@corva/ui 3.70.0 → 3.70.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/AddComment/Popover.js +1 -1
- package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js +1 -1
- package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
- package/cjs-bundle/components/AttachFileButton/AttachFileButton.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentRow.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/AttachmentTile.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/SortableAttachments.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/SortableAttachments.js.map +1 -0
- package/cjs-bundle/components/AttachmentPreview/StoredAttachmentPreview.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +2 -0
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -0
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
- package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCardReplies.js +1 -1
- package/cjs-bundle/components/CommentCard/buildCommentReply.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentComposer.js +1 -1
- package/cjs-bundle/components/CommentComposer/CommentReplyInput.js +1 -1
- package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.js +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.scss.js +1 -1
- package/cjs-bundle/components/CommentInputNext/useFileDrop.js +2 -0
- package/cjs-bundle/components/CommentInputNext/useFileDrop.js.map +1 -0
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
- package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/cjs-bundle/components/FeedCard/useActivityInteractions.js +1 -1
- package/cjs-bundle/components/FeedCard/useFeedActivity.js +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/OffsetWellPickerContent/OffsetWellPickerContent.js +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/index.js +1 -1
- package/cjs-bundle/componentsV2/Popover/Popover.js +1 -1
- package/cjs-bundle/constants/attachments.js +2 -0
- package/cjs-bundle/constants/attachments.js.map +1 -0
- package/cjs-bundle/constants/index.js +1 -1
- package/components/AddComment/Popover.js +1 -1
- package/components/AddComment/Popover.js.map +1 -1
- package/components/AddComment/components/Content.js +1 -1
- package/components/AddComment/components/Content.js.map +1 -1
- package/components/AttachFileButton/AttachFileButton.d.ts +2 -1
- package/components/AttachFileButton/AttachFileButton.d.ts.map +1 -1
- package/components/AttachFileButton/AttachFileButton.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.d.ts +4 -0
- package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts +2 -0
- package/components/AttachmentPreview/AttachmentPreview.types.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentRow.d.ts +5 -0
- package/components/AttachmentPreview/AttachmentRow.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentRow.js +2 -0
- package/components/AttachmentPreview/AttachmentRow.js.map +1 -0
- package/components/AttachmentPreview/AttachmentTile.d.ts +9 -0
- package/components/AttachmentPreview/AttachmentTile.d.ts.map +1 -0
- package/components/AttachmentPreview/AttachmentTile.js +2 -0
- package/components/AttachmentPreview/AttachmentTile.js.map +1 -0
- package/components/AttachmentPreview/SortableAttachments.d.ts +8 -0
- package/components/AttachmentPreview/SortableAttachments.d.ts.map +1 -0
- package/components/AttachmentPreview/SortableAttachments.js +2 -0
- package/components/AttachmentPreview/SortableAttachments.js.map +1 -0
- package/components/AttachmentPreview/StoredAttachmentPreview.d.ts +3 -3
- package/components/AttachmentPreview/StoredAttachmentPreview.d.ts.map +1 -1
- package/components/AttachmentPreview/StoredAttachmentPreview.js +1 -1
- package/components/AttachmentPreview/index.d.ts +3 -0
- package/components/AttachmentPreview/index.d.ts.map +1 -1
- package/components/AttachmentPreview/useStoredAttachments.d.ts +8 -0
- package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -0
- package/components/AttachmentPreview/useStoredAttachments.js +2 -0
- package/components/AttachmentPreview/useStoredAttachments.js.map +1 -0
- package/components/BICOffsetPickerDialog/index.js +1 -1
- package/components/BICOffsetPickerDialog/index.js.map +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
- package/components/Casing/CasingTableV2/components/Component.js +1 -1
- package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
- package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
- package/components/CommentCard/CommentCard.d.ts.map +1 -1
- package/components/CommentCard/CommentCard.js +1 -1
- package/components/CommentCard/CommentCard.types.d.ts +5 -1
- package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
- package/components/CommentCard/CommentCardReplies.js +1 -1
- package/components/CommentCard/__tests__/buildCommentReply.test.d.ts +2 -0
- package/components/CommentCard/__tests__/buildCommentReply.test.d.ts.map +1 -0
- package/components/CommentCard/buildCommentReply.d.ts +15 -7
- package/components/CommentCard/buildCommentReply.d.ts.map +1 -1
- package/components/CommentCard/buildCommentReply.js +1 -1
- package/components/CommentComposer/CommentComposer.d.ts +8 -3
- package/components/CommentComposer/CommentComposer.d.ts.map +1 -1
- package/components/CommentComposer/CommentComposer.js +1 -1
- package/components/CommentComposer/CommentReplyInput.d.ts +6 -2
- package/components/CommentComposer/CommentReplyInput.d.ts.map +1 -1
- package/components/CommentComposer/CommentReplyInput.js +1 -1
- package/components/CommentComposer/useAttachmentUpload.d.ts +15 -6
- package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
- package/components/CommentComposer/useAttachmentUpload.js +1 -1
- package/components/CommentInputNext/CommentInputNext.d.ts +6 -0
- package/components/CommentInputNext/CommentInputNext.d.ts.map +1 -1
- package/components/CommentInputNext/CommentInputNext.js +1 -1
- package/components/CommentInputNext/CommentInputNext.scss.js +1 -1
- package/components/CommentInputNext/useFileDrop.d.ts +17 -0
- package/components/CommentInputNext/useFileDrop.d.ts.map +1 -0
- package/components/CommentInputNext/useFileDrop.js +2 -0
- package/components/CommentInputNext/useFileDrop.js.map +1 -0
- package/components/DocumentViewer/DocumentViewer.js +1 -1
- package/components/DocumentViewer/DocumentViewer.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
- package/components/FeedCard/useActivityInteractions.d.ts +9 -2
- package/components/FeedCard/useActivityInteractions.d.ts.map +1 -1
- package/components/FeedCard/useActivityInteractions.js +1 -1
- package/components/FeedCard/useFeedActivity.d.ts.map +1 -1
- package/components/FeedCard/useFeedActivity.js +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/OffsetWellPickerContent/OffsetWellPickerContent.js +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/index.d.ts +2 -0
- package/components/index.d.ts.map +1 -1
- package/components/index.js +1 -1
- package/componentsV2/Popover/Popover.d.ts.map +1 -1
- package/componentsV2/Popover/Popover.js +1 -1
- package/constants/attachments.d.ts +2 -0
- package/constants/attachments.d.ts.map +1 -0
- package/constants/attachments.js +2 -0
- package/constants/attachments.js.map +1 -0
- package/constants/index.d.ts +2 -1
- package/constants/index.d.ts.map +1 -1
- package/constants/index.js +1 -1
- package/mcp-server/server.mjs +68 -4
- package/package.json +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js +0 -2
- package/cjs-bundle/components/AttachmentPreview/useStoredAttachment.js.map +0 -1
- package/components/AttachmentPreview/useStoredAttachment.js +0 -2
- package/components/AttachmentPreview/useStoredAttachment.js.map +0 -1
|
@@ -5,6 +5,12 @@ type ReplyUser = {
|
|
|
5
5
|
last_name?: string;
|
|
6
6
|
profile_photo?: string;
|
|
7
7
|
};
|
|
8
|
+
type ReplyAttachment = {
|
|
9
|
+
url?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
file_name?: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
};
|
|
8
14
|
export type ActivityReply = {
|
|
9
15
|
id: string | number;
|
|
10
16
|
body?: string;
|
|
@@ -12,17 +18,19 @@ export type ActivityReply = {
|
|
|
12
18
|
created_at?: string | number;
|
|
13
19
|
allowed_actions?: string[];
|
|
14
20
|
mentioned_users?: unknown[];
|
|
15
|
-
attachment?:
|
|
16
|
-
|
|
17
|
-
name?: string;
|
|
18
|
-
file_name?: string;
|
|
19
|
-
size?: number;
|
|
20
|
-
} | null;
|
|
21
|
+
attachment?: ReplyAttachment | null;
|
|
22
|
+
attachments?: ReplyAttachment[] | null;
|
|
21
23
|
};
|
|
24
|
+
export declare const getReplyAttachments: (reply: ActivityReply) => {
|
|
25
|
+
url: string;
|
|
26
|
+
name: string;
|
|
27
|
+
size?: number;
|
|
28
|
+
}[];
|
|
22
29
|
export type BuildCommentReplyOptions = {
|
|
23
30
|
currentUserId?: string | number;
|
|
24
31
|
onDelete: (id: string | number) => void;
|
|
32
|
+
onEdit: (id: string | number) => void;
|
|
25
33
|
};
|
|
26
|
-
export declare const buildCommentReply: (reply: ActivityReply, { currentUserId, onDelete }: BuildCommentReplyOptions) => CommentReply;
|
|
34
|
+
export declare const buildCommentReply: (reply: ActivityReply, { currentUserId, onDelete, onEdit }: BuildCommentReplyOptions) => CommentReply;
|
|
27
35
|
export {};
|
|
28
36
|
//# sourceMappingURL=buildCommentReply.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCommentReply.d.ts","sourceRoot":"","sources":["../../../src/components/CommentCard/buildCommentReply.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,KAAK,SAAS,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE
|
|
1
|
+
{"version":3,"file":"buildCommentReply.d.ts","sourceRoot":"","sources":["../../../src/components/CommentCard/buildCommentReply.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,KAAK,SAAS,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,eAAe,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;CACxC,CAAC;AAGF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,aAAa,KACnB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAOvC,CAAC;AAMT,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,aAAa,EACpB,qCAAqC,wBAAwB,KAC5D,YA4CF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as o,Fragment as s,jsx as c}from"react/jsx-runtime";import i from"moment-timezone";import{DeleteFourIcon as
|
|
1
|
+
import{jsxs as o,Fragment as s,jsx as c}from"react/jsx-runtime";import i from"moment-timezone";import{WriteIcon as n,DeleteFourIcon as t}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{StoredAttachmentPreview as m}from"../AttachmentPreview/StoredAttachmentPreview.js";import{formatMentionText as r}from"../UserMention/utils/index.js";import{isNativeDetected as e}from"../../utils/mobileDetect.js";var u=function(o){var s;return(null!==(s=o.attachments)&&void 0!==s&&s.length?o.attachments:[o.attachment]).reduce((function(o,s){var c,i=null!==(c=null==s?void 0:s.file_name)&&void 0!==c?c:null==s?void 0:s.name;return null!=s&&s.url&&i&&o.push({url:s.url,name:i,size:s.size}),o}),[])},p=function(p,l){var a,d,j,I,v,h,C,b,F,f,O,A=l.currentUserId,D=l.onDelete,M=l.onEdit,P=Number(null===(a=p.user)||void 0===a?void 0:a.id)===Number(A)||(null!==(d=p.allowed_actions)&&void 0!==d?d:[]).includes("update"),g=Number(null===(j=p.user)||void 0===j?void 0:j.id)===Number(A)||(null!==(I=p.allowed_actions)&&void 0!==I?I:[]).includes("destroy"),k=u(p);return{id:p.id,author:{id:null===(v=p.user)||void 0===v?void 0:v.id,name:(F=p.user,"".concat(null!==(f=null==F?void 0:F.first_name)&&void 0!==f?f:""," ").concat(null!==(O=null==F?void 0:F.last_name)&&void 0!==O?O:"").trim()),avatarUrl:null===(h=p.user)||void 0===h?void 0:h.profile_photo},timestamp:i(p.created_at).format("MM/DD/YY H:mm"),body:o(s,{children:[r(null!==(C=p.body)&&void 0!==C?C:"",null!==(b=p.mentioned_users)&&void 0!==b?b:[],e,void 0,void 0),!!k.length&&c(m,{attachments:k})]}),menuItems:[{label:"Edit",icon:c(n,{size:16}),disabled:!P,onClick:function(){return M(p.id)}},{label:"Delete",icon:c(t,{size:16}),disabled:!g,onClick:function(){return D(p.id)}}]}};export{p as buildCommentReply,u as getReplyAttachments};
|
|
2
2
|
//# sourceMappingURL=buildCommentReply.js.map
|
|
@@ -16,8 +16,13 @@ export type CommentComposerProps = {
|
|
|
16
16
|
onSubmit: () => void;
|
|
17
17
|
canSubmit: boolean;
|
|
18
18
|
currentUser: CommentComposerUser;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
attachments?: UploadedAttachment[];
|
|
20
|
+
onAttachmentsChange?: (attachments: UploadedAttachment[]) => void;
|
|
21
|
+
maxAttachments?: number;
|
|
22
|
+
/** @deprecated Use `attachments` — kept so single-attachment callers keep working. */
|
|
23
|
+
attachment?: UploadedAttachment | null;
|
|
24
|
+
/** @deprecated Use `onAttachmentsChange`. */
|
|
25
|
+
onAttachmentChange?: (attachment: UploadedAttachment | null) => void;
|
|
21
26
|
attachmentError?: string | null;
|
|
22
27
|
onAttachmentError?: (message: string | null) => void;
|
|
23
28
|
maxAttachmentSizeBytes?: number;
|
|
@@ -34,5 +39,5 @@ export type CommentComposerProps = {
|
|
|
34
39
|
className?: string;
|
|
35
40
|
testId?: string;
|
|
36
41
|
};
|
|
37
|
-
export declare const CommentComposer: ({ body, onBodyChange, onSubmit, canSubmit, currentUser, attachment, onAttachmentChange, attachmentError, onAttachmentError, maxAttachmentSizeBytes, disabled, autoFocus, placeholder, metaRows, isMetaSingleLine, shareToChat, trailing, embedded, className, testId, }: CommentComposerProps) => JSX.Element;
|
|
42
|
+
export declare const CommentComposer: ({ body, onBodyChange, onSubmit, canSubmit, currentUser, attachments, onAttachmentsChange, maxAttachments, attachment, onAttachmentChange, attachmentError, onAttachmentError, maxAttachmentSizeBytes, disabled, autoFocus, placeholder, metaRows, isMetaSingleLine, shareToChat, trailing, embedded, className, testId, }: CommentComposerProps) => JSX.Element;
|
|
38
43
|
//# sourceMappingURL=CommentComposer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentComposer.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CommentComposer.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAIV,MAAM,OAAO,CAAC;AAef,OAAO,EAEL,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,mBAAmB,CAAC;IAEjC,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sFAAsF;IACtF,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IAClD,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAyBF,eAAO,MAAM,eAAe,GAAI,2TAwB7B,oBAAoB,gBA4ItB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/defineProperty";import{jsx as s,jsxs as n,Fragment as t}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import o from"@babel/runtime/helpers/defineProperty";import{jsx as s,jsxs as n,Fragment as t}from"react/jsx-runtime";import{useMemo as i,useCallback as c,useRef as e}from"react";import{Input as r}from"@material-ui/core";import m from"@material-ui/icons/AlternateEmail";import{ButtonIcon as a}from"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as l}from"../../componentsV2/Tooltip/Tooltip.js";import{SmilingFaceIcon as p}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/DragOne.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/SearchOne.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../icons/customIcons/icons/InterventionUnit.js";import"../../icons/customIcons/icons/CloudDelete.js";import"../../icons/customIcons/icons/Lasso.js";import"../../icons/customIcons/icons/Radius.js";import"../../icons/customIcons/icons/ErrorOps.js";import"../../icons/customIcons/icons/DataTypeOps.js";import"../../icons/customIcons/icons/FalsePositiveOps.js";import"../../icons/customIcons/icons/CalibrationOps.js";import"../../icons/customIcons/icons/CriticalOps.js";import"../../icons/customIcons/icons/Company.js";import"../../icons/customIcons/icons/ArchiveOne.js";import"../../icons/customIcons/icons/ParseBotFusion.js";import"../../icons/customIcons/icons/Connect.js";import"../../icons/customIcons/icons/PuzzleOne.js";import"../../icons/customIcons/icons/Feed.js";import"../../icons/customIcons/icons/Prompt.js";import"../../icons/customIcons/icons/Companies.js";import"../../icons/customIcons/icons/ClipboardAi.js";import"../../icons/customIcons/icons/Key.js";import"../../icons/customIcons/icons/AtSignCrossed.js";import"../../icons/customIcons/icons/MappingManual.js";import"../../icons/customIcons/icons/Mapping.js";import"../../icons/customIcons/icons/Metrics.js";import"../../icons/customIcons/icons/Drops.js";import"../../icons/customIcons/icons/ClipboardSearch.js";import"../../icons/customIcons/icons/Template.js";import"../../icons/customIcons/icons/ClipboardMetrics.js";import"../../icons/customIcons/icons/ClipboardBuilder.js";import"../../icons/customIcons/icons/UnitConversion.js";import"../../icons/customIcons/icons/NPT.js";import"../../icons/customIcons/icons/GuidedFrac.js";import{AvatarComponent as u}from"../Avatar/index.js";import{AttachFileButton as d}from"../AttachFileButton/AttachFileButton.js";import{CommentInput as j}from"../CommentInputNext/CommentInputNext.js";import I from"../EmojiIconButton.js";import h from"../FailedFileUploading.js";import f from"../UserMention/index.js";import{isSuggestionsListOpened as b}from"../UserMention/utils/index.js";import{useAttachmentUpload as g,DEFAULT_MAX_ATTACHMENTS as v}from"./useAttachmentUpload.js";import{CommentMetaLine as C}from"./CommentMetaLine.js";import{ShareToChatRow as y}from"./ShareToChatRow.js";import O from"./CommentComposer.scss.js";function F(o,s){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);s&&(t=t.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),n.push.apply(n,t)}return n}function A(s){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?F(Object(t),!0).forEach((function(n){o(s,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):F(Object(t)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(t,o))}))}return s}var S={fontSize:14,lineHeight:"20px",suggestions:{backgroundColor:"var(--palette-background-b-9)",list:{backgroundColor:"var(--palette-background-b-9)"},item:{color:"var(--palette-primary-text-1)","&focused":{backgroundColor:"rgb(from var(--palette-primary-text-1) r g b / 0.08)"}}}},P=function(o){return n("div",{className:O.suggestion,children:[s(u,{size:26,alt:o.display,imgSrc:o.photo,displayName:o.display}),s("span",{children:o.display})]})},x=function(o){var u=o.body,F=o.onBodyChange,x=o.onSubmit,E=o.canSubmit,k=o.currentUser,D=o.attachments,w=o.onAttachmentsChange,R=o.maxAttachments,M=void 0===R?v:R,U=o.attachment,B=o.onAttachmentChange,z=o.attachmentError,N=o.onAttachmentError,T=o.maxAttachmentSizeBytes,L=o.disabled,G=o.autoFocus,q=o.placeholder,K=void 0===q?"Add a comment...":q,W=o.metaRows,H=o.isMetaSingleLine,V=o.shareToChat,Q=o.trailing,Z=o.embedded,$=o.className,J=o.testId,X=!!w,Y=i((function(){return X?null!=D?D:[]:[U].filter(Boolean)}),[X,D,U]),_=c((function(o){var s;w?w(o):null==B||B(null!==(s=o[0])&&void 0!==s?s:null)}),[w,B]),oo=g({value:Y,onChange:_,onError:N,maxSizeBytes:T,maxFiles:X?M:1}),so=E&&!oo.isUploading,no=e(null);return s(j,{value:u,canSubmit:so,disabled:L,onSubmit:x,trailing:Q,embedded:Z,className:$,testId:J,field:s(r,{inputComponent:f,inputProps:{onChange:F,currentUser:k,allowEmptyQuery:!0,suggestionsPortalHost:document.querySelector("body"),withLightTheme:!1,mentionProps:{renderSuggestion:P},style:S},value:u,placeholder:K,inputRef:no,className:O.mentionField,onKeyDown:function(o){"Enter"!==o.key||o.shiftKey||so&&!L&&(b()||(o.preventDefault(),x()))},disableUnderline:!0,rows:1,fullWidth:!0,multiline:!0,autoFocus:G}),attachments:oo.items,onAttachmentRemove:oo.removeAttachment,onAttachmentRetry:oo.handleRetry,onAttachmentReorder:X?oo.reorderAttachments:void 0,onFilesDrop:oo.addFiles,dropLabel:1===oo.maxFiles?"Drop a file here":"Drop files here",attachmentSlot:z?s(h,{errorMessage:z}):void 0,toolbar:n(t,{children:[s(d,{inputRef:oo.fileInputRef,onClick:oo.openFileDialog,onFileSelect:oo.handleFileSelect,multiple:X,disabled:oo.isFull,tooltip:oo.isFull?"Up to ".concat(oo.maxFiles," ").concat(1===oo.maxFiles?"file":"files"," can be attached"):"Attach file"}),s(l,{title:"Mention someone",children:s(a,{size:"xs",type:"tertiary",onClick:function(){var o,s=no.current;if(s){s.focus();var n=!!s.value&&!/\s$/.test(s.value),t="".concat(s.value).concat(n?" @":"@"),i=null===(o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),"value"))||void 0===o?void 0:o.set;null==i||i.call(s,t),s.setSelectionRange(t.length,t.length),s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("keyup",{bubbles:!0}))}},children:s(m,{fontSize:"inherit"})})}),s("span",{className:O.iconSlot,children:s(I,{icon:s(p,{size:16}),handleSelectEmoji:function(o){return F("".concat(u).concat(o.native))}})})]}),footer:(!(null==W||!W.length)||!!V)&&n(t,{children:[s(C,{rows:null!=W?W:[],singleLine:H}),V&&s(y,A({},V))]})})};export{x as CommentComposer};
|
|
2
2
|
//# sourceMappingURL=CommentComposer.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UploadedAttachment } from './useAttachmentUpload';
|
|
2
2
|
export type CommentReplyInputProps = {
|
|
3
3
|
/** Resolving to `false` keeps the draft, so a failed post can be retried. */
|
|
4
|
-
onSubmit: (body: string,
|
|
4
|
+
onSubmit: (body: string, attachments: UploadedAttachment[]) => void | boolean | Promise<void | boolean>;
|
|
5
5
|
author?: {
|
|
6
6
|
name?: string;
|
|
7
7
|
avatarUrl?: string;
|
|
@@ -9,7 +9,11 @@ export type CommentReplyInputProps = {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
autoFocus?: boolean;
|
|
12
|
+
maxAttachments?: number;
|
|
13
|
+
initialBody?: string;
|
|
14
|
+
initialAttachments?: UploadedAttachment[];
|
|
15
|
+
onCancel?: () => void;
|
|
12
16
|
testId?: string;
|
|
13
17
|
};
|
|
14
|
-
export declare const CommentReplyInput: ({ onSubmit, author, disabled, placeholder, autoFocus, testId, }: CommentReplyInputProps) => JSX.Element;
|
|
18
|
+
export declare const CommentReplyInput: ({ onSubmit, author, disabled, placeholder, autoFocus, maxAttachments, initialBody, initialAttachments, onCancel, testId, }: CommentReplyInputProps) => JSX.Element;
|
|
15
19
|
//# sourceMappingURL=CommentReplyInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentReplyInput.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentReplyInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CommentReplyInput.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentReplyInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,kBAAkB,EAAE,KAC9B,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,4HAW/B,sBAAsB,gBAsDxB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{jsx as
|
|
1
|
+
import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/regenerator";import{jsx as a}from"react/jsx-runtime";import{useState as n}from"react";import{Avatar as o}from"../../componentsV2/Avatar/Avatar.js";import{AttachFileButton as i}from"../AttachFileButton/AttachFileButton.js";import{CommentInput as l}from"../CommentInputNext/CommentInputNext.js";import m from"../FailedFileUploading.js";import{useAttachmentUpload as c}from"./useAttachmentUpload.js";var s=[],u=function(u){var p=u.onSubmit,d=u.author,h=u.disabled,f=u.placeholder,v=void 0===f?"Reply":f,b=u.autoFocus,A=void 0===b||b,F=u.maxAttachments,g=u.initialBody,x=void 0===g?"":g,y=u.initialAttachments,C=void 0===y?s:y,R=u.onCancel,S=u.testId,j=n(x),I=e(j,2),U=I[0],k=I[1],B=n(C),w=e(B,2),D=w[0],N=w[1],T=n(null),z=e(T,2),E=z[0],G=z[1],M=c({value:D,onChange:N,onError:G,maxFiles:F}),V=function(){var e=t(r.mark((function t(e){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p(e,D);case 2:if(t.t0=t.sent,!1!==t.t0){t.next=5;break}return t.abrupt("return");case 5:k(""),N([]),M.clearAttachments();case 8:case"end":return t.stop()}}),t)})));return function(t){return e.apply(this,arguments)}}();return a(l,{bare:!0,autoFocus:A,placeholder:v,value:U,onChange:k,canSubmit:!(!U.trim()&&!D.length||M.isUploading),onSubmit:V,onCancel:R,disabled:h,attachments:M.items,onAttachmentRemove:M.removeAttachment,onAttachmentRetry:M.handleRetry,onAttachmentReorder:M.reorderAttachments,onFilesDrop:M.addFiles,testId:S,attachmentSlot:E?a(m,{errorMessage:E}):void 0,toolbar:a(i,{inputRef:M.fileInputRef,onClick:M.openFileDialog,onFileSelect:M.handleFileSelect,multiple:!0,disabled:M.isFull,tooltip:M.isFull?"Up to ".concat(M.maxFiles," files can be attached"):"Attach file"}),leading:a(o,{size:32,name:null==d?void 0:d.name,imageSrc:null==d?void 0:d.avatarUrl})})};export{u as CommentReplyInput};
|
|
2
2
|
//# sourceMappingURL=CommentReplyInput.js.map
|
|
@@ -6,21 +6,30 @@ export type UploadedAttachment = {
|
|
|
6
6
|
size?: number;
|
|
7
7
|
};
|
|
8
8
|
type UseAttachmentUploadOptions = {
|
|
9
|
-
value: UploadedAttachment
|
|
10
|
-
onChange: (
|
|
9
|
+
value: UploadedAttachment[];
|
|
10
|
+
onChange: (attachments: UploadedAttachment[]) => void;
|
|
11
11
|
onError?: (message: string | null) => void;
|
|
12
12
|
maxSizeBytes?: number;
|
|
13
|
+
maxFiles?: number;
|
|
14
|
+
/** Mirrors the file input's `accept`; also gates drag-and-drop. */
|
|
15
|
+
accept?: string;
|
|
13
16
|
};
|
|
14
|
-
export declare const
|
|
17
|
+
export declare const DEFAULT_MAX_ATTACHMENTS = 10;
|
|
18
|
+
export declare const useAttachmentUpload: ({ value, onChange, onError, maxSizeBytes, maxFiles, accept, }: UseAttachmentUploadOptions) => {
|
|
15
19
|
items: AttachmentPreviewItem[];
|
|
16
20
|
fileInputRef: import("react").RefObject<HTMLInputElement>;
|
|
17
21
|
openFileDialog: () => void | undefined;
|
|
18
22
|
handleFileSelect: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
addFiles: (files: File[]) => void;
|
|
24
|
+
removeAttachment: (id: AttachmentPreviewItem["id"]) => void;
|
|
25
|
+
handleRetry: (id: AttachmentPreviewItem["id"]) => void;
|
|
26
|
+
reorderAttachments: (orderedIds: AttachmentPreviewItem["id"][]) => void;
|
|
27
|
+
clearAttachments: () => void;
|
|
21
28
|
isUploading: boolean;
|
|
22
29
|
error: string | null;
|
|
23
|
-
|
|
30
|
+
count: number;
|
|
31
|
+
isFull: boolean;
|
|
32
|
+
maxFiles: number;
|
|
24
33
|
};
|
|
25
34
|
export {};
|
|
26
35
|
//# sourceMappingURL=useAttachmentUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentUpload.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useAttachmentUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4C,MAAM,OAAO,CAAC;AAG9E,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"useAttachmentUpload.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useAttachmentUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4C,MAAM,OAAO,CAAC;AAG9E,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,8CAA8C,CAAC;AAMtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,WAAW,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAcF,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAkD1C,eAAO,MAAM,mBAAmB,GAAI,+DAOjC,0BAA0B;;;;8BA0KjB,WAAW,CAAC,gBAAgB,CAAC;sBApD7B,IAAI,EAAE;2BAgET,qBAAqB,CAAC,IAAI,CAAC;sBAW3B,qBAAqB,CAAC,IAAI,CAAC;qCAcnB,qBAAqB,CAAC,IAAI,CAAC,EAAE;;;;;;;CA8G7C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/asyncToGenerator";import
|
|
1
|
+
import r from"@babel/runtime/helpers/toConsumableArray";import e from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import i from"@babel/runtime/regenerator";import{useState as o,useRef as u,useCallback as l,useEffect as c}from"react";import a from"react-s3-uploader/s3upload";import{getAttachmentKind as f}from"../AttachmentPreview/getAttachmentKind.js";import{ACCEPTED_ATTACHMENT_TYPES as s}from"../AttachFileButton/AttachFileButton.js";import{getS3SignedUrl as d,getS3DownloadLink as p}from"../../clients/jsonApi/index.js";function v(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function m(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?v(Object(t),!0).forEach((function(e){n(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var h=10,g=function(r){return r.type.startsWith("image/")?"image":r.type.startsWith("video/")?"video":"file"},b=function(r){return(r/1048576).toFixed(1)},U=function(r){return{id:r.url,name:r.name,file:null,previewUrl:"",isUploading:!1,error:null,uploaded:r}},w=0,y=function(n){var v,h,y=n.value,O=n.onChange,j=n.onError,F=n.maxSizeBytes,x=n.maxFiles,k=void 0===x?10:x,P=n.accept,L=void 0===P?s:P,A=o([]),S=t(A,2),E=S[0],R=S[1],B=u(null),z=u(new Map),C=u(new Map),M=u([]),W=u(O),D=u(j);W.current=O,D.current=j;var T=u([]),_=l((function(r){var e=r(M.current);M.current=e,R(e),T.current=function(r){return r.map((function(r){return r.uploaded})).filter(Boolean)}(e),W.current(T.current)}),[]),G=l((function(r,e){return _((function(n){return n.map((function(n){return n.id===r?m(m({},n),e):n}))}))}),[_]),I=l((function(r){var e,n;null===(e=z.current.get(r))||void 0===e||e.abortUpload(),z.current.delete(r),C.current.set(r,(null!==(n=C.current.get(r))&&void 0!==n?n:0)+1)}),[]),K=l((function(r){null!=r&&r.previewUrl&&URL.revokeObjectURL(r.previewUrl)}),[]),Y=l((function(){var r,e,n;null===(r=D.current)||void 0===r||r.call(D,null!==(e=null===(n=M.current.find((function(r){return r.error})))||void 0===n?void 0:n.error)&&void 0!==e?e:null)}),[]);c((function(){return function(){z.current.forEach((function(r){return r.abortUpload()})),z.current.clear(),M.current.forEach((function(r){r.previewUrl&&URL.revokeObjectURL(r.previewUrl)}))}}),[]);var q=l((function(r,n){var t,o=(null!==(t=C.current.get(r))&&void 0!==t?t:0)+1;C.current.set(r,o);var u,l,c=function(){return C.current.get(r)===o},f=function(e){var n;c()&&(G(r,{isUploading:!1,error:e}),null===(n=D.current)||void 0===n||n.call(D,e))},s="",v=new a({files:[n],preprocess:function(r,e){return e(r)},onProgress:function(){},getSignedUrl:(l=e(i.mark((function r(e,n){var t;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,d(e.name,e.type);case 3:t=r.sent,s=t.file_name,n(m(m({},t),{},{signedUrl:t.signed_url})),r.next=11;break;case 8:r.prev=8,r.t0=r.catch(0),f((null===r.t0||void 0===r.t0?void 0:r.t0.message)||"Failed to upload the file");case 11:case"end":return r.stop()}}),r,null,[[0,8]])}))),function(r,e){return l.apply(this,arguments)}),onFinishS3Put:(u=e(i.mark((function e(){var t,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p(s);case 3:if(t=e.sent,o=t.url,c()){e.next=7;break}return e.abrupt("return");case 7:z.current.delete(r),G(r,{isUploading:!1,error:null,uploaded:{url:o,name:s,size:n.size}}),Y(),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),f((null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to upload the file");case 15:case"end":return e.stop()}}),e,null,[[0,12]])}))),function(){return u.apply(this,arguments)}),onError:function(r){return f(r||"Failed to upload the file")}});z.current.set(r,v)}),[G,Y]),H=l((function(e){var n,t,i,o,u=e.filter((function(r){return function(r,e){return e.split(",").map((function(r){return r.trim().toLowerCase()})).filter(Boolean).some((function(e){if(e.startsWith("."))return r.name.toLowerCase().endsWith(e);if(e.endsWith("/*")){var n=r.type.toLowerCase();return n?n.startsWith(e.slice(0,-1)):f({name:r.name})===e.slice(0,-1)}return r.type.toLowerCase()===e}))}(r,L)})),l=u.length<e.length?1===e.length?"That file type is not supported.":"Some files were skipped — unsupported file type.":null,c="You can attach up to ".concat(k," files."),a=k-M.current.length;if(!u.length||a<=0){var s;null===(s=D.current)||void 0===s||s.call(D,u.length?c:l)}else{var d=u.slice(0,a),p=d.map((function(r){var e=g(r),n=!!F&&r.size>F;return{id:"attachment-".concat(w+=1),name:r.name,file:r,previewUrl:"file"===e?"":URL.createObjectURL(r),isUploading:!n,error:n?"File is too large (".concat(b(r.size)," MB). Maximum size is ").concat(b(F)," MB."):null,uploaded:null}}));_((function(e){return[].concat(r(e),r(p))}));var v=u.length>d.length?c:null;null===(n=D.current)||void 0===n||n.call(D,null!==(t=null!==(i=null===(o=M.current.find((function(r){return r.error})))||void 0===o?void 0:o.error)&&void 0!==i?i:l)&&void 0!==t?t:v),p.filter((function(r){return!r.error})).forEach((function(r){return q(r.id,r.file)}))}}),[_,k,F,q,L]),J=l((function(r){var e,n=Array.from(null!==(e=r.target.files)&&void 0!==e?e:[]);B.current&&(B.current.value=""),n.length&&H(n)}),[H]),N=l((function(){var r;return null===(r=B.current)||void 0===r?void 0:r.click()}),[]),Q=l((function(r){var e=String(r);I(e),K(M.current.find((function(r){return r.id===e}))),_((function(r){return r.filter((function(r){return r.id!==e}))})),Y()}),[I,K,_,Y]),V=l((function(r){var e=String(r),n=M.current.find((function(r){return r.id===e}));null!=n&&n.file&&(I(e),G(e,{isUploading:!0,error:null}),Y(),q(e,n.file))}),[I,G,q,Y]),X=l((function(e){return _((function(n){var t=new Map(n.map((function(r){return[r.id,r]}))),i=e.map((function(r){return t.get(String(r))})).filter(Boolean),o=n.filter((function(r){return!e.some((function(e){return String(e)===r.id}))}));return[].concat(r(i),r(o))}))}),[_]),Z=l((function(){var r;M.current.forEach((function(r){I(r.id),K(r)})),_((function(){return[]})),null===(r=D.current)||void 0===r||r.call(D,null)}),[I,_,K]);c((function(){var r,e,n;(e=T.current,n=y,e.length===n.length&&e.every((function(r,e){return r.url===n[e].url})))||(M.current.forEach((function(r){I(r.id),r.previewUrl&&URL.revokeObjectURL(r.previewUrl)})),M.current=y.map(U),T.current=y,R(M.current),null===(r=D.current)||void 0===r||r.call(D,null))}),[y,I]);var $=o({}),rr=t($,2),er=rr[0],nr=rr[1],tr=u(er);tr.current=er;var ir=E.filter((function(r){return!r.file&&r.uploaded})).map((function(r){return r.uploaded.name})).join("|");return c((function(){var r=ir.split("|").filter((function(r){return r&&!(r in tr.current)}));if(r.length){var e=!0;return Promise.all(r.map((function(r){return p(r,"inline").then((function(e){var n=e.url;return[r,n]})).catch((function(e){return console.error('Failed to sign stored attachment "'.concat(r,'"'),e),[r,""]}))}))).then((function(r){e&&nr((function(e){return m(m({},e),Object.fromEntries(r))}))})),function(){e=!1}}}),[ir]),{items:E.reduce((function(r,e){var n;if(e.file)return r.push({id:e.id,name:e.name,src:e.previewUrl,kind:g(e.file),isUploading:e.isUploading,error:null!==(n=e.error)&&void 0!==n?n:void 0}),r;var t=e.uploaded,i=f(t),o=er[t.name];return"file"===i||o?(r.push({id:e.id,name:t.name,src:o,kind:i}),r):r}),[]),fileInputRef:B,openFileDialog:N,handleFileSelect:J,addFiles:H,removeAttachment:Q,handleRetry:V,reorderAttachments:X,clearAttachments:Z,isUploading:E.some((function(r){return r.isUploading})),error:null!==(v=null===(h=E.find((function(r){return r.error})))||void 0===h?void 0:h.error)&&void 0!==v?v:null,count:E.length,isFull:E.length>=k,maxFiles:k}};export{h as DEFAULT_MAX_ATTACHMENTS,y as useAttachmentUpload};
|
|
2
2
|
//# sourceMappingURL=useAttachmentUpload.js.map
|
|
@@ -5,6 +5,7 @@ export type CommentInputProps = {
|
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (value: string) => void;
|
|
7
7
|
onSubmit?: (value: string) => void;
|
|
8
|
+
onCancel?: () => void;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
autoFocus?: boolean;
|
|
10
11
|
minRows?: number;
|
|
@@ -21,6 +22,11 @@ export type CommentInputProps = {
|
|
|
21
22
|
attachments?: AttachmentPreviewItem[];
|
|
22
23
|
onAttachmentRemove?: (id: AttachmentPreviewItem['id']) => void;
|
|
23
24
|
onAttachmentRetry?: (id: AttachmentPreviewItem['id']) => void;
|
|
25
|
+
/** Enables drag-to-reorder on the attachment strip. */
|
|
26
|
+
onAttachmentReorder?: (orderedIds: AttachmentPreviewItem['id'][]) => void;
|
|
27
|
+
/** Enables dropping files from the desktop onto the composer. */
|
|
28
|
+
onFilesDrop?: (files: File[]) => void;
|
|
29
|
+
dropLabel?: string;
|
|
24
30
|
/** Extra content in the attachment area, e.g. an upload-error banner. */
|
|
25
31
|
attachmentSlot?: ReactNode;
|
|
26
32
|
toolbar?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentInputNext.d.ts","sourceRoot":"","sources":["../../../src/components/CommentInputNext/CommentInputNext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAMV,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"CommentInputNext.d.ts","sourceRoot":"","sources":["../../../src/components/CommentInputNext/CommentInputNext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAMV,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAMrF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,mEAAmE;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACtC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC/D,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC9D,uDAAuD;IACvD,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,qBAAqB,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC;IAC1E,iEAAiE;IACjE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAMF,eAAO,MAAM,YAAY,8GAmMxB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/slicedToArray";import{jsx as
|
|
1
|
+
import o from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/helpers/slicedToArray";import{jsx as i,jsxs as c,Fragment as n}from"react/jsx-runtime";import{forwardRef as t,useState as e,useRef as r,useCallback as m,useLayoutEffect as a}from"react";import l from"classnames";import{ButtonIcon as p}from"../../componentsV2/ButtonIcon/ButtonIcon.js";import{Tooltip as u}from"../../componentsV2/Tooltip/Tooltip.js";import{ArrowUpIcon as d}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{AttachmentPreview as j}from"../AttachmentPreview/AttachmentPreview.js";import"../../componentsV2/FileIcon/FileIcon.js";import"@material-ui/core";import"../AttachmentPreview/AttachmentPreview.scss.js";import"../../utils/main.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../clients/jsonApi/index.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import{useFileDrop as I}from"./useFileDrop.js";import h from"./CommentInputNext.scss.js";function v(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(o);s&&(c=c.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,c)}return i}function b(s){for(var i=1;i<arguments.length;i++){var c=null!=arguments[i]?arguments[i]:{};i%2?v(Object(c),!0).forEach((function(i){o(s,i,c[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(c)):v(Object(c)).forEach((function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(c,o))}))}return s}var f=t((function(o,t){var v=o.placeholder,f=void 0===v?"Add a comment":v,g=o.value,O=o.onChange,y=o.onSubmit,C=o.onCancel,P=o.disabled,F=o.autoFocus,A=o.minRows,N=void 0===A?1:A,D=o.maxRows,w=o.field,x=o.canSubmit,R=o.bare,S=o.leading,k=o.trailing,E=o.sendTooltip,M=void 0===E?"Send":E,T=o.attachments,B=o.onAttachmentRemove,G=o.onAttachmentRetry,U=o.onAttachmentReorder,z=o.onFilesDrop,H=o.dropLabel,K=void 0===H?"Drop files here":H,L=o.attachmentSlot,V=o.toolbar,q=o.footer,W=o.embedded,Y=o.className,Z=o.testId,J=I(P?void 0:z),Q=J.isDragging,X=J.dropHandlers,$=Q&&i("div",{className:h.dropOverlay,children:K}),_=void 0!==g,oo=e(""),so=s(oo,2),io=so[0],co=so[1],no=_?g:io,to=null!=D?D:R?12:8,eo=r(null),ro=m((function(o){if(eo.current=o,o){var s=o;s.style.height="auto";var i=20*to;s.style.height="".concat(Math.min(s.scrollHeight,i),"px"),s.style.overflowY=s.scrollHeight>i?"auto":"hidden"}}),[to]);a((function(){w||ro(eo.current)}),[no,w,ro]);var mo=(null!=x?x:!!no.trim())&&!P,ao=function(){mo&&(null==y||y(no.trim()),_||w||co(""))},lo=null!=w?w:i("textarea",{ref:ro,className:h.input,rows:N,placeholder:f,value:no,disabled:P,autoFocus:F,onChange:function(o){var s;s=o.target.value,_||co(s),null==O||O(s),ro(o.target)},onKeyDown:function(o){if("Escape"===o.key&&C)return o.preventDefault(),void C();"Enter"!==o.key||o.shiftKey||(o.preventDefault(),ao())}}),po=null!=k?k:i(u,{title:M,children:i("span",{className:h.send,children:i(p,{size:R?"xs":"small",type:"primary",disabled:!mo,onClick:ao,testId:"comment-input-send",children:i(d,{})})})}),uo=((null==T?void 0:T.length)||L)&&c("div",{className:h.attachment,children:[null!=T&&T.length?i(j,{items:T,onRemove:B,onRetry:G,onReorder:U}):null,L]});return c("div",R?b(b({ref:t,"data-testid":Z,className:l(h.rootBare,Y)},X),{},{children:[$,c("div",{className:h.fieldRow,children:[S&&i("div",{className:h.leading,children:S}),c("div",{className:l(h.field,!!uo&&h.fieldExpanded,P&&h.fieldDisabled),children:[c("div",{className:h.fieldMain,children:[lo,uo]}),V&&i("div",{className:h.bareToolbar,children:V}),po]})]})]}):b(b({ref:t,"data-testid":Z,className:l(h.root,W&&h.rootEmbedded,Y)},X),{},{children:[$,c("div",{className:h.inputPanel,children:[lo,uo,c("div",{className:h.toolbarRow,children:[i("div",{className:h.toolbar,children:V}),po]})]}),q&&c(n,{children:[i("div",{className:h.divider}),i("div",{className:h.metaShare,children:q})]})]}))}));export{f as CommentInput};
|
|
2
2
|
//# sourceMappingURL=CommentInputNext.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={spacing:"8",root:"CommentInputNext_root__5uxKl",inputPanel:"CommentInputNext_inputPanel__4KOFc",rootEmbedded:"CommentInputNext_rootEmbedded__-LyQl",toolbarRow:"CommentInputNext_toolbarRow__L8xXu",divider:"CommentInputNext_divider__LWp-3",metaShare:"CommentInputNext_metaShare__yJ8GZ",rootBare:"CommentInputNext_rootBare__lxyYY",fieldRow:"CommentInputNext_fieldRow__Rqcbr",leading:"CommentInputNext_leading__yDBbV",field:"CommentInputNext_field__OpnOp",fieldExpanded:"CommentInputNext_fieldExpanded__w1omA",fieldDisabled:"CommentInputNext_fieldDisabled__g3aIT",bareToolbar:"CommentInputNext_bareToolbar__nFQP-",fieldMain:"CommentInputNext_fieldMain__Rs8-Y",attachment:"CommentInputNext_attachment__2EDgL",input:"CommentInputNext_input__w6b1c",toolbar:"CommentInputNext_toolbar__Zs2OG",send:"CommentInputNext_send__p248I"};e(".CommentInputNext_root__5uxKl{background:var(--palette-background-b-6);border-radius:12px;display:flex;flex-direction:column;overflow:hidden}.CommentInputNext_inputPanel__4KOFc{display:flex;flex-direction:column;gap:8px;padding:12px 12px 8px}.CommentInputNext_rootEmbedded__-LyQl{background:transparent;border-radius:0;overflow:visible}.CommentInputNext_toolbarRow__L8xXu{align-items:center;display:flex;justify-content:space-between;width:100%}.CommentInputNext_divider__LWp-3{background:var(--palette-background-b-4);height:1px}.CommentInputNext_metaShare__yJ8GZ{color:var(--palette-primary-text-6);padding:8px 12px}.
|
|
1
|
+
import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={spacing:"8",root:"CommentInputNext_root__5uxKl",dropOverlay:"CommentInputNext_dropOverlay__E5Riv",inputPanel:"CommentInputNext_inputPanel__4KOFc",rootEmbedded:"CommentInputNext_rootEmbedded__-LyQl",toolbarRow:"CommentInputNext_toolbarRow__L8xXu",divider:"CommentInputNext_divider__LWp-3",metaShare:"CommentInputNext_metaShare__yJ8GZ",rootBare:"CommentInputNext_rootBare__lxyYY",fieldRow:"CommentInputNext_fieldRow__Rqcbr",leading:"CommentInputNext_leading__yDBbV",field:"CommentInputNext_field__OpnOp",fieldExpanded:"CommentInputNext_fieldExpanded__w1omA",fieldDisabled:"CommentInputNext_fieldDisabled__g3aIT",bareToolbar:"CommentInputNext_bareToolbar__nFQP-",fieldMain:"CommentInputNext_fieldMain__Rs8-Y",attachment:"CommentInputNext_attachment__2EDgL",input:"CommentInputNext_input__w6b1c",toolbar:"CommentInputNext_toolbar__Zs2OG",send:"CommentInputNext_send__p248I"};e(".CommentInputNext_root__5uxKl{background:var(--palette-background-b-6);border-radius:12px;display:flex;flex-direction:column;overflow:hidden;position:relative}.CommentInputNext_dropOverlay__E5Riv{align-items:center;background:rgb(from var(--palette-primary-main) r g b/.1);border:1px dashed var(--palette-primary-main);border-radius:inherit;color:var(--palette-primary-main);display:flex;font-size:14px;inset:0;justify-content:center;line-height:20px;pointer-events:none;position:absolute;z-index:5}.CommentInputNext_inputPanel__4KOFc{display:flex;flex-direction:column;gap:8px;padding:12px 12px 8px}.CommentInputNext_rootEmbedded__-LyQl{background:transparent;border-radius:0;overflow:visible}.CommentInputNext_toolbarRow__L8xXu{align-items:center;display:flex;justify-content:space-between;width:100%}.CommentInputNext_divider__LWp-3{background:var(--palette-background-b-4);height:1px}.CommentInputNext_metaShare__yJ8GZ{color:var(--palette-primary-text-6);display:flex;flex-direction:column;gap:8px;padding:8px 12px}.CommentInputNext_rootBare__lxyYY{display:flex;flex-direction:column;gap:8px;position:relative}.CommentInputNext_fieldRow__Rqcbr{align-items:flex-start;display:flex;gap:8px}.CommentInputNext_leading__yDBbV{flex-shrink:0}.CommentInputNext_field__OpnOp{align-items:flex-end;background:rgb(from var(--palette-primary-text-1) r g b/.04);border:1px solid rgb(from var(--palette-primary-text-1) r g b/.04);border-radius:8px;display:flex;flex:1 0 0;gap:8px;max-height:256px;min-height:36px;min-width:0;overflow:hidden;padding:6px 8px}.CommentInputNext_field__OpnOp:focus-within{border-color:var(--palette-primary-main)}.CommentInputNext_fieldExpanded__w1omA{max-height:none;overflow:visible}.CommentInputNext_fieldDisabled__g3aIT{opacity:.6}.CommentInputNext_bareToolbar__nFQP-{align-items:center;color:var(--palette-primary-text-6);display:flex;flex-shrink:0}.CommentInputNext_fieldMain__Rs8-Y{flex:1 0 0;min-width:0}.CommentInputNext_attachment__2EDgL,.CommentInputNext_fieldMain__Rs8-Y{display:flex;flex-direction:column;gap:8px}.CommentInputNext_input__w6b1c{background:transparent;border:none;color:var(--palette-primary-text-1);font:inherit;font-size:14px;line-height:20px;outline:none;resize:none;width:100%}.CommentInputNext_input__w6b1c::placeholder{color:var(--palette-primary-text-9)}.CommentInputNext_input__w6b1c:disabled{cursor:not-allowed}.CommentInputNext_toolbar__Zs2OG{align-items:center;color:var(--palette-primary-text-6);display:flex;gap:4px;margin-left:-4px}.CommentInputNext_send__p248I{flex-shrink:0}");export{t as default};
|
|
2
2
|
//# sourceMappingURL=CommentInputNext.scss.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DragEvent } from 'react';
|
|
2
|
+
type DropHandlers = {
|
|
3
|
+
onDragEnter: (event: DragEvent) => void;
|
|
4
|
+
onDragOver: (event: DragEvent) => void;
|
|
5
|
+
onDragLeave: (event: DragEvent) => void;
|
|
6
|
+
onDrop: (event: DragEvent) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Drop-files-from-the-desktop for a composer surface. Returns no handlers when `onFiles`
|
|
10
|
+
* is absent, so a caller that can't accept files never intercepts the drag.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useFileDrop: (onFiles?: (files: File[]) => void) => {
|
|
13
|
+
isDragging: boolean;
|
|
14
|
+
dropHandlers: DropHandlers | undefined;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=useFileDrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFileDrop.d.ts","sourceRoot":"","sources":["../../../src/components/CommentInputNext/useFileDrop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0C,MAAM,OAAO,CAAC;AAE1E,KAAK,YAAY,GAAG;IAClB,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACxC,UAAU,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACxC,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI;;;CA+C5D,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import r from"@babel/runtime/helpers/slicedToArray";import{useState as n,useRef as e,useCallback as t,useMemo as o}from"react";var u=function(r){var n,e;return null===(n=r.dataTransfer)||void 0===n||null===(e=n.types)||void 0===e?void 0:e.includes("Files")},a=function(a){var i=n(!1),l=r(i,2),f=l[0],v=l[1],c=e(0),d=t((function(r){u(r)&&(r.preventDefault(),c.current+=1,v(!0))}),[]),p=t((function(r){u(r)&&r.preventDefault()}),[]),s=t((function(r){u(r)&&(r.preventDefault(),c.current-=1,c.current<=0&&(c.current=0,v(!1)))}),[]),D=t((function(r){var n,e;if(u(r)){r.preventDefault(),c.current=0,v(!1);var t=Array.from(null!==(n=null===(e=r.dataTransfer)||void 0===e?void 0:e.files)&&void 0!==n?n:[]);t.length&&(null==a||a(t))}}),[a]),g=o((function(){return a?{onDragEnter:d,onDragOver:p,onDragLeave:s,onDrop:D}:void 0}),[a,d,p,s,D]);return{isDragging:f&&!!a,dropHandlers:g}};export{a as useFileDrop};
|
|
2
|
+
//# sourceMappingURL=useFileDrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFileDrop.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|