├── .babelrc
├── .editorconfig
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── bin
└── publish-gh-pages
├── example-umd
├── index.html
└── main.js
├── example
├── index.html
└── main.js
├── index.d.ts
├── karma.conf.js
├── lib
└── is-visible-with-offset.js
├── package-lock.json
├── package.json
├── testconf.js
├── tests
└── visibility-sensor-spec.jsx
├── visibility-sensor.js
└── webpack.config.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-env", "@babel/preset-react"],
3 | "plugins": ["@babel/plugin-proposal-class-properties"]
4 | }
5 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/*
2 | tests/bundle.js
3 | dist
4 | example/dist
5 | .idea/
6 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .git
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 | dist: trusty
3 | language: node_js
4 | node_js:
5 | - 8
6 |
7 | before_install:
8 | - export CHROME_BIN=/usr/bin/google-chrome
9 | - export DISPLAY=:99.0
10 | - sh -e /etc/init.d/xvfb start
11 | - sudo apt-get update
12 | - sudo apt-get install -y libappindicator1 fonts-liberation
13 | - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
14 | - sudo dpkg -i google-chrome*.deb
15 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 5.1.1
4 |
5 | - Upgrade outdated dependencies to resolve vulnerabilities ([#162](https://github.com/joshwnj/react-visibility-sensor/pull/162))
6 |
7 | ## 5.1.0
8 |
9 | - Add TypeScript definition ([#153](https://github.com/joshwnj/react-visibility-sensor/pull/153))
10 |
11 | ## 5.0.0
12 |
13 | - Update to ES6 style React and replaced Browserify with Webpack ([#123](https://github.com/joshwnj/react-visibility-sensor/pull/123))
14 | - Update code to the latest version of react, remove useless params/function ([#115](https://github.com/joshwnj/react-visibility-sensor/pull/115))
15 |
16 | ## 4.1.0
17 |
18 | - Update lifecycle method for React 16.3 ([#119](https://github.com/joshwnj/react-visibility-sensor/pull/119))
19 |
20 | ## 4.0.0
21 |
22 | - Upgrade outdated deps and node version ([#127](https://github.com/joshwnj/react-visibility-sensor/pull/127))
23 |
24 | ## 3.14.0
25 |
26 | - re-register node in componentDidUpdate if children diffs ([#103](https://github.com/joshwnj/react-visibility-sensor/pull/103))
27 |
28 | ## 3.13.0
29 |
30 | - Check if the component has size and is not hidden ([#114](https://github.com/joshwnj/react-visibility-sensor/pull/114))
31 |
32 | ## 3.12.0
33 |
34 | - round down viewport values ([#116](https://github.com/joshwnj/react-visibility-sensor/pull/116))
35 |
36 | ## 3.11.0
37 |
38 | - add react 16 as a peer dep ([#94](https://github.com/joshwnj/react-visibility-sensor/pull/94))
39 |
40 | ## 3.10.1
41 |
42 | - prevent unnecessary rerendering ([#85](https://github.com/joshwnj/react-visibility-sensor/pull/85))
43 |
44 | ## 3.10.0
45 |
46 | - allow passing a children function that takes state and chooses what to render from it ([#76](https://github.com/joshwnj/react-visibility-sensor/pull/76#pullrequestreview-33850456))
47 |
48 | ## 3.9.0
49 |
50 | - Migrated deprecated React.PropTypes and React.createClass ([#73](https://github.com/joshwnj/react-visibility-sensor/pull/73))
51 |
52 | ## 3.8.0
53 |
54 | - Improving offset and adding resize listener ([#69](https://github.com/joshwnj/react-visibility-sensor/pull/69))
55 |
56 | ## 3.7.0
57 |
58 | - added `offset` prop ([#64](https://github.com/joshwnj/react-visibility-sensor/pull/64))
59 |
60 | ## 3.6.2
61 |
62 | - fixed a problem where `.debounceCheck` is not cleared properly ([#62](https://github.com/joshwnj/react-visibility-sensor/pull/62))
63 |
64 | ## 3.6.1
65 |
66 | - fixed typo from `delay` to `scrollDelay` ([#59](https://github.com/joshwnj/react-visibility-sensor/pull/59))
67 |
68 | ## 3.6.0
69 |
70 | - added support for "scrollCheck" as well as the default "intervalCheck" ([#54](https://github.com/joshwnj/react-visibility-sensor/pull/54))
71 |
72 | ## 3.5.0
73 |
74 | - simpler logic for `partialVisible` ([#41](https://github.com/joshwnj/react-visibility-sensor/pull/41))
75 |
76 | ## 3.4.0
77 |
78 | - `partialVisibility` prop can now either be a `boolean` (any edge can be visible) or a string of `top|right|bottom|left` to indicate which edge determines visibility ([#42](https://github.com/joshwnj/react-visibility-sensor/pull/42/files))
79 |
80 | ## 3.3.0
81 |
82 | - Mark partially visible when center is visible ([#40](https://github.com/joshwnj/react-visibility-sensor/pull/40))
83 |
84 | ## 3.2.1
85 |
86 | - Fixed error case where component can be null ([#38](https://github.com/joshwnj/react-visibility-sensor/pull/38))
87 |
88 | ## 3.2.0
89 |
90 | - Added `minTopValue` and `delayedCall` props ([#30](https://github.com/joshwnj/react-visibility-sensor/pull/30))
91 |
92 | ## 3.1.1
93 |
94 | - Removed dist file from git (as suggested in #18)
95 | - Added `npm run build`, which is also run on prepublish
96 | - updated the build script so browserify produces a standalone umd script
97 | - added `example-umd` to show how to use it with plain `
81 |
82 |
83 |
84 |