@radix-ui/react-use-rect 0.1.2-rc.39 → 0.1.2-rc.41
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.ts.map +1 -1
- package/dist/index.js +1 -19
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +0 -6
- package/dist/index.module.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAKA;;;GAGG;AACH,wBAAiB,UAAU,EAAE,UAAU,GAAG,IAAI,0BAa7C","sources":["packages/react/use-rect/src/packages/react/use-rect/src/useRect.tsx","packages/react/use-rect/src/packages/react/use-rect/src/index.ts","packages/react/use-rect/src/index.ts"],"sourcesContent":[null,null,"export
|
|
1
|
+
{"mappings":";AAKA;;;GAGG;AACH,wBAAiB,UAAU,EAAE,UAAU,GAAG,IAAI,0BAa7C","sources":["packages/react/use-rect/src/packages/react/use-rect/src/useRect.tsx","packages/react/use-rect/src/packages/react/use-rect/src/index.ts","packages/react/use-rect/src/index.ts"],"sourcesContent":[null,null,"export { useRect } from './useRect';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
var $KEKIw$react = require("react");
|
|
2
2
|
var $KEKIw$radixuirect = require("@radix-ui/rect");
|
|
3
3
|
|
|
4
|
-
function $parcel$exportWildcard(dest, source) {
|
|
5
|
-
Object.keys(source).forEach(function(key) {
|
|
6
|
-
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(dest, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return source[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
return dest;
|
|
19
|
-
}
|
|
20
4
|
function $parcel$export(e, n, v, s) {
|
|
21
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
22
6
|
}
|
|
23
|
-
var $c64cf18f363cc04f$exports = {};
|
|
24
7
|
|
|
25
|
-
$parcel$export(
|
|
8
|
+
$parcel$export(module.exports, "useRect", () => $c64cf18f363cc04f$export$9823a655542017cd);
|
|
26
9
|
|
|
27
10
|
|
|
28
11
|
/**
|
|
@@ -46,7 +29,6 @@ $parcel$export($c64cf18f363cc04f$exports, "useRect", () => $c64cf18f363cc04f$exp
|
|
|
46
29
|
}
|
|
47
30
|
|
|
48
31
|
|
|
49
|
-
$parcel$exportWildcard(module.exports, $c64cf18f363cc04f$exports);
|
|
50
32
|
|
|
51
33
|
|
|
52
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;ACAA;;AAKA;;;GAGA,CACA,SAASA,yCAAT,CAAiBG,UAAjB,EAAgD;IAC9C,MAAM,CAACC,IAAD,EAAOC,OAAP,CAAA,GAAkBJ,qBAAA,EAAxB,AAAA;IACAA,sBAAA,CAAgB,IAAM;QACpB,IAAIE,UAAJ,EAAgB;YACd,MAAMK,SAAS,GAAGN,qCAAkB,CAACC,UAAD,EAAaE,OAAb,CAApC,AAAA;YACA,OAAO,IAAM;gBACXA,OAAO,CAACI,SAAD,CAAP,CAAAJ;gBACAG,SAAS,EAATA,CAAAA;aAFF,CAGC;SACF;QACD,OAAA;KARF,EASG;QAACL,UAAD;KATH,CASC,CAAA;IACD,OAAOC,IAAP,CAAA;CACD;;ADtBD","sources":["packages/react/use-rect/src/index.ts","packages/react/use-rect/src/useRect.tsx"],"sourcesContent":["export { useRect } from './useRect';\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<ClientRect>();\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"],"names":["useRect","React","observeElementRect","measurable","rect","setRect","useState","useEffect","unobserve","undefined"],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import {useState as $jNFHB$useState, useEffect as $jNFHB$useEffect} from "react";
|
|
2
2
|
import {observeElementRect as $jNFHB$observeElementRect} from "@radix-ui/rect";
|
|
3
3
|
|
|
4
|
-
function $parcel$export(e, n, v, s) {
|
|
5
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
|
-
}
|
|
7
|
-
var $ccac1052a272b78b$exports = {};
|
|
8
|
-
|
|
9
|
-
$parcel$export($ccac1052a272b78b$exports, "useRect", () => $ccac1052a272b78b$export$9823a655542017cd);
|
|
10
4
|
|
|
11
5
|
|
|
12
6
|
/**
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;ACAA;;AAKA;;;GAGA,CACA,SAASA,yCAAT,CAAiBG,UAAjB,EAAgD;IAC9C,MAAM,CAACC,IAAD,EAAOC,OAAP,CAAA,GAAkBJ,eAAA,EAAxB,AAAA;IACAA,gBAAA,CAAgB,IAAM;QACpB,IAAIE,UAAJ,EAAgB;YACd,MAAMK,SAAS,GAAGN,yBAAkB,CAACC,UAAD,EAAaE,OAAb,CAApC,AAAA;YACA,OAAO,IAAM;gBACXA,OAAO,CAACI,SAAD,CAAP,CAAAJ;gBACAG,SAAS,EAATA,CAAAA;aAFF,CAGC;SACF;QACD,OAAA;KARF,EASG;QAACL,UAAD;KATH,CASC,CAAA;IACD,OAAOC,IAAP,CAAA;CACD;;ADtBD","sources":["packages/react/use-rect/src/index.ts","packages/react/use-rect/src/useRect.tsx"],"sourcesContent":["export { useRect } from './useRect';\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<ClientRect>();\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"],"names":["useRect","React","observeElementRect","measurable","rect","setRect","useState","useEffect","unobserve","undefined"],"version":3,"file":"index.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-use-rect",
|
|
3
|
-
"version": "0.1.2-rc.
|
|
3
|
+
"version": "0.1.2-rc.41",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.13.10",
|
|
20
|
-
"@radix-ui/rect": "0.1.1"
|
|
20
|
+
"@radix-ui/rect": "0.1.2-rc.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^16.8 || ^17.0 || ^18.0"
|