@corva/ui 3.74.0-1 → 3.74.0-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/AttachmentLightbox/AttachmentDocument.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js.map +1 -0
- package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.js +1 -1
- package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.js.map +1 -1
- package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.scss.js +1 -1
- package/cjs-bundle/components/AttachmentLightbox/AttachmentPreviewPane.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/AttachmentPreviewPane.js.map +1 -0
- package/cjs-bundle/components/AttachmentLightbox/copyImageToClipboard.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/copyImageToClipboard.js.map +1 -0
- package/cjs-bundle/components/AttachmentLightbox/downloadAttachment.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/downloadAttachment.js.map +1 -0
- package/cjs-bundle/components/AttachmentLightbox/useAttachmentLightbox.js +1 -1
- package/cjs-bundle/components/AttachmentLightbox/useAttachmentLightbox.js.map +1 -1
- package/cjs-bundle/components/AttachmentLightbox/useZoomPan.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/useZoomPan.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentActionsMenu.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentActionsMenu.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentDownloadLink.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentDownloadLink.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentImage.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentImage.js.map +1 -0
- 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 +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
- 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/CollapsableSidebar.js +1 -1
- package/cjs-bundle/components/CollapsableSidebar.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/CommentCardReactions.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCardReactions.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentMenu.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentMenu.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/ShareToChatRow.js +1 -1
- package/cjs-bundle/components/CommentComposer/ShareToChatRow.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/useFilePaste.js +2 -0
- package/cjs-bundle/components/CommentInputNext/useFilePaste.js.map +1 -0
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js.map +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js.map +1 -1
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js +1 -1
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js.map +1 -1
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/useFullscreenModes.js +2 -0
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/useFullscreenModes.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/FeedItem/FeedItem.js +1 -1
- package/cjs-bundle/components/FeedItem/FeedItem.js.map +1 -1
- package/cjs-bundle/components/FeedItem/components/FeedComments.js +1 -1
- package/cjs-bundle/components/FeedItem/components/FeedComments.js.map +1 -1
- package/cjs-bundle/components/LinkedText/LinkedText.js +2 -0
- package/cjs-bundle/components/LinkedText/LinkedText.js.map +1 -0
- package/cjs-bundle/components/LinkedText/LinkedText.scss.js +2 -0
- package/cjs-bundle/components/LinkedText/LinkedText.scss.js.map +1 -0
- package/cjs-bundle/components/NewDocumentViewer/utils.js +1 -1
- package/cjs-bundle/components/NewDocumentViewer/utils.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/AppHeader/components/HeaderActions/HeaderActions.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.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/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.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/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.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/Popover/Popover.js +1 -1
- package/cjs-bundle/components/Popover/Popover.js.map +1 -1
- package/cjs-bundle/components/Popper/Popper.js +1 -1
- package/cjs-bundle/components/Popper/Popper.js.map +1 -1
- package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
- package/cjs-bundle/components/RealTimeValuesSidebar/SidebarFooter.js.map +1 -1
- package/cjs-bundle/components/UserMention/constants.js +1 -1
- package/cjs-bundle/components/UserMention/constants.js.map +1 -1
- package/cjs-bundle/components/UserMention/index.js +1 -1
- package/cjs-bundle/components/UserMention/index.js.map +1 -1
- package/cjs-bundle/components/index.js +1 -1
- package/cjs-bundle/componentsV2/AppCommonsProvider/AppCommonsContext.js.map +1 -1
- package/cjs-bundle/componentsV2/AppCommonsProvider/utils.js +1 -1
- package/cjs-bundle/componentsV2/AppCommonsProvider/utils.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.constants.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.constants.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.js.map +1 -1
- package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
- package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js.map +1 -1
- package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.scss.js +1 -1
- package/cjs-bundle/componentsV2/Chip/Chip.js +1 -1
- package/cjs-bundle/componentsV2/Chip/Chip.js.map +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/ColorPicker.js +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/ColorPicker.js.map +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/ColorPicker.scss.js +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/OpacityDragtracker/OpacityDragtracker.js +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/OpacityDragtracker/OpacityDragtracker.js.map +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/Swatches/Swatches.scss.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
- package/cjs-bundle/componentsV2/InterventionEventSelector/InterventionEventSelector.js +2 -0
- package/cjs-bundle/componentsV2/InterventionEventSelector/InterventionEventSelector.js.map +1 -0
- package/cjs-bundle/componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js +2 -0
- package/cjs-bundle/componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js.map +1 -0
- package/cjs-bundle/componentsV2/InterventionEventSelector/useInterventionUnitEvents.js +2 -0
- package/cjs-bundle/componentsV2/InterventionEventSelector/useInterventionUnitEvents.js.map +1 -0
- package/cjs-bundle/componentsV2/InterventionEventSelector/utils.js +2 -0
- package/cjs-bundle/componentsV2/InterventionEventSelector/utils.js.map +1 -0
- package/cjs-bundle/componentsV2/Modal/Modal.js +1 -1
- package/cjs-bundle/componentsV2/Modal/Modal.js.map +1 -1
- package/cjs-bundle/componentsV2/Modal/constants.js +2 -0
- package/cjs-bundle/componentsV2/Modal/constants.js.map +1 -0
- package/cjs-bundle/componentsV2/WellArchivedMessage/WellArchivedMessage.js +1 -1
- package/cjs-bundle/componentsV2/WellArchivedMessage/WellArchivedMessage.js.map +1 -1
- package/cjs-bundle/componentsV2/index.js +1 -1
- package/cjs-bundle/effects/useOutsideClick.js +1 -1
- package/cjs-bundle/effects/useOutsideClick.js.map +1 -1
- package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js +1 -1
- package/cjs-bundle/testing/AppTestWrapper/AppTestWrapper.js.map +1 -1
- package/cjs-bundle/utils/devcenter.js +1 -1
- package/cjs-bundle/utils/devcenter.js.map +1 -1
- package/cjs-bundle/utils/fetchAttachment.js +2 -0
- package/cjs-bundle/utils/fetchAttachment.js.map +1 -0
- package/cjs-bundle/utils/fileExtension.js +1 -1
- package/cjs-bundle/utils/fileExtension.js.map +1 -1
- package/cjs-bundle/utils/links.js +2 -0
- package/cjs-bundle/utils/links.js.map +1 -0
- 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/AttachmentLightbox/AttachmentDocument.d.ts +6 -0
- package/components/AttachmentLightbox/AttachmentDocument.d.ts.map +1 -0
- package/components/AttachmentLightbox/AttachmentDocument.js +2 -0
- package/components/AttachmentLightbox/AttachmentDocument.js.map +1 -0
- package/components/AttachmentLightbox/AttachmentLightbox.d.ts +9 -8
- package/components/AttachmentLightbox/AttachmentLightbox.d.ts.map +1 -1
- package/components/AttachmentLightbox/AttachmentLightbox.js +1 -1
- package/components/AttachmentLightbox/AttachmentLightbox.js.map +1 -1
- package/components/AttachmentLightbox/AttachmentLightbox.scss.js +1 -1
- package/components/AttachmentLightbox/AttachmentPreviewPane.d.ts +9 -0
- package/components/AttachmentLightbox/AttachmentPreviewPane.d.ts.map +1 -0
- package/components/AttachmentLightbox/AttachmentPreviewPane.js +2 -0
- package/components/AttachmentLightbox/AttachmentPreviewPane.js.map +1 -0
- package/components/AttachmentLightbox/__tests__/AttachmentDocument.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/AttachmentDocument.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/__tests__/AttachmentLightbox.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/AttachmentLightbox.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/__tests__/copyImageToClipboard.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/copyImageToClipboard.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/__tests__/downloadAttachment.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/downloadAttachment.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/__tests__/useZoomPan.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/useZoomPan.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/copyImageToClipboard.d.ts +4 -0
- package/components/AttachmentLightbox/copyImageToClipboard.d.ts.map +1 -0
- package/components/AttachmentLightbox/copyImageToClipboard.js +2 -0
- package/components/AttachmentLightbox/copyImageToClipboard.js.map +1 -0
- package/components/AttachmentLightbox/downloadAttachment.d.ts +10 -0
- package/components/AttachmentLightbox/downloadAttachment.d.ts.map +1 -0
- package/components/AttachmentLightbox/downloadAttachment.js +2 -0
- package/components/AttachmentLightbox/downloadAttachment.js.map +1 -0
- package/components/AttachmentLightbox/useAttachmentLightbox.d.ts +6 -2
- package/components/AttachmentLightbox/useAttachmentLightbox.d.ts.map +1 -1
- package/components/AttachmentLightbox/useAttachmentLightbox.js +1 -1
- package/components/AttachmentLightbox/useAttachmentLightbox.js.map +1 -1
- package/components/AttachmentLightbox/useZoomPan.d.ts +29 -0
- package/components/AttachmentLightbox/useZoomPan.d.ts.map +1 -0
- package/components/AttachmentLightbox/useZoomPan.js +2 -0
- package/components/AttachmentLightbox/useZoomPan.js.map +1 -0
- package/components/AttachmentPreview/AttachmentActionsMenu.d.ts +16 -0
- package/components/AttachmentPreview/AttachmentActionsMenu.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentActionsMenu.js +2 -0
- package/components/AttachmentPreview/AttachmentActionsMenu.js.map +1 -0
- package/components/AttachmentPreview/AttachmentDownloadLink.d.ts +11 -0
- package/components/AttachmentPreview/AttachmentDownloadLink.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentDownloadLink.js +2 -0
- package/components/AttachmentPreview/AttachmentDownloadLink.js.map +1 -0
- package/components/AttachmentPreview/AttachmentImage.d.ts +12 -0
- package/components/AttachmentPreview/AttachmentImage.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentImage.js +2 -0
- package/components/AttachmentPreview/AttachmentImage.js.map +1 -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 +7 -0
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentRow.d.ts +7 -3
- package/components/AttachmentPreview/AttachmentRow.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentRow.js +1 -1
- package/components/AttachmentPreview/AttachmentRow.js.map +1 -1
- package/components/AttachmentPreview/AttachmentTile.d.ts +5 -1
- package/components/AttachmentPreview/AttachmentTile.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentTile.js +1 -1
- package/components/AttachmentPreview/AttachmentTile.js.map +1 -1
- package/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.d.ts.map +1 -0
- package/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.d.ts.map +1 -0
- package/components/AttachmentPreview/__tests__/AttachmentImage.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/AttachmentImage.test.d.ts.map +1 -0
- package/components/AttachmentPreview/__tests__/AttachmentTile.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/AttachmentTile.test.d.ts.map +1 -0
- package/components/AttachmentPreview/__tests__/useStoredAttachments.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/useStoredAttachments.test.d.ts.map +1 -0
- package/components/AttachmentPreview/useStoredAttachment.d.ts +8 -0
- package/components/AttachmentPreview/useStoredAttachment.d.ts.map +1 -1
- package/components/AttachmentPreview/useStoredAttachment.js +2 -0
- package/components/AttachmentPreview/useStoredAttachment.js.map +1 -0
- package/components/AttachmentPreview/useStoredAttachments.d.ts +1 -1
- package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -1
- package/components/AttachmentPreview/useStoredAttachments.js +1 -1
- package/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
- 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/CollapsableSidebar.js +1 -1
- package/components/CollapsableSidebar.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 +2 -0
- package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
- package/components/CommentCard/CommentCardReactions.js +1 -1
- package/components/CommentCard/CommentCardReactions.js.map +1 -1
- package/components/CommentCard/CommentMenu.d.ts.map +1 -1
- package/components/CommentCard/CommentMenu.js +1 -1
- package/components/CommentCard/CommentMenu.js.map +1 -1
- 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.map +1 -1
- package/components/CommentComposer/CommentReplyInput.js +1 -1
- package/components/CommentComposer/CommentReplyInput.js.map +1 -1
- package/components/CommentComposer/ShareToChatRow.js +1 -1
- package/components/CommentComposer/ShareToChatRow.js.map +1 -1
- package/components/CommentComposer/__tests__/useAttachmentUpload.linked.test.d.ts +2 -0
- package/components/CommentComposer/__tests__/useAttachmentUpload.linked.test.d.ts.map +1 -0
- package/components/CommentComposer/useAttachmentUpload.d.ts +1 -0
- 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 +2 -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/__tests__/useFilePaste.test.d.ts +2 -0
- package/components/CommentInputNext/__tests__/useFilePaste.test.d.ts.map +1 -0
- package/components/CommentInputNext/useFilePaste.d.ts +17 -0
- package/components/CommentInputNext/useFilePaste.d.ts.map +1 -0
- package/components/CommentInputNext/useFilePaste.js +2 -0
- package/components/CommentInputNext/useFilePaste.js.map +1 -0
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts +9 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/__tests__/DevCenterAppContainer.registerAITools.test.d.ts +2 -0
- package/components/DevCenter/DevCenterAppContainer/__tests__/DevCenterAppContainer.registerAITools.test.d.ts.map +1 -0
- package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/components/PriorityMenus/PriorityMenus.js.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/effects/useAppMaximized.js.map +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.d.ts.map +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js.map +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/__tests__/useFullscreenModes.test.d.ts +2 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/__tests__/useFullscreenModes.test.d.ts.map +1 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/useFullscreenModes.d.ts +10 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/useFullscreenModes.d.ts.map +1 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/useFullscreenModes.js +2 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/useFullscreenModes.js.map +1 -0
- package/components/DocumentViewer/DocumentViewer.js +1 -1
- package/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/components/Drillstring/BHAComponentDetail/constants.d.ts +2 -2
- 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/FeedItem/FeedItem.js +1 -1
- package/components/FeedItem/FeedItem.js.map +1 -1
- package/components/FeedItem/components/FeedComments.js +1 -1
- package/components/FeedItem/components/FeedComments.js.map +1 -1
- package/components/LinkedText/LinkedText.d.ts +17 -0
- package/components/LinkedText/LinkedText.d.ts.map +1 -0
- package/components/LinkedText/LinkedText.js +2 -0
- package/components/LinkedText/LinkedText.js.map +1 -0
- package/components/LinkedText/LinkedText.scss.js +2 -0
- package/components/LinkedText/LinkedText.scss.js.map +1 -0
- package/components/LinkedText/__tests__/LinkedText.test.d.ts +2 -0
- package/components/LinkedText/__tests__/LinkedText.test.d.ts.map +1 -0
- package/components/LinkedText/index.d.ts +2 -0
- package/components/LinkedText/index.d.ts.map +1 -0
- package/components/NewDocumentViewer/utils.d.ts.map +1 -1
- package/components/NewDocumentViewer/utils.js +1 -1
- package/components/NewDocumentViewer/utils.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/AppHeader/components/HeaderActions/HeaderActions.js +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/HeaderActions/HeaderActions.js.map +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js +1 -1
- package/components/OffsetWellPickerV5/components/AppHeader/components/LoadAllWellsToggle/LoadAllWellsToggle.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/Filter.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/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/PeriodFilterSelect/PeriodFilterSelect.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/SingleFilterSelect/SingleFilterSelect.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/LayerSwitcher/LayerSwitcher.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapControls/MapControls.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHintsStash.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.js +1 -1
- package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/SubjectWellMarker/SubjectWellMarker.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/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AssetResultSection/AssetResultSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/components/AutoCompleteAssetSearch/AutoCompleteAssetSearch.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/CompanyCell/CompanyCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/FormationCell/FormationCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/InterventionAssetCell/InterventionAssetCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/PadNameCell/PadNameCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/RigCell/RigCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/cells/WellNameCell/WellNameCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/SettingsMenu.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/MetricsSettingsSection/MetricsSettingsSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/SettingsMenu/components/TableSettingsSection/TableSettingsSection.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellsTable/components/WellNameHeaderCell/WellNameHeaderCell.js.map +1 -1
- package/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.js +1 -1
- package/components/OffsetWellPickerV5/components/PickerModalActions/PickerModalActions.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/Popover/Popover.js +1 -1
- package/components/Popover/Popover.js.map +1 -1
- package/components/Popper/Popper.js +1 -1
- package/components/Popper/Popper.js.map +1 -1
- package/components/RealTimeValuesSidebar/SidebarFooter.js +1 -1
- package/components/RealTimeValuesSidebar/SidebarFooter.js.map +1 -1
- package/components/UserMention/__tests__/highlightLinks.test.d.ts +2 -0
- package/components/UserMention/__tests__/highlightLinks.test.d.ts.map +1 -0
- package/components/UserMention/constants.d.ts +1 -0
- package/components/UserMention/constants.d.ts.map +1 -1
- package/components/UserMention/constants.js +1 -1
- package/components/UserMention/constants.js.map +1 -1
- package/components/UserMention/index.js +1 -1
- package/components/UserMention/index.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/AppCommonsProvider/AppCommonsContext.d.ts +4 -2
- package/componentsV2/AppCommonsProvider/AppCommonsContext.d.ts.map +1 -1
- package/componentsV2/AppCommonsProvider/AppCommonsContext.js.map +1 -1
- package/componentsV2/AppCommonsProvider/utils.d.ts +1 -1
- package/componentsV2/AppCommonsProvider/utils.d.ts.map +1 -1
- package/componentsV2/AppCommonsProvider/utils.js +1 -1
- package/componentsV2/AppCommonsProvider/utils.js.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.d.ts +4 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.js.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.js +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.js.map +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.d.ts +2 -0
- package/componentsV2/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.js.map +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.scss.js +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts +1 -0
- package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts.map +1 -1
- package/componentsV2/Chip/Chip.d.ts +1 -0
- package/componentsV2/Chip/Chip.d.ts.map +1 -1
- package/componentsV2/Chip/Chip.js +1 -1
- package/componentsV2/Chip/Chip.js.map +1 -1
- package/componentsV2/Chip/Chip.stories.d.ts.map +1 -1
- package/componentsV2/ColorPicker/ColorPicker.d.ts +2 -1
- package/componentsV2/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/componentsV2/ColorPicker/ColorPicker.js +1 -1
- package/componentsV2/ColorPicker/ColorPicker.js.map +1 -1
- package/componentsV2/ColorPicker/ColorPicker.scss.js +1 -1
- package/componentsV2/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
- package/componentsV2/ColorPicker/OpacityDragtracker/OpacityDragtracker.d.ts.map +1 -1
- package/componentsV2/ColorPicker/OpacityDragtracker/OpacityDragtracker.js +1 -1
- package/componentsV2/ColorPicker/OpacityDragtracker/OpacityDragtracker.js.map +1 -1
- package/componentsV2/ColorPicker/Swatches/Swatches.scss.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
- package/componentsV2/InterventionEventSelector/InterventionEventSelector.d.ts +3 -0
- package/componentsV2/InterventionEventSelector/InterventionEventSelector.d.ts.map +1 -0
- package/componentsV2/InterventionEventSelector/InterventionEventSelector.js +2 -0
- package/componentsV2/InterventionEventSelector/InterventionEventSelector.js.map +1 -0
- package/componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js +2 -0
- package/componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js.map +1 -0
- package/componentsV2/InterventionEventSelector/InterventionEventSelector.stories.d.ts +9 -0
- package/componentsV2/InterventionEventSelector/InterventionEventSelector.stories.d.ts.map +1 -0
- package/componentsV2/InterventionEventSelector/__tests__/InterventionEventSelector.test.d.ts +2 -0
- package/componentsV2/InterventionEventSelector/__tests__/InterventionEventSelector.test.d.ts.map +1 -0
- package/componentsV2/InterventionEventSelector/index.d.ts +5 -0
- package/componentsV2/InterventionEventSelector/index.d.ts.map +1 -0
- package/componentsV2/InterventionEventSelector/types.d.ts +22 -0
- package/componentsV2/InterventionEventSelector/types.d.ts.map +1 -0
- package/componentsV2/InterventionEventSelector/useInterventionUnitEvents.d.ts +8 -0
- package/componentsV2/InterventionEventSelector/useInterventionUnitEvents.d.ts.map +1 -0
- package/componentsV2/InterventionEventSelector/useInterventionUnitEvents.js +2 -0
- package/componentsV2/InterventionEventSelector/useInterventionUnitEvents.js.map +1 -0
- package/componentsV2/InterventionEventSelector/utils.d.ts +6 -0
- package/componentsV2/InterventionEventSelector/utils.d.ts.map +1 -0
- package/componentsV2/InterventionEventSelector/utils.js +2 -0
- package/componentsV2/InterventionEventSelector/utils.js.map +1 -0
- package/componentsV2/Modal/Modal.d.ts.map +1 -1
- package/componentsV2/Modal/Modal.js +1 -1
- package/componentsV2/Modal/Modal.js.map +1 -1
- package/componentsV2/Modal/constants.d.ts +3 -0
- package/componentsV2/Modal/constants.d.ts.map +1 -0
- package/componentsV2/Modal/constants.js +2 -0
- package/componentsV2/Modal/constants.js.map +1 -0
- package/componentsV2/WellArchivedMessage/WellArchivedMessage.js +1 -1
- package/componentsV2/WellArchivedMessage/WellArchivedMessage.js.map +1 -1
- package/componentsV2/index.d.ts +1 -0
- package/componentsV2/index.d.ts.map +1 -1
- package/componentsV2/index.js +1 -1
- package/effects/__tests__/useOutsideClick.test.d.ts.map +1 -1
- package/effects/useOutsideClick.d.ts.map +1 -1
- package/effects/useOutsideClick.js +1 -1
- package/effects/useOutsideClick.js.map +1 -1
- package/mcp-server/server.mjs +108 -24
- package/package.json +1 -1
- package/testing/AppTestWrapper/AppTestWrapper.js +1 -1
- package/testing/AppTestWrapper/AppTestWrapper.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/shared/Common.d.ts +9 -0
- package/types/shared/Common.d.ts.map +1 -1
- package/utils/__tests__/fetchAttachment.test.d.ts +2 -0
- package/utils/__tests__/fetchAttachment.test.d.ts.map +1 -0
- package/utils/__tests__/links.test.d.ts +2 -0
- package/utils/__tests__/links.test.d.ts.map +1 -0
- package/utils/devcenter.d.ts +1 -0
- package/utils/devcenter.d.ts.map +1 -1
- package/utils/devcenter.js +1 -1
- package/utils/devcenter.js.map +1 -1
- package/utils/fetchAttachment.d.ts +3 -0
- package/utils/fetchAttachment.d.ts.map +1 -0
- package/utils/fetchAttachment.js +2 -0
- package/utils/fetchAttachment.js.map +1 -0
- package/utils/fileExtension.d.ts.map +1 -1
- package/utils/fileExtension.js +1 -1
- package/utils/fileExtension.js.map +1 -1
- package/utils/links.d.ts +14 -0
- package/utils/links.d.ts.map +1 -0
- package/utils/links.js +2 -0
- package/utils/links.js.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCard.js","sources":["../../../../src/components/CommentCard/CommentCard.tsx"],"sourcesContent":["import { forwardRef, ReactElement, useMemo } from 'react';\nimport { Collapse } from '@material-ui/core';\nimport classNames from 'classnames';\n\nimport { FeedCard, FEED_CARD_MAX_HEIGHT_PX } from '../FeedCard';\nimport { StoredAttachment } from '../AttachmentPreview/useStoredAttachment';\nimport { useStoredAttachments } from '../AttachmentPreview/useStoredAttachments';\nimport { useFeedActivity } from '../FeedCard/useFeedActivity';\nimport { AttachmentPreview } from '../AttachmentPreview';\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { InfoIcon } from '../../icons';\n\nimport { CommentCardReactions } from './CommentCardReactions';\nimport { CommentCardReplies } from './CommentCardReplies';\nimport { CommentCardProps, CommentContextRow } from './CommentCard.types';\n\nimport styles from './CommentCard.scss';\n\nconst MetadataTooltip = ({ rows }: { rows: CommentContextRow[] }) => (\n <div className={styles.metadataRows}>\n {rows.map(({ label, value, unit }) => (\n <div key={label} className={styles.metadataRow}>\n <span className={styles.metadataLabel}>{label}</span>\n <span className={styles.metadataValue}>{value}</span>\n {unit && <span className={styles.metadataUnit}>{unit}</span>}\n </div>\n ))}\n </div>\n);\n\nexport const CommentCard = forwardRef<HTMLDivElement, CommentCardProps>((props, ref) => {\n const {\n activity,\n variant = 'expanded',\n author,\n timestamp,\n subtitle,\n body,\n contextRows,\n attachment,\n storedAttachments,\n isLiked,\n likesCount,\n commentsCount,\n replies,\n hasMoreReplies,\n moreRepliesCount,\n attachments,\n onAttachmentClick,\n attachmentSlot,\n chip,\n chipColor,\n onLike,\n onReplyToggle,\n onForward,\n onShowMoreReplies,\n menuItems,\n isReplyOpen,\n replyInput,\n editForm,\n width,\n onMouseEnter,\n onMouseLeave,\n className,\n testId,\n } = props;\n\n const activityBinding = useFeedActivity(activity, 'comment');\n const cardMenuItems = activityBinding\n ? [...(menuItems ?? []), ...activityBinding.menuItems]\n : menuItems;\n const cardReplyInput = activityBinding ? activityBinding.replyInput : replyInput;\n const cardIsReplyOpen = activityBinding ? activityBinding.isReplyOpen : isReplyOpen;\n const cardReplies = activityBinding ? activityBinding.replies : replies;\n\n const hasFooter = !!(\n activityBinding ||\n onLike ||\n onReplyToggle ||\n onForward ||\n cardMenuItems?.length ||\n contextRows?.length\n );\n\n const info = !!contextRows?.length && (\n <Tooltip\n placement=\"top\"\n className={styles.metadataTooltip}\n title={<MetadataTooltip rows={contextRows} />}\n >\n <span className={styles.infoButton} data-testid=\"comment-card-info\">\n <InfoIcon size={12} strokeWidth={2} />\n </span>\n </Tooltip>\n );\n\n const reactions = (\n <CommentCardReactions\n info={info}\n commentsCount={activityBinding ? activityBinding.commentsCount : commentsCount}\n likesCount={activityBinding ? activityBinding.likesCount : likesCount}\n isLiked={activityBinding ? activityBinding.isLiked : isLiked}\n menuItems={cardMenuItems}\n onLike={activityBinding ? activityBinding.onLike : onLike}\n onReplyToggle={activityBinding ? activityBinding.onReplyToggle : onReplyToggle}\n onForward={onForward}\n />\n );\n\n const bodyRow = (\n <div className={styles.bodyRow}>\n <div className={styles.text}>{body}</div>\n {chip && (\n <span\n className={classNames(styles.chip, !!chipColor && styles.chipAccented)}\n style={chipColor ? { borderLeftColor: chipColor } : undefined}\n >\n {chip}\n </span>\n )}\n </div>\n );\n\n const storedList = useMemo(\n () => storedAttachments ?? ([attachment].filter(Boolean) as StoredAttachment[]),\n [storedAttachments, attachment]\n );\n const storedItems = useStoredAttachments(storedList);\n const items = storedItems.length ? storedItems : attachments;\n\n // Undefined is the norm, which lets AttachmentPreview run its own lightbox; a caller that\n // passes the prop is taking the click over.\n const attachmentPreview = items?.length ? (\n <AttachmentPreview items={items} onItemClick={onAttachmentClick} />\n ) : null;\n\n const surfaceProps = {\n ref,\n width,\n radius: 12,\n onMouseEnter,\n onMouseLeave,\n testId,\n className,\n };\n\n if (activityBinding?.isDeleted) return null;\n const withOverlays = (card: ReactElement) => (\n <>\n {card}\n {activityBinding?.deleteDialog}\n </>\n );\n\n if (variant === 'preview') {\n return withOverlays(\n <FeedCard {...surfaceProps} maxHeight={FEED_CARD_MAX_HEIGHT_PX}>\n <div className={styles.compactBody}>\n <div className={styles.compactTop}>\n <Avatar\n size={24}\n name={author.name}\n imageSrc={author.avatarUrl}\n className={styles.avatar}\n />\n <span className={styles.name}>{author.name}</span>\n <span className={styles.compactTime}>{timestamp}</span>\n </div>\n <div className={styles.scrollBody}>{bodyRow}</div>\n </div>\n {hasFooter && <div className={styles.compactFooter}>{reactions}</div>}\n </FeedCard>\n );\n }\n\n const editing = !!editForm;\n\n const headerEl = (\n <div className={styles.header}>\n <Avatar size={24} name={author.name} imageSrc={author.avatarUrl} className={styles.avatar} />\n <div className={styles.headerText}>\n <div className={styles.nameRow}>\n <span className={styles.name}>{author.name}</span>\n {timestamp && <span className={styles.timestamp}>{timestamp}</span>}\n </div>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </div>\n </div>\n );\n\n if (editing) {\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.editHeader}>{headerEl}</div>\n {editForm}\n </FeedCard>\n );\n }\n\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.capped} style={{ maxHeight: FEED_CARD_MAX_HEIGHT_PX }}>\n <div className={styles.bodySurface}>\n {headerEl}\n\n <div className={styles.scrollBody}>\n {bodyRow}\n {(attachmentPreview || attachmentSlot) && (\n <div className={styles.attachment}>\n {attachmentPreview}\n {attachmentSlot}\n </div>\n )}\n </div>\n </div>\n\n {hasFooter && <div className={styles.footer}>{reactions}</div>}\n </div>\n\n {hasFooter && (\n <Collapse in={cardIsReplyOpen} timeout={250} unmountOnExit>\n <div className={styles.repliesSection}>\n <CommentCardReplies\n replies={cardReplies}\n hasMoreReplies={activityBinding ? activityBinding.hasMoreReplies : hasMoreReplies}\n moreRepliesCount={\n activityBinding ? activityBinding.moreRepliesCount : moreRepliesCount\n }\n isReplyOpen={cardIsReplyOpen}\n replyInput={cardReplyInput}\n onShowMoreReplies={\n activityBinding ? activityBinding.onShowMoreReplies : onShowMoreReplies\n }\n />\n </div>\n </Collapse>\n )}\n </FeedCard>\n );\n});\n"],"names":["MetadataTooltip","_ref","rows","_jsx","className","styles","metadataRows","children","map","_ref2","label","value","unit","_jsxs","metadataRow","jsx","metadataLabel","metadataValue","metadataUnit","CommentCard","forwardRef","props","ref","activity","_props$variant","variant","author","timestamp","subtitle","body","contextRows","attachment","storedAttachments","isLiked","likesCount","commentsCount","replies","hasMoreReplies","moreRepliesCount","attachments","onAttachmentClick","attachmentSlot","chip","chipColor","onLike","onReplyToggle","onForward","onShowMoreReplies","menuItems","isReplyOpen","replyInput","editForm","width","onMouseEnter","onMouseLeave","testId","activityBinding","useFeedActivity","cardMenuItems","cardReplyInput","cardIsReplyOpen","cardReplies","hasFooter","length","info","Tooltip","placement","metadataTooltip","title","infoButton","InfoIcon","size","strokeWidth","reactions","CommentCardReactions","bodyRow","jsxs","text","classNames","chipAccented","style","borderLeftColor","undefined","storedList","useMemo","filter","Boolean","storedItems","useStoredAttachments","items","attachmentPreview","AttachmentPreview","onItemClick","surfaceProps","radius","isDeleted","withOverlays","card","_Fragment","deleteDialog","FeedCard","maxHeight","FEED_CARD_MAX_HEIGHT_PX","compactBody","compactTop","Avatar","name","imageSrc","avatarUrl","avatar","compactTime","scrollBody","compactFooter","editing","headerEl","header","headerText","nameRow","editHeader","capped","bodySurface","footer","Collapse","in","timeout","unmountOnExit","repliesSection","CommentCardReplies"],"mappings":"8hLAmBA,IAAMA,EAAkB,SAAHC,GAAA,IAAMC,IAAAA,KAAI,OAC7BC,EAAAA,IAAA,MAAA,CAAKC,UAAWC,EAAOC,aAAaC,SACjCL,EAAKM,KAAI,SAAAC,GAAA,IAAGC,IAAAA,MAAOC,IAAAA,MAAOC,IAAAA,KAAI,OAC7BC,EAAAA,KAAA,MAAA,CAAiBT,UAAWC,EAAOS,YAAYP,SAC7C,CAAAJ,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOW,cAAcT,SAAEG,IACxCP,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOY,cAAcV,SAAEI,IACvCC,GAAQT,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOa,aAAaX,SAAEK,MAHxCF,OAMR,EAGKS,EAAcC,EAAUA,YAAmC,SAACC,EAAOC,GAC9E,IACEC,EAiCEF,EAjCFE,SAAQC,EAiCNH,EAhCFI,QAAAA,aAAU,WAAUD,EACpBE,EA+BEL,EA/BFK,OACAC,EA8BEN,EA9BFM,UACAC,EA6BEP,EA7BFO,SACAC,EA4BER,EA5BFQ,KACAC,EA2BET,EA3BFS,YACAC,EA0BEV,EA1BFU,WACAC,EAyBEX,EAzBFW,kBACAC,EAwBEZ,EAxBFY,QACAC,EAuBEb,EAvBFa,WACAC,EAsBEd,EAtBFc,cACAC,EAqBEf,EArBFe,QACAC,EAoBEhB,EApBFgB,eACAC,EAmBEjB,EAnBFiB,iBACAC,EAkBElB,EAlBFkB,YACAC,EAiBEnB,EAjBFmB,kBACAC,EAgBEpB,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AAYjH,SAAA,CAChC2G,GAEDrG,EAAA+D,KAAA,MAAA,CAAKxE,UAAWC,EAAO0G,WAAWxG,SAAA,CAC/BoE,IACCe,IAAqBjD,IACrB5B,EAAA+D,KAAA,MAAA,CAAKxE,UAAWC,EAAO0B,WAAWxB,SAC/BmF,CAAAA,GACAjD,WAMRqB,IAAa3D,EAAAY,IAAA,MAAA,CAAKX,UAAWC,EAAOoH,OAAOlH,SAAEkE,QAG/CX,IACC3D,EAAAY,IAAC2G,WAAQ,CAACC,GAAI/D,GAAiBgE,QAAS,IAAKC,eAAa,EAAAtH,SACxDJ,EAAAY,IAAA,MAAA,CAAKX,UAAWC,EAAOyH,eAAevH,SACpCJ,MAAC4H,qBAAkB,CACjB3F,QAASyB,GACTxB,eAAgBmB,EAAkBA,EAAgBnB,eAAiBA,EACnEC,iBACEkB,EAAkBA,EAAgBlB,iBAAmBA,EAEvDW,YAAaW,GACbV,WAAYS,GACZZ,kBACES,EAAkBA,EAAgBT,kBAAoBA,YAQtE"}
|
|
1
|
+
{"version":3,"file":"CommentCard.js","sources":["../../../../src/components/CommentCard/CommentCard.tsx"],"sourcesContent":["import { forwardRef, ReactElement, useMemo } from 'react';\nimport { Collapse } from '@material-ui/core';\nimport classNames from 'classnames';\n\nimport { FeedCard, FEED_CARD_MAX_HEIGHT_PX } from '../FeedCard';\nimport { StoredAttachment } from '../AttachmentPreview/useStoredAttachment';\nimport { useStoredAttachments } from '../AttachmentPreview/useStoredAttachments';\nimport { useFeedActivity } from '../FeedCard/useFeedActivity';\nimport { AttachmentPreview } from '../AttachmentPreview';\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { LinkedText } from '../LinkedText';\nimport { InfoIcon } from '../../icons';\n\nimport { CommentCardReactions } from './CommentCardReactions';\nimport { CommentCardReplies } from './CommentCardReplies';\nimport { CommentCardProps, CommentContextRow } from './CommentCard.types';\n\nimport styles from './CommentCard.scss';\n\nconst MetadataTooltip = ({ rows }: { rows: CommentContextRow[] }) => (\n <div className={styles.metadataRows}>\n {rows.map(({ label, value, unit }) => (\n <div key={label} className={styles.metadataRow}>\n <span className={styles.metadataLabel}>{label}</span>\n <span className={styles.metadataValue}>{value}</span>\n {unit && <span className={styles.metadataUnit}>{unit}</span>}\n </div>\n ))}\n </div>\n);\n\nexport const CommentCard = forwardRef<HTMLDivElement, CommentCardProps>((props, ref) => {\n const {\n activity,\n variant = 'expanded',\n author,\n timestamp,\n subtitle,\n body,\n contextRows,\n attachment,\n storedAttachments,\n isLiked,\n likesCount,\n commentsCount,\n replies,\n hasMoreReplies,\n moreRepliesCount,\n attachments,\n onAttachmentClick,\n onAttachmentShare,\n attachmentSlot,\n chip,\n chipColor,\n onLike,\n onReplyToggle,\n onForward,\n onShowMoreReplies,\n menuItems,\n isReplyOpen,\n replyInput,\n editForm,\n width,\n onMouseEnter,\n onMouseLeave,\n className,\n testId,\n } = props;\n\n const activityBinding = useFeedActivity(activity, 'comment');\n const cardMenuItems = activityBinding\n ? [...(menuItems ?? []), ...activityBinding.menuItems]\n : menuItems;\n const cardReplyInput = activityBinding ? activityBinding.replyInput : replyInput;\n const cardIsReplyOpen = activityBinding ? activityBinding.isReplyOpen : isReplyOpen;\n const cardReplies = activityBinding ? activityBinding.replies : replies;\n\n const hasFooter = !!(\n activityBinding ||\n onLike ||\n onReplyToggle ||\n onForward ||\n cardMenuItems?.length ||\n contextRows?.length\n );\n\n const info = !!contextRows?.length && (\n <Tooltip\n placement=\"top\"\n className={styles.metadataTooltip}\n title={<MetadataTooltip rows={contextRows} />}\n >\n <span className={styles.infoButton} data-testid=\"comment-card-info\">\n <InfoIcon size={12} strokeWidth={2} />\n </span>\n </Tooltip>\n );\n\n const reactions = (\n <CommentCardReactions\n info={info}\n commentsCount={activityBinding ? activityBinding.commentsCount : commentsCount}\n likesCount={activityBinding ? activityBinding.likesCount : likesCount}\n isLiked={activityBinding ? activityBinding.isLiked : isLiked}\n menuItems={cardMenuItems}\n onLike={activityBinding ? activityBinding.onLike : onLike}\n onReplyToggle={activityBinding ? activityBinding.onReplyToggle : onReplyToggle}\n onForward={onForward}\n />\n );\n\n const bodyRow = (\n <div className={styles.bodyRow}>\n <div className={styles.text}>\n <LinkedText>{body}</LinkedText>\n </div>\n {chip && (\n <span\n className={classNames(styles.chip, !!chipColor && styles.chipAccented)}\n style={chipColor ? { borderLeftColor: chipColor } : undefined}\n >\n {chip}\n </span>\n )}\n </div>\n );\n\n const storedList = useMemo(\n () => storedAttachments ?? ([attachment].filter(Boolean) as StoredAttachment[]),\n [storedAttachments, attachment]\n );\n const storedItems = useStoredAttachments(storedList);\n const items = storedItems.length ? storedItems : attachments;\n\n // Undefined is the norm, which lets AttachmentPreview run its own lightbox; a caller that\n // passes the prop is taking the click over.\n const attachmentPreview = items?.length ? (\n <AttachmentPreview items={items} onItemClick={onAttachmentClick} onShare={onAttachmentShare} />\n ) : null;\n\n const surfaceProps = {\n ref,\n width,\n radius: 12,\n onMouseEnter,\n onMouseLeave,\n testId,\n className,\n };\n\n if (activityBinding?.isDeleted) return null;\n const withOverlays = (card: ReactElement) => (\n <>\n {card}\n {activityBinding?.deleteDialog}\n </>\n );\n\n if (variant === 'preview') {\n return withOverlays(\n <FeedCard {...surfaceProps} maxHeight={FEED_CARD_MAX_HEIGHT_PX}>\n <div className={styles.compactBody}>\n <div className={styles.compactTop}>\n <Avatar\n size={24}\n name={author.name}\n imageSrc={author.avatarUrl}\n className={styles.avatar}\n />\n <span className={styles.name}>{author.name}</span>\n <span className={styles.compactTime}>{timestamp}</span>\n </div>\n <div className={styles.scrollBody}>{bodyRow}</div>\n </div>\n {hasFooter && <div className={styles.compactFooter}>{reactions}</div>}\n </FeedCard>\n );\n }\n\n const editing = !!editForm;\n\n const headerEl = (\n <div className={styles.header}>\n <Avatar size={24} name={author.name} imageSrc={author.avatarUrl} className={styles.avatar} />\n <div className={styles.headerText}>\n <div className={styles.nameRow}>\n <span className={styles.name}>{author.name}</span>\n {timestamp && <span className={styles.timestamp}>{timestamp}</span>}\n </div>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </div>\n </div>\n );\n\n if (editing) {\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.editHeader}>{headerEl}</div>\n {editForm}\n </FeedCard>\n );\n }\n\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.capped} style={{ maxHeight: FEED_CARD_MAX_HEIGHT_PX }}>\n <div className={styles.bodySurface}>\n {headerEl}\n\n <div className={styles.scrollBody}>\n {bodyRow}\n {(attachmentPreview || attachmentSlot) && (\n <div className={styles.attachment}>\n {attachmentPreview}\n {attachmentSlot}\n </div>\n )}\n </div>\n </div>\n\n {hasFooter && <div className={styles.footer}>{reactions}</div>}\n </div>\n\n {hasFooter && (\n <Collapse in={cardIsReplyOpen} timeout={250} unmountOnExit>\n <div className={styles.repliesSection}>\n <CommentCardReplies\n replies={cardReplies}\n hasMoreReplies={activityBinding ? activityBinding.hasMoreReplies : hasMoreReplies}\n moreRepliesCount={\n activityBinding ? activityBinding.moreRepliesCount : moreRepliesCount\n }\n isReplyOpen={cardIsReplyOpen}\n replyInput={cardReplyInput}\n onShowMoreReplies={\n activityBinding ? activityBinding.onShowMoreReplies : onShowMoreReplies\n }\n />\n </div>\n </Collapse>\n )}\n </FeedCard>\n );\n});\n"],"names":["MetadataTooltip","_ref","rows","_jsx","className","styles","metadataRows","children","map","_ref2","label","value","unit","_jsxs","metadataRow","jsx","metadataLabel","metadataValue","metadataUnit","CommentCard","forwardRef","props","ref","activity","_props$variant","variant","author","timestamp","subtitle","body","contextRows","attachment","storedAttachments","isLiked","likesCount","commentsCount","replies","hasMoreReplies","moreRepliesCount","attachments","onAttachmentClick","onAttachmentShare","attachmentSlot","chip","chipColor","onLike","onReplyToggle","onForward","onShowMoreReplies","menuItems","isReplyOpen","replyInput","editForm","width","onMouseEnter","onMouseLeave","testId","activityBinding","useFeedActivity","cardMenuItems","cardReplyInput","cardIsReplyOpen","cardReplies","hasFooter","length","info","Tooltip","placement","metadataTooltip","title","infoButton","InfoIcon","size","strokeWidth","reactions","CommentCardReactions","bodyRow","jsxs","text","LinkedText","classNames","chipAccented","style","borderLeftColor","undefined","storedList","useMemo","filter","Boolean","storedItems","useStoredAttachments","items","attachmentPreview","AttachmentPreview","onItemClick","onShare","surfaceProps","radius","isDeleted","withOverlays","card","_Fragment","deleteDialog","FeedCard","maxHeight","FEED_CARD_MAX_HEIGHT_PX","compactBody","compactTop","Avatar","name","imageSrc","avatarUrl","avatar","compactTime","scrollBody","compactFooter","editing","headerEl","header","headerText","nameRow","editHeader","capped","bodySurface","footer","Collapse","in","timeout","unmountOnExit","repliesSection","CommentCardReplies"],"mappings":"8vLAoBA,IAAMA,EAAkB,SAAHC,GAAA,IAAMC,IAAAA,KAAI,OAC7BC,EAAAA,IAAA,MAAA,CAAKC,UAAWC,EAAOC,aAAaC,SACjCL,EAAKM,KAAI,SAAAC,GAAA,IAAGC,IAAAA,MAAOC,IAAAA,MAAOC,IAAAA,KAAI,OAC7BC,EAAAA,KAAA,MAAA,CAAiBT,UAAWC,EAAOS,YAAYP,SAC7C,CAAAJ,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOW,cAAcT,SAAEG,IACxCP,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOY,cAAcV,SAAEI,IACvCC,GAAQT,EAAAY,IAAA,OAAA,CAAMX,UAAWC,EAAOa,aAAaX,SAAEK,MAHxCF,OAMR,EAGKS,EAAcC,EAAUA,YAAmC,SAACC,EAAOC,GAC9E,IACEC,EAkCEF,EAlCFE,SAAQC,EAkCNH,EAjCFI,QAAAA,aAAU,WAAUD,EACpBE,EAgCEL,EAhCFK,OACAC,EA+BEN,EA/BFM,UACAC,EA8BEP,EA9BFO,SACAC,EA6BER,EA7BFQ,KACAC,EA4BET,EA5BFS,YACAC,EA2BEV,EA3BFU,WACAC,EA0BEX,EA1BFW,kBACAC,EAyBEZ,EAzBFY,QACAC,EAwB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,SAAE8G,KACnCjE,MAMLvC,EAACgE,KAAA0B,kBAAaP,IAAY,GAAA,CAAAzF,SACxB,CAAAM,EAAAgE,KAAA,MAAA,CAAKzE,UAAWC,EAAOqH,OAAQxC,MAAO,CAAEsB,UAAWC,EAAAA,yBAA0BlG,SAC3E,CAAAM,EAAAgE,KAAA,MAAA,CAAKzE,UAAWC,EAAOsH,YAAYpH,SAAA,CAChC8G,GAEDxG,EAAAgE,KAAA,MAAA,CAAKzE,UAAWC,EAAO6G,WAAW3G,SAAA,CAC/BqE,IACCgB,IAAqBlD,IACrB7B,EAAAgE,KAAA,MAAA,CAAKzE,UAAWC,EAAO0B,WAAWxB,SAC/BqF,CAAAA,GACAlD,WAMRqB,IAAa5D,EAAAY,IAAA,MAAA,CAAKX,UAAWC,EAAOuH,OAAOrH,SAAEmE,QAG/CX,IACC5D,EAAAY,IAAC8G,WAAQ,CAACC,GAAIjE,GAAiBkE,QAAS,IAAKC,eAAa,EAAAzH,SACxDJ,EAAAY,IAAA,MAAA,CAAKX,UAAWC,EAAO4H,eAAe1H,SACpCJ,MAAC+H,qBAAkB,CACjB9F,QAAS0B,GACTzB,eAAgBoB,GAAkBA,GAAgBpB,eAAiBA,EACnEC,iBACEmB,GAAkBA,GAAgBnB,iBAAmBA,EAEvDY,YAAaW,GACbV,WAAYS,GACZZ,kBACES,GAAkBA,GAAgBT,kBAAoBA,YAQtE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("classnames"),o=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),c=require("../../componentsV2/Tooltip/Tooltip.js"),i=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 n=require("./CommentMenu.js"),e=require("./CommentCard.scss.js"),r=require("react/jsx-runtime");function u(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var t=u(s);exports.CommentCardReactions=function(s){var u=s.info,m=s.commentsCount,a=void 0===m?0:m,j=s.likesCount,I=void 0===j?0:j,l=s.isLiked,q=s.menuItems,d=s.onLike,p=s.onReplyToggle,C=s.onForward;return r.jsxs("div",{className:e.actionsRow,children:[r.jsxs("div",{className:e.actions,children:[p&&r.jsxs("div",{className:e.action,children:[r.jsx(o.ButtonIcon,{size:"xs",type:"tertiary",onClick:p,testId:"comment-card-reply",children:r.jsx(i.MessageIcon,{size:16})}),a>0&&r.jsx("span",{className:e.count,children:a})]}),d&&r.jsxs("div",{className:e.action,children:[r.jsx(o.ButtonIcon,{size:"xs",type:"tertiary",onClick:d,className:t.default(l&&e.liked),testId:"comment-card-like",children:r.jsx(i.ThumbsUpIcon,{size:16})}),I>0&&r.jsx("span",{className:e.count,children:I})]}),C&&r.jsx(c.Tooltip,{title:"Share to Chat",children:r.jsx("span",{children:r.jsx(o.ButtonIcon,{size:"xs",type:"tertiary",onClick:C,testId:"comment-card-forward",children:r.jsx(i.ShareTwoIcon,{size:16})})})})]}),r.jsxs("div",{className:e.trailingActions,children:[u,r.jsx(n.CommentMenu,{items:q,testId:"comment-card-menu"})]})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("classnames"),o=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),c=require("../../componentsV2/Tooltip/Tooltip.js"),i=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 n=require("./CommentMenu.js"),e=require("./CommentCard.scss.js"),r=require("react/jsx-runtime");function u(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var t=u(s);exports.CommentCardReactions=function(s){var u=s.info,m=s.commentsCount,a=void 0===m?0:m,j=s.likesCount,I=void 0===j?0:j,l=s.isLiked,q=s.menuItems,d=s.onLike,p=s.onReplyToggle,C=s.onForward;return r.jsxs("div",{className:e.actionsRow,children:[r.jsxs("div",{className:e.actions,children:[p&&r.jsxs("div",{className:e.action,children:[r.jsx(o.ButtonIcon,{size:"xs",type:"tertiary",onClick:p,testId:"comment-card-reply",children:r.jsx(i.MessageIcon,{size:16})}),a>0&&r.jsx("span",{className:e.count,children:a})]}),d&&r.jsxs("div",{className:e.action,children:[r.jsx(o.ButtonIcon,{size:"xs",type:"tertiary",onClick:d,className:t.default(l&&e.liked),testId:"comment-card-like",children:r.jsx(i.ThumbsUpIcon,{size:16})}),I>0&&r.jsx("span",{className:e.count,children:I})]}),C&&r.jsx(c.Tooltip,{title:"Share to Team Chat",children:r.jsx("span",{children:r.jsx(o.ButtonIcon,{size:"xs",type:"tertiary",onClick:C,testId:"comment-card-forward",children:r.jsx(i.ShareTwoIcon,{size:16})})})})]}),r.jsxs("div",{className:e.trailingActions,children:[u,r.jsx(n.CommentMenu,{items:q,testId:"comment-card-menu"})]})]})};
|
|
2
2
|
//# sourceMappingURL=CommentCardReactions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCardReactions.js","sources":["../../../../src/components/CommentCard/CommentCardReactions.tsx"],"sourcesContent":["import { FC, ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { MessageIcon, ShareTwoIcon, ThumbsUpIcon } from '../../icons';\n\nimport { CommentMenuItem } from './CommentCard.types';\nimport { CommentMenu } from './CommentMenu';\n\nimport styles from './CommentCard.scss';\n\ntype CommentCardReactionsProps = {\n info?: ReactNode;\n commentsCount?: number;\n likesCount?: number;\n isLiked?: boolean;\n menuItems?: CommentMenuItem[];\n onLike?: () => void;\n onReplyToggle?: () => void;\n onForward?: () => void;\n};\n\nexport const CommentCardReactions: FC<CommentCardReactionsProps> = ({\n info,\n commentsCount = 0,\n likesCount = 0,\n isLiked,\n menuItems,\n onLike,\n onReplyToggle,\n onForward,\n}) => {\n return (\n <div className={styles.actionsRow}>\n <div className={styles.actions}>\n {onReplyToggle && (\n <div className={styles.action}>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiary\"\n onClick={onReplyToggle}\n testId=\"comment-card-reply\"\n >\n <MessageIcon size={16} />\n </ButtonIcon>\n {commentsCount > 0 && <span className={styles.count}>{commentsCount}</span>}\n </div>\n )}\n\n {onLike && (\n <div className={styles.action}>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiary\"\n onClick={onLike}\n className={classNames(isLiked && styles.liked)}\n testId=\"comment-card-like\"\n >\n <ThumbsUpIcon size={16} />\n </ButtonIcon>\n {likesCount > 0 && <span className={styles.count}>{likesCount}</span>}\n </div>\n )}\n\n {onForward && (\n <Tooltip title=\"Share to Chat\">\n <span>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiary\"\n onClick={onForward}\n testId=\"comment-card-forward\"\n >\n <ShareTwoIcon size={16} />\n </ButtonIcon>\n </span>\n </Tooltip>\n )}\n </div>\n\n <div className={styles.trailingActions}>\n {info}\n <CommentMenu items={menuItems} testId=\"comment-card-menu\" />\n </div>\n </div>\n );\n};\n"],"names":["_ref","info","_ref$commentsCount","commentsCount","_ref$likesCount","likesCount","isLiked","menuItems","onLike","onReplyToggle","onForward","_jsxs","className","styles","actionsRow","children","jsxs","actions","action","_jsx","ButtonIcon","size","type","onClick","testId","MessageIcon","count","classNames","liked","ThumbsUpIcon","jsx","Tooltip","title","ShareTwoIcon","trailingActions","CommentMenu","items"],"mappings":"gvIAuBmE,SAS7DA,GAAA,IARJC,IAAAA,KAAIC,EAAAF,EACJG,cAAAA,aAAgB,EAACD,EAAAE,EAAAJ,EACjBK,WAAAA,aAAa,EAACD,EACdE,IAAAA,QACAC,IAAAA,UACAC,IAAAA,OACAC,IAAAA,cACAC,IAAAA,UAEA,OACEC,EAAAA,KAAA,MAAA,CAAKC,UAAWC,EAAOC,WAAWC,SAChC,CAAAJ,EAAAK,KAAA,MAAA,CAAKJ,UAAWC,EAAOI,QAAQF,SAAA,CAC5BN,GACCE,EAAAK,KAAA,MAAA,CAAKJ,UAAWC,EAAOK,OAAOH,SAAA,CAC5BI,MAACC,aAAU,CACTC,KAAK,KACLC,KAAK,WACLC,QAASd,EACTe,OAAO,qBAAoBT,SAE3BI,MAACM,cAAW,CAACJ,KAAM,OAEpBlB,EAAgB,GAAKgB,EAAAA,IAAA,OAAA,CAAMP,UAAWC,EAAOa,MAAMX,SAAEZ,OAIzDK,GACCG,EAAAK,KAAA,MAAA,CAAKJ,UAAWC,EAAOK,OAAOH,SAAA,CAC5BI,MAACC,aAAU,CACTC,KAAK,KACLC,KAAK,WACLC,QAASf,EACTI,UAAWe,EAAU,QAACrB,GAAWO,EAAOe,OACxCJ,OAAO,oBAAmBT,SAE1BI,MAACU,eAAY,CAACR,KAAM,OAErBhB,EAAa,GAAKc,EAAAA,IAAA,OAAA,CAAMP,UAAWC,EAAOa,MAAMX,SAAEV,OAItDK,GACCS,EAAAW,IAACC,UAAO,CAACC,MAAM,
|
|
1
|
+
{"version":3,"file":"CommentCardReactions.js","sources":["../../../../src/components/CommentCard/CommentCardReactions.tsx"],"sourcesContent":["import { FC, ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { MessageIcon, ShareTwoIcon, ThumbsUpIcon } from '../../icons';\n\nimport { CommentMenuItem } from './CommentCard.types';\nimport { CommentMenu } from './CommentMenu';\n\nimport styles from './CommentCard.scss';\n\ntype CommentCardReactionsProps = {\n info?: ReactNode;\n commentsCount?: number;\n likesCount?: number;\n isLiked?: boolean;\n menuItems?: CommentMenuItem[];\n onLike?: () => void;\n onReplyToggle?: () => void;\n onForward?: () => void;\n};\n\nexport const CommentCardReactions: FC<CommentCardReactionsProps> = ({\n info,\n commentsCount = 0,\n likesCount = 0,\n isLiked,\n menuItems,\n onLike,\n onReplyToggle,\n onForward,\n}) => {\n return (\n <div className={styles.actionsRow}>\n <div className={styles.actions}>\n {onReplyToggle && (\n <div className={styles.action}>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiary\"\n onClick={onReplyToggle}\n testId=\"comment-card-reply\"\n >\n <MessageIcon size={16} />\n </ButtonIcon>\n {commentsCount > 0 && <span className={styles.count}>{commentsCount}</span>}\n </div>\n )}\n\n {onLike && (\n <div className={styles.action}>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiary\"\n onClick={onLike}\n className={classNames(isLiked && styles.liked)}\n testId=\"comment-card-like\"\n >\n <ThumbsUpIcon size={16} />\n </ButtonIcon>\n {likesCount > 0 && <span className={styles.count}>{likesCount}</span>}\n </div>\n )}\n\n {onForward && (\n <Tooltip title=\"Share to Team Chat\">\n <span>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiary\"\n onClick={onForward}\n testId=\"comment-card-forward\"\n >\n <ShareTwoIcon size={16} />\n </ButtonIcon>\n </span>\n </Tooltip>\n )}\n </div>\n\n <div className={styles.trailingActions}>\n {info}\n <CommentMenu items={menuItems} testId=\"comment-card-menu\" />\n </div>\n </div>\n );\n};\n"],"names":["_ref","info","_ref$commentsCount","commentsCount","_ref$likesCount","likesCount","isLiked","menuItems","onLike","onReplyToggle","onForward","_jsxs","className","styles","actionsRow","children","jsxs","actions","action","_jsx","ButtonIcon","size","type","onClick","testId","MessageIcon","count","classNames","liked","ThumbsUpIcon","jsx","Tooltip","title","ShareTwoIcon","trailingActions","CommentMenu","items"],"mappings":"gvIAuBmE,SAS7DA,GAAA,IARJC,IAAAA,KAAI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perty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),n=require("react"),t=require("@material-ui/icons/MoreVert"),r=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),u=require("../../componentsV2/Menu/Menu.js"),i=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(e),c=o(t);exports.CommentMenu=function(e){var t=e.items,o=e.testId,s=n.useState(!1),a=l.default(s,2),d=a[0],f=a[1],m=n.useRef(null);return null!=t&&t.length?i.jsxs(i.Fragment,{children:[i.jsx(r.ButtonIcon,{size:"xs",type:"tertiary",ref:m,onClick:function(){return f((function(e){return!e}))},testId:o,children:i.jsx(c.default,{fontSize:"inherit"})}),i.jsx(u.Menu,{open:d,placement:"bottom-end",anchorEl:m.current,onClose:function(){return f(!1)},children:t.map((function(e){return i.jsx(u.Menu.Item,{prefix:e.icon,disabled:e.disabled,onClick:function(){f(!1),e.onClick()},children:e.label},e.label)}))})]}):null};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),n=require("react"),t=require("@material-ui/icons/MoreVert"),r=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),u=require("../../componentsV2/Menu/Menu.js"),i=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(e),c=o(t);exports.CommentMenu=function(e){var t=e.items,o=e.testId,s=n.useState(!1),a=l.default(s,2),d=a[0],f=a[1],m=n.useRef(null);return null!=t&&t.length?i.jsxs(i.Fragment,{children:[i.jsx(r.ButtonIcon,{size:"xs",type:"tertiary",ref:m,isActive:d,onClick:function(){return f((function(e){return!e}))},testId:o,children:i.jsx(c.default,{fontSize:"inherit"})}),i.jsx(u.Menu,{open:d,placement:"bottom-end",anchorEl:m.current,onClose:function(){return f(!1)},children:t.map((function(e){return i.jsx(u.Menu.Item,{prefix:e.icon,disabled:e.disabled,onClick:function(){f(!1),e.onClick()},children:e.label},e.label)}))})]}):null};
|
|
2
2
|
//# sourceMappingURL=CommentMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentMenu.js","sources":["../../../../src/components/CommentCard/CommentMenu.tsx"],"sourcesContent":["import { FC, useRef, useState } from 'react';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Menu } from '../../componentsV2/Menu';\n\nimport { CommentMenuItem } from './CommentCard.types';\n\ntype CommentMenuProps = {\n items?: CommentMenuItem[];\n testId?: string;\n};\n\nexport const CommentMenu: FC<CommentMenuProps> = ({ items, testId }) => {\n const [isOpen, setIsOpen] = useState(false);\n const anchorRef = useRef<HTMLButtonElement>(null);\n\n if (!items?.length) return null;\n\n return (\n <>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiary\"\n ref={anchorRef}\n onClick={() => setIsOpen(open => !open)}\n testId={testId}\n >\n <MoreVertIcon fontSize=\"inherit\" />\n </ButtonIcon>\n <Menu\n open={isOpen}\n placement=\"bottom-end\"\n anchorEl={anchorRef.current}\n onClose={() => setIsOpen(false)}\n >\n {items.map(item => (\n <Menu.Item\n key={item.label}\n prefix={item.icon}\n disabled={item.disabled}\n onClick={() => {\n setIsOpen(false);\n item.onClick();\n }}\n >\n {item.label}\n </Menu.Item>\n ))}\n </Menu>\n </>\n );\n};\n"],"names":["_ref","items","testId","useState","_useState2","_slicedToArray","_useState","isOpen","setIsOpen","anchorRef","useRef","length","_jsxs","_Fragment","children","_jsx","ButtonIcon","size","type","ref","onClick","open","MoreVertIcon","fontSize","Menu","placement","anchorEl","current","onClose","map","item","jsx","Item","prefix","icon","disabled","label"],"mappings":"yaAaiD,SAAuBA,GAAA,IAApBC,IAAAA,MAAOC,IAAAA,OAC7BC,EAAAA,EAAQA,UAAC,GAAMC,EAAAC,EAAAA,QAAAC,EAAA,GAApCC,EAAMH,EAAA,GAAEI,EAASJ,EAAA,GAClBK,EAAYC,SAA0B,MAE5C,OAAKT,SAAAA,EAAOU,OAGVC,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACEC,MAACC,aAAU,CACTC,KAAK,KACLC,KAAK,WACLC,IAAKV,EACLW,QAAS,WAAA,
|
|
1
|
+
{"version":3,"file":"CommentMenu.js","sources":["../../../../src/components/CommentCard/CommentMenu.tsx"],"sourcesContent":["import { FC, useRef, useState } from 'react';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Menu } from '../../componentsV2/Menu';\n\nimport { CommentMenuItem } from './CommentCard.types';\n\ntype CommentMenuProps = {\n items?: CommentMenuItem[];\n testId?: string;\n};\n\nexport const CommentMenu: FC<CommentMenuProps> = ({ items, testId }) => {\n const [isOpen, setIsOpen] = useState(false);\n const anchorRef = useRef<HTMLButtonElement>(null);\n\n if (!items?.length) return null;\n\n return (\n <>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiary\"\n ref={anchorRef}\n isActive={isOpen}\n onClick={() => setIsOpen(open => !open)}\n testId={testId}\n >\n <MoreVertIcon fontSize=\"inherit\" />\n </ButtonIcon>\n <Menu\n open={isOpen}\n placement=\"bottom-end\"\n anchorEl={anchorRef.current}\n onClose={() => setIsOpen(false)}\n >\n {items.map(item => (\n <Menu.Item\n key={item.label}\n prefix={item.icon}\n disabled={item.disabled}\n onClick={() => {\n setIsOpen(false);\n item.onClick();\n }}\n >\n {item.label}\n </Menu.Item>\n ))}\n </Menu>\n </>\n );\n};\n"],"names":["_ref","items","testId","useState","_useState2","_slicedToArray","_useState","isOpen","setIsOpen","anchorRef","useRef","length","_jsxs","_Fragment","children","_jsx","ButtonIcon","size","type","ref","isActive","onClick","open","MoreVertIcon","fontSize","Menu","placement","anchorEl","current","onClose","map","item","jsx","Item","prefix","icon","disabled","label"],"mappings":"yaAaiD,SAAuBA,GAAA,IAApBC,IAAAA,MAAOC,IAAAA,OAC7BC,EAAAA,EAAQA,UAAC,GAAMC,EAAAC,EAAAA,QAAAC,EAAA,GAApCC,EAAMH,EAAA,GAAEI,EAASJ,EAAA,GAClBK,EAAYC,SAA0B,MAE5C,OAAKT,SAAAA,EAAOU,OAGVC,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACEC,MAACC,aAAU,CACTC,KAAK,KACLC,KAAK,WACLC,IAAKV,EACLW,SAAUb,EACVc,QAAS,WAAA,OAAMb,GAAU,SAAAc,GAAI,OAAKA,IAAM,EACxCpB,OAAQA,EAAOY,SAEfC,MAACQ,UAAY,CAACC,SAAS,cAEzBT,MAACU,OAAI,CACHH,KAAMf,EACNmB,UAAU,aACVC,SAAUlB,EAAUmB,QACpBC,QAAS,WAAA,OAAMrB,GAAU,EAAO,EAAAM,SAE/Bb,EAAM6B,KAAI,SAAAC,GAAI,OACbhB,EAAAiB,IAACP,EAAIA,KAACQ,KAAI,CAERC,OAAQH,EAAKI,KACbC,SAAUL,EAAKK,SACff,QAAS,WACPb,GAAU,GACVuB,EAAKV,SACL,EAAAP,SAEDiB,EAAKM,OARDN,EAAKM,eAtBO,IAoC7B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("react"),o=require("@material-ui/core"),n=require("@material-ui/icons/AlternateEmail"),i=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),c=require("../../componentsV2/Tooltip/Tooltip.js"),r=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 t=require("../Avatar/index.js"),u=require("../AttachFileButton/AttachFileButton.js"),a=require("../CommentInputNext/CommentInputNext.js"),l=require("../EmojiIconButton.js"),m=require("../FailedFileUploading.js"),j=require("../UserMention/index.js"),d=require("../UserMention/utils/index.js"),p=require("./useAttachmentUpload.js"),q=require("./CommentMetaLine.js"),I=require("./ShareToChatRow.js"),h=require("./CommentComposer.scss.js"),b=require("react/jsx-runtime");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=g(e),v=g(n);function C(e,s){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),o.push.apply(o,n)}return o}function y(e){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?C(Object(o),!0).forEach((function(s){f.default(e,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):C(Object(o)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(o,s))}))}return e}var x={fontSize:14,lineHeight:"20px",suggestions:{backgroundColor:"var(--palette-background-b-9)",list:{backgroundColor:"var(--palette-background-b-9)"},item:{color:"var(--palette-primary-text-1)","&focused":{backgroundColor:"rgb(from var(--palette-primary-text-1) r g b / 0.08)"}}}},F=function(e){return b.jsxs("div",{className:h.suggestion,children:[b.jsx(t.AvatarComponent,{size:26,alt:e.display,imgSrc:e.photo,displayName:e.display}),b.jsx("span",{children:e.display})]})};exports.CommentComposer=function(e){var n=e.body,t=e.onBodyChange,g=e.onSubmit,f=e.canSubmit,C=e.currentUser,O=e.attachments,A=e.onAttachmentsChange,S=e.maxAttachments,P=void 0===S?p.DEFAULT_MAX_ATTACHMENTS:S,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),s=require("react"),o=require("@material-ui/core"),n=require("@material-ui/icons/AlternateEmail"),i=require("../../componentsV2/ButtonIcon/ButtonIcon.js"),c=require("../../componentsV2/Tooltip/Tooltip.js"),r=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 t=require("../Avatar/index.js"),u=require("../AttachFileButton/AttachFileButton.js"),a=require("../CommentInputNext/CommentInputNext.js"),l=require("../EmojiIconButton.js"),m=require("../FailedFileUploading.js"),j=require("../UserMention/index.js"),d=require("../UserMention/utils/index.js"),p=require("./useAttachmentUpload.js"),q=require("./CommentMetaLine.js"),I=require("./ShareToChatRow.js"),h=require("./CommentComposer.scss.js"),b=require("react/jsx-runtime");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=g(e),v=g(n);function C(e,s){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),o.push.apply(o,n)}return o}function y(e){for(var s=1;s<arguments.length;s++){var o=null!=arguments[s]?arguments[s]:{};s%2?C(Object(o),!0).forEach((function(s){f.default(e,s,o[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):C(Object(o)).forEach((function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(o,s))}))}return e}var x={fontSize:14,lineHeight:"20px",suggestions:{backgroundColor:"var(--palette-background-b-9)",list:{backgroundColor:"var(--palette-background-b-9)"},item:{color:"var(--palette-primary-text-1)","&focused":{backgroundColor:"rgb(from var(--palette-primary-text-1) r g b / 0.08)"}}}},F=function(e){return b.jsxs("div",{className:h.suggestion,children:[b.jsx(t.AvatarComponent,{size:26,alt:e.display,imgSrc:e.photo,displayName:e.display}),b.jsx("span",{children:e.display})]})};exports.CommentComposer=function(e){var n=e.body,t=e.onBodyChange,g=e.onSubmit,f=e.canSubmit,C=e.currentUser,O=e.attachments,A=e.onAttachmentsChange,S=e.maxAttachments,P=void 0===S?p.DEFAULT_MAX_ATTACHMENTS:S,k=e.attachment,E=e.onAttachmentChange,M=e.attachmentError,D=e.onAttachmentError,w=e.maxAttachmentSizeBytes,R=e.disabled,U=e.autoFocus,T=e.placeholder,B=void 0===T?"Add a comment...":T,L=e.metaRows,N=e.isMetaSingleLine,z=e.shareToChat,G=e.trailing,_=e.embedded,H=e.className,K=e.testId,W=!!A,V=s.useMemo((function(){return W?null!=O?O:[]:[k].filter(Boolean)}),[W,O,k]),Q=s.useCallback((function(e){var s;A?A(e):null==E||E(null!==(s=e[0])&&void 0!==s?s:null)}),[A,E]),X=p.useAttachmentUpload({value:V,onChange:Q,onError:D,maxSizeBytes:w,maxFiles:W?P:1}),Z=f&&!X.isUploading,$=s.useRef(null);return b.jsx(a.CommentInput,{value:n,canSubmit:Z,disabled:R,onSubmit:g,trailing:G,embedded:_,className:H,testId:K,field:b.jsx(o.Input,{inputComponent:j,inputProps:{onChange:t,currentUser:C,allowEmptyQuery:!0,suggestionsPortalHost:document.querySelector("body"),withLightTheme:!1,mentionProps:{renderSuggestion:F},highlightLinks:!0,style:x},value:n,placeholder:B,inputRef:$,className:h.mentionField,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||Z&&!R&&(d.isSuggestionsListOpened()||(e.preventDefault(),g()))},disableUnderline:!0,rows:1,fullWidth:!0,multiline:!0,autoFocus:U}),attachments:X.items,onAttachmentRemove:X.removeAttachment,onAttachmentRetry:X.handleRetry,onAttachmentReorder:W?X.reorderAttachments:void 0,onFilesDrop:X.addFiles,onImageLinkPaste:X.addLinkedImage,dropLabel:1===X.maxFiles?"Drop a file here":"Drop files here",attachmentSlot:M?b.jsx(m,{errorMessage:M}):void 0,toolbar:b.jsxs(b.Fragment,{children:[b.jsx(u.AttachFileButton,{inputRef:X.fileInputRef,onClick:X.openFileDialog,onFileSelect:X.handleFileSelect,multiple:W,disabled:X.isFull,tooltip:X.isFull?"Up to ".concat(X.maxFiles," ").concat(1===X.maxFiles?"file":"files"," can be attached"):"Attach file"}),b.jsx(c.Tooltip,{title:"Mention someone",children:b.jsx(i.ButtonIcon,{size:"xs",type:"tertiary",onClick:function(){var e,s=$.current;if(s){s.focus();var o=!!s.value&&!/\s$/.test(s.value),n="".concat(s.value).concat(o?" @":"@"),i=null===(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),"value"))||void 0===e?void 0:e.set;null==i||i.call(s,n),s.setSelectionRange(n.length,n.length),s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("keyup",{bubbles:!0}))}},children:b.jsx(v.default,{fontSize:"inherit"})})}),b.jsx("span",{className:h.iconSlot,children:b.jsx(l,{icon:b.jsx(r.SmilingFaceIcon,{size:16}),handleSelectEmoji:function(e){return t("".concat(n).concat(e.native))}})})]}),footer:(!(null==L||!L.length)||!!z)&&b.jsxs(b.Fragment,{children:[b.jsx(q.CommentMetaLine,{rows:null!=L?L:[],singleLine:N}),z&&b.jsx(I.ShareToChatRow,y({},z))]})})};
|
|
2
2
|
//# sourceMappingURL=CommentComposer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentComposer.js","sources":["../../../../src/components/CommentComposer/CommentComposer.tsx"],"sourcesContent":["import {\n CSSProperties,\n FormEventHandler,\n KeyboardEvent,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport { Input } from '@material-ui/core';\nimport AlternateEmailIcon from '@material-ui/icons/AlternateEmail';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { SmilingFaceIcon } from '../../icons';\nimport Avatar from '../Avatar';\nimport { AttachFileButton } from '../AttachFileButton';\nimport { CommentInput } from '../CommentInputNext/CommentInputNext';\nimport EmojiIconButton from '../EmojiIconButton';\nimport FailedFileUploading from '../FailedFileUploading';\nimport UserMention from '../UserMention';\nimport { isSuggestionsListOpened } from '../UserMention/utils';\n\nimport {\n useAttachmentUpload,\n UploadedAttachment,\n DEFAULT_MAX_ATTACHMENTS,\n} from './useAttachmentUpload';\nimport { CommentMetaLine, CommentMetaRow } from './CommentMetaLine';\nimport { ShareToChatRow, ShareToChatRowProps } from './ShareToChatRow';\n\nimport styles from './CommentComposer.scss';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case user payload. */\nexport type CommentComposerUser = {\n id?: number;\n company_id?: number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n [key: string]: unknown;\n};\n/* eslint-enable camelcase */\n\nexport type CommentComposerProps = {\n body: string;\n onBodyChange: (value: string) => void;\n onSubmit: () => void;\n canSubmit: boolean;\n currentUser: CommentComposerUser;\n\n attachments?: UploadedAttachment[];\n onAttachmentsChange?: (attachments: UploadedAttachment[]) => void;\n maxAttachments?: number;\n /** @deprecated Use `attachments` — kept so single-attachment callers keep working. */\n attachment?: UploadedAttachment | null;\n /** @deprecated Use `onAttachmentsChange`. */\n onAttachmentChange?: (attachment: UploadedAttachment | null) => void;\n attachmentError?: string | null;\n onAttachmentError?: (message: string | null) => void;\n maxAttachmentSizeBytes?: number;\n\n disabled?: boolean;\n autoFocus?: boolean;\n placeholder?: string;\n metaRows?: CommentMetaRow[];\n isMetaSingleLine?: boolean;\n shareToChat?: Omit<ShareToChatRowProps, 'testId'>;\n /** Replaces the default send button, e.g. the edit form's Cancel/Save. */\n trailing?: ReactNode;\n /** Render flush inside a host card instead of as its own surface. */\n embedded?: boolean;\n className?: string;\n testId?: string;\n};\n\nconst SUGGESTIONS_BACKGROUND = 'var(--palette-background-b-9)';\n\n// Module-level so react-mentions isn't re-rendered on every keystroke.\nconst MENTION_INPUT_STYLE = {\n fontSize: 14,\n lineHeight: '20px',\n suggestions: {\n backgroundColor: SUGGESTIONS_BACKGROUND,\n list: { backgroundColor: SUGGESTIONS_BACKGROUND },\n item: {\n color: 'var(--palette-primary-text-1)',\n '&focused': { backgroundColor: 'rgb(from var(--palette-primary-text-1) r g b / 0.08)' },\n },\n },\n} as unknown as CSSProperties;\n\nconst renderSuggestion = (entry: { display: string; photo?: string }) => (\n <div className={styles.suggestion}>\n <Avatar size={26} alt={entry.display} imgSrc={entry.photo} displayName={entry.display} />\n <span>{entry.display}</span>\n </div>\n);\n\nexport const CommentComposer = ({\n body,\n onBodyChange,\n onSubmit,\n canSubmit,\n currentUser,\n attachments,\n onAttachmentsChange,\n maxAttachments = DEFAULT_MAX_ATTACHMENTS,\n attachment,\n onAttachmentChange,\n attachmentError,\n onAttachmentError,\n maxAttachmentSizeBytes,\n disabled,\n autoFocus,\n placeholder = 'Add a comment...',\n metaRows,\n isMetaSingleLine,\n shareToChat,\n trailing,\n embedded,\n className,\n testId,\n}: CommentComposerProps) => {\n // Callers still on the singular props get the old one-file behaviour, unchanged.\n const isMulti = !!onAttachmentsChange;\n const value = useMemo(\n () => (isMulti ? attachments ?? [] : ([attachment].filter(Boolean) as UploadedAttachment[])),\n [isMulti, attachments, attachment]\n );\n\n const handleAttachmentsChange = useCallback(\n (next: UploadedAttachment[]) => {\n if (onAttachmentsChange) onAttachmentsChange(next);\n else onAttachmentChange?.(next[0] ?? null);\n },\n [onAttachmentsChange, onAttachmentChange]\n );\n\n const upload = useAttachmentUpload({\n value,\n onChange: handleAttachmentsChange,\n onError: onAttachmentError,\n maxSizeBytes: maxAttachmentSizeBytes,\n maxFiles: isMulti ? maxAttachments : 1,\n });\n\n // An attachment only lands once S3 confirms, so posting mid-upload would drop it.\n const canSend = canSubmit && !upload.isUploading;\n\n const fieldRef = useRef<HTMLTextAreaElement | null>(null);\n\n // react-mentions opens suggestions from textarea events, so type \"@\" instead of setting state.\n const mentionSomeone = () => {\n const field = fieldRef.current;\n if (!field) return;\n\n field.focus();\n\n const needsSpace = !!field.value && !/\\s$/.test(field.value);\n const nextValue = `${field.value}${needsSpace ? ' @' : '@'}`;\n const setValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(field), 'value')?.set;\n\n setValue?.call(field, nextValue);\n field.setSelectionRange(nextValue.length, nextValue.length);\n field.dispatchEvent(new Event('input', { bubbles: true }));\n field.dispatchEvent(new Event('keyup', { bubbles: true }));\n };\n\n const handleEnterKey = (event: KeyboardEvent) => {\n if (event.key !== 'Enter' || event.shiftKey) return;\n if (!canSend || disabled) return;\n if (isSuggestionsListOpened()) return;\n\n event.preventDefault();\n onSubmit();\n };\n\n return (\n <CommentInput\n value={body}\n canSubmit={canSend}\n disabled={disabled}\n onSubmit={onSubmit}\n trailing={trailing}\n embedded={embedded}\n className={className}\n testId={testId}\n field={\n <Input\n inputComponent={UserMention}\n inputProps={{\n // UserMention calls onChange with the text string, not a DOM event.\n onChange: onBodyChange as unknown as FormEventHandler<HTMLInputElement>,\n currentUser,\n allowEmptyQuery: true,\n suggestionsPortalHost: document.querySelector('body'),\n withLightTheme: false,\n mentionProps: { renderSuggestion },\n style: MENTION_INPUT_STYLE,\n }}\n value={body}\n placeholder={placeholder}\n inputRef={fieldRef}\n className={styles.mentionField}\n onKeyDown={handleEnterKey}\n disableUnderline\n rows={1}\n fullWidth\n multiline\n autoFocus={autoFocus}\n />\n }\n attachments={upload.items}\n onAttachmentRemove={upload.removeAttachment}\n onAttachmentRetry={upload.handleRetry}\n onAttachmentReorder={isMulti ? upload.reorderAttachments : undefined}\n onFilesDrop={upload.addFiles}\n dropLabel={upload.maxFiles === 1 ? 'Drop a file here' : 'Drop files here'}\n attachmentSlot={\n attachmentError ? <FailedFileUploading errorMessage={attachmentError} /> : undefined\n }\n toolbar={\n <>\n <AttachFileButton\n inputRef={upload.fileInputRef}\n onClick={upload.openFileDialog}\n onFileSelect={upload.handleFileSelect}\n multiple={isMulti}\n disabled={upload.isFull}\n tooltip={\n upload.isFull\n ? `Up to ${upload.maxFiles} ${\n upload.maxFiles === 1 ? 'file' : 'files'\n } can be attached`\n : 'Attach file'\n }\n />\n <Tooltip title=\"Mention someone\">\n <ButtonIcon size=\"xs\" type=\"tertiary\" onClick={mentionSomeone}>\n <AlternateEmailIcon fontSize=\"inherit\" />\n </ButtonIcon>\n </Tooltip>\n <span className={styles.iconSlot}>\n <EmojiIconButton\n icon={<SmilingFaceIcon size={16} />}\n handleSelectEmoji={(emoji: { native: string }) =>\n onBodyChange(`${body}${emoji.native}`)\n }\n />\n </span>\n </>\n }\n footer={\n (!!metaRows?.length || !!shareToChat) && (\n <>\n <CommentMetaLine rows={metaRows ?? []} singleLine={isMetaSingleLine} />\n {shareToChat && <ShareToChatRow {...shareToChat} />}\n </>\n )\n }\n />\n );\n};\n"],"names":["MENTION_INPUT_STYLE","fontSize","lineHeight","suggestions","backgroundColor","list","item","color","renderSuggestion","entry","_jsxs","className","styles","suggestion","children","_jsx","Avatar","size","alt","display","imgSrc","photo","displayName","jsx","_ref","body","onBodyChange","onSubmit","canSubmit","currentUser","attachments","onAttachmentsChange","_ref$maxAttachments","maxAttachments","DEFAULT_MAX_ATTACHMENTS","attachment","onAttachmentChange","attachmentError","onAttachmentError","maxAttachmentSizeBytes","disabled","autoFocus","_ref$placeholder","placeholder","metaRows","isMetaSingleLine","shareToChat","trailing","embedded","testId","isMulti","value","useMemo","filter","Boolean","handleAttachmentsChange","useCallback","next","_next$","upload","useAttachmentUpload","onChange","onError","maxSizeBytes","maxFiles","canSend","isUploading","fieldRef","useRef","CommentInput","field","Input","inputComponent","UserMention","inputProps","allowEmptyQuery","suggestionsPortalHost","document","querySelector","withLightTheme","mentionProps","style","inputRef","mentionField","onKeyDown","event","key","shiftKey","isSuggestionsListOpened","preventDefault","disableUnderline","rows","fullWidth","multiline","items","onAttachmentRemove","removeAttachment","onAttachmentRetry","handleRetry","onAttachmentReorder","reorderAttachments","undefined","onFilesDrop","addFiles","dropLabel","attachmentSlot","FailedFileUploading","errorMessage","toolbar","jsxs","_Fragment","AttachFileButton","fileInputRef","onClick","openFileDialog","onFileSelect","handleFileSelect","multiple","isFull","tooltip","concat","Tooltip","title","ButtonIcon","type","_Object$getOwnPropert","current","focus","needsSpace","test","nextValue","setValue","Object","getOwnPropertyDescriptor","getPrototypeOf","set","call","setSelectionRange","length","dispatchEvent","Event","bubbles","AlternateEmailIcon","iconSlot","EmojiIconButton","icon","SmilingFaceIcon","handleSelectEmoji","emoji","native","footer","CommentMetaLine","singleLine","ShareToChatRow","_objectSpread"],"mappings":"gxKA4EA,IAGMA,EAAsB,CAC1BC,SAAU,GACVC,WAAY,OACZC,YAAa,CACXC,gBAP2B,gCAQ3BC,KAAM,CAAED,gBARmB,iCAS3BE,KAAM,CACJC,MAAO,gCACP,WAAY,CAAEH,gBAAiB,2DAK/BI,EAAmB,SAACC,GAA0C,OAClEC,EAAAA,KAAA,MAAA,CAAKC,UAAWC,EAAOC,WAAWC,SAAA,CAChCC,MAACC,kBAAM,CAACC,KAAM,GAAIC,IAAKT,EAAMU,QAASC,OAAQX,EAAMY,MAAOC,YAAab,EAAMU,UAC9EJ,EAAAQ,IAAA,OAAA,CAAAT,SAAOL,EAAMU,YACT,0BAGuB,SAwBHK,GAAA,IAvB1BC,IAAAA,KACAC,IAAAA,aACAC,IAAAA,SACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,YACAC,IAAAA,oBAAmBC,EAAAR,EACnBS,eAAAA,aAAiBC,EAAuBA,wBAAAF,EACxCG,IAAAA,WACAC,IAAAA,mBACAC,IAAAA,gBACAC,IAAAA,kBACAC,IAAAA,uBACAC,IAAAA,SACAC,IAAAA,UAASC,EAAAlB,EACTmB,YAAAA,aAAc,mBAAkBD,EAChCE,IAAAA,SACAC,IAAAA,iBACAC,IAAAA,YACAC,IAAAA,SACAC,IAAAA,SACArC,IAAAA,UACAsC,IAAAA,OAGMC,IAAYnB,EACZoB,EAAQC,EAAAA,SACZ,WAAA,OAAOF,EAAUpB,QAAAA,EAAe,GAAM,CAACK,GAAYkB,OAAOC,QAAkC,GAC5F,CAACJ,EAASpB,EAAaK,IAGnBoB,EAA0BC,eAC9B,SAACC,GAA+B,IAAAC,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5D,KAAM/C,QAAAA,EAAY,GAAI4G,WAAY3G,IAClDC,GAAe/B,MAAC0I,EAAAA,eAAcC,EAAA,CAAA,EAAK5G,QAMhD"}
|
|
1
|
+
{"version":3,"file":"CommentComposer.js","sources":["../../../../src/components/CommentComposer/CommentComposer.tsx"],"sourcesContent":["import {\n CSSProperties,\n FormEventHandler,\n KeyboardEvent,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport { Input } from '@material-ui/core';\nimport AlternateEmailIcon from '@material-ui/icons/AlternateEmail';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { SmilingFaceIcon } from '../../icons';\nimport Avatar from '../Avatar';\nimport { AttachFileButton } from '../AttachFileButton';\nimport { CommentInput } from '../CommentInputNext/CommentInputNext';\nimport EmojiIconButton from '../EmojiIconButton';\nimport FailedFileUploading from '../FailedFileUploading';\nimport UserMention from '../UserMention';\nimport { isSuggestionsListOpened } from '../UserMention/utils';\n\nimport {\n useAttachmentUpload,\n UploadedAttachment,\n DEFAULT_MAX_ATTACHMENTS,\n} from './useAttachmentUpload';\nimport { CommentMetaLine, CommentMetaRow } from './CommentMetaLine';\nimport { ShareToChatRow, ShareToChatRowProps } from './ShareToChatRow';\n\nimport styles from './CommentComposer.scss';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case user payload. */\nexport type CommentComposerUser = {\n id?: number;\n company_id?: number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n [key: string]: unknown;\n};\n/* eslint-enable camelcase */\n\nexport type CommentComposerProps = {\n body: string;\n onBodyChange: (value: string) => void;\n onSubmit: () => void;\n canSubmit: boolean;\n currentUser: CommentComposerUser;\n\n attachments?: UploadedAttachment[];\n onAttachmentsChange?: (attachments: UploadedAttachment[]) => void;\n maxAttachments?: number;\n /** @deprecated Use `attachments` — kept so single-attachment callers keep working. */\n attachment?: UploadedAttachment | null;\n /** @deprecated Use `onAttachmentsChange`. */\n onAttachmentChange?: (attachment: UploadedAttachment | null) => void;\n attachmentError?: string | null;\n onAttachmentError?: (message: string | null) => void;\n maxAttachmentSizeBytes?: number;\n\n disabled?: boolean;\n autoFocus?: boolean;\n placeholder?: string;\n metaRows?: CommentMetaRow[];\n isMetaSingleLine?: boolean;\n shareToChat?: Omit<ShareToChatRowProps, 'testId'>;\n /** Replaces the default send button, e.g. the edit form's Cancel/Save. */\n trailing?: ReactNode;\n /** Render flush inside a host card instead of as its own surface. */\n embedded?: boolean;\n className?: string;\n testId?: string;\n};\n\nconst SUGGESTIONS_BACKGROUND = 'var(--palette-background-b-9)';\n\n// Module-level so react-mentions isn't re-rendered on every keystroke.\nconst MENTION_INPUT_STYLE = {\n fontSize: 14,\n lineHeight: '20px',\n suggestions: {\n backgroundColor: SUGGESTIONS_BACKGROUND,\n list: { backgroundColor: SUGGESTIONS_BACKGROUND },\n item: {\n color: 'var(--palette-primary-text-1)',\n '&focused': { backgroundColor: 'rgb(from var(--palette-primary-text-1) r g b / 0.08)' },\n },\n },\n} as unknown as CSSProperties;\n\nconst renderSuggestion = (entry: { display: string; photo?: string }) => (\n <div className={styles.suggestion}>\n <Avatar size={26} alt={entry.display} imgSrc={entry.photo} displayName={entry.display} />\n <span>{entry.display}</span>\n </div>\n);\n\nexport const CommentComposer = ({\n body,\n onBodyChange,\n onSubmit,\n canSubmit,\n currentUser,\n attachments,\n onAttachmentsChange,\n maxAttachments = DEFAULT_MAX_ATTACHMENTS,\n attachment,\n onAttachmentChange,\n attachmentError,\n onAttachmentError,\n maxAttachmentSizeBytes,\n disabled,\n autoFocus,\n placeholder = 'Add a comment...',\n metaRows,\n isMetaSingleLine,\n shareToChat,\n trailing,\n embedded,\n className,\n testId,\n}: CommentComposerProps) => {\n // Callers still on the singular props get the old one-file behaviour, unchanged.\n const isMulti = !!onAttachmentsChange;\n const value = useMemo(\n () => (isMulti ? attachments ?? [] : ([attachment].filter(Boolean) as UploadedAttachment[])),\n [isMulti, attachments, attachment]\n );\n\n const handleAttachmentsChange = useCallback(\n (next: UploadedAttachment[]) => {\n if (onAttachmentsChange) onAttachmentsChange(next);\n else onAttachmentChange?.(next[0] ?? null);\n },\n [onAttachmentsChange, onAttachmentChange]\n );\n\n const upload = useAttachmentUpload({\n value,\n onChange: handleAttachmentsChange,\n onError: onAttachmentError,\n maxSizeBytes: maxAttachmentSizeBytes,\n maxFiles: isMulti ? maxAttachments : 1,\n });\n\n // An attachment only lands once S3 confirms, so posting mid-upload would drop it.\n const canSend = canSubmit && !upload.isUploading;\n\n const fieldRef = useRef<HTMLTextAreaElement | null>(null);\n\n // react-mentions opens suggestions from textarea events, so type \"@\" instead of setting state.\n const mentionSomeone = () => {\n const field = fieldRef.current;\n if (!field) return;\n\n field.focus();\n\n const needsSpace = !!field.value && !/\\s$/.test(field.value);\n const nextValue = `${field.value}${needsSpace ? ' @' : '@'}`;\n const setValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(field), 'value')?.set;\n\n setValue?.call(field, nextValue);\n field.setSelectionRange(nextValue.length, nextValue.length);\n field.dispatchEvent(new Event('input', { bubbles: true }));\n field.dispatchEvent(new Event('keyup', { bubbles: true }));\n };\n\n const handleEnterKey = (event: KeyboardEvent) => {\n if (event.key !== 'Enter' || event.shiftKey) return;\n if (!canSend || disabled) return;\n if (isSuggestionsListOpened()) return;\n\n event.preventDefault();\n onSubmit();\n };\n\n return (\n <CommentInput\n value={body}\n canSubmit={canSend}\n disabled={disabled}\n onSubmit={onSubmit}\n trailing={trailing}\n embedded={embedded}\n className={className}\n testId={testId}\n field={\n <Input\n inputComponent={UserMention}\n inputProps={{\n // UserMention calls onChange with the text string, not a DOM event.\n onChange: onBodyChange as unknown as FormEventHandler<HTMLInputElement>,\n currentUser,\n allowEmptyQuery: true,\n suggestionsPortalHost: document.querySelector('body'),\n withLightTheme: false,\n mentionProps: { renderSuggestion },\n highlightLinks: true,\n style: MENTION_INPUT_STYLE,\n }}\n value={body}\n placeholder={placeholder}\n inputRef={fieldRef}\n className={styles.mentionField}\n onKeyDown={handleEnterKey}\n disableUnderline\n rows={1}\n fullWidth\n multiline\n autoFocus={autoFocus}\n />\n }\n attachments={upload.items}\n onAttachmentRemove={upload.removeAttachment}\n onAttachmentRetry={upload.handleRetry}\n onAttachmentReorder={isMulti ? upload.reorderAttachments : undefined}\n onFilesDrop={upload.addFiles}\n onImageLinkPaste={upload.addLinkedImage}\n dropLabel={upload.maxFiles === 1 ? 'Drop a file here' : 'Drop files here'}\n attachmentSlot={\n attachmentError ? <FailedFileUploading errorMessage={attachmentError} /> : undefined\n }\n toolbar={\n <>\n <AttachFileButton\n inputRef={upload.fileInputRef}\n onClick={upload.openFileDialog}\n onFileSelect={upload.handleFileSelect}\n multiple={isMulti}\n disabled={upload.isFull}\n tooltip={\n upload.isFull\n ? `Up to ${upload.maxFiles} ${\n upload.maxFiles === 1 ? 'file' : 'files'\n } can be attached`\n : 'Attach file'\n }\n />\n <Tooltip title=\"Mention someone\">\n <ButtonIcon size=\"xs\" type=\"tertiary\" onClick={mentionSomeone}>\n <AlternateEmailIcon fontSize=\"inherit\" />\n </ButtonIcon>\n </Tooltip>\n <span className={styles.iconSlot}>\n <EmojiIconButton\n icon={<SmilingFaceIcon size={16} />}\n handleSelectEmoji={(emoji: { native: string }) =>\n onBodyChange(`${body}${emoji.native}`)\n }\n />\n </span>\n </>\n }\n footer={\n (!!metaRows?.length || !!shareToChat) && (\n <>\n <CommentMetaLine rows={metaRows ?? []} singleLine={isMetaSingleLine} />\n {shareToChat && <ShareToChatRow {...shareToChat} />}\n </>\n )\n }\n />\n );\n};\n"],"names":["MENTION_INPUT_STYLE","fontSize","lineHeight","suggestions","backgroundColor","list","item","color","renderSuggestion","entry","_jsxs","className","styles","suggestion","children","_jsx","Avatar","size","alt","display","imgSrc","photo","displayName","jsx","_ref","body","onBodyChange","onSubmit","canSubmit","currentUser","attachments","onAttachmentsChange","_ref$maxAttachments","maxAttachments","DEFAULT_MAX_ATTACHMENTS","attachment","onAttachmentChange","attachmentError","onAttachmentError","maxAttachmentSizeBytes","disabled","autoFocus","_ref$placeholder","placeholder","metaRows","isMetaSingleLine","shareToChat","trailing","embedded","testId","isMulti","value","useMemo","filter","Boolean","handleAttachmentsChange","useCallback","next","_next$","upload","useAttachmentUpload","onChange","onError","maxSizeBytes","maxFiles","canSend","isUploading","fieldRef","useRef","CommentInput","field","Input","inputComponent","UserMention","inputProps","allowEmptyQuery","suggestionsPortalHost","document","querySelector","withLightTheme","mentionProps","highlightLinks","style","inputRef","mentionField","onKeyDown","event","key","shiftKey","isSuggestionsListOpened","preventDefault","disableUnderline","rows","fullWidth","multiline","items","onAttachmentRemove","removeAttachment","onAttachmentRetry","handleRetry","onAttachmentReorder","reorderAttachments","undefined","onFilesDrop","addFiles","onImageLinkPaste","addLinkedImage","dropLabel","attachmentSlot","FailedFileUploading","errorMessage","toolbar","jsxs","_Fragment","AttachFileButton","fileInputRef","onClick","openFileDialog","onFileSelect","handleFileSelect","multiple","isFull","tooltip","concat","Tooltip","title","ButtonIcon","type","_Object$getOwnPropert","current","focus","needsSpace","test","nextValue","setValue","Object","getOwnPropertyDescriptor","getPrototypeOf","set","call","setSelectionRange","length","dispatchEvent","Event","bubbles","AlternateEmailIcon","iconSlot","EmojiIconButton","icon","SmilingFaceIcon","handleSelectEmoji","emoji","native","footer","CommentMetaLine","singleLine","ShareToChatRow","_objectSpread"],"mappings":"gxKA4EA,IAGMA,EAAsB,CAC1BC,SAAU,GACVC,WAAY,OACZC,YAAa,CACXC,gBAP2B,gCAQ3BC,KAAM,CAAED,gBARmB,iCAS3BE,KAAM,CACJC,MAAO,gCACP,WAAY,CAAEH,gBAAiB,2DAK/BI,EAAmB,SAACC,GAA0C,OAClEC,EAAAA,KAAA,MAAA,CAAKC,UAAWC,EAAOC,WAAWC,SAAA,CAChCC,MAACC,kBAAM,CAACC,KAAM,GAAIC,IAAKT,EAAMU,QAASC,OAAQX,EAAMY,MAAOC,YAAab,EAAMU,UAC9EJ,E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jDG,EAAiF,QAAtEC,EAAAA,OAAOC,yBAAyBD,OAAOE,eAAenE,GAAQ,gBAAQ,IAAA0D,OAAA,EAAtEA,EAAwEU,IAEzFJ,SAAAA,EAAUK,KAAKrE,EAAO+D,GACtB/D,EAAMsE,kBAAkBP,EAAUQ,OAAQR,EAAUQ,QACpDvE,EAAMwE,cAAc,IAAIC,MAAM,QAAS,CAAEC,SAAS,KAClD1E,EAAMwE,cAAc,IAAIC,MAAM,QAAS,CAAEC,SAAS,IAXtC,GAsF0DlI,SAC5DC,MAACkI,UAAkB,CAAChJ,SAAS,gBAGjCc,EAAAQ,IAAA,OAAA,CAAMZ,UAAWC,EAAOsI,SAASpI,SAC/BC,MAACoI,EAAe,CACdC,KAAMrI,MAACsI,kBAAe,CAACpI,KAAM,KAC7BqI,kBAAmB,SAACC,GAAyB,OAC3C7H,EAAgBD,GAAAA,OAAAA,UAAO8H,EAAMC,QAAS,SAMhDC,UACK7G,UAAAA,EAAUiG,WAAY/F,IACvBpC,EAAAA,KAAAuG,EAAAA,SAAA,CAAAnG,SAAA,CACEC,MAAC2I,kBAAe,CAAC9D,KAAMhD,QAAAA,EAAY,GAAI+G,WAAY9G,IAClDC,GAAe/B,MAAC6I,EAAAA,eAAcC,EAAA,CAAA,EAAK/G,QAMhD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/slicedToArray"),a=require("@babel/runtime/regenerator"),n=require("react"),r=require("../../componentsV2/Avatar/Avatar.js"),i=require("../AttachFileButton/AttachFileButton.js"),l=require("../CommentInputNext/CommentInputNext.js"),o=require("../FailedFileUploading.js"),u=require("./useAttachmentUpload.js"),s=require("react/jsx-runtime");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(e),m=c(t),p=c(a),h=[];exports.CommentReplyInput=function(e){var t=e.onSubmit,a=e.author,c=e.disabled,f=e.placeholder,v=void 0===f?"Reply":f,b=e.autoFocus,A=void 0===b||b,F=e.maxAttachments,x=e.initialBody,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/slicedToArray"),a=require("@babel/runtime/regenerator"),n=require("react"),r=require("../../componentsV2/Avatar/Avatar.js"),i=require("../AttachFileButton/AttachFileButton.js"),l=require("../CommentInputNext/CommentInputNext.js"),o=require("../FailedFileUploading.js"),u=require("./useAttachmentUpload.js"),s=require("react/jsx-runtime");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(e),m=c(t),p=c(a),h=[];exports.CommentReplyInput=function(e){var t=e.onSubmit,a=e.author,c=e.disabled,f=e.placeholder,v=void 0===f?"Reply":f,b=e.autoFocus,A=void 0===b||b,F=e.maxAttachments,x=e.initialBody,g=void 0===x?"":x,j=e.initialAttachments,q=void 0===j?h:j,y=e.onCancel,S=e.testId,C=n.useState(g),I=m.default(C,2),R=I[0],U=I[1],k=n.useState(q),B=m.default(k,2),w=B[0],D=B[1],L=n.useState(null),M=m.default(L,2),N=M[0],P=M[1],T=u.useAttachmentUpload({value:w,onChange:D,onError:P,maxFiles:F}),_=function(){var e=d.default(p.default.mark((function e(a){return p.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t(a,w);case 2:if(e.t0=e.sent,!1!==e.t0){e.next=5;break}return e.abrupt("return");case 5:U(""),D([]),T.clearAttachments();case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return s.jsx(l.CommentInput,{bare:!0,autoFocus:A,placeholder:v,value:R,onChange:U,canSubmit:!(!R.trim()&&!w.length||T.isUploading),onSubmit:_,onCancel:y,disabled:c,attachments:T.items,onAttachmentRemove:T.removeAttachment,onAttachmentRetry:T.handleRetry,onAttachmentReorder:T.reorderAttachments,onFilesDrop:T.addFiles,onImageLinkPaste:T.addLinkedImage,testId:S,attachmentSlot:N?s.jsx(o,{errorMessage:N}):void 0,toolbar:s.jsx(i.AttachFileButton,{inputRef:T.fileInputRef,onClick:T.openFileDialog,onFileSelect:T.handleFileSelect,multiple:!0,disabled:T.isFull,tooltip:T.isFull?"Up to ".concat(T.maxFiles," files can be attached"):"Attach file"}),leading:s.jsx(r.Avatar,{size:32,name:null==a?void 0:a.name,imageSrc:null==a?void 0:a.avatarUrl})})};
|
|
2
2
|
//# sourceMappingURL=CommentReplyInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentReplyInput.js","sources":["../../../../src/components/CommentComposer/CommentReplyInput.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { AttachFileButton } from '../AttachFileButton';\nimport { CommentInput } from '../CommentInputNext/CommentInputNext';\nimport FailedFileUploading from '../FailedFileUploading';\n\nimport { useAttachmentUpload, UploadedAttachment } from './useAttachmentUpload';\n\nconst EMPTY_ATTACHMENTS: UploadedAttachment[] = [];\n\nexport type CommentReplyInputProps = {\n /** Resolving to `false` keeps the draft, so a failed post can be retried. */\n onSubmit: (\n body: string,\n attachments: UploadedAttachment[]\n ) => void | boolean | Promise<void | boolean>;\n author?: { name?: string; avatarUrl?: string };\n disabled?: boolean;\n placeholder?: string;\n autoFocus?: boolean;\n maxAttachments?: number;\n initialBody?: string;\n initialAttachments?: UploadedAttachment[];\n onCancel?: () => void;\n testId?: string;\n};\n\nexport const CommentReplyInput = ({\n onSubmit,\n author,\n disabled,\n placeholder = 'Reply',\n autoFocus = true,\n maxAttachments,\n initialBody = '',\n initialAttachments = EMPTY_ATTACHMENTS,\n onCancel,\n testId,\n}: CommentReplyInputProps) => {\n const [body, setBody] = useState(initialBody);\n const [attachments, setAttachments] = useState<UploadedAttachment[]>(initialAttachments);\n const [attachmentError, setAttachmentError] = useState<string | null>(null);\n\n const upload = useAttachmentUpload({\n value: attachments,\n onChange: setAttachments,\n onError: setAttachmentError,\n maxFiles: maxAttachments,\n });\n\n const handleSubmit = async (value: string) => {\n if ((await onSubmit(value, attachments)) === false) return;\n\n setBody('');\n setAttachments([]);\n upload.clearAttachments();\n };\n\n return (\n <CommentInput\n bare\n autoFocus={autoFocus}\n placeholder={placeholder}\n value={body}\n onChange={setBody}\n // An attachment only lands once S3 confirms, so posting mid-upload would drop it.\n canSubmit={(!!body.trim() || !!attachments.length) && !upload.isUploading}\n onSubmit={handleSubmit}\n onCancel={onCancel}\n disabled={disabled}\n attachments={upload.items}\n onAttachmentRemove={upload.removeAttachment}\n onAttachmentRetry={upload.handleRetry}\n onAttachmentReorder={upload.reorderAttachments}\n onFilesDrop={upload.addFiles}\n testId={testId}\n attachmentSlot={\n attachmentError ? <FailedFileUploading errorMessage={attachmentError} /> : undefined\n }\n toolbar={\n <AttachFileButton\n inputRef={upload.fileInputRef}\n onClick={upload.openFileDialog}\n onFileSelect={upload.handleFileSelect}\n multiple\n disabled={upload.isFull}\n tooltip={upload.isFull ? `Up to ${upload.maxFiles} files can be attached` : 'Attach file'}\n />\n }\n leading={<Avatar size={32} name={author?.name} imageSrc={author?.avatarUrl} />}\n />\n );\n};\n"],"names":["EMPTY_ATTACHMENTS","_ref","onSubmit","author","disabled","_ref$placeholder","placeholder","_ref$autoFocus","autoFocus","maxAttachments","_ref$initialBody","initialBody","_ref$initialAttachmen","initialAttachments","onCancel","testId","useState","_useState2","_slicedToArray","_useState","body","setBody","_useState4","_useState3","attachments","setAttachments","_useState6","_useState5","attachmentError","setAttachmentError","upload","useAttachmentUpload","value","onChange","onError","maxFiles","handleSubmit","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","wrap","_context","prev","next","t0","sent","abrupt","clearAttachments","stop","_callee","_x","apply","this","arguments","_jsx","CommentInput","bare","canSubmit","trim","length","isUploading","items","onAttachmentRemove","removeAttachment","onAttachmentRetry","handleRetry","onAttachmentReorder","reorderAttachments","onFilesDrop","addFiles","attachmentSlot","jsx","FailedFileUploading","errorMessage","undefined","toolbar","AttachFileButton","inputRef","fileInputRef","onClick","openFileDialog","onFileSelect","handleFileSelect","multiple","isFull","tooltip","leading","Avatar","size","name","imageSrc","avatarUrl"],"mappings":"klBASMA,EAA0C,6BAmBf,SAWHC,GAAA,IAV5BC,IAAAA,SACAC,IAAAA,OACAC,IAAAA,SAAQC,EAAAJ,EACRK,YAAAA,aAAc,QAAOD,EAAAE,EAAAN,EACrBO,UAAAA,cAAgBD,EAChBE,IAAAA,eAAcC,EAAAT,EACdU,YAAAA,aAAc,GAAED,EAAAE,EAAAX,EAChBY,mBAAAA,aAAqBb,EAAiBY,EACtCE,IAAAA,SACAC,IAAAA,OAEwBC,EAAAA,EAAQA,SAACL,GAAYM,EAAAC,EAAAA,QAAAC,EAAA,GAAtCC,EAAIH,EAAA,GAAEI,EAAOJ,EAAA,GACkBD,EAAAA,EAAQA,SAAuBH,GAAmBS,EAAAJ,EAAAA,QAAAK,EAAA,GAAjFC,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GACYN,EAAAA,EAAQA,SAAgB,MAAKU,EAAAR,EAAAA,QAAAS,EAAA,GAApEC,EAAeF,EAAA,GAAEG,EAAkBH,EAAA,GAEpCI,EAASC,EAAAA,oBAAoB,CACjCC,MAAOR,EACPS,SAAUR,EACVS,QAASL,EACTM,SAAU1B,IAGN2B,EAAY,WAAA,IAAAC,EAAAC,EAAAA,QAAAC,EAAAA,QAAAC,MAAG,WAAOR,GAAa,OAAAO,UAAAE,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAE,KAAA,EAC5B1C,EAAS8B,EAAOR,GAAY,KAAA,EAAA,GAAAkB,EAAAG,GAAAH,EAAAI,MAAM,IAANJ,EAAAG,GAAW,CAAAH,EAAAE,KAAA,EAAA,KAAA,CAAA,OAAAF,EAAAK,OAAA,UAAA,KAAA,EAElD1B,EAAQ,IACRI,EAAe,IACfK,EAAOkB,mBAAmB,KAAA,EAAA,IAAA,MAAA,OAAAN,EAAAO,OAAA,GAAAC,EAC3B,KAAA,OAAA,SANiBC,GAAA,OAAAd,EAAAe,MAAAC,KAAAC,UAAA,EAAA,GAQlB,OACEC,EAAAA,IAACC,EAAAA,aAAY,CACXC,MAAI,EACJjD,UAAWA,EACXF,YAAaA,EACb0B,MAAOZ,EACPa,SAAUZ,EAEVqC,aAActC,EAAKuC,SAAYnC,EAAYoC,QAAY9B,EAAO+B,aAC9D3D,SAAUkC,EACVtB,SAAUA,EACVV,SAAUA,EACVoB,YAAaM,EAAOgC,MACpBC,mBAAoBjC,EAAOkC,iBAC3BC,kBAAmBnC,EAAOoC,YAC1BC,oBAAqBrC,EAAOsC,mBAC5BC,YAAavC,EAAOwC,
|
|
1
|
+
{"version":3,"file":"CommentReplyInput.js","sources":["../../../../src/components/CommentComposer/CommentReplyInput.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { AttachFileButton } from '../AttachFileButton';\nimport { CommentInput } from '../CommentInputNext/CommentInputNext';\nimport FailedFileUploading from '../FailedFileUploading';\n\nimport { useAttachmentUpload, UploadedAttachment } from './useAttachmentUpload';\n\nconst EMPTY_ATTACHMENTS: UploadedAttachment[] = [];\n\nexport type CommentReplyInputProps = {\n /** Resolving to `false` keeps the draft, so a failed post can be retried. */\n onSubmit: (\n body: string,\n attachments: UploadedAttachment[]\n ) => void | boolean | Promise<void | boolean>;\n author?: { name?: string; avatarUrl?: string };\n disabled?: boolean;\n placeholder?: string;\n autoFocus?: boolean;\n maxAttachments?: number;\n initialBody?: string;\n initialAttachments?: UploadedAttachment[];\n onCancel?: () => void;\n testId?: string;\n};\n\nexport const CommentReplyInput = ({\n onSubmit,\n author,\n disabled,\n placeholder = 'Reply',\n autoFocus = true,\n maxAttachments,\n initialBody = '',\n initialAttachments = EMPTY_ATTACHMENTS,\n onCancel,\n testId,\n}: CommentReplyInputProps) => {\n const [body, setBody] = useState(initialBody);\n const [attachments, setAttachments] = useState<UploadedAttachment[]>(initialAttachments);\n const [attachmentError, setAttachmentError] = useState<string | null>(null);\n\n const upload = useAttachmentUpload({\n value: attachments,\n onChange: setAttachments,\n onError: setAttachmentError,\n maxFiles: maxAttachments,\n });\n\n const handleSubmit = async (value: string) => {\n if ((await onSubmit(value, attachments)) === false) return;\n\n setBody('');\n setAttachments([]);\n upload.clearAttachments();\n };\n\n return (\n <CommentInput\n bare\n autoFocus={autoFocus}\n placeholder={placeholder}\n value={body}\n onChange={setBody}\n // An attachment only lands once S3 confirms, so posting mid-upload would drop it.\n canSubmit={(!!body.trim() || !!attachments.length) && !upload.isUploading}\n onSubmit={handleSubmit}\n onCancel={onCancel}\n disabled={disabled}\n attachments={upload.items}\n onAttachmentRemove={upload.removeAttachment}\n onAttachmentRetry={upload.handleRetry}\n onAttachmentReorder={upload.reorderAttachments}\n onFilesDrop={upload.addFiles}\n onImageLinkPaste={upload.addLinkedImage}\n testId={testId}\n attachmentSlot={\n attachmentError ? <FailedFileUploading errorMessage={attachmentError} /> : undefined\n }\n toolbar={\n <AttachFileButton\n inputRef={upload.fileInputRef}\n onClick={upload.openFileDialog}\n onFileSelect={upload.handleFileSelect}\n multiple\n disabled={upload.isFull}\n tooltip={upload.isFull ? `Up to ${upload.maxFiles} files can be attached` : 'Attach file'}\n />\n }\n leading={<Avatar size={32} name={author?.name} imageSrc={author?.avatarUrl} />}\n />\n );\n};\n"],"names":["EMPTY_ATTACHMENTS","_ref","onSubmit","author","disabled","_ref$placeholder","placeholder","_ref$autoFocus","autoFocus","maxAttachments","_ref$initialBody","initialBody","_ref$initialAttachmen","initialAttachments","onCancel","testId","useState","_useState2","_slicedToArray","_useState","body","setBody","_useState4","_useState3","attachments","setAttachments","_useState6","_useState5","attachmentError","setAttachmentError","upload","useAttachmentUpload","value","onChange","onError","maxFiles","handleSubmit","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","wrap","_context","prev","next","t0","sent","abrupt","clearAttachments","stop","_callee","_x","apply","this","arguments","_jsx","CommentInput","bare","canSubmit","trim","length","isUploading","items","onAttachmentRemove","removeAttachment","onAttachmentRetry","handleRetry","onAttachmentReorder","reorderAttachments","onFilesDrop","addFiles","onImageLinkPaste","addLinkedImage","attachmentSlot","jsx","FailedFileUploading","errorMessage","undefined","toolbar","AttachFileButton","inputRef","fileInputRef","onClick","openFileDialog","onFileSelect","handleFileSelect","multiple","isFull","tooltip","leading","Avatar","size","name","imageSrc","avatarUrl"],"mappings":"klBASMA,EAA0C,6BAmBf,SAWHC,GAAA,IAV5BC,IAAAA,SACAC,IAAAA,OACAC,IAAAA,SAAQC,EAAAJ,EACRK,YAAAA,aAAc,QAAOD,EAAAE,EAAAN,EACrBO,UAAAA,cAAgBD,EAChBE,IAAAA,eAAcC,EAAAT,EACdU,YAAAA,aAAc,GAAED,EAAAE,EAAAX,EAChBY,mBAAAA,aAAqBb,EAAiBY,EACtCE,IAAAA,SACAC,IAAAA,OAEwBC,EAAAA,EAAQA,SAACL,GAAYM,EAAAC,EAAAA,QAAAC,EAAA,GAAtCC,EAAIH,EAAA,GAAEI,EAAOJ,EAAA,GACkBD,EAAAA,EAAQA,SAAuBH,GAAmBS,EAAAJ,EAAAA,QAAAK,EAAA,GAAjFC,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GACYN,EAAAA,EAAQA,SAAgB,MAAKU,EAAAR,EAAAA,QAAAS,EAAA,GAApEC,EAAeF,EAAA,GAAEG,EAAkBH,EAAA,GAEpCI,EAASC,EAAAA,oBAAoB,CACjCC,MAAOR,EACPS,SAAUR,EACVS,QAASL,EACTM,SAAU1B,IAGN2B,EAAY,WAAA,IAAAC,EAAAC,EAAAA,QAAAC,EAAAA,QAAAC,MAAG,WAAOR,GAAa,OAAAO,UAAAE,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,OAAAF,EAAAE,KAAA,EAC5B1C,EAAS8B,EAAOR,GAAY,KAAA,EAAA,GAAAkB,EAAAG,GAAAH,EAAAI,MAAM,IAANJ,EAAAG,GAAW,CAAAH,EAAAE,KAAA,EAAA,KAAA,CAAA,OAAAF,EAAAK,OAAA,UAAA,KAAA,EAElD1B,EAAQ,IACRI,EAAe,IACfK,EAAOkB,mBAAmB,KAAA,EAAA,IAAA,MAAA,OAAAN,EAAAO,OAAA,GAAAC,EAC3B,KAAA,OAAA,SANiBC,GAAA,OAAAd,EAAAe,MAAAC,KAAAC,UAAA,EAAA,GAQlB,OACEC,EAAAA,IAACC,EAAAA,aAAY,CACXC,MAAI,EACJjD,UAAWA,EACXF,YAAaA,EACb0B,MAAOZ,EACPa,SAAUZ,EAEVqC,aAActC,EAAKuC,SAAYnC,EAAYoC,QAAY9B,EAAO+B,aAC9D3D,SAAUkC,EACVtB,SAAUA,EACVV,SAAUA,EACVoB,YAAaM,EAAOgC,MACpBC,mBAAoBjC,EAAOkC,iBAC3BC,kBAAmBnC,EAAOoC,YAC1BC,oBAAqBrC,EAAOsC,mBAC5BC,YAAavC,EAAOwC,SACpBC,iBAAkBzC,EAAO0C,eACzBzD,OAAQA,EACR0D,eACE7C,EAAkB2B,EAAAmB,IAACC,EAAmB,CAACC,aAAchD,SAAsBiD,EAE7EC,QACEvB,MAACwB,mBAAgB,CACfC,SAAUlD,EAAOmD,aACjBC,QAASpD,EAAOqD,eAChBC,aAActD,EAAOuD,iBACrBC,UAAQ,EACRlF,SAAU0B,EAAOyD,OACjBC,QAAS1D,EAAOyD,uBAAkBzD,EAAOK,SAAmC,0BAAA,gBAGhFsD,QAASlC,MAACmC,SAAM,CAACC,KAAM,GAAIC,KAAMzF,aAAAA,EAAAA,EAAQyF,KAAMC,SAAU1F,aAAM,EAANA,EAAQ2F,aAGvE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../componentsV2/Checkbox/Checkbox.js"),a=require("./ChatChannelSelector.js"),n=require("./ShareToChatRow.scss.js"),s=require("react/jsx-runtime");exports.ShareToChatRow=function(h){var r=h.checked,l=h.onChange,c=h.channels,t=h.selectedChannel,o=h.onChannelChange,i=h.isChannelSelectDisabled,C=h.label,d=void 0===C?"Share in Chat":C,u=h.testId;return s.jsxs("div",{className:n.row,"data-testid":u,children:[s.jsx("div",{className:n.checkbox,children:s.jsx(e.Checkbox,{size:"small",checked:r,onChange:l,label:d})}),r&&s.jsx(a.ChatChannelSelector,{channels:c,value:t,onChange:o,disabled:i})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../componentsV2/Checkbox/Checkbox.js"),a=require("./ChatChannelSelector.js"),n=require("./ShareToChatRow.scss.js"),s=require("react/jsx-runtime");exports.ShareToChatRow=function(h){var r=h.checked,l=h.onChange,c=h.channels,t=h.selectedChannel,o=h.onChannelChange,i=h.isChannelSelectDisabled,C=h.label,d=void 0===C?"Share in Team Chat":C,u=h.testId;return s.jsxs("div",{className:n.row,"data-testid":u,children:[s.jsx("div",{className:n.checkbox,children:s.jsx(e.Checkbox,{size:"small",checked:r,onChange:l,label:d})}),r&&s.jsx(a.ChatChannelSelector,{channels:c,value:t,onChange:o,disabled:i})]})};
|
|
2
2
|
//# sourceMappingURL=ShareToChatRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareToChatRow.js","sources":["../../../../src/components/CommentComposer/ShareToChatRow.tsx"],"sourcesContent":["import { Checkbox } from '../../componentsV2/Checkbox';\n\nimport { ChatChannel, ChatChannelSelector } from './ChatChannelSelector';\n\nimport styles from './ShareToChatRow.scss';\n\nexport type ShareToChatRowProps = {\n checked: boolean;\n onChange: (checked: boolean) => void;\n channels: ChatChannel[];\n selectedChannel: ChatChannel | null;\n onChannelChange: (channel: ChatChannel) => void;\n isChannelSelectDisabled?: boolean;\n label?: string;\n testId?: string;\n};\n\nexport const ShareToChatRow = ({\n checked,\n onChange,\n channels,\n selectedChannel,\n onChannelChange,\n isChannelSelectDisabled,\n label = 'Share in Chat',\n testId,\n}: ShareToChatRowProps) => (\n <div className={styles.row} data-testid={testId}>\n <div className={styles.checkbox}>\n <Checkbox size=\"small\" checked={checked} onChange={onChange} label={label} />\n </div>\n {checked && (\n <ChatChannelSelector\n channels={channels}\n value={selectedChannel}\n onChange={onChannelChange}\n disabled={isChannelSelectDisabled}\n />\n )}\n </div>\n);\n"],"names":["_ref","checked","onChange","channels","selectedChannel","onChannelChange","isChannelSelectDisabled","_ref$label","label","testId","_jsxs","className","styles","row","children","_jsx","jsx","checkbox","Checkbox","size","ChatChannelSelector","value","disabled"],"mappings":"+PAiB8B,SAAHA,GAAA,IACzBC,IAAAA,QACAC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,gBACAC,IAAAA,gBACAC,IAAAA,wBAAuBC,EAAAP,EACvBQ,MAAAA,aAAQ,
|
|
1
|
+
{"version":3,"file":"ShareToChatRow.js","sources":["../../../../src/components/CommentComposer/ShareToChatRow.tsx"],"sourcesContent":["import { Checkbox } from '../../componentsV2/Checkbox';\n\nimport { ChatChannel, ChatChannelSelector } from './ChatChannelSelector';\n\nimport styles from './ShareToChatRow.scss';\n\nexport type ShareToChatRowProps = {\n checked: boolean;\n onChange: (checked: boolean) => void;\n channels: ChatChannel[];\n selectedChannel: ChatChannel | null;\n onChannelChange: (channel: ChatChannel) => void;\n isChannelSelectDisabled?: boolean;\n label?: string;\n testId?: string;\n};\n\nexport const ShareToChatRow = ({\n checked,\n onChange,\n channels,\n selectedChannel,\n onChannelChange,\n isChannelSelectDisabled,\n label = 'Share in Team Chat',\n testId,\n}: ShareToChatRowProps) => (\n <div className={styles.row} data-testid={testId}>\n <div className={styles.checkbox}>\n <Checkbox size=\"small\" checked={checked} onChange={onChange} label={label} />\n </div>\n {checked && (\n <ChatChannelSelector\n channels={channels}\n value={selectedChannel}\n onChange={onChannelChange}\n disabled={isChannelSelectDisabled}\n />\n )}\n </div>\n);\n"],"names":["_ref","checked","onChange","channels","selectedChannel","onChannelChange","isChannelSelectDisabled","_ref$label","label","testId","_jsxs","className","styles","row","children","_jsx","jsx","checkbox","Checkbox","size","ChatChannelSelector","value","disabled"],"mappings":"+PAiB8B,SAAHA,GAAA,IACzBC,IAAAA,QACAC,IAAAA,SACAC,IAAAA,SACAC,IAAAA,gBACAC,IAAAA,gBACAC,IAAAA,wBAAuBC,EAAAP,EACvBQ,MAAAA,aAAQ,qBAAoBD,EAC5BE,IAAAA,OAAM,OAENC,EAAAA,KAAA,MAAA,CAAKC,UAAWC,EAAOC,IAAK,cAAaJ,EAAOK,SAC9C,CAAAC,EAAAC,IAAA,MAAA,CAAKL,UAAWC,EAAOK,SAASH,SAC9BC,MAACG,WAAQ,CAACC,KAAK,QAAQlB,QAASA,EAASC,SAAUA,EAAUM,MAAOA,MAErEP,GACCc,EAAAC,IAACI,sBAAmB,CAClBjB,SAAUA,EACVkB,MAAOjB,EACPF,SAAUG,EACViB,SAAUhB,MAGV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/toConsumableArray"),r=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),u=require("@babel/runtime/regenerator"),i=require("react"),l=require("react-s3-uploader/s3upload"),o=require("../AttachmentPreview/getAttachmentKind.js"),a=require("../AttachFileButton/AttachFileButton.js"),c=require("../../clients/jsonApi/index.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/toConsumableArray"),r=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),u=require("@babel/runtime/regenerator"),i=require("react"),l=require("react-s3-uploader/s3upload"),o=require("../AttachmentPreview/getAttachmentKind.js"),a=require("../AttachFileButton/AttachFileButton.js"),c=require("../../clients/jsonApi/index.js"),f=require("../../utils/links.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=s(e),p=s(r),v=s(n),m=s(t),h=s(u),g=s(l);function b(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function U(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?b(Object(n),!0).forEach((function(r){v.default(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var w=function(e){return e.type.startsWith("image/")?"image":e.type.startsWith("video/")?"video":"file"},k=function(e){return(e/1048576).toFixed(1)},y=function(e){return{id:e.url,name:e.name,file:null,previewUrl:"",isUploading:!1,error:null,uploaded:e}},j=0,C=function(){return"attachment-".concat(j+=1)};exports.DEFAULT_MAX_ATTACHMENTS=10,exports.useAttachmentUpload=function(e){var r,n,t=e.value,u=e.onChange,l=e.onError,s=e.maxSizeBytes,v=e.maxFiles,b=void 0===v?10:v,j=e.accept,O=void 0===j?a.ACCEPTED_ATTACHMENT_TYPES:j,A=i.useState([]),E=m.default(A,2),S=E[0],R=E[1],F=i.useRef(null),x=i.useRef(new Map),L=i.useRef(new Map),P=i.useRef([]),T=i.useRef(u),q=i.useRef(l);T.current=u,q.current=l;var z=i.useRef([]),M=i.useCallback((function(e){var r=e(P.current);P.current=r,R(r),z.current=function(e){return e.map((function(e){return e.uploaded})).filter(Boolean)}(r),T.current(z.current)}),[]),D=i.useCallback((function(e,r){return M((function(n){return n.map((function(n){return n.id===e?U(U({},n),r):n}))}))}),[M]),B=i.useCallback((function(e){var r,n;null===(r=x.current.get(e))||void 0===r||r.abortUpload(),x.current.delete(e),L.current.set(e,(null!==(n=L.current.get(e))&&void 0!==n?n:0)+1)}),[]),_=i.useCallback((function(e){null!=e&&e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}),[]),W=i.useCallback((function(){var e,r,n;null===(e=q.current)||void 0===e||e.call(q,null!==(r=null===(n=P.current.find((function(e){return e.error})))||void 0===n?void 0:n.error)&&void 0!==r?r:null)}),[]);i.useEffect((function(){return function(){x.current.forEach((function(e){return e.abortUpload()})),x.current.clear(),P.current.forEach((function(e){e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}))}}),[]);var K=i.useCallback((function(e,r){var n,t=(null!==(n=L.current.get(e))&&void 0!==n?n:0)+1;L.current.set(e,t);var u,i,l=function(){return L.current.get(e)===t},o=function(r){var n;l()&&(D(e,{isUploading:!1,error:r}),null===(n=q.current)||void 0===n||n.call(q,r))},a="",f=new g.default({files:[r],preprocess:function(e,r){return r(e)},onProgress:function(){},getSignedUrl:(i=p.default(h.default.mark((function e(r,n){var t;return h.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.getS3SignedUrl(r.name,r.type);case 3:t=e.sent,a=t.file_name,n(U(U({},t),{},{signedUrl:t.signed_url})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),o((null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to upload the file");case 11:case"end":return e.stop()}}),e,null,[[0,8]])}))),function(e,r){return i.apply(this,arguments)}),onFinishS3Put:(u=p.default(h.default.mark((function n(){var t,u;return h.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,c.getS3DownloadLink(a);case 3:if(t=n.sent,u=t.url,l()){n.next=7;break}return n.abrupt("return");case 7:x.current.delete(e),D(e,{isUploading:!1,error:null,uploaded:{url:u,name:a,size:r.size}}),W(),n.next=15;break;case 12:n.prev=12,n.t0=n.catch(0),o((null===n.t0||void 0===n.t0?void 0:n.t0.message)||"Failed to upload the file");case 15:case"end":return n.stop()}}),n,null,[[0,12]])}))),function(){return u.apply(this,arguments)}),onError:function(e){return o(e||"Failed to upload the file")}});x.current.set(e,f)}),[D,W]),N=i.useCallback((function(e){var r,n=f.getUrlFileName(e);n&&(P.current.length>=b?null===(r=q.current)||void 0===r||r.call(q,"You can attach up to ".concat(b," files.")):P.current.some((function(r){var n;return(null===(n=r.uploaded)||void 0===n?void 0:n.url)===e}))||M((function(r){return[].concat(d.default(r),[{id:C(),name:n,file:null,previewUrl:e,isUploading:!1,error:null,uploaded:{url:e,name:n}}])})))}),[M,b]),Y=i.useCallback((function(e){var r,n,t,u,i=e.filter((function(e){return function(e,r){return r.split(",").map((function(e){return e.trim().toLowerCase()})).filter(Boolean).some((function(r){if(r.startsWith("."))return e.name.toLowerCase().endsWith(r);if(r.endsWith("/*")){var n=e.type.toLowerCase();return n?n.startsWith(r.slice(0,-1)):o.getAttachmentKind({name:e.name})===r.slice(0,-1)}return e.type.toLowerCase()===r}))}(e,O)})),l=i.length<e.length?1===e.length?"That file type is not supported.":"Some files were skipped — unsupported file type.":null,a="You can attach up to ".concat(b," files."),c=b-P.current.length;if(!i.length||c<=0){var f;null===(f=q.current)||void 0===f||f.call(q,i.length?a:l)}else{var p=i.slice(0,c),v=p.map((function(e){var r=w(e),n=!!s&&e.size>s;return{id:C(),name:e.name,file:e,previewUrl:"file"===r?"":URL.createObjectURL(e),isUploading:!n,error:n?"File is too large (".concat(k(e.size)," MB). Maximum size is ").concat(k(s)," MB."):null,uploaded:null}}));M((function(e){return[].concat(d.default(e),d.default(v))}));var m=i.length>p.length?a:null;null===(r=q.current)||void 0===r||r.call(q,null!==(n=null!==(t=null===(u=P.current.find((function(e){return e.error})))||void 0===u?void 0:u.error)&&void 0!==t?t:l)&&void 0!==n?n:m),v.filter((function(e){return!e.error})).forEach((function(e){return K(e.id,e.file)}))}}),[M,b,s,K,O]),H=i.useCallback((function(e){var r,n=Array.from(null!==(r=e.target.files)&&void 0!==r?r:[]);F.current&&(F.current.value=""),n.length&&Y(n)}),[Y]),I=i.useCallback((function(){var e;return null===(e=F.current)||void 0===e?void 0:e.click()}),[]),G=i.useCallback((function(e){var r=String(e);B(r),_(P.current.find((function(e){return e.id===r}))),M((function(e){return e.filter((function(e){return e.id!==r}))})),W()}),[B,_,M,W]),X=i.useCallback((function(e){var r=String(e),n=P.current.find((function(e){return e.id===r}));null!=n&&n.file&&(B(r),D(r,{isUploading:!0,error:null}),W(),K(r,n.file))}),[B,D,K,W]),J=i.useCallback((function(e){return M((function(r){var n=new Map(r.map((function(e){return[e.id,e]}))),t=e.map((function(e){return n.get(String(e))})).filter(Boolean),u=r.filter((function(r){return!e.some((function(e){return String(e)===r.id}))}));return[].concat(d.default(t),d.default(u))}))}),[M]),Q=i.useCallback((function(){var e;P.current.forEach((function(e){B(e.id),_(e)})),M((function(){return[]})),null===(e=q.current)||void 0===e||e.call(q,null)}),[B,M,_]);i.useEffect((function(){var e,r,n;(r=z.current,n=t,r.length===n.length&&r.every((function(e,r){return e.url===n[r].url})))||(P.current.forEach((function(e){B(e.id),e.previewUrl&&URL.revokeObjectURL(e.previewUrl)})),P.current=t.map(y),z.current=t,R(P.current),null===(e=q.current)||void 0===e||e.call(q,null))}),[t,B]);var V=i.useState({}),Z=m.default(V,2),$=Z[0],ee=Z[1],re=i.useRef($);re.current=$;var ne=S.filter((function(e){return!e.file&&!e.previewUrl&&e.uploaded})).map((function(e){return e.uploaded.name})).join("|");return i.useEffect((function(){var e=ne.split("|").filter((function(e){return e&&!(e in re.current)}));if(e.length){var r=!0;return Promise.all(e.map((function(e){return c.getS3DownloadLink(e,"inline").then((function(r){var n=r.url;return[e,n]})).catch((function(r){return console.error('Failed to sign stored attachment "'.concat(e,'"'),r),[e,""]}))}))).then((function(e){r&&ee((function(r){return U(U({},r),Object.fromEntries(e))}))})),function(){r=!1}}}),[ne]),{items:S.reduce((function(e,r){var n;if(r.file)return e.push({id:r.id,name:r.name,src:r.previewUrl,kind:w(r.file),size:r.file.size,isUploading:r.isUploading,error:null!==(n=r.error)&&void 0!==n?n:void 0}),e;var t=r.uploaded,u=o.getAttachmentKind(t),i=r.previewUrl||$[t.name];return"file"===u||i?(e.push({id:r.id,name:t.name,src:i,kind:u,size:t.size}),e):e}),[]),fileInputRef:F,openFileDialog:I,handleFileSelect:H,addFiles:Y,addLinkedImage:N,removeAttachment:G,handleRetry:X,reorderAttachments:J,clearAttachments:Q,isUploading:S.some((function(e){return e.isUploading})),error:null!==(r=null===(n=S.find((function(e){return e.error})))||void 0===n?void 0:n.error)&&void 0!==r?r:null,count:S.length,isFull:S.length>=b,maxFiles:b}};
|
|
2
2
|
//# sourceMappingURL=useAttachmentUpload.js.map
|