@ariakit/core 0.4.6 → 0.4.8
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/CHANGELOG.md +9 -0
- package/cjs/__chunks/{B4LYZ4EM.cjs → 3QF3ODTR.cjs} +44 -61
- package/cjs/__chunks/{LPDHSEHU.cjs → 7CES7GVE.cjs} +4 -8
- package/cjs/__chunks/{Q2WCPTYS.cjs → 7WYII4AN.cjs} +6 -12
- package/cjs/__chunks/{EEDWPDM2.cjs → BTUHABP4.cjs} +16 -30
- package/cjs/__chunks/{4W3OYRR3.cjs → CCI5VM7E.cjs} +24 -30
- package/cjs/__chunks/{5JEQEZFR.cjs → H6ZQSQQL.cjs} +16 -16
- package/cjs/__chunks/{D7M2PCAQ.cjs → KCEXELK7.cjs} +6 -7
- package/cjs/__chunks/{LTLFSC4X.cjs → N667HVED.cjs} +2 -2
- package/cjs/__chunks/{3HYNC3XA.cjs → PW36G76L.cjs} +25 -29
- package/cjs/__chunks/{AETQC2AR.cjs → QLWAGBAQ.cjs} +20 -22
- package/cjs/__chunks/{B4AKUC4S.cjs → VJAE2Y4T.cjs} +10 -10
- package/cjs/__chunks/XIZWLBI2.cjs +42 -0
- package/cjs/checkbox/checkbox-store.cjs +7 -7
- package/cjs/collection/collection-store.cjs +6 -6
- package/cjs/combobox/combobox-store.cjs +50 -56
- package/cjs/combobox/combobox-store.d.cts +2 -0
- package/cjs/combobox/combobox-store.d.ts +2 -0
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-store.cjs +7 -7
- package/cjs/composite/composite-store.d.cts +5 -1
- package/cjs/composite/composite-store.d.ts +5 -1
- package/cjs/dialog/dialog-store.cjs +6 -6
- package/cjs/disclosure/disclosure-store.cjs +5 -5
- package/cjs/form/form-store.cjs +32 -36
- package/cjs/hovercard/hovercard-store.cjs +8 -8
- package/cjs/index.cjs +1 -1
- package/cjs/menu/menu-bar-store.cjs +8 -8
- package/cjs/menu/menu-store.cjs +37 -42
- package/cjs/menubar/menubar-store.cjs +8 -8
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +13 -13
- package/cjs/select/select-store.cjs +49 -62
- package/cjs/select/select-store.d.cts +2 -0
- package/cjs/select/select-store.d.ts +2 -0
- package/cjs/tab/tab-store.cjs +49 -61
- package/cjs/tab/tab-store.d.cts +10 -4
- package/cjs/tab/tab-store.d.ts +10 -4
- package/cjs/tag/tag-store.cjs +23 -27
- package/cjs/toolbar/toolbar-store.cjs +9 -9
- package/cjs/tooltip/tooltip-store.cjs +15 -15
- package/cjs/utils/array.cjs +1 -1
- package/cjs/utils/dom.cjs +3 -3
- package/cjs/utils/events.cjs +25 -37
- package/cjs/utils/focus.cjs +41 -61
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/misc.d.cts +1 -1
- package/cjs/utils/misc.d.ts +1 -1
- package/cjs/utils/platform.cjs +4 -4
- package/cjs/utils/store.cjs +4 -4
- package/cjs/utils/undo.cjs +3 -3
- package/esm/__chunks/{MFZZDIHG.js → 3UYWTADI.js} +4 -4
- package/esm/__chunks/{EQPTKGFA.js → 6DHTHWXD.js} +10 -16
- package/esm/__chunks/{WCKXDMU7.js → 6E4KKOSB.js} +5 -7
- package/esm/__chunks/{EKIWAN6A.js → 7LM4Q2XB.js} +4 -8
- package/esm/__chunks/{PBSSD2DM.js → D7EIQZAU.js} +8 -12
- package/esm/__chunks/{BRS7GKWU.js → EACLTACN.js} +4 -4
- package/esm/__chunks/{R676XYVY.js → EQQLU3CG.js} +34 -51
- package/esm/__chunks/{I2NJJ3XW.js → HWOIWM4O.js} +6 -12
- package/esm/__chunks/{22HHDS5F.js → PBFD2E7P.js} +15 -29
- package/esm/__chunks/{P3MTNH46.js → PIWLWQMB.js} +4 -4
- package/esm/__chunks/{CLSHHUGK.js → US4USQPI.js} +2 -3
- package/esm/__chunks/{5RJNXXU2.js → YOHCVXJB.js} +1 -1
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +5 -5
- package/esm/combobox/combobox-store.d.ts +2 -0
- package/esm/combobox/combobox-store.js +16 -22
- package/esm/composite/composite-overflow-store.js +6 -6
- package/esm/composite/composite-store.d.ts +5 -1
- package/esm/composite/composite-store.js +6 -6
- package/esm/dialog/dialog-store.js +5 -5
- package/esm/disclosure/disclosure-store.js +4 -4
- package/esm/form/form-store.js +9 -13
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.js +7 -7
- package/esm/menu/menu-store.js +15 -20
- package/esm/menubar/menubar-store.js +7 -7
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +6 -6
- package/esm/select/select-store.d.ts +2 -0
- package/esm/select/select-store.js +22 -35
- package/esm/tab/tab-store.d.ts +10 -4
- package/esm/tab/tab-store.js +18 -30
- package/esm/tag/tag-store.js +11 -15
- package/esm/toolbar/toolbar-store.js +6 -6
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/utils/array.js +1 -1
- package/esm/utils/dom.js +2 -2
- package/esm/utils/events.js +20 -32
- package/esm/utils/focus.js +33 -53
- package/esm/utils/misc.d.ts +1 -1
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +3 -3
- package/esm/utils/store.js +3 -3
- package/esm/utils/undo.js +2 -2
- package/package.json +2 -2
- package/readme.md +18 -0
- package/.eslintignore +0 -6
- package/cjs/__chunks/UEZLSKZ4.cjs +0 -42
- /package/cjs/__chunks/{AV6KTKLE.cjs → 3IVNQNIV.cjs} +0 -0
- /package/esm/__chunks/{4R3V3JGP.js → 3YLGPPWQ.js} +0 -0
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _PW36G76Lcjs = require('../__chunks/PW36G76L.cjs');
|
|
5
|
+
require('../__chunks/CCI5VM7E.cjs');
|
|
6
6
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
7
|
-
require('../__chunks/
|
|
7
|
+
require('../__chunks/3QF3ODTR.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('../__chunks/
|
|
10
|
+
var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
|
|
11
|
+
require('../__chunks/7WYII4AN.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
|
|
16
16
|
|
|
17
17
|
// src/toolbar/toolbar-store.ts
|
|
18
18
|
function createToolbarStore(props = {}) {
|
|
19
19
|
var _a;
|
|
20
20
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
21
|
-
return
|
|
22
|
-
orientation:
|
|
21
|
+
return _PW36G76Lcjs.createCompositeStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), {
|
|
22
|
+
orientation: _BTUHABP4cjs.defaultValue.call(void 0,
|
|
23
23
|
props.orientation,
|
|
24
24
|
syncState == null ? void 0 : syncState.orientation,
|
|
25
25
|
"horizontal"
|
|
26
26
|
),
|
|
27
|
-
focusLoop:
|
|
27
|
+
focusLoop: _BTUHABP4cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _XIZWLBI2cjs = require('../__chunks/XIZWLBI2.cjs');
|
|
5
|
+
require('../__chunks/H6ZQSQQL.cjs');
|
|
6
|
+
require('../__chunks/N667HVED.cjs');
|
|
7
|
+
require('../__chunks/QLWAGBAQ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _3QF3ODTRcjs = require('../__chunks/3QF3ODTR.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
|
|
18
18
|
|
|
19
19
|
// src/tooltip/tooltip-store.ts
|
|
20
20
|
function createTooltipStore(props = {}) {
|
|
@@ -29,20 +29,20 @@ function createTooltipStore(props = {}) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
32
|
-
const hovercard =
|
|
33
|
-
placement:
|
|
32
|
+
const hovercard = _XIZWLBI2cjs.createHovercardStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), {
|
|
33
|
+
placement: _BTUHABP4cjs.defaultValue.call(void 0,
|
|
34
34
|
props.placement,
|
|
35
35
|
syncState == null ? void 0 : syncState.placement,
|
|
36
36
|
"top"
|
|
37
37
|
),
|
|
38
|
-
hideTimeout:
|
|
38
|
+
hideTimeout: _BTUHABP4cjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
|
|
39
39
|
}));
|
|
40
|
-
const initialState =
|
|
41
|
-
type:
|
|
42
|
-
skipTimeout:
|
|
40
|
+
const initialState = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, hovercard.getState()), {
|
|
41
|
+
type: _BTUHABP4cjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
|
|
42
|
+
skipTimeout: _BTUHABP4cjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
|
|
43
43
|
});
|
|
44
|
-
const tooltip =
|
|
45
|
-
return
|
|
44
|
+
const tooltip = _3QF3ODTRcjs.createStore.call(void 0, initialState, hovercard, props.store);
|
|
45
|
+
return _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
|
package/cjs/utils/array.cjs
CHANGED
package/cjs/utils/dom.cjs
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
22
|
-
require('../__chunks/
|
|
21
|
+
var _7WYII4ANcjs = require('../__chunks/7WYII4AN.cjs');
|
|
22
|
+
require('../__chunks/3IVNQNIV.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -39,4 +39,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.canUseDOM =
|
|
42
|
+
exports.canUseDOM = _7WYII4ANcjs.canUseDOM; exports.contains = _7WYII4ANcjs.contains; exports.getActiveElement = _7WYII4ANcjs.getActiveElement; exports.getDocument = _7WYII4ANcjs.getDocument; exports.getPopupItemRole = _7WYII4ANcjs.getPopupItemRole; exports.getPopupRole = _7WYII4ANcjs.getPopupRole; exports.getScrollingElement = _7WYII4ANcjs.getScrollingElement; exports.getTextboxSelection = _7WYII4ANcjs.getTextboxSelection; exports.getTextboxValue = _7WYII4ANcjs.getTextboxValue; exports.getWindow = _7WYII4ANcjs.getWindow; exports.isButton = _7WYII4ANcjs.isButton; exports.isFrame = _7WYII4ANcjs.isFrame; exports.isPartiallyHidden = _7WYII4ANcjs.isPartiallyHidden; exports.isTextField = _7WYII4ANcjs.isTextField; exports.isTextbox = _7WYII4ANcjs.isTextbox; exports.isVisible = _7WYII4ANcjs.isVisible; exports.scrollIntoViewIfNeeded = _7WYII4ANcjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _7WYII4ANcjs.setSelectionRange;
|
package/cjs/utils/events.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _KCEXELK7cjs = require('../__chunks/KCEXELK7.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _7WYII4ANcjs = require('../__chunks/7WYII4AN.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
|
|
12
12
|
|
|
13
13
|
// src/utils/events.ts
|
|
14
14
|
function isPortalEvent(event) {
|
|
15
15
|
return Boolean(
|
|
16
|
-
event.currentTarget && !
|
|
16
|
+
event.currentTarget && !_7WYII4ANcjs.contains.call(void 0, event.currentTarget, event.target)
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
function isSelfTarget(event) {
|
|
@@ -21,35 +21,24 @@ function isSelfTarget(event) {
|
|
|
21
21
|
}
|
|
22
22
|
function isOpeningInNewTab(event) {
|
|
23
23
|
const element = event.currentTarget;
|
|
24
|
-
if (!element)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (isAppleDevice && !event.
|
|
28
|
-
return false;
|
|
29
|
-
if (!isAppleDevice && !event.ctrlKey)
|
|
30
|
-
return false;
|
|
24
|
+
if (!element) return false;
|
|
25
|
+
const isAppleDevice = _KCEXELK7cjs.isApple.call(void 0, );
|
|
26
|
+
if (isAppleDevice && !event.metaKey) return false;
|
|
27
|
+
if (!isAppleDevice && !event.ctrlKey) return false;
|
|
31
28
|
const tagName = element.tagName.toLowerCase();
|
|
32
|
-
if (tagName === "a")
|
|
33
|
-
|
|
34
|
-
if (tagName === "
|
|
35
|
-
return true;
|
|
36
|
-
if (tagName === "input" && element.type === "submit")
|
|
37
|
-
return true;
|
|
29
|
+
if (tagName === "a") return true;
|
|
30
|
+
if (tagName === "button" && element.type === "submit") return true;
|
|
31
|
+
if (tagName === "input" && element.type === "submit") return true;
|
|
38
32
|
return false;
|
|
39
33
|
}
|
|
40
34
|
function isDownloading(event) {
|
|
41
35
|
const element = event.currentTarget;
|
|
42
|
-
if (!element)
|
|
43
|
-
return false;
|
|
36
|
+
if (!element) return false;
|
|
44
37
|
const tagName = element.tagName.toLowerCase();
|
|
45
|
-
if (!event.altKey)
|
|
46
|
-
|
|
47
|
-
if (tagName === "
|
|
48
|
-
|
|
49
|
-
if (tagName === "button" && element.type === "submit")
|
|
50
|
-
return true;
|
|
51
|
-
if (tagName === "input" && element.type === "submit")
|
|
52
|
-
return true;
|
|
38
|
+
if (!event.altKey) return false;
|
|
39
|
+
if (tagName === "a") return true;
|
|
40
|
+
if (tagName === "button" && element.type === "submit") return true;
|
|
41
|
+
if (tagName === "input" && element.type === "submit") return true;
|
|
53
42
|
return false;
|
|
54
43
|
}
|
|
55
44
|
function fireEvent(element, type, eventInit) {
|
|
@@ -59,14 +48,14 @@ function fireEvent(element, type, eventInit) {
|
|
|
59
48
|
function fireBlurEvent(element, eventInit) {
|
|
60
49
|
const event = new FocusEvent("blur", eventInit);
|
|
61
50
|
const defaultAllowed = element.dispatchEvent(event);
|
|
62
|
-
const bubbleInit =
|
|
51
|
+
const bubbleInit = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
|
|
63
52
|
element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
|
|
64
53
|
return defaultAllowed;
|
|
65
54
|
}
|
|
66
55
|
function fireFocusEvent(element, eventInit) {
|
|
67
56
|
const event = new FocusEvent("focus", eventInit);
|
|
68
57
|
const defaultAllowed = element.dispatchEvent(event);
|
|
69
|
-
const bubbleInit =
|
|
58
|
+
const bubbleInit = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
|
|
70
59
|
element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
|
|
71
60
|
return defaultAllowed;
|
|
72
61
|
}
|
|
@@ -81,16 +70,13 @@ function fireClickEvent(element, eventInit) {
|
|
|
81
70
|
function isFocusEventOutside(event, container) {
|
|
82
71
|
const containerElement = container || event.currentTarget;
|
|
83
72
|
const relatedTarget = event.relatedTarget;
|
|
84
|
-
return !relatedTarget || !
|
|
73
|
+
return !relatedTarget || !_7WYII4ANcjs.contains.call(void 0, containerElement, relatedTarget);
|
|
85
74
|
}
|
|
86
75
|
function getInputType(event) {
|
|
87
76
|
const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
|
|
88
|
-
if (!nativeEvent)
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
return;
|
|
92
|
-
if (typeof nativeEvent.inputType !== "string")
|
|
93
|
-
return;
|
|
77
|
+
if (!nativeEvent) return;
|
|
78
|
+
if (!("inputType" in nativeEvent)) return;
|
|
79
|
+
if (typeof nativeEvent.inputType !== "string") return;
|
|
94
80
|
return nativeEvent.inputType;
|
|
95
81
|
}
|
|
96
82
|
function queueBeforeEvent(element, type, callback, timeout) {
|
|
@@ -127,7 +113,9 @@ function addGlobalEventListener(type, listener, options, scope = window) {
|
|
|
127
113
|
scope.document.removeEventListener(type, listener, options);
|
|
128
114
|
} catch (e) {
|
|
129
115
|
}
|
|
130
|
-
|
|
116
|
+
for (const remove of children) {
|
|
117
|
+
remove();
|
|
118
|
+
}
|
|
131
119
|
};
|
|
132
120
|
return removeEventListener;
|
|
133
121
|
}
|
package/cjs/utils/focus.cjs
CHANGED
|
@@ -4,55 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _7WYII4ANcjs = require('../__chunks/7WYII4AN.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
|
|
11
11
|
|
|
12
12
|
// src/utils/focus.ts
|
|
13
13
|
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
|
|
14
14
|
function hasNegativeTabIndex(element) {
|
|
15
|
-
const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10);
|
|
15
|
+
const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
|
|
16
16
|
return tabIndex < 0;
|
|
17
17
|
}
|
|
18
18
|
function isFocusable(element) {
|
|
19
|
-
if (!element.matches(selector))
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
return false;
|
|
23
|
-
if (element.closest("[inert]"))
|
|
24
|
-
return false;
|
|
19
|
+
if (!element.matches(selector)) return false;
|
|
20
|
+
if (!_7WYII4ANcjs.isVisible.call(void 0, element)) return false;
|
|
21
|
+
if (element.closest("[inert]")) return false;
|
|
25
22
|
return true;
|
|
26
23
|
}
|
|
27
24
|
function isTabbable(element) {
|
|
28
|
-
if (!isFocusable(element))
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
if (!element.form)
|
|
35
|
-
return true;
|
|
36
|
-
if (element.checked)
|
|
37
|
-
return true;
|
|
38
|
-
if (element.type !== "radio")
|
|
39
|
-
return true;
|
|
25
|
+
if (!isFocusable(element)) return false;
|
|
26
|
+
if (hasNegativeTabIndex(element)) return false;
|
|
27
|
+
if (!("form" in element)) return true;
|
|
28
|
+
if (!element.form) return true;
|
|
29
|
+
if (element.checked) return true;
|
|
30
|
+
if (element.type !== "radio") return true;
|
|
40
31
|
const radioGroup = element.form.elements.namedItem(element.name);
|
|
41
|
-
if (!radioGroup)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (!activeElement)
|
|
47
|
-
|
|
48
|
-
if (activeElement
|
|
49
|
-
return true;
|
|
50
|
-
if (!("form" in activeElement))
|
|
51
|
-
return true;
|
|
52
|
-
if (activeElement.form !== element.form)
|
|
53
|
-
return true;
|
|
54
|
-
if (activeElement.name !== element.name)
|
|
55
|
-
return true;
|
|
32
|
+
if (!radioGroup) return true;
|
|
33
|
+
if (!("length" in radioGroup)) return true;
|
|
34
|
+
const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, element);
|
|
35
|
+
if (!activeElement) return true;
|
|
36
|
+
if (activeElement === element) return true;
|
|
37
|
+
if (!("form" in activeElement)) return true;
|
|
38
|
+
if (activeElement.form !== element.form) return true;
|
|
39
|
+
if (activeElement.name !== element.name) return true;
|
|
56
40
|
return false;
|
|
57
41
|
}
|
|
58
42
|
function getAllFocusableIn(container, includeContainer) {
|
|
@@ -64,7 +48,7 @@ function getAllFocusableIn(container, includeContainer) {
|
|
|
64
48
|
}
|
|
65
49
|
const focusableElements = elements.filter(isFocusable);
|
|
66
50
|
focusableElements.forEach((element, i) => {
|
|
67
|
-
if (
|
|
51
|
+
if (_7WYII4ANcjs.isFrame.call(void 0, element) && element.contentDocument) {
|
|
68
52
|
const frameBody = element.contentDocument.body;
|
|
69
53
|
focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
|
|
70
54
|
}
|
|
@@ -90,7 +74,7 @@ function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
|
|
|
90
74
|
tabbableElements.unshift(container);
|
|
91
75
|
}
|
|
92
76
|
tabbableElements.forEach((element, i) => {
|
|
93
|
-
if (
|
|
77
|
+
if (_7WYII4ANcjs.isFrame.call(void 0, element) && element.contentDocument) {
|
|
94
78
|
const frameBody = element.contentDocument.body;
|
|
95
79
|
const allFrameTabbable = getAllTabbableIn(
|
|
96
80
|
frameBody,
|
|
@@ -131,7 +115,7 @@ function getLastTabbable(fallbackToFocusable) {
|
|
|
131
115
|
return getLastTabbableIn(document.body, false, fallbackToFocusable);
|
|
132
116
|
}
|
|
133
117
|
function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
|
|
134
|
-
const activeElement =
|
|
118
|
+
const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, container);
|
|
135
119
|
const allFocusable = getAllFocusableIn(container, includeContainer);
|
|
136
120
|
const activeIndex = allFocusable.indexOf(activeElement);
|
|
137
121
|
const nextFocusableElements = allFocusable.slice(activeIndex + 1);
|
|
@@ -146,7 +130,7 @@ function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
|
|
|
146
130
|
);
|
|
147
131
|
}
|
|
148
132
|
function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
|
|
149
|
-
const activeElement =
|
|
133
|
+
const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, container);
|
|
150
134
|
const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
|
|
151
135
|
const activeIndex = allFocusable.indexOf(activeElement);
|
|
152
136
|
const previousFocusableElements = allFocusable.slice(activeIndex + 1);
|
|
@@ -167,29 +151,21 @@ function getClosestFocusable(element) {
|
|
|
167
151
|
return element || null;
|
|
168
152
|
}
|
|
169
153
|
function hasFocus(element) {
|
|
170
|
-
const activeElement =
|
|
171
|
-
if (!activeElement)
|
|
172
|
-
|
|
173
|
-
if (activeElement === element)
|
|
174
|
-
return true;
|
|
154
|
+
const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, element);
|
|
155
|
+
if (!activeElement) return false;
|
|
156
|
+
if (activeElement === element) return true;
|
|
175
157
|
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
|
|
176
|
-
if (!activeDescendant)
|
|
177
|
-
return false;
|
|
158
|
+
if (!activeDescendant) return false;
|
|
178
159
|
return activeDescendant === element.id;
|
|
179
160
|
}
|
|
180
161
|
function hasFocusWithin(element) {
|
|
181
|
-
const activeElement =
|
|
182
|
-
if (!activeElement)
|
|
183
|
-
|
|
184
|
-
if (_Q2WCPTYScjs.contains.call(void 0, element, activeElement))
|
|
185
|
-
return true;
|
|
162
|
+
const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, element);
|
|
163
|
+
if (!activeElement) return false;
|
|
164
|
+
if (_7WYII4ANcjs.contains.call(void 0, element, activeElement)) return true;
|
|
186
165
|
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
|
|
187
|
-
if (!activeDescendant)
|
|
188
|
-
|
|
189
|
-
if (
|
|
190
|
-
return false;
|
|
191
|
-
if (activeDescendant === element.id)
|
|
192
|
-
return true;
|
|
166
|
+
if (!activeDescendant) return false;
|
|
167
|
+
if (!("id" in element)) return false;
|
|
168
|
+
if (activeDescendant === element.id) return true;
|
|
193
169
|
return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
|
|
194
170
|
}
|
|
195
171
|
function focusIfNeeded(element) {
|
|
@@ -205,7 +181,9 @@ function disableFocus(element) {
|
|
|
205
181
|
}
|
|
206
182
|
function disableFocusIn(container, includeContainer) {
|
|
207
183
|
const tabbableElements = getAllTabbableIn(container, includeContainer);
|
|
208
|
-
tabbableElements
|
|
184
|
+
for (const element of tabbableElements) {
|
|
185
|
+
disableFocus(element);
|
|
186
|
+
}
|
|
209
187
|
}
|
|
210
188
|
function restoreFocusIn(container) {
|
|
211
189
|
const elements = container.querySelectorAll("[data-tabindex]");
|
|
@@ -221,14 +199,16 @@ function restoreFocusIn(container) {
|
|
|
221
199
|
if (container.hasAttribute("data-tabindex")) {
|
|
222
200
|
restoreTabIndex(container);
|
|
223
201
|
}
|
|
224
|
-
elements
|
|
202
|
+
for (const element of elements) {
|
|
203
|
+
restoreTabIndex(element);
|
|
204
|
+
}
|
|
225
205
|
}
|
|
226
206
|
function focusIntoView(element, options) {
|
|
227
207
|
if (!("scrollIntoView" in element)) {
|
|
228
208
|
element.focus();
|
|
229
209
|
} else {
|
|
230
210
|
element.focus({ preventScroll: true });
|
|
231
|
-
element.scrollIntoView(
|
|
211
|
+
element.scrollIntoView(_3IVNQNIVcjs.__spreadValues.call(void 0, { block: "nearest", inline: "nearest" }, options));
|
|
232
212
|
}
|
|
233
213
|
}
|
|
234
214
|
|
package/cjs/utils/misc.cjs
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
25
|
-
require('../__chunks/
|
|
24
|
+
var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
|
|
25
|
+
require('../__chunks/3IVNQNIV.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -45,4 +45,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
exports.afterPaint =
|
|
48
|
+
exports.afterPaint = _BTUHABP4cjs.afterPaint; exports.applyState = _BTUHABP4cjs.applyState; exports.beforePaint = _BTUHABP4cjs.beforePaint; exports.chain = _BTUHABP4cjs.chain; exports.cx = _BTUHABP4cjs.cx; exports.defaultValue = _BTUHABP4cjs.defaultValue; exports.disabledFromProps = _BTUHABP4cjs.disabledFromProps; exports.getKeys = _BTUHABP4cjs.getKeys; exports.hasOwnProperty = _BTUHABP4cjs.hasOwnProperty; exports.identity = _BTUHABP4cjs.identity; exports.invariant = _BTUHABP4cjs.invariant; exports.isEmpty = _BTUHABP4cjs.isEmpty; exports.isFalsyBooleanCallback = _BTUHABP4cjs.isFalsyBooleanCallback; exports.isInteger = _BTUHABP4cjs.isInteger; exports.isObject = _BTUHABP4cjs.isObject; exports.noop = _BTUHABP4cjs.noop; exports.normalizeString = _BTUHABP4cjs.normalizeString; exports.omit = _BTUHABP4cjs.omit; exports.pick = _BTUHABP4cjs.pick; exports.removeUndefinedValues = _BTUHABP4cjs.removeUndefinedValues; exports.shallowEqual = _BTUHABP4cjs.shallowEqual;
|
package/cjs/utils/misc.d.cts
CHANGED
|
@@ -99,7 +99,7 @@ export declare function invariant(condition: any, message?: string | boolean): a
|
|
|
99
99
|
/**
|
|
100
100
|
* Similar to `Object.keys` but returns a type-safe array of keys.
|
|
101
101
|
*/
|
|
102
|
-
export declare function getKeys<T extends object>(obj: T):
|
|
102
|
+
export declare function getKeys<T extends object>(obj: T): Array<keyof T>;
|
|
103
103
|
/**
|
|
104
104
|
* Checks whether a boolean event prop (e.g., hideOnInteractOutside) was
|
|
105
105
|
* intentionally set to false, either with a boolean value or a callback that
|
package/cjs/utils/misc.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ export declare function invariant(condition: any, message?: string | boolean): a
|
|
|
99
99
|
/**
|
|
100
100
|
* Similar to `Object.keys` but returns a type-safe array of keys.
|
|
101
101
|
*/
|
|
102
|
-
export declare function getKeys<T extends object>(obj: T):
|
|
102
|
+
export declare function getKeys<T extends object>(obj: T): Array<keyof T>;
|
|
103
103
|
/**
|
|
104
104
|
* Checks whether a boolean event prop (e.g., hideOnInteractOutside) was
|
|
105
105
|
* intentionally set to false, either with a boolean value or a callback that
|
package/cjs/utils/platform.cjs
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../__chunks/
|
|
10
|
-
require('../__chunks/
|
|
8
|
+
var _KCEXELK7cjs = require('../__chunks/KCEXELK7.cjs');
|
|
9
|
+
require('../__chunks/7WYII4AN.cjs');
|
|
10
|
+
require('../__chunks/3IVNQNIV.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.isApple =
|
|
17
|
+
exports.isApple = _KCEXELK7cjs.isApple; exports.isFirefox = _KCEXELK7cjs.isFirefox; exports.isMac = _KCEXELK7cjs.isMac; exports.isSafari = _KCEXELK7cjs.isSafari; exports.isTouchDevice = _KCEXELK7cjs.isTouchDevice;
|
package/cjs/utils/store.cjs
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
require('../__chunks/
|
|
15
|
-
require('../__chunks/
|
|
13
|
+
var _3QF3ODTRcjs = require('../__chunks/3QF3ODTR.cjs');
|
|
14
|
+
require('../__chunks/BTUHABP4.cjs');
|
|
15
|
+
require('../__chunks/3IVNQNIV.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -24,4 +24,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.batch =
|
|
27
|
+
exports.batch = _3QF3ODTRcjs.batch; exports.createStore = _3QF3ODTRcjs.createStore; exports.init = _3QF3ODTRcjs.init; exports.mergeStore = _3QF3ODTRcjs.mergeStore; exports.omit = _3QF3ODTRcjs.omit; exports.pick = _3QF3ODTRcjs.pick; exports.setup = _3QF3ODTRcjs.setup; exports.subscribe = _3QF3ODTRcjs.subscribe; exports.sync = _3QF3ODTRcjs.sync; exports.throwOnConflictingProps = _3QF3ODTRcjs.throwOnConflictingProps;
|
package/cjs/utils/undo.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../__chunks/
|
|
5
|
+
var _7CES7GVEcjs = require('../__chunks/7CES7GVE.cjs');
|
|
6
|
+
require('../__chunks/3IVNQNIV.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.UndoManager =
|
|
10
|
+
exports.UndoManager = _7CES7GVEcjs.UndoManager; exports.createUndoManager = _7CES7GVEcjs.createUndoManager;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDialogStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./YOHCVXJB.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
mergeStore,
|
|
8
8
|
omit,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./EQQLU3CG.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./PBFD2E7P.js";
|
|
14
14
|
import {
|
|
15
15
|
__objRest,
|
|
16
16
|
__spreadProps,
|
|
17
17
|
__spreadValues
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./3YLGPPWQ.js";
|
|
19
19
|
|
|
20
20
|
// src/popover/popover-store.ts
|
|
21
21
|
function createPopoverStore(_a = {}) {
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
init,
|
|
6
6
|
setup,
|
|
7
7
|
throwOnConflictingProps
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./EQQLU3CG.js";
|
|
9
9
|
import {
|
|
10
10
|
chain,
|
|
11
11
|
defaultValue
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./PBFD2E7P.js";
|
|
13
13
|
import {
|
|
14
14
|
getDocument
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./HWOIWM4O.js";
|
|
16
16
|
import {
|
|
17
17
|
__spreadProps,
|
|
18
18
|
__spreadValues
|
|
19
|
-
} from "./
|
|
19
|
+
} from "./3YLGPPWQ.js";
|
|
20
20
|
|
|
21
21
|
// src/collection/collection-store.ts
|
|
22
22
|
function isElementPreceding(a, b) {
|
|
@@ -30,10 +30,8 @@ function sortBasedOnDOMPosition(items) {
|
|
|
30
30
|
pairs.sort(([indexA, a], [indexB, b]) => {
|
|
31
31
|
const elementA = a.element;
|
|
32
32
|
const elementB = b.element;
|
|
33
|
-
if (elementA === elementB)
|
|
34
|
-
|
|
35
|
-
if (!elementA || !elementB)
|
|
36
|
-
return 0;
|
|
33
|
+
if (elementA === elementB) return 0;
|
|
34
|
+
if (!elementA || !elementB) return 0;
|
|
37
35
|
if (isElementPreceding(elementA, elementB)) {
|
|
38
36
|
if (indexA > indexB) {
|
|
39
37
|
isOrderDifferent = true;
|
|
@@ -104,8 +102,7 @@ function createCollectionStore(props = {}) {
|
|
|
104
102
|
let firstRun = true;
|
|
105
103
|
let raf = requestAnimationFrame(() => {
|
|
106
104
|
const { renderedItems } = collection.getState();
|
|
107
|
-
if (state.renderedItems === renderedItems)
|
|
108
|
-
return;
|
|
105
|
+
if (state.renderedItems === renderedItems) return;
|
|
109
106
|
sortItems(state.renderedItems);
|
|
110
107
|
});
|
|
111
108
|
if (typeof IntersectionObserver !== "function") {
|
|
@@ -122,8 +119,7 @@ function createCollectionStore(props = {}) {
|
|
|
122
119
|
const root = getCommonParent(state.renderedItems);
|
|
123
120
|
const observer = new IntersectionObserver(ioCallback, { root });
|
|
124
121
|
for (const item of state.renderedItems) {
|
|
125
|
-
if (!item.element)
|
|
126
|
-
continue;
|
|
122
|
+
if (!item.element) continue;
|
|
127
123
|
observer.observe(item.element);
|
|
128
124
|
}
|
|
129
125
|
return () => {
|
|
@@ -157,8 +153,7 @@ function createCollectionStore(props = {}) {
|
|
|
157
153
|
return items2.filter(({ id }) => id !== item.id);
|
|
158
154
|
}
|
|
159
155
|
const index = items2.findIndex(({ id }) => id === item.id);
|
|
160
|
-
if (index === -1)
|
|
161
|
-
return items2;
|
|
156
|
+
if (index === -1) return items2;
|
|
162
157
|
const nextItems = items2.slice();
|
|
163
158
|
nextItems[index] = prevItem;
|
|
164
159
|
itemsMap.set(item.id, prevItem);
|
|
@@ -182,8 +177,7 @@ function createCollectionStore(props = {}) {
|
|
|
182
177
|
)
|
|
183
178
|
),
|
|
184
179
|
item: (id) => {
|
|
185
|
-
if (!id)
|
|
186
|
-
return null;
|
|
180
|
+
if (!id) return null;
|
|
187
181
|
let item = itemsMap.get(id);
|
|
188
182
|
if (!item) {
|
|
189
183
|
const { items: items2 } = collection.getState();
|