@ariakit/core 0.4.9 → 0.4.11

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/cjs/__chunks/{3IVNQNIV.cjs → 7EQBAZ46.cjs} +1 -2
  3. package/cjs/__chunks/{3QF3ODTR.cjs → BSLRW6E7.cjs} +15 -16
  4. package/cjs/__chunks/{H6ZQSQQL.cjs → C5P5S22J.cjs} +17 -18
  5. package/cjs/__chunks/{QLWAGBAQ.cjs → G2MFLTB2.cjs} +19 -20
  6. package/cjs/__chunks/{CCI5VM7E.cjs → G2NIRMCL.cjs} +19 -20
  7. package/cjs/__chunks/{ULSPM3Y3.cjs → GDZQUFNP.cjs} +1 -3
  8. package/cjs/__chunks/{N667HVED.cjs → I2G6EN27.cjs} +3 -4
  9. package/cjs/__chunks/LLZO7SOB.cjs +34 -0
  10. package/cjs/__chunks/LSC6QXJ7.cjs +41 -0
  11. package/cjs/__chunks/{BTUHABP4.cjs → MLCPLY2P.cjs} +3 -4
  12. package/cjs/__chunks/{7CES7GVE.cjs → SHOLYDNP.cjs} +1 -3
  13. package/cjs/__chunks/{KCEXELK7.cjs → TEPPO3KC.cjs} +7 -8
  14. package/cjs/__chunks/{PW36G76L.cjs → W3GMUKTU.cjs} +76 -99
  15. package/cjs/__chunks/{7WYII4AN.cjs → WCFMOJKV.cjs} +8 -7
  16. package/cjs/checkbox/checkbox-store.cjs +8 -9
  17. package/cjs/collection/collection-store.cjs +7 -8
  18. package/cjs/combobox/combobox-store.cjs +47 -48
  19. package/cjs/composite/composite-overflow-store.cjs +8 -9
  20. package/cjs/composite/composite-store.cjs +9 -10
  21. package/cjs/composite/composite-store.d.cts +30 -12
  22. package/cjs/composite/composite-store.d.ts +30 -12
  23. package/cjs/dialog/dialog-store.cjs +7 -8
  24. package/cjs/disclosure/disclosure-store.cjs +6 -7
  25. package/cjs/form/form-store.cjs +29 -30
  26. package/cjs/form/types.cjs +1 -1
  27. package/cjs/hovercard/hovercard-store.cjs +9 -10
  28. package/cjs/index.cjs +1 -2
  29. package/cjs/menu/menu-bar-store.cjs +10 -11
  30. package/cjs/menu/menu-store.cjs +34 -35
  31. package/cjs/menubar/menubar-store.cjs +10 -11
  32. package/cjs/popover/popover-store.cjs +8 -9
  33. package/cjs/radio/radio-store.cjs +15 -16
  34. package/cjs/select/select-store.cjs +39 -40
  35. package/cjs/tab/tab-store.cjs +45 -40
  36. package/cjs/tag/tag-store.cjs +21 -22
  37. package/cjs/toolbar/toolbar-store.cjs +11 -12
  38. package/cjs/tooltip/tooltip-store.cjs +16 -17
  39. package/cjs/utils/array.cjs +4 -5
  40. package/cjs/utils/dom.cjs +4 -5
  41. package/cjs/utils/events.cjs +9 -10
  42. package/cjs/utils/focus.cjs +13 -14
  43. package/cjs/utils/misc.cjs +4 -5
  44. package/cjs/utils/platform.cjs +5 -6
  45. package/cjs/utils/store.cjs +5 -6
  46. package/cjs/utils/types.cjs +1 -1
  47. package/cjs/utils/undo.cjs +4 -5
  48. package/esm/__chunks/{US4USQPI.js → 3VBK76MS.js} +1 -1
  49. package/esm/__chunks/{6DHTHWXD.js → 7DTP4AQO.js} +1 -1
  50. package/esm/__chunks/{D7EIQZAU.js → 7IJEP35G.js} +53 -75
  51. package/esm/__chunks/{HWOIWM4O.js → PQP5VPTV.js} +7 -4
  52. package/esm/__chunks/{PIWLWQMB.js → YKFX5MNB.js} +1 -1
  53. package/esm/collection/collection-store.js +2 -2
  54. package/esm/combobox/combobox-store.js +6 -6
  55. package/esm/composite/composite-store.d.ts +30 -12
  56. package/esm/composite/composite-store.js +3 -3
  57. package/esm/form/form-store.js +2 -2
  58. package/esm/menu/menu-bar-store.js +4 -4
  59. package/esm/menu/menu-store.js +3 -3
  60. package/esm/menubar/menubar-store.js +4 -4
  61. package/esm/radio/radio-store.js +3 -3
  62. package/esm/select/select-store.js +3 -3
  63. package/esm/tab/tab-store.js +11 -5
  64. package/esm/tag/tag-store.js +3 -3
  65. package/esm/toolbar/toolbar-store.js +3 -3
  66. package/esm/utils/dom.js +1 -1
  67. package/esm/utils/events.js +2 -2
  68. package/esm/utils/focus.js +1 -1
  69. package/esm/utils/platform.js +2 -2
  70. package/package.json +1 -1
  71. package/cjs/__chunks/VJAE2Y4T.cjs +0 -35
  72. package/cjs/__chunks/XIZWLBI2.cjs +0 -42
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @ariakit/core
2
2
 
3
+ ## 0.4.11
4
+
5
+ ### Overriding composite state for specific methods
6
+
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#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
+
9
+ ```js
10
+ const store = useCompositeStore({ defaultActiveId: "item1" });
11
+ const item3 = store.next({ activeId: "item2" });
12
+ ```
13
+
14
+ It's important to note that the composite state is not modified when using this feature. The state passed to these methods is used solely for that specific method call.
15
+
16
+ ### Other updates
17
+
18
+ - Fixed CJS build on Next.js.
19
+ - Fixed `getScrollingElement` to consider `overflow: clip`.
20
+ - Improved JSDocs.
21
+
22
+ ## 0.4.10
23
+
24
+ ### Tabs inside animated Combobox or Select
25
+
26
+ When rendering [Tab](https://ariakit.org/components/tab) inside [Combobox](https://ariakit.org/components/combobox) or [Select](https://ariakit.org/components/select), it now waits for the closing animation to finish before restoring the tab with the selected item. This should prevent an inconsistent UI where the tab is restored immediately while the content is still animating out. See [Select with Combobox and Tabs](https://ariakit.org/examples/select-combobox-tab).
27
+
28
+ ### Other updates
29
+
30
+ - Updated [Combobox](https://ariakit.org/components/combobox) to immediately reset the [`activeId`](https://ariakit.org/reference/use-combobox-store#activeid) upon closing the popover.
31
+ - Improved JSDocs.
32
+
3
33
  ## 0.4.9
4
34
 
5
35
  - Improved JSDocs.
@@ -1,5 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
- var __defProp = Object.defineProperty;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
3
2
  var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
4
 
@@ -7,24 +7,23 @@
7
7
 
8
8
 
9
9
 
10
+ var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
10
11
 
11
- var _BTUHABP4cjs = require('./BTUHABP4.cjs');
12
12
 
13
13
 
14
-
15
- var _3IVNQNIVcjs = require('./3IVNQNIV.cjs');
14
+ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
16
15
 
17
16
  // src/utils/store.ts
18
17
  function getInternal(store, key) {
19
18
  const internals = store.__unstableInternals;
20
- _BTUHABP4cjs.invariant.call(void 0, internals, "Invalid store");
19
+ _MLCPLY2Pcjs.invariant.call(void 0, internals, "Invalid store");
21
20
  return internals[key];
22
21
  }
23
22
  function createStore(initialState, ...stores) {
24
23
  let state = initialState;
25
24
  let prevStateBatch = state;
26
25
  let lastUpdate = Symbol();
27
- let destroy = _BTUHABP4cjs.noop;
26
+ let destroy = _MLCPLY2Pcjs.noop;
28
27
  const instances = /* @__PURE__ */ new Set();
29
28
  const updatedKeys = /* @__PURE__ */ new Set();
30
29
  const setups = /* @__PURE__ */ new Set();
@@ -46,13 +45,13 @@ function createStore(initialState, ...stores) {
46
45
  destroy();
47
46
  };
48
47
  if (initialized) return maybeDestroy;
49
- const desyncs = _BTUHABP4cjs.getKeys.call(void 0, state).map(
50
- (key) => _BTUHABP4cjs.chain.call(void 0,
48
+ const desyncs = _MLCPLY2Pcjs.getKeys.call(void 0, state).map(
49
+ (key) => _MLCPLY2Pcjs.chain.call(void 0,
51
50
  ...stores.map((store) => {
52
51
  var _a;
53
52
  const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
54
53
  if (!storeState) return;
55
- if (!_BTUHABP4cjs.hasOwnProperty.call(void 0, storeState, key)) return;
54
+ if (!_MLCPLY2Pcjs.hasOwnProperty.call(void 0, storeState, key)) return;
56
55
  return sync(store, [key], (state2) => {
57
56
  setState(
58
57
  key,
@@ -70,7 +69,7 @@ function createStore(initialState, ...stores) {
70
69
  teardowns.push(setup2());
71
70
  }
72
71
  const cleanups = stores.map(init);
73
- destroy = _BTUHABP4cjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
72
+ destroy = _MLCPLY2Pcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
74
73
  return maybeDestroy;
75
74
  };
76
75
  const sub = (keys, listener, set = listeners) => {
@@ -93,13 +92,13 @@ function createStore(initialState, ...stores) {
93
92
  disposables.set(listener, listener(state, prevStateBatch));
94
93
  return sub(keys, listener, batchListeners);
95
94
  };
96
- const storePick = (keys) => createStore(_BTUHABP4cjs.pick.call(void 0, state, keys), finalStore);
97
- const storeOmit = (keys) => createStore(_BTUHABP4cjs.omit.call(void 0, state, keys), finalStore);
95
+ const storePick = (keys) => createStore(_MLCPLY2Pcjs.pick.call(void 0, state, keys), finalStore);
96
+ const storeOmit = (keys) => createStore(_MLCPLY2Pcjs.omit.call(void 0, state, keys), finalStore);
98
97
  const getState = () => state;
99
98
  const setState = (key, value, fromStores = false) => {
100
99
  var _a;
101
- if (!_BTUHABP4cjs.hasOwnProperty.call(void 0, state, key)) return;
102
- const nextValue = _BTUHABP4cjs.applyState.call(void 0, value, state[key]);
100
+ if (!_MLCPLY2Pcjs.hasOwnProperty.call(void 0, state, key)) return;
101
+ const nextValue = _MLCPLY2Pcjs.applyState.call(void 0, value, state[key]);
103
102
  if (nextValue === state[key]) return;
104
103
  if (!fromStores) {
105
104
  for (const store of stores) {
@@ -107,7 +106,7 @@ function createStore(initialState, ...stores) {
107
106
  }
108
107
  }
109
108
  const prevState = state;
110
- state = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, state), { [key]: nextValue });
109
+ state = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, state), { [key]: nextValue });
111
110
  const thisUpdate = Symbol();
112
111
  lastUpdate = thisUpdate;
113
112
  updatedKeys.add(key);
@@ -197,7 +196,7 @@ function throwOnConflictingProps(props, store) {
197
196
  if (!defaultKeys.length) return;
198
197
  const storeState = store.getState();
199
198
  const conflictingProps = defaultKeys.filter(
200
- (key) => _BTUHABP4cjs.hasOwnProperty.call(void 0, storeState, key)
199
+ (key) => _MLCPLY2Pcjs.hasOwnProperty.call(void 0, storeState, key)
201
200
  );
202
201
  if (!conflictingProps.length) return;
203
202
  throw new Error(
@@ -1,32 +1,31 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _I2G6EN27cjs = require('./I2G6EN27.cjs');
3
4
 
4
- var _N667HVEDcjs = require('./N667HVED.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
+ var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
9
10
 
10
- var _3QF3ODTRcjs = require('./3QF3ODTR.cjs');
11
11
 
12
+ var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
12
13
 
13
- var _BTUHABP4cjs = require('./BTUHABP4.cjs');
14
14
 
15
15
 
16
16
 
17
-
18
- var _3IVNQNIVcjs = require('./3IVNQNIV.cjs');
17
+ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
19
18
 
20
19
  // src/popover/popover-store.ts
21
20
  function createPopoverStore(_a = {}) {
22
21
  var _b = _a, {
23
22
  popover: otherPopover
24
- } = _b, props = _3IVNQNIVcjs.__objRest.call(void 0, _b, [
23
+ } = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
25
24
  "popover"
26
25
  ]);
27
- const store = _3QF3ODTRcjs.mergeStore.call(void 0,
26
+ const store = _BSLRW6E7cjs.mergeStore.call(void 0,
28
27
  props.store,
29
- _3QF3ODTRcjs.omit.call(void 0, otherPopover, [
28
+ _BSLRW6E7cjs.omit.call(void 0, otherPopover, [
30
29
  "arrowElement",
31
30
  "anchorElement",
32
31
  "contentElement",
@@ -34,24 +33,24 @@ function createPopoverStore(_a = {}) {
34
33
  "disclosureElement"
35
34
  ])
36
35
  );
37
- _3QF3ODTRcjs.throwOnConflictingProps.call(void 0, props, store);
36
+ _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
38
37
  const syncState = store == null ? void 0 : store.getState();
39
- const dialog = _N667HVEDcjs.createDialogStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), { store }));
40
- const placement = _BTUHABP4cjs.defaultValue.call(void 0,
38
+ const dialog = _I2G6EN27cjs.createDialogStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), { store }));
39
+ const placement = _MLCPLY2Pcjs.defaultValue.call(void 0,
41
40
  props.placement,
42
41
  syncState == null ? void 0 : syncState.placement,
43
42
  "bottom"
44
43
  );
45
- const initialState = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, dialog.getState()), {
44
+ const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, dialog.getState()), {
46
45
  placement,
47
46
  currentPlacement: placement,
48
- anchorElement: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
49
- popoverElement: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
50
- arrowElement: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
47
+ anchorElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
48
+ popoverElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
49
+ arrowElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
51
50
  rendered: Symbol("rendered")
52
51
  });
53
- const popover = _3QF3ODTRcjs.createStore.call(void 0, initialState, dialog, store);
54
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, dialog), popover), {
52
+ const popover = _BSLRW6E7cjs.createStore.call(void 0, initialState, dialog, store);
53
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, dialog), popover), {
55
54
  setAnchorElement: (element) => popover.setState("anchorElement", element),
56
55
  setPopoverElement: (element) => popover.setState("popoverElement", element),
57
56
  setArrowElement: (element) => popover.setState("arrowElement", element),
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
4
 
@@ -6,61 +6,60 @@
6
6
 
7
7
 
8
8
 
9
+ var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
9
10
 
10
- var _3QF3ODTRcjs = require('./3QF3ODTR.cjs');
11
11
 
12
+ var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
12
13
 
13
- var _BTUHABP4cjs = require('./BTUHABP4.cjs');
14
14
 
15
15
 
16
-
17
- var _3IVNQNIVcjs = require('./3IVNQNIV.cjs');
16
+ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
18
17
 
19
18
  // src/disclosure/disclosure-store.ts
20
19
  function createDisclosureStore(props = {}) {
21
- const store = _3QF3ODTRcjs.mergeStore.call(void 0,
20
+ const store = _BSLRW6E7cjs.mergeStore.call(void 0,
22
21
  props.store,
23
- _3QF3ODTRcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
22
+ _BSLRW6E7cjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
24
23
  );
25
- _3QF3ODTRcjs.throwOnConflictingProps.call(void 0, props, store);
24
+ _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
26
25
  const syncState = store == null ? void 0 : store.getState();
27
- const open = _BTUHABP4cjs.defaultValue.call(void 0,
26
+ const open = _MLCPLY2Pcjs.defaultValue.call(void 0,
28
27
  props.open,
29
28
  syncState == null ? void 0 : syncState.open,
30
29
  props.defaultOpen,
31
30
  false
32
31
  );
33
- const animated = _BTUHABP4cjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
32
+ const animated = _MLCPLY2Pcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
34
33
  const initialState = {
35
34
  open,
36
35
  animated,
37
36
  animating: !!animated && open,
38
37
  mounted: open,
39
- contentElement: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
40
- disclosureElement: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
38
+ contentElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
39
+ disclosureElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
41
40
  };
42
- const disclosure = _3QF3ODTRcjs.createStore.call(void 0, initialState, store);
43
- _3QF3ODTRcjs.setup.call(void 0,
41
+ const disclosure = _BSLRW6E7cjs.createStore.call(void 0, initialState, store);
42
+ _BSLRW6E7cjs.setup.call(void 0,
44
43
  disclosure,
45
- () => _3QF3ODTRcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
44
+ () => _BSLRW6E7cjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
46
45
  if (state.animated) return;
47
46
  disclosure.setState("animating", false);
48
47
  })
49
48
  );
50
- _3QF3ODTRcjs.setup.call(void 0,
49
+ _BSLRW6E7cjs.setup.call(void 0,
51
50
  disclosure,
52
- () => _3QF3ODTRcjs.subscribe.call(void 0, disclosure, ["open"], () => {
51
+ () => _BSLRW6E7cjs.subscribe.call(void 0, disclosure, ["open"], () => {
53
52
  if (!disclosure.getState().animated) return;
54
53
  disclosure.setState("animating", true);
55
54
  })
56
55
  );
57
- _3QF3ODTRcjs.setup.call(void 0,
56
+ _BSLRW6E7cjs.setup.call(void 0,
58
57
  disclosure,
59
- () => _3QF3ODTRcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
58
+ () => _BSLRW6E7cjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
60
59
  disclosure.setState("mounted", state.open || state.animating);
61
60
  })
62
61
  );
63
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, disclosure), {
62
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, disclosure), {
64
63
  disclosure: props.disclosure,
65
64
  setOpen: (value) => disclosure.setState("open", value),
66
65
  show: () => disclosure.setState("open", true),
@@ -1,22 +1,21 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
4
 
5
5
 
6
6
 
7
+ var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
7
8
 
8
- var _3QF3ODTRcjs = require('./3QF3ODTR.cjs');
9
9
 
10
10
 
11
+ var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
11
12
 
12
- var _BTUHABP4cjs = require('./BTUHABP4.cjs');
13
13
 
14
+ var _WCFMOJKVcjs = require('./WCFMOJKV.cjs');
14
15
 
15
- var _7WYII4ANcjs = require('./7WYII4AN.cjs');
16
16
 
17
17
 
18
-
19
- var _3IVNQNIVcjs = require('./3IVNQNIV.cjs');
18
+ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
20
19
 
21
20
  // src/collection/collection-store.ts
22
21
  function isElementPreceding(a, b) {
@@ -60,16 +59,16 @@ function getCommonParent(items) {
60
59
  }
61
60
  parentElement = parentElement.parentElement;
62
61
  }
63
- return _7WYII4ANcjs.getDocument.call(void 0, parentElement).body;
62
+ return _WCFMOJKVcjs.getDocument.call(void 0, parentElement).body;
64
63
  }
65
64
  function getPrivateStore(store) {
66
65
  return store == null ? void 0 : store.__unstablePrivateStore;
67
66
  }
68
67
  function createCollectionStore(props = {}) {
69
68
  var _a;
70
- _3QF3ODTRcjs.throwOnConflictingProps.call(void 0, props, props.store);
69
+ _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, props.store);
71
70
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
72
- const items = _BTUHABP4cjs.defaultValue.call(void 0,
71
+ const items = _MLCPLY2Pcjs.defaultValue.call(void 0,
73
72
  props.items,
74
73
  syncState == null ? void 0 : syncState.items,
75
74
  props.defaultItems,
@@ -78,27 +77,27 @@ function createCollectionStore(props = {}) {
78
77
  const itemsMap = new Map(items.map((item) => [item.id, item]));
79
78
  const initialState = {
80
79
  items,
81
- renderedItems: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
80
+ renderedItems: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
82
81
  };
83
82
  const syncPrivateStore = getPrivateStore(props.store);
84
- const privateStore = _3QF3ODTRcjs.createStore.call(void 0,
83
+ const privateStore = _BSLRW6E7cjs.createStore.call(void 0,
85
84
  { items, renderedItems: initialState.renderedItems },
86
85
  syncPrivateStore
87
86
  );
88
- const collection = _3QF3ODTRcjs.createStore.call(void 0, initialState, props.store);
87
+ const collection = _BSLRW6E7cjs.createStore.call(void 0, initialState, props.store);
89
88
  const sortItems = (renderedItems) => {
90
89
  const sortedItems = sortBasedOnDOMPosition(renderedItems);
91
90
  privateStore.setState("renderedItems", sortedItems);
92
91
  collection.setState("renderedItems", sortedItems);
93
92
  };
94
- _3QF3ODTRcjs.setup.call(void 0, collection, () => _3QF3ODTRcjs.init.call(void 0, privateStore));
95
- _3QF3ODTRcjs.setup.call(void 0, privateStore, () => {
96
- return _3QF3ODTRcjs.batch.call(void 0, privateStore, ["items"], (state) => {
93
+ _BSLRW6E7cjs.setup.call(void 0, collection, () => _BSLRW6E7cjs.init.call(void 0, privateStore));
94
+ _BSLRW6E7cjs.setup.call(void 0, privateStore, () => {
95
+ return _BSLRW6E7cjs.batch.call(void 0, privateStore, ["items"], (state) => {
97
96
  collection.setState("items", state.items);
98
97
  });
99
98
  });
100
- _3QF3ODTRcjs.setup.call(void 0, privateStore, () => {
101
- return _3QF3ODTRcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
99
+ _BSLRW6E7cjs.setup.call(void 0, privateStore, () => {
100
+ return _BSLRW6E7cjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
102
101
  let firstRun = true;
103
102
  let raf = requestAnimationFrame(() => {
104
103
  const { renderedItems } = collection.getState();
@@ -135,7 +134,7 @@ function createCollectionStore(props = {}) {
135
134
  const nextItems = items2.slice();
136
135
  if (index !== -1) {
137
136
  prevItem = items2[index];
138
- const nextItem = _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, prevItem), item);
137
+ const nextItem = _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, prevItem), item);
139
138
  nextItems[index] = nextItem;
140
139
  itemsMap.set(item.id, nextItem);
141
140
  } else {
@@ -167,9 +166,9 @@ function createCollectionStore(props = {}) {
167
166
  (getItems) => privateStore.setState("items", getItems),
168
167
  true
169
168
  );
170
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, collection), {
169
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection), {
171
170
  registerItem,
172
- renderItem: (item) => _BTUHABP4cjs.chain.call(void 0,
171
+ renderItem: (item) => _MLCPLY2Pcjs.chain.call(void 0,
173
172
  registerItem(item),
174
173
  mergeItem(
175
174
  item,
@@ -1,6 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
- // src/utils/array.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/array.ts
4
2
  function toArray(arg) {
5
3
  if (Array.isArray(arg)) {
6
4
  return arg;
@@ -1,11 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
-
4
- var _QLWAGBAQcjs = require('./QLWAGBAQ.cjs');
3
+ var _G2MFLTB2cjs = require('./G2MFLTB2.cjs');
5
4
 
6
5
  // src/dialog/dialog-store.ts
7
6
  function createDialogStore(props = {}) {
8
- return _QLWAGBAQcjs.createDisclosureStore.call(void 0, props);
7
+ return _G2MFLTB2cjs.createDisclosureStore.call(void 0, props);
9
8
  }
10
9
 
11
10
 
@@ -0,0 +1,34 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _W3GMUKTUcjs = require('./W3GMUKTU.cjs');
4
+
5
+
6
+ var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
7
+
8
+
9
+ var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
10
+
11
+
12
+
13
+ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
14
+
15
+ // src/menubar/menubar-store.ts
16
+ function createMenubarStore(props = {}) {
17
+ var _a;
18
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
19
+ const composite = _W3GMUKTUcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
20
+ orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
21
+ props.orientation,
22
+ syncState == null ? void 0 : syncState.orientation,
23
+ "horizontal"
24
+ ),
25
+ focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
26
+ }));
27
+ const initialState = _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState());
28
+ const menubar = _BSLRW6E7cjs.createStore.call(void 0, initialState, composite, props.store);
29
+ return _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite), menubar);
30
+ }
31
+
32
+
33
+
34
+ exports.createMenubarStore = createMenubarStore;
@@ -0,0 +1,41 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _C5P5S22Jcjs = require('./C5P5S22J.cjs');
4
+
5
+
6
+ var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
7
+
8
+
9
+ var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
10
+
11
+
12
+
13
+ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
14
+
15
+ // src/hovercard/hovercard-store.ts
16
+ function createHovercardStore(props = {}) {
17
+ var _a;
18
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
19
+ const popover = _C5P5S22Jcjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
20
+ placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
21
+ props.placement,
22
+ syncState == null ? void 0 : syncState.placement,
23
+ "bottom"
24
+ )
25
+ }));
26
+ const timeout = _MLCPLY2Pcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
27
+ const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, popover.getState()), {
28
+ timeout,
29
+ showTimeout: _MLCPLY2Pcjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
30
+ hideTimeout: _MLCPLY2Pcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
31
+ autoFocusOnShow: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
32
+ });
33
+ const hovercard = _BSLRW6E7cjs.createStore.call(void 0, initialState, popover, props.store);
34
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, popover), hovercard), {
35
+ setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
36
+ });
37
+ }
38
+
39
+
40
+
41
+ exports.createHovercardStore = createHovercardStore;
@@ -1,7 +1,6 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
-
4
- var _3IVNQNIVcjs = require('./3IVNQNIV.cjs');
3
+ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
5
4
 
6
5
  // src/utils/misc.ts
7
6
  function noop(..._) {
@@ -74,7 +73,7 @@ function normalizeString(str) {
74
73
  return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
75
74
  }
76
75
  function omit(object, keys) {
77
- const result = _3IVNQNIVcjs.__spreadValues.call(void 0, {}, object);
76
+ const result = _7EQBAZ46cjs.__spreadValues.call(void 0, {}, object);
78
77
  for (const key of keys) {
79
78
  if (hasOwnProperty(result, key)) {
80
79
  delete result[key];
@@ -1,6 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
- // src/utils/undo.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/undo.ts
4
2
  function createUndoCallback(callback) {
5
3
  return async () => {
6
4
  const redo = await (callback == null ? void 0 : callback());
@@ -1,24 +1,23 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
-
4
- var _7WYII4ANcjs = require('./7WYII4AN.cjs');
3
+ var _WCFMOJKVcjs = require('./WCFMOJKV.cjs');
5
4
 
6
5
  // src/utils/platform.ts
7
6
  function isTouchDevice() {
8
- return _7WYII4ANcjs.canUseDOM && !!navigator.maxTouchPoints;
7
+ return _WCFMOJKVcjs.canUseDOM && !!navigator.maxTouchPoints;
9
8
  }
10
9
  function isApple() {
11
- if (!_7WYII4ANcjs.canUseDOM) return false;
10
+ if (!_WCFMOJKVcjs.canUseDOM) return false;
12
11
  return /mac|iphone|ipad|ipod/i.test(navigator.platform);
13
12
  }
14
13
  function isSafari() {
15
- return _7WYII4ANcjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
14
+ return _WCFMOJKVcjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
16
15
  }
17
16
  function isFirefox() {
18
- return _7WYII4ANcjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
17
+ return _WCFMOJKVcjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
19
18
  }
20
19
  function isMac() {
21
- return _7WYII4ANcjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
20
+ return _WCFMOJKVcjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
22
21
  }
23
22
 
24
23