@appsupportkit/support-sdk 0.1.2 → 0.3.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/lib/commonjs/api.js +17 -2
- package/lib/commonjs/api.js.map +1 -1
- package/lib/commonjs/components/BottomSheet.js +67 -47
- package/lib/commonjs/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/LauncherButton.js +177 -0
- package/lib/commonjs/components/LauncherButton.js.map +1 -0
- package/lib/commonjs/components/SupportButton.js +168 -190
- package/lib/commonjs/components/SupportButton.js.map +1 -1
- package/lib/commonjs/components/icons.js +110 -23
- package/lib/commonjs/components/icons.js.map +1 -1
- package/lib/commonjs/components/primitives.js +191 -44
- package/lib/commonjs/components/primitives.js.map +1 -1
- package/lib/commonjs/components/screens/ComposeScreen.js +108 -60
- package/lib/commonjs/components/screens/ComposeScreen.js.map +1 -1
- package/lib/commonjs/components/screens/HomeScreen.js +221 -118
- package/lib/commonjs/components/screens/HomeScreen.js.map +1 -1
- package/lib/commonjs/components/screens/LanguageScreen.js +150 -0
- package/lib/commonjs/components/screens/LanguageScreen.js.map +1 -0
- package/lib/commonjs/components/screens/ThreadScreen.js +237 -111
- package/lib/commonjs/components/screens/ThreadScreen.js.map +1 -1
- package/lib/commonjs/i18n/index.js +101 -0
- package/lib/commonjs/i18n/index.js.map +1 -0
- package/lib/commonjs/i18n/languages.js +95 -0
- package/lib/commonjs/i18n/languages.js.map +1 -0
- package/lib/commonjs/i18n/strings/de.js +72 -0
- package/lib/commonjs/i18n/strings/de.js.map +1 -0
- package/lib/commonjs/i18n/strings/en.js +88 -0
- package/lib/commonjs/i18n/strings/en.js.map +1 -0
- package/lib/commonjs/i18n/strings/es.js +72 -0
- package/lib/commonjs/i18n/strings/es.js.map +1 -0
- package/lib/commonjs/i18n/strings/fr.js +72 -0
- package/lib/commonjs/i18n/strings/fr.js.map +1 -0
- package/lib/commonjs/i18n/strings/hi.js +72 -0
- package/lib/commonjs/i18n/strings/hi.js.map +1 -0
- package/lib/commonjs/i18n/strings/it.js +72 -0
- package/lib/commonjs/i18n/strings/it.js.map +1 -0
- package/lib/commonjs/i18n/strings/ja.js +72 -0
- package/lib/commonjs/i18n/strings/ja.js.map +1 -0
- package/lib/commonjs/i18n/strings/ko.js +72 -0
- package/lib/commonjs/i18n/strings/ko.js.map +1 -0
- package/lib/commonjs/i18n/strings/nl.js +72 -0
- package/lib/commonjs/i18n/strings/nl.js.map +1 -0
- package/lib/commonjs/i18n/strings/pl.js +72 -0
- package/lib/commonjs/i18n/strings/pl.js.map +1 -0
- package/lib/commonjs/i18n/strings/pt.js +72 -0
- package/lib/commonjs/i18n/strings/pt.js.map +1 -0
- package/lib/commonjs/i18n/strings/ru.js +72 -0
- package/lib/commonjs/i18n/strings/ru.js.map +1 -0
- package/lib/commonjs/i18n/strings/tr.js +72 -0
- package/lib/commonjs/i18n/strings/tr.js.map +1 -0
- package/lib/commonjs/i18n/strings/zh.js +72 -0
- package/lib/commonjs/i18n/strings/zh.js.map +1 -0
- package/lib/commonjs/index.js +31 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theme.js +136 -17
- package/lib/commonjs/theme.js.map +1 -1
- package/lib/commonjs/types.js +18 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/unread.js +92 -0
- package/lib/commonjs/unread.js.map +1 -0
- package/lib/commonjs/useSupportThreads.js +296 -0
- package/lib/commonjs/useSupportThreads.js.map +1 -0
- package/lib/commonjs/utils.js +58 -10
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/api.js +16 -2
- package/lib/module/api.js.map +1 -1
- package/lib/module/components/BottomSheet.js +68 -48
- package/lib/module/components/BottomSheet.js.map +1 -1
- package/lib/module/components/LauncherButton.js +172 -0
- package/lib/module/components/LauncherButton.js.map +1 -0
- package/lib/module/components/SupportButton.js +172 -194
- package/lib/module/components/SupportButton.js.map +1 -1
- package/lib/module/components/icons.js +107 -22
- package/lib/module/components/icons.js.map +1 -1
- package/lib/module/components/primitives.js +187 -45
- package/lib/module/components/primitives.js.map +1 -1
- package/lib/module/components/screens/ComposeScreen.js +114 -64
- package/lib/module/components/screens/ComposeScreen.js.map +1 -1
- package/lib/module/components/screens/HomeScreen.js +224 -121
- package/lib/module/components/screens/HomeScreen.js.map +1 -1
- package/lib/module/components/screens/LanguageScreen.js +147 -0
- package/lib/module/components/screens/LanguageScreen.js.map +1 -0
- package/lib/module/components/screens/ThreadScreen.js +243 -115
- package/lib/module/components/screens/ThreadScreen.js.map +1 -1
- package/lib/module/i18n/index.js +56 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/i18n/languages.js +88 -0
- package/lib/module/i18n/languages.js.map +1 -0
- package/lib/module/i18n/strings/de.js +68 -0
- package/lib/module/i18n/strings/de.js.map +1 -0
- package/lib/module/i18n/strings/en.js +84 -0
- package/lib/module/i18n/strings/en.js.map +1 -0
- package/lib/module/i18n/strings/es.js +68 -0
- package/lib/module/i18n/strings/es.js.map +1 -0
- package/lib/module/i18n/strings/fr.js +68 -0
- package/lib/module/i18n/strings/fr.js.map +1 -0
- package/lib/module/i18n/strings/hi.js +68 -0
- package/lib/module/i18n/strings/hi.js.map +1 -0
- package/lib/module/i18n/strings/it.js +68 -0
- package/lib/module/i18n/strings/it.js.map +1 -0
- package/lib/module/i18n/strings/ja.js +68 -0
- package/lib/module/i18n/strings/ja.js.map +1 -0
- package/lib/module/i18n/strings/ko.js +68 -0
- package/lib/module/i18n/strings/ko.js.map +1 -0
- package/lib/module/i18n/strings/nl.js +68 -0
- package/lib/module/i18n/strings/nl.js.map +1 -0
- package/lib/module/i18n/strings/pl.js +68 -0
- package/lib/module/i18n/strings/pl.js.map +1 -0
- package/lib/module/i18n/strings/pt.js +68 -0
- package/lib/module/i18n/strings/pt.js.map +1 -0
- package/lib/module/i18n/strings/ru.js +68 -0
- package/lib/module/i18n/strings/ru.js.map +1 -0
- package/lib/module/i18n/strings/tr.js +68 -0
- package/lib/module/i18n/strings/tr.js.map +1 -0
- package/lib/module/i18n/strings/zh.js +68 -0
- package/lib/module/i18n/strings/zh.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/theme.js +135 -16
- package/lib/module/theme.js.map +1 -1
- package/lib/module/types.js +18 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/unread.js +83 -0
- package/lib/module/unread.js.map +1 -0
- package/lib/module/useSupportThreads.js +291 -0
- package/lib/module/useSupportThreads.js.map +1 -0
- package/lib/module/utils.js +55 -10
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/api.d.ts +9 -0
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/LauncherButton.d.ts +14 -0
- package/lib/typescript/components/LauncherButton.d.ts.map +1 -0
- package/lib/typescript/components/SupportButton.d.ts +3 -3
- package/lib/typescript/components/SupportButton.d.ts.map +1 -1
- package/lib/typescript/components/icons.d.ts +18 -2
- package/lib/typescript/components/icons.d.ts.map +1 -1
- package/lib/typescript/components/primitives.d.ts +42 -7
- package/lib/typescript/components/primitives.d.ts.map +1 -1
- package/lib/typescript/components/screens/ComposeScreen.d.ts +3 -1
- package/lib/typescript/components/screens/ComposeScreen.d.ts.map +1 -1
- package/lib/typescript/components/screens/HomeScreen.d.ts +8 -2
- package/lib/typescript/components/screens/HomeScreen.d.ts.map +1 -1
- package/lib/typescript/components/screens/LanguageScreen.d.ts +30 -0
- package/lib/typescript/components/screens/LanguageScreen.d.ts.map +1 -0
- package/lib/typescript/components/screens/ThreadScreen.d.ts +3 -1
- package/lib/typescript/components/screens/ThreadScreen.d.ts.map +1 -1
- package/lib/typescript/i18n/index.d.ts +15 -0
- package/lib/typescript/i18n/index.d.ts.map +1 -0
- package/lib/typescript/i18n/languages.d.ts +36 -0
- package/lib/typescript/i18n/languages.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/de.d.ts +3 -0
- package/lib/typescript/i18n/strings/de.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/en.d.ts +83 -0
- package/lib/typescript/i18n/strings/en.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/es.d.ts +3 -0
- package/lib/typescript/i18n/strings/es.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/fr.d.ts +3 -0
- package/lib/typescript/i18n/strings/fr.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/hi.d.ts +3 -0
- package/lib/typescript/i18n/strings/hi.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/it.d.ts +3 -0
- package/lib/typescript/i18n/strings/it.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/ja.d.ts +3 -0
- package/lib/typescript/i18n/strings/ja.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/ko.d.ts +3 -0
- package/lib/typescript/i18n/strings/ko.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/nl.d.ts +3 -0
- package/lib/typescript/i18n/strings/nl.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/pl.d.ts +3 -0
- package/lib/typescript/i18n/strings/pl.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/pt.d.ts +3 -0
- package/lib/typescript/i18n/strings/pt.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/ru.d.ts +3 -0
- package/lib/typescript/i18n/strings/ru.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/tr.d.ts +3 -0
- package/lib/typescript/i18n/strings/tr.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/zh.d.ts +3 -0
- package/lib/typescript/i18n/strings/zh.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/theme.d.ts +44 -3
- package/lib/typescript/theme.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +54 -2
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/unread.d.ts +22 -0
- package/lib/typescript/unread.d.ts.map +1 -0
- package/lib/typescript/useSupportThreads.d.ts +38 -0
- package/lib/typescript/useSupportThreads.d.ts.map +1 -0
- package/lib/typescript/utils.d.ts +8 -2
- package/lib/typescript/utils.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/api.ts +24 -1
- package/src/components/BottomSheet.tsx +61 -43
- package/src/components/LauncherButton.tsx +217 -0
- package/src/components/SupportButton.tsx +195 -210
- package/src/components/icons.tsx +113 -19
- package/src/components/primitives.tsx +230 -39
- package/src/components/screens/ComposeScreen.tsx +129 -63
- package/src/components/screens/HomeScreen.tsx +230 -120
- package/src/components/screens/LanguageScreen.tsx +172 -0
- package/src/components/screens/ThreadScreen.tsx +319 -122
- package/src/i18n/index.ts +81 -0
- package/src/i18n/languages.ts +106 -0
- package/src/i18n/strings/de.ts +78 -0
- package/src/i18n/strings/en.ts +94 -0
- package/src/i18n/strings/es.ts +77 -0
- package/src/i18n/strings/fr.ts +78 -0
- package/src/i18n/strings/hi.ts +77 -0
- package/src/i18n/strings/it.ts +77 -0
- package/src/i18n/strings/ja.ts +77 -0
- package/src/i18n/strings/ko.ts +76 -0
- package/src/i18n/strings/nl.ts +77 -0
- package/src/i18n/strings/pl.ts +77 -0
- package/src/i18n/strings/pt.ts +77 -0
- package/src/i18n/strings/ru.ts +77 -0
- package/src/i18n/strings/tr.ts +77 -0
- package/src/i18n/strings/zh.ts +75 -0
- package/src/index.tsx +9 -0
- package/src/theme.ts +165 -18
- package/src/types.ts +56 -2
- package/src/unread.ts +91 -0
- package/src/useSupportThreads.ts +392 -0
- package/src/utils.ts +48 -10
|
@@ -1,13 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { KeyboardAvoidingView, Platform, Text, TextInput, View } from 'react-native';
|
|
5
|
-
import {
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { Animated, Easing, KeyboardAvoidingView, Platform, Text, TextInput, View } from 'react-native';
|
|
5
|
+
import { USER_MESSAGE_MAX, USER_MESSAGE_MIN } from '../../types';
|
|
6
6
|
import { CheckIcon, Chevron } from '../icons';
|
|
7
|
-
import {
|
|
7
|
+
import { IconButton, PrimaryButton, textStyles, TypeGlyph } from '../primitives';
|
|
8
|
+
|
|
9
|
+
/** Scales in once on success — the only celebratory motion in the SDK. */
|
|
8
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
function SentMark({
|
|
12
|
+
theme
|
|
13
|
+
}) {
|
|
14
|
+
const scale = useRef(new Animated.Value(0.6)).current;
|
|
15
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
Animated.parallel([Animated.timing(scale, {
|
|
18
|
+
toValue: 1,
|
|
19
|
+
duration: 320,
|
|
20
|
+
easing: Easing.bezier(0.16, 1, 0.3, 1),
|
|
21
|
+
useNativeDriver: true
|
|
22
|
+
}), Animated.timing(opacity, {
|
|
23
|
+
toValue: 1,
|
|
24
|
+
duration: 200,
|
|
25
|
+
easing: Easing.out(Easing.cubic),
|
|
26
|
+
useNativeDriver: true
|
|
27
|
+
})]).start();
|
|
28
|
+
}, [scale, opacity]);
|
|
29
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
30
|
+
style: {
|
|
31
|
+
width: 56,
|
|
32
|
+
height: 56,
|
|
33
|
+
borderRadius: 28,
|
|
34
|
+
backgroundColor: theme.colors.statusResolvedBg,
|
|
35
|
+
borderWidth: 1,
|
|
36
|
+
borderColor: theme.colors.statusResolved,
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
opacity,
|
|
40
|
+
transform: [{
|
|
41
|
+
scale
|
|
42
|
+
}]
|
|
43
|
+
},
|
|
44
|
+
children: /*#__PURE__*/_jsx(CheckIcon, {
|
|
45
|
+
color: theme.colors.statusResolved,
|
|
46
|
+
size: 20
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
9
50
|
export function ComposeScreen({
|
|
10
51
|
theme,
|
|
52
|
+
strings,
|
|
11
53
|
type,
|
|
12
54
|
onBack,
|
|
13
55
|
onSubmit
|
|
@@ -19,6 +61,7 @@ export function ComposeScreen({
|
|
|
19
61
|
const trimmed = message.trim();
|
|
20
62
|
const valid = trimmed.length >= USER_MESSAGE_MIN && trimmed.length <= USER_MESSAGE_MAX;
|
|
21
63
|
const overLimit = message.length > USER_MESSAGE_MAX;
|
|
64
|
+
const tooShort = trimmed.length > 0 && trimmed.length < USER_MESSAGE_MIN;
|
|
22
65
|
async function handleSubmit() {
|
|
23
66
|
if (!valid || submitting) return;
|
|
24
67
|
setSubmitting(true);
|
|
@@ -33,37 +76,26 @@ export function ComposeScreen({
|
|
|
33
76
|
flex: 1,
|
|
34
77
|
alignItems: 'center',
|
|
35
78
|
justifyContent: 'center',
|
|
36
|
-
gap:
|
|
37
|
-
|
|
79
|
+
gap: 14,
|
|
80
|
+
paddingHorizontal: 32,
|
|
81
|
+
paddingBottom: 40
|
|
38
82
|
},
|
|
39
|
-
children: [/*#__PURE__*/_jsx(
|
|
40
|
-
|
|
41
|
-
width: 40,
|
|
42
|
-
height: 40,
|
|
43
|
-
borderRadius: 20,
|
|
44
|
-
borderWidth: 1,
|
|
45
|
-
borderColor: theme.colors.statusResolved,
|
|
46
|
-
alignItems: 'center',
|
|
47
|
-
justifyContent: 'center'
|
|
48
|
-
},
|
|
49
|
-
children: /*#__PURE__*/_jsx(CheckIcon, {
|
|
50
|
-
color: theme.colors.statusResolved,
|
|
51
|
-
size: 14
|
|
52
|
-
})
|
|
83
|
+
children: [/*#__PURE__*/_jsx(SentMark, {
|
|
84
|
+
theme: theme
|
|
53
85
|
}), /*#__PURE__*/_jsx(Text, {
|
|
54
|
-
style: textStyles.
|
|
55
|
-
children:
|
|
86
|
+
style: textStyles.title(theme),
|
|
87
|
+
children: strings.t('compose.sent')
|
|
56
88
|
}), /*#__PURE__*/_jsx(Text, {
|
|
57
89
|
style: [textStyles.secondary(theme), {
|
|
58
90
|
textAlign: 'center'
|
|
59
91
|
}],
|
|
60
|
-
children:
|
|
92
|
+
children: strings.t('compose.sentHint')
|
|
61
93
|
}), /*#__PURE__*/_jsx(View, {
|
|
62
94
|
style: {
|
|
63
|
-
marginTop:
|
|
95
|
+
marginTop: 6
|
|
64
96
|
},
|
|
65
97
|
children: /*#__PURE__*/_jsx(PrimaryButton, {
|
|
66
|
-
label:
|
|
98
|
+
label: strings.t('compose.done'),
|
|
67
99
|
onPress: onBack,
|
|
68
100
|
theme: theme
|
|
69
101
|
})
|
|
@@ -79,26 +111,36 @@ export function ComposeScreen({
|
|
|
79
111
|
style: {
|
|
80
112
|
flexDirection: 'row',
|
|
81
113
|
alignItems: 'center',
|
|
82
|
-
gap:
|
|
114
|
+
gap: 10,
|
|
83
115
|
paddingHorizontal: 12,
|
|
84
|
-
paddingBottom:
|
|
116
|
+
paddingBottom: 14
|
|
85
117
|
},
|
|
86
|
-
children: [/*#__PURE__*/_jsx(
|
|
118
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
87
119
|
onPress: onBack,
|
|
88
120
|
theme: theme,
|
|
89
|
-
accessibilityLabel:
|
|
90
|
-
|
|
91
|
-
padding: 6,
|
|
92
|
-
borderRadius: theme.radii.control
|
|
93
|
-
},
|
|
121
|
+
accessibilityLabel: strings.t('compose.back'),
|
|
122
|
+
size: 32,
|
|
94
123
|
children: /*#__PURE__*/_jsx(Chevron, {
|
|
95
124
|
color: theme.colors.textSecondary,
|
|
96
125
|
direction: "left",
|
|
97
126
|
size: 12
|
|
98
127
|
})
|
|
99
|
-
}), /*#__PURE__*/_jsx(
|
|
100
|
-
|
|
101
|
-
|
|
128
|
+
}), /*#__PURE__*/_jsx(TypeGlyph, {
|
|
129
|
+
type: type,
|
|
130
|
+
theme: theme,
|
|
131
|
+
size: 32
|
|
132
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
133
|
+
style: {
|
|
134
|
+
flex: 1,
|
|
135
|
+
gap: 1
|
|
136
|
+
},
|
|
137
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
138
|
+
style: textStyles.heading(theme),
|
|
139
|
+
children: strings.t(`type.${type}`)
|
|
140
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
141
|
+
style: textStyles.meta(theme),
|
|
142
|
+
children: strings.t(`sub.${type}`)
|
|
143
|
+
})]
|
|
102
144
|
})]
|
|
103
145
|
}), /*#__PURE__*/_jsxs(View, {
|
|
104
146
|
style: {
|
|
@@ -113,53 +155,61 @@ export function ComposeScreen({
|
|
|
113
155
|
},
|
|
114
156
|
multiline: true,
|
|
115
157
|
autoFocus: true,
|
|
116
|
-
|
|
158
|
+
editable: !submitting,
|
|
159
|
+
placeholder: strings.t(`prompt.${type}`),
|
|
117
160
|
placeholderTextColor: theme.colors.textTertiary,
|
|
118
161
|
style: {
|
|
119
|
-
minHeight:
|
|
120
|
-
maxHeight:
|
|
162
|
+
minHeight: 140,
|
|
163
|
+
maxHeight: 240,
|
|
121
164
|
borderWidth: 1,
|
|
122
165
|
borderColor: theme.colors.border,
|
|
123
|
-
borderRadius: theme.radii.
|
|
166
|
+
borderRadius: theme.radii.card,
|
|
124
167
|
backgroundColor: theme.colors.surface,
|
|
125
168
|
color: theme.colors.textPrimary,
|
|
126
|
-
fontSize:
|
|
127
|
-
lineHeight:
|
|
128
|
-
padding:
|
|
169
|
+
fontSize: 15,
|
|
170
|
+
lineHeight: 21,
|
|
171
|
+
padding: 14,
|
|
129
172
|
textAlignVertical: 'top'
|
|
130
173
|
}
|
|
131
174
|
}), /*#__PURE__*/_jsxs(View, {
|
|
132
175
|
style: {
|
|
133
176
|
flexDirection: 'row',
|
|
134
177
|
alignItems: 'center',
|
|
135
|
-
|
|
136
|
-
|
|
178
|
+
gap: 10,
|
|
179
|
+
paddingTop: 10,
|
|
180
|
+
paddingHorizontal: 2,
|
|
181
|
+
minHeight: 20
|
|
137
182
|
},
|
|
138
|
-
children: [/*#__PURE__*/
|
|
139
|
-
style: [textStyles.meta(theme), overLimit && {
|
|
140
|
-
color: theme.colors.statusDanger
|
|
141
|
-
}],
|
|
142
|
-
children: [message.length, "/", USER_MESSAGE_MAX]
|
|
143
|
-
}), trimmed.length > 0 && trimmed.length < USER_MESSAGE_MIN && /*#__PURE__*/_jsxs(Text, {
|
|
144
|
-
style: textStyles.meta(theme),
|
|
145
|
-
children: ["At least ", USER_MESSAGE_MIN, " characters"]
|
|
146
|
-
}), failedMessage !== null && /*#__PURE__*/_jsx(Text, {
|
|
183
|
+
children: [failedMessage !== null ? /*#__PURE__*/_jsx(Text, {
|
|
147
184
|
style: {
|
|
148
|
-
fontSize:
|
|
185
|
+
fontSize: 12,
|
|
149
186
|
color: theme.colors.statusDanger
|
|
150
187
|
},
|
|
151
188
|
children: failedMessage
|
|
152
|
-
})
|
|
153
|
-
style:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
children: /*#__PURE__*/_jsx(PrimaryButton, {
|
|
157
|
-
label: submitting ? 'Sending…' : 'Send',
|
|
158
|
-
onPress: handleSubmit,
|
|
159
|
-
disabled: !valid || submitting,
|
|
160
|
-
theme: theme
|
|
189
|
+
}) : tooShort ? /*#__PURE__*/_jsx(Text, {
|
|
190
|
+
style: textStyles.meta(theme),
|
|
191
|
+
children: strings.t('compose.minChars', {
|
|
192
|
+
count: USER_MESSAGE_MIN
|
|
161
193
|
})
|
|
194
|
+
}) : null, /*#__PURE__*/_jsxs(Text, {
|
|
195
|
+
style: [textStyles.meta(theme), {
|
|
196
|
+
marginLeft: 'auto'
|
|
197
|
+
}, overLimit && {
|
|
198
|
+
color: theme.colors.statusDanger
|
|
199
|
+
}],
|
|
200
|
+
children: [message.length, "/", USER_MESSAGE_MAX]
|
|
162
201
|
})]
|
|
202
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
203
|
+
style: {
|
|
204
|
+
paddingTop: 12
|
|
205
|
+
},
|
|
206
|
+
children: /*#__PURE__*/_jsx(PrimaryButton, {
|
|
207
|
+
label: strings.t(submitting ? 'compose.sending' : 'compose.send'),
|
|
208
|
+
onPress: handleSubmit,
|
|
209
|
+
disabled: !valid || submitting,
|
|
210
|
+
theme: theme,
|
|
211
|
+
fullWidth: true
|
|
212
|
+
})
|
|
163
213
|
})]
|
|
164
214
|
})]
|
|
165
215
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","KeyboardAvoidingView","Platform","Text","TextInput","View","
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","Animated","Easing","KeyboardAvoidingView","Platform","Text","TextInput","View","USER_MESSAGE_MAX","USER_MESSAGE_MIN","CheckIcon","Chevron","IconButton","PrimaryButton","textStyles","TypeGlyph","jsx","_jsx","jsxs","_jsxs","SentMark","theme","scale","Value","current","opacity","parallel","timing","toValue","duration","easing","bezier","useNativeDriver","out","cubic","start","style","width","height","borderRadius","backgroundColor","colors","statusResolvedBg","borderWidth","borderColor","statusResolved","alignItems","justifyContent","transform","children","color","size","ComposeScreen","strings","type","onBack","onSubmit","message","setMessage","submitting","setSubmitting","failedMessage","setFailedMessage","sent","setSent","trimmed","trim","valid","length","overLimit","tooShort","handleSubmit","errorMessage","flex","gap","paddingHorizontal","paddingBottom","title","t","secondary","textAlign","marginTop","label","onPress","behavior","OS","undefined","flexDirection","accessibilityLabel","textSecondary","direction","heading","meta","value","onChangeText","v","multiline","autoFocus","editable","placeholder","placeholderTextColor","textTertiary","minHeight","maxHeight","border","radii","card","surface","textPrimary","fontSize","lineHeight","padding","textAlignVertical","paddingTop","statusDanger","count","marginLeft","disabled","fullWidth"],"sourceRoot":"../../../../src","sources":["components/screens/ComposeScreen.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SACEC,QAAQ,EACRC,MAAM,EACNC,oBAAoB,EACpBC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,IAAI,QACC,cAAc;AAIrB,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,aAAa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