@zag-js/focus-visible 1.7.0 → 1.8.1

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
@@ -3,10 +3,6 @@
3
3
  var domQuery = require('@zag-js/dom-query');
4
4
 
5
5
  // src/index.ts
6
- function isVirtualClick(event) {
7
- if (event.mozInputSource === 0 && event.isTrusted) return true;
8
- return event.detail === 0 && !event.pointerType;
9
- }
10
6
  function isValidKey(e) {
11
7
  return !(e.metaKey || !domQuery.isMac() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
12
8
  }
@@ -46,7 +42,7 @@ function handlePointerEvent(e) {
46
42
  }
47
43
  }
48
44
  function handleClickEvent(e) {
49
- if (isVirtualClick(e)) {
45
+ if (domQuery.isVirtualClick(e)) {
50
46
  hasEventBeforeFocus = true;
51
47
  currentModality = "virtual";
52
48
  }
package/dist/index.mjs CHANGED
@@ -1,10 +1,6 @@
1
- import { getWindow, getDocument, getEventTarget, isMac } from '@zag-js/dom-query';
1
+ import { getWindow, getDocument, getEventTarget, isVirtualClick, isMac } from '@zag-js/dom-query';
2
2
 
3
3
  // src/index.ts
4
- function isVirtualClick(event) {
5
- if (event.mozInputSource === 0 && event.isTrusted) return true;
6
- return event.detail === 0 && !event.pointerType;
7
- }
8
4
  function isValidKey(e) {
9
5
  return !(e.metaKey || !isMac() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
10
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/focus-visible",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "Focus visible polyfill utility based on WICG",
5
5
  "keywords": [
6
6
  "js",
@@ -25,7 +25,7 @@
25
25
  "clean-package": "../../../clean-package.config.json",
26
26
  "main": "dist/index.js",
27
27
  "dependencies": {
28
- "@zag-js/dom-query": "1.7.0"
28
+ "@zag-js/dom-query": "1.8.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "clean-package": "2.2.0"