@parlr/react-native 0.1.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/LICENSE +21 -0
- package/README.md +918 -0
- package/lib/commonjs/components/AttachmentPicker.js +292 -0
- package/lib/commonjs/components/AttachmentPicker.js.map +1 -0
- package/lib/commonjs/components/AttachmentPreview.js +200 -0
- package/lib/commonjs/components/AttachmentPreview.js.map +1 -0
- package/lib/commonjs/components/ChatBubble.js +391 -0
- package/lib/commonjs/components/ChatBubble.js.map +1 -0
- package/lib/commonjs/components/EmptyState.js +115 -0
- package/lib/commonjs/components/EmptyState.js.map +1 -0
- package/lib/commonjs/components/ParlrChat.js +745 -0
- package/lib/commonjs/components/ParlrChat.js.map +1 -0
- package/lib/commonjs/components/ParlrConversationList.js +509 -0
- package/lib/commonjs/components/ParlrConversationList.js.map +1 -0
- package/lib/commonjs/components/PreChatForm.js +263 -0
- package/lib/commonjs/components/PreChatForm.js.map +1 -0
- package/lib/commonjs/components/RichMessage.js +284 -0
- package/lib/commonjs/components/RichMessage.js.map +1 -0
- package/lib/commonjs/components/SatisfactionSurvey.js +292 -0
- package/lib/commonjs/components/SatisfactionSurvey.js.map +1 -0
- package/lib/commonjs/components/TypingIndicator.js +86 -0
- package/lib/commonjs/components/TypingIndicator.js.map +1 -0
- package/lib/commonjs/core/api.js +310 -0
- package/lib/commonjs/core/api.js.map +1 -0
- package/lib/commonjs/core/config.js +40 -0
- package/lib/commonjs/core/config.js.map +1 -0
- package/lib/commonjs/core/errors.js +73 -0
- package/lib/commonjs/core/errors.js.map +1 -0
- package/lib/commonjs/core/offlineQueue.js +89 -0
- package/lib/commonjs/core/offlineQueue.js.map +1 -0
- package/lib/commonjs/core/pushNotifications.js +21 -0
- package/lib/commonjs/core/pushNotifications.js.map +1 -0
- package/lib/commonjs/core/session.js +130 -0
- package/lib/commonjs/core/session.js.map +1 -0
- package/lib/commonjs/core/theme.js +110 -0
- package/lib/commonjs/core/theme.js.map +1 -0
- package/lib/commonjs/core/types.js +6 -0
- package/lib/commonjs/core/types.js.map +1 -0
- package/lib/commonjs/core/websocket.js +245 -0
- package/lib/commonjs/core/websocket.js.map +1 -0
- package/lib/commonjs/hooks/useChat.js +462 -0
- package/lib/commonjs/hooks/useChat.js.map +1 -0
- package/lib/commonjs/hooks/useParlr.js +44 -0
- package/lib/commonjs/hooks/useParlr.js.map +1 -0
- package/lib/commonjs/index.js +185 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/provider/ParlrContext.js +38 -0
- package/lib/commonjs/provider/ParlrContext.js.map +1 -0
- package/lib/commonjs/provider/ParlrProvider.js +256 -0
- package/lib/commonjs/provider/ParlrProvider.js.map +1 -0
- package/lib/module/components/AttachmentPicker.js +287 -0
- package/lib/module/components/AttachmentPicker.js.map +1 -0
- package/lib/module/components/AttachmentPreview.js +195 -0
- package/lib/module/components/AttachmentPreview.js.map +1 -0
- package/lib/module/components/ChatBubble.js +386 -0
- package/lib/module/components/ChatBubble.js.map +1 -0
- package/lib/module/components/EmptyState.js +110 -0
- package/lib/module/components/EmptyState.js.map +1 -0
- package/lib/module/components/ParlrChat.js +740 -0
- package/lib/module/components/ParlrChat.js.map +1 -0
- package/lib/module/components/ParlrConversationList.js +504 -0
- package/lib/module/components/ParlrConversationList.js.map +1 -0
- package/lib/module/components/PreChatForm.js +258 -0
- package/lib/module/components/PreChatForm.js.map +1 -0
- package/lib/module/components/RichMessage.js +280 -0
- package/lib/module/components/RichMessage.js.map +1 -0
- package/lib/module/components/SatisfactionSurvey.js +287 -0
- package/lib/module/components/SatisfactionSurvey.js.map +1 -0
- package/lib/module/components/TypingIndicator.js +81 -0
- package/lib/module/components/TypingIndicator.js.map +1 -0
- package/lib/module/core/api.js +305 -0
- package/lib/module/core/api.js.map +1 -0
- package/lib/module/core/config.js +36 -0
- package/lib/module/core/config.js.map +1 -0
- package/lib/module/core/errors.js +64 -0
- package/lib/module/core/errors.js.map +1 -0
- package/lib/module/core/offlineQueue.js +82 -0
- package/lib/module/core/offlineQueue.js.map +1 -0
- package/lib/module/core/pushNotifications.js +16 -0
- package/lib/module/core/pushNotifications.js.map +1 -0
- package/lib/module/core/session.js +122 -0
- package/lib/module/core/session.js.map +1 -0
- package/lib/module/core/theme.js +105 -0
- package/lib/module/core/theme.js.map +1 -0
- package/lib/module/core/types.js +4 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/core/websocket.js +241 -0
- package/lib/module/core/websocket.js.map +1 -0
- package/lib/module/hooks/useChat.js +458 -0
- package/lib/module/hooks/useChat.js.map +1 -0
- package/lib/module/hooks/useParlr.js +40 -0
- package/lib/module/hooks/useParlr.js.map +1 -0
- package/lib/module/index.js +58 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/provider/ParlrContext.js +35 -0
- package/lib/module/provider/ParlrContext.js.map +1 -0
- package/lib/module/provider/ParlrProvider.js +251 -0
- package/lib/module/provider/ParlrProvider.js.map +1 -0
- package/lib/typescript/commonjs/components/AttachmentPicker.d.ts +23 -0
- package/lib/typescript/commonjs/components/AttachmentPicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/AttachmentPreview.d.ts +16 -0
- package/lib/typescript/commonjs/components/AttachmentPreview.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ChatBubble.d.ts +14 -0
- package/lib/typescript/commonjs/components/ChatBubble.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/EmptyState.d.ts +10 -0
- package/lib/typescript/commonjs/components/EmptyState.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ParlrChat.d.ts +34 -0
- package/lib/typescript/commonjs/components/ParlrChat.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ParlrConversationList.d.ts +17 -0
- package/lib/typescript/commonjs/components/ParlrConversationList.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/PreChatForm.d.ts +20 -0
- package/lib/typescript/commonjs/components/PreChatForm.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/RichMessage.d.ts +41 -0
- package/lib/typescript/commonjs/components/RichMessage.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/SatisfactionSurvey.d.ts +17 -0
- package/lib/typescript/commonjs/components/SatisfactionSurvey.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TypingIndicator.d.ts +7 -0
- package/lib/typescript/commonjs/components/TypingIndicator.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/api.d.ts +37 -0
- package/lib/typescript/commonjs/core/api.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/config.d.ts +9 -0
- package/lib/typescript/commonjs/core/config.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/errors.d.ts +35 -0
- package/lib/typescript/commonjs/core/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/offlineQueue.d.ts +16 -0
- package/lib/typescript/commonjs/core/offlineQueue.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/pushNotifications.d.ts +6 -0
- package/lib/typescript/commonjs/core/pushNotifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/session.d.ts +15 -0
- package/lib/typescript/commonjs/core/session.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/theme.d.ts +43 -0
- package/lib/typescript/commonjs/core/theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/types.d.ts +185 -0
- package/lib/typescript/commonjs/core/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/websocket.d.ts +17 -0
- package/lib/typescript/commonjs/core/websocket.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/useChat.d.ts +35 -0
- package/lib/typescript/commonjs/hooks/useChat.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/useParlr.d.ts +11 -0
- package/lib/typescript/commonjs/hooks/useParlr.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +30 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/provider/ParlrContext.d.ts +13 -0
- package/lib/typescript/commonjs/provider/ParlrContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/provider/ParlrProvider.d.ts +5 -0
- package/lib/typescript/commonjs/provider/ParlrProvider.d.ts.map +1 -0
- package/lib/typescript/module/components/AttachmentPicker.d.ts +23 -0
- package/lib/typescript/module/components/AttachmentPicker.d.ts.map +1 -0
- package/lib/typescript/module/components/AttachmentPreview.d.ts +16 -0
- package/lib/typescript/module/components/AttachmentPreview.d.ts.map +1 -0
- package/lib/typescript/module/components/ChatBubble.d.ts +14 -0
- package/lib/typescript/module/components/ChatBubble.d.ts.map +1 -0
- package/lib/typescript/module/components/EmptyState.d.ts +10 -0
- package/lib/typescript/module/components/EmptyState.d.ts.map +1 -0
- package/lib/typescript/module/components/ParlrChat.d.ts +34 -0
- package/lib/typescript/module/components/ParlrChat.d.ts.map +1 -0
- package/lib/typescript/module/components/ParlrConversationList.d.ts +17 -0
- package/lib/typescript/module/components/ParlrConversationList.d.ts.map +1 -0
- package/lib/typescript/module/components/PreChatForm.d.ts +20 -0
- package/lib/typescript/module/components/PreChatForm.d.ts.map +1 -0
- package/lib/typescript/module/components/RichMessage.d.ts +41 -0
- package/lib/typescript/module/components/RichMessage.d.ts.map +1 -0
- package/lib/typescript/module/components/SatisfactionSurvey.d.ts +17 -0
- package/lib/typescript/module/components/SatisfactionSurvey.d.ts.map +1 -0
- package/lib/typescript/module/components/TypingIndicator.d.ts +7 -0
- package/lib/typescript/module/components/TypingIndicator.d.ts.map +1 -0
- package/lib/typescript/module/core/api.d.ts +37 -0
- package/lib/typescript/module/core/api.d.ts.map +1 -0
- package/lib/typescript/module/core/config.d.ts +9 -0
- package/lib/typescript/module/core/config.d.ts.map +1 -0
- package/lib/typescript/module/core/errors.d.ts +35 -0
- package/lib/typescript/module/core/errors.d.ts.map +1 -0
- package/lib/typescript/module/core/offlineQueue.d.ts +16 -0
- package/lib/typescript/module/core/offlineQueue.d.ts.map +1 -0
- package/lib/typescript/module/core/pushNotifications.d.ts +6 -0
- package/lib/typescript/module/core/pushNotifications.d.ts.map +1 -0
- package/lib/typescript/module/core/session.d.ts +15 -0
- package/lib/typescript/module/core/session.d.ts.map +1 -0
- package/lib/typescript/module/core/theme.d.ts +43 -0
- package/lib/typescript/module/core/theme.d.ts.map +1 -0
- package/lib/typescript/module/core/types.d.ts +185 -0
- package/lib/typescript/module/core/types.d.ts.map +1 -0
- package/lib/typescript/module/core/websocket.d.ts +17 -0
- package/lib/typescript/module/core/websocket.d.ts.map +1 -0
- package/lib/typescript/module/hooks/useChat.d.ts +35 -0
- package/lib/typescript/module/hooks/useChat.d.ts.map +1 -0
- package/lib/typescript/module/hooks/useParlr.d.ts +11 -0
- package/lib/typescript/module/hooks/useParlr.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +30 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/provider/ParlrContext.d.ts +13 -0
- package/lib/typescript/module/provider/ParlrContext.d.ts.map +1 -0
- package/lib/typescript/module/provider/ParlrProvider.d.ts +5 -0
- package/lib/typescript/module/provider/ParlrProvider.d.ts.map +1 -0
- package/package.json +120 -0
- package/src/components/AttachmentPicker.tsx +310 -0
- package/src/components/AttachmentPreview.tsx +209 -0
- package/src/components/ChatBubble.tsx +424 -0
- package/src/components/EmptyState.tsx +118 -0
- package/src/components/ParlrChat.tsx +863 -0
- package/src/components/ParlrConversationList.tsx +559 -0
- package/src/components/PreChatForm.tsx +313 -0
- package/src/components/RichMessage.tsx +353 -0
- package/src/components/SatisfactionSurvey.tsx +333 -0
- package/src/components/TypingIndicator.tsx +89 -0
- package/src/core/api.ts +406 -0
- package/src/core/config.ts +39 -0
- package/src/core/errors.ts +68 -0
- package/src/core/offlineQueue.ts +94 -0
- package/src/core/pushNotifications.ts +22 -0
- package/src/core/session.ts +156 -0
- package/src/core/theme.ts +133 -0
- package/src/core/types.ts +237 -0
- package/src/core/websocket.ts +270 -0
- package/src/hooks/useChat.ts +534 -0
- package/src/hooks/useParlr.ts +43 -0
- package/src/index.ts +98 -0
- package/src/provider/ParlrContext.ts +40 -0
- package/src/provider/ParlrProvider.tsx +338 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Parlr React Native SDK - Satisfaction Survey (CSAT)
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
//
|
|
7
|
+
// Displays a 1-5 star rating + optional comment after a conversation is closed.
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
import React, { useCallback, useState } from 'react';
|
|
11
|
+
import { ActivityIndicator, Pressable, StyleSheet, Text, TextInput, View, useColorScheme } from 'react-native';
|
|
12
|
+
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Props
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// i18n
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
|
|
21
|
+
function getI18n(locale) {
|
|
22
|
+
if (locale?.startsWith('en')) {
|
|
23
|
+
return {
|
|
24
|
+
title: 'How was your experience?',
|
|
25
|
+
description: 'Rate your conversation with our team.',
|
|
26
|
+
commentPlaceholder: 'Tell us more (optional)',
|
|
27
|
+
submit: 'Submit',
|
|
28
|
+
dismiss: 'Skip',
|
|
29
|
+
thanks: 'Thank you for your feedback!',
|
|
30
|
+
labels: ['Terrible', 'Bad', 'Okay', 'Good', 'Excellent']
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
title: 'Comment s\u2019est pass\u00e9e votre exp\u00e9rience ?',
|
|
35
|
+
description: '\u00c9valuez votre conversation avec notre \u00e9quipe.',
|
|
36
|
+
commentPlaceholder: 'Dites-nous en plus (optionnel)',
|
|
37
|
+
submit: 'Envoyer',
|
|
38
|
+
dismiss: 'Passer',
|
|
39
|
+
thanks: 'Merci pour votre retour !',
|
|
40
|
+
labels: ['Terrible', 'Mauvais', 'Correct', 'Bien', 'Excellent']
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// Star component
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
function Star({
|
|
49
|
+
filled,
|
|
50
|
+
onPress,
|
|
51
|
+
size = 36
|
|
52
|
+
}) {
|
|
53
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
54
|
+
onPress: onPress,
|
|
55
|
+
hitSlop: 4,
|
|
56
|
+
accessibilityRole: "button",
|
|
57
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
58
|
+
style: {
|
|
59
|
+
fontSize: size,
|
|
60
|
+
color: filled ? '#f59e0b' : '#d1d5db'
|
|
61
|
+
},
|
|
62
|
+
children: filled ? '\u2605' : '\u2606'
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Component
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
export function SatisfactionSurvey({
|
|
72
|
+
onSubmit,
|
|
73
|
+
onDismiss,
|
|
74
|
+
title,
|
|
75
|
+
description,
|
|
76
|
+
accentColor: accentColorProp,
|
|
77
|
+
locale
|
|
78
|
+
}) {
|
|
79
|
+
const isDark = useColorScheme() === 'dark';
|
|
80
|
+
const accentColor = accentColorProp ?? '#6366f1';
|
|
81
|
+
const i18n = getI18n(locale);
|
|
82
|
+
const [score, setScore] = useState(0);
|
|
83
|
+
const [comment, setComment] = useState('');
|
|
84
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
85
|
+
const [submitted, setSubmitted] = useState(false);
|
|
86
|
+
const handleSubmit = useCallback(async () => {
|
|
87
|
+
if (score === 0) return;
|
|
88
|
+
setIsSubmitting(true);
|
|
89
|
+
try {
|
|
90
|
+
await onSubmit(score, comment.trim() || undefined);
|
|
91
|
+
setSubmitted(true);
|
|
92
|
+
} finally {
|
|
93
|
+
setIsSubmitting(false);
|
|
94
|
+
}
|
|
95
|
+
}, [score, comment, onSubmit]);
|
|
96
|
+
if (submitted) {
|
|
97
|
+
return /*#__PURE__*/_jsx(View, {
|
|
98
|
+
style: [styles.root, isDark && styles.rootDark],
|
|
99
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
100
|
+
style: styles.container,
|
|
101
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
102
|
+
style: styles.checkmark,
|
|
103
|
+
children: '\u2714'
|
|
104
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
105
|
+
style: [styles.thanksText, isDark && styles.thanksTextDark],
|
|
106
|
+
children: i18n.thanks
|
|
107
|
+
})]
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return /*#__PURE__*/_jsx(View, {
|
|
112
|
+
style: [styles.root, isDark && styles.rootDark],
|
|
113
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
114
|
+
style: styles.container,
|
|
115
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
116
|
+
style: [styles.title, isDark && styles.titleDark],
|
|
117
|
+
children: title ?? i18n.title
|
|
118
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
119
|
+
style: [styles.description, isDark && styles.descriptionDark],
|
|
120
|
+
children: description ?? i18n.description
|
|
121
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
122
|
+
style: styles.starsRow,
|
|
123
|
+
children: [1, 2, 3, 4, 5].map(value => /*#__PURE__*/_jsx(Star, {
|
|
124
|
+
filled: value <= score,
|
|
125
|
+
onPress: () => setScore(value)
|
|
126
|
+
}, value))
|
|
127
|
+
}), score > 0 && /*#__PURE__*/_jsx(Text, {
|
|
128
|
+
style: [styles.scoreLabel, isDark && styles.scoreLabelDark],
|
|
129
|
+
children: i18n.labels[score - 1]
|
|
130
|
+
}), score > 0 && /*#__PURE__*/_jsx(TextInput, {
|
|
131
|
+
style: [styles.commentInput, isDark ? styles.commentInputDark : styles.commentInputLight],
|
|
132
|
+
value: comment,
|
|
133
|
+
onChangeText: setComment,
|
|
134
|
+
placeholder: i18n.commentPlaceholder,
|
|
135
|
+
placeholderTextColor: isDark ? '#64748b' : '#94a3b8',
|
|
136
|
+
multiline: true,
|
|
137
|
+
maxLength: 500,
|
|
138
|
+
accessibilityLabel: i18n.commentPlaceholder
|
|
139
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
140
|
+
style: styles.actions,
|
|
141
|
+
children: [onDismiss && /*#__PURE__*/_jsx(Pressable, {
|
|
142
|
+
onPress: onDismiss,
|
|
143
|
+
style: styles.dismissButton,
|
|
144
|
+
accessibilityRole: "button",
|
|
145
|
+
accessibilityLabel: i18n.dismiss,
|
|
146
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
147
|
+
style: [styles.dismissText, isDark && styles.dismissTextDark],
|
|
148
|
+
children: i18n.dismiss
|
|
149
|
+
})
|
|
150
|
+
}), /*#__PURE__*/_jsx(Pressable, {
|
|
151
|
+
onPress: handleSubmit,
|
|
152
|
+
disabled: score === 0 || isSubmitting,
|
|
153
|
+
style: [styles.submitButton, {
|
|
154
|
+
backgroundColor: score === 0 || isSubmitting ? '#cbd5e1' : accentColor
|
|
155
|
+
}],
|
|
156
|
+
accessibilityRole: "button",
|
|
157
|
+
accessibilityLabel: i18n.submit,
|
|
158
|
+
accessibilityState: {
|
|
159
|
+
disabled: score === 0 || isSubmitting
|
|
160
|
+
},
|
|
161
|
+
children: isSubmitting ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
162
|
+
size: "small",
|
|
163
|
+
color: "#ffffff"
|
|
164
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
165
|
+
style: styles.submitText,
|
|
166
|
+
children: i18n.submit
|
|
167
|
+
})
|
|
168
|
+
})]
|
|
169
|
+
})]
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
// Styles
|
|
176
|
+
// ---------------------------------------------------------------------------
|
|
177
|
+
|
|
178
|
+
const styles = StyleSheet.create({
|
|
179
|
+
root: {
|
|
180
|
+
backgroundColor: '#ffffff',
|
|
181
|
+
paddingVertical: 24
|
|
182
|
+
},
|
|
183
|
+
rootDark: {
|
|
184
|
+
backgroundColor: '#0f172a'
|
|
185
|
+
},
|
|
186
|
+
container: {
|
|
187
|
+
paddingHorizontal: 24,
|
|
188
|
+
alignItems: 'center'
|
|
189
|
+
},
|
|
190
|
+
title: {
|
|
191
|
+
fontSize: 18,
|
|
192
|
+
fontWeight: '700',
|
|
193
|
+
color: '#0f172a',
|
|
194
|
+
marginBottom: 6,
|
|
195
|
+
textAlign: 'center'
|
|
196
|
+
},
|
|
197
|
+
titleDark: {
|
|
198
|
+
color: '#f1f5f9'
|
|
199
|
+
},
|
|
200
|
+
description: {
|
|
201
|
+
fontSize: 14,
|
|
202
|
+
color: '#64748b',
|
|
203
|
+
textAlign: 'center',
|
|
204
|
+
marginBottom: 20
|
|
205
|
+
},
|
|
206
|
+
descriptionDark: {
|
|
207
|
+
color: '#94a3b8'
|
|
208
|
+
},
|
|
209
|
+
starsRow: {
|
|
210
|
+
flexDirection: 'row',
|
|
211
|
+
gap: 12,
|
|
212
|
+
marginBottom: 8
|
|
213
|
+
},
|
|
214
|
+
scoreLabel: {
|
|
215
|
+
fontSize: 14,
|
|
216
|
+
fontWeight: '500',
|
|
217
|
+
color: '#475569',
|
|
218
|
+
marginBottom: 16
|
|
219
|
+
},
|
|
220
|
+
scoreLabelDark: {
|
|
221
|
+
color: '#94a3b8'
|
|
222
|
+
},
|
|
223
|
+
commentInput: {
|
|
224
|
+
width: '100%',
|
|
225
|
+
minHeight: 80,
|
|
226
|
+
maxHeight: 120,
|
|
227
|
+
fontSize: 14,
|
|
228
|
+
paddingHorizontal: 14,
|
|
229
|
+
paddingVertical: 10,
|
|
230
|
+
borderRadius: 10,
|
|
231
|
+
borderWidth: 1,
|
|
232
|
+
textAlignVertical: 'top',
|
|
233
|
+
marginBottom: 16
|
|
234
|
+
},
|
|
235
|
+
commentInputLight: {
|
|
236
|
+
backgroundColor: '#f8fafc',
|
|
237
|
+
borderColor: '#e2e8f0',
|
|
238
|
+
color: '#0f172a'
|
|
239
|
+
},
|
|
240
|
+
commentInputDark: {
|
|
241
|
+
backgroundColor: '#1e293b',
|
|
242
|
+
borderColor: '#334155',
|
|
243
|
+
color: '#f1f5f9'
|
|
244
|
+
},
|
|
245
|
+
actions: {
|
|
246
|
+
flexDirection: 'row',
|
|
247
|
+
gap: 12,
|
|
248
|
+
alignItems: 'center'
|
|
249
|
+
},
|
|
250
|
+
dismissButton: {
|
|
251
|
+
paddingHorizontal: 20,
|
|
252
|
+
paddingVertical: 12
|
|
253
|
+
},
|
|
254
|
+
dismissText: {
|
|
255
|
+
fontSize: 14,
|
|
256
|
+
color: '#64748b'
|
|
257
|
+
},
|
|
258
|
+
dismissTextDark: {
|
|
259
|
+
color: '#94a3b8'
|
|
260
|
+
},
|
|
261
|
+
submitButton: {
|
|
262
|
+
flex: 1,
|
|
263
|
+
paddingVertical: 12,
|
|
264
|
+
borderRadius: 10,
|
|
265
|
+
alignItems: 'center'
|
|
266
|
+
},
|
|
267
|
+
submitText: {
|
|
268
|
+
color: '#ffffff',
|
|
269
|
+
fontSize: 15,
|
|
270
|
+
fontWeight: '600'
|
|
271
|
+
},
|
|
272
|
+
checkmark: {
|
|
273
|
+
fontSize: 48,
|
|
274
|
+
color: '#22c55e',
|
|
275
|
+
marginBottom: 12
|
|
276
|
+
},
|
|
277
|
+
thanksText: {
|
|
278
|
+
fontSize: 16,
|
|
279
|
+
fontWeight: '600',
|
|
280
|
+
color: '#0f172a',
|
|
281
|
+
textAlign: 'center'
|
|
282
|
+
},
|
|
283
|
+
thanksTextDark: {
|
|
284
|
+
color: '#f1f5f9'
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
//# sourceMappingURL=SatisfactionSurvey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useState","ActivityIndicator","Pressable","StyleSheet","Text","TextInput","View","useColorScheme","jsx","_jsx","jsxs","_jsxs","getI18n","locale","startsWith","title","description","commentPlaceholder","submit","dismiss","thanks","labels","Star","filled","onPress","size","hitSlop","accessibilityRole","children","style","fontSize","color","SatisfactionSurvey","onSubmit","onDismiss","accentColor","accentColorProp","isDark","i18n","score","setScore","comment","setComment","isSubmitting","setIsSubmitting","submitted","setSubmitted","handleSubmit","trim","undefined","styles","root","rootDark","container","checkmark","thanksText","thanksTextDark","titleDark","descriptionDark","starsRow","map","value","scoreLabel","scoreLabelDark","commentInput","commentInputDark","commentInputLight","onChangeText","placeholder","placeholderTextColor","multiline","maxLength","accessibilityLabel","actions","dismissButton","dismissText","dismissTextDark","disabled","submitButton","backgroundColor","accessibilityState","submitText","create","paddingVertical","paddingHorizontal","alignItems","fontWeight","marginBottom","textAlign","flexDirection","gap","width","minHeight","maxHeight","borderRadius","borderWidth","textAlignVertical","borderColor","flex"],"sourceRoot":"../../../src","sources":["components/SatisfactionSurvey.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,SACEC,iBAAiB,EACjBC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,IAAI,EACJC,cAAc,QACT,cAAc;;AAErB;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBA;AACA;AACA;;AAEA,SAASC,OAAOA,CAACC,MAAe,EAAE;EAChC,IAAIA,MAAM,EAAEC,UAAU,CAAC,IAAI,CAAC,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,EAAE,EAAE;IACZwD,UAAU,EAAE,KAAK;IACjBvD,KAAK,EAAE,SAAS;IAChByD,SAAS,EAAE;EACb,CAAC;EACDhC,cAAc,EAAE;IACdzB,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Parlr React Native SDK - Typing Indicator (animated 3 dots)
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
import React, { useEffect } from 'react';
|
|
8
|
+
import { StyleSheet, View, useColorScheme } from 'react-native';
|
|
9
|
+
import Animated, { useSharedValue, useAnimatedStyle, withRepeat, withSequence, withTiming, withDelay, Easing } from 'react-native-reanimated';
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
function Dot({
|
|
12
|
+
index,
|
|
13
|
+
color
|
|
14
|
+
}) {
|
|
15
|
+
const translateY = useSharedValue(0);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
translateY.value = withDelay(index * 150, withRepeat(withSequence(withTiming(-6, {
|
|
18
|
+
duration: 300,
|
|
19
|
+
easing: Easing.out(Easing.ease)
|
|
20
|
+
}), withTiming(0, {
|
|
21
|
+
duration: 300,
|
|
22
|
+
easing: Easing.in(Easing.ease)
|
|
23
|
+
})), -1, false));
|
|
24
|
+
}, [index, translateY]);
|
|
25
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
26
|
+
transform: [{
|
|
27
|
+
translateY: translateY.value
|
|
28
|
+
}]
|
|
29
|
+
}));
|
|
30
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
31
|
+
style: [styles.dot, {
|
|
32
|
+
backgroundColor: color
|
|
33
|
+
}, animatedStyle]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export function TypingIndicator({
|
|
37
|
+
accentColor
|
|
38
|
+
}) {
|
|
39
|
+
const isDark = useColorScheme() === 'dark';
|
|
40
|
+
const dotColor = accentColor ?? (isDark ? '#94a3b8' : '#64748b');
|
|
41
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
42
|
+
style: [styles.container, isDark ? styles.containerDark : styles.containerLight],
|
|
43
|
+
accessibilityLabel: "Agent is typing",
|
|
44
|
+
accessibilityRole: "text",
|
|
45
|
+
children: [/*#__PURE__*/_jsx(Dot, {
|
|
46
|
+
index: 0,
|
|
47
|
+
color: dotColor
|
|
48
|
+
}), /*#__PURE__*/_jsx(Dot, {
|
|
49
|
+
index: 1,
|
|
50
|
+
color: dotColor
|
|
51
|
+
}), /*#__PURE__*/_jsx(Dot, {
|
|
52
|
+
index: 2,
|
|
53
|
+
color: dotColor
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const styles = StyleSheet.create({
|
|
58
|
+
container: {
|
|
59
|
+
flexDirection: 'row',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
alignSelf: 'flex-start',
|
|
62
|
+
paddingHorizontal: 16,
|
|
63
|
+
paddingVertical: 12,
|
|
64
|
+
borderRadius: 18,
|
|
65
|
+
marginLeft: 12,
|
|
66
|
+
marginVertical: 4,
|
|
67
|
+
gap: 4
|
|
68
|
+
},
|
|
69
|
+
containerLight: {
|
|
70
|
+
backgroundColor: '#f1f5f9'
|
|
71
|
+
},
|
|
72
|
+
containerDark: {
|
|
73
|
+
backgroundColor: '#1e293b'
|
|
74
|
+
},
|
|
75
|
+
dot: {
|
|
76
|
+
width: 7,
|
|
77
|
+
height: 7,
|
|
78
|
+
borderRadius: 3.5
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=TypingIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","StyleSheet","View","useColorScheme","Animated","useSharedValue","useAnimatedStyle","withRepeat","withSequence","withTiming","withDelay","Easing","jsx","_jsx","jsxs","_jsxs","Dot","index","color","translateY","value","duration","easing","out","ease","in","animatedStyle","transform","style","styles","dot","backgroundColor","TypingIndicator","accentColor","isDark","dotColor","container","containerDark","containerLight","accessibilityLabel","accessibilityRole","children","create","flexDirection","alignItems","alignSelf","paddingHorizontal","paddingVertical","borderRadius","marginLeft","marginVertical","gap","width","height"],"sourceRoot":"../../../src","sources":["components/TypingIndicator.tsx"],"mappings":";;AAAA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,UAAU,EAAEC,IAAI,EAAEC,cAAc,QAAQ,cAAc;AAC/D,OAAOC,QAAQ,IACbC,cAAc,EACdC,gBAAgB,EAChBC,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,SAAS,EACTC,MAAM,QACD,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMjC,SAASC,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAwC,CAAC,EAAE;EAC/D,MAAMC,UAAU,GAAGd,cAAc,CAAC,CAAC,CAAC;EAEpCL,SAAS,CAAC,MAAM;IACdmB,UAAU,CAACC,KAAK,GAAGV,SAAS,CAC1BO,KAAK,GAAG,GAAG,EACXV,UAAU,CACRC,YAAY,CACVC,UAAU,CAAC,CAAC,CAAC,EAAE;MAAEY,QAAQ,EAAE,GAAG;MAAEC,MAAM,EAAEX,MAAM,CAACY,GAAG,CAACZ,MAAM,CAACa,IAAI;IAAE,CAAC,CAAC,EAClEf,UAAU,CAAC,CAAC,EAAE;MAAEY,QAAQ,EAAE,GAAG;MAAEC,MAAM,EAAEX,MAAM,CAACc,EAAE,CAACd,MAAM,CAACa,IAAI;IAAE,CAAC,CACjE,CAAC,EACD,CAAC,CAAC,EACF,KACF,CACF,CAAC;EACH,CAAC,EAAE,CAACP,KAAK,EAAEE,UAAU,CAAC,CAAC;EAEvB,MAAMO,aAAa,GAAGpB,gBAAgB,CAAC,OAAO;IAC5CqB,SAA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