@vkontakte/vkjs
Advanced tools
Comparing version 0.18.0 to 0.19.0
@@ -0,4 +1,6 @@ | ||
export { animate, animationEvent, transitionEvent, waitAnimationEnd, cancelWaitAnimationEnd, waitTransitionEnd, cancelWaitTransitionEnd } from './animate'; | ||
/** | ||
* classNames | ||
*/ | ||
export { classNames } from './classNames'; | ||
@@ -5,0 +7,0 @@ /** |
import { isIOS, isIPadOS } from './IOSDetections'; | ||
import { canUseDOM } from './dom'; | ||
var hasMouse; | ||
@@ -7,19 +8,26 @@ var hasTouchEvents; | ||
if (isIOS && !isIPadOS) { | ||
if (canUseDOM) { | ||
if (isIOS && !isIPadOS) { | ||
hasMouse = false; | ||
hasHover = false; | ||
hasTouchEvents = true; | ||
hasTouch = true; | ||
} else { | ||
hasTouchEvents = 'ontouchstart' in document; | ||
hasTouch = hasTouchEvents || 'maxTouchPoints' in navigator && navigator.maxTouchPoints > 0; | ||
if (hasTouch) { | ||
var notMobile = !/android|mobile|tablet/i.test(navigator.userAgent); | ||
hasMouse = window.matchMedia && matchMedia('(pointer)').matches ? matchMedia('(pointer: fine)').matches : notMobile; | ||
hasHover = hasMouse && (window.matchMedia && matchMedia('(hover)').matches ? matchMedia('(hover: hover)').matches : notMobile); | ||
} else { | ||
hasMouse = true; | ||
hasHover = true; | ||
} | ||
} | ||
} else { | ||
hasMouse = false; | ||
hasTouchEvents = false; | ||
hasHover = false; | ||
hasTouchEvents = true; | ||
hasTouch = true; | ||
} else { | ||
hasTouchEvents = 'ontouchstart' in document; | ||
hasTouch = hasTouchEvents || 'maxTouchPoints' in navigator && navigator.maxTouchPoints > 0; | ||
if (hasTouch) { | ||
var notMobile = !/android|mobile|tablet/i.test(navigator.userAgent); | ||
hasMouse = window.matchMedia && matchMedia('(pointer)').matches ? matchMedia('(pointer: fine)').matches : notMobile; | ||
hasHover = hasMouse && (window.matchMedia && matchMedia('(hover)').matches ? matchMedia('(hover: hover)').matches : notMobile); | ||
} else { | ||
hasMouse = true; | ||
hasHover = true; | ||
} | ||
hasTouch = false; | ||
} | ||
@@ -26,0 +34,0 @@ |
@@ -0,1 +1,2 @@ | ||
export { animate, animationEvent, transitionEvent, waitAnimationEnd, cancelWaitAnimationEnd, waitTransitionEnd, cancelWaitTransitionEnd, } from './animate'; | ||
export { classNames, } from './classNames'; | ||
@@ -18,3 +19,3 @@ export { copyTextToClipboard, } from './clipboard'; | ||
export { isObjectLike, isArray, isObject, isUndefined, isFunction, isFormData, isString, isNumber, } from './type_checkers'; | ||
export type { Dictionary, AnyFunction, Writeable, } from './types'; | ||
export type { Dictionary, AnyFunction, SupportEvent, TimeoutHandle, Writeable, } from './types'; | ||
export { localStorage, sessionStorage, } from './storage'; |
@@ -6,2 +6,44 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "animate", { | ||
enumerable: true, | ||
get: function get() { | ||
return _animate.animate; | ||
} | ||
}); | ||
Object.defineProperty(exports, "animationEvent", { | ||
enumerable: true, | ||
get: function get() { | ||
return _animate.animationEvent; | ||
} | ||
}); | ||
Object.defineProperty(exports, "transitionEvent", { | ||
enumerable: true, | ||
get: function get() { | ||
return _animate.transitionEvent; | ||
} | ||
}); | ||
Object.defineProperty(exports, "waitAnimationEnd", { | ||
enumerable: true, | ||
get: function get() { | ||
return _animate.waitAnimationEnd; | ||
} | ||
}); | ||
Object.defineProperty(exports, "cancelWaitAnimationEnd", { | ||
enumerable: true, | ||
get: function get() { | ||
return _animate.cancelWaitAnimationEnd; | ||
} | ||
}); | ||
Object.defineProperty(exports, "waitTransitionEnd", { | ||
enumerable: true, | ||
get: function get() { | ||
return _animate.waitTransitionEnd; | ||
} | ||
}); | ||
Object.defineProperty(exports, "cancelWaitTransitionEnd", { | ||
enumerable: true, | ||
get: function get() { | ||
return _animate.cancelWaitTransitionEnd; | ||
} | ||
}); | ||
Object.defineProperty(exports, "classNames", { | ||
@@ -308,2 +350,4 @@ enumerable: true, | ||
var _animate = require("./animate"); | ||
var _classNames = require("./classNames"); | ||
@@ -310,0 +354,0 @@ |
@@ -10,2 +10,4 @@ "use strict"; | ||
var _dom = require("./dom"); | ||
var hasMouse; | ||
@@ -20,20 +22,27 @@ exports.hasMouse = hasMouse; | ||
if (_IOSDetections.isIOS && !_IOSDetections.isIPadOS) { | ||
if (_dom.canUseDOM) { | ||
if (_IOSDetections.isIOS && !_IOSDetections.isIPadOS) { | ||
exports.hasMouse = hasMouse = false; | ||
exports.hasHover = hasHover = false; | ||
exports.hasTouchEvents = hasTouchEvents = true; | ||
exports.hasTouch = hasTouch = true; | ||
} else { | ||
exports.hasTouchEvents = hasTouchEvents = 'ontouchstart' in document; | ||
exports.hasTouch = hasTouch = hasTouchEvents || 'maxTouchPoints' in navigator && navigator.maxTouchPoints > 0; | ||
if (hasTouch) { | ||
var notMobile = !/android|mobile|tablet/i.test(navigator.userAgent); | ||
exports.hasMouse = hasMouse = window.matchMedia && matchMedia('(pointer)').matches ? matchMedia('(pointer: fine)').matches : notMobile; | ||
exports.hasHover = hasHover = hasMouse && (window.matchMedia && matchMedia('(hover)').matches ? matchMedia('(hover: hover)').matches : notMobile); | ||
} else { | ||
exports.hasMouse = hasMouse = true; | ||
exports.hasHover = hasHover = true; | ||
} | ||
} | ||
} else { | ||
exports.hasMouse = hasMouse = false; | ||
exports.hasTouchEvents = hasTouchEvents = false; | ||
exports.hasHover = hasHover = false; | ||
exports.hasTouchEvents = hasTouchEvents = true; | ||
exports.hasTouch = hasTouch = true; | ||
} else { | ||
exports.hasTouchEvents = hasTouchEvents = 'ontouchstart' in document; | ||
exports.hasTouch = hasTouch = hasTouchEvents || 'maxTouchPoints' in navigator && navigator.maxTouchPoints > 0; | ||
if (hasTouch) { | ||
var notMobile = !/android|mobile|tablet/i.test(navigator.userAgent); | ||
exports.hasMouse = hasMouse = window.matchMedia && matchMedia('(pointer)').matches ? matchMedia('(pointer: fine)').matches : notMobile; | ||
exports.hasHover = hasHover = hasMouse && (window.matchMedia && matchMedia('(hover)').matches ? matchMedia('(hover: hover)').matches : notMobile); | ||
} else { | ||
exports.hasMouse = hasMouse = true; | ||
exports.hasHover = hasHover = true; | ||
} | ||
exports.hasTouch = hasTouch = false; | ||
} | ||
//# sourceMappingURL=InputUtils.js.map |
@@ -5,4 +5,9 @@ export declare type Dictionary<T> = { | ||
export declare type AnyFunction = (...args: any[]) => any; | ||
export declare type SupportEvent<T extends keyof GlobalEventHandlersEventMap> = { | ||
supported: boolean; | ||
name: T; | ||
}; | ||
export declare type TimeoutHandle = number | undefined; | ||
export declare type Writeable<T> = { | ||
-readonly [P in keyof T]: T[P]; | ||
}; |
{ | ||
"name": "@vkontakte/vkjs", | ||
"version": "0.18.0", | ||
"version": "v0.19.0", | ||
"description": "VK shared JS libs", | ||
@@ -18,2 +18,3 @@ "main": "lib/index.js", | ||
"clear": "shx rm -rf lib", | ||
"prepare": "yarn build", | ||
"build": "yarn clear && yarn build-cjs && yarn build-es6", | ||
@@ -20,0 +21,0 @@ "test": "eslint ./src --ext .ts && tsc --noEmit", |
@@ -0,1 +1,11 @@ | ||
export { | ||
animate, | ||
animationEvent, | ||
transitionEvent, | ||
waitAnimationEnd, | ||
cancelWaitAnimationEnd, | ||
waitTransitionEnd, | ||
cancelWaitTransitionEnd, | ||
} from './animate'; | ||
/** | ||
@@ -130,2 +140,4 @@ * classNames | ||
AnyFunction, | ||
SupportEvent, | ||
TimeoutHandle, | ||
Writeable, | ||
@@ -132,0 +144,0 @@ } from './types'; |
import { isIOS, isIPadOS } from './IOSDetections'; | ||
import { canUseDOM } from './dom'; | ||
@@ -8,26 +9,33 @@ let hasMouse: boolean; | ||
if (isIOS && !isIPadOS) { | ||
hasMouse = false; | ||
hasHover = false; | ||
hasTouchEvents = true; | ||
hasTouch = true; | ||
} else { | ||
hasTouchEvents = 'ontouchstart' in document; | ||
hasTouch = hasTouchEvents || | ||
('maxTouchPoints' in navigator && navigator.maxTouchPoints > 0); | ||
if (canUseDOM) { | ||
if (isIOS && !isIPadOS) { | ||
hasMouse = false; | ||
hasHover = false; | ||
hasTouchEvents = true; | ||
hasTouch = true; | ||
} else { | ||
hasTouchEvents = 'ontouchstart' in document; | ||
hasTouch = hasTouchEvents || | ||
('maxTouchPoints' in navigator && navigator.maxTouchPoints > 0); | ||
if (hasTouch) { | ||
const notMobile = !/android|mobile|tablet/i.test(navigator.userAgent); | ||
if (hasTouch) { | ||
const notMobile = !/android|mobile|tablet/i.test(navigator.userAgent); | ||
hasMouse = window.matchMedia && matchMedia('(pointer)').matches ? | ||
matchMedia('(pointer: fine)').matches : notMobile; | ||
hasMouse = window.matchMedia && matchMedia('(pointer)').matches ? | ||
matchMedia('(pointer: fine)').matches : notMobile; | ||
hasHover = hasMouse && (window.matchMedia && matchMedia('(hover)').matches ? | ||
matchMedia('(hover: hover)').matches : notMobile); | ||
} else { | ||
hasMouse = true; | ||
hasHover = true; | ||
hasHover = hasMouse && (window.matchMedia && matchMedia('(hover)').matches ? | ||
matchMedia('(hover: hover)').matches : notMobile); | ||
} else { | ||
hasMouse = true; | ||
hasHover = true; | ||
} | ||
} | ||
} else { | ||
hasMouse = false; | ||
hasTouchEvents = false; | ||
hasHover = false; | ||
hasTouch = false; | ||
} | ||
export { hasMouse, hasHover, hasTouchEvents, hasTouch }; |
@@ -5,2 +5,9 @@ export type Dictionary<T> = { [key: string]: T }; | ||
export type SupportEvent<T extends keyof GlobalEventHandlersEventMap> = { | ||
supported: boolean; | ||
name: T; | ||
}; | ||
export type TimeoutHandle = number | undefined; | ||
export type Writeable<T> = { -readonly [P in keyof T]: T[P] }; |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
273899
152
3913
1