Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alpinejs/intersect

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alpinejs/intersect - npm Package Compare versions

Comparing version 3.2.3 to 3.2.4

4

dist/cdn.js
(() => {
// packages/intersect/src/index.js
function src_default(Alpine) {
Alpine.directive("intersect", (el, {expression, modifiers}, {evaluateLater, cleanup}) => {
Alpine.directive("intersect", (el, {value, expression, modifiers}, {evaluateLater, cleanup}) => {
let evaluate = evaluateLater(expression);
let observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.intersectionRatio === 0)
if (!entry.isIntersecting && value === "enter" || entry.isIntersecting && value === "leave" || entry.intersectionRatio === 0 && !value)
return;

@@ -10,0 +10,0 @@ evaluate();

@@ -1,1 +0,1 @@

(()=>{function n(t){t.directive("intersect",(i,{expression:r,modifiers:c},{evaluateLater:o,cleanup:s})=>{let d=o(r),e=new IntersectionObserver(l=>{l.forEach(a=>{a.intersectionRatio!==0&&(d(),c.includes("once")&&e.disconnect())})});e.observe(i),s(()=>{e.disconnect()})})}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(n)});})();
(()=>{function i(r){r.directive("intersect",(c,{value:e,expression:s,modifiers:o},{evaluateLater:d,cleanup:l})=>{let a=d(s),n=new IntersectionObserver(f=>{f.forEach(t=>{!t.isIntersecting&&e==="enter"||t.isIntersecting&&e==="leave"||t.intersectionRatio===0&&!e||(a(),o.includes("once")&&n.disconnect())})});n.observe(c),l(()=>{n.disconnect()})})}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(i)});})();

@@ -16,7 +16,7 @@ var __defProp = Object.defineProperty;

function src_default(Alpine) {
Alpine.directive("intersect", (el, {expression, modifiers}, {evaluateLater, cleanup}) => {
Alpine.directive("intersect", (el, {value, expression, modifiers}, {evaluateLater, cleanup}) => {
let evaluate = evaluateLater(expression);
let observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.intersectionRatio === 0)
if (!entry.isIntersecting && value === "enter" || entry.isIntersecting && value === "leave" || entry.intersectionRatio === 0 && !value)
return;

@@ -23,0 +23,0 @@ evaluate();

// packages/intersect/src/index.js
function src_default(Alpine) {
Alpine.directive("intersect", (el, {expression, modifiers}, {evaluateLater, cleanup}) => {
Alpine.directive("intersect", (el, {value, expression, modifiers}, {evaluateLater, cleanup}) => {
let evaluate = evaluateLater(expression);
let observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.intersectionRatio === 0)
if (!entry.isIntersecting && value === "enter" || entry.isIntersecting && value === "leave" || entry.intersectionRatio === 0 && !value)
return;

@@ -9,0 +9,0 @@ evaluate();

{
"name": "@alpinejs/intersect",
"version": "3.2.3",
"version": "3.2.4",
"description": "Trigger JavaScript when an element enters the viewport",

@@ -5,0 +5,0 @@ "author": "Caleb Porzio",

export default function (Alpine) {
Alpine.directive('intersect', (el, { expression, modifiers }, { evaluateLater, cleanup }) => {
Alpine.directive('intersect', (el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
let evaluate = evaluateLater(expression)

@@ -7,3 +7,7 @@

entries.forEach(entry => {
if (entry.intersectionRatio === 0) return
if (
! entry.isIntersecting && value === 'enter'
|| entry.isIntersecting && value === 'leave'
|| entry.intersectionRatio === 0 && ! value
) return

@@ -10,0 +14,0 @@ evaluate()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc