react-native-my-survey-sdk 3.0.4 → 3.0.5
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.
|
@@ -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;AAGhE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;
|
|
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;AAGhE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AA0JD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA6I1C,CAAC"}
|
|
@@ -81,54 +81,71 @@ function FlatEmoji({ index, selected }) {
|
|
|
81
81
|
</react_native_1.View>)}
|
|
82
82
|
</react_native_1.View>);
|
|
83
83
|
}
|
|
84
|
-
function RatingIcon({ style, index, selected, filled, color,
|
|
85
|
-
var _a;
|
|
84
|
+
function RatingIcon({ style, index, selected, filled, color, }) {
|
|
86
85
|
const activeColor = color || '#F59E0B';
|
|
87
|
-
const inactive = '#E5E7EB';
|
|
88
86
|
switch (style) {
|
|
89
|
-
case 'heart':
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
case 'heart': {
|
|
88
|
+
// View-based heart: filled = solid colored circle, unfilled = outlined circle
|
|
89
|
+
return (<react_native_1.View style={{
|
|
90
|
+
width: 40, height: 40, borderRadius: 20,
|
|
91
|
+
backgroundColor: filled ? activeColor : 'transparent',
|
|
92
|
+
borderWidth: filled ? 0 : 2,
|
|
93
|
+
borderColor: activeColor,
|
|
94
|
+
opacity: filled ? 1 : 0.4,
|
|
95
|
+
}}/>);
|
|
96
|
+
}
|
|
93
97
|
case 'circle':
|
|
94
98
|
return (<react_native_1.View style={{
|
|
95
99
|
width: 38,
|
|
96
100
|
height: 38,
|
|
97
101
|
borderRadius: 19,
|
|
98
|
-
backgroundColor: filled ? activeColor :
|
|
99
|
-
borderWidth:
|
|
100
|
-
borderColor: '#D1D5DB',
|
|
102
|
+
backgroundColor: filled ? activeColor : 'transparent',
|
|
103
|
+
borderWidth: 2,
|
|
104
|
+
borderColor: filled ? activeColor : '#D1D5DB',
|
|
101
105
|
}}/>);
|
|
102
106
|
case 'tile':
|
|
103
107
|
return (<react_native_1.View style={{
|
|
104
|
-
width:
|
|
105
|
-
height:
|
|
106
|
-
borderRadius:
|
|
107
|
-
backgroundColor: filled ? activeColor :
|
|
108
|
+
width: 44,
|
|
109
|
+
height: 44,
|
|
110
|
+
borderRadius: 8,
|
|
111
|
+
backgroundColor: filled ? activeColor : '#F3F4F6',
|
|
112
|
+
borderWidth: filled ? 0 : 1.5,
|
|
113
|
+
borderColor: '#D1D5DB',
|
|
108
114
|
alignItems: 'center',
|
|
109
115
|
justifyContent: 'center',
|
|
110
116
|
}}>
|
|
111
|
-
<react_native_1.Text style={{ fontSize:
|
|
117
|
+
<react_native_1.Text style={{ fontSize: 15, fontWeight: '700', color: filled ? '#FFF' : '#6B7280' }}>
|
|
112
118
|
{index + 1}
|
|
113
119
|
</react_native_1.Text>
|
|
114
120
|
</react_native_1.View>);
|
|
115
121
|
case 'emoji':
|
|
116
122
|
case 'flat_emoji':
|
|
117
123
|
case 'flatEmoji':
|
|
124
|
+
case 'smiley':
|
|
125
|
+
case 'smileys':
|
|
126
|
+
case 'faces':
|
|
118
127
|
return <FlatEmoji index={index} selected={selected}/>;
|
|
119
128
|
case '3d_emoji': {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const emoji = (_a = emojiScale[Math.round(index * step)]) !== null && _a !== void 0 ? _a : '😐';
|
|
123
|
-
return (<react_native_1.Text style={{ fontSize: 36, opacity: selected ? 1 : 0.35 }}>
|
|
124
|
-
{emoji}
|
|
125
|
-
</react_native_1.Text>);
|
|
129
|
+
// Use FlatEmoji (View-based) — reliable on all iOS versions
|
|
130
|
+
return <FlatEmoji index={index} selected={selected}/>;
|
|
126
131
|
}
|
|
127
132
|
case 'star':
|
|
128
|
-
default:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
default: {
|
|
134
|
+
// View-based star alternative: filled/outlined circles with a consistent look
|
|
135
|
+
return (<react_native_1.View style={{
|
|
136
|
+
width: 44, height: 44, borderRadius: 22,
|
|
137
|
+
backgroundColor: filled ? activeColor : 'transparent',
|
|
138
|
+
borderWidth: 2,
|
|
139
|
+
borderColor: filled ? activeColor : '#D1D5DB',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
justifyContent: 'center',
|
|
142
|
+
}}>
|
|
143
|
+
{filled && (<react_native_1.View style={{
|
|
144
|
+
width: 16, height: 16, borderRadius: 8,
|
|
145
|
+
backgroundColor: '#FFF',
|
|
146
|
+
}}/>)}
|
|
147
|
+
</react_native_1.View>);
|
|
148
|
+
}
|
|
132
149
|
}
|
|
133
150
|
}
|
|
134
151
|
const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
@@ -231,7 +248,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
231
248
|
scrollContent: { paddingTop: 16, paddingBottom: 8 },
|
|
232
249
|
title: { fontSize: 18, fontWeight: '700', marginBottom: 16 },
|
|
233
250
|
subtitle: { fontSize: 14, opacity: 0.6, marginBottom: 16 },
|
|
234
|
-
iconsRow: { flexDirection: 'row', marginTop: 4, marginBottom: 20, flexWrap: 'nowrap', justifyContent: '
|
|
251
|
+
iconsRow: { flexDirection: 'row', marginTop: 4, marginBottom: 20, flexWrap: 'nowrap', justifyContent: 'center', gap: 12 },
|
|
235
252
|
iconButton: { alignItems: 'center', justifyContent: 'center' },
|
|
236
253
|
colLabels: {
|
|
237
254
|
flexDirection: 'row',
|