@buoy-gg/image-overlay 7.0.41 → 7.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -76
- package/lib/commonjs/imageOverlay/components/ImageOverlayModal.js +1 -880
- package/lib/commonjs/imageOverlay/components/ImageOverlayStandalone.js +1 -463
- package/lib/commonjs/imageOverlay/components/OverlayControls.js +1 -253
- package/lib/commonjs/imageOverlay/components/TargetList.js +1 -181
- package/lib/commonjs/imageOverlay/types/index.js +1 -1
- package/lib/commonjs/imageOverlay/utils/ImageOverlayController.js +1 -426
- package/lib/commonjs/imageOverlay/utils/componentMeasurement.js +1 -106
- package/lib/commonjs/imageOverlay/utils/devtoolsHook.js +1 -36
- package/lib/commonjs/imageOverlay/utils/fiberScanner.js +1 -104
- package/lib/commonjs/imageOverlay/utils/imageClipboard.js +1 -22
- package/lib/commonjs/imageOverlay/utils/imageClipboard.web.js +1 -44
- package/lib/commonjs/index.js +1 -59
- package/lib/commonjs/preset.js +1 -42
- package/lib/module/imageOverlay/components/ImageOverlayModal.js +1 -875
- package/lib/module/imageOverlay/components/ImageOverlayStandalone.js +1 -459
- package/lib/module/imageOverlay/components/OverlayControls.js +1 -249
- package/lib/module/imageOverlay/components/TargetList.js +1 -177
- package/lib/module/imageOverlay/types/index.js +1 -1
- package/lib/module/imageOverlay/utils/ImageOverlayController.js +1 -422
- package/lib/module/imageOverlay/utils/componentMeasurement.js +1 -102
- package/lib/module/imageOverlay/utils/devtoolsHook.js +1 -31
- package/lib/module/imageOverlay/utils/fiberScanner.js +1 -100
- package/lib/module/imageOverlay/utils/imageClipboard.js +1 -17
- package/lib/module/imageOverlay/utils/imageClipboard.web.js +1 -39
- package/lib/module/index.js +1 -35
- package/lib/module/preset.js +1 -38
- package/lib/web/index.mjs +4 -5
- package/package.json +2 -2
- package/lib/typescript/imageOverlay/components/ImageOverlayModal.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/components/ImageOverlayStandalone.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/components/OverlayControls.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/components/TargetList.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/types/index.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/utils/ImageOverlayController.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/utils/componentMeasurement.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/utils/devtoolsHook.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/utils/fiberScanner.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/utils/imageClipboard.d.ts.map +0 -1
- package/lib/typescript/imageOverlay/utils/imageClipboard.web.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
|
@@ -1,249 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Controls for adjusting the overlay: opacity, scale, offset.
|
|
5
|
-
* Each control has a slider track plus -/+ stepper buttons.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { useRef, useCallback } from "react";
|
|
9
|
-
import { View, Text, TouchableOpacity, StyleSheet, PanResponder } from "react-native";
|
|
10
|
-
import { night, monoFont } from "@buoy-gg/shared-ui";
|
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
function SliderStepper({
|
|
13
|
-
label,
|
|
14
|
-
value,
|
|
15
|
-
min,
|
|
16
|
-
max,
|
|
17
|
-
step,
|
|
18
|
-
displayValue,
|
|
19
|
-
onChange
|
|
20
|
-
}) {
|
|
21
|
-
const trackWidth = useRef(0);
|
|
22
|
-
const trackX = useRef(0);
|
|
23
|
-
const clamp = useCallback(v => Math.max(min, Math.min(max, v)), [min, max]);
|
|
24
|
-
const fraction = max > min ? (value - min) / (max - min) : 0;
|
|
25
|
-
|
|
26
|
-
// Keep current values in refs so PanResponder always uses latest props
|
|
27
|
-
const onChangeRef = useRef(onChange);
|
|
28
|
-
const clampRef = useRef(clamp);
|
|
29
|
-
const minRef = useRef(min);
|
|
30
|
-
const maxRef = useRef(max);
|
|
31
|
-
onChangeRef.current = onChange;
|
|
32
|
-
clampRef.current = clamp;
|
|
33
|
-
minRef.current = min;
|
|
34
|
-
maxRef.current = max;
|
|
35
|
-
const handleSliderEvent = useCallback(pageX => {
|
|
36
|
-
const x = pageX - trackX.current;
|
|
37
|
-
const frac = Math.max(0, Math.min(1, x / trackWidth.current));
|
|
38
|
-
const val = minRef.current + frac * (maxRef.current - minRef.current);
|
|
39
|
-
onChangeRef.current(clampRef.current(val));
|
|
40
|
-
}, []);
|
|
41
|
-
const panResponder = useRef(PanResponder.create({
|
|
42
|
-
onStartShouldSetPanResponder: () => true,
|
|
43
|
-
onMoveShouldSetPanResponder: () => true,
|
|
44
|
-
onPanResponderTerminationRequest: () => false,
|
|
45
|
-
onPanResponderGrant: evt => {
|
|
46
|
-
handleSliderEvent(evt.nativeEvent.pageX);
|
|
47
|
-
},
|
|
48
|
-
onPanResponderMove: evt => {
|
|
49
|
-
handleSliderEvent(evt.nativeEvent.pageX);
|
|
50
|
-
}
|
|
51
|
-
})).current;
|
|
52
|
-
const onTrackLayout = useCallback(e => {
|
|
53
|
-
trackWidth.current = e.nativeEvent.layout.width;
|
|
54
|
-
// We need pageX, measure the track view
|
|
55
|
-
}, []);
|
|
56
|
-
const trackRef = useRef(null);
|
|
57
|
-
const measureTrack = useCallback(() => {
|
|
58
|
-
trackRef.current?.measure?.((_x, _y, _w, _h, pageX) => {
|
|
59
|
-
trackX.current = pageX;
|
|
60
|
-
});
|
|
61
|
-
}, []);
|
|
62
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
63
|
-
style: styles.controlRow,
|
|
64
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
65
|
-
style: styles.label,
|
|
66
|
-
children: label
|
|
67
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
68
|
-
style: styles.controlRight,
|
|
69
|
-
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
70
|
-
style: styles.stepperButton,
|
|
71
|
-
onPress: () => onChange(clamp(value - step)),
|
|
72
|
-
activeOpacity: 0.6,
|
|
73
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
74
|
-
style: styles.stepperButtonText,
|
|
75
|
-
children: "-"
|
|
76
|
-
})
|
|
77
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
78
|
-
style: styles.sliderHitArea,
|
|
79
|
-
...panResponder.panHandlers,
|
|
80
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
81
|
-
ref: trackRef,
|
|
82
|
-
style: styles.sliderTrack,
|
|
83
|
-
onLayout: e => {
|
|
84
|
-
onTrackLayout(e);
|
|
85
|
-
measureTrack();
|
|
86
|
-
},
|
|
87
|
-
pointerEvents: "none",
|
|
88
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
89
|
-
style: [styles.sliderFill, {
|
|
90
|
-
width: `${fraction * 100}%`
|
|
91
|
-
}]
|
|
92
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
93
|
-
style: [styles.sliderThumb, {
|
|
94
|
-
left: `${fraction * 100}%`
|
|
95
|
-
}]
|
|
96
|
-
})]
|
|
97
|
-
})
|
|
98
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
99
|
-
style: styles.stepperButton,
|
|
100
|
-
onPress: () => onChange(clamp(value + step)),
|
|
101
|
-
activeOpacity: 0.6,
|
|
102
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
103
|
-
style: styles.stepperButtonText,
|
|
104
|
-
children: "+"
|
|
105
|
-
})
|
|
106
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
107
|
-
style: styles.valueText,
|
|
108
|
-
children: displayValue
|
|
109
|
-
})]
|
|
110
|
-
})]
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
export function OverlayControls({
|
|
114
|
-
opacity,
|
|
115
|
-
scale,
|
|
116
|
-
offsetX,
|
|
117
|
-
offsetY,
|
|
118
|
-
onOpacityChange,
|
|
119
|
-
onScaleChange,
|
|
120
|
-
onOffsetChange,
|
|
121
|
-
opacityOnly
|
|
122
|
-
}) {
|
|
123
|
-
if (opacityOnly) {
|
|
124
|
-
return /*#__PURE__*/_jsx(SliderStepper, {
|
|
125
|
-
label: "Opacity",
|
|
126
|
-
value: opacity,
|
|
127
|
-
min: 0,
|
|
128
|
-
max: 1,
|
|
129
|
-
step: 0.05,
|
|
130
|
-
displayValue: `${Math.round(opacity * 100)}%`,
|
|
131
|
-
onChange: onOpacityChange
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
135
|
-
style: styles.container,
|
|
136
|
-
children: [/*#__PURE__*/_jsx(SliderStepper, {
|
|
137
|
-
label: "Opacity",
|
|
138
|
-
value: opacity,
|
|
139
|
-
min: 0,
|
|
140
|
-
max: 1,
|
|
141
|
-
step: 0.05,
|
|
142
|
-
displayValue: `${Math.round(opacity * 100)}%`,
|
|
143
|
-
onChange: onOpacityChange
|
|
144
|
-
}), /*#__PURE__*/_jsx(SliderStepper, {
|
|
145
|
-
label: "Scale",
|
|
146
|
-
value: scale,
|
|
147
|
-
min: 0.05,
|
|
148
|
-
max: 3,
|
|
149
|
-
step: 0.05,
|
|
150
|
-
displayValue: `${Math.round(scale * 100)}%`,
|
|
151
|
-
onChange: onScaleChange
|
|
152
|
-
}), /*#__PURE__*/_jsx(SliderStepper, {
|
|
153
|
-
label: "Offset X",
|
|
154
|
-
value: offsetX,
|
|
155
|
-
min: -200,
|
|
156
|
-
max: 200,
|
|
157
|
-
step: 2,
|
|
158
|
-
displayValue: `${Math.round(offsetX)}px`,
|
|
159
|
-
onChange: v => onOffsetChange(Math.round(v), offsetY)
|
|
160
|
-
}), /*#__PURE__*/_jsx(SliderStepper, {
|
|
161
|
-
label: "Offset Y",
|
|
162
|
-
value: offsetY,
|
|
163
|
-
min: -200,
|
|
164
|
-
max: 200,
|
|
165
|
-
step: 2,
|
|
166
|
-
displayValue: `${Math.round(offsetY)}px`,
|
|
167
|
-
onChange: v => onOffsetChange(offsetX, Math.round(v))
|
|
168
|
-
})]
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
const THUMB_SIZE = 18;
|
|
172
|
-
const styles = StyleSheet.create({
|
|
173
|
-
container: {
|
|
174
|
-
gap: 8
|
|
175
|
-
},
|
|
176
|
-
controlRow: {
|
|
177
|
-
paddingHorizontal: 12,
|
|
178
|
-
gap: 4
|
|
179
|
-
},
|
|
180
|
-
label: {
|
|
181
|
-
fontSize: 11,
|
|
182
|
-
fontWeight: "600",
|
|
183
|
-
color: night.color.textTertiary,
|
|
184
|
-
textTransform: "uppercase",
|
|
185
|
-
letterSpacing: 0.5
|
|
186
|
-
},
|
|
187
|
-
controlRight: {
|
|
188
|
-
flexDirection: "row",
|
|
189
|
-
alignItems: "center",
|
|
190
|
-
gap: 6
|
|
191
|
-
},
|
|
192
|
-
stepperButton: {
|
|
193
|
-
width: 28,
|
|
194
|
-
height: 28,
|
|
195
|
-
borderRadius: 6,
|
|
196
|
-
backgroundColor: night.color.surfaceElevated,
|
|
197
|
-
borderWidth: 1,
|
|
198
|
-
borderColor: night.color.border,
|
|
199
|
-
justifyContent: "center",
|
|
200
|
-
alignItems: "center"
|
|
201
|
-
},
|
|
202
|
-
stepperButtonText: {
|
|
203
|
-
fontSize: 16,
|
|
204
|
-
fontWeight: "700",
|
|
205
|
-
color: night.color.text,
|
|
206
|
-
lineHeight: 18
|
|
207
|
-
},
|
|
208
|
-
sliderHitArea: {
|
|
209
|
-
flex: 1,
|
|
210
|
-
paddingVertical: 20,
|
|
211
|
-
paddingHorizontal: 40,
|
|
212
|
-
marginVertical: -20,
|
|
213
|
-
marginHorizontal: -40
|
|
214
|
-
},
|
|
215
|
-
sliderTrack: {
|
|
216
|
-
height: 28,
|
|
217
|
-
justifyContent: "center",
|
|
218
|
-
borderRadius: 6,
|
|
219
|
-
backgroundColor: night.color.bg,
|
|
220
|
-
borderWidth: 1,
|
|
221
|
-
borderColor: night.color.border,
|
|
222
|
-
overflow: "hidden"
|
|
223
|
-
},
|
|
224
|
-
sliderFill: {
|
|
225
|
-
position: "absolute",
|
|
226
|
-
left: 0,
|
|
227
|
-
top: 0,
|
|
228
|
-
bottom: 0,
|
|
229
|
-
backgroundColor: night.color.accentFill,
|
|
230
|
-
borderRadius: 5
|
|
231
|
-
},
|
|
232
|
-
sliderThumb: {
|
|
233
|
-
position: "absolute",
|
|
234
|
-
width: 4,
|
|
235
|
-
top: 4,
|
|
236
|
-
bottom: 4,
|
|
237
|
-
marginLeft: -2,
|
|
238
|
-
borderRadius: 2,
|
|
239
|
-
backgroundColor: night.color.accent
|
|
240
|
-
},
|
|
241
|
-
valueText: {
|
|
242
|
-
fontSize: 11,
|
|
243
|
-
fontWeight: "600",
|
|
244
|
-
color: night.color.text,
|
|
245
|
-
width: 45,
|
|
246
|
-
textAlign: "right",
|
|
247
|
-
fontFamily: monoFont
|
|
248
|
-
}
|
|
249
|
-
});
|
|
1
|
+
"use strict";import{useRef as a,useCallback as m}from"react";import{View as c,Text as y,TouchableOpacity as V,StyleSheet as j,PanResponder as z}from"react-native";import{night as l,monoFont as O}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as f}from"react/jsx-runtime";function h({label:s,value:d,min:o,max:n,step:p,displayValue:x,onChange:i}){const g=a(0);const u=a(0);const b=m(r=>Math.max(o,Math.min(n,r)),[o,n]);const v=n>o?(d-o)/(n-o):0;const T=a(i);const S=a(b);const R=a(o);const M=a(n);T.current=i;S.current=b;R.current=o;M.current=n;const k=m(r=>{const C=r-u.current;const H=Math.max(0,Math.min(1,C/g.current));const P=R.current+H*(M.current-R.current);T.current(S.current(P))},[]);const B=a(z.create({onStartShouldSetPanResponder:()=>true,onMoveShouldSetPanResponder:()=>true,onPanResponderTerminationRequest:()=>false,onPanResponderGrant:r=>{k(r.nativeEvent.pageX)},onPanResponderMove:r=>{k(r.nativeEvent.pageX)}})).current;const E=m(r=>{g.current=r.nativeEvent.layout.width},[]);const w=a(null);const _=m(()=>{w.current?.measure?.((r,C,H,P,$)=>{u.current=$})},[]);return f(c,{style:t.controlRow,children:[e(y,{style:t.label,children:s}),f(c,{style:t.controlRight,children:[e(V,{style:t.stepperButton,onPress:()=>i(b(d-p)),activeOpacity:.6,children:e(y,{style:t.stepperButtonText,children:"-"})}),e(c,{style:t.sliderHitArea,...B.panHandlers,children:f(c,{ref:w,style:t.sliderTrack,onLayout:r=>{E(r);_()},pointerEvents:"none",children:[e(c,{style:[t.sliderFill,{width:`${v*100}%`}]}),e(c,{style:[t.sliderThumb,{left:`${v*100}%`}]})]})}),e(V,{style:t.stepperButton,onPress:()=>i(b(d+p)),activeOpacity:.6,children:e(y,{style:t.stepperButtonText,children:"+"})}),e(y,{style:t.valueText,children:x})]})]})}export function OverlayControls({opacity:s,scale:d,offsetX:o,offsetY:n,onOpacityChange:p,onScaleChange:x,onOffsetChange:i,opacityOnly:g}){if(g){return e(h,{label:"Opacity",value:s,min:0,max:1,step:.05,displayValue:`${Math.round(s*100)}%`,onChange:p})}return f(c,{style:t.container,children:[e(h,{label:"Opacity",value:s,min:0,max:1,step:.05,displayValue:`${Math.round(s*100)}%`,onChange:p}),e(h,{label:"Scale",value:d,min:.05,max:3,step:.05,displayValue:`${Math.round(d*100)}%`,onChange:x}),e(h,{label:"Offset X",value:o,min:-200,max:200,step:2,displayValue:`${Math.round(o)}px`,onChange:u=>i(Math.round(u),n)}),e(h,{label:"Offset Y",value:n,min:-200,max:200,step:2,displayValue:`${Math.round(n)}px`,onChange:u=>i(o,Math.round(u))})]})}const L=18;const t=j.create({container:{gap:8},controlRow:{paddingHorizontal:12,gap:4},label:{fontSize:11,fontWeight:"600",color:l.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},controlRight:{flexDirection:"row",alignItems:"center",gap:6},stepperButton:{width:28,height:28,borderRadius:6,backgroundColor:l.color.surfaceElevated,borderWidth:1,borderColor:l.color.border,justifyContent:"center",alignItems:"center"},stepperButtonText:{fontSize:16,fontWeight:"700",color:l.color.text,lineHeight:18},sliderHitArea:{flex:1,paddingVertical:20,paddingHorizontal:40,marginVertical:-20,marginHorizontal:-40},sliderTrack:{height:28,justifyContent:"center",borderRadius:6,backgroundColor:l.color.bg,borderWidth:1,borderColor:l.color.border,overflow:"hidden"},sliderFill:{position:"absolute",left:0,top:0,bottom:0,backgroundColor:l.color.accentFill,borderRadius:5},sliderThumb:{position:"absolute",width:4,top:4,bottom:4,marginLeft:-2,borderRadius:2,backgroundColor:l.color.accent},valueText:{fontSize:11,fontWeight:"600",color:l.color.text,width:45,textAlign:"right",fontFamily:O}});
|
|
@@ -1,177 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* List of discovered image-overlay target components.
|
|
5
|
-
* Styled to match RenderListItem from highlight-updates.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { View, Text, TouchableOpacity, StyleSheet, ScrollView } from "react-native";
|
|
9
|
-
import { ChevronRight, night, Hash, ToolEmptyState, monoFont } from "@buoy-gg/shared-ui";
|
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
function TargetRow({
|
|
12
|
-
target,
|
|
13
|
-
onSelect
|
|
14
|
-
}) {
|
|
15
|
-
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
16
|
-
style: styles.card,
|
|
17
|
-
onPress: onSelect,
|
|
18
|
-
activeOpacity: 0.7,
|
|
19
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
20
|
-
style: styles.colorIndicator
|
|
21
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
22
|
-
style: styles.content,
|
|
23
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
24
|
-
style: styles.topRow,
|
|
25
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
26
|
-
style: styles.label,
|
|
27
|
-
numberOfLines: 1,
|
|
28
|
-
children: target.label
|
|
29
|
-
})
|
|
30
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
31
|
-
style: styles.bottomRow,
|
|
32
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
33
|
-
style: styles.badgeRow,
|
|
34
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
35
|
-
style: styles.testIdBadge,
|
|
36
|
-
children: [/*#__PURE__*/_jsx(Hash, {
|
|
37
|
-
size: 8,
|
|
38
|
-
color: night.color.accent
|
|
39
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
40
|
-
style: styles.testIdBadgeText,
|
|
41
|
-
children: "testID"
|
|
42
|
-
})]
|
|
43
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
44
|
-
style: styles.testIdValue,
|
|
45
|
-
numberOfLines: 1,
|
|
46
|
-
children: target.testID
|
|
47
|
-
})]
|
|
48
|
-
}), target.componentName && /*#__PURE__*/_jsx(Text, {
|
|
49
|
-
style: styles.componentName,
|
|
50
|
-
numberOfLines: 1,
|
|
51
|
-
children: target.componentName
|
|
52
|
-
})]
|
|
53
|
-
})]
|
|
54
|
-
}), /*#__PURE__*/_jsx(ChevronRight, {
|
|
55
|
-
size: 16,
|
|
56
|
-
color: night.color.textTertiary
|
|
57
|
-
})]
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
export function TargetList({
|
|
61
|
-
targets,
|
|
62
|
-
onSelect
|
|
63
|
-
}) {
|
|
64
|
-
if (targets.length === 0) {
|
|
65
|
-
return /*#__PURE__*/_jsx(ToolEmptyState, {
|
|
66
|
-
testID: "buoy-image-overlay-empty"
|
|
67
|
-
// scanning = the screen was walked and nothing was tagged.
|
|
68
|
-
,
|
|
69
|
-
otto: "scanning",
|
|
70
|
-
title: "No targets found",
|
|
71
|
-
message: 'Tag components with\ntestID="image-target:YourLabel"'
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return /*#__PURE__*/_jsx(ScrollView, {
|
|
75
|
-
style: styles.list,
|
|
76
|
-
contentContainerStyle: styles.listContent,
|
|
77
|
-
children: targets.map(target => /*#__PURE__*/_jsx(TargetRow, {
|
|
78
|
-
target: target,
|
|
79
|
-
onSelect: () => onSelect(target)
|
|
80
|
-
}, target.testID))
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
const styles = StyleSheet.create({
|
|
84
|
-
list: {
|
|
85
|
-
flex: 1
|
|
86
|
-
},
|
|
87
|
-
listContent: {
|
|
88
|
-
paddingTop: 8,
|
|
89
|
-
paddingBottom: 20
|
|
90
|
-
},
|
|
91
|
-
card: {
|
|
92
|
-
flexDirection: "row",
|
|
93
|
-
alignItems: "center",
|
|
94
|
-
paddingVertical: 10,
|
|
95
|
-
paddingHorizontal: 12,
|
|
96
|
-
marginHorizontal: 12,
|
|
97
|
-
marginBottom: 6,
|
|
98
|
-
backgroundColor: night.color.surface,
|
|
99
|
-
borderRadius: 8,
|
|
100
|
-
borderWidth: 1,
|
|
101
|
-
borderColor: night.color.border
|
|
102
|
-
},
|
|
103
|
-
colorIndicator: {
|
|
104
|
-
width: 4,
|
|
105
|
-
height: 36,
|
|
106
|
-
borderRadius: 2,
|
|
107
|
-
marginRight: 10,
|
|
108
|
-
backgroundColor: night.color.accent
|
|
109
|
-
},
|
|
110
|
-
content: {
|
|
111
|
-
flex: 1,
|
|
112
|
-
marginRight: 8
|
|
113
|
-
},
|
|
114
|
-
topRow: {
|
|
115
|
-
flexDirection: "row",
|
|
116
|
-
alignItems: "center",
|
|
117
|
-
marginBottom: 4
|
|
118
|
-
},
|
|
119
|
-
label: {
|
|
120
|
-
fontSize: 13,
|
|
121
|
-
fontWeight: "600",
|
|
122
|
-
color: night.color.text,
|
|
123
|
-
flex: 1
|
|
124
|
-
},
|
|
125
|
-
bottomRow: {
|
|
126
|
-
gap: 2
|
|
127
|
-
},
|
|
128
|
-
badgeRow: {
|
|
129
|
-
flexDirection: "row",
|
|
130
|
-
alignItems: "center",
|
|
131
|
-
gap: 4
|
|
132
|
-
},
|
|
133
|
-
testIdBadge: {
|
|
134
|
-
flexDirection: "row",
|
|
135
|
-
alignItems: "center",
|
|
136
|
-
paddingVertical: 2,
|
|
137
|
-
paddingHorizontal: 5,
|
|
138
|
-
borderRadius: 4,
|
|
139
|
-
backgroundColor: night.color.accentSoft,
|
|
140
|
-
gap: 3
|
|
141
|
-
},
|
|
142
|
-
testIdBadgeText: {
|
|
143
|
-
fontSize: 9,
|
|
144
|
-
fontWeight: "700",
|
|
145
|
-
color: night.color.accent
|
|
146
|
-
},
|
|
147
|
-
testIdValue: {
|
|
148
|
-
fontSize: 11,
|
|
149
|
-
color: night.color.text,
|
|
150
|
-
fontFamily: monoFont,
|
|
151
|
-
flex: 1
|
|
152
|
-
},
|
|
153
|
-
componentName: {
|
|
154
|
-
fontSize: 10,
|
|
155
|
-
color: "#a855f7",
|
|
156
|
-
fontFamily: monoFont,
|
|
157
|
-
marginTop: 1
|
|
158
|
-
},
|
|
159
|
-
emptyState: {
|
|
160
|
-
alignItems: "center",
|
|
161
|
-
paddingVertical: 40,
|
|
162
|
-
paddingHorizontal: 32
|
|
163
|
-
},
|
|
164
|
-
emptyTitle: {
|
|
165
|
-
color: night.color.text,
|
|
166
|
-
fontSize: 14,
|
|
167
|
-
fontWeight: "600",
|
|
168
|
-
marginBottom: 6
|
|
169
|
-
},
|
|
170
|
-
emptyText: {
|
|
171
|
-
color: night.color.textTertiary,
|
|
172
|
-
fontSize: 12,
|
|
173
|
-
textAlign: "center",
|
|
174
|
-
lineHeight: 18,
|
|
175
|
-
fontFamily: monoFont
|
|
176
|
-
}
|
|
177
|
-
});
|
|
1
|
+
"use strict";import{View as r,Text as l,TouchableOpacity as d,StyleSheet as m,ScrollView as g}from"react-native";import{ChevronRight as f,night as e,Hash as p,ToolEmptyState as h,monoFont as s}from"@buoy-gg/shared-ui";import{jsx as o,jsxs as i}from"react/jsx-runtime";function y({target:n,onSelect:a}){return i(d,{style:t.card,onPress:a,activeOpacity:.7,children:[o(r,{style:t.colorIndicator}),i(r,{style:t.content,children:[o(r,{style:t.topRow,children:o(l,{style:t.label,numberOfLines:1,children:n.label})}),i(r,{style:t.bottomRow,children:[i(r,{style:t.badgeRow,children:[i(r,{style:t.testIdBadge,children:[o(p,{size:8,color:e.color.accent}),o(l,{style:t.testIdBadgeText,children:"testID"})]}),o(l,{style:t.testIdValue,numberOfLines:1,children:n.testID})]}),n.componentName&&o(l,{style:t.componentName,numberOfLines:1,children:n.componentName})]})]}),o(f,{size:16,color:e.color.textTertiary})]})}export function TargetList({targets:n,onSelect:a}){if(n.length===0){return o(h,{testID:"buoy-image-overlay-empty",otto:"scanning",title:"No targets found",message:'Tag components with\ntestID="image-target:YourLabel"'})}return o(g,{style:t.list,contentContainerStyle:t.listContent,children:n.map(c=>o(y,{target:c,onSelect:()=>a(c)},c.testID))})}const t=m.create({list:{flex:1},listContent:{paddingTop:8,paddingBottom:20},card:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,marginHorizontal:12,marginBottom:6,backgroundColor:e.color.surface,borderRadius:8,borderWidth:1,borderColor:e.color.border},colorIndicator:{width:4,height:36,borderRadius:2,marginRight:10,backgroundColor:e.color.accent},content:{flex:1,marginRight:8},topRow:{flexDirection:"row",alignItems:"center",marginBottom:4},label:{fontSize:13,fontWeight:"600",color:e.color.text,flex:1},bottomRow:{gap:2},badgeRow:{flexDirection:"row",alignItems:"center",gap:4},testIdBadge:{flexDirection:"row",alignItems:"center",paddingVertical:2,paddingHorizontal:5,borderRadius:4,backgroundColor:e.color.accentSoft,gap:3},testIdBadgeText:{fontSize:9,fontWeight:"700",color:e.color.accent},testIdValue:{fontSize:11,color:e.color.text,fontFamily:s,flex:1},componentName:{fontSize:10,color:"#a855f7",fontFamily:s,marginTop:1},emptyState:{alignItems:"center",paddingVertical:40,paddingHorizontal:32},emptyTitle:{color:e.color.text,fontSize:14,fontWeight:"600",marginBottom:6},emptyText:{color:e.color.textTertiary,fontSize:12,textAlign:"center",lineHeight:18,fontFamily:s}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|