@buoy-gg/highlight-updates 2.1.12 → 2.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.
- package/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +1 -285
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1 -1371
- package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +1 -591
- package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +1 -267
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +1 -178
- package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +1 -303
- package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +1 -500
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +1 -830
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +1 -894
- package/lib/commonjs/highlight-updates/components/RenderListItem.js +1 -220
- package/lib/commonjs/highlight-updates/components/StatsDisplay.js +1 -70
- package/lib/commonjs/highlight-updates/components/index.js +1 -97
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1 -1435
- package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +1 -359
- package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +1 -371
- package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +1 -1828
- package/lib/commonjs/highlight-updates/utils/RenderTracker.js +1 -903
- package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +1 -264
- package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +1 -58
- package/lib/commonjs/index.js +1 -311
- package/lib/commonjs/preset.js +1 -278
- package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +1 -278
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1 -1365
- package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +1 -585
- package/lib/module/highlight-updates/components/IdentifierBadge.js +1 -259
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +1 -174
- package/lib/module/highlight-updates/components/ModalHeaderContent.js +1 -298
- package/lib/module/highlight-updates/components/RenderCauseBadge.js +1 -491
- package/lib/module/highlight-updates/components/RenderDetailView.js +1 -826
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +1 -888
- package/lib/module/highlight-updates/components/RenderListItem.js +1 -215
- package/lib/module/highlight-updates/components/StatsDisplay.js +1 -67
- package/lib/module/highlight-updates/components/index.js +1 -16
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1 -1431
- package/lib/module/highlight-updates/utils/PerformanceLogger.js +1 -353
- package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +1 -358
- package/lib/module/highlight-updates/utils/RenderCauseDetector.js +1 -1818
- package/lib/module/highlight-updates/utils/RenderTracker.js +1 -900
- package/lib/module/highlight-updates/utils/ViewTypeMapper.js +1 -255
- package/lib/module/highlight-updates/utils/renderExportFormatter.js +1 -54
- package/lib/module/index.js +1 -71
- package/lib/module/preset.js +1 -272
- package/package.json +7 -7
- package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/components/index.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +0 -1
- package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
|
@@ -1,259 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* IdentifierBadge
|
|
5
|
-
*
|
|
6
|
-
* Shared badge component for displaying component identifiers.
|
|
7
|
-
* Used throughout the highlight-updates package for consistent styling.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import React from "react";
|
|
11
|
-
import { View, Text, StyleSheet } from "react-native";
|
|
12
|
-
import { Box, Hash, Layers, Eye, Search, FileCode, buoyColors } from "@buoy-gg/shared-ui";
|
|
13
|
-
|
|
14
|
-
// All possible identifier types
|
|
15
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
// Badge configuration for each identifier type
|
|
17
|
-
export const IDENTIFIER_CONFIG = {
|
|
18
|
-
viewType: {
|
|
19
|
-
label: "ViewType",
|
|
20
|
-
shortLabel: "View",
|
|
21
|
-
color: buoyColors.primary,
|
|
22
|
-
icon: Box
|
|
23
|
-
},
|
|
24
|
-
testID: {
|
|
25
|
-
label: "testID",
|
|
26
|
-
shortLabel: "test",
|
|
27
|
-
color: buoyColors.success,
|
|
28
|
-
icon: Hash
|
|
29
|
-
},
|
|
30
|
-
nativeID: {
|
|
31
|
-
label: "nativeID",
|
|
32
|
-
shortLabel: "native",
|
|
33
|
-
color: "#f59e0b",
|
|
34
|
-
// amber
|
|
35
|
-
icon: Hash
|
|
36
|
-
},
|
|
37
|
-
component: {
|
|
38
|
-
label: "Component",
|
|
39
|
-
shortLabel: "Comp",
|
|
40
|
-
color: "#a855f7",
|
|
41
|
-
// purple
|
|
42
|
-
icon: FileCode
|
|
43
|
-
},
|
|
44
|
-
accessibilityLabel: {
|
|
45
|
-
label: "a11y",
|
|
46
|
-
shortLabel: "a11y",
|
|
47
|
-
color: "#ec4899",
|
|
48
|
-
// pink
|
|
49
|
-
icon: Eye
|
|
50
|
-
},
|
|
51
|
-
nativeTag: {
|
|
52
|
-
label: "tag",
|
|
53
|
-
shortLabel: "tag",
|
|
54
|
-
color: buoyColors.textMuted,
|
|
55
|
-
icon: Layers
|
|
56
|
-
},
|
|
57
|
-
any: {
|
|
58
|
-
label: "Any",
|
|
59
|
-
shortLabel: "Any",
|
|
60
|
-
color: buoyColors.warning,
|
|
61
|
-
icon: Search
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
export function IdentifierBadge({
|
|
65
|
-
type,
|
|
66
|
-
value,
|
|
67
|
-
compact = false,
|
|
68
|
-
badgeOnly = false,
|
|
69
|
-
valueOnly = false,
|
|
70
|
-
shortLabel = false,
|
|
71
|
-
showIcon = false
|
|
72
|
-
}) {
|
|
73
|
-
const config = IDENTIFIER_CONFIG[type];
|
|
74
|
-
const IconComponent = config.icon;
|
|
75
|
-
const label = shortLabel ? config.shortLabel : config.label;
|
|
76
|
-
if (valueOnly) {
|
|
77
|
-
return /*#__PURE__*/_jsx(Text, {
|
|
78
|
-
style: [styles.valueOnly, compact && styles.valueOnlyCompact, {
|
|
79
|
-
color: config.color
|
|
80
|
-
}],
|
|
81
|
-
numberOfLines: 1,
|
|
82
|
-
children: value
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
if (badgeOnly) {
|
|
86
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
87
|
-
style: [styles.badgeOnly, compact && styles.badgeOnlyCompact, {
|
|
88
|
-
backgroundColor: config.color + "20",
|
|
89
|
-
borderColor: config.color + "40"
|
|
90
|
-
}],
|
|
91
|
-
children: [showIcon && /*#__PURE__*/_jsx(IconComponent, {
|
|
92
|
-
size: compact ? 10 : 12,
|
|
93
|
-
color: config.color
|
|
94
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
95
|
-
style: [styles.badgeOnlyText, compact && styles.badgeOnlyTextCompact, {
|
|
96
|
-
color: config.color
|
|
97
|
-
}],
|
|
98
|
-
children: label
|
|
99
|
-
})]
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
103
|
-
style: [styles.container, compact && styles.containerCompact],
|
|
104
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
105
|
-
style: [styles.badge, compact && styles.badgeCompact, {
|
|
106
|
-
backgroundColor: config.color + "20"
|
|
107
|
-
}],
|
|
108
|
-
children: [showIcon && /*#__PURE__*/_jsx(IconComponent, {
|
|
109
|
-
size: compact ? 8 : 10,
|
|
110
|
-
color: config.color
|
|
111
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
112
|
-
style: [styles.badgeText, compact && styles.badgeTextCompact, {
|
|
113
|
-
color: config.color
|
|
114
|
-
}],
|
|
115
|
-
children: label
|
|
116
|
-
})]
|
|
117
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
118
|
-
style: [styles.value, compact && styles.valueCompact],
|
|
119
|
-
numberOfLines: 1,
|
|
120
|
-
children: value
|
|
121
|
-
})]
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Standalone badge (no value) for category selection
|
|
126
|
-
|
|
127
|
-
export function CategoryBadge({
|
|
128
|
-
type,
|
|
129
|
-
count,
|
|
130
|
-
isSelected = false,
|
|
131
|
-
showIcon = true
|
|
132
|
-
}) {
|
|
133
|
-
const config = IDENTIFIER_CONFIG[type];
|
|
134
|
-
const IconComponent = config.icon;
|
|
135
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
136
|
-
style: [styles.categoryBadge, {
|
|
137
|
-
backgroundColor: config.color + "15",
|
|
138
|
-
borderColor: isSelected ? config.color : config.color + "40",
|
|
139
|
-
borderWidth: isSelected ? 2 : 1
|
|
140
|
-
}],
|
|
141
|
-
children: [showIcon && /*#__PURE__*/_jsx(IconComponent, {
|
|
142
|
-
size: 12,
|
|
143
|
-
color: config.color
|
|
144
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
145
|
-
style: [styles.categoryBadgeText, {
|
|
146
|
-
color: config.color
|
|
147
|
-
}],
|
|
148
|
-
children: config.label
|
|
149
|
-
}), count !== undefined && /*#__PURE__*/_jsx(View, {
|
|
150
|
-
style: [styles.categoryBadgeCount, {
|
|
151
|
-
backgroundColor: config.color + "25"
|
|
152
|
-
}],
|
|
153
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
154
|
-
style: [styles.categoryBadgeCountText, {
|
|
155
|
-
color: config.color
|
|
156
|
-
}],
|
|
157
|
-
children: count
|
|
158
|
-
})
|
|
159
|
-
})]
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
const styles = StyleSheet.create({
|
|
163
|
-
// Full badge with value
|
|
164
|
-
container: {
|
|
165
|
-
flexDirection: "row",
|
|
166
|
-
alignItems: "center",
|
|
167
|
-
gap: 6
|
|
168
|
-
},
|
|
169
|
-
containerCompact: {
|
|
170
|
-
gap: 4
|
|
171
|
-
},
|
|
172
|
-
badge: {
|
|
173
|
-
flexDirection: "row",
|
|
174
|
-
alignItems: "center",
|
|
175
|
-
paddingVertical: 3,
|
|
176
|
-
paddingHorizontal: 6,
|
|
177
|
-
borderRadius: 4,
|
|
178
|
-
gap: 4
|
|
179
|
-
},
|
|
180
|
-
badgeCompact: {
|
|
181
|
-
paddingVertical: 2,
|
|
182
|
-
paddingHorizontal: 5,
|
|
183
|
-
gap: 3
|
|
184
|
-
},
|
|
185
|
-
badgeText: {
|
|
186
|
-
fontSize: 10,
|
|
187
|
-
fontWeight: "700"
|
|
188
|
-
},
|
|
189
|
-
badgeTextCompact: {
|
|
190
|
-
fontSize: 9
|
|
191
|
-
},
|
|
192
|
-
value: {
|
|
193
|
-
fontSize: 12,
|
|
194
|
-
color: buoyColors.text,
|
|
195
|
-
fontFamily: "monospace",
|
|
196
|
-
flex: 1
|
|
197
|
-
},
|
|
198
|
-
valueCompact: {
|
|
199
|
-
fontSize: 11
|
|
200
|
-
},
|
|
201
|
-
// Badge only (no value)
|
|
202
|
-
badgeOnly: {
|
|
203
|
-
flexDirection: "row",
|
|
204
|
-
alignItems: "center",
|
|
205
|
-
paddingVertical: 4,
|
|
206
|
-
paddingHorizontal: 8,
|
|
207
|
-
borderRadius: 6,
|
|
208
|
-
borderWidth: 1,
|
|
209
|
-
gap: 5
|
|
210
|
-
},
|
|
211
|
-
badgeOnlyCompact: {
|
|
212
|
-
paddingVertical: 2,
|
|
213
|
-
paddingHorizontal: 6,
|
|
214
|
-
borderRadius: 4,
|
|
215
|
-
gap: 4
|
|
216
|
-
},
|
|
217
|
-
badgeOnlyText: {
|
|
218
|
-
fontSize: 11,
|
|
219
|
-
fontWeight: "600"
|
|
220
|
-
},
|
|
221
|
-
badgeOnlyTextCompact: {
|
|
222
|
-
fontSize: 9,
|
|
223
|
-
fontWeight: "700"
|
|
224
|
-
},
|
|
225
|
-
// Value only
|
|
226
|
-
valueOnly: {
|
|
227
|
-
fontSize: 12,
|
|
228
|
-
fontFamily: "monospace"
|
|
229
|
-
},
|
|
230
|
-
valueOnlyCompact: {
|
|
231
|
-
fontSize: 11
|
|
232
|
-
},
|
|
233
|
-
// Category badge (for filter selection)
|
|
234
|
-
categoryBadge: {
|
|
235
|
-
flexDirection: "row",
|
|
236
|
-
alignItems: "center",
|
|
237
|
-
paddingVertical: 8,
|
|
238
|
-
paddingLeft: 10,
|
|
239
|
-
paddingRight: 6,
|
|
240
|
-
borderRadius: 8,
|
|
241
|
-
gap: 6
|
|
242
|
-
},
|
|
243
|
-
categoryBadgeText: {
|
|
244
|
-
fontSize: 11,
|
|
245
|
-
fontWeight: "600"
|
|
246
|
-
},
|
|
247
|
-
categoryBadgeCount: {
|
|
248
|
-
paddingHorizontal: 6,
|
|
249
|
-
paddingVertical: 2,
|
|
250
|
-
borderRadius: 10,
|
|
251
|
-
minWidth: 20,
|
|
252
|
-
alignItems: "center"
|
|
253
|
-
},
|
|
254
|
-
categoryBadgeCountText: {
|
|
255
|
-
fontSize: 10,
|
|
256
|
-
fontWeight: "600"
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
export default IdentifierBadge;
|
|
1
|
+
"use strict";import React from"react";import{View,Text,StyleSheet}from"react-native";import{Box,Hash,Layers,Eye,Search,FileCode,buoyColors}from"@buoy-gg/shared-ui";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const IDENTIFIER_CONFIG={viewType:{label:"ViewType",shortLabel:"View",color:buoyColors.primary,icon:Box},testID:{label:"testID",shortLabel:"test",color:buoyColors.success,icon:Hash},nativeID:{label:"nativeID",shortLabel:"native",color:"#f59e0b",icon:Hash},component:{label:"Component",shortLabel:"Comp",color:"#a855f7",icon:FileCode},accessibilityLabel:{label:"a11y",shortLabel:"a11y",color:"#ec4899",icon:Eye},nativeTag:{label:"tag",shortLabel:"tag",color:buoyColors.textMuted,icon:Layers},any:{label:"Any",shortLabel:"Any",color:buoyColors.warning,icon:Search}};export function IdentifierBadge({type:e,value:o,compact:t=!1,badgeOnly:l=!1,valueOnly:a=!1,shortLabel:r=!1,showIcon:n=!1}){const s=IDENTIFIER_CONFIG[e],i=s.icon,c=r?s.shortLabel:s.label;return a?_jsx(Text,{style:[styles.valueOnly,t&&styles.valueOnlyCompact,{color:s.color}],numberOfLines:1,children:o}):_jsxs(View,l?{style:[styles.badgeOnly,t&&styles.badgeOnlyCompact,{backgroundColor:s.color+"20",borderColor:s.color+"40"}],children:[n&&_jsx(i,{size:t?10:12,color:s.color}),_jsx(Text,{style:[styles.badgeOnlyText,t&&styles.badgeOnlyTextCompact,{color:s.color}],children:c})]}:{style:[styles.container,t&&styles.containerCompact],children:[_jsxs(View,{style:[styles.badge,t&&styles.badgeCompact,{backgroundColor:s.color+"20"}],children:[n&&_jsx(i,{size:t?8:10,color:s.color}),_jsx(Text,{style:[styles.badgeText,t&&styles.badgeTextCompact,{color:s.color}],children:c})]}),_jsx(Text,{style:[styles.value,t&&styles.valueCompact],numberOfLines:1,children:o})]})}export function CategoryBadge({type:e,count:o,isSelected:t=!1,showIcon:l=!0}){const a=IDENTIFIER_CONFIG[e],r=a.icon;return _jsxs(View,{style:[styles.categoryBadge,{backgroundColor:a.color+"15",borderColor:t?a.color:a.color+"40",borderWidth:t?2:1}],children:[l&&_jsx(r,{size:12,color:a.color}),_jsx(Text,{style:[styles.categoryBadgeText,{color:a.color}],children:a.label}),void 0!==o&&_jsx(View,{style:[styles.categoryBadgeCount,{backgroundColor:a.color+"25"}],children:_jsx(Text,{style:[styles.categoryBadgeCountText,{color:a.color}],children:o})})]})}const styles=StyleSheet.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{flexDirection:"row",alignItems:"center",paddingVertical:3,paddingHorizontal:6,borderRadius:4,gap:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5,gap:3},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},value:{fontSize:12,color:buoyColors.text,fontFamily:"monospace",flex:1},valueCompact:{fontSize:11},badgeOnly:{flexDirection:"row",alignItems:"center",paddingVertical:4,paddingHorizontal:8,borderRadius:6,borderWidth:1,gap:5},badgeOnlyCompact:{paddingVertical:2,paddingHorizontal:6,borderRadius:4,gap:4},badgeOnlyText:{fontSize:11,fontWeight:"600"},badgeOnlyTextCompact:{fontSize:9,fontWeight:"700"},valueOnly:{fontSize:12,fontFamily:"monospace"},valueOnlyCompact:{fontSize:11},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCount:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCountText:{fontSize:10,fontWeight:"600"}});export default IdentifierBadge;
|
|
@@ -1,174 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* IsolatedRenderList
|
|
5
|
-
*
|
|
6
|
-
* Performance-optimized component that isolates the render tracking subscription
|
|
7
|
-
* to prevent parent re-renders. Only this component re-renders when new renders
|
|
8
|
-
* are tracked, keeping the modal UI stable.
|
|
9
|
-
*
|
|
10
|
-
* Following the optimization guide: move subscriptions to child components to
|
|
11
|
-
* prevent parent re-renders.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import React, { useState, useEffect, useRef, useCallback, memo, useMemo } from "react";
|
|
15
|
-
import { View, Text, FlatList, StyleSheet } from "react-native";
|
|
16
|
-
import { RenderTracker } from "../utils/RenderTracker";
|
|
17
|
-
import { RenderListItem } from "./RenderListItem";
|
|
18
|
-
import { Activity, Lock, buoyColors } from "@buoy-gg/shared-ui";
|
|
19
|
-
|
|
20
|
-
// Free tier limit for tracked components
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
const FREE_TIER_COMPONENT_LIMIT = 25;
|
|
23
|
-
/**
|
|
24
|
-
* Isolated list component that owns the render subscription.
|
|
25
|
-
* Parent component does NOT re-render when renders change.
|
|
26
|
-
*/
|
|
27
|
-
function IsolatedRenderListInner({
|
|
28
|
-
searchText,
|
|
29
|
-
filters,
|
|
30
|
-
onSelectRender,
|
|
31
|
-
onStatsChange,
|
|
32
|
-
onRendersChange,
|
|
33
|
-
isTracking,
|
|
34
|
-
isPro = false
|
|
35
|
-
}) {
|
|
36
|
-
// Initialize with current data to avoid flash of empty state
|
|
37
|
-
const [renders, setRenders] = useState(() => RenderTracker.getFilteredRenders(searchText));
|
|
38
|
-
const flatListRef = useRef(null);
|
|
39
|
-
|
|
40
|
-
// Subscribe to RenderTracker updates - ONLY this component re-renders
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
const unsubscribe = RenderTracker.subscribe(() => {
|
|
43
|
-
const newRenders = RenderTracker.getFilteredRenders(searchText);
|
|
44
|
-
setRenders(newRenders);
|
|
45
|
-
// Notify parent of stats via callback (parent uses ref, no re-render)
|
|
46
|
-
onStatsChange(RenderTracker.getStats());
|
|
47
|
-
// Notify parent of renders list for navigation
|
|
48
|
-
onRendersChange?.(newRenders);
|
|
49
|
-
});
|
|
50
|
-
return unsubscribe;
|
|
51
|
-
}, [searchText, onStatsChange, onRendersChange]);
|
|
52
|
-
|
|
53
|
-
// Update filtered renders when search or filters change
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
const newRenders = RenderTracker.getFilteredRenders(searchText);
|
|
56
|
-
setRenders(newRenders);
|
|
57
|
-
onRendersChange?.(newRenders);
|
|
58
|
-
}, [searchText, filters, onRendersChange]);
|
|
59
|
-
|
|
60
|
-
// Limit visible components for free tier
|
|
61
|
-
const visibleRenders = useMemo(() => {
|
|
62
|
-
if (isPro) return renders;
|
|
63
|
-
return renders.slice(0, FREE_TIER_COMPONENT_LIMIT);
|
|
64
|
-
}, [renders, isPro]);
|
|
65
|
-
|
|
66
|
-
// Calculate locked component count
|
|
67
|
-
const lockedComponentCount = useMemo(() => {
|
|
68
|
-
if (isPro) return 0;
|
|
69
|
-
return Math.max(0, renders.length - FREE_TIER_COMPONENT_LIMIT);
|
|
70
|
-
}, [renders.length, isPro]);
|
|
71
|
-
|
|
72
|
-
// Stable keyExtractor - moved outside to avoid recreation
|
|
73
|
-
const keyExtractor = useCallback(item => item.id, []);
|
|
74
|
-
|
|
75
|
-
// Stable renderItem - uses stable onSelectRender callback
|
|
76
|
-
const renderItem = useCallback(({
|
|
77
|
-
item,
|
|
78
|
-
index
|
|
79
|
-
}) => /*#__PURE__*/_jsx(RenderListItem, {
|
|
80
|
-
render: item,
|
|
81
|
-
onPress: () => onSelectRender(item, index, visibleRenders)
|
|
82
|
-
}), [onSelectRender, visibleRenders]);
|
|
83
|
-
|
|
84
|
-
// Locked banner footer
|
|
85
|
-
const renderFooter = useCallback(() => {
|
|
86
|
-
if (lockedComponentCount <= 0) return null;
|
|
87
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
88
|
-
style: styles.lockedBanner,
|
|
89
|
-
children: [/*#__PURE__*/_jsx(Lock, {
|
|
90
|
-
size: 14,
|
|
91
|
-
color: buoyColors.warning
|
|
92
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
93
|
-
style: styles.lockedBannerText,
|
|
94
|
-
children: [lockedComponentCount, " more ", lockedComponentCount === 1 ? 'component' : 'components', " locked"]
|
|
95
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
96
|
-
style: styles.lockedBannerSubtext,
|
|
97
|
-
children: "Upgrade to Pro"
|
|
98
|
-
})]
|
|
99
|
-
});
|
|
100
|
-
}, [lockedComponentCount]);
|
|
101
|
-
|
|
102
|
-
// Show empty state when no renders
|
|
103
|
-
if (renders.length === 0) {
|
|
104
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
105
|
-
style: styles.emptyState,
|
|
106
|
-
children: [/*#__PURE__*/_jsx(Activity, {
|
|
107
|
-
size: 32,
|
|
108
|
-
color: buoyColors.textMuted
|
|
109
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
110
|
-
style: styles.emptyTitle,
|
|
111
|
-
children: "No renders tracked"
|
|
112
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
113
|
-
style: styles.emptyText,
|
|
114
|
-
children: isTracking ? "Component renders will appear here" : "Enable tracking to start capturing"
|
|
115
|
-
})]
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
return /*#__PURE__*/_jsx(FlatList, {
|
|
119
|
-
ref: flatListRef,
|
|
120
|
-
data: visibleRenders,
|
|
121
|
-
renderItem: renderItem,
|
|
122
|
-
keyExtractor: keyExtractor,
|
|
123
|
-
contentContainerStyle: styles.listContent,
|
|
124
|
-
showsVerticalScrollIndicator: true,
|
|
125
|
-
initialNumToRender: 10,
|
|
126
|
-
maxToRenderPerBatch: 10,
|
|
127
|
-
windowSize: 10,
|
|
128
|
-
scrollEnabled: false,
|
|
129
|
-
ListFooterComponent: renderFooter
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Memoize to prevent re-renders from parent state changes
|
|
134
|
-
export const IsolatedRenderList = /*#__PURE__*/memo(IsolatedRenderListInner);
|
|
135
|
-
const styles = StyleSheet.create({
|
|
136
|
-
listContent: {
|
|
137
|
-
paddingTop: 8
|
|
138
|
-
},
|
|
139
|
-
emptyState: {
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
paddingVertical: 40
|
|
142
|
-
},
|
|
143
|
-
emptyTitle: {
|
|
144
|
-
color: buoyColors.text,
|
|
145
|
-
fontSize: 14,
|
|
146
|
-
fontWeight: "600",
|
|
147
|
-
marginTop: 12,
|
|
148
|
-
marginBottom: 6
|
|
149
|
-
},
|
|
150
|
-
emptyText: {
|
|
151
|
-
color: buoyColors.textMuted,
|
|
152
|
-
fontSize: 12,
|
|
153
|
-
textAlign: "center"
|
|
154
|
-
},
|
|
155
|
-
lockedBanner: {
|
|
156
|
-
flexDirection: "row",
|
|
157
|
-
alignItems: "center",
|
|
158
|
-
justifyContent: "center",
|
|
159
|
-
paddingVertical: 12,
|
|
160
|
-
paddingHorizontal: 16,
|
|
161
|
-
marginTop: 8,
|
|
162
|
-
gap: 8
|
|
163
|
-
},
|
|
164
|
-
lockedBannerText: {
|
|
165
|
-
color: buoyColors.warning,
|
|
166
|
-
fontSize: 13,
|
|
167
|
-
fontWeight: "500"
|
|
168
|
-
},
|
|
169
|
-
lockedBannerSubtext: {
|
|
170
|
-
color: buoyColors.textMuted,
|
|
171
|
-
fontSize: 12
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
export default IsolatedRenderList;
|
|
1
|
+
"use strict";import React,{useState,useEffect,useRef,useCallback,memo,useMemo}from"react";import{View,Text,FlatList,StyleSheet}from"react-native";import{RenderTracker}from"../utils/RenderTracker";import{RenderListItem}from"./RenderListItem";import{Activity,Lock,buoyColors}from"@buoy-gg/shared-ui";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const FREE_TIER_COMPONENT_LIMIT=25;function IsolatedRenderListInner({searchText:e,filters:t,onSelectRender:r,onStatsChange:n,onRendersChange:o,isTracking:s,isPro:l=!1}){const[i,a]=useState(()=>RenderTracker.getFilteredRenders(e)),c=useRef(null);useEffect(()=>RenderTracker.subscribe(()=>{const t=RenderTracker.getFilteredRenders(e);a(t),n(RenderTracker.getStats()),o?.(t)}),[e,n,o]),useEffect(()=>{const t=RenderTracker.getFilteredRenders(e);a(t),o?.(t)},[e,t,o]);const d=useMemo(()=>l?i:i.slice(0,25),[i,l]),m=useMemo(()=>l?0:Math.max(0,i.length-25),[i.length,l]),u=useCallback(e=>e.id,[]),x=useCallback(({item:e,index:t})=>_jsx(RenderListItem,{render:e,onPress:()=>r(e,t,d)}),[r,d]),y=useCallback(()=>m<=0?null:_jsxs(View,{style:styles.lockedBanner,children:[_jsx(Lock,{size:14,color:buoyColors.warning}),_jsxs(Text,{style:styles.lockedBannerText,children:[m," more ",1===m?"component":"components"," locked"]}),_jsx(Text,{style:styles.lockedBannerSubtext,children:"Upgrade to Pro"})]}),[m]);return 0===i.length?_jsxs(View,{style:styles.emptyState,children:[_jsx(Activity,{size:32,color:buoyColors.textMuted}),_jsx(Text,{style:styles.emptyTitle,children:"No renders tracked"}),_jsx(Text,{style:styles.emptyText,children:s?"Component renders will appear here":"Enable tracking to start capturing"})]}):_jsx(FlatList,{ref:c,data:d,renderItem:x,keyExtractor:u,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:!0,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:!1,ListFooterComponent:y})}export const IsolatedRenderList=memo(IsolatedRenderListInner);const styles=StyleSheet.create({listContent:{paddingTop:8},emptyState:{alignItems:"center",paddingVertical:40},emptyTitle:{color:buoyColors.text,fontSize:14,fontWeight:"600",marginTop:12,marginBottom:6},emptyText:{color:buoyColors.textMuted,fontSize:12,textAlign:"center"},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:16,marginTop:8,gap:8},lockedBannerText:{color:buoyColors.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:buoyColors.textMuted,fontSize:12}});export default IsolatedRenderList;
|