@interactjs/core
Advanced tools
Comparing version 1.9.5 to 1.9.6
@@ -0,3 +1,3 @@ | ||
import Eventable from './Eventable'; | ||
import { Defaults, Options } from './defaultOptions'; | ||
import Eventable from './Eventable'; | ||
import { Actions } from './scope'; | ||
@@ -4,0 +4,0 @@ declare type IgnoreValue = string | Interact.Element | boolean; |
import * as utils from '@interactjs/utils/index'; | ||
import InteractEvent, { EventPhase } from './InteractEvent'; | ||
import Interactable from './Interactable'; | ||
import InteractEvent, { EventPhase } from './InteractEvent'; | ||
import PointerInfo from './PointerInfo'; | ||
@@ -5,0 +5,0 @@ import { ActionName } from './scope'; |
@@ -7,5 +7,5 @@ import browser from "../utils/browser.js"; | ||
import InteractionBase from "./Interaction.js"; | ||
import interactablePreventDefault from "./interactablePreventDefault.js"; | ||
import finder from "./interactionFinder.js"; | ||
import Scope from "./scope.js"; | ||
import interactablePreventDefault from "./interactablePreventDefault.js"; | ||
const methodNames = ['pointerDown', 'pointerMove', 'pointerUp', 'updatePointer', 'removePointer', 'windowBlur']; | ||
@@ -12,0 +12,0 @@ |
@@ -1,2 +0,2 @@ | ||
import e from"../utils/browser.min.js";import t from"../utils/domObjects.min.js";import{nodeContains as n}from"../utils/domUtils.min.js";import o from"../utils/events.min.js";import*as r from"../utils/pointerUtils.min.js";import i from"./Interaction.min.js";import s from"./interactionFinder.min.js";import p from"./scope.min.js";import c from"./interactablePreventDefault.min.js";const a=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function l(t,n){return o=>{const i=n.interactions.list,s=r.getPointerType(o),[p,c]=r.getEventTargets(o),a=[];if(/^touch/.test(o.type)){n.prevTouchTime=n.now();for(const e of o.changedTouches){const t=e,i={pointer:t,pointerId:r.getPointerId(t),pointerType:s,eventType:o.type,eventTarget:p,curEventTarget:c,scope:n},l=u(i);a.push([i.pointer,i.eventTarget,i.curEventTarget,l])}}else{let t=!1;if(!e.supportsPointerEvent&&/mouse/.test(o.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===o.timeStamp}if(!t){const e={pointer:o,pointerId:r.getPointerId(o),pointerType:s,eventType:o.type,curEventTarget:c,eventTarget:p,scope:n},t=u(e);a.push([e.pointer,e.eventTarget,e.curEventTarget,t])}}for(const[e,n,r,i]of a)i[t](e,o,n,r)}}function u(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 m({doc:e,scope:t,options:n},r){const{docEvents:i}=t.interactions,s=o[r];t.browser.isIOS&&!n.events&&(n.events={passive:!1});for(const t in o.delegatedEvents)s(e,t,o.delegateListener),s(e,t,o.delegateUseCapture,!0);const p=n&&n.events;for(const{type:t,listener:n}of i)s(e,t,n,p)}const v={id:"core/interactions",install(o){const r={};for(const e of a)r[e]=l(e,o);const s=e.pEventTypes;let p;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)}p=t.PointerEvent?[{type:s.down,listener:u},{type:s.down,listener:r.pointerDown},{type:s.move,listener:r.pointerMove},{type:s.up,listener:r.pointerUp},{type:s.cancel,listener:r.pointerUp}]:[{type:"mousedown",listener:r.pointerDown},{type:"mousemove",listener:r.pointerMove},{type:"mouseup",listener:r.pointerUp},{type:"touchstart",listener:u},{type:"touchstart",listener:r.pointerDown},{type:"touchmove",listener:r.pointerMove},{type:"touchend",listener:r.pointerUp},{type:"touchcancel",listener:r.pointerUp}],p.push({type:"blur",listener(e){for(const t of o.interactions.list)t.documentBlur(e)}}),o.prevTouchTime=0,o.Interaction=class extends i{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:r,docEvents:p,pointerMoveTolerance:1},o.usePlugin(c)},listeners:{"scope:add-document"(e){return m(e,"add")},"scope:remove-document"(e){return m(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:m,doOnInteractions:l,methodNames:a};export default v; | ||
import e from"../utils/browser.min.js";import t from"../utils/domObjects.min.js";import{nodeContains as n}from"../utils/domUtils.min.js";import o from"../utils/events.min.js";import*as r from"../utils/pointerUtils.min.js";import i from"./Interaction.min.js";import s from"./interactablePreventDefault.min.js";import p from"./interactionFinder.min.js";import c from"./scope.min.js";const a=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function l(t,n){return o=>{const i=n.interactions.list,s=r.getPointerType(o),[p,c]=r.getEventTargets(o),a=[];if(/^touch/.test(o.type)){n.prevTouchTime=n.now();for(const e of o.changedTouches){const t=e,i={pointer:t,pointerId:r.getPointerId(t),pointerType:s,eventType:o.type,eventTarget:p,curEventTarget:c,scope:n},l=u(i);a.push([i.pointer,i.eventTarget,i.curEventTarget,l])}}else{let t=!1;if(!e.supportsPointerEvent&&/mouse/.test(o.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===o.timeStamp}if(!t){const e={pointer:o,pointerId:r.getPointerId(o),pointerType:s,eventType:o.type,curEventTarget:c,eventTarget:p,scope:n},t=u(e);a.push([e.pointer,e.eventTarget,e.curEventTarget,t])}}for(const[e,n,r,i]of a)i[t](e,o,n,r)}}function u(e){const{pointerType:t,scope:n}=e,o={interaction:p.search(e),searchDetails:e};return n.fire("interactions:find",o),o.interaction||n.interactions.new({pointerType:t})}function m({doc:e,scope:t,options:n},r){const{docEvents:i}=t.interactions,s=o[r];t.browser.isIOS&&!n.events&&(n.events={passive:!1});for(const t in o.delegatedEvents)s(e,t,o.delegateListener),s(e,t,o.delegateUseCapture,!0);const p=n&&n.events;for(const{type:t,listener:n}of i)s(e,t,n,p)}const v={id:"core/interactions",install(o){const r={};for(const e of a)r[e]=l(e,o);const p=e.pEventTypes;let c;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)}c=t.PointerEvent?[{type:p.down,listener:u},{type:p.down,listener:r.pointerDown},{type:p.move,listener:r.pointerMove},{type:p.up,listener:r.pointerUp},{type:p.cancel,listener:r.pointerUp}]:[{type:"mousedown",listener:r.pointerDown},{type:"mousemove",listener:r.pointerMove},{type:"mouseup",listener:r.pointerUp},{type:"touchstart",listener:u},{type:"touchstart",listener:r.pointerDown},{type:"touchmove",listener:r.pointerMove},{type:"touchend",listener:r.pointerUp},{type:"touchcancel",listener:r.pointerUp}],c.push({type:"blur",listener(e){for(const t of o.interactions.list)t.documentBlur(e)}}),o.prevTouchTime=0,o.Interaction=class extends i{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:r,docEvents:c,pointerMoveTolerance:1},o.usePlugin(s)},listeners:{"scope:add-document"(e){return m(e,"add")},"scope:remove-document"(e){return m(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:m,doOnInteractions:l,methodNames:a};export default v; | ||
//# sourceMappingURL=interactions.min.js.map |
/** @module interact */ | ||
import * as utils from '@interactjs/utils/index'; | ||
import Interactable from './Interactable'; | ||
import { Options } from './defaultOptions'; | ||
import Interactable from './Interactable'; | ||
import * as utils from '@interactjs/utils/index'; | ||
export interface InteractStatic { | ||
@@ -19,3 +19,3 @@ (target: Interact.Target, options?: Options): Interactable; | ||
globalEvents: any; | ||
dynamicDrop: (newValue?: boolean) => boolean | Interact.interact; | ||
dynamicDrop: (newValue?: boolean) => boolean | this; | ||
version: string; | ||
@@ -22,0 +22,0 @@ interact: InteractStatic; |
/** @module interact */ | ||
import { isNonNativeEvent } from "./scope.js"; | ||
import browser from "../utils/browser.js"; | ||
import events from "../utils/events.js"; | ||
import * as utils from "../utils/index.js"; | ||
import { isNonNativeEvent } from "./scope.js"; | ||
export class InteractStatic { | ||
@@ -21,3 +21,3 @@ // expose the functions used to calculate multi-touch properties | ||
this.dynamicDrop = void 0; | ||
this.version = "1.9.5"; | ||
this.version = "1.9.6"; | ||
this.interact = void 0; | ||
@@ -24,0 +24,0 @@ const { |
@@ -1,2 +0,2 @@ | ||
import{isNonNativeEvent as t}from"./scope.min.js";import e from"../utils/browser.min.js";import s from"../utils/events.min.js";import*as o from"../utils/index.min.js";export class InteractStatic{constructor(t){this.scope=t,this.getPointerAverage=o.pointer.pointerAverage,this.getTouchBBox=o.pointer.touchBBox,this.getTouchDistance=o.pointer.touchDistance,this.getTouchAngle=o.pointer.touchAngle,this.getElementRect=o.dom.getElementRect,this.getElementClientRect=o.dom.getElementClientRect,this.matchesSelector=o.dom.matchesSelector,this.closest=o.dom.closest,this.globalEvents={},this.dynamicDrop=void 0,this.version="1.9.5",this.interact=void 0;const{prototype:e}=this.constructor,s=(e,s)=>{let o=t.interactables.get(e,s);return o||(o=t.interactables.new(e,s),o.events.global=this.globalEvents),o};for(const t of Object.getOwnPropertyNames(this.constructor.prototype))s[t]=e[t];return o.extend(s,this),s.constructor=this.constructor,this.interact=s,s}use(t,e){return this.scope.usePlugin(t,e),this}isSet(t,e){return!!this.scope.interactables.get(t,e&&e.context)}on(e,i,r){if(o.is.string(e)&&-1!==e.search(" ")&&(e=e.trim().split(/ +/)),o.is.array(e)){for(const t of e)this.on(t,i,r);return this}if(o.is.object(e)){for(const t in e)this.on(t,e[t],i);return this}return t(e,this.scope.actions)?this.globalEvents[e]?this.globalEvents[e].push(i):this.globalEvents[e]=[i]:s.add(this.scope.document,e,i,{options:r}),this}off(e,i,r){if(o.is.string(e)&&-1!==e.search(" ")&&(e=e.trim().split(/ +/)),o.is.array(e)){for(const t of e)this.off(t,i,r);return this}if(o.is.object(e)){for(const t in e)this.off(t,e[t],i);return this}if(t(e,this.scope.actions)){let t;e in this.globalEvents&&-1!==(t=this.globalEvents[e].indexOf(i))&&this.globalEvents[e].splice(t,1)}else s.remove(this.scope.document,e,i,r);return this}debug(){return this.scope}supportsTouch(){return e.supportsTouch}supportsPointerEvent(){return e.supportsPointerEvent}stop(){for(const t of this.scope.interactions.list)t.stop();return this}pointerMoveTolerance(t){return o.is.number(t)?(this.scope.interactions.pointerMoveTolerance=t,this):this.scope.interactions.pointerMoveTolerance}addDocument(t,e){this.scope.addDocument(t,e)}removeDocument(t){this.scope.removeDocument(t)}}export default InteractStatic; | ||
import t from"../utils/browser.min.js";import e from"../utils/events.min.js";import*as s from"../utils/index.min.js";import{isNonNativeEvent as o}from"./scope.min.js";export class InteractStatic{constructor(t){this.scope=t,this.getPointerAverage=s.pointer.pointerAverage,this.getTouchBBox=s.pointer.touchBBox,this.getTouchDistance=s.pointer.touchDistance,this.getTouchAngle=s.pointer.touchAngle,this.getElementRect=s.dom.getElementRect,this.getElementClientRect=s.dom.getElementClientRect,this.matchesSelector=s.dom.matchesSelector,this.closest=s.dom.closest,this.globalEvents={},this.dynamicDrop=void 0,this.version="1.9.6",this.interact=void 0;const{prototype:e}=this.constructor,o=(e,s)=>{let o=t.interactables.get(e,s);return o||(o=t.interactables.new(e,s),o.events.global=this.globalEvents),o};for(const t of Object.getOwnPropertyNames(this.constructor.prototype))o[t]=e[t];return s.extend(o,this),o.constructor=this.constructor,this.interact=o,o}use(t,e){return this.scope.usePlugin(t,e),this}isSet(t,e){return!!this.scope.interactables.get(t,e&&e.context)}on(t,i,r){if(s.is.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),s.is.array(t)){for(const e of t)this.on(e,i,r);return this}if(s.is.object(t)){for(const e in t)this.on(e,t[e],i);return this}return o(t,this.scope.actions)?this.globalEvents[t]?this.globalEvents[t].push(i):this.globalEvents[t]=[i]:e.add(this.scope.document,t,i,{options:r}),this}off(t,i,r){if(s.is.string(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),s.is.array(t)){for(const e of t)this.off(e,i,r);return this}if(s.is.object(t)){for(const e in t)this.off(e,t[e],i);return this}if(o(t,this.scope.actions)){let e;t in this.globalEvents&&-1!==(e=this.globalEvents[t].indexOf(i))&&this.globalEvents[t].splice(e,1)}else e.remove(this.scope.document,t,i,r);return this}debug(){return this.scope}supportsTouch(){return t.supportsTouch}supportsPointerEvent(){return t.supportsPointerEvent}stop(){for(const t of this.scope.interactions.list)t.stop();return this}pointerMoveTolerance(t){return s.is.number(t)?(this.scope.interactions.pointerMoveTolerance=t,this):this.scope.interactions.pointerMoveTolerance}addDocument(t,e){this.scope.addDocument(t,e)}removeDocument(t){this.scope.removeDocument(t)}}export default InteractStatic; | ||
//# sourceMappingURL=InteractStatic.min.js.map |
{ | ||
"name": "@interactjs/core", | ||
"version": "1.9.5", | ||
"version": "1.9.6", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"@interactjs/dev-tools": "1.9.5", | ||
"@interactjs/utils": "1.9.5" | ||
"@interactjs/dev-tools": "1.9.6", | ||
"@interactjs/utils": "1.9.6" | ||
}, | ||
"devDependencies": { | ||
"@interactjs/_dev": "1.9.5", | ||
"@interactjs/actions": "1.9.5", | ||
"@interactjs/auto-start": "1.9.5" | ||
"@interactjs/_dev": "1.9.6", | ||
"@interactjs/actions": "1.9.6", | ||
"@interactjs/auto-start": "1.9.6" | ||
}, | ||
@@ -17,3 +17,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "cb94f9a0" | ||
"gitHead": "8666b4e3" | ||
} |
import * as utils from '@interactjs/utils/index'; | ||
import Eventable from './Eventable'; | ||
import InteractEvent, { PhaseMap } from './InteractEvent'; | ||
import InteractStatic from './InteractStatic'; | ||
import InteractableBase from './Interactable'; | ||
import InteractableSet from './InteractableSet'; | ||
import InteractEvent, { PhaseMap } from './InteractEvent'; | ||
import InteractStatic from './InteractStatic'; | ||
export interface SignalArgs { | ||
@@ -8,0 +8,0 @@ 'scope:add-document': DocSignalArg; |
import domObjects from "../utils/domObjects.js"; | ||
import * as utils from "../utils/index.js"; | ||
import defaults from "./defaultOptions.js"; | ||
import Eventable from "./Eventable.js"; | ||
import InteractEvent from "./InteractEvent.js"; | ||
import InteractStatic from "./InteractStatic.js"; | ||
import InteractableBase from "./Interactable.js"; | ||
import InteractableSet from "./InteractableSet.js"; | ||
import InteractEvent from "./InteractEvent.js"; | ||
import defaults from "./defaultOptions.js"; | ||
import interactions from "./interactions.js"; | ||
import InteractStatic from "./InteractStatic.js"; | ||
const { | ||
@@ -11,0 +11,0 @@ win, |
@@ -1,2 +0,2 @@ | ||
import t from"../utils/domObjects.min.js";import*as i from"../utils/index.min.js";import s from"./defaultOptions.min.js";import e from"./Eventable.min.js";import n from"./Interactable.min.js";import o from"./InteractableSet.min.js";import r from"./InteractEvent.min.js";import a from"./interactions.min.js";import d from"./InteractStatic.min.js";const{win:l,browser:h,raf:c,events:u}=i;export default class p{constructor(){this.id=`__interact_scope_${Math.floor(100*Math.random())}`,this.isInitialized=!1,this.listenerMaps=[],this.browser=h,this.events=u,this.utils=i,this.defaults=i.clone(s),this.Eventable=e,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=new d(this),this.InteractEvent=r,this.Interactable=void 0,this.interactables=new o(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=t=>this.removeDocument(t.target);const t=this;this.Interactable=class extends n{get _defaults(){return t.defaults}set(i){return super.set(i),t.fire("interactable:set",{options:i,interactable:this}),this}unset(){super.unset(),t.interactables.list.splice(t.interactables.list.indexOf(this),1),t.fire("interactable:unset",{interactable:this})}}}addListeners(t,i){this.listenerMaps.push({id:i,map:t})}fire(t,i){for(const{map:{[t]:s}}of this.listenerMaps)if(s&&!1===s(i,this,t))return!1}init(t){return this.isInitialized?this:initScope(this,t)}pluginIsInstalled(t){return this._plugins.map[t.id]||-1!==this._plugins.list.indexOf(t)}usePlugin(t,i){if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,i),t.listeners&&t.before){let i=0;const s=this.listenerMaps.length,e=t.before.reduce((t,i)=>(t[i]=!0,t),{});for(;i<s;i++){if(e[this.listenerMaps[i].id])break}this.listenerMaps.splice(i,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}addDocument(t,s){if(-1!==this.getDocIndex(t))return!1;const e=l.getWindow(t);s=s?i.extend({},s):{},this.documents.push({doc:t,options:s}),u.documents.push(t),t!==this.document&&u.add(e,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:e,scope:this,options:s})}removeDocument(t){const i=this.getDocIndex(t),s=l.getWindow(t),e=this.documents[i].options;u.remove(s,"unload",this.onWindowUnload),this.documents.splice(i,1),u.documents.splice(i,1),this.fire("scope:remove-document",{doc:t,window:s,scope:this,options:e})}getDocIndex(t){for(let i=0;i<this.documents.length;i++)if(this.documents[i].doc===t)return i;return-1}getDocOptions(t){const i=this.getDocIndex(t);return-1===i?null:this.documents[i].options}now(){return(this.window.Date||Date).now()}}export function isNonNativeEvent(t,i){if(i.phaselessTypes[t])return!0;for(const s in i.map)if(0===t.indexOf(s)&&t.substr(s.length)in i.phases)return!0;return!1}export function initScope(i,s){return i.isInitialized=!0,l.init(s),t.init(s),h.init(s),c.init(s),u.init(s),i.usePlugin(a),i.document=s.document,i.window=s,i}export{p as Scope}; | ||
import t from"../utils/domObjects.min.js";import*as i from"../utils/index.min.js";import s from"./Eventable.min.js";import e from"./InteractEvent.min.js";import n from"./InteractStatic.min.js";import o from"./Interactable.min.js";import r from"./InteractableSet.min.js";import a from"./defaultOptions.min.js";import d from"./interactions.min.js";const{win:l,browser:h,raf:c,events:u}=i;export default class p{constructor(){this.id=`__interact_scope_${Math.floor(100*Math.random())}`,this.isInitialized=!1,this.listenerMaps=[],this.browser=h,this.events=u,this.utils=i,this.defaults=i.clone(a),this.Eventable=s,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=new n(this),this.InteractEvent=e,this.Interactable=void 0,this.interactables=new r(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=t=>this.removeDocument(t.target);const t=this;this.Interactable=class extends o{get _defaults(){return t.defaults}set(i){return super.set(i),t.fire("interactable:set",{options:i,interactable:this}),this}unset(){super.unset(),t.interactables.list.splice(t.interactables.list.indexOf(this),1),t.fire("interactable:unset",{interactable:this})}}}addListeners(t,i){this.listenerMaps.push({id:i,map:t})}fire(t,i){for(const{map:{[t]:s}}of this.listenerMaps)if(s&&!1===s(i,this,t))return!1}init(t){return this.isInitialized?this:initScope(this,t)}pluginIsInstalled(t){return this._plugins.map[t.id]||-1!==this._plugins.list.indexOf(t)}usePlugin(t,i){if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,i),t.listeners&&t.before){let i=0;const s=this.listenerMaps.length,e=t.before.reduce((t,i)=>(t[i]=!0,t),{});for(;i<s;i++){if(e[this.listenerMaps[i].id])break}this.listenerMaps.splice(i,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}addDocument(t,s){if(-1!==this.getDocIndex(t))return!1;const e=l.getWindow(t);s=s?i.extend({},s):{},this.documents.push({doc:t,options:s}),u.documents.push(t),t!==this.document&&u.add(e,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:e,scope:this,options:s})}removeDocument(t){const i=this.getDocIndex(t),s=l.getWindow(t),e=this.documents[i].options;u.remove(s,"unload",this.onWindowUnload),this.documents.splice(i,1),u.documents.splice(i,1),this.fire("scope:remove-document",{doc:t,window:s,scope:this,options:e})}getDocIndex(t){for(let i=0;i<this.documents.length;i++)if(this.documents[i].doc===t)return i;return-1}getDocOptions(t){const i=this.getDocIndex(t);return-1===i?null:this.documents[i].options}now(){return(this.window.Date||Date).now()}}export function isNonNativeEvent(t,i){if(i.phaselessTypes[t])return!0;for(const s in i.map)if(0===t.indexOf(s)&&t.substr(s.length)in i.phases)return!0;return!1}export function initScope(i,s){return i.isInitialized=!0,l.init(s),t.init(s),h.init(s),c.init(s),u.init(s),i.usePlugin(d),i.document=s.document,i.window=s,i}export{p as Scope}; | ||
//# sourceMappingURL=scope.min.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
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
403796