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

@interactjs/auto-start

Package Overview
Dependencies
Maintainers
2
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interactjs/auto-start - npm Package Compare versions

Comparing version 1.10.19 to 1.10.20

1

base.d.ts

@@ -5,2 +5,3 @@ import type { Interactable } from '@interactjs/core/Interactable';

import type { CursorChecker, Element, ActionName, ActionProps } from '@interactjs/core/types';
import './InteractableMethods';
declare module '@interactjs/core/InteractStatic' {

@@ -7,0 +8,0 @@ interface InteractStatic {

@@ -5,3 +5,7 @@ import * as domUtils from "../utils/domUtils.js";

import { copyAction } from "../utils/misc.js";
/* eslint-disable import/no-duplicates -- for typescript module augmentations */
import './InteractableMethods';
import InteractableMethods from './InteractableMethods';
/* eslint-enable import/no-duplicates */

@@ -8,0 +12,0 @@ function install(scope) {

2

base.prod.js

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

import*as t from"../utils/domUtils.prod.js";import e from"../utils/extend.prod.js";import n from"../utils/is.prod.js";import{copyAction as r}from"../utils/misc.prod.js";import o from"./InteractableMethods";function a(t,e,n,r,o){return e.testIgnoreAllow(e.options[t.name],n,r)&&e.options[t.name].enabled&&c(e,n,t,o)?t:null}function i(t,e,n,r,o,i,l){for(let s=0,c=r.length;s<c;s++){const c=r[s],u=o[s],m=c.getAction(e,n,t,u);if(!m)continue;const p=a(m,c,u,i,l);if(p)return{action:p,interactable:c,element:u}}return{action:null,interactable:null,element:null}}function l(e,r,o,a,l){let s=[],c=[],u=a;function m(t){s.push(t),c.push(u)}for(;n.element(u);){s=[],c=[],l.interactables.forEachMatch(u,m);const n=i(e,r,o,s,c,a,l);if(n.action&&!n.interactable.options[n.action.name].manualStart)return n;u=t.parentNode(u)}return{action:null,interactable:null,element:null}}function s(t,{action:e,interactable:n,element:o},a){e=e||{name:null},t.interactable=n,t.element=o,r(t.prepared,e),t.rect=n&&e.name?n.getRect(o):null,p(t,a),a.fire("autoStart:prepared",{interaction:t})}function c(t,e,n,r){const o=t.options,a=o[n.name].max,i=o[n.name].maxPerElement,l=r.autoStart.maxInteractions;let s=0,c=0,u=0;if(!(a&&i&&l))return!1;for(const o of r.interactions.list){const r=o.prepared.name;if(o.interacting()){if(s++,s>=l)return!1;if(o.interactable===t){if(c+=r===n.name?1:0,c>=a)return!1;if(o.element===e&&(u++,r===n.name&&u>=i))return!1}}}return l>0}function u(t,e){return n.number(t)?(e.autoStart.maxInteractions=t,this):e.autoStart.maxInteractions}function m(t,e,n){const{cursorElement:r}=n.autoStart;r&&r!==t&&(r.style.cursor=""),t.ownerDocument.documentElement.style.cursor=e,t.style.cursor=e,n.autoStart.cursorElement=e?t:null}function p(t,e){const{interactable:r,element:o,prepared:a}=t;if("mouse"!==t.pointerType||!r||!r.options.styleCursor)return void(e.autoStart.cursorElement&&m(e.autoStart.cursorElement,"",e));let i="";if(a.name){const l=r.options[a.name].cursorChecker;i=n.func(l)?l(a,r,o,t._interacting):e.actions.map[a.name].getCursor(a)}m(t.element,i||"",e)}const f={id:"auto-start/base",before:["actions"],install(t){const{interactStatic:n,defaults:r}=t;t.usePlugin(o),r.base.actionChecker=null,r.base.styleCursor=!0,e(r.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),n.maxInteractions=e=>u(e,t),t.autoStart={maxInteractions:1/0,withinInteractionLimit:c,cursorElement:null}},listeners:{"interactions:down"({interaction:t,pointer:e,event:n,eventTarget:r},o){t.interacting()||s(t,l(t,e,n,r,o),o)},"interactions:move"(t,e){(({interaction:t,pointer:e,event:n,eventTarget:r},o)=>{"mouse"!==t.pointerType||t.pointerIsDown||t.interacting()||s(t,l(t,e,n,r,o),o)})(t,e),((t,e)=>{const{interaction:n}=t;if(!n.pointerIsDown||n.interacting()||!n.pointerWasMoved||!n.prepared.name)return;e.fire("autoStart:before-start",t);const{interactable:r}=n,o=n.prepared.name;o&&r&&(r.options[o].manualStart||!c(r,n.element,n.prepared,e)?n.stop():(n.start(n.prepared,r,n.element),p(n,e)))})(t,e)},"interactions:stop"({interaction:t},e){const{interactable:n}=t;n&&n.options.styleCursor&&m(t.element,"",e)}},maxInteractions:u,withinInteractionLimit:c,validateAction:a};export default f;
import*as t from"../utils/domUtils.prod.js";import e from"../utils/extend.prod.js";import n from"../utils/is.prod.js";import{copyAction as r}from"../utils/misc.prod.js";import"./InteractableMethods";import o from"./InteractableMethods";function a(t,e,n,r,o){return e.testIgnoreAllow(e.options[t.name],n,r)&&e.options[t.name].enabled&&c(e,n,t,o)?t:null}function i(t,e,n,r,o,i,l){for(let s=0,c=r.length;s<c;s++){const c=r[s],u=o[s],m=c.getAction(e,n,t,u);if(!m)continue;const p=a(m,c,u,i,l);if(p)return{action:p,interactable:c,element:u}}return{action:null,interactable:null,element:null}}function l(e,r,o,a,l){let s=[],c=[],u=a;function m(t){s.push(t),c.push(u)}for(;n.element(u);){s=[],c=[],l.interactables.forEachMatch(u,m);const n=i(e,r,o,s,c,a,l);if(n.action&&!n.interactable.options[n.action.name].manualStart)return n;u=t.parentNode(u)}return{action:null,interactable:null,element:null}}function s(t,{action:e,interactable:n,element:o},a){e=e||{name:null},t.interactable=n,t.element=o,r(t.prepared,e),t.rect=n&&e.name?n.getRect(o):null,p(t,a),a.fire("autoStart:prepared",{interaction:t})}function c(t,e,n,r){const o=t.options,a=o[n.name].max,i=o[n.name].maxPerElement,l=r.autoStart.maxInteractions;let s=0,c=0,u=0;if(!(a&&i&&l))return!1;for(const o of r.interactions.list){const r=o.prepared.name;if(o.interacting()){if(s++,s>=l)return!1;if(o.interactable===t){if(c+=r===n.name?1:0,c>=a)return!1;if(o.element===e&&(u++,r===n.name&&u>=i))return!1}}}return l>0}function u(t,e){return n.number(t)?(e.autoStart.maxInteractions=t,this):e.autoStart.maxInteractions}function m(t,e,n){const{cursorElement:r}=n.autoStart;r&&r!==t&&(r.style.cursor=""),t.ownerDocument.documentElement.style.cursor=e,t.style.cursor=e,n.autoStart.cursorElement=e?t:null}function p(t,e){const{interactable:r,element:o,prepared:a}=t;if("mouse"!==t.pointerType||!r||!r.options.styleCursor)return void(e.autoStart.cursorElement&&m(e.autoStart.cursorElement,"",e));let i="";if(a.name){const l=r.options[a.name].cursorChecker;i=n.func(l)?l(a,r,o,t._interacting):e.actions.map[a.name].getCursor(a)}m(t.element,i||"",e)}const f={id:"auto-start/base",before:["actions"],install(t){const{interactStatic:n,defaults:r}=t;t.usePlugin(o),r.base.actionChecker=null,r.base.styleCursor=!0,e(r.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),n.maxInteractions=e=>u(e,t),t.autoStart={maxInteractions:1/0,withinInteractionLimit:c,cursorElement:null}},listeners:{"interactions:down"({interaction:t,pointer:e,event:n,eventTarget:r},o){t.interacting()||s(t,l(t,e,n,r,o),o)},"interactions:move"(t,e){(({interaction:t,pointer:e,event:n,eventTarget:r},o)=>{"mouse"!==t.pointerType||t.pointerIsDown||t.interacting()||s(t,l(t,e,n,r,o),o)})(t,e),((t,e)=>{const{interaction:n}=t;if(!n.pointerIsDown||n.interacting()||!n.pointerWasMoved||!n.prepared.name)return;e.fire("autoStart:before-start",t);const{interactable:r}=n,o=n.prepared.name;o&&r&&(r.options[o].manualStart||!c(r,n.element,n.prepared,e)?n.stop():(n.start(n.prepared,r,n.element),p(n,e)))})(t,e)},"interactions:stop"({interaction:t},e){const{interactable:n}=t;n&&n.options.styleCursor&&m(t.element,"",e)}},maxInteractions:u,withinInteractionLimit:c,validateAction:a};export default f;
//# sourceMappingURL=base.prod.js.map
import type { Plugin } from '@interactjs/core/scope';
import './base';
declare module '@interactjs/core/options' {

@@ -3,0 +4,0 @@ interface PerActionDefaults {

@@ -0,2 +1,5 @@

/* eslint-disable import/no-duplicates -- for typescript module augmentations */
import './base';
import basePlugin from './base';
/* eslint-enable */

@@ -3,0 +6,0 @@ function install(scope) {

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

import t from"./base";function e(t){const e=t.prepared&&t.prepared.name;if(!e)return null;const r=t.interactable.options;return r[e].hold||r[e].delay}const r={id:"auto-start/hold",install(e){const{defaults:r}=e;e.usePlugin(t),r.perAction.hold=0,r.perAction.delay=0},listeners:{"interactions:new"({interaction:t}){t.autoStartHoldTimer=null},"autoStart:prepared"({interaction:t}){const r=e(t);r>0&&(t.autoStartHoldTimer=setTimeout((()=>{t.start(t.prepared,t.interactable,t.element)}),r))},"interactions:move"({interaction:t,duplicate:e}){t.autoStartHoldTimer&&t.pointerWasMoved&&!e&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start"({interaction:t}){e(t)>0&&(t.prepared.name=null)}},getHoldDuration:e};export default r;
import"./base";import t from"./base";function e(t){const e=t.prepared&&t.prepared.name;if(!e)return null;const r=t.interactable.options;return r[e].hold||r[e].delay}const r={id:"auto-start/hold",install(e){const{defaults:r}=e;e.usePlugin(t),r.perAction.hold=0,r.perAction.delay=0},listeners:{"interactions:new"({interaction:t}){t.autoStartHoldTimer=null},"autoStart:prepared"({interaction:t}){const r=e(t);r>0&&(t.autoStartHoldTimer=setTimeout((()=>{t.start(t.prepared,t.interactable,t.element)}),r))},"interactions:move"({interaction:t,duplicate:e}){t.autoStartHoldTimer&&t.pointerWasMoved&&!e&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start"({interaction:t}){e(t)>0&&(t.prepared.name=null)}},getHoldDuration:e};export default r;
//# sourceMappingURL=hold.prod.js.map
{
"name": "@interactjs/auto-start",
"version": "1.10.19",
"version": "1.10.20",
"main": "index",

@@ -13,7 +13,7 @@ "module": "index",

"peerDependencies": {
"@interactjs/core": "1.10.19",
"@interactjs/utils": "1.10.19"
"@interactjs/core": "1.10.20",
"@interactjs/utils": "1.10.20"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.19"
"@interactjs/interact": "1.10.20"
},

@@ -28,3 +28,3 @@ "publishConfig": {

"license": "MIT",
"gitHead": "f3a3a694"
"gitHead": "f7135537"
}
import type { Scope } from '@interactjs/core/scope';
import './base';
import './dragAxis';
import './hold';
declare const _default: {

@@ -3,0 +6,0 @@ id: string;

@@ -0,4 +1,10 @@

/* eslint-disable import/no-duplicates -- for typescript module augmentations */
import './base';
import './dragAxis';
import './hold';
import autoStart from './base';
import dragAxis from './dragAxis';
import hold from './hold';
/* eslint-enable import/no-duplicates */
export default {

@@ -5,0 +11,0 @@ id: 'auto-start',

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

import i from"./base";import o from"./dragAxis";import r from"./hold";export default{id:"auto-start",install(t){t.usePlugin(i),t.usePlugin(r),t.usePlugin(o)}};
import"./base";import"./dragAxis";import"./hold";import i from"./base";import o from"./dragAxis";import r from"./hold";export default{id:"auto-start",install(t){t.usePlugin(i),t.usePlugin(r),t.usePlugin(o)}};
//# sourceMappingURL=plugin.prod.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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