@interactjs/utils
Advanced tools
Comparing version 1.10.13 to 1.10.14
@@ -21,2 +21,3 @@ import domObjects from "./domObjects.js"; | ||
browser.supportsTouch = 'ontouchstart' in window || is.func(window.DocumentTouch) && domObjects.document instanceof window.DocumentTouch; // Does the browser support PointerEvents | ||
// https://github.com/taye/interact.js/issues/703#issuecomment-471570492 | ||
@@ -23,0 +24,0 @@ browser.supportsPointerEvent = navigator.pointerEnabled !== false && !!domObjects.PointerEvent; |
import type { Rect, Target, Element } from '@interactjs/core/types'; | ||
export declare function nodeContains(parent: Node, child: Node): boolean; | ||
export declare function closest(element: Node, selector: string): Element; | ||
export declare function closest(element: Node, selector: string): HTMLElement | SVGElement; | ||
export declare function parentNode(node: Node | Document): ParentNode; | ||
@@ -5,0 +5,0 @@ export declare function matchesSelector(element: Element, selector: string): boolean; |
@@ -1,2 +0,1 @@ | ||
import type { Element } from '@interactjs/core/types'; | ||
declare const _default: { | ||
@@ -12,3 +11,3 @@ window: (thing: any) => thing is Window; | ||
string: (thing: any) => thing is string; | ||
element: (thing: any) => thing is Element; | ||
element: (thing: any) => thing is HTMLElement | SVGElement; | ||
plainObject: (thing: any) => thing is { | ||
@@ -15,0 +14,0 @@ [index: string]: any; |
@@ -21,9 +21,7 @@ import isWindow from "./isWindow.js"; | ||
return false; | ||
} // eslint-disable-next-line import/no-named-as-default-member | ||
} | ||
const _window = win.getWindow(thing) || win.window; | ||
return /object|function/.test(typeof _window.Element) ? thing instanceof _window.Element // DOM2 | ||
: thing.nodeType === 1 && typeof thing.nodeName === 'string'; | ||
return /object|function/.test(typeof Element) ? thing instanceof Element || thing instanceof _window.Element : thing.nodeType === 1 && typeof thing.nodeName === 'string'; | ||
}; | ||
@@ -30,0 +28,0 @@ |
@@ -1,2 +0,2 @@ | ||
import o from"./isWindow.prod.js";import*as t from"./window.prod.js";const e=o=>!!o&&"object"==typeof o,n=o=>"function"==typeof o;export default{window:e=>e===t.window||o(e),docFrag:o=>e(o)&&11===o.nodeType,object:e,func:n,number:o=>"number"==typeof o,bool:o=>"boolean"==typeof o,string:o=>"string"==typeof o,element(o){if(!o||"object"!=typeof o)return!1;const e=t.getWindow(o)||t.window;return/object|function/.test(typeof e.Element)?o instanceof e.Element:1===o.nodeType&&"string"==typeof o.nodeName},plainObject:o=>e(o)&&!!o.constructor&&/function Object\b/.test(o.constructor.toString()),array:o=>e(o)&&void 0!==o.length&&n(o.splice)}; | ||
import o from"./isWindow.prod.js";import*as t from"./window.prod.js";const e=o=>!!o&&"object"==typeof o,n=o=>"function"==typeof o;export default{window:e=>e===t.window||o(e),docFrag:o=>e(o)&&11===o.nodeType,object:e,func:n,number:o=>"number"==typeof o,bool:o=>"boolean"==typeof o,string:o=>"string"==typeof o,element(o){if(!o||"object"!=typeof o)return!1;const e=t.getWindow(o)||t.window;return/object|function/.test(typeof Element)?o instanceof Element||o instanceof e.Element:1===o.nodeType&&"string"==typeof o.nodeName},plainObject:o=>e(o)&&!!o.constructor&&/function Object\b/.test(o.constructor.toString()),array:o=>e(o)&&void 0!==o.length&&n(o.splice)}; | ||
//# sourceMappingURL=is.prod.js.map |
{ | ||
"name": "@interactjs/utils", | ||
"version": "1.10.13", | ||
"version": "1.10.14", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -1,7 +0,5 @@ | ||
declare function pointerExtend<T>(dest: Partial<T>, source: T): Partial<T>; | ||
declare namespace pointerExtend { | ||
var prefixedPropREs: { | ||
[prefix: string]: RegExp; | ||
}; | ||
} | ||
export default pointerExtend; | ||
export default function pointerExtend<T>(dest: Partial<T & { | ||
__set?: Partial<T>; | ||
}>, source: T): Partial<T & { | ||
__set?: Partial<T>; | ||
}>; |
@@ -1,15 +0,18 @@ | ||
function pointerExtend(dest, source) { | ||
export default function pointerExtend(dest, source) { | ||
dest.__set ||= {}; | ||
for (const prop in source) { | ||
const prefixedPropREs = pointerExtend.prefixedPropREs; | ||
let deprecated = false; // skip deprecated prefixed properties | ||
if (typeof dest[prop] !== 'function' && prop !== '__set') { | ||
Object.defineProperty(dest, prop, { | ||
get() { | ||
if (prop in dest.__set) return dest.__set[prop]; | ||
return dest.__set[prop] = source[prop]; | ||
}, | ||
for (const vendor in prefixedPropREs) { | ||
if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) { | ||
deprecated = true; | ||
break; | ||
} | ||
} | ||
set(value) { | ||
dest.__set[prop] = value; | ||
}, | ||
if (!deprecated && typeof source[prop] !== 'function') { | ||
dest[prop] = source[prop]; | ||
configurable: true | ||
}); | ||
} | ||
@@ -20,8 +23,2 @@ } | ||
} | ||
pointerExtend.prefixedPropREs = { | ||
webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/, | ||
moz: /(Pressure)$/ | ||
}; | ||
export default pointerExtend; | ||
//# sourceMappingURL=pointerExtend.js.map |
@@ -1,2 +0,2 @@ | ||
function e(o,t){for(const n in t){const r=e.prefixedPropREs;let i=!1;for(const e in r)if(0===n.indexOf(e)&&r[e].test(n)){i=!0;break}i||"function"==typeof t[n]||(o[n]=t[n])}return o}e.prefixedPropREs={webkit:/(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,moz:/(Pressure)$/};export default e; | ||
export default function e(e,t){e.__set||={};for(const _ in t)"function"!=typeof e[_]&&"__set"!==_&&Object.defineProperty(e,_,{get(){return _ in e.__set?e.__set[_]:e.__set[_]=t[_]},set(t){e.__set[_]=t},configurable:!0});return e} | ||
//# sourceMappingURL=pointerExtend.prod.js.map |
@@ -26,3 +26,3 @@ let lastTime = 0; | ||
const token = global.setTimeout(() => { | ||
// eslint-disable-next-line node/no-callback-literal | ||
// eslint-disable-next-line n/no-callback-literal | ||
callback(currTime + timeToCall); | ||
@@ -29,0 +29,0 @@ }, 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
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
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
170004
1059