react-intersection-observer
Advanced tools
Comparing version 9.10.1 to 9.10.2
{ | ||
"name": "react-intersection-observer", | ||
"version": "9.10.1", | ||
"version": "9.10.2", | ||
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
@@ -141,3 +141,3 @@ # react-intersection-observer | ||
| **root** | `Element` | `document` | The Intersection Observer interface's read-only root property identifies the Element or Document whose bounds are treated as the bounding box of the viewport for the element which is the observer's target. If the root is `null`, then the bounds of the actual document viewport are used. | | ||
| **rootMargin** | `string` | `'0px'` | Margin around the root. Can have values similar to the CSS margin property, e.g. `"10px 20px 30px 40px"` (top, right, bottom, left). Also supports percentages, to check if an element intersects with the center of the viewport for example "-50% 0% -50% 0%". | | ||
| **rootMargin** | `string` | `'0px'` | Margin around the root. Can have values similar to the CSS margin property, e.g. `"10px 20px 30px 40px"` (top, right, bottom, left). Also supports percentages, to check if an element intersects with the center of the viewport for example `"-50% 0% -50% 0%"`. | | ||
| **threshold** | `number` or `number[]` | `0` | Number between `0` and `1` indicating the percentage that should be visible before triggering. Can also be an array of numbers, to create multiple trigger points. | | ||
@@ -144,0 +144,0 @@ | **onChange** | `(inView, entry) => void` | `undefined` | Call this function whenever the in view state changes. It will receive the `inView` boolean, alongside the current `IntersectionObserverEntry`. | |
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -18,2 +20,10 @@ var __export = (target, all) => { | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -31,3 +41,5 @@ | ||
module.exports = __toCommonJS(test_utils_exports); | ||
var import_react = require("react"); | ||
var React = __toESM(require("react")); | ||
var DeprecatedReactTestUtils = __toESM(require("react-dom/test-utils")); | ||
var act3 = typeof React.act === "function" ? React.act : DeprecatedReactTestUtils.act; | ||
var isMocking = false; | ||
@@ -137,4 +149,4 @@ var observers = /* @__PURE__ */ new Map(); | ||
} | ||
if (import_react.act && getIsReactActEnvironment()) | ||
(0, import_react.act)(() => item.callback(entries, observer)); | ||
if (act3 && getIsReactActEnvironment()) | ||
act3(() => item.callback(entries, observer)); | ||
else | ||
@@ -141,0 +153,0 @@ item.callback(entries, observer); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146921
1467