@buoy-gg/image-overlay 7.0.32 → 7.0.34
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/imageOverlay/components/ImageOverlayModal.js +13 -39
- package/lib/commonjs/imageOverlay/components/TargetList.js +7 -9
- package/lib/commonjs/preset.js +6 -23
- package/lib/module/imageOverlay/components/ImageOverlayModal.js +15 -41
- package/lib/module/imageOverlay/components/TargetList.js +8 -10
- package/lib/module/preset.js +6 -21
- package/lib/typescript/imageOverlay/components/ImageOverlayModal.d.ts.map +1 -1
- package/lib/typescript/imageOverlay/components/TargetList.d.ts.map +1 -1
- package/lib/typescript/preset.d.ts +3 -5
- package/lib/typescript/preset.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -337,32 +337,14 @@ function ImageOverlayModal({
|
|
|
337
337
|
})]
|
|
338
338
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
339
339
|
style: styles.toggleSection,
|
|
340
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
trackColor: {
|
|
349
|
-
false: _sharedUi.night.color.surfaceElevated,
|
|
350
|
-
true: _sharedUi.night.color.accent
|
|
351
|
-
}
|
|
352
|
-
})]
|
|
353
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
354
|
-
style: styles.toggleRow,
|
|
355
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
356
|
-
style: styles.toggleLabel,
|
|
357
|
-
children: "Auto Track"
|
|
358
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Switch, {
|
|
359
|
-
value: autoTrack,
|
|
360
|
-
onValueChange: setAutoTrack,
|
|
361
|
-
trackColor: {
|
|
362
|
-
false: _sharedUi.night.color.surfaceElevated,
|
|
363
|
-
true: _sharedUi.night.color.accent
|
|
364
|
-
}
|
|
365
|
-
})]
|
|
340
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToggleRow, {
|
|
341
|
+
label: "Show Outline",
|
|
342
|
+
value: state.showOutline,
|
|
343
|
+
onValueChange: v => _ImageOverlayController.ImageOverlayController.setShowOutline(v)
|
|
344
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToggleRow, {
|
|
345
|
+
label: "Auto Track",
|
|
346
|
+
value: autoTrack,
|
|
347
|
+
onValueChange: setAutoTrack
|
|
366
348
|
}), state.imageUri && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
367
349
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
368
350
|
style: styles.blendRow,
|
|
@@ -519,19 +501,11 @@ function ImageOverlayModal({
|
|
|
519
501
|
})
|
|
520
502
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
521
503
|
style: styles.toggleSection,
|
|
522
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Switch, {
|
|
528
|
-
value: state.locked,
|
|
529
|
-
onValueChange: v => _ImageOverlayController.ImageOverlayController.setLocked(v),
|
|
530
|
-
trackColor: {
|
|
531
|
-
false: _sharedUi.night.color.surfaceElevated,
|
|
532
|
-
true: _sharedUi.night.color.warning
|
|
533
|
-
}
|
|
534
|
-
})]
|
|
504
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToggleRow, {
|
|
505
|
+
label: "Lock Position",
|
|
506
|
+
tone: "warning",
|
|
507
|
+
value: state.locked,
|
|
508
|
+
onValueChange: v => _ImageOverlayController.ImageOverlayController.setLocked(v)
|
|
535
509
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
536
510
|
style: styles.blendRow,
|
|
537
511
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
@@ -66,15 +66,13 @@ function TargetList({
|
|
|
66
66
|
onSelect
|
|
67
67
|
}) {
|
|
68
68
|
if (targets.length === 0) {
|
|
69
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
children: ["Tag components with", "\n", "testID=\"image-target:YourLabel\""]
|
|
77
|
-
})]
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
|
|
70
|
+
testID: "buoy-image-overlay-empty"
|
|
71
|
+
// scanning = the screen was walked and nothing was tagged.
|
|
72
|
+
,
|
|
73
|
+
otto: "scanning",
|
|
74
|
+
title: "No targets found",
|
|
75
|
+
message: 'Tag components with\ntestID="image-target:YourLabel"'
|
|
78
76
|
});
|
|
79
77
|
}
|
|
80
78
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
package/lib/commonjs/preset.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.IMAGE_OVERLAY_ICON_COLOR = void 0;
|
|
7
|
-
exports.createImageOverlayTool = createImageOverlayTool;
|
|
8
|
-
exports.imageOverlayToolPreset = void 0;
|
|
6
|
+
exports.imageOverlayToolPreset = exports.createImageOverlayTool = exports.IMAGE_OVERLAY_ICON_COLOR = void 0;
|
|
9
7
|
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
8
|
var _ImageOverlayModal = require("./imageOverlay/components/ImageOverlayModal");
|
|
11
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -23,7 +21,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
21
|
*/
|
|
24
22
|
|
|
25
23
|
const IMAGE_OVERLAY_ICON_COLOR = exports.IMAGE_OVERLAY_ICON_COLOR = "#A855F7";
|
|
26
|
-
const imageOverlayToolPreset = exports.imageOverlayToolPreset = {
|
|
24
|
+
const imageOverlayToolPreset = exports.imageOverlayToolPreset = (0, _sharedUi.defineToolPreset)({
|
|
27
25
|
id: "image-overlay",
|
|
28
26
|
name: "IMG",
|
|
29
27
|
description: "Design mockup overlay",
|
|
@@ -38,22 +36,7 @@ const imageOverlayToolPreset = exports.imageOverlayToolPreset = {
|
|
|
38
36
|
props: {
|
|
39
37
|
enableSharedModalDimensions: false
|
|
40
38
|
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
name: options?.name || "IMG",
|
|
46
|
-
description: options?.description || "Design mockup overlay",
|
|
47
|
-
slot: "both",
|
|
48
|
-
icon: ({
|
|
49
|
-
size
|
|
50
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ImageOverlayIcon, {
|
|
51
|
-
size: size,
|
|
52
|
-
color: IMAGE_OVERLAY_ICON_COLOR
|
|
53
|
-
}),
|
|
54
|
-
component: _ImageOverlayModal.ImageOverlayModal,
|
|
55
|
-
props: {
|
|
56
|
-
enableSharedModalDimensions: options?.enableSharedModalDimensions !== undefined ? options.enableSharedModalDimensions : false
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
39
|
+
});
|
|
40
|
+
const createImageOverlayTool = exports.createImageOverlayTool = (0, _sharedUi.createToolFactory)(imageOverlayToolPreset, options => ({
|
|
41
|
+
enableSharedModalDimensions: options.enableSharedModalDimensions ?? false
|
|
42
|
+
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useState, useEffect, useCallback } from "react";
|
|
4
|
-
import { View, Text, TextInput, TouchableOpacity, StyleSheet,
|
|
5
|
-
import { JsModal, ModalHeader, macOSColors, night, Trash2, SquareDashed, Image, PowerToggleButton, windowDragProps } from "@buoy-gg/shared-ui";
|
|
4
|
+
import { View, Text, TextInput, TouchableOpacity, StyleSheet, Alert } from "react-native";
|
|
5
|
+
import { JsModal, ModalHeader, macOSColors, night, Trash2, SquareDashed, Image, PowerToggleButton, windowDragProps, ToggleRow } from "@buoy-gg/shared-ui";
|
|
6
6
|
import { ImageOverlayController } from "../utils/ImageOverlayController";
|
|
7
7
|
import { scanForImageTargets } from "../utils/fiberScanner";
|
|
8
8
|
import { TargetList } from "./TargetList";
|
|
@@ -332,32 +332,14 @@ export function ImageOverlayModal({
|
|
|
332
332
|
})]
|
|
333
333
|
}), /*#__PURE__*/_jsxs(View, {
|
|
334
334
|
style: styles.toggleSection,
|
|
335
|
-
children: [/*#__PURE__*/
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
trackColor: {
|
|
344
|
-
false: night.color.surfaceElevated,
|
|
345
|
-
true: night.color.accent
|
|
346
|
-
}
|
|
347
|
-
})]
|
|
348
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
349
|
-
style: styles.toggleRow,
|
|
350
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
351
|
-
style: styles.toggleLabel,
|
|
352
|
-
children: "Auto Track"
|
|
353
|
-
}), /*#__PURE__*/_jsx(Switch, {
|
|
354
|
-
value: autoTrack,
|
|
355
|
-
onValueChange: setAutoTrack,
|
|
356
|
-
trackColor: {
|
|
357
|
-
false: night.color.surfaceElevated,
|
|
358
|
-
true: night.color.accent
|
|
359
|
-
}
|
|
360
|
-
})]
|
|
335
|
+
children: [/*#__PURE__*/_jsx(ToggleRow, {
|
|
336
|
+
label: "Show Outline",
|
|
337
|
+
value: state.showOutline,
|
|
338
|
+
onValueChange: v => ImageOverlayController.setShowOutline(v)
|
|
339
|
+
}), /*#__PURE__*/_jsx(ToggleRow, {
|
|
340
|
+
label: "Auto Track",
|
|
341
|
+
value: autoTrack,
|
|
342
|
+
onValueChange: setAutoTrack
|
|
361
343
|
}), state.imageUri && /*#__PURE__*/_jsxs(_Fragment, {
|
|
362
344
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
363
345
|
style: styles.blendRow,
|
|
@@ -514,19 +496,11 @@ export function ImageOverlayModal({
|
|
|
514
496
|
})
|
|
515
497
|
}), /*#__PURE__*/_jsxs(View, {
|
|
516
498
|
style: styles.toggleSection,
|
|
517
|
-
children: [/*#__PURE__*/
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}), /*#__PURE__*/_jsx(Switch, {
|
|
523
|
-
value: state.locked,
|
|
524
|
-
onValueChange: v => ImageOverlayController.setLocked(v),
|
|
525
|
-
trackColor: {
|
|
526
|
-
false: night.color.surfaceElevated,
|
|
527
|
-
true: night.color.warning
|
|
528
|
-
}
|
|
529
|
-
})]
|
|
499
|
+
children: [/*#__PURE__*/_jsx(ToggleRow, {
|
|
500
|
+
label: "Lock Position",
|
|
501
|
+
tone: "warning",
|
|
502
|
+
value: state.locked,
|
|
503
|
+
onValueChange: v => ImageOverlayController.setLocked(v)
|
|
530
504
|
}), /*#__PURE__*/_jsxs(View, {
|
|
531
505
|
style: styles.blendRow,
|
|
532
506
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { View, Text, TouchableOpacity, StyleSheet, ScrollView } from "react-native";
|
|
9
|
-
import { ChevronRight, night, Hash } from "@buoy-gg/shared-ui";
|
|
9
|
+
import { ChevronRight, night, Hash, ToolEmptyState } from "@buoy-gg/shared-ui";
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
function TargetRow({
|
|
12
12
|
target,
|
|
@@ -62,15 +62,13 @@ export function TargetList({
|
|
|
62
62
|
onSelect
|
|
63
63
|
}) {
|
|
64
64
|
if (targets.length === 0) {
|
|
65
|
-
return /*#__PURE__*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
children: ["Tag components with", "\n", "testID=\"image-target:YourLabel\""]
|
|
73
|
-
})]
|
|
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"'
|
|
74
72
|
});
|
|
75
73
|
}
|
|
76
74
|
return /*#__PURE__*/_jsx(ScrollView, {
|
package/lib/module/preset.js
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { ImageOverlayIcon } from "@buoy-gg/shared-ui";
|
|
16
|
+
import { ImageOverlayIcon, createToolFactory, defineToolPreset } from "@buoy-gg/shared-ui";
|
|
17
17
|
import { ImageOverlayModal } from "./imageOverlay/components/ImageOverlayModal";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
export const IMAGE_OVERLAY_ICON_COLOR = "#A855F7";
|
|
20
|
-
export const imageOverlayToolPreset = {
|
|
20
|
+
export const imageOverlayToolPreset = defineToolPreset({
|
|
21
21
|
id: "image-overlay",
|
|
22
22
|
name: "IMG",
|
|
23
23
|
description: "Design mockup overlay",
|
|
@@ -32,22 +32,7 @@ export const imageOverlayToolPreset = {
|
|
|
32
32
|
props: {
|
|
33
33
|
enableSharedModalDimensions: false
|
|
34
34
|
}
|
|
35
|
-
};
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
name: options?.name || "IMG",
|
|
40
|
-
description: options?.description || "Design mockup overlay",
|
|
41
|
-
slot: "both",
|
|
42
|
-
icon: ({
|
|
43
|
-
size
|
|
44
|
-
}) => /*#__PURE__*/_jsx(ImageOverlayIcon, {
|
|
45
|
-
size: size,
|
|
46
|
-
color: IMAGE_OVERLAY_ICON_COLOR
|
|
47
|
-
}),
|
|
48
|
-
component: ImageOverlayModal,
|
|
49
|
-
props: {
|
|
50
|
-
enableSharedModalDimensions: options?.enableSharedModalDimensions !== undefined ? options.enableSharedModalDimensions : false
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
35
|
+
});
|
|
36
|
+
export const createImageOverlayTool = createToolFactory(imageOverlayToolPreset, options => ({
|
|
37
|
+
enableSharedModalDimensions: options.enableSharedModalDimensions ?? false
|
|
38
|
+
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageOverlayModal.d.ts","sourceRoot":"","sources":["../../../../src/imageOverlay/components/ImageOverlayModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageOverlayModal.d.ts","sourceRoot":"","sources":["../../../../src/imageOverlay/components/ImageOverlayModal.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,sBAAsB,EAAkC,MAAM,UAAU,CAAC;AAMvF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAKjE,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,iBAAiB,EACjB,sBAAsB,EACtB,MAAc,EACd,WAAW,GACZ,EAAE,sBAAsB,+BAoiBxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,GAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAM,+BAG3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TargetList.d.ts","sourceRoot":"","sources":["../../../../src/imageOverlay/components/TargetList.tsx"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"TargetList.d.ts","sourceRoot":"","sources":["../../../../src/imageOverlay/components/TargetList.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAwCjD,UAAU,eAAe;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAwBhE"}
|
|
@@ -25,12 +25,10 @@ export declare const imageOverlayToolPreset: {
|
|
|
25
25
|
enableSharedModalDimensions: boolean;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export declare
|
|
29
|
-
|
|
30
|
-
description?: string;
|
|
31
|
-
id?: string;
|
|
28
|
+
export declare const createImageOverlayTool: (options?: ({
|
|
29
|
+
/** Enable shared modal dimensions */
|
|
32
30
|
enableSharedModalDimensions?: boolean;
|
|
33
|
-
})
|
|
31
|
+
} & import("@buoy-gg/shared-ui").ToolPresetOverrides) | undefined) => {
|
|
34
32
|
id: string;
|
|
35
33
|
name: string;
|
|
36
34
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/preset.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAEhF,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAElD,eAAO,MAAM,sBAAsB;;;;;qBAKhB;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/preset.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAEhF,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAElD,eAAO,MAAM,sBAAsB;;;;;qBAKhB;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;CAOjC,CAAC;AAEH,eAAO,MAAM,sBAAsB;IAG/B,qCAAqC;kCACP,OAAO;;;;;;qBAbtB;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;CAiBlC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/image-overlay",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.34",
|
|
4
4
|
"description": "Pin your Figma mockup on top of the running app — pixel-perfect UI comparison without leaving the simulator. Part of Buoy devtools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
29
|
+
"@buoy-gg/shared-ui": "^7.0.34"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "*",
|