@kopexa/use-safe-layout-effect 0.0.0-canary-20250721165623

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/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @kopexa/use-safe-layout-effect
2
+
3
+ A Quick description of the component
4
+
5
+ > This is an internal utility, not intended for public usage.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ yarn add @kopexa/use-safe-layout-effect
11
+ # or
12
+ npm i @kopexa/use-safe-layout-effect
13
+ ```
14
+
15
+ ## Contribution
16
+
17
+ Yes please! See the
18
+ [contributing guidelines](https://github.com/kopexa-grc/sight/blob/master/CONTRIBUTING.md)
19
+ for details.
20
+
21
+ ## License
22
+
23
+ This project is licensed under the terms of the
24
+ [MIT license](https://github.com/kopexa-grc/sight/blob/master/LICENSE).
@@ -0,0 +1,5 @@
1
+ import { useLayoutEffect } from 'react';
2
+
3
+ declare const useSafeLayoutEffect: typeof useLayoutEffect;
4
+
5
+ export { useSafeLayoutEffect };
@@ -0,0 +1,5 @@
1
+ import { useLayoutEffect } from 'react';
2
+
3
+ declare const useSafeLayoutEffect: typeof useLayoutEffect;
4
+
5
+ export { useSafeLayoutEffect };
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ useSafeLayoutEffect: () => useSafeLayoutEffect
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var import_react = require("react");
27
+ var useSafeLayoutEffect = (globalThis == null ? void 0 : globalThis.document) ? import_react.useLayoutEffect : import_react.useEffect;
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ useSafeLayoutEffect
31
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ // src/index.ts
2
+ import { useEffect, useLayoutEffect } from "react";
3
+ var useSafeLayoutEffect = (globalThis == null ? void 0 : globalThis.document) ? useLayoutEffect : useEffect;
4
+ export {
5
+ useSafeLayoutEffect
6
+ };
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@kopexa/use-safe-layout-effect",
3
+ "version": "0.0.0-canary-20250721165623",
4
+ "description": "",
5
+ "keywords": [
6
+ "use-safe-layout-effect"
7
+ ],
8
+ "author": "Kopexa <hello@kopexa.com>",
9
+ "homepage": "https://kopexa.com",
10
+ "license": "MIT",
11
+ "main": "dist/index.js",
12
+ "sideEffects": false,
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/kopexa-grc/sight.git",
22
+ "directory": "packages/hooks/use-safe-layout-effect"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/kopexa-grc/sight/issues"
26
+ },
27
+ "peerDependencies": {
28
+ "react": ">=19.0.0-rc.0"
29
+ },
30
+ "clean-package": "../../../clean-package.config.json",
31
+ "tsup": {
32
+ "clean": true,
33
+ "target": "es2019",
34
+ "format": [
35
+ "cjs",
36
+ "esm"
37
+ ]
38
+ },
39
+ "module": "dist/index.mjs",
40
+ "types": "dist/index.d.ts",
41
+ "exports": {
42
+ ".": {
43
+ "types": "./dist/index.d.ts",
44
+ "import": "./dist/index.mjs",
45
+ "require": "./dist/index.js"
46
+ },
47
+ "./package.json": "./package.json"
48
+ },
49
+ "scripts": {
50
+ "build": "tsup src --dts",
51
+ "build:fast": "tsup src",
52
+ "dev": "pnpm build:fast --watch",
53
+ "clean": "rimraf dist .turbo",
54
+ "typecheck": "tsc --noEmit"
55
+ }
56
+ }