@y14e/portal 1.2.24 → 1.2.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
@@ -10,14 +10,14 @@ npm i @y14e/portal
10
10
 
11
11
  ```ts
12
12
  // npm
13
- import { createPortal } from '@y14e/portal@1.2.24';
13
+ import { createPortal } from '@y14e/portal';
14
14
 
15
15
  // CDNs
16
- import { createPortal } from 'https://esm.sh/@y14e/portal@1.2.24';
16
+ import { createPortal } from 'https://esm.sh/@y14e/portal@1.2.26';
17
17
  // or
18
- import { createPortal } from 'https://cdn.jsdelivr.net/npm/@y14e/portal@1.2.24/+esm';
18
+ import { createPortal } from 'https://cdn.jsdelivr.net/npm/@y14e/portal@1.2.26/+esm';
19
19
  // or
20
- import { createPortal } from 'https://esm.unpkg.com/@y14e/portal@1.2.24';
20
+ import { createPortal } from 'https://esm.unpkg.com/@y14e/portal@1.2.26';
21
21
  ```
22
22
 
23
23
  ## 📦 APIs
@@ -524,10 +524,13 @@ var Portal = class {
524
524
  return sentinel;
525
525
  }
526
526
  #focusSentinel(isPrevious) {
527
- this.#timer && cancelAnimationFrame(this.#timer);
528
- this.#timer = requestAnimationFrame(
529
- () => (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus()
530
- );
527
+ const sentinel = isPrevious ? this.#entranceSentinel : this.#exitSentinel;
528
+ if (isPrevious) {
529
+ sentinel.focus();
530
+ } else {
531
+ this.#timer && cancelAnimationFrame(this.#timer);
532
+ this.#timer = requestAnimationFrame(() => sentinel.focus());
533
+ }
531
534
  }
532
535
  #getFocusables() {
533
536
  return getFocusables(this.#host, {
@@ -559,7 +562,7 @@ function containsComposed2(container, element) {
559
562
  * Lightweight DOM portal (teleport) utility with fully focus management.
560
563
  * Designed for accessible dialogs, menus, overlays, popovers.
561
564
  *
562
- * @version 1.2.24
565
+ * @version 1.2.26
563
566
  * @author Yusuke Kamiyamane
564
567
  * @license MIT
565
568
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -584,7 +587,7 @@ power-focusable/dist/index.js:
584
587
  * High-precision focus management utility with full composed tree support.
585
588
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
586
589
  *
587
- * @version 4.3.3
590
+ * @version 4.3.6
588
591
  * @author Yusuke Kamiyamane
589
592
  * @license MIT
590
593
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -522,10 +522,13 @@ var Portal = class {
522
522
  return sentinel;
523
523
  }
524
524
  #focusSentinel(isPrevious) {
525
- this.#timer && cancelAnimationFrame(this.#timer);
526
- this.#timer = requestAnimationFrame(
527
- () => (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus()
528
- );
525
+ const sentinel = isPrevious ? this.#entranceSentinel : this.#exitSentinel;
526
+ if (isPrevious) {
527
+ sentinel.focus();
528
+ } else {
529
+ this.#timer && cancelAnimationFrame(this.#timer);
530
+ this.#timer = requestAnimationFrame(() => sentinel.focus());
531
+ }
529
532
  }
530
533
  #getFocusables() {
531
534
  return getFocusables(this.#host, {
@@ -557,7 +560,7 @@ function containsComposed2(container, element) {
557
560
  * Lightweight DOM portal (teleport) utility with fully focus management.
558
561
  * Designed for accessible dialogs, menus, overlays, popovers.
559
562
  *
560
- * @version 1.2.24
563
+ * @version 1.2.26
561
564
  * @author Yusuke Kamiyamane
562
565
  * @license MIT
563
566
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -582,7 +585,7 @@ power-focusable/dist/index.js:
582
585
  * High-precision focus management utility with full composed tree support.
583
586
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
584
587
  *
585
- * @version 4.3.3
588
+ * @version 4.3.6
586
589
  * @author Yusuke Kamiyamane
587
590
  * @license MIT
588
591
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -167,10 +167,13 @@ var Portal = class {
167
167
  return sentinel;
168
168
  }
169
169
  #focusSentinel(isPrevious) {
170
- this.#timer && cancelAnimationFrame(this.#timer);
171
- this.#timer = requestAnimationFrame(
172
- () => (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus()
173
- );
170
+ const sentinel = isPrevious ? this.#entranceSentinel : this.#exitSentinel;
171
+ if (isPrevious) {
172
+ sentinel.focus();
173
+ } else {
174
+ this.#timer && cancelAnimationFrame(this.#timer);
175
+ this.#timer = requestAnimationFrame(() => sentinel.focus());
176
+ }
174
177
  }
175
178
  #getFocusables() {
176
179
  return powerFocusable.getFocusables(this.#host, {
@@ -202,7 +205,7 @@ function containsComposed(container, element) {
202
205
  * Lightweight DOM portal (teleport) utility with fully focus management.
203
206
  * Designed for accessible dialogs, menus, overlays, popovers.
204
207
  *
205
- * @version 1.2.24
208
+ * @version 1.2.26
206
209
  * @author Yusuke Kamiyamane
207
210
  * @license MIT
208
211
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Lightweight DOM portal (teleport) utility with fully focus management.
4
4
  * Designed for accessible dialogs, menus, overlays, popovers.
5
5
  *
6
- * @version 1.2.24
6
+ * @version 1.2.26
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Lightweight DOM portal (teleport) utility with fully focus management.
4
4
  * Designed for accessible dialogs, menus, overlays, popovers.
5
5
  *
6
- * @version 1.2.24
6
+ * @version 1.2.26
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -165,10 +165,13 @@ var Portal = class {
165
165
  return sentinel;
166
166
  }
167
167
  #focusSentinel(isPrevious) {
168
- this.#timer && cancelAnimationFrame(this.#timer);
169
- this.#timer = requestAnimationFrame(
170
- () => (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus()
171
- );
168
+ const sentinel = isPrevious ? this.#entranceSentinel : this.#exitSentinel;
169
+ if (isPrevious) {
170
+ sentinel.focus();
171
+ } else {
172
+ this.#timer && cancelAnimationFrame(this.#timer);
173
+ this.#timer = requestAnimationFrame(() => sentinel.focus());
174
+ }
172
175
  }
173
176
  #getFocusables() {
174
177
  return getFocusables(this.#host, {
@@ -200,7 +203,7 @@ function containsComposed(container, element) {
200
203
  * Lightweight DOM portal (teleport) utility with fully focus management.
201
204
  * Designed for accessible dialogs, menus, overlays, popovers.
202
205
  *
203
- * @version 1.2.24
206
+ * @version 1.2.26
204
207
  * @author Yusuke Kamiyamane
205
208
  * @license MIT
206
209
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/portal",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "Lightweight DOM portal (teleport) utility with fully focus management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -56,6 +56,6 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@y14e/attributes-utils": "^1.1.2",
59
- "power-focusable": "^4.3.4"
59
+ "power-focusable": "^4.3.6"
60
60
  }
61
61
  }