@radix-ui/react-use-rect 1.1.0 → 1.1.1-rc.2
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.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +3 -3
- package/package.json +15 -3
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,6 @@ import { Measurable } from '@radix-ui/rect';
|
|
|
4
4
|
* Use this custom hook to get access to an element's rect (getBoundingClientRect)
|
|
5
5
|
* and observe it along time.
|
|
6
6
|
*/
|
|
7
|
-
declare function useRect(measurable: Measurable | null):
|
|
7
|
+
declare function useRect(measurable: Measurable | null): DOMRect | undefined;
|
|
8
8
|
|
|
9
9
|
export { useRect };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ import { Measurable } from '@radix-ui/rect';
|
|
|
4
4
|
* Use this custom hook to get access to an element's rect (getBoundingClientRect)
|
|
5
5
|
* and observe it along time.
|
|
6
6
|
*/
|
|
7
|
-
declare function useRect(measurable: Measurable | null):
|
|
7
|
+
declare function useRect(measurable: Measurable | null): DOMRect | undefined;
|
|
8
8
|
|
|
9
9
|
export { useRect };
|
package/dist/index.js
CHANGED
|
@@ -28,13 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// packages/react/use-rect/src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
useRect: () => useRect
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
|
-
// packages/react/use-rect/src/
|
|
37
|
+
// packages/react/use-rect/src/use-rect.tsx
|
|
38
38
|
var React = __toESM(require("react"));
|
|
39
39
|
var import_rect = require("@radix-ui/rect");
|
|
40
40
|
function useRect(measurable) {
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts", "../src/
|
|
4
|
-
"sourcesContent": ["export { useRect } from './
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAmC;AAQnC,SAAS,QAAQ,YAA+B;AAC9C,QAAM,CAAC,MAAM,OAAO,IAAU,
|
|
3
|
+
"sources": ["../src/index.ts", "../src/use-rect.tsx"],
|
|
4
|
+
"sourcesContent": ["export { useRect } from './use-rect';\n", "import * as React from 'react';\nimport { observeElementRect } from '@radix-ui/rect';\n\nimport type { Measurable } from '@radix-ui/rect';\n\n/**\n * Use this custom hook to get access to an element's rect (getBoundingClientRect)\n * and observe it along time.\n */\nfunction useRect(measurable: Measurable | null) {\n const [rect, setRect] = React.useState<DOMRect>();\n React.useEffect(() => {\n if (measurable) {\n const unobserve = observeElementRect(measurable, setRect);\n return () => {\n setRect(undefined);\n unobserve();\n };\n }\n return;\n }, [measurable]);\n return rect;\n}\n\nexport { useRect };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAmC;AAQnC,SAAS,QAAQ,YAA+B;AAC9C,QAAM,CAAC,MAAM,OAAO,IAAU,eAAkB;AAChD,EAAM,gBAAU,MAAM;AACpB,QAAI,YAAY;AACd,YAAM,gBAAY,gCAAmB,YAAY,OAAO;AACxD,aAAO,MAAM;AACX,gBAAQ,MAAS;AACjB,kBAAU;AAAA,MACZ;AAAA,IACF;AACA;AAAA,EACF,GAAG,CAAC,UAAU,CAAC;AACf,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { observeElementRect } from '@radix-ui/rect';\n\nimport type { Measurable } from '@radix-ui/rect';\n\n/**\n * Use this custom hook to get access to an element's rect (getBoundingClientRect)\n * and observe it along time.\n */\nfunction useRect(measurable: Measurable | null) {\n const [rect, setRect] = React.useState<
|
|
5
|
-
"mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,0BAA0B;AAQnC,SAAS,QAAQ,YAA+B;AAC9C,QAAM,CAAC,MAAM,OAAO,IAAU,
|
|
3
|
+
"sources": ["../src/use-rect.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { observeElementRect } from '@radix-ui/rect';\n\nimport type { Measurable } from '@radix-ui/rect';\n\n/**\n * Use this custom hook to get access to an element's rect (getBoundingClientRect)\n * and observe it along time.\n */\nfunction useRect(measurable: Measurable | null) {\n const [rect, setRect] = React.useState<DOMRect>();\n React.useEffect(() => {\n if (measurable) {\n const unobserve = observeElementRect(measurable, setRect);\n return () => {\n setRect(undefined);\n unobserve();\n };\n }\n return;\n }, [measurable]);\n return rect;\n}\n\nexport { useRect };\n"],
|
|
5
|
+
"mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,0BAA0B;AAQnC,SAAS,QAAQ,YAA+B;AAC9C,QAAM,CAAC,MAAM,OAAO,IAAU,eAAkB;AAChD,EAAM,gBAAU,MAAM;AACpB,QAAI,YAAY;AACd,YAAM,YAAY,mBAAmB,YAAY,OAAO;AACxD,aAAO,MAAM;AACX,gBAAQ,MAAS;AACjB,kBAAU;AAAA,MACZ;AAAA,IACF;AACA;AAAA,EACF,GAAG,CAAC,UAAU,CAAC;AACf,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-use-rect",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -24,11 +24,22 @@
|
|
|
24
24
|
],
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"scripts": {
|
|
27
|
+
"lint": "eslint --max-warnings 0 src",
|
|
27
28
|
"clean": "rm -rf dist",
|
|
28
29
|
"version": "yarn version"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@radix-ui/rect": "1.1.
|
|
32
|
+
"@radix-ui/rect": "1.1.1-rc.2"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@repo/eslint-config": "0.0.0",
|
|
36
|
+
"@repo/typescript-config": "0.0.0",
|
|
37
|
+
"@types/react": "^19.0.7",
|
|
38
|
+
"@types/react-dom": "^19.0.3",
|
|
39
|
+
"eslint": "^9.18.0",
|
|
40
|
+
"react": "^19.0.0",
|
|
41
|
+
"react-dom": "^19.0.0",
|
|
42
|
+
"typescript": "^5.7.3"
|
|
32
43
|
},
|
|
33
44
|
"peerDependencies": {
|
|
34
45
|
"@types/react": "*",
|
|
@@ -46,5 +57,6 @@
|
|
|
46
57
|
},
|
|
47
58
|
"bugs": {
|
|
48
59
|
"url": "https://github.com/radix-ui/primitives/issues"
|
|
49
|
-
}
|
|
60
|
+
},
|
|
61
|
+
"stableVersion": "1.1.0"
|
|
50
62
|
}
|