react-native-my-survey-sdk 3.0.2 → 3.0.4
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;AAyID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA6I1C,CAAC"}
|
|
@@ -81,7 +81,8 @@ 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, }) {
|
|
84
|
+
function RatingIcon({ style, index, selected, filled, color, totalSteps, }) {
|
|
85
|
+
var _a;
|
|
85
86
|
const activeColor = color || '#F59E0B';
|
|
86
87
|
const inactive = '#E5E7EB';
|
|
87
88
|
switch (style) {
|
|
@@ -115,6 +116,14 @@ function RatingIcon({ style, index, selected, filled, color, }) {
|
|
|
115
116
|
case 'flat_emoji':
|
|
116
117
|
case 'flatEmoji':
|
|
117
118
|
return <FlatEmoji index={index} selected={selected}/>;
|
|
119
|
+
case '3d_emoji': {
|
|
120
|
+
const emojiScale = ['😡', '😠', '😟', '😕', '😐', '🙂', '😊', '😄', '🤩', '😍'];
|
|
121
|
+
const step = (emojiScale.length - 1) / Math.max(1, totalSteps - 1);
|
|
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>);
|
|
126
|
+
}
|
|
118
127
|
case 'star':
|
|
119
128
|
default:
|
|
120
129
|
return (<react_native_1.Text style={{ fontSize: 34, color: filled ? activeColor : inactive }}>
|
|
@@ -180,7 +189,7 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
180
189
|
{Array.from({ length: totalSteps }, (_, i) => {
|
|
181
190
|
const isFilled = isCumulative ? selected !== null && i <= selected : i === selected;
|
|
182
191
|
return (<react_native_1.TouchableOpacity key={i} onPress={() => handleSelect(i)} style={styles.iconButton} activeOpacity={0.7}>
|
|
183
|
-
<RatingIcon style={ratingStyle} index={i} selected={i === selected} filled={isFilled} color={ratingColor}/>
|
|
192
|
+
<RatingIcon style={ratingStyle} index={i} selected={i === selected} filled={isFilled} color={ratingColor} totalSteps={totalSteps}/>
|
|
184
193
|
</react_native_1.TouchableOpacity>);
|
|
185
194
|
})}
|
|
186
195
|
</react_native_1.View>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboNetworkService.d.ts","sourceRoot":"","sources":["../../src/core/XeboNetworkService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,sBAA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case 'emojis': return 'emoji';
|
|
79
|
+
case '3d_emoji':
|
|
80
|
+
case '3d_emojis': return '3d_emoji';
|
|
79
81
|
default: return 'star';
|
|
80
82
|
}
|
|
81
83
|
}
|
|
@@ -119,6 +121,7 @@ function parseSurvey(data) {
|
|
|
119
121
|
if (followUpQuestionIds.has(q.uuid))
|
|
120
122
|
continue;
|
|
121
123
|
const type = mapQuestionType(q.quesType);
|
|
124
|
+
console.log(`[Xebo] Raw API question [${q.quesType}]:`, JSON.stringify(q, null, 2));
|
|
122
125
|
if (type === XeboModels_1.XeboQuestionType.dropdown) {
|
|
123
126
|
console.log('[Xebo] Dropdown raw options keys:', JSON.stringify(Object.keys((_d = q.options) !== null && _d !== void 0 ? _d : {})));
|
|
124
127
|
console.log('[Xebo] Dropdown options.row:', JSON.stringify((_e = q.options) === null || _e === void 0 ? void 0 : _e.row));
|
|
@@ -201,10 +204,11 @@ function parseSurvey(data) {
|
|
|
201
204
|
: undefined,
|
|
202
205
|
followUpQuestion: undefined,
|
|
203
206
|
conditionalFollowUps: conditionalFollowUps.length > 0 ? conditionalFollowUps : undefined,
|
|
204
|
-
ratingStyle:
|
|
207
|
+
ratingStyle: ratingSettings ? mapRatingStyle(ratingSettings.type) : undefined,
|
|
205
208
|
showColLabels: ratingSettings === null || ratingSettings === void 0 ? void 0 : ratingSettings.colLabel,
|
|
206
209
|
ratingColor: ratingSettings === null || ratingSettings === void 0 ? void 0 : ratingSettings.color,
|
|
207
210
|
};
|
|
211
|
+
console.log(`[Xebo] Parsed question [${type}]:`, JSON.stringify(parsed, null, 2));
|
|
208
212
|
questions.push(parsed);
|
|
209
213
|
}
|
|
210
214
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-my-survey-sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Xebo survey collection SDK for React Native",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,4 +35,4 @@
|
|
|
35
35
|
"react-native-modal": "^13.0.0",
|
|
36
36
|
"typescript": "^5.3.0"
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|