@gustavo-valsechi/client 1.4.299 → 1.4.300

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.
@@ -40,6 +40,7 @@ var import_styles = require("./styles");
40
40
  var import_theme = require("../theme");
41
41
  var import_react_dom = require("react-dom");
42
42
  var import_events = require("./events");
43
+ var import_navigation = require("next/navigation");
43
44
  var import_lodash = __toESM(require("lodash"));
44
45
  var import_modal = __toESM(require("./modal"));
45
46
  const TargetContext = (0, import_react.createContext)({});
@@ -49,6 +50,7 @@ const TargetProviderContainer = ({ children }) => {
49
50
  const inputRef = (0, import_react.useRef)([]);
50
51
  const containerRef = (0, import_react.useRef)([]);
51
52
  const theme = (0, import_theme.useTheme)();
53
+ const pathname = (0, import_navigation.usePathname)();
52
54
  const [targets, setTargets] = (0, import_react.useState)([]);
53
55
  const [modal, setModal] = (0, import_react.useState)(-1);
54
56
  (0, import_react.useEffect)(() => {
@@ -69,6 +71,12 @@ const TargetProviderContainer = ({ children }) => {
69
71
  focusable.addEventListener("blur", () => (0, import_events.onBlur)(target, index, close, focusable, insideMemory));
70
72
  });
71
73
  }, [targets, inputRef, containerRef, theme.content.isMobile]);
74
+ (0, import_react.useEffect)(() => {
75
+ import_lodash.default.forEach(targets, (target, index) => {
76
+ var _a;
77
+ console.log((_a = target.ref) == null ? void 0 : _a.current);
78
+ });
79
+ }, [targets, pathname]);
72
80
  const getCoords = (target, component) => {
73
81
  const rect = target.getBoundingClientRect();
74
82
  const targetTop = rect.top + window.scrollY;
@@ -6,6 +6,7 @@ import { Container } from "./styles";
6
6
  import { useTheme } from "../theme";
7
7
  import { createPortal } from "react-dom";
8
8
  import { onScroll, onBlur, onFocus, onClick } from "./events";
9
+ import { usePathname } from "next/navigation";
9
10
  import _ from "lodash";
10
11
  import Modal from "./modal";
11
12
  const TargetContext = createContext({});
@@ -15,6 +16,7 @@ const TargetProviderContainer = ({ children }) => {
15
16
  const inputRef = useRef([]);
16
17
  const containerRef = useRef([]);
17
18
  const theme = useTheme();
19
+ const pathname = usePathname();
18
20
  const [targets, setTargets] = useState([]);
19
21
  const [modal, setModal] = useState(-1);
20
22
  useEffect(() => {
@@ -35,6 +37,12 @@ const TargetProviderContainer = ({ children }) => {
35
37
  focusable.addEventListener("blur", () => onBlur(target, index, close, focusable, insideMemory));
36
38
  });
37
39
  }, [targets, inputRef, containerRef, theme.content.isMobile]);
40
+ useEffect(() => {
41
+ _.forEach(targets, (target, index) => {
42
+ var _a;
43
+ console.log((_a = target.ref) == null ? void 0 : _a.current);
44
+ });
45
+ }, [targets, pathname]);
38
46
  const getCoords = (target, component) => {
39
47
  const rect = target.getBoundingClientRect();
40
48
  const targetTop = rect.top + window.scrollY;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.299",
3
+ "version": "1.4.300",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",