react-native-inapp-inspector 1.1.1 → 1.1.2

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,8 +1,9 @@
1
1
  import React from 'react';
2
- declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, }: {
2
+ declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, wrap, }: {
3
3
  data: unknown;
4
4
  search?: string;
5
5
  forceOpen?: boolean;
6
6
  defaultExpandDepth?: number;
7
+ wrap?: boolean;
7
8
  }) => React.JSX.Element;
8
9
  export default JsonViewer;
@@ -9,11 +9,13 @@ const react_native_1 = require("react-native");
9
9
  const TreeNode_1 = __importDefault(require("./TreeNode"));
10
10
  // Stylesheet
11
11
  const styles_1 = __importDefault(require("../styles"));
12
- const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, }) => {
12
+ const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, }) => {
13
+ const tree = (<TreeNode_1.default data={data} search={search} forceOpen={forceOpen} defaultExpandDepth={defaultExpandDepth}/>);
14
+ if (wrap) {
15
+ return <react_native_1.View style={[styles_1.default.codeBlock, { width: '100%' }]}>{tree}</react_native_1.View>;
16
+ }
13
17
  return (<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={true} style={styles_1.default.codeBlockScroll}>
14
- <react_native_1.View style={styles_1.default.codeBlock}>
15
- <TreeNode_1.default data={data} search={search} forceOpen={forceOpen} defaultExpandDepth={defaultExpandDepth}/>
16
- </react_native_1.View>
18
+ <react_native_1.View style={styles_1.default.codeBlock}>{tree}</react_native_1.View>
17
19
  </react_native_1.ScrollView>);
18
20
  };
19
21
  exports.default = JsonViewer;
@@ -45,7 +45,7 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, metho
45
45
  </react_native_1.Text>
46
46
  </react_native_1.View>
47
47
  <react_native_1.View style={styles_1.default.metaDivider}/>
48
-
48
+
49
49
  <react_native_1.View style={styles_1.default.metaRow}>
50
50
  <react_native_1.View style={styles_1.default.metaLabelRow}>
51
51
  <NetworkIcons_1.TerminalIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
@@ -56,9 +56,12 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, metho
56
56
  {
57
57
  borderColor: 'rgba(107, 78, 255, 0.25)',
58
58
  backgroundColor: 'rgba(107, 78, 255, 0.08)',
59
- }
59
+ },
60
+ ]}>
61
+ <react_native_1.Text style={[
62
+ styles_1.default.statusText,
63
+ { color: AppColors_1.AppColors.purple, fontFamily: AppFonts_1.AppFonts.interBold },
60
64
  ]}>
61
- <react_native_1.Text style={[styles_1.default.statusText, { color: AppColors_1.AppColors.purple, fontFamily: AppFonts_1.AppFonts.interBold }]}>
62
65
  {method || 'GET'}
63
66
  </react_native_1.Text>
64
67
  </react_native_1.View>
@@ -96,7 +99,9 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, metho
96
99
  <NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
97
100
  <react_native_1.Text style={styles_1.default.metaLabel}>Content Type</react_native_1.Text>
98
101
  </react_native_1.View>
99
- <react_native_1.Text style={styles_1.default.metaValue}>{contentType || 'application/json'}</react_native_1.Text>
102
+ <react_native_1.Text style={styles_1.default.metaValue}>
103
+ {contentType || 'application/json'}
104
+ </react_native_1.Text>
100
105
  </react_native_1.View>
101
106
  <react_native_1.View style={styles_1.default.metaDivider}/>
102
107
 
@@ -130,7 +135,7 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, metho
130
135
  </react_native_1.View>
131
136
  </react_native_1.View>
132
137
  <react_native_1.View style={styles_1.default.metaDivider}/>
133
-
138
+
134
139
  <react_native_1.View style={styles_1.default.metaRow}>
135
140
  <react_native_1.View style={styles_1.default.metaLabelRow}>
136
141
  <NetworkIcons_1.SizeIcon color={AppColors_1.AppColors.grayTextWeak}/>
@@ -145,7 +150,22 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, metho
145
150
  <NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
146
151
  <react_native_1.Text style={styles_1.default.metaLabel}>Full URL</react_native_1.Text>
147
152
  </react_native_1.View>
148
- <react_native_1.Text selectable={true} numberOfLines={3} ellipsizeMode="tail" style={[styles_1.default.metaValue, { fontSize: 11.5, color: AppColors_1.AppColors.grayTextWeak, flex: 1, textAlign: 'right', lineHeight: 16 }]}>
153
+ <react_native_1.Text selectable={true} numberOfLines={3} ellipsizeMode="tail" onPress={() => {
154
+ if (url) {
155
+ react_native_1.Linking.openURL(url).catch(() => { });
156
+ }
157
+ }} style={[
158
+ styles_1.default.metaValue,
159
+ {
160
+ fontSize: 11.5,
161
+ color: url ? AppColors_1.AppColors.purple : AppColors_1.AppColors.grayTextWeak,
162
+ textDecorationLine: url ? 'underline' : 'none',
163
+ fontFamily: AppFonts_1.AppFonts.interMedium,
164
+ flex: 1,
165
+ textAlign: 'right',
166
+ lineHeight: 16,
167
+ },
168
+ ]}>
149
169
  {url || '—'}
150
170
  </react_native_1.Text>
151
171
  </react_native_1.View>
@@ -44,6 +44,44 @@ const AppFonts_1 = require("../styles/AppFonts");
44
44
  const NetworkIcons_1 = require("./NetworkIcons");
45
45
  const react_native_svg_1 = __importStar(require("react-native-svg"));
46
46
  const AnimatedEntrance_1 = __importDefault(require("./AnimatedEntrance"));
47
+ const helpers_1 = require("../helpers");
48
+ // #15 — copy-to-clipboard control for a single dispatched action
49
+ const ActionCopyButton = ({ value }) => {
50
+ const [copied, setCopied] = (0, react_1.useState)(false);
51
+ return (<react_native_1.Pressable hitSlop={10} onPress={() => {
52
+ (0, helpers_1.copyToClipboard)(value(), 'Action');
53
+ setCopied(true);
54
+ setTimeout(() => setCopied(false), 1200);
55
+ }} style={{
56
+ width: 26,
57
+ height: 26,
58
+ borderRadius: 7,
59
+ alignItems: 'center',
60
+ justifyContent: 'center',
61
+ backgroundColor: copied
62
+ ? `${AppColors_1.AppColors.greenColor}1A`
63
+ : AppColors_1.AppColors.grayBackground,
64
+ borderWidth: 1,
65
+ borderColor: AppColors_1.AppColors.dividerColor,
66
+ }}>
67
+ {copied ? (<NetworkIcons_1.CheckIcon color={AppColors_1.AppColors.greenColor} size={13}/>) : (<NetworkIcons_1.CopyIcon color={AppColors_1.AppColors.grayTextWeak} size={13}/>)}
68
+ </react_native_1.Pressable>);
69
+ };
70
+ // #15 — derive the redux module / folder name from an action type.
71
+ // Supports RTK slice convention ("booking/setDate" -> "Booking") and
72
+ // falls back to the first affected slice.
73
+ const getActionModule = (type, affectedSlices) => {
74
+ if (type && type.includes('/')) {
75
+ const prefix = type.split('/')[0];
76
+ if (prefix)
77
+ return prefix.charAt(0).toUpperCase() + prefix.slice(1);
78
+ }
79
+ if (affectedSlices && affectedSlices.length > 0) {
80
+ const s = affectedSlices[0];
81
+ return s.charAt(0).toUpperCase() + s.slice(1);
82
+ }
83
+ return null;
84
+ };
47
85
  // Custom icons
48
86
  const DatabaseIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 12 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
49
87
  <react_native_svg_1.Path d="M12 2C6.5 2 2 4.2 2 7v10c0 2.8 4.5 5 10 5s10-2.2 10-5V7c0-2.8-4.5-5-10-5z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
@@ -353,12 +391,49 @@ const ReduxActionTimeline = ({ history, onClear, search, }) => {
353
391
  },
354
392
  ]}>
355
393
  <react_native_1.View style={timelineStyles.cardHeader}>
356
- <react_native_1.View style={timelineStyles.typeBadge}>
357
- <react_native_1.Text style={timelineStyles.typeText}>{item.type}</react_native_1.Text>
394
+ <react_native_1.View style={{
395
+ flexDirection: 'row',
396
+ alignItems: 'center',
397
+ gap: 6,
398
+ flex: 1,
399
+ }}>
400
+ {(() => {
401
+ const moduleName = getActionModule(item.type, item.affectedSlices);
402
+ return moduleName ? (<react_native_1.View style={{
403
+ paddingHorizontal: 7,
404
+ paddingVertical: 2,
405
+ borderRadius: 6,
406
+ backgroundColor: `${AppColors_1.AppColors.purple}14`,
407
+ borderWidth: 1,
408
+ borderColor: `${AppColors_1.AppColors.purple}33`,
409
+ }}>
410
+ <react_native_1.Text style={{
411
+ fontFamily: AppFonts_1.AppFonts.interBold,
412
+ fontSize: 9.5,
413
+ color: AppColors_1.AppColors.purple,
414
+ letterSpacing: 0.2,
415
+ }}>
416
+ {moduleName}
417
+ </react_native_1.Text>
418
+ </react_native_1.View>) : null;
419
+ })()}
420
+ <react_native_1.View style={timelineStyles.typeBadge}>
421
+ <react_native_1.Text style={timelineStyles.typeText}>{item.type}</react_native_1.Text>
422
+ </react_native_1.View>
423
+ </react_native_1.View>
424
+ <react_native_1.View style={{
425
+ flexDirection: 'row',
426
+ alignItems: 'center',
427
+ gap: 8,
428
+ }}>
429
+ <react_native_1.Text style={timelineStyles.timestamp}>
430
+ {item.timestamp}
431
+ </react_native_1.Text>
432
+ <ActionCopyButton value={() => ({
433
+ type: item.type,
434
+ payload: item.payload,
435
+ })}/>
358
436
  </react_native_1.View>
359
- <react_native_1.Text style={timelineStyles.timestamp}>
360
- {item.timestamp}
361
- </react_native_1.Text>
362
437
  </react_native_1.View>
363
438
 
364
439
  {item.affectedSlices.length > 0 && (<react_native_1.View style={timelineStyles.slicesRow}>
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.1.1";
1
+ export declare const LIB_VERSION = "1.1.2";
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
4
  // AUTO-GENERATED FILE — do not edit by hand.
5
5
  // Regenerated from package.json on every build by scripts/gen-version.js.
6
- exports.LIB_VERSION = '1.1.1';
6
+ exports.LIB_VERSION = '1.1.2';