@interactjs/core
Advanced tools
Comparing version 1.10.2 to 1.10.3
@@ -1,2 +0,1 @@ | ||
import { Scope } from "./scope.js"; | ||
import * as arr from "../utils/arr.js"; | ||
@@ -144,8 +143,4 @@ import * as domUtils from "../utils/domUtils.js"; | ||
let index; | ||
if (!delegates) return; // count from last index of delegated to 0 | ||
if (!delegates) { | ||
return; | ||
} // count from last index of delegated to 0 | ||
for (index = delegates.length - 1; index >= 0; index--) { | ||
@@ -152,0 +147,0 @@ const cur = delegates[index]; // look for matching selector and context Node |
@@ -1,2 +0,2 @@ | ||
import{Scope as e}from"./scope.prod.js";import*as t from"../utils/arr.prod.js";import*as s from"../utils/domUtils.prod.js";import n from"../utils/extend.prod.js";import r from"../utils/is.prod.js";import o from"../utils/pointerExtend.prod.js";import*as i from"../utils/pointerUtils.prod.js";class a{constructor(e){this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=e,o(this,e)}preventOriginalDefault(){this.originalEvent.preventDefault()}stopPropagation(){this.originalEvent.stopPropagation()}stopImmediatePropagation(){this.originalEvent.stopImmediatePropagation()}}function p(e){if(!r.object(e))return{capture:!!e,passive:!1};const t=n({},e);return t.capture=!!e.capture,t.passive=!!e.passive,t}export default{id:"events",install(e){const n=[],o={},l=[],c={add:u,remove:v,addDelegate(e,s,n,r,i){const a=p(i);if(!o[n]){o[n]=[];for(const e of l)u(e,n,d),u(e,n,f,!0)}const c=o[n];let v=t.find(c,(t=>t.selector===e&&t.context===s));v||(v={selector:e,context:s,listeners:[]},c.push(v)),v.listeners.push([r,a])},removeDelegate(e,t,s,n,r){const i=p(r),a=o[s];let l,c=!1;if(a)for(l=a.length-1;l>=0;l--){const r=a[l];if(r.selector===e&&r.context===t){const{listeners:e}=r;for(let r=e.length-1;r>=0;r--){const[o,{capture:p,passive:u}]=e[r];if(o===n&&p===i.capture&&u===i.passive){e.splice(r,1),e.length||(a.splice(l,1),v(t,s,d),v(t,s,f,!0)),c=!0;break}}if(c)break}}},delegateListener:d,delegateUseCapture:f,delegatedEvents:o,documents:l,targets:n,supportsOptions:!1,supportsPassive:!1};function u(e,s,r,o){const i=p(o);let a=t.find(n,(t=>t.eventTarget===e));a||(a={eventTarget:e,events:{}},n.push(a)),a.events[s]||(a.events[s]=[]),e.addEventListener&&!t.contains(a.events[s],r)&&(e.addEventListener(s,r,c.supportsOptions?i:i.capture),a.events[s].push(r))}function v(e,s,r,o){const i=p(o),a=t.findIndex(n,(t=>t.eventTarget===e)),l=n[a];if(!l||!l.events)return;if("all"===s){for(s in l.events)l.events.hasOwnProperty(s)&&v(e,s,"all");return}let u=!1;const d=l.events[s];if(d){if("all"===r){for(let t=d.length-1;t>=0;t--)v(e,s,d[t],i);return}for(let t=0;t<d.length;t++)if(d[t]===r){e.removeEventListener(s,r,c.supportsOptions?i:i.capture),d.splice(t,1),0===d.length&&(delete l.events[s],u=!0);break}}u&&!Object.keys(l.events).length&&n.splice(a,1)}function d(e,t){const n=p(t),l=new a(e),c=o[e.type],[u]=i.getEventTargets(e);let v=u;for(;r.element(v);){for(let e=0;e<c.length;e++){const t=c[e],{selector:r,context:o}=t;if(s.matchesSelector(v,r)&&s.nodeContains(o,u)&&s.nodeContains(o,v)){const{listeners:e}=t;l.currentTarget=v;for(const[t,{capture:s,passive:r}]of e)s===n.capture&&r===n.passive&&t(l)}}v=s.parentNode(v)}}function f(e){return d(e,!0)}return e.document.createElement("div").addEventListener("test",null,{get capture(){return c.supportsOptions=!0},get passive(){return c.supportsPassive=!0}}),e.events=c,c}}; | ||
import*as e from"../utils/arr.prod.js";import*as t from"../utils/domUtils.prod.js";import s from"../utils/extend.prod.js";import n from"../utils/is.prod.js";import r from"../utils/pointerExtend.prod.js";import*as o from"../utils/pointerUtils.prod.js";class i{constructor(e){this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=e,r(this,e)}preventOriginalDefault(){this.originalEvent.preventDefault()}stopPropagation(){this.originalEvent.stopPropagation()}stopImmediatePropagation(){this.originalEvent.stopImmediatePropagation()}}function a(e){if(!n.object(e))return{capture:!!e,passive:!1};const t=s({},e);return t.capture=!!e.capture,t.passive=!!e.passive,t}export default{id:"events",install(s){const r=[],p={},l=[],c={add:u,remove:v,addDelegate(t,s,n,r,o){const i=a(o);if(!p[n]){p[n]=[];for(const e of l)u(e,n,d),u(e,n,f,!0)}const c=p[n];let v=e.find(c,(e=>e.selector===t&&e.context===s));v||(v={selector:t,context:s,listeners:[]},c.push(v)),v.listeners.push([r,i])},removeDelegate(e,t,s,n,r){const o=a(r),i=p[s];let l,c=!1;if(i)for(l=i.length-1;l>=0;l--){const r=i[l];if(r.selector===e&&r.context===t){const{listeners:e}=r;for(let r=e.length-1;r>=0;r--){const[a,{capture:p,passive:u}]=e[r];if(a===n&&p===o.capture&&u===o.passive){e.splice(r,1),e.length||(i.splice(l,1),v(t,s,d),v(t,s,f,!0)),c=!0;break}}if(c)break}}},delegateListener:d,delegateUseCapture:f,delegatedEvents:p,documents:l,targets:r,supportsOptions:!1,supportsPassive:!1};function u(t,s,n,o){const i=a(o);let p=e.find(r,(e=>e.eventTarget===t));p||(p={eventTarget:t,events:{}},r.push(p)),p.events[s]||(p.events[s]=[]),t.addEventListener&&!e.contains(p.events[s],n)&&(t.addEventListener(s,n,c.supportsOptions?i:i.capture),p.events[s].push(n))}function v(t,s,n,o){const i=a(o),p=e.findIndex(r,(e=>e.eventTarget===t)),l=r[p];if(!l||!l.events)return;if("all"===s){for(s in l.events)l.events.hasOwnProperty(s)&&v(t,s,"all");return}let u=!1;const d=l.events[s];if(d){if("all"===n){for(let e=d.length-1;e>=0;e--)v(t,s,d[e],i);return}for(let e=0;e<d.length;e++)if(d[e]===n){t.removeEventListener(s,n,c.supportsOptions?i:i.capture),d.splice(e,1),0===d.length&&(delete l.events[s],u=!0);break}}u&&!Object.keys(l.events).length&&r.splice(p,1)}function d(e,s){const r=a(s),l=new i(e),c=p[e.type],[u]=o.getEventTargets(e);let v=u;for(;n.element(v);){for(let e=0;e<c.length;e++){const s=c[e],{selector:n,context:o}=s;if(t.matchesSelector(v,n)&&t.nodeContains(o,u)&&t.nodeContains(o,v)){const{listeners:e}=s;l.currentTarget=v;for(const[t,{capture:s,passive:n}]of e)s===r.capture&&n===r.passive&&t(l)}}v=t.parentNode(v)}}function f(e){return d(e,!0)}return s.document.createElement("div").addEventListener("test",null,{get capture(){return c.supportsOptions=!0},get passive(){return c.supportsPassive=!0}}),s.events=c,c}}; | ||
//# sourceMappingURL=events.prod.js.map |
@@ -88,2 +88,3 @@ /* eslint-disable no-dupe-class-members */ | ||
if (is.array(optionValue)) { | ||
; | ||
actionOptions[optionName] = arr.from(optionValue); | ||
@@ -93,5 +94,7 @@ } // if the option value is an object | ||
// copy the object | ||
; | ||
actionOptions[optionName] = extend(actionOptions[optionName] || {}, clone(optionValue)); // set anabled field to true if it exists in the defaults | ||
if (is.object(defaults.perAction[optionName]) && 'enabled' in defaults.perAction[optionName]) { | ||
; | ||
actionOptions[optionName].enabled = optionValue.enabled !== false; | ||
@@ -101,5 +104,7 @@ } | ||
else if (is.bool(optionValue) && is.object(defaults.perAction[optionName])) { | ||
; | ||
actionOptions[optionName].enabled = optionValue; | ||
} // if it's anything else, do a plain assignment | ||
else { | ||
; | ||
actionOptions[optionName] = optionValue; | ||
@@ -166,5 +171,7 @@ } | ||
if (trySelector(newValue) || is.object(newValue)) { | ||
; | ||
this.options[optionName] = newValue; | ||
for (const action in this._actions.map) { | ||
; | ||
this.options[action][optionName] = newValue; | ||
@@ -352,2 +359,3 @@ } | ||
; | ||
this.options = clone(defaults.base); | ||
@@ -365,2 +373,3 @@ | ||
if (is.func(this[setting])) { | ||
; | ||
this[setting](options[setting]); | ||
@@ -367,0 +376,0 @@ } |
@@ -1,2 +0,1 @@ | ||
import { Interactable } from "./Interactable.js"; | ||
import { matchesSelector, nodeContains } from "../utils/domUtils.js"; | ||
@@ -22,7 +21,4 @@ import is from "../utils/is.js"; | ||
const setting = interactable.options.preventDefault; | ||
if (setting === 'never') return; | ||
if (setting === 'never') { | ||
return; | ||
} | ||
if (setting === 'always') { | ||
@@ -29,0 +25,0 @@ event.preventDefault(); |
@@ -1,2 +0,2 @@ | ||
import{Interactable as t}from"./Interactable.prod.js";import{matchesSelector as e,nodeContains as n}from"../utils/domUtils.prod.js";import r from"../utils/is.prod.js";import{getWindow as o}from"../utils/window.prod.js";function i(t){return/^(always|never|auto)$/.test(t)?(this.options.preventDefault=t,this):r.bool(t)?(this.options.preventDefault=t?"always":"never",this):this.options.preventDefault}function s({interaction:t,event:e}){t.interactable&&t.interactable.checkAndPreventDefault(e)}export function install(t){const{Interactable:s}=t;s.prototype.preventDefault=i,s.prototype.checkAndPreventDefault=function(n){return((t,n,i)=>{const s=t.options.preventDefault;if("never"!==s)if("always"!==s){if(n.events.supportsPassive&&/^touch(start|move)$/.test(i.type)){const t=o(i.target).document,e=n.getDocOptions(t);if(!e||!e.events||!1!==e.events.passive)return}/^(mouse|pointer|touch)*(down|start)/i.test(i.type)||r.element(i.target)&&e(i.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||i.preventDefault()}else i.preventDefault()})(this,t,n)},t.interactions.docEvents.push({type:"dragstart",listener(e){for(const r of t.interactions.list)if(r.element&&(r.element===e.target||n(r.element,e.target)))return void r.interactable.checkAndPreventDefault(e)}})}export default{id:"core/interactablePreventDefault",install:install,listeners:["down","move","up","cancel"].reduce(((t,e)=>(t["interactions:"+e]=s,t)),{})}; | ||
import{matchesSelector as t,nodeContains as e}from"../utils/domUtils.prod.js";import n from"../utils/is.prod.js";import{getWindow as r}from"../utils/window.prod.js";function o(t){return/^(always|never|auto)$/.test(t)?(this.options.preventDefault=t,this):n.bool(t)?(this.options.preventDefault=t?"always":"never",this):this.options.preventDefault}function i({interaction:t,event:e}){t.interactable&&t.interactable.checkAndPreventDefault(e)}export function install(i){const{Interactable:s}=i;s.prototype.preventDefault=o,s.prototype.checkAndPreventDefault=function(e){return((e,o,i)=>{const s=e.options.preventDefault;if("never"!==s)if("always"!==s){if(o.events.supportsPassive&&/^touch(start|move)$/.test(i.type)){const t=r(i.target).document,e=o.getDocOptions(t);if(!e||!e.events||!1!==e.events.passive)return}/^(mouse|pointer|touch)*(down|start)/i.test(i.type)||n.element(i.target)&&t(i.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||i.preventDefault()}else i.preventDefault()})(this,i,e)},i.interactions.docEvents.push({type:"dragstart",listener(t){for(const n of i.interactions.list)if(n.element&&(n.element===t.target||e(n.element,t.target)))return void n.interactable.checkAndPreventDefault(t)}})}export default{id:"core/interactablePreventDefault",install:install,listeners:["down","move","up","cancel"].reduce(((t,e)=>(t["interactions:"+e]=i,t)),{})}; | ||
//# sourceMappingURL=interactablePreventDefault.prod.js.map |
@@ -60,2 +60,3 @@ import * as arr from "../utils/arr.js"; | ||
; | ||
target[this.scope.id].push(mappingInfo); | ||
@@ -90,4 +91,4 @@ } | ||
if ((is.string(interactable.target) // target is a selector and the element matches | ||
? is.element(node) && domUtils.matchesSelector(node, interactable.target) : // target is the element | ||
if ((is.string(interactable.target) ? // target is a selector and the element matches | ||
is.element(node) && domUtils.matchesSelector(node, interactable.target) : // target is the element | ||
node === interactable.target) && // the element is in context | ||
@@ -94,0 +95,0 @@ interactable.inContext(node)) { |
@@ -431,7 +431,3 @@ import * as arr from "../utils/arr.js"; | ||
const pointerIndex = this.getPointerIndex(pointer); | ||
if (pointerIndex === -1) { | ||
return; | ||
} | ||
if (pointerIndex === -1) return; | ||
const pointerInfo = this.pointers[pointerIndex]; | ||
@@ -438,0 +434,0 @@ |
@@ -1,2 +0,1 @@ | ||
import { Scope, SignalArgs } from "./scope.js"; | ||
import browser from "../utils/browser.js"; | ||
@@ -3,0 +2,0 @@ import domObjects from "../utils/domObjects.js"; |
@@ -1,2 +0,2 @@ | ||
import{Scope as e,SignalArgs as t}from"./scope.prod.js";import o from"../utils/browser.prod.js";import n from"../utils/domObjects.prod.js";import{nodeContains as r}from"../utils/domUtils.prod.js";import*as i from"../utils/pointerUtils.prod.js";import s from"./Interaction.prod.js";import p from"./interactablePreventDefault.prod.js";import c from"./interactionFinder.prod.js";const a=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function l(e,t){return n=>{const r=t.interactions.list,s=i.getPointerType(n),[p,c]=i.getEventTargets(n),a=[];if(/^touch/.test(n.type)){t.prevTouchTime=t.now();for(const e of n.changedTouches){const o=e,r={pointer:o,pointerId:i.getPointerId(o),pointerType:s,eventType:n.type,eventTarget:p,curEventTarget:c,scope:t},l=u(r);a.push([r.pointer,r.eventTarget,r.curEventTarget,l])}}else{let e=!1;if(!o.supportsPointerEvent&&/mouse/.test(n.type)){for(let t=0;t<r.length&&!e;t++)e="mouse"!==r[t].pointerType&&r[t].pointerIsDown;e=e||t.now()-t.prevTouchTime<500||0===n.timeStamp}if(!e){const e={pointer:n,pointerId:i.getPointerId(n),pointerType:s,eventType:n.type,curEventTarget:c,eventTarget:p,scope:t},o=u(e);a.push([e.pointer,e.eventTarget,e.curEventTarget,o])}}for(const[t,o,r,i]of a)i[e](t,n,o,r)}}function u(e){const{pointerType:t,scope:o}=e,n={interaction:c.search(e),searchDetails:e};return o.fire("interactions:find",n),n.interaction||o.interactions.new({pointerType:t})}function d({doc:e,scope:t,options:o},n){const{interactions:{docEvents:r},events:i}=t,s=i[n];t.browser.isIOS&&!o.events&&(o.events={passive:!1});for(const t in i.delegatedEvents)s(e,t,i.delegateListener),s(e,t,i.delegateUseCapture,!0);const p=o&&o.events;for(const{type:t,listener:o}of r)s(e,t,o,p)}const v={id:"core/interactions",install(e){const t={};for(const o of a)t[o]=l(o,e);const i=o.pEventTypes;let c;function u(){for(const t of e.interactions.list)if(t.pointerIsDown&&"touch"===t.pointerType&&!t._interacting)for(const o of t.pointers)e.documents.some((({doc:e})=>r(e,o.downTarget)))||t.removePointer(o.pointer,o.event)}c=n.PointerEvent?[{type:i.down,listener:u},{type:i.down,listener:t.pointerDown},{type:i.move,listener:t.pointerMove},{type:i.up,listener:t.pointerUp},{type:i.cancel,listener:t.pointerUp}]:[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:u},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}],c.push({type:"blur",listener(t){for(const o of e.interactions.list)o.documentBlur(t)}}),e.prevTouchTime=0,e.Interaction=class extends s{get pointerMoveTolerance(){return e.interactions.pointerMoveTolerance}set pointerMoveTolerance(t){e.interactions.pointerMoveTolerance=t}_now(){return e.now()}},e.interactions={list:[],new(t){t.scopeFire=(t,o)=>e.fire(t,o);const o=new e.Interaction(t);return e.interactions.list.push(o),o},listeners:t,docEvents:c,pointerMoveTolerance:1},e.usePlugin(p)},listeners:{"scope:add-document":e=>d(e,"add"),"scope:remove-document":e=>d(e,"remove"),"interactable:unset"({interactable:e},t){for(let o=t.interactions.list.length-1;o>=0;o--){const n=t.interactions.list[o];n.interactable===e&&(n.stop(),t.fire("interactions:destroy",{interaction:n}),n.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(o,1))}}},onDocSignal:d,doOnInteractions:l,methodNames:a};export default v; | ||
import e from"../utils/browser.prod.js";import t from"../utils/domObjects.prod.js";import{nodeContains as n}from"../utils/domUtils.prod.js";import*as o from"../utils/pointerUtils.prod.js";import r from"./Interaction.prod.js";import i from"./interactablePreventDefault.prod.js";import s from"./interactionFinder.prod.js";const p=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function c(t,n){return r=>{const i=n.interactions.list,s=o.getPointerType(r),[p,c]=o.getEventTargets(r),l=[];if(/^touch/.test(r.type)){n.prevTouchTime=n.now();for(const e of r.changedTouches){const t=e,i={pointer:t,pointerId:o.getPointerId(t),pointerType:s,eventType:r.type,eventTarget:p,curEventTarget:c,scope:n},u=a(i);l.push([i.pointer,i.eventTarget,i.curEventTarget,u])}}else{let t=!1;if(!e.supportsPointerEvent&&/mouse/.test(r.type)){for(let e=0;e<i.length&&!t;e++)t="mouse"!==i[e].pointerType&&i[e].pointerIsDown;t=t||n.now()-n.prevTouchTime<500||0===r.timeStamp}if(!t){const e={pointer:r,pointerId:o.getPointerId(r),pointerType:s,eventType:r.type,curEventTarget:c,eventTarget:p,scope:n},t=a(e);l.push([e.pointer,e.eventTarget,e.curEventTarget,t])}}for(const[e,n,o,i]of l)i[t](e,r,n,o)}}function a(e){const{pointerType:t,scope:n}=e,o={interaction:s.search(e),searchDetails:e};return n.fire("interactions:find",o),o.interaction||n.interactions.new({pointerType:t})}function l({doc:e,scope:t,options:n},o){const{interactions:{docEvents:r},events:i}=t,s=i[o];t.browser.isIOS&&!n.events&&(n.events={passive:!1});for(const t in i.delegatedEvents)s(e,t,i.delegateListener),s(e,t,i.delegateUseCapture,!0);const p=n&&n.events;for(const{type:t,listener:n}of r)s(e,t,n,p)}const u={id:"core/interactions",install(o){const s={};for(const e of p)s[e]=c(e,o);const a=e.pEventTypes;let l;function u(){for(const e of o.interactions.list)if(e.pointerIsDown&&"touch"===e.pointerType&&!e._interacting)for(const t of e.pointers)o.documents.some((({doc:e})=>n(e,t.downTarget)))||e.removePointer(t.pointer,t.event)}l=t.PointerEvent?[{type:a.down,listener:u},{type:a.down,listener:s.pointerDown},{type:a.move,listener:s.pointerMove},{type:a.up,listener:s.pointerUp},{type:a.cancel,listener:s.pointerUp}]:[{type:"mousedown",listener:s.pointerDown},{type:"mousemove",listener:s.pointerMove},{type:"mouseup",listener:s.pointerUp},{type:"touchstart",listener:u},{type:"touchstart",listener:s.pointerDown},{type:"touchmove",listener:s.pointerMove},{type:"touchend",listener:s.pointerUp},{type:"touchcancel",listener:s.pointerUp}],l.push({type:"blur",listener(e){for(const t of o.interactions.list)t.documentBlur(e)}}),o.prevTouchTime=0,o.Interaction=class extends r{get pointerMoveTolerance(){return o.interactions.pointerMoveTolerance}set pointerMoveTolerance(e){o.interactions.pointerMoveTolerance=e}_now(){return o.now()}},o.interactions={list:[],new(e){e.scopeFire=(e,t)=>o.fire(e,t);const t=new o.Interaction(e);return o.interactions.list.push(t),t},listeners:s,docEvents:l,pointerMoveTolerance:1},o.usePlugin(i)},listeners:{"scope:add-document":e=>l(e,"add"),"scope:remove-document":e=>l(e,"remove"),"interactable:unset"({interactable:e},t){for(let n=t.interactions.list.length-1;n>=0;n--){const o=t.interactions.list[n];o.interactable===e&&(o.stop(),t.fire("interactions:destroy",{interaction:o}),o.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(n,1))}}},onDocSignal:l,doOnInteractions:c,methodNames:p};export default u; | ||
//# sourceMappingURL=interactions.prod.js.map |
@@ -56,9 +56,9 @@ /** @module interact */ | ||
interact.version = "1.10.2"; | ||
interact.version = "1.10.3"; | ||
interact.scope = scope; | ||
/** | ||
* Use a plugin | ||
* | ||
* @alias module:interact.use | ||
* | ||
* Use a plugin | ||
* | ||
* @alias module:interact.use | ||
* | ||
*/ | ||
@@ -65,0 +65,0 @@ |
@@ -1,2 +0,2 @@ | ||
import t from"../utils/browser.prod.js";import*as e from"../utils/domUtils.prod.js";import o from"../utils/is.prod.js";import*as s from"../utils/pointerUtils.prod.js";import{warnOnce as n}from"../utils/misc.prod.js";import i from"./isNonNativeEvent.prod.js";export function createInteractStatic(r){const c=(t,e)=>{let o=r.interactables.get(t,e);return o||(o=r.interactables.new(t,e),o.events.global=c.globalEvents),o};return c.getPointerAverage=s.pointerAverage,c.getTouchBBox=s.touchBBox,c.getTouchDistance=s.touchDistance,c.getTouchAngle=s.touchAngle,c.getElementRect=e.getElementRect,c.getElementClientRect=e.getElementClientRect,c.matchesSelector=e.matchesSelector,c.closest=e.closest,c.globalEvents={},c.version="1.10.2",c.scope=r,c.use=function(t,e){return this.scope.usePlugin(t,e),this},c.isSet=function(t,e){return!!this.scope.interactables.get(t,e&&e.context)},c.on=n((function(t,e,s){if(o.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),o.array(t)){for(const o of t)this.on(o,e,s);return this}if(o.object(t)){for(const o in t)this.on(o,t[o],e);return this}return i(t,this.scope.actions)?this.globalEvents[t]?this.globalEvents[t].push(e):this.globalEvents[t]=[e]:this.scope.events.add(this.scope.document,t,e,{options:s}),this}),"The interact.on() method is being deprecated"),c.off=n((function(t,e,s){if(o.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),o.array(t)){for(const o of t)this.off(o,e,s);return this}if(o.object(t)){for(const o in t)this.off(o,t[o],e);return this}if(i(t,this.scope.actions)){let o;t in this.globalEvents&&-1!==(o=this.globalEvents[t].indexOf(e))&&this.globalEvents[t].splice(o,1)}else this.scope.events.remove(this.scope.document,t,e,s);return this}),"The interact.off() method is being deprecated"),c.debug=function(){return this.scope},c.supportsTouch=()=>t.supportsTouch,c.supportsPointerEvent=()=>t.supportsPointerEvent,c.stop=function(){for(const t of this.scope.interactions.list)t.stop();return this},c.pointerMoveTolerance=function(t){return o.number(t)?(this.scope.interactions.pointerMoveTolerance=t,this):this.scope.interactions.pointerMoveTolerance},c.addDocument=function(t,e){this.scope.addDocument(t,e)},c.removeDocument=function(t){this.scope.removeDocument(t)},c} | ||
import t from"../utils/browser.prod.js";import*as e from"../utils/domUtils.prod.js";import o from"../utils/is.prod.js";import*as s from"../utils/pointerUtils.prod.js";import{warnOnce as n}from"../utils/misc.prod.js";import i from"./isNonNativeEvent.prod.js";export function createInteractStatic(r){const c=(t,e)=>{let o=r.interactables.get(t,e);return o||(o=r.interactables.new(t,e),o.events.global=c.globalEvents),o};return c.getPointerAverage=s.pointerAverage,c.getTouchBBox=s.touchBBox,c.getTouchDistance=s.touchDistance,c.getTouchAngle=s.touchAngle,c.getElementRect=e.getElementRect,c.getElementClientRect=e.getElementClientRect,c.matchesSelector=e.matchesSelector,c.closest=e.closest,c.globalEvents={},c.version="1.10.3",c.scope=r,c.use=function(t,e){return this.scope.usePlugin(t,e),this},c.isSet=function(t,e){return!!this.scope.interactables.get(t,e&&e.context)},c.on=n((function(t,e,s){if(o.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),o.array(t)){for(const o of t)this.on(o,e,s);return this}if(o.object(t)){for(const o in t)this.on(o,t[o],e);return this}return i(t,this.scope.actions)?this.globalEvents[t]?this.globalEvents[t].push(e):this.globalEvents[t]=[e]:this.scope.events.add(this.scope.document,t,e,{options:s}),this}),"The interact.on() method is being deprecated"),c.off=n((function(t,e,s){if(o.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),o.array(t)){for(const o of t)this.off(o,e,s);return this}if(o.object(t)){for(const o in t)this.off(o,t[o],e);return this}if(i(t,this.scope.actions)){let o;t in this.globalEvents&&-1!==(o=this.globalEvents[t].indexOf(e))&&this.globalEvents[t].splice(o,1)}else this.scope.events.remove(this.scope.document,t,e,s);return this}),"The interact.off() method is being deprecated"),c.debug=function(){return this.scope},c.supportsTouch=()=>t.supportsTouch,c.supportsPointerEvent=()=>t.supportsPointerEvent,c.stop=function(){for(const t of this.scope.interactions.list)t.stop();return this},c.pointerMoveTolerance=function(t){return o.number(t)?(this.scope.interactions.pointerMoveTolerance=t,this):this.scope.interactions.pointerMoveTolerance},c.addDocument=function(t,e){this.scope.addDocument(t,e)},c.removeDocument=function(t){this.scope.removeDocument(t)},c} | ||
//# sourceMappingURL=interactStatic.prod.js.map |
{ | ||
"name": "@interactjs/core", | ||
"version": "1.10.2", | ||
"version": "1.10.3", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"@interactjs/utils": "1.10.2" | ||
"@interactjs/utils": "1.10.3" | ||
}, | ||
@@ -8,0 +8,0 @@ "publishConfig": { |
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
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
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
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
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
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
415256
2398