@ariakit/core 0.4.5 → 0.4.7
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 +12 -0
- package/cjs/__chunks/{QD2A4YF6.cjs → 3COGJMN3.cjs} +11 -11
- package/cjs/__chunks/{MHZQJPY3.cjs → 5BQ2XS3R.cjs} +4 -4
- package/cjs/__chunks/{2D5LEVE7.cjs → D7M2PCAQ.cjs} +6 -6
- package/cjs/__chunks/{LTLFSC4X.cjs → DIYYVJDK.cjs} +2 -2
- package/cjs/__chunks/{AETQC2AR.cjs → LAYUSNGM.cjs} +11 -11
- package/cjs/__chunks/{KL74MAHB.cjs → LBFF2BBK.cjs} +6 -6
- package/cjs/__chunks/{B4LYZ4EM.cjs → M2NNCFIJ.cjs} +13 -11
- package/cjs/__chunks/{5JEQEZFR.cjs → MB5TLEVH.cjs} +7 -7
- package/cjs/__chunks/{IMYW2UAC.cjs → Q2WCPTYS.cjs} +4 -22
- package/cjs/__chunks/{UEZLSKZ4.cjs → XVL5HZ27.cjs} +4 -4
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/checkbox/checkbox-store.d.cts +2 -2
- package/cjs/checkbox/checkbox-store.d.ts +2 -2
- package/cjs/collection/collection-store.cjs +4 -4
- package/cjs/collection/collection-store.d.cts +2 -2
- package/cjs/collection/collection-store.d.ts +2 -2
- package/cjs/combobox/combobox-store.cjs +35 -26
- package/cjs/combobox/combobox-store.d.cts +7 -5
- package/cjs/combobox/combobox-store.d.ts +7 -5
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-overflow-store.d.cts +2 -2
- package/cjs/composite/composite-overflow-store.d.ts +2 -2
- package/cjs/composite/composite-store.cjs +5 -5
- package/cjs/composite/composite-store.d.cts +8 -4
- package/cjs/composite/composite-store.d.ts +8 -4
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/dialog/dialog-store.d.cts +2 -2
- package/cjs/dialog/dialog-store.d.ts +2 -2
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/disclosure/disclosure-store.d.cts +2 -2
- package/cjs/disclosure/disclosure-store.d.ts +2 -2
- package/cjs/form/form-store.cjs +8 -8
- package/cjs/form/form-store.d.cts +4 -4
- package/cjs/form/form-store.d.ts +4 -4
- package/cjs/form/types.d.cts +3 -3
- package/cjs/form/types.d.ts +3 -3
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard-store.d.cts +3 -3
- package/cjs/hovercard/hovercard-store.d.ts +3 -3
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-bar-store.d.cts +2 -2
- package/cjs/menu/menu-bar-store.d.ts +2 -2
- package/cjs/menu/menu-store.cjs +19 -19
- package/cjs/menu/menu-store.d.cts +6 -6
- package/cjs/menu/menu-store.d.ts +6 -6
- package/cjs/menubar/menubar-store.cjs +6 -6
- package/cjs/menubar/menubar-store.d.cts +2 -2
- package/cjs/menubar/menubar-store.d.ts +2 -2
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover-store.d.cts +3 -3
- package/cjs/popover/popover-store.d.ts +3 -3
- package/cjs/radio/radio-store.cjs +6 -6
- package/cjs/radio/radio-store.d.cts +3 -3
- package/cjs/radio/radio-store.d.ts +3 -3
- package/cjs/select/select-store.cjs +31 -21
- package/cjs/select/select-store.d.cts +19 -9
- package/cjs/select/select-store.d.ts +19 -9
- package/cjs/tab/tab-store.cjs +58 -25
- package/cjs/tab/tab-store.d.cts +17 -10
- package/cjs/tab/tab-store.d.ts +17 -10
- package/cjs/tag/tag-store.cjs +8 -8
- package/cjs/tag/tag-store.d.cts +3 -3
- package/cjs/tag/tag-store.d.ts +3 -3
- package/cjs/toolbar/toolbar-store.cjs +5 -5
- package/cjs/toolbar/toolbar-store.d.cts +2 -2
- package/cjs/toolbar/toolbar-store.d.ts +2 -2
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/tooltip/tooltip-store.d.cts +2 -2
- package/cjs/tooltip/tooltip-store.d.ts +2 -2
- package/cjs/utils/dom.cjs +2 -6
- package/cjs/utils/dom.d.cts +1 -17
- package/cjs/utils/dom.d.ts +1 -17
- package/cjs/utils/events.cjs +23 -16
- package/cjs/utils/events.d.cts +1 -1
- package/cjs/utils/events.d.ts +1 -1
- package/cjs/utils/focus.cjs +20 -18
- package/cjs/utils/focus.d.cts +1 -1
- package/cjs/utils/focus.d.ts +1 -1
- package/cjs/utils/misc.d.cts +1 -1
- package/cjs/utils/misc.d.ts +1 -1
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.cjs +2 -2
- package/cjs/utils/store.d.cts +3 -3
- package/cjs/utils/store.d.ts +3 -3
- package/esm/__chunks/{QAI5BPCY.js → CLSHHUGK.js} +1 -1
- package/esm/__chunks/{BRS7GKWU.js → E4HA32QI.js} +2 -2
- package/esm/__chunks/{IUORCTET.js → I2NJJ3XW.js} +3 -21
- package/esm/__chunks/{ABMC67JW.js → I2WJ7JBQ.js} +2 -2
- package/esm/__chunks/{WCKXDMU7.js → KDSZSVV5.js} +1 -1
- package/esm/__chunks/{R676XYVY.js → KLPDXTDE.js} +13 -11
- package/esm/__chunks/{5RJNXXU2.js → NWACXGIN.js} +1 -1
- package/esm/__chunks/{K7A7LTR3.js → RCLYDUHE.js} +2 -2
- package/esm/__chunks/{MFZZDIHG.js → SAZZJI72.js} +2 -2
- package/esm/__chunks/{YVUNPQHS.js → VH2P7HEP.js} +2 -2
- package/esm/checkbox/checkbox-store.d.ts +2 -2
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.d.ts +2 -2
- package/esm/collection/collection-store.js +3 -3
- package/esm/combobox/combobox-store.d.ts +7 -5
- package/esm/combobox/combobox-store.js +20 -11
- package/esm/composite/composite-overflow-store.d.ts +2 -2
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.d.ts +8 -4
- package/esm/composite/composite-store.js +4 -4
- package/esm/dialog/dialog-store.d.ts +2 -2
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.d.ts +2 -2
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.d.ts +4 -4
- package/esm/form/form-store.js +3 -3
- package/esm/form/types.d.ts +3 -3
- package/esm/hovercard/hovercard-store.d.ts +3 -3
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.d.ts +2 -2
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.d.ts +6 -6
- package/esm/menu/menu-store.js +8 -8
- package/esm/menubar/menubar-store.d.ts +2 -2
- package/esm/menubar/menubar-store.js +5 -5
- package/esm/popover/popover-store.d.ts +3 -3
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.d.ts +3 -3
- package/esm/radio/radio-store.js +4 -4
- package/esm/select/select-store.d.ts +19 -9
- package/esm/select/select-store.js +19 -9
- package/esm/tab/tab-store.d.ts +17 -10
- package/esm/tab/tab-store.js +44 -11
- package/esm/tag/tag-store.d.ts +3 -3
- package/esm/tag/tag-store.js +4 -4
- package/esm/toolbar/toolbar-store.d.ts +2 -2
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/tooltip/tooltip-store.d.ts +2 -2
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/utils/dom.d.ts +1 -17
- package/esm/utils/dom.js +1 -5
- package/esm/utils/events.d.ts +1 -1
- package/esm/utils/events.js +20 -13
- package/esm/utils/focus.d.ts +1 -1
- package/esm/utils/focus.js +12 -10
- package/esm/utils/misc.d.ts +1 -1
- package/esm/utils/platform.js +2 -2
- package/esm/utils/store.d.ts +3 -3
- package/esm/utils/store.js +1 -1
- package/package.json +2 -2
- package/.eslintignore +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ariakit/core
|
|
2
2
|
|
|
3
|
+
## 0.4.7
|
|
4
|
+
|
|
5
|
+
- Improved JSDocs.
|
|
6
|
+
|
|
7
|
+
## 0.4.6
|
|
8
|
+
|
|
9
|
+
- Ensured [Combobox](https://ariakit.org/components/combobox) uses roving tabindex to manage focus on mobile Safari.
|
|
10
|
+
- Added a new `listElement` state to the Select store.
|
|
11
|
+
- Removed unnecessary utility functions: `closest`, `matches`.
|
|
12
|
+
- Improved use of [Tab](https://ariakit.org/components/tab) components within [Select](https://ariakit.org/components/select) widgets.
|
|
13
|
+
- Improved JSDocs.
|
|
14
|
+
|
|
3
15
|
## 0.4.5
|
|
4
16
|
|
|
5
17
|
- Added new `undo` utils.
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _M2NNCFIJcjs = require('./M2NNCFIJ.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _Q2WCPTYScjs = require('./Q2WCPTYS.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -62,14 +62,14 @@ function getCommonParent(items) {
|
|
|
62
62
|
}
|
|
63
63
|
parentElement = parentElement.parentElement;
|
|
64
64
|
}
|
|
65
|
-
return
|
|
65
|
+
return _Q2WCPTYScjs.getDocument.call(void 0, parentElement).body;
|
|
66
66
|
}
|
|
67
67
|
function getPrivateStore(store) {
|
|
68
68
|
return store == null ? void 0 : store.__unstablePrivateStore;
|
|
69
69
|
}
|
|
70
70
|
function createCollectionStore(props = {}) {
|
|
71
71
|
var _a;
|
|
72
|
-
|
|
72
|
+
_M2NNCFIJcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
73
73
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
74
74
|
const items = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
75
75
|
props.items,
|
|
@@ -83,24 +83,24 @@ function createCollectionStore(props = {}) {
|
|
|
83
83
|
renderedItems: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
|
|
84
84
|
};
|
|
85
85
|
const syncPrivateStore = getPrivateStore(props.store);
|
|
86
|
-
const privateStore =
|
|
86
|
+
const privateStore = _M2NNCFIJcjs.createStore.call(void 0,
|
|
87
87
|
{ items, renderedItems: initialState.renderedItems },
|
|
88
88
|
syncPrivateStore
|
|
89
89
|
);
|
|
90
|
-
const collection =
|
|
90
|
+
const collection = _M2NNCFIJcjs.createStore.call(void 0, initialState, props.store);
|
|
91
91
|
const sortItems = (renderedItems) => {
|
|
92
92
|
const sortedItems = sortBasedOnDOMPosition(renderedItems);
|
|
93
93
|
privateStore.setState("renderedItems", sortedItems);
|
|
94
94
|
collection.setState("renderedItems", sortedItems);
|
|
95
95
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return
|
|
96
|
+
_M2NNCFIJcjs.setup.call(void 0, collection, () => _M2NNCFIJcjs.init.call(void 0, privateStore));
|
|
97
|
+
_M2NNCFIJcjs.setup.call(void 0, privateStore, () => {
|
|
98
|
+
return _M2NNCFIJcjs.batch.call(void 0, privateStore, ["items"], (state) => {
|
|
99
99
|
collection.setState("items", state.items);
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
|
-
|
|
103
|
-
return
|
|
102
|
+
_M2NNCFIJcjs.setup.call(void 0, privateStore, () => {
|
|
103
|
+
return _M2NNCFIJcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
|
|
104
104
|
let firstRun = true;
|
|
105
105
|
let raf = requestAnimationFrame(() => {
|
|
106
106
|
const { renderedItems } = collection.getState();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _LBFF2BBKcjs = require('./LBFF2BBK.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _M2NNCFIJcjs = require('./M2NNCFIJ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
|
|
@@ -17,7 +17,7 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
|
17
17
|
function createMenubarStore(props = {}) {
|
|
18
18
|
var _a;
|
|
19
19
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
-
const composite =
|
|
20
|
+
const composite = _LBFF2BBKcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
21
21
|
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
22
22
|
props.orientation,
|
|
23
23
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -26,7 +26,7 @@ function createMenubarStore(props = {}) {
|
|
|
26
26
|
focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
27
27
|
}));
|
|
28
28
|
const initialState = _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState());
|
|
29
|
-
const menubar =
|
|
29
|
+
const menubar = _M2NNCFIJcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
30
30
|
return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), menubar);
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _Q2WCPTYScjs = require('./Q2WCPTYS.cjs');
|
|
5
5
|
|
|
6
6
|
// src/utils/platform.ts
|
|
7
7
|
function isTouchDevice() {
|
|
8
|
-
return
|
|
8
|
+
return _Q2WCPTYScjs.canUseDOM && !!navigator.maxTouchPoints;
|
|
9
9
|
}
|
|
10
10
|
function isApple() {
|
|
11
|
-
if (!
|
|
11
|
+
if (!_Q2WCPTYScjs.canUseDOM)
|
|
12
12
|
return false;
|
|
13
13
|
return /mac|iphone|ipad|ipod/i.test(navigator.platform);
|
|
14
14
|
}
|
|
15
15
|
function isSafari() {
|
|
16
|
-
return
|
|
16
|
+
return _Q2WCPTYScjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
|
|
17
17
|
}
|
|
18
18
|
function isFirefox() {
|
|
19
|
-
return
|
|
19
|
+
return _Q2WCPTYScjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
|
|
20
20
|
}
|
|
21
21
|
function isMac() {
|
|
22
|
-
return
|
|
22
|
+
return _Q2WCPTYScjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _LAYUSNGMcjs = require('./LAYUSNGM.cjs');
|
|
5
5
|
|
|
6
6
|
// src/dialog/dialog-store.ts
|
|
7
7
|
function createDialogStore(props = {}) {
|
|
8
|
-
return
|
|
8
|
+
return _LAYUSNGMcjs.createDisclosureStore.call(void 0, props);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _M2NNCFIJcjs = require('./M2NNCFIJ.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
|
|
@@ -18,11 +18,11 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
|
18
18
|
|
|
19
19
|
// src/disclosure/disclosure-store.ts
|
|
20
20
|
function createDisclosureStore(props = {}) {
|
|
21
|
-
const store =
|
|
21
|
+
const store = _M2NNCFIJcjs.mergeStore.call(void 0,
|
|
22
22
|
props.store,
|
|
23
|
-
|
|
23
|
+
_M2NNCFIJcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
|
|
24
24
|
);
|
|
25
|
-
|
|
25
|
+
_M2NNCFIJcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
26
26
|
const syncState = store == null ? void 0 : store.getState();
|
|
27
27
|
const open = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
28
28
|
props.open,
|
|
@@ -39,26 +39,26 @@ function createDisclosureStore(props = {}) {
|
|
|
39
39
|
contentElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
|
|
40
40
|
disclosureElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
|
|
41
41
|
};
|
|
42
|
-
const disclosure =
|
|
43
|
-
|
|
42
|
+
const disclosure = _M2NNCFIJcjs.createStore.call(void 0, initialState, store);
|
|
43
|
+
_M2NNCFIJcjs.setup.call(void 0,
|
|
44
44
|
disclosure,
|
|
45
|
-
() =>
|
|
45
|
+
() => _M2NNCFIJcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
|
|
46
46
|
if (state.animated)
|
|
47
47
|
return;
|
|
48
48
|
disclosure.setState("animating", false);
|
|
49
49
|
})
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
_M2NNCFIJcjs.setup.call(void 0,
|
|
52
52
|
disclosure,
|
|
53
|
-
() =>
|
|
53
|
+
() => _M2NNCFIJcjs.subscribe.call(void 0, disclosure, ["open"], () => {
|
|
54
54
|
if (!disclosure.getState().animated)
|
|
55
55
|
return;
|
|
56
56
|
disclosure.setState("animating", true);
|
|
57
57
|
})
|
|
58
58
|
);
|
|
59
|
-
|
|
59
|
+
_M2NNCFIJcjs.setup.call(void 0,
|
|
60
60
|
disclosure,
|
|
61
|
-
() =>
|
|
61
|
+
() => _M2NNCFIJcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
|
|
62
62
|
disclosure.setState("mounted", state.open || state.animating);
|
|
63
63
|
})
|
|
64
64
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _3COGJMN3cjs = require('./3COGJMN3.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@ var _ULSPM3Y3cjs = require('./ULSPM3Y3.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _M2NNCFIJcjs = require('./M2NNCFIJ.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
|
|
@@ -124,7 +124,7 @@ function verticalizeItems(items) {
|
|
|
124
124
|
function createCompositeStore(props = {}) {
|
|
125
125
|
var _a;
|
|
126
126
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
127
|
-
const collection =
|
|
127
|
+
const collection = _3COGJMN3cjs.createCollectionStore.call(void 0, props);
|
|
128
128
|
const activeId = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
129
129
|
props.activeId,
|
|
130
130
|
syncState == null ? void 0 : syncState.activeId,
|
|
@@ -154,10 +154,10 @@ function createCompositeStore(props = {}) {
|
|
|
154
154
|
focusWrap: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
|
|
155
155
|
focusShift: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
|
|
156
156
|
});
|
|
157
|
-
const composite =
|
|
158
|
-
|
|
157
|
+
const composite = _M2NNCFIJcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
158
|
+
_M2NNCFIJcjs.setup.call(void 0,
|
|
159
159
|
composite,
|
|
160
|
-
() =>
|
|
160
|
+
() => _M2NNCFIJcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
|
|
161
161
|
composite.setState("activeId", (activeId2) => {
|
|
162
162
|
var _a2;
|
|
163
163
|
if (activeId2 !== void 0)
|
|
@@ -70,7 +70,9 @@ function createStore(initialState, ...stores) {
|
|
|
70
70
|
)
|
|
71
71
|
);
|
|
72
72
|
const teardowns = [];
|
|
73
|
-
|
|
73
|
+
for (const setup2 of setups) {
|
|
74
|
+
teardowns.push(setup2());
|
|
75
|
+
}
|
|
74
76
|
const cleanups = stores.map(init);
|
|
75
77
|
destroy = _EEDWPDM2cjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
|
|
76
78
|
return maybeDestroy;
|
|
@@ -99,16 +101,16 @@ function createStore(initialState, ...stores) {
|
|
|
99
101
|
const storeOmit = (keys) => createStore(_EEDWPDM2cjs.omit.call(void 0, state, keys), finalStore);
|
|
100
102
|
const getState = () => state;
|
|
101
103
|
const setState = (key, value, fromStores = false) => {
|
|
104
|
+
var _a;
|
|
102
105
|
if (!_EEDWPDM2cjs.hasOwnProperty.call(void 0, state, key))
|
|
103
106
|
return;
|
|
104
107
|
const nextValue = _EEDWPDM2cjs.applyState.call(void 0, value, state[key]);
|
|
105
108
|
if (nextValue === state[key])
|
|
106
109
|
return;
|
|
107
110
|
if (!fromStores) {
|
|
108
|
-
|
|
109
|
-
var _a;
|
|
111
|
+
for (const store of stores) {
|
|
110
112
|
(_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
|
|
111
|
-
}
|
|
113
|
+
}
|
|
112
114
|
}
|
|
113
115
|
const prevState = state;
|
|
114
116
|
state = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, state), { [key]: nextValue });
|
|
@@ -116,24 +118,24 @@ function createStore(initialState, ...stores) {
|
|
|
116
118
|
lastUpdate = thisUpdate;
|
|
117
119
|
updatedKeys.add(key);
|
|
118
120
|
const run = (listener, prev, uKeys) => {
|
|
119
|
-
var
|
|
121
|
+
var _a2;
|
|
120
122
|
const keys = listenerKeys.get(listener);
|
|
121
123
|
const updated = (k) => uKeys ? uKeys.has(k) : k === key;
|
|
122
124
|
if (!keys || keys.some(updated)) {
|
|
123
|
-
(
|
|
125
|
+
(_a2 = disposables.get(listener)) == null ? void 0 : _a2();
|
|
124
126
|
disposables.set(listener, listener(state, prev));
|
|
125
127
|
}
|
|
126
128
|
};
|
|
127
|
-
|
|
129
|
+
for (const listener of listeners) {
|
|
128
130
|
run(listener, prevState);
|
|
129
|
-
}
|
|
131
|
+
}
|
|
130
132
|
queueMicrotask(() => {
|
|
131
133
|
if (lastUpdate !== thisUpdate)
|
|
132
134
|
return;
|
|
133
135
|
const snapshot = state;
|
|
134
|
-
|
|
136
|
+
for (const listener of batchListeners) {
|
|
135
137
|
run(listener, prevStateBatch, updatedKeys);
|
|
136
|
-
}
|
|
138
|
+
}
|
|
137
139
|
prevStateBatch = snapshot;
|
|
138
140
|
updatedKeys.clear();
|
|
139
141
|
});
|
|
@@ -194,7 +196,7 @@ function mergeStore(...stores) {
|
|
|
194
196
|
const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
|
|
195
197
|
if (!nextState)
|
|
196
198
|
return state;
|
|
197
|
-
return
|
|
199
|
+
return Object.assign(state, nextState);
|
|
198
200
|
}, {});
|
|
199
201
|
const store = createStore(initialState, ...stores);
|
|
200
202
|
return store;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _DIYYVJDKcjs = require('./DIYYVJDK.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _M2NNCFIJcjs = require('./M2NNCFIJ.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
|
|
@@ -24,9 +24,9 @@ function createPopoverStore(_a = {}) {
|
|
|
24
24
|
} = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
|
|
25
25
|
"popover"
|
|
26
26
|
]);
|
|
27
|
-
const store =
|
|
27
|
+
const store = _M2NNCFIJcjs.mergeStore.call(void 0,
|
|
28
28
|
props.store,
|
|
29
|
-
|
|
29
|
+
_M2NNCFIJcjs.omit.call(void 0, otherPopover, [
|
|
30
30
|
"arrowElement",
|
|
31
31
|
"anchorElement",
|
|
32
32
|
"contentElement",
|
|
@@ -34,9 +34,9 @@ function createPopoverStore(_a = {}) {
|
|
|
34
34
|
"disclosureElement"
|
|
35
35
|
])
|
|
36
36
|
);
|
|
37
|
-
|
|
37
|
+
_M2NNCFIJcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
38
38
|
const syncState = store == null ? void 0 : store.getState();
|
|
39
|
-
const dialog =
|
|
39
|
+
const dialog = _DIYYVJDKcjs.createDialogStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), { store }));
|
|
40
40
|
const placement = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
41
41
|
props.placement,
|
|
42
42
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -50,7 +50,7 @@ function createPopoverStore(_a = {}) {
|
|
|
50
50
|
arrowElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
|
|
51
51
|
rendered: Symbol("rendered")
|
|
52
52
|
});
|
|
53
|
-
const popover =
|
|
53
|
+
const popover = _M2NNCFIJcjs.createStore.call(void 0, initialState, dialog, store);
|
|
54
54
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, dialog), popover), {
|
|
55
55
|
setAnchorElement: (element) => popover.setState("anchorElement", element),
|
|
56
56
|
setPopoverElement: (element) => popover.setState("popoverElement", element),
|
|
@@ -57,29 +57,13 @@ var buttonInputTypes = [
|
|
|
57
57
|
"reset",
|
|
58
58
|
"submit"
|
|
59
59
|
];
|
|
60
|
-
function matches(element, selectors) {
|
|
61
|
-
if ("matches" in element) {
|
|
62
|
-
return element.matches(selectors);
|
|
63
|
-
}
|
|
64
|
-
if ("msMatchesSelector" in element) {
|
|
65
|
-
return element.msMatchesSelector(selectors);
|
|
66
|
-
}
|
|
67
|
-
return element.webkitMatchesSelector(selectors);
|
|
68
|
-
}
|
|
69
60
|
function isVisible(element) {
|
|
61
|
+
if (typeof element.checkVisibility === "function") {
|
|
62
|
+
return element.checkVisibility();
|
|
63
|
+
}
|
|
70
64
|
const htmlElement = element;
|
|
71
65
|
return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
|
|
72
66
|
}
|
|
73
|
-
function closest(element, selectors) {
|
|
74
|
-
if ("closest" in element)
|
|
75
|
-
return element.closest(selectors);
|
|
76
|
-
do {
|
|
77
|
-
if (matches(element, selectors))
|
|
78
|
-
return element;
|
|
79
|
-
element = element.parentElement || element.parentNode;
|
|
80
|
-
} while (element !== null && element.nodeType === 1);
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
67
|
function isTextField(element) {
|
|
84
68
|
try {
|
|
85
69
|
const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
|
|
@@ -207,6 +191,4 @@ function setSelectionRange(element, ...args) {
|
|
|
207
191
|
|
|
208
192
|
|
|
209
193
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
exports.canUseDOM = canUseDOM; exports.getDocument = getDocument; exports.getWindow = getWindow; exports.getActiveElement = getActiveElement; exports.contains = contains; exports.isFrame = isFrame; exports.isButton = isButton; exports.matches = matches; exports.isVisible = isVisible; exports.closest = closest; exports.isTextField = isTextField; exports.isTextbox = isTextbox; exports.getTextboxValue = getTextboxValue; exports.getTextboxSelection = getTextboxSelection; exports.getPopupRole = getPopupRole; exports.getPopupItemRole = getPopupItemRole; exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded; exports.getScrollingElement = getScrollingElement; exports.isPartiallyHidden = isPartiallyHidden; exports.setSelectionRange = setSelectionRange;
|
|
194
|
+
exports.canUseDOM = canUseDOM; exports.getDocument = getDocument; exports.getWindow = getWindow; exports.getActiveElement = getActiveElement; exports.contains = contains; exports.isFrame = isFrame; exports.isButton = isButton; exports.isVisible = isVisible; exports.isTextField = isTextField; exports.isTextbox = isTextbox; exports.getTextboxValue = getTextboxValue; exports.getTextboxSelection = getTextboxSelection; exports.getPopupRole = getPopupRole; exports.getPopupItemRole = getPopupItemRole; exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded; exports.getScrollingElement = getScrollingElement; exports.isPartiallyHidden = isPartiallyHidden; exports.setSelectionRange = setSelectionRange;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _MB5TLEVHcjs = require('./MB5TLEVH.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _M2NNCFIJcjs = require('./M2NNCFIJ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
|
|
@@ -17,7 +17,7 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
|
17
17
|
function createHovercardStore(props = {}) {
|
|
18
18
|
var _a;
|
|
19
19
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
-
const popover =
|
|
20
|
+
const popover = _MB5TLEVHcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
21
21
|
placement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
22
22
|
props.placement,
|
|
23
23
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -31,7 +31,7 @@ function createHovercardStore(props = {}) {
|
|
|
31
31
|
hideTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
|
|
32
32
|
autoFocusOnShow: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
|
|
33
33
|
});
|
|
34
|
-
const hovercard =
|
|
34
|
+
const hovercard = _M2NNCFIJcjs.createStore.call(void 0, initialState, popover, props.store);
|
|
35
35
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
|
|
36
36
|
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
|
|
37
37
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _M2NNCFIJcjs = require('../__chunks/M2NNCFIJ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
@@ -14,7 +14,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
14
14
|
// src/checkbox/checkbox-store.ts
|
|
15
15
|
function createCheckboxStore(props = {}) {
|
|
16
16
|
var _a;
|
|
17
|
-
|
|
17
|
+
_M2NNCFIJcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
18
18
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
19
19
|
const initialState = {
|
|
20
20
|
value: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
@@ -24,7 +24,7 @@ function createCheckboxStore(props = {}) {
|
|
|
24
24
|
false
|
|
25
25
|
)
|
|
26
26
|
};
|
|
27
|
-
const checkbox =
|
|
27
|
+
const checkbox = _M2NNCFIJcjs.createStore.call(void 0, initialState, props.store);
|
|
28
28
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, checkbox), {
|
|
29
29
|
setValue: (value) => checkbox.setState("value", value)
|
|
30
30
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
2
|
-
import type { PickRequired, SetState, ToPrimitive } from "../utils/types.
|
|
1
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
2
|
+
import type { PickRequired, SetState, ToPrimitive } from "../utils/types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a checkbox store.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
2
|
-
import type { PickRequired, SetState, ToPrimitive } from "../utils/types.
|
|
1
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
2
|
+
import type { PickRequired, SetState, ToPrimitive } from "../utils/types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a checkbox store.
|
|
5
5
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _3COGJMN3cjs = require('../__chunks/3COGJMN3.cjs');
|
|
5
|
+
require('../__chunks/M2NNCFIJ.cjs');
|
|
6
6
|
require('../__chunks/EEDWPDM2.cjs');
|
|
7
|
-
require('../__chunks/
|
|
7
|
+
require('../__chunks/Q2WCPTYS.cjs');
|
|
8
8
|
require('../__chunks/AV6KTKLE.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createCollectionStore =
|
|
11
|
+
exports.createCollectionStore = _3COGJMN3cjs.createCollectionStore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
2
|
-
import type { BivariantCallback } from "../utils/types.
|
|
1
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
2
|
+
import type { BivariantCallback } from "../utils/types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a collection store.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
2
|
-
import type { BivariantCallback } from "../utils/types.
|
|
1
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
2
|
+
import type { BivariantCallback } from "../utils/types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a collection store.
|
|
5
5
|
*/
|