react-native-my-survey-sdk 3.1.1 → 3.1.3
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/dist/components/XeboDropdownView.d.ts.map +1 -1
- package/dist/components/XeboDropdownView.js +10 -6
- package/dist/components/XeboIntroView.d.ts.map +1 -1
- package/dist/components/XeboIntroView.js +3 -2
- package/dist/components/XeboLanguageView.d.ts +11 -0
- package/dist/components/XeboLanguageView.d.ts.map +1 -0
- package/dist/components/XeboLanguageView.js +90 -0
- package/dist/components/XeboMultiNPSView.d.ts.map +1 -1
- package/dist/components/XeboMultiNPSView.js +9 -7
- package/dist/components/XeboMultiRatingView.d.ts.map +1 -1
- package/dist/components/XeboMultiRatingView.js +9 -7
- package/dist/components/XeboMultipleChoiceView.d.ts.map +1 -1
- package/dist/components/XeboMultipleChoiceView.js +10 -8
- package/dist/components/XeboNPSView.d.ts.map +1 -1
- package/dist/components/XeboNPSView.js +15 -13
- package/dist/components/XeboRatingView.d.ts.map +1 -1
- package/dist/components/XeboRatingView.js +10 -8
- package/dist/components/XeboSingleChoiceView.d.ts.map +1 -1
- package/dist/components/XeboSingleChoiceView.js +10 -8
- package/dist/components/XeboSurveyModal.d.ts.map +1 -1
- package/dist/components/XeboSurveyModal.js +96 -18
- package/dist/components/XeboTextBoxView.d.ts.map +1 -1
- package/dist/components/XeboTextBoxView.js +10 -7
- package/dist/components/XeboThankYouView.d.ts.map +1 -1
- package/dist/components/XeboThankYouView.js +3 -2
- package/dist/core/XeboLanguageService.d.ts +28 -0
- package/dist/core/XeboLanguageService.d.ts.map +1 -0
- package/dist/core/XeboLanguageService.js +261 -0
- package/dist/core/XeboNetworkService.d.ts +12 -2
- package/dist/core/XeboNetworkService.d.ts.map +1 -1
- package/dist/core/XeboNetworkService.js +27 -11
- package/dist/core/XeboSurveyManager.d.ts +22 -1
- package/dist/core/XeboSurveyManager.d.ts.map +1 -1
- package/dist/core/XeboSurveyManager.js +140 -39
- package/dist/i18n/XeboRtl.d.ts +11 -0
- package/dist/i18n/XeboRtl.d.ts.map +1 -0
- package/dist/i18n/XeboRtl.js +21 -0
- package/dist/i18n/XeboStrings.d.ts +29 -0
- package/dist/i18n/XeboStrings.d.ts.map +1 -0
- package/dist/i18n/XeboStrings.js +59 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/models/XeboAPIModels.d.ts +10 -1
- package/dist/models/XeboAPIModels.d.ts.map +1 -1
- package/dist/models/XeboLanguageModels.d.ts +62 -0
- package/dist/models/XeboLanguageModels.d.ts.map +1 -0
- package/dist/models/XeboLanguageModels.js +3 -0
- package/dist/models/XeboModels.d.ts +7 -0
- package/dist/models/XeboModels.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboDropdownView.d.ts","sourceRoot":"","sources":["../../src/components/XeboDropdownView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAc,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"XeboDropdownView.d.ts","sourceRoot":"","sources":["../../src/components/XeboDropdownView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAc,MAAM,sBAAsB,CAAC;AAK5E,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiH5C,CAAC"}
|
|
@@ -37,6 +37,8 @@ exports.XeboDropdownView = void 0;
|
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
38
|
const react_native_1 = require("react-native");
|
|
39
39
|
const XeboTheme_1 = require("../theme/XeboTheme");
|
|
40
|
+
const XeboStrings_1 = require("../i18n/XeboStrings");
|
|
41
|
+
const XeboRtl_1 = require("../i18n/XeboRtl");
|
|
40
42
|
const XeboDropdownView = ({ question, isLastQuestion, onAnswer }) => {
|
|
41
43
|
var _a;
|
|
42
44
|
const theme = (0, XeboTheme_1.getTheme)();
|
|
@@ -59,7 +61,7 @@ const XeboDropdownView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
59
61
|
};
|
|
60
62
|
const handleNext = () => {
|
|
61
63
|
if (question.isRequired && !selectedChoice) {
|
|
62
|
-
setError('Please select an option.');
|
|
64
|
+
setError((0, XeboStrings_1.requiredMessage)(question, 'Please select an option.'));
|
|
63
65
|
shake();
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
@@ -69,10 +71,10 @@ const XeboDropdownView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
69
71
|
});
|
|
70
72
|
};
|
|
71
73
|
return (<react_native_1.View style={styles.container}>
|
|
72
|
-
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
74
|
+
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
73
75
|
{question.title}
|
|
74
76
|
</react_native_1.Text>
|
|
75
|
-
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
77
|
+
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
76
78
|
{question.subtitle}
|
|
77
79
|
</react_native_1.Text>)}
|
|
78
80
|
|
|
@@ -81,6 +83,7 @@ const XeboDropdownView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
81
83
|
<react_native_1.Text style={[
|
|
82
84
|
styles.triggerText,
|
|
83
85
|
{ color: selectedChoice ? theme.textColor : '#9CA3AF', fontFamily: theme.fontFamily },
|
|
86
|
+
(0, XeboRtl_1.rtlText)(),
|
|
84
87
|
]}>
|
|
85
88
|
{selectedChoice ? selectedChoice.text : (question.placeholder || 'Select an option')}
|
|
86
89
|
</react_native_1.Text>
|
|
@@ -101,6 +104,7 @@ const XeboDropdownView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
101
104
|
fontFamily: theme.fontFamily,
|
|
102
105
|
fontWeight: (selectedChoice === null || selectedChoice === void 0 ? void 0 : selectedChoice.id) === choice.id ? '600' : '400',
|
|
103
106
|
},
|
|
107
|
+
(0, XeboRtl_1.rtlText)(),
|
|
104
108
|
]}>
|
|
105
109
|
{choice.text}
|
|
106
110
|
</react_native_1.Text>
|
|
@@ -108,7 +112,7 @@ const XeboDropdownView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
108
112
|
</react_native_1.ScrollView>
|
|
109
113
|
</react_native_1.View>)}
|
|
110
114
|
|
|
111
|
-
{!!error && <react_native_1.Text style={styles.errorText}>{error}</react_native_1.Text>}
|
|
115
|
+
{!!error && <react_native_1.Text style={[styles.errorText, (0, XeboRtl_1.rtlText)()]}>{error}</react_native_1.Text>}
|
|
112
116
|
|
|
113
117
|
<react_native_1.TouchableOpacity style={[
|
|
114
118
|
styles.button,
|
|
@@ -116,7 +120,7 @@ const XeboDropdownView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
116
120
|
(question.isRequired && !selectedChoice) && styles.buttonDisabled,
|
|
117
121
|
]} onPress={handleNext} activeOpacity={0.8}>
|
|
118
122
|
<react_native_1.Text style={[styles.buttonText, { fontFamily: theme.fontFamily }]}>
|
|
119
|
-
{isLastQuestion
|
|
123
|
+
{(0, XeboStrings_1.actionLabel)(isLastQuestion)}
|
|
120
124
|
</react_native_1.Text>
|
|
121
125
|
</react_native_1.TouchableOpacity>
|
|
122
126
|
</react_native_1.View>);
|
|
@@ -126,7 +130,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
126
130
|
container: {
|
|
127
131
|
paddingHorizontal: 20,
|
|
128
132
|
paddingTop: 16,
|
|
129
|
-
paddingBottom:
|
|
133
|
+
paddingBottom: 10,
|
|
130
134
|
},
|
|
131
135
|
title: {
|
|
132
136
|
fontSize: 18,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboIntroView.d.ts","sourceRoot":"","sources":["../../src/components/XeboIntroView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"XeboIntroView.d.ts","sourceRoot":"","sources":["../../src/components/XeboIntroView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,UAAU,KAAK;IACb,SAAS,EAAE,cAAc,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA4BzC,CAAC"}
|
|
@@ -7,11 +7,12 @@ exports.XeboIntroView = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const react_native_1 = require("react-native");
|
|
9
9
|
const XeboTheme_1 = require("../theme/XeboTheme");
|
|
10
|
+
const XeboRtl_1 = require("../i18n/XeboRtl");
|
|
10
11
|
const XeboIntroView = ({ introPage, onStart }) => {
|
|
11
12
|
const theme = (0, XeboTheme_1.getTheme)();
|
|
12
13
|
return (<react_native_1.View style={styles.outer}>
|
|
13
14
|
{!!introPage.content && (<react_native_1.ScrollView style={styles.scroll} showsVerticalScrollIndicator={false} contentContainerStyle={styles.scrollContent}>
|
|
14
|
-
<react_native_1.Text style={[styles.content, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
15
|
+
<react_native_1.Text style={[styles.content, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
15
16
|
{introPage.content}
|
|
16
17
|
</react_native_1.Text>
|
|
17
18
|
</react_native_1.ScrollView>)}
|
|
@@ -28,7 +29,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
28
29
|
outer: {
|
|
29
30
|
paddingHorizontal: 20,
|
|
30
31
|
paddingTop: 8,
|
|
31
|
-
paddingBottom:
|
|
32
|
+
paddingBottom: 10,
|
|
32
33
|
},
|
|
33
34
|
scroll: {
|
|
34
35
|
maxHeight: 220,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { XeboLanguagePageModel } from '../models/XeboLanguageModels';
|
|
3
|
+
interface Props {
|
|
4
|
+
page: XeboLanguagePageModel;
|
|
5
|
+
selectedLangKey: string | null;
|
|
6
|
+
busy: boolean;
|
|
7
|
+
onSelect: (langKey: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const XeboLanguageView: React.FC<Props>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=XeboLanguageView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XeboLanguageView.d.ts","sourceRoot":"","sources":["../../src/components/XeboLanguageView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,UAAU,KAAK;IACb,IAAI,EAAE,qBAAqB,CAAC;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAGD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+D5C,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.XeboLanguageView = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const XeboTheme_1 = require("../theme/XeboTheme");
|
|
10
|
+
// Skip lives in the modal header, so this page only renders the language choices.
|
|
11
|
+
const XeboLanguageView = ({ page, selectedLangKey, busy, onSelect, }) => {
|
|
12
|
+
const theme = (0, XeboTheme_1.getTheme)();
|
|
13
|
+
return (<react_native_1.View style={styles.container}>
|
|
14
|
+
<react_native_1.ScrollView style={styles.prompts} showsVerticalScrollIndicator={false}>
|
|
15
|
+
{page.prompts.map(prompt => (<react_native_1.Text key={`${prompt.langKey}-${prompt.text}`} style={[
|
|
16
|
+
styles.prompt,
|
|
17
|
+
{ color: theme.textColor, fontFamily: theme.fontFamily },
|
|
18
|
+
prompt.direction === 'rtl' && styles.promptRtl,
|
|
19
|
+
]}>
|
|
20
|
+
{prompt.text}
|
|
21
|
+
</react_native_1.Text>))}
|
|
22
|
+
</react_native_1.ScrollView>
|
|
23
|
+
|
|
24
|
+
<react_native_1.View style={styles.buttons}>
|
|
25
|
+
{page.options.map(option => {
|
|
26
|
+
const selected = selectedLangKey === option.langKey;
|
|
27
|
+
const dimmed = busy && !selected;
|
|
28
|
+
return (<react_native_1.TouchableOpacity key={option.langKey} style={[
|
|
29
|
+
styles.button,
|
|
30
|
+
{
|
|
31
|
+
backgroundColor: selected ? theme.primaryColor : 'transparent',
|
|
32
|
+
borderColor: selected ? theme.primaryColor : '#E5E7EB',
|
|
33
|
+
borderRadius: theme.cornerRadius,
|
|
34
|
+
opacity: dimmed ? 0.4 : 1,
|
|
35
|
+
},
|
|
36
|
+
]} onPress={() => onSelect(option.langKey)} disabled={busy} activeOpacity={0.8}>
|
|
37
|
+
<react_native_1.Text style={[
|
|
38
|
+
styles.buttonText,
|
|
39
|
+
{
|
|
40
|
+
color: selected ? '#FFFFFF' : theme.textColor,
|
|
41
|
+
fontFamily: theme.fontFamily,
|
|
42
|
+
},
|
|
43
|
+
option.direction === 'rtl' && styles.buttonTextRtl,
|
|
44
|
+
]}>
|
|
45
|
+
{option.nativeText || option.name}
|
|
46
|
+
</react_native_1.Text>
|
|
47
|
+
</react_native_1.TouchableOpacity>);
|
|
48
|
+
})}
|
|
49
|
+
</react_native_1.View>
|
|
50
|
+
</react_native_1.View>);
|
|
51
|
+
};
|
|
52
|
+
exports.XeboLanguageView = XeboLanguageView;
|
|
53
|
+
const styles = react_native_1.StyleSheet.create({
|
|
54
|
+
container: {
|
|
55
|
+
flex: 1,
|
|
56
|
+
paddingHorizontal: 20,
|
|
57
|
+
paddingTop: 8,
|
|
58
|
+
paddingBottom: 8,
|
|
59
|
+
},
|
|
60
|
+
prompts: {
|
|
61
|
+
flexGrow: 0,
|
|
62
|
+
marginBottom: 16,
|
|
63
|
+
},
|
|
64
|
+
prompt: {
|
|
65
|
+
fontSize: 16,
|
|
66
|
+
fontWeight: '600',
|
|
67
|
+
lineHeight: 24,
|
|
68
|
+
marginBottom: 6,
|
|
69
|
+
},
|
|
70
|
+
promptRtl: {
|
|
71
|
+
textAlign: 'right',
|
|
72
|
+
writingDirection: 'rtl',
|
|
73
|
+
},
|
|
74
|
+
buttons: {
|
|
75
|
+
flexShrink: 1,
|
|
76
|
+
},
|
|
77
|
+
button: {
|
|
78
|
+
borderWidth: 1.5,
|
|
79
|
+
paddingVertical: 14,
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
marginBottom: 10,
|
|
82
|
+
},
|
|
83
|
+
buttonText: {
|
|
84
|
+
fontSize: 16,
|
|
85
|
+
fontWeight: '600',
|
|
86
|
+
},
|
|
87
|
+
buttonTextRtl: {
|
|
88
|
+
writingDirection: 'rtl',
|
|
89
|
+
},
|
|
90
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboMultiNPSView.d.ts","sourceRoot":"","sources":["../../src/components/XeboMultiNPSView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"XeboMultiNPSView.d.ts","sourceRoot":"","sources":["../../src/components/XeboMultiNPSView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKhE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAqBD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAwG5C,CAAC"}
|
|
@@ -37,6 +37,8 @@ exports.XeboMultiNPSView = void 0;
|
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
38
|
const react_native_1 = require("react-native");
|
|
39
39
|
const XeboTheme_1 = require("../theme/XeboTheme");
|
|
40
|
+
const XeboStrings_1 = require("../i18n/XeboStrings");
|
|
41
|
+
const XeboRtl_1 = require("../i18n/XeboRtl");
|
|
40
42
|
const DETRACTOR_COLOR = '#F24236';
|
|
41
43
|
const PASSIVE_COLOR = '#FFC208';
|
|
42
44
|
const PROMOTER_COLOR = '#2ECC70';
|
|
@@ -78,7 +80,7 @@ const XeboMultiNPSView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
78
80
|
};
|
|
79
81
|
const handleNext = () => {
|
|
80
82
|
if (question.isRequired && rows.some(r => scores[r.id] === undefined)) {
|
|
81
|
-
setError('Please rate all items.');
|
|
83
|
+
setError((0, XeboStrings_1.requiredMessage)(question, 'Please rate all items.'));
|
|
82
84
|
shake();
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
@@ -96,16 +98,16 @@ const XeboMultiNPSView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
96
98
|
});
|
|
97
99
|
};
|
|
98
100
|
return (<react_native_1.View style={styles.container}>
|
|
99
|
-
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
101
|
+
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
100
102
|
{question.title}
|
|
101
103
|
</react_native_1.Text>
|
|
102
|
-
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
104
|
+
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
103
105
|
{question.subtitle}
|
|
104
106
|
</react_native_1.Text>)}
|
|
105
107
|
|
|
106
108
|
<react_native_1.ScrollView style={styles.scroll} showsVerticalScrollIndicator={false}>
|
|
107
109
|
{rows.map(row => (<react_native_1.View key={row.id} style={styles.rowWrap}>
|
|
108
|
-
<react_native_1.Text style={[styles.rowLabel, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
110
|
+
<react_native_1.Text style={[styles.rowLabel, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
109
111
|
{row.text}
|
|
110
112
|
</react_native_1.Text>
|
|
111
113
|
{/* Single-row NPS scale with always-visible category colors */}
|
|
@@ -133,12 +135,12 @@ const XeboMultiNPSView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
133
135
|
</react_native_1.View>))}
|
|
134
136
|
</react_native_1.ScrollView>
|
|
135
137
|
|
|
136
|
-
{!!error && <react_native_1.Text style={styles.errorText}>{error}</react_native_1.Text>}
|
|
138
|
+
{!!error && <react_native_1.Text style={[styles.errorText, (0, XeboRtl_1.rtlText)()]}>{error}</react_native_1.Text>}
|
|
137
139
|
|
|
138
140
|
<react_native_1.Animated.View style={{ transform: [{ translateX: shakeAnim }] }}>
|
|
139
141
|
<react_native_1.TouchableOpacity style={[styles.button, { backgroundColor: theme.primaryColor, borderRadius: theme.cornerRadius }]} onPress={handleNext} activeOpacity={0.8}>
|
|
140
142
|
<react_native_1.Text style={[styles.buttonText, { fontFamily: theme.fontFamily }]}>
|
|
141
|
-
{isLastQuestion
|
|
143
|
+
{(0, XeboStrings_1.actionLabel)(isLastQuestion)}
|
|
142
144
|
</react_native_1.Text>
|
|
143
145
|
</react_native_1.TouchableOpacity>
|
|
144
146
|
</react_native_1.Animated.View>
|
|
@@ -146,7 +148,7 @@ const XeboMultiNPSView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
146
148
|
};
|
|
147
149
|
exports.XeboMultiNPSView = XeboMultiNPSView;
|
|
148
150
|
const styles = react_native_1.StyleSheet.create({
|
|
149
|
-
container: { flex: 1, paddingHorizontal: 20, paddingTop: 16, paddingBottom:
|
|
151
|
+
container: { flex: 1, paddingHorizontal: 20, paddingTop: 16, paddingBottom: 10 },
|
|
150
152
|
title: { fontSize: 18, fontWeight: '700', marginBottom: 6 },
|
|
151
153
|
subtitle: { fontSize: 14, opacity: 0.6, marginBottom: 16 },
|
|
152
154
|
scroll: { flex: 1, minHeight: 0, marginBottom: 12 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboMultiRatingView.d.ts","sourceRoot":"","sources":["../../src/components/XeboMultiRatingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"XeboMultiRatingView.d.ts","sourceRoot":"","sources":["../../src/components/XeboMultiRatingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKhE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA2H/C,CAAC"}
|
|
@@ -37,6 +37,8 @@ exports.XeboMultiRatingView = void 0;
|
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
38
|
const react_native_1 = require("react-native");
|
|
39
39
|
const XeboTheme_1 = require("../theme/XeboTheme");
|
|
40
|
+
const XeboStrings_1 = require("../i18n/XeboStrings");
|
|
41
|
+
const XeboRtl_1 = require("../i18n/XeboRtl");
|
|
40
42
|
const XeboMultiRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
41
43
|
var _a, _b, _c, _d, _e;
|
|
42
44
|
const theme = (0, XeboTheme_1.getTheme)();
|
|
@@ -62,7 +64,7 @@ const XeboMultiRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
62
64
|
const isCumulative = ratingStyle === 'star' || ratingStyle === 'heart';
|
|
63
65
|
const handleNext = () => {
|
|
64
66
|
if (question.isRequired && rows.some(r => ratings[r.id] === undefined)) {
|
|
65
|
-
setError('Please rate all items.');
|
|
67
|
+
setError((0, XeboStrings_1.requiredMessage)(question, 'Please rate all items.'));
|
|
66
68
|
shake();
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
@@ -81,16 +83,16 @@ const XeboMultiRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
81
83
|
};
|
|
82
84
|
const starIcon = (filled) => ratingStyle === 'heart' ? (filled ? '♥' : '♡') : filled ? '★' : '☆';
|
|
83
85
|
return (<react_native_1.View style={styles.container}>
|
|
84
|
-
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
86
|
+
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
85
87
|
{question.title}
|
|
86
88
|
</react_native_1.Text>
|
|
87
|
-
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
89
|
+
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
88
90
|
{question.subtitle}
|
|
89
91
|
</react_native_1.Text>)}
|
|
90
92
|
|
|
91
93
|
<react_native_1.ScrollView style={styles.scroll} showsVerticalScrollIndicator={false}>
|
|
92
94
|
{rows.map(row => (<react_native_1.View key={row.id} style={styles.rowWrap}>
|
|
93
|
-
<react_native_1.Text style={[styles.rowLabel, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
95
|
+
<react_native_1.Text style={[styles.rowLabel, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
94
96
|
{row.text}
|
|
95
97
|
</react_native_1.Text>
|
|
96
98
|
<react_native_1.View style={styles.iconsRow}>
|
|
@@ -118,12 +120,12 @@ const XeboMultiRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
118
120
|
</react_native_1.View>))}
|
|
119
121
|
</react_native_1.ScrollView>
|
|
120
122
|
|
|
121
|
-
{!!error && <react_native_1.Text style={styles.errorText}>{error}</react_native_1.Text>}
|
|
123
|
+
{!!error && <react_native_1.Text style={[styles.errorText, (0, XeboRtl_1.rtlText)()]}>{error}</react_native_1.Text>}
|
|
122
124
|
|
|
123
125
|
<react_native_1.Animated.View style={{ transform: [{ translateX: shakeAnim }] }}>
|
|
124
126
|
<react_native_1.TouchableOpacity style={[styles.button, { backgroundColor: theme.primaryColor, borderRadius: theme.cornerRadius }]} onPress={handleNext} activeOpacity={0.8}>
|
|
125
127
|
<react_native_1.Text style={[styles.buttonText, { fontFamily: theme.fontFamily }]}>
|
|
126
|
-
{isLastQuestion
|
|
128
|
+
{(0, XeboStrings_1.actionLabel)(isLastQuestion)}
|
|
127
129
|
</react_native_1.Text>
|
|
128
130
|
</react_native_1.TouchableOpacity>
|
|
129
131
|
</react_native_1.Animated.View>
|
|
@@ -131,7 +133,7 @@ const XeboMultiRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
131
133
|
};
|
|
132
134
|
exports.XeboMultiRatingView = XeboMultiRatingView;
|
|
133
135
|
const styles = react_native_1.StyleSheet.create({
|
|
134
|
-
container: { paddingHorizontal: 20, paddingTop: 16, paddingBottom:
|
|
136
|
+
container: { paddingHorizontal: 20, paddingTop: 16, paddingBottom: 10 },
|
|
135
137
|
title: { fontSize: 18, fontWeight: '700', marginBottom: 16 },
|
|
136
138
|
subtitle: { fontSize: 14, opacity: 0.6, marginBottom: 16 },
|
|
137
139
|
scroll: { maxHeight: 280, marginBottom: 12 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboMultipleChoiceView.d.ts","sourceRoot":"","sources":["../../src/components/XeboMultipleChoiceView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAc,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"XeboMultipleChoiceView.d.ts","sourceRoot":"","sources":["../../src/components/XeboMultipleChoiceView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAc,MAAM,sBAAsB,CAAC;AAK5E,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAqGlD,CAAC"}
|
|
@@ -37,6 +37,8 @@ exports.XeboMultipleChoiceView = void 0;
|
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
38
|
const react_native_1 = require("react-native");
|
|
39
39
|
const XeboTheme_1 = require("../theme/XeboTheme");
|
|
40
|
+
const XeboStrings_1 = require("../i18n/XeboStrings");
|
|
41
|
+
const XeboRtl_1 = require("../i18n/XeboRtl");
|
|
40
42
|
const XeboMultipleChoiceView = ({ question, isLastQuestion, onAnswer }) => {
|
|
41
43
|
var _a;
|
|
42
44
|
const theme = (0, XeboTheme_1.getTheme)();
|
|
@@ -66,7 +68,7 @@ const XeboMultipleChoiceView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
66
68
|
};
|
|
67
69
|
const handleNext = () => {
|
|
68
70
|
if (question.isRequired && selectedIds.size === 0) {
|
|
69
|
-
setError('Please select at least one option.');
|
|
71
|
+
setError((0, XeboStrings_1.requiredMessage)(question, 'Please select at least one option.'));
|
|
70
72
|
shake();
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
@@ -82,10 +84,10 @@ const XeboMultipleChoiceView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
82
84
|
});
|
|
83
85
|
};
|
|
84
86
|
return (<react_native_1.View style={styles.container}>
|
|
85
|
-
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
87
|
+
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
86
88
|
{question.title}
|
|
87
89
|
</react_native_1.Text>
|
|
88
|
-
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
90
|
+
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
89
91
|
{question.subtitle}
|
|
90
92
|
</react_native_1.Text>)}
|
|
91
93
|
|
|
@@ -105,19 +107,19 @@ const XeboMultipleChoiceView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
105
107
|
]}>
|
|
106
108
|
{selected && <react_native_1.Text style={styles.checkmark}>✓</react_native_1.Text>}
|
|
107
109
|
</react_native_1.View>
|
|
108
|
-
<react_native_1.Text style={[styles.optionText, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
110
|
+
<react_native_1.Text style={[styles.optionText, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
109
111
|
{choice.text}
|
|
110
112
|
</react_native_1.Text>
|
|
111
113
|
</react_native_1.TouchableOpacity>);
|
|
112
114
|
})}
|
|
113
115
|
</react_native_1.ScrollView>
|
|
114
116
|
|
|
115
|
-
{!!error && <react_native_1.Text style={styles.errorText}>{error}</react_native_1.Text>}
|
|
117
|
+
{!!error && <react_native_1.Text style={[styles.errorText, (0, XeboRtl_1.rtlText)()]}>{error}</react_native_1.Text>}
|
|
116
118
|
|
|
117
119
|
<react_native_1.Animated.View style={{ transform: [{ translateX: shakeAnim }] }}>
|
|
118
120
|
<react_native_1.TouchableOpacity style={[styles.button, { backgroundColor: theme.primaryColor, borderRadius: theme.cornerRadius }]} onPress={handleNext} activeOpacity={0.8}>
|
|
119
121
|
<react_native_1.Text style={[styles.buttonText, { fontFamily: theme.fontFamily }]}>
|
|
120
|
-
{isLastQuestion
|
|
122
|
+
{(0, XeboStrings_1.actionLabel)(isLastQuestion)}
|
|
121
123
|
</react_native_1.Text>
|
|
122
124
|
</react_native_1.TouchableOpacity>
|
|
123
125
|
</react_native_1.Animated.View>
|
|
@@ -129,7 +131,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
129
131
|
flex: 1,
|
|
130
132
|
paddingHorizontal: 20,
|
|
131
133
|
paddingTop: 16,
|
|
132
|
-
paddingBottom:
|
|
134
|
+
paddingBottom: 10,
|
|
133
135
|
},
|
|
134
136
|
title: {
|
|
135
137
|
fontSize: 18,
|
|
@@ -160,7 +162,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
160
162
|
borderWidth: 2,
|
|
161
163
|
alignItems: 'center',
|
|
162
164
|
justifyContent: 'center',
|
|
163
|
-
|
|
165
|
+
marginEnd: 12,
|
|
164
166
|
},
|
|
165
167
|
checkmark: {
|
|
166
168
|
color: '#FFFFFF',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboNPSView.d.ts","sourceRoot":"","sources":["../../src/components/XeboNPSView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,UAAU,EAA6C,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"XeboNPSView.d.ts","sourceRoot":"","sources":["../../src/components/XeboNPSView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,UAAU,EAA6C,MAAM,sBAAsB,CAAC;AAK3G,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,EAAE,KAAK,IAAI,CAAC;CACvD;AAuBD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAsNvC,CAAC"}
|
|
@@ -38,6 +38,8 @@ const react_1 = __importStar(require("react"));
|
|
|
38
38
|
const react_native_1 = require("react-native");
|
|
39
39
|
const XeboModels_1 = require("../models/XeboModels");
|
|
40
40
|
const XeboTheme_1 = require("../theme/XeboTheme");
|
|
41
|
+
const XeboStrings_1 = require("../i18n/XeboStrings");
|
|
42
|
+
const XeboRtl_1 = require("../i18n/XeboRtl");
|
|
41
43
|
// NPS zone colors — matches iOS SDK defaults
|
|
42
44
|
const DETRACTOR_COLOR = '#F24236';
|
|
43
45
|
const PASSIVE_COLOR = '#FFC208';
|
|
@@ -94,7 +96,7 @@ const XeboNPSView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
94
96
|
const handleNext = () => {
|
|
95
97
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
96
98
|
if (question.isRequired && selectedScore === null) {
|
|
97
|
-
setError('Please select a score.');
|
|
99
|
+
setError((0, XeboStrings_1.requiredMessage)(question, 'Please select a score.'));
|
|
98
100
|
shake();
|
|
99
101
|
return;
|
|
100
102
|
}
|
|
@@ -133,10 +135,10 @@ const XeboNPSView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
133
135
|
// Outer view fills modal content area; button pinned at bottom outside ScrollView
|
|
134
136
|
<react_native_1.View style={styles.outer}>
|
|
135
137
|
<react_native_1.ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent} showsVerticalScrollIndicator={false} keyboardShouldPersistTaps="handled">
|
|
136
|
-
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
138
|
+
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
137
139
|
{question.title}
|
|
138
140
|
</react_native_1.Text>
|
|
139
|
-
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
141
|
+
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
140
142
|
{question.subtitle}
|
|
141
143
|
</react_native_1.Text>)}
|
|
142
144
|
|
|
@@ -167,42 +169,42 @@ const XeboNPSView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
167
169
|
|
|
168
170
|
{/* Lower / Upper labels */}
|
|
169
171
|
{(((_b = question.npsLabels) === null || _b === void 0 ? void 0 : _b.lower) || ((_c = question.npsLabels) === null || _c === void 0 ? void 0 : _c.upper)) && (<react_native_1.View style={styles.labelsRow}>
|
|
170
|
-
<react_native_1.Text style={[styles.label, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
172
|
+
<react_native_1.Text style={[styles.label, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
171
173
|
{(_e = (_d = question.npsLabels) === null || _d === void 0 ? void 0 : _d.lower) !== null && _e !== void 0 ? _e : ''}
|
|
172
174
|
</react_native_1.Text>
|
|
173
|
-
<react_native_1.Text style={[styles.label, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
175
|
+
<react_native_1.Text style={[styles.label, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
174
176
|
{(_g = (_f = question.npsLabels) === null || _f === void 0 ? void 0 : _f.upper) !== null && _g !== void 0 ? _g : ''}
|
|
175
177
|
</react_native_1.Text>
|
|
176
178
|
</react_native_1.View>)}
|
|
177
179
|
|
|
178
180
|
{/* Conditional follow-up (NPS Pro) */}
|
|
179
181
|
{selectedScore !== null && activeFollowUp && (<react_native_1.View style={[styles.followUpCard, { borderColor: '#E5E7EB', borderRadius: theme.cornerRadius }]}>
|
|
180
|
-
<react_native_1.Text style={[styles.followUpTitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
182
|
+
<react_native_1.Text style={[styles.followUpTitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
181
183
|
{activeFollowUp.followUpQuestion}
|
|
182
184
|
</react_native_1.Text>
|
|
183
185
|
{activeFollowUp.followUpType === XeboModels_1.XeboQuestionType.singleChoice && activeFollowUp.followUpOptions.length > 0 ? (activeFollowUp.followUpOptions.map(opt => (<react_native_1.TouchableOpacity key={opt.id} style={[
|
|
184
186
|
styles.followUpOption,
|
|
185
187
|
followUpChoice === opt.id && { borderColor: theme.primaryColor },
|
|
186
188
|
]} onPress={() => setFollowUpChoice(opt.id)} activeOpacity={0.7}>
|
|
187
|
-
<react_native_1.Text style={[styles.followUpOptionText, { color: theme.textColor }]}>{opt.text}</react_native_1.Text>
|
|
188
|
-
</react_native_1.TouchableOpacity>))) : (<react_native_1.TextInput style={[styles.followUpInput, { borderColor: '#E5E7EB', color: theme.textColor, borderRadius: theme.cornerRadius }]} placeholder="Your comment..." placeholderTextColor="#9CA3AF" value={followUpText} onChangeText={setFollowUpText} multiline numberOfLines={3} textAlignVertical="top"/>)}
|
|
189
|
+
<react_native_1.Text style={[styles.followUpOptionText, { color: theme.textColor }, (0, XeboRtl_1.rtlText)()]}>{opt.text}</react_native_1.Text>
|
|
190
|
+
</react_native_1.TouchableOpacity>))) : (<react_native_1.TextInput style={[styles.followUpInput, { borderColor: '#E5E7EB', color: theme.textColor, borderRadius: theme.cornerRadius }, (0, XeboRtl_1.rtlText)()]} placeholder="Your comment..." placeholderTextColor="#9CA3AF" value={followUpText} onChangeText={setFollowUpText} multiline numberOfLines={3} textAlignVertical="top"/>)}
|
|
189
191
|
</react_native_1.View>)}
|
|
190
192
|
|
|
191
193
|
{/* Simple text follow-up */}
|
|
192
194
|
{selectedScore !== null && hasTextFollowUp && (<react_native_1.View style={[styles.followUpCard, { borderColor: '#E5E7EB', borderRadius: theme.cornerRadius }]}>
|
|
193
|
-
<react_native_1.Text style={[styles.followUpTitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
195
|
+
<react_native_1.Text style={[styles.followUpTitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
194
196
|
{question.followUpQuestion}
|
|
195
197
|
</react_native_1.Text>
|
|
196
|
-
<react_native_1.TextInput style={[styles.followUpInput, { borderColor: '#E5E7EB', color: theme.textColor, borderRadius: theme.cornerRadius }]} placeholder="Your comment..." placeholderTextColor="#9CA3AF" value={followUpText} onChangeText={setFollowUpText} multiline numberOfLines={3} textAlignVertical="top"/>
|
|
198
|
+
<react_native_1.TextInput style={[styles.followUpInput, { borderColor: '#E5E7EB', color: theme.textColor, borderRadius: theme.cornerRadius }, (0, XeboRtl_1.rtlText)()]} placeholder="Your comment..." placeholderTextColor="#9CA3AF" value={followUpText} onChangeText={setFollowUpText} multiline numberOfLines={3} textAlignVertical="top"/>
|
|
197
199
|
</react_native_1.View>)}
|
|
198
200
|
</react_native_1.ScrollView>
|
|
199
201
|
|
|
200
202
|
{/* Error + button always visible at bottom, outside scroll */}
|
|
201
|
-
{!!error && <react_native_1.Text style={styles.errorText}>{error}</react_native_1.Text>}
|
|
203
|
+
{!!error && <react_native_1.Text style={[styles.errorText, (0, XeboRtl_1.rtlText)()]}>{error}</react_native_1.Text>}
|
|
202
204
|
<react_native_1.Animated.View style={{ transform: [{ translateX: shakeAnim }] }}>
|
|
203
205
|
<react_native_1.TouchableOpacity style={[styles.button, { backgroundColor: theme.primaryColor, borderRadius: theme.cornerRadius, opacity: selectedScore === null ? 0.4 : 1 }]} onPress={handleNext} disabled={selectedScore === null} activeOpacity={0.8}>
|
|
204
206
|
<react_native_1.Text style={[styles.buttonText, { fontFamily: theme.fontFamily }]}>
|
|
205
|
-
{isLastQuestion
|
|
207
|
+
{(0, XeboStrings_1.actionLabel)(isLastQuestion)}
|
|
206
208
|
</react_native_1.Text>
|
|
207
209
|
</react_native_1.TouchableOpacity>
|
|
208
210
|
</react_native_1.Animated.View>
|
|
@@ -213,7 +215,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
213
215
|
outer: {
|
|
214
216
|
flex: 1,
|
|
215
217
|
paddingHorizontal: 20,
|
|
216
|
-
paddingBottom:
|
|
218
|
+
paddingBottom: 10,
|
|
217
219
|
},
|
|
218
220
|
scroll: { flex: 1, minHeight: 0 },
|
|
219
221
|
scrollContent: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboRatingView.d.ts","sourceRoot":"","sources":["../../src/components/XeboRatingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"XeboRatingView.d.ts","sourceRoot":"","sources":["../../src/components/XeboRatingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKhE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AA6ID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgJ1C,CAAC"}
|
|
@@ -37,6 +37,8 @@ exports.XeboRatingView = void 0;
|
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
38
|
const react_native_1 = require("react-native");
|
|
39
39
|
const XeboTheme_1 = require("../theme/XeboTheme");
|
|
40
|
+
const XeboStrings_1 = require("../i18n/XeboStrings");
|
|
41
|
+
const XeboRtl_1 = require("../i18n/XeboRtl");
|
|
40
42
|
// ─── Icon renderers per style ─────────────────────────────────────────────────
|
|
41
43
|
const FLAT_EMOJI_CONFIGS = [
|
|
42
44
|
{ bg: '#E63946', mouth: 'frown' },
|
|
@@ -164,7 +166,7 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
164
166
|
const handleNext = () => {
|
|
165
167
|
var _a, _b, _c, _d, _e, _f;
|
|
166
168
|
if (question.isRequired && selected === null) {
|
|
167
|
-
setError('Please select a rating.');
|
|
169
|
+
setError((0, XeboStrings_1.requiredMessage)(question, 'Please select a rating.'));
|
|
168
170
|
shake();
|
|
169
171
|
return;
|
|
170
172
|
}
|
|
@@ -181,10 +183,10 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
181
183
|
// Outer view fills modal content area; button pinned at bottom outside ScrollView
|
|
182
184
|
<react_native_1.View style={styles.outer}>
|
|
183
185
|
<react_native_1.ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent} showsVerticalScrollIndicator={false} keyboardShouldPersistTaps="handled">
|
|
184
|
-
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
186
|
+
<react_native_1.Text style={[styles.title, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
185
187
|
{question.title}
|
|
186
188
|
</react_native_1.Text>
|
|
187
|
-
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
189
|
+
{!!question.subtitle && (<react_native_1.Text style={[styles.subtitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
188
190
|
{question.subtitle}
|
|
189
191
|
</react_native_1.Text>)}
|
|
190
192
|
|
|
@@ -213,19 +215,19 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
213
215
|
|
|
214
216
|
{/* Follow-up after rating */}
|
|
215
217
|
{selected !== null && !!question.followUpQuestion && (<react_native_1.View style={[styles.followUpCard, { borderRadius: theme.cornerRadius }]}>
|
|
216
|
-
<react_native_1.Text style={[styles.followUpTitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
218
|
+
<react_native_1.Text style={[styles.followUpTitle, { color: theme.textColor, fontFamily: theme.fontFamily }, (0, XeboRtl_1.rtlText)()]}>
|
|
217
219
|
{question.followUpQuestion}
|
|
218
220
|
</react_native_1.Text>
|
|
219
|
-
<react_native_1.TextInput style={[styles.followUpInput, { borderColor: '#E5E7EB', color: theme.textColor, borderRadius: theme.cornerRadius }]} placeholder="Your comment..." placeholderTextColor="#9CA3AF" value={followUpText} onChangeText={setFollowUpText} multiline numberOfLines={3} textAlignVertical="top"/>
|
|
221
|
+
<react_native_1.TextInput style={[styles.followUpInput, { borderColor: '#E5E7EB', color: theme.textColor, borderRadius: theme.cornerRadius }, (0, XeboRtl_1.rtlText)()]} placeholder="Your comment..." placeholderTextColor="#9CA3AF" value={followUpText} onChangeText={setFollowUpText} multiline numberOfLines={3} textAlignVertical="top"/>
|
|
220
222
|
</react_native_1.View>)}
|
|
221
223
|
</react_native_1.ScrollView>
|
|
222
224
|
|
|
223
225
|
{/* Error + button always visible at bottom, outside scroll */}
|
|
224
|
-
{!!error && <react_native_1.Text style={styles.errorText}>{error}</react_native_1.Text>}
|
|
226
|
+
{!!error && <react_native_1.Text style={[styles.errorText, (0, XeboRtl_1.rtlText)()]}>{error}</react_native_1.Text>}
|
|
225
227
|
<react_native_1.Animated.View style={{ transform: [{ translateX: shakeAnim }] }}>
|
|
226
228
|
<react_native_1.TouchableOpacity style={[styles.button, { backgroundColor: theme.primaryColor, borderRadius: theme.cornerRadius, opacity: selected === null ? 0.4 : 1 }]} onPress={handleNext} disabled={selected === null} activeOpacity={0.8}>
|
|
227
229
|
<react_native_1.Text style={[styles.buttonText, { fontFamily: theme.fontFamily }]}>
|
|
228
|
-
{isLastQuestion
|
|
230
|
+
{(0, XeboStrings_1.actionLabel)(isLastQuestion)}
|
|
229
231
|
</react_native_1.Text>
|
|
230
232
|
</react_native_1.TouchableOpacity>
|
|
231
233
|
</react_native_1.Animated.View>
|
|
@@ -236,7 +238,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
236
238
|
outer: {
|
|
237
239
|
flex: 1,
|
|
238
240
|
paddingHorizontal: 20,
|
|
239
|
-
paddingBottom:
|
|
241
|
+
paddingBottom: 10,
|
|
240
242
|
justifyContent: 'space-between',
|
|
241
243
|
},
|
|
242
244
|
scroll: { maxHeight: 320 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboSingleChoiceView.d.ts","sourceRoot":"","sources":["../../src/components/XeboSingleChoiceView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAc,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"XeboSingleChoiceView.d.ts","sourceRoot":"","sources":["../../src/components/XeboSingleChoiceView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAc,MAAM,sBAAsB,CAAC;AAK5E,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAsFhD,CAAC"}
|