rn-erxes-sdk 0.1.11 → 0.1.13
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/lib/commonjs/App.js +13 -14
- package/lib/commonjs/App.js.map +1 -1
- package/lib/commonjs/FAQ.js +1 -9
- package/lib/commonjs/FAQ.js.map +1 -1
- package/lib/commonjs/Widget.js +27 -86
- package/lib/commonjs/Widget.js.map +1 -1
- package/lib/commonjs/components/FAB.js +2 -11
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/InputTools.js +1 -9
- package/lib/commonjs/components/InputTools.js.map +1 -1
- package/lib/commonjs/screen/conversation/ConversationDetail.js +2 -15
- package/lib/commonjs/screen/conversation/ConversationDetail.js.map +1 -1
- package/lib/commonjs/screen/conversation/Conversations.js +17 -3
- package/lib/commonjs/screen/conversation/Conversations.js.map +1 -1
- package/lib/commonjs/screen/greetings/Greetings.js +9 -12
- package/lib/commonjs/screen/greetings/Greetings.js.map +1 -1
- package/lib/commonjs/screen/greetings/Supporters.js +8 -4
- package/lib/commonjs/screen/greetings/Supporters.js.map +1 -1
- package/lib/commonjs/utils/utils.js +1 -13
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/App.js +13 -14
- package/lib/module/App.js.map +1 -1
- package/lib/module/FAQ.js +1 -8
- package/lib/module/FAQ.js.map +1 -1
- package/lib/module/Widget.js +26 -88
- package/lib/module/Widget.js.map +1 -1
- package/lib/module/components/FAB.js +2 -11
- package/lib/module/components/FAB.js.map +1 -1
- package/lib/module/components/InputTools.js +2 -9
- package/lib/module/components/InputTools.js.map +1 -1
- package/lib/module/screen/conversation/ConversationDetail.js +2 -15
- package/lib/module/screen/conversation/ConversationDetail.js.map +1 -1
- package/lib/module/screen/conversation/Conversations.js +17 -4
- package/lib/module/screen/conversation/Conversations.js.map +1 -1
- package/lib/module/screen/greetings/Greetings.js +9 -12
- package/lib/module/screen/greetings/Greetings.js.map +1 -1
- package/lib/module/screen/greetings/Supporters.js +8 -4
- package/lib/module/screen/greetings/Supporters.js.map +1 -1
- package/lib/module/utils/utils.js +0 -10
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/App.d.ts +3 -0
- package/lib/typescript/App.d.ts.map +1 -1
- package/lib/typescript/FAQ.d.ts.map +1 -1
- package/lib/typescript/Widget.d.ts.map +1 -1
- package/lib/typescript/components/FAB.d.ts +1 -3
- package/lib/typescript/components/FAB.d.ts.map +1 -1
- package/lib/typescript/components/InputTools.d.ts.map +1 -1
- package/lib/typescript/screen/conversation/ConversationDetail.d.ts.map +1 -1
- package/lib/typescript/screen/conversation/Conversations.d.ts.map +1 -1
- package/lib/typescript/screen/greetings/Greetings.d.ts.map +1 -1
- package/lib/typescript/screen/greetings/Supporters.d.ts.map +1 -1
- package/lib/typescript/utils/utils.d.ts +0 -1
- package/lib/typescript/utils/utils.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/App.tsx +19 -13
- package/src/FAQ.tsx +0 -8
- package/src/Widget.tsx +36 -92
- package/src/components/FAB.tsx +3 -14
- package/src/components/InputTools.tsx +8 -9
- package/src/screen/conversation/ConversationDetail.tsx +2 -15
- package/src/screen/conversation/Conversations.tsx +18 -3
- package/src/screen/greetings/Greetings.tsx +13 -12
- package/src/screen/greetings/Supporters.tsx +9 -4
- package/src/utils/utils.tsx +0 -12
- package/lib/commonjs/icons/MaterialCommunityIcons.js +0 -81
- package/lib/commonjs/icons/MaterialCommunityIcons.js.map +0 -1
- package/lib/module/icons/MaterialCommunityIcons.js +0 -71
- package/lib/module/icons/MaterialCommunityIcons.js.map +0 -1
- package/lib/typescript/icons/MaterialCommunityIcons.d.ts +0 -22
- package/lib/typescript/icons/MaterialCommunityIcons.d.ts.map +0 -1
- package/src/icons/MaterialCommunityIcons.tsx +0 -91
package/src/Widget.tsx
CHANGED
|
@@ -6,7 +6,15 @@ import Greetings from './screen/greetings/Greetings';
|
|
|
6
6
|
import Conversations from './screen/conversation/Conversations';
|
|
7
7
|
|
|
8
8
|
const Widget = (props: any) => {
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
brandCode,
|
|
11
|
+
email,
|
|
12
|
+
hasBack,
|
|
13
|
+
onBack,
|
|
14
|
+
connection,
|
|
15
|
+
backIcon,
|
|
16
|
+
newChatIcon,
|
|
17
|
+
} = props;
|
|
10
18
|
const [response, setResponse] = React.useState<any>(null);
|
|
11
19
|
|
|
12
20
|
const [connectMutation] = useMutation(connect);
|
|
@@ -31,112 +39,48 @@ const Widget = (props: any) => {
|
|
|
31
39
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
40
|
}, []);
|
|
33
41
|
|
|
34
|
-
const bgColor =
|
|
42
|
+
const bgColor =
|
|
43
|
+
response?.data?.widgetsMessengerConnect?.uiOptions?.color || '#5629b6';
|
|
35
44
|
const integrationId = response?.data?.widgetsMessengerConnect?.integrationId;
|
|
36
45
|
const brand = response?.data?.widgetsMessengerConnect?.brand;
|
|
46
|
+
const textColor =
|
|
47
|
+
response?.data?.widgetsMessengerConnect?.uiOptions?.textColor || '#fff';
|
|
37
48
|
|
|
38
49
|
if (!integrationId) {
|
|
39
50
|
return null;
|
|
40
51
|
}
|
|
41
52
|
|
|
53
|
+
const greetingProps = {
|
|
54
|
+
greetings: response?.data?.widgetsMessengerConnect?.messengerData,
|
|
55
|
+
integrationId,
|
|
56
|
+
hasBack,
|
|
57
|
+
onBack,
|
|
58
|
+
backIcon,
|
|
59
|
+
bgColor,
|
|
60
|
+
textColor,
|
|
61
|
+
brand,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const conversationProps = {
|
|
65
|
+
customerId: connection?.cachedCustomerId,
|
|
66
|
+
visitorId: connection?.visitorId,
|
|
67
|
+
integrationId,
|
|
68
|
+
bgColor,
|
|
69
|
+
brand,
|
|
70
|
+
newChatIcon,
|
|
71
|
+
textColor,
|
|
72
|
+
};
|
|
73
|
+
|
|
42
74
|
return (
|
|
43
75
|
<View style={styles.container}>
|
|
44
|
-
<Greetings
|
|
45
|
-
|
|
46
|
-
bgColor={bgColor}
|
|
47
|
-
integrationId={integrationId}
|
|
48
|
-
hasBack={hasBack}
|
|
49
|
-
onBack={onBack}
|
|
50
|
-
/>
|
|
51
|
-
{/* <TabBar index={index} setIndex={setIndex} bgColor={bgColor} /> */}
|
|
52
|
-
{/* {index === 0 ? ( */}
|
|
53
|
-
<Conversations
|
|
54
|
-
customerId={connection?.cachedCustomerId}
|
|
55
|
-
visitorId={connection?.visitorId}
|
|
56
|
-
integrationId={integrationId}
|
|
57
|
-
bgColor={bgColor}
|
|
58
|
-
brand={brand}
|
|
59
|
-
/>
|
|
60
|
-
{/* ) : (
|
|
61
|
-
<FAQ knowledgeBaseTopicId={knowledgeBaseTopicId} />
|
|
62
|
-
)} */}
|
|
76
|
+
<Greetings {...greetingProps} />
|
|
77
|
+
<Conversations {...conversationProps} />
|
|
63
78
|
</View>
|
|
64
79
|
);
|
|
65
80
|
};
|
|
66
81
|
|
|
67
82
|
export default Widget;
|
|
68
83
|
|
|
69
|
-
// const TabBar = (props: any) => {
|
|
70
|
-
// const { index, setIndex, bgColor } = props;
|
|
71
|
-
// return (
|
|
72
|
-
// <View
|
|
73
|
-
// style={{
|
|
74
|
-
// backgroundColor: '#fff',
|
|
75
|
-
// flexDirection: 'row',
|
|
76
|
-
// padding: 3,
|
|
77
|
-
// marginBottom: 3,
|
|
78
|
-
// borderColor: '#E5E5E5',
|
|
79
|
-
// borderWidth: 0.3,
|
|
80
|
-
// }}
|
|
81
|
-
// >
|
|
82
|
-
// <TouchableOpacity onPress={() => setIndex(0)} style={{ flex: 1 }}>
|
|
83
|
-
// <View
|
|
84
|
-
// style={{
|
|
85
|
-
// backgroundColor: index === 0 ? bgColor : 'transparent',
|
|
86
|
-
// borderRadius: 5,
|
|
87
|
-
// shadowColor: bgColor,
|
|
88
|
-
// shadowOffset: {
|
|
89
|
-
// width: 0,
|
|
90
|
-
// height: index === 0 ? 2 : 0,
|
|
91
|
-
// },
|
|
92
|
-
// shadowOpacity: 0.5,
|
|
93
|
-
// shadowRadius: index === 0 ? 3.84 : 0,
|
|
94
|
-
// elevation: index === 0 ? 5 : 0,
|
|
95
|
-
// }}
|
|
96
|
-
// >
|
|
97
|
-
// <Text
|
|
98
|
-
// style={{
|
|
99
|
-
// textAlign: 'center',
|
|
100
|
-
// color: index === 0 ? 'white' : 'black',
|
|
101
|
-
// paddingVertical: 10,
|
|
102
|
-
// fontWeight: '600',
|
|
103
|
-
// }}
|
|
104
|
-
// >
|
|
105
|
-
// Support
|
|
106
|
-
// </Text>
|
|
107
|
-
// </View>
|
|
108
|
-
// </TouchableOpacity>
|
|
109
|
-
// <TouchableOpacity
|
|
110
|
-
// onPress={() => setIndex(1)}
|
|
111
|
-
// style={{
|
|
112
|
-
// flex: 1,
|
|
113
|
-
// backgroundColor: index === 1 ? bgColor : 'transparent',
|
|
114
|
-
// borderRadius: 5,
|
|
115
|
-
// shadowColor: bgColor,
|
|
116
|
-
// shadowOffset: {
|
|
117
|
-
// width: 0,
|
|
118
|
-
// height: index === 1 ? 2 : 0,
|
|
119
|
-
// },
|
|
120
|
-
// shadowOpacity: 0.5,
|
|
121
|
-
// shadowRadius: index === 1 ? 3.84 : 0,
|
|
122
|
-
// elevation: index === 1 ? 5 : 0,
|
|
123
|
-
// }}
|
|
124
|
-
// >
|
|
125
|
-
// <Text
|
|
126
|
-
// style={{
|
|
127
|
-
// paddingVertical: 10,
|
|
128
|
-
// color: index === 1 ? 'white' : 'black',
|
|
129
|
-
// textAlign: 'center',
|
|
130
|
-
// fontWeight: '600',
|
|
131
|
-
// }}
|
|
132
|
-
// >
|
|
133
|
-
// FAQ
|
|
134
|
-
// </Text>
|
|
135
|
-
// </TouchableOpacity>
|
|
136
|
-
// </View>
|
|
137
|
-
// );
|
|
138
|
-
// };
|
|
139
|
-
|
|
140
84
|
const styles = StyleSheet.create({
|
|
141
85
|
container: {
|
|
142
86
|
flex: 1,
|
package/src/components/FAB.tsx
CHANGED
|
@@ -6,29 +6,24 @@ import {
|
|
|
6
6
|
TouchableOpacity,
|
|
7
7
|
ViewStyle,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import MaterialCommunityIcons from '../icons/MaterialCommunityIcons';
|
|
10
9
|
|
|
11
10
|
type Props = {
|
|
12
|
-
icon?:
|
|
11
|
+
icon?: any;
|
|
13
12
|
onPress: () => void;
|
|
14
13
|
top?: number;
|
|
15
14
|
left?: number;
|
|
16
15
|
right?: number;
|
|
17
16
|
bottom?: number;
|
|
18
17
|
backgroundColor?: string;
|
|
19
|
-
iconColor?: string;
|
|
20
|
-
iconSize?: number;
|
|
21
18
|
style?: StyleProp<ViewStyle>;
|
|
22
19
|
iconSource?: string;
|
|
23
20
|
};
|
|
24
21
|
|
|
25
22
|
const FAB = (props: Props) => {
|
|
26
23
|
const {
|
|
27
|
-
icon
|
|
24
|
+
icon,
|
|
28
25
|
onPress,
|
|
29
26
|
backgroundColor = '#2F1F69',
|
|
30
|
-
iconColor = '#fff',
|
|
31
|
-
iconSize = 20,
|
|
32
27
|
style,
|
|
33
28
|
bottom = 20,
|
|
34
29
|
} = props;
|
|
@@ -44,13 +39,7 @@ const FAB = (props: Props) => {
|
|
|
44
39
|
style,
|
|
45
40
|
]}
|
|
46
41
|
>
|
|
47
|
-
|
|
48
|
-
allowFontScaling={false}
|
|
49
|
-
name={icon}
|
|
50
|
-
size={iconSize}
|
|
51
|
-
color={iconColor}
|
|
52
|
-
direction="ltr"
|
|
53
|
-
/>
|
|
42
|
+
{icon}
|
|
54
43
|
</TouchableOpacity>
|
|
55
44
|
);
|
|
56
45
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/* eslint-disable react-native/no-inline-styles */
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Text,
|
|
6
|
+
TextInput,
|
|
7
|
+
TouchableOpacity,
|
|
8
|
+
View,
|
|
9
|
+
} from 'react-native';
|
|
5
10
|
|
|
6
11
|
const InputTools: React.FC<any> = (props: any) => {
|
|
7
12
|
const { onSend, bgColor } = props;
|
|
@@ -39,13 +44,7 @@ const InputTools: React.FC<any> = (props: any) => {
|
|
|
39
44
|
onInput('');
|
|
40
45
|
}}
|
|
41
46
|
>
|
|
42
|
-
<
|
|
43
|
-
allowFontScaling={false}
|
|
44
|
-
name={'send'}
|
|
45
|
-
size={20}
|
|
46
|
-
color={'white'}
|
|
47
|
-
direction="ltr"
|
|
48
|
-
/>
|
|
47
|
+
<Text>A</Text>
|
|
49
48
|
</TouchableOpacity>
|
|
50
49
|
</View>
|
|
51
50
|
);
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
import React, { useEffect } from 'react';
|
|
16
16
|
import { useMutation, useQuery, useSubscription } from '@apollo/client';
|
|
17
17
|
import { widgetsConversationDetail } from '../../graphql/query';
|
|
18
|
-
import MaterialCommunityIcons from '../../icons/MaterialCommunityIcons';
|
|
19
18
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
20
19
|
import Message from './Message';
|
|
21
20
|
import InputTools from '../../components/InputTools';
|
|
@@ -193,13 +192,7 @@ const Header = (props: any) => {
|
|
|
193
192
|
},
|
|
194
193
|
]}
|
|
195
194
|
>
|
|
196
|
-
<
|
|
197
|
-
allowFontScaling={false}
|
|
198
|
-
name={'chevron-left'}
|
|
199
|
-
size={24}
|
|
200
|
-
color={'white'}
|
|
201
|
-
direction="ltr"
|
|
202
|
-
/>
|
|
195
|
+
<Text>A</Text>
|
|
203
196
|
</TouchableOpacity>
|
|
204
197
|
<View
|
|
205
198
|
style={[
|
|
@@ -250,13 +243,7 @@ const Header = (props: any) => {
|
|
|
250
243
|
},
|
|
251
244
|
]}
|
|
252
245
|
>
|
|
253
|
-
<
|
|
254
|
-
allowFontScaling={false}
|
|
255
|
-
name={'chevron-left'}
|
|
256
|
-
size={24}
|
|
257
|
-
color={'white'}
|
|
258
|
-
direction="ltr"
|
|
259
|
-
/>
|
|
246
|
+
<Text>A</Text>
|
|
260
247
|
</TouchableOpacity>
|
|
261
248
|
<View style={[styles.title]}>
|
|
262
249
|
<Text style={{ fontWeight: '600', fontSize: 16 }}>{brand?.name}</Text>
|
|
@@ -17,13 +17,15 @@ import FAB from '../../components/FAB';
|
|
|
17
17
|
import { getAttachmentUrl } from '../../utils/utils';
|
|
18
18
|
|
|
19
19
|
const Conversations = (props: any) => {
|
|
20
|
-
const { customerId, visitorId, integrationId, bgColor, brand } =
|
|
20
|
+
const { customerId, visitorId, integrationId, bgColor, brand, newChatIcon } =
|
|
21
|
+
props;
|
|
21
22
|
|
|
22
|
-
console.log(
|
|
23
|
+
console.log(brand);
|
|
23
24
|
|
|
24
25
|
const { data, loading, refetch } = useQuery(widgetsConversations, {
|
|
25
26
|
variables: {
|
|
26
|
-
customerId,
|
|
27
|
+
customerId: customerId ? customerId : null,
|
|
28
|
+
visitorId: customerId ? null : visitorId,
|
|
27
29
|
integrationId,
|
|
28
30
|
},
|
|
29
31
|
});
|
|
@@ -91,6 +93,16 @@ const Conversations = (props: any) => {
|
|
|
91
93
|
return <View style={{ height: 10 }} />;
|
|
92
94
|
};
|
|
93
95
|
|
|
96
|
+
const emptyComponent = () => {
|
|
97
|
+
return (
|
|
98
|
+
<View>
|
|
99
|
+
<Text style={{ opacity: 0.8 }}>
|
|
100
|
+
There is no chat currently right now
|
|
101
|
+
</Text>
|
|
102
|
+
</View>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
94
106
|
return (
|
|
95
107
|
<View style={{ flex: 1 }}>
|
|
96
108
|
<FlatList
|
|
@@ -109,6 +121,7 @@ const Conversations = (props: any) => {
|
|
|
109
121
|
tintColor={bgColor}
|
|
110
122
|
/>
|
|
111
123
|
}
|
|
124
|
+
ListEmptyComponent={emptyComponent}
|
|
112
125
|
ItemSeparatorComponent={seperator}
|
|
113
126
|
/>
|
|
114
127
|
<FAB
|
|
@@ -124,6 +137,8 @@ const Conversations = (props: any) => {
|
|
|
124
137
|
// brand,
|
|
125
138
|
// })
|
|
126
139
|
}
|
|
140
|
+
backgroundColor={bgColor}
|
|
141
|
+
icon={newChatIcon}
|
|
127
142
|
/>
|
|
128
143
|
</View>
|
|
129
144
|
);
|
|
@@ -9,13 +9,20 @@ import {
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import Social from './Social';
|
|
11
11
|
import Supporters from './Supporters';
|
|
12
|
-
import MaterialCommunityIcons from '../../icons/MaterialCommunityIcons';
|
|
13
12
|
|
|
14
13
|
const Greetings = (props: any) => {
|
|
15
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
greetings,
|
|
16
|
+
bgColor,
|
|
17
|
+
textColor,
|
|
18
|
+
integrationId,
|
|
19
|
+
hasBack,
|
|
20
|
+
onBack,
|
|
21
|
+
backIcon,
|
|
22
|
+
} = props;
|
|
16
23
|
|
|
17
24
|
return (
|
|
18
|
-
<SafeAreaView style={{ backgroundColor: bgColor
|
|
25
|
+
<SafeAreaView style={{ backgroundColor: bgColor }}>
|
|
19
26
|
{hasBack ? (
|
|
20
27
|
<TouchableOpacity
|
|
21
28
|
onPress={() => {
|
|
@@ -28,24 +35,18 @@ const Greetings = (props: any) => {
|
|
|
28
35
|
},
|
|
29
36
|
]}
|
|
30
37
|
>
|
|
31
|
-
|
|
32
|
-
allowFontScaling={false}
|
|
33
|
-
name={'chevron-left'}
|
|
34
|
-
size={24}
|
|
35
|
-
color={'white'}
|
|
36
|
-
direction="ltr"
|
|
37
|
-
/>
|
|
38
|
+
{backIcon}
|
|
38
39
|
</TouchableOpacity>
|
|
39
40
|
) : null}
|
|
40
41
|
<View style={[styles.title]}>
|
|
41
42
|
<View style={{ marginTop: 20 }}>
|
|
42
|
-
<Text style={{ fontWeight: '600', fontSize: 18 }}>
|
|
43
|
+
<Text style={{ fontWeight: '600', fontSize: 18, color: textColor }}>
|
|
43
44
|
{greetings?.messages?.greetings?.title}
|
|
44
45
|
</Text>
|
|
45
46
|
<View style={{ marginTop: 20 }}>
|
|
46
47
|
<Social links={greetings?.links} />
|
|
47
48
|
</View>
|
|
48
|
-
<Text style={{ marginTop: 20, color:
|
|
49
|
+
<Text style={{ marginTop: 20, color: textColor, opacity: 0.8 }}>
|
|
49
50
|
{greetings?.messages?.greetings?.message}
|
|
50
51
|
</Text>
|
|
51
52
|
</View>
|
|
@@ -22,7 +22,12 @@ const Supporters = (props: any) => {
|
|
|
22
22
|
const renderSupporter = (supporter: any, index: number) => {
|
|
23
23
|
const color = supporter?.isOnline ? '#3ccc38' : 'white';
|
|
24
24
|
return (
|
|
25
|
-
<View
|
|
25
|
+
<View
|
|
26
|
+
key={index}
|
|
27
|
+
style={{
|
|
28
|
+
marginLeft: index === 0 ? 0 : 10,
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
26
31
|
<Image
|
|
27
32
|
source={{ uri: supporter?.details?.avatar }}
|
|
28
33
|
style={styles.image}
|
|
@@ -34,7 +39,7 @@ const Supporters = (props: any) => {
|
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
return (
|
|
37
|
-
<View style={{ marginTop: 10 }}>
|
|
42
|
+
<View style={{ marginTop: 10, flexDirection: 'row' }}>
|
|
38
43
|
{supporters
|
|
39
44
|
?.filter((supporter: any) => supporter?.isActive)
|
|
40
45
|
?.map((supporter: any, index: number) => {
|
|
@@ -53,8 +58,8 @@ const styles = StyleSheet.create({
|
|
|
53
58
|
borderRadius: 90,
|
|
54
59
|
},
|
|
55
60
|
activeStatus: {
|
|
56
|
-
width:
|
|
57
|
-
height:
|
|
61
|
+
width: 13,
|
|
62
|
+
height: 13,
|
|
58
63
|
borderRadius: 90,
|
|
59
64
|
position: 'absolute',
|
|
60
65
|
bottom: 0,
|
package/src/utils/utils.tsx
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import FingerprintJS from '@fingerprintjs/fingerprintjs';
|
|
2
|
-
|
|
3
1
|
const url = 'https://office.erxes.io/gateway';
|
|
4
2
|
|
|
5
3
|
export function getAttachmentUrl(value: string) {
|
|
@@ -23,13 +21,3 @@ export const strip_html = (string: any, withoutCut?: boolean) => {
|
|
|
23
21
|
return cut;
|
|
24
22
|
}
|
|
25
23
|
};
|
|
26
|
-
|
|
27
|
-
export const getVisitorId = async () => {
|
|
28
|
-
const fp = await FingerprintJS.load();
|
|
29
|
-
|
|
30
|
-
// The FingerprintJS agent is ready.
|
|
31
|
-
const result = await fp.get();
|
|
32
|
-
|
|
33
|
-
// This is the visitor identifier:
|
|
34
|
-
return result.visitorId;
|
|
35
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.accessibilityProps = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
|
-
let MaterialCommunityIcons;
|
|
13
|
-
try {
|
|
14
|
-
// Optionally require vector-icons
|
|
15
|
-
MaterialCommunityIcons = require('react-native-vector-icons/MaterialCommunityIcons').default;
|
|
16
|
-
} catch (e) {
|
|
17
|
-
let isErrorLogged = false;
|
|
18
|
-
|
|
19
|
-
// Fallback component for icons
|
|
20
|
-
MaterialCommunityIcons = _ref => {
|
|
21
|
-
let {
|
|
22
|
-
color,
|
|
23
|
-
size,
|
|
24
|
-
...rest
|
|
25
|
-
} = _ref;
|
|
26
|
-
if (!isErrorLogged) {
|
|
27
|
-
if (!/(Cannot find module|Module not found|Cannot resolve module)/) {
|
|
28
|
-
console.error('Error');
|
|
29
|
-
}
|
|
30
|
-
console.warn(`To remove this warning, try installing 'react-native-vector-icons'`);
|
|
31
|
-
isErrorLogged = true;
|
|
32
|
-
}
|
|
33
|
-
return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({}, rest, {
|
|
34
|
-
style: [styles.icon, {
|
|
35
|
-
color,
|
|
36
|
-
fontSize: size
|
|
37
|
-
}],
|
|
38
|
-
pointerEvents: "none",
|
|
39
|
-
selectable: false
|
|
40
|
-
}), "\u25A1");
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const accessibilityProps = _reactNative.Platform.OS === 'web' ? {
|
|
44
|
-
role: 'img',
|
|
45
|
-
focusable: false
|
|
46
|
-
} : {
|
|
47
|
-
accessibilityElementsHidden: true,
|
|
48
|
-
importantForAccessibility: 'no-hide-descendants'
|
|
49
|
-
};
|
|
50
|
-
exports.accessibilityProps = accessibilityProps;
|
|
51
|
-
const defaultIcon = _ref2 => {
|
|
52
|
-
let {
|
|
53
|
-
name,
|
|
54
|
-
color,
|
|
55
|
-
size,
|
|
56
|
-
direction,
|
|
57
|
-
allowFontScaling
|
|
58
|
-
} = _ref2;
|
|
59
|
-
return /*#__PURE__*/React.createElement(MaterialCommunityIcons, _extends({
|
|
60
|
-
allowFontScaling: allowFontScaling,
|
|
61
|
-
name: name,
|
|
62
|
-
color: color,
|
|
63
|
-
size: size,
|
|
64
|
-
style: [{
|
|
65
|
-
transform: [{
|
|
66
|
-
scaleX: direction === 'rtl' ? -1 : 1
|
|
67
|
-
}],
|
|
68
|
-
lineHeight: size
|
|
69
|
-
}, styles.icon],
|
|
70
|
-
pointerEvents: "none",
|
|
71
|
-
selectable: false
|
|
72
|
-
}, accessibilityProps));
|
|
73
|
-
};
|
|
74
|
-
const styles = _reactNative.StyleSheet.create({
|
|
75
|
-
icon: {
|
|
76
|
-
backgroundColor: 'transparent'
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
var _default = defaultIcon;
|
|
80
|
-
exports.default = _default;
|
|
81
|
-
//# sourceMappingURL=MaterialCommunityIcons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","MaterialCommunityIcons","e","isErrorLogged","_ref","color","size","rest","console","error","warn","createElement","Text","style","styles","icon","fontSize","pointerEvents","selectable","accessibilityProps","Platform","OS","role","focusable","accessibilityElementsHidden","importantForAccessibility","exports","defaultIcon","_ref2","name","direction","allowFontScaling","transform","scaleX","lineHeight","StyleSheet","create","backgroundColor","_default"],"sourceRoot":"../../../src","sources":["icons/MaterialCommunityIcons.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AA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AACC,OAAA,CAAAP,kBAAA,GAAAA,kBAAA;AAER,MAAMQ,WAAW,GAAGC,KAAA;EAAA,IAAC;IACnBC,IAAI;IACJxB,KAAK;IACLC,IAAI;IACJwB,SAAS;IACTC;EACS,CAAC,GAAAH,KAAA;EAAA,oBACV9D,KAAA,CAAA6C,aAAA,CAACV,sBAAsB,EAAAT,QAAA;IACrBuC,gBAAgB,EAAEA,gBAAiB;IACnCF,IAAI,EAAEA,IAAK;IACXxB,KAAK,EAAEA,KAAM;IACbC,IAAI,EAAEA,IAAK;IACXO,KAAK,EAAE,CACL;MACEmB,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAEH,SAAS,KAAK,KAAK,GAAG,CAAC,CAAC,GAAG;MAAE,CAAC,CAAC;MACrDI,UAAU,EAAE5B;IACd,CAAC,EACDQ,MAAM,CAACC,IAAI,CACX;IACFE,aAAa,EAAC,MAAM;IACpBC,UAAU,EAAE;EAAM,GACdC,kBAAkB,CACvB,CAAC;AAAA,CACH;AAED,MAAML,MAAM,GAAGqB,uBAAU,CAACC,MAAM,CAAC;EAC/BrB,IAAI,EAAE;IACJsB,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYX,WAAW;AAAAD,OAAA,CAAAjD,OAAA,GAAA6D,QAAA"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { StyleSheet, Text, Platform } from 'react-native';
|
|
4
|
-
let MaterialCommunityIcons;
|
|
5
|
-
try {
|
|
6
|
-
// Optionally require vector-icons
|
|
7
|
-
MaterialCommunityIcons = require('react-native-vector-icons/MaterialCommunityIcons').default;
|
|
8
|
-
} catch (e) {
|
|
9
|
-
let isErrorLogged = false;
|
|
10
|
-
|
|
11
|
-
// Fallback component for icons
|
|
12
|
-
MaterialCommunityIcons = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
color,
|
|
15
|
-
size,
|
|
16
|
-
...rest
|
|
17
|
-
} = _ref;
|
|
18
|
-
if (!isErrorLogged) {
|
|
19
|
-
if (!/(Cannot find module|Module not found|Cannot resolve module)/) {
|
|
20
|
-
console.error('Error');
|
|
21
|
-
}
|
|
22
|
-
console.warn(`To remove this warning, try installing 'react-native-vector-icons'`);
|
|
23
|
-
isErrorLogged = true;
|
|
24
|
-
}
|
|
25
|
-
return /*#__PURE__*/React.createElement(Text, _extends({}, rest, {
|
|
26
|
-
style: [styles.icon, {
|
|
27
|
-
color,
|
|
28
|
-
fontSize: size
|
|
29
|
-
}],
|
|
30
|
-
pointerEvents: "none",
|
|
31
|
-
selectable: false
|
|
32
|
-
}), "\u25A1");
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export const accessibilityProps = Platform.OS === 'web' ? {
|
|
36
|
-
role: 'img',
|
|
37
|
-
focusable: false
|
|
38
|
-
} : {
|
|
39
|
-
accessibilityElementsHidden: true,
|
|
40
|
-
importantForAccessibility: 'no-hide-descendants'
|
|
41
|
-
};
|
|
42
|
-
const defaultIcon = _ref2 => {
|
|
43
|
-
let {
|
|
44
|
-
name,
|
|
45
|
-
color,
|
|
46
|
-
size,
|
|
47
|
-
direction,
|
|
48
|
-
allowFontScaling
|
|
49
|
-
} = _ref2;
|
|
50
|
-
return /*#__PURE__*/React.createElement(MaterialCommunityIcons, _extends({
|
|
51
|
-
allowFontScaling: allowFontScaling,
|
|
52
|
-
name: name,
|
|
53
|
-
color: color,
|
|
54
|
-
size: size,
|
|
55
|
-
style: [{
|
|
56
|
-
transform: [{
|
|
57
|
-
scaleX: direction === 'rtl' ? -1 : 1
|
|
58
|
-
}],
|
|
59
|
-
lineHeight: size
|
|
60
|
-
}, styles.icon],
|
|
61
|
-
pointerEvents: "none",
|
|
62
|
-
selectable: false
|
|
63
|
-
}, accessibilityProps));
|
|
64
|
-
};
|
|
65
|
-
const styles = StyleSheet.create({
|
|
66
|
-
icon: {
|
|
67
|
-
backgroundColor: 'transparent'
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
export default defaultIcon;
|
|
71
|
-
//# sourceMappingURL=MaterialCommunityIcons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","Text","Platform","MaterialCommunityIcons","require","default","e","isErrorLogged","_ref","color","size","rest","console","error","warn","createElement","_extends","style","styles","icon","fontSize","pointerEvents","selectable","accessibilityProps","OS","role","focusable","accessibilityElementsHidden","importantForAccessibility","defaultIcon","_ref2","name","direction","allowFontScaling","transform","scaleX","lineHeight","create","backgroundColor"],"sourceRoot":"../../../src","sources":["icons/MaterialCommunityIcons.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AAUzD,IAAIC,sBAA2B;AAE/B,IAAI;EACF;EACAA,sBAAsB,GACpBC,OAAO,CAAC,kDAAkD,CAAC,CAACC,OAAO;AACvE,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV,IAAIC,aAAa,GAAG,KAAK;;EAEzB;EACAJ,sBAAsB,GAAGK,IAAA,IAAmC;IAAA,IAAlC;MAAEC,KAAK;MAAEC,IAAI;MAAE,GAAGC;IAAU,CAAC,GAAAH,IAAA;IACrD,IAAI,CAACD,aAAa,EAAE;MAClB,IAAI,CAAC,6DAA6D,EAAE;QAClEK,OAAO,CAACC,KAAK,CAAC,OAAO,CAAC;MACxB;MAEAD,OAAO,CAACE,IAAI,CACT,oEACH,CAAC;MAEDP,aAAa,GAAG,IAAI;IACtB;IAEA,oBACER,KAAA,CAAAgB,aAAA,CAACd,IAAI,EAAAe,QAAA,KACCL,IAAI;MACRM,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAE;QAAEV,KAAK;QAAEW,QAAQ,EAAEV;MAAK,CAAC,CAAE;MAChDW,aAAa,EAAC,MAAM;MACpBC,UAAU,EAAE;IAAM,IACnB,QAEK,CAAC;EAEX,CAAC;AACH;AAEA,OAAO,MAAMC,kBAAkB,GAC7BrB,QAAQ,CAACsB,EAAE,KAAK,KAAK,GACjB;EACEC,IAAI,EAAE,KAAK;EACXC,SAAS,EAAE;AACb,CAAC,GACD;EACEC,2BAA2B,EAAE,IAAI;EACjCC,yBAAyB,EACvB;AACJ,CAAC;AAEP,MAAMC,WAAW,GAAGC,KAAA;EAAA,IAAC;IACnBC,IAAI;IACJtB,KAAK;IACLC,IAAI;IACJsB,SAAS;IACTC;EACS,CAAC,GAAAH,KAAA;EAAA,oBACV/B,KAAA,CAAAgB,aAAA,CAACZ,sBAAsB,EAAAa,QAAA;IACrBiB,gBAAgB,EAAEA,gBAAiB;IACnCF,IAAI,EAAEA,IAAK;IACXtB,KAAK,EAAEA,KAAM;IACbC,IAAI,EAAEA,IAAK;IACXO,KAAK,EAAE,CACL;MACEiB,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAEH,SAAS,KAAK,KAAK,GAAG,CAAC,CAAC,GAAG;MAAE,CAAC,CAAC;MACrDI,UAAU,EAAE1B;IACd,CAAC,EACDQ,MAAM,CAACC,IAAI,CACX;IACFE,aAAa,EAAC,MAAM;IACpBC,UAAU,EAAE;EAAM,GACdC,kBAAkB,CACvB,CAAC;AAAA,CACH;AAED,MAAML,MAAM,GAAGlB,UAAU,CAACqC,MAAM,CAAC;EAC/BlB,IAAI,EAAE;IACJmB,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAEF,eAAeT,WAAW"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export type IconProps = {
|
|
3
|
-
name: string;
|
|
4
|
-
color: string;
|
|
5
|
-
size: number;
|
|
6
|
-
direction: 'rtl' | 'ltr';
|
|
7
|
-
allowFontScaling?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare const accessibilityProps: {
|
|
10
|
-
role: string;
|
|
11
|
-
focusable: boolean;
|
|
12
|
-
accessibilityElementsHidden?: undefined;
|
|
13
|
-
importantForAccessibility?: undefined;
|
|
14
|
-
} | {
|
|
15
|
-
accessibilityElementsHidden: boolean;
|
|
16
|
-
importantForAccessibility: "no-hide-descendants";
|
|
17
|
-
role?: undefined;
|
|
18
|
-
focusable?: undefined;
|
|
19
|
-
};
|
|
20
|
-
declare const defaultIcon: ({ name, color, size, direction, allowFontScaling, }: IconProps) => React.JSX.Element;
|
|
21
|
-
export default defaultIcon;
|
|
22
|
-
//# sourceMappingURL=MaterialCommunityIcons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialCommunityIcons.d.ts","sourceRoot":"","sources":["../../../src/icons/MaterialCommunityIcons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAsCF,eAAO,MAAM,kBAAkB;;;;;;;;;;CAUxB,CAAC;AAER,QAAA,MAAM,WAAW,wDAMd,SAAS,sBAiBX,CAAC;AAQF,eAAe,WAAW,CAAC"}
|