@corva/ui 3.74.0-1 → 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/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/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/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/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/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/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/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/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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/regenerator";import{fetchAttachment as t}from"../../utils/fetchAttachment.js";var n=function(){var n=e(r.mark((function e(n,o){var a,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return",!1);case 2:return e.prev=2,e.next=5,t(n);case 5:if((a=e.sent).ok){e.next=8;break}throw new Error("Could not read the file (".concat(a.status,")"));case 8:return e.t0=URL,e.next=11,a.blob();case 11:return e.t1=e.sent,c=e.t0.createObjectURL.call(e.t0,e.t1),(u=document.createElement("a")).href=c,u.download=o,document.body.appendChild(u),u.click(),u.remove(),URL.revokeObjectURL(c),e.abrupt("return",!0);case 23:return e.prev=23,e.t2=e.catch(2),console.error('Failed to download "'.concat(n,'"'),e.t2),e.abrupt("return",!1);case 27:case"end":return e.stop()}}),e,null,[[2,23]])})));return function(e,r){return n.apply(this,arguments)}}(),o=["http:","https:","blob:"],a=function(e){if(e)try{var r=new URL(e,window.location.href).protocol;if(!o.includes(r))throw new Error("Refusing to open a ".concat(r," url"));window.open(e,"_blank","noopener")}catch(r){console.error('Failed to open "'.concat(e,'"'),r)}},c=function(){var t=e(r.mark((function e(t,o){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(t,o);case 2:if(e.sent){e.next=4;break}a(t);case 4:case"end":return e.stop()}}),e)})));return function(e,r){return t.apply(this,arguments)}}();export{n as downloadAttachment,a as openAttachmentInNewTab,c as saveAttachment};
|
|
2
|
+
//# sourceMappingURL=downloadAttachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadAttachment.js","sources":["../../../src/components/AttachmentLightbox/downloadAttachment.ts"],"sourcesContent":["import { fetchAttachment } from '~/utils/fetchAttachment';\n\n/**\n * `download` is ignored cross-origin, where a plain link navigates the app away instead. Fetching\n * the bytes and handing the browser a blob url saves under the right name wherever the file lives.\n */\nexport const downloadAttachment = async (url: string, fileName: string): Promise<boolean> => {\n if (!url) return false;\n\n try {\n const response = await fetchAttachment(url);\n\n if (!response.ok) throw new Error(`Could not read the file (${response.status})`);\n\n const blobUrl = URL.createObjectURL(await response.blob());\n const link = document.createElement('a');\n\n link.href = blobUrl;\n link.download = fileName;\n document.body.appendChild(link);\n link.click();\n link.remove();\n URL.revokeObjectURL(blobUrl);\n\n return true;\n } catch (error) {\n console.error(`Failed to download \"${url}\"`, error);\n\n return false;\n }\n};\n\nconst SAFE_SCHEMES = ['http:', 'https:', 'blob:'];\n\n/** Stored data, not a literal: an unchecked `javascript:` url would run on open. */\nexport const openAttachmentInNewTab = (url: string): void => {\n // An empty one resolves to the page itself, passes the check below, and opens a blank tab.\n if (!url) return;\n\n try {\n const { protocol } = new URL(url, window.location.href);\n\n if (!SAFE_SCHEMES.includes(protocol)) throw new Error(`Refusing to open a ${protocol} url`);\n\n window.open(url, '_blank', 'noopener');\n } catch (error) {\n console.error(`Failed to open \"${url}\"`, error);\n }\n};\n\n/** Saves the file, falling back to a tab when the bytes cannot be read. */\nexport const saveAttachment = async (url: string, fileName: string): Promise<void> => {\n if (!(await downloadAttachment(url, fileName))) openAttachmentInNewTab(url);\n};\n"],"names":["downloadAttachment","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","fileName","response","blobUrl","link","wrap","_context","prev","next","abrupt","fetchAttachment","sent","ok","Error","concat","status","t0","URL","blob","t1","createObjectURL","call","document","createElement","href","download","body","appendChild","click","remove","revokeObjectURL","t2","console","error","stop","_x","_x2","apply","this","arguments","SAFE_SCHEMES","openAttachmentInNewTab","protocol","window","location","includes","open","saveAttachment","_ref2","_callee2","_context2","_x3","_x4"],"mappings":"sKAMaA,EAAkB,WAAA,IAAGC,EAAAC,EAAAC,EAAAC,MAAA,SAAAC,EAAOC,EAAaC,GAAgB,IAAAC,EAAAC,EAAAC,EAAA,OAAAP,EAAAQ,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,GAC/DR,EAAG,CAAAM,EAAAE,KAAA,EAAA,KAAA,CAAA,OAAAF,EAAAG,OAAA,UAAS,GAAK,KAAA,EAAA,OAAAH,EAAAC,KAAA,EAAAD,EAAAE,KAAA,EAGGE,EAAgBV,GAAI,KAAA,EAA7B,IAARE,EAAQI,EAAAK,MAEAC,GAAE,CAAAN,EAAAE,KAAA,EAAA,KAAA,CAAA,MAAQ,IAAIK,MAAK,4BAAAC,OAA6BZ,EAASa,OAAU,MAAA,KAAA,EAE9D,OAF8DT,EAAAU,GAEjEC,IAAGX,EAAAE,KAAA,GAAuBN,EAASgB,OAAM,KAAA,GAQ5B,OAR4BZ,EAAAa,GAAAb,EAAAK,KAAnDR,OAAciB,gBAAeC,KAAAf,EAAAU,GAAAV,EAAAa,KAC7Bf,EAAOkB,SAASC,cAAc,MAE/BC,KAAOrB,EACZC,EAAKqB,SAAWxB,EAChBqB,SAASI,KAAKC,YAAYvB,GAC1BA,EAAKwB,QACLxB,EAAKyB,SACLZ,IAAIa,gBAAgB3B,GAASG,EAAAG,OAAA,UAEtB,GAAI,KAAA,GAEyC,OAFzCH,EAAAC,KAAA,GAAAD,EAAAyB,GAAAzB,EAAA,MAAA,GAEX0B,QAAQC,MAA6BjC,uBAAAA,OAAAA,EAAc,KAAAM,EAAAyB,IAACzB,EAAAG,OAAA,UAE7C,GAAK,KAAA,GAAA,IAAA,MAAA,OAAAH,EAAA4B,OAAA,GAAAnC,EAAA,KAAA,CAAA,CAAA,EAAA,KAEf,KAAA,OAAA,SAxB8BoC,EAAAC,GAAA,OAAAzC,EAAA0C,MAAAC,KAAAC,UAAA,CAAA,CAAA,GA0BzBC,EAAe,CAAC,QAAS,SAAU,SAG5BC,EAAyB,SAACzC,GAErC,GAAKA,EAEL,IACE,IAAQ0C,EAAa,IAAIzB,IAAIjB,EAAK2C,OAAOC,SAASpB,MAA1CkB,SAER,IAAKF,EAAaK,SAASH,GAAW,MAAM,IAAI7B,MAAK,sBAAAC,OAAuB4B,EAAe,SAE3FC,OAAOG,KAAK9C,EAAK,SAAU,WAG7B,CAFE,MAAOiC,GACPD,QAAQC,MAAK,mBAAAnB,OAAoBd,EAAG,KAAKiC,EAC3C,CACF,EAGac,EAAc,WAAA,IAAGC,EAAApD,EAAAC,EAAAC,MAAA,SAAAmD,EAAOjD,EAAaC,GAAgB,OAAAJ,EAAAQ,MAAA,SAAA6C,GAAA,OAAA,OAAAA,EAAA3C,KAAA2C,EAAA1C,MAAA,KAAA,EAAA,OAAA0C,EAAA1C,KAAA,EACpDd,EAAmBM,EAAKC,GAAS,KAAA,EAAA,GAAAiD,EAAAvC,KAAA,CAAAuC,EAAA1C,KAAA,EAAA,KAAA,CAAGiC,EAAuBzC,GAAK,KAAA,EAAA,IAAA,MAAA,OAAAkD,EAAAhB,OAAA,GAAAe,EAC7E,KAAA,OAAA,SAF0BE,EAAAC,GAAA,OAAAJ,EAAAX,MAAAC,KAAAC,UAAA,CAAA,CAAA"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { AttachmentPreviewItem } from '../AttachmentPreview/AttachmentPreview.types';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export type UseAttachmentLightboxOptions = {
|
|
3
|
+
/** Adds "Share file" to the overflow menu. */
|
|
4
|
+
onShare?: (item: AttachmentPreviewItem) => void;
|
|
5
|
+
};
|
|
6
|
+
/** Wires attachments to the preview modal; a kind with no renderer shows a download card. */
|
|
7
|
+
export declare const useAttachmentLightbox: (items: AttachmentPreviewItem[], { onShare }?: UseAttachmentLightboxOptions) => {
|
|
4
8
|
openAttachment: (item: AttachmentPreviewItem) => void;
|
|
5
9
|
lightbox: import("react/jsx-runtime").JSX.Element;
|
|
6
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentLightbox.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentLightbox/useAttachmentLightbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAI1F,
|
|
1
|
+
{"version":3,"file":"useAttachmentLightbox.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentLightbox/useAttachmentLightbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAI1F,MAAM,MAAM,4BAA4B,GAAG;IACzC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,qBAAqB,UACzB,qBAAqB,EAAE,gBACjB,4BAA4B;2BAIX,qBAAqB;;CAgBpD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/slicedToArray";import{useState as t}from"react";import{AttachmentLightbox as
|
|
1
|
+
import r from"@babel/runtime/helpers/slicedToArray";import{useState as t}from"react";import{AttachmentLightbox as o}from"./AttachmentLightbox.js";import{jsx as e}from"react/jsx-runtime";var n=function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.onShare,m=t(null),l=r(m,2),c=l[0],h=l[1],u=function(r){r.isUploading||r.error||h(r.id)};return{openAttachment:u,lightbox:e(o,{items:n,activeId:c,onActiveIdChange:h,onClose:function(){return h(null)},onShare:a})}};export{n as useAttachmentLightbox};
|
|
2
2
|
//# sourceMappingURL=useAttachmentLightbox.js.map
|
|
@@ -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":"iIAEO,IAAMA,EAAW,EACXC,EAAW,EACXC,EAAY,GAKnBC,EAAY,SAACC,GAAY,OAAKC,KAAKC,IAAID,KAAKE,IAAIH,EAP9B,GACA,EAMwD,EAWnEI,EAAa,SAQpBC,GAAA,IAPJC,IAAAA,QACAC,IAAAA,OACAC,IAAAA,SAMMC,EAAcC,EAAuB,MACnBC,EAAAA,EA5BF,GA4BoBC,EAAAC,EAAAC,EAAA,GAAnCd,EAAIY,EAAA,GAAEG,EAAOH,EAAA,GACcD,EAAAA,GAAS,GAAMK,EAAAH,EAAAI,EAAA,GAA1CC,EAASF,EAAA,GAAEG,EAAYH,EAAA,GAExBI,EAAUV,EAAOV,GACjBqB,EAAYX,EAAsB,MAClCY,EAAUZ,EAAoB,MAEpCa,GAAU,WACRH,EAAQI,QAAUxB,CACpB,GAAG,CAACA,IAEJuB,GAAU,WACRR,EAxCoB,GAyCpBM,EAAUG,QAAU,IACtB,GAAG,CAAChB,IAGJe,GAAU,WACR,IAAME,EAAWhB,EAAYe,QAE7B,GAAKC,EAAL,CAEA,IAAMC,EAASL,EAAUG,QACzBH,EAAUG,QAAU,KAEhBE,GACFD,EAASE,WAAaD,EAAOE,OAASH,EAASI,YAAcH,EAAOI,QACpEL,EAASM,UAAYL,EAAOM,OAASP,EAASQ,aAAeP,EAAOQ,UAEpET,EAASE,YAAcF,EAASI,YAAcJ,EAASU,aAAe,EACtEV,EAASM,WAAaN,EAASQ,aAAeR,EAASW,cAAgB,EAV1D,CAYjB,GAAG,CAACpC,EAAMQ,IAEV,IAAM6B,EAASC,GAAY,SAACC,EAAeb,GACzC,IAAMc,EAAOzC,EAAUqB,EAAQI,QAAUe,GAErCC,IAASpB,EAAQI,UACjBE,IAAQL,EAAUG,QAAUE,GAEhCX,EAAQyB,GACT,GAAE,IAEGC,EAASH,GAAY,WAAA,OAAMD,EArEV,MAqE6B,CAACA,IAC/CK,EAAUJ,GAAY,WAAA,OAAMD,GAtEX,MAsE+B,CAACA,IAGvDd,GAAU,WACR,IAAME,EAAWhB,EAAYe,QAE7B,GAAKC,GAAanB,EAAlB,CAEA,IAAMqC,EAAc,SAACC,GACnB,IAAML,EA5Ec,MA4ELK,EAAMC,OAGrB,GAAI9C,EAAUqB,EAAQI,QAAUe,KAAWnB,EAAQI,QAAnD,CAEAoB,EAAME,iBAEN,IAAMC,EAAOtB,EAASuB,wBAChBlB,EAAUc,EAAMK,QAAUF,EAAKG,KAC/BhB,EAAUU,EAAMO,QAAUJ,EAAKK,IAErCf,EAAOE,EAAO,CACZX,OAAQH,EAASI,aAAeJ,EAASE,WAAaG,GAAWL,EAASI,YAAc,GACxFG,OAAQP,EAASQ,cACZR,EAASM,UAAYG,GAAWT,EAASQ,aAC1C,GACJH,QAAAA,EACAI,QAAAA,GAd0D,GAoB9D,OAFAT,EAAS4B,iBAAiB,QAASV,EAAa,CAAEW,SAAS,IAEpD,WAAA,OAAM7B,EAAS8B,oBAAoB,QAASZ,EAAY,CA1BpB,CA2B7C,GAAG,CAACrC,EAAS+B,IAEb,IAAMmB,EAAajD,GAAUP,EA3GP,EA6GhByD,EAAgBnB,GACpB,SAACM,GAA6C,IAAAc,EACtCjC,EAAWhB,EAAYe,SAGxBgC,GAAcZ,EAAMe,OAAS,IAAMlC,IAExCH,EAAQE,QAAU,CAChBoC,SAAUhB,EAAMK,QAChBY,SAAUjB,EAAMO,QAChBxB,WAAYF,EAASE,WACrBI,UAAWN,EAASM,WAEtB,QAAAN,EAAAA,EAASqC,yBAAT,IAAAJ,GAAAA,EAAAK,KAAAtC,EAA6BmB,EAAMoB,WACnC7C,GAAa,GACf,GACA,CAACqC,IAGGS,EAAgB3B,GAAY,SAACM,GACjC,IAAMsB,EAAO5C,EAAQE,QACfC,EAAWhB,EAAYe,QAExB0C,GAASzC,IAEdA,EAASE,WAAauC,EAAKvC,YAAciB,EAAMK,QAAUiB,EAAKN,UAC9DnC,EAASM,UAAYmC,EAAKnC,WAAaa,EAAMO,QAAUe,EAAKL,UAC7D,GAAE,IAEGM,EAAc7B,GAAY,SAACM,GAA6C,IAAAwB,EAAAC,EACvE/C,EAAQE,UAEbF,EAAQE,QAAU,KAClB,QAAAf,EAAAA,EAAYe,eAAZ,IAAA4C,GAA0C,QAA1CC,EAAAD,EAAqBE,6BAAqB,IAAAD,GAA1CA,EAA6CzB,KAAAA,EAAAA,EAAMoB,WACnD7C,GAAa,GACd,GAAE,IAEH,MAAO,CACLV,YAAAA,EACAT,KAAAA,EACAyC,OAAAA,EACAC,QAAAA,EACA6B,UAAWvE,EAtJS,EAuJpBwE,WAAYxE,EAxJQ,EAyJpBwD,WAAAA,EACAtC,UAAAA,EACAuD,YAAa,CAAEhB,cAAAA,EAAeQ,cAAAA,EAAeE,YAAAA,EAAaO,gBAAiBP,GAE/E"}
|
|
@@ -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
|