@zag-js/slider 0.0.0-dev-20220603135505 → 0.0.0-dev-20220604123458
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -12
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +21 -12
- package/dist/index.mjs.map +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -66,28 +66,33 @@ function raf(fn) {
|
|
|
66
66
|
globalThis.cancelAnimationFrame(id);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
var runIfFn = (v, ...a) => {
|
|
70
|
-
const res = typeof v === "function" ? v(...a) : v;
|
|
71
|
-
return res != null ? res : void 0;
|
|
72
|
-
};
|
|
73
|
-
var noop = () => {
|
|
74
|
-
};
|
|
75
|
-
var pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
|
|
76
|
-
var platform = (v) => isDom() && v.test(navigator.platform);
|
|
77
69
|
var isDom = () => typeof window !== "undefined";
|
|
78
|
-
var isMac = () => platform(/^Mac/);
|
|
79
|
-
var isIPhone = () => platform(/^iPhone/);
|
|
80
|
-
var isIPad = () => platform(/^iPad/) || isMac() && navigator.maxTouchPoints > 1;
|
|
81
|
-
var isIos = () => isIPhone() || isIPad();
|
|
82
70
|
var isArray = (v) => Array.isArray(v);
|
|
83
71
|
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
84
72
|
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
73
|
+
function getPlatform() {
|
|
74
|
+
var _a;
|
|
75
|
+
const agent = navigator.userAgentData;
|
|
76
|
+
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
|
|
77
|
+
}
|
|
78
|
+
var pt = (v) => isDom() && v.test(getPlatform());
|
|
79
|
+
var isTouchDevice = isDom() && !!navigator.maxTouchPoints;
|
|
80
|
+
var isMac = () => pt(/^Mac/) && !isTouchDevice;
|
|
81
|
+
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
|
|
82
|
+
var isIos = () => isApple() && !isMac();
|
|
85
83
|
var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
|
|
86
84
|
var supportsTouchEvent = () => isDom() && window.ontouchstart === null;
|
|
87
85
|
var supportsMouseEvent = () => isDom() && window.onmousedown === null;
|
|
88
86
|
var isMouseEvent = (v) => isObject(v) && hasProp(v, "button");
|
|
89
87
|
var isTouchEvent = (v) => isObject(v) && hasProp(v, "touches");
|
|
90
88
|
var isLeftClick = (v) => v.button === 0;
|
|
89
|
+
var runIfFn = (v, ...a) => {
|
|
90
|
+
const res = typeof v === "function" ? v(...a) : v;
|
|
91
|
+
return res != null ? res : void 0;
|
|
92
|
+
};
|
|
93
|
+
var noop = () => {
|
|
94
|
+
};
|
|
95
|
+
var pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
|
|
91
96
|
function getListenerElements() {
|
|
92
97
|
;
|
|
93
98
|
globalThis.__listenerElements__ = globalThis.__listenerElements__ || /* @__PURE__ */ new Map();
|
|
@@ -491,9 +496,11 @@ var transform = (a, b) => {
|
|
|
491
496
|
};
|
|
492
497
|
|
|
493
498
|
// ../../utilities/rect/dist/index.mjs
|
|
499
|
+
var isDom2 = () => typeof window !== "undefined";
|
|
494
500
|
var isArray2 = (v) => Array.isArray(v);
|
|
495
501
|
var isObject2 = (v) => !(v == null || typeof v !== "object" || isArray2(v));
|
|
496
502
|
var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
503
|
+
var isTouchDevice2 = isDom2() && !!navigator.maxTouchPoints;
|
|
497
504
|
var isTouchEvent2 = (v) => isObject2(v) && hasProp2(v, "touches");
|
|
498
505
|
var fallback2 = { pageX: 0, pageY: 0, clientX: 0, clientY: 0 };
|
|
499
506
|
function getEventPoint(e, t = "page") {
|
|
@@ -686,6 +693,8 @@ function createNormalizer(fn) {
|
|
|
686
693
|
var normalizeProp = createNormalizer((v) => v);
|
|
687
694
|
|
|
688
695
|
// ../../utilities/core/dist/index.mjs
|
|
696
|
+
var isDom3 = () => typeof window !== "undefined";
|
|
697
|
+
var isTouchDevice3 = isDom3() && !!navigator.maxTouchPoints;
|
|
689
698
|
var isLeftClick2 = (v) => v.button === 0;
|
|
690
699
|
var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
|
|
691
700
|
|