@buoy-gg/highlight-updates 7.0.38 → 7.0.39
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/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +281 -1
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1474 -1
- package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +641 -1
- package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +273 -1
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +188 -1
- package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +293 -1
- package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +508 -1
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +846 -1
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +915 -1
- package/lib/commonjs/highlight-updates/components/RenderListItem.js +235 -1
- package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +469 -1
- package/lib/commonjs/highlight-updates/components/StatsDisplay.js +73 -1
- package/lib/commonjs/highlight-updates/types/copySettings.js +107 -1
- package/lib/commonjs/highlight-updates/utils/CommitProfiler.js +446 -1
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1920 -1
- package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +359 -1
- package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +371 -1
- package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +1840 -1
- package/lib/commonjs/highlight-updates/utils/RenderTracker.js +952 -1
- package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +264 -1
- package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +32 -1
- package/lib/commonjs/highlight-updates/utils/devtoolsComponentNames.js +188 -1
- package/lib/commonjs/highlight-updates/utils/namedComposite.js +41 -1
- package/lib/commonjs/highlight-updates/utils/ownStateChanged.js +103 -1
- package/lib/commonjs/highlight-updates/utils/rawEventEmitter.js +50 -1
- package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +58 -1
- package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +485 -1
- package/lib/commonjs/highlight-updates/utils/screenElements.js +1248 -1
- package/lib/commonjs/highlight-updates/utils/tapMatch.js +83 -1
- package/lib/commonjs/highlight-updates/utils/testIDs.js +68 -1
- package/lib/commonjs/highlight-updates/utils/touchCapture.js +277 -1
- package/lib/commonjs/index.js +429 -1
- package/lib/commonjs/preset.js +278 -1
- package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +235 -1
- package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +274 -1
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1468 -1
- package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +634 -1
- package/lib/module/highlight-updates/components/IdentifierBadge.js +265 -1
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +183 -1
- package/lib/module/highlight-updates/components/ModalHeaderContent.js +288 -1
- package/lib/module/highlight-updates/components/RenderCauseBadge.js +499 -1
- package/lib/module/highlight-updates/components/RenderDetailView.js +840 -1
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +908 -1
- package/lib/module/highlight-updates/components/RenderListItem.js +230 -1
- package/lib/module/highlight-updates/components/RendersCopySettingsView.js +465 -1
- package/lib/module/highlight-updates/components/StatsDisplay.js +70 -1
- package/lib/module/highlight-updates/types/copySettings.js +102 -1
- package/lib/module/highlight-updates/utils/CommitProfiler.js +442 -1
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1916 -1
- package/lib/module/highlight-updates/utils/PerformanceLogger.js +353 -1
- package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +358 -1
- package/lib/module/highlight-updates/utils/RenderCauseDetector.js +1830 -1
- package/lib/module/highlight-updates/utils/RenderTracker.js +949 -1
- package/lib/module/highlight-updates/utils/ViewTypeMapper.js +255 -1
- package/lib/module/highlight-updates/utils/copySettingsStorage.js +26 -1
- package/lib/module/highlight-updates/utils/devtoolsComponentNames.js +178 -1
- package/lib/module/highlight-updates/utils/namedComposite.js +36 -1
- package/lib/module/highlight-updates/utils/ownStateChanged.js +98 -1
- package/lib/module/highlight-updates/utils/rawEventEmitter.js +46 -1
- package/lib/module/highlight-updates/utils/renderExportFormatter.js +54 -1
- package/lib/module/highlight-updates/utils/rendersExportFormatter.js +478 -1
- package/lib/module/highlight-updates/utils/screenElements.js +1242 -1
- package/lib/module/highlight-updates/utils/tapMatch.js +76 -1
- package/lib/module/highlight-updates/utils/testIDs.js +60 -1
- package/lib/module/highlight-updates/utils/touchCapture.js +270 -1
- package/lib/module/index.js +130 -1
- package/lib/module/preset.js +272 -1
- package/lib/module/sync/highlightUpdatesSyncAdapter.js +230 -1
- package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/CommitProfiler.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/devtoolsComponentNames.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/namedComposite.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ownStateChanged.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/rawEventEmitter.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/screenElements.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/tapMatch.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/testIDs.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/touchCapture.d.ts.map +1 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +1 -0
- package/package.json +7 -7
|
@@ -1 +1,273 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CategoryBadge = CategoryBadge;
|
|
7
|
+
exports.IDENTIFIER_CONFIG = void 0;
|
|
8
|
+
exports.IdentifierBadge = IdentifierBadge;
|
|
9
|
+
exports.default = void 0;
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _reactNative = require("react-native");
|
|
12
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
/**
|
|
16
|
+
* IdentifierBadge
|
|
17
|
+
*
|
|
18
|
+
* Shared badge component for displaying component identifiers.
|
|
19
|
+
* Used throughout the highlight-updates package for consistent styling.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// All possible identifier types
|
|
23
|
+
|
|
24
|
+
// Badge configuration for each identifier type
|
|
25
|
+
const IDENTIFIER_CONFIG = exports.IDENTIFIER_CONFIG = {
|
|
26
|
+
viewType: {
|
|
27
|
+
label: "ViewType",
|
|
28
|
+
shortLabel: "View",
|
|
29
|
+
color: _sharedUi.night.color.accent,
|
|
30
|
+
icon: _sharedUi.Box
|
|
31
|
+
},
|
|
32
|
+
testID: {
|
|
33
|
+
label: "testID",
|
|
34
|
+
shortLabel: "test",
|
|
35
|
+
color: _sharedUi.buoyColors.success,
|
|
36
|
+
icon: _sharedUi.Hash
|
|
37
|
+
},
|
|
38
|
+
nativeID: {
|
|
39
|
+
label: "nativeID",
|
|
40
|
+
shortLabel: "native",
|
|
41
|
+
color: "#f59e0b",
|
|
42
|
+
// amber
|
|
43
|
+
icon: _sharedUi.Hash
|
|
44
|
+
},
|
|
45
|
+
component: {
|
|
46
|
+
label: "Component",
|
|
47
|
+
shortLabel: "Comp",
|
|
48
|
+
color: "#a855f7",
|
|
49
|
+
// purple
|
|
50
|
+
icon: _sharedUi.FileCode
|
|
51
|
+
},
|
|
52
|
+
accessibilityLabel: {
|
|
53
|
+
label: "a11y",
|
|
54
|
+
shortLabel: "a11y",
|
|
55
|
+
color: "#ec4899",
|
|
56
|
+
// pink
|
|
57
|
+
icon: _sharedUi.Eye
|
|
58
|
+
},
|
|
59
|
+
nativeTag: {
|
|
60
|
+
label: "tag",
|
|
61
|
+
shortLabel: "tag",
|
|
62
|
+
color: _sharedUi.buoyColors.textMuted,
|
|
63
|
+
icon: _sharedUi.Layers
|
|
64
|
+
},
|
|
65
|
+
any: {
|
|
66
|
+
label: "Any",
|
|
67
|
+
shortLabel: "Any",
|
|
68
|
+
color: _sharedUi.buoyColors.warning,
|
|
69
|
+
icon: _sharedUi.Search
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function IdentifierBadge({
|
|
73
|
+
type,
|
|
74
|
+
value,
|
|
75
|
+
compact = false,
|
|
76
|
+
badgeOnly = false,
|
|
77
|
+
valueOnly = false,
|
|
78
|
+
shortLabel = false,
|
|
79
|
+
showIcon = false,
|
|
80
|
+
testID
|
|
81
|
+
}) {
|
|
82
|
+
const config = IDENTIFIER_CONFIG[type];
|
|
83
|
+
const IconComponent = config.icon;
|
|
84
|
+
const label = shortLabel ? config.shortLabel : config.label;
|
|
85
|
+
if (valueOnly) {
|
|
86
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
87
|
+
testID: testID ? `${testID}-value` : undefined,
|
|
88
|
+
style: [styles.valueOnly, compact && styles.valueOnlyCompact, {
|
|
89
|
+
color: config.color
|
|
90
|
+
}],
|
|
91
|
+
numberOfLines: 1,
|
|
92
|
+
children: value
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (badgeOnly) {
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
97
|
+
testID: testID,
|
|
98
|
+
style: [styles.badgeOnly, compact && styles.badgeOnlyCompact, {
|
|
99
|
+
backgroundColor: config.color + "20",
|
|
100
|
+
borderColor: config.color + "40"
|
|
101
|
+
}],
|
|
102
|
+
children: [showIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
103
|
+
size: compact ? 10 : 12,
|
|
104
|
+
color: config.color
|
|
105
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
106
|
+
style: [styles.badgeOnlyText, compact && styles.badgeOnlyTextCompact, {
|
|
107
|
+
color: config.color
|
|
108
|
+
}],
|
|
109
|
+
children: label
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
114
|
+
testID: testID,
|
|
115
|
+
accessibilityLabel: `${config.label} ${value}`,
|
|
116
|
+
style: [styles.container, compact && styles.containerCompact],
|
|
117
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
118
|
+
style: [styles.badge, compact && styles.badgeCompact, {
|
|
119
|
+
backgroundColor: config.color + "20"
|
|
120
|
+
}],
|
|
121
|
+
children: [showIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
122
|
+
size: compact ? 8 : 10,
|
|
123
|
+
color: config.color
|
|
124
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
125
|
+
style: [styles.badgeText, compact && styles.badgeTextCompact, {
|
|
126
|
+
color: config.color
|
|
127
|
+
}],
|
|
128
|
+
children: label
|
|
129
|
+
})]
|
|
130
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
131
|
+
testID: testID ? `${testID}-value` : undefined,
|
|
132
|
+
style: [styles.value, compact && styles.valueCompact],
|
|
133
|
+
numberOfLines: 1,
|
|
134
|
+
children: value
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Standalone badge (no value) for category selection
|
|
140
|
+
|
|
141
|
+
function CategoryBadge({
|
|
142
|
+
type,
|
|
143
|
+
count,
|
|
144
|
+
isSelected = false,
|
|
145
|
+
showIcon = true
|
|
146
|
+
}) {
|
|
147
|
+
const config = IDENTIFIER_CONFIG[type];
|
|
148
|
+
const IconComponent = config.icon;
|
|
149
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
150
|
+
style: [styles.categoryBadge, {
|
|
151
|
+
backgroundColor: config.color + "15",
|
|
152
|
+
borderColor: isSelected ? config.color : config.color + "40",
|
|
153
|
+
borderWidth: isSelected ? 2 : 1
|
|
154
|
+
}],
|
|
155
|
+
children: [showIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
156
|
+
size: 12,
|
|
157
|
+
color: config.color
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
159
|
+
style: [styles.categoryBadgeText, {
|
|
160
|
+
color: config.color
|
|
161
|
+
}],
|
|
162
|
+
children: config.label
|
|
163
|
+
}), count !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
164
|
+
style: [styles.categoryBadgeCount, {
|
|
165
|
+
backgroundColor: config.color + "25"
|
|
166
|
+
}],
|
|
167
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
168
|
+
style: [styles.categoryBadgeCountText, {
|
|
169
|
+
color: config.color
|
|
170
|
+
}],
|
|
171
|
+
children: count
|
|
172
|
+
})
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const styles = _reactNative.StyleSheet.create({
|
|
177
|
+
// Full badge with value
|
|
178
|
+
container: {
|
|
179
|
+
flexDirection: "row",
|
|
180
|
+
alignItems: "center",
|
|
181
|
+
gap: 6
|
|
182
|
+
},
|
|
183
|
+
containerCompact: {
|
|
184
|
+
gap: 4
|
|
185
|
+
},
|
|
186
|
+
badge: {
|
|
187
|
+
flexDirection: "row",
|
|
188
|
+
alignItems: "center",
|
|
189
|
+
paddingVertical: 3,
|
|
190
|
+
paddingHorizontal: 6,
|
|
191
|
+
borderRadius: 4,
|
|
192
|
+
gap: 4
|
|
193
|
+
},
|
|
194
|
+
badgeCompact: {
|
|
195
|
+
paddingVertical: 2,
|
|
196
|
+
paddingHorizontal: 5,
|
|
197
|
+
gap: 3
|
|
198
|
+
},
|
|
199
|
+
badgeText: {
|
|
200
|
+
fontSize: 10,
|
|
201
|
+
fontWeight: "700"
|
|
202
|
+
},
|
|
203
|
+
badgeTextCompact: {
|
|
204
|
+
fontSize: 9
|
|
205
|
+
},
|
|
206
|
+
value: {
|
|
207
|
+
fontSize: 12,
|
|
208
|
+
color: _sharedUi.night.color.text,
|
|
209
|
+
fontFamily: _sharedUi.monoFont,
|
|
210
|
+
flex: 1
|
|
211
|
+
},
|
|
212
|
+
valueCompact: {
|
|
213
|
+
fontSize: 11
|
|
214
|
+
},
|
|
215
|
+
// Badge only (no value)
|
|
216
|
+
badgeOnly: {
|
|
217
|
+
flexDirection: "row",
|
|
218
|
+
alignItems: "center",
|
|
219
|
+
paddingVertical: 4,
|
|
220
|
+
paddingHorizontal: 8,
|
|
221
|
+
borderRadius: 6,
|
|
222
|
+
borderWidth: 1,
|
|
223
|
+
gap: 5
|
|
224
|
+
},
|
|
225
|
+
badgeOnlyCompact: {
|
|
226
|
+
paddingVertical: 2,
|
|
227
|
+
paddingHorizontal: 6,
|
|
228
|
+
borderRadius: 4,
|
|
229
|
+
gap: 4
|
|
230
|
+
},
|
|
231
|
+
badgeOnlyText: {
|
|
232
|
+
fontSize: 11,
|
|
233
|
+
fontWeight: "600"
|
|
234
|
+
},
|
|
235
|
+
badgeOnlyTextCompact: {
|
|
236
|
+
fontSize: 9,
|
|
237
|
+
fontWeight: "700"
|
|
238
|
+
},
|
|
239
|
+
// Value only
|
|
240
|
+
valueOnly: {
|
|
241
|
+
fontSize: 12,
|
|
242
|
+
fontFamily: _sharedUi.monoFont
|
|
243
|
+
},
|
|
244
|
+
valueOnlyCompact: {
|
|
245
|
+
fontSize: 11
|
|
246
|
+
},
|
|
247
|
+
// Category badge (for filter selection)
|
|
248
|
+
categoryBadge: {
|
|
249
|
+
flexDirection: "row",
|
|
250
|
+
alignItems: "center",
|
|
251
|
+
paddingVertical: 8,
|
|
252
|
+
paddingLeft: 10,
|
|
253
|
+
paddingRight: 6,
|
|
254
|
+
borderRadius: 8,
|
|
255
|
+
gap: 6
|
|
256
|
+
},
|
|
257
|
+
categoryBadgeText: {
|
|
258
|
+
fontSize: 11,
|
|
259
|
+
fontWeight: "600"
|
|
260
|
+
},
|
|
261
|
+
categoryBadgeCount: {
|
|
262
|
+
paddingHorizontal: 6,
|
|
263
|
+
paddingVertical: 2,
|
|
264
|
+
borderRadius: 10,
|
|
265
|
+
minWidth: 20,
|
|
266
|
+
alignItems: "center"
|
|
267
|
+
},
|
|
268
|
+
categoryBadgeCountText: {
|
|
269
|
+
fontSize: 10,
|
|
270
|
+
fontWeight: "600"
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
var _default = exports.default = IdentifierBadge;
|
|
@@ -1 +1,188 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.IsolatedRenderList = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _RenderTracker = require("../utils/RenderTracker");
|
|
10
|
+
var _RenderListItem = require("./RenderListItem");
|
|
11
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
/**
|
|
15
|
+
* IsolatedRenderList
|
|
16
|
+
*
|
|
17
|
+
* Performance-optimized component that isolates the render tracking subscription
|
|
18
|
+
* to prevent parent re-renders. Only this component re-renders when new renders
|
|
19
|
+
* are tracked, keeping the modal UI stable.
|
|
20
|
+
*
|
|
21
|
+
* Following the optimization guide: move subscriptions to child components to
|
|
22
|
+
* prevent parent re-renders.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// Free tier limit for tracked components
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Isolated list component that owns the render subscription.
|
|
29
|
+
* Parent component does NOT re-render when renders change.
|
|
30
|
+
*/
|
|
31
|
+
function IsolatedRenderListInner({
|
|
32
|
+
searchText,
|
|
33
|
+
filters,
|
|
34
|
+
onSelectRender,
|
|
35
|
+
onStatsChange,
|
|
36
|
+
onRendersChange,
|
|
37
|
+
isTracking,
|
|
38
|
+
isPro = false
|
|
39
|
+
}) {
|
|
40
|
+
// Initialize with current data to avoid flash of empty state
|
|
41
|
+
const [renders, setRenders] = (0, _react.useState)(() => _RenderTracker.RenderTracker.getFilteredRenders(searchText));
|
|
42
|
+
const flatListRef = (0, _react.useRef)(null);
|
|
43
|
+
|
|
44
|
+
// Subscribe to RenderTracker updates - ONLY this component re-renders
|
|
45
|
+
(0, _react.useEffect)(() => {
|
|
46
|
+
const unsubscribe = _RenderTracker.RenderTracker.subscribe(() => {
|
|
47
|
+
const newRenders = _RenderTracker.RenderTracker.getFilteredRenders(searchText);
|
|
48
|
+
setRenders(newRenders);
|
|
49
|
+
// Notify parent of stats via callback (parent uses ref, no re-render)
|
|
50
|
+
onStatsChange(_RenderTracker.RenderTracker.getStats());
|
|
51
|
+
// Notify parent of renders list for navigation
|
|
52
|
+
onRendersChange?.(newRenders);
|
|
53
|
+
});
|
|
54
|
+
return unsubscribe;
|
|
55
|
+
}, [searchText, onStatsChange, onRendersChange]);
|
|
56
|
+
|
|
57
|
+
// Update filtered renders when search or filters change
|
|
58
|
+
(0, _react.useEffect)(() => {
|
|
59
|
+
const newRenders = _RenderTracker.RenderTracker.getFilteredRenders(searchText);
|
|
60
|
+
setRenders(newRenders);
|
|
61
|
+
onRendersChange?.(newRenders);
|
|
62
|
+
}, [searchText, filters, onRendersChange]);
|
|
63
|
+
|
|
64
|
+
// Limit visible components for free tier
|
|
65
|
+
// `isPro` stays a prop so callers can force the unlimited view; the tier cap
|
|
66
|
+
// applies otherwise. useLimit() already returns Infinity for Pro, so the two
|
|
67
|
+
// agree — this only preserves the prop contract for cross-package callers.
|
|
68
|
+
const tierLimit = (0, _sharedUi.useLimit)("highlightUpdates.components");
|
|
69
|
+
const componentLimit = isPro ? Infinity : tierLimit;
|
|
70
|
+
const visibleRenders = (0, _react.useMemo)(() => {
|
|
71
|
+
return renders.slice(0, componentLimit);
|
|
72
|
+
}, [renders, componentLimit]);
|
|
73
|
+
|
|
74
|
+
// Calculate locked component count
|
|
75
|
+
const lockedComponentCount = (0, _react.useMemo)(() => {
|
|
76
|
+
return Math.max(0, renders.length - componentLimit);
|
|
77
|
+
}, [renders.length, componentLimit]);
|
|
78
|
+
|
|
79
|
+
// Stable keyExtractor - moved outside to avoid recreation
|
|
80
|
+
const keyExtractor = (0, _react.useCallback)(item => item.id, []);
|
|
81
|
+
|
|
82
|
+
// Stable renderItem - uses stable onSelectRender callback
|
|
83
|
+
const renderItem = (0, _react.useCallback)(({
|
|
84
|
+
item,
|
|
85
|
+
index
|
|
86
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderListItem.RenderListItem, {
|
|
87
|
+
render: item,
|
|
88
|
+
onPress: () => onSelectRender(item, index, visibleRenders)
|
|
89
|
+
}), [onSelectRender, visibleRenders]);
|
|
90
|
+
|
|
91
|
+
// Locked banner footer
|
|
92
|
+
const renderFooter = (0, _react.useCallback)(() => {
|
|
93
|
+
if (lockedComponentCount <= 0) return null;
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
95
|
+
testID: "buoy-highlight-locked",
|
|
96
|
+
style: styles.lockedBanner,
|
|
97
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Lock, {
|
|
98
|
+
size: 14,
|
|
99
|
+
color: _sharedUi.night.color.warning
|
|
100
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
101
|
+
testID: "buoy-highlight-locked-text",
|
|
102
|
+
style: styles.lockedBannerText,
|
|
103
|
+
children: [lockedComponentCount, " more ", lockedComponentCount === 1 ? 'component' : 'components', " locked"]
|
|
104
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
105
|
+
style: styles.lockedBannerSubtext,
|
|
106
|
+
children: "Upgrade to Pro"
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
}, [lockedComponentCount]);
|
|
110
|
+
|
|
111
|
+
// Show empty state when no renders
|
|
112
|
+
if (renders.length === 0) {
|
|
113
|
+
const term = searchText.trim();
|
|
114
|
+
|
|
115
|
+
// Read straight off the tracker rather than held in state: this runs only
|
|
116
|
+
// on the empty branch, so it costs nothing on the hot path, and it is
|
|
117
|
+
// always the current truth. `totalTracked` is every component the tracker
|
|
118
|
+
// holds; `unsearched` is what the settings and filters allow BEFORE the
|
|
119
|
+
// search box.
|
|
120
|
+
const totalTracked = _RenderTracker.RenderTracker.getStats().totalComponents;
|
|
121
|
+
const unsearched = term ? _RenderTracker.RenderTracker.getFilteredRenders("").length : 0;
|
|
122
|
+
const content = (0, _sharedUi.resolveListEmptyState)({
|
|
123
|
+
subject: "components",
|
|
124
|
+
verb: "tracked",
|
|
125
|
+
search: searchText,
|
|
126
|
+
// The denominator is what the FILTERS left, not the raw tracker count —
|
|
127
|
+
// "clear the search to see them" has to be true of what you get back.
|
|
128
|
+
total: term ? unsearched : totalTracked,
|
|
129
|
+
capturing: isTracking,
|
|
130
|
+
blocked: term && unsearched === 0 && totalTracked > 0 ? "The active filters hide everything tracked, so there is nothing to search." : undefined,
|
|
131
|
+
waiting: {
|
|
132
|
+
// stare = "watching for a specific event; recording armed".
|
|
133
|
+
otto: "stare",
|
|
134
|
+
title: "No renders tracked",
|
|
135
|
+
message: "Component renders will appear here"
|
|
136
|
+
},
|
|
137
|
+
paused: {
|
|
138
|
+
title: "No renders tracked",
|
|
139
|
+
message: "Enable tracking to start capturing"
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
|
|
143
|
+
...content,
|
|
144
|
+
testID: "buoy-highlight-empty"
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
|
|
148
|
+
testID: "buoy-highlight-list",
|
|
149
|
+
ref: flatListRef,
|
|
150
|
+
data: visibleRenders,
|
|
151
|
+
renderItem: renderItem,
|
|
152
|
+
keyExtractor: keyExtractor,
|
|
153
|
+
contentContainerStyle: styles.listContent,
|
|
154
|
+
showsVerticalScrollIndicator: true,
|
|
155
|
+
initialNumToRender: 10,
|
|
156
|
+
maxToRenderPerBatch: 10,
|
|
157
|
+
windowSize: 10,
|
|
158
|
+
scrollEnabled: false,
|
|
159
|
+
ListFooterComponent: renderFooter
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Memoize to prevent re-renders from parent state changes
|
|
164
|
+
const IsolatedRenderList = exports.IsolatedRenderList = /*#__PURE__*/(0, _react.memo)(IsolatedRenderListInner);
|
|
165
|
+
const styles = _reactNative.StyleSheet.create({
|
|
166
|
+
listContent: {
|
|
167
|
+
paddingTop: 8
|
|
168
|
+
},
|
|
169
|
+
lockedBanner: {
|
|
170
|
+
flexDirection: "row",
|
|
171
|
+
alignItems: "center",
|
|
172
|
+
justifyContent: "center",
|
|
173
|
+
paddingVertical: 12,
|
|
174
|
+
paddingHorizontal: 16,
|
|
175
|
+
marginTop: 8,
|
|
176
|
+
gap: 8
|
|
177
|
+
},
|
|
178
|
+
lockedBannerText: {
|
|
179
|
+
color: _sharedUi.night.color.warning,
|
|
180
|
+
fontSize: 13,
|
|
181
|
+
fontWeight: "500"
|
|
182
|
+
},
|
|
183
|
+
lockedBannerSubtext: {
|
|
184
|
+
color: _sharedUi.night.color.textTertiary,
|
|
185
|
+
fontSize: 12
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
var _default = exports.default = IsolatedRenderList;
|