react-native-inapp-inspector 1.1.11 → 1.1.13

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.
Files changed (53) hide show
  1. package/dist/commonjs/components/AnalyticsDetail.js +93 -479
  2. package/dist/commonjs/components/AnalyticsEventCard.js +25 -25
  3. package/dist/commonjs/components/ConsoleLogCard.js +3 -1
  4. package/dist/commonjs/components/HighlightText.js +1 -1
  5. package/dist/commonjs/components/JsonViewer.d.ts +3 -1
  6. package/dist/commonjs/components/JsonViewer.js +327 -9
  7. package/dist/commonjs/components/MetaAccordion.d.ts +10 -1
  8. package/dist/commonjs/components/MetaAccordion.js +121 -24
  9. package/dist/commonjs/components/NetworkIcons.d.ts +1 -0
  10. package/dist/commonjs/components/NetworkIcons.js +8 -1
  11. package/dist/commonjs/components/ReduxTreeView.d.ts +12 -17
  12. package/dist/commonjs/components/ReduxTreeView.js +1045 -632
  13. package/dist/commonjs/components/SectionHeader.d.ts +1 -1
  14. package/dist/commonjs/components/SectionHeader.js +7 -1
  15. package/dist/commonjs/components/TouchableScale.js +8 -0
  16. package/dist/commonjs/constants/version.d.ts +1 -1
  17. package/dist/commonjs/constants/version.js +1 -1
  18. package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -0
  19. package/dist/commonjs/customHooks/reduxLogger.js +2 -0
  20. package/dist/commonjs/helpers/index.d.ts +3 -0
  21. package/dist/commonjs/helpers/index.js +103 -1
  22. package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
  23. package/dist/commonjs/helpers/settingsStore.js +4 -0
  24. package/dist/commonjs/index.js +385 -339
  25. package/dist/commonjs/types/index.d.ts +3 -0
  26. package/dist/esm/components/AnalyticsDetail.js +94 -480
  27. package/dist/esm/components/AnalyticsEventCard.js +25 -25
  28. package/dist/esm/components/ConsoleLogCard.js +3 -1
  29. package/dist/esm/components/HighlightText.js +3 -3
  30. package/dist/esm/components/JsonViewer.d.ts +3 -1
  31. package/dist/esm/components/JsonViewer.js +295 -10
  32. package/dist/esm/components/MetaAccordion.d.ts +10 -1
  33. package/dist/esm/components/MetaAccordion.js +90 -26
  34. package/dist/esm/components/NetworkIcons.d.ts +1 -0
  35. package/dist/esm/components/NetworkIcons.js +6 -0
  36. package/dist/esm/components/ReduxTreeView.d.ts +12 -17
  37. package/dist/esm/components/ReduxTreeView.js +1047 -629
  38. package/dist/esm/components/SectionHeader.d.ts +1 -1
  39. package/dist/esm/components/SectionHeader.js +8 -2
  40. package/dist/esm/components/TouchableScale.js +9 -1
  41. package/dist/esm/constants/version.d.ts +1 -1
  42. package/dist/esm/constants/version.js +1 -1
  43. package/dist/esm/customHooks/reduxLogger.d.ts +2 -0
  44. package/dist/esm/customHooks/reduxLogger.js +2 -0
  45. package/dist/esm/helpers/index.d.ts +3 -0
  46. package/dist/esm/helpers/index.js +100 -1
  47. package/dist/esm/helpers/settingsStore.d.ts +1 -0
  48. package/dist/esm/helpers/settingsStore.js +3 -0
  49. package/dist/esm/index.js +389 -343
  50. package/dist/esm/types/index.d.ts +3 -0
  51. package/example/package-lock.json +33 -74
  52. package/example/package.json +1 -1
  53. package/package.json +1 -1
@@ -38,298 +38,126 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const react_1 = __importStar(require("react"));
40
40
  const react_native_1 = require("react-native");
41
- const react_native_linear_gradient_1 = __importDefault(require("react-native-linear-gradient"));
42
41
  // Components
43
42
  const CopyButton_1 = __importDefault(require("./CopyButton"));
44
43
  const JsonViewer_1 = __importDefault(require("./JsonViewer"));
45
- // Icons
46
- const NetworkIcons_1 = require("./NetworkIcons");
44
+ const TouchableScale_1 = __importDefault(require("./TouchableScale"));
47
45
  // Utils
48
46
  const AppFonts_1 = require("../styles/AppFonts");
47
+ const helpers_1 = require("../helpers");
49
48
  // Stylesheet
50
49
  const AppColors_1 = require("../styles/AppColors");
51
- const styles_1 = __importDefault(require("../styles"));
52
- const AnalyticsEventCard_1 = require("./AnalyticsEventCard");
53
- // Helpers
54
- const helpers_1 = require("../helpers");
55
- // Sub Components
56
- const ParamRowItem = ({ paramKey, value, }) => {
57
- const isObject = typeof value === 'object' && value !== null;
58
- const valStr = isObject ? JSON.stringify(value, null, 2) : String(value);
59
- const [expanded, setExpanded] = (0, react_1.useState)(false);
60
- const isLong = valStr.length > 80 || valStr.includes('\n') || isObject;
61
- return (<react_native_1.View style={[detailStyles.dataBox, { backgroundColor: AppColors_1.AppColors.primaryLight, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
62
- <react_native_1.View style={detailStyles.dataBoxHeader}>
63
- <react_native_1.Text style={[detailStyles.dataBoxKey, { color: AppColors_1.AppColors.primaryBlack }]} numberOfLines={1}>
64
- {paramKey}
65
- </react_native_1.Text>
66
- <CopyButton_1.default value={valStr} label={paramKey}/>
67
- </react_native_1.View>
68
- {expanded && isObject ? (<react_native_1.View style={[detailStyles.jsonBlock, { backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
69
- <JsonViewer_1.default data={value}/>
70
- </react_native_1.View>) : (<react_native_1.Text style={[detailStyles.dataBoxVal, { color: AppColors_1.AppColors.primaryBlack }]} selectable numberOfLines={expanded ? undefined : 2}>
71
- {valStr}
72
- </react_native_1.Text>)}
73
- {isLong && (<react_native_1.Pressable onPress={() => setExpanded(!expanded)} style={[detailStyles.showMoreBtn, { backgroundColor: AppColors_1.AppColors.grayBackground }]}>
74
- <react_native_1.Text style={[detailStyles.showMoreText, { color: AppColors_1.AppColors.grayTextStrong }]}>
75
- {expanded ? 'Show Less' : 'Show More'}
76
- </react_native_1.Text>
77
- </react_native_1.Pressable>)}
78
- </react_native_1.View>);
79
- };
80
- const ParamTable = ({ data, emptyLabel, }) => {
81
- const entries = Object.keys(data).map(key => ({
82
- key,
83
- value: data[key],
84
- }));
85
- if (entries.length === 0) {
86
- return (<react_native_1.View style={[detailStyles.emptyParams, { backgroundColor: AppColors_1.AppColors.primaryLight, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
87
- <react_native_1.Text style={[detailStyles.emptyParamsText, { color: AppColors_1.AppColors.grayTextWeak }]}>
88
- {emptyLabel ?? 'No parameters'}
89
- </react_native_1.Text>
90
- </react_native_1.View>);
91
- }
92
- return (<react_native_1.View style={detailStyles.paramList}>
93
- {entries.map(({ key, value }) => (<ParamRowItem key={key} paramKey={key} value={value}/>))}
94
- </react_native_1.View>);
95
- };
96
- const SectionCard = ({ title, children, count, accentColor = AppColors_1.AppColors.purple, }) => {
97
- if (!title) {
98
- return (<react_native_1.View style={{ paddingHorizontal: 16, paddingTop: 12, paddingBottom: 20 }}>
99
- {children}
100
- </react_native_1.View>);
101
- }
102
- return (<react_native_1.View style={[detailStyles.sectionCard, { backgroundColor: AppColors_1.AppColors.primaryLight, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
103
- <react_native_1.View style={detailStyles.sectionHeader}>
104
- <react_native_1.View style={detailStyles.sectionTitleRow}>
105
- <react_native_1.View style={[
106
- detailStyles.sectionAccentDot,
107
- { backgroundColor: accentColor },
108
- ]}/>
109
- <react_native_1.Text style={[detailStyles.sectionTitle, { color: AppColors_1.AppColors.primaryBlack }]}>{title.toUpperCase()}</react_native_1.Text>
110
- </react_native_1.View>
111
- {typeof count === 'number' && (<react_native_1.View style={[
112
- detailStyles.countBadge,
113
- {
114
- borderColor: `${accentColor}55`,
115
- backgroundColor: `${accentColor}12`,
116
- },
117
- ]}>
118
- <react_native_1.Text style={[detailStyles.countBadgeText, { color: accentColor }]}>
119
- {count}
120
- </react_native_1.Text>
121
- </react_native_1.View>)}
122
- </react_native_1.View>
123
- <react_native_1.View style={{ paddingHorizontal: 14, paddingBottom: 14 }}>{children}</react_native_1.View>
124
- </react_native_1.View>);
125
- };
126
50
  const AnalyticsDetail = ({ event, }) => {
127
- const [search, setSearch] = (0, react_1.useState)('');
128
- const [activeTab, setActiveTab] = (0, react_1.useState)('unformatted');
129
- const SOURCE_COLORS = {
130
- firebase: '#E07B1A',
131
- manual: AppColors_1.AppColors.purple,
132
- };
51
+ const [expandDepth, setExpandDepth] = (0, react_1.useState)(1);
52
+ const [treeKey, setTreeKey] = (0, react_1.useState)(0);
133
53
  const params = event.params ?? {};
134
54
  const userProperties = event.userProperties ?? {};
135
- const eventColor = (0, AnalyticsEventCard_1.getEventColor)(event.name);
136
- const sourceColor = SOURCE_COLORS[event.source] ?? AppColors_1.AppColors.purple;
137
- const paramCount = Object.keys(params).length;
138
55
  const upCount = Object.keys(userProperties).length;
139
- const topMetrics = [];
140
- if (event.screenName) {
141
- topMetrics.push({
142
- key: 'Screen',
143
- value: event.screenName,
144
- color: AppColors_1.AppColors.skyBlue,
145
- });
146
- }
147
- if (event.userId) {
148
- topMetrics.push({
149
- key: 'User ID',
150
- value: event.userId,
151
- color: AppColors_1.AppColors.greenColor,
152
- });
153
- }
154
- if (event.pageTitle) {
155
- topMetrics.push({
156
- key: 'Page',
157
- value: event.pageTitle,
158
- color: AppColors_1.AppColors.purple,
159
- });
160
- }
161
- if (params?.primary_category) {
162
- topMetrics.push({
163
- key: 'Category',
164
- value: String(params.primary_category),
165
- color: AppColors_1.AppColors.purple,
166
- });
167
- }
168
- if (params?.flow) {
169
- topMetrics.push({
170
- key: 'Flow',
171
- value: String(params.flow),
172
- color: AppColors_1.AppColors.greenColor,
173
- });
174
- }
175
- if (params?.market_language) {
176
- topMetrics.push({
177
- key: 'Language',
178
- value: String(params.market_language),
179
- color: '#F59E0B',
180
- }); // Amber
181
- }
182
- if (params?.tripType) {
183
- topMetrics.push({
184
- key: 'Trip Type',
185
- value: String(params.tripType),
186
- color: '#3B82F6',
187
- }); // Blue
56
+ const jsonData = {
57
+ name: event.name,
58
+ params: params,
59
+ ...(upCount > 0 ? { userProperties } : {}),
60
+ };
61
+ const isObject = typeof jsonData === 'object' && jsonData !== null;
62
+ const isArray = Array.isArray(jsonData);
63
+ let typeLabel = typeof jsonData;
64
+ let countLabel = '';
65
+ if (jsonData === null) {
66
+ typeLabel = 'null';
188
67
  }
189
- if (userProperties?.platform_type) {
190
- topMetrics.push({
191
- key: 'Platform',
192
- value: String(userProperties.platform_type),
193
- color: AppColors_1.AppColors.skyBlue,
194
- });
68
+ else if (isArray) {
69
+ typeLabel = 'array';
70
+ countLabel = `${jsonData.length} items`;
195
71
  }
196
- if (userProperties?.login_status) {
197
- topMetrics.push({
198
- key: 'Login Status',
199
- value: String(userProperties.login_status),
200
- color: '#64748B',
201
- });
72
+ else if (isObject) {
73
+ typeLabel = 'object';
74
+ countLabel = `${Object.keys(jsonData).length} keys`;
202
75
  }
203
- topMetrics.unshift({
204
- key: 'Source',
205
- value: event.source,
206
- color: sourceColor,
207
- });
208
76
  return (<react_native_1.ScrollView style={[detailStyles.scroll, { backgroundColor: AppColors_1.AppColors.grayBackground }]} contentContainerStyle={detailStyles.content} showsVerticalScrollIndicator contentInsetAdjustmentBehavior="never" automaticallyAdjustContentInsets={false}>
209
- <react_native_linear_gradient_1.default colors={[
210
- `${eventColor}18`,
211
- `${eventColor}06`,
212
- AppColors_1.AppColors.grayBackground,
213
- ]} style={detailStyles.hero}>
214
- <react_native_1.View style={{
77
+
78
+ {/* Clean Toolbar */}
79
+ <react_native_1.View style={{
215
80
  flexDirection: 'row',
216
- width: '100%',
217
81
  justifyContent: 'space-between',
218
- alignItems: 'flex-start',
82
+ alignItems: 'center',
219
83
  paddingHorizontal: 16,
220
- paddingTop: 14,
221
- marginBottom: 8,
84
+ paddingVertical: 12,
85
+ borderBottomWidth: 1,
86
+ borderBottomColor: AppColors_1.AppColors.grayBorderSecondary,
87
+ backgroundColor: AppColors_1.AppColors.primaryLight,
88
+ }}>
89
+ <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
90
+ <TouchableScale_1.default style={{
91
+ flexDirection: 'row',
92
+ alignItems: 'center',
93
+ gap: 6,
94
+ backgroundColor: AppColors_1.AppColors.grayBackground,
95
+ paddingHorizontal: 12,
96
+ paddingVertical: 6,
97
+ borderRadius: 8,
98
+ borderWidth: 1,
99
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
100
+ }} onPress={() => {
101
+ const nextDepth = expandDepth === 99 ? 1 : 99;
102
+ setExpandDepth(nextDepth);
103
+ setTreeKey(prev => prev + 1);
222
104
  }}>
223
- <react_native_1.View style={{ flex: 1, paddingRight: 10 }}>
224
105
  <react_native_1.Text style={{
225
106
  fontFamily: AppFonts_1.AppFonts.interBold,
226
- fontSize: 18,
227
- color: AppColors_1.AppColors.primaryBlack,
228
- marginBottom: 4,
229
- }} numberOfLines={2}>
230
- {event.name}
231
- </react_native_1.Text>
232
- <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
233
- <react_native_1.View style={{
234
- width: 8,
235
- height: 8,
236
- borderRadius: 4,
237
- backgroundColor: sourceColor,
238
- }}/>
239
- <react_native_1.Text style={{
240
- fontFamily: AppFonts_1.AppFonts.interMedium,
241
107
  fontSize: 12,
242
- color: AppColors_1.AppColors.grayTextStrong,
108
+ color: AppColors_1.AppColors.purple,
243
109
  }}>
244
- {(0, helpers_1.formatDateTimeToAnalytics)(event.timestamp)}
110
+ {expandDepth === 99 ? 'Collapse All' : 'Expand All'}
111
+ </react_native_1.Text>
112
+ </TouchableScale_1.default>
113
+ <react_native_1.View style={{
114
+ flexDirection: 'row',
115
+ alignItems: 'center',
116
+ backgroundColor: AppColors_1.AppColors.grayBackground,
117
+ borderRadius: 6,
118
+ overflow: 'hidden',
119
+ borderWidth: 1,
120
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
121
+ }}>
122
+ <react_native_1.View style={{ paddingHorizontal: 6, paddingVertical: 4, backgroundColor: AppColors_1.AppColors.purple + '18' }}>
123
+ <react_native_1.Text style={{ fontFamily: AppFonts_1.AppFonts.interBold, fontSize: 9, color: AppColors_1.AppColors.purple, letterSpacing: 0.3 }}>
124
+ {typeLabel.toUpperCase()}
245
125
  </react_native_1.Text>
246
126
  </react_native_1.View>
127
+ {countLabel ? (<react_native_1.View style={{ paddingHorizontal: 6, paddingVertical: 4 }}>
128
+ <react_native_1.Text style={{ fontFamily: AppFonts_1.AppFonts.interMedium, fontSize: 9, color: AppColors_1.AppColors.grayText }}>
129
+ {countLabel}
130
+ </react_native_1.Text>
131
+ </react_native_1.View>) : null}
132
+ </react_native_1.View>
133
+ <react_native_1.View style={{
134
+ backgroundColor: AppColors_1.AppColors.grayBackground,
135
+ borderRadius: 6,
136
+ paddingHorizontal: 6,
137
+ paddingVertical: 4,
138
+ borderWidth: 1,
139
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
140
+ }}>
141
+ <react_native_1.Text style={{ fontFamily: AppFonts_1.AppFonts.interMedium, fontSize: 9, color: AppColors_1.AppColors.grayText }}>
142
+ {(0, helpers_1.getSize)(jsonData)}
143
+ </react_native_1.Text>
247
144
  </react_native_1.View>
248
- <CopyButton_1.default value={JSON.stringify({ name: event.name, params: params }, null, 2)} label="Copy JSON"/>
249
145
  </react_native_1.View>
250
146
 
251
- {topMetrics.length > 0 && (<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={false} style={detailStyles.metricsScroll} contentContainerStyle={detailStyles.metricsGrid}>
252
- {topMetrics.map((item, idx) => (<react_native_1.View key={idx} style={[
253
- detailStyles.metricCard,
254
- {
255
- borderLeftColor: item.color,
256
- backgroundColor: AppColors_1.AppColors.primaryLight,
257
- },
258
- ]}>
259
- <react_native_1.Text style={[detailStyles.metricLabel, { color: AppColors_1.AppColors.grayTextWeak }]}>{item.key}</react_native_1.Text>
260
- <react_native_1.Text style={[detailStyles.metricValue, { color: item.color }]} numberOfLines={1}>
261
- {item.value}
262
- </react_native_1.Text>
263
- </react_native_1.View>))}
264
- </react_native_1.ScrollView>)}
265
- </react_native_linear_gradient_1.default>
147
+ <CopyButton_1.default value={JSON.stringify(jsonData, null, 2)} label="Copy JSON"/>
148
+ </react_native_1.View>
266
149
 
267
- <react_native_1.View style={[detailStyles.tabRow, { backgroundColor: AppColors_1.AppColors.grayBackground }]}>
268
- <react_native_1.Pressable style={[
269
- detailStyles.tabButton,
270
- activeTab === 'unformatted' && [detailStyles.tabActive, { backgroundColor: AppColors_1.AppColors.primaryLight }],
271
- ]} onPress={() => setActiveTab('unformatted')}>
272
- <react_native_1.Text style={[
273
- detailStyles.tabText,
274
- { color: AppColors_1.AppColors.grayTextWeak },
275
- activeTab === 'unformatted' && [detailStyles.tabTextActive, { color: AppColors_1.AppColors.primaryBlack }],
276
- ]}>
277
- JSON Viewer
278
- </react_native_1.Text>
279
- </react_native_1.Pressable>
280
- <react_native_1.Pressable style={[
281
- detailStyles.tabButton,
282
- activeTab === 'formatted' && [detailStyles.tabActive, { backgroundColor: AppColors_1.AppColors.primaryLight }],
283
- ]} onPress={() => setActiveTab('formatted')}>
284
- <react_native_1.Text style={[
285
- detailStyles.tabText,
286
- { color: AppColors_1.AppColors.grayTextWeak },
287
- activeTab === 'formatted' && [detailStyles.tabTextActive, { color: AppColors_1.AppColors.primaryBlack }],
150
+ {/* Direct JSON Viewer View */}
151
+ <react_native_1.View style={[
152
+ detailStyles.jsonBlockContainer,
153
+ {
154
+ backgroundColor: AppColors_1.AppColors.primaryLight,
155
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
156
+ marginTop: 16,
157
+ },
288
158
  ]}>
289
- Tabular View
290
- </react_native_1.Text>
291
- </react_native_1.Pressable>
159
+ <JsonViewer_1.default key={treeKey} data={jsonData} defaultExpandDepth={expandDepth} fullHeight/>
292
160
  </react_native_1.View>
293
-
294
- {activeTab === 'unformatted' && (<react_native_1.View style={detailStyles.searchRow}>
295
- <react_native_1.View style={[styles_1.default.detailSearchBox, { backgroundColor: AppColors_1.AppColors.primaryLight, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
296
- <react_native_1.TextInput placeholder="Search JSON data..." placeholderTextColor={AppColors_1.AppColors.grayTextWeak} value={search} onChangeText={setSearch} style={[styles_1.default.detailSearchInput, { color: AppColors_1.AppColors.primaryBlack }]} autoCorrect={false} autoCapitalize="none"/>
297
- {search.length > 0 && (<react_native_1.Pressable onPress={() => setSearch('')} hitSlop={10} style={{ padding: 8 }}>
298
- <NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
299
- </react_native_1.Pressable>)}
300
- </react_native_1.View>
301
- </react_native_1.View>)}
302
-
303
- {activeTab === 'formatted' && (<react_native_1.View style={{ gap: 10 }}>
304
- {paramCount > 0 && (<SectionCard title="Event Parameters" count={paramCount} accentColor={eventColor}>
305
- <ParamTable data={params} emptyLabel="No parameters"/>
306
- </SectionCard>)}
307
-
308
- {upCount > 0 && (<SectionCard title="User Properties" count={upCount} accentColor={AppColors_1.AppColors.greenColor}>
309
- <ParamTable data={userProperties} emptyLabel="No user properties"/>
310
- </SectionCard>)}
311
- </react_native_1.View>)}
312
-
313
- {activeTab === 'unformatted' && (<SectionCard accentColor={AppColors_1.AppColors.purple}>
314
- <react_native_1.View style={[detailStyles.jsonBlock, { marginLeft: 0, marginTop: 0, backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
315
- <JsonViewer_1.default data={{
316
- name: event.name,
317
- params: params,
318
- ...(upCount > 0
319
- ? {
320
- userProperties: userProperties,
321
- }
322
- : {}),
323
- }} search={search}/>
324
- </react_native_1.View>
325
- </SectionCard>)}
326
-
327
- {/* Empty state */}
328
- {paramCount === 0 && upCount === 0 && activeTab !== 'unformatted' && (<react_native_1.View style={[detailStyles.emptyParams, { backgroundColor: AppColors_1.AppColors.primaryLight, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
329
- <react_native_1.Text style={[detailStyles.emptyParamsText, { color: AppColors_1.AppColors.grayTextWeak }]}>
330
- No parameters recorded for this event
331
- </react_native_1.Text>
332
- </react_native_1.View>)}
333
161
  </react_native_1.ScrollView>);
334
162
  };
335
163
  const detailStyles = react_native_1.StyleSheet.create({
@@ -338,226 +166,12 @@ const detailStyles = react_native_1.StyleSheet.create({
338
166
  paddingTop: 0,
339
167
  paddingBottom: 40,
340
168
  },
341
- hero: {
342
- paddingTop: 0,
343
- paddingBottom: 16,
344
- paddingHorizontal: 0,
345
- gap: 8,
346
- marginTop: 0,
347
- marginBottom: 0,
348
- width: '100%',
349
- alignSelf: 'stretch',
350
- },
351
- searchRow: {
352
- paddingHorizontal: 16,
353
- marginVertical: 6,
354
- },
355
- sectionCard: {
356
- marginHorizontal: 0,
357
- borderRadius: 12,
358
- overflow: 'hidden',
359
- borderWidth: 1,
360
- borderColor: AppColors_1.AppColors.grayBorderSecondary,
361
- backgroundColor: AppColors_1.AppColors.primaryLight,
362
- shadowColor: '#000',
363
- shadowOpacity: 0.04,
364
- shadowRadius: 4,
365
- shadowOffset: { width: 0, height: 1 },
366
- elevation: 1,
367
- },
368
- sectionHeader: {
369
- flexDirection: 'row',
370
- alignItems: 'center',
371
- justifyContent: 'space-between',
372
- paddingHorizontal: 14,
373
- paddingVertical: 12,
374
- },
375
- sectionTitleRow: {
376
- flexDirection: 'row',
377
- alignItems: 'center',
378
- gap: 8,
379
- flex: 1,
380
- },
381
- sectionAccentDot: {
382
- width: 8,
383
- height: 8,
384
- borderRadius: 4,
385
- },
386
- sectionTitle: {
387
- fontFamily: AppFonts_1.AppFonts.interBold,
388
- fontSize: 13,
389
- color: AppColors_1.AppColors.primaryBlack,
390
- },
391
- sectionActions: {
392
- flexDirection: 'row',
393
- alignItems: 'center',
394
- gap: 6,
395
- },
396
- countBadge: {
397
- paddingHorizontal: 7,
398
- paddingVertical: 2,
399
- borderRadius: 8,
400
- borderWidth: 1,
401
- },
402
- countBadgeText: {
403
- fontFamily: AppFonts_1.AppFonts.interBold,
404
- fontSize: 10,
405
- },
406
- paramList: {
407
- gap: 8,
408
- },
409
- emptyParams: {
410
- marginVertical: 12,
411
- paddingVertical: 18,
412
- paddingHorizontal: 14,
413
- borderRadius: 10,
414
- borderWidth: 1,
415
- borderColor: AppColors_1.AppColors.grayBorderSecondary,
416
- backgroundColor: AppColors_1.AppColors.primaryLight,
417
- alignItems: 'center',
418
- justifyContent: 'center',
419
- },
420
- emptyParamsText: {
421
- fontFamily: AppFonts_1.AppFonts.interMedium,
422
- fontSize: 13,
423
- color: AppColors_1.AppColors.grayTextWeak,
424
- textAlign: 'center',
425
- lineHeight: 18,
426
- },
427
- dataBox: {
428
- backgroundColor: '#FFFFFF',
429
- borderRadius: 8,
430
- borderWidth: 1,
431
- borderColor: '#E5E7EB',
432
- padding: 12,
433
- },
434
- dataBoxHeader: {
435
- flexDirection: 'row',
436
- justifyContent: 'space-between',
437
- alignItems: 'center',
438
- marginBottom: 8,
439
- },
440
- dataBoxKey: {
441
- fontFamily: AppFonts_1.AppFonts.interBold,
442
- fontWeight: 'bold',
443
- fontSize: 13,
444
- color: AppColors_1.AppColors.primaryBlack,
445
- flex: 1,
446
- paddingRight: 8,
447
- },
448
- dataBoxVal: {
449
- fontFamily: AppFonts_1.AppFonts.interRegular,
450
- fontSize: 13,
451
- color: AppColors_1.AppColors.primaryBlack,
452
- lineHeight: 18,
453
- },
454
- showMoreBtn: {
455
- marginTop: 8,
456
- alignSelf: 'flex-start',
457
- backgroundColor: '#F3F4F6',
458
- paddingHorizontal: 10,
459
- paddingVertical: 4,
460
- borderRadius: 4,
461
- },
462
- showMoreText: {
463
- fontFamily: AppFonts_1.AppFonts.interMedium,
464
- fontSize: 11,
465
- color: '#4B5563', // matching previous UI color
466
- },
467
- jsonBlock: {
468
- padding: 12,
469
- borderWidth: 1,
470
- borderColor: '#E0E7FF',
471
- borderRadius: 8,
472
- backgroundColor: '#EEF2FF',
473
- },
474
- metricsScroll: {
475
- height: 92,
476
- overflow: 'visible',
477
- },
478
- metricsGrid: {
479
- gap: 8,
480
- marginTop: 4,
481
- paddingHorizontal: 16,
482
- paddingBottom: 14,
483
- },
484
- metricCard: {
485
- backgroundColor: '#FFFFFF',
486
- paddingVertical: 8,
487
- paddingHorizontal: 10,
488
- borderRadius: 6,
489
- borderLeftWidth: 3,
490
- width: 130, // fixed width for horizontal scrolling
491
- shadowColor: '#000',
492
- shadowOpacity: 0.04,
493
- shadowRadius: 4,
494
- shadowOffset: { width: 0, height: 2 },
495
- elevation: 2,
496
- alignItems: 'flex-start',
497
- },
498
- metricLabel: {
499
- fontFamily: AppFonts_1.AppFonts.interMedium,
500
- fontSize: 10,
501
- color: AppColors_1.AppColors.grayTextWeak,
502
- textTransform: 'uppercase',
503
- marginBottom: 4,
504
- },
505
- metricValue: {
506
- fontFamily: AppFonts_1.AppFonts.interBold,
507
- fontSize: 13,
508
- },
509
- tabRow: {
510
- flexDirection: 'row',
169
+ jsonBlockContainer: {
511
170
  marginHorizontal: 16,
512
- marginTop: 6,
513
- backgroundColor: '#E5E7EB',
514
- borderRadius: 8,
515
- padding: 4,
516
- },
517
- tabButton: {
518
- flex: 1,
519
- flexDirection: 'row',
520
- alignItems: 'center',
521
- justifyContent: 'center',
522
- paddingVertical: 8,
523
- borderRadius: 6,
524
- gap: 6,
525
- },
526
- tabActive: {
527
- backgroundColor: '#FFFFFF',
528
- shadowColor: '#000',
529
- shadowOpacity: 0.1,
530
- shadowRadius: 2,
531
- shadowOffset: { width: 0, height: 1 },
532
- elevation: 2,
533
- },
534
- tabText: {
535
- fontFamily: AppFonts_1.AppFonts.interMedium,
536
- fontSize: 13,
537
- color: AppColors_1.AppColors.grayTextWeak,
538
- },
539
- tabTextActive: {
540
- fontFamily: AppFonts_1.AppFonts.interBold,
541
- color: AppColors_1.AppColors.primaryBlack,
542
- },
543
- tabBadge: {
544
- backgroundColor: '#D1D5DB',
545
- paddingHorizontal: 6,
546
- paddingVertical: 2,
547
- borderRadius: 10,
548
- },
549
- tabBadgeActive: {
550
- backgroundColor: AppColors_1.AppColors.primaryLight,
171
+ marginTop: 16,
172
+ marginBottom: 16,
551
173
  borderWidth: 1,
552
- borderColor: '#E5E7EB',
553
- },
554
- tabBadgeText: {
555
- fontFamily: AppFonts_1.AppFonts.interBold,
556
- fontSize: 10,
557
- color: '#6B7280',
558
- },
559
- tabBadgeTextActive: {
560
- color: AppColors_1.AppColors.primaryBlack,
174
+ borderRadius: 12,
561
175
  },
562
176
  });
563
177
  exports.default = AnalyticsDetail;
@@ -175,34 +175,34 @@ const AnalyticsEventCard = react_1.default.memo(function AnalyticsEventCard({ ev
175
175
  {userPropCount > 0 && (<react_native_1.View style={[cardStyles.chip, { backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
176
176
  <react_native_1.Text style={[cardStyles.chipText, { color: AppColors_1.AppColors.grayText }]}>★ {userPropCount} props</react_native_1.Text>
177
177
  </react_native_1.View>)}
178
- </react_native_1.View>
179
178
 
180
- {/* Inline Mini Graph for E-commerce Items */}
181
- {(() => {
179
+ {(() => {
182
180
  const items = event.params?.items;
183
- if (!Array.isArray(items) || items.length === 0)
184
- return null;
185
- const prices = items
186
- .map((item) => parseFloat(item.price || item.value))
187
- .filter(p => !isNaN(p));
188
- if (prices.length === 0)
189
- return null;
190
- const max = Math.max(...prices);
191
- if (max === 0)
192
- return null;
193
- return (<react_native_1.View style={cardStyles.miniGraphWrapper}>
194
- {prices.map((val, idx) => {
195
- const hPct = (val / max) * 100;
196
- return (<react_native_1.View key={idx} style={[
197
- cardStyles.miniGraphBar,
198
- {
199
- height: `${Math.max(15, hPct)}%`,
200
- backgroundColor: color,
201
- },
202
- ]}/>);
203
- })}
204
- </react_native_1.View>);
181
+ if (Array.isArray(items) && items.length > 0) {
182
+ return (<react_native_1.View style={[cardStyles.chip, { backgroundColor: '#FEF3C7', borderColor: '#FDE68A' }]}>
183
+ <react_native_1.Text style={[cardStyles.chipText, { color: '#D97706', fontFamily: AppFonts_1.AppFonts.interBold }]}>
184
+ 🛒 {items.length} {items.length === 1 ? 'item' : 'items'}
185
+ </react_native_1.Text>
186
+ </react_native_1.View>);
187
+ }
188
+ return null;
189
+ })()}
190
+
191
+ {(() => {
192
+ const val = event.params?.value ?? event.params?.price;
193
+ const currency = event.params?.currency ?? '';
194
+ const isPrimitive = typeof val === 'string' || typeof val === 'number';
195
+ if (isPrimitive) {
196
+ const currencyStr = typeof currency === 'string' || typeof currency === 'number' ? String(currency) : '';
197
+ return (<react_native_1.View style={[cardStyles.chip, { backgroundColor: '#ECFDF5', borderColor: '#A7F3D0' }]}>
198
+ <react_native_1.Text style={[cardStyles.chipText, { color: '#059669', fontFamily: AppFonts_1.AppFonts.interBold }]}>
199
+ 💰 {String(val)} {currencyStr}
200
+ </react_native_1.Text>
201
+ </react_native_1.View>);
202
+ }
203
+ return null;
205
204
  })()}
205
+ </react_native_1.View>
206
206
  </react_native_1.View>
207
207
  </TouchableScale_1.default>
208
208
  </react_native_1.View>);