@corva/ui 3.74.0-0 → 3.74.0-2
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/AssetEditor/AssetEditorAutocomplete.js +1 -1
- package/cjs-bundle/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
- package/cjs-bundle/components/AssetEditorV2/index.js +1 -1
- package/cjs-bundle/components/AssetEditorV2/index.js.map +1 -1
- package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/AttachmentDocument.js.map +1 -0
- package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.js +1 -1
- package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.js.map +1 -1
- package/cjs-bundle/components/AttachmentLightbox/AttachmentLightbox.scss.js +1 -1
- package/cjs-bundle/components/AttachmentLightbox/AttachmentPreviewPane.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/AttachmentPreviewPane.js.map +1 -0
- package/cjs-bundle/components/AttachmentLightbox/copyImageToClipboard.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/copyImageToClipboard.js.map +1 -0
- package/cjs-bundle/components/AttachmentLightbox/downloadAttachment.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/downloadAttachment.js.map +1 -0
- package/cjs-bundle/components/AttachmentLightbox/useAttachmentLightbox.js +1 -1
- package/cjs-bundle/components/AttachmentLightbox/useAttachmentLightbox.js.map +1 -1
- package/cjs-bundle/components/AttachmentLightbox/useZoomPan.js +2 -0
- package/cjs-bundle/components/AttachmentLightbox/useZoomPan.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentActionsMenu.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentActionsMenu.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentDownloadLink.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentDownloadLink.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentImage.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentImage.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentMenu.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentMenu.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/CommentReplyInput.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentReplyInput.js.map +1 -1
- package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
- package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.js +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.js.map +1 -1
- package/cjs-bundle/components/CommentInputNext/useFilePaste.js +2 -0
- package/cjs-bundle/components/CommentInputNext/useFilePaste.js.map +1 -0
- package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
- 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/IconMenu/index.js +1 -1
- package/cjs-bundle/components/IconMenu/index.js.map +1 -1
- package/cjs-bundle/components/KeyboardDateTimePicker.js +1 -1
- package/cjs-bundle/components/KeyboardDateTimePicker.js.map +1 -1
- package/cjs-bundle/components/LinkedText/LinkedText.js +2 -0
- package/cjs-bundle/components/LinkedText/LinkedText.js.map +1 -0
- package/cjs-bundle/components/LinkedText/LinkedText.scss.js +2 -0
- package/cjs-bundle/components/LinkedText/LinkedText.scss.js.map +1 -0
- package/cjs-bundle/components/NewDocumentViewer/utils.js +1 -1
- package/cjs-bundle/components/NewDocumentViewer/utils.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV5/components/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/PostInput/PostInput.js +1 -1
- package/cjs-bundle/components/PostInput/PostInput.js.map +1 -1
- package/cjs-bundle/components/UserMention/constants.js +1 -1
- package/cjs-bundle/components/UserMention/constants.js.map +1 -1
- package/cjs-bundle/components/UserMention/index.js +1 -1
- package/cjs-bundle/components/UserMention/index.js.map +1 -1
- package/cjs-bundle/components/index.js +1 -1
- package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
- package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.js.map +1 -1
- package/cjs-bundle/componentsV2/ButtonIcon/ButtonIcon.scss.js +1 -1
- package/cjs-bundle/componentsV2/Modal/Modal.js +1 -1
- package/cjs-bundle/componentsV2/Modal/Modal.js.map +1 -1
- package/cjs-bundle/componentsV2/Modal/constants.js +2 -0
- package/cjs-bundle/componentsV2/Modal/constants.js.map +1 -0
- package/cjs-bundle/effects/useOutsideClick.js +1 -1
- package/cjs-bundle/effects/useOutsideClick.js.map +1 -1
- package/cjs-bundle/utils/fetchAttachment.js +2 -0
- package/cjs-bundle/utils/fetchAttachment.js.map +1 -0
- package/cjs-bundle/utils/links.js +2 -0
- package/cjs-bundle/utils/links.js.map +1 -0
- package/components/AddComment/Popover.js +1 -1
- package/components/AddComment/Popover.js.map +1 -1
- package/components/AddComment/components/Content.js +1 -1
- package/components/AddComment/components/Content.js.map +1 -1
- package/components/AssetEditor/AssetEditorAutocomplete.d.ts +96 -13
- package/components/AssetEditor/AssetEditorAutocomplete.d.ts.map +1 -1
- package/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
- package/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
- package/components/AssetEditorV2/index.d.ts +28 -12
- package/components/AssetEditorV2/index.d.ts.map +1 -1
- package/components/AssetEditorV2/index.js +1 -1
- package/components/AssetEditorV2/index.js.map +1 -1
- package/components/AttachmentLightbox/AttachmentDocument.d.ts +6 -0
- package/components/AttachmentLightbox/AttachmentDocument.d.ts.map +1 -0
- package/components/AttachmentLightbox/AttachmentDocument.js +2 -0
- package/components/AttachmentLightbox/AttachmentDocument.js.map +1 -0
- package/components/AttachmentLightbox/AttachmentLightbox.d.ts +9 -8
- package/components/AttachmentLightbox/AttachmentLightbox.d.ts.map +1 -1
- package/components/AttachmentLightbox/AttachmentLightbox.js +1 -1
- package/components/AttachmentLightbox/AttachmentLightbox.js.map +1 -1
- package/components/AttachmentLightbox/AttachmentLightbox.scss.js +1 -1
- package/components/AttachmentLightbox/AttachmentPreviewPane.d.ts +9 -0
- package/components/AttachmentLightbox/AttachmentPreviewPane.d.ts.map +1 -0
- package/components/AttachmentLightbox/AttachmentPreviewPane.js +2 -0
- package/components/AttachmentLightbox/AttachmentPreviewPane.js.map +1 -0
- package/components/AttachmentLightbox/__tests__/AttachmentDocument.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/AttachmentDocument.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/__tests__/AttachmentLightbox.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/AttachmentLightbox.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/__tests__/copyImageToClipboard.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/copyImageToClipboard.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/__tests__/downloadAttachment.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/downloadAttachment.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/__tests__/useZoomPan.test.d.ts +2 -0
- package/components/AttachmentLightbox/__tests__/useZoomPan.test.d.ts.map +1 -0
- package/components/AttachmentLightbox/copyImageToClipboard.d.ts +4 -0
- package/components/AttachmentLightbox/copyImageToClipboard.d.ts.map +1 -0
- package/components/AttachmentLightbox/copyImageToClipboard.js +2 -0
- package/components/AttachmentLightbox/copyImageToClipboard.js.map +1 -0
- package/components/AttachmentLightbox/downloadAttachment.d.ts +10 -0
- package/components/AttachmentLightbox/downloadAttachment.d.ts.map +1 -0
- package/components/AttachmentLightbox/downloadAttachment.js +2 -0
- package/components/AttachmentLightbox/downloadAttachment.js.map +1 -0
- package/components/AttachmentLightbox/useAttachmentLightbox.d.ts +6 -2
- package/components/AttachmentLightbox/useAttachmentLightbox.d.ts.map +1 -1
- package/components/AttachmentLightbox/useAttachmentLightbox.js +1 -1
- package/components/AttachmentLightbox/useAttachmentLightbox.js.map +1 -1
- package/components/AttachmentLightbox/useZoomPan.d.ts +29 -0
- package/components/AttachmentLightbox/useZoomPan.d.ts.map +1 -0
- package/components/AttachmentLightbox/useZoomPan.js +2 -0
- package/components/AttachmentLightbox/useZoomPan.js.map +1 -0
- package/components/AttachmentPreview/AttachmentActionsMenu.d.ts +16 -0
- package/components/AttachmentPreview/AttachmentActionsMenu.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentActionsMenu.js +2 -0
- package/components/AttachmentPreview/AttachmentActionsMenu.js.map +1 -0
- package/components/AttachmentPreview/AttachmentDownloadLink.d.ts +11 -0
- package/components/AttachmentPreview/AttachmentDownloadLink.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentDownloadLink.js +2 -0
- package/components/AttachmentPreview/AttachmentDownloadLink.js.map +1 -0
- package/components/AttachmentPreview/AttachmentImage.d.ts +12 -0
- package/components/AttachmentPreview/AttachmentImage.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentImage.js +2 -0
- package/components/AttachmentPreview/AttachmentImage.js.map +1 -0
- package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts +7 -0
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentRow.d.ts +7 -3
- package/components/AttachmentPreview/AttachmentRow.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentRow.js +1 -1
- package/components/AttachmentPreview/AttachmentRow.js.map +1 -1
- package/components/AttachmentPreview/AttachmentTile.d.ts +5 -1
- package/components/AttachmentPreview/AttachmentTile.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentTile.js +1 -1
- package/components/AttachmentPreview/AttachmentTile.js.map +1 -1
- package/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.d.ts.map +1 -0
- package/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.d.ts.map +1 -0
- package/components/AttachmentPreview/__tests__/AttachmentImage.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/AttachmentImage.test.d.ts.map +1 -0
- package/components/AttachmentPreview/__tests__/AttachmentTile.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/AttachmentTile.test.d.ts.map +1 -0
- package/components/AttachmentPreview/__tests__/useStoredAttachments.test.d.ts +2 -0
- package/components/AttachmentPreview/__tests__/useStoredAttachments.test.d.ts.map +1 -0
- package/components/AttachmentPreview/useStoredAttachment.d.ts +8 -0
- package/components/AttachmentPreview/useStoredAttachment.d.ts.map +1 -1
- package/components/AttachmentPreview/useStoredAttachment.js +2 -0
- package/components/AttachmentPreview/useStoredAttachment.js.map +1 -0
- package/components/AttachmentPreview/useStoredAttachments.d.ts +1 -1
- package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -1
- package/components/AttachmentPreview/useStoredAttachments.js +1 -1
- package/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/components/CommentCard/CommentCard.d.ts.map +1 -1
- package/components/CommentCard/CommentCard.js +1 -1
- package/components/CommentCard/CommentCard.js.map +1 -1
- package/components/CommentCard/CommentCard.types.d.ts +2 -0
- package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
- package/components/CommentCard/CommentMenu.d.ts.map +1 -1
- package/components/CommentCard/CommentMenu.js +1 -1
- package/components/CommentCard/CommentMenu.js.map +1 -1
- package/components/CommentComposer/CommentComposer.d.ts.map +1 -1
- package/components/CommentComposer/CommentComposer.js +1 -1
- package/components/CommentComposer/CommentComposer.js.map +1 -1
- package/components/CommentComposer/CommentReplyInput.d.ts.map +1 -1
- package/components/CommentComposer/CommentReplyInput.js +1 -1
- package/components/CommentComposer/CommentReplyInput.js.map +1 -1
- package/components/CommentComposer/__tests__/useAttachmentUpload.linked.test.d.ts +2 -0
- package/components/CommentComposer/__tests__/useAttachmentUpload.linked.test.d.ts.map +1 -0
- package/components/CommentComposer/useAttachmentUpload.d.ts +1 -0
- package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
- package/components/CommentComposer/useAttachmentUpload.js +1 -1
- package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
- package/components/CommentInputNext/CommentInputNext.d.ts +2 -0
- package/components/CommentInputNext/CommentInputNext.d.ts.map +1 -1
- package/components/CommentInputNext/CommentInputNext.js +1 -1
- package/components/CommentInputNext/CommentInputNext.js.map +1 -1
- package/components/CommentInputNext/__tests__/useFilePaste.test.d.ts +2 -0
- package/components/CommentInputNext/__tests__/useFilePaste.test.d.ts.map +1 -0
- package/components/CommentInputNext/useFilePaste.d.ts +17 -0
- package/components/CommentInputNext/useFilePaste.d.ts.map +1 -0
- package/components/CommentInputNext/useFilePaste.js +2 -0
- package/components/CommentInputNext/useFilePaste.js.map +1 -0
- package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts +5 -1
- package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
- package/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
- 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/IconMenu/index.d.ts +67 -21
- package/components/IconMenu/index.d.ts.map +1 -1
- package/components/IconMenu/index.js +1 -1
- package/components/IconMenu/index.js.map +1 -1
- package/components/KeyboardDateTimePicker.d.ts +6 -7
- package/components/KeyboardDateTimePicker.d.ts.map +1 -1
- package/components/KeyboardDateTimePicker.js +1 -1
- package/components/KeyboardDateTimePicker.js.map +1 -1
- package/components/LinkedText/LinkedText.d.ts +17 -0
- package/components/LinkedText/LinkedText.d.ts.map +1 -0
- package/components/LinkedText/LinkedText.js +2 -0
- package/components/LinkedText/LinkedText.js.map +1 -0
- package/components/LinkedText/LinkedText.scss.js +2 -0
- package/components/LinkedText/LinkedText.scss.js.map +1 -0
- package/components/LinkedText/__tests__/LinkedText.test.d.ts +2 -0
- package/components/LinkedText/__tests__/LinkedText.test.d.ts.map +1 -0
- package/components/LinkedText/index.d.ts +2 -0
- package/components/LinkedText/index.d.ts.map +1 -0
- package/components/NewDocumentViewer/utils.d.ts.map +1 -1
- package/components/NewDocumentViewer/utils.js +1 -1
- package/components/NewDocumentViewer/utils.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
- package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
- package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
- package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
- package/components/OffsetWellPickerV5/components/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/PostInput/PostInput.d.ts +20 -10
- package/components/PostInput/PostInput.d.ts.map +1 -1
- package/components/PostInput/PostInput.js +1 -1
- package/components/PostInput/PostInput.js.map +1 -1
- package/components/UserMention/__tests__/highlightLinks.test.d.ts +2 -0
- package/components/UserMention/__tests__/highlightLinks.test.d.ts.map +1 -0
- package/components/UserMention/constants.d.ts +1 -0
- package/components/UserMention/constants.d.ts.map +1 -1
- package/components/UserMention/constants.js +1 -1
- package/components/UserMention/constants.js.map +1 -1
- package/components/UserMention/index.js +1 -1
- package/components/UserMention/index.js.map +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.map +1 -1
- package/components/index.js +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.d.ts +2 -0
- package/componentsV2/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.js +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.js.map +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.scss.js +1 -1
- package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts +1 -0
- package/componentsV2/ButtonIcon/ButtonIcon.stories.d.ts.map +1 -1
- package/componentsV2/Modal/Modal.d.ts.map +1 -1
- package/componentsV2/Modal/Modal.js +1 -1
- package/componentsV2/Modal/Modal.js.map +1 -1
- package/componentsV2/Modal/constants.d.ts +3 -0
- package/componentsV2/Modal/constants.d.ts.map +1 -0
- package/componentsV2/Modal/constants.js +2 -0
- package/componentsV2/Modal/constants.js.map +1 -0
- package/effects/__tests__/useOutsideClick.test.d.ts.map +1 -1
- package/effects/useOutsideClick.d.ts.map +1 -1
- package/effects/useOutsideClick.js +1 -1
- package/effects/useOutsideClick.js.map +1 -1
- package/mcp-server/server.mjs +35 -9
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/__tests__/fetchAttachment.test.d.ts +2 -0
- package/utils/__tests__/fetchAttachment.test.d.ts.map +1 -0
- package/utils/__tests__/links.test.d.ts +2 -0
- package/utils/__tests__/links.test.d.ts.map +1 -0
- package/utils/fetchAttachment.d.ts +3 -0
- package/utils/fetchAttachment.d.ts.map +1 -0
- package/utils/fetchAttachment.js +2 -0
- package/utils/fetchAttachment.js.map +1 -0
- package/utils/links.d.ts +14 -0
- package/utils/links.d.ts.map +1 -0
- package/utils/links.js +2 -0
- package/utils/links.js.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentLightbox.js","sources":["../../../src/components/AttachmentLightbox/useAttachmentLightbox.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport type { AttachmentPreviewItem } from '../AttachmentPreview/AttachmentPreview.types';\n\nimport { AttachmentLightbox
|
|
1
|
+
{"version":3,"file":"useAttachmentLightbox.js","sources":["../../../src/components/AttachmentLightbox/useAttachmentLightbox.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport type { AttachmentPreviewItem } from '../AttachmentPreview/AttachmentPreview.types';\n\nimport { AttachmentLightbox } from './AttachmentLightbox';\n\nexport type UseAttachmentLightboxOptions = {\n /** Adds \"Share file\" to the overflow menu. */\n onShare?: (item: AttachmentPreviewItem) => void;\n};\n\n/** Wires attachments to the preview modal; a kind with no renderer shows a download card. */\nexport const useAttachmentLightbox = (\n items: AttachmentPreviewItem[],\n { onShare }: UseAttachmentLightboxOptions = {}\n) => {\n const [activeId, setActiveId] = useState<AttachmentPreviewItem['id'] | null>(null);\n\n const openAttachment = (item: AttachmentPreviewItem) => {\n if (!item.isUploading && !item.error) setActiveId(item.id);\n };\n\n return {\n openAttachment,\n lightbox: (\n <AttachmentLightbox\n items={items}\n activeId={activeId}\n onActiveIdChange={setActiveId}\n onClose={() => setActiveId(null)}\n onShare={onShare}\n />\n ),\n };\n};\n"],"names":["useAttachmentLightbox","items","_ref","arguments","length","undefined","onShare","useState","_useState2","_slicedToArray","_useState","activeId","setActiveId","openAttachment","item","isUploading","error","id","lightbox","_jsx","AttachmentLightbox","onActiveIdChange","onClose"],"mappings":"8LAYaA,EAAwB,SACnCC,GAEG,IAAAC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GADyC,CAAE,EAA5CG,IAAAA,QAE8BC,EAAAA,EAA6C,MAAKC,EAAAC,EAAAC,EAAA,GAA3EC,EAAQH,EAAA,GAAEI,EAAWJ,EAAA,GAEtBK,EAAiB,SAACC,GACjBA,EAAKC,aAAgBD,EAAKE,OAAOJ,EAAYE,EAAKG,KAGzD,MAAO,CACLJ,eAAAA,EACAK,SACEC,EAACC,EAAkB,CACjBnB,MAAOA,EACPU,SAAUA,EACVU,iBAAkBT,EAClBU,QAAS,WAAA,OAAMV,EAAY,KAAM,EACjCN,QAASA,IAIjB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PointerEvent as ReactPointerEvent } from 'react';
|
|
2
|
+
export declare const MIN_ZOOM = 1;
|
|
3
|
+
export declare const MAX_ZOOM = 3;
|
|
4
|
+
export declare const ZOOM_STEP = 0.5;
|
|
5
|
+
/**
|
|
6
|
+
* The scroll box does the panning, so a zoom only resizes the content and puts the scroll offset
|
|
7
|
+
* back where the viewer was looking.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useZoomPan: ({ canZoom, canPan, resetKey, }: {
|
|
10
|
+
canZoom: boolean;
|
|
11
|
+
canPan: boolean;
|
|
12
|
+
resetKey: unknown;
|
|
13
|
+
}) => {
|
|
14
|
+
viewportRef: import("react").RefObject<HTMLDivElement>;
|
|
15
|
+
zoom: number;
|
|
16
|
+
zoomIn: () => void;
|
|
17
|
+
zoomOut: () => void;
|
|
18
|
+
canZoomIn: boolean;
|
|
19
|
+
canZoomOut: boolean;
|
|
20
|
+
isPannable: boolean;
|
|
21
|
+
isPanning: boolean;
|
|
22
|
+
panHandlers: {
|
|
23
|
+
onPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
24
|
+
onPointerMove: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
25
|
+
onPointerUp: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
26
|
+
onPointerCancel: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useZoomPan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoomPan.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentLightbox/useZoomPan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAA4C,MAAM,OAAO,CAAC;AAEpG,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,SAAS,MAAM,CAAC;AAY7B;;;GAGG;AACH,eAAO,MAAM,UAAU,mCAIpB;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;;;;;;;;;;+BAoFW,iBAAiB,CAAC,cAAc,CAAC;+BAkBD,iBAAiB,CAAC,cAAc,CAAC;6BAUnC,iBAAiB,CAAC,cAAc,CAAC;;;CAmB1E,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import r from"@babel/runtime/helpers/slicedToArray";import{useRef as n,useState as t,useEffect as e,useCallback as o}from"react";var l=1,c=3,i=.5,u=function(r){return Math.min(Math.max(r,1),3)},a=function(l){var c=l.canZoom,i=l.canPan,a=l.resetKey,s=n(null),f=t(1),p=r(f,2),v=p[0],d=p[1],h=t(!1),m=r(h,2),Y=m[0],L=m[1],P=n(v),X=n(null),g=n(null);e((function(){P.current=v}),[v]),e((function(){d(1),X.current=null}),[a]),e((function(){var r=s.current;if(r){var n=X.current;X.current=null,n?(r.scrollLeft=n.ratioX*r.scrollWidth-n.offsetX,r.scrollTop=n.ratioY*r.scrollHeight-n.offsetY):(r.scrollLeft=(r.scrollWidth-r.clientWidth)/2,r.scrollTop=(r.scrollHeight-r.clientHeight)/2)}}),[v,a]);var T=o((function(r,n){var t=u(P.current+r);t!==P.current&&(n&&(X.current=n),d(t))}),[]),H=o((function(){return T(.5)}),[T]),W=o((function(){return T(-.5)}),[T]);e((function(){var r=s.current;if(r&&c){var n=function(n){var t=.004*-n.deltaY;if(u(P.current+t)!==P.current){n.preventDefault();var e=r.getBoundingClientRect(),o=n.clientX-e.left,l=n.clientY-e.top;T(t,{ratioX:r.scrollWidth?(r.scrollLeft+o)/r.scrollWidth:.5,ratioY:r.scrollHeight?(r.scrollTop+l)/r.scrollHeight:.5,offsetX:o,offsetY:l})}};return r.addEventListener("wheel",n,{passive:!1}),function(){return r.removeEventListener("wheel",n)}}}),[c,T]);var b=i&&v>1,w=o((function(r){var n,t=s.current;!b||r.button>0||!t||(g.current={pointerX:r.clientX,pointerY:r.clientY,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop},null===(n=t.setPointerCapture)||void 0===n||n.call(t,r.pointerId),L(!0))}),[b]),C=o((function(r){var n=g.current,t=s.current;n&&t&&(t.scrollLeft=n.scrollLeft-(r.clientX-n.pointerX),t.scrollTop=n.scrollTop-(r.clientY-n.pointerY))}),[]),I=o((function(r){var n,t;g.current&&(g.current=null,null===(n=s.current)||void 0===n||null===(t=n.releasePointerCapture)||void 0===t||t.call(n,r.pointerId),L(!1))}),[]);return{viewportRef:s,zoom:v,zoomIn:H,zoomOut:W,canZoomIn:v<3,canZoomOut:v>1,isPannable:b,isPanning:Y,panHandlers:{onPointerDown:w,onPointerMove:C,onPointerUp:I,onPointerCancel:I}}};export{c as MAX_ZOOM,l as MIN_ZOOM,i as ZOOM_STEP,a as useZoomPan};
|
|
2
|
+
//# sourceMappingURL=useZoomPan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoomPan.js","sources":["../../../src/components/AttachmentLightbox/useZoomPan.ts"],"sourcesContent":["import { PointerEvent as ReactPointerEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nexport const MIN_ZOOM = 1;\nexport const MAX_ZOOM = 3;\nexport const ZOOM_STEP = 0.5;\n\n// A trackpad pinch arrives as a wheel event; this turns its delta into a comfortable travel.\nconst WHEEL_SENSITIVITY = 0.004;\n\nconst clampZoom = (zoom: number) => Math.min(Math.max(zoom, MIN_ZOOM), MAX_ZOOM);\n\n/** Where the pointer sat in the content, so the same point stays put across a zoom. */\ntype Anchor = { ratioX: number; ratioY: number; offsetX: number; offsetY: number };\n\ntype Drag = { pointerX: number; pointerY: number; scrollLeft: number; scrollTop: number };\n\n/**\n * The scroll box does the panning, so a zoom only resizes the content and puts the scroll offset\n * back where the viewer was looking.\n */\nexport const useZoomPan = ({\n canZoom,\n canPan,\n resetKey,\n}: {\n canZoom: boolean;\n canPan: boolean;\n resetKey: unknown;\n}) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const [zoom, setZoom] = useState(MIN_ZOOM);\n const [isPanning, setIsPanning] = useState(false);\n\n const zoomRef = useRef(zoom);\n const anchorRef = useRef<Anchor | null>(null);\n const dragRef = useRef<Drag | null>(null);\n\n useEffect(() => {\n zoomRef.current = zoom;\n }, [zoom]);\n\n useEffect(() => {\n setZoom(MIN_ZOOM);\n anchorRef.current = null;\n }, [resetKey]);\n\n // Runs after the box has resized, so scrollWidth/Height are the new ones.\n useEffect(() => {\n const viewport = viewportRef.current;\n\n if (!viewport) return;\n\n const anchor = anchorRef.current;\n anchorRef.current = null;\n\n if (anchor) {\n viewport.scrollLeft = anchor.ratioX * viewport.scrollWidth - anchor.offsetX;\n viewport.scrollTop = anchor.ratioY * viewport.scrollHeight - anchor.offsetY;\n } else {\n viewport.scrollLeft = (viewport.scrollWidth - viewport.clientWidth) / 2;\n viewport.scrollTop = (viewport.scrollHeight - viewport.clientHeight) / 2;\n }\n }, [zoom, resetKey]);\n\n const zoomBy = useCallback((delta: number, anchor?: Anchor) => {\n const next = clampZoom(zoomRef.current + delta);\n\n if (next === zoomRef.current) return;\n if (anchor) anchorRef.current = anchor;\n\n setZoom(next);\n }, []);\n\n const zoomIn = useCallback(() => zoomBy(ZOOM_STEP), [zoomBy]);\n const zoomOut = useCallback(() => zoomBy(-ZOOM_STEP), [zoomBy]);\n\n // Native listener: React's onWheel is passive, so it could not block the page from scrolling.\n useEffect(() => {\n const viewport = viewportRef.current;\n\n if (!viewport || !canZoom) return undefined;\n\n const handleWheel = (event: WheelEvent) => {\n const delta = -event.deltaY * WHEEL_SENSITIVITY;\n\n // Already as big or small as it goes: let the wheel scroll whatever is behind the preview.\n if (clampZoom(zoomRef.current + delta) === zoomRef.current) return;\n\n event.preventDefault();\n\n const rect = viewport.getBoundingClientRect();\n const offsetX = event.clientX - rect.left;\n const offsetY = event.clientY - rect.top;\n\n zoomBy(delta, {\n ratioX: viewport.scrollWidth ? (viewport.scrollLeft + offsetX) / viewport.scrollWidth : 0.5,\n ratioY: viewport.scrollHeight\n ? (viewport.scrollTop + offsetY) / viewport.scrollHeight\n : 0.5,\n offsetX,\n offsetY,\n });\n };\n\n viewport.addEventListener('wheel', handleWheel, { passive: false });\n\n return () => viewport.removeEventListener('wheel', handleWheel);\n }, [canZoom, zoomBy]);\n\n const isPannable = canPan && zoom > MIN_ZOOM;\n\n const onPointerDown = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n const viewport = viewportRef.current;\n\n // `> 0` rather than `!== 0`: only a reported secondary/middle button should bail.\n if (!isPannable || event.button > 0 || !viewport) return;\n\n dragRef.current = {\n pointerX: event.clientX,\n pointerY: event.clientY,\n scrollLeft: viewport.scrollLeft,\n scrollTop: viewport.scrollTop,\n };\n viewport.setPointerCapture?.(event.pointerId);\n setIsPanning(true);\n },\n [isPannable]\n );\n\n const onPointerMove = useCallback((event: ReactPointerEvent<HTMLDivElement>) => {\n const drag = dragRef.current;\n const viewport = viewportRef.current;\n\n if (!drag || !viewport) return;\n\n viewport.scrollLeft = drag.scrollLeft - (event.clientX - drag.pointerX);\n viewport.scrollTop = drag.scrollTop - (event.clientY - drag.pointerY);\n }, []);\n\n const onPointerUp = useCallback((event: ReactPointerEvent<HTMLDivElement>) => {\n if (!dragRef.current) return;\n\n dragRef.current = null;\n viewportRef.current?.releasePointerCapture?.(event.pointerId);\n setIsPanning(false);\n }, []);\n\n return {\n viewportRef,\n zoom,\n zoomIn,\n zoomOut,\n canZoomIn: zoom < MAX_ZOOM,\n canZoomOut: zoom > MIN_ZOOM,\n isPannable,\n isPanning,\n panHandlers: { onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp },\n };\n};\n"],"names":["MIN_ZOOM","MAX_ZOOM","ZOOM_STEP","clampZoom","zoom","Math","min","max","useZoomPan","_ref","canZoom","canPan","resetKey","viewportRef","useRef","useState","_useState2","_slicedToArray","_useState","setZoom","_useState4","_useState3","isPanning","setIsPanning","zoomRef","anchorRef","dragRef","useEffect","current","viewport","anchor","scrollLeft","ratioX","scrollWidth","offsetX","scrollTop","ratioY","scrollHeight","offsetY","clientWidth","clientHeight","zoomBy","useCallback","delta","next","zoomIn","zoomOut","handleWheel","event","deltaY","preventDefault","rect","getBoundingClientRect","clientX","left","clientY","top","addEventListener","passive","removeEventListener","isPannable","onPointerDown","_viewport$setPointerC","button","pointerX","pointerY","setPointerCapture","call","pointerId","onPointerMove","drag","onPointerUp","_viewportRef$current","_viewportRef$current$","releasePointerCapture","canZoomIn","canZoomOut","panHandlers","onPointerCancel"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { AttachmentPreviewItem } from './AttachmentPreview.types';
|
|
3
|
+
export type AttachmentActionsMenuProps = {
|
|
4
|
+
item: AttachmentPreviewItem;
|
|
5
|
+
/** Adds "Share file" to the menu. */
|
|
6
|
+
onShare?: (item: AttachmentPreviewItem) => void;
|
|
7
|
+
/** `xs` sits on a tile, `small` in the preview modal's header. */
|
|
8
|
+
size?: 'xs' | 'small';
|
|
9
|
+
/** Test ids read `<prefix>-more`, `<prefix>-share`, and so on. */
|
|
10
|
+
testIdPrefix?: string;
|
|
11
|
+
tooltip?: string;
|
|
12
|
+
imageRef?: RefObject<HTMLImageElement>;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const AttachmentActionsMenu: ({ item, onShare, size, testIdPrefix, tooltip, imageRef, className, }: AttachmentActionsMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=AttachmentActionsMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentActionsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentActionsMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAuB,MAAM,OAAO,CAAC;AAOnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAMlE,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,qCAAqC;IACrC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,kEAAkE;IAClE,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;IACtB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,qBAAqB,yEAQ/B,0BAA0B,4CAmF5B,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o from"@babel/runtime/helpers/slicedToArray";import{useState as s,useEffect as c}from"react";import{ButtonIcon as i}from"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as n}from"../../componentsV2/Tooltip/Tooltip.js";import{Menu as t}from"../../componentsV2/Menu/Menu.js";import{getCanCopyImages as m,copyImageToClipboard as r}from"../AttachmentLightbox/copyImageToClipboard.js";import{MoreOneIcon as e,ShareTwoIcon as p,LinkOneIcon as u,PictureIcon as l}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{showSuccessNotification as a,showErrorNotification as I}from"../../utils/notificationToasts.js";import j from"../../utils/main.js";import{jsxs as d,Fragment as C,jsx as h}from"react/jsx-runtime";var f=function(f){var b,g=f.item,v=f.onShare,F=f.size,k=void 0===F?"small":F,O=f.testIdPrefix,y=void 0===O?"attachment-preview":O,A=f.tooltip,M=void 0===A?"More":A,P=f.imageRef,x=f.className,T=s(null),S=o(T,2),D=S[0],R=S[1];c((function(){R(null)}),[g.id]);var B=g.src||g.downloadUrl,E="image"===(null!==(b=g.kind)&&void 0!==b?b:"file")&&!!g.src&&m(),L=function(o){return function(s){s.stopPropagation(),o(),R(null)}};return d(C,{children:[h(n,{title:M,children:h(i,{size:k,type:"tertiaryBg",ariaLabel:"More actions",isActive:!!D,className:x,onClick:function(o){o.stopPropagation(),R(o.currentTarget)},testId:"".concat(y,"-more"),children:h(e,{})})}),!!D&&d(t,{open:!0,anchorEl:D,placement:"bottom-end",onClose:function(){return R(null)},children:[!!v&&h(t.Item,{prefix:h(p,{}),onClick:L((function(){return v(g)})),testId:"".concat(y,"-share"),children:"Share file"}),h(t.Item,{prefix:h(u,{}),disabled:!B,onClick:L((function(){B&&(j.copyToClipboard(B),a("Link copied to clipboard"))})),testId:"".concat(y,"-copy-link"),children:"Copy link"}),E&&h(t.Item,{prefix:h(l,{}),onClick:L((function(){r(g.src,null==P?void 0:P.current).then((function(o){o?a("Image copied to clipboard"):I("Could not copy the image")}))})),testId:"".concat(y,"-copy-image"),children:"Copy image"})]})]})};export{f as AttachmentActionsMenu};
|
|
2
|
+
//# sourceMappingURL=AttachmentActionsMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentActionsMenu.js","sources":["../../../src/components/AttachmentPreview/AttachmentActionsMenu.tsx"],"sourcesContent":["import { MouseEvent, RefObject, useEffect, useState } from 'react';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { Menu } from '../../componentsV2/Menu';\nimport { copyImageToClipboard, getCanCopyImages } from '../AttachmentLightbox/copyImageToClipboard';\n\nimport { AttachmentPreviewItem } from './AttachmentPreview.types';\n\nimport { LinkOneIcon, MoreOneIcon, PictureIcon, ShareTwoIcon } from '~/icons';\nimport { showErrorNotification, showSuccessNotification } from '~/utils/notificationToasts';\nimport utils from '~/utils/main';\n\nexport type AttachmentActionsMenuProps = {\n item: AttachmentPreviewItem;\n /** Adds \"Share file\" to the menu. */\n onShare?: (item: AttachmentPreviewItem) => void;\n /** `xs` sits on a tile, `small` in the preview modal's header. */\n size?: 'xs' | 'small';\n /** Test ids read `<prefix>-more`, `<prefix>-share`, and so on. */\n testIdPrefix?: string;\n tooltip?: string;\n imageRef?: RefObject<HTMLImageElement>;\n className?: string;\n};\n\nexport const AttachmentActionsMenu = ({\n item,\n onShare,\n size = 'small',\n testIdPrefix = 'attachment-preview',\n tooltip = 'More',\n imageRef,\n className,\n}: AttachmentActionsMenuProps) => {\n const [menuAnchor, setMenuAnchor] = useState<HTMLElement | null>(null);\n\n useEffect(() => {\n setMenuAnchor(null);\n }, [item.id]);\n\n const shareableUrl = item.src || item.downloadUrl;\n const canCopyImage = (item.kind ?? 'file') === 'image' && !!item.src && getCanCopyImages();\n\n const copyImage = () => {\n copyImageToClipboard(item.src as string, imageRef?.current).then(copied => {\n if (copied) showSuccessNotification('Image copied to clipboard');\n else showErrorNotification('Could not copy the image');\n });\n };\n\n // A portalled menu still bubbles its clicks up the React tree, where the tile would take\n // them as its own and open the preview over whatever the action just started.\n const runAndClose = (action: () => void) => (event: MouseEvent) => {\n event.stopPropagation();\n action();\n setMenuAnchor(null);\n };\n\n return (\n <>\n <Tooltip title={tooltip}>\n <ButtonIcon\n size={size}\n type=\"tertiaryBg\"\n ariaLabel=\"More actions\"\n isActive={!!menuAnchor}\n className={className}\n onClick={event => {\n event.stopPropagation();\n setMenuAnchor(event.currentTarget);\n }}\n testId={`${testIdPrefix}-more`}\n >\n <MoreOneIcon />\n </ButtonIcon>\n </Tooltip>\n\n {!!menuAnchor && (\n <Menu open anchorEl={menuAnchor} placement=\"bottom-end\" onClose={() => setMenuAnchor(null)}>\n {!!onShare && (\n <Menu.Item\n prefix={<ShareTwoIcon />}\n onClick={runAndClose(() => onShare(item))}\n testId={`${testIdPrefix}-share`}\n >\n Share file\n </Menu.Item>\n )}\n\n <Menu.Item\n prefix={<LinkOneIcon />}\n disabled={!shareableUrl}\n onClick={runAndClose(() => {\n if (!shareableUrl) return;\n utils.copyToClipboard(shareableUrl);\n showSuccessNotification('Link copied to clipboard');\n })}\n testId={`${testIdPrefix}-copy-link`}\n >\n Copy link\n </Menu.Item>\n\n {/* Only images: no browser lets a page put a video or a document on the clipboard. */}\n {canCopyImage && (\n <Menu.Item\n prefix={<PictureIcon />}\n onClick={runAndClose(copyImage)}\n testId={`${testIdPrefix}-copy-image`}\n >\n Copy image\n </Menu.Item>\n )}\n </Menu>\n )}\n </>\n );\n};\n"],"names":["AttachmentActionsMenu","_ref","_item$kind","item","onShare","_ref$size","size","_ref$testIdPrefix","testIdPrefix","_ref$tooltip","tooltip","imageRef","className","useState","_useState2","_slicedToArray","_useState","menuAnchor","setMenuAnchor","useEffect","id","shareableUrl","src","downloadUrl","canCopyImage","kind","getCanCopyImages","runAndClose","action","event","stopPropagation","_jsxs","_Fragment","children","_jsx","Tooltip","title","ButtonIcon","type","ariaLabel","isActive","onClick","currentTarget","testId","concat","MoreOneIcon","Menu","open","anchorEl","placement","onClose","Item","prefix","ShareTwoIcon","LinkOneIcon","disabled","utils","copyToClipboard","showSuccessNotification","PictureIcon","copyImageToClipboard","current","then","copied","showErrorNotification"],"mappings":"yxIA0BaA,IAAAA,EAAwB,SAQHC,GAAA,IAAAC,EAPhCC,IAAAA,KACAC,IAAAA,QAAOC,EAAAJ,EACPK,KAAAA,aAAO,QAAOD,EAAAE,EAAAN,EACdO,aAAAA,aAAe,qBAAoBD,EAAAE,EAAAR,EACnCS,QAAAA,aAAU,OAAMD,EAChBE,IAAAA,SACAC,IAAAA,UAEoCC,EAAAA,EAA6B,MAAKC,EAAAC,EAAAC,EAAA,GAA/DC,EAAUH,EAAA,GAAEI,EAAaJ,EAAA,GAEhCK,GAAU,WACRD,EAAc,KAChB,GAAG,CAACf,EAAKiB,KAET,IAAMC,EAAelB,EAAKmB,KAAOnB,EAAKoB,YAChCC,EAAyC,mBAA1BtB,EAACC,EAAKsB,oBAAQ,WAAyBtB,EAAKmB,KAAOI,IAWlEC,EAAc,SAACC,GAAkB,OAAK,SAACC,GAC3CA,EAAMC,kBACNF,IACAV,EAAc,MACf,EAED,OACEa,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,EAAO,CAACC,MAAO1B,EAAQuB,SACtBC,EAACG,EAAU,CACT/B,KAAMA,EACNgC,KAAK,aACLC,UAAU,eACVC,WAAYvB,EACZL,UAAWA,EACX6B,QAAS,SAAAZ,GACPA,EAAMC,kBACNZ,EAAcW,EAAMa,cACpB,EACFC,OAAM,GAAAC,OAAKpC,EAAoB,SAAAyB,SAE/BC,EAACW,EAAW,UAIb5B,GACDc,EAACe,EAAI,CAACC,MAAI,EAACC,SAAU/B,EAAYgC,UAAU,aAAaC,QAAS,WAAA,OAAMhC,EAAc,KAAM,EAAAe,SAAA,GACtF7B,GACD8B,EAACY,EAAKK,KAAI,CACRC,OAAQlB,EAACmB,EAAgB,IACzBZ,QAASd,GAAY,WAAA,OAAMvB,EAAQD,MACnCwC,OAAM,GAAAC,OAAKpC,EAAqB,UAAAyB,SAAA,eAMpCC,EAACY,EAAKK,KAAI,CACRC,OAAQlB,EAACoB,EAAe,IACxBC,UAAWlC,EACXoB,QAASd,GAAY,WACdN,IACLmC,EAAMC,gBAAgBpC,GACtBqC,EAAwB,4BAC1B,IACAf,OAAM,GAAAC,OAAKpC,EAAyB,cAAAyB,SAAA,cAMrCT,GACCU,EAACY,EAAKK,KAAI,CACRC,OAAQlB,EAACyB,EAAe,IACxBlB,QAASd,GA/DH,WAChBiC,EAAqBzD,EAAKmB,IAAeX,aAAQ,EAARA,EAAUkD,SAASC,MAAK,SAAAC,GAC3DA,EAAQL,EAAwB,6BAC/BM,EAAsB,2BAC7B,OA4DUrB,OAAM,GAAAC,OAAKpC,EAA0B,eAAAyB,SAAA,oBASnD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type AttachmentDownloadLinkProps = {
|
|
2
|
+
url: string;
|
|
3
|
+
fileName: string;
|
|
4
|
+
/** `xs` sits on a tile, `small` in the preview modal's header. */
|
|
5
|
+
size?: 'xs' | 'small';
|
|
6
|
+
className?: string;
|
|
7
|
+
testId?: string;
|
|
8
|
+
};
|
|
9
|
+
/** Keeps the link semantics but fetches the bytes, since `download` is ignored cross-origin. */
|
|
10
|
+
export declare const AttachmentDownloadLink: ({ url, fileName, size, className, testId, }: AttachmentDownloadLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=AttachmentDownloadLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentDownloadLink.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentDownloadLink.tsx"],"names":[],"mappings":"AAQA,MAAM,MAAM,2BAA2B,GAAG;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,sBAAsB,gDAMhC,2BAA2B,4CAwB7B,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ButtonIcon as o}from"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as s}from"../../componentsV2/Tooltip/Tooltip.js";import{saveAttachment as c}from"../AttachmentLightbox/downloadAttachment.js";import{DownloadIcon as i}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{jsx as n}from"react/jsx-runtime";var t=function(t){var m=t.url,r=t.fileName,e=t.size,p=void 0===e?"small":e,u=t.className,a=t.testId;return n(s,{title:"Download",children:n("a",{href:m,download:r,target:"_blank",rel:"noopener noreferrer",className:u,"data-testid":void 0===a?"attachment-download":a,onClick:function(o){o.preventDefault(),o.stopPropagation(),c(m,r)},children:n(o,{size:p,type:"tertiaryBg",ariaLabel:"Download",children:n(i,{size:"xs"===p?"small":void 0})})})})};export{t as AttachmentDownloadLink};
|
|
2
|
+
//# sourceMappingURL=AttachmentDownloadLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentDownloadLink.js","sources":["../../../src/components/AttachmentPreview/AttachmentDownloadLink.tsx"],"sourcesContent":["import { MouseEvent } from 'react';\n\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { saveAttachment } from '../AttachmentLightbox/downloadAttachment';\n\nimport { DownloadIcon } from '~/icons';\n\nexport type AttachmentDownloadLinkProps = {\n url: string;\n fileName: string;\n /** `xs` sits on a tile, `small` in the preview modal's header. */\n size?: 'xs' | 'small';\n className?: string;\n testId?: string;\n};\n\n/** Keeps the link semantics but fetches the bytes, since `download` is ignored cross-origin. */\nexport const AttachmentDownloadLink = ({\n url,\n fileName,\n size = 'small',\n className,\n testId = 'attachment-download',\n}: AttachmentDownloadLinkProps) => {\n const handleClick = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n saveAttachment(url, fileName);\n };\n\n return (\n <Tooltip title=\"Download\">\n <a\n href={url}\n download={fileName}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={className}\n data-testid={testId}\n onClick={handleClick}\n >\n <ButtonIcon size={size} type=\"tertiaryBg\" ariaLabel=\"Download\">\n <DownloadIcon size={size === 'xs' ? 'small' : undefined} />\n </ButtonIcon>\n </a>\n </Tooltip>\n );\n};\n"],"names":["AttachmentDownloadLink","_ref","url","fileName","_ref$size","size","className","_ref$testId","testId","_jsx","Tooltip","title","children","href","download","target","rel","onClick","event","preventDefault","stopPropagation","saveAttachment","ButtonIcon","type","ariaLabel","DownloadIcon","undefined"],"mappings":"24HAkBaA,IAAAA,EAAyB,SAMHC,GAAA,IALjCC,IAAAA,IACAC,IAAAA,SAAQC,EAAAH,EACRI,KAAAA,aAAO,QAAOD,EACdE,IAAAA,UAASC,EAAAN,EACTO,OAQA,OACEC,EAACC,EAAO,CAACC,MAAM,WAAUC,SACvBH,EAAA,IAAA,CACEI,KAAMX,EACNY,SAAUX,EACVY,OAAO,SACPC,IAAI,sBACJV,UAAWA,EACX,yBAhBG,sBAAqBC,EAiBxBU,QAfc,SAACC,GACnBA,EAAMC,iBACND,EAAME,kBACNC,EAAenB,EAAKC,IAYKS,SAErBH,EAACa,EAAU,CAACjB,KAAMA,EAAMkB,KAAK,aAAaC,UAAU,WAAUZ,SAC5DH,EAACgB,EAAY,CAACpB,KAAe,OAATA,EAAgB,aAAUqB,SAKxD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AttachmentImageProps = {
|
|
2
|
+
src?: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
draggable?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Asks with CORS so the page may read the pixels, which is what lets Copy image work off the
|
|
9
|
+
* screen. A host that answers without the header refuses outright, so a failed load retries plain.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AttachmentImage: import("react").ForwardRefExoticComponent<AttachmentImageProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
12
|
+
//# sourceMappingURL=AttachmentImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentImage.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentImage.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,mHAkB3B,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import r from"@babel/runtime/helpers/slicedToArray";import{forwardRef as a,useState as o}from"react";import{jsx as e}from"react/jsx-runtime";var t=a((function(a,t){var i=a.src,n=a.alt,s=a.className,m=a.draggable,c=o(!0),l=r(c,2),u=l[0],f=l[1];return e("img",{ref:t,src:i,alt:n,className:s,draggable:m,crossOrigin:u?"anonymous":void 0,onError:function(){return f(!1)}},u?"cors":"plain")}));export{t as AttachmentImage};
|
|
2
|
+
//# sourceMappingURL=AttachmentImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentImage.js","sources":["../../../src/components/AttachmentPreview/AttachmentImage.tsx"],"sourcesContent":["import { forwardRef, useState } from 'react';\n\nexport type AttachmentImageProps = {\n src?: string;\n alt: string;\n className?: string;\n draggable?: boolean;\n};\n\n/**\n * Asks with CORS so the page may read the pixels, which is what lets Copy image work off the\n * screen. A host that answers without the header refuses outright, so a failed load retries plain.\n */\nexport const AttachmentImage = forwardRef<HTMLImageElement, AttachmentImageProps>(\n ({ src, alt, className, draggable }, ref) => {\n const [readable, setReadable] = useState(true);\n\n return (\n <img\n // Keyed so the browser re-requests rather than reusing the refused response.\n key={readable ? 'cors' : 'plain'}\n ref={ref}\n src={src}\n alt={alt}\n className={className}\n draggable={draggable}\n crossOrigin={readable ? 'anonymous' : undefined}\n onError={() => setReadable(false)}\n />\n );\n }\n);\n"],"names":["AttachmentImage","forwardRef","_ref","ref","src","alt","className","draggable","useState","_useState2","_slicedToArray","_useState","readable","setReadable","_jsx","crossOrigin","undefined","onError"],"mappings":"iJAaaA,EAAkBC,GAC7B,SAAAC,EAAqCC,GAAQ,IAA1CC,IAAAA,IAAKC,IAAAA,IAAKC,IAAAA,UAAWC,IAAAA,UACUC,EAAAA,GAAS,GAAKC,EAAAC,EAAAC,EAAA,GAAvCC,EAAQH,EAAA,GAAEI,EAAWJ,EAAA,GAE5B,OACEK,EAAA,MAAA,CAGEX,IAAKA,EACLC,IAAKA,EACLC,IAAKA,EACLC,UAAWA,EACXC,UAAWA,EACXQ,YAAaH,EAAW,iBAAcI,EACtCC,QAAS,WAAA,OAAMJ,GAAY,EAAM,GAP5BD,EAAW,OAAS,QAU/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentPreview.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentPreview.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"AttachmentPreview.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentPreview.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,mHA8B7B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{forwardRef as r}from"react";import{useAttachmentLightbox as o}from"../AttachmentLightbox/useAttachmentLightbox.js";import{AttachmentRow as n}from"./AttachmentRow.js";import{SortableAttachments as i}from"./SortableAttachments.js";import{jsx as c,jsxs as m,Fragment as p}from"react/jsx-runtime";var l=["onReorder","onItemClick"];function
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{forwardRef as r}from"react";import{useAttachmentLightbox as o}from"../AttachmentLightbox/useAttachmentLightbox.js";import{AttachmentRow as n}from"./AttachmentRow.js";import{SortableAttachments as i}from"./SortableAttachments.js";import{jsx as c,jsxs as m,Fragment as p}from"react/jsx-runtime";var l=["onReorder","onItemClick","onShare"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?a(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var b=r((function(e,r){var a=e.onReorder,b=e.onItemClick,s=e.onShare,h=t(e,l),u=o(h.items,{onShare:s}),O=u.openAttachment,j=u.lightbox;if(!h.items.length)return null;var g=!!a&&h.items.length>1?c(i,f(f({},h),{},{ref:r,onReorder:a,onItemClick:null!=b?b:O})):c(n,f(f({},h),{},{ref:r,onShare:s,onItemClick:null!=b?b:O}));return m(p,{children:[g,!b&&j]})}));export{b as AttachmentPreview};
|
|
2
2
|
//# sourceMappingURL=AttachmentPreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentPreview.js","sources":["../../../src/components/AttachmentPreview/AttachmentPreview.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { useAttachmentLightbox } from '../AttachmentLightbox/useAttachmentLightbox';\n\nimport { AttachmentRow } from './AttachmentRow';\nimport { SortableAttachments } from './SortableAttachments';\nimport { AttachmentPreviewProps } from './AttachmentPreview.types';\n\n/**\n * Picks the strip that fits — reorderable or plain — and gives it a lightbox. Rendering lives in\n * `AttachmentRow`, drag-and-drop in `SortableAttachments`, the modal in `useAttachmentLightbox`.\n */\nexport const AttachmentPreview = forwardRef<HTMLDivElement, AttachmentPreviewProps>(\n ({ onReorder, onItemClick, ...props }, ref) => {\n
|
|
1
|
+
{"version":3,"file":"AttachmentPreview.js","sources":["../../../src/components/AttachmentPreview/AttachmentPreview.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { useAttachmentLightbox } from '../AttachmentLightbox/useAttachmentLightbox';\n\nimport { AttachmentRow } from './AttachmentRow';\nimport { SortableAttachments } from './SortableAttachments';\nimport { AttachmentPreviewProps } from './AttachmentPreview.types';\n\n/**\n * Picks the strip that fits — reorderable or plain — and gives it a lightbox. Rendering lives in\n * `AttachmentRow`, drag-and-drop in `SortableAttachments`, the modal in `useAttachmentLightbox`.\n */\nexport const AttachmentPreview = forwardRef<HTMLDivElement, AttachmentPreviewProps>(\n ({ onReorder, onItemClick, onShare, ...props }, ref) => {\n const { openAttachment, lightbox } = useAttachmentLightbox(props.items, { onShare });\n\n if (!props.items.length) return null;\n\n const isSortable = !!onReorder && props.items.length > 1;\n const strip = isSortable ? (\n <SortableAttachments\n {...props}\n ref={ref}\n onReorder={onReorder}\n onItemClick={onItemClick ?? openAttachment}\n />\n ) : (\n <AttachmentRow\n {...props}\n ref={ref}\n onShare={onShare}\n onItemClick={onItemClick ?? openAttachment}\n />\n );\n\n return (\n <>\n {strip}\n {!onItemClick && lightbox}\n </>\n );\n }\n);\n"],"names":["AttachmentPreview","forwardRef","_ref","ref","onReorder","onItemClick","onShare","props","_objectWithoutProperties","_excluded","_useAttachmentLightbo","useAttachmentLightbox","items","openAttachment","lightbox","length","strip","_jsx","SortableAttachments","AttachmentRow","_objectSpread","_jsxs","_Fragment","children"],"mappings":"8gCAYaA,EAAoBC,GAC/B,SAAAC,EAAgDC,GAAQ,IAArDC,IAAAA,UAAWC,IAAAA,YAAaC,IAAAA,QAAYC,EAAKC,EAAAN,EAAAO,GAC1CC,EAAqCC,EAAsBJ,EAAMK,MAAO,CAAEN,QAAAA,IAAlEO,IAAAA,eAAgBC,IAAAA,SAExB,IAAKP,EAAMK,MAAMG,OAAQ,OAAO,KAEhC,IACMC,IADeZ,GAAaG,EAAMK,MAAMG,OAAS,EAErDE,EAACC,SACKX,GAAK,GAAA,CACTJ,IAAKA,EACLC,UAAWA,EACXC,YAAaA,QAAAA,EAAeQ,KAG9BI,EAACE,EAAaC,EAAAA,EAAA,CAAA,EACRb,GAAK,GAAA,CACTJ,IAAKA,EACLG,QAASA,EACTD,YAAaA,QAAAA,EAAeQ,KAIhC,OACEQ,EAAAC,EAAA,CAAAC,SAAA,CACGP,GACCX,GAAeS,IAGvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={spacing:"8",scroller:"AttachmentPreview_scroller__ZqYC8",slot:"AttachmentPreview_slot__ewKLo",slotDragging:"AttachmentPreview_slotDragging__hrfJX",slotContent:"AttachmentPreview_slotContent__GNuSu",insertion:"AttachmentPreview_insertion__iFqlp",insertionBefore:"AttachmentPreview_insertionBefore__jyWQM",insertionEdge:"AttachmentPreview_insertionEdge__Bjk1t",insertionAfter:"AttachmentPreview_insertionAfter__4NvhP",dragGhost:"AttachmentPreview_dragGhost__4aSzE",dragGhostHandle:"AttachmentPreview_dragGhostHandle__Gu2CP",thumbnail:"AttachmentPreview_thumbnail__ytI2L",clickable:"AttachmentPreview_clickable__BEXzK",thumbnailInner:"AttachmentPreview_thumbnailInner__9Ex4-",thumbnailImage:"AttachmentPreview_thumbnailImage__RQ4fL",videoOverlay:"AttachmentPreview_videoOverlay__5Lgi1",playIcon:"AttachmentPreview_playIcon__OOnql",fileCard:"AttachmentPreview_fileCard__oxDbD",fileCardLink:"AttachmentPreview_fileCardLink__TDpvh",fileCardContent:"AttachmentPreview_fileCardContent__c-99Q",fileInfo:"AttachmentPreview_fileInfo__eqJ-B",fileName:"AttachmentPreview_fileName__1Ccg0",fileType:"AttachmentPreview_fileType__0v6E4",
|
|
1
|
+
import t from'./../../ext-esm/style-inject/dist/style-inject.es.js';var e={spacing:"8",scroller:"AttachmentPreview_scroller__ZqYC8",slot:"AttachmentPreview_slot__ewKLo",slotDragging:"AttachmentPreview_slotDragging__hrfJX",slotContent:"AttachmentPreview_slotContent__GNuSu",insertion:"AttachmentPreview_insertion__iFqlp",insertionBefore:"AttachmentPreview_insertionBefore__jyWQM",insertionEdge:"AttachmentPreview_insertionEdge__Bjk1t",insertionAfter:"AttachmentPreview_insertionAfter__4NvhP",dragGhost:"AttachmentPreview_dragGhost__4aSzE",dragGhostHandle:"AttachmentPreview_dragGhostHandle__Gu2CP",thumbnail:"AttachmentPreview_thumbnail__ytI2L",clickable:"AttachmentPreview_clickable__BEXzK",selected:"AttachmentPreview_selected__JRuMO",thumbnailInner:"AttachmentPreview_thumbnailInner__9Ex4-",thumbnailImage:"AttachmentPreview_thumbnailImage__RQ4fL",videoOverlay:"AttachmentPreview_videoOverlay__5Lgi1",playIcon:"AttachmentPreview_playIcon__OOnql",fileCard:"AttachmentPreview_fileCard__oxDbD",fileCardLink:"AttachmentPreview_fileCardLink__TDpvh",fileCardContent:"AttachmentPreview_fileCardContent__c-99Q",fileInfo:"AttachmentPreview_fileInfo__eqJ-B",fileName:"AttachmentPreview_fileName__1Ccg0",fileType:"AttachmentPreview_fileType__0v6E4",tileActions:"AttachmentPreview_tileActions__2nLlw",tileActionLink:"AttachmentPreview_tileActionLink__aMyS4",removeButton:"AttachmentPreview_removeButton__aX-qu",removeButtonVisible:"AttachmentPreview_removeButtonVisible__BVjYB",thumbnailError:"AttachmentPreview_thumbnailError__yyH08",uploadingOverlay:"AttachmentPreview_uploadingOverlay__leV1D",uploadingSpinner:"AttachmentPreview_uploadingSpinner__u-t7d",loader:"AttachmentPreview_loader__HK5bZ",errorOverlay:"AttachmentPreview_errorOverlay__8sM1d",retryButton:"AttachmentPreview_retryButton__tKVV0"};t('.AttachmentPreview_scroller__ZqYC8{-ms-overflow-style:none;align-items:flex-start;display:flex;gap:12px;margin-left:-8px;overflow-x:auto;overflow-y:visible;padding-left:8px;padding-right:8px;padding-top:6px;scroll-behavior:smooth;scrollbar-width:none}.AttachmentPreview_scroller__ZqYC8::-webkit-scrollbar{display:none}.AttachmentPreview_slot__ewKLo{border-radius:8px;cursor:grab;flex-shrink:0;position:relative;touch-action:none}.AttachmentPreview_slot__ewKLo:focus-visible{outline:none}.AttachmentPreview_slot__ewKLo:focus-visible:before{border:2px solid var(--palette-primary-main);border-radius:8px;content:"";inset:0;pointer-events:none;position:absolute;z-index:5}.AttachmentPreview_slotDragging__hrfJX{cursor:grabbing}.AttachmentPreview_slotDragging__hrfJX .AttachmentPreview_slotContent__GNuSu{visibility:hidden}.AttachmentPreview_slotDragging__hrfJX:focus-visible:before{display:none}.AttachmentPreview_slotDragging__hrfJX:after{background:rgb(from var(--palette-primary-text-1) r g b/.04);border:1px dashed var(--palette-primary-text-6);border-radius:8px;content:"";inset:0;position:absolute}.AttachmentPreview_insertion__iFqlp{background:var(--palette-primary-main);border-radius:2px;bottom:0;box-shadow:0 0 6px rgb(from var(--palette-primary-main) r g b/.6);position:absolute;top:0;width:2px;z-index:4}.AttachmentPreview_insertionBefore__jyWQM,.AttachmentPreview_insertionEdge__Bjk1t{left:-7px}.AttachmentPreview_insertionAfter__4NvhP{right:-7px}.AttachmentPreview_dragGhost__4aSzE{background:var(--palette-background-b-6);border-radius:8px;box-shadow:0 10px 20px rgb(from var(--palette-background-b-1) r g b/.45);cursor:grabbing;opacity:.9;position:relative;transform:rotate(4deg)}.AttachmentPreview_dragGhostHandle__Gu2CP{align-items:center;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute;z-index:2}.AttachmentPreview_dragGhostHandle__Gu2CP button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.16)!important;color:var(--palette-primary-text-1)!important}.AttachmentPreview_dragGhostHandle__Gu2CP svg{color:var(--palette-primary-text-1)}.AttachmentPreview_thumbnail__ytI2L{border-radius:8px;flex-shrink:0;height:64px;overflow:visible;position:relative;width:64px}.AttachmentPreview_clickable__BEXzK{cursor:pointer}.AttachmentPreview_clickable__BEXzK:hover{opacity:.9}.AttachmentPreview_selected__JRuMO:after{border:1px solid var(--palette-primary-main);border-radius:8px;content:"";inset:0;pointer-events:none;position:absolute;z-index:4}.AttachmentPreview_thumbnailInner__9Ex4-{border-radius:8px;inset:0;overflow:hidden;pointer-events:none;position:absolute}.AttachmentPreview_thumbnailImage__RQ4fL{height:100%;left:50%;max-width:none;min-width:100%;object-fit:cover;pointer-events:none;position:absolute;top:0;transform:translateX(-50%);width:auto}.AttachmentPreview_videoOverlay__5Lgi1{align-items:center;background:rgb(from var(--palette-background-b-1) r g b/.5);border-radius:8px;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute}.AttachmentPreview_playIcon__OOnql{color:var(--palette-primary-text-1);font-size:32px}.AttachmentPreview_fileCard__oxDbD{align-items:flex-start;border:1px solid rgb(from var(--palette-primary-text-1) r g b/.08);border-radius:8px;display:flex;flex-direction:column;flex-shrink:0;height:64px;justify-content:center;padding:8px 16px;position:relative;width:142px}.AttachmentPreview_fileCardLink__TDpvh{color:inherit;cursor:pointer;text-decoration:none}.AttachmentPreview_fileCardLink__TDpvh:hover{border-color:rgb(from var(--palette-primary-text-1) r g b/.16)}.AttachmentPreview_fileCardContent__c-99Q{align-items:center;display:flex;gap:8px;width:100%}.AttachmentPreview_fileInfo__eqJ-B{align-items:flex-start;display:flex;flex:1 0 0;flex-direction:column;justify-content:center;min-width:0}.AttachmentPreview_fileName__1Ccg0{color:var(--palette-primary-text-1)}.AttachmentPreview_fileName__1Ccg0,.AttachmentPreview_fileType__0v6E4{font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.AttachmentPreview_fileType__0v6E4{color:var(--palette-primary-text-6);text-transform:uppercase}.AttachmentPreview_tileActions__2nLlw{display:flex;gap:4px;opacity:0;position:absolute;right:-6px;top:-6px;transition:opacity .2s;z-index:3}.AttachmentPreview_tileActions__2nLlw button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_tileActions__2nLlw button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}.AttachmentPreview_fileCard__oxDbD .AttachmentPreview_tileActions__2nLlw:focus-within,.AttachmentPreview_fileCard__oxDbD:hover .AttachmentPreview_tileActions__2nLlw,.AttachmentPreview_thumbnail__ytI2L .AttachmentPreview_tileActions__2nLlw:focus-within,.AttachmentPreview_thumbnail__ytI2L:hover .AttachmentPreview_tileActions__2nLlw{opacity:1}.AttachmentPreview_tileActionLink__aMyS4{display:inline-flex}.AttachmentPreview_removeButton__aX-qu{opacity:0;position:absolute;right:-6px;top:-6px;transition:opacity .2s;z-index:3}.AttachmentPreview_removeButton__aX-qu button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_removeButton__aX-qu button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}.AttachmentPreview_fileCard__oxDbD:hover .AttachmentPreview_removeButton__aX-qu,.AttachmentPreview_removeButtonVisible__BVjYB,.AttachmentPreview_thumbnail__ytI2L:hover .AttachmentPreview_removeButton__aX-qu{opacity:1}.AttachmentPreview_thumbnailError__yyH08{border:1px solid rgb(from var(--palette-error-main) r g b/.4)}.AttachmentPreview_uploadingOverlay__leV1D{background:rgb(from var(--palette-background-b-1) r g b/.5);border-radius:8px;inset:0;pointer-events:none;position:absolute}.AttachmentPreview_uploadingSpinner__u-t7d{align-items:center;backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08);border-radius:6px;display:flex;height:24px;justify-content:center;position:absolute;right:-6px;top:-6px;width:24px;z-index:2}.AttachmentPreview_loader__HK5bZ{color:var(--palette-primary-text-6)!important;height:14px!important;width:14px!important}.AttachmentPreview_errorOverlay__8sM1d{background:rgb(from var(--palette-error-main) r g b/.08);border-radius:8px;inset:0;pointer-events:none;position:absolute}.AttachmentPreview_retryButton__tKVV0{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:2}.AttachmentPreview_retryButton__tKVV0 button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_retryButton__tKVV0 button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}');export{e as default};
|
|
2
2
|
//# sourceMappingURL=AttachmentPreview.scss.js.map
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export type AttachmentKind = 'image' | 'video' | 'file';
|
|
2
2
|
export type AttachmentPreviewItem = {
|
|
3
3
|
id: string | number;
|
|
4
|
+
/** For a stored attachment this is the S3 key, not a bare file name. */
|
|
4
5
|
name: string;
|
|
5
6
|
src?: string;
|
|
6
7
|
downloadUrl?: string;
|
|
7
8
|
kind?: AttachmentKind;
|
|
9
|
+
/** Bytes. */
|
|
10
|
+
size?: number;
|
|
8
11
|
isUploading?: boolean;
|
|
9
12
|
error?: string;
|
|
10
13
|
};
|
|
@@ -13,6 +16,10 @@ export type AttachmentPreviewProps = {
|
|
|
13
16
|
onRemove?: (id: AttachmentPreviewItem['id']) => void;
|
|
14
17
|
onRetry?: (id: AttachmentPreviewItem['id']) => void;
|
|
15
18
|
onItemClick?: (item: AttachmentPreviewItem) => void;
|
|
19
|
+
/** Adds "Share file" to the overflow menu. Ignored when `onItemClick` takes the click over. */
|
|
20
|
+
onShare?: (item: AttachmentPreviewItem) => void;
|
|
21
|
+
/** Drops the per-tile hover actions, where the surrounding UI already offers them. */
|
|
22
|
+
hideActions?: boolean;
|
|
16
23
|
/** Enables drag-to-reorder; receives the full id list in its new order. */
|
|
17
24
|
onReorder?: (orderedIds: AttachmentPreviewItem['id'][]) => void;
|
|
18
25
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentPreview.types.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentPreview.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACpD,2EAA2E;IAC3E,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,qBAAqB,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC;IAEhE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"AttachmentPreview.types.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentPreview.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,aAAa;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACpD,+FAA+F;IAC/F,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,sFAAsF;IACtF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,qBAAqB,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC;IAEhE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { AttachmentPreviewProps } from './AttachmentPreview.types';
|
|
2
|
-
export type AttachmentRowProps = Omit<AttachmentPreviewProps, 'onReorder'
|
|
1
|
+
import { AttachmentPreviewItem, AttachmentPreviewProps } from './AttachmentPreview.types';
|
|
2
|
+
export type AttachmentRowProps = Omit<AttachmentPreviewProps, 'onReorder'> & {
|
|
3
|
+
selectedId?: AttachmentPreviewItem['id'];
|
|
4
|
+
};
|
|
3
5
|
/** The plain, non-reorderable strip. `SortableAttachments` is its drag-and-drop counterpart. */
|
|
4
|
-
export declare const AttachmentRow: import("react").ForwardRefExoticComponent<
|
|
6
|
+
export declare const AttachmentRow: import("react").ForwardRefExoticComponent<Omit<AttachmentPreviewProps, "onReorder"> & {
|
|
7
|
+
selectedId?: AttachmentPreviewItem['id'];
|
|
8
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
9
|
//# sourceMappingURL=AttachmentRow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentRow.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentRow.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentRow.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentRow.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAI1F,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE,WAAW,CAAC,GAAG;IAC3E,UAAU,CAAC,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;CAC1C,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,aAAa;iBAJX,qBAAqB,CAAC,IAAI,CAAC;kDAwBzC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef as
|
|
1
|
+
import{forwardRef as e}from"react";import t from"classnames";import{AttachmentTile as r}from"./AttachmentTile.js";import o from"./AttachmentPreview.scss.js";import{jsx as i}from"react/jsx-runtime";var m=e((function(e,m){var n=e.items,s=e.onRemove,c=e.onRetry,a=e.onItemClick,d=e.onShare,l=e.selectedId,f=e.hideActions,h=e.className,p=e.testId;return i("div",{ref:m,"data-testid":p,className:t(o.scroller,h),children:n.map((function(e){return i(r,{item:e,onRemove:s,onRetry:c,onItemClick:a,onShare:d,isSelected:void 0!==l&&e.id===l,hideActions:f},e.id)}))})}));export{m as AttachmentRow};
|
|
2
2
|
//# sourceMappingURL=AttachmentRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentRow.js","sources":["../../../src/components/AttachmentPreview/AttachmentRow.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classNames from 'classnames';\n\nimport { AttachmentTile } from './AttachmentTile';\nimport { AttachmentPreviewProps } from './AttachmentPreview.types';\n\nimport styles from './AttachmentPreview.scss';\n\nexport type AttachmentRowProps = Omit<AttachmentPreviewProps, 'onReorder'
|
|
1
|
+
{"version":3,"file":"AttachmentRow.js","sources":["../../../src/components/AttachmentPreview/AttachmentRow.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classNames from 'classnames';\n\nimport { AttachmentTile } from './AttachmentTile';\nimport { AttachmentPreviewItem, AttachmentPreviewProps } from './AttachmentPreview.types';\n\nimport styles from './AttachmentPreview.scss';\n\nexport type AttachmentRowProps = Omit<AttachmentPreviewProps, 'onReorder'> & {\n selectedId?: AttachmentPreviewItem['id'];\n};\n\n/** The plain, non-reorderable strip. `SortableAttachments` is its drag-and-drop counterpart. */\nexport const AttachmentRow = forwardRef<HTMLDivElement, AttachmentRowProps>(\n (\n { items, onRemove, onRetry, onItemClick, onShare, selectedId, hideActions, className, testId },\n ref\n ) => (\n <div ref={ref} data-testid={testId} className={classNames(styles.scroller, className)}>\n {items.map(item => (\n <AttachmentTile\n key={item.id}\n item={item}\n onRemove={onRemove}\n onRetry={onRetry}\n onItemClick={onItemClick}\n onShare={onShare}\n isSelected={selectedId !== undefined && item.id === selectedId}\n hideActions={hideActions}\n />\n ))}\n </div>\n )\n);\n"],"names":["AttachmentRow","forwardRef","ref","items","onRemove","onRetry","onItemClick","onShare","selectedId","hideActions","className","testId","_jsx","classNames","styles","scroller","children","map","item","AttachmentTile","isSelected","undefined","id"],"mappings":"yMAaaA,EAAgBC,GAC3B,WAEEC,GAAG,IADDC,IAAAA,MAAOC,IAAAA,SAAUC,IAAAA,QAASC,IAAAA,YAAaC,IAAAA,QAASC,IAAAA,WAAYC,IAAAA,YAAaC,IAAAA,UAAWC,IAAAA,OAAM,OAG5FC,EAAA,MAAA,CAAKV,IAAKA,EAAK,cAAaS,EAAQD,UAAWG,EAAWC,EAAOC,SAAUL,GAAWM,SACnFb,EAAMc,KAAI,SAAAC,GAAI,OACbN,EAACO,EAAc,CAEbD,KAAMA,EACNd,SAAUA,EACVC,QAASA,EACTC,YAAaA,EACbC,QAASA,EACTa,gBAA2BC,IAAfb,GAA4BU,EAAKI,KAAOd,EACpDC,YAAaA,GAPRS,EAAKI,QAUV"}
|
|
@@ -4,6 +4,10 @@ export type AttachmentTileProps = {
|
|
|
4
4
|
onRemove?: AttachmentPreviewProps['onRemove'];
|
|
5
5
|
onRetry?: AttachmentPreviewProps['onRetry'];
|
|
6
6
|
onItemClick?: AttachmentPreviewProps['onItemClick'];
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
hideActions?: boolean;
|
|
9
|
+
/** Adds "Share file" to the tile's hover menu. */
|
|
10
|
+
onShare?: (item: AttachmentPreviewItem) => void;
|
|
7
11
|
};
|
|
8
|
-
export declare const AttachmentTile: ({ item, onRemove, onRetry, onItemClick }: AttachmentTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const AttachmentTile: ({ item, onRemove, onRetry, onItemClick, isSelected, hideActions, onShare, }: AttachmentTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
13
|
//# sourceMappingURL=AttachmentTile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentTile.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentTile.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AttachmentTile.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentPreview/AttachmentTile.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAgB1F,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kDAAkD;IAClD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD,CAAC;AA0FF,eAAO,MAAM,cAAc,gFAQxB,mBAAmB,4CAiGrB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"classnames";import{FileIcon as
|
|
1
|
+
import o from"@babel/runtime/helpers/defineProperty";import{useRef as s}from"react";import i from"classnames";import{FileIcon as n}from"../../componentsV2/FileIcon/FileIcon.js";import{ButtonIcon as c}from"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as t}from"../../componentsV2/Tooltip/Tooltip.js";import{LoaderCircular as e}from"../../componentsV2/LoaderCircular/LoaderCircular.js";import{PlayOneIcon as r,UndoIcon as m,CloseSmallIcon as a}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{AttachmentActionsMenu as l}from"./AttachmentActionsMenu.js";import{AttachmentImage as p}from"./AttachmentImage.js";import{AttachmentDownloadLink as u}from"./AttachmentDownloadLink.js";import d from"./AttachmentPreview.scss.js";import j from"../../utils/main.js";import{jsxs as I,jsx as h,Fragment as f}from"react/jsx-runtime";function v(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,n)}return i}function b(s){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?v(Object(n),!0).forEach((function(i){o(s,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(n,o))}))}return s}var C=function(o){var s,i=o.split(".");return i.length>1?(null!==(s=i.pop())&&void 0!==s?s:"").toUpperCase():""},g=function(o){var s=o.item,i=o.onShare,n=o.imageRef,c=j.getFileNameWithExtensionFromPath(s.name),t=s.downloadUrl||s.src;return I("div",{className:d.tileActions,"data-testid":"attachment-tile-actions",children:[!!t&&h(u,{url:t,fileName:c,size:"xs",className:d.tileActionLink}),h(l,{item:s,onShare:i,size:"xs",testIdPrefix:"attachment-tile",tooltip:"More actions",imageRef:n})]})},y=function(o){return function(s){s.stopPropagation(),o()}},O=function(o){var s=o.item,n=o.onRemove,r=o.onRetry;return I(f,{children:[s.isUploading&&I(f,{children:[h("div",{className:d.uploadingOverlay}),h("div",{className:d.uploadingSpinner,children:h(e,{size:"xs",className:d.loader})})]}),!!s.error&&I(f,{children:[h("div",{className:d.errorOverlay}),r&&h(t,{title:"Retry upload",children:h("div",{className:d.retryButton,children:h(c,{size:"xs",type:"tertiaryBg",onClick:y((function(){return r(s.id)})),testId:"attachment-retry",children:h(m,{size:"small"})})})})]}),n&&!s.isUploading&&h(t,{title:"Remove",children:h("div",{className:i(d.removeButton,!!s.error&&d.removeButtonVisible),children:h(c,{size:"xs",type:"tertiaryBg",onClick:y((function(){return n(s.id)})),testId:"attachment-remove",children:h(a,{size:"small"})})})})]})},N=function(o){var c,e,m=o.item,a=o.onRemove,l=o.onRetry,u=o.onItemClick,v=o.isSelected,y=o.hideActions,N=o.onShare,P=s(null),F=null!==(c=m.kind)&&void 0!==c?c:"file",k=h(O,{item:m,onRemove:a,onRetry:l}),A=j.getFileNameWithExtensionFromPath(m.name),R=!m.isUploading&&!m.error,x=!!u&&R,S=!y&&!a&&R;if("image"===F||"video"===F)return I("div",{className:i(d.thumbnail,x&&d.clickable,v&&d.selected,!!m.error&&d.thumbnailError),onClick:x?function(){return null==u?void 0:u(m)}:void 0,children:[h("div",{className:d.thumbnailInner,children:"image"===F?h(p,{ref:P,src:m.src,alt:A,className:d.thumbnailImage}):h("video",{src:(e=m.src,e&&!e.includes("#t=")?"".concat(e,"#t=0.1"):e),className:d.thumbnailImage,preload:"metadata",playsInline:!0,muted:!0})}),"video"===F&&h("div",{className:d.videoOverlay,children:h(r,{theme:"filled",className:d.playIcon})}),S&&h(g,{item:m,onShare:N,imageRef:P}),k]});var D,E=I(f,{children:[I("div",{className:d.fileCardContent,children:[h(n,{name:A}),I("div",{className:d.fileInfo,children:[h(t,{title:A,children:h("div",{className:d.fileName,children:(D=A,D.replace(/\.[^/.]+$/,""))})}),h("div",{className:d.fileType,children:C(A)})]})]}),S&&h(g,{item:m,onShare:N}),k]}),w=x?{role:"button",tabIndex:0,onClick:function(){return null==u?void 0:u(m)},onKeyDown:function(o){o.target===o.currentTarget&&("Enter"!==o.key&&" "!==o.key||(o.preventDefault(),null==u||u(m)))}}:{};return h("div",b(b({className:i(d.fileCard,x&&d.fileCardLink,v&&d.selected,!!m.error&&d.thumbnailError)},w),{},{children:E}))};export{N as AttachmentTile};
|
|
2
2
|
//# sourceMappingURL=AttachmentTile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentTile.js","sources":["../../../src/components/AttachmentPreview/AttachmentTile.tsx"],"sourcesContent":["import { MouseEvent } from 'react';\nimport classNames from 'classnames';\n\nimport { FileIcon } from '../../componentsV2/FileIcon';\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { LoaderCircular } from '../../componentsV2/LoaderCircular';\nimport { PlayOneIcon, CloseSmallIcon, UndoIcon } from '../../icons';\n\nimport { AttachmentPreviewItem, AttachmentPreviewProps } from './AttachmentPreview.types';\n\nimport styles from './AttachmentPreview.scss';\n\nimport { DownloadIcon } from '~/icons';\nimport utils from '~/utils/main';\n\nconst getExtension = (name: string) => {\n const parts = name.split('.');\n return parts.length > 1 ? (parts.pop() ?? '').toUpperCase() : '';\n};\n\nconst dropExtension = (name: string) => name.replace(/\\.[^/.]+$/, '');\n\n// A bare <video> paints nothing until a frame is decoded; the media fragment forces one.\nconst withFirstFrame = (src?: string) => (src && !src.includes('#t=') ? `${src}#t=0.1` : src);\n\nexport type AttachmentTileProps = {\n item: AttachmentPreviewItem;\n onRemove?: AttachmentPreviewProps['onRemove'];\n onRetry?: AttachmentPreviewProps['onRetry'];\n onItemClick?: AttachmentPreviewProps['onItemClick'];\n};\n\nconst stopAndRun = (action: () => void) => (event: MouseEvent) => {\n event.stopPropagation();\n action();\n};\n\nconst TileOverlays = ({ item, onRemove, onRetry }: Omit<AttachmentTileProps, 'onItemClick'>) => (\n <>\n {item.isUploading && (\n <>\n <div className={styles.uploadingOverlay} />\n <div className={styles.uploadingSpinner}>\n <LoaderCircular size=\"xs\" className={styles.loader} />\n </div>\n </>\n )}\n\n {!!item.error && (\n <>\n <div className={styles.errorOverlay} />\n {onRetry && (\n <Tooltip title=\"Retry upload\">\n <div className={styles.retryButton}>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiaryBg\"\n onClick={stopAndRun(() => onRetry(item.id))}\n testId=\"attachment-retry\"\n >\n <UndoIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n </>\n )}\n\n {onRemove && !item.isUploading && (\n <Tooltip title=\"Remove\">\n <div\n className={classNames(styles.removeButton, !!item.error && styles.removeButtonVisible)}\n >\n <ButtonIcon\n size=\"xs\"\n type=\"tertiaryBg\"\n onClick={stopAndRun(() => onRemove(item.id))}\n testId=\"attachment-remove\"\n >\n <CloseSmallIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n </>\n);\n\nexport const AttachmentTile = ({ item, onRemove, onRetry, onItemClick }: AttachmentTileProps) => {\n const kind = item.kind ?? 'file';\n const overlays = <TileOverlays item={item} onRemove={onRemove} onRetry={onRetry} />;\n const fileName = utils.getFileNameWithExtensionFromPath(item.name);\n\n if (kind === 'image' || kind === 'video') {\n const clickable = !!onItemClick && !item.isUploading && !item.error;\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <div\n className={classNames(\n styles.thumbnail,\n clickable && styles.clickable,\n !!item.error && styles.thumbnailError\n )}\n onClick={clickable ? () => onItemClick?.(item) : undefined}\n >\n <div className={styles.thumbnailInner}>\n {kind === 'image' ? (\n <img src={item.src} alt={fileName} className={styles.thumbnailImage} />\n ) : (\n <video\n src={withFirstFrame(item.src)}\n className={styles.thumbnailImage}\n preload=\"metadata\"\n playsInline\n muted\n />\n )}\n </div>\n {kind === 'video' && (\n <div className={styles.videoOverlay}>\n <PlayOneIcon theme=\"filled\" className={styles.playIcon} />\n </div>\n )}\n {overlays}\n </div>\n );\n }\n\n // Download and remove share the tile's top-right corner, so an editable tile keeps only Remove.\n const isDownloadable = !!item.downloadUrl && !onRemove && !item.isUploading && !item.error;\n\n const fileCardContent = (\n <>\n <div className={styles.fileCardContent}>\n <FileIcon name={fileName} />\n <div className={styles.fileInfo}>\n <Tooltip title={fileName}>\n <div className={styles.fileName}>{dropExtension(fileName)}</div>\n </Tooltip>\n <div className={styles.fileType}>{getExtension(fileName)}</div>\n </div>\n </div>\n {isDownloadable && (\n <Tooltip title=\"Download\">\n <div className={styles.downloadButton}>\n <ButtonIcon size=\"xs\" type=\"tertiaryBg\" testId=\"attachment-download-button\">\n <DownloadIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n {overlays}\n </>\n );\n\n if (isDownloadable) {\n return (\n <a\n href={item.downloadUrl}\n download={fileName}\n className={classNames(styles.fileCard, styles.fileCardLink)}\n data-testid=\"attachment-download\"\n >\n {fileCardContent}\n </a>\n );\n }\n\n return (\n <div className={classNames(styles.fileCard, !!item.error && styles.thumbnailError)}>\n {fileCardContent}\n </div>\n );\n};\n"],"names":["getExtension","name","_parts$pop","parts","split","length","pop","toUpperCase","stopAndRun","action","event","stopPropagation","TileOverlays","_ref","item","onRemove","onRetry","_jsxs","_Fragment","children","isUploading","_jsx","className","styles","uploadingOverlay","uploadingSpinner","LoaderCircular","size","loader","error","errorOverlay","Tooltip","title","retryButton","ButtonIcon","type","onClick","id","testId","UndoIcon","classNames","removeButton","removeButtonVisible","CloseSmallIcon","AttachmentTile","_ref2","_item$kind","src","onItemClick","kind","overlays","fileName","utils","getFileNameWithExtensionFromPath","clickable","thumbnail","thumbnailError","undefined","thumbnailInner","alt","thumbnailImage","includes","concat","preload","playsInline","muted","videoOverlay","PlayOneIcon","theme","playIcon","isDownloadable","downloadUrl","fileCardContent","FileIcon","fileInfo","replace","fileType","downloadButton","DownloadIcon","href","download","fileCard","fileCardLink"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"AttachmentTile.js","sources":["../../../src/components/AttachmentPreview/AttachmentTile.tsx"],"sourcesContent":["import { KeyboardEvent, MouseEvent, RefObject, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport { FileIcon } from '../../componentsV2/FileIcon';\nimport { ButtonIcon } from '../../componentsV2/ButtonIcon';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { LoaderCircular } from '../../componentsV2/LoaderCircular';\nimport { PlayOneIcon, CloseSmallIcon, UndoIcon } from '../../icons';\n\nimport { AttachmentActionsMenu } from './AttachmentActionsMenu';\nimport { AttachmentImage } from './AttachmentImage';\nimport { AttachmentDownloadLink } from './AttachmentDownloadLink';\nimport { AttachmentPreviewItem, AttachmentPreviewProps } from './AttachmentPreview.types';\n\nimport styles from './AttachmentPreview.scss';\n\nimport utils from '~/utils/main';\n\nconst getExtension = (name: string) => {\n const parts = name.split('.');\n return parts.length > 1 ? (parts.pop() ?? '').toUpperCase() : '';\n};\n\nconst dropExtension = (name: string) => name.replace(/\\.[^/.]+$/, '');\n\n// A bare <video> paints nothing until a frame is decoded; the media fragment forces one.\nconst withFirstFrame = (src?: string) => (src && !src.includes('#t=') ? `${src}#t=0.1` : src);\n\nexport type AttachmentTileProps = {\n item: AttachmentPreviewItem;\n onRemove?: AttachmentPreviewProps['onRemove'];\n onRetry?: AttachmentPreviewProps['onRetry'];\n onItemClick?: AttachmentPreviewProps['onItemClick'];\n isSelected?: boolean;\n hideActions?: boolean;\n /** Adds \"Share file\" to the tile's hover menu. */\n onShare?: (item: AttachmentPreviewItem) => void;\n};\n\nconst TileActions = ({\n item,\n onShare,\n imageRef,\n}: Pick<AttachmentTileProps, 'item' | 'onShare'> & {\n imageRef?: RefObject<HTMLImageElement>;\n}) => {\n const fileName = utils.getFileNameWithExtensionFromPath(item.name);\n const downloadUrl = item.downloadUrl || item.src;\n\n return (\n <div className={styles.tileActions} data-testid=\"attachment-tile-actions\">\n {!!downloadUrl && (\n <AttachmentDownloadLink\n url={downloadUrl}\n fileName={fileName}\n size=\"xs\"\n className={styles.tileActionLink}\n />\n )}\n\n <AttachmentActionsMenu\n item={item}\n onShare={onShare}\n size=\"xs\"\n testIdPrefix=\"attachment-tile\"\n tooltip=\"More actions\"\n imageRef={imageRef}\n />\n </div>\n );\n};\n\nconst stopAndRun = (action: () => void) => (event: MouseEvent) => {\n event.stopPropagation();\n action();\n};\n\nconst TileOverlays = ({ item, onRemove, onRetry }: Omit<AttachmentTileProps, 'onItemClick'>) => (\n <>\n {item.isUploading && (\n <>\n <div className={styles.uploadingOverlay} />\n <div className={styles.uploadingSpinner}>\n <LoaderCircular size=\"xs\" className={styles.loader} />\n </div>\n </>\n )}\n\n {!!item.error && (\n <>\n <div className={styles.errorOverlay} />\n {onRetry && (\n <Tooltip title=\"Retry upload\">\n <div className={styles.retryButton}>\n <ButtonIcon\n size=\"xs\"\n type=\"tertiaryBg\"\n onClick={stopAndRun(() => onRetry(item.id))}\n testId=\"attachment-retry\"\n >\n <UndoIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n </>\n )}\n\n {onRemove && !item.isUploading && (\n <Tooltip title=\"Remove\">\n <div\n className={classNames(styles.removeButton, !!item.error && styles.removeButtonVisible)}\n >\n <ButtonIcon\n size=\"xs\"\n type=\"tertiaryBg\"\n onClick={stopAndRun(() => onRemove(item.id))}\n testId=\"attachment-remove\"\n >\n <CloseSmallIcon size=\"small\" />\n </ButtonIcon>\n </div>\n </Tooltip>\n )}\n </>\n);\n\nexport const AttachmentTile = ({\n item,\n onRemove,\n onRetry,\n onItemClick,\n isSelected,\n hideActions,\n onShare,\n}: AttachmentTileProps) => {\n const imageRef = useRef<HTMLImageElement>(null);\n const kind = item.kind ?? 'file';\n const overlays = <TileOverlays item={item} onRemove={onRemove} onRetry={onRetry} />;\n const fileName = utils.getFileNameWithExtensionFromPath(item.name);\n const isReady = !item.isUploading && !item.error;\n const clickable = !!onItemClick && isReady;\n // A tile being composed shows Remove in the same corner, and has nothing to link to.\n const showActions = !hideActions && !onRemove && isReady;\n\n if (kind === 'image' || kind === 'video') {\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <div\n className={classNames(\n styles.thumbnail,\n clickable && styles.clickable,\n isSelected && styles.selected,\n !!item.error && styles.thumbnailError\n )}\n onClick={clickable ? () => onItemClick?.(item) : undefined}\n >\n <div className={styles.thumbnailInner}>\n {kind === 'image' ? (\n <AttachmentImage\n ref={imageRef}\n src={item.src}\n alt={fileName}\n className={styles.thumbnailImage}\n />\n ) : (\n <video\n src={withFirstFrame(item.src)}\n className={styles.thumbnailImage}\n preload=\"metadata\"\n playsInline\n muted\n />\n )}\n </div>\n {kind === 'video' && (\n <div className={styles.videoOverlay}>\n <PlayOneIcon theme=\"filled\" className={styles.playIcon} />\n </div>\n )}\n {showActions && <TileActions item={item} onShare={onShare} imageRef={imageRef} />}\n {overlays}\n </div>\n );\n }\n\n const fileCardContent = (\n <>\n <div className={styles.fileCardContent}>\n <FileIcon name={fileName} />\n <div className={styles.fileInfo}>\n <Tooltip title={fileName}>\n <div className={styles.fileName}>{dropExtension(fileName)}</div>\n </Tooltip>\n <div className={styles.fileType}>{getExtension(fileName)}</div>\n </div>\n </div>\n {showActions && <TileActions item={item} onShare={onShare} />}\n {overlays}\n </>\n );\n\n const cardInteraction = clickable\n ? {\n role: 'button',\n tabIndex: 0,\n onClick: () => onItemClick?.(item),\n onKeyDown: (event: KeyboardEvent) => {\n // Keys bubbling from the nested download link must reach it, not open the preview.\n if (event.target !== event.currentTarget) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n\n // Space would otherwise scroll the surrounding feed.\n event.preventDefault();\n onItemClick?.(item);\n },\n }\n : {};\n\n return (\n <div\n className={classNames(\n styles.fileCard,\n clickable && styles.fileCardLink,\n isSelected && styles.selected,\n !!item.error && styles.thumbnailError\n )}\n {...cardInteraction}\n >\n {fileCardContent}\n </div>\n );\n};\n"],"names":["getExtension","name","_parts$pop","parts","split","length","pop","toUpperCase","TileActions","_ref","item","onShare","imageRef","fileName","utils","getFileNameWithExtensionFromPath","downloadUrl","src","_jsxs","className","styles","tileActions","children","_jsx","AttachmentDownloadLink","url","size","tileActionLink","AttachmentActionsMenu","testIdPrefix","tooltip","stopAndRun","action","event","stopPropagation","TileOverlays","_ref2","onRemove","onRetry","_Fragment","isUploading","uploadingOverlay","uploadingSpinner","LoaderCircular","loader","error","errorOverlay","Tooltip","title","retryButton","ButtonIcon","type","onClick","id","testId","UndoIcon","classNames","removeButton","removeButtonVisible","CloseSmallIcon","AttachmentTile","_ref3","_item$kind","onItemClick","isSelected","hideActions","useRef","kind","overlays","isReady","clickable","showActions","thumbnail","selected","thumbnailError","undefined","thumbnailInner","AttachmentImage","ref","alt","thumbnailImage","includes","concat","preload","playsInline","muted","videoOverlay","PlayOneIcon","theme","playIcon","fileCardContent","FileIcon","fileInfo","replace","fileType","cardInteraction","role","tabIndex","onKeyDown","target","currentTarget","key","preventDefault","_objectSpread","fileCard","fileCardLink"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentActionsMenu.test.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentPreview/__tests__/AttachmentActionsMenu.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentDownloadLink.test.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentPreview/__tests__/AttachmentDownloadLink.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentImage.test.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentPreview/__tests__/AttachmentImage.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentTile.test.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentPreview/__tests__/AttachmentTile.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStoredAttachments.test.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentPreview/__tests__/useStoredAttachments.test.tsx"],"names":[],"mappings":""}
|