react-native-my-survey-sdk 2.2.15 → 2.2.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-my-survey-sdk",
3
- "version": "2.2.15",
3
+ "version": "2.2.16",
4
4
  "description": "Xebo survey collection SDK for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -118,15 +118,19 @@ export function parseSurvey(data: APISurveyResponse['data']): XeboSurvey {
118
118
  console.log('[Xebo] Dropdown options.row:', JSON.stringify(q.options?.row));
119
119
  console.log('[Xebo] Full dropdown q.options:', JSON.stringify(q.options));
120
120
  }
121
- const rows: XeboChoice[] = (q.options?.row ?? []).map(r => ({
122
- id: r.uuid,
123
- text: stripHTML(r.text),
124
- value: r.uuid,
121
+ const rawOptions = q.options as any;
122
+ const rowSource: any[] = Array.isArray(rawOptions)
123
+ ? rawOptions
124
+ : (rawOptions?.row ?? rawOptions?.items ?? rawOptions?.choices ?? []);
125
+ const rows: XeboChoice[] = rowSource.map((r: any) => ({
126
+ id: r.uuid ?? r.id,
127
+ text: stripHTML(r.text ?? r.label ?? r.value ?? ''),
128
+ value: r.uuid ?? r.id,
125
129
  }));
126
- const cols: XeboChoice[] = (q.options?.col ?? []).map(c => ({
127
- id: c.uuid,
128
- text: stripHTML(c.text),
129
- value: c.uuid,
130
+ const cols: XeboChoice[] = (rawOptions?.col ?? rawOptions?.columns ?? []).map((c: any) => ({
131
+ id: c.uuid ?? c.id,
132
+ text: stripHTML(c.text ?? c.label ?? ''),
133
+ value: c.uuid ?? c.id,
130
134
  }));
131
135
 
132
136
  // Build conditional follow-ups for NPS Pro