react-native-srschat 0.1.46 → 0.1.48
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/README.md +14 -3
- package/lib/commonjs/components/LoadingTips.js +2 -2
- package/lib/commonjs/components/LoadingTips.js.map +1 -1
- package/lib/commonjs/components/email.js +6 -3
- package/lib/commonjs/components/email.js.map +1 -1
- package/lib/commonjs/components/input.js +2 -3
- package/lib/commonjs/components/input.js.map +1 -1
- package/lib/commonjs/components/productCard.js +125 -32
- package/lib/commonjs/components/productCard.js.map +1 -1
- package/lib/commonjs/components/progressCircle.js +1 -1
- package/lib/commonjs/components/progressCircle.js.map +1 -1
- package/lib/commonjs/contexts/AppContext.js +12 -6
- package/lib/commonjs/contexts/AppContext.js.map +1 -1
- package/lib/commonjs/hooks/Stream.js +2 -1
- package/lib/commonjs/hooks/Stream.js.map +1 -1
- package/lib/commonjs/layout/ex.js +252 -270
- package/lib/commonjs/layout/ex.js.map +1 -1
- package/lib/commonjs/layout/icon.js +2 -1
- package/lib/commonjs/layout/icon.js.map +1 -1
- package/lib/commonjs/layout/welcome.js +6 -5
- package/lib/commonjs/layout/welcome.js.map +1 -1
- package/lib/commonjs/layout/window.js +38 -10
- package/lib/commonjs/layout/window.js.map +1 -1
- package/lib/commonjs/utils/storage.js +1 -1
- package/lib/module/components/LoadingTips.js +2 -2
- package/lib/module/components/LoadingTips.js.map +1 -1
- package/lib/module/components/email.js +7 -4
- package/lib/module/components/email.js.map +1 -1
- package/lib/module/components/input.js +2 -3
- package/lib/module/components/input.js.map +1 -1
- package/lib/module/components/productCard.js +125 -32
- package/lib/module/components/productCard.js.map +1 -1
- package/lib/module/components/progressCircle.js +1 -1
- package/lib/module/components/progressCircle.js.map +1 -1
- package/lib/module/contexts/AppContext.js +12 -6
- package/lib/module/contexts/AppContext.js.map +1 -1
- package/lib/module/hooks/Stream.js +2 -1
- package/lib/module/hooks/Stream.js.map +1 -1
- package/lib/module/layout/ex.js +252 -261
- package/lib/module/layout/ex.js.map +1 -1
- package/lib/module/layout/icon.js +2 -1
- package/lib/module/layout/icon.js.map +1 -1
- package/lib/module/layout/welcome.js +6 -5
- package/lib/module/layout/welcome.js.map +1 -1
- package/lib/module/layout/window.js +38 -10
- package/lib/module/layout/window.js.map +1 -1
- package/lib/module/utils/storage.js +1 -1
- package/lib/typescript/components/email.d.ts.map +1 -1
- package/lib/typescript/components/productCard.d.ts +2 -1
- package/lib/typescript/components/productCard.d.ts.map +1 -1
- package/lib/typescript/contexts/AppContext.d.ts.map +1 -1
- package/lib/typescript/hooks/Stream.d.ts.map +1 -1
- package/lib/typescript/layout/ex.d.ts +0 -2
- package/lib/typescript/layout/ex.d.ts.map +1 -1
- package/lib/typescript/layout/icon.d.ts.map +1 -1
- package/lib/typescript/layout/window.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/LoadingTips.js +2 -2
- package/src/components/email.js +7 -4
- package/src/components/input.js +1 -2
- package/src/components/productCard.js +132 -33
- package/src/components/progressCircle.js +1 -1
- package/src/contexts/AppContext.js +13 -6
- package/src/hooks/Stream.js +1 -0
- package/src/layout/ex.js +250 -249
- package/src/layout/icon.js +2 -1
- package/src/layout/welcome.js +5 -5
- package/src/layout/window.js +33 -6
- package/src/utils/storage.ts +1 -1
package/lib/module/layout/ex.js
CHANGED
|
@@ -1,262 +1,253 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { Header } from '../components/header';
|
|
5
|
-
import { AppContext } from '../contexts/AppContext';
|
|
6
|
-
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
7
|
-
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
8
|
-
import { Testing } from '../components/testing';
|
|
9
|
-
import { ChatInput } from '../components/input';
|
|
10
|
-
import { useWebSocketMessage } from '../hooks/Stream';
|
|
11
|
-
import { ProductCard } from '../components/productCard'
|
|
12
|
-
import Markdown from 'react-native-markdown-display';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
ghostBarLong: {
|
|
255
|
-
width: "100%"
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
{/* <Testing
|
|
259
|
-
onProductCardClick={onProductCardClick}
|
|
260
|
-
onAddToCartClick={onAddToCartClick}
|
|
261
|
-
/> */}
|
|
1
|
+
// import React, { useState, useEffect, useContext, useRef } from 'react';
|
|
2
|
+
// import { Text, StyleSheet, View, TextInput, TouchableOpacity, Platform, KeyboardAvoidingView,
|
|
3
|
+
// Keyboard, Animated, PanResponder, Pressable } from 'react-native';
|
|
4
|
+
// import { Header } from '../components/header';
|
|
5
|
+
// import { AppContext } from '../contexts/AppContext';
|
|
6
|
+
// import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
7
|
+
// import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
8
|
+
// import { Testing } from '../components/testing';
|
|
9
|
+
// import { ChatInput } from '../components/input';
|
|
10
|
+
// import { useWebSocketMessage } from '../hooks/Stream';
|
|
11
|
+
// import { ProductCard } from '../components/productCard'
|
|
12
|
+
// import Markdown from 'react-native-markdown-display';
|
|
13
|
+
|
|
14
|
+
// export const ChatWindow = () => {
|
|
15
|
+
// const { handleSend, messages, input, setInput, ghostMessage, handleButtonClick, setShowModal } = useContext(AppContext);
|
|
16
|
+
|
|
17
|
+
// const scrollViewRef = useRef(null);
|
|
18
|
+
// const fadeAnim = useRef(new Animated.Value(0.6)).current;
|
|
19
|
+
// const panY = useRef(new Animated.Value(0)).current;
|
|
20
|
+
// const isDragging = useRef(false);
|
|
21
|
+
|
|
22
|
+
// useEffect(() => {
|
|
23
|
+
// if (scrollViewRef.current) {
|
|
24
|
+
// setTimeout(() => {
|
|
25
|
+
// scrollViewRef.current.scrollToEnd({ animated: false });
|
|
26
|
+
// }, 100);
|
|
27
|
+
// }
|
|
28
|
+
// }, []);
|
|
29
|
+
|
|
30
|
+
// useEffect(() => {
|
|
31
|
+
// if (ghostMessage) {
|
|
32
|
+
// Animated.loop(
|
|
33
|
+
// Animated.sequence([
|
|
34
|
+
// Animated.timing(fadeAnim, { toValue: 1, duration: 500, useNativeDriver: false }),
|
|
35
|
+
// Animated.timing(fadeAnim, { toValue: 0.6, duration: 500, useNativeDriver: false }),
|
|
36
|
+
// ])
|
|
37
|
+
// ).start();
|
|
38
|
+
// }
|
|
39
|
+
// }, [ghostMessage]);
|
|
40
|
+
|
|
41
|
+
// useWebSocketMessage()
|
|
42
|
+
|
|
43
|
+
// const headerPanResponder = PanResponder.create({
|
|
44
|
+
// onStartShouldSetPanResponder: () => true,
|
|
45
|
+
// onMoveShouldSetPanResponder: () => true,
|
|
46
|
+
// onPanResponderGrant: () => {
|
|
47
|
+
// isDragging.current = true;
|
|
48
|
+
// },
|
|
49
|
+
// onPanResponderMove: (evt, gestureState) => {
|
|
50
|
+
// if (isDragging.current && gestureState.dy > 0) { // Downward swipe
|
|
51
|
+
// panY.setValue(gestureState.dy);
|
|
52
|
+
// }
|
|
53
|
+
// },
|
|
54
|
+
// onPanResponderRelease: (evt, gestureState) => {
|
|
55
|
+
// if (gestureState.dy > 100) { // Swiped down enough
|
|
56
|
+
// handleClick()
|
|
57
|
+
// } else {
|
|
58
|
+
// Animated.spring(panY, { toValue: 0, useNativeDriver: false }).start();
|
|
59
|
+
// }
|
|
60
|
+
// isDragging.current = false;
|
|
61
|
+
// },
|
|
62
|
+
// });
|
|
63
|
+
|
|
64
|
+
// const handleClick = () => {
|
|
65
|
+
// if ((uiConfig.showIcon ?? true) !== true) {
|
|
66
|
+
// setShowModal("Off");
|
|
67
|
+
// } else {
|
|
68
|
+
// setShowModal("Icon");
|
|
69
|
+
// }
|
|
70
|
+
// };
|
|
71
|
+
|
|
72
|
+
// return (
|
|
73
|
+
// <View style={styles.overlay}>
|
|
74
|
+
// {/* Click outside chat to close */}
|
|
75
|
+
// <Pressable style={styles.outsideTouchable} onPress={() => handleClick()} />
|
|
76
|
+
|
|
77
|
+
// <Animated.View style={[styles.container, { transform: [{ translateY: panY }] }]}>
|
|
78
|
+
// {/* Header - Only this section triggers drag-to-close */}
|
|
79
|
+
// <View style={styles.headerContainer} {...headerPanResponder.panHandlers}>
|
|
80
|
+
// <Header />
|
|
81
|
+
// </View>
|
|
82
|
+
|
|
83
|
+
// {/* Messages area */}
|
|
84
|
+
// <KeyboardAwareScrollView
|
|
85
|
+
// ref={scrollViewRef}
|
|
86
|
+
// contentContainerStyle={styles.messagesContent}
|
|
87
|
+
// enableOnAndroid
|
|
88
|
+
// contentInsetAdjustmentBehavior="never"
|
|
89
|
+
// automaticallyAdjustContentInsets={false}
|
|
90
|
+
// contentInset={{ bottom: 0 }}
|
|
91
|
+
// keyboardShouldPersistTaps="always"
|
|
92
|
+
// showsVerticalScrollIndicator={false}
|
|
93
|
+
// extraScrollHeight={0}
|
|
94
|
+
// onContentSizeChange={() => {
|
|
95
|
+
// scrollViewRef.current?.scrollToEnd({ animated: true });
|
|
96
|
+
// }}
|
|
97
|
+
// >
|
|
98
|
+
// {messages.map((msg, i) => (
|
|
99
|
+
|
|
100
|
+
// <View key={i} style={styles.messageWrapper}>
|
|
101
|
+
// {msg.type !== "middle" && (
|
|
102
|
+
// <View style={[ styles.messageBubble, msg.type === "user" ? styles.userMessage : styles.aiMessage,]}>
|
|
103
|
+
// <Markdown style={{ body: { color: msg.type === "user" ? "#ffffff" : "#161616",fontSize: 16, lineHeight: 22 }}}>
|
|
104
|
+
// {msg.text}
|
|
105
|
+
// </Markdown>
|
|
106
|
+
// </View>
|
|
107
|
+
// )}
|
|
108
|
+
|
|
109
|
+
// {msg.products && msg.products.length > 0 &&
|
|
110
|
+
// msg.products.map((prod, index) => (
|
|
111
|
+
// <View key={index} style={styles.productCardWrapper}>
|
|
112
|
+
// <ProductCard prod={prod} />
|
|
113
|
+
// </View>
|
|
114
|
+
// ))}
|
|
115
|
+
|
|
116
|
+
// {msg.suggested_questions && Array.isArray(msg.questions) && msg.questions.map((question, index) => (
|
|
117
|
+
// <TouchableOpacity key={index} style={styles.suggestedQuestionButton}
|
|
118
|
+
// onPress={() => handleButtonClick(question)}>
|
|
119
|
+
// <Text style={styles.suggestedQuestionText}>{question}</Text>
|
|
120
|
+
// </TouchableOpacity>
|
|
121
|
+
// ))}
|
|
122
|
+
|
|
123
|
+
// {ghostMessage && i === messages.length - 1 && (
|
|
124
|
+
// <View style={styles.ghostMessageContainer}>
|
|
125
|
+
// <Animated.View style={[styles.ghostBar, styles.ghostBarShort, { opacity: fadeAnim }]} />
|
|
126
|
+
// <Animated.View style={[styles.ghostBar, styles.ghostBarLong, { opacity: fadeAnim }]} />
|
|
127
|
+
// <Animated.View style={[styles.ghostBar, styles.ghostBarMedium, { opacity: fadeAnim }]} />
|
|
128
|
+
// </View>
|
|
129
|
+
// )}
|
|
130
|
+
// </View>
|
|
131
|
+
// ))}
|
|
132
|
+
|
|
133
|
+
// <KeyboardAvoidingView
|
|
134
|
+
// behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
135
|
+
// keyboardVerticalOffset={Platform.OS === 'ios' ? 120 : 60}
|
|
136
|
+
// >
|
|
137
|
+
// <ChatInput/>
|
|
138
|
+
// </KeyboardAvoidingView>
|
|
139
|
+
// </KeyboardAwareScrollView>
|
|
140
|
+
|
|
141
|
+
// </Animated.View>
|
|
142
|
+
// </View>
|
|
143
|
+
// );
|
|
144
|
+
// };
|
|
145
|
+
|
|
146
|
+
// const styles = StyleSheet.create({
|
|
147
|
+
// overlay: {
|
|
148
|
+
// flex: 1,
|
|
149
|
+
// position: 'absolute',
|
|
150
|
+
// left: 0,
|
|
151
|
+
// right: 0,
|
|
152
|
+
// top: 0,
|
|
153
|
+
// bottom: 0,
|
|
154
|
+
// backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
155
|
+
// justifyContent: 'flex-end',
|
|
156
|
+
// },
|
|
157
|
+
// outsideTouchable: {
|
|
158
|
+
// flex: 1, // Takes up the space above the chat, allows clicking to close
|
|
159
|
+
// },
|
|
160
|
+
// container: {
|
|
161
|
+
// flex: 1,
|
|
162
|
+
// backgroundColor: '#f6f6f6',
|
|
163
|
+
// position: 'absolute',
|
|
164
|
+
// zIndex: 1000,
|
|
165
|
+
// left: 0,
|
|
166
|
+
// right: 0,
|
|
167
|
+
// bottom: 0,
|
|
168
|
+
// top: 140,
|
|
169
|
+
// pointerEvents: 'box-none',
|
|
170
|
+
// borderTopWidth: 1,
|
|
171
|
+
// borderTopColor: '#DDD',
|
|
172
|
+
// borderTopLeftRadius: 16,
|
|
173
|
+
// borderTopRightRadius: 16,
|
|
174
|
+
// overflow: 'hidden',
|
|
175
|
+
// },
|
|
176
|
+
// headerContainer: {
|
|
177
|
+
// alignItems: "center",
|
|
178
|
+
// backgroundColor: "#f6f6f6",
|
|
179
|
+
// borderTopLeftRadius: 16,
|
|
180
|
+
// borderTopRightRadius: 16,
|
|
181
|
+
// },
|
|
182
|
+
// messagesContent: {
|
|
183
|
+
// padding: 16,
|
|
184
|
+
// justifyContent: 'flex-end',
|
|
185
|
+
// },
|
|
186
|
+
// messageWrapper: {
|
|
187
|
+
// marginBottom: 0,
|
|
188
|
+
// },
|
|
189
|
+
// messageBubble: {
|
|
190
|
+
// padding: 6,
|
|
191
|
+
// paddingHorizontal: 16,
|
|
192
|
+
// borderRadius: 12,
|
|
193
|
+
// marginBottom: 5
|
|
194
|
+
// },
|
|
195
|
+
// userMessage: {
|
|
196
|
+
// alignSelf: 'flex-end',
|
|
197
|
+
// backgroundColor: "#003764",
|
|
198
|
+
// color: "#ffffff"
|
|
199
|
+
// },
|
|
200
|
+
// aiMessage: {
|
|
201
|
+
// alignSelf: 'flex-start',
|
|
202
|
+
// backgroundColor: '#FFFFFF',
|
|
203
|
+
// width: '100%',
|
|
204
|
+
// },
|
|
205
|
+
// productCardWrapper: {
|
|
206
|
+
// marginTop: 5,
|
|
207
|
+
// },
|
|
208
|
+
// suggestedQuestionButton: {
|
|
209
|
+
// backgroundColor: "white",
|
|
210
|
+
// borderWidth: 1,
|
|
211
|
+
// borderColor: "#004687",
|
|
212
|
+
// borderRadius: 18,
|
|
213
|
+
// paddingVertical: 10,
|
|
214
|
+
// paddingHorizontal: 16,
|
|
215
|
+
// marginBottom: 7,
|
|
216
|
+
// alignSelf: "flex-start",
|
|
217
|
+
// },
|
|
218
|
+
// suggestedQuestionText: {
|
|
219
|
+
// color: "#004687",
|
|
220
|
+
// fontSize: 13,
|
|
221
|
+
// textAlign: "left",
|
|
222
|
+
// },
|
|
223
|
+
// ghostMessageContainer: {
|
|
224
|
+
// alignSelf: 'flex-start',
|
|
225
|
+
// width: '100%',
|
|
226
|
+
// backgroundColor: "#FFFFFF",
|
|
227
|
+
// borderRadius: 10,
|
|
228
|
+
// borderTopLeftRadius: 0,
|
|
229
|
+
// padding: 14,
|
|
230
|
+
// marginVertical: 5,
|
|
231
|
+
// },
|
|
232
|
+
// ghostBar: {
|
|
233
|
+
// height: 20,
|
|
234
|
+
// borderRadius: 10,
|
|
235
|
+
// backgroundColor: "#ebebeb",
|
|
236
|
+
// marginVertical: 3,
|
|
237
|
+
// },
|
|
238
|
+
// ghostBarShort: {
|
|
239
|
+
// width: "50%",
|
|
240
|
+
// },
|
|
241
|
+
// ghostBarMedium: {
|
|
242
|
+
// width: "75%",
|
|
243
|
+
// },
|
|
244
|
+
// ghostBarLong: {
|
|
245
|
+
// width: "100%",
|
|
246
|
+
// },
|
|
247
|
+
// });
|
|
248
|
+
|
|
249
|
+
// {/* <Testing
|
|
250
|
+
// onProductCardClick={onProductCardClick}
|
|
251
|
+
// onAddToCartClick={onAddToCartClick}
|
|
252
|
+
// /> */}
|
|
262
253
|
//# sourceMappingURL=ex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["layout/ex.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -26,7 +26,8 @@ export const ChatIcon = () => {
|
|
|
26
26
|
if (!disclaimer) {
|
|
27
27
|
setShowModal("Form");
|
|
28
28
|
} else {
|
|
29
|
-
if (messages.length > 1 || maintenance) {
|
|
29
|
+
if ((messages.length > 1 || maintenance) && !uiConfig.showWelcome) {
|
|
30
|
+
// console.log("UI Config", uiConfig.showWelcome)
|
|
30
31
|
setShowModal("ChatWindow");
|
|
31
32
|
} else {
|
|
32
33
|
setShowModal("Welcome");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useContext","TouchableOpacity","View","StyleSheet","Text","AppContext","Ionicons","CloudinaryImage","ChatIcon","_uiConfig$iconPositio","_uiConfig$iconPositio2","setShowModal","messages","maintenance","disclaimer","uiConfig","iconPosition","top","right","iconType","handleClick","length","containerStyle","styles","tabContainer","bubbleContainer","createElement","style","onPress","activeOpacity","iconContent","cldImg","imageStyle","width","height","tabText","create","position","borderRadius","alignItems","justifyContent","zIndex","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderTopLeftRadius","borderBottomLeftRadius","backgroundColor","flexDirection","paddingHorizontal","color","fontSize","fontWeight","marginLeft"],"sourceRoot":"../../../src","sources":["layout/icon.js"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,gBAAgB,EAAEC,IAAI,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACvE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,QAAQ,MAAM,oCAAoC;AACzD;AACA,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAO,MAAMC,QAAQ,GAAGA,CAAA,KAAM;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAC5B,MAAM;IAAEC,YAAY;IAAEC,QAAQ;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAGf,UAAU,CAACK,UAAU,CAAC;;EAE5F;EACA,MAAMW,YAAY,GAAG;IACnBC,GAAG,EAAE,CAAAF,QAAQ,aAARA,QAAQ,gBAAAN,qBAAA,GAARM,QAAQ,CAAEC,YAAY,cAAAP,qBAAA,uBAAtBA,qBAAA,CAAwBQ,GAAG,KAAI,EAAE;IACtCC,KAAK,EAAE,CAAAH,QAAQ,aAARA,QAAQ,gBAAAL,sBAAA,GAARK,QAAQ,CAAEC,YAAY,cAAAN,sBAAA,uBAAtBA,sBAAA,CAAwBQ,KAAK,KAAI;EAC1C,CAAC;;EAED;EACA,MAAMC,QAAQ,GAAG,CAAAJ,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEI,QAAQ,KAAI,QAAQ;EAE/C,MAAMC,WAAW,GAAGA,CAAA,KAAM;IACxB,IAAI,CAACN,UAAU,EAAE;MACfH,YAAY,CAAC,MAAM,CAAC;IACtB,CAAC,MAAM;MACL,
|
|
1
|
+
{"version":3,"names":["React","useContext","TouchableOpacity","View","StyleSheet","Text","AppContext","Ionicons","CloudinaryImage","ChatIcon","_uiConfig$iconPositio","_uiConfig$iconPositio2","setShowModal","messages","maintenance","disclaimer","uiConfig","iconPosition","top","right","iconType","handleClick","length","showWelcome","containerStyle","styles","tabContainer","bubbleContainer","createElement","style","onPress","activeOpacity","iconContent","cldImg","imageStyle","width","height","tabText","create","position","borderRadius","alignItems","justifyContent","zIndex","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderTopLeftRadius","borderBottomLeftRadius","backgroundColor","flexDirection","paddingHorizontal","color","fontSize","fontWeight","marginLeft"],"sourceRoot":"../../../src","sources":["layout/icon.js"],"m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BC,eAAe,EAAE,SAAS;IAC1BC,aAAa,EAAE,KAAK;IACpBX,UAAU,EAAE,QAAQ;IACpBY,iBAAiB,EAAE,EAAE;IACrBX,cAAc,EAAE,YAAY;IAC5BC,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEV,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCU,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACb,CAAC;EACDhB,WAAW,EAAE;IACXoB,aAAa,EAAE,KAAK;IACpBX,UAAU,EAAE;EACd,CAAC;EAEDJ,OAAO,EAAE;IACPiB,KAAK,EAAE,OAAO;IACdC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -13,7 +13,8 @@ export const Welcome = ({
|
|
|
13
13
|
setShowModal,
|
|
14
14
|
uiConfig,
|
|
15
15
|
onProductCardClick,
|
|
16
|
-
onAddToCartClick
|
|
16
|
+
onAddToCartClick,
|
|
17
|
+
data
|
|
17
18
|
} = useContext(AppContext);
|
|
18
19
|
const handleClick = () => {
|
|
19
20
|
if ((uiConfig.showIcon ?? true) !== true) {
|
|
@@ -52,15 +53,15 @@ export const Welcome = ({
|
|
|
52
53
|
style: styles.blueContainer
|
|
53
54
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
54
55
|
style: styles.welcomeHeader
|
|
55
|
-
}, "Hi \uD83D\uDC4B"), /*#__PURE__*/React.createElement(Text, {
|
|
56
|
+
}, "Hi ", (data === null || data === void 0 ? void 0 : data.customer_name) || "", " \uD83D\uDC4B"), /*#__PURE__*/React.createElement(Text, {
|
|
56
57
|
style: styles.welcomeBody2
|
|
57
|
-
}, "I
|
|
58
|
+
}, "I\u2019m your Heritage Pool+ AI Agent. I can help you during your online visit with Product and Account information."), /*#__PURE__*/React.createElement(WelcomeInput, null), /*#__PURE__*/React.createElement(Text, {
|
|
58
59
|
style: styles.textBeta
|
|
59
|
-
}, "Beta version.
|
|
60
|
+
}, "Beta version. AI Assistant is still learning!"))), /*#__PURE__*/React.createElement(ScrollView, {
|
|
60
61
|
style: styles.bottomContainer
|
|
61
62
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
62
63
|
style: styles.welcomeBody
|
|
63
|
-
}, "Suggested
|
|
64
|
+
}, "Suggested Questions..."), /*#__PURE__*/React.createElement(ButtonComponent, null))));
|
|
64
65
|
};
|
|
65
66
|
const styles = StyleSheet.create({
|
|
66
67
|
container: {
|