@ariakit/core 0.3.2 → 0.3.4
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 +20 -0
- package/cjs/__chunks/{4L3HCXJY.cjs → 25WWT2VO.cjs} +17 -16
- package/cjs/__chunks/{EXM2AW52.cjs → FTB5CXVB.cjs} +3 -1
- package/cjs/__chunks/{EIRIJC7T.cjs → G5EW4WED.cjs} +8 -7
- package/cjs/__chunks/{RCYVACJO.cjs → LMT335NJ.cjs} +9 -4
- package/cjs/__chunks/LUOEAZGU.cjs +42 -0
- package/cjs/__chunks/{4OD4ZFRG.cjs → M44E4T5A.cjs} +30 -29
- package/cjs/__chunks/{GHET3DES.cjs → MLPOXRDT.cjs} +4 -3
- package/cjs/__chunks/{7GWXP6CQ.cjs → OASSVCYR.cjs} +43 -29
- package/cjs/__chunks/{AIHTEA5D.cjs → ROX3MRGO.cjs} +18 -17
- package/cjs/__chunks/{GDZQUFNP.cjs → ULSPM3Y3.cjs} +3 -1
- package/cjs/__chunks/{72I2GWXF.cjs → WYXAWBLE.cjs} +2 -1
- package/cjs/__chunks/{52LQV3SV.cjs → YXSGST3H.cjs} +23 -23
- package/cjs/checkbox/checkbox-store.cjs +9 -8
- package/cjs/checkbox/checkbox-store.d.cts +41 -0
- package/cjs/collection/collection-store.cjs +8 -7
- package/cjs/collection/collection-store.d.cts +65 -0
- package/cjs/combobox/combobox-store.cjs +37 -36
- package/cjs/combobox/combobox-store.d.cts +77 -0
- package/cjs/composite/composite-overflow-store.cjs +9 -8
- package/cjs/composite/composite-overflow-store.d.cts +10 -0
- package/cjs/composite/composite-store.cjs +10 -9
- package/cjs/composite/composite-store.d.cts +206 -0
- package/cjs/dialog/dialog-store.cjs +8 -7
- package/cjs/dialog/dialog-store.d.cts +10 -0
- package/cjs/disclosure/disclosure-store.cjs +7 -6
- package/cjs/disclosure/disclosure-store.d.cts +125 -0
- package/cjs/disclosure/disclosure-store.d.ts +1 -0
- package/cjs/form/form-store.cjs +30 -29
- package/cjs/form/form-store.d.cts +236 -0
- package/cjs/form/types.cjs +1 -1
- package/cjs/form/types.d.cts +38 -0
- package/cjs/hovercard/hovercard-store.cjs +10 -9
- package/cjs/hovercard/hovercard-store.d.cts +46 -0
- package/cjs/index.cjs +2 -1
- package/cjs/index.d.cts +2 -0
- package/cjs/menu/menu-bar-store.cjs +12 -11
- package/cjs/menu/menu-bar-store.d.cts +10 -0
- package/cjs/menu/menu-store.cjs +35 -34
- package/cjs/menu/menu-store.d.cts +78 -0
- package/cjs/popover/popover-store.cjs +9 -8
- package/cjs/popover/popover-store.d.cts +69 -0
- package/cjs/radio/radio-store.cjs +16 -15
- package/cjs/radio/radio-store.d.cts +36 -0
- package/cjs/select/select-store.cjs +37 -36
- package/cjs/select/select-store.d.cts +93 -0
- package/cjs/tab/tab-store.cjs +28 -27
- package/cjs/tab/tab-store.d.cts +87 -0
- package/cjs/toolbar/toolbar-store.cjs +12 -11
- package/cjs/toolbar/toolbar-store.d.cts +21 -0
- package/cjs/tooltip/tooltip-store.cjs +17 -16
- package/cjs/tooltip/tooltip-store.d.cts +29 -0
- package/cjs/utils/array.cjs +5 -4
- package/cjs/utils/array.d.cts +29 -0
- package/cjs/utils/dom.cjs +5 -4
- package/cjs/utils/dom.d.cts +105 -0
- package/cjs/utils/events.cjs +10 -9
- package/cjs/utils/events.d.cts +70 -0
- package/cjs/utils/focus.cjs +17 -16
- package/cjs/utils/focus.d.cts +117 -0
- package/cjs/utils/misc.cjs +7 -4
- package/cjs/utils/misc.d.cts +124 -0
- package/cjs/utils/misc.d.ts +7 -0
- package/cjs/utils/platform.cjs +6 -5
- package/cjs/utils/platform.d.cts +20 -0
- package/cjs/utils/store.cjs +6 -5
- package/cjs/utils/store.d.cts +71 -0
- package/cjs/utils/types.cjs +1 -1
- package/cjs/utils/types.d.cts +74 -0
- package/esm/__chunks/{PNRLI7OV.js → 2SMRF6AD.js} +1 -0
- package/esm/__chunks/{UCFCIHEU.js → 5UJPJ37G.js} +2 -1
- package/esm/__chunks/{5XEKIOCW.js → 7PRQYBBV.js} +2 -0
- package/esm/__chunks/{WVTCK5PV.js → D23ES3Z4.js} +6 -1
- package/esm/__chunks/{BL2LUIIN.js → FGW7QUD2.js} +6 -5
- package/esm/__chunks/{DEGIJZ7N.js → GME4NYXR.js} +28 -14
- package/esm/__chunks/{BE4I5ZDQ.js → I7YGHQ4Z.js} +2 -1
- package/esm/__chunks/{A2JA3CYE.js → LWQU4J4N.js} +5 -4
- package/esm/__chunks/{O35LWD4W.js → NIF7E7VE.js} +2 -0
- package/esm/__chunks/{STQCKYT6.js → Q332EHXG.js} +5 -4
- package/esm/__chunks/{OZ4NH3RO.js → TEJLMP2M.js} +8 -8
- package/esm/__chunks/{LTJQMYBN.js → VEWADM34.js} +5 -4
- package/esm/checkbox/checkbox-store.js +4 -3
- package/esm/collection/collection-store.js +6 -5
- package/esm/combobox/combobox-store.js +12 -11
- package/esm/composite/composite-overflow-store.js +7 -6
- package/esm/composite/composite-store.js +8 -7
- package/esm/dialog/dialog-store.js +6 -5
- package/esm/disclosure/disclosure-store.d.ts +1 -0
- package/esm/disclosure/disclosure-store.js +5 -4
- package/esm/form/form-store.js +6 -5
- package/esm/form/types.js +1 -0
- package/esm/hovercard/hovercard-store.js +8 -7
- package/esm/index.js +2 -1
- package/esm/menu/menu-bar-store.js +8 -7
- package/esm/menu/menu-store.js +12 -11
- package/esm/popover/popover-store.js +7 -6
- package/esm/radio/radio-store.js +8 -7
- package/esm/select/select-store.js +11 -10
- package/esm/tab/tab-store.js +8 -7
- package/esm/toolbar/toolbar-store.js +8 -7
- package/esm/tooltip/tooltip-store.js +8 -7
- package/esm/utils/array.js +3 -2
- package/esm/utils/dom.js +3 -2
- package/esm/utils/events.js +4 -3
- package/esm/utils/focus.js +3 -2
- package/esm/utils/misc.d.ts +7 -0
- package/esm/utils/misc.js +5 -2
- package/esm/utils/platform.js +4 -3
- package/esm/utils/store.js +4 -3
- package/esm/utils/types.js +1 -0
- package/package.json +109 -28
- package/cjs/__chunks/ZRCUNIY2.cjs +0 -41
- package/cjs/tsconfig.build.tsbuildinfo +0 -1
- package/esm/tsconfig.build.tsbuildinfo +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @ariakit/core
|
|
2
2
|
|
|
3
|
+
## 0.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`#2935`](https://github.com/ariakit/ariakit/pull/2935) Fixed TypeScript declaration files in CommonJS projects using `NodeNext` for `moduleResolution`.
|
|
8
|
+
|
|
9
|
+
- [`#2945`](https://github.com/ariakit/ariakit/pull/2945) Added new `disabledFromProps` function to `@ariakit/core/utils/misc`.
|
|
10
|
+
|
|
11
|
+
- [`#2948`](https://github.com/ariakit/ariakit/pull/2948) Added `"use client"` directive to all modules.
|
|
12
|
+
|
|
13
|
+
- Improved JSDocs.
|
|
14
|
+
|
|
15
|
+
## 0.3.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`#2909`](https://github.com/ariakit/ariakit/pull/2909) Fixed [Disclosure](https://ariakit.org/components/disclosure) and related components not waiting for the exit animation to complete before hiding the content element.
|
|
20
|
+
|
|
21
|
+
- Improved JSDocs.
|
|
22
|
+
|
|
3
23
|
## 0.3.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _7GWXP6CQcjs = require('./7GWXP6CQ.cjs');
|
|
7
6
|
|
|
7
|
+
var _OASSVCYRcjs = require('./OASSVCYR.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
11
10
|
|
|
11
|
+
var _LMT335NJcjs = require('./LMT335NJ.cjs');
|
|
12
12
|
|
|
13
|
-
var _EXM2AW52cjs = require('./EXM2AW52.cjs');
|
|
14
13
|
|
|
14
|
+
var _FTB5CXVBcjs = require('./FTB5CXVB.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
var _WYXAWBLEcjs = require('./WYXAWBLE.cjs');
|
|
18
19
|
|
|
19
20
|
// src/collection/collection-store.ts
|
|
20
21
|
function isElementPreceding(a, b) {
|
|
@@ -60,13 +61,13 @@ function getCommonParent(items) {
|
|
|
60
61
|
}
|
|
61
62
|
parentElement = parentElement.parentElement;
|
|
62
63
|
}
|
|
63
|
-
return
|
|
64
|
+
return _FTB5CXVBcjs.getDocument.call(void 0, parentElement).body;
|
|
64
65
|
}
|
|
65
66
|
function createCollectionStore(props = {}) {
|
|
66
67
|
var _a;
|
|
67
|
-
|
|
68
|
+
_OASSVCYRcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
68
69
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
69
|
-
const items =
|
|
70
|
+
const items = _LMT335NJcjs.defaultValue.call(void 0,
|
|
70
71
|
props.items,
|
|
71
72
|
syncState == null ? void 0 : syncState.items,
|
|
72
73
|
props.defaultItems,
|
|
@@ -75,20 +76,20 @@ function createCollectionStore(props = {}) {
|
|
|
75
76
|
const itemsMap = new Map(items.map((item) => [item.id, item]));
|
|
76
77
|
const initialState = {
|
|
77
78
|
items,
|
|
78
|
-
renderedItems:
|
|
79
|
+
renderedItems: _LMT335NJcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
|
|
79
80
|
};
|
|
80
|
-
const privateStore =
|
|
81
|
+
const privateStore = _OASSVCYRcjs.createStore.call(void 0, {
|
|
81
82
|
renderedItems: initialState.renderedItems
|
|
82
83
|
});
|
|
83
|
-
const collection =
|
|
84
|
+
const collection = _OASSVCYRcjs.createStore.call(void 0, initialState, props.store);
|
|
84
85
|
const sortItems = () => {
|
|
85
86
|
const state = privateStore.getState();
|
|
86
87
|
const renderedItems = sortBasedOnDOMPosition(state.renderedItems);
|
|
87
88
|
privateStore.setState("renderedItems", renderedItems);
|
|
88
89
|
collection.setState("renderedItems", renderedItems);
|
|
89
90
|
};
|
|
90
|
-
|
|
91
|
-
return
|
|
91
|
+
_OASSVCYRcjs.setup.call(void 0, collection, () => {
|
|
92
|
+
return _OASSVCYRcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
|
|
92
93
|
let firstRun = true;
|
|
93
94
|
let raf = requestAnimationFrame(sortItems);
|
|
94
95
|
if (typeof IntersectionObserver !== "function")
|
|
@@ -121,7 +122,7 @@ function createCollectionStore(props = {}) {
|
|
|
121
122
|
const nextItems = items2.slice();
|
|
122
123
|
if (index !== -1) {
|
|
123
124
|
prevItem = items2[index];
|
|
124
|
-
const nextItem =
|
|
125
|
+
const nextItem = _WYXAWBLEcjs.__spreadValues.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, prevItem), item);
|
|
125
126
|
nextItems[index] = nextItem;
|
|
126
127
|
itemsMap.set(item.id, nextItem);
|
|
127
128
|
} else {
|
|
@@ -150,9 +151,9 @@ function createCollectionStore(props = {}) {
|
|
|
150
151
|
return unmergeItem;
|
|
151
152
|
};
|
|
152
153
|
const registerItem = (item) => mergeItem(item, (getItems) => collection.setState("items", getItems), true);
|
|
153
|
-
return
|
|
154
|
+
return _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, collection), {
|
|
154
155
|
registerItem,
|
|
155
|
-
renderItem: (item) =>
|
|
156
|
+
renderItem: (item) => _LMT335NJcjs.chain.call(void 0,
|
|
156
157
|
registerItem(item),
|
|
157
158
|
mergeItem(
|
|
158
159
|
item,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
// src/utils/dom.ts
|
|
2
4
|
var canUseDOM = checkIsBrowser();
|
|
3
5
|
function checkIsBrowser() {
|
|
4
6
|
var _a;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
var _FTB5CXVBcjs = require('./FTB5CXVB.cjs');
|
|
4
5
|
|
|
5
6
|
// src/utils/platform.ts
|
|
6
7
|
function isTouchDevice() {
|
|
7
|
-
return
|
|
8
|
+
return _FTB5CXVBcjs.canUseDOM && !!navigator.maxTouchPoints;
|
|
8
9
|
}
|
|
9
10
|
function isApple() {
|
|
10
|
-
if (!
|
|
11
|
+
if (!_FTB5CXVBcjs.canUseDOM)
|
|
11
12
|
return false;
|
|
12
13
|
return /mac|iphone|ipad|ipod/i.test(navigator.platform);
|
|
13
14
|
}
|
|
14
15
|
function isSafari() {
|
|
15
|
-
return
|
|
16
|
+
return _FTB5CXVBcjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
|
|
16
17
|
}
|
|
17
18
|
function isFirefox() {
|
|
18
|
-
return
|
|
19
|
+
return _FTB5CXVBcjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
|
|
19
20
|
}
|
|
20
21
|
function isMac() {
|
|
21
|
-
return
|
|
22
|
+
return _FTB5CXVBcjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
var _WYXAWBLEcjs = require('./WYXAWBLE.cjs');
|
|
4
5
|
|
|
5
6
|
// src/utils/misc.ts
|
|
6
7
|
function noop(..._) {
|
|
@@ -80,7 +81,7 @@ function normalizeString(str) {
|
|
|
80
81
|
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
81
82
|
}
|
|
82
83
|
function omit(object, keys) {
|
|
83
|
-
const result =
|
|
84
|
+
const result = _WYXAWBLEcjs.__spreadValues.call(void 0, {}, object);
|
|
84
85
|
for (const key of keys) {
|
|
85
86
|
if (hasOwnProperty(result, key)) {
|
|
86
87
|
delete result[key];
|
|
@@ -126,6 +127,9 @@ function isFalsyBooleanCallback(booleanOrCallback, ...args) {
|
|
|
126
127
|
return false;
|
|
127
128
|
return !result;
|
|
128
129
|
}
|
|
130
|
+
function disabledFromProps(props) {
|
|
131
|
+
return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
|
|
132
|
+
}
|
|
129
133
|
function defaultValue(...values) {
|
|
130
134
|
for (const value of values) {
|
|
131
135
|
if (value !== void 0)
|
|
@@ -154,4 +158,5 @@ function defaultValue(...values) {
|
|
|
154
158
|
|
|
155
159
|
|
|
156
160
|
|
|
157
|
-
|
|
161
|
+
|
|
162
|
+
exports.noop = noop; exports.shallowEqual = shallowEqual; exports.applyState = applyState; exports.isObject = isObject; exports.isEmpty = isEmpty; exports.isInteger = isInteger; exports.hasOwnProperty = hasOwnProperty; exports.chain = chain; exports.cx = cx; exports.normalizeString = normalizeString; exports.omit = omit; exports.pick = pick; exports.identity = identity; exports.beforePaint = beforePaint; exports.afterPaint = afterPaint; exports.invariant = invariant; exports.getKeys = getKeys; exports.isFalsyBooleanCallback = isFalsyBooleanCallback; exports.disabledFromProps = disabledFromProps; exports.defaultValue = defaultValue;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _ROX3MRGOcjs = require('./ROX3MRGO.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _OASSVCYRcjs = require('./OASSVCYR.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _LMT335NJcjs = require('./LMT335NJ.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _WYXAWBLEcjs = require('./WYXAWBLE.cjs');
|
|
15
|
+
|
|
16
|
+
// src/hovercard/hovercard-store.ts
|
|
17
|
+
function createHovercardStore(props = {}) {
|
|
18
|
+
var _a;
|
|
19
|
+
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
+
const popover = _ROX3MRGOcjs.createPopoverStore.call(void 0, _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
21
|
+
placement: _LMT335NJcjs.defaultValue.call(void 0,
|
|
22
|
+
props.placement,
|
|
23
|
+
syncState == null ? void 0 : syncState.placement,
|
|
24
|
+
"bottom"
|
|
25
|
+
)
|
|
26
|
+
}));
|
|
27
|
+
const timeout = _LMT335NJcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
|
|
28
|
+
const initialState = _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, popover.getState()), {
|
|
29
|
+
timeout,
|
|
30
|
+
showTimeout: _LMT335NJcjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
|
|
31
|
+
hideTimeout: _LMT335NJcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
|
|
32
|
+
autoFocusOnShow: _LMT335NJcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
|
|
33
|
+
});
|
|
34
|
+
const hovercard = _OASSVCYRcjs.createStore.call(void 0, initialState, popover, props.store);
|
|
35
|
+
return _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
|
|
36
|
+
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
exports.createHovercardStore = createHovercardStore;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
|
-
var _4L3HCXJYcjs = require('./4L3HCXJY.cjs');
|
|
4
3
|
|
|
4
|
+
var _25WWT2VOcjs = require('./25WWT2VO.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _7GWXP6CQcjs = require('./7GWXP6CQ.cjs');
|
|
9
8
|
|
|
9
|
+
var _OASSVCYRcjs = require('./OASSVCYR.cjs');
|
|
10
10
|
|
|
11
|
-
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
12
11
|
|
|
12
|
+
var _LMT335NJcjs = require('./LMT335NJ.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var _GDZQUFNPcjs = require('./GDZQUFNP.cjs');
|
|
16
15
|
|
|
16
|
+
var _ULSPM3Y3cjs = require('./ULSPM3Y3.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
var _WYXAWBLEcjs = require('./WYXAWBLE.cjs');
|
|
20
21
|
|
|
21
22
|
// src/composite/composite-store.ts
|
|
22
23
|
var NULL_ITEM = { id: null };
|
|
@@ -107,7 +108,7 @@ function verticalizeItems(items) {
|
|
|
107
108
|
for (const row of rows) {
|
|
108
109
|
const item = row[i];
|
|
109
110
|
if (item) {
|
|
110
|
-
verticalized.push(
|
|
111
|
+
verticalized.push(_WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, item), {
|
|
111
112
|
// If there's no rowId, it means that it's not a grid composite, but
|
|
112
113
|
// a single row instead. So, instead of verticalizing it, that is,
|
|
113
114
|
// assigning a different rowId based on the column index, we keep it
|
|
@@ -123,40 +124,40 @@ function verticalizeItems(items) {
|
|
|
123
124
|
function createCompositeStore(props = {}) {
|
|
124
125
|
var _a;
|
|
125
126
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
126
|
-
const collection =
|
|
127
|
-
const activeId =
|
|
127
|
+
const collection = _25WWT2VOcjs.createCollectionStore.call(void 0, props);
|
|
128
|
+
const activeId = _LMT335NJcjs.defaultValue.call(void 0,
|
|
128
129
|
props.activeId,
|
|
129
130
|
syncState == null ? void 0 : syncState.activeId,
|
|
130
131
|
props.defaultActiveId
|
|
131
132
|
);
|
|
132
|
-
const initialState =
|
|
133
|
+
const initialState = _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, collection.getState()), {
|
|
133
134
|
activeId,
|
|
134
|
-
baseElement:
|
|
135
|
-
includesBaseElement:
|
|
135
|
+
baseElement: _LMT335NJcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
|
|
136
|
+
includesBaseElement: _LMT335NJcjs.defaultValue.call(void 0,
|
|
136
137
|
props.includesBaseElement,
|
|
137
138
|
syncState == null ? void 0 : syncState.includesBaseElement,
|
|
138
139
|
activeId === null
|
|
139
140
|
),
|
|
140
|
-
moves:
|
|
141
|
-
orientation:
|
|
141
|
+
moves: _LMT335NJcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
|
|
142
|
+
orientation: _LMT335NJcjs.defaultValue.call(void 0,
|
|
142
143
|
props.orientation,
|
|
143
144
|
syncState == null ? void 0 : syncState.orientation,
|
|
144
145
|
"both"
|
|
145
146
|
),
|
|
146
|
-
rtl:
|
|
147
|
-
virtualFocus:
|
|
147
|
+
rtl: _LMT335NJcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
|
|
148
|
+
virtualFocus: _LMT335NJcjs.defaultValue.call(void 0,
|
|
148
149
|
props.virtualFocus,
|
|
149
150
|
syncState == null ? void 0 : syncState.virtualFocus,
|
|
150
151
|
false
|
|
151
152
|
),
|
|
152
|
-
focusLoop:
|
|
153
|
-
focusWrap:
|
|
154
|
-
focusShift:
|
|
153
|
+
focusLoop: _LMT335NJcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
|
|
154
|
+
focusWrap: _LMT335NJcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
|
|
155
|
+
focusShift: _LMT335NJcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
|
|
155
156
|
});
|
|
156
|
-
const composite =
|
|
157
|
-
|
|
157
|
+
const composite = _OASSVCYRcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
158
|
+
_OASSVCYRcjs.setup.call(void 0,
|
|
158
159
|
composite,
|
|
159
|
-
() =>
|
|
160
|
+
() => _OASSVCYRcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
|
|
160
161
|
composite.setState("activeId", (activeId2) => {
|
|
161
162
|
var _a2;
|
|
162
163
|
if (activeId2 !== void 0)
|
|
@@ -170,7 +171,7 @@ function createCompositeStore(props = {}) {
|
|
|
170
171
|
const { activeId: activeId2, rtl, focusLoop, focusWrap, includesBaseElement } = composite.getState();
|
|
171
172
|
const isHorizontal = orientation !== "vertical";
|
|
172
173
|
const isRTL = rtl && isHorizontal;
|
|
173
|
-
const allItems = isRTL ?
|
|
174
|
+
const allItems = isRTL ? _ULSPM3Y3cjs.reverseArray.call(void 0, items) : items;
|
|
174
175
|
if (activeId2 == null) {
|
|
175
176
|
return (_a2 = findFirstEnabledItem(allItems)) == null ? void 0 : _a2.id;
|
|
176
177
|
}
|
|
@@ -223,7 +224,7 @@ function createCompositeStore(props = {}) {
|
|
|
223
224
|
}
|
|
224
225
|
return nextItem == null ? void 0 : nextItem.id;
|
|
225
226
|
};
|
|
226
|
-
return
|
|
227
|
+
return _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, collection), composite), {
|
|
227
228
|
setBaseElement: (element) => composite.setState("baseElement", element),
|
|
228
229
|
setActiveId: (id) => composite.setState("activeId", id),
|
|
229
230
|
move: (id) => {
|
|
@@ -238,7 +239,7 @@ function createCompositeStore(props = {}) {
|
|
|
238
239
|
},
|
|
239
240
|
last: () => {
|
|
240
241
|
var _a2;
|
|
241
|
-
return (_a2 = findFirstEnabledItem(
|
|
242
|
+
return (_a2 = findFirstEnabledItem(_ULSPM3Y3cjs.reverseArray.call(void 0, composite.getState().renderedItems))) == null ? void 0 : _a2.id;
|
|
242
243
|
},
|
|
243
244
|
next: (skip) => {
|
|
244
245
|
const { renderedItems, orientation } = composite.getState();
|
|
@@ -250,7 +251,7 @@ function createCompositeStore(props = {}) {
|
|
|
250
251
|
const isGrid = !!((_a2 = findFirstEnabledItem(renderedItems)) == null ? void 0 : _a2.rowId);
|
|
251
252
|
const hasNullItem = !isGrid && includesBaseElement;
|
|
252
253
|
return getNextId(
|
|
253
|
-
|
|
254
|
+
_ULSPM3Y3cjs.reverseArray.call(void 0, renderedItems),
|
|
254
255
|
orientation,
|
|
255
256
|
hasNullItem,
|
|
256
257
|
skip
|
|
@@ -266,7 +267,7 @@ function createCompositeStore(props = {}) {
|
|
|
266
267
|
} = composite.getState();
|
|
267
268
|
const shouldShift = focusShift && !skip;
|
|
268
269
|
const verticalItems = verticalizeItems(
|
|
269
|
-
|
|
270
|
+
_ULSPM3Y3cjs.flatten2DArray.call(void 0,
|
|
270
271
|
normalizeRows(groupItemsByRows(renderedItems), activeId2, shouldShift)
|
|
271
272
|
)
|
|
272
273
|
);
|
|
@@ -278,8 +279,8 @@ function createCompositeStore(props = {}) {
|
|
|
278
279
|
const { activeId: activeId2, renderedItems, focusShift, includesBaseElement } = composite.getState();
|
|
279
280
|
const shouldShift = focusShift && !skip;
|
|
280
281
|
const verticalItems = verticalizeItems(
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
_ULSPM3Y3cjs.reverseArray.call(void 0,
|
|
283
|
+
_ULSPM3Y3cjs.flatten2DArray.call(void 0,
|
|
283
284
|
normalizeRows(
|
|
284
285
|
groupItemsByRows(renderedItems),
|
|
285
286
|
activeId2,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
var _YXSGST3Hcjs = require('./YXSGST3H.cjs');
|
|
4
5
|
|
|
5
6
|
// src/dialog/dialog-store.ts
|
|
6
7
|
function createDialogStore(props = {}) {
|
|
7
|
-
return
|
|
8
|
+
return _YXSGST3Hcjs.createDisclosureStore.call(void 0, props);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
11
10
|
|
|
11
|
+
var _LMT335NJcjs = require('./LMT335NJ.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
var _WYXAWBLEcjs = require('./WYXAWBLE.cjs');
|
|
15
16
|
|
|
16
17
|
// src/utils/store.ts
|
|
17
18
|
function getInternal(store, key) {
|
|
18
19
|
const internals = store.__unstableInternals;
|
|
19
|
-
|
|
20
|
+
_LMT335NJcjs.invariant.call(void 0, internals, "Invalid store");
|
|
20
21
|
return internals[key];
|
|
21
22
|
}
|
|
22
23
|
function createStore(initialState, ...stores) {
|
|
@@ -27,7 +28,7 @@ function createStore(initialState, ...stores) {
|
|
|
27
28
|
const updatedKeys = /* @__PURE__ */ new Set();
|
|
28
29
|
const setups = /* @__PURE__ */ new Set();
|
|
29
30
|
const listeners = /* @__PURE__ */ new Set();
|
|
30
|
-
const
|
|
31
|
+
const batchListeners = /* @__PURE__ */ new Set();
|
|
31
32
|
const disposables = /* @__PURE__ */ new WeakMap();
|
|
32
33
|
const listenerKeys = /* @__PURE__ */ new WeakMap();
|
|
33
34
|
const storeSetup = (callback) => {
|
|
@@ -36,32 +37,41 @@ function createStore(initialState, ...stores) {
|
|
|
36
37
|
};
|
|
37
38
|
const storeInit = () => {
|
|
38
39
|
if (initialized)
|
|
39
|
-
return
|
|
40
|
+
return _LMT335NJcjs.noop;
|
|
40
41
|
if (!stores.length)
|
|
41
|
-
return
|
|
42
|
+
return _LMT335NJcjs.noop;
|
|
42
43
|
initialized = true;
|
|
43
|
-
const desyncs =
|
|
44
|
-
(key) =>
|
|
44
|
+
const desyncs = _LMT335NJcjs.getKeys.call(void 0, state).map(
|
|
45
|
+
(key) => _LMT335NJcjs.chain.call(void 0,
|
|
45
46
|
...stores.map((store) => {
|
|
46
47
|
var _a;
|
|
47
48
|
const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
|
|
48
49
|
if (!storeState)
|
|
49
50
|
return;
|
|
50
|
-
if (!
|
|
51
|
+
if (!_LMT335NJcjs.hasOwnProperty.call(void 0, storeState, key))
|
|
51
52
|
return;
|
|
52
|
-
return sync(
|
|
53
|
+
return sync(
|
|
54
|
+
store,
|
|
55
|
+
[key],
|
|
56
|
+
(state2) => setState(
|
|
57
|
+
key,
|
|
58
|
+
state2[key],
|
|
59
|
+
// @ts-expect-error - Not public API. This is just to prevent
|
|
60
|
+
// infinite loops.
|
|
61
|
+
true
|
|
62
|
+
)
|
|
63
|
+
);
|
|
53
64
|
})
|
|
54
65
|
)
|
|
55
66
|
);
|
|
56
67
|
const teardowns = [];
|
|
57
68
|
setups.forEach((setup2) => teardowns.push(setup2()));
|
|
58
69
|
const cleanups = stores.map(init);
|
|
59
|
-
return
|
|
70
|
+
return _LMT335NJcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups, () => {
|
|
60
71
|
initialized = false;
|
|
61
72
|
});
|
|
62
73
|
};
|
|
63
|
-
const sub = (keys, listener,
|
|
64
|
-
const set = batch2 ? listenersBatch : listeners;
|
|
74
|
+
const sub = (keys, listener, set = listeners) => {
|
|
65
75
|
set.add(listener);
|
|
66
76
|
listenerKeys.set(listener, keys);
|
|
67
77
|
return () => {
|
|
@@ -79,23 +89,25 @@ function createStore(initialState, ...stores) {
|
|
|
79
89
|
};
|
|
80
90
|
const storeBatch = (keys, listener) => {
|
|
81
91
|
disposables.set(listener, listener(state, prevStateBatch));
|
|
82
|
-
return sub(keys, listener,
|
|
92
|
+
return sub(keys, listener, batchListeners);
|
|
83
93
|
};
|
|
84
|
-
const storePick = (keys) => createStore(
|
|
85
|
-
const storeOmit = (keys) => createStore(
|
|
94
|
+
const storePick = (keys) => createStore(_LMT335NJcjs.pick.call(void 0, state, keys), finalStore);
|
|
95
|
+
const storeOmit = (keys) => createStore(_LMT335NJcjs.omit.call(void 0, state, keys), finalStore);
|
|
86
96
|
const getState = () => state;
|
|
87
|
-
const setState = (key, value) => {
|
|
88
|
-
if (!
|
|
97
|
+
const setState = (key, value, fromStores = false) => {
|
|
98
|
+
if (!_LMT335NJcjs.hasOwnProperty.call(void 0, state, key))
|
|
89
99
|
return;
|
|
90
|
-
const nextValue =
|
|
100
|
+
const nextValue = _LMT335NJcjs.applyState.call(void 0, value, state[key]);
|
|
91
101
|
if (nextValue === state[key])
|
|
92
102
|
return;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
103
|
+
if (!fromStores) {
|
|
104
|
+
stores.forEach((store) => {
|
|
105
|
+
var _a;
|
|
106
|
+
(_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
97
109
|
const prevState = state;
|
|
98
|
-
state =
|
|
110
|
+
state = _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, state), { [key]: nextValue });
|
|
99
111
|
const thisUpdate = Symbol();
|
|
100
112
|
lastUpdate = thisUpdate;
|
|
101
113
|
updatedKeys.add(key);
|
|
@@ -108,12 +120,14 @@ function createStore(initialState, ...stores) {
|
|
|
108
120
|
disposables.set(listener, listener(state, prev));
|
|
109
121
|
}
|
|
110
122
|
};
|
|
111
|
-
listeners.forEach((listener) =>
|
|
123
|
+
listeners.forEach((listener) => {
|
|
124
|
+
run(listener, prevState);
|
|
125
|
+
});
|
|
112
126
|
queueMicrotask(() => {
|
|
113
127
|
if (lastUpdate !== thisUpdate)
|
|
114
128
|
return;
|
|
115
129
|
const snapshot = state;
|
|
116
|
-
|
|
130
|
+
batchListeners.forEach((listener) => {
|
|
117
131
|
run(listener, prevStateBatch, updatedKeys);
|
|
118
132
|
});
|
|
119
133
|
prevStateBatch = snapshot;
|
|
@@ -176,7 +190,7 @@ function mergeStore(...stores) {
|
|
|
176
190
|
const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
|
|
177
191
|
if (!nextState)
|
|
178
192
|
return state;
|
|
179
|
-
return
|
|
193
|
+
return _WYXAWBLEcjs.__spreadValues.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, state), nextState);
|
|
180
194
|
}, {});
|
|
181
195
|
const store = createStore(initialState, ...stores);
|
|
182
196
|
return store;
|
|
@@ -195,7 +209,7 @@ function throwOnConflictingProps(props, store) {
|
|
|
195
209
|
return;
|
|
196
210
|
const storeState = store.getState();
|
|
197
211
|
const conflictingProps = defaultKeys.filter(
|
|
198
|
-
(key) =>
|
|
212
|
+
(key) => _LMT335NJcjs.hasOwnProperty.call(void 0, storeState, key)
|
|
199
213
|
);
|
|
200
214
|
if (!conflictingProps.length)
|
|
201
215
|
return;
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
|
-
var _GHET3DEScjs = require('./GHET3DES.cjs');
|
|
4
3
|
|
|
4
|
+
var _MLPOXRDTcjs = require('./MLPOXRDT.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var _7GWXP6CQcjs = require('./7GWXP6CQ.cjs');
|
|
10
9
|
|
|
10
|
+
var _OASSVCYRcjs = require('./OASSVCYR.cjs');
|
|
11
11
|
|
|
12
|
-
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
13
12
|
|
|
13
|
+
var _LMT335NJcjs = require('./LMT335NJ.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
var _WYXAWBLEcjs = require('./WYXAWBLE.cjs');
|
|
18
19
|
|
|
19
20
|
// src/popover/popover-store.ts
|
|
20
21
|
function createPopoverStore(_a = {}) {
|
|
21
22
|
var _b = _a, {
|
|
22
23
|
popover: otherPopover
|
|
23
|
-
} = _b, props =
|
|
24
|
+
} = _b, props = _WYXAWBLEcjs.__objRest.call(void 0, _b, [
|
|
24
25
|
"popover"
|
|
25
26
|
]);
|
|
26
|
-
const store =
|
|
27
|
+
const store = _OASSVCYRcjs.mergeStore.call(void 0,
|
|
27
28
|
props.store,
|
|
28
|
-
|
|
29
|
+
_OASSVCYRcjs.omit.call(void 0, otherPopover, [
|
|
29
30
|
"arrowElement",
|
|
30
31
|
"anchorElement",
|
|
31
32
|
"contentElement",
|
|
@@ -33,24 +34,24 @@ function createPopoverStore(_a = {}) {
|
|
|
33
34
|
"disclosureElement"
|
|
34
35
|
])
|
|
35
36
|
);
|
|
36
|
-
|
|
37
|
+
_OASSVCYRcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
37
38
|
const syncState = store == null ? void 0 : store.getState();
|
|
38
|
-
const dialog =
|
|
39
|
-
const placement =
|
|
39
|
+
const dialog = _MLPOXRDTcjs.createDialogStore.call(void 0, _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, props), { store }));
|
|
40
|
+
const placement = _LMT335NJcjs.defaultValue.call(void 0,
|
|
40
41
|
props.placement,
|
|
41
42
|
syncState == null ? void 0 : syncState.placement,
|
|
42
43
|
"bottom"
|
|
43
44
|
);
|
|
44
|
-
const initialState =
|
|
45
|
+
const initialState = _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, dialog.getState()), {
|
|
45
46
|
placement,
|
|
46
47
|
currentPlacement: placement,
|
|
47
|
-
anchorElement:
|
|
48
|
-
popoverElement:
|
|
49
|
-
arrowElement:
|
|
48
|
+
anchorElement: _LMT335NJcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
|
|
49
|
+
popoverElement: _LMT335NJcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
|
|
50
|
+
arrowElement: _LMT335NJcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
|
|
50
51
|
rendered: Symbol("rendered")
|
|
51
52
|
});
|
|
52
|
-
const popover =
|
|
53
|
-
return
|
|
53
|
+
const popover = _OASSVCYRcjs.createStore.call(void 0, initialState, dialog, store);
|
|
54
|
+
return _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, dialog), popover), {
|
|
54
55
|
setAnchorElement: (element) => popover.setState("anchorElement", element),
|
|
55
56
|
setPopoverElement: (element) => popover.setState("popoverElement", element),
|
|
56
57
|
setArrowElement: (element) => popover.setState("arrowElement", element),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
// src/utils/array.ts
|
|
2
4
|
function toArray(arg) {
|
|
3
5
|
if (Array.isArray(arg)) {
|
|
4
6
|
return arg;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
2
3
|
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
5
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|