@zag-js/tooltip 0.0.0-dev-20220704095222 → 0.0.0-dev-20220704163406

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 CHANGED
@@ -48,8 +48,8 @@ var dataAttr = (guard) => {
48
48
  };
49
49
  function getCache() {
50
50
  const g = globalThis;
51
- g.__styleCache__ = g.__styleCache__ || /* @__PURE__ */ new WeakMap();
52
- return g.__styleCache__;
51
+ g.__styleCache = g.__styleCache || /* @__PURE__ */ new WeakMap();
52
+ return g.__styleCache;
53
53
  }
54
54
  function getComputedStyle(el) {
55
55
  var _a;
@@ -64,6 +64,23 @@ function getComputedStyle(el) {
64
64
  }
65
65
  return style;
66
66
  }
67
+ var runIfFn = (v, ...a) => {
68
+ const res = typeof v === "function" ? v(...a) : v;
69
+ return res != null ? res : void 0;
70
+ };
71
+ var isArray = (v) => Array.isArray(v);
72
+ var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
73
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
74
+ var isDom = () => typeof window !== "undefined";
75
+ function getPlatform() {
76
+ var _a;
77
+ const agent = navigator.userAgentData;
78
+ return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
79
+ }
80
+ var pt = (v) => isDom() && v.test(getPlatform());
81
+ var vn = (v) => isDom() && v.test(navigator.vendor);
82
+ var isSafari = () => isApple() && vn(/apple/i);
83
+ var isApple = () => pt(/mac|iphone|ipad|ipod/i);
67
84
  function isWindow(value) {
68
85
  return (value == null ? void 0 : value.toString()) === "[object Window]";
69
86
  }
@@ -90,18 +107,10 @@ function getParent(el) {
90
107
  function isHTMLElement(v) {
91
108
  return typeof v === "object" && (v == null ? void 0 : v.nodeType) === Node.ELEMENT_NODE && typeof (v == null ? void 0 : v.nodeName) === "string";
92
109
  }
93
- var isDom = () => typeof window !== "undefined";
94
- var isArray = (v) => Array.isArray(v);
95
- var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
96
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
97
110
  var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
98
111
  var supportsTouchEvent = () => isDom() && window.ontouchstart === null;
99
112
  var supportsMouseEvent = () => isDom() && window.onmousedown === null;
100
113
  var isTouchEvent = (v) => isObject(v) && hasProp(v, "touches");
101
- var runIfFn = (v, ...a) => {
102
- const res = typeof v === "function" ? v(...a) : v;
103
- return res != null ? res : void 0;
104
- };
105
114
  var isRef = (v) => hasProp(v, "current");
106
115
  var fallback2 = { pageX: 0, pageY: 0, clientX: 0, clientY: 0 };
107
116
  function extractInfo(event, type = "page") {
@@ -372,16 +381,6 @@ var import_core2 = require("@zag-js/core");
372
381
  var import_popper2 = require("@zag-js/popper");
373
382
 
374
383
  // ../../utilities/core/dist/index.mjs
375
- var isDom2 = () => typeof window !== "undefined";
376
- function getPlatform() {
377
- var _a;
378
- const agent = navigator.userAgentData;
379
- return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
380
- }
381
- var pt = (v) => isDom2() && v.test(getPlatform());
382
- var vn = (v) => isDom2() && v.test(navigator.vendor);
383
- var isSafari = () => isApple() && vn(/apple/i);
384
- var isApple = () => pt(/mac|iphone|ipad|ipod/i);
385
384
  var noop = () => {
386
385
  };
387
386
 
package/dist/index.mjs CHANGED
@@ -24,8 +24,8 @@ var dataAttr = (guard) => {
24
24
  };
25
25
  function getCache() {
26
26
  const g = globalThis;
27
- g.__styleCache__ = g.__styleCache__ || /* @__PURE__ */ new WeakMap();
28
- return g.__styleCache__;
27
+ g.__styleCache = g.__styleCache || /* @__PURE__ */ new WeakMap();
28
+ return g.__styleCache;
29
29
  }
30
30
  function getComputedStyle(el) {
31
31
  var _a;
@@ -40,6 +40,23 @@ function getComputedStyle(el) {
40
40
  }
41
41
  return style;
42
42
  }
43
+ var runIfFn = (v, ...a) => {
44
+ const res = typeof v === "function" ? v(...a) : v;
45
+ return res != null ? res : void 0;
46
+ };
47
+ var isArray = (v) => Array.isArray(v);
48
+ var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
49
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
50
+ var isDom = () => typeof window !== "undefined";
51
+ function getPlatform() {
52
+ var _a;
53
+ const agent = navigator.userAgentData;
54
+ return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
55
+ }
56
+ var pt = (v) => isDom() && v.test(getPlatform());
57
+ var vn = (v) => isDom() && v.test(navigator.vendor);
58
+ var isSafari = () => isApple() && vn(/apple/i);
59
+ var isApple = () => pt(/mac|iphone|ipad|ipod/i);
43
60
  function isWindow(value) {
44
61
  return (value == null ? void 0 : value.toString()) === "[object Window]";
45
62
  }
@@ -66,18 +83,10 @@ function getParent(el) {
66
83
  function isHTMLElement(v) {
67
84
  return typeof v === "object" && (v == null ? void 0 : v.nodeType) === Node.ELEMENT_NODE && typeof (v == null ? void 0 : v.nodeName) === "string";
68
85
  }
69
- var isDom = () => typeof window !== "undefined";
70
- var isArray = (v) => Array.isArray(v);
71
- var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
72
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
73
86
  var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
74
87
  var supportsTouchEvent = () => isDom() && window.ontouchstart === null;
75
88
  var supportsMouseEvent = () => isDom() && window.onmousedown === null;
76
89
  var isTouchEvent = (v) => isObject(v) && hasProp(v, "touches");
77
- var runIfFn = (v, ...a) => {
78
- const res = typeof v === "function" ? v(...a) : v;
79
- return res != null ? res : void 0;
80
- };
81
90
  var isRef = (v) => hasProp(v, "current");
82
91
  var fallback2 = { pageX: 0, pageY: 0, clientX: 0, clientY: 0 };
83
92
  function extractInfo(event, type = "page") {
@@ -348,16 +357,6 @@ import { createMachine, ref, subscribe } from "@zag-js/core";
348
357
  import { getPlacement } from "@zag-js/popper";
349
358
 
350
359
  // ../../utilities/core/dist/index.mjs
351
- var isDom2 = () => typeof window !== "undefined";
352
- function getPlatform() {
353
- var _a;
354
- const agent = navigator.userAgentData;
355
- return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
356
- }
357
- var pt = (v) => isDom2() && v.test(getPlatform());
358
- var vn = (v) => isDom2() && v.test(navigator.vendor);
359
- var isSafari = () => isApple() && vn(/apple/i);
360
- var isApple = () => pt(/mac|iphone|ipad|ipod/i);
361
360
  var noop = () => {
362
361
  };
363
362
 
@@ -1,4 +1,4 @@
1
- import { MachineContext as Ctx } from "./tooltip.types";
1
+ import type { MachineContext as Ctx } from "./tooltip.types";
2
2
  export declare const dom: {
3
3
  getDoc: (ctx: Ctx) => Document;
4
4
  getWin: (ctx: Ctx) => Window & typeof globalThis;
@@ -1,2 +1,2 @@
1
- import { UserDefinedContext, MachineContext, MachineState } from "./tooltip.types";
1
+ import type { MachineContext, MachineState, UserDefinedContext } from "./tooltip.types";
2
2
  export declare function machine(ctx?: UserDefinedContext): import("@zag-js/core").Machine<MachineContext, MachineState, import("@zag-js/core").StateMachine.AnyEventObject>;
@@ -1,6 +1,6 @@
1
1
  import type { StateMachine as S } from "@zag-js/core";
2
- import { Placement, PositioningOptions } from "@zag-js/popper";
3
- import { RootProperties } from "@zag-js/types";
2
+ import type { Placement, PositioningOptions } from "@zag-js/popper";
3
+ import type { RootProperties } from "@zag-js/types";
4
4
  declare type ElementIds = Partial<{
5
5
  trigger: string;
6
6
  content: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/tooltip",
3
- "version": "0.0.0-dev-20220704095222",
3
+ "version": "0.0.0-dev-20220704163406",
4
4
  "description": "Core logic for the tooltip widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -29,10 +29,10 @@
29
29
  "url": "https://github.com/chakra-ui/zag/issues"
30
30
  },
31
31
  "dependencies": {
32
- "@zag-js/core": "0.0.0-dev-20220704095222",
33
- "@zag-js/dom-utils": "0.0.0-dev-20220704095222",
34
- "@zag-js/popper": "0.0.0-dev-20220704095222",
35
- "@zag-js/types": "0.0.0-dev-20220704095222"
32
+ "@zag-js/core": "0.0.0-dev-20220704163406",
33
+ "@zag-js/dom-utils": "0.0.0-dev-20220704163406",
34
+ "@zag-js/popper": "0.0.0-dev-20220704163406",
35
+ "@zag-js/types": "0.0.0-dev-20220704163406"
36
36
  },
37
37
  "scripts": {
38
38
  "build:fast": "zag build",