@buoy-gg/image-overlay 7.0.33 → 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.
@@ -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.jsxs)(_reactNative.View, {
341
- style: styles.toggleRow,
342
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
343
- style: styles.toggleLabel,
344
- children: "Show Outline"
345
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Switch, {
346
- value: state.showOutline,
347
- onValueChange: v => _ImageOverlayController.ImageOverlayController.setShowOutline(v),
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.jsxs)(_reactNative.View, {
523
- style: styles.toggleRow,
524
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
525
- style: styles.toggleLabel,
526
- children: "Lock Position"
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, {
@@ -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
- function createImageOverlayTool(options) {
43
- return {
44
- id: options?.id || "image-overlay",
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, Switch, Alert } from "react-native";
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__*/_jsxs(View, {
336
- style: styles.toggleRow,
337
- children: [/*#__PURE__*/_jsx(Text, {
338
- style: styles.toggleLabel,
339
- children: "Show Outline"
340
- }), /*#__PURE__*/_jsx(Switch, {
341
- value: state.showOutline,
342
- onValueChange: v => ImageOverlayController.setShowOutline(v),
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__*/_jsxs(View, {
518
- style: styles.toggleRow,
519
- children: [/*#__PURE__*/_jsx(Text, {
520
- style: styles.toggleLabel,
521
- children: "Lock Position"
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, {
@@ -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 function createImageOverlayTool(options) {
37
- return {
38
- id: options?.id || "image-overlay",
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":"AAcA,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,+BAgjBxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,GAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAM,+BAG3E"}
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"}
@@ -25,12 +25,10 @@ export declare const imageOverlayToolPreset: {
25
25
  enableSharedModalDimensions: boolean;
26
26
  };
27
27
  };
28
- export declare function createImageOverlayTool(options?: {
29
- name?: string;
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;;;;;CAOlC,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;;;;;qBAMoB;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;EAWpC"}
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.33",
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.33"
29
+ "@buoy-gg/shared-ui": "^7.0.34"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": "*",