power-focusable 4.3.25 → 4.3.26

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/README.md CHANGED
@@ -24,11 +24,11 @@ import {
24
24
  } from 'power-focusable';
25
25
 
26
26
  // CDNs
27
- import { ... } 'https://esm.sh/power-focusable@4.3.25';
27
+ import { ... } 'https://esm.sh/power-focusable@4.3.26';
28
28
  // or
29
- import { ... } 'https://cdn.jsdelivr.net/npm/power-focusable@4.3.25/+esm';
29
+ import { ... } 'https://cdn.jsdelivr.net/npm/power-focusable@4.3.26/+esm';
30
30
  // or
31
- import { ... } 'https://esm.unpkg.com/power-focusable@4.3.25';
31
+ import { ... } 'https://esm.unpkg.com/power-focusable@4.3.26';
32
32
  ```
33
33
 
34
34
  ## 🪄 Options
@@ -44,7 +44,7 @@ interface PowerFocusableOptions {
44
44
  wrap: boolean; // default: false
45
45
  }
46
46
 
47
- type PowerFocusableFunction = ((element: Element) => boolean) | undefined;
47
+ type PowerFocusableFunction = ((element: Element) => boolean);
48
48
  ```
49
49
 
50
50
  ### `anchor`
package/dist/index.cjs CHANGED
@@ -261,11 +261,11 @@ function getRelativeFocusable(container, offset, options) {
261
261
  }
262
262
  const settings = {
263
263
  composed,
264
- filter,
265
- include,
266
264
  skipNegativeTabIndexCheck,
267
265
  skipVisibilityCheck
268
266
  };
267
+ filter && Object.assign(settings, { filter });
268
+ include && Object.assign(settings, { include });
269
269
  const focusables = getFocusables(container, settings);
270
270
  const { length } = focusables;
271
271
  if (!length) {
@@ -494,7 +494,7 @@ function isUngroupedRadio(element) {
494
494
  * High-precision focus management utility with full composed tree support.
495
495
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
496
496
  *
497
- * @version 4.3.25
497
+ * @version 4.3.26
498
498
  * @author Yusuke Kamiyamane
499
499
  * @license MIT
500
500
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  * High-precision focus management utility with full composed tree support.
4
4
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
5
5
  *
6
- * @version 4.3.25
6
+ * @version 4.3.26
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -18,7 +18,7 @@ interface PowerFocusableOptions {
18
18
  skipVisibilityCheck: boolean;
19
19
  wrap: boolean;
20
20
  }
21
- type PowerFocusableFunction = ((element: Element) => boolean) | undefined;
21
+ type PowerFocusableFunction = (element: Element) => boolean;
22
22
  declare function createFocusTrap(container?: Element): () => void;
23
23
  declare function getFocusables(container?: Element, options?: Partial<Omit<PowerFocusableOptions, 'anchor' | 'wrap'>>): Element[];
24
24
  declare function getNextFocusable(container?: Element, options?: Partial<PowerFocusableOptions>): Element | null;
@@ -32,4 +32,4 @@ declare function isFocusable(element: Element, options?: {
32
32
  declare function focusElement(element: Element): void;
33
33
  declare function getActiveElement(): Element | null;
34
34
 
35
- export { type PowerFocusableOptions, createFocusTrap, focusElement, getActiveElement, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
35
+ export { type PowerFocusableFunction, type PowerFocusableOptions, createFocusTrap, focusElement, getActiveElement, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * High-precision focus management utility with full composed tree support.
4
4
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
5
5
  *
6
- * @version 4.3.25
6
+ * @version 4.3.26
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -18,7 +18,7 @@ interface PowerFocusableOptions {
18
18
  skipVisibilityCheck: boolean;
19
19
  wrap: boolean;
20
20
  }
21
- type PowerFocusableFunction = ((element: Element) => boolean) | undefined;
21
+ type PowerFocusableFunction = (element: Element) => boolean;
22
22
  declare function createFocusTrap(container?: Element): () => void;
23
23
  declare function getFocusables(container?: Element, options?: Partial<Omit<PowerFocusableOptions, 'anchor' | 'wrap'>>): Element[];
24
24
  declare function getNextFocusable(container?: Element, options?: Partial<PowerFocusableOptions>): Element | null;
@@ -32,4 +32,4 @@ declare function isFocusable(element: Element, options?: {
32
32
  declare function focusElement(element: Element): void;
33
33
  declare function getActiveElement(): Element | null;
34
34
 
35
- export { type PowerFocusableOptions, createFocusTrap, focusElement, getActiveElement, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
35
+ export { type PowerFocusableFunction, type PowerFocusableOptions, createFocusTrap, focusElement, getActiveElement, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
package/dist/index.js CHANGED
@@ -259,11 +259,11 @@ function getRelativeFocusable(container, offset, options) {
259
259
  }
260
260
  const settings = {
261
261
  composed,
262
- filter,
263
- include,
264
262
  skipNegativeTabIndexCheck,
265
263
  skipVisibilityCheck
266
264
  };
265
+ filter && Object.assign(settings, { filter });
266
+ include && Object.assign(settings, { include });
267
267
  const focusables = getFocusables(container, settings);
268
268
  const { length } = focusables;
269
269
  if (!length) {
@@ -492,7 +492,7 @@ function isUngroupedRadio(element) {
492
492
  * High-precision focus management utility with full composed tree support.
493
493
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
494
494
  *
495
- * @version 4.3.25
495
+ * @version 4.3.26
496
496
  * @author Yusuke Kamiyamane
497
497
  * @license MIT
498
498
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "power-focusable",
3
- "version": "4.3.25",
3
+ "version": "4.3.26",
4
4
  "description": "High-precision focus management utility with full composed tree support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -53,5 +53,8 @@
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=18"
56
+ },
57
+ "allowScripts": {
58
+ "esbuild": true
56
59
  }
57
60
  }