@corva/ui 3.71.0-9 → 3.72.0-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.
- package/cjs-bundle/components/AddComment/Popover.js +1 -1
- package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
- package/cjs-bundle/components/AttachFileButton/AttachFileButton.js +1 -1
- package/cjs-bundle/components/AttachFileButton/AttachFileButton.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/SortableAttachments.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/SortableAttachments.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/StoredAttachmentPreview.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/StoredAttachmentPreview.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -0
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentCardReplies.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCardReplies.js.map +1 -1
- package/cjs-bundle/components/CommentCard/buildCommentReply.js +1 -1
- package/cjs-bundle/components/CommentCard/buildCommentReply.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/CommentReplyInput.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentReplyInput.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
- package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.js +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.js.map +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.scss.js +1 -1
- package/cjs-bundle/components/CommentInputNext/useFileDrop.js +2 -0
- package/cjs-bundle/components/CommentInputNext/useFileDrop.js.map +1 -0
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/cjs-bundle/components/FeedCard/useActivityInteractions.js +1 -1
- package/cjs-bundle/components/FeedCard/useActivityInteractions.js.map +1 -1
- package/cjs-bundle/components/FeedCard/useFeedActivity.js +1 -1
- package/cjs-bundle/components/FeedCard/useFeedActivity.js.map +1 -1
- package/cjs-bundle/components/IconMenu/index.js +1 -1
- package/cjs-bundle/components/IconMenu/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/cjs-bundle/components/index.js +1 -1
- package/cjs-bundle/componentsV2/AppContainer/AppContainer.scss.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.scss.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.scss.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/AutocompleteMenuItem.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/AutocompleteMenuItem.js.map +1 -1
- package/cjs-bundle/componentsV2/Checkbox/Checkbox.js +1 -1
- package/cjs-bundle/componentsV2/Checkbox/Checkbox.js.map +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/ColorPicker.scss.js +1 -1
- package/cjs-bundle/componentsV2/Menu/Menu.scss.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuDivider/MenuDivider.scss.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.js.map +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.scss.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.js.map +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.scss.js +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.scss.js +1 -1
- package/cjs-bundle/componentsV2/Paper/Paper.js +1 -1
- package/cjs-bundle/componentsV2/Paper/Paper.js.map +1 -1
- package/cjs-bundle/componentsV2/Paper/Paper.scss.js +1 -1
- package/cjs-bundle/componentsV2/Popover/Popover.js +1 -1
- package/cjs-bundle/componentsV2/Popover/Popover.js.map +1 -1
- package/cjs-bundle/componentsV2/Radio/Radio.js +1 -1
- package/cjs-bundle/componentsV2/Radio/Radio.js.map +1 -1
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js +2 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js.map +1 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js +2 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js.map +1 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.js +2 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.js.map +1 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js +2 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js.map +1 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxLabel/RadioAndCheckboxLabel.scss.js +1 -1
- package/cjs-bundle/componentsV2/Tabs/Tabs.js +1 -1
- package/cjs-bundle/componentsV2/Tabs/Tabs.js.map +1 -1
- package/cjs-bundle/componentsV2/Tabs/Tabs.scss.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.scss.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/TemplatesTreeMenuHeader/TemplatesTreeMenuHeader.scss.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.scss.js +1 -1
- package/cjs-bundle/config/theme/checkboxOverrides.js +1 -1
- package/cjs-bundle/config/theme/checkboxOverrides.js.map +1 -1
- package/cjs-bundle/config/theme/index.js +1 -1
- package/cjs-bundle/config/theme/index.js.map +1 -1
- package/cjs-bundle/config/theme/radioOverrides.js +1 -1
- package/cjs-bundle/config/theme/radioOverrides.js.map +1 -1
- package/cjs-bundle/constants/attachments.js +2 -0
- package/cjs-bundle/constants/attachments.js.map +1 -0
- package/cjs-bundle/constants/index.js +1 -1
- package/components/AddComment/Popover.js +1 -1
- package/components/AddComment/Popover.js.map +1 -1
- package/components/AddComment/components/Content.js +1 -1
- package/components/AddComment/components/Content.js.map +1 -1
- package/components/AttachFileButton/AttachFileButton.d.ts +2 -1
- package/components/AttachFileButton/AttachFileButton.d.ts.map +1 -1
- package/components/AttachFileButton/AttachFileButton.js +1 -1
- package/components/AttachFileButton/AttachFileButton.js.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.d.ts +4 -0
- package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts +2 -0
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentRow.d.ts +5 -0
- package/components/AttachmentPreview/AttachmentRow.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentRow.js +2 -0
- package/components/AttachmentPreview/AttachmentRow.js.map +1 -0
- package/components/AttachmentPreview/AttachmentTile.d.ts +9 -0
- package/components/AttachmentPreview/AttachmentTile.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentTile.js +2 -0
- package/components/AttachmentPreview/AttachmentTile.js.map +1 -0
- package/components/AttachmentPreview/SortableAttachments.d.ts +8 -0
- package/components/AttachmentPreview/SortableAttachments.d.ts.map +1 -0
- package/components/AttachmentPreview/SortableAttachments.js +2 -0
- package/components/AttachmentPreview/SortableAttachments.js.map +1 -0
- package/components/AttachmentPreview/StoredAttachmentPreview.d.ts +3 -3
- package/components/AttachmentPreview/StoredAttachmentPreview.d.ts.map +1 -1
- package/components/AttachmentPreview/StoredAttachmentPreview.js +1 -1
- package/components/AttachmentPreview/StoredAttachmentPreview.js.map +1 -1
- package/components/AttachmentPreview/index.d.ts +3 -0
- package/components/AttachmentPreview/index.d.ts.map +1 -1
- package/components/AttachmentPreview/useStoredAttachments.d.ts +8 -0
- package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -0
- package/components/AttachmentPreview/useStoredAttachments.js +2 -0
- package/components/AttachmentPreview/useStoredAttachments.js.map +1 -0
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/components/CommentCard/CommentCard.d.ts.map +1 -1
- package/components/CommentCard/CommentCard.js +1 -1
- package/components/CommentCard/CommentCard.js.map +1 -1
- package/components/CommentCard/CommentCard.types.d.ts +5 -1
- package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
- package/components/CommentCard/CommentCardReplies.js +1 -1
- package/components/CommentCard/CommentCardReplies.js.map +1 -1
- package/components/CommentCard/__tests__/buildCommentReply.test.d.ts +2 -0
- package/components/CommentCard/__tests__/buildCommentReply.test.d.ts.map +1 -0
- package/components/CommentCard/buildCommentReply.d.ts +15 -7
- package/components/CommentCard/buildCommentReply.d.ts.map +1 -1
- package/components/CommentCard/buildCommentReply.js +1 -1
- package/components/CommentCard/buildCommentReply.js.map +1 -1
- package/components/CommentComposer/CommentComposer.d.ts +8 -3
- package/components/CommentComposer/CommentComposer.d.ts.map +1 -1
- package/components/CommentComposer/CommentComposer.js +1 -1
- package/components/CommentComposer/CommentComposer.js.map +1 -1
- package/components/CommentComposer/CommentReplyInput.d.ts +6 -2
- package/components/CommentComposer/CommentReplyInput.d.ts.map +1 -1
- package/components/CommentComposer/CommentReplyInput.js +1 -1
- package/components/CommentComposer/CommentReplyInput.js.map +1 -1
- package/components/CommentComposer/useAttachmentUpload.d.ts +15 -6
- package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
- package/components/CommentComposer/useAttachmentUpload.js +1 -1
- package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
- package/components/CommentInputNext/CommentInputNext.d.ts +6 -0
- package/components/CommentInputNext/CommentInputNext.d.ts.map +1 -1
- package/components/CommentInputNext/CommentInputNext.js +1 -1
- package/components/CommentInputNext/CommentInputNext.js.map +1 -1
- package/components/CommentInputNext/CommentInputNext.scss.js +1 -1
- package/components/CommentInputNext/useFileDrop.d.ts +17 -0
- package/components/CommentInputNext/useFileDrop.d.ts.map +1 -0
- package/components/CommentInputNext/useFileDrop.js +2 -0
- package/components/CommentInputNext/useFileDrop.js.map +1 -0
- package/components/DocumentViewer/DocumentViewer.js +1 -1
- package/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/components/FeedCard/useActivityInteractions.d.ts +9 -2
- package/components/FeedCard/useActivityInteractions.d.ts.map +1 -1
- package/components/FeedCard/useActivityInteractions.js +1 -1
- package/components/FeedCard/useActivityInteractions.js.map +1 -1
- package/components/FeedCard/useFeedActivity.d.ts.map +1 -1
- package/components/FeedCard/useFeedActivity.js +1 -1
- package/components/FeedCard/useFeedActivity.js.map +1 -1
- package/components/IconMenu/index.d.ts +1 -1
- package/components/IconMenu/index.js +1 -1
- package/components/IconMenu/index.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.map +1 -1
- package/components/index.js +1 -1
- package/componentsV2/AppContainer/AppContainer.scss.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.scss.js +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js +1 -1
- package/componentsV2/Autocomplete/Autocomplete.d.ts +5 -1
- package/componentsV2/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/componentsV2/Autocomplete/Autocomplete.js +1 -1
- package/componentsV2/Autocomplete/Autocomplete.js.map +1 -1
- package/componentsV2/Autocomplete/Autocomplete.scss.js +1 -1
- package/componentsV2/Autocomplete/AutocompleteMenuItem.d.ts +7 -3
- package/componentsV2/Autocomplete/AutocompleteMenuItem.d.ts.map +1 -1
- package/componentsV2/Autocomplete/AutocompleteMenuItem.js +1 -1
- package/componentsV2/Autocomplete/AutocompleteMenuItem.js.map +1 -1
- package/componentsV2/Autocomplete/AutocompleteNext.stories.d.ts.map +1 -1
- package/componentsV2/Checkbox/Checkbox.d.ts.map +1 -1
- package/componentsV2/Checkbox/Checkbox.js +1 -1
- package/componentsV2/Checkbox/Checkbox.js.map +1 -1
- package/componentsV2/ColorPicker/ColorPicker.scss.js +1 -1
- package/componentsV2/Menu/Menu.scss.js +1 -1
- package/componentsV2/Menu/Menu.stories.d.ts +1 -0
- package/componentsV2/Menu/Menu.stories.d.ts.map +1 -1
- package/componentsV2/Menu/MenuDivider/MenuDivider.scss.js +1 -1
- package/componentsV2/Menu/MenuGroup/MenuGroup.js +1 -1
- package/componentsV2/Menu/MenuGroup/MenuGroup.js.map +1 -1
- package/componentsV2/Menu/MenuGroup/MenuGroup.scss.js +1 -1
- package/componentsV2/Menu/MenuItem/MenuItem.d.ts +2 -0
- package/componentsV2/Menu/MenuItem/MenuItem.d.ts.map +1 -1
- package/componentsV2/Menu/MenuItem/MenuItem.js +1 -1
- package/componentsV2/Menu/MenuItem/MenuItem.js.map +1 -1
- package/componentsV2/Menu/MenuItem/MenuItem.scss.js +1 -1
- package/componentsV2/PadModeSelect/PadModeSelect.scss.js +1 -1
- package/componentsV2/Paper/Paper.d.ts.map +1 -1
- package/componentsV2/Paper/Paper.js +1 -1
- package/componentsV2/Paper/Paper.js.map +1 -1
- package/componentsV2/Paper/Paper.scss.js +1 -1
- package/componentsV2/Popover/Popover.d.ts.map +1 -1
- package/componentsV2/Popover/Popover.js +1 -1
- package/componentsV2/Popover/Popover.js.map +1 -1
- package/componentsV2/Radio/Radio.d.ts.map +1 -1
- package/componentsV2/Radio/Radio.js +1 -1
- package/componentsV2/Radio/Radio.js.map +1 -1
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.d.ts +5 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.d.ts.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js +2 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js +2 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.d.ts +2 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.d.ts.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.js +2 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.js.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js +2 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/index.d.ts +3 -0
- package/componentsV2/RadioAndCheckboxIcons/index.d.ts.map +1 -0
- package/componentsV2/RadioAndCheckboxLabel/RadioAndCheckboxLabel.scss.js +1 -1
- package/componentsV2/Tabs/Tabs.d.ts +1 -0
- package/componentsV2/Tabs/Tabs.d.ts.map +1 -1
- package/componentsV2/Tabs/Tabs.js +1 -1
- package/componentsV2/Tabs/Tabs.js.map +1 -1
- package/componentsV2/Tabs/Tabs.scss.js +1 -1
- package/componentsV2/Tabs/Tabs.stories.d.ts +1 -1
- package/componentsV2/Tabs/Tabs.stories.d.ts.map +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.d.ts.map +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.scss.js +1 -1
- package/componentsV2/TemplatesControl/TemplatesTreeMenuHeader/TemplatesTreeMenuHeader.scss.js +1 -1
- package/componentsV2/TemplatesControl/Toggle/Toggle.scss.js +1 -1
- package/config/theme/checkboxOverrides.d.ts +0 -9
- package/config/theme/checkboxOverrides.d.ts.map +1 -1
- package/config/theme/checkboxOverrides.js +1 -1
- package/config/theme/checkboxOverrides.js.map +1 -1
- package/config/theme/index.d.ts.map +1 -1
- package/config/theme/index.js +1 -1
- package/config/theme/index.js.map +1 -1
- package/config/theme/radioOverrides.d.ts +3 -15
- package/config/theme/radioOverrides.d.ts.map +1 -1
- package/config/theme/radioOverrides.js +1 -1
- package/config/theme/radioOverrides.js.map +1 -1
- package/constants/attachments.d.ts +2 -0
- package/constants/attachments.d.ts.map +1 -0
- package/constants/attachments.js +2 -0
- package/constants/attachments.js.map +1 -0
- package/constants/index.d.ts +2 -1
- package/constants/index.d.ts.map +1 -1
- package/constants/index.js +1 -1
- package/mcp-server/server.mjs +79 -11
- package/package.json +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js +0 -2
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js.map +0 -1
- package/components/AttachmentPreview/useStoredAttachment.js +0 -2
- package/components/AttachmentPreview/useStoredAttachment.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationPopup.js","sources":["../../../../../../../src/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { Button, withStyles, makeStyles } from '@material-ui/core';\n\nimport { isMobileDetected } from '~/utils/mobileDetect';\nimport { Modal, Typography } from '~/components';\n\nconst StyledButton = withStyles({ root: { height: '36px' } })(Button);\nconst ClearAllButton = withStyles({ root: { margin: '0 16px 0 auto' } })(StyledButton);\nconst StyledText = withStyles({ root: { color: '#bdbdbd' } })(Typography.Regular16);\n\nexport const useStyles = makeStyles(theme => ({\n paper: {\n minWidth: ({ isMobile }) => (isMobile ? 0 : '416px'),\n minHeight: ({ isMobile }) => isMobile && '240px !important',\n maxWidth: ({ isMobile }) => isMobile && 'calc(100% - 24px)',\n },\n content: {\n width: ({ isMobile }) => (isMobile ? 'auto' : '300px'),\n color: theme.palette.primary.text6,\n },\n}));\n\nexport const ConfirmationPopup = ({ title, text, okText, handleClose, handleOk }) => {\n const styles = useStyles({ isMobile: isMobileDetected });\n\n return (\n <Modal\n open\n onClose={handleClose}\n title={title}\n isMobile={false}\n actions={\n <>\n <ClearAllButton color=\"primary\" onClick={handleClose}>\n Cancel\n </ClearAllButton>\n\n <StyledButton variant=\"contained\" color=\"primary\" onClick={handleOk}>\n {okText || 'OK'}\n </StyledButton>\n </>\n }\n contentContainerClassName={styles.paper}\n >\n <div className={styles.content}>\n <StyledText>{text}</StyledText>\n </div>\n </Modal>\n );\n};\n\nConfirmationPopup.propTypes = {\n title: PropTypes.string.isRequired,\n okText: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n handleClose: PropTypes.func.isRequired,\n handleOk: PropTypes.func.isRequired,\n};\n"],"names":["StyledButton","withStyles","root","height","Button","ClearAllButton","margin","StyledText","color","Typography","Regular16","useStyles","makeStyles","theme","paper","minWidth","_ref","isMobile","minHeight","_ref2","maxWidth","_ref3","content","width","_ref4","palette","primary","text6","ConfirmationPopup","_ref5","title","text","okText","handleClose","handleOk","styles","isMobileDetected","_jsx","Modal","open","onClose","actions","_jsxs","jsxs","_Fragment","children","onClick","variant","contentContainerClassName","jsx","className","propTypes","PropTypes","string","isRequired","func"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfirmationPopup.js","sources":["../../../../../../../src/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { Button, withStyles, makeStyles } from '@material-ui/core';\n\nimport { isMobileDetected } from '~/utils/mobileDetect';\nimport { Modal, Typography } from '~/components';\n\nconst StyledButton = withStyles({ root: { height: '36px' } })(Button);\nconst ClearAllButton = withStyles({ root: { margin: '0 16px 0 auto' } })(StyledButton);\nconst StyledText = withStyles({ root: { color: '#bdbdbd' } })(Typography.Regular16);\n\nexport const useStyles = makeStyles(theme => ({\n paper: {\n minWidth: ({ isMobile }) => (isMobile ? 0 : '416px'),\n minHeight: ({ isMobile }) => isMobile && '240px !important',\n maxWidth: ({ isMobile }) => isMobile && 'calc(100% - 24px)',\n },\n content: {\n width: ({ isMobile }) => (isMobile ? 'auto' : '300px'),\n color: theme.palette.primary.text6,\n },\n}));\n\nexport const ConfirmationPopup = ({ title, text, okText, handleClose, handleOk }) => {\n const styles = useStyles({ isMobile: isMobileDetected });\n\n return (\n <Modal\n open\n onClose={handleClose}\n title={title}\n isMobile={false}\n actions={\n <>\n <ClearAllButton color=\"primary\" onClick={handleClose}>\n Cancel\n </ClearAllButton>\n\n <StyledButton variant=\"contained\" color=\"primary\" onClick={handleOk}>\n {okText || 'OK'}\n </StyledButton>\n </>\n }\n contentContainerClassName={styles.paper}\n >\n <div className={styles.content}>\n <StyledText>{text}</StyledText>\n </div>\n </Modal>\n );\n};\n\nConfirmationPopup.propTypes = {\n title: PropTypes.string.isRequired,\n okText: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n handleClose: PropTypes.func.isRequired,\n handleOk: PropTypes.func.isRequired,\n};\n"],"names":["StyledButton","withStyles","root","height","Button","ClearAllButton","margin","StyledText","color","Typography","Regular16","useStyles","makeStyles","theme","paper","minWidth","_ref","isMobile","minHeight","_ref2","maxWidth","_ref3","content","width","_ref4","palette","primary","text6","ConfirmationPopup","_ref5","title","text","okText","handleClose","handleOk","styles","isMobileDetected","_jsx","Modal","open","onClose","actions","_jsxs","jsxs","_Fragment","children","onClick","variant","contentContainerClassName","jsx","className","propTypes","PropTypes","string","isRequired","func"],"mappings":"ktgCAMMA,EAAeC,EAAAA,WAAW,CAAEC,KAAM,CAAEC,OAAQ,SAA7BF,CAAyCG,EAAMA,QAC9DC,EAAiBJ,EAAAA,WAAW,CAAEC,KAAM,CAAEI,OAAQ,kBAA7BL,CAAkDD,GACnEO,EAAaN,EAAAA,WAAW,CAAEC,KAAM,CAAEM,MAA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
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/toConsumableArray"),r=require("@babel/runtime/helpers/slicedToArray"),u=require("@babel/runtime/regenerator"),i=require("react"),l=require("moment-timezone"),a=require("../CommentCard/buildCommentReply.js"),o=require("../../clients/jsonApi/index.js"),c=require("../../utils/notificationToasts.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=s(e),d=s(t),p=s(n),m=s(r),v=s(u),h=s(l);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){d.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}exports.useActivityInteractions=function(e){var t,n,r,u=e.activity,l=e.currentUser,s=e.onChanged,b=e.loadingState,y=i.useRef(s);y.current=s;var S=i.useCallback((function(){var e;return null===(e=y.current)||void 0===e?void 0:e.call(y)}),[]),w=i.useState(!1),k=m.default(w,2),x=k[0],O=k[1],j=b?b.isLoading:x,C=b?b.setIsLoading:O,R=i.useState(!1),E=m.default(R,2),q=E[0],P=E[1],F=i.useState(null),M=m.default(F,2),A=M[0],I=M[1],N=i.useState(3),L=m.default(N,2),_=L[0],z=L[1],D=i.useState([]),T=m.default(D,2),U=T[0],G=T[1],B=i.useState({}),H=m.default(B,2),J=H[0],K=H[1],Q=i.useRef(U);Q.current=U;var V=i.useState([]),W=m.default(V,2),X=W[0],Y=W[1],Z=i.useState(null),$=m.default(Z,2),ee=$[0],te=$[1],ne=i.useMemo((function(){var e;return null!==(e=null==u?void 0:u.comments)&&void 0!==e?e:[]}),[null==u?void 0:u.comments]),re=i.useMemo((function(){var e=new Set(ne.map((function(e){return String(e.id)}))),t=[].concat(p.default(ne.map((function(e){return g(g({},e),J[String(e.id)])}))),p.default(U.filter((function(t){return!e.has(String(t.id))}))));return X.length?t.filter((function(e){return!X.some((function(t){return String(t)===String(e.id)}))})):t}),[ne,U,J,X]);i.useEffect((function(){if(U.length){var e=new Set(ne.map((function(e){return String(e.id)}))),t=U.filter((function(t){return!e.has(String(t.id))}));t.length!==U.length&&G(t)}}),[ne,U]),i.useEffect((function(){if(X.length){var e=new Set(ne.map((function(e){return String(e.id)}))),t=X.filter((function(t){return e.has(String(t))}));t.length!==X.length&&Y(t)}}),[ne,X]);var ue=(null!==(t=null==u?void 0:u.likes)&&void 0!==t?t:[]).some((function(e){var t;return Number(null===(t=e.user)||void 0===t?void 0:t.id)===Number(null==l?void 0:l.id)})),ie=null!=ee?ee:ue,le=null!==(n=null==u?void 0:u.likes_count)&&void 0!==n?n:0,ae=null===ee||ee===ue?le:Math.max(0,le+(ee?1:-1));i.useEffect((function(){null!==ee&&ee===ue&&te(null)}),[ue,ee]);var oe=function(){var e=f.default(v.default.mark((function e(){return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(null==u?void 0:u.id)){e.next=2;break}return e.abrupt("return");case 2:return te(!ie),C(!0),e.prev=5,e.next=8,o.toggleFeedItemLike(u.id);case 8:S(),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),te(null),c.showErrorNotification("Failed to update the like");case 15:return e.prev=15,C(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[5,11,15,18]])})));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=f.default(v.default.mark((function e(t){var n,r,i,l,a=arguments;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]?a[1]:[],null!=(null==u?void 0:u.id)){e.next=3;break}return e.abrupt("return",!1);case 3:return C(!0),e.prev=4,r=n.map((function(e){return{url:e.url,size:e.size,file_name:e.name}})),i=g({body:t},r.length?{attachments:r,attachment:r[0]}:{}),e.next=9,o.postFeedItemComment(u.id,{comment:i});case 9:return null!=(l=e.sent)&&l.id&&G((function(e){return[].concat(p.default(e),[l])})),S(),e.abrupt("return",!0);case 15:return e.prev=15,e.t0=e.catch(4),c.showErrorNotification("Failed to post the reply"),e.abrupt("return",!1);case 19:return e.prev=19,C(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[4,15,19,22]])})));return function(t){return e.apply(this,arguments)}}(),se=i.useCallback(function(){var e=f.default(v.default.mark((function e(t,n,r){var i,l,a;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(null==u?void 0:u.id)){e.next=2;break}return e.abrupt("return",!1);case 2:return C(!0),e.prev=3,l=r.map((function(e){return{url:e.url,size:e.size,file_name:e.name}})),a={body:n,attachments:l,attachment:null!==(i=l[0])&&void 0!==i?i:null},e.next=8,o.patchFeedItemComment(u.id,t,{comment:a});case 8:return K((function(e){var r;return g(g({},e),{},d.default({},String(t),{body:n,attachments:l,attachment:null!==(r=l[0])&&void 0!==r?r:null}))})),I(null),S(),e.abrupt("return",!0);case 14:return e.prev=14,e.t0=e.catch(3),c.showErrorNotification("Failed to update the reply"),e.abrupt("return",!1);case 18:return e.prev=18,C(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[3,14,18,21]])})));return function(t,n,r){return e.apply(this,arguments)}}(),[null==u?void 0:u.id,S,C]),fe=i.useCallback(function(){var e=f.default(v.default.mark((function e(t){var n;return v.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(null==u?void 0:u.id)){e.next=2;break}return e.abrupt("return");case 2:return C(!0),n=Q.current.find((function(e){return String(e.id)===String(t)})),G((function(e){return e.filter((function(e){return String(e.id)!==String(t)}))})),Y((function(e){return[].concat(p.default(e),[t])})),e.prev=6,e.next=9,o.deleteFeedItemComment(u.id,t);case 9:S(),c.showSuccessNotification("Reply was deleted"),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(6),Y((function(e){return e.filter((function(e){return String(e)!==String(t)}))})),n&&G((function(e){return[].concat(p.default(e),[n])})),c.showErrorNotification("Failed to delete the reply");case 18:return e.prev=18,C(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[6,13,18,21]])})));return function(t){return e.apply(this,arguments)}}(),[null==u?void 0:u.id,S,C]),de=i.useMemo((function(){return re.length?re.map((function(e){return{reply:e,sortAt:h.default(e.created_at).unix()}})).sort((function(e,t){return t.sortAt-e.sortAt})).slice(0,_).map((function(e){var t=e.reply;return a.buildCommentReply(t,{currentUserId:null==l?void 0:l.id,onDelete:fe,onEdit:I})})):[]}),[re,_,fe,null==l?void 0:l.id]);return{isLoading:j,isLiked:ie,likesCount:ae,commentsCount:re.length,isReplyOpen:q,toggleReplyOpen:function(){return P((function(e){return!e}))},replies:de,editingReply:null!==(r=re.find((function(e){return String(e.id)===String(A)})))&&void 0!==r?r:null,cancelReplyEdit:function(){return I(null)},hasMoreReplies:re.length>_,moreRepliesCount:Math.max(0,re.length-_),showMoreReplies:function(){return z((function(e){return e+10}))},toggleLike:oe,postReply:ce,updateReply:se}};
|
|
2
2
|
//# sourceMappingURL=useActivityInteractions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActivityInteractions.js","sources":["../../../../src/components/FeedCard/useActivityInteractions.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport moment from 'moment-timezone';\n\nimport type { ActivityReply } from '../CommentCard/buildCommentReply';\nimport { buildCommentReply } from '../CommentCard/buildCommentReply';\nimport type { CommentReply } from '../CommentCard/CommentCard.types';\n\nimport { deleteFeedItemComment, postFeedItemComment, toggleFeedItemLike } from '~/clients/jsonApi';\nimport { showErrorNotification, showSuccessNotification } from '~/utils/notificationToasts';\n\nconst INITIAL_VISIBLE_REPLIES = 3;\nconst MORE_REPLIES_INCREMENT = 10;\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case activity payload. */\nexport type InteractionActivity = {\n id?: string | number;\n likes_count?: number;\n likes?: { user?: { id?: string | number } }[];\n comments?: ActivityReply[];\n};\n/* eslint-enable camelcase */\n\nexport type UseActivityInteractionsOptions = {\n activity: InteractionActivity;\n currentUser: { id?: string | number };\n onChanged?: () => void;\n loadingState?: { isLoading: boolean; setIsLoading: (isLoading: boolean) => void };\n};\n\nexport type UseActivityInteractionsResult = {\n isLoading: boolean;\n isLiked: boolean;\n likesCount: number;\n commentsCount: number;\n isReplyOpen: boolean;\n toggleReplyOpen: () => void;\n replies: CommentReply[];\n hasMoreReplies: boolean;\n moreRepliesCount: number;\n showMoreReplies: () => void;\n toggleLike: () => Promise<void>;\n /** Resolves `false` when the post failed, so the composer can keep the draft. */\n postReply: (\n body: string,\n attachment?: { url: string; name: string; size?: number } | null\n ) => Promise<boolean>;\n};\n\n// Optimistic like / reply / reply-delete, reconciled once the host's refetch lands.\nexport const useActivityInteractions = ({\n activity,\n currentUser,\n onChanged,\n loadingState,\n}: UseActivityInteractionsOptions): UseActivityInteractionsResult => {\n // Read through a ref so an inline callback doesn't invalidate the memoized replies.\n const onChangedRef = useRef(onChanged);\n onChangedRef.current = onChanged;\n const notifyChanged = useCallback(() => onChangedRef.current?.(), []);\n\n const [localIsLoading, setLocalIsLoading] = useState(false);\n const isLoading = loadingState ? loadingState.isLoading : localIsLoading;\n const setIsLoading = loadingState ? loadingState.setIsLoading : setLocalIsLoading;\n\n const [isReplyOpen, setIsReplyOpen] = useState(false);\n const [visibleReplies, setVisibleReplies] = useState(INITIAL_VISIBLE_REPLIES);\n const [optimisticReplies, setOptimisticReplies] = useState<ActivityReply[]>([]);\n // Read through a ref so deleting a reply doesn't have to re-create its memoized handler.\n const optimisticRepliesRef = useRef(optimisticReplies);\n optimisticRepliesRef.current = optimisticReplies;\n const [deletedReplyIds, setDeletedReplyIds] = useState<(string | number)[]>([]);\n const [optimisticLiked, setOptimisticLiked] = useState<boolean | null>(null);\n\n const serverReplies = useMemo(() => activity?.comments ?? [], [activity?.comments]);\n const replies = useMemo(() => {\n // Ids arrive as string or number, so compare them as strings.\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const merged = optimisticReplies.length\n ? [...serverReplies, ...optimisticReplies.filter(reply => !serverIds.has(String(reply.id)))]\n : serverReplies;\n\n if (!deletedReplyIds.length) return merged;\n\n return merged.filter(reply => !deletedReplyIds.some(id => String(id) === String(reply.id)));\n }, [serverReplies, optimisticReplies, deletedReplyIds]);\n\n useEffect(() => {\n if (!optimisticReplies.length) return;\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const stillPending = optimisticReplies.filter(reply => !serverIds.has(String(reply.id)));\n if (stillPending.length !== optimisticReplies.length) setOptimisticReplies(stillPending);\n }, [serverReplies, optimisticReplies]);\n\n // Drop a deleted id once the refetch has removed it server-side.\n useEffect(() => {\n if (!deletedReplyIds.length) return;\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const stillPresent = deletedReplyIds.filter(id => serverIds.has(String(id)));\n if (stillPresent.length !== deletedReplyIds.length) setDeletedReplyIds(stillPresent);\n }, [serverReplies, deletedReplyIds]);\n\n const serverLiked = (activity?.likes ?? []).some(\n like => Number(like.user?.id) === Number(currentUser?.id)\n );\n const isLiked = optimisticLiked ?? serverLiked;\n const serverLikesCount = activity?.likes_count ?? 0;\n // Clamp: a stale likes array (count 0 while already liked) would render < 0.\n const likesCount =\n optimisticLiked === null || optimisticLiked === serverLiked\n ? serverLikesCount\n : Math.max(0, serverLikesCount + (optimisticLiked ? 1 : -1));\n\n useEffect(() => {\n if (optimisticLiked !== null && optimisticLiked === serverLiked) setOptimisticLiked(null);\n }, [serverLiked, optimisticLiked]);\n\n const toggleLike = async () => {\n if (activity?.id == null) return;\n const next = !isLiked;\n setOptimisticLiked(next);\n setIsLoading(true);\n try {\n await toggleFeedItemLike(activity.id);\n notifyChanged();\n } catch (err) {\n setOptimisticLiked(null);\n showErrorNotification('Failed to update the like');\n } finally {\n setIsLoading(false);\n }\n };\n\n const postReply = async (\n body: string,\n attachment?: { url: string; name: string; size?: number } | null\n ) => {\n if (activity?.id == null) return false;\n setIsLoading(true);\n try {\n const comment = {\n body,\n ...(attachment\n ? {\n attachment: {\n url: attachment.url,\n size: attachment.size,\n file_name: attachment.name,\n },\n }\n : {}),\n };\n const created = await postFeedItemComment(activity.id, { comment });\n if (created?.id) setOptimisticReplies(prev => [...prev, created]);\n notifyChanged();\n\n return true;\n } catch (err) {\n showErrorNotification('Failed to post the reply');\n\n return false;\n } finally {\n setIsLoading(false);\n }\n };\n\n const deleteReply = useCallback(\n async (replyId: string | number) => {\n if (activity?.id == null) return;\n setIsLoading(true);\n // A reply posted in this session is not in the server list yet, so hiding it by id alone\n // would be undone by the reconciliation above: drop the local copy as well.\n const pendingCopy = optimisticRepliesRef.current.find(\n reply => String(reply.id) === String(replyId)\n );\n setOptimisticReplies(prev => prev.filter(reply => String(reply.id) !== String(replyId)));\n setDeletedReplyIds(prev => [...prev, replyId]); // hide immediately; the refetch drops it a moment later\n try {\n await deleteFeedItemComment(activity.id, replyId);\n notifyChanged();\n showSuccessNotification('Reply was deleted');\n } catch (err) {\n setDeletedReplyIds(prev => prev.filter(id => String(id) !== String(replyId)));\n if (pendingCopy) setOptimisticReplies(prev => [...prev, pendingCopy]);\n showErrorNotification('Failed to delete the reply');\n } finally {\n setIsLoading(false);\n }\n },\n [activity?.id, notifyChanged, setIsLoading]\n );\n\n const mappedReplies = useMemo<CommentReply[]>(() => {\n if (!replies.length) return [];\n\n return replies\n .map(reply => ({ reply, sortAt: moment(reply.created_at).unix() }))\n .sort((a, b) => b.sortAt - a.sortAt)\n .slice(0, visibleReplies)\n .map(({ reply }) =>\n buildCommentReply(reply, { currentUserId: currentUser?.id, onDelete: deleteReply })\n );\n }, [replies, visibleReplies, deleteReply, currentUser?.id]);\n\n return {\n isLoading,\n isLiked,\n likesCount,\n commentsCount: replies.length,\n isReplyOpen,\n toggleReplyOpen: () => setIsReplyOpen(open => !open),\n replies: mappedReplies,\n hasMoreReplies: replies.length > visibleReplies,\n moreRepliesCount: Math.max(0, replies.length - visibleReplies),\n showMoreReplies: () => setVisibleReplies(prev => prev + MORE_REPLIES_INCREMENT),\n toggleLike,\n postReply,\n };\n};\n"],"names":["_ref","_activity$likes","_activity$likes_count","activity","currentUser","onChanged","loadingState","onChangedRef","useRef","current","notifyChanged","useCallback","_onChangedRef$current","call","useState","_useState2","_slicedToArray","_useState","localIsLoading","setLocalIsLoading","isLoading","setIsLoading","_useState4","_useState3","isReplyOpen","setIsReplyOpen","_useState6","_useState5","visibleReplies","setVisibleReplies","_useState8","_useState7","optimisticReplies","setOptimisticReplies","optimisticRepliesRef","_useState10","_useState9","deletedReplyIds","setDeletedReplyIds","_useState12","_useState11","optimisticLiked","setOptimisticLiked","serverReplies","useMemo","_activity$comments","comments","replies","serverIds","Set","map","reply","String","id","merged","length","concat","_toConsumableArray","filter","has","some","useEffect","stillPending","stillPresent","serverLiked","likes","like","_like$user","Number","user","isLiked","serverLikesCount","likes_count","likesCount","Math","max","toggleLike","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","abrupt","toggleFeedItemLike","t0","showErrorNotification","finish","stop","apply","this","arguments","postReply","_ref3","_callee2","body","attachment","comment","created","_context2","_objectSpread","url","size","file_name","name","postFeedItemComment","sent","_x","_x2","deleteReply","_ref4","replyId","pendingCopy","_context3","find","deleteFeedItemComment","showSuccessNotification","_callee3","_x3","mappedReplies","sortAt","moment","created_at","unix","sort","a","b","slice","_ref5","buildCommentReply","currentUserId","onDelete","commentsCount","toggleReplyOpen","open","hasMoreReplies","moreRepliesCount","showMoreReplies"],"mappings":"ytCAiDuC,SAK8BA,GAAA,IAAAC,EAAAC,EAJnEC,IAAAA,SACAC,IAAAA,YACAC,IAAAA,UACAC,IAAAA,aAGMC,EAAeC,SAAOH,GAC5BE,EAA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AEL,UAC5BO,MAAM,EAAGtG,GACTsB,KAAI,SAAAiF,GAAA,IAAGhF,IAAAA,MAAK,OACXiF,EAAAA,kBAAkBjF,EAAO,CAAEkF,cAAejI,aAAAA,EAAAA,EAAaiD,GAAIiF,SAAUtB,QAP7C,EAS7B,GAAE,CAACjE,EAASnB,EAAgBoF,GAAa5G,aAAAA,EAAAA,EAAaiD,KAEvD,MAAO,CACLjC,UAAAA,EACAkD,QAAAA,EACAG,WAAAA,EACA8D,cAAexF,EAAQQ,OACvB/B,YAAAA,EACAgH,gBAAiB,WAAA,OAAM/G,GAAe,SAAAgH,GAAI,OAAKA,IAAK,EACpD1F,QAAS2E,GACTgB,eAAgB3F,EAAQQ,OAAS3B,EACjC+G,iBAAkBjE,KAAKC,IAAI,EAAG5B,EAAQQ,OAAS3B,GAC/CgH,gBAAiB,WAAA,OAAM/G,GAAkB,SAAAuD,GAAI,OAAIA,EA1MtB,KA0MoD,EAC/ER,WAAAA,EACAmB,UAAAA,EAEJ"}
|
|
1
|
+
{"version":3,"file":"useActivityInteractions.js","sources":["../../../../src/components/FeedCard/useActivityInteractions.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport moment from 'moment-timezone';\n\nimport type { ActivityReply } from '../CommentCard/buildCommentReply';\nimport { buildCommentReply } from '../CommentCard/buildCommentReply';\nimport type { CommentReply } from '../CommentCard/CommentCard.types';\n\nimport {\n deleteFeedItemComment,\n patchFeedItemComment,\n postFeedItemComment,\n toggleFeedItemLike,\n} from '~/clients/jsonApi';\nimport { showErrorNotification, showSuccessNotification } from '~/utils/notificationToasts';\n\nconst INITIAL_VISIBLE_REPLIES = 3;\nconst MORE_REPLIES_INCREMENT = 10;\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case activity payload. */\nexport type InteractionActivity = {\n id?: string | number;\n likes_count?: number;\n likes?: { user?: { id?: string | number } }[];\n comments?: ActivityReply[];\n};\n/* eslint-enable camelcase */\n\nexport type UseActivityInteractionsOptions = {\n activity: InteractionActivity;\n currentUser: { id?: string | number };\n onChanged?: () => void;\n loadingState?: { isLoading: boolean; setIsLoading: (isLoading: boolean) => void };\n};\n\nexport type UseActivityInteractionsResult = {\n isLoading: boolean;\n isLiked: boolean;\n likesCount: number;\n commentsCount: number;\n isReplyOpen: boolean;\n toggleReplyOpen: () => void;\n replies: CommentReply[];\n editingReply: ActivityReply | null;\n cancelReplyEdit: () => void;\n updateReply: (\n replyId: string | number,\n body: string,\n attachments: { url: string; name: string; size?: number }[]\n ) => Promise<boolean>;\n hasMoreReplies: boolean;\n moreRepliesCount: number;\n showMoreReplies: () => void;\n toggleLike: () => Promise<void>;\n /** Resolves `false` when the post failed, so the composer can keep the draft. */\n postReply: (\n body: string,\n attachments?: { url: string; name: string; size?: number }[]\n ) => Promise<boolean>;\n};\n\n// Optimistic like / reply / reply-delete, reconciled once the host's refetch lands.\nexport const useActivityInteractions = ({\n activity,\n currentUser,\n onChanged,\n loadingState,\n}: UseActivityInteractionsOptions): UseActivityInteractionsResult => {\n // Read through a ref so an inline callback doesn't invalidate the memoized replies.\n const onChangedRef = useRef(onChanged);\n onChangedRef.current = onChanged;\n const notifyChanged = useCallback(() => onChangedRef.current?.(), []);\n\n const [localIsLoading, setLocalIsLoading] = useState(false);\n const isLoading = loadingState ? loadingState.isLoading : localIsLoading;\n const setIsLoading = loadingState ? loadingState.setIsLoading : setLocalIsLoading;\n\n const [isReplyOpen, setIsReplyOpen] = useState(false);\n const [editingReplyId, setEditingReplyId] = useState<string | number | null>(null);\n const [visibleReplies, setVisibleReplies] = useState(INITIAL_VISIBLE_REPLIES);\n const [optimisticReplies, setOptimisticReplies] = useState<ActivityReply[]>([]);\n const [updatedReplies, setUpdatedReplies] = useState<Record<string, Partial<ActivityReply>>>({});\n // Read through a ref so deleting a reply doesn't have to re-create its memoized handler.\n const optimisticRepliesRef = useRef(optimisticReplies);\n optimisticRepliesRef.current = optimisticReplies;\n const [deletedReplyIds, setDeletedReplyIds] = useState<(string | number)[]>([]);\n const [optimisticLiked, setOptimisticLiked] = useState<boolean | null>(null);\n\n const serverReplies = useMemo(() => activity?.comments ?? [], [activity?.comments]);\n const replies = useMemo(() => {\n // Ids arrive as string or number, so compare them as strings.\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const merged = [\n ...serverReplies.map(reply => ({ ...reply, ...updatedReplies[String(reply.id)] })),\n ...optimisticReplies.filter(reply => !serverIds.has(String(reply.id))),\n ];\n\n if (!deletedReplyIds.length) return merged;\n\n return merged.filter(reply => !deletedReplyIds.some(id => String(id) === String(reply.id)));\n }, [serverReplies, optimisticReplies, updatedReplies, deletedReplyIds]);\n\n useEffect(() => {\n if (!optimisticReplies.length) return;\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const stillPending = optimisticReplies.filter(reply => !serverIds.has(String(reply.id)));\n if (stillPending.length !== optimisticReplies.length) setOptimisticReplies(stillPending);\n }, [serverReplies, optimisticReplies]);\n\n // Drop a deleted id once the refetch has removed it server-side.\n useEffect(() => {\n if (!deletedReplyIds.length) return;\n const serverIds = new Set(serverReplies.map(reply => String(reply.id)));\n const stillPresent = deletedReplyIds.filter(id => serverIds.has(String(id)));\n if (stillPresent.length !== deletedReplyIds.length) setDeletedReplyIds(stillPresent);\n }, [serverReplies, deletedReplyIds]);\n\n const serverLiked = (activity?.likes ?? []).some(\n like => Number(like.user?.id) === Number(currentUser?.id)\n );\n const isLiked = optimisticLiked ?? serverLiked;\n const serverLikesCount = activity?.likes_count ?? 0;\n // Clamp: a stale likes array (count 0 while already liked) would render < 0.\n const likesCount =\n optimisticLiked === null || optimisticLiked === serverLiked\n ? serverLikesCount\n : Math.max(0, serverLikesCount + (optimisticLiked ? 1 : -1));\n\n useEffect(() => {\n if (optimisticLiked !== null && optimisticLiked === serverLiked) setOptimisticLiked(null);\n }, [serverLiked, optimisticLiked]);\n\n const toggleLike = async () => {\n if (activity?.id == null) return;\n const next = !isLiked;\n setOptimisticLiked(next);\n setIsLoading(true);\n try {\n await toggleFeedItemLike(activity.id);\n notifyChanged();\n } catch (err) {\n setOptimisticLiked(null);\n showErrorNotification('Failed to update the like');\n } finally {\n setIsLoading(false);\n }\n };\n\n const postReply = async (\n body: string,\n attachments: { url: string; name: string; size?: number }[] = []\n ) => {\n if (activity?.id == null) return false;\n setIsLoading(true);\n try {\n const files = attachments.map(file => ({\n url: file.url,\n size: file.size,\n file_name: file.name,\n }));\n // `attachment` mirrors the first file for clients still reading the legacy field.\n const comment = {\n body,\n ...(files.length ? { attachments: files, attachment: files[0] } : {}),\n };\n const created = await postFeedItemComment(activity.id, { comment });\n if (created?.id) setOptimisticReplies(prev => [...prev, created]);\n notifyChanged();\n\n return true;\n } catch (err) {\n showErrorNotification('Failed to post the reply');\n\n return false;\n } finally {\n setIsLoading(false);\n }\n };\n\n const updateReply = useCallback(\n async (\n replyId: string | number,\n body: string,\n attachments: { url: string; name: string; size?: number }[]\n ) => {\n if (activity?.id == null) return false;\n setIsLoading(true);\n try {\n const files = attachments.map(file => ({\n url: file.url,\n size: file.size,\n file_name: file.name,\n }));\n const comment = {\n body,\n attachments: files,\n attachment: files[0] ?? null,\n };\n await patchFeedItemComment(activity.id, replyId, { comment });\n setUpdatedReplies(prev => ({\n ...prev,\n [String(replyId)]: {\n body,\n attachments: files,\n attachment: files[0] ?? null,\n },\n }));\n setEditingReplyId(null);\n notifyChanged();\n\n return true;\n } catch (err) {\n showErrorNotification('Failed to update the reply');\n\n return false;\n } finally {\n setIsLoading(false);\n }\n },\n [activity?.id, notifyChanged, setIsLoading]\n );\n\n const deleteReply = useCallback(\n async (replyId: string | number) => {\n if (activity?.id == null) return;\n setIsLoading(true);\n // A reply posted in this session is not in the server list yet, so hiding it by id alone\n // would be undone by the reconciliation above: drop the local copy as well.\n const pendingCopy = optimisticRepliesRef.current.find(\n reply => String(reply.id) === String(replyId)\n );\n setOptimisticReplies(prev => prev.filter(reply => String(reply.id) !== String(replyId)));\n setDeletedReplyIds(prev => [...prev, replyId]); // hide immediately; the refetch drops it a moment later\n try {\n await deleteFeedItemComment(activity.id, replyId);\n notifyChanged();\n showSuccessNotification('Reply was deleted');\n } catch (err) {\n setDeletedReplyIds(prev => prev.filter(id => String(id) !== String(replyId)));\n if (pendingCopy) setOptimisticReplies(prev => [...prev, pendingCopy]);\n showErrorNotification('Failed to delete the reply');\n } finally {\n setIsLoading(false);\n }\n },\n [activity?.id, notifyChanged, setIsLoading]\n );\n\n const mappedReplies = useMemo<CommentReply[]>(() => {\n if (!replies.length) return [];\n\n return replies\n .map(reply => ({ reply, sortAt: moment(reply.created_at).unix() }))\n .sort((a, b) => b.sortAt - a.sortAt)\n .slice(0, visibleReplies)\n .map(({ reply }) =>\n buildCommentReply(reply, {\n currentUserId: currentUser?.id,\n onDelete: deleteReply,\n onEdit: setEditingReplyId,\n })\n );\n }, [replies, visibleReplies, deleteReply, currentUser?.id]);\n\n return {\n isLoading,\n isLiked,\n likesCount,\n commentsCount: replies.length,\n isReplyOpen,\n toggleReplyOpen: () => setIsReplyOpen(open => !open),\n replies: mappedReplies,\n editingReply: replies.find(reply => String(reply.id) === String(editingReplyId)) ?? null,\n cancelReplyEdit: () => setEditingReplyId(null),\n hasMoreReplies: replies.length > visibleReplies,\n moreRepliesCount: Math.max(0, replies.length - visibleReplies),\n showMoreReplies: () => setVisibleReplies(prev => prev + MORE_REPLIES_INCREMENT),\n toggleLike,\n postReply,\n updateReply,\n };\n};\n"],"names":["_ref","_activity$likes","_activity$likes_count","_replies$find","activity","currentUser","onChanged","loadingState","onChangedRef","useRef","current","notifyChanged","useCallback","_onChangedRef$current","call","useState","_useState2","_slicedToArray","_useState","localIsLoading","setLocalIsLoading","isLoading","setIsLoading","_useState4","_useState3","isReplyOpen","setIsReplyOpen","_useState6","_useState5","editingReplyId","setEditingReplyId","_useState8","_useState7","visibleReplies","setVisibleReplies","_useState10","_useState9","optimisticReplies","setOptimisticReplies","_useState11","_useState12","updatedReplies","setUpdatedReplies","optimisticRepliesRef","_useState14","_useState13","deletedReplyIds","setDeletedReplyIds","_useState16","_useState15","optimisticLiked","setOptimisticLiked","serverReplies","useMemo","_activity$comments","comments","replies","serverIds","Set","map","reply","String","id","merged","filter","has","length","some","useEffect","stillPending","stillPresent","serverLiked","likes","like","_like$user","Number","user","isLiked","serverLikesCount","likes_count","likesCount","Math","max","toggleLike","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","abrupt","toggleFeedItemLike","t0","showErrorNotification","finish","stop","apply","this","arguments","postReply","_ref3","body","attachments","files","comment","created","_args2","_context2","file","url","size","file_name","name","_objectSpread","attachment","postFeedItemComment","sent","_callee2","_x","updateReply","_ref4","replyId","_files$","_context3","patchFeedItemComment","_files$2","_callee3","_x2","_x3","_x4","deleteReply","_ref5","pendingCopy","_context4","find","deleteFeedItemComment","showSuccessNotification","_callee4","_x5","mappedReplies","sortAt","moment","created_at","unix","sort","a","b","slice","_ref6","buildCommentReply","currentUserId","onDelete","onEdit","commentsCount","toggleReplyOpen","open","editingReply","cancelReplyEdit","hasMoreReplies","moreRepliesCount","showMoreReplies"],"mappings":"ytCA6DuC,SAK8BA,GAAA,IAAAC,EAAAC,EAAAC,EAJnEC,IAAAA,SACAC,IAAAA,YACAC,IAAAA,UACAC,IAAAA,aAGMC,EAAeC,SAAOH,GAC5BE,EAAaE,QAAUJ,EACvB,IAAMK,EAAgBC,EAAAA,aAAY,WAAA,IAAAC,EAAA,OAAM,QAANA,EAAML,EAAaE,eAAb,IAAAG,OAAA,EAAAA,EAAAC,KAAAN,EAAwB,GAAE,IAEtBO,EAAAA,EAAQA,UAAC,GAAMC,EAAAC,EAAAA,QAAAC,EAAA,GAApDC,EAAcH,EAAA,GAAEI,EAAiBJ,EAAA,GAClCK,EAAYd,EAAeA,EAAac,UAAYF,EACpDG,EAAef,EAAeA,EAAae,aAAeF,EAE1BL,EAAAA,EAAQA,UAAC,GAAMQ,EAAAN,EAAAA,QAAAO,EAAA,GAA9CC,EAAWF,EAAA,GAA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AuB7B,CAACjG,aAAAA,EAAAA,EAAU0D,GAAInD,EAAeW,IAG1BwH,GAAgBzF,EAAAA,SAAwB,WAC5C,OAAKG,GAAQU,OAENV,GACJG,KAAI,SAAAC,GAAK,MAAK,CAAEA,MAAAA,EAAOmF,OAAQC,EAAAA,QAAOpF,EAAMqF,YAAYC,OAAS,IACjEC,MAAK,SAACC,EAAGC,GAAC,OAAKA,EAAEN,OAASK,EAAEL,UAC5BO,MAAM,EAAGrH,GACT0B,KAAI,SAAA4F,GAAA,IAAG3F,IAAAA,MAAK,OACX4F,EAAAA,kBAAkB5F,EAAO,CACvB6F,cAAepJ,aAAAA,EAAAA,EAAayD,GAC5B4F,SAAUrB,GACVsB,OAAQ7H,OAVc,EAa7B,GAAE,CAAC0B,GAASvB,EAAgBoG,GAAahI,aAAAA,EAAAA,EAAayD,KAEvD,MAAO,CACLzC,UAAAA,EACAwD,QAAAA,GACAG,WAAAA,GACA4E,cAAepG,GAAQU,OACvBzC,YAAAA,EACAoI,gBAAiB,WAAA,OAAMnI,GAAe,SAAAoI,GAAI,OAAKA,IAAK,EACpDtG,QAASsF,GACTiB,uBAAcvG,GAAQiF,MAAK,SAAA7E,GAAK,OAAIC,OAAOD,EAAME,MAAQD,OAAOhC,EAAe,mBAAK,KACpFmI,gBAAiB,WAAA,OAAMlI,EAAkB,KAAK,EAC9CmI,eAAgBzG,GAAQU,OAASjC,EACjCiI,iBAAkBjF,KAAKC,IAAI,EAAG1B,GAAQU,OAASjC,GAC/CkI,gBAAiB,WAAA,OAAMjI,GAAkB,SAAAyD,GAAI,OAAIA,EAnQtB,KAmQoD,EAC/ER,WAAAA,GACAmB,UAAAA,GACAoB,YAAAA,GAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("../CommentComposer/CommentReplyInput.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("../CommentCard/buildCommentReply.js"),o=require("../CommentComposer/CommentReplyInput.js"),i=require("../ConfirmationDialog.js"),n=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/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/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 c=require("./useActivityInteractions.js"),r=require("./useDeleteFeedItem.js"),t=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(e);function a(e,s){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);s&&(i=i.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),o.push.apply(o,i)}return o}function m(e){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?a(Object(o),!0).forEach((function(s){l.default(e,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(o,s))}))}return e}var d=i,p=function(e){var s,o;return"".concat(null!==(s=null==e?void 0:e.first_name)&&void 0!==s?s:""," ").concat(null!==(o=null==e?void 0:e.last_name)&&void 0!==o?o:"").trim()};exports.useFeedActivity=function(e,i){var u,l,a,j,I=c.useActivityInteractions({activity:null!==(u=null==e?void 0:e.data)&&void 0!==u?u:{},currentUser:null!==(l=null==e?void 0:e.currentUser)&&void 0!==l?l:{},onChanged:null==e?void 0:e.onChanged,loadingState:null==e?void 0:e.loadingState}),q=r.useDeleteFeedItem({id:null==e||null===(a=e.data)||void 0===a?void 0:a.id,successMessage:"".concat(i[0].toUpperCase()).concat(i.slice(1)," was deleted"),errorMessage:"Failed to delete the ".concat(i),onDeleted:function(){var s,o;null==e||null===(s=e.onChanged)||void 0===s||s.call(e),null==e||null===(o=e.onDeleted)||void 0===o||o.call(e)}});if(!e)return null;var v=I.replies.map((function(e){var i,n;return I.editingReply&&String(e.id)===String(I.editingReply.id)?m(m({},e),{},{editForm:t.jsx(o.CommentReplyInput,{onSubmit:function(s,o){var i,n;return I.updateReply(null!==(i=null===(n=I.editingReply)||void 0===n?void 0:n.id)&&void 0!==i?i:e.id,s,o)},onCancel:I.cancelReplyEdit,disabled:I.isLoading,initialBody:null!==(i=I.editingReply.body)&&void 0!==i?i:"",initialAttachments:s.getReplyAttachments(I.editingReply),author:{name:p(I.editingReply.user),avatarUrl:null===(n=I.editingReply.user)||void 0===n?void 0:n.profile_photo}})}):e}));return{isDeleted:q.isDeleted,isLiked:I.isLiked,likesCount:I.likesCount,commentsCount:I.commentsCount,isReplyOpen:I.isReplyOpen,replies:v,hasMoreReplies:I.hasMoreReplies,moreRepliesCount:I.moreRepliesCount,onLike:I.toggleLike,onReplyToggle:I.toggleReplyOpen,onShowMoreReplies:I.showMoreReplies,replyInput:t.jsx(o.CommentReplyInput,{onSubmit:I.postReply,disabled:I.isLoading,author:{name:p(e.currentUser),avatarUrl:null===(j=e.currentUser)||void 0===j?void 0:j.profile_photo}}),menuItems:e.canDelete?[{label:"Delete",icon:t.jsx(n.DeleteFourIcon,{size:16}),onClick:q.openDeleteDialog}]:[],deleteDialog:t.jsx(d,{open:q.isDialogOpen,title:"Delete ".concat(i),text:"Are you sure you want to delete this ".concat(i,"?"),okText:"Delete",disableOk:q.isDeleting,handleOk:q.confirmDelete,handleClose:q.closeDeleteDialog})}};
|
|
2
2
|
//# sourceMappingURL=useFeedActivity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFeedActivity.js","sources":["../../../../src/components/FeedCard/useFeedActivity.tsx"],"sourcesContent":["import { ComponentType, ReactNode } from 'react';\n\nimport { CommentMenuItem, CommentReply } from '../CommentCard/CommentCard.types';\nimport { CommentReplyInput } from '../CommentComposer/CommentReplyInput';\nimport ConfirmationDialogJs from '../ConfirmationDialog';\nimport { DeleteFourIcon } from '../../icons';\n\nimport { useActivityInteractions } from './useActivityInteractions';\nimport type { InteractionActivity } from './useActivityInteractions';\nimport { useDeleteFeedItem } from './useDeleteFeedItem';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case user payload. */\nexport type FeedActivityUser = {\n id?: string | number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n};\n/* eslint-enable camelcase */\n\nexport type FeedActivityProps = {\n data: InteractionActivity;\n currentUser: FeedActivityUser;\n onChanged?: () => void;\n loadingState?: { isLoading: boolean; setIsLoading: (isLoading: boolean) => void };\n canDelete?: boolean;\n onDeleted?: () => void;\n};\n\nconst ConfirmationDialog = ConfirmationDialogJs as unknown as ComponentType<{\n open: boolean;\n title: string;\n text: string;\n okText: string;\n disableOk: boolean;\n handleOk: () => void;\n handleClose: () => void;\n}>;\n\nconst getUserName = (user?: FeedActivityUser) =>\n `${user?.first_name ?? ''} ${user?.last_name ?? ''}`.trim();\n\nexport type FeedActivityBinding = {\n isDeleted: boolean;\n isLiked?: boolean;\n likesCount?: number;\n commentsCount?: number;\n isReplyOpen?: boolean;\n replies?: CommentReply[];\n hasMoreReplies?: boolean;\n moreRepliesCount?: number;\n onLike?: () => void;\n onReplyToggle?: () => void;\n onShowMoreReplies?: () => void;\n replyInput?: ReactNode;\n menuItems: CommentMenuItem[];\n deleteDialog: ReactNode;\n};\n\n// Returns `null` without an `activity`, so the card falls back to its presentational props.\nexport const useFeedActivity = (\n activity: FeedActivityProps | undefined,\n // What the delete dialog and its notifications call the item: \"comment\", \"item\".\n subject: string\n): FeedActivityBinding | null => {\n const interactions = useActivityInteractions({\n activity: activity?.data ?? {},\n currentUser: activity?.currentUser ?? {},\n onChanged: activity?.onChanged,\n loadingState: activity?.loadingState,\n });\n\n const deletion = useDeleteFeedItem({\n id: activity?.data?.id,\n successMessage: `${subject[0].toUpperCase()}${subject.slice(1)} was deleted`,\n errorMessage: `Failed to delete the ${subject}`,\n onDeleted: () => {\n activity?.onChanged?.();\n activity?.onDeleted?.();\n },\n });\n\n if (!activity) return null;\n\n return {\n isDeleted: deletion.isDeleted,\n isLiked: interactions.isLiked,\n likesCount: interactions.likesCount,\n commentsCount: interactions.commentsCount,\n isReplyOpen: interactions.isReplyOpen,\n replies
|
|
1
|
+
{"version":3,"file":"useFeedActivity.js","sources":["../../../../src/components/FeedCard/useFeedActivity.tsx"],"sourcesContent":["import { ComponentType, ReactNode } from 'react';\n\nimport { CommentMenuItem, CommentReply } from '../CommentCard/CommentCard.types';\nimport { getReplyAttachments } from '../CommentCard/buildCommentReply';\nimport { CommentReplyInput } from '../CommentComposer/CommentReplyInput';\nimport ConfirmationDialogJs from '../ConfirmationDialog';\nimport { DeleteFourIcon } from '../../icons';\n\nimport { useActivityInteractions } from './useActivityInteractions';\nimport type { InteractionActivity } from './useActivityInteractions';\nimport { useDeleteFeedItem } from './useDeleteFeedItem';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case user payload. */\nexport type FeedActivityUser = {\n id?: string | number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n};\n/* eslint-enable camelcase */\n\nexport type FeedActivityProps = {\n data: InteractionActivity;\n currentUser: FeedActivityUser;\n onChanged?: () => void;\n loadingState?: { isLoading: boolean; setIsLoading: (isLoading: boolean) => void };\n canDelete?: boolean;\n onDeleted?: () => void;\n};\n\nconst ConfirmationDialog = ConfirmationDialogJs as unknown as ComponentType<{\n open: boolean;\n title: string;\n text: string;\n okText: string;\n disableOk: boolean;\n handleOk: () => void;\n handleClose: () => void;\n}>;\n\nconst getUserName = (user?: FeedActivityUser) =>\n `${user?.first_name ?? ''} ${user?.last_name ?? ''}`.trim();\n\nexport type FeedActivityBinding = {\n isDeleted: boolean;\n isLiked?: boolean;\n likesCount?: number;\n commentsCount?: number;\n isReplyOpen?: boolean;\n replies?: CommentReply[];\n hasMoreReplies?: boolean;\n moreRepliesCount?: number;\n onLike?: () => void;\n onReplyToggle?: () => void;\n onShowMoreReplies?: () => void;\n replyInput?: ReactNode;\n menuItems: CommentMenuItem[];\n deleteDialog: ReactNode;\n};\n\n// Returns `null` without an `activity`, so the card falls back to its presentational props.\nexport const useFeedActivity = (\n activity: FeedActivityProps | undefined,\n // What the delete dialog and its notifications call the item: \"comment\", \"item\".\n subject: string\n): FeedActivityBinding | null => {\n const interactions = useActivityInteractions({\n activity: activity?.data ?? {},\n currentUser: activity?.currentUser ?? {},\n onChanged: activity?.onChanged,\n loadingState: activity?.loadingState,\n });\n\n const deletion = useDeleteFeedItem({\n id: activity?.data?.id,\n successMessage: `${subject[0].toUpperCase()}${subject.slice(1)} was deleted`,\n errorMessage: `Failed to delete the ${subject}`,\n onDeleted: () => {\n activity?.onChanged?.();\n activity?.onDeleted?.();\n },\n });\n\n if (!activity) return null;\n\n const replies = interactions.replies.map(reply =>\n interactions.editingReply && String(reply.id) === String(interactions.editingReply.id)\n ? {\n ...reply,\n editForm: (\n <CommentReplyInput\n onSubmit={(body, attachments) =>\n interactions.updateReply(\n interactions.editingReply?.id ?? reply.id,\n body,\n attachments\n )\n }\n onCancel={interactions.cancelReplyEdit}\n disabled={interactions.isLoading}\n initialBody={interactions.editingReply.body ?? ''}\n initialAttachments={getReplyAttachments(interactions.editingReply)}\n author={{\n name: getUserName(interactions.editingReply.user),\n avatarUrl: interactions.editingReply.user?.profile_photo,\n }}\n />\n ),\n }\n : reply\n );\n\n return {\n isDeleted: deletion.isDeleted,\n isLiked: interactions.isLiked,\n likesCount: interactions.likesCount,\n commentsCount: interactions.commentsCount,\n isReplyOpen: interactions.isReplyOpen,\n replies,\n hasMoreReplies: interactions.hasMoreReplies,\n moreRepliesCount: interactions.moreRepliesCount,\n onLike: interactions.toggleLike,\n onReplyToggle: interactions.toggleReplyOpen,\n onShowMoreReplies: interactions.showMoreReplies,\n replyInput: (\n <CommentReplyInput\n onSubmit={interactions.postReply}\n disabled={interactions.isLoading}\n author={{\n name: getUserName(activity.currentUser),\n avatarUrl: activity.currentUser?.profile_photo,\n }}\n />\n ),\n menuItems: activity.canDelete\n ? [\n {\n label: 'Delete',\n icon: <DeleteFourIcon size={16} />,\n onClick: deletion.openDeleteDialog,\n },\n ]\n : [],\n deleteDialog: (\n <ConfirmationDialog\n open={deletion.isDialogOpen}\n title={`Delete ${subject}`}\n text={`Are you sure you want to delete this ${subject}?`}\n okText=\"Delete\"\n disableOk={deletion.isDeleting}\n handleOk={deletion.confirmDelete}\n handleClose={deletion.closeDeleteDialog}\n />\n ),\n };\n};\n"],"names":["ConfirmationDialog","ConfirmationDialogJs","getUserName","user","_user$first_name","_user$last_name","concat","first_name","last_name","trim","activity","subject","_activity$data","_activity$currentUser","_activity$data2","_activity$currentUser2","interactions","useActivityInteractions","data","currentUser","onChanged","loadingState","deletion","useDeleteFeedItem","id","successMessage","toUpperCase","slice","errorMessage","onDeleted","_activity$onChanged","_activity$onDeleted","replies","map","reply","_interactions$editing3","_interactions$editing4","editingReply","String","editForm","_jsx","CommentReplyInput","onSubmit","body","attachments","_interactions$editing","_interactions$editing2","updateReply","onCancel","cancelReplyEdit","disabled","isLoading","initialBody","initialAttachments","getReplyAttachments","author","name","avatarUrl","profile_photo","isDeleted","isLiked","likesCount","commentsCount","isReplyOpen","hasMoreReplies","moreRepliesCount","onLike","toggleLike","onReplyToggle","toggleReplyOpen","onShowMoreReplies","showMoreReplies","replyInput","postReply","menuItems","canDelete","label","icon","DeleteFourIcon","size","onClick","openDeleteDialog","deleteDialog","open","isDialogOpen","title","text","okText","disableOk","isDeleting","handleOk","confirmDelete","handleClose","closeDeleteDialog"],"mappings":"k2JA8BA,IAAMA,EAAqBC,EAUrBC,EAAc,SAACC,GAAuB,IAAAC,EAAAC,EAAA,MAC1C,GAAAC,OAAmB,QAAnBF,EAAGD,eAAAA,EAAMI,kBAAU,IAAAH,EAAAA,EAAI,GAAE,KAAAE,OAAuB,QAAvBD,EAAIF,eAAAA,EAAMK,iBAAa,IAAAH,EAAAA,EAAA,IAAKI,MAAM,0BAoB9B,SAC7BC,EAEAC,GAC+B,IAAAC,EAAAC,EAAAC,EAAAC,EACzBC,EAAeC,EAAAA,wBAAwB,CAC3CP,SAA4B,QAApBE,EAAEF,aAAQ,EAARA,EAAUQ,YAAQ,IAAAN,EAAAA,EAAA,CAAE,EAC9BO,YAAsC,QAA3BN,EAAEH,aAAQ,EAARA,EAAUS,mBAAe,IAAAN,EAAAA,EAAA,CAAE,EACxCO,UAAWV,aAAAA,EAAAA,EAAUU,UACrBC,aAAcX,aAAQ,EAARA,EAAUW,eAGpBC,EAAWC,EAAAA,kBAAkB,CACjCC,GAAId,SAAA,QAAQI,EAARJ,EAAUQ,YAAV,IAAAJ,OAAQ,EAARA,EAAgBU,GACpBC,eAAmBd,GAAAA,OAAAA,EAAQ,GAAGe,eAAapB,OAAGK,EAAQgB,MAAM,GAAgB,gBAC5EC,aAAY,wBAAAtB,OAA0BK,GACtCkB,UAAW,WA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AASS,aAC3BsC,kBAAW/C,EAAAA,EAASS,gCAATJ,EAAsB2C,iBAIvCgB,UAAWhE,EAASiE,UAChB,CACE,CACEC,MAAO,SACPC,KAAMrC,MAACsC,iBAAc,CAACC,KAAM,KAC5BC,QAAS1D,EAAS2D,mBAGtB,GACJC,aACE1C,MAACxC,EAAkB,CACjBmF,KAAM7D,EAAS8D,aACfC,MAAK,UAAA/E,OAAYK,GACjB2E,KAAI,wCAAAhF,OAA0CK,EAAW,KACzD4E,OAAO,SACPC,UAAWlE,EAASmE,WACpBC,SAAUpE,EAASqE,cACnBC,YAAatE,EAASuE,oBAI9B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),o=require("prop-types"),n=require("@material-ui/core"),a=require("@material-ui/icons"),i=require("../IconButton/index.js"),l=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(e),c=s(t),p=s(o);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){u.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e){var t=e.classes,o=e["data-testid"],a=e.iconButtonStyle,i=e.color,s=e.disableRipple,u=e.className,p=e.IconElement,d=e.IconButtonComponent,h=e.disabled,m=e.iconButtonProps,b=e.children,g=e.anchorOrigin,O=e.transformOrigin,y=e.marginThreshold,v=e.menuProps,P=e.tooltipProps,j=e.paperClassName,B=r.useState(null),T=c.default(B,2),x=T[0],C=T[1],w=!!x,q=r.useState(!1),I=c.default(q,2),N=I[0],S=I[1];r.useEffect((function(){var e;return w&&setTimeout((function(){e=S(w)}),500),function(){e&&clearTimeout(e)}}),[w]);var E=function(e){e.stopPropagation(),C(null),S(!1)},R=l.jsx(d,f(f({"aria-label":"IconMenu","aria-owns":w?"icon-menu":void 0,"aria-haspopup":"true","data-testid":o,onClick:function(e){e.stopPropagation(),e.preventDefault(),C(e.currentTarget)},classes:{root:t.iconButton},className:u,style:a,color:i,disableRipple:s,disabled:h},m),{},{children:p}));return l.jsxs(l.Fragment,{children:[P?l.jsx(n.Tooltip,f(f({},P),{},{children:R})):R,l.jsx(n.Menu,f(f({id:"icon-menu",anchorEl:x,open:w,MenuListProps:{"data-testid":"".concat(o,"Dropdown")},disableAutoFocus:!N,autoFocus:N,onClose:E,onClick:E,anchorOrigin:g,transformOrigin:O,classes:{paper:t.paper},elevation:0,marginThreshold:y,PaperProps:{className:t[j]}},v),{},{children:b}))]})}h.propTypes={children:p.default.oneOfType([p.default.string,p.default.node,p.default.array]),classes:p.default.shape({iconButton:p.default.string,paper:p.default.string}),className:p.default.string,color:p.default.string,IconElement:p.default.element,IconButtonComponent:p.default.any,iconButtonStyle:p.default.shape({}),anchorOrigin:p.default.shape({horizontal:p.default.oneOf(["left","center","right"]),vertical:p.default.oneOf(["top","center","bottom"])}),transformOrigin:p.default.shape({horizontal:p.default.oneOf(["left","center","right"]),vertical:p.default.oneOf(["top","center","bottom"])}),disableRipple:p.default.bool,"data-testid":p.default.string,marginThreshold:p.default.number,disabled:p.default.bool,tooltipProps:p.default.shape({}),menuProps:p.default.shape({}),iconButtonProps:p.default.shape({}),paperClassName:p.default.string},h.defaultProps={children:void 0,classes:{},className:void 0,color:void 0,"data-testid":void 0,IconElement:l.jsx(a.MoreVert,{}),iconButtonStyle:void 0,IconButtonComponent:i,disableRipple:!1,anchorOrigin:{horizontal:"right",vertical:"top"},transformOrigin:{horizontal:"right",vertical:"bottom"},marginThreshold:void 0,disabled:!1,tooltipProps:void 0,menuProps:{},iconButtonProps:{},paperClassName:""};var m=n.withStyles((function(e){return{iconButton:{borderRadius:8,padding:"10px",color:e.palette.primary.text6,"&:hover":{color:e.palette.primary.text1,backgroundColor:"rgba(255, 255, 255, 0.16)"},"& .MuiTouchRipple-child":{borderRadius:8},paper:{}}}
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),o=require("prop-types"),n=require("@material-ui/core"),a=require("@material-ui/icons"),i=require("../IconButton/index.js"),l=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(e),c=s(t),p=s(o);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){u.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e){var t=e.classes,o=e["data-testid"],a=e.iconButtonStyle,i=e.color,s=e.disableRipple,u=e.className,p=e.IconElement,d=e.IconButtonComponent,h=e.disabled,m=e.iconButtonProps,b=e.children,g=e.anchorOrigin,O=e.transformOrigin,y=e.marginThreshold,v=e.menuProps,P=e.tooltipProps,j=e.paperClassName,B=r.useState(null),T=c.default(B,2),x=T[0],C=T[1],w=!!x,q=r.useState(!1),I=c.default(q,2),N=I[0],S=I[1];r.useEffect((function(){var e;return w&&setTimeout((function(){e=S(w)}),500),function(){e&&clearTimeout(e)}}),[w]);var E=function(e){e.stopPropagation(),C(null),S(!1)},R=l.jsx(d,f(f({"aria-label":"IconMenu","aria-owns":w?"icon-menu":void 0,"aria-haspopup":"true","data-testid":o,onClick:function(e){e.stopPropagation(),e.preventDefault(),C(e.currentTarget)},classes:{root:t.iconButton},className:u,style:a,color:i,disableRipple:s,disabled:h},m),{},{children:p}));return l.jsxs(l.Fragment,{children:[P?l.jsx(n.Tooltip,f(f({},P),{},{children:R})):R,l.jsx(n.Menu,f(f({id:"icon-menu",anchorEl:x,open:w,MenuListProps:{"data-testid":"".concat(o,"Dropdown")},disableAutoFocus:!N,autoFocus:N,onClose:E,onClick:E,anchorOrigin:g,transformOrigin:O,classes:{paper:t.paper},elevation:0,marginThreshold:y,PaperProps:{className:t[j]}},v),{},{children:b}))]})}h.propTypes={children:p.default.oneOfType([p.default.string,p.default.node,p.default.array]),classes:p.default.shape({iconButton:p.default.string,paper:p.default.string}),className:p.default.string,color:p.default.string,IconElement:p.default.element,IconButtonComponent:p.default.any,iconButtonStyle:p.default.shape({}),anchorOrigin:p.default.shape({horizontal:p.default.oneOf(["left","center","right"]),vertical:p.default.oneOf(["top","center","bottom"])}),transformOrigin:p.default.shape({horizontal:p.default.oneOf(["left","center","right"]),vertical:p.default.oneOf(["top","center","bottom"])}),disableRipple:p.default.bool,"data-testid":p.default.string,marginThreshold:p.default.number,disabled:p.default.bool,tooltipProps:p.default.shape({}),menuProps:p.default.shape({}),iconButtonProps:p.default.shape({}),paperClassName:p.default.string},h.defaultProps={children:void 0,classes:{},className:void 0,color:void 0,"data-testid":void 0,IconElement:l.jsx(a.MoreVert,{}),iconButtonStyle:void 0,IconButtonComponent:i,disableRipple:!1,anchorOrigin:{horizontal:"right",vertical:"top"},transformOrigin:{horizontal:"right",vertical:"bottom"},marginThreshold:void 0,disabled:!1,tooltipProps:void 0,menuProps:{},iconButtonProps:{},paperClassName:""};var m=n.withStyles((function(e){return{iconButton:{borderRadius:8,padding:"10px",color:e.palette.primary.text6,"&:hover":{color:e.palette.primary.text1,backgroundColor:"rgba(255, 255, 255, 0.16)"},"& .MuiTouchRipple-child":{borderRadius:8}},paper:{}}}))(h);module.exports=m;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/IconMenu/index.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Menu, withStyles, Tooltip } from '@material-ui/core';\nimport { MoreVert } from '@material-ui/icons';\n\nimport IconButton from '../IconButton';\n\nconst muiStyles = theme => ({\n iconButton: {\n borderRadius: 8,\n padding: '10px',\n color: theme.palette.primary.text6,\n '&:hover': {\n color: theme.palette.primary.text1,\n backgroundColor: 'rgba(255, 255, 255, 0.16)',\n },\n '& .MuiTouchRipple-child': {\n borderRadius: 8,\n },\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/IconMenu/index.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Menu, withStyles, Tooltip } from '@material-ui/core';\nimport { MoreVert } from '@material-ui/icons';\n\nimport IconButton from '../IconButton';\n\nconst muiStyles = theme => ({\n iconButton: {\n borderRadius: 8,\n padding: '10px',\n color: theme.palette.primary.text6,\n '&:hover': {\n color: theme.palette.primary.text1,\n backgroundColor: 'rgba(255, 255, 255, 0.16)',\n },\n '& .MuiTouchRipple-child': {\n borderRadius: 8,\n },\n },\n paper: {},\n});\n\nfunction IconMenu({\n classes,\n // IconButtonComponentProps\n 'data-testid': testId,\n iconButtonStyle,\n color,\n disableRipple,\n className,\n IconElement,\n IconButtonComponent,\n disabled,\n iconButtonProps,\n // MenuProps\n children,\n anchorOrigin,\n transformOrigin,\n marginThreshold,\n menuProps,\n // Tooltip\n tooltipProps,\n paperClassName,\n}) {\n const [anchorEl, setAnchorEl] = useState(null);\n const isOpen = !!anchorEl;\n\n /*\n A fix of the issue: https://corvaqa.atlassian.net/browse/DC-3713\n\n When Material Menu is rendered, at first it's displayed at the top of the container\n and only then moves to the anchor element. When the focus is enabled, and the element is\n inside of an iframe but outside the view - browsers scroll the page to it. Because of this, we set focus in async\n manner, to wait for correct position - and then set focus.\n\n https://github.dev/mui/material-ui/blob/v4.x/packages/material-ui/src/Popover/Popover.js#L323-L331\n */\n const [isMenuAutofocus, setIsMenuAutofocus] = useState(false);\n useEffect(() => {\n let timerId;\n\n if (isOpen) {\n setTimeout(() => {\n timerId = setIsMenuAutofocus(isOpen);\n // Why 500? The lower delay doesn't actually work, so this is the lowest value I could get to make it work\n }, 500);\n }\n\n return () => {\n if (timerId) {\n clearTimeout(timerId);\n }\n };\n }, [isOpen]);\n\n const handleClose = event => {\n event.stopPropagation();\n setAnchorEl(null);\n setIsMenuAutofocus(false);\n };\n const handleOpen = event => {\n event.stopPropagation();\n event.preventDefault();\n setAnchorEl(event.currentTarget);\n };\n\n const iconButtonElement = (\n <IconButtonComponent\n aria-label=\"IconMenu\"\n aria-owns={isOpen ? 'icon-menu' : undefined}\n aria-haspopup=\"true\"\n data-testid={testId}\n onClick={handleOpen}\n classes={{ root: classes.iconButton }}\n className={className}\n style={iconButtonStyle}\n color={color}\n disableRipple={disableRipple}\n disabled={disabled}\n {...iconButtonProps}\n >\n {IconElement}\n </IconButtonComponent>\n );\n\n return (\n <>\n {tooltipProps ? <Tooltip {...tooltipProps}>{iconButtonElement}</Tooltip> : iconButtonElement}\n <Menu\n id=\"icon-menu\"\n anchorEl={anchorEl}\n open={isOpen}\n MenuListProps={{ 'data-testid': `${testId}Dropdown` }}\n disableAutoFocus={!isMenuAutofocus}\n autoFocus={isMenuAutofocus}\n onClose={handleClose}\n onClick={handleClose}\n anchorOrigin={anchorOrigin}\n transformOrigin={transformOrigin}\n classes={{ paper: classes.paper }}\n elevation={0}\n marginThreshold={marginThreshold}\n PaperProps={{\n className: classes[paperClassName],\n }}\n {...menuProps}\n >\n {children}\n </Menu>\n </>\n );\n}\n\nIconMenu.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.array]),\n classes: PropTypes.shape({\n iconButton: PropTypes.string,\n paper: PropTypes.string,\n }),\n className: PropTypes.string,\n color: PropTypes.string,\n IconElement: PropTypes.element,\n // eslint-disable-next-line react/forbid-prop-types\n IconButtonComponent: PropTypes.any,\n iconButtonStyle: PropTypes.shape({}),\n anchorOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'center', 'right']),\n vertical: PropTypes.oneOf(['top', 'center', 'bottom']),\n }),\n transformOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'center', 'right']),\n vertical: PropTypes.oneOf(['top', 'center', 'bottom']),\n }),\n disableRipple: PropTypes.bool,\n 'data-testid': PropTypes.string,\n marginThreshold: PropTypes.number,\n disabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({}),\n menuProps: PropTypes.shape({}),\n iconButtonProps: PropTypes.shape({}),\n paperClassName: PropTypes.string,\n};\n\nIconMenu.defaultProps = {\n children: undefined,\n classes: {},\n className: undefined,\n color: undefined,\n 'data-testid': undefined,\n IconElement: <MoreVert />,\n iconButtonStyle: undefined,\n IconButtonComponent: IconButton,\n disableRipple: false,\n anchorOrigin: { horizontal: 'right', vertical: 'top' },\n transformOrigin: { horizontal: 'right', vertical: 'bottom' },\n marginThreshold: undefined,\n disabled: false,\n tooltipProps: undefined,\n menuProps: {},\n iconButtonProps: {},\n paperClassName: '',\n};\n\nexport default withStyles(muiStyles)(IconMenu);\n"],"names":["IconMenu","_ref","classes","testId","iconButtonStyle","color","disableRipple","className","IconElement","IconButtonComponent","disabled","iconButtonProps","children","anchorOrigin","transformOrigin","marginThreshold","menuProps","tooltipProps","paperClassName","useState","_useState2","_slicedToArray","_useState","anchorEl","setAnchorEl","isOpen","_useState4","_useState3","isMenuAutofocus","setIsMenuAutofocus","useEffect","timerId","setTimeout","clearTimeout","handleClose","event","stopPropagation","iconButtonElement","_jsx","jsx","_objectSpread","undefined","onClick","preventDefault","currentTarget","root","iconButton","style","_jsxs","_Fragment","Tooltip","Menu","id","open","MenuListProps","disableAutoFocus","autoFocus","onClose","paper","elevation","PaperProps","propTypes","PropTypes","oneOfType","string","node","array","shape","element","any","horizontal","oneOf","vertical","bool","number","defaultProps","MoreVert","IconButton","index","withStyles","theme","borderRadius","padding","palette","primary","text6","text1","backgroundColor"],"mappings":"28BAuBA,SAASA,EAqBNC,GAAA,IApBDC,IAAAA,QAEeC,IAAf,eACAC,IAAAA,gBACAC,IAAAA,MACAC,IAAAA,cACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oBACAC,IAAAA,SACAC,IAAAA,gBAEAC,IAAAA,SACAC,IAAAA,aACAC,IAAAA,gBACAC,IAAAA,gBACAC,IAAAA,UAEAC,IAAAA,aACAC,IAAAA,eAEgCC,EAAAA,EAAQA,SAAC,MAAKC,EAAAC,EAAAA,QAAAC,EAAA,GAAvCC,EAAQH,EAAA,GAAEI,EAAWJ,EAAA,GACtBK,IAAWF,EAY6BJ,EAAAA,EAAQA,UAAC,GAAMO,EAAAL,EAAAA,QAAAM,EAAA,GAAtDC,EAAeF,EAAA,GAAEG,EAAkBH,EAAA,GAC1CI,EAAAA,WAAU,WACR,IAAIC,EASJ,OAPIN,GACFO,YAAW,WACTD,EAAUF,EAAmBJ,EAE9B,GAAE,KAGE,WACDM,GACFE,aAAaF,GAGnB,GAAG,CAACN,IAEJ,IAAMS,EAAc,SAAAC,GAClBA,EAAMC,kBACNZ,EAAY,MACZK,GAAmB,IAQfQ,EACJC,EAAAC,IAAC9B,EAAmB+B,EAAAA,EAAA,CAClB,aAAW,WACX,YAAWf,EAAS,iBAAcgB,EAClC,gBAAc,OACd,cAAatC,EACbuC,QAZe,SAAAP,GACjBA,EAAMC,kBACND,EAAMQ,iBACNnB,EAAYW,EAAMS,gBAUhB1C,QAAS,CAAE2C,KAAM3C,EAAQ4C,YACzBvC,UAAWA,EACXwC,MAAO3C,EACPC,MAAOA,EACPC,cAAeA,EACfI,SAAUA,GACNC,GAAe,GAAA,CAAAC,SAElBJ,KAIL,OACEwC,EAAAA,KAAAC,EAAAA,SAAA,CA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