From b6af07abeb390572188431e51c4d9c03b78a69a5 Mon Sep 17 00:00:00 2001 From: mertyldrr Date: Sat, 7 Oct 2023 18:12:19 +0200 Subject: [PATCH] add use-measure library to get bounds of parent element --- frontend/package-lock.json | 35 +++++++++++++++++++++++++++++++++++ frontend/package.json | 1 + 2 files changed, 36 insertions(+) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 1cf64f85..96087369 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -63,6 +63,7 @@ "lint-staged": "^13.2.2", "prettier": "2.8.8", "prop-types": "^15.8.1", + "react-use-measure": "^2.1.1", "storybook": "^7.0.27", "tailwindcss": "^3.3.3", "typescript": "^4.6.4", @@ -13353,6 +13354,12 @@ "node": ">=10" } }, + "node_modules/debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", + "dev": true + }, "node_modules/debug": { "version": "4.3.4", "license": "MIT", @@ -23209,6 +23216,19 @@ "react-dom": ">=16.6.0" } }, + "node_modules/react-use-measure": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/react-use-measure/-/react-use-measure-2.1.1.tgz", + "integrity": "sha512-nocZhN26cproIiIduswYpV5y5lQpSQS1y/4KuvUCjSKmw7ZWIS/+g3aFnX3WdBkyuGUtTLif3UTqnLLhbDoQig==", + "dev": true, + "dependencies": { + "debounce": "^1.2.1" + }, + "peerDependencies": { + "react": ">=16.13", + "react-dom": ">=16.13" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -36047,6 +36067,12 @@ "whatwg-url": "^8.0.0" } }, + "debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", + "dev": true + }, "debug": { "version": "4.3.4", "requires": { @@ -42330,6 +42356,15 @@ "prop-types": "^15.6.2" } }, + "react-use-measure": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/react-use-measure/-/react-use-measure-2.1.1.tgz", + "integrity": "sha512-nocZhN26cproIiIduswYpV5y5lQpSQS1y/4KuvUCjSKmw7ZWIS/+g3aFnX3WdBkyuGUtTLif3UTqnLLhbDoQig==", + "dev": true, + "requires": { + "debounce": "^1.2.1" + } + }, "read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 6cc1fd25..a25f411e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -96,6 +96,7 @@ "lint-staged": "^13.2.2", "prettier": "2.8.8", "prop-types": "^15.8.1", + "react-use-measure": "^2.1.1", "storybook": "^7.0.27", "tailwindcss": "^3.3.3", "typescript": "^4.6.4",