@buoy-gg/highlight-updates 7.0.41 → 7.0.42

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 (108) hide show
  1. package/README.md +11 -71
  2. package/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +1 -281
  3. package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1 -1474
  4. package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +1 -641
  5. package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +1 -273
  6. package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +1 -188
  7. package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +1 -293
  8. package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +1 -508
  9. package/lib/commonjs/highlight-updates/components/RenderDetailView.js +1 -846
  10. package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +1 -915
  11. package/lib/commonjs/highlight-updates/components/RenderListItem.js +1 -235
  12. package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +1 -469
  13. package/lib/commonjs/highlight-updates/components/StatsDisplay.js +1 -73
  14. package/lib/commonjs/highlight-updates/types/copySettings.js +1 -107
  15. package/lib/commonjs/highlight-updates/utils/CommitProfiler.js +1 -455
  16. package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1 -1929
  17. package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +26 -359
  18. package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +1 -371
  19. package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +5 -1840
  20. package/lib/commonjs/highlight-updates/utils/RenderTracker.js +1 -952
  21. package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +1 -264
  22. package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +1 -32
  23. package/lib/commonjs/highlight-updates/utils/devtoolsComponentNames.js +1 -188
  24. package/lib/commonjs/highlight-updates/utils/namedComposite.js +1 -41
  25. package/lib/commonjs/highlight-updates/utils/ownStateChanged.js +1 -103
  26. package/lib/commonjs/highlight-updates/utils/rawEventEmitter.js +1 -50
  27. package/lib/commonjs/highlight-updates/utils/rawEventEmitter.web.js +1 -12
  28. package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +1 -58
  29. package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +1 -485
  30. package/lib/commonjs/highlight-updates/utils/screenElements.js +1 -1269
  31. package/lib/commonjs/highlight-updates/utils/tapMatch.js +1 -83
  32. package/lib/commonjs/highlight-updates/utils/testIDs.js +1 -68
  33. package/lib/commonjs/highlight-updates/utils/touchCapture.js +1 -277
  34. package/lib/commonjs/index.js +1 -429
  35. package/lib/commonjs/preset.js +1 -278
  36. package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +1 -235
  37. package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +1 -274
  38. package/lib/module/highlight-updates/components/HighlightFilterView.js +1 -1468
  39. package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +1 -634
  40. package/lib/module/highlight-updates/components/IdentifierBadge.js +1 -265
  41. package/lib/module/highlight-updates/components/IsolatedRenderList.js +1 -183
  42. package/lib/module/highlight-updates/components/ModalHeaderContent.js +1 -288
  43. package/lib/module/highlight-updates/components/RenderCauseBadge.js +1 -499
  44. package/lib/module/highlight-updates/components/RenderDetailView.js +1 -840
  45. package/lib/module/highlight-updates/components/RenderHistoryViewer.js +1 -908
  46. package/lib/module/highlight-updates/components/RenderListItem.js +1 -230
  47. package/lib/module/highlight-updates/components/RendersCopySettingsView.js +1 -465
  48. package/lib/module/highlight-updates/components/StatsDisplay.js +1 -70
  49. package/lib/module/highlight-updates/types/copySettings.js +1 -102
  50. package/lib/module/highlight-updates/utils/CommitProfiler.js +1 -451
  51. package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1 -1925
  52. package/lib/module/highlight-updates/utils/PerformanceLogger.js +26 -353
  53. package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +1 -358
  54. package/lib/module/highlight-updates/utils/RenderCauseDetector.js +5 -1830
  55. package/lib/module/highlight-updates/utils/RenderTracker.js +1 -949
  56. package/lib/module/highlight-updates/utils/ViewTypeMapper.js +1 -255
  57. package/lib/module/highlight-updates/utils/copySettingsStorage.js +1 -26
  58. package/lib/module/highlight-updates/utils/devtoolsComponentNames.js +1 -178
  59. package/lib/module/highlight-updates/utils/namedComposite.js +1 -36
  60. package/lib/module/highlight-updates/utils/ownStateChanged.js +1 -98
  61. package/lib/module/highlight-updates/utils/rawEventEmitter.js +1 -46
  62. package/lib/module/highlight-updates/utils/rawEventEmitter.web.js +1 -3
  63. package/lib/module/highlight-updates/utils/renderExportFormatter.js +1 -54
  64. package/lib/module/highlight-updates/utils/rendersExportFormatter.js +1 -478
  65. package/lib/module/highlight-updates/utils/screenElements.js +1 -1263
  66. package/lib/module/highlight-updates/utils/tapMatch.js +1 -76
  67. package/lib/module/highlight-updates/utils/testIDs.js +1 -60
  68. package/lib/module/highlight-updates/utils/touchCapture.js +1 -270
  69. package/lib/module/index.js +1 -130
  70. package/lib/module/preset.js +1 -272
  71. package/lib/module/sync/highlightUpdatesSyncAdapter.js +1 -230
  72. package/lib/web/index.mjs +28 -29
  73. package/package.json +7 -7
  74. package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +0 -1
  75. package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +0 -1
  76. package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +0 -1
  77. package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +0 -1
  78. package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +0 -1
  79. package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +0 -1
  80. package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +0 -1
  81. package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +0 -1
  82. package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +0 -1
  83. package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +0 -1
  84. package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +0 -1
  85. package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +0 -1
  86. package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +0 -1
  87. package/lib/typescript/highlight-updates/utils/CommitProfiler.d.ts.map +0 -1
  88. package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +0 -1
  89. package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +0 -1
  90. package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +0 -1
  91. package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +0 -1
  92. package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +0 -1
  93. package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +0 -1
  94. package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +0 -1
  95. package/lib/typescript/highlight-updates/utils/devtoolsComponentNames.d.ts.map +0 -1
  96. package/lib/typescript/highlight-updates/utils/namedComposite.d.ts.map +0 -1
  97. package/lib/typescript/highlight-updates/utils/ownStateChanged.d.ts.map +0 -1
  98. package/lib/typescript/highlight-updates/utils/rawEventEmitter.d.ts.map +0 -1
  99. package/lib/typescript/highlight-updates/utils/rawEventEmitter.web.d.ts.map +0 -1
  100. package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +0 -1
  101. package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +0 -1
  102. package/lib/typescript/highlight-updates/utils/screenElements.d.ts.map +0 -1
  103. package/lib/typescript/highlight-updates/utils/tapMatch.d.ts.map +0 -1
  104. package/lib/typescript/highlight-updates/utils/testIDs.d.ts.map +0 -1
  105. package/lib/typescript/highlight-updates/utils/touchCapture.d.ts.map +0 -1
  106. package/lib/typescript/index.d.ts.map +0 -1
  107. package/lib/typescript/preset.d.ts.map +0 -1
  108. package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +0 -1
@@ -1,508 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.COMPONENT_CAUSE_CONFIG = exports.CAUSE_CONFIG = void 0;
7
- exports.EnhancedCauseDisplay = EnhancedCauseDisplay;
8
- exports.RenderCauseBadge = RenderCauseBadge;
9
- exports.TwoLevelCauseBadge = TwoLevelCauseBadge;
10
- exports.default = void 0;
11
- var _react = _interopRequireDefault(require("react"));
12
- var _reactNative = require("react-native");
13
- var _sharedUi = require("@buoy-gg/shared-ui");
14
- var _jsxRuntime = require("react/jsx-runtime");
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- /**
17
- * RenderCauseBadge
18
- *
19
- * Displays a colored badge indicating why a component rendered.
20
- * Used in RenderListItem and RenderDetailView.
21
- *
22
- * TWO-LEVEL CAUSATION:
23
- * Shows both the native-level cause (what props changed on the native view)
24
- * and the component-level cause (why the React component re-rendered).
25
- */
26
-
27
- // Badge configuration for each cause type
28
-
29
- const CAUSE_CONFIG = exports.CAUSE_CONFIG = {
30
- mount: {
31
- label: "MOUNT",
32
- color: _sharedUi.buoyColors.success,
33
- tip: "First render of this component."
34
- },
35
- props: {
36
- label: "PROPS",
37
- color: _sharedUi.buoyColors.warning,
38
- tip: "Native props changed. Consider React.memo() or useCallback for handlers."
39
- },
40
- state: {
41
- label: "STATE",
42
- color: "#a855f7",
43
- // purple
44
- tip: "Component state changed via setState."
45
- },
46
- hooks: {
47
- label: "HOOKS",
48
- color: "#ec4899",
49
- // pink
50
- tip: "Hook values changed (useState, useReducer, useMemo, etc.)."
51
- },
52
- context: {
53
- label: "CONTEXT",
54
- color: "#06b6d4",
55
- // cyan
56
- tip: "React context value changed."
57
- },
58
- parent: {
59
- label: "PARENT",
60
- color: _sharedUi.buoyColors.textSecondary,
61
- tip: "Parent component re-rendered. Consider wrapping with React.memo()."
62
- },
63
- unknown: {
64
- label: "?",
65
- color: _sharedUi.buoyColors.textMuted,
66
- tip: "Could not determine render cause."
67
- }
68
- };
69
-
70
- // Component-level cause configuration
71
- const COMPONENT_CAUSE_CONFIG = exports.COMPONENT_CAUSE_CONFIG = {
72
- mount: {
73
- label: "mount",
74
- color: _sharedUi.buoyColors.success,
75
- tip: "First render of this component."
76
- },
77
- props: {
78
- label: "props",
79
- color: _sharedUi.buoyColors.warning,
80
- tip: "Component received different props from parent."
81
- },
82
- state: {
83
- label: "state",
84
- color: "#a855f7",
85
- // purple
86
- tip: "Component's own state changed (useState/useReducer)."
87
- },
88
- parent: {
89
- label: "parent",
90
- color: _sharedUi.buoyColors.textSecondary,
91
- tip: "Parent re-rendered but this component's props/state didn't change. Consider React.memo()."
92
- },
93
- unknown: {
94
- label: "?",
95
- color: _sharedUi.buoyColors.textMuted,
96
- tip: "Could not determine component render cause."
97
- }
98
- };
99
- function RenderCauseBadge({
100
- cause,
101
- compact = false,
102
- showKeys = false,
103
- showTwoLevel = false,
104
- testID
105
- }) {
106
- const config = CAUSE_CONFIG[cause.type];
107
- const componentConfig = cause.componentCause ? COMPONENT_CAUSE_CONFIG[cause.componentCause] : null;
108
-
109
- // For two-level display: "Component (parent) → Native (PROPS)"
110
- const showComponentCause = showTwoLevel && componentConfig && cause.componentCause !== cause.type;
111
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
112
- nativeID: "__rn_buoy__cause-badge",
113
- testID: testID,
114
- style: [styles.container, compact && styles.containerCompact],
115
- children: [showComponentCause && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
116
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
117
- style: [styles.badge, compact && styles.badgeCompact, styles.componentBadge, {
118
- backgroundColor: componentConfig.color + "15"
119
- }],
120
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
121
- testID: testID ? `${testID}-component` : undefined,
122
- style: [styles.badgeText, compact && styles.badgeTextCompact, styles.componentBadgeText, {
123
- color: componentConfig.color
124
- }],
125
- children: componentConfig.label
126
- })
127
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
128
- style: [styles.arrowText, compact && styles.arrowTextCompact],
129
- children: "\u2192"
130
- })]
131
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
132
- style: [styles.badge, compact && styles.badgeCompact, {
133
- backgroundColor: config.color + "20"
134
- }],
135
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
136
- testID: testID ? `${testID}-native` : undefined,
137
- style: [styles.badgeText, compact && styles.badgeTextCompact, {
138
- color: config.color
139
- }],
140
- children: config.label
141
- })
142
- }), showKeys && cause.changedKeys && cause.changedKeys.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
143
- testID: testID ? `${testID}-keys` : undefined,
144
- style: [styles.keysText, compact && styles.keysTextCompact],
145
- numberOfLines: 1,
146
- children: cause.changedKeys.join(", ")
147
- }), showKeys && cause.hookIndices && cause.hookIndices.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
148
- testID: testID ? `${testID}-hooks` : undefined,
149
- style: [styles.keysText, compact && styles.keysTextCompact],
150
- numberOfLines: 1,
151
- children: ["Hook ", cause.hookIndices.join(", ")]
152
- })]
153
- });
154
- }
155
-
156
- /**
157
- * TwoLevelCauseBadge - A more detailed badge for detail views
158
- * Shows: "ComponentName re-rendered due to PARENT → native PROPS [style]"
159
- */
160
- function TwoLevelCauseBadge({
161
- cause
162
- }) {
163
- const nativeConfig = CAUSE_CONFIG[cause.type];
164
- const componentConfig = cause.componentCause ? COMPONENT_CAUSE_CONFIG[cause.componentCause] : null;
165
- const componentName = cause.componentName || "Component";
166
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
167
- nativeID: "__rn_buoy__two-level-cause",
168
- style: styles.twoLevelContainer,
169
- children: [componentConfig && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
170
- style: styles.twoLevelRow,
171
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
172
- style: styles.twoLevelLabel,
173
- children: "Component:"
174
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
175
- style: styles.twoLevelName,
176
- children: componentName
177
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
178
- style: styles.twoLevelText,
179
- children: "re-rendered due to"
180
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
181
- style: [styles.badge, {
182
- backgroundColor: componentConfig.color + "20"
183
- }],
184
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
185
- style: [styles.badgeText, {
186
- color: componentConfig.color
187
- }],
188
- children: componentConfig.label.toUpperCase()
189
- })
190
- })]
191
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
192
- style: styles.twoLevelRow,
193
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
194
- style: styles.twoLevelLabel,
195
- children: "Native:"
196
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
197
- style: [styles.badge, {
198
- backgroundColor: nativeConfig.color + "20"
199
- }],
200
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
201
- style: [styles.badgeText, {
202
- color: nativeConfig.color
203
- }],
204
- children: nativeConfig.label
205
- })
206
- }), cause.changedKeys && cause.changedKeys.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
207
- style: styles.twoLevelKeys,
208
- children: ["[", cause.changedKeys.join(", "), "]"]
209
- })]
210
- })]
211
- });
212
- }
213
-
214
- /**
215
- * EnhancedCauseDisplay - Phase 5: Comprehensive cause display
216
- * Shows detailed breakdown of why a component rendered with clear sections
217
- */
218
- function EnhancedCauseDisplay({
219
- cause,
220
- nativeType
221
- }) {
222
- const nativeConfig = CAUSE_CONFIG[cause.type];
223
- const componentConfig = cause.componentCause ? COMPONENT_CAUSE_CONFIG[cause.componentCause] : null;
224
- const componentName = cause.componentName || "Unknown";
225
- const hasHookChanges = cause.hookChanges && cause.hookChanges.length > 0;
226
- const hasChangedKeys = cause.changedKeys && cause.changedKeys.length > 0;
227
-
228
- // Separate ref-only changes from actual value changes
229
- const refOnlyChanges = cause.changedKeys?.filter(k => k.includes("(ref only)") || k.includes("(fn ref)")) || [];
230
- const valueChanges = cause.changedKeys?.filter(k => !k.includes("(ref only)") && !k.includes("(fn ref)")) || [];
231
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
232
- nativeID: "__rn_buoy__enhanced-cause",
233
- style: styles.enhancedContainer,
234
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
235
- style: styles.enhancedHeader,
236
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
237
- style: styles.enhancedComponentName,
238
- children: componentName
239
- }), nativeType && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
240
- style: styles.enhancedNativeTag,
241
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
242
- style: styles.enhancedNativeTagText,
243
- children: nativeType
244
- })
245
- })]
246
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
247
- style: styles.enhancedFlowContainer,
248
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
249
- style: styles.enhancedFlowLabel,
250
- children: "Cause:"
251
- }), componentConfig && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
252
- style: [styles.enhancedFlowBadge, {
253
- backgroundColor: componentConfig.color + "20"
254
- }],
255
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
256
- style: [styles.enhancedFlowBadgeText, {
257
- color: componentConfig.color
258
- }],
259
- children: componentConfig.label.toUpperCase()
260
- })
261
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
262
- style: styles.enhancedFlowArrow,
263
- children: "\u2192"
264
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
265
- style: [styles.enhancedFlowBadge, {
266
- backgroundColor: nativeConfig.color + "20"
267
- }],
268
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
269
- style: [styles.enhancedFlowBadgeText, {
270
- color: nativeConfig.color
271
- }],
272
- children: nativeConfig.label
273
- })
274
- })]
275
- }), hasHookChanges && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
276
- style: styles.enhancedSection,
277
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
278
- style: styles.enhancedSectionTitle,
279
- children: "Component State Changed:"
280
- }), cause.hookChanges.map(hook => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
281
- style: styles.enhancedChangeRow,
282
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
283
- style: styles.enhancedChangeIcon,
284
- children: "\u26A1"
285
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
286
- style: styles.enhancedChangeText,
287
- children: ["Hook[", hook.index, "] (", hook.type, "): ", hook.description]
288
- })]
289
- }, hook.index))]
290
- }), valueChanges.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
291
- style: styles.enhancedSection,
292
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
293
- style: styles.enhancedSectionTitle,
294
- children: "Native Props Changed:"
295
- }), valueChanges.map((key, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
296
- style: styles.enhancedChangeRow,
297
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
298
- style: styles.enhancedChangeIcon,
299
- children: "~"
300
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
301
- style: styles.enhancedChangeText,
302
- children: key
303
- })]
304
- }, index))]
305
- }), refOnlyChanges.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
306
- style: styles.enhancedSection,
307
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
308
- style: [styles.enhancedSectionTitle, {
309
- color: _sharedUi.night.color.textTertiary
310
- }],
311
- children: "Reference Changes (optimization opportunity):"
312
- }), refOnlyChanges.map((key, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
313
- style: styles.enhancedChangeRow,
314
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
315
- style: [styles.enhancedChangeIcon, {
316
- color: _sharedUi.night.color.textTertiary
317
- }],
318
- children: "\u25CB"
319
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
320
- style: [styles.enhancedChangeText, {
321
- color: _sharedUi.night.color.textTertiary
322
- }],
323
- children: key
324
- })]
325
- }, index))]
326
- }), !hasHookChanges && !hasChangedKeys && cause.type !== "mount" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
327
- style: styles.enhancedSection,
328
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
329
- style: styles.enhancedNoChanges,
330
- children: cause.type === "parent" ? "Parent re-rendered (consider React.memo)" : "No specific changes detected"
331
- })
332
- })]
333
- });
334
- }
335
- const styles = _reactNative.StyleSheet.create({
336
- container: {
337
- flexDirection: "row",
338
- alignItems: "center",
339
- gap: 6
340
- },
341
- containerCompact: {
342
- gap: 4
343
- },
344
- badge: {
345
- paddingVertical: 3,
346
- paddingHorizontal: 6,
347
- borderRadius: 4
348
- },
349
- badgeCompact: {
350
- paddingVertical: 2,
351
- paddingHorizontal: 5
352
- },
353
- componentBadge: {
354
- borderStyle: "dashed",
355
- borderWidth: 1,
356
- borderColor: _sharedUi.night.color.border
357
- },
358
- badgeText: {
359
- fontSize: 10,
360
- fontWeight: "700"
361
- },
362
- badgeTextCompact: {
363
- fontSize: 9
364
- },
365
- componentBadgeText: {
366
- fontWeight: "500",
367
- textTransform: "lowercase"
368
- },
369
- arrowText: {
370
- fontSize: 10,
371
- color: _sharedUi.night.color.textTertiary
372
- },
373
- arrowTextCompact: {
374
- fontSize: 9
375
- },
376
- keysText: {
377
- fontSize: 11,
378
- color: _sharedUi.night.color.textSecondary,
379
- fontFamily: _sharedUi.monoFont,
380
- flex: 1
381
- },
382
- keysTextCompact: {
383
- fontSize: 10
384
- },
385
- // Two-level badge styles
386
- twoLevelContainer: {
387
- gap: 8
388
- },
389
- twoLevelRow: {
390
- flexDirection: "row",
391
- alignItems: "center",
392
- flexWrap: "wrap",
393
- gap: 6
394
- },
395
- twoLevelLabel: {
396
- fontSize: 11,
397
- fontWeight: "600",
398
- color: _sharedUi.night.color.textSecondary,
399
- minWidth: 70
400
- },
401
- twoLevelName: {
402
- fontSize: 11,
403
- fontWeight: "600",
404
- color: _sharedUi.night.color.text,
405
- fontFamily: _sharedUi.monoFont
406
- },
407
- twoLevelText: {
408
- fontSize: 11,
409
- color: _sharedUi.night.color.textSecondary
410
- },
411
- twoLevelKeys: {
412
- fontSize: 10,
413
- color: _sharedUi.night.color.textSecondary,
414
- fontFamily: _sharedUi.monoFont
415
- },
416
- // Enhanced cause display styles (Phase 5)
417
- enhancedContainer: {
418
- gap: 12
419
- },
420
- enhancedHeader: {
421
- flexDirection: "row",
422
- alignItems: "center",
423
- justifyContent: "space-between",
424
- gap: 8
425
- },
426
- enhancedComponentName: {
427
- fontSize: 14,
428
- fontWeight: "700",
429
- color: _sharedUi.night.color.text,
430
- fontFamily: _sharedUi.monoFont
431
- },
432
- enhancedNativeTag: {
433
- // Inset display chip — the night track color.
434
- backgroundColor: _sharedUi.night.color.bg,
435
- paddingVertical: 2,
436
- paddingHorizontal: 6,
437
- borderRadius: 4
438
- },
439
- enhancedNativeTagText: {
440
- fontSize: 10,
441
- fontWeight: "600",
442
- color: _sharedUi.night.color.textTertiary,
443
- fontFamily: _sharedUi.monoFont
444
- },
445
- enhancedFlowContainer: {
446
- flexDirection: "row",
447
- alignItems: "center",
448
- gap: 8,
449
- paddingVertical: 8,
450
- paddingHorizontal: 12,
451
- // Inset display box — the night track color.
452
- backgroundColor: _sharedUi.night.color.bg,
453
- borderRadius: 6
454
- },
455
- enhancedFlowLabel: {
456
- fontSize: 11,
457
- fontWeight: "600",
458
- color: _sharedUi.night.color.textSecondary
459
- },
460
- enhancedFlowBadge: {
461
- paddingVertical: 3,
462
- paddingHorizontal: 8,
463
- borderRadius: 4
464
- },
465
- enhancedFlowBadgeText: {
466
- fontSize: 10,
467
- fontWeight: "700"
468
- },
469
- enhancedFlowArrow: {
470
- fontSize: 14,
471
- color: _sharedUi.night.color.textTertiary,
472
- fontWeight: "300"
473
- },
474
- enhancedSection: {
475
- gap: 6
476
- },
477
- enhancedSectionTitle: {
478
- fontSize: 11,
479
- fontWeight: "600",
480
- color: _sharedUi.night.color.textSecondary,
481
- letterSpacing: 0.3
482
- },
483
- enhancedChangeRow: {
484
- flexDirection: "row",
485
- alignItems: "flex-start",
486
- gap: 6,
487
- paddingLeft: 4
488
- },
489
- enhancedChangeIcon: {
490
- fontSize: 12,
491
- color: _sharedUi.night.color.warning,
492
- fontFamily: _sharedUi.monoFont,
493
- width: 16
494
- },
495
- enhancedChangeText: {
496
- fontSize: 12,
497
- color: _sharedUi.night.color.text,
498
- fontFamily: _sharedUi.monoFont,
499
- flex: 1
500
- },
501
- enhancedNoChanges: {
502
- fontSize: 12,
503
- color: _sharedUi.night.color.textTertiary,
504
- fontStyle: "italic",
505
- paddingLeft: 4
506
- }
507
- });
508
- var _default = exports.default = RenderCauseBadge;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.COMPONENT_CAUSE_CONFIG=exports.CAUSE_CONFIG=void 0;exports.EnhancedCauseDisplay=EnhancedCauseDisplay;exports.RenderCauseBadge=RenderCauseBadge;exports.TwoLevelCauseBadge=TwoLevelCauseBadge;exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const CAUSE_CONFIG=exports.CAUSE_CONFIG={mount:{label:"MOUNT",color:_sharedUi.buoyColors.success,tip:"First render of this component."},props:{label:"PROPS",color:_sharedUi.buoyColors.warning,tip:"Native props changed. Consider React.memo() or useCallback for handlers."},state:{label:"STATE",color:"#a855f7",tip:"Component state changed via setState."},hooks:{label:"HOOKS",color:"#ec4899",tip:"Hook values changed (useState, useReducer, useMemo, etc.)."},context:{label:"CONTEXT",color:"#06b6d4",tip:"React context value changed."},parent:{label:"PARENT",color:_sharedUi.buoyColors.textSecondary,tip:"Parent component re-rendered. Consider wrapping with React.memo()."},unknown:{label:"?",color:_sharedUi.buoyColors.textMuted,tip:"Could not determine render cause."}};const COMPONENT_CAUSE_CONFIG=exports.COMPONENT_CAUSE_CONFIG={mount:{label:"mount",color:_sharedUi.buoyColors.success,tip:"First render of this component."},props:{label:"props",color:_sharedUi.buoyColors.warning,tip:"Component received different props from parent."},state:{label:"state",color:"#a855f7",tip:"Component's own state changed (useState/useReducer)."},parent:{label:"parent",color:_sharedUi.buoyColors.textSecondary,tip:"Parent re-rendered but this component's props/state didn't change. Consider React.memo()."},unknown:{label:"?",color:_sharedUi.buoyColors.textMuted,tip:"Could not determine component render cause."}};function RenderCauseBadge({cause:e,compact:n=false,showKeys:t=false,showTwoLevel:l=false,testID:r}){const a=CAUSE_CONFIG[e.type];const i=e.componentCause?COMPONENT_CAUSE_CONFIG[e.componentCause]:null;const c=l&&i&&e.componentCause!==e.type;return(0,_jsxRuntime.jsxs)(_reactNative.View,{nativeID:"__rn_buoy__cause-badge",testID:r,style:[styles.container,n&&styles.containerCompact],children:[c&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.badge,n&&styles.badgeCompact,styles.componentBadge,{backgroundColor:i.color+"15"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:r?`${r}-component`:void 0,style:[styles.badgeText,n&&styles.badgeTextCompact,styles.componentBadgeText,{color:i.color}],children:i.label})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.arrowText,n&&styles.arrowTextCompact],children:"\u2192"})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.badge,n&&styles.badgeCompact,{backgroundColor:a.color+"20"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:r?`${r}-native`:void 0,style:[styles.badgeText,n&&styles.badgeTextCompact,{color:a.color}],children:a.label})}),t&&e.changedKeys&&e.changedKeys.length>0&&(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:r?`${r}-keys`:void 0,style:[styles.keysText,n&&styles.keysTextCompact],numberOfLines:1,children:e.changedKeys.join(", ")}),t&&e.hookIndices&&e.hookIndices.length>0&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{testID:r?`${r}-hooks`:void 0,style:[styles.keysText,n&&styles.keysTextCompact],numberOfLines:1,children:["Hook ",e.hookIndices.join(", ")]})]})}function TwoLevelCauseBadge({cause:e}){const n=CAUSE_CONFIG[e.type];const t=e.componentCause?COMPONENT_CAUSE_CONFIG[e.componentCause]:null;const l=e.componentName||"Component";return(0,_jsxRuntime.jsxs)(_reactNative.View,{nativeID:"__rn_buoy__two-level-cause",style:styles.twoLevelContainer,children:[t&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.twoLevelRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.twoLevelLabel,children:"Component:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.twoLevelName,children:l}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.twoLevelText,children:"re-rendered due to"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.badge,{backgroundColor:t.color+"20"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.badgeText,{color:t.color}],children:t.label.toUpperCase()})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.twoLevelRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.twoLevelLabel,children:"Native:"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.badge,{backgroundColor:n.color+"20"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.badgeText,{color:n.color}],children:n.label})}),e.changedKeys&&e.changedKeys.length>0&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.twoLevelKeys,children:["[",e.changedKeys.join(", "),"]"]})]})]})}function EnhancedCauseDisplay({cause:e,nativeType:n}){const t=CAUSE_CONFIG[e.type];const l=e.componentCause?COMPONENT_CAUSE_CONFIG[e.componentCause]:null;const r=e.componentName||"Unknown";const a=e.hookChanges&&e.hookChanges.length>0;const i=e.changedKeys&&e.changedKeys.length>0;const c=e.changedKeys?.filter(o=>o.includes("(ref only)")||o.includes("(fn ref)"))||[];const s=e.changedKeys?.filter(o=>!o.includes("(ref only)")&&!o.includes("(fn ref)"))||[];return(0,_jsxRuntime.jsxs)(_reactNative.View,{nativeID:"__rn_buoy__enhanced-cause",style:styles.enhancedContainer,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.enhancedHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedComponentName,children:r}),n&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.enhancedNativeTag,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedNativeTagText,children:n})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.enhancedFlowContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedFlowLabel,children:"Cause:"}),l&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.enhancedFlowBadge,{backgroundColor:l.color+"20"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.enhancedFlowBadgeText,{color:l.color}],children:l.label.toUpperCase()})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedFlowArrow,children:"\u2192"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.enhancedFlowBadge,{backgroundColor:t.color+"20"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.enhancedFlowBadgeText,{color:t.color}],children:t.label})})]}),a&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.enhancedSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedSectionTitle,children:"Component State Changed:"}),e.hookChanges.map(o=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.enhancedChangeRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedChangeIcon,children:"\u26A1"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.enhancedChangeText,children:["Hook[",o.index,"] (",o.type,"): ",o.description]})]},o.index))]}),s.length>0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.enhancedSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedSectionTitle,children:"Native Props Changed:"}),s.map((o,d)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.enhancedChangeRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedChangeIcon,children:"~"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedChangeText,children:o})]},d))]}),c.length>0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.enhancedSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.enhancedSectionTitle,{color:_sharedUi.night.color.textTertiary}],children:"Reference Changes (optimization opportunity):"}),c.map((o,d)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.enhancedChangeRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.enhancedChangeIcon,{color:_sharedUi.night.color.textTertiary}],children:"\u25CB"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.enhancedChangeText,{color:_sharedUi.night.color.textTertiary}],children:o})]},d))]}),!a&&!i&&e.type!=="mount"&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.enhancedSection,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.enhancedNoChanges,children:e.type==="parent"?"Parent re-rendered (consider React.memo)":"No specific changes detected"})})]})}const styles=_reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{paddingVertical:3,paddingHorizontal:6,borderRadius:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5},componentBadge:{borderStyle:"dashed",borderWidth:1,borderColor:_sharedUi.night.color.border},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},componentBadgeText:{fontWeight:"500",textTransform:"lowercase"},arrowText:{fontSize:10,color:_sharedUi.night.color.textTertiary},arrowTextCompact:{fontSize:9},keysText:{fontSize:11,color:_sharedUi.night.color.textSecondary,fontFamily:_sharedUi.monoFont,flex:1},keysTextCompact:{fontSize:10},twoLevelContainer:{gap:8},twoLevelRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:6},twoLevelLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.textSecondary,minWidth:70},twoLevelName:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont},twoLevelText:{fontSize:11,color:_sharedUi.night.color.textSecondary},twoLevelKeys:{fontSize:10,color:_sharedUi.night.color.textSecondary,fontFamily:_sharedUi.monoFont},enhancedContainer:{gap:12},enhancedHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},enhancedComponentName:{fontSize:14,fontWeight:"700",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont},enhancedNativeTag:{backgroundColor:_sharedUi.night.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},enhancedNativeTagText:{fontSize:10,fontWeight:"600",color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},enhancedFlowContainer:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12,backgroundColor:_sharedUi.night.color.bg,borderRadius:6},enhancedFlowLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.textSecondary},enhancedFlowBadge:{paddingVertical:3,paddingHorizontal:8,borderRadius:4},enhancedFlowBadgeText:{fontSize:10,fontWeight:"700"},enhancedFlowArrow:{fontSize:14,color:_sharedUi.night.color.textTertiary,fontWeight:"300"},enhancedSection:{gap:6},enhancedSectionTitle:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.textSecondary,letterSpacing:.3},enhancedChangeRow:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingLeft:4},enhancedChangeIcon:{fontSize:12,color:_sharedUi.night.color.warning,fontFamily:_sharedUi.monoFont,width:16},enhancedChangeText:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,flex:1},enhancedNoChanges:{fontSize:12,color:_sharedUi.night.color.textTertiary,fontStyle:"italic",paddingLeft:4}});var _default=exports.default=RenderCauseBadge;