@ariakit/core 0.4.11 → 0.4.12
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 +6 -1
- package/cjs/__chunks/{W3GMUKTU.cjs → A47DWKLR.cjs} +1 -1
- package/cjs/__chunks/{LLZO7SOB.cjs → FGGZELG7.cjs} +2 -2
- package/cjs/combobox/combobox-store.cjs +2 -2
- package/cjs/composite/composite-store.cjs +2 -2
- package/cjs/menu/menu-bar-store.cjs +3 -3
- package/cjs/menu/menu-store.cjs +2 -2
- package/cjs/menubar/menubar-store.cjs +3 -3
- package/cjs/radio/radio-store.cjs +2 -2
- package/cjs/select/select-store.cjs +2 -2
- package/cjs/tab/tab-store.cjs +2 -2
- package/cjs/tag/tag-store.cjs +2 -2
- package/cjs/toolbar/toolbar-store.cjs +2 -2
- package/esm/__chunks/{7IJEP35G.js → IJ6VFLJG.js} +1 -1
- package/esm/__chunks/{YKFX5MNB.js → S22RJCNX.js} +1 -1
- package/esm/combobox/combobox-store.js +1 -1
- package/esm/composite/composite-store.js +1 -1
- package/esm/menu/menu-bar-store.js +2 -2
- package/esm/menu/menu-store.js +1 -1
- package/esm/menubar/menubar-store.js +2 -2
- package/esm/radio/radio-store.js +1 -1
- package/esm/select/select-store.js +1 -1
- package/esm/tab/tab-store.js +1 -1
- package/esm/tag/tag-store.js +1 -1
- package/esm/toolbar/toolbar-store.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# @ariakit/core
|
|
2
2
|
|
|
3
|
+
## 0.4.12
|
|
4
|
+
|
|
5
|
+
- Fixed regression in [`focusShift`](https://ariakit.org/reference/composite-provider#focusshift).
|
|
6
|
+
- Improved JSDocs.
|
|
7
|
+
|
|
3
8
|
## 0.4.11
|
|
4
9
|
|
|
5
10
|
### Overriding composite state for specific methods
|
|
6
11
|
|
|
7
|
-
The [`next`](https://ariakit.org/reference/use-composite-store#next), [`previous`](https://ariakit.org/reference/use-composite-store#previous), [`up`](https://ariakit.org/reference/use-composite-store#up), and [`down`](https://ariakit.org/reference/use-composite-store#down) methods of the [composite store](https://ariakit.org/reference/use-composite-store) now accept an object as the first argument to override the composite state for that specific method. For example, you can pass a different [`activeId`](https://ariakit.org/reference/use-composite-store#
|
|
12
|
+
The [`next`](https://ariakit.org/reference/use-composite-store#next), [`previous`](https://ariakit.org/reference/use-composite-store#previous), [`up`](https://ariakit.org/reference/use-composite-store#up), and [`down`](https://ariakit.org/reference/use-composite-store#down) methods of the [composite store](https://ariakit.org/reference/use-composite-store) now accept an object as the first argument to override the composite state for that specific method. For example, you can pass a different [`activeId`](https://ariakit.org/reference/use-composite-store#activeid) value to the [`next`](https://ariakit.org/reference/use-composite-store#next) method so it returns the next item based on that value rather than the current active item in the composite store:
|
|
8
13
|
|
|
9
14
|
```js
|
|
10
15
|
const store = useCompositeStore({ defaultActiveId: "item1" });
|
|
@@ -177,7 +177,7 @@ function createCompositeStore(props = {}) {
|
|
|
177
177
|
let items = !isVerticalDirection ? renderedItems : _GDZQUFNPcjs.flatten2DArray.call(void 0,
|
|
178
178
|
normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)
|
|
179
179
|
);
|
|
180
|
-
items = canReverse ? _GDZQUFNPcjs.reverseArray.call(void 0,
|
|
180
|
+
items = canReverse ? _GDZQUFNPcjs.reverseArray.call(void 0, items) : items;
|
|
181
181
|
items = isVerticalDirection ? verticalizeItems(items) : items;
|
|
182
182
|
if (activeId2 == null) {
|
|
183
183
|
return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A47DWKLRcjs = require('./A47DWKLR.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
|
|
@@ -16,7 +16,7 @@ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
|
|
|
16
16
|
function createMenubarStore(props = {}) {
|
|
17
17
|
var _a;
|
|
18
18
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
19
|
-
const composite =
|
|
19
|
+
const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
20
20
|
orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
21
21
|
props.orientation,
|
|
22
22
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
|
|
4
4
|
require('../__chunks/G2NIRMCL.cjs');
|
|
5
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
6
6
|
|
|
@@ -50,7 +50,7 @@ function createComboboxStore(_a = {}) {
|
|
|
50
50
|
props.defaultActiveId,
|
|
51
51
|
null
|
|
52
52
|
);
|
|
53
|
-
const composite =
|
|
53
|
+
const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
54
54
|
activeId,
|
|
55
55
|
includesBaseElement: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
56
56
|
props.includesBaseElement,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
|
|
4
4
|
require('../__chunks/G2NIRMCL.cjs');
|
|
5
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
6
6
|
require('../__chunks/BSLRW6E7.cjs');
|
|
@@ -9,4 +9,4 @@ require('../__chunks/WCFMOJKV.cjs');
|
|
|
9
9
|
require('../__chunks/7EQBAZ46.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createCompositeStore =
|
|
12
|
+
exports.createCompositeStore = _A47DWKLRcjs.createCompositeStore;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _FGGZELG7cjs = require('../__chunks/FGGZELG7.cjs');
|
|
4
|
+
require('../__chunks/A47DWKLR.cjs');
|
|
5
5
|
require('../__chunks/G2NIRMCL.cjs');
|
|
6
6
|
require('../__chunks/GDZQUFNP.cjs');
|
|
7
7
|
require('../__chunks/BSLRW6E7.cjs');
|
|
@@ -11,7 +11,7 @@ require('../__chunks/7EQBAZ46.cjs');
|
|
|
11
11
|
|
|
12
12
|
// src/menu/menu-bar-store.ts
|
|
13
13
|
function createMenuBarStore(props = {}) {
|
|
14
|
-
return
|
|
14
|
+
return _FGGZELG7cjs.createMenubarStore.call(void 0, props);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
|
package/cjs/menu/menu-store.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _LSC6QXJ7cjs = require('../__chunks/LSC6QXJ7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
|
|
7
7
|
require('../__chunks/G2NIRMCL.cjs');
|
|
8
8
|
require('../__chunks/GDZQUFNP.cjs');
|
|
9
9
|
require('../__chunks/C5P5S22J.cjs');
|
|
@@ -54,7 +54,7 @@ function createMenuStore(_a = {}) {
|
|
|
54
54
|
);
|
|
55
55
|
_BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
|
|
56
56
|
const syncState = store.getState();
|
|
57
|
-
const composite =
|
|
57
|
+
const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
58
58
|
store,
|
|
59
59
|
orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
60
60
|
props.orientation,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _FGGZELG7cjs = require('../__chunks/FGGZELG7.cjs');
|
|
4
|
+
require('../__chunks/A47DWKLR.cjs');
|
|
5
5
|
require('../__chunks/G2NIRMCL.cjs');
|
|
6
6
|
require('../__chunks/GDZQUFNP.cjs');
|
|
7
7
|
require('../__chunks/BSLRW6E7.cjs');
|
|
@@ -10,4 +10,4 @@ require('../__chunks/WCFMOJKV.cjs');
|
|
|
10
10
|
require('../__chunks/7EQBAZ46.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createMenubarStore =
|
|
13
|
+
exports.createMenubarStore = _FGGZELG7cjs.createMenubarStore;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
|
|
4
4
|
require('../__chunks/G2NIRMCL.cjs');
|
|
5
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ function createRadioStore(_a = {}) {
|
|
|
21
21
|
var props = _7EQBAZ46cjs.__objRest.call(void 0, _a, []);
|
|
22
22
|
var _a2;
|
|
23
23
|
const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
|
|
24
|
-
const composite =
|
|
24
|
+
const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
25
25
|
focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
26
26
|
}));
|
|
27
27
|
const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
|
|
4
4
|
require('../__chunks/G2NIRMCL.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
@@ -52,7 +52,7 @@ function createSelectStore(_a = {}) {
|
|
|
52
52
|
);
|
|
53
53
|
_BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
|
|
54
54
|
const syncState = store.getState();
|
|
55
|
-
const composite =
|
|
55
|
+
const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
56
56
|
store,
|
|
57
57
|
virtualFocus: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
58
58
|
props.virtualFocus,
|
package/cjs/tab/tab-store.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _G2NIRMCLcjs = require('../__chunks/G2NIRMCL.cjs');
|
|
@@ -51,7 +51,7 @@ function createTabStore(_a = {}) {
|
|
|
51
51
|
_BSLRW6E7cjs.omit.call(void 0, combobox, independentKeys)
|
|
52
52
|
);
|
|
53
53
|
const syncState = store == null ? void 0 : store.getState();
|
|
54
|
-
const composite =
|
|
54
|
+
const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
55
55
|
store,
|
|
56
56
|
// We need to explicitly set the default value of `includesBaseElement` to
|
|
57
57
|
// `false` since we don't want the composite store to default it to `true`
|
package/cjs/tag/tag-store.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
|
|
4
4
|
require('../__chunks/G2NIRMCL.cjs');
|
|
5
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
|
|
|
25
25
|
function createTagStore(props = {}) {
|
|
26
26
|
var _a;
|
|
27
27
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
28
|
-
const composite =
|
|
28
|
+
const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, props);
|
|
29
29
|
const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
30
30
|
inputElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.inputElement, null),
|
|
31
31
|
labelElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.labelElement, null),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
|
|
4
4
|
require('../__chunks/G2NIRMCL.cjs');
|
|
5
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
6
6
|
require('../__chunks/BSLRW6E7.cjs');
|
|
@@ -17,7 +17,7 @@ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
|
|
|
17
17
|
function createToolbarStore(props = {}) {
|
|
18
18
|
var _a;
|
|
19
19
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
-
return
|
|
20
|
+
return _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
21
21
|
orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
22
22
|
props.orientation,
|
|
23
23
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -178,7 +178,7 @@ function createCompositeStore(props = {}) {
|
|
|
178
178
|
let items = !isVerticalDirection ? renderedItems : flatten2DArray(
|
|
179
179
|
normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)
|
|
180
180
|
);
|
|
181
|
-
items = canReverse ? reverseArray(
|
|
181
|
+
items = canReverse ? reverseArray(items) : items;
|
|
182
182
|
items = isVerticalDirection ? verticalizeItems(items) : items;
|
|
183
183
|
if (activeId2 == null) {
|
|
184
184
|
return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createMenubarStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/S22RJCNX.js";
|
|
5
|
+
import "../__chunks/IJ6VFLJG.js";
|
|
6
6
|
import "../__chunks/7DTP4AQO.js";
|
|
7
7
|
import "../__chunks/7PRQYBBV.js";
|
|
8
8
|
import "../__chunks/EQQLU3CG.js";
|
package/esm/menu/menu-store.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createMenubarStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/S22RJCNX.js";
|
|
5
|
+
import "../__chunks/IJ6VFLJG.js";
|
|
6
6
|
import "../__chunks/7DTP4AQO.js";
|
|
7
7
|
import "../__chunks/7PRQYBBV.js";
|
|
8
8
|
import "../__chunks/EQQLU3CG.js";
|
package/esm/radio/radio-store.js
CHANGED
package/esm/tab/tab-store.js
CHANGED
package/esm/tag/tag-store.js
CHANGED