@oscarpalmer/atoms 0.7.0 → 0.7.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/js/atoms.js CHANGED
@@ -18,10 +18,10 @@ function findParentElement(origin, selector) {
18
18
  }
19
19
  return parent ?? undefined;
20
20
  }
21
- function getElementUnderPointer(all) {
21
+ function getElementUnderPointer(skipIgnore) {
22
22
  const elements = Array.from(document.querySelectorAll(":hover")).filter((element) => {
23
23
  const style = window.getComputedStyle(element);
24
- return element.tagName !== "HEAD" && (typeof all === "boolean" && all ? true : style.pointerEvents !== "none" && style.visibility !== "hidden");
24
+ return element.tagName !== "HEAD" && (typeof skipIgnore === "boolean" && skipIgnore ? true : style.pointerEvents !== "none" && style.visibility !== "hidden");
25
25
  });
26
26
  return elements[elements.length - 1];
27
27
  }
package/package.json CHANGED
@@ -39,5 +39,5 @@
39
39
  },
40
40
  "type": "module",
41
41
  "types": "./types/index.d.ts",
42
- "version": "0.7.0"
42
+ "version": "0.7.1"
43
43
  }
package/src/js/element.ts CHANGED
@@ -38,16 +38,18 @@ export function findParentElement(
38
38
  /**
39
39
  * - Get the most specific element under the pointer
40
40
  * - Ignores elements with `pointer-events: none` and `visibility: hidden`
41
- * - If `all` is `true`, all elements under the pointer are returned
41
+ * - If `skipIgnore` is `true`, no elements are ignored
42
42
  */
43
- export function getElementUnderPointer(all?: boolean): Element | undefined {
43
+ export function getElementUnderPointer(
44
+ skipIgnore?: boolean,
45
+ ): Element | undefined {
44
46
  const elements = Array.from(document.querySelectorAll(':hover')).filter(
45
47
  element => {
46
48
  const style = window.getComputedStyle(element);
47
49
 
48
50
  return (
49
51
  element.tagName !== 'HEAD' &&
50
- (typeof all === 'boolean' && all
52
+ (typeof skipIgnore === 'boolean' && skipIgnore
51
53
  ? true
52
54
  : style.pointerEvents !== 'none' && style.visibility !== 'hidden')
53
55
  );
@@ -6,6 +6,6 @@ export declare function findParentElement(origin: Element, selector: string | ((
6
6
  /**
7
7
  * - Get the most specific element under the pointer
8
8
  * - Ignores elements with `pointer-events: none` and `visibility: hidden`
9
- * - If `all` is `true`, all elements under the pointer are returned
9
+ * - If `skipIgnore` is `true`, no elements are ignored
10
10
  */
11
- export declare function getElementUnderPointer(all?: boolean): Element | undefined;
11
+ export declare function getElementUnderPointer(skipIgnore?: boolean): Element | undefined;