UNPKG

react-cool-inview

Version:

React hook to monitor an element enters or leaves the viewport (or another element).

130 lines (129 loc) 4.04 kB
{ "name": "react-cool-inview", "version": "3.0.1", "description": "React hook to monitor an element enters or leaves the viewport (or another element).", "license": "MIT", "homepage": "https://react-cool-inview.netlify.app", "repository": "https://github.com/wellyshen/react-cool-inview", "bugs": "https://github.com/wellyshen/react-cool-inview/issues", "keywords": [ "react", "hook", "component", "react-hook", "inview-hook", "inviewport-hook", "in-view-hook", "in-viewport-hook", "intersection-hook", "intersection-observer-hook", "use", "use-inview", "use-inviewport", "use-in-view", "use-in-viewport", "use-intersection", "use-intersection-observer", "inview", "inviewport", "in-view", "in-viewport", "intersection", "observer", "intersection-observer", "intersection-observer-api", "performance", "monitor", "scroll-direction", "direction", "viewport", "visibility", "lazy", "lazy-loading", "scrolling", "impressions", "animations", "typescript" ], "author": "Welly Shen <hivoid19@gmail.com> (https://github.com/wellyshen)", "main": "dist/index.js", "module": "dist/index.esm.js", "types": "dist/index.d.ts", "files": [ "dist" ], "scripts": { "dev": "yarn clean:dev && rollup -c rollup/config.js -w --environment BUILD:dev", "lint": "run-s lint:*", "lint:code": "eslint --fix . --ext .js,.ts,.tsx", "lint:type": "tsc", "lint:style": "stylelint --fix \"**/*.{css,ts,tsx}\"", "lint:format": "prettier -w . -u --loglevel silent", "test": "jest", "test:watch": "yarn test --watch", "test:cov": "yarn clean:cov && yarn test --coverage", "build:demo": "yarn clean:dev && yarn clean:demo && rollup -c rollup/config.js --environment BUILD:demo", "build:dist": "yarn clean:dist && BABEL_ENV=dist rollup -c rollup/config.js --environment BUILD:dist", "build": "run-s build:*", "preversion": "run-s lint test build:dist", "postversion": "git push --follow-tags --no-verify && npm publish && yarn clean:dist", "clean:dev": "rimraf demo/.dev", "clean:demo": "rimraf public", "clean:dist": "rimraf dist .size-snapshot.json", "clean:cov": "rimraf coverage", "clean": "run-p clean:*", "prepare": "husky install" }, "lint-staged": { "*.{js,ts,tsx}": "eslint --fix", "*.{css,ts,tsx}": "stylelint --fix", "**/*": "prettier --write --ignore-unknown" }, "devDependencies": { "@babel/core": "^7.17.0", "@babel/preset-env": "^7.16.11", "@babel/preset-react": "^7.16.7", "@babel/preset-typescript": "^7.16.7", "@emotion/babel-plugin": "^11.7.2", "@emotion/react": "^11.7.1", "@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-commonjs": "^21.0.1", "@rollup/plugin-html": "^0.2.4", "@rollup/plugin-node-resolve": "^13.1.3", "@rollup/plugin-replace": "^3.0.1", "@rollup/plugin-url": "^6.1.0", "@testing-library/react": "^12.1.4", "@testing-library/react-hooks": "^7.0.2", "@types/jest": "^27.4.0", "@types/react": "^17.0.39", "@types/react-dom": "^17.0.11", "eslint": "^8.2.0", "eslint-config-welly": "^1.13.0", "husky": "^7.0.4", "jest": "^27.4.7", "lint-staged": "^12.3.3", "normalize.css": "^8.0.1", "npm-run-all": "^4.1.5", "postcss": "^8.4.6", "prettier": "^2.5.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-test-renderer": "^17.0.2", "rimraf": "^3.0.2", "rollup": "^2.67.0", "rollup-plugin-copy": "^3.4.0", "rollup-plugin-livereload": "^2.0.5", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-serve": "^1.1.0", "rollup-plugin-size-snapshot": "^0.12.0", "rollup-plugin-terser": "^7.0.2", "stylelint": "^13.13.1", "stylelint-config-prettier": "^9.0.3", "stylelint-config-standard": "^22.0.0", "ts-jest": "^27.1.3", "typescript": "^4.5.5" }, "peerDependencies": { "react": ">= 16.8.0" } }