@y14e/portal 1.2.20 → 1.2.21

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.20';
13
+ import { createPortal } from '@y14e/portal@1.2.21';
14
14
 
15
15
  // CDNs
16
- import { createPortal } from 'https://esm.sh/@y14e/portal@1.2.20';
16
+ import { createPortal } from 'https://esm.sh/@y14e/portal@1.2.21';
17
17
  // or
18
- import { createPortal } from 'https://cdn.jsdelivr.net/npm/@y14e/portal@1.2.20/+esm';
18
+ import { createPortal } from 'https://cdn.jsdelivr.net/npm/@y14e/portal@1.2.21/+esm';
19
19
  // or
20
- import { createPortal } from 'https://esm.unpkg.com/@y14e/portal@1.2.20';
20
+ import { createPortal } from 'https://esm.unpkg.com/@y14e/portal@1.2.21';
21
21
  ```
22
22
 
23
23
  ## 📦 APIs
@@ -388,7 +388,6 @@ var Portal = class {
388
388
  #exitSentinel;
389
389
  #focusables = /* @__PURE__ */ new Set();
390
390
  #controller = null;
391
- #timer;
392
391
  #isDestroyed = false;
393
392
  constructor(host, container) {
394
393
  this.#host = host;
@@ -408,10 +407,6 @@ var Portal = class {
408
407
  this.#isDestroyed = true;
409
408
  this.#controller?.abort();
410
409
  this.#controller = null;
411
- if (this.#timer !== void 0) {
412
- cancelAnimationFrame(this.#timer);
413
- this.#timer = void 0;
414
- }
415
410
  restoreAttributes([...this.#focusables]);
416
411
  this.#focusables.clear();
417
412
  this.#exitSentinel.after(this.#host);
@@ -530,10 +525,7 @@ var Portal = class {
530
525
  return sentinel;
531
526
  }
532
527
  #focusSentinel(isPrevious) {
533
- this.#timer && cancelAnimationFrame(this.#timer);
534
- this.#timer = requestAnimationFrame(
535
- () => (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus()
536
- );
528
+ (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus();
537
529
  }
538
530
  #getFocusables() {
539
531
  return getFocusables(this.#host, {
@@ -565,7 +557,7 @@ function containsComposed2(container, element) {
565
557
  * Lightweight DOM portal (teleport) utility with fully focus management.
566
558
  * Designed for accessible dialogs, menus, overlays, popovers.
567
559
  *
568
- * @version 1.2.20
560
+ * @version 1.2.21
569
561
  * @author Yusuke Kamiyamane
570
562
  * @license MIT
571
563
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -386,7 +386,6 @@ var Portal = class {
386
386
  #exitSentinel;
387
387
  #focusables = /* @__PURE__ */ new Set();
388
388
  #controller = null;
389
- #timer;
390
389
  #isDestroyed = false;
391
390
  constructor(host, container) {
392
391
  this.#host = host;
@@ -406,10 +405,6 @@ var Portal = class {
406
405
  this.#isDestroyed = true;
407
406
  this.#controller?.abort();
408
407
  this.#controller = null;
409
- if (this.#timer !== void 0) {
410
- cancelAnimationFrame(this.#timer);
411
- this.#timer = void 0;
412
- }
413
408
  restoreAttributes([...this.#focusables]);
414
409
  this.#focusables.clear();
415
410
  this.#exitSentinel.after(this.#host);
@@ -528,10 +523,7 @@ var Portal = class {
528
523
  return sentinel;
529
524
  }
530
525
  #focusSentinel(isPrevious) {
531
- this.#timer && cancelAnimationFrame(this.#timer);
532
- this.#timer = requestAnimationFrame(
533
- () => (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus()
534
- );
526
+ (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus();
535
527
  }
536
528
  #getFocusables() {
537
529
  return getFocusables(this.#host, {
@@ -563,7 +555,7 @@ function containsComposed2(container, element) {
563
555
  * Lightweight DOM portal (teleport) utility with fully focus management.
564
556
  * Designed for accessible dialogs, menus, overlays, popovers.
565
557
  *
566
- * @version 1.2.20
558
+ * @version 1.2.21
567
559
  * @author Yusuke Kamiyamane
568
560
  * @license MIT
569
561
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -31,7 +31,6 @@ var Portal = class {
31
31
  #exitSentinel;
32
32
  #focusables = /* @__PURE__ */ new Set();
33
33
  #controller = null;
34
- #timer;
35
34
  #isDestroyed = false;
36
35
  constructor(host, container) {
37
36
  this.#host = host;
@@ -51,10 +50,6 @@ var Portal = class {
51
50
  this.#isDestroyed = true;
52
51
  this.#controller?.abort();
53
52
  this.#controller = null;
54
- if (this.#timer !== void 0) {
55
- cancelAnimationFrame(this.#timer);
56
- this.#timer = void 0;
57
- }
58
53
  attributesUtils.restoreAttributes([...this.#focusables]);
59
54
  this.#focusables.clear();
60
55
  this.#exitSentinel.after(this.#host);
@@ -173,10 +168,7 @@ var Portal = class {
173
168
  return sentinel;
174
169
  }
175
170
  #focusSentinel(isPrevious) {
176
- this.#timer && cancelAnimationFrame(this.#timer);
177
- this.#timer = requestAnimationFrame(
178
- () => (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus()
179
- );
171
+ (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus();
180
172
  }
181
173
  #getFocusables() {
182
174
  return powerFocusable.getFocusables(this.#host, {
@@ -208,7 +200,7 @@ function containsComposed(container, element) {
208
200
  * Lightweight DOM portal (teleport) utility with fully focus management.
209
201
  * Designed for accessible dialogs, menus, overlays, popovers.
210
202
  *
211
- * @version 1.2.20
203
+ * @version 1.2.21
212
204
  * @author Yusuke Kamiyamane
213
205
  * @license MIT
214
206
  * @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.20
6
+ * @version 1.2.21
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.20
6
+ * @version 1.2.21
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -29,7 +29,6 @@ var Portal = class {
29
29
  #exitSentinel;
30
30
  #focusables = /* @__PURE__ */ new Set();
31
31
  #controller = null;
32
- #timer;
33
32
  #isDestroyed = false;
34
33
  constructor(host, container) {
35
34
  this.#host = host;
@@ -49,10 +48,6 @@ var Portal = class {
49
48
  this.#isDestroyed = true;
50
49
  this.#controller?.abort();
51
50
  this.#controller = null;
52
- if (this.#timer !== void 0) {
53
- cancelAnimationFrame(this.#timer);
54
- this.#timer = void 0;
55
- }
56
51
  restoreAttributes([...this.#focusables]);
57
52
  this.#focusables.clear();
58
53
  this.#exitSentinel.after(this.#host);
@@ -171,10 +166,7 @@ var Portal = class {
171
166
  return sentinel;
172
167
  }
173
168
  #focusSentinel(isPrevious) {
174
- this.#timer && cancelAnimationFrame(this.#timer);
175
- this.#timer = requestAnimationFrame(
176
- () => (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus()
177
- );
169
+ (isPrevious ? this.#entranceSentinel : this.#exitSentinel).focus();
178
170
  }
179
171
  #getFocusables() {
180
172
  return getFocusables(this.#host, {
@@ -206,7 +198,7 @@ function containsComposed(container, element) {
206
198
  * Lightweight DOM portal (teleport) utility with fully focus management.
207
199
  * Designed for accessible dialogs, menus, overlays, popovers.
208
200
  *
209
- * @version 1.2.20
201
+ * @version 1.2.21
210
202
  * @author Yusuke Kamiyamane
211
203
  * @license MIT
212
204
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/portal",
3
- "version": "1.2.20",
3
+ "version": "1.2.21",
4
4
  "description": "Lightweight DOM portal (teleport) utility with fully focus management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",