@developer_tribe/react-native-comnyx 0.13.13 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/generated/RCTAppDependencyProvider.h +25 -0
- package/android/generated/RCTAppDependencyProvider.mm +55 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/android/generated/ReactAppDependencyProvider.podspec +34 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNComnyxSpec-generated.cpp +22 -0
- package/android/generated/jni/RNComnyxSpec.h +24 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +17 -0
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +19 -0
- package/android/src/main/AndroidManifest.xml +15 -0
- package/android/src/main/AndroidManifestNew.xml +4 -0
- package/android/src/main/java/com/comnyx/ComnyxMediaPickerModule.kt +347 -0
- package/android/src/main/java/com/comnyx/ComnyxPackage.kt +1 -1
- package/android/src/main/java/com/comnyx/VideoPlayerActivity.kt +91 -0
- package/ios/ComnyxMediaPicker.m +29 -0
- package/ios/ComnyxMediaPicker.swift +436 -0
- package/lib/commonjs/NativeComnyxMediaPicker.js +83 -0
- package/lib/commonjs/NativeComnyxMediaPicker.js.map +1 -0
- package/lib/commonjs/api/index.js +19 -0
- package/lib/commonjs/api/index.js.map +1 -1
- package/lib/commonjs/api/media.js +76 -0
- package/lib/commonjs/api/media.js.map +1 -0
- package/lib/commonjs/assets/attachment-01.png +0 -0
- package/lib/commonjs/assets/gallery.png +0 -0
- package/lib/commonjs/assets/video-play.png +0 -0
- package/lib/commonjs/assets/x-circle.png +0 -0
- package/lib/commonjs/components/ChatList.js +48 -22
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/components/LinkifyText.js +5 -1
- package/lib/commonjs/components/LinkifyText.js.map +1 -1
- package/lib/commonjs/components/MediaMessageItem.js +333 -0
- package/lib/commonjs/components/MediaMessageItem.js.map +1 -0
- package/lib/commonjs/components/MediaPickerButton.js +244 -0
- package/lib/commonjs/components/MediaPickerButton.js.map +1 -0
- package/lib/commonjs/components/MediaViewerModal.js +164 -0
- package/lib/commonjs/components/MediaViewerModal.js.map +1 -0
- package/lib/commonjs/components/MessageInput.js +344 -73
- package/lib/commonjs/components/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageItem.js +17 -8
- package/lib/commonjs/components/MessageItem.js.map +1 -1
- package/lib/commonjs/constants/translations.js +174 -29
- package/lib/commonjs/constants/translations.js.map +1 -1
- package/lib/commonjs/data/fake/media.js +105 -0
- package/lib/commonjs/data/fake/media.js.map +1 -0
- package/lib/commonjs/types/MediaTypes.js +2 -0
- package/lib/commonjs/types/MediaTypes.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/NativeComnyxMediaPicker.js +73 -0
- package/lib/module/NativeComnyxMediaPicker.js.map +1 -0
- package/lib/module/api/index.js +1 -0
- package/lib/module/api/index.js.map +1 -1
- package/lib/module/api/media.js +70 -0
- package/lib/module/api/media.js.map +1 -0
- package/lib/module/assets/attachment-01.png +0 -0
- package/lib/module/assets/gallery.png +0 -0
- package/lib/module/assets/video-play.png +0 -0
- package/lib/module/assets/x-circle.png +0 -0
- package/lib/module/components/ChatList.js +48 -22
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/components/LinkifyText.js +5 -1
- package/lib/module/components/LinkifyText.js.map +1 -1
- package/lib/module/components/MediaMessageItem.js +330 -0
- package/lib/module/components/MediaMessageItem.js.map +1 -0
- package/lib/module/components/MediaPickerButton.js +240 -0
- package/lib/module/components/MediaPickerButton.js.map +1 -0
- package/lib/module/components/MediaViewerModal.js +160 -0
- package/lib/module/components/MediaViewerModal.js.map +1 -0
- package/lib/module/components/MessageInput.js +347 -75
- package/lib/module/components/MessageInput.js.map +1 -1
- package/lib/module/components/MessageItem.js +17 -8
- package/lib/module/components/MessageItem.js.map +1 -1
- package/lib/module/constants/translations.js +174 -29
- package/lib/module/constants/translations.js.map +1 -1
- package/lib/module/data/fake/media.js +99 -0
- package/lib/module/data/fake/media.js.map +1 -0
- package/lib/module/types/MediaTypes.js +2 -0
- package/lib/module/types/MediaTypes.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/NativeComnyxMediaPicker.d.ts +9 -0
- package/lib/typescript/src/NativeComnyxMediaPicker.d.ts.map +1 -0
- package/lib/typescript/src/api/index.d.ts +1 -0
- package/lib/typescript/src/api/index.d.ts.map +1 -1
- package/lib/typescript/src/api/media.d.ts +7 -0
- package/lib/typescript/src/api/media.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/src/components/LinkifyText.d.ts.map +1 -1
- package/lib/typescript/src/components/MediaMessageItem.d.ts +6 -0
- package/lib/typescript/src/components/MediaMessageItem.d.ts.map +1 -0
- package/lib/typescript/src/components/MediaPickerButton.d.ts +5 -0
- package/lib/typescript/src/components/MediaPickerButton.d.ts.map +1 -0
- package/lib/typescript/src/components/MediaViewerModal.d.ts +8 -0
- package/lib/typescript/src/components/MediaViewerModal.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageInput.d.ts.map +1 -1
- package/lib/typescript/src/components/MessageItem.d.ts.map +1 -1
- package/lib/typescript/src/constants/translations.d.ts.map +1 -1
- package/lib/typescript/src/data/fake/media.d.ts +6 -0
- package/lib/typescript/src/data/fake/media.d.ts.map +1 -0
- package/lib/typescript/src/types/Conversation.d.ts +19 -0
- package/lib/typescript/src/types/Conversation.d.ts.map +1 -1
- package/lib/typescript/src/types/LocalizationKeys.d.ts +5 -0
- package/lib/typescript/src/types/LocalizationKeys.d.ts.map +1 -1
- package/lib/typescript/src/types/MediaTypes.d.ts +26 -0
- package/lib/typescript/src/types/MediaTypes.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +1 -1
- package/lib/typescript/src/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeComnyxMediaPicker.ts +83 -0
- package/src/api/index.ts +1 -0
- package/src/api/media.ts +116 -0
- package/src/assets/attachment-01.png +0 -0
- package/src/assets/gallery.png +0 -0
- package/src/assets/video-play.png +0 -0
- package/src/assets/x-circle.png +0 -0
- package/src/components/ChatList.tsx +81 -24
- package/src/components/CustomerForm.tsx +1 -1
- package/src/components/LinkifyText.tsx +3 -2
- package/src/components/MediaMessageItem.tsx +390 -0
- package/src/components/MediaPickerButton.tsx +269 -0
- package/src/components/MediaViewerModal.tsx +168 -0
- package/src/components/MessageInput.tsx +396 -84
- package/src/components/MessageItem.tsx +19 -5
- package/src/constants/translations.ts +145 -0
- package/src/data/fake/media.ts +110 -0
- package/src/types/Conversation.ts +20 -0
- package/src/types/LocalizationKeys.ts +5 -0
- package/src/types/MediaTypes.ts +27 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Modal, View, Image, TouchableOpacity, StatusBar, useWindowDimensions } from 'react-native';
|
|
4
|
+
import { useState, useEffect } from 'react';
|
|
5
|
+
import { AppText } from "./AppText.js";
|
|
6
|
+
import { ScaledSheet } from "./ScaledSheet.js";
|
|
7
|
+
import { activeOpacity } from "../constants/activeOpacity.js";
|
|
8
|
+
import { openVideo } from "../NativeComnyxMediaPicker.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export function MediaViewerModal({
|
|
11
|
+
visible,
|
|
12
|
+
onClose,
|
|
13
|
+
mediaUri,
|
|
14
|
+
mediaType,
|
|
15
|
+
thumbnailUri
|
|
16
|
+
}) {
|
|
17
|
+
const {
|
|
18
|
+
width,
|
|
19
|
+
height
|
|
20
|
+
} = useWindowDimensions();
|
|
21
|
+
const [imageError, setImageError] = useState(false);
|
|
22
|
+
const isVideo = mediaType === 'video';
|
|
23
|
+
const displayUri = isVideo ? thumbnailUri || undefined : mediaUri;
|
|
24
|
+
// Reset error state when URI or visibility changes
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (visible) {
|
|
27
|
+
setImageError(false);
|
|
28
|
+
}
|
|
29
|
+
}, [visible, mediaUri]);
|
|
30
|
+
const handlePlayVideo = () => {
|
|
31
|
+
if (mediaUri) {
|
|
32
|
+
openVideo(mediaUri).catch(err => console.warn('[Comnyx] Could not open video:', err));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/_jsxs(Modal, {
|
|
36
|
+
visible: visible,
|
|
37
|
+
transparent: true,
|
|
38
|
+
animationType: "fade",
|
|
39
|
+
onRequestClose: onClose,
|
|
40
|
+
statusBarTranslucent: true,
|
|
41
|
+
children: [/*#__PURE__*/_jsx(StatusBar, {
|
|
42
|
+
backgroundColor: "rgba(0,0,0,0.95)",
|
|
43
|
+
barStyle: "light-content"
|
|
44
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
45
|
+
style: styles.overlay,
|
|
46
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
47
|
+
style: styles.closeButton,
|
|
48
|
+
onPress: onClose,
|
|
49
|
+
activeOpacity: activeOpacity,
|
|
50
|
+
children: /*#__PURE__*/_jsx(AppText, {
|
|
51
|
+
style: styles.closeIcon,
|
|
52
|
+
children: "\u2715"
|
|
53
|
+
})
|
|
54
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
55
|
+
style: [styles.mediaContainer, {
|
|
56
|
+
width,
|
|
57
|
+
height: height * 0.7
|
|
58
|
+
}],
|
|
59
|
+
children: [displayUri && !imageError ? /*#__PURE__*/_jsx(Image, {
|
|
60
|
+
source: {
|
|
61
|
+
uri: displayUri
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
width,
|
|
65
|
+
height: height * 0.9
|
|
66
|
+
},
|
|
67
|
+
resizeMode: "contain",
|
|
68
|
+
resizeMethod: "resize",
|
|
69
|
+
onError: () => setImageError(true)
|
|
70
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
71
|
+
style: [styles.placeholder, {
|
|
72
|
+
width: width * 0.6,
|
|
73
|
+
height: width * 0.6
|
|
74
|
+
}],
|
|
75
|
+
children: /*#__PURE__*/_jsx(AppText, {
|
|
76
|
+
style: styles.placeholderIcon,
|
|
77
|
+
children: isVideo ? '🎬' : '🖼️'
|
|
78
|
+
})
|
|
79
|
+
}), isVideo && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
80
|
+
style: styles.playOverlay,
|
|
81
|
+
onPress: handlePlayVideo,
|
|
82
|
+
activeOpacity: activeOpacity,
|
|
83
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
84
|
+
style: styles.playButton,
|
|
85
|
+
children: /*#__PURE__*/_jsx(AppText, {
|
|
86
|
+
style: styles.playIcon,
|
|
87
|
+
children: "\u25B6"
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
})]
|
|
91
|
+
})]
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const styles = ScaledSheet.create({
|
|
96
|
+
overlay: {
|
|
97
|
+
flex: 1,
|
|
98
|
+
backgroundColor: 'rgba(0,0,0,0.95)',
|
|
99
|
+
justifyContent: 'center'
|
|
100
|
+
},
|
|
101
|
+
closeButton: {
|
|
102
|
+
...{
|
|
103
|
+
position: 'absolute',
|
|
104
|
+
top: '50@vs',
|
|
105
|
+
left: '20@s',
|
|
106
|
+
zIndex: 10,
|
|
107
|
+
width: '40@vs',
|
|
108
|
+
height: '40@vs',
|
|
109
|
+
borderRadius: 20,
|
|
110
|
+
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
alignItems: 'center'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
closeIcon: {
|
|
116
|
+
color: '#FFFFFF',
|
|
117
|
+
fontSize: '20@vs',
|
|
118
|
+
fontWeight: '300'
|
|
119
|
+
},
|
|
120
|
+
mediaContainer: {
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
alignItems: 'center'
|
|
123
|
+
},
|
|
124
|
+
placeholder: {
|
|
125
|
+
backgroundColor: 'rgba(255,255,255,0.1)',
|
|
126
|
+
borderRadius: 12,
|
|
127
|
+
justifyContent: 'center',
|
|
128
|
+
alignItems: 'center'
|
|
129
|
+
},
|
|
130
|
+
placeholderIcon: {
|
|
131
|
+
fontSize: '60@vs'
|
|
132
|
+
},
|
|
133
|
+
playOverlay: {
|
|
134
|
+
...{
|
|
135
|
+
position: 'absolute',
|
|
136
|
+
top: 0,
|
|
137
|
+
left: 0,
|
|
138
|
+
right: 0,
|
|
139
|
+
bottom: 0,
|
|
140
|
+
justifyContent: 'center',
|
|
141
|
+
alignItems: 'center'
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
playButton: {
|
|
145
|
+
width: '70@vs',
|
|
146
|
+
height: '70@vs',
|
|
147
|
+
borderRadius: '35@vs',
|
|
148
|
+
backgroundColor: 'rgba(0,0,0,0.6)',
|
|
149
|
+
justifyContent: 'center',
|
|
150
|
+
alignItems: 'center',
|
|
151
|
+
borderWidth: 2,
|
|
152
|
+
borderColor: 'rgba(255,255,255,0.8)'
|
|
153
|
+
},
|
|
154
|
+
playIcon: {
|
|
155
|
+
fontSize: '30@vs',
|
|
156
|
+
color: '#FFFFFF',
|
|
157
|
+
marginLeft: '4@s'
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
//# sourceMappingURL=MediaViewerModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Modal","View","Image","TouchableOpacity","StatusBar","useWindowDimensions","useState","useEffect","AppText","ScaledSheet","activeOpacity","openVideo","jsx","_jsx","jsxs","_jsxs","MediaViewerModal","visible","onClose","mediaUri","mediaType","thumbnailUri","width","height","imageError","setImageError","isVideo","displayUri","undefined","handlePlayVideo","catch","err","console","warn","transparent","animationType","onRequestClose","statusBarTranslucent","children","backgroundColor","barStyle","style","styles","overlay","closeButton","onPress","closeIcon","mediaContainer","source","uri","resizeMode","resizeMethod","onError","placeholder","placeholderIcon","playOverlay","playButton","playIcon","create","flex","justifyContent","position","top","left","zIndex","borderRadius","alignItems","color","fontSize","fontWeight","right","bottom","borderWidth","borderColor","marginLeft"],"sourceRoot":"../../../src","sources":["components/MediaViewerModal.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,118 +1,325 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { TextInput, View, Image, TouchableOpacity } from 'react-native';
|
|
4
|
-
import { useState } from 'react';
|
|
3
|
+
import { TextInput, View, Image, TouchableOpacity, ScrollView } from 'react-native';
|
|
4
|
+
import { useState, useCallback } from 'react';
|
|
5
5
|
import { sendCustomerMessage } from "../api/index.js";
|
|
6
|
+
import { getUploadUrl, uploadFileToS3, sendMediaMessage } from "../api/index.js";
|
|
7
|
+
import { deleteTempFile } from "../NativeComnyxMediaPicker.js";
|
|
6
8
|
import { useThemeColors } from "../hooks/useThemeColors.js";
|
|
7
9
|
import { ScaledSheet } from "./ScaledSheet.js";
|
|
8
10
|
import { useLocalize } from "../hooks/useLocalize.js";
|
|
9
11
|
import { activeOpacity } from "../constants/activeOpacity.js";
|
|
10
12
|
import { useIsRtl } from "../hooks/isRtl.js";
|
|
11
13
|
import { useAppStore } from "../store/store.js";
|
|
14
|
+
import { MediaPickerButton } from "./MediaPickerButton.js";
|
|
12
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
16
|
const sendDark = require('../assets/arrow-right.png');
|
|
17
|
+
const circleXIcon = require('../assets/x-circle.png');
|
|
14
18
|
export function MessageInput({
|
|
15
19
|
scrollToBottom
|
|
16
20
|
}) {
|
|
17
21
|
const [value, setValue] = useState('');
|
|
22
|
+
const [pendingMedia, setPendingMedia] = useState([]);
|
|
23
|
+
const [isSending, setIsSending] = useState(false);
|
|
18
24
|
const customer = useAppStore(s => s.customer);
|
|
19
25
|
const themeColors = useThemeColors();
|
|
20
26
|
const localize = useLocalize();
|
|
21
27
|
const isRtl = useIsRtl();
|
|
22
|
-
const
|
|
23
|
-
if (value.trim())
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const sendTextOnlyMessage = useCallback(() => {
|
|
29
|
+
if (!value.trim()) return;
|
|
30
|
+
const date = new Date();
|
|
31
|
+
const localId = `local-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
32
|
+
useAppStore.getState().setData(data => [{
|
|
33
|
+
id: null,
|
|
34
|
+
local_id: localId,
|
|
35
|
+
approved: false,
|
|
36
|
+
content: value,
|
|
37
|
+
created_at: date,
|
|
38
|
+
customer: {
|
|
39
|
+
name: customer.name,
|
|
40
|
+
profile_photo_url: null
|
|
41
|
+
}
|
|
42
|
+
}, ...(data ?? [])]);
|
|
43
|
+
sendCustomerMessage(customer.external_id, value, {
|
|
44
|
+
fake: useAppStore.getState().fake
|
|
45
|
+
}).then(res => {
|
|
46
|
+
const data = useAppStore.getState().data;
|
|
47
|
+
if (data) {
|
|
48
|
+
const itemIndex = data.findIndex(item => item.local_id === localId);
|
|
49
|
+
if (itemIndex === -1) {
|
|
50
|
+
//TODO:??
|
|
51
|
+
} else {
|
|
52
|
+
const alteredData = [...data];
|
|
53
|
+
alteredData[itemIndex] = {
|
|
54
|
+
id: res.message.id,
|
|
55
|
+
content: res.message.content,
|
|
56
|
+
customer: res.message.customer ?? alteredData[itemIndex]?.customer,
|
|
57
|
+
created_at: new Date(res.message.created_at),
|
|
58
|
+
approved: true
|
|
59
|
+
};
|
|
60
|
+
useAppStore.setState({
|
|
61
|
+
data: alteredData
|
|
62
|
+
});
|
|
63
|
+
scrollToBottom(false);
|
|
33
64
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} else {
|
|
44
|
-
const alteredData = [...data];
|
|
45
|
-
alteredData[itemIndex] = {
|
|
46
|
-
id: res.message.id,
|
|
47
|
-
content: res.message.content,
|
|
48
|
-
customer: res.message.customer ?? alteredData[itemIndex]?.customer,
|
|
49
|
-
created_at: new Date(res.message.created_at),
|
|
50
|
-
approved: true
|
|
51
|
-
};
|
|
52
|
-
useAppStore.setState({
|
|
53
|
-
data: alteredData
|
|
54
|
-
});
|
|
55
|
-
scrollToBottom(false);
|
|
56
|
-
}
|
|
65
|
+
} else {
|
|
66
|
+
//TODO: ??
|
|
67
|
+
}
|
|
68
|
+
}).catch(() => {
|
|
69
|
+
const data = useAppStore.getState().data;
|
|
70
|
+
if (data) {
|
|
71
|
+
const itemIndex = data.findIndex(item => item.local_id === localId);
|
|
72
|
+
if (itemIndex === -1) {
|
|
73
|
+
//TODO:??
|
|
57
74
|
} else {
|
|
58
|
-
|
|
75
|
+
const alteredData = [...data];
|
|
76
|
+
alteredData[itemIndex] = {
|
|
77
|
+
...alteredData[itemIndex],
|
|
78
|
+
id: alteredData[itemIndex]?.id ?? null,
|
|
79
|
+
content: alteredData[itemIndex]?.content ?? '',
|
|
80
|
+
created_at: alteredData[itemIndex]?.created_at ?? new Date(),
|
|
81
|
+
approved: alteredData[itemIndex]?.approved ?? false,
|
|
82
|
+
customer: alteredData[itemIndex]?.customer ?? null,
|
|
83
|
+
error: true
|
|
84
|
+
};
|
|
85
|
+
useAppStore.setState({
|
|
86
|
+
data: alteredData
|
|
87
|
+
});
|
|
88
|
+
scrollToBottom(false);
|
|
59
89
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
} else {
|
|
91
|
+
//TODO: ??
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
setValue('');
|
|
95
|
+
}, [value, customer, scrollToBottom]);
|
|
96
|
+
const uploadSingleMedia = useCallback(async (asset, isFake, onProgress) => {
|
|
97
|
+
const presignResponse = await getUploadUrl(asset.fileName, asset.mimeType, {
|
|
98
|
+
fake: isFake
|
|
99
|
+
});
|
|
100
|
+
const uploadUrl = presignResponse.data.url;
|
|
101
|
+
const filePath = presignResponse.data.path;
|
|
102
|
+
await uploadFileToS3(uploadUrl, asset.uri, asset.mimeType, onProgress, {
|
|
103
|
+
fake: isFake
|
|
104
|
+
});
|
|
105
|
+
return isFake ? asset.uri : filePath;
|
|
106
|
+
}, []);
|
|
107
|
+
const sendMediaMessages = useCallback(async (assets, content) => {
|
|
108
|
+
const isFake = useAppStore.getState().fake;
|
|
109
|
+
const date = new Date();
|
|
110
|
+
const placeholderMediaFiles = assets.map(asset => ({
|
|
111
|
+
url: '',
|
|
112
|
+
type: asset.type,
|
|
113
|
+
local_uri: asset.uri,
|
|
114
|
+
thumbnail_uri: asset.thumbnailUri
|
|
115
|
+
}));
|
|
116
|
+
const localId = `local-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
117
|
+
useAppStore.getState().setData(data => [{
|
|
118
|
+
id: null,
|
|
119
|
+
local_id: localId,
|
|
120
|
+
approved: false,
|
|
121
|
+
content: content,
|
|
122
|
+
created_at: date,
|
|
123
|
+
customer: {
|
|
124
|
+
name: customer.name,
|
|
125
|
+
profile_photo_url: null
|
|
126
|
+
},
|
|
127
|
+
media_files: placeholderMediaFiles,
|
|
128
|
+
media_type: assets[0].type,
|
|
129
|
+
is_uploading: true,
|
|
130
|
+
upload_progress: 0
|
|
131
|
+
}, ...(data ?? [])]);
|
|
132
|
+
scrollToBottom(false);
|
|
133
|
+
try {
|
|
134
|
+
const fileProgresses = new Array(assets.length).fill(0);
|
|
135
|
+
let lastProgressUpdate = 0;
|
|
136
|
+
const updateOverallProgress = () => {
|
|
137
|
+
const now = Date.now();
|
|
138
|
+
if (now - lastProgressUpdate < 250) return;
|
|
139
|
+
lastProgressUpdate = now;
|
|
140
|
+
const sum = fileProgresses.reduce((a, b) => a + b, 0);
|
|
141
|
+
const overall = Math.min(95, Math.round(sum / assets.length));
|
|
142
|
+
const currentData = useAppStore.getState().data;
|
|
143
|
+
if (currentData) {
|
|
144
|
+
const idx = currentData.findIndex(item => item.local_id === localId);
|
|
145
|
+
if (idx !== -1) {
|
|
146
|
+
const updated = [...currentData];
|
|
147
|
+
updated[idx] = {
|
|
148
|
+
...updated[idx],
|
|
149
|
+
upload_progress: overall
|
|
76
150
|
};
|
|
77
151
|
useAppStore.setState({
|
|
78
|
-
data:
|
|
152
|
+
data: updated
|
|
79
153
|
});
|
|
80
|
-
scrollToBottom(false);
|
|
81
154
|
}
|
|
82
|
-
} else {
|
|
83
|
-
//TODO: ??
|
|
84
155
|
}
|
|
156
|
+
};
|
|
157
|
+
const uploadedPaths = [];
|
|
158
|
+
for (let i = 0; i < assets.length; i++) {
|
|
159
|
+
const path = await uploadSingleMedia(assets[i], isFake, percentage => {
|
|
160
|
+
fileProgresses[i] = percentage;
|
|
161
|
+
updateOverallProgress();
|
|
162
|
+
});
|
|
163
|
+
uploadedPaths.push(path);
|
|
164
|
+
}
|
|
165
|
+
const res = await sendMediaMessage(customer.external_id, uploadedPaths, assets[0].type, content, {
|
|
166
|
+
fake: isFake
|
|
85
167
|
});
|
|
168
|
+
const currentData = useAppStore.getState().data;
|
|
169
|
+
if (currentData) {
|
|
170
|
+
const idx = currentData.findIndex(item => item.local_id === localId);
|
|
171
|
+
if (idx !== -1) {
|
|
172
|
+
const updated = [...currentData];
|
|
173
|
+
const finalMediaFiles = assets.map((asset, i) => ({
|
|
174
|
+
url: uploadedPaths[i],
|
|
175
|
+
type: asset.type,
|
|
176
|
+
local_uri: asset.uri,
|
|
177
|
+
thumbnail_uri: asset.thumbnailUri
|
|
178
|
+
}));
|
|
179
|
+
updated[idx] = {
|
|
180
|
+
id: res.message.id,
|
|
181
|
+
content: res.message.content,
|
|
182
|
+
customer: res.message.customer ?? updated[idx]?.customer ?? null,
|
|
183
|
+
created_at: new Date(res.message.created_at),
|
|
184
|
+
approved: true,
|
|
185
|
+
media_files: finalMediaFiles,
|
|
186
|
+
media_type: assets[0].type,
|
|
187
|
+
is_uploading: false,
|
|
188
|
+
upload_progress: 100
|
|
189
|
+
};
|
|
190
|
+
useAppStore.setState({
|
|
191
|
+
data: updated
|
|
192
|
+
});
|
|
193
|
+
scrollToBottom(false);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Temp files are NOT deleted here — they are still needed for display
|
|
198
|
+
// until the backend data refresh provides full S3 URLs.
|
|
199
|
+
// The OS cleans up temp directory files automatically.
|
|
200
|
+
} catch (error) {
|
|
201
|
+
// Handle upload error — temp files are preserved for retry
|
|
202
|
+
const currentData = useAppStore.getState().data;
|
|
203
|
+
if (currentData) {
|
|
204
|
+
const idx = currentData.findIndex(item => item.local_id === localId);
|
|
205
|
+
if (idx !== -1) {
|
|
206
|
+
const updated = [...currentData];
|
|
207
|
+
updated[idx] = {
|
|
208
|
+
...updated[idx],
|
|
209
|
+
is_uploading: false,
|
|
210
|
+
error: true
|
|
211
|
+
};
|
|
212
|
+
useAppStore.setState({
|
|
213
|
+
data: updated
|
|
214
|
+
});
|
|
215
|
+
scrollToBottom(false);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
console.error('[Comnyx] Media upload failed:', error);
|
|
219
|
+
}
|
|
220
|
+
}, [customer, scrollToBottom, uploadSingleMedia]);
|
|
221
|
+
const handleMediaSelected = useCallback(assets => {
|
|
222
|
+
setPendingMedia(prev => [...prev, ...assets]);
|
|
223
|
+
}, []);
|
|
224
|
+
const removePendingMedia = useCallback(index => {
|
|
225
|
+
setPendingMedia(prev => {
|
|
226
|
+
const removed = prev[index];
|
|
227
|
+
if (removed) {
|
|
228
|
+
deleteTempFile(removed.uri).catch(e => console.warn('[Comnyx] Failed to delete temp file:', e));
|
|
229
|
+
if (removed.thumbnailUri) {
|
|
230
|
+
deleteTempFile(removed.thumbnailUri).catch(e => console.warn('[Comnyx] Failed to delete temp thumbnail:', e));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return prev.filter((_, i) => i !== index);
|
|
234
|
+
});
|
|
235
|
+
}, []);
|
|
236
|
+
const handleSend = useCallback(async () => {
|
|
237
|
+
if (isSending) return;
|
|
238
|
+
if (pendingMedia.length > 0) {
|
|
239
|
+
setIsSending(true);
|
|
240
|
+
const content = value.trim();
|
|
241
|
+
const assets = [...pendingMedia];
|
|
242
|
+
setPendingMedia([]);
|
|
86
243
|
setValue('');
|
|
244
|
+
await sendMediaMessages(assets, content);
|
|
245
|
+
setIsSending(false);
|
|
246
|
+
} else if (value.trim()) {
|
|
247
|
+
sendTextOnlyMessage();
|
|
87
248
|
}
|
|
88
|
-
};
|
|
249
|
+
}, [isSending, pendingMedia, value, sendMediaMessages, sendTextOnlyMessage]);
|
|
250
|
+
const hasPendingMedia = pendingMedia.length > 0;
|
|
89
251
|
return /*#__PURE__*/_jsxs(View, {
|
|
90
252
|
style: [styles.container, {
|
|
91
253
|
backgroundColor: themeColors.background
|
|
92
254
|
}],
|
|
93
|
-
children: [/*#__PURE__*/_jsx(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
returnKeyType: "send",
|
|
98
|
-
multiline: true,
|
|
99
|
-
maxLength: 1000,
|
|
100
|
-
style: [styles.textInput, {
|
|
101
|
-
backgroundColor: themeColors.background,
|
|
102
|
-
color: themeColors.text,
|
|
255
|
+
children: [/*#__PURE__*/_jsx(MediaPickerButton, {
|
|
256
|
+
onMediaSelected: handleMediaSelected
|
|
257
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
258
|
+
style: [styles.inputWrapper, {
|
|
103
259
|
borderColor: themeColors.silver
|
|
104
260
|
}],
|
|
105
|
-
|
|
106
|
-
|
|
261
|
+
children: [hasPendingMedia && /*#__PURE__*/_jsx(ScrollView, {
|
|
262
|
+
horizontal: true,
|
|
263
|
+
showsHorizontalScrollIndicator: false,
|
|
264
|
+
style: styles.previewScroll,
|
|
265
|
+
contentContainerStyle: styles.previewContent,
|
|
266
|
+
children: pendingMedia.map((asset, index) => /*#__PURE__*/_jsxs(View, {
|
|
267
|
+
style: styles.previewItem,
|
|
268
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
269
|
+
source: {
|
|
270
|
+
uri: asset.type === 'video' && asset.thumbnailUri ? asset.thumbnailUri : asset.uri
|
|
271
|
+
},
|
|
272
|
+
style: styles.previewThumbnail
|
|
273
|
+
}), asset.type === 'video' && /*#__PURE__*/_jsx(View, {
|
|
274
|
+
style: styles.playIconOverlay,
|
|
275
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
276
|
+
style: styles.playIcon,
|
|
277
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
278
|
+
style: styles.playTriangle
|
|
279
|
+
})
|
|
280
|
+
})
|
|
281
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
282
|
+
style: styles.removeButton,
|
|
283
|
+
onPress: () => removePendingMedia(index),
|
|
284
|
+
activeOpacity: activeOpacity,
|
|
285
|
+
hitSlop: {
|
|
286
|
+
top: 8,
|
|
287
|
+
bottom: 8,
|
|
288
|
+
left: 8,
|
|
289
|
+
right: 8
|
|
290
|
+
},
|
|
291
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
292
|
+
source: circleXIcon,
|
|
293
|
+
style: styles.removeIcon
|
|
294
|
+
})
|
|
295
|
+
})]
|
|
296
|
+
}, `${asset.uri}-${index}`))
|
|
297
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
298
|
+
value: value,
|
|
299
|
+
onChangeText: newValue => setValue(newValue),
|
|
300
|
+
onSubmitEditing: handleSend,
|
|
301
|
+
returnKeyType: "send",
|
|
302
|
+
multiline: true,
|
|
303
|
+
maxLength: 1000,
|
|
304
|
+
style: [styles.textInput, {
|
|
305
|
+
backgroundColor: themeColors.background,
|
|
306
|
+
color: themeColors.text
|
|
307
|
+
}],
|
|
308
|
+
placeholder: localize('chat.messageInput.placeholder'),
|
|
309
|
+
placeholderTextColor: themeColors.text + '80'
|
|
310
|
+
})]
|
|
107
311
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
108
312
|
style: [styles.sendButton],
|
|
109
|
-
onPress:
|
|
313
|
+
onPress: handleSend,
|
|
110
314
|
activeOpacity: activeOpacity,
|
|
315
|
+
disabled: isSending,
|
|
111
316
|
children: /*#__PURE__*/_jsx(Image, {
|
|
112
317
|
style: [styles.sendIcon, isRtl && {
|
|
113
318
|
transform: [{
|
|
114
319
|
rotate: '180deg'
|
|
115
320
|
}]
|
|
321
|
+
}, isSending && {
|
|
322
|
+
opacity: 0.4
|
|
116
323
|
}],
|
|
117
324
|
source: sendDark
|
|
118
325
|
})
|
|
@@ -124,16 +331,80 @@ const styles = ScaledSheet.create({
|
|
|
124
331
|
flexDirection: 'row',
|
|
125
332
|
paddingHorizontal: '10@s',
|
|
126
333
|
paddingVertical: '10@vs',
|
|
127
|
-
alignItems: '
|
|
334
|
+
alignItems: 'flex-end',
|
|
128
335
|
position: 'relative',
|
|
129
336
|
zIndex: 1
|
|
130
337
|
},
|
|
131
|
-
|
|
338
|
+
inputWrapper: {
|
|
132
339
|
flex: 1,
|
|
133
340
|
borderWidth: 1,
|
|
134
341
|
borderRadius: '20@s',
|
|
135
|
-
paddingHorizontal: '15@s',
|
|
136
342
|
marginRight: '10@s',
|
|
343
|
+
overflow: 'hidden'
|
|
344
|
+
},
|
|
345
|
+
previewScroll: {
|
|
346
|
+
maxHeight: '80@vs',
|
|
347
|
+
marginTop: '8@vs',
|
|
348
|
+
marginHorizontal: '10@s'
|
|
349
|
+
},
|
|
350
|
+
previewContent: {
|
|
351
|
+
flexDirection: 'row',
|
|
352
|
+
gap: '6@s'
|
|
353
|
+
},
|
|
354
|
+
previewItem: {
|
|
355
|
+
position: 'relative',
|
|
356
|
+
width: '60@vs',
|
|
357
|
+
height: '60@vs',
|
|
358
|
+
borderRadius: '8@s'
|
|
359
|
+
},
|
|
360
|
+
previewThumbnail: {
|
|
361
|
+
width: '100%',
|
|
362
|
+
height: '100%',
|
|
363
|
+
borderRadius: '8@s'
|
|
364
|
+
},
|
|
365
|
+
playIconOverlay: {
|
|
366
|
+
...{
|
|
367
|
+
position: 'absolute',
|
|
368
|
+
top: 0,
|
|
369
|
+
left: 0,
|
|
370
|
+
right: 0,
|
|
371
|
+
bottom: 0,
|
|
372
|
+
justifyContent: 'center',
|
|
373
|
+
alignItems: 'center'
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
playIcon: {
|
|
377
|
+
width: '22@vs',
|
|
378
|
+
height: '22@vs',
|
|
379
|
+
borderRadius: '11@vs',
|
|
380
|
+
borderWidth: 1.5,
|
|
381
|
+
borderColor: '#fff',
|
|
382
|
+
justifyContent: 'center',
|
|
383
|
+
alignItems: 'center'
|
|
384
|
+
},
|
|
385
|
+
playTriangle: {
|
|
386
|
+
width: 0,
|
|
387
|
+
height: 0,
|
|
388
|
+
borderLeftWidth: '7@vs',
|
|
389
|
+
borderTopWidth: '5@vs',
|
|
390
|
+
borderBottomWidth: '5@vs',
|
|
391
|
+
borderLeftColor: '#fff',
|
|
392
|
+
borderTopColor: 'transparent',
|
|
393
|
+
borderBottomColor: 'transparent',
|
|
394
|
+
marginLeft: '2@s'
|
|
395
|
+
},
|
|
396
|
+
removeButton: {
|
|
397
|
+
position: 'absolute',
|
|
398
|
+
top: '-1@vs',
|
|
399
|
+
right: 0,
|
|
400
|
+
zIndex: 1
|
|
401
|
+
},
|
|
402
|
+
removeIcon: {
|
|
403
|
+
width: '20@vs',
|
|
404
|
+
height: '20@vs'
|
|
405
|
+
},
|
|
406
|
+
textInput: {
|
|
407
|
+
paddingHorizontal: '15@s',
|
|
137
408
|
fontSize: '16@vs',
|
|
138
409
|
paddingVertical: '10@vs',
|
|
139
410
|
minHeight: 40,
|
|
@@ -144,7 +415,8 @@ const styles = ScaledSheet.create({
|
|
|
144
415
|
height: '40@vs',
|
|
145
416
|
borderRadius: '20@vs',
|
|
146
417
|
justifyContent: 'center',
|
|
147
|
-
alignItems: 'center'
|
|
418
|
+
alignItems: 'center',
|
|
419
|
+
marginBottom: 0
|
|
148
420
|
},
|
|
149
421
|
sendIcon: {
|
|
150
422
|
width: '40@vs',
|