@y14e/portal 1.4.3 → 1.4.5
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.bundle.cjs +154 -175
- package/dist/index.bundle.js +154 -175
- package/dist/index.cjs +17 -14
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -14
- package/package.json +3 -3
package/dist/index.bundle.cjs
CHANGED
|
@@ -29,87 +29,114 @@ function saveAttributes(element_or_elements, name_or_names) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// node_modules/power-focusable/dist/index.js
|
|
32
|
+
function containsComposed(container, element) {
|
|
33
|
+
let current = element;
|
|
34
|
+
while (current) {
|
|
35
|
+
if (current === container) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
current = current instanceof ShadowRoot ? current.mode === "open" ? current.host : null : current.parentNode;
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
function getComposedChildren(node) {
|
|
43
|
+
if (node instanceof ShadowRoot) {
|
|
44
|
+
return [...node.children];
|
|
45
|
+
}
|
|
46
|
+
if (!(node instanceof Element)) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
if (node instanceof HTMLSlotElement) {
|
|
50
|
+
const assigned = node.assignedElements({ flatten: true });
|
|
51
|
+
if (assigned.length) {
|
|
52
|
+
return assigned;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (node instanceof HTMLElement && node.shadowRoot?.mode === "open") {
|
|
56
|
+
return [...node.shadowRoot.children];
|
|
57
|
+
}
|
|
58
|
+
return [...node.children];
|
|
59
|
+
}
|
|
32
60
|
var FOCUSABLE_SELECTOR = ':is(a[href], area[href], button, embed, iframe, input:not([type="hidden" i]), object, select, details > summary:first-of-type, textarea, [contenteditable]:not([contenteditable="false" i]), [controls], [tabindex]):not(:disabled, [hidden], [inert], [tabindex="-1"])';
|
|
33
61
|
var FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX = FOCUSABLE_SELECTOR.replace(
|
|
34
62
|
/(,\s*)?\[tabindex="-1"\]/g,
|
|
35
63
|
""
|
|
36
64
|
);
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
65
|
+
function focusElement(element) {
|
|
66
|
+
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
67
|
+
}
|
|
68
|
+
function getActiveElement() {
|
|
69
|
+
let current = document.activeElement;
|
|
70
|
+
while (current?.shadowRoot?.activeElement) {
|
|
71
|
+
current = current.shadowRoot.activeElement;
|
|
41
72
|
}
|
|
42
|
-
|
|
43
|
-
|
|
73
|
+
return current;
|
|
74
|
+
}
|
|
75
|
+
function getTabIndex(element) {
|
|
76
|
+
return "tabIndex" in element ? Number(element.tabIndex) : -1;
|
|
77
|
+
}
|
|
78
|
+
function isDisabled(element) {
|
|
79
|
+
return "disabled" in element && !!element.disabled;
|
|
80
|
+
}
|
|
81
|
+
function isFormControl(element) {
|
|
82
|
+
return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(element.tagName);
|
|
83
|
+
}
|
|
84
|
+
function isInert(element) {
|
|
85
|
+
return "inert" in element && !!element.inert;
|
|
86
|
+
}
|
|
87
|
+
function isUngroupedRadio(input) {
|
|
88
|
+
return input.type === "radio" && !!input.name;
|
|
89
|
+
}
|
|
90
|
+
function resolveOptions(options) {
|
|
91
|
+
let {
|
|
92
|
+
anchor = getActiveElement(),
|
|
93
|
+
composed = false,
|
|
44
94
|
filter,
|
|
45
95
|
include,
|
|
46
|
-
skipNegativeTabIndexCheck,
|
|
47
|
-
skipVisibilityCheck
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
skipNegativeTabIndexCheck,
|
|
56
|
-
skipVisibilityCheck
|
|
57
|
-
}) && candidates.push(match);
|
|
96
|
+
skipNegativeTabIndexCheck = false,
|
|
97
|
+
skipVisibilityCheck = false,
|
|
98
|
+
wrap = false
|
|
99
|
+
} = options;
|
|
100
|
+
if (!(anchor instanceof Element)) {
|
|
101
|
+
const active = getActiveElement();
|
|
102
|
+
if (active instanceof Element) {
|
|
103
|
+
console.warn("Invalid anchor element. Fallback: active element.");
|
|
104
|
+
anchor = active;
|
|
58
105
|
}
|
|
59
|
-
} else {
|
|
60
|
-
let traverse2 = function(node) {
|
|
61
|
-
if (isFocusable(node, {
|
|
62
|
-
skipNegativeTabIndexCheck,
|
|
63
|
-
skipVisibilityCheck
|
|
64
|
-
}) || include?.(node)) {
|
|
65
|
-
candidates.push(node);
|
|
66
|
-
}
|
|
67
|
-
(!composed ? [...node.children] : getComposedChildren(node)).map(
|
|
68
|
-
traverse2
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
(!composed ? [...container.children] : getComposedChildren(container)).map(
|
|
72
|
-
traverse2
|
|
73
|
-
);
|
|
74
106
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
function getNextFocusable(container = document.body, options = {}) {
|
|
80
|
-
return getRelativeFocusable(container, 1, options);
|
|
81
|
-
}
|
|
82
|
-
function getPreviousFocusable(container = document.body, options = {}) {
|
|
83
|
-
return getRelativeFocusable(container, -1, options);
|
|
84
|
-
}
|
|
85
|
-
function isFocusable(element, options = {}) {
|
|
86
|
-
if (!(element instanceof Element)) {
|
|
87
|
-
console.warn("Invalid element");
|
|
88
|
-
return false;
|
|
107
|
+
if (typeof composed !== "boolean") {
|
|
108
|
+
console.warn("Invalid composed option. Fallback: false.");
|
|
109
|
+
composed = false;
|
|
89
110
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
111
|
+
if (filter !== void 0 && typeof filter !== "function") {
|
|
112
|
+
console.warn("Invalid filter function. Fallback: no filter function (undefined).");
|
|
113
|
+
filter = void 0;
|
|
93
114
|
}
|
|
94
|
-
if (
|
|
95
|
-
|
|
115
|
+
if (include !== void 0 && typeof include !== "function") {
|
|
116
|
+
console.warn("Invalid include function. Fallback: no include function (undefined).");
|
|
117
|
+
include = void 0;
|
|
96
118
|
}
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return false;
|
|
119
|
+
if (typeof skipNegativeTabIndexCheck !== "boolean") {
|
|
120
|
+
console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
|
|
121
|
+
skipNegativeTabIndexCheck = false;
|
|
101
122
|
}
|
|
102
|
-
if (
|
|
103
|
-
|
|
123
|
+
if (typeof skipVisibilityCheck !== "boolean") {
|
|
124
|
+
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
125
|
+
skipVisibilityCheck = false;
|
|
104
126
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
visibilityProperty: true
|
|
109
|
-
})) {
|
|
110
|
-
return false;
|
|
127
|
+
if (typeof wrap !== "boolean") {
|
|
128
|
+
console.warn("Invalid wrap option. Fallback: false.");
|
|
129
|
+
wrap = false;
|
|
111
130
|
}
|
|
112
|
-
return
|
|
131
|
+
return {
|
|
132
|
+
anchor,
|
|
133
|
+
composed,
|
|
134
|
+
filter,
|
|
135
|
+
include,
|
|
136
|
+
skipNegativeTabIndexCheck,
|
|
137
|
+
skipVisibilityCheck,
|
|
138
|
+
wrap
|
|
139
|
+
};
|
|
113
140
|
}
|
|
114
141
|
function getRelativeFocusable(container, offset, options) {
|
|
115
142
|
if (!(container instanceof Element)) {
|
|
@@ -234,117 +261,80 @@ function sortByTabIndex(elements) {
|
|
|
234
261
|
}
|
|
235
262
|
return ordered.sort((a, b) => getTabIndex(a) - getTabIndex(b)).concat(natural);
|
|
236
263
|
}
|
|
237
|
-
function
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
current = current instanceof ShadowRoot ? current.mode === "open" ? current.host : null : current.parentNode;
|
|
244
|
-
}
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
function getComposedChildren(node) {
|
|
248
|
-
if (node instanceof ShadowRoot) {
|
|
249
|
-
return [...node.children];
|
|
250
|
-
}
|
|
251
|
-
if (!(node instanceof Element)) {
|
|
252
|
-
return [];
|
|
264
|
+
function getFocusables(container = document.body, options = {}) {
|
|
265
|
+
if (!(container instanceof Element)) {
|
|
266
|
+
console.warn("Invalid container element. Fallback: <body> element.");
|
|
267
|
+
container = document.body;
|
|
253
268
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
269
|
+
const { composed, filter, include, skipNegativeTabIndexCheck, skipVisibilityCheck } = resolveOptions(options);
|
|
270
|
+
const candidates = [];
|
|
271
|
+
if (!composed && !include) {
|
|
272
|
+
for (const match of container.querySelectorAll(
|
|
273
|
+
!skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR : FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX
|
|
274
|
+
)) {
|
|
275
|
+
match && isFocusable(match, { skipNegativeTabIndexCheck, skipVisibilityCheck }) && candidates.push(match);
|
|
258
276
|
}
|
|
277
|
+
} else {
|
|
278
|
+
let traverse2 = function(node) {
|
|
279
|
+
if (isFocusable(node, { skipNegativeTabIndexCheck, skipVisibilityCheck }) || include?.(node)) {
|
|
280
|
+
candidates.push(node);
|
|
281
|
+
}
|
|
282
|
+
(!composed ? [...node.children] : getComposedChildren(node)).map(traverse2);
|
|
283
|
+
};
|
|
284
|
+
(!composed ? [...container.children] : getComposedChildren(container)).map(traverse2);
|
|
259
285
|
}
|
|
260
|
-
|
|
261
|
-
return [...node.shadowRoot.children];
|
|
262
|
-
}
|
|
263
|
-
return [...node.children];
|
|
264
|
-
}
|
|
265
|
-
function focusElement(element) {
|
|
266
|
-
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
267
|
-
}
|
|
268
|
-
function getActiveElement() {
|
|
269
|
-
let current = document.activeElement;
|
|
270
|
-
while (current?.shadowRoot?.activeElement) {
|
|
271
|
-
current = current.shadowRoot.activeElement;
|
|
272
|
-
}
|
|
273
|
-
return current;
|
|
286
|
+
return normalizeRadioGroup(sortByTabIndex(!filter ? candidates : candidates.filter(filter)));
|
|
274
287
|
}
|
|
275
|
-
function
|
|
276
|
-
return
|
|
277
|
-
}
|
|
278
|
-
function isDisabled(element) {
|
|
279
|
-
return "disabled" in element && !!element.disabled;
|
|
280
|
-
}
|
|
281
|
-
function isFormControl(element) {
|
|
282
|
-
return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(element.tagName);
|
|
283
|
-
}
|
|
284
|
-
function isInert(element) {
|
|
285
|
-
return "inert" in element && !!element.inert;
|
|
288
|
+
function getNextFocusable(container = document.body, options = {}) {
|
|
289
|
+
return getRelativeFocusable(container, 1, options);
|
|
286
290
|
}
|
|
287
|
-
function
|
|
288
|
-
return
|
|
291
|
+
function getPreviousFocusable(container = document.body, options = {}) {
|
|
292
|
+
return getRelativeFocusable(container, -1, options);
|
|
289
293
|
}
|
|
290
|
-
function
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
filter,
|
|
295
|
-
include,
|
|
296
|
-
skipNegativeTabIndexCheck = false,
|
|
297
|
-
skipVisibilityCheck = false,
|
|
298
|
-
wrap = false
|
|
299
|
-
} = options;
|
|
300
|
-
if (!(anchor instanceof Element)) {
|
|
301
|
-
const active = getActiveElement();
|
|
302
|
-
if (active instanceof Element) {
|
|
303
|
-
console.warn("Invalid anchor element. Fallback: active element.");
|
|
304
|
-
anchor = active;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
if (typeof composed !== "boolean") {
|
|
308
|
-
console.warn("Invalid composed option. Fallback: false.");
|
|
309
|
-
composed = false;
|
|
294
|
+
function isFocusable(element, options = {}) {
|
|
295
|
+
if (!(element instanceof Element)) {
|
|
296
|
+
console.warn("Invalid element");
|
|
297
|
+
return false;
|
|
310
298
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
);
|
|
315
|
-
filter = void 0;
|
|
299
|
+
const { skipNegativeTabIndexCheck, skipVisibilityCheck } = resolveOptions(options);
|
|
300
|
+
if (element.hasAttribute("hidden") || isInert(element)) {
|
|
301
|
+
return false;
|
|
316
302
|
}
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
"Invalid include function. Fallback: no include function (undefined)."
|
|
320
|
-
);
|
|
321
|
-
include = void 0;
|
|
303
|
+
if (!skipNegativeTabIndexCheck && getTabIndex(element) < 0) {
|
|
304
|
+
return false;
|
|
322
305
|
}
|
|
323
|
-
if (
|
|
324
|
-
|
|
325
|
-
|
|
306
|
+
if (!element.matches(
|
|
307
|
+
!skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR : FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX
|
|
308
|
+
)) {
|
|
309
|
+
return false;
|
|
326
310
|
}
|
|
327
|
-
if (
|
|
328
|
-
|
|
329
|
-
skipVisibilityCheck = false;
|
|
311
|
+
if (isDisabledDeep(element)) {
|
|
312
|
+
return false;
|
|
330
313
|
}
|
|
331
|
-
if (
|
|
332
|
-
|
|
333
|
-
|
|
314
|
+
if (!skipVisibilityCheck && !element.checkVisibility({
|
|
315
|
+
contentVisibilityAuto: true,
|
|
316
|
+
opacityProperty: true,
|
|
317
|
+
visibilityProperty: true
|
|
318
|
+
})) {
|
|
319
|
+
return false;
|
|
334
320
|
}
|
|
335
|
-
return
|
|
336
|
-
anchor,
|
|
337
|
-
composed,
|
|
338
|
-
filter,
|
|
339
|
-
include,
|
|
340
|
-
skipNegativeTabIndexCheck,
|
|
341
|
-
skipVisibilityCheck,
|
|
342
|
-
wrap
|
|
343
|
-
};
|
|
321
|
+
return true;
|
|
344
322
|
}
|
|
345
323
|
|
|
346
|
-
// src/
|
|
324
|
+
// src/constants.ts
|
|
347
325
|
var VISUALLY_HIDDEN_CSS = "border: 0; clip: rect(0, 0, 0, 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; user-select: none; white-space: nowrap; width: 1px;";
|
|
326
|
+
|
|
327
|
+
// src/options.ts
|
|
328
|
+
function resolveOptions2(options) {
|
|
329
|
+
let { noInlineStyle = false } = options;
|
|
330
|
+
if (typeof noInlineStyle !== "boolean") {
|
|
331
|
+
console.warn("Invalid noInlineStyle option. Fallback: false.");
|
|
332
|
+
noInlineStyle = false;
|
|
333
|
+
}
|
|
334
|
+
return { noInlineStyle };
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// src/index.ts
|
|
348
338
|
function createPortal(host, container = document.body, options = {}) {
|
|
349
339
|
if (!(host instanceof Element)) {
|
|
350
340
|
console.warn("Invalid host element");
|
|
@@ -380,7 +370,7 @@ var Portal = class {
|
|
|
380
370
|
container = document.body;
|
|
381
371
|
}
|
|
382
372
|
this.#container = container;
|
|
383
|
-
this.#settings =
|
|
373
|
+
this.#settings = resolveOptions2(options);
|
|
384
374
|
this.#entranceSentinel = this.#createSentinel();
|
|
385
375
|
this.#exitSentinel = this.#createSentinel();
|
|
386
376
|
this.#initialize();
|
|
@@ -413,11 +403,11 @@ var Portal = class {
|
|
|
413
403
|
this.#host.setAttribute("data-portaled", "");
|
|
414
404
|
}
|
|
415
405
|
#onFocus = (event) => {
|
|
416
|
-
const { currentTarget:
|
|
406
|
+
const { currentTarget: target, relatedTarget: previous } = event;
|
|
417
407
|
if (!(previous instanceof Element)) {
|
|
418
408
|
return;
|
|
419
409
|
}
|
|
420
|
-
if (
|
|
410
|
+
if (target === this.#entranceSentinel) {
|
|
421
411
|
if (this.#host.contains(previous)) {
|
|
422
412
|
this.#moveFocus("previous");
|
|
423
413
|
return;
|
|
@@ -436,9 +426,6 @@ var Portal = class {
|
|
|
436
426
|
last ? focusElement(last) : this.#moveFocus("previous");
|
|
437
427
|
};
|
|
438
428
|
#onKeyDown = (event) => {
|
|
439
|
-
if (!(event instanceof KeyboardEvent)) {
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
429
|
const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
443
430
|
if (key !== "Tab" || altKey || ctrlKey || metaKey) {
|
|
444
431
|
return;
|
|
@@ -507,14 +494,6 @@ var Portal = class {
|
|
|
507
494
|
const focusable = direction === "previous" ? getPreviousFocusable(document.body, options) : getNextFocusable(document.body, options);
|
|
508
495
|
focusable && focusElement(focusable);
|
|
509
496
|
}
|
|
510
|
-
#resolveOptions(options) {
|
|
511
|
-
let { noInlineStyle = false } = options;
|
|
512
|
-
if (typeof noInlineStyle !== "boolean") {
|
|
513
|
-
console.warn("Invalid noInlineStyle option. Fallback: false.");
|
|
514
|
-
noInlineStyle = false;
|
|
515
|
-
}
|
|
516
|
-
return { noInlineStyle };
|
|
517
|
-
}
|
|
518
497
|
};
|
|
519
498
|
|
|
520
499
|
exports.createPortal = createPortal;
|
package/dist/index.bundle.js
CHANGED
|
@@ -27,87 +27,114 @@ function saveAttributes(element_or_elements, name_or_names) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// node_modules/power-focusable/dist/index.js
|
|
30
|
+
function containsComposed(container, element) {
|
|
31
|
+
let current = element;
|
|
32
|
+
while (current) {
|
|
33
|
+
if (current === container) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
current = current instanceof ShadowRoot ? current.mode === "open" ? current.host : null : current.parentNode;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
function getComposedChildren(node) {
|
|
41
|
+
if (node instanceof ShadowRoot) {
|
|
42
|
+
return [...node.children];
|
|
43
|
+
}
|
|
44
|
+
if (!(node instanceof Element)) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
if (node instanceof HTMLSlotElement) {
|
|
48
|
+
const assigned = node.assignedElements({ flatten: true });
|
|
49
|
+
if (assigned.length) {
|
|
50
|
+
return assigned;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (node instanceof HTMLElement && node.shadowRoot?.mode === "open") {
|
|
54
|
+
return [...node.shadowRoot.children];
|
|
55
|
+
}
|
|
56
|
+
return [...node.children];
|
|
57
|
+
}
|
|
30
58
|
var FOCUSABLE_SELECTOR = ':is(a[href], area[href], button, embed, iframe, input:not([type="hidden" i]), object, select, details > summary:first-of-type, textarea, [contenteditable]:not([contenteditable="false" i]), [controls], [tabindex]):not(:disabled, [hidden], [inert], [tabindex="-1"])';
|
|
31
59
|
var FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX = FOCUSABLE_SELECTOR.replace(
|
|
32
60
|
/(,\s*)?\[tabindex="-1"\]/g,
|
|
33
61
|
""
|
|
34
62
|
);
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
63
|
+
function focusElement(element) {
|
|
64
|
+
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
65
|
+
}
|
|
66
|
+
function getActiveElement() {
|
|
67
|
+
let current = document.activeElement;
|
|
68
|
+
while (current?.shadowRoot?.activeElement) {
|
|
69
|
+
current = current.shadowRoot.activeElement;
|
|
39
70
|
}
|
|
40
|
-
|
|
41
|
-
|
|
71
|
+
return current;
|
|
72
|
+
}
|
|
73
|
+
function getTabIndex(element) {
|
|
74
|
+
return "tabIndex" in element ? Number(element.tabIndex) : -1;
|
|
75
|
+
}
|
|
76
|
+
function isDisabled(element) {
|
|
77
|
+
return "disabled" in element && !!element.disabled;
|
|
78
|
+
}
|
|
79
|
+
function isFormControl(element) {
|
|
80
|
+
return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(element.tagName);
|
|
81
|
+
}
|
|
82
|
+
function isInert(element) {
|
|
83
|
+
return "inert" in element && !!element.inert;
|
|
84
|
+
}
|
|
85
|
+
function isUngroupedRadio(input) {
|
|
86
|
+
return input.type === "radio" && !!input.name;
|
|
87
|
+
}
|
|
88
|
+
function resolveOptions(options) {
|
|
89
|
+
let {
|
|
90
|
+
anchor = getActiveElement(),
|
|
91
|
+
composed = false,
|
|
42
92
|
filter,
|
|
43
93
|
include,
|
|
44
|
-
skipNegativeTabIndexCheck,
|
|
45
|
-
skipVisibilityCheck
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (!
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
skipNegativeTabIndexCheck,
|
|
54
|
-
skipVisibilityCheck
|
|
55
|
-
}) && candidates.push(match);
|
|
94
|
+
skipNegativeTabIndexCheck = false,
|
|
95
|
+
skipVisibilityCheck = false,
|
|
96
|
+
wrap = false
|
|
97
|
+
} = options;
|
|
98
|
+
if (!(anchor instanceof Element)) {
|
|
99
|
+
const active = getActiveElement();
|
|
100
|
+
if (active instanceof Element) {
|
|
101
|
+
console.warn("Invalid anchor element. Fallback: active element.");
|
|
102
|
+
anchor = active;
|
|
56
103
|
}
|
|
57
|
-
} else {
|
|
58
|
-
let traverse2 = function(node) {
|
|
59
|
-
if (isFocusable(node, {
|
|
60
|
-
skipNegativeTabIndexCheck,
|
|
61
|
-
skipVisibilityCheck
|
|
62
|
-
}) || include?.(node)) {
|
|
63
|
-
candidates.push(node);
|
|
64
|
-
}
|
|
65
|
-
(!composed ? [...node.children] : getComposedChildren(node)).map(
|
|
66
|
-
traverse2
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
(!composed ? [...container.children] : getComposedChildren(container)).map(
|
|
70
|
-
traverse2
|
|
71
|
-
);
|
|
72
104
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
function getNextFocusable(container = document.body, options = {}) {
|
|
78
|
-
return getRelativeFocusable(container, 1, options);
|
|
79
|
-
}
|
|
80
|
-
function getPreviousFocusable(container = document.body, options = {}) {
|
|
81
|
-
return getRelativeFocusable(container, -1, options);
|
|
82
|
-
}
|
|
83
|
-
function isFocusable(element, options = {}) {
|
|
84
|
-
if (!(element instanceof Element)) {
|
|
85
|
-
console.warn("Invalid element");
|
|
86
|
-
return false;
|
|
105
|
+
if (typeof composed !== "boolean") {
|
|
106
|
+
console.warn("Invalid composed option. Fallback: false.");
|
|
107
|
+
composed = false;
|
|
87
108
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
109
|
+
if (filter !== void 0 && typeof filter !== "function") {
|
|
110
|
+
console.warn("Invalid filter function. Fallback: no filter function (undefined).");
|
|
111
|
+
filter = void 0;
|
|
91
112
|
}
|
|
92
|
-
if (
|
|
93
|
-
|
|
113
|
+
if (include !== void 0 && typeof include !== "function") {
|
|
114
|
+
console.warn("Invalid include function. Fallback: no include function (undefined).");
|
|
115
|
+
include = void 0;
|
|
94
116
|
}
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return false;
|
|
117
|
+
if (typeof skipNegativeTabIndexCheck !== "boolean") {
|
|
118
|
+
console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
|
|
119
|
+
skipNegativeTabIndexCheck = false;
|
|
99
120
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
121
|
+
if (typeof skipVisibilityCheck !== "boolean") {
|
|
122
|
+
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
123
|
+
skipVisibilityCheck = false;
|
|
102
124
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
visibilityProperty: true
|
|
107
|
-
})) {
|
|
108
|
-
return false;
|
|
125
|
+
if (typeof wrap !== "boolean") {
|
|
126
|
+
console.warn("Invalid wrap option. Fallback: false.");
|
|
127
|
+
wrap = false;
|
|
109
128
|
}
|
|
110
|
-
return
|
|
129
|
+
return {
|
|
130
|
+
anchor,
|
|
131
|
+
composed,
|
|
132
|
+
filter,
|
|
133
|
+
include,
|
|
134
|
+
skipNegativeTabIndexCheck,
|
|
135
|
+
skipVisibilityCheck,
|
|
136
|
+
wrap
|
|
137
|
+
};
|
|
111
138
|
}
|
|
112
139
|
function getRelativeFocusable(container, offset, options) {
|
|
113
140
|
if (!(container instanceof Element)) {
|
|
@@ -232,117 +259,80 @@ function sortByTabIndex(elements) {
|
|
|
232
259
|
}
|
|
233
260
|
return ordered.sort((a, b) => getTabIndex(a) - getTabIndex(b)).concat(natural);
|
|
234
261
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
return true;
|
|
240
|
-
}
|
|
241
|
-
current = current instanceof ShadowRoot ? current.mode === "open" ? current.host : null : current.parentNode;
|
|
242
|
-
}
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
function getComposedChildren(node) {
|
|
246
|
-
if (node instanceof ShadowRoot) {
|
|
247
|
-
return [...node.children];
|
|
248
|
-
}
|
|
249
|
-
if (!(node instanceof Element)) {
|
|
250
|
-
return [];
|
|
262
|
+
function getFocusables(container = document.body, options = {}) {
|
|
263
|
+
if (!(container instanceof Element)) {
|
|
264
|
+
console.warn("Invalid container element. Fallback: <body> element.");
|
|
265
|
+
container = document.body;
|
|
251
266
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
267
|
+
const { composed, filter, include, skipNegativeTabIndexCheck, skipVisibilityCheck } = resolveOptions(options);
|
|
268
|
+
const candidates = [];
|
|
269
|
+
if (!composed && !include) {
|
|
270
|
+
for (const match of container.querySelectorAll(
|
|
271
|
+
!skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR : FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX
|
|
272
|
+
)) {
|
|
273
|
+
match && isFocusable(match, { skipNegativeTabIndexCheck, skipVisibilityCheck }) && candidates.push(match);
|
|
256
274
|
}
|
|
275
|
+
} else {
|
|
276
|
+
let traverse2 = function(node) {
|
|
277
|
+
if (isFocusable(node, { skipNegativeTabIndexCheck, skipVisibilityCheck }) || include?.(node)) {
|
|
278
|
+
candidates.push(node);
|
|
279
|
+
}
|
|
280
|
+
(!composed ? [...node.children] : getComposedChildren(node)).map(traverse2);
|
|
281
|
+
};
|
|
282
|
+
(!composed ? [...container.children] : getComposedChildren(container)).map(traverse2);
|
|
257
283
|
}
|
|
258
|
-
|
|
259
|
-
return [...node.shadowRoot.children];
|
|
260
|
-
}
|
|
261
|
-
return [...node.children];
|
|
262
|
-
}
|
|
263
|
-
function focusElement(element) {
|
|
264
|
-
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
265
|
-
}
|
|
266
|
-
function getActiveElement() {
|
|
267
|
-
let current = document.activeElement;
|
|
268
|
-
while (current?.shadowRoot?.activeElement) {
|
|
269
|
-
current = current.shadowRoot.activeElement;
|
|
270
|
-
}
|
|
271
|
-
return current;
|
|
284
|
+
return normalizeRadioGroup(sortByTabIndex(!filter ? candidates : candidates.filter(filter)));
|
|
272
285
|
}
|
|
273
|
-
function
|
|
274
|
-
return
|
|
275
|
-
}
|
|
276
|
-
function isDisabled(element) {
|
|
277
|
-
return "disabled" in element && !!element.disabled;
|
|
278
|
-
}
|
|
279
|
-
function isFormControl(element) {
|
|
280
|
-
return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(element.tagName);
|
|
281
|
-
}
|
|
282
|
-
function isInert(element) {
|
|
283
|
-
return "inert" in element && !!element.inert;
|
|
286
|
+
function getNextFocusable(container = document.body, options = {}) {
|
|
287
|
+
return getRelativeFocusable(container, 1, options);
|
|
284
288
|
}
|
|
285
|
-
function
|
|
286
|
-
return
|
|
289
|
+
function getPreviousFocusable(container = document.body, options = {}) {
|
|
290
|
+
return getRelativeFocusable(container, -1, options);
|
|
287
291
|
}
|
|
288
|
-
function
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
filter,
|
|
293
|
-
include,
|
|
294
|
-
skipNegativeTabIndexCheck = false,
|
|
295
|
-
skipVisibilityCheck = false,
|
|
296
|
-
wrap = false
|
|
297
|
-
} = options;
|
|
298
|
-
if (!(anchor instanceof Element)) {
|
|
299
|
-
const active = getActiveElement();
|
|
300
|
-
if (active instanceof Element) {
|
|
301
|
-
console.warn("Invalid anchor element. Fallback: active element.");
|
|
302
|
-
anchor = active;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
if (typeof composed !== "boolean") {
|
|
306
|
-
console.warn("Invalid composed option. Fallback: false.");
|
|
307
|
-
composed = false;
|
|
292
|
+
function isFocusable(element, options = {}) {
|
|
293
|
+
if (!(element instanceof Element)) {
|
|
294
|
+
console.warn("Invalid element");
|
|
295
|
+
return false;
|
|
308
296
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
);
|
|
313
|
-
filter = void 0;
|
|
297
|
+
const { skipNegativeTabIndexCheck, skipVisibilityCheck } = resolveOptions(options);
|
|
298
|
+
if (element.hasAttribute("hidden") || isInert(element)) {
|
|
299
|
+
return false;
|
|
314
300
|
}
|
|
315
|
-
if (
|
|
316
|
-
|
|
317
|
-
"Invalid include function. Fallback: no include function (undefined)."
|
|
318
|
-
);
|
|
319
|
-
include = void 0;
|
|
301
|
+
if (!skipNegativeTabIndexCheck && getTabIndex(element) < 0) {
|
|
302
|
+
return false;
|
|
320
303
|
}
|
|
321
|
-
if (
|
|
322
|
-
|
|
323
|
-
|
|
304
|
+
if (!element.matches(
|
|
305
|
+
!skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR : FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX
|
|
306
|
+
)) {
|
|
307
|
+
return false;
|
|
324
308
|
}
|
|
325
|
-
if (
|
|
326
|
-
|
|
327
|
-
skipVisibilityCheck = false;
|
|
309
|
+
if (isDisabledDeep(element)) {
|
|
310
|
+
return false;
|
|
328
311
|
}
|
|
329
|
-
if (
|
|
330
|
-
|
|
331
|
-
|
|
312
|
+
if (!skipVisibilityCheck && !element.checkVisibility({
|
|
313
|
+
contentVisibilityAuto: true,
|
|
314
|
+
opacityProperty: true,
|
|
315
|
+
visibilityProperty: true
|
|
316
|
+
})) {
|
|
317
|
+
return false;
|
|
332
318
|
}
|
|
333
|
-
return
|
|
334
|
-
anchor,
|
|
335
|
-
composed,
|
|
336
|
-
filter,
|
|
337
|
-
include,
|
|
338
|
-
skipNegativeTabIndexCheck,
|
|
339
|
-
skipVisibilityCheck,
|
|
340
|
-
wrap
|
|
341
|
-
};
|
|
319
|
+
return true;
|
|
342
320
|
}
|
|
343
321
|
|
|
344
|
-
// src/
|
|
322
|
+
// src/constants.ts
|
|
345
323
|
var VISUALLY_HIDDEN_CSS = "border: 0; clip: rect(0, 0, 0, 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; user-select: none; white-space: nowrap; width: 1px;";
|
|
324
|
+
|
|
325
|
+
// src/options.ts
|
|
326
|
+
function resolveOptions2(options) {
|
|
327
|
+
let { noInlineStyle = false } = options;
|
|
328
|
+
if (typeof noInlineStyle !== "boolean") {
|
|
329
|
+
console.warn("Invalid noInlineStyle option. Fallback: false.");
|
|
330
|
+
noInlineStyle = false;
|
|
331
|
+
}
|
|
332
|
+
return { noInlineStyle };
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/index.ts
|
|
346
336
|
function createPortal(host, container = document.body, options = {}) {
|
|
347
337
|
if (!(host instanceof Element)) {
|
|
348
338
|
console.warn("Invalid host element");
|
|
@@ -378,7 +368,7 @@ var Portal = class {
|
|
|
378
368
|
container = document.body;
|
|
379
369
|
}
|
|
380
370
|
this.#container = container;
|
|
381
|
-
this.#settings =
|
|
371
|
+
this.#settings = resolveOptions2(options);
|
|
382
372
|
this.#entranceSentinel = this.#createSentinel();
|
|
383
373
|
this.#exitSentinel = this.#createSentinel();
|
|
384
374
|
this.#initialize();
|
|
@@ -411,11 +401,11 @@ var Portal = class {
|
|
|
411
401
|
this.#host.setAttribute("data-portaled", "");
|
|
412
402
|
}
|
|
413
403
|
#onFocus = (event) => {
|
|
414
|
-
const { currentTarget:
|
|
404
|
+
const { currentTarget: target, relatedTarget: previous } = event;
|
|
415
405
|
if (!(previous instanceof Element)) {
|
|
416
406
|
return;
|
|
417
407
|
}
|
|
418
|
-
if (
|
|
408
|
+
if (target === this.#entranceSentinel) {
|
|
419
409
|
if (this.#host.contains(previous)) {
|
|
420
410
|
this.#moveFocus("previous");
|
|
421
411
|
return;
|
|
@@ -434,9 +424,6 @@ var Portal = class {
|
|
|
434
424
|
last ? focusElement(last) : this.#moveFocus("previous");
|
|
435
425
|
};
|
|
436
426
|
#onKeyDown = (event) => {
|
|
437
|
-
if (!(event instanceof KeyboardEvent)) {
|
|
438
|
-
return;
|
|
439
|
-
}
|
|
440
427
|
const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
441
428
|
if (key !== "Tab" || altKey || ctrlKey || metaKey) {
|
|
442
429
|
return;
|
|
@@ -505,14 +492,6 @@ var Portal = class {
|
|
|
505
492
|
const focusable = direction === "previous" ? getPreviousFocusable(document.body, options) : getNextFocusable(document.body, options);
|
|
506
493
|
focusable && focusElement(focusable);
|
|
507
494
|
}
|
|
508
|
-
#resolveOptions(options) {
|
|
509
|
-
let { noInlineStyle = false } = options;
|
|
510
|
-
if (typeof noInlineStyle !== "boolean") {
|
|
511
|
-
console.warn("Invalid noInlineStyle option. Fallback: false.");
|
|
512
|
-
noInlineStyle = false;
|
|
513
|
-
}
|
|
514
|
-
return { noInlineStyle };
|
|
515
|
-
}
|
|
516
495
|
};
|
|
517
496
|
|
|
518
497
|
export { createPortal };
|
package/dist/index.cjs
CHANGED
|
@@ -4,7 +4,21 @@ var attributeUtils = require('@y14e/attribute-utils');
|
|
|
4
4
|
var powerFocusable = require('power-focusable');
|
|
5
5
|
|
|
6
6
|
// src/index.ts
|
|
7
|
+
|
|
8
|
+
// src/constants.ts
|
|
7
9
|
var VISUALLY_HIDDEN_CSS = "border: 0; clip: rect(0, 0, 0, 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; user-select: none; white-space: nowrap; width: 1px;";
|
|
10
|
+
|
|
11
|
+
// src/options.ts
|
|
12
|
+
function resolveOptions(options) {
|
|
13
|
+
let { noInlineStyle = false } = options;
|
|
14
|
+
if (typeof noInlineStyle !== "boolean") {
|
|
15
|
+
console.warn("Invalid noInlineStyle option. Fallback: false.");
|
|
16
|
+
noInlineStyle = false;
|
|
17
|
+
}
|
|
18
|
+
return { noInlineStyle };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
8
22
|
function createPortal(host, container = document.body, options = {}) {
|
|
9
23
|
if (!(host instanceof Element)) {
|
|
10
24
|
console.warn("Invalid host element");
|
|
@@ -40,7 +54,7 @@ var Portal = class {
|
|
|
40
54
|
container = document.body;
|
|
41
55
|
}
|
|
42
56
|
this.#container = container;
|
|
43
|
-
this.#settings =
|
|
57
|
+
this.#settings = resolveOptions(options);
|
|
44
58
|
this.#entranceSentinel = this.#createSentinel();
|
|
45
59
|
this.#exitSentinel = this.#createSentinel();
|
|
46
60
|
this.#initialize();
|
|
@@ -73,11 +87,11 @@ var Portal = class {
|
|
|
73
87
|
this.#host.setAttribute("data-portaled", "");
|
|
74
88
|
}
|
|
75
89
|
#onFocus = (event) => {
|
|
76
|
-
const { currentTarget:
|
|
90
|
+
const { currentTarget: target, relatedTarget: previous } = event;
|
|
77
91
|
if (!(previous instanceof Element)) {
|
|
78
92
|
return;
|
|
79
93
|
}
|
|
80
|
-
if (
|
|
94
|
+
if (target === this.#entranceSentinel) {
|
|
81
95
|
if (this.#host.contains(previous)) {
|
|
82
96
|
this.#moveFocus("previous");
|
|
83
97
|
return;
|
|
@@ -96,9 +110,6 @@ var Portal = class {
|
|
|
96
110
|
last ? powerFocusable.focusElement(last) : this.#moveFocus("previous");
|
|
97
111
|
};
|
|
98
112
|
#onKeyDown = (event) => {
|
|
99
|
-
if (!(event instanceof KeyboardEvent)) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
113
|
const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
103
114
|
if (key !== "Tab" || altKey || ctrlKey || metaKey) {
|
|
104
115
|
return;
|
|
@@ -167,14 +178,6 @@ var Portal = class {
|
|
|
167
178
|
const focusable = direction === "previous" ? powerFocusable.getPreviousFocusable(document.body, options) : powerFocusable.getNextFocusable(document.body, options);
|
|
168
179
|
focusable && powerFocusable.focusElement(focusable);
|
|
169
180
|
}
|
|
170
|
-
#resolveOptions(options) {
|
|
171
|
-
let { noInlineStyle = false } = options;
|
|
172
|
-
if (typeof noInlineStyle !== "boolean") {
|
|
173
|
-
console.warn("Invalid noInlineStyle option. Fallback: false.");
|
|
174
|
-
noInlineStyle = false;
|
|
175
|
-
}
|
|
176
|
-
return { noInlineStyle };
|
|
177
|
-
}
|
|
178
181
|
};
|
|
179
182
|
|
|
180
183
|
exports.createPortal = createPortal;
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,7 +2,21 @@ import { restoreAttributes, saveAttributes } from '@y14e/attribute-utils';
|
|
|
2
2
|
import { containsComposed, focusElement, getActiveElement, getFocusables, getPreviousFocusable, getNextFocusable } from 'power-focusable';
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
5
|
+
|
|
6
|
+
// src/constants.ts
|
|
5
7
|
var VISUALLY_HIDDEN_CSS = "border: 0; clip: rect(0, 0, 0, 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; user-select: none; white-space: nowrap; width: 1px;";
|
|
8
|
+
|
|
9
|
+
// src/options.ts
|
|
10
|
+
function resolveOptions(options) {
|
|
11
|
+
let { noInlineStyle = false } = options;
|
|
12
|
+
if (typeof noInlineStyle !== "boolean") {
|
|
13
|
+
console.warn("Invalid noInlineStyle option. Fallback: false.");
|
|
14
|
+
noInlineStyle = false;
|
|
15
|
+
}
|
|
16
|
+
return { noInlineStyle };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
6
20
|
function createPortal(host, container = document.body, options = {}) {
|
|
7
21
|
if (!(host instanceof Element)) {
|
|
8
22
|
console.warn("Invalid host element");
|
|
@@ -38,7 +52,7 @@ var Portal = class {
|
|
|
38
52
|
container = document.body;
|
|
39
53
|
}
|
|
40
54
|
this.#container = container;
|
|
41
|
-
this.#settings =
|
|
55
|
+
this.#settings = resolveOptions(options);
|
|
42
56
|
this.#entranceSentinel = this.#createSentinel();
|
|
43
57
|
this.#exitSentinel = this.#createSentinel();
|
|
44
58
|
this.#initialize();
|
|
@@ -71,11 +85,11 @@ var Portal = class {
|
|
|
71
85
|
this.#host.setAttribute("data-portaled", "");
|
|
72
86
|
}
|
|
73
87
|
#onFocus = (event) => {
|
|
74
|
-
const { currentTarget:
|
|
88
|
+
const { currentTarget: target, relatedTarget: previous } = event;
|
|
75
89
|
if (!(previous instanceof Element)) {
|
|
76
90
|
return;
|
|
77
91
|
}
|
|
78
|
-
if (
|
|
92
|
+
if (target === this.#entranceSentinel) {
|
|
79
93
|
if (this.#host.contains(previous)) {
|
|
80
94
|
this.#moveFocus("previous");
|
|
81
95
|
return;
|
|
@@ -94,9 +108,6 @@ var Portal = class {
|
|
|
94
108
|
last ? focusElement(last) : this.#moveFocus("previous");
|
|
95
109
|
};
|
|
96
110
|
#onKeyDown = (event) => {
|
|
97
|
-
if (!(event instanceof KeyboardEvent)) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
111
|
const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
101
112
|
if (key !== "Tab" || altKey || ctrlKey || metaKey) {
|
|
102
113
|
return;
|
|
@@ -165,14 +176,6 @@ var Portal = class {
|
|
|
165
176
|
const focusable = direction === "previous" ? getPreviousFocusable(document.body, options) : getNextFocusable(document.body, options);
|
|
166
177
|
focusable && focusElement(focusable);
|
|
167
178
|
}
|
|
168
|
-
#resolveOptions(options) {
|
|
169
|
-
let { noInlineStyle = false } = options;
|
|
170
|
-
if (typeof noInlineStyle !== "boolean") {
|
|
171
|
-
console.warn("Invalid noInlineStyle option. Fallback: false.");
|
|
172
|
-
noInlineStyle = false;
|
|
173
|
-
}
|
|
174
|
-
return { noInlineStyle };
|
|
175
|
-
}
|
|
176
179
|
};
|
|
177
180
|
|
|
178
181
|
export { createPortal };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/portal",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "Lightweight DOM portal (teleport) utility with fully focus management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"a11y",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"esbuild": true
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@y14e/attribute-utils": "^2.0.
|
|
62
|
-
"power-focusable": "^4.
|
|
61
|
+
"@y14e/attribute-utils": "^2.0.18",
|
|
62
|
+
"power-focusable": "^4.5.6"
|
|
63
63
|
}
|
|
64
64
|
}
|