@corva/ui 3.71.0-9 → 3.72.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/AddComment/Popover.js +1 -1
- package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
- package/cjs-bundle/components/AttachFileButton/AttachFileButton.js +1 -1
- package/cjs-bundle/components/AttachFileButton/AttachFileButton.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/SortableAttachments.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/SortableAttachments.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/StoredAttachmentPreview.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/StoredAttachmentPreview.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -0
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentCardReplies.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCardReplies.js.map +1 -1
- package/cjs-bundle/components/CommentCard/buildCommentReply.js +1 -1
- package/cjs-bundle/components/CommentCard/buildCommentReply.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/CommentReplyInput.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentReplyInput.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
- package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.js +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.js.map +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.scss.js +1 -1
- package/cjs-bundle/components/CommentInputNext/useFileDrop.js +2 -0
- package/cjs-bundle/components/CommentInputNext/useFileDrop.js.map +1 -0
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/cjs-bundle/components/FeedCard/useActivityInteractions.js +1 -1
- package/cjs-bundle/components/FeedCard/useActivityInteractions.js.map +1 -1
- package/cjs-bundle/components/FeedCard/useFeedActivity.js +1 -1
- package/cjs-bundle/components/FeedCard/useFeedActivity.js.map +1 -1
- package/cjs-bundle/components/IconMenu/index.js +1 -1
- package/cjs-bundle/components/IconMenu/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/cjs-bundle/components/index.js +1 -1
- package/cjs-bundle/componentsV2/AppContainer/AppContainer.scss.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.scss.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/Autocomplete.scss.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/AutocompleteMenuItem.js +1 -1
- package/cjs-bundle/componentsV2/Autocomplete/AutocompleteMenuItem.js.map +1 -1
- package/cjs-bundle/componentsV2/Checkbox/Checkbox.js +1 -1
- package/cjs-bundle/componentsV2/Checkbox/Checkbox.js.map +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/ColorPicker.scss.js +1 -1
- package/cjs-bundle/componentsV2/Menu/Menu.scss.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuDivider/MenuDivider.scss.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.js.map +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuGroup/MenuGroup.scss.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.js +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.js.map +1 -1
- package/cjs-bundle/componentsV2/Menu/MenuItem/MenuItem.scss.js +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.scss.js +1 -1
- package/cjs-bundle/componentsV2/Paper/Paper.js +1 -1
- package/cjs-bundle/componentsV2/Paper/Paper.js.map +1 -1
- package/cjs-bundle/componentsV2/Paper/Paper.scss.js +1 -1
- package/cjs-bundle/componentsV2/Popover/Popover.js +1 -1
- package/cjs-bundle/componentsV2/Popover/Popover.js.map +1 -1
- package/cjs-bundle/componentsV2/Radio/Radio.js +1 -1
- package/cjs-bundle/componentsV2/Radio/Radio.js.map +1 -1
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js +2 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js.map +1 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js +2 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js.map +1 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.js +2 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.js.map +1 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js +2 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js.map +1 -0
- package/cjs-bundle/componentsV2/RadioAndCheckboxLabel/RadioAndCheckboxLabel.scss.js +1 -1
- package/cjs-bundle/componentsV2/Tabs/Tabs.js +1 -1
- package/cjs-bundle/componentsV2/Tabs/Tabs.js.map +1 -1
- package/cjs-bundle/componentsV2/Tabs/Tabs.scss.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/ShareModal/ShareModal.scss.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/TemplatesTreeMenuHeader/TemplatesTreeMenuHeader.scss.js +1 -1
- package/cjs-bundle/componentsV2/TemplatesControl/Toggle/Toggle.scss.js +1 -1
- package/cjs-bundle/config/theme/checkboxOverrides.js +1 -1
- package/cjs-bundle/config/theme/checkboxOverrides.js.map +1 -1
- package/cjs-bundle/config/theme/index.js +1 -1
- package/cjs-bundle/config/theme/index.js.map +1 -1
- package/cjs-bundle/config/theme/radioOverrides.js +1 -1
- package/cjs-bundle/config/theme/radioOverrides.js.map +1 -1
- package/cjs-bundle/constants/attachments.js +2 -0
- package/cjs-bundle/constants/attachments.js.map +1 -0
- package/cjs-bundle/constants/index.js +1 -1
- package/components/AddComment/Popover.js +1 -1
- package/components/AddComment/Popover.js.map +1 -1
- package/components/AddComment/components/Content.js +1 -1
- package/components/AddComment/components/Content.js.map +1 -1
- package/components/AttachFileButton/AttachFileButton.d.ts +2 -1
- package/components/AttachFileButton/AttachFileButton.d.ts.map +1 -1
- package/components/AttachFileButton/AttachFileButton.js +1 -1
- package/components/AttachFileButton/AttachFileButton.js.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.d.ts +4 -0
- package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts +2 -0
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentRow.d.ts +5 -0
- package/components/AttachmentPreview/AttachmentRow.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentRow.js +2 -0
- package/components/AttachmentPreview/AttachmentRow.js.map +1 -0
- package/components/AttachmentPreview/AttachmentTile.d.ts +9 -0
- package/components/AttachmentPreview/AttachmentTile.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentTile.js +2 -0
- package/components/AttachmentPreview/AttachmentTile.js.map +1 -0
- package/components/AttachmentPreview/SortableAttachments.d.ts +8 -0
- package/components/AttachmentPreview/SortableAttachments.d.ts.map +1 -0
- package/components/AttachmentPreview/SortableAttachments.js +2 -0
- package/components/AttachmentPreview/SortableAttachments.js.map +1 -0
- package/components/AttachmentPreview/StoredAttachmentPreview.d.ts +3 -3
- package/components/AttachmentPreview/StoredAttachmentPreview.d.ts.map +1 -1
- package/components/AttachmentPreview/StoredAttachmentPreview.js +1 -1
- package/components/AttachmentPreview/StoredAttachmentPreview.js.map +1 -1
- package/components/AttachmentPreview/index.d.ts +3 -0
- package/components/AttachmentPreview/index.d.ts.map +1 -1
- package/components/AttachmentPreview/useStoredAttachments.d.ts +8 -0
- package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -0
- package/components/AttachmentPreview/useStoredAttachments.js +2 -0
- package/components/AttachmentPreview/useStoredAttachments.js.map +1 -0
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/components/CommentCard/CommentCard.d.ts.map +1 -1
- package/components/CommentCard/CommentCard.js +1 -1
- package/components/CommentCard/CommentCard.js.map +1 -1
- package/components/CommentCard/CommentCard.types.d.ts +5 -1
- package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
- package/components/CommentCard/CommentCardReplies.js +1 -1
- package/components/CommentCard/CommentCardReplies.js.map +1 -1
- package/components/CommentCard/__tests__/buildCommentReply.test.d.ts +2 -0
- package/components/CommentCard/__tests__/buildCommentReply.test.d.ts.map +1 -0
- package/components/CommentCard/buildCommentReply.d.ts +15 -7
- package/components/CommentCard/buildCommentReply.d.ts.map +1 -1
- package/components/CommentCard/buildCommentReply.js +1 -1
- package/components/CommentCard/buildCommentReply.js.map +1 -1
- package/components/CommentComposer/CommentComposer.d.ts +8 -3
- package/components/CommentComposer/CommentComposer.d.ts.map +1 -1
- package/components/CommentComposer/CommentComposer.js +1 -1
- package/components/CommentComposer/CommentComposer.js.map +1 -1
- package/components/CommentComposer/CommentReplyInput.d.ts +6 -2
- package/components/CommentComposer/CommentReplyInput.d.ts.map +1 -1
- package/components/CommentComposer/CommentReplyInput.js +1 -1
- package/components/CommentComposer/CommentReplyInput.js.map +1 -1
- package/components/CommentComposer/useAttachmentUpload.d.ts +15 -6
- package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
- package/components/CommentComposer/useAttachmentUpload.js +1 -1
- package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
- package/components/CommentInputNext/CommentInputNext.d.ts +6 -0
- package/components/CommentInputNext/CommentInputNext.d.ts.map +1 -1
- package/components/CommentInputNext/CommentInputNext.js +1 -1
- package/components/CommentInputNext/CommentInputNext.js.map +1 -1
- package/components/CommentInputNext/CommentInputNext.scss.js +1 -1
- package/components/CommentInputNext/useFileDrop.d.ts +17 -0
- package/components/CommentInputNext/useFileDrop.d.ts.map +1 -0
- package/components/CommentInputNext/useFileDrop.js +2 -0
- package/components/CommentInputNext/useFileDrop.js.map +1 -0
- package/components/DocumentViewer/DocumentViewer.js +1 -1
- package/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/components/FeedCard/useActivityInteractions.d.ts +9 -2
- package/components/FeedCard/useActivityInteractions.d.ts.map +1 -1
- package/components/FeedCard/useActivityInteractions.js +1 -1
- package/components/FeedCard/useActivityInteractions.js.map +1 -1
- package/components/FeedCard/useFeedActivity.d.ts.map +1 -1
- package/components/FeedCard/useFeedActivity.js +1 -1
- package/components/FeedCard/useFeedActivity.js.map +1 -1
- package/components/IconMenu/index.d.ts +1 -1
- package/components/IconMenu/index.js +1 -1
- package/components/IconMenu/index.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
- package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
- package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js +1 -1
- package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
- package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.map +1 -1
- package/components/index.js +1 -1
- package/componentsV2/AppContainer/AppContainer.scss.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.scss.js +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js +1 -1
- package/componentsV2/Autocomplete/Autocomplete.d.ts +5 -1
- package/componentsV2/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/componentsV2/Autocomplete/Autocomplete.js +1 -1
- package/componentsV2/Autocomplete/Autocomplete.js.map +1 -1
- package/componentsV2/Autocomplete/Autocomplete.scss.js +1 -1
- package/componentsV2/Autocomplete/AutocompleteMenuItem.d.ts +7 -3
- package/componentsV2/Autocomplete/AutocompleteMenuItem.d.ts.map +1 -1
- package/componentsV2/Autocomplete/AutocompleteMenuItem.js +1 -1
- package/componentsV2/Autocomplete/AutocompleteMenuItem.js.map +1 -1
- package/componentsV2/Autocomplete/AutocompleteNext.stories.d.ts.map +1 -1
- package/componentsV2/Checkbox/Checkbox.d.ts.map +1 -1
- package/componentsV2/Checkbox/Checkbox.js +1 -1
- package/componentsV2/Checkbox/Checkbox.js.map +1 -1
- package/componentsV2/ColorPicker/ColorPicker.scss.js +1 -1
- package/componentsV2/Menu/Menu.scss.js +1 -1
- package/componentsV2/Menu/Menu.stories.d.ts +1 -0
- package/componentsV2/Menu/Menu.stories.d.ts.map +1 -1
- package/componentsV2/Menu/MenuDivider/MenuDivider.scss.js +1 -1
- package/componentsV2/Menu/MenuGroup/MenuGroup.js +1 -1
- package/componentsV2/Menu/MenuGroup/MenuGroup.js.map +1 -1
- package/componentsV2/Menu/MenuGroup/MenuGroup.scss.js +1 -1
- package/componentsV2/Menu/MenuItem/MenuItem.d.ts +2 -0
- package/componentsV2/Menu/MenuItem/MenuItem.d.ts.map +1 -1
- package/componentsV2/Menu/MenuItem/MenuItem.js +1 -1
- package/componentsV2/Menu/MenuItem/MenuItem.js.map +1 -1
- package/componentsV2/Menu/MenuItem/MenuItem.scss.js +1 -1
- package/componentsV2/PadModeSelect/PadModeSelect.scss.js +1 -1
- package/componentsV2/Paper/Paper.d.ts.map +1 -1
- package/componentsV2/Paper/Paper.js +1 -1
- package/componentsV2/Paper/Paper.js.map +1 -1
- package/componentsV2/Paper/Paper.scss.js +1 -1
- package/componentsV2/Popover/Popover.d.ts.map +1 -1
- package/componentsV2/Popover/Popover.js +1 -1
- package/componentsV2/Popover/Popover.js.map +1 -1
- package/componentsV2/Radio/Radio.d.ts.map +1 -1
- package/componentsV2/Radio/Radio.js +1 -1
- package/componentsV2/Radio/Radio.js.map +1 -1
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.d.ts +5 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.d.ts.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js +2 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.js.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js +2 -0
- package/componentsV2/RadioAndCheckboxIcons/CheckboxIcon.scss.js.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.d.ts +2 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.d.ts.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.js +2 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.js.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js +2 -0
- package/componentsV2/RadioAndCheckboxIcons/RadioIcon.scss.js.map +1 -0
- package/componentsV2/RadioAndCheckboxIcons/index.d.ts +3 -0
- package/componentsV2/RadioAndCheckboxIcons/index.d.ts.map +1 -0
- package/componentsV2/RadioAndCheckboxLabel/RadioAndCheckboxLabel.scss.js +1 -1
- package/componentsV2/Tabs/Tabs.d.ts +1 -0
- package/componentsV2/Tabs/Tabs.d.ts.map +1 -1
- package/componentsV2/Tabs/Tabs.js +1 -1
- package/componentsV2/Tabs/Tabs.js.map +1 -1
- package/componentsV2/Tabs/Tabs.scss.js +1 -1
- package/componentsV2/Tabs/Tabs.stories.d.ts +1 -1
- package/componentsV2/Tabs/Tabs.stories.d.ts.map +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.d.ts.map +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.js +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.js.map +1 -1
- package/componentsV2/TemplatesControl/ShareModal/ShareModal.scss.js +1 -1
- package/componentsV2/TemplatesControl/TemplatesTreeMenuHeader/TemplatesTreeMenuHeader.scss.js +1 -1
- package/componentsV2/TemplatesControl/Toggle/Toggle.scss.js +1 -1
- package/config/theme/checkboxOverrides.d.ts +0 -9
- package/config/theme/checkboxOverrides.d.ts.map +1 -1
- package/config/theme/checkboxOverrides.js +1 -1
- package/config/theme/checkboxOverrides.js.map +1 -1
- package/config/theme/index.d.ts.map +1 -1
- package/config/theme/index.js +1 -1
- package/config/theme/index.js.map +1 -1
- package/config/theme/radioOverrides.d.ts +3 -15
- package/config/theme/radioOverrides.d.ts.map +1 -1
- package/config/theme/radioOverrides.js +1 -1
- package/config/theme/radioOverrides.js.map +1 -1
- package/constants/attachments.d.ts +2 -0
- package/constants/attachments.d.ts.map +1 -0
- package/constants/attachments.js +2 -0
- package/constants/attachments.js.map +1 -0
- package/constants/index.d.ts +2 -1
- package/constants/index.d.ts.map +1 -1
- package/constants/index.js +1 -1
- package/mcp-server/server.mjs +79 -11
- package/package.json +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js +0 -2
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js.map +0 -1
- package/components/AttachmentPreview/useStoredAttachment.js +0 -2
- package/components/AttachmentPreview/useStoredAttachment.js.map +0 -1
|
@@ -23,6 +23,7 @@ export type CommentReply = {
|
|
|
23
23
|
author: CommentAuthor;
|
|
24
24
|
timestamp: string;
|
|
25
25
|
body: ReactNode;
|
|
26
|
+
editForm?: ReactNode;
|
|
26
27
|
menuItems?: CommentMenuItem[];
|
|
27
28
|
};
|
|
28
29
|
export type CommentCardProps = {
|
|
@@ -40,8 +41,11 @@ export type CommentCardProps = {
|
|
|
40
41
|
replies?: CommentReply[];
|
|
41
42
|
hasMoreReplies?: boolean;
|
|
42
43
|
moreRepliesCount?: number;
|
|
43
|
-
/** The card signs and renders
|
|
44
|
+
/** The card signs and renders these itself. */
|
|
45
|
+
storedAttachments?: StoredAttachment[];
|
|
46
|
+
/** @deprecated Use `storedAttachments`. */
|
|
44
47
|
attachment?: StoredAttachment | null;
|
|
48
|
+
/** Already-signed items, when the caller handles the round trip. */
|
|
45
49
|
attachments?: AttachmentPreviewItem[];
|
|
46
50
|
onAttachmentClick?: (item: AttachmentPreviewItem) => void;
|
|
47
51
|
attachmentSlot?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCard.types.d.ts","sourceRoot":"","sources":["../../../src/components/CommentCard/CommentCard.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACjC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAElC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,
|
|
1
|
+
{"version":3,"file":"CommentCard.types.d.ts","sourceRoot":"","sources":["../../../src/components/CommentCard/CommentCard.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,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AAI,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAE9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Avatar as o}from"../../componentsV2/Avatar/Avatar.js";import{ButtonText as s}from"../../componentsV2/ButtonText/ButtonText.js";import{DownSmallIcon as c}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{CommentMenu as i}from"./CommentMenu.js";import n from"./CommentCard.scss.js";import{jsxs as t,jsx as m}from"react/jsx-runtime";var r=function(r){var e=r.replies,p=r.hasMoreReplies,u=r.moreRepliesCount,a=r.replyInput,l=r.onShowMoreReplies;return t("div",{className:n.replies,children:[a,null==e?void 0:e.map((function(s){return t("div",{className:n.reply,children:[t("div",{className:n.replyHeader,children:[m(o,{size:32,name:s.author.name,imageSrc:s.author.avatarUrl}),t("div",{className:n.replyNameRow,children:[m("span",{className:n.replyName,children:s.author.name}),m("span",{className:n.replyTimestamp,children:s.timestamp})]}),m(i,{items:s.menuItems,testId:"comment-reply-menu"})]}),m("div",{className:n.replyText,children:s.body})]},s.id)})),p&&l&&m(s,{type:"primary",size:"medium",prefix:m(c,{size:16}),onClick:l,children:u?"Show ".concat(u," More Comments"):"Show More Comments"})]})};export{r as CommentCardReplies};
|
|
1
|
+
import{Avatar as o}from"../../componentsV2/Avatar/Avatar.js";import{ButtonText as s}from"../../componentsV2/ButtonText/ButtonText.js";import{DownSmallIcon as c}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{CommentMenu as i}from"./CommentMenu.js";import n from"./CommentCard.scss.js";import{jsxs as t,jsx as m}from"react/jsx-runtime";var r=function(r){var e=r.replies,p=r.hasMoreReplies,u=r.moreRepliesCount,a=r.replyInput,l=r.onShowMoreReplies;return t("div",{className:n.replies,children:[a,null==e?void 0:e.map((function(s){var c;return t("div",{className:n.reply,children:[t("div",{className:n.replyHeader,children:[m(o,{size:32,name:s.author.name,imageSrc:s.author.avatarUrl}),t("div",{className:n.replyNameRow,children:[m("span",{className:n.replyName,children:s.author.name}),m("span",{className:n.replyTimestamp,children:s.timestamp})]}),m(i,{items:s.menuItems,testId:"comment-reply-menu"})]}),m("div",{className:n.replyText,children:null!==(c=s.editForm)&&void 0!==c?c:s.body})]},s.id)})),p&&l&&m(s,{type:"primary",size:"medium",prefix:m(c,{size:16}),onClick:l,children:u?"Show ".concat(u," More Comments"):"Show More Comments"})]})};export{r as CommentCardReplies};
|
|
2
2
|
//# sourceMappingURL=CommentCardReplies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCardReplies.js","sources":["../../../src/components/CommentCard/CommentCardReplies.tsx"],"sourcesContent":["import { FC } from 'react';\n\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { ButtonText } from '../../componentsV2/ButtonText';\nimport { DownSmallIcon } from '../../icons';\n\nimport { CommentReply } from './CommentCard.types';\nimport { CommentMenu } from './CommentMenu';\n\nimport styles from './CommentCard.scss';\n\ntype CommentCardRepliesProps = {\n replies?: CommentReply[];\n hasMoreReplies?: boolean;\n moreRepliesCount?: number;\n isReplyOpen?: boolean;\n replyInput?: React.ReactNode;\n onShowMoreReplies?: () => void;\n};\n\nexport const CommentCardReplies: FC<CommentCardRepliesProps> = ({\n replies,\n hasMoreReplies,\n moreRepliesCount,\n replyInput,\n onShowMoreReplies,\n}) => (\n <div className={styles.replies}>\n {replyInput}\n\n {replies?.map(reply => (\n <div key={reply.id} className={styles.reply}>\n <div className={styles.replyHeader}>\n <Avatar size={32} name={reply.author.name} imageSrc={reply.author.avatarUrl} />\n <div className={styles.replyNameRow}>\n <span className={styles.replyName}>{reply.author.name}</span>\n <span className={styles.replyTimestamp}>{reply.timestamp}</span>\n </div>\n <CommentMenu items={reply.menuItems} testId=\"comment-reply-menu\" />\n </div>\n <div className={styles.replyText}>{reply.body}</div>\n </div>\n ))}\n\n {hasMoreReplies && onShowMoreReplies && (\n <ButtonText\n type=\"primary\"\n size=\"medium\"\n prefix={<DownSmallIcon size={16} />}\n onClick={onShowMoreReplies}\n >\n {moreRepliesCount ? `Show ${moreRepliesCount} More Comments` : 'Show More Comments'}\n </ButtonText>\n )}\n </div>\n);\n"],"names":["CommentCardReplies","_ref","replies","hasMoreReplies","moreRepliesCount","replyInput","onShowMoreReplies","_jsxs","className","styles","children","map","reply","replyHeader","_jsx","Avatar","size","name","author","imageSrc","avatarUrl","replyNameRow","replyName","replyTimestamp","timestamp","CommentMenu","items","menuItems","testId","replyText","body","id","ButtonText","type","prefix","DownSmallIcon","onClick"],"mappings":"05HAoBaA,IAAAA,EAAkD,SAAHC,GAAA,IAC1DC,IAAAA,QACAC,IAAAA,eACAC,IAAAA,iBACAC,IAAAA,WACAC,IAAAA,kBAAiB,OAEjBC,EAAA,MAAA,CAAKC,UAAWC,EAAOP,QAAQQ,SAC5BL,CAAAA,EAEAH,aAAAA,EAAAA,EAASS,KAAI,SAAAC,GAAK,
|
|
1
|
+
{"version":3,"file":"CommentCardReplies.js","sources":["../../../src/components/CommentCard/CommentCardReplies.tsx"],"sourcesContent":["import { FC } from 'react';\n\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { ButtonText } from '../../componentsV2/ButtonText';\nimport { DownSmallIcon } from '../../icons';\n\nimport { CommentReply } from './CommentCard.types';\nimport { CommentMenu } from './CommentMenu';\n\nimport styles from './CommentCard.scss';\n\ntype CommentCardRepliesProps = {\n replies?: CommentReply[];\n hasMoreReplies?: boolean;\n moreRepliesCount?: number;\n isReplyOpen?: boolean;\n replyInput?: React.ReactNode;\n onShowMoreReplies?: () => void;\n};\n\nexport const CommentCardReplies: FC<CommentCardRepliesProps> = ({\n replies,\n hasMoreReplies,\n moreRepliesCount,\n replyInput,\n onShowMoreReplies,\n}) => (\n <div className={styles.replies}>\n {replyInput}\n\n {replies?.map(reply => (\n <div key={reply.id} className={styles.reply}>\n <div className={styles.replyHeader}>\n <Avatar size={32} name={reply.author.name} imageSrc={reply.author.avatarUrl} />\n <div className={styles.replyNameRow}>\n <span className={styles.replyName}>{reply.author.name}</span>\n <span className={styles.replyTimestamp}>{reply.timestamp}</span>\n </div>\n <CommentMenu items={reply.menuItems} testId=\"comment-reply-menu\" />\n </div>\n <div className={styles.replyText}>{reply.editForm ?? reply.body}</div>\n </div>\n ))}\n\n {hasMoreReplies && onShowMoreReplies && (\n <ButtonText\n type=\"primary\"\n size=\"medium\"\n prefix={<DownSmallIcon size={16} />}\n onClick={onShowMoreReplies}\n >\n {moreRepliesCount ? `Show ${moreRepliesCount} More Comments` : 'Show More Comments'}\n </ButtonText>\n )}\n </div>\n);\n"],"names":["CommentCardReplies","_ref","replies","hasMoreReplies","moreRepliesCount","replyInput","onShowMoreReplies","_jsxs","className","styles","children","map","reply","_reply$editForm","replyHeader","_jsx","Avatar","size","name","author","imageSrc","avatarUrl","replyNameRow","replyName","replyTimestamp","timestamp","CommentMenu","items","menuItems","testId","replyText","editForm","body","id","ButtonText","type","prefix","DownSmallIcon","onClick"],"mappings":"05HAoBaA,IAAAA,EAAkD,SAAHC,GAAA,IAC1DC,IAAAA,QACAC,IAAAA,eACAC,IAAAA,iBACAC,IAAAA,WACAC,IAAAA,kBAAiB,OAEjBC,EAAA,MAAA,CAAKC,UAAWC,EAAOP,QAAQQ,SAC5BL,CAAAA,EAEAH,aAAAA,EAAAA,EAASS,KAAI,SAAAC,GAAK,IAAAC,EAAA,OACjBN,EAAA,MAAA,CAAoBC,UAAWC,EAAOG,MAAMF,SAC1C,CAAAH,EAAA,MAAA,CAAKC,UAAWC,EAAOK,YAAYJ,SAAA,CACjCK,EAACC,EAAM,CAACC,KAAM,GAAIC,KAAMN,EAAMO,OAAOD,KAAME,SAAUR,EAAMO,OAAOE,YAClEd,EAAA,MAAA,CAAKC,UAAWC,EAAOa,aAAaZ,SAClC,CAAAK,EAAA,OAAA,CAAMP,UAAWC,EAAOc,UAAUb,SAAEE,EAAMO,OAAOD,OACjDH,EAAA,OAAA,CAAMP,UAAWC,EAAOe,eAAed,SAAEE,EAAMa,eAEjDV,EAACW,EAAW,CAACC,MAAOf,EAAMgB,UAAWC,OAAO,0BAE9Cd,EAAA,MAAA,CAAKP,UAAWC,EAAOqB,UAAUpB,SAAgB,QAAhBG,EAAED,EAAMmB,gBAAQ,IAAAlB,EAAAA,EAAID,EAAMoB,SATnDpB,EAAMqB,GAWjB,IAEA9B,GAAkBG,GACjBS,EAACmB,EAAU,CACTC,KAAK,UACLlB,KAAK,SACLmB,OAAQrB,EAACsB,EAAa,CAACpB,KAAM,KAC7BqB,QAAShC,EAAkBI,SAE1BN,EAA2BA,QAAAA,OAAAA,EAAmC,kBAAA,yBAG/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCommentReply.test.d.ts","sourceRoot":"","sources":["../../../../src/components/CommentCard/__tests__/buildCommentReply.test.tsx"],"names":[],"mappings":""}
|
|
@@ -5,6 +5,12 @@ type ReplyUser = {
|
|
|
5
5
|
last_name?: string;
|
|
6
6
|
profile_photo?: string;
|
|
7
7
|
};
|
|
8
|
+
type ReplyAttachment = {
|
|
9
|
+
url?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
file_name?: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
};
|
|
8
14
|
export type ActivityReply = {
|
|
9
15
|
id: string | number;
|
|
10
16
|
body?: string;
|
|
@@ -12,17 +18,19 @@ export type ActivityReply = {
|
|
|
12
18
|
created_at?: string | number;
|
|
13
19
|
allowed_actions?: string[];
|
|
14
20
|
mentioned_users?: unknown[];
|
|
15
|
-
attachment?:
|
|
16
|
-
|
|
17
|
-
name?: string;
|
|
18
|
-
file_name?: string;
|
|
19
|
-
size?: number;
|
|
20
|
-
} | null;
|
|
21
|
+
attachment?: ReplyAttachment | null;
|
|
22
|
+
attachments?: ReplyAttachment[] | null;
|
|
21
23
|
};
|
|
24
|
+
export declare const getReplyAttachments: (reply: ActivityReply) => {
|
|
25
|
+
url: string;
|
|
26
|
+
name: string;
|
|
27
|
+
size?: number;
|
|
28
|
+
}[];
|
|
22
29
|
export type BuildCommentReplyOptions = {
|
|
23
30
|
currentUserId?: string | number;
|
|
24
31
|
onDelete: (id: string | number) => void;
|
|
32
|
+
onEdit: (id: string | number) => void;
|
|
25
33
|
};
|
|
26
|
-
export declare const buildCommentReply: (reply: ActivityReply, { currentUserId, onDelete }: BuildCommentReplyOptions) => CommentReply;
|
|
34
|
+
export declare const buildCommentReply: (reply: ActivityReply, { currentUserId, onDelete, onEdit }: BuildCommentReplyOptions) => CommentReply;
|
|
27
35
|
export {};
|
|
28
36
|
//# sourceMappingURL=buildCommentReply.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCommentReply.d.ts","sourceRoot":"","sources":["../../../src/components/CommentCard/buildCommentReply.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;A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EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;CACxC,CAAC;AAGF,eAAO,MAAM,mBAAmB,UACvB,aAAa,KACnB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAOvC,CAAC;AAMT,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,UACrB,aAAa,uCACiB,wBAAwB,KAC5D,YA4CF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"moment-timezone";import{DeleteFourIcon as
|
|
1
|
+
import o from"moment-timezone";import{WriteIcon as s,DeleteFourIcon as c}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{StoredAttachmentPreview as i}from"../AttachmentPreview/StoredAttachmentPreview.js";import{formatMentionText as n}from"../UserMention/utils/index.js";import{isNativeDetected as t}from"../../utils/mobileDetect.js";import{jsxs as m,Fragment as r,jsx as e}from"react/jsx-runtime";var u=function(o){var s;return(null!==(s=o.attachments)&&void 0!==s&&s.length?o.attachments:[o.attachment]).reduce((function(o,s){var c,i=null!==(c=null==s?void 0:s.file_name)&&void 0!==c?c:null==s?void 0:s.name;return null!=s&&s.url&&i&&o.push({url:s.url,name:i,size:s.size}),o}),[])},p=function(p,l){var a,d,j,I,v,h,C,b,F,f,O,A=l.currentUserId,D=l.onDelete,M=l.onEdit,P=Number(null===(a=p.user)||void 0===a?void 0:a.id)===Number(A)||(null!==(d=p.allowed_actions)&&void 0!==d?d:[]).includes("update"),g=Number(null===(j=p.user)||void 0===j?void 0:j.id)===Number(A)||(null!==(I=p.allowed_actions)&&void 0!==I?I:[]).includes("destroy"),k=u(p);return{id:p.id,author:{id:null===(v=p.user)||void 0===v?void 0:v.id,name:(F=p.user,"".concat(null!==(f=null==F?void 0:F.first_name)&&void 0!==f?f:""," ").concat(null!==(O=null==F?void 0:F.last_name)&&void 0!==O?O:"").trim()),avatarUrl:null===(h=p.user)||void 0===h?void 0:h.profile_photo},timestamp:o(p.created_at).format("MM/DD/YY H:mm"),body:m(r,{children:[n(null!==(C=p.body)&&void 0!==C?C:"",null!==(b=p.mentioned_users)&&void 0!==b?b:[],t,void 0,void 0),!!k.length&&e(i,{attachments:k})]}),menuItems:[{label:"Edit",icon:e(s,{size:16}),disabled:!P,onClick:function(){return M(p.id)}},{label:"Delete",icon:e(c,{size:16}),disabled:!g,onClick:function(){return D(p.id)}}]}};export{p as buildCommentReply,u as getReplyAttachments};
|
|
2
2
|
//# sourceMappingURL=buildCommentReply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCommentReply.js","sources":["../../../src/components/CommentCard/buildCommentReply.tsx"],"sourcesContent":["import moment from 'moment-timezone';\n\nimport { DeleteFourIcon } from '../../icons';\nimport { StoredAttachmentPreview } from '../AttachmentPreview/StoredAttachmentPreview';\nimport { formatMentionText } from '../UserMention/utils';\n\nimport { CommentReply } from './CommentCard.types';\n\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\nconst COMMENT_TIME_FORMAT = 'MM/DD/YY H:mm';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case activity payload. */\ntype ReplyUser = {\n id?: string | number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n};\n\nexport type ActivityReply = {\n id: string | number;\n body?: string;\n user?: ReplyUser;\n created_at?: string | number;\n allowed_actions?: string[];\n mentioned_users?: unknown[];\n attachment?:
|
|
1
|
+
{"version":3,"file":"buildCommentReply.js","sources":["../../../src/components/CommentCard/buildCommentReply.tsx"],"sourcesContent":["import moment from 'moment-timezone';\n\nimport { DeleteFourIcon, WriteIcon } from '../../icons';\nimport { StoredAttachmentPreview } from '../AttachmentPreview/StoredAttachmentPreview';\nimport { formatMentionText } from '../UserMention/utils';\n\nimport { CommentReply } from './CommentCard.types';\n\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\nconst COMMENT_TIME_FORMAT = 'MM/DD/YY H:mm';\n\n/* eslint-disable camelcase -- mirrors the platform's snake_case activity payload. */\ntype ReplyUser = {\n id?: string | number;\n first_name?: string;\n last_name?: string;\n profile_photo?: string;\n};\n\ntype ReplyAttachment = { url?: string; name?: string; file_name?: string; size?: number };\n\nexport type ActivityReply = {\n id: string | number;\n body?: string;\n user?: ReplyUser;\n created_at?: string | number;\n allowed_actions?: string[];\n mentioned_users?: unknown[];\n attachment?: ReplyAttachment | null;\n attachments?: ReplyAttachment[] | null;\n};\n\n// Old replies only carry the singular field; the API mirrors the first file into both.\nexport const getReplyAttachments = (\n reply: ActivityReply\n): { url: string; name: string; size?: number }[] =>\n (reply.attachments?.length ? reply.attachments : [reply.attachment]).reduce<\n { url: string; name: string; size?: number }[]\n >((acc, file) => {\n const name = file?.file_name ?? file?.name;\n if (file?.url && name) acc.push({ url: file.url, name, size: file.size });\n return acc;\n }, []);\n\nconst getReplyUserName = (user?: ReplyUser): string =>\n `${user?.first_name ?? ''} ${user?.last_name ?? ''}`.trim();\n/* eslint-enable camelcase */\n\nexport type BuildCommentReplyOptions = {\n currentUserId?: string | number;\n onDelete: (id: string | number) => void;\n onEdit: (id: string | number) => void;\n};\n\nexport const buildCommentReply = (\n reply: ActivityReply,\n { currentUserId, onDelete, onEdit }: BuildCommentReplyOptions\n): CommentReply => {\n const canUpdate =\n Number(reply.user?.id) === Number(currentUserId) ||\n (reply.allowed_actions ?? []).includes('update');\n const canDelete =\n Number(reply.user?.id) === Number(currentUserId) ||\n (reply.allowed_actions ?? []).includes('destroy');\n const attachments = getReplyAttachments(reply);\n\n return {\n id: reply.id,\n author: {\n id: reply.user?.id,\n name: getReplyUserName(reply.user),\n avatarUrl: reply.user?.profile_photo,\n },\n timestamp: moment(reply.created_at).format(COMMENT_TIME_FORMAT),\n body: (\n <>\n {formatMentionText(\n reply.body ?? '',\n reply.mentioned_users ?? [],\n isNativeDetected,\n undefined,\n undefined\n )}\n {!!attachments.length && <StoredAttachmentPreview attachments={attachments} />}\n </>\n ),\n menuItems: [\n {\n label: 'Edit',\n icon: <WriteIcon size={16} />,\n disabled: !canUpdate,\n onClick: () => onEdit(reply.id),\n },\n {\n label: 'Delete',\n icon: <DeleteFourIcon size={16} />,\n disabled: !canDelete,\n onClick: () => onDelete(reply.id),\n },\n ],\n };\n};\n"],"names":["getReplyAttachments","reply","_reply$attachments","attachments","length","attachment","reduce","acc","file","_file$file_name","name","file_name","url","push","size","buildCommentReply","_ref","_reply$user","_reply$allowed_action","_reply$user2","_reply$allowed_action2","_reply$user3","_reply$user4","_reply$body","_reply$mentioned_user","user","_user$first_name","_user$last_name","currentUserId","onDelete","onEdit","canUpdate","Number","id","allowed_actions","includes","canDelete","author","concat","first_name","last_name","trim","avatarUrl","profile_photo","timestamp","moment","created_at","format","body","_jsxs","_Fragment","children","formatMentionText","mentioned_users","isNativeDetected","undefined","_jsx","StoredAttachmentPreview","menuItems","label","icon","WriteIcon","disabled","onClick","DeleteFourIcon"],"mappings":"w9HAUA,IAwBaA,EAAsB,SACjCC,GAAoB,IAAAC,EAAA,eAEnBD,EAAAA,EAAME,0BAAND,EAAmBE,OAASH,EAAME,YAAc,CAACF,EAAMI,aAAaC,QAEnE,SAACC,EAAKC,GAAS,IAAAC,EACTC,EAAsB,QAAfF,EAAAA,eAAAA,EAAMG,iBAAS,IAAAF,EAAAA,EAAID,aAAAA,EAAAA,EAAME,KAEtC,OADIF,SAAAA,EAAMI,KAAOF,GAAMH,EAAIM,KAAK,CAAED,IAAKJ,EAAKI,IAAKF,KAAAA,EAAMI,KAAMN,EAAKM,OAC3DP,CACR,GAAE,GAAG,EAYKQ,EAAoB,SAC/Bd,EAEiBe,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAbOC,EAAgBC,EAAAC,EAYtCC,IAAAA,cAAeC,IAAAA,SAAUC,IAAAA,OAErBC,EACJC,OAAO,QAAA/B,EAAAA,EAAMwB,YAAN,IAAAR,OAAA,EAAAA,EAAYgB,MAAQD,OAAOJ,KACR,QAAzB3B,EAAAA,EAAMiC,uBAAmB,IAAAhB,EAAAA,EAAA,IAAIiB,SAAS,UACnCC,EACJJ,OAAO,QAAA/B,EAAAA,EAAMwB,YAAN,IAAAN,OAAA,EAAAA,EAAYc,MAAQD,OAAOJ,KACR,QAAzB3B,EAAAA,EAAMiC,uBAAmB,IAAAd,EAAAA,EAAA,IAAIe,SAAS,WACnChC,EAAcH,EAAoBC,GAExC,MAAO,CACLgC,GAAIhC,EAAMgC,GACVI,OAAQ,CACNJ,GAAc,UAAVhC,EAAMwB,YAAI,IAAAJ,OAAA,EAAVA,EAAYY,GAChBvB,MA1BoBe,EA0BGxB,EAAMwB,KAzBjC,GAAAa,OAAmB,QAAnBZ,EAAGD,eAAAA,EAAMc,kBAAU,IAAAb,EAAAA,EAAI,GAAE,KAAAY,OAAuB,QAAvBX,EAAIF,eAAAA,EAAMe,iBAAa,IAAAb,EAAAA,EAAA,IAAKc,QA0BjDC,kBAAWzC,EAAAA,EAAMwB,yBAANH,EAAYqB,eAEzBC,UAAWC,EAAO5C,EAAM6C,YAAYC,OAhEZ,iBAiExBC,KACEC,EAAAC,EAAA,CAAAC,SAAA,CACGC,EACW,QADM7B,EAChBtB,EAAM+C,YAAI,IAAAzB,EAAAA,EAAI,GACO,QADLC,EAChBvB,EAAMoD,uBAAe,IAAA7B,EAAAA,EAAI,GACzB8B,OACAC,OACAA,KAECpD,EAAYC,QAAUoD,EAACC,EAAuB,CAACtD,YAAaA,OAGnEuD,UAAW,CACT,CACEC,MAAO,OACPC,KAAMJ,EAACK,EAAS,CAAC/C,KAAM,KACvBgD,UAAW/B,EACXgC,QAAS,WAAA,OAAMjC,EAAO7B,EAAMgC,GAAG,GAEjC,CACE0B,MAAO,SACPC,KAAMJ,EAACQ,EAAc,CAAClD,KAAM,KAC5BgD,UAAW1B,EACX2B,QAAS,WAAA,OAAMlC,EAAS5B,EAAMgC,GAAG,IAIzC"}
|
|
@@ -16,8 +16,13 @@ export type CommentComposerProps = {
|
|
|
16
16
|
onSubmit: () => void;
|
|
17
17
|
canSubmit: boolean;
|
|
18
18
|
currentUser: CommentComposerUser;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
attachments?: UploadedAttachment[];
|
|
20
|
+
onAttachmentsChange?: (attachments: UploadedAttachment[]) => void;
|
|
21
|
+
maxAttachments?: number;
|
|
22
|
+
/** @deprecated Use `attachments` — kept so single-attachment callers keep working. */
|
|
23
|
+
attachment?: UploadedAttachment | null;
|
|
24
|
+
/** @deprecated Use `onAttachmentsChange`. */
|
|
25
|
+
onAttachmentChange?: (attachment: UploadedAttachment | null) => void;
|
|
21
26
|
attachmentError?: string | null;
|
|
22
27
|
onAttachmentError?: (message: string | null) => void;
|
|
23
28
|
maxAttachmentSizeBytes?: number;
|
|
@@ -34,5 +39,5 @@ export type CommentComposerProps = {
|
|
|
34
39
|
className?: string;
|
|
35
40
|
testId?: string;
|
|
36
41
|
};
|
|
37
|
-
export declare const CommentComposer: ({ body, onBodyChange, onSubmit, canSubmit, currentUser, attachment, onAttachmentChange, attachmentError, onAttachmentError, maxAttachmentSizeBytes, disabled, autoFocus, placeholder, metaRows, isMetaSingleLine, shareToChat, trailing, embedded, className, testId, }: CommentComposerProps) => JSX.Element;
|
|
42
|
+
export declare const CommentComposer: ({ body, onBodyChange, onSubmit, canSubmit, currentUser, attachments, onAttachmentsChange, maxAttachments, attachment, onAttachmentChange, attachmentError, onAttachmentError, maxAttachmentSizeBytes, disabled, autoFocus, placeholder, metaRows, isMetaSingleLine, shareToChat, trailing, embedded, className, testId, }: CommentComposerProps) => JSX.Element;
|
|
38
43
|
//# sourceMappingURL=CommentComposer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentComposer.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CommentComposer.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAIV,MAAM,OAAO,CAAC;AAef,OAAO,EAEL,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO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C;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IAClD,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAyBF,eAAO,MAAM,eAAe,8TAwBzB,oBAAoB,gBA4ItB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/defineProperty";import{useRef as
|
|
1
|
+
import o from"@babel/runtime/helpers/defineProperty";import{useMemo as s,useCallback as n,useRef as t}from"react";import{Input as i}from"@material-ui/core";import c from"@material-ui/icons/AlternateEmail";import{ButtonIcon as e}from"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as r}from"../../componentsV2/Tooltip/Tooltip.js";import{SmilingFaceIcon as m}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{AvatarComponent as a}from"../Avatar/index.js";import{AttachFileButton as l}from"../AttachFileButton/AttachFileButton.js";import{CommentInput as p}from"../CommentInputNext/CommentInputNext.js";import u from"../EmojiIconButton.js";import d from"../FailedFileUploading.js";import j from"../UserMention/index.js";import{isSuggestionsListOpened as I}from"../UserMention/utils/index.js";import{useAttachmentUpload as h,DEFAULT_MAX_ATTACHMENTS as f}from"./useAttachmentUpload.js";import{CommentMetaLine as b}from"./CommentMetaLine.js";import{ShareToChatRow as g}from"./ShareToChatRow.js";import v from"./CommentComposer.scss.js";import{jsx as C,jsxs as y,Fragment as O}from"react/jsx-runtime";function F(o,s){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);s&&(t=t.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),n.push.apply(n,t)}return n}function A(s){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?F(Object(t),!0).forEach((function(n){o(s,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):F(Object(t)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(t,o))}))}return s}var S={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)"}}}},P=function(o){return y("div",{className:v.suggestion,children:[C(a,{size:26,alt:o.display,imgSrc:o.photo,displayName:o.display}),C("span",{children:o.display})]})},x=function(o){var a=o.body,F=o.onBodyChange,x=o.onSubmit,E=o.canSubmit,k=o.currentUser,D=o.attachments,w=o.onAttachmentsChange,R=o.maxAttachments,M=void 0===R?f:R,U=o.attachment,B=o.onAttachmentChange,z=o.attachmentError,N=o.onAttachmentError,T=o.maxAttachmentSizeBytes,L=o.disabled,G=o.autoFocus,q=o.placeholder,K=void 0===q?"Add a comment...":q,W=o.metaRows,H=o.isMetaSingleLine,V=o.shareToChat,Q=o.trailing,Z=o.embedded,$=o.className,J=o.testId,X=!!w,Y=s((function(){return X?null!=D?D:[]:[U].filter(Boolean)}),[X,D,U]),_=n((function(o){var s;w?w(o):null==B||B(null!==(s=o[0])&&void 0!==s?s:null)}),[w,B]),oo=h({value:Y,onChange:_,onError:N,maxSizeBytes:T,maxFiles:X?M:1}),so=E&&!oo.isUploading,no=t(null);return C(p,{value:a,canSubmit:so,disabled:L,onSubmit:x,trailing:Q,embedded:Z,className:$,testId:J,field:C(i,{inputComponent:j,inputProps:{onChange:F,currentUser:k,allowEmptyQuery:!0,suggestionsPortalHost:document.querySelector("body"),withLightTheme:!1,mentionProps:{renderSuggestion:P},style:S},value:a,placeholder:K,inputRef:no,className:v.mentionField,onKeyDown:function(o){"Enter"!==o.key||o.shiftKey||so&&!L&&(I()||(o.preventDefault(),x()))},disableUnderline:!0,rows:1,fullWidth:!0,multiline:!0,autoFocus:G}),attachments:oo.items,onAttachmentRemove:oo.removeAttachment,onAttachmentRetry:oo.handleRetry,onAttachmentReorder:X?oo.reorderAttachments:void 0,onFilesDrop:oo.addFiles,dropLabel:1===oo.maxFiles?"Drop a file here":"Drop files here",attachmentSlot:z?C(d,{errorMessage:z}):void 0,toolbar:y(O,{children:[C(l,{inputRef:oo.fileInputRef,onClick:oo.openFileDialog,onFileSelect:oo.handleFileSelect,multiple:X,disabled:oo.isFull,tooltip:oo.isFull?"Up to ".concat(oo.maxFiles," ").concat(1===oo.maxFiles?"file":"files"," can be attached"):"Attach file"}),C(r,{title:"Mention someone",children:C(e,{size:"xs",type:"tertiary",onClick:function(){var o,s=no.current;if(s){s.focus();var n=!!s.value&&!/\s$/.test(s.value),t="".concat(s.value).concat(n?" @":"@"),i=null===(o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),"value"))||void 0===o?void 0:o.set;null==i||i.call(s,t),s.setSelectionRange(t.length,t.length),s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("keyup",{bubbles:!0}))}},children:C(c,{fontSize:"inherit"})})}),C("span",{className:v.iconSlot,children:C(u,{icon:C(m,{size:16}),handleSelectEmoji:function(o){return F("".concat(a).concat(o.native))}})})]}),footer:(!(null==W||!W.length)||!!V)&&y(O,{children:[C(b,{rows:null!=W?W:[],singleLine:H}),V&&C(g,A({},V))]})})};export{x as CommentComposer};
|
|
2
2
|
//# sourceMappingURL=CommentComposer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentComposer.js","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"sourcesContent":["import { CSSProperties, FormEventHandler, KeyboardEvent, ReactNode, useRef } 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 { useAttachmentUpload, UploadedAttachment } 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 attachment: UploadedAttachment | null;\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 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 const upload = useAttachmentUpload({\n value: attachment,\n onChange: onAttachmentChange,\n onError: onAttachmentError,\n maxSizeBytes: maxAttachmentSizeBytes,\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 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 disabled={upload.hasAttachment}\n tooltip={upload.hasAttachment ? 'Only one file can be attached' : 'Attach file'}\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","CommentComposer","_ref","body","onBodyChange","onSubmit","canSubmit","currentUser","attachment","onAttachmentChange","attachmentError","onAttachmentError","maxAttachmentSizeBytes","disabled","autoFocus","_ref$placeholder","placeholder","metaRows","isMetaSingleLine","shareToChat","trailing","embedded","testId","upload","useAttachmentUpload","value","onChange","onError","maxSizeBytes","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","attachments","items","onAttachmentRemove","removeAttachment","onAttachmentRetry","handleRetry","attachmentSlot","FailedFileUploading","errorMessage","undefined","toolbar","_Fragment","AttachFileButton","fileInputRef","onClick","openFileDialog","onFileSelect","handleFileSelect","hasAttachment","tooltip","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":"+pKA2DA,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,EAAA,MAAA,CAAKC,UAAWC,EAAOC,WAAWC,SAAA,CAChCC,EAACC,EAAM,CAACC,KAAM,GAAIC,IAAKT,EAAMU,QAASC,OAAQX,EAAMY,MAAOC,YAAab,EAAMU,UAC9EJ,EAAA,OAAA,CAAAD,SAAOL,EAAMU,YACT,EAGKI,EAAkB,SAqBHC,GAAA,IApB1BC,IAAAA,KACAC,IAAAA,aACAC,IAAAA,SACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,WACAC,IAAAA,mBACAC,IAAAA,gBACAC,IAAAA,kBACAC,IAAAA,uBACAC,IAAAA,SACAC,IAAAA,UAASC,EAAAb,EACTc,YAAAA,aAAc,mBAAkBD,EAChCE,IAAAA,SACAC,IAAAA,iBACAC,IAAAA,YACAC,IAAAA,SACAC,IAAAA,SACAhC,IAAAA,UACAiC,IAAAA,OAEMC,EAASC,EAAoB,CACjCC,MAAOjB,EACPkB,SAAUjB,EACVkB,QAAShB,EACTiB,aAAchB,IAIViB,EAAUvB,IAAciB,EAAOO,YAE/BC,EAAWC,EAAmC,MA4BpD,OACEvC,EAACwC,EAAY,CACXR,MAAOtB,EACPG,UAAWuB,EACXhB,SAAUA,EACVR,SAAU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EAAtEA,EAAwEU,IAEzFJ,SAAAA,EAAUK,KAAK3D,EAAOqD,GACtBrD,EAAM4D,kBAAkBP,EAAUQ,OAAQR,EAAUQ,QACpD7D,EAAM8D,cAAc,IAAIC,MAAM,QAAS,CAAEC,SAAS,KAClDhE,EAAM8D,cAAc,IAAIC,MAAM,QAAS,CAAEC,SAAS,IAXtC,GA0E0D1G,SAC5DC,EAAC0G,EAAkB,CAACxH,SAAS,gBAGjCc,EAAA,OAAA,CAAMJ,UAAWC,EAAO8G,SAAS5G,SAC/BC,EAAC4G,EAAe,CACdC,KAAM7G,EAAC8G,EAAe,CAAC5G,KAAM,KAC7B6G,kBAAmB,SAACC,GAAyB,OAC3CrG,EAAgBD,GAAAA,OAAAA,UAAOsG,EAAMC,QAAS,SAMhDC,UACK1F,UAAAA,EAAU8E,WAAY5E,IACvB/B,EAAAiF,EAAA,CAAA7E,SAAA,CACEC,EAACmH,EAAe,CAACrD,KAAMtC,QAAAA,EAAY,GAAI4F,WAAY3F,IAClDC,GAAe1B,EAACqH,EAAcC,EAAA,CAAA,EAAK5F,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 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","CommentComposer","_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","_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":"0tKA4EA,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,EAAA,MAAA,CAAKC,UAAWC,EAAOC,WAAWC,SAAA,CAChCC,EAACC,EAAM,CAACC,KAAM,GAAIC,IAAKT,EAAMU,QAASC,OAAQX,EAAMY,MAAOC,YAAab,EAAMU,UAC9EJ,EAAA,OAAA,CAAAD,SAAOL,EAAMU,YACT,EAGKI,EAAkB,SAwBHC,GAAA,IAvB1BC,IAAAA,KACAC,IAAAA,aACAC,IAAAA,SACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,YACAC,IAAAA,oBAAmBC,EAAAR,EACnBS,eAAAA,aAAiBC,EAAuBF,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,GACZ,WAAA,OAAOF,EAAUpB,QAAAA,EAAe,GAAM,CAACK,GAAYkB,OAAOC,QAAkC,GAC5F,CAACJ,EAASpB,EAAaK,IAGnBoB,EAA0BC,GAC9B,SAACC,GAA+B,IAAAC,EAC1B3B,EAAqBA,EAAoB0B,GACxCrB,SAAAA,EAA4B,UAAPqB,EAAK,UAAE,IAAAC,EAAAA,EAAI,KACvC,GACA,CAAC3B,EA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entReplyInputProps = {
|
|
3
3
|
/** Resolving to `false` keeps the draft, so a failed post can be retried. */
|
|
4
|
-
onSubmit: (body: string,
|
|
4
|
+
onSubmit: (body: string, attachments: UploadedAttachment[]) => void | boolean | Promise<void | boolean>;
|
|
5
5
|
author?: {
|
|
6
6
|
name?: string;
|
|
7
7
|
avatarUrl?: string;
|
|
@@ -9,7 +9,11 @@ export type CommentReplyInputProps = {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
autoFocus?: boolean;
|
|
12
|
+
maxAttachments?: number;
|
|
13
|
+
initialBody?: string;
|
|
14
|
+
initialAttachments?: UploadedAttachment[];
|
|
15
|
+
onCancel?: () => void;
|
|
12
16
|
testId?: string;
|
|
13
17
|
};
|
|
14
|
-
export declare const CommentReplyInput: ({ onSubmit, author, disabled, placeholder, autoFocus, testId, }: CommentReplyInputProps) => JSX.Element;
|
|
18
|
+
export declare const CommentReplyInput: ({ onSubmit, author, disabled, placeholder, autoFocus, maxAttachments, initialBody, initialAttachments, onCancel, testId, }: CommentReplyInputProps) => JSX.Element;
|
|
15
19
|
//# sourceMappingURL=CommentReplyInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentReplyInput.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentReplyInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CommentReplyInput.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentReplyInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,kBAAkB,EAAE,KAC9B,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,+HAW3B,sBAAsB,gBAsDxB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{useState as
|
|
1
|
+
import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{useState as a}from"react";import{Avatar as n}from"../../componentsV2/Avatar/Avatar.js";import{AttachFileButton as o}from"../AttachFileButton/AttachFileButton.js";import{CommentInput as i}from"../CommentInputNext/CommentInputNext.js";import l from"../FailedFileUploading.js";import{useAttachmentUpload as m}from"./useAttachmentUpload.js";import{jsx as c}from"react/jsx-runtime";var s=[],u=function(u){var p=u.onSubmit,d=u.author,h=u.disabled,f=u.placeholder,v=void 0===f?"Reply":f,b=u.autoFocus,A=void 0===b||b,F=u.maxAttachments,g=u.initialBody,x=void 0===g?"":g,y=u.initialAttachments,C=void 0===y?s:y,R=u.onCancel,S=u.testId,j=a(x),I=e(j,2),U=I[0],k=I[1],B=a(C),w=e(B,2),D=w[0],N=w[1],T=a(null),z=e(T,2),E=z[0],G=z[1],M=m({value:D,onChange:N,onError:G,maxFiles:F}),V=function(){var e=t(r.mark((function t(e){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p(e,D);case 2:if(t.t0=t.sent,!1!==t.t0){t.next=5;break}return t.abrupt("return");case 5:k(""),N([]),M.clearAttachments();case 8:case"end":return t.stop()}}),t)})));return function(t){return e.apply(this,arguments)}}();return c(i,{bare:!0,autoFocus:A,placeholder:v,value:U,onChange:k,canSubmit:!(!U.trim()&&!D.length||M.isUploading),onSubmit:V,onCancel:R,disabled:h,attachments:M.items,onAttachmentRemove:M.removeAttachment,onAttachmentRetry:M.handleRetry,onAttachmentReorder:M.reorderAttachments,onFilesDrop:M.addFiles,testId:S,attachmentSlot:E?c(l,{errorMessage:E}):void 0,toolbar:c(o,{inputRef:M.fileInputRef,onClick:M.openFileDialog,onFileSelect:M.handleFileSelect,multiple:!0,disabled:M.isFull,tooltip:M.isFull?"Up to ".concat(M.maxFiles," files can be attached"):"Attach file"}),leading:c(n,{size:32,name:null==d?void 0:d.name,imageSrc:null==d?void 0:d.avatarUrl})})};export{u as CommentReplyInput};
|
|
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\nexport type CommentReplyInputProps = {\n /** Resolving to `false` keeps the draft, so a failed post can be retried. */\n onSubmit: (\n body: string,\n
|
|
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","CommentReplyInput","_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","FailedFileUploading","errorMessage","undefined","toolbar","AttachFileButton","inputRef","fileInputRef","onClick","openFileDialog","onFileSelect","handleFileSelect","multiple","isFull","tooltip","leading","Avatar","size","name","imageSrc","avatarUrl"],"mappings":"qhBASA,IAAMA,EAA0C,GAmBnCC,EAAoB,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,aAAqBd,EAAiBa,EACtCE,IAAAA,SACAC,IAAAA,OAEwBC,EAAAA,EAASL,GAAYM,EAAAC,EAAAC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AAsB8C,EAE7EC,QACEpB,EAACqB,EAAgB,CACfC,SAAU/C,EAAOgD,aACjBC,QAASjD,EAAOkD,eAChBC,aAAcnD,EAAOoD,iBACrBC,UAAQ,EACR/E,SAAU0B,EAAOsD,OACjBC,QAASvD,EAAOsD,uBAAkBtD,EAAOK,SAAmC,0BAAA,gBAGhFmD,QAAS/B,EAACgC,EAAM,CAACC,KAAM,GAAIC,KAAMtF,aAAAA,EAAAA,EAAQsF,KAAMC,SAAUvF,aAAM,EAANA,EAAQwF,aAGvE"}
|
|
@@ -6,21 +6,30 @@ export type UploadedAttachment = {
|
|
|
6
6
|
size?: number;
|
|
7
7
|
};
|
|
8
8
|
type UseAttachmentUploadOptions = {
|
|
9
|
-
value: UploadedAttachment
|
|
10
|
-
onChange: (
|
|
9
|
+
value: UploadedAttachment[];
|
|
10
|
+
onChange: (attachments: UploadedAttachment[]) => void;
|
|
11
11
|
onError?: (message: string | null) => void;
|
|
12
12
|
maxSizeBytes?: number;
|
|
13
|
+
maxFiles?: number;
|
|
14
|
+
/** Mirrors the file input's `accept`; also gates drag-and-drop. */
|
|
15
|
+
accept?: string;
|
|
13
16
|
};
|
|
14
|
-
export declare const
|
|
17
|
+
export declare const DEFAULT_MAX_ATTACHMENTS = 10;
|
|
18
|
+
export declare const useAttachmentUpload: ({ value, onChange, onError, maxSizeBytes, maxFiles, accept, }: UseAttachmentUploadOptions) => {
|
|
15
19
|
items: AttachmentPreviewItem[];
|
|
16
20
|
fileInputRef: import("react").RefObject<HTMLInputElement>;
|
|
17
21
|
openFileDialog: () => void | undefined;
|
|
18
22
|
handleFileSelect: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
addFiles: (files: File[]) => void;
|
|
24
|
+
removeAttachment: (id: AttachmentPreviewItem['id']) => void;
|
|
25
|
+
handleRetry: (id: AttachmentPreviewItem['id']) => void;
|
|
26
|
+
reorderAttachments: (orderedIds: AttachmentPreviewItem['id'][]) => void;
|
|
27
|
+
clearAttachments: () => void;
|
|
21
28
|
isUploading: boolean;
|
|
22
29
|
error: string | null;
|
|
23
|
-
|
|
30
|
+
count: number;
|
|
31
|
+
isFull: boolean;
|
|
32
|
+
maxFiles: number;
|
|
24
33
|
};
|
|
25
34
|
export {};
|
|
26
35
|
//# sourceMappingURL=useAttachmentUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentUpload.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useAttachmentUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4C,MAAM,OAAO,CAAC;AAG9E,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"useAttachmentUpload.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useAttachmentUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4C,MAAM,OAAO,CAAC;AAG9E,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,8CAA8C,CAAC;AAMtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,WAAW,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAcF,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAkD1C,eAAO,MAAM,mBAAmB,kEAO7B,0BAA0B;;;;8BA0KjB,WAAW,CAAC,gBAAgB,CAAC;sBApD7B,IAAI,EAAE;2BAgET,qBAAqB,CAAC,IAAI,CAAC;sBAW3B,qBAAqB,CAAC,IAAI,CAAC;qCAcnB,qBAAqB,CAAC,IAAI,CAAC,EAAE;;;;;;;CA8G7C,CAAC"}
|