@gustavo-valsechi/client 1.4.41 → 1.4.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.
@@ -48,7 +48,8 @@ const TargetProviderContainer = ({ children }) => {
48
48
  if (!element) return;
49
49
  element.addEventListener("click", () => {
50
50
  const newTargets = [...targets];
51
- newTargets.splice(index, 1, { ...target, show: !target.show });
51
+ const coords = getCoords(element);
52
+ newTargets.splice(index, 1, { ...target, show: !target.show, coords });
52
53
  setTargets(newTargets);
53
54
  });
54
55
  });
@@ -70,7 +71,7 @@ const TargetProviderContainer = ({ children }) => {
70
71
  return coords;
71
72
  };
72
73
  const add = (target) => {
73
- memory.push(target);
74
+ memory.push({ ...target, show: false, coords: { top: 0, left: 0 } });
74
75
  setTargets(memory);
75
76
  };
76
77
  const remove = (ref) => {
@@ -88,10 +89,10 @@ const TargetProviderContainer = ({ children }) => {
88
89
  children: [
89
90
  import_lodash.default.map(
90
91
  targets,
91
- (target, index) => !!target.show ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
+ (target, index) => target.show ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
93
  import_styles.Container,
93
94
  {
94
- style: getCoords(target.ref.current),
95
+ style: target.coords,
95
96
  children: target.component
96
97
  },
97
98
  index
@@ -14,7 +14,8 @@ const TargetProviderContainer = ({ children }) => {
14
14
  if (!element) return;
15
15
  element.addEventListener("click", () => {
16
16
  const newTargets = [...targets];
17
- newTargets.splice(index, 1, { ...target, show: !target.show });
17
+ const coords = getCoords(element);
18
+ newTargets.splice(index, 1, { ...target, show: !target.show, coords });
18
19
  setTargets(newTargets);
19
20
  });
20
21
  });
@@ -36,7 +37,7 @@ const TargetProviderContainer = ({ children }) => {
36
37
  return coords;
37
38
  };
38
39
  const add = (target) => {
39
- memory.push(target);
40
+ memory.push({ ...target, show: false, coords: { top: 0, left: 0 } });
40
41
  setTargets(memory);
41
42
  };
42
43
  const remove = (ref) => {
@@ -54,10 +55,10 @@ const TargetProviderContainer = ({ children }) => {
54
55
  children: [
55
56
  _.map(
56
57
  targets,
57
- (target, index) => !!target.show ? /* @__PURE__ */ jsx(
58
+ (target, index) => target.show ? /* @__PURE__ */ jsx(
58
59
  Container,
59
60
  {
60
- style: getCoords(target.ref.current),
61
+ style: target.coords,
61
62
  children: target.component
62
63
  },
63
64
  index
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(styles_exports);
34
34
  var import_styled_components = __toESM(require("styled-components"));
35
35
  const Container = import_styled_components.default.div`
36
36
  position: absolute;
37
+ z-index: 10;
37
38
  `;
38
39
  // Annotate the CommonJS export names for ESM import in node:
39
40
  0 && (module.exports = {
@@ -1,6 +1,7 @@
1
1
  import styled from "styled-components";
2
2
  const Container = styled.div`
3
3
  position: absolute;
4
+ z-index: 10;
4
5
  `;
5
6
  export {
6
7
  Container
@@ -5,7 +5,6 @@ export interface ITargetProvider extends IBaseProvider {
5
5
  export interface ITargetConfig {
6
6
  ref: React.RefObject<any>;
7
7
  component: React.ReactNode;
8
- show?: boolean;
9
8
  }
10
9
  export interface ITargetConfigCoords {
11
10
  top: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.41",
3
+ "version": "1.4.42",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",