@buoy-gg/highlight-updates 3.0.0 → 3.0.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.
Files changed (83) hide show
  1. package/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +285 -1
  2. package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1371 -1
  3. package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +564 -1
  4. package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +267 -1
  5. package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +178 -1
  6. package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +309 -1
  7. package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +500 -1
  8. package/lib/commonjs/highlight-updates/components/RenderDetailView.js +803 -1
  9. package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +894 -1
  10. package/lib/commonjs/highlight-updates/components/RenderListItem.js +220 -1
  11. package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +562 -1
  12. package/lib/commonjs/highlight-updates/components/StatsDisplay.js +70 -1
  13. package/lib/commonjs/highlight-updates/components/index.js +97 -1
  14. package/lib/commonjs/highlight-updates/types/copySettings.js +107 -1
  15. package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1819 -1
  16. package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +359 -1
  17. package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +371 -1
  18. package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +1828 -1
  19. package/lib/commonjs/highlight-updates/utils/RenderTracker.js +919 -1
  20. package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +264 -1
  21. package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +49 -1
  22. package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +58 -1
  23. package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +485 -1
  24. package/lib/commonjs/index.js +320 -1
  25. package/lib/commonjs/preset.js +278 -1
  26. package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +83 -0
  27. package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +278 -1
  28. package/lib/module/highlight-updates/components/HighlightFilterView.js +1365 -1
  29. package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +558 -1
  30. package/lib/module/highlight-updates/components/IdentifierBadge.js +259 -1
  31. package/lib/module/highlight-updates/components/IsolatedRenderList.js +174 -1
  32. package/lib/module/highlight-updates/components/ModalHeaderContent.js +304 -1
  33. package/lib/module/highlight-updates/components/RenderCauseBadge.js +491 -1
  34. package/lib/module/highlight-updates/components/RenderDetailView.js +797 -1
  35. package/lib/module/highlight-updates/components/RenderHistoryViewer.js +888 -1
  36. package/lib/module/highlight-updates/components/RenderListItem.js +215 -1
  37. package/lib/module/highlight-updates/components/RendersCopySettingsView.js +558 -1
  38. package/lib/module/highlight-updates/components/StatsDisplay.js +67 -1
  39. package/lib/module/highlight-updates/components/index.js +16 -1
  40. package/lib/module/highlight-updates/types/copySettings.js +102 -1
  41. package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1815 -1
  42. package/lib/module/highlight-updates/utils/PerformanceLogger.js +353 -1
  43. package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +358 -1
  44. package/lib/module/highlight-updates/utils/RenderCauseDetector.js +1818 -1
  45. package/lib/module/highlight-updates/utils/RenderTracker.js +916 -1
  46. package/lib/module/highlight-updates/utils/ViewTypeMapper.js +255 -1
  47. package/lib/module/highlight-updates/utils/copySettingsStorage.js +43 -1
  48. package/lib/module/highlight-updates/utils/renderExportFormatter.js +54 -1
  49. package/lib/module/highlight-updates/utils/rendersExportFormatter.js +478 -1
  50. package/lib/module/index.js +74 -1
  51. package/lib/module/preset.js +272 -1
  52. package/lib/module/sync/highlightUpdatesSyncAdapter.js +78 -0
  53. package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +1 -0
  54. package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +1 -0
  55. package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +1 -0
  56. package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +1 -0
  57. package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +1 -0
  58. package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +1 -0
  59. package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +1 -0
  60. package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +1 -0
  61. package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +1 -0
  62. package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +1 -0
  63. package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +1 -0
  64. package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +1 -0
  65. package/lib/typescript/highlight-updates/components/index.d.ts.map +1 -0
  66. package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +1 -0
  67. package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts +90 -0
  68. package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +1 -0
  69. package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +1 -0
  70. package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +1 -0
  71. package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +1 -0
  72. package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts +10 -0
  73. package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +1 -0
  74. package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +1 -0
  75. package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +1 -0
  76. package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +1 -0
  77. package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +1 -0
  78. package/lib/typescript/index.d.ts +1 -0
  79. package/lib/typescript/index.d.ts.map +1 -0
  80. package/lib/typescript/preset.d.ts.map +1 -0
  81. package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts +36 -0
  82. package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +1 -0
  83. package/package.json +7 -7
@@ -1 +1,255 @@
1
- "use strict";export const VIEW_TYPE_MAP={RCTView:"View",RCTSafeAreaView:"SafeAreaView",RCTModalHostView:"Modal",RCTText:"Text",RCTRawText:"RawText",RCTVirtualText:"VirtualText",RCTTextInlineImage:"TextInlineImage",RCTImageView:"Image",RCTImage:"Image",RCTScrollView:"ScrollView",RCTScrollContentView:"ScrollContentView",AndroidHorizontalScrollView:"HorizontalScrollView",AndroidHorizontalScrollContentView:"HorizontalScrollContentView",RCTSinglelineTextInputView:"TextInput",RCTMultilineTextInputView:"TextInput (Multiline)",AndroidTextInput:"TextInput",RCTInputAccessoryView:"InputAccessoryView",RCTRefreshControl:"RefreshControl",AndroidSwipeRefreshLayout:"RefreshControl",PullToRefreshView:"RefreshControl",RCTSwitch:"Switch",AndroidSwitch:"Switch",RCTSlider:"Slider",RCTActivityIndicatorView:"ActivityIndicator",AndroidProgressBar:"ActivityIndicator",AndroidDrawerLayout:"DrawerLayout",VirtualView:"VirtualView",VirtualViewExperimental:"VirtualView",DebuggingOverlay:"DebuggingOverlay",LayoutConformance:"LayoutConformance",UnimplementedNativeView:"UnimplementedView",RKShimmeringView:"ShimmeringView",RCTTemplateView:"TemplateView",RCTAxialGradientView:"AxialGradientView",RCTMap:"Map",RCTWebView:"WebView",RCTKeyframes:"Keyframes",RCTImpressionTrackingView:"ImpressionTrackingView",RNSVGSvgView:"Svg",RNSVGGroup:"G",RNSVGPath:"Path",RNSVGText:"SvgText",RNSVGTSpan:"TSpan",RNSVGTextPath:"TextPath",RNSVGImage:"SvgImage",RNSVGCircle:"Circle",RNSVGEllipse:"Ellipse",RNSVGLine:"Line",RNSVGRect:"Rect",RNSVGClipPath:"ClipPath",RNSVGDefs:"Defs",RNSVGUse:"Use",RNSVGSymbol:"Symbol",RNSVGPattern:"Pattern",RNSVGMask:"Mask",RNSVGForeignObject:"ForeignObject",RNSVGMarker:"Marker",RNSVGLinearGradient:"LinearGradient",RNSVGRadialGradient:"RadialGradient",RNSVGFilter:"Filter",RNSVGFeBlend:"FeBlend",RNSVGFeColorMatrix:"FeColorMatrix",RNSVGFeComposite:"FeComposite",RNSVGFeFlood:"FeFlood",RNSVGFeGaussianBlur:"FeGaussianBlur",RNSVGFeMerge:"FeMerge",RNSVGFeOffset:"FeOffset",RNSVGPolygon:"Polygon",RNSVGPolyline:"Polyline",RNSVGStop:"Stop",RNGestureHandlerRootView:"GestureHandlerRootView",RNGestureHandlerButton:"GestureHandlerButton",RNCSafeAreaProvider:"SafeAreaProvider",RNCSafeAreaView:"SafeAreaView",RNSScreen:"Screen",RNSScreenContainer:"ScreenContainer",RNSScreenStack:"ScreenStack",RNSScreenStackHeaderConfig:"ScreenStackHeaderConfig",RNSScreenStackHeaderSubview:"ScreenStackHeaderSubview",RNSSearchBar:"SearchBar",RNSFullWindowOverlay:"FullWindowOverlay",RNSModalScreen:"ModalScreen",ReanimatedView:"Animated.View",ExpoView:"ExpoView",ExpoBlurView:"BlurView",ExpoLinearGradient:"LinearGradient",ExpoImage:"ExpoImage",ExpoVideoView:"VideoView",ExpoCamera:"Camera",ExpoBarCodeScannerView:"BarCodeScanner",RNCWebView:"WebView",AIRMap:"MapView",AIRMapMarker:"Marker",AIRMapPolyline:"Polyline",AIRMapPolygon:"Polygon",AIRMapCircle:"Circle",AIRMapCallout:"Callout",RCTVideo:"Video",LottieAnimationView:"LottieView",FastImageView:"FastImage"};export function getComponentDisplayName(e){return VIEW_TYPE_MAP[e]||e}export function getNativeViewType(e){for(const[i,t]of Object.entries(VIEW_TYPE_MAP))if(t===e)return i;return null}export function isKnownViewType(e){return e in VIEW_TYPE_MAP}export function getAllNativeViewTypes(){return Object.keys(VIEW_TYPE_MAP)}export function getAllComponentNames(){return[...new Set(Object.values(VIEW_TYPE_MAP))]}export default{VIEW_TYPE_MAP:VIEW_TYPE_MAP,getComponentDisplayName:getComponentDisplayName,getNativeViewType:getNativeViewType,isKnownViewType:isKnownViewType,getAllNativeViewTypes:getAllNativeViewTypes,getAllComponentNames:getAllComponentNames};
1
+ /**
2
+ * ViewTypeMapper
3
+ *
4
+ * Maps native view class names (e.g., "RCTView", "RCTText") to their
5
+ * developer-friendly React Native component names (e.g., "View", "Text").
6
+ *
7
+ * This makes the render tracking UI more understandable since developers
8
+ * work with component names, not native class names.
9
+ *
10
+ * Sources:
11
+ * - React Native core: packages/react-native/Libraries/Components/*
12
+ * - React Native Android: ReactAndroid/src/main/java/com/facebook/react/views/*
13
+ * - FabricNameComponentMapping.kt
14
+ * - Common third-party libraries (react-native-svg, gesture-handler, etc.)
15
+ */
16
+
17
+ "use strict";
18
+
19
+ /**
20
+ * Mapping from native view class names to React component names.
21
+ *
22
+ * Format: { "NativeClassName": "ComponentName" }
23
+ */
24
+ export const VIEW_TYPE_MAP = {
25
+ // ==========================================================================
26
+ // REACT NATIVE CORE - Views
27
+ // ==========================================================================
28
+ RCTView: "View",
29
+ RCTSafeAreaView: "SafeAreaView",
30
+ RCTModalHostView: "Modal",
31
+ // ==========================================================================
32
+ // REACT NATIVE CORE - Text
33
+ // ==========================================================================
34
+ RCTText: "Text",
35
+ RCTRawText: "RawText",
36
+ RCTVirtualText: "VirtualText",
37
+ RCTTextInlineImage: "TextInlineImage",
38
+ // ==========================================================================
39
+ // REACT NATIVE CORE - Images
40
+ // ==========================================================================
41
+ RCTImageView: "Image",
42
+ RCTImage: "Image",
43
+ // ==========================================================================
44
+ // REACT NATIVE CORE - ScrollView
45
+ // ==========================================================================
46
+ RCTScrollView: "ScrollView",
47
+ RCTScrollContentView: "ScrollContentView",
48
+ AndroidHorizontalScrollView: "HorizontalScrollView",
49
+ AndroidHorizontalScrollContentView: "HorizontalScrollContentView",
50
+ // ==========================================================================
51
+ // REACT NATIVE CORE - TextInput
52
+ // ==========================================================================
53
+ RCTSinglelineTextInputView: "TextInput",
54
+ RCTMultilineTextInputView: "TextInput (Multiline)",
55
+ AndroidTextInput: "TextInput",
56
+ RCTInputAccessoryView: "InputAccessoryView",
57
+ // ==========================================================================
58
+ // REACT NATIVE CORE - Lists (FlatList/SectionList internals)
59
+ // ==========================================================================
60
+ RCTRefreshControl: "RefreshControl",
61
+ AndroidSwipeRefreshLayout: "RefreshControl",
62
+ PullToRefreshView: "RefreshControl",
63
+ // ==========================================================================
64
+ // REACT NATIVE CORE - Buttons & Touchables
65
+ // ==========================================================================
66
+ RCTSwitch: "Switch",
67
+ AndroidSwitch: "Switch",
68
+ RCTSlider: "Slider",
69
+ // ==========================================================================
70
+ // REACT NATIVE CORE - Activity Indicators
71
+ // ==========================================================================
72
+ RCTActivityIndicatorView: "ActivityIndicator",
73
+ AndroidProgressBar: "ActivityIndicator",
74
+ // ==========================================================================
75
+ // REACT NATIVE CORE - Android-specific
76
+ // ==========================================================================
77
+ AndroidDrawerLayout: "DrawerLayout",
78
+ VirtualView: "VirtualView",
79
+ VirtualViewExperimental: "VirtualView",
80
+ // ==========================================================================
81
+ // REACT NATIVE CORE - Debugging & Internal
82
+ // ==========================================================================
83
+ DebuggingOverlay: "DebuggingOverlay",
84
+ LayoutConformance: "LayoutConformance",
85
+ UnimplementedNativeView: "UnimplementedView",
86
+ // ==========================================================================
87
+ // REACT NATIVE CORE - Legacy/Deprecated
88
+ // ==========================================================================
89
+ RKShimmeringView: "ShimmeringView",
90
+ RCTTemplateView: "TemplateView",
91
+ RCTAxialGradientView: "AxialGradientView",
92
+ // "RCTVideo": "Video",
93
+ RCTMap: "Map",
94
+ RCTWebView: "WebView",
95
+ RCTKeyframes: "Keyframes",
96
+ RCTImpressionTrackingView: "ImpressionTrackingView",
97
+ // ==========================================================================
98
+ // REACT-NATIVE-SVG
99
+ // ==========================================================================
100
+ RNSVGSvgView: "Svg",
101
+ RNSVGGroup: "G",
102
+ RNSVGPath: "Path",
103
+ RNSVGText: "SvgText",
104
+ RNSVGTSpan: "TSpan",
105
+ RNSVGTextPath: "TextPath",
106
+ RNSVGImage: "SvgImage",
107
+ RNSVGCircle: "Circle",
108
+ RNSVGEllipse: "Ellipse",
109
+ RNSVGLine: "Line",
110
+ RNSVGRect: "Rect",
111
+ RNSVGClipPath: "ClipPath",
112
+ RNSVGDefs: "Defs",
113
+ RNSVGUse: "Use",
114
+ RNSVGSymbol: "Symbol",
115
+ RNSVGPattern: "Pattern",
116
+ RNSVGMask: "Mask",
117
+ RNSVGForeignObject: "ForeignObject",
118
+ RNSVGMarker: "Marker",
119
+ RNSVGLinearGradient: "LinearGradient",
120
+ RNSVGRadialGradient: "RadialGradient",
121
+ RNSVGFilter: "Filter",
122
+ RNSVGFeBlend: "FeBlend",
123
+ RNSVGFeColorMatrix: "FeColorMatrix",
124
+ RNSVGFeComposite: "FeComposite",
125
+ RNSVGFeFlood: "FeFlood",
126
+ RNSVGFeGaussianBlur: "FeGaussianBlur",
127
+ RNSVGFeMerge: "FeMerge",
128
+ RNSVGFeOffset: "FeOffset",
129
+ RNSVGPolygon: "Polygon",
130
+ RNSVGPolyline: "Polyline",
131
+ RNSVGStop: "Stop",
132
+ // ==========================================================================
133
+ // REACT-NATIVE-GESTURE-HANDLER
134
+ // ==========================================================================
135
+ RNGestureHandlerRootView: "GestureHandlerRootView",
136
+ RNGestureHandlerButton: "GestureHandlerButton",
137
+ // ==========================================================================
138
+ // REACT-NATIVE-SAFE-AREA-CONTEXT
139
+ // ==========================================================================
140
+ RNCSafeAreaProvider: "SafeAreaProvider",
141
+ RNCSafeAreaView: "SafeAreaView",
142
+ // ==========================================================================
143
+ // REACT-NATIVE-SCREENS (React Navigation)
144
+ // ==========================================================================
145
+ RNSScreen: "Screen",
146
+ RNSScreenContainer: "ScreenContainer",
147
+ RNSScreenStack: "ScreenStack",
148
+ RNSScreenStackHeaderConfig: "ScreenStackHeaderConfig",
149
+ RNSScreenStackHeaderSubview: "ScreenStackHeaderSubview",
150
+ RNSSearchBar: "SearchBar",
151
+ RNSFullWindowOverlay: "FullWindowOverlay",
152
+ RNSModalScreen: "ModalScreen",
153
+ // ==========================================================================
154
+ // REACT-NATIVE-REANIMATED
155
+ // ==========================================================================
156
+ ReanimatedView: "Animated.View",
157
+ // ==========================================================================
158
+ // EXPO MODULES
159
+ // ==========================================================================
160
+ ExpoView: "ExpoView",
161
+ ExpoBlurView: "BlurView",
162
+ ExpoLinearGradient: "LinearGradient",
163
+ ExpoImage: "ExpoImage",
164
+ ExpoVideoView: "VideoView",
165
+ ExpoCamera: "Camera",
166
+ ExpoBarCodeScannerView: "BarCodeScanner",
167
+ // ==========================================================================
168
+ // REACT-NATIVE-WEBVIEW
169
+ // ==========================================================================
170
+ RNCWebView: "WebView",
171
+ // ==========================================================================
172
+ // REACT-NATIVE-MAPS
173
+ // ==========================================================================
174
+ AIRMap: "MapView",
175
+ AIRMapMarker: "Marker",
176
+ AIRMapPolyline: "Polyline",
177
+ AIRMapPolygon: "Polygon",
178
+ AIRMapCircle: "Circle",
179
+ AIRMapCallout: "Callout",
180
+ // ==========================================================================
181
+ // REACT-NATIVE-VIDEO
182
+ // ==========================================================================
183
+ RCTVideo: "Video",
184
+ // ==========================================================================
185
+ // LOTTIE-REACT-NATIVE
186
+ // ==========================================================================
187
+ LottieAnimationView: "LottieView",
188
+ // ==========================================================================
189
+ // REACT-NATIVE-FAST-IMAGE
190
+ // ==========================================================================
191
+ FastImageView: "FastImage"
192
+ };
193
+
194
+ /**
195
+ * Get the developer-friendly component name for a native view type.
196
+ * Returns the original viewType if no mapping exists.
197
+ *
198
+ * @param viewType - The native view class name (e.g., "RCTView")
199
+ * @returns The component name (e.g., "View")
200
+ */
201
+ export function getComponentDisplayName(viewType) {
202
+ return VIEW_TYPE_MAP[viewType] || viewType;
203
+ }
204
+
205
+ /**
206
+ * Get the native view class name for a component name (reverse lookup).
207
+ * Returns null if no mapping exists.
208
+ *
209
+ * @param componentName - The component name (e.g., "View")
210
+ * @returns The native view class name (e.g., "RCTView") or null
211
+ */
212
+ export function getNativeViewType(componentName) {
213
+ for (const [native, display] of Object.entries(VIEW_TYPE_MAP)) {
214
+ if (display === componentName) {
215
+ return native;
216
+ }
217
+ }
218
+ return null;
219
+ }
220
+
221
+ /**
222
+ * Check if a view type is a known native component.
223
+ *
224
+ * @param viewType - The native view class name
225
+ * @returns true if it's a known component
226
+ */
227
+ export function isKnownViewType(viewType) {
228
+ return viewType in VIEW_TYPE_MAP;
229
+ }
230
+
231
+ /**
232
+ * Get all known view types (useful for autocomplete/suggestions).
233
+ *
234
+ * @returns Array of all native view class names
235
+ */
236
+ export function getAllNativeViewTypes() {
237
+ return Object.keys(VIEW_TYPE_MAP);
238
+ }
239
+
240
+ /**
241
+ * Get all known component names (useful for autocomplete/suggestions).
242
+ *
243
+ * @returns Array of all component display names
244
+ */
245
+ export function getAllComponentNames() {
246
+ return [...new Set(Object.values(VIEW_TYPE_MAP))];
247
+ }
248
+ export default {
249
+ VIEW_TYPE_MAP,
250
+ getComponentDisplayName,
251
+ getNativeViewType,
252
+ isKnownViewType,
253
+ getAllNativeViewTypes,
254
+ getAllComponentNames
255
+ };
@@ -1 +1,43 @@
1
- "use strict";import{persistentStorage,devToolsStorageKeys}from"@buoy-gg/shared-ui";import{DEFAULT_COPY_SETTINGS}from"../types/copySettings";export async function saveCopySettings(t){try{const e=devToolsStorageKeys.highlightUpdates.copySettings();await persistentStorage.setItem(e,JSON.stringify(t))}catch{}}export async function loadCopySettings(){try{const t=devToolsStorageKeys.highlightUpdates.copySettings(),e=await persistentStorage.getItem(t);if(e&&""!==e){const t=JSON.parse(e);return{...DEFAULT_COPY_SETTINGS,...t,filterCauses:t.filterCauses??DEFAULT_COPY_SETTINGS.filterCauses}}return null}catch{return null}}export async function clearCopySettings(){try{const t=devToolsStorageKeys.highlightUpdates.copySettings();await persistentStorage.removeItem(t)}catch{}}
1
+ "use strict";
2
+
3
+ /**
4
+ * Copy Settings Storage
5
+ *
6
+ * Persists the highlight-updates copy/export settings.
7
+ */
8
+
9
+ import { persistentStorage, devToolsStorageKeys } from "@buoy-gg/shared-ui";
10
+ import { DEFAULT_COPY_SETTINGS } from "../types/copySettings";
11
+ export async function saveCopySettings(settings) {
12
+ try {
13
+ const key = devToolsStorageKeys.highlightUpdates.copySettings();
14
+ await persistentStorage.setItem(key, JSON.stringify(settings));
15
+ } catch {
16
+ // Silently fail — persistence is optional
17
+ }
18
+ }
19
+ export async function loadCopySettings() {
20
+ try {
21
+ const key = devToolsStorageKeys.highlightUpdates.copySettings();
22
+ const value = await persistentStorage.getItem(key);
23
+ if (value && value !== "") {
24
+ const parsed = JSON.parse(value);
25
+ return {
26
+ ...DEFAULT_COPY_SETTINGS,
27
+ ...parsed,
28
+ filterCauses: parsed.filterCauses ?? DEFAULT_COPY_SETTINGS.filterCauses
29
+ };
30
+ }
31
+ return null;
32
+ } catch {
33
+ return null;
34
+ }
35
+ }
36
+ export async function clearCopySettings() {
37
+ try {
38
+ const key = devToolsStorageKeys.highlightUpdates.copySettings();
39
+ await persistentStorage.removeItem(key);
40
+ } catch {
41
+ // Silently fail
42
+ }
43
+ }
@@ -1 +1,54 @@
1
- "use strict";export function generateRendersJson(e){const n={exportedAt:(new Date).toISOString(),totalComponents:e.length,totalRenders:e.reduce((e,n)=>e+n.renderCount,0),components:e.map(e=>({componentName:e.componentName||e.displayName,viewType:e.viewType,nativeTag:e.nativeTag,testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,renderCount:e.renderCount,firstRenderTime:e.firstRenderTime,lastRenderTime:e.lastRenderTime,lastRenderCause:e.lastRenderCause?{type:e.lastRenderCause.type,componentCause:e.lastRenderCause.componentCause,changedKeys:e.lastRenderCause.changedKeys,hookChanges:e.lastRenderCause.hookChanges?.map(e=>({type:e.type,index:e.index,description:e.description}))}:null,renderHistory:e.renderHistory?.map(e=>({renderNumber:e.renderNumber,timestamp:e.timestamp,cause:{type:e.cause.type,componentCause:e.cause.componentCause,changedKeys:e.cause.changedKeys}}))}))};return JSON.stringify(n,null,2)}
1
+ "use strict";
2
+
3
+ /**
4
+ * Render Export Formatter
5
+ *
6
+ * Simple JSON export for render tracking data.
7
+ */
8
+
9
+ /**
10
+ * Generate JSON export of all tracked renders
11
+ */
12
+ export function generateRendersJson(renders) {
13
+ const exportData = {
14
+ exportedAt: new Date().toISOString(),
15
+ totalComponents: renders.length,
16
+ totalRenders: renders.reduce((sum, r) => sum + r.renderCount, 0),
17
+ components: renders.map(render => ({
18
+ // Identity
19
+ componentName: render.componentName || render.displayName,
20
+ viewType: render.viewType,
21
+ nativeTag: render.nativeTag,
22
+ // Identifiers
23
+ testID: render.testID,
24
+ nativeID: render.nativeID,
25
+ accessibilityLabel: render.accessibilityLabel,
26
+ // Render stats
27
+ renderCount: render.renderCount,
28
+ firstRenderTime: render.firstRenderTime,
29
+ lastRenderTime: render.lastRenderTime,
30
+ // Last render cause
31
+ lastRenderCause: render.lastRenderCause ? {
32
+ type: render.lastRenderCause.type,
33
+ componentCause: render.lastRenderCause.componentCause,
34
+ changedKeys: render.lastRenderCause.changedKeys,
35
+ hookChanges: render.lastRenderCause.hookChanges?.map(h => ({
36
+ type: h.type,
37
+ index: h.index,
38
+ description: h.description
39
+ }))
40
+ } : null,
41
+ // Render history (if available)
42
+ renderHistory: render.renderHistory?.map(event => ({
43
+ renderNumber: event.renderNumber,
44
+ timestamp: event.timestamp,
45
+ cause: {
46
+ type: event.cause.type,
47
+ componentCause: event.cause.componentCause,
48
+ changedKeys: event.cause.changedKeys
49
+ }
50
+ }))
51
+ }))
52
+ };
53
+ return JSON.stringify(exportData, null, 2);
54
+ }