@interactjs/utils
Advanced tools
Comparing version 1.10.8 to 1.10.9
import domObjects from "./domObjects.js"; | ||
import is from "./is.js"; | ||
import * as win from "./window.js"; | ||
const browser = { | ||
@@ -19,3 +18,3 @@ init, | ||
const Element = domObjects.Element; | ||
const navigator = win.window.navigator; // Does the browser support touch input? | ||
const navigator = window.navigator || {}; // Does the browser support touch input? | ||
@@ -49,3 +48,3 @@ browser.supportsTouch = 'ontouchstart' in window || is.func(window.DocumentTouch) && domObjects.document instanceof window.DocumentTouch; // Does the browser support PointerEvents | ||
browser.wheelEvent = 'onmousewheel' in domObjects.document ? 'mousewheel' : 'wheel'; | ||
browser.wheelEvent = domObjects.document && 'onmousewheel' in domObjects.document ? 'mousewheel' : 'wheel'; | ||
} | ||
@@ -52,0 +51,0 @@ |
@@ -1,2 +0,2 @@ | ||
import e from"./domObjects.prod.js";import o from"./is.prod.js";import*as t from"./window.prod.js";const n={init(r){const s=e.Element,p=t.window.navigator;n.supportsTouch="ontouchstart"in r||o.func(r.DocumentTouch)&&e.document instanceof r.DocumentTouch,n.supportsPointerEvent=!1!==p.pointerEnabled&&!!e.PointerEvent,n.isIOS=/iP(hone|od|ad)/.test(p.platform),n.isIOS7=/iP(hone|od|ad)/.test(p.platform)&&/OS 7[^\d]/.test(p.appVersion),n.isIe9=/MSIE 9/.test(p.userAgent),n.isOperaMobile="Opera"===p.appName&&n.supportsTouch&&/Presto/.test(p.userAgent),n.prefixedMatchesSelector="matches"in s.prototype?"matches":"webkitMatchesSelector"in s.prototype?"webkitMatchesSelector":"mozMatchesSelector"in s.prototype?"mozMatchesSelector":"oMatchesSelector"in s.prototype?"oMatchesSelector":"msMatchesSelector",n.pEventTypes=n.supportsPointerEvent?e.PointerEvent===r.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,n.wheelEvent="onmousewheel"in e.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null};export default n; | ||
import e from"./domObjects.prod.js";import t from"./is.prod.js";const o={init(n){const r=e.Element,s=n.navigator||{};o.supportsTouch="ontouchstart"in n||t.func(n.DocumentTouch)&&e.document instanceof n.DocumentTouch,o.supportsPointerEvent=!1!==s.pointerEnabled&&!!e.PointerEvent,o.isIOS=/iP(hone|od|ad)/.test(s.platform),o.isIOS7=/iP(hone|od|ad)/.test(s.platform)&&/OS 7[^\d]/.test(s.appVersion),o.isIe9=/MSIE 9/.test(s.userAgent),o.isOperaMobile="Opera"===s.appName&&o.supportsTouch&&/Presto/.test(s.userAgent),o.prefixedMatchesSelector="matches"in r.prototype?"matches":"webkitMatchesSelector"in r.prototype?"webkitMatchesSelector":"mozMatchesSelector"in r.prototype?"mozMatchesSelector":"oMatchesSelector"in r.prototype?"oMatchesSelector":"msMatchesSelector",o.pEventTypes=o.supportsPointerEvent?e.PointerEvent===n.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,o.wheelEvent=e.document&&"onmousewheel"in e.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null};export default o; | ||
//# sourceMappingURL=browser.prod.js.map |
{ | ||
"name": "@interactjs/utils", | ||
"version": "1.10.8", | ||
"version": "1.10.9", | ||
"peerDependencies": {}, | ||
@@ -8,7 +8,4 @@ "publishConfig": { | ||
}, | ||
"sideEffects": [ | ||
"**/index.js", | ||
"**/index.prod.js" | ||
], | ||
"sideEffects": false, | ||
"license": "MIT" | ||
} |
16
raf.js
@@ -5,5 +5,5 @@ let lastTime = 0; | ||
function init(window) { | ||
request = window.requestAnimationFrame; | ||
cancel = window.cancelAnimationFrame; | ||
function init(global) { | ||
request = global.requestAnimationFrame; | ||
cancel = global.cancelAnimationFrame; | ||
@@ -14,9 +14,9 @@ if (!request) { | ||
for (const vendor of vendors) { | ||
request = window[`${vendor}RequestAnimationFrame`]; | ||
cancel = window[`${vendor}CancelAnimationFrame`] || window[`${vendor}CancelRequestAnimationFrame`]; | ||
request = global[`${vendor}RequestAnimationFrame`]; | ||
cancel = global[`${vendor}CancelAnimationFrame`] || global[`${vendor}CancelRequestAnimationFrame`]; | ||
} | ||
} | ||
request = request && request.bind(window); | ||
cancel = cancel && cancel.bind(window); | ||
request = request && request.bind(global); | ||
cancel = cancel && cancel.bind(global); | ||
@@ -27,3 +27,3 @@ if (!request) { | ||
const timeToCall = Math.max(0, 16 - (currTime - lastTime)); | ||
const token = window.setTimeout(() => { | ||
const token = global.setTimeout(() => { | ||
// eslint-disable-next-line node/no-callback-literal | ||
@@ -30,0 +30,0 @@ callback(currTime + timeToCall); |
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
164340
850