@elliemae/ds-floating-context 3.70.0-next.19 → 3.70.0-next.20

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.
@@ -34,13 +34,15 @@ module.exports = __toCommonJS(useFloatingResizeObserver_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_react = require("react");
36
36
  const useFloatingResizeObserver = ({ enabled, floating, onResize }) => {
37
+ const onResizeRef = (0, import_react.useRef)(onResize);
38
+ onResizeRef.current = onResize;
37
39
  (0, import_react.useEffect)(() => {
38
40
  if (!enabled || !floating) return void 0;
39
41
  const observer = new ResizeObserver(() => {
40
- onResize();
42
+ onResizeRef.current();
41
43
  });
42
44
  observer.observe(floating);
43
45
  return () => observer.disconnect();
44
- }, [enabled, floating, onResize]);
46
+ }, [enabled, floating]);
45
47
  };
46
48
  //# sourceMappingURL=useFloatingResizeObserver.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useFloatingResizeObserver.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { useEffect } from 'react';\n\ninterface UseFloatingResizeObserverParams {\n enabled: boolean;\n floating: HTMLElement | null;\n onResize: () => void;\n}\n\n/**\n * Observes the floating element's size and calls `onResize` when its bounding box changes.\n * Used to re-run position computation when the floating content reflows (e.g. async-loaded data).\n */\nexport const useFloatingResizeObserver = ({ enabled, floating, onResize }: UseFloatingResizeObserverParams) => {\n useEffect(() => {\n if (!enabled || !floating) return undefined;\n\n const observer = new ResizeObserver(() => {\n onResize();\n });\n observer.observe(floating);\n\n return () => observer.disconnect();\n }, [enabled, floating, onResize]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA0B;AAYnB,MAAM,4BAA4B,CAAC,EAAE,SAAS,UAAU,SAAS,MAAuC;AAC7G,8BAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,SAAU,QAAO;AAElC,UAAM,WAAW,IAAI,eAAe,MAAM;AACxC,eAAS;AAAA,IACX,CAAC;AACD,aAAS,QAAQ,QAAQ;AAEzB,WAAO,MAAM,SAAS,WAAW;AAAA,EACnC,GAAG,CAAC,SAAS,UAAU,QAAQ,CAAC;AAClC;",
4
+ "sourcesContent": ["import { useEffect, useRef } from 'react';\n\ninterface UseFloatingResizeObserverParams {\n enabled: boolean;\n floating: HTMLElement | null;\n onResize: () => void;\n}\n\n/**\n * Observes the floating element's size and calls `onResize` when its bounding box changes.\n * Used to re-run position computation when the floating content reflows (e.g. async-loaded data).\n */\nexport const useFloatingResizeObserver = ({ enabled, floating, onResize }: UseFloatingResizeObserverParams) => {\n // Latest-ref so an inline `onResize` does not invalidate the effect on every render.\n // ResizeObserver fires an initial callback on `observe()`, so re-subscribing every render\n // would call `onResize` \u2192 setState \u2192 re-render \u2192 re-subscribe \u2192 infinite loop.\n const onResizeRef = useRef(onResize);\n onResizeRef.current = onResize;\n\n useEffect(() => {\n if (!enabled || !floating) return undefined;\n\n const observer = new ResizeObserver(() => {\n onResizeRef.current();\n });\n observer.observe(floating);\n\n return () => observer.disconnect();\n }, [enabled, floating]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAY3B,MAAM,4BAA4B,CAAC,EAAE,SAAS,UAAU,SAAS,MAAuC;AAI7G,QAAM,kBAAc,qBAAO,QAAQ;AACnC,cAAY,UAAU;AAEtB,8BAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,SAAU,QAAO;AAElC,UAAM,WAAW,IAAI,eAAe,MAAM;AACxC,kBAAY,QAAQ;AAAA,IACtB,CAAC;AACD,aAAS,QAAQ,QAAQ;AAEzB,WAAO,MAAM,SAAS,WAAW;AAAA,EACnC,GAAG,CAAC,SAAS,QAAQ,CAAC;AACxB;",
6
6
  "names": []
7
7
  }
@@ -1,14 +1,16 @@
1
1
  import * as React from "react";
2
- import { useEffect } from "react";
2
+ import { useEffect, useRef } from "react";
3
3
  const useFloatingResizeObserver = ({ enabled, floating, onResize }) => {
4
+ const onResizeRef = useRef(onResize);
5
+ onResizeRef.current = onResize;
4
6
  useEffect(() => {
5
7
  if (!enabled || !floating) return void 0;
6
8
  const observer = new ResizeObserver(() => {
7
- onResize();
9
+ onResizeRef.current();
8
10
  });
9
11
  observer.observe(floating);
10
12
  return () => observer.disconnect();
11
- }, [enabled, floating, onResize]);
13
+ }, [enabled, floating]);
12
14
  };
13
15
  export {
14
16
  useFloatingResizeObserver
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useFloatingResizeObserver.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect } from 'react';\n\ninterface UseFloatingResizeObserverParams {\n enabled: boolean;\n floating: HTMLElement | null;\n onResize: () => void;\n}\n\n/**\n * Observes the floating element's size and calls `onResize` when its bounding box changes.\n * Used to re-run position computation when the floating content reflows (e.g. async-loaded data).\n */\nexport const useFloatingResizeObserver = ({ enabled, floating, onResize }: UseFloatingResizeObserverParams) => {\n useEffect(() => {\n if (!enabled || !floating) return undefined;\n\n const observer = new ResizeObserver(() => {\n onResize();\n });\n observer.observe(floating);\n\n return () => observer.disconnect();\n }, [enabled, floating, onResize]);\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAYnB,MAAM,4BAA4B,CAAC,EAAE,SAAS,UAAU,SAAS,MAAuC;AAC7G,YAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,SAAU,QAAO;AAElC,UAAM,WAAW,IAAI,eAAe,MAAM;AACxC,eAAS;AAAA,IACX,CAAC;AACD,aAAS,QAAQ,QAAQ;AAEzB,WAAO,MAAM,SAAS,WAAW;AAAA,EACnC,GAAG,CAAC,SAAS,UAAU,QAAQ,CAAC;AAClC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect, useRef } from 'react';\n\ninterface UseFloatingResizeObserverParams {\n enabled: boolean;\n floating: HTMLElement | null;\n onResize: () => void;\n}\n\n/**\n * Observes the floating element's size and calls `onResize` when its bounding box changes.\n * Used to re-run position computation when the floating content reflows (e.g. async-loaded data).\n */\nexport const useFloatingResizeObserver = ({ enabled, floating, onResize }: UseFloatingResizeObserverParams) => {\n // Latest-ref so an inline `onResize` does not invalidate the effect on every render.\n // ResizeObserver fires an initial callback on `observe()`, so re-subscribing every render\n // would call `onResize` \u2192 setState \u2192 re-render \u2192 re-subscribe \u2192 infinite loop.\n const onResizeRef = useRef(onResize);\n onResizeRef.current = onResize;\n\n useEffect(() => {\n if (!enabled || !floating) return undefined;\n\n const observer = new ResizeObserver(() => {\n onResizeRef.current();\n });\n observer.observe(floating);\n\n return () => observer.disconnect();\n }, [enabled, floating]);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,cAAc;AAY3B,MAAM,4BAA4B,CAAC,EAAE,SAAS,UAAU,SAAS,MAAuC;AAI7G,QAAM,cAAc,OAAO,QAAQ;AACnC,cAAY,UAAU;AAEtB,YAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,SAAU,QAAO;AAElC,UAAM,WAAW,IAAI,eAAe,MAAM;AACxC,kBAAY,QAAQ;AAAA,IACtB,CAAC;AACD,aAAS,QAAQ,QAAQ;AAEzB,WAAO,MAAM,SAAS,WAAW;AAAA,EACnC,GAAG,CAAC,SAAS,QAAQ,CAAC;AACxB;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-floating-context",
3
- "version": "3.70.0-next.19",
3
+ "version": "3.70.0-next.20",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Popper Hook",
6
6
  "files": [
@@ -36,14 +36,14 @@
36
36
  "indent": 4
37
37
  },
38
38
  "dependencies": {
39
- "@elliemae/ds-hooks-headless-tooltip": "3.70.0-next.19",
40
- "@elliemae/ds-props-helpers": "3.70.0-next.19",
41
- "@elliemae/ds-system": "3.70.0-next.19",
42
- "@elliemae/ds-typescript-helpers": "3.70.0-next.19"
39
+ "@elliemae/ds-hooks-headless-tooltip": "3.70.0-next.20",
40
+ "@elliemae/ds-props-helpers": "3.70.0-next.20",
41
+ "@elliemae/ds-system": "3.70.0-next.20",
42
+ "@elliemae/ds-typescript-helpers": "3.70.0-next.20"
43
43
  },
44
44
  "devDependencies": {
45
45
  "jest": "^30.0.0",
46
- "@elliemae/ds-monorepo-devops": "3.70.0-next.19"
46
+ "@elliemae/ds-monorepo-devops": "3.70.0-next.20"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "lodash-es": "^4.17.21",