@zag-js/slider 0.0.0-dev-20220604091726 → 0.0.0-dev-20220604123738

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.mjs CHANGED
@@ -42,28 +42,33 @@ function raf(fn) {
42
42
  globalThis.cancelAnimationFrame(id);
43
43
  };
44
44
  }
45
- var runIfFn = (v, ...a) => {
46
- const res = typeof v === "function" ? v(...a) : v;
47
- return res != null ? res : void 0;
48
- };
49
- var noop = () => {
50
- };
51
- var pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
52
- var platform = (v) => isDom() && v.test(navigator.platform);
53
45
  var isDom = () => typeof window !== "undefined";
54
- var isMac = () => platform(/^Mac/);
55
- var isIPhone = () => platform(/^iPhone/);
56
- var isIPad = () => platform(/^iPad/) || isMac() && navigator.maxTouchPoints > 1;
57
- var isIos = () => isIPhone() || isIPad();
58
46
  var isArray = (v) => Array.isArray(v);
59
47
  var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
60
48
  var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
49
+ function getPlatform() {
50
+ var _a;
51
+ const agent = navigator.userAgentData;
52
+ return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
53
+ }
54
+ var pt = (v) => isDom() && v.test(getPlatform());
55
+ var isTouchDevice = isDom() && !!navigator.maxTouchPoints;
56
+ var isMac = () => pt(/^Mac/) && !isTouchDevice;
57
+ var isApple = () => pt(/mac|iphone|ipad|ipod/i);
58
+ var isIos = () => isApple() && !isMac();
61
59
  var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
62
60
  var supportsTouchEvent = () => isDom() && window.ontouchstart === null;
63
61
  var supportsMouseEvent = () => isDom() && window.onmousedown === null;
64
62
  var isMouseEvent = (v) => isObject(v) && hasProp(v, "button");
65
63
  var isTouchEvent = (v) => isObject(v) && hasProp(v, "touches");
66
64
  var isLeftClick = (v) => v.button === 0;
65
+ var runIfFn = (v, ...a) => {
66
+ const res = typeof v === "function" ? v(...a) : v;
67
+ return res != null ? res : void 0;
68
+ };
69
+ var noop = () => {
70
+ };
71
+ var pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
67
72
  function getListenerElements() {
68
73
  ;
69
74
  globalThis.__listenerElements__ = globalThis.__listenerElements__ || /* @__PURE__ */ new Map();
@@ -467,9 +472,11 @@ var transform = (a, b) => {
467
472
  };
468
473
 
469
474
  // ../../utilities/rect/dist/index.mjs
475
+ var isDom2 = () => typeof window !== "undefined";
470
476
  var isArray2 = (v) => Array.isArray(v);
471
477
  var isObject2 = (v) => !(v == null || typeof v !== "object" || isArray2(v));
472
478
  var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
479
+ var isTouchDevice2 = isDom2() && !!navigator.maxTouchPoints;
473
480
  var isTouchEvent2 = (v) => isObject2(v) && hasProp2(v, "touches");
474
481
  var fallback2 = { pageX: 0, pageY: 0, clientX: 0, clientY: 0 };
475
482
  function getEventPoint(e, t = "page") {
@@ -662,6 +669,8 @@ function createNormalizer(fn) {
662
669
  var normalizeProp = createNormalizer((v) => v);
663
670
 
664
671
  // ../../utilities/core/dist/index.mjs
672
+ var isDom3 = () => typeof window !== "undefined";
673
+ var isTouchDevice3 = isDom3() && !!navigator.maxTouchPoints;
665
674
  var isLeftClick2 = (v) => v.button === 0;
666
675
  var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
667
676