@radix-ui/react-use-layout-effect 1.0.1-rc.6 → 1.1.0-rc.1
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 +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +35 -18
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +7 -15
- package/dist/index.mjs.map +7 -1
- package/package.json +2 -5
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
4
5
|
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
@@ -6,6 +7,6 @@ import * as React from "react";
|
|
|
6
7
|
*
|
|
7
8
|
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
declare const useLayoutEffect: typeof React.useLayoutEffect;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
export { useLayoutEffect };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
4
5
|
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
@@ -6,6 +7,6 @@ import * as React from "react";
|
|
|
6
7
|
*
|
|
7
8
|
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
declare const useLayoutEffect: typeof React.useLayoutEffect;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
export { useLayoutEffect };
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
(() => {
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
10
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
|
+
}) : x)(function(x) {
|
|
12
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
|
+
});
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
19
31
|
|
|
32
|
+
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
33
|
+
var React = __toESM(__require("react"));
|
|
34
|
+
var useLayoutEffect2 = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
20
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/useLayoutEffect.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAuB;AASvB,MAAMA,mBAAkB,QAAQ,YAAY,QAAQ,IAAU,wBAAkB,MAAM;AAAA,EAAC;",
|
|
6
|
+
"names": ["useLayoutEffect"]
|
|
7
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
10
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect : ()=>{};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export {$9f79659886946c16$export$e5c5a5f917a5871c as useLayoutEffect};
|
|
1
|
+
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
var useLayoutEffect2 = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {
|
|
4
|
+
};
|
|
5
|
+
export {
|
|
6
|
+
useLayoutEffect2 as useLayoutEffect
|
|
7
|
+
};
|
|
16
8
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/useLayoutEffect.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n"],
|
|
5
|
+
"mappings": ";AAAA,YAAY,WAAW;AASvB,IAAMA,mBAAkB,QAAQ,YAAY,QAAQ,IAAU,wBAAkB,MAAM;AAAC;",
|
|
6
|
+
"names": ["useLayoutEffect"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-use-layout-effect",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -44,8 +44,5 @@
|
|
|
44
44
|
"bugs": {
|
|
45
45
|
"url": "https://github.com/radix-ui/primitives/issues"
|
|
46
46
|
},
|
|
47
|
-
"
|
|
48
|
-
"@babel/runtime": "^7.13.10"
|
|
49
|
-
},
|
|
50
|
-
"stableVersion": "1.0.0"
|
|
47
|
+
"stableVersion": "1.0.1"
|
|
51
48
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAEA;;;;;;GAMG;AACH,OAAA,MAAM,6CAAkF,CAAC","sources":["packages/react/use-layout-effect/src/packages/react/use-layout-effect/src/useLayoutEffect.tsx","packages/react/use-layout-effect/src/packages/react/use-layout-effect/src/index.ts","packages/react/use-layout-effect/src/index.ts"],"sourcesContent":[null,null,"export { useLayoutEffect } from './useLayoutEffect';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|