From 326e17878879a5788ea0014cf247442d8fff6bce Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Tue, 10 May 2022 09:34:34 +0100 Subject: [PATCH] Update react-resize-aware with use-resize-observer (#40509) --- package-lock.json | 13 +- package.json | 1 + packages/components/package.json | 1 - .../flyout/test/__snapshots__/index.js.snap | 17 +- packages/components/src/flyout/utils.js | 12 +- .../components/src/placeholder/test/index.js | 7 + .../popover/test/__snapshots__/index.js.snap | 8 + .../src/resizable-box/resize-tooltip/utils.ts | 9 +- .../test/__snapshots__/index.js.snap | 14 +- .../toggle-group-control/component.tsx | 10 +- packages/compose/CHANGELOG.md | 4 + packages/compose/README.md | 9 +- packages/compose/package.json | 1 - .../src/hooks/use-resize-observer/index.js | 31 -- .../hooks/use-resize-observer/index.native.js | 2 - .../src/hooks/use-resize-observer/index.tsx | 362 ++++++++++++++++++ test/unit/config/global-mocks.js | 7 +- 17 files changed, 418 insertions(+), 90 deletions(-) delete mode 100644 packages/compose/src/hooks/use-resize-observer/index.js create mode 100644 packages/compose/src/hooks/use-resize-observer/index.tsx diff --git a/package-lock.json b/package-lock.json index 4ede15a245c6e4..a27e94f8c2f1d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17292,7 +17292,6 @@ "re-resizable": "^6.4.0", "react-colorful": "^5.3.1", "react-dates": "^21.8.0", - "react-resize-aware": "^3.1.0", "reakit": "^1.3.8", "uuid": "^8.3.0" }, @@ -17379,7 +17378,6 @@ "clipboard": "^2.0.8", "lodash": "^4.17.21", "mousetrap": "^1.6.5", - "react-resize-aware": "^3.1.0", "use-memo-one": "^1.1.1" } }, @@ -51136,11 +51134,6 @@ "integrity": "sha512-PgidR3wST3dDYKr6b4pJoqQFpPGNKDSCDx4cZoshjXipw3LzO7mG1My2pwEzz2JVkF+inx3xRpDeQLFQGH/hsQ==", "dev": true }, - "react-resize-aware": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/react-resize-aware/-/react-resize-aware-3.1.0.tgz", - "integrity": "sha512-bIhHlxVTX7xKUz14ksXMEHjzCZPTpQZKZISY3nbTD273pDKPABGFNFBP6Tr42KECxzC5YQiKpMchjTVJCqaxpA==" - }, "react-router": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.1.1.tgz", @@ -52504,6 +52497,12 @@ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, + "resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==", + "dev": true + }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", diff --git a/package.json b/package.json index 324271515eb0ac..ec05cf5af74ad9 100755 --- a/package.json +++ b/package.json @@ -212,6 +212,7 @@ "react-refresh": "0.10.0", "react-test-renderer": "17.0.2", "redux": "4.1.2", + "resize-observer-polyfill": "1.5.1", "rimraf": "3.0.2", "rtlcss": "2.6.2", "sass": "1.35.2", diff --git a/packages/components/package.json b/packages/components/package.json index d587d1889e085b..15ea54baa7d6b2 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -65,7 +65,6 @@ "re-resizable": "^6.4.0", "react-colorful": "^5.3.1", "react-dates": "^21.8.0", - "react-resize-aware": "^3.1.0", "reakit": "^1.3.8", "uuid": "^8.3.0" }, diff --git a/packages/components/src/flyout/test/__snapshots__/index.js.snap b/packages/components/src/flyout/test/__snapshots__/index.js.snap index 66893021274f94..60c6d3fe10500f 100644 --- a/packages/components/src/flyout/test/__snapshots__/index.js.snap +++ b/packages/components/src/flyout/test/__snapshots__/index.js.snap @@ -93,12 +93,9 @@ exports[`props should render correctly 1`] = `
-