react-native-my-survey-sdk 3.0.6 → 3.0.8

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;AAsID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA6I1C,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;AAGhE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAsID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAuI1C,CAAC"}
@@ -183,23 +183,21 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
183
183
  {question.subtitle}
184
184
  </react_native_1.Text>)}
185
185
 
186
- {/* Rating icons row */}
186
+ {/* Rating icons + labels: each icon paired with its label */}
187
187
  <react_native_1.View style={styles.iconsRow}>
188
188
  {Array.from({ length: totalSteps }, (_, i) => {
189
+ var _a, _b;
189
190
  const isFilled = isCumulative ? selected !== null && i <= selected : i === selected;
191
+ const label = question.showColLabels ? (_b = (_a = question.columns) === null || _a === void 0 ? void 0 : _a[i]) === null || _b === void 0 ? void 0 : _b.text : undefined;
190
192
  return (<react_native_1.TouchableOpacity key={i} onPress={() => handleSelect(i)} style={styles.iconButton} activeOpacity={0.7}>
191
193
  <RatingIcon style={ratingStyle} index={i} selected={i === selected} filled={isFilled} color={ratingColor} totalSteps={totalSteps}/>
194
+ {!!label && (<react_native_1.Text style={[styles.colLabel, { color: theme.textColor, fontFamily: theme.fontFamily }]} numberOfLines={1}>
195
+ {label}
196
+ </react_native_1.Text>)}
192
197
  </react_native_1.TouchableOpacity>);
193
198
  })}
194
199
  </react_native_1.View>
195
200
 
196
- {/* Column labels */}
197
- {question.showColLabels && question.columns && (<react_native_1.View style={styles.colLabels}>
198
- {question.columns.map((col) => (<react_native_1.Text key={col.id} style={[styles.colLabel, { color: theme.textColor, fontFamily: theme.fontFamily }]} numberOfLines={1}>
199
- {col.text}
200
- </react_native_1.Text>))}
201
- </react_native_1.View>)}
202
-
203
201
  {/* Follow-up after rating */}
204
202
  {selected !== null && !!question.followUpQuestion && (<react_native_1.View style={[styles.followUpCard, { borderRadius: theme.cornerRadius }]}>
205
203
  <react_native_1.Text style={[styles.followUpTitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
@@ -223,21 +221,23 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
223
221
  exports.XeboRatingView = XeboRatingView;
224
222
  const styles = react_native_1.StyleSheet.create({
225
223
  outer: {
224
+ flex: 1,
226
225
  paddingHorizontal: 20,
227
226
  paddingBottom: 24,
227
+ justifyContent: 'space-between',
228
228
  },
229
229
  scroll: { maxHeight: 320 },
230
230
  scrollContent: { paddingTop: 16, paddingBottom: 8 },
231
231
  title: { fontSize: 18, fontWeight: '700', marginBottom: 16 },
232
232
  subtitle: { fontSize: 14, opacity: 0.6, marginBottom: 16 },
233
- iconsRow: { flexDirection: 'row', marginTop: 4, marginBottom: 20, flexWrap: 'nowrap', justifyContent: 'center', gap: 16 },
234
- iconButton: { alignItems: 'center', justifyContent: 'center', padding: 4 },
233
+ iconsRow: { flexDirection: 'row', marginTop: 4, marginBottom: 20, justifyContent: 'space-between' },
234
+ iconButton: { flex: 1, alignItems: 'center', justifyContent: 'flex-start', paddingVertical: 4 },
235
235
  colLabels: {
236
236
  flexDirection: 'row',
237
237
  justifyContent: 'space-between',
238
238
  marginBottom: 16,
239
239
  },
240
- colLabel: { fontSize: 11, opacity: 0.6, textAlign: 'center', flex: 1 },
240
+ colLabel: { fontSize: 11, opacity: 0.6, textAlign: 'center', marginTop: 6 },
241
241
  followUpCard: {
242
242
  borderWidth: 1.5,
243
243
  borderColor: '#E5E7EB',
@@ -252,6 +252,6 @@ const styles = react_native_1.StyleSheet.create({
252
252
  minHeight: 80,
253
253
  },
254
254
  errorText: { color: '#EF4444', fontSize: 13, marginBottom: 8 },
255
- button: { paddingVertical: 14, alignItems: 'center', marginTop: 8 },
255
+ button: { paddingVertical: 14, alignItems: 'center', marginTop: 16, marginBottom: 8 },
256
256
  buttonText: { color: '#FFFFFF', fontSize: 16, fontWeight: '600' },
257
257
  });
@@ -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,sBAAsB,CAAC;AAC9B,OAAO,EAEL,iBAAiB,EAGlB,MAAM,yBAAyB,CAAC;AAIjC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAID,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM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AC,CAsBrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,UAAU,EAAE,EACrB,IAAI,CAAC,EAAE,UAAU,GAChB,OAAO,CAAC,YAAY,CAAC,CAmFvB"}
@@ -65,7 +65,8 @@ function stripHTML(raw) {
65
65
  }
66
66
  // ─── Question type mapping ────────────────────────────────────────────────────
67
67
  function mapRatingStyle(apiType) {
68
- switch (apiType === null || apiType === void 0 ? void 0 : apiType.toLowerCase()) {
68
+ const normalized = (apiType !== null && apiType !== void 0 ? apiType : '').toLowerCase().replace(/^animated_/, '');
69
+ switch (normalized) {
69
70
  case 'star':
70
71
  case 'stars': return 'star';
71
72
  case 'heart':
@@ -75,7 +76,11 @@ function mapRatingStyle(apiType) {
75
76
  case 'tile':
76
77
  case 'tiles': return 'tile';
77
78
  case 'emoji':
78
- case 'emojis': return 'emoji';
79
+ case 'emojis':
80
+ case 'flat_emoji':
81
+ case 'flat_emojis':
82
+ case 'smiley':
83
+ case 'smileys': return 'emoji';
79
84
  case '3d_emoji':
80
85
  case '3d_emojis': return '3d_emoji';
81
86
  default: return 'star';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-my-survey-sdk",
3
- "version": "3.0.6",
3
+ "version": "3.0.8",
4
4
  "description": "Xebo survey collection SDK for React Native",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",