@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
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.highlightUpdatesSyncAdapter = void 0;
7
+ var _HighlightUpdatesController = _interopRequireDefault(require("../highlight-updates/utils/HighlightUpdatesController"));
8
+ var _RenderTracker = require("../highlight-updates/utils/RenderTracker");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function ensureInitialized() {
11
+ if (!_HighlightUpdatesController.default.isInitialized()) {
12
+ _HighlightUpdatesController.default.initialize();
13
+ }
14
+ }
15
+
16
+ /**
17
+ * Sync adapter for the highlight-updates tool, consumed by
18
+ * @buoy-gg/external-sync's `useExternalSync` (structurally matches its
19
+ * ToolSyncAdapter interface so this package doesn't need a dependency on it).
20
+ *
21
+ * The visual highlights draw on the DEVICE's UI, but the render-tracking
22
+ * data (component list, render counts, causes, history) is plain data — the
23
+ * snapshot carries it so the dashboard renders the real HighlightUpdatesModal
24
+ * as a mirror. Mutations (toggle, freeze, clear, spotlight) come back as
25
+ * actions and run on the device; spotlight even highlights the component on
26
+ * the phone screen while browsing details from the desktop.
27
+ */
28
+ const highlightUpdatesSyncAdapter = exports.highlightUpdatesSyncAdapter = {
29
+ version: 1,
30
+ getSnapshot: () => ({
31
+ enabled: _HighlightUpdatesController.default.isEnabled(),
32
+ frozen: _HighlightUpdatesController.default.getFrozen(),
33
+ // True while tracking but the visual boxes are hidden (screenshot tool).
34
+ highlightsSuppressed: _HighlightUpdatesController.default.getHighlightsSuppressed(),
35
+ renders: _RenderTracker.RenderTracker.getRenders(),
36
+ trackerState: _RenderTracker.RenderTracker.getState()
37
+ }),
38
+ subscribe: onChange => {
39
+ const unsubscribeEnabled = _HighlightUpdatesController.default.subscribe(onChange);
40
+ const unsubscribeFreeze = _HighlightUpdatesController.default.subscribeToFreeze(onChange);
41
+ const unsubscribeRenders = _RenderTracker.RenderTracker.subscribe(onChange);
42
+ const unsubscribeTrackerState = _RenderTracker.RenderTracker.subscribeToState(onChange);
43
+ return () => {
44
+ unsubscribeEnabled();
45
+ unsubscribeFreeze();
46
+ unsubscribeRenders();
47
+ unsubscribeTrackerState();
48
+ };
49
+ },
50
+ actions: {
51
+ toggle: () => {
52
+ ensureInitialized();
53
+ _HighlightUpdatesController.default.toggle();
54
+ },
55
+ setEnabled: params => {
56
+ ensureInitialized();
57
+ _HighlightUpdatesController.default.setEnabled(params.enabled);
58
+ },
59
+ toggleFreeze: () => {
60
+ _HighlightUpdatesController.default.toggleFreeze();
61
+ },
62
+ clearRenderCounts: () => {
63
+ _HighlightUpdatesController.default.clearRenderCounts();
64
+ },
65
+ setSpotlight: params => {
66
+ _HighlightUpdatesController.default.setSpotlight(params.nativeTag);
67
+ },
68
+ // Resolve a component (by testID/nativeID/name/nativeTag) to a fresh
69
+ // on-screen rectangle — best-effort scrolling it into view first — so the
70
+ // desktop can crop a simulator screenshot to exactly that component. The
71
+ // returned value (rect + scale + screen) flows back as the action result.
72
+ locateComponent: params => {
73
+ ensureInitialized();
74
+ return _HighlightUpdatesController.default.locateComponent(params ?? {});
75
+ },
76
+ // Track + measure components WITHOUT drawing the highlight boxes, so the
77
+ // desktop screenshot tool can locate components with no on-device overlay.
78
+ setSilentTracking: params => {
79
+ ensureInitialized();
80
+ _HighlightUpdatesController.default.setSilentTracking(params.enabled ?? false);
81
+ }
82
+ }
83
+ };
@@ -1 +1,278 @@
1
- "use strict";import React,{useEffect,useState,useRef,useCallback,useLayoutEffect}from"react";import{View,Text,StyleSheet,TouchableOpacity}from"react-native";import{buoyColors}from"@buoy-gg/shared-ui";import HighlightUpdatesController from"./utils/HighlightUpdatesController";import{PerformanceLogger,markOverlayRendered}from"./utils/PerformanceLogger";import{RenderTracker}from"./utils/RenderTracker";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const HIGHLIGHT_DURATION=1e3;export function HighlightUpdatesOverlay({onBadgePress:e}={}){const[t,r]=useState([]),[o,l]=useState(()=>HighlightUpdatesController.getFrozen()),[s,i]=useState(null),n=useRef(null),a=useRef(0),h=useRef(0),g=useRef(o);g.current=o,PerformanceLogger.isEnabled()&&(a.current=performance.now(),h.current=t.length),useLayoutEffect(()=>{if(PerformanceLogger.isEnabled()&&a.current>0&&h.current>0){const e=performance.now()-a.current;markOverlayRendered(h.current,e)}}),useEffect(()=>HighlightUpdatesController.subscribeToFreeze(e=>{l(e)}),[]),useEffect(()=>RenderTracker.subscribeToFilters(()=>{r(e=>e.filter(e=>{const t=RenderTracker.getRender(String(e.id));return!t||RenderTracker.shouldShowRender(t)}))}),[]),useEffect(()=>(HighlightUpdatesController.setSpotlightCallback(e=>{i(e)}),()=>{HighlightUpdatesController.setSpotlightCallback(null)}),[]);const d=useCallback(e=>{const t=Date.now(),o=e.map(e=>({...e,timestamp:t}));r(e=>{const t=[...e];for(const e of o){const r=t.findIndex(t=>t.id===e.id);r>=0?t[r]=e:t.push(e)}return t})},[]);useEffect(()=>(HighlightUpdatesController.setHighlightCallback(d),n.current=setInterval(()=>{if(g.current)return;const e=Date.now();r(t=>t.filter(t=>e-t.timestamp<1e3))},50),()=>{HighlightUpdatesController.setHighlightCallback(null),n.current&&clearInterval(n.current)}),[d]);const c=e||HighlightUpdatesController.getBadgePressCallback(),u=useCallback(t=>{e?e(t):HighlightUpdatesController.handleBadgePress(t)},[e]),p=s?RenderTracker.getRender(String(s)):null;return 0!==t.length||p?.measurements?_jsxs(View,{style:styles.overlay,pointerEvents:"box-none",nativeID:"highlight-updates-overlay",children:[p?.measurements&&_jsxs(_Fragment,{children:[_jsx(View,{pointerEvents:"none",nativeID:"__spotlight_highlight__",style:[styles.spotlightHighlight,{left:p.measurements.x-3,top:p.measurements.y-3,width:p.measurements.width+6,height:p.measurements.height+6}]}),_jsx(View,{pointerEvents:"none",style:[styles.spotlightLabel,{left:p.measurements.x,top:p.measurements.y+p.measurements.height+4}],children:_jsx(Text,{style:styles.spotlightLabelText,children:p.componentName||p.displayName||p.viewType})})]}),t.map(e=>_jsx(View,{pointerEvents:"box-none",nativeID:`__highlight_rect_${e.id}__`,style:[styles.highlight,{left:e.x,top:e.y,width:e.width,height:e.height,borderColor:e.color}],children:e.count>0&&(c?_jsx(TouchableOpacity,{onPress:()=>u(e.id),style:[styles.badge,{backgroundColor:e.color}],activeOpacity:.7,hitSlop:{top:8,bottom:8,left:8,right:8},children:_jsx(Text,{style:styles.badgeText,nativeID:`__highlight_text_${e.id}__`,children:e.count})}):_jsx(View,{style:[styles.badge,{backgroundColor:e.color}],nativeID:`__highlight_badge_${e.id}__`,pointerEvents:"none",children:_jsx(Text,{style:styles.badgeText,nativeID:`__highlight_text_${e.id}__`,children:e.count})}))},`highlight-${e.id}`))]}):null}const styles=StyleSheet.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999999,elevation:999999,borderWidth:0},highlight:{position:"absolute",borderWidth:2,borderStyle:"solid",backgroundColor:"transparent"},badge:{position:"absolute",top:0,right:0,height:14,borderRadius:0,justifyContent:"center",alignItems:"center",paddingHorizontal:2},badgeText:{color:"#000",fontSize:9,fontWeight:"bold"},spotlightHighlight:{position:"absolute",borderWidth:2,borderStyle:"dashed",borderColor:buoyColors.primary,backgroundColor:"transparent"},spotlightLabel:{position:"absolute",backgroundColor:buoyColors.card,borderWidth:1,borderColor:buoyColors.primary,paddingHorizontal:8,paddingVertical:3,borderRadius:4},spotlightLabelText:{color:buoyColors.primary,fontSize:11,fontWeight:"600",fontFamily:"monospace"}});export default HighlightUpdatesOverlay;
1
+ "use strict";
2
+
3
+ /**
4
+ * HighlightUpdatesOverlay
5
+ *
6
+ * Renders colored highlight rectangles for components that have updated.
7
+ * Uses View-based rendering (similar to debug-borders) instead of the
8
+ * native DebuggingOverlay component for better compatibility.
9
+ */
10
+
11
+ import React, { useEffect, useState, useRef, useCallback, useLayoutEffect } from "react";
12
+ import { View, Text, StyleSheet, TouchableOpacity } from "react-native";
13
+ import { buoyColors } from "@buoy-gg/shared-ui";
14
+ import HighlightUpdatesController from "./utils/HighlightUpdatesController";
15
+ import { PerformanceLogger, markOverlayRendered } from "./utils/PerformanceLogger";
16
+ import { RenderTracker } from "./utils/RenderTracker";
17
+
18
+ // Declare performance API available in React Native's JavaScript environment
19
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
20
+ // How long highlights stay visible (ms)
21
+ const HIGHLIGHT_DURATION = 1000;
22
+ export function HighlightUpdatesOverlay({
23
+ onBadgePress
24
+ } = {}) {
25
+ const [highlights, setHighlights] = useState([]);
26
+ const [isFrozen, setIsFrozen] = useState(() => HighlightUpdatesController.getFrozen());
27
+ const [spotlightTag, setSpotlightTag] = useState(null);
28
+ const cleanupTimerRef = useRef(null);
29
+ const renderStartTimeRef = useRef(0);
30
+ const highlightCountRef = useRef(0);
31
+ const frozenRef = useRef(isFrozen);
32
+
33
+ // Keep ref in sync with state for use in interval callback
34
+ frozenRef.current = isFrozen;
35
+
36
+ // Track render start time
37
+ if (PerformanceLogger.isEnabled()) {
38
+ renderStartTimeRef.current = performance.now();
39
+ highlightCountRef.current = highlights.length;
40
+ }
41
+
42
+ // Measure render completion time using useLayoutEffect (runs after DOM mutations)
43
+ useLayoutEffect(() => {
44
+ if (PerformanceLogger.isEnabled() && renderStartTimeRef.current > 0 && highlightCountRef.current > 0) {
45
+ const renderTime = performance.now() - renderStartTimeRef.current;
46
+ // Mark end-to-end timing (for benchmark recording only - no console logs)
47
+ markOverlayRendered(highlightCountRef.current, renderTime);
48
+ }
49
+ });
50
+
51
+ // Subscribe to freeze state changes
52
+ useEffect(() => {
53
+ const unsubscribe = HighlightUpdatesController.subscribeToFreeze(frozen => {
54
+ setIsFrozen(frozen);
55
+ });
56
+ return unsubscribe;
57
+ }, []);
58
+
59
+ // Subscribe to filter changes - refresh frozen highlights when filters change
60
+ useEffect(() => {
61
+ const unsubscribe = RenderTracker.subscribeToFilters(() => {
62
+ // When filters change, filter out highlights that no longer match
63
+ setHighlights(prev => {
64
+ return prev.filter(highlight => {
65
+ // Look up the render by nativeTag
66
+ const render = RenderTracker.getRender(String(highlight.id));
67
+ if (!render) {
68
+ // If render not found, keep the highlight (it might be from a different source)
69
+ return true;
70
+ }
71
+ // Check if the render should still be shown based on new filters
72
+ return RenderTracker.shouldShowRender(render);
73
+ });
74
+ });
75
+ });
76
+ return unsubscribe;
77
+ }, []);
78
+
79
+ // Subscribe to spotlight changes - show which component is being viewed in detail
80
+ useEffect(() => {
81
+ HighlightUpdatesController.setSpotlightCallback(tag => {
82
+ setSpotlightTag(tag);
83
+ });
84
+ return () => {
85
+ HighlightUpdatesController.setSpotlightCallback(null);
86
+ };
87
+ }, []);
88
+
89
+ // Callback to add new highlights
90
+ const addHighlights = useCallback(newRects => {
91
+ const now = Date.now();
92
+ const timestampedRects = newRects.map(rect => ({
93
+ ...rect,
94
+ timestamp: now
95
+ }));
96
+ setHighlights(prev => {
97
+ // Merge new highlights, replacing any with same id
98
+ const updated = [...prev];
99
+ for (const newRect of timestampedRects) {
100
+ const existingIndex = updated.findIndex(r => r.id === newRect.id);
101
+ if (existingIndex >= 0) {
102
+ updated[existingIndex] = newRect;
103
+ } else {
104
+ updated.push(newRect);
105
+ }
106
+ }
107
+ return updated;
108
+ });
109
+ }, []);
110
+
111
+ // Register the callback with the controller
112
+ useEffect(() => {
113
+ HighlightUpdatesController.setHighlightCallback(addHighlights);
114
+
115
+ // Cleanup timer to remove old highlights
116
+ // When frozen, skip cleanup to keep highlights visible indefinitely
117
+ cleanupTimerRef.current = setInterval(() => {
118
+ // Check frozen state via ref (doesn't cause re-subscription)
119
+ if (frozenRef.current) {
120
+ return; // Skip cleanup when frozen
121
+ }
122
+ const now = Date.now();
123
+ setHighlights(prev => prev.filter(rect => now - rect.timestamp < HIGHLIGHT_DURATION));
124
+ }, 50);
125
+ return () => {
126
+ HighlightUpdatesController.setHighlightCallback(null);
127
+ if (cleanupTimerRef.current) {
128
+ clearInterval(cleanupTimerRef.current);
129
+ }
130
+ };
131
+ }, [addHighlights]);
132
+
133
+ // Check if badge press handling is enabled (via props or controller)
134
+ const hasBadgePressHandler = onBadgePress || HighlightUpdatesController.getBadgePressCallback();
135
+
136
+ // Handle badge press - navigate to detail view for this component
137
+ const handleBadgePress = useCallback(nativeTag => {
138
+ // First try the prop callback
139
+ if (onBadgePress) {
140
+ onBadgePress(nativeTag);
141
+ } else {
142
+ // Fall back to controller callback
143
+ HighlightUpdatesController.handleBadgePress(nativeTag);
144
+ }
145
+ }, [onBadgePress]);
146
+
147
+ // Get spotlight render info if we have a spotlight active
148
+ const spotlightRender = spotlightTag ? RenderTracker.getRender(String(spotlightTag)) : null;
149
+
150
+ // Render nothing if no highlights and no spotlight
151
+ if (highlights.length === 0 && !spotlightRender?.measurements) {
152
+ return null;
153
+ }
154
+ return /*#__PURE__*/_jsxs(View, {
155
+ style: styles.overlay,
156
+ pointerEvents: "box-none",
157
+ nativeID: "highlight-updates-overlay",
158
+ children: [spotlightRender?.measurements && /*#__PURE__*/_jsxs(_Fragment, {
159
+ children: [/*#__PURE__*/_jsx(View, {
160
+ pointerEvents: "none",
161
+ nativeID: "__spotlight_highlight__",
162
+ style: [styles.spotlightHighlight, {
163
+ // Offset by border width so border renders outside the component bounds
164
+ left: spotlightRender.measurements.x - 3,
165
+ top: spotlightRender.measurements.y - 3,
166
+ width: spotlightRender.measurements.width + 6,
167
+ height: spotlightRender.measurements.height + 6
168
+ }]
169
+ }), /*#__PURE__*/_jsx(View, {
170
+ pointerEvents: "none",
171
+ style: [styles.spotlightLabel, {
172
+ left: spotlightRender.measurements.x,
173
+ top: spotlightRender.measurements.y + spotlightRender.measurements.height + 4
174
+ }],
175
+ children: /*#__PURE__*/_jsx(Text, {
176
+ style: styles.spotlightLabelText,
177
+ children: spotlightRender.componentName || spotlightRender.displayName || spotlightRender.viewType
178
+ })
179
+ })]
180
+ }), highlights.map(rect => /*#__PURE__*/_jsx(View, {
181
+ pointerEvents: "box-none",
182
+ nativeID: `__highlight_rect_${rect.id}__`,
183
+ style: [styles.highlight, {
184
+ left: rect.x,
185
+ top: rect.y,
186
+ width: rect.width,
187
+ height: rect.height,
188
+ borderColor: rect.color
189
+ }],
190
+ children: rect.count > 0 && (hasBadgePressHandler ? /*#__PURE__*/_jsx(TouchableOpacity, {
191
+ onPress: () => handleBadgePress(rect.id),
192
+ style: [styles.badge, {
193
+ backgroundColor: rect.color
194
+ }],
195
+ activeOpacity: 0.7,
196
+ hitSlop: {
197
+ top: 8,
198
+ bottom: 8,
199
+ left: 8,
200
+ right: 8
201
+ },
202
+ children: /*#__PURE__*/_jsx(Text, {
203
+ style: styles.badgeText,
204
+ nativeID: `__highlight_text_${rect.id}__`,
205
+ children: rect.count
206
+ })
207
+ }) : /*#__PURE__*/_jsx(View, {
208
+ style: [styles.badge, {
209
+ backgroundColor: rect.color
210
+ }],
211
+ nativeID: `__highlight_badge_${rect.id}__`,
212
+ pointerEvents: "none",
213
+ children: /*#__PURE__*/_jsx(Text, {
214
+ style: styles.badgeText,
215
+ nativeID: `__highlight_text_${rect.id}__`,
216
+ children: rect.count
217
+ })
218
+ }))
219
+ }, `highlight-${rect.id}`))]
220
+ });
221
+ }
222
+ const styles = StyleSheet.create({
223
+ overlay: {
224
+ position: "absolute",
225
+ top: 0,
226
+ left: 0,
227
+ right: 0,
228
+ bottom: 0,
229
+ zIndex: 999999,
230
+ elevation: 999999,
231
+ borderWidth: 0
232
+ },
233
+ highlight: {
234
+ position: "absolute",
235
+ borderWidth: 2,
236
+ borderStyle: "solid",
237
+ backgroundColor: "transparent"
238
+ },
239
+ badge: {
240
+ position: "absolute",
241
+ top: 0,
242
+ right: 0,
243
+ height: 14,
244
+ borderRadius: 0,
245
+ justifyContent: "center",
246
+ alignItems: "center",
247
+ paddingHorizontal: 2
248
+ },
249
+ badgeText: {
250
+ color: "#000",
251
+ fontSize: 9,
252
+ fontWeight: "bold"
253
+ },
254
+ // Spotlight highlight styles
255
+ spotlightHighlight: {
256
+ position: "absolute",
257
+ borderWidth: 2,
258
+ borderStyle: "dashed",
259
+ borderColor: buoyColors.primary,
260
+ backgroundColor: "transparent"
261
+ },
262
+ spotlightLabel: {
263
+ position: "absolute",
264
+ backgroundColor: buoyColors.card,
265
+ borderWidth: 1,
266
+ borderColor: buoyColors.primary,
267
+ paddingHorizontal: 8,
268
+ paddingVertical: 3,
269
+ borderRadius: 4
270
+ },
271
+ spotlightLabelText: {
272
+ color: buoyColors.primary,
273
+ fontSize: 11,
274
+ fontWeight: "600",
275
+ fontFamily: "monospace"
276
+ }
277
+ });
278
+ export default HighlightUpdatesOverlay;