@ariakit/core 0.3.4 → 0.3.6
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 +8 -0
- package/cjs/__chunks/{LMT335NJ.cjs → 3UT5FE6K.cjs} +2 -2
- package/cjs/__chunks/{OASSVCYR.cjs → 46BH65MC.cjs} +20 -22
- package/cjs/__chunks/{FTB5CXVB.cjs → 5F4DVUNS.cjs} +7 -1
- package/cjs/__chunks/{M44E4T5A.cjs → 6WBY3ZZM.cjs} +21 -21
- package/cjs/__chunks/{ROX3MRGO.cjs → 7ZUFMSXJ.cjs} +16 -16
- package/cjs/__chunks/GXIZMD53.cjs +35 -0
- package/cjs/__chunks/{MLPOXRDT.cjs → GZDVJEID.cjs} +2 -2
- package/cjs/__chunks/{25WWT2VO.cjs → JLC5A6WF.cjs} +15 -15
- package/cjs/__chunks/{YXSGST3H.cjs → MEHGRTJ3.cjs} +18 -18
- package/cjs/__chunks/PD7XZBXC.cjs +42 -0
- package/cjs/__chunks/{G5EW4WED.cjs → YIUPKKEK.cjs} +6 -6
- package/cjs/checkbox/checkbox-store.cjs +7 -7
- package/cjs/collection/collection-store.cjs +6 -6
- package/cjs/combobox/combobox-store.cjs +34 -34
- package/cjs/combobox/combobox-store.d.cts +4 -1
- package/cjs/combobox/combobox-store.d.ts +4 -1
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-store.cjs +7 -7
- package/cjs/dialog/dialog-store.cjs +6 -6
- package/cjs/disclosure/disclosure-store.cjs +5 -5
- package/cjs/form/form-store.cjs +28 -28
- package/cjs/hovercard/hovercard-store.cjs +8 -8
- package/cjs/index.cjs +1 -1
- package/cjs/menu/menu-bar-store.cjs +8 -21
- package/cjs/menu/menu-bar-store.d.cts +6 -6
- package/cjs/menu/menu-bar-store.d.ts +6 -6
- package/cjs/menu/menu-store.cjs +32 -32
- package/cjs/menubar/menubar-store.cjs +14 -0
- package/cjs/menubar/menubar-store.d.cts +16 -0
- package/cjs/menubar/menubar-store.d.ts +16 -0
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +13 -13
- package/cjs/select/select-store.cjs +33 -33
- package/cjs/tab/tab-store.cjs +25 -25
- package/cjs/toolbar/toolbar-store.cjs +9 -9
- package/cjs/tooltip/tooltip-store.cjs +15 -15
- package/cjs/utils/array.cjs +1 -1
- package/cjs/utils/dom.cjs +5 -3
- package/cjs/utils/dom.d.cts +9 -0
- package/cjs/utils/dom.d.ts +9 -0
- package/cjs/utils/events.cjs +8 -8
- package/cjs/utils/focus.cjs +15 -15
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/platform.cjs +4 -4
- package/cjs/utils/store.cjs +4 -4
- package/esm/__chunks/ANO6WJO4.js +35 -0
- package/esm/__chunks/{LWQU4J4N.js → BXH3I7ML.js} +4 -4
- package/esm/__chunks/{Q332EHXG.js → CCU5UHQ2.js} +4 -4
- package/esm/__chunks/{I7YGHQ4Z.js → CL47ZAPY.js} +1 -1
- package/esm/__chunks/{NIF7E7VE.js → DLOEKDPY.js} +7 -1
- package/esm/__chunks/{TEJLMP2M.js → DYD4YNLE.js} +3 -3
- package/esm/__chunks/{GME4NYXR.js → E7OQVGGY.js} +6 -8
- package/esm/__chunks/{D23ES3Z4.js → I2VQ3XGR.js} +1 -1
- package/esm/__chunks/{5UJPJ37G.js → MHPO2BXA.js} +1 -1
- package/esm/__chunks/{FGW7QUD2.js → OGMLJYDV.js} +4 -4
- package/esm/__chunks/{VEWADM34.js → WY3EMTH6.js} +4 -4
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +5 -5
- package/esm/combobox/combobox-store.d.ts +4 -1
- package/esm/combobox/combobox-store.js +10 -10
- package/esm/composite/composite-overflow-store.js +6 -6
- package/esm/composite/composite-store.js +6 -6
- package/esm/dialog/dialog-store.js +5 -5
- package/esm/disclosure/disclosure-store.js +4 -4
- package/esm/form/form-store.js +5 -5
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.d.ts +6 -6
- package/esm/menu/menu-bar-store.js +9 -22
- package/esm/menu/menu-store.js +10 -10
- package/esm/menubar/menubar-store.d.ts +16 -0
- package/esm/menubar/menubar-store.js +14 -0
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +6 -6
- package/esm/select/select-store.js +9 -9
- package/esm/tab/tab-store.js +6 -6
- package/esm/toolbar/toolbar-store.js +6 -6
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/utils/array.js +1 -1
- package/esm/utils/dom.d.ts +9 -0
- package/esm/utils/dom.js +6 -4
- package/esm/utils/events.js +3 -3
- package/esm/utils/focus.js +2 -2
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +3 -3
- package/esm/utils/store.js +3 -3
- package/menubar/menubar-store/package.json +8 -0
- package/package.json +8 -1
- package/cjs/__chunks/LUOEAZGU.cjs +0 -42
- /package/cjs/__chunks/{WYXAWBLE.cjs → AV6KTKLE.cjs} +0 -0
- /package/esm/__chunks/{2SMRF6AD.js → 4R3V3JGP.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ariakit/core
|
|
2
2
|
|
|
3
|
+
## 0.3.6
|
|
4
|
+
|
|
5
|
+
- Fixed `setSelectionRange` error when used with [unsupported](https://html.spec.whatwg.org/multipage/input.html#concept-input-apply) input types.
|
|
6
|
+
|
|
7
|
+
## 0.3.5
|
|
8
|
+
|
|
9
|
+
- Added new `menubar` module.
|
|
10
|
+
|
|
3
11
|
## 0.3.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
5
5
|
|
|
6
6
|
// src/utils/misc.ts
|
|
7
7
|
function noop(..._) {
|
|
@@ -81,7 +81,7 @@ function normalizeString(str) {
|
|
|
81
81
|
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
82
82
|
}
|
|
83
83
|
function omit(object, keys) {
|
|
84
|
-
const result =
|
|
84
|
+
const result = _AV6KTKLEcjs.__spreadValues.call(void 0, {}, object);
|
|
85
85
|
for (const key of keys) {
|
|
86
86
|
if (hasOwnProperty(result, key)) {
|
|
87
87
|
delete result[key];
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
16
16
|
|
|
17
17
|
// src/utils/store.ts
|
|
18
18
|
function getInternal(store, key) {
|
|
19
19
|
const internals = store.__unstableInternals;
|
|
20
|
-
|
|
20
|
+
_3UT5FE6Kcjs.invariant.call(void 0, internals, "Invalid store");
|
|
21
21
|
return internals[key];
|
|
22
22
|
}
|
|
23
23
|
function createStore(initialState, ...stores) {
|
|
@@ -37,37 +37,35 @@ function createStore(initialState, ...stores) {
|
|
|
37
37
|
};
|
|
38
38
|
const storeInit = () => {
|
|
39
39
|
if (initialized)
|
|
40
|
-
return
|
|
40
|
+
return _3UT5FE6Kcjs.noop;
|
|
41
41
|
if (!stores.length)
|
|
42
|
-
return
|
|
42
|
+
return _3UT5FE6Kcjs.noop;
|
|
43
43
|
initialized = true;
|
|
44
|
-
const desyncs =
|
|
45
|
-
(key) =>
|
|
44
|
+
const desyncs = _3UT5FE6Kcjs.getKeys.call(void 0, state).map(
|
|
45
|
+
(key) => _3UT5FE6Kcjs.chain.call(void 0,
|
|
46
46
|
...stores.map((store) => {
|
|
47
47
|
var _a;
|
|
48
48
|
const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
|
|
49
49
|
if (!storeState)
|
|
50
50
|
return;
|
|
51
|
-
if (!
|
|
51
|
+
if (!_3UT5FE6Kcjs.hasOwnProperty.call(void 0, storeState, key))
|
|
52
52
|
return;
|
|
53
|
-
return sync(
|
|
54
|
-
|
|
55
|
-
[key],
|
|
56
|
-
(state2) => setState(
|
|
53
|
+
return sync(store, [key], (state2) => {
|
|
54
|
+
setState(
|
|
57
55
|
key,
|
|
58
56
|
state2[key],
|
|
59
57
|
// @ts-expect-error - Not public API. This is just to prevent
|
|
60
58
|
// infinite loops.
|
|
61
59
|
true
|
|
62
|
-
)
|
|
63
|
-
);
|
|
60
|
+
);
|
|
61
|
+
});
|
|
64
62
|
})
|
|
65
63
|
)
|
|
66
64
|
);
|
|
67
65
|
const teardowns = [];
|
|
68
66
|
setups.forEach((setup2) => teardowns.push(setup2()));
|
|
69
67
|
const cleanups = stores.map(init);
|
|
70
|
-
return
|
|
68
|
+
return _3UT5FE6Kcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups, () => {
|
|
71
69
|
initialized = false;
|
|
72
70
|
});
|
|
73
71
|
};
|
|
@@ -91,13 +89,13 @@ function createStore(initialState, ...stores) {
|
|
|
91
89
|
disposables.set(listener, listener(state, prevStateBatch));
|
|
92
90
|
return sub(keys, listener, batchListeners);
|
|
93
91
|
};
|
|
94
|
-
const storePick = (keys) => createStore(
|
|
95
|
-
const storeOmit = (keys) => createStore(
|
|
92
|
+
const storePick = (keys) => createStore(_3UT5FE6Kcjs.pick.call(void 0, state, keys), finalStore);
|
|
93
|
+
const storeOmit = (keys) => createStore(_3UT5FE6Kcjs.omit.call(void 0, state, keys), finalStore);
|
|
96
94
|
const getState = () => state;
|
|
97
95
|
const setState = (key, value, fromStores = false) => {
|
|
98
|
-
if (!
|
|
96
|
+
if (!_3UT5FE6Kcjs.hasOwnProperty.call(void 0, state, key))
|
|
99
97
|
return;
|
|
100
|
-
const nextValue =
|
|
98
|
+
const nextValue = _3UT5FE6Kcjs.applyState.call(void 0, value, state[key]);
|
|
101
99
|
if (nextValue === state[key])
|
|
102
100
|
return;
|
|
103
101
|
if (!fromStores) {
|
|
@@ -107,7 +105,7 @@ function createStore(initialState, ...stores) {
|
|
|
107
105
|
});
|
|
108
106
|
}
|
|
109
107
|
const prevState = state;
|
|
110
|
-
state =
|
|
108
|
+
state = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, state), { [key]: nextValue });
|
|
111
109
|
const thisUpdate = Symbol();
|
|
112
110
|
lastUpdate = thisUpdate;
|
|
113
111
|
updatedKeys.add(key);
|
|
@@ -190,7 +188,7 @@ function mergeStore(...stores) {
|
|
|
190
188
|
const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
|
|
191
189
|
if (!nextState)
|
|
192
190
|
return state;
|
|
193
|
-
return
|
|
191
|
+
return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, state), nextState);
|
|
194
192
|
}, {});
|
|
195
193
|
const store = createStore(initialState, ...stores);
|
|
196
194
|
return store;
|
|
@@ -209,7 +207,7 @@ function throwOnConflictingProps(props, store) {
|
|
|
209
207
|
return;
|
|
210
208
|
const storeState = store.getState();
|
|
211
209
|
const conflictingProps = defaultKeys.filter(
|
|
212
|
-
(key) =>
|
|
210
|
+
(key) => _3UT5FE6Kcjs.hasOwnProperty.call(void 0, storeState, key)
|
|
213
211
|
);
|
|
214
212
|
if (!conflictingProps.length)
|
|
215
213
|
return;
|
|
@@ -169,6 +169,12 @@ function isPartiallyHidden(element) {
|
|
|
169
169
|
const right = elementRect.right > scrollerRight;
|
|
170
170
|
return top || left || bottom || right;
|
|
171
171
|
}
|
|
172
|
+
function setSelectionRange(element, ...args) {
|
|
173
|
+
if (/text|search|password|tel|url/i.test(element.type)) {
|
|
174
|
+
element.setSelectionRange(...args);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
172
178
|
|
|
173
179
|
|
|
174
180
|
|
|
@@ -188,4 +194,4 @@ function isPartiallyHidden(element) {
|
|
|
188
194
|
|
|
189
195
|
|
|
190
196
|
|
|
191
|
-
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.getPopupRole = getPopupRole; exports.getPopupItemRole = getPopupItemRole; exports.getTextboxSelection = getTextboxSelection; exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded; exports.getScrollingElement = getScrollingElement; exports.isPartiallyHidden = isPartiallyHidden;
|
|
197
|
+
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.getPopupRole = getPopupRole; exports.getPopupItemRole = getPopupItemRole; exports.getTextboxSelection = getTextboxSelection; exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded; exports.getScrollingElement = getScrollingElement; exports.isPartiallyHidden = isPartiallyHidden; exports.setSelectionRange = setSelectionRange;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _JLC5A6WFcjs = require('./JLC5A6WF.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _46BH65MCcjs = require('./46BH65MC.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ var _ULSPM3Y3cjs = require('./ULSPM3Y3.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
21
21
|
|
|
22
22
|
// src/composite/composite-store.ts
|
|
23
23
|
var NULL_ITEM = { id: null };
|
|
@@ -108,7 +108,7 @@ function verticalizeItems(items) {
|
|
|
108
108
|
for (const row of rows) {
|
|
109
109
|
const item = row[i];
|
|
110
110
|
if (item) {
|
|
111
|
-
verticalized.push(
|
|
111
|
+
verticalized.push(_AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, item), {
|
|
112
112
|
// If there's no rowId, it means that it's not a grid composite, but
|
|
113
113
|
// a single row instead. So, instead of verticalizing it, that is,
|
|
114
114
|
// assigning a different rowId based on the column index, we keep it
|
|
@@ -124,40 +124,40 @@ 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 =
|
|
128
|
-
const activeId =
|
|
127
|
+
const collection = _JLC5A6WFcjs.createCollectionStore.call(void 0, props);
|
|
128
|
+
const activeId = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
129
129
|
props.activeId,
|
|
130
130
|
syncState == null ? void 0 : syncState.activeId,
|
|
131
131
|
props.defaultActiveId
|
|
132
132
|
);
|
|
133
|
-
const initialState =
|
|
133
|
+
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, collection.getState()), {
|
|
134
134
|
activeId,
|
|
135
|
-
baseElement:
|
|
136
|
-
includesBaseElement:
|
|
135
|
+
baseElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
|
|
136
|
+
includesBaseElement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
137
137
|
props.includesBaseElement,
|
|
138
138
|
syncState == null ? void 0 : syncState.includesBaseElement,
|
|
139
139
|
activeId === null
|
|
140
140
|
),
|
|
141
|
-
moves:
|
|
142
|
-
orientation:
|
|
141
|
+
moves: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
|
|
142
|
+
orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
143
143
|
props.orientation,
|
|
144
144
|
syncState == null ? void 0 : syncState.orientation,
|
|
145
145
|
"both"
|
|
146
146
|
),
|
|
147
|
-
rtl:
|
|
148
|
-
virtualFocus:
|
|
147
|
+
rtl: _3UT5FE6Kcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
|
|
148
|
+
virtualFocus: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
149
149
|
props.virtualFocus,
|
|
150
150
|
syncState == null ? void 0 : syncState.virtualFocus,
|
|
151
151
|
false
|
|
152
152
|
),
|
|
153
|
-
focusLoop:
|
|
154
|
-
focusWrap:
|
|
155
|
-
focusShift:
|
|
153
|
+
focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
|
|
154
|
+
focusWrap: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
|
|
155
|
+
focusShift: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
|
|
156
156
|
});
|
|
157
|
-
const composite =
|
|
158
|
-
|
|
157
|
+
const composite = _46BH65MCcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
158
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
159
159
|
composite,
|
|
160
|
-
() =>
|
|
160
|
+
() => _46BH65MCcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
|
|
161
161
|
composite.setState("activeId", (activeId2) => {
|
|
162
162
|
var _a2;
|
|
163
163
|
if (activeId2 !== void 0)
|
|
@@ -224,7 +224,7 @@ function createCompositeStore(props = {}) {
|
|
|
224
224
|
}
|
|
225
225
|
return nextItem == null ? void 0 : nextItem.id;
|
|
226
226
|
};
|
|
227
|
-
return
|
|
227
|
+
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, collection), composite), {
|
|
228
228
|
setBaseElement: (element) => composite.setState("baseElement", element),
|
|
229
229
|
setActiveId: (id) => composite.setState("activeId", id),
|
|
230
230
|
move: (id) => {
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _GZDVJEIDcjs = require('./GZDVJEID.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _46BH65MCcjs = require('./46BH65MC.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
19
19
|
|
|
20
20
|
// src/popover/popover-store.ts
|
|
21
21
|
function createPopoverStore(_a = {}) {
|
|
22
22
|
var _b = _a, {
|
|
23
23
|
popover: otherPopover
|
|
24
|
-
} = _b, props =
|
|
24
|
+
} = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
|
|
25
25
|
"popover"
|
|
26
26
|
]);
|
|
27
|
-
const store =
|
|
27
|
+
const store = _46BH65MCcjs.mergeStore.call(void 0,
|
|
28
28
|
props.store,
|
|
29
|
-
|
|
29
|
+
_46BH65MCcjs.omit.call(void 0, otherPopover, [
|
|
30
30
|
"arrowElement",
|
|
31
31
|
"anchorElement",
|
|
32
32
|
"contentElement",
|
|
@@ -34,24 +34,24 @@ function createPopoverStore(_a = {}) {
|
|
|
34
34
|
"disclosureElement"
|
|
35
35
|
])
|
|
36
36
|
);
|
|
37
|
-
|
|
37
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
38
38
|
const syncState = store == null ? void 0 : store.getState();
|
|
39
|
-
const dialog =
|
|
40
|
-
const placement =
|
|
39
|
+
const dialog = _GZDVJEIDcjs.createDialogStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), { store }));
|
|
40
|
+
const placement = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
41
41
|
props.placement,
|
|
42
42
|
syncState == null ? void 0 : syncState.placement,
|
|
43
43
|
"bottom"
|
|
44
44
|
);
|
|
45
|
-
const initialState =
|
|
45
|
+
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, dialog.getState()), {
|
|
46
46
|
placement,
|
|
47
47
|
currentPlacement: placement,
|
|
48
|
-
anchorElement:
|
|
49
|
-
popoverElement:
|
|
50
|
-
arrowElement:
|
|
48
|
+
anchorElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
|
|
49
|
+
popoverElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
|
|
50
|
+
arrowElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
|
|
51
51
|
rendered: Symbol("rendered")
|
|
52
52
|
});
|
|
53
|
-
const popover =
|
|
54
|
-
return
|
|
53
|
+
const popover = _46BH65MCcjs.createStore.call(void 0, initialState, dialog, store);
|
|
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
57
|
setArrowElement: (element) => popover.setState("arrowElement", element),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _6WBY3ZZMcjs = require('./6WBY3ZZM.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _46BH65MCcjs = require('./46BH65MC.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
15
|
+
|
|
16
|
+
// src/menubar/menubar-store.ts
|
|
17
|
+
function createMenubarStore(props = {}) {
|
|
18
|
+
var _a;
|
|
19
|
+
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
+
const composite = _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
21
|
+
orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
22
|
+
props.orientation,
|
|
23
|
+
syncState == null ? void 0 : syncState.orientation,
|
|
24
|
+
"horizontal"
|
|
25
|
+
),
|
|
26
|
+
focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
27
|
+
}));
|
|
28
|
+
const initialState = _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState());
|
|
29
|
+
const menubar = _46BH65MCcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
30
|
+
return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), menubar);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
exports.createMenubarStore = createMenubarStore;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _MEHGRTJ3cjs = require('./MEHGRTJ3.cjs');
|
|
5
5
|
|
|
6
6
|
// src/dialog/dialog-store.ts
|
|
7
7
|
function createDialogStore(props = {}) {
|
|
8
|
-
return
|
|
8
|
+
return _MEHGRTJ3cjs.createDisclosureStore.call(void 0, props);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _46BH65MCcjs = require('./46BH65MC.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _5F4DVUNScjs = require('./5F4DVUNS.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
19
19
|
|
|
20
20
|
// src/collection/collection-store.ts
|
|
21
21
|
function isElementPreceding(a, b) {
|
|
@@ -61,13 +61,13 @@ function getCommonParent(items) {
|
|
|
61
61
|
}
|
|
62
62
|
parentElement = parentElement.parentElement;
|
|
63
63
|
}
|
|
64
|
-
return
|
|
64
|
+
return _5F4DVUNScjs.getDocument.call(void 0, parentElement).body;
|
|
65
65
|
}
|
|
66
66
|
function createCollectionStore(props = {}) {
|
|
67
67
|
var _a;
|
|
68
|
-
|
|
68
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
69
69
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
70
|
-
const items =
|
|
70
|
+
const items = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
71
71
|
props.items,
|
|
72
72
|
syncState == null ? void 0 : syncState.items,
|
|
73
73
|
props.defaultItems,
|
|
@@ -76,20 +76,20 @@ function createCollectionStore(props = {}) {
|
|
|
76
76
|
const itemsMap = new Map(items.map((item) => [item.id, item]));
|
|
77
77
|
const initialState = {
|
|
78
78
|
items,
|
|
79
|
-
renderedItems:
|
|
79
|
+
renderedItems: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
|
|
80
80
|
};
|
|
81
|
-
const privateStore =
|
|
81
|
+
const privateStore = _46BH65MCcjs.createStore.call(void 0, {
|
|
82
82
|
renderedItems: initialState.renderedItems
|
|
83
83
|
});
|
|
84
|
-
const collection =
|
|
84
|
+
const collection = _46BH65MCcjs.createStore.call(void 0, initialState, props.store);
|
|
85
85
|
const sortItems = () => {
|
|
86
86
|
const state = privateStore.getState();
|
|
87
87
|
const renderedItems = sortBasedOnDOMPosition(state.renderedItems);
|
|
88
88
|
privateStore.setState("renderedItems", renderedItems);
|
|
89
89
|
collection.setState("renderedItems", renderedItems);
|
|
90
90
|
};
|
|
91
|
-
|
|
92
|
-
return
|
|
91
|
+
_46BH65MCcjs.setup.call(void 0, collection, () => {
|
|
92
|
+
return _46BH65MCcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
|
|
93
93
|
let firstRun = true;
|
|
94
94
|
let raf = requestAnimationFrame(sortItems);
|
|
95
95
|
if (typeof IntersectionObserver !== "function")
|
|
@@ -122,7 +122,7 @@ function createCollectionStore(props = {}) {
|
|
|
122
122
|
const nextItems = items2.slice();
|
|
123
123
|
if (index !== -1) {
|
|
124
124
|
prevItem = items2[index];
|
|
125
|
-
const nextItem =
|
|
125
|
+
const nextItem = _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, prevItem), item);
|
|
126
126
|
nextItems[index] = nextItem;
|
|
127
127
|
itemsMap.set(item.id, nextItem);
|
|
128
128
|
} else {
|
|
@@ -151,9 +151,9 @@ function createCollectionStore(props = {}) {
|
|
|
151
151
|
return unmergeItem;
|
|
152
152
|
};
|
|
153
153
|
const registerItem = (item) => mergeItem(item, (getItems) => collection.setState("items", getItems), true);
|
|
154
|
-
return
|
|
154
|
+
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, collection), {
|
|
155
155
|
registerItem,
|
|
156
|
-
renderItem: (item) =>
|
|
156
|
+
renderItem: (item) => _3UT5FE6Kcjs.chain.call(void 0,
|
|
157
157
|
registerItem(item),
|
|
158
158
|
mergeItem(
|
|
159
159
|
item,
|
|
@@ -7,62 +7,62 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _46BH65MCcjs = require('./46BH65MC.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
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 = _46BH65MCcjs.mergeStore.call(void 0,
|
|
22
22
|
props.store,
|
|
23
|
-
|
|
23
|
+
_46BH65MCcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
|
|
24
24
|
);
|
|
25
|
-
|
|
25
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
26
26
|
const syncState = store == null ? void 0 : store.getState();
|
|
27
|
-
const open =
|
|
27
|
+
const open = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
28
28
|
props.open,
|
|
29
29
|
syncState == null ? void 0 : syncState.open,
|
|
30
30
|
props.defaultOpen,
|
|
31
31
|
false
|
|
32
32
|
);
|
|
33
|
-
const animated =
|
|
33
|
+
const animated = _3UT5FE6Kcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
|
|
34
34
|
const initialState = {
|
|
35
35
|
open,
|
|
36
36
|
animated,
|
|
37
37
|
animating: !!animated && open,
|
|
38
38
|
mounted: open,
|
|
39
|
-
contentElement:
|
|
40
|
-
disclosureElement:
|
|
39
|
+
contentElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
|
|
40
|
+
disclosureElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
|
|
41
41
|
};
|
|
42
|
-
const disclosure =
|
|
43
|
-
|
|
42
|
+
const disclosure = _46BH65MCcjs.createStore.call(void 0, initialState, store);
|
|
43
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
44
44
|
disclosure,
|
|
45
|
-
() =>
|
|
45
|
+
() => _46BH65MCcjs.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
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
52
52
|
disclosure,
|
|
53
|
-
() =>
|
|
53
|
+
() => _46BH65MCcjs.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
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
60
60
|
disclosure,
|
|
61
|
-
() =>
|
|
61
|
+
() => _46BH65MCcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
|
|
62
62
|
disclosure.setState("mounted", state.open || state.animating);
|
|
63
63
|
})
|
|
64
64
|
);
|
|
65
|
-
return
|
|
65
|
+
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, disclosure), {
|
|
66
66
|
setOpen: (value) => disclosure.setState("open", value),
|
|
67
67
|
show: () => disclosure.setState("open", true),
|
|
68
68
|
hide: () => disclosure.setState("open", false),
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _7ZUFMSXJcjs = require('./7ZUFMSXJ.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _46BH65MCcjs = require('./46BH65MC.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _AV6KTKLEcjs = require('./AV6KTKLE.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 = _7ZUFMSXJcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
21
|
+
placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
22
|
+
props.placement,
|
|
23
|
+
syncState == null ? void 0 : syncState.placement,
|
|
24
|
+
"bottom"
|
|
25
|
+
)
|
|
26
|
+
}));
|
|
27
|
+
const timeout = _3UT5FE6Kcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
|
|
28
|
+
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover.getState()), {
|
|
29
|
+
timeout,
|
|
30
|
+
showTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
|
|
31
|
+
hideTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
|
|
32
|
+
autoFocusOnShow: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
|
|
33
|
+
});
|
|
34
|
+
const hovercard = _46BH65MCcjs.createStore.call(void 0, initialState, popover, props.store);
|
|
35
|
+
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
|
|
36
|
+
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
exports.createHovercardStore = createHovercardStore;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _5F4DVUNScjs = require('./5F4DVUNS.cjs');
|
|
5
5
|
|
|
6
6
|
// src/utils/platform.ts
|
|
7
7
|
function isTouchDevice() {
|
|
8
|
-
return
|
|
8
|
+
return _5F4DVUNScjs.canUseDOM && !!navigator.maxTouchPoints;
|
|
9
9
|
}
|
|
10
10
|
function isApple() {
|
|
11
|
-
if (!
|
|
11
|
+
if (!_5F4DVUNScjs.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 _5F4DVUNScjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
|
|
17
17
|
}
|
|
18
18
|
function isFirefox() {
|
|
19
|
-
return
|
|
19
|
+
return _5F4DVUNScjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
|
|
20
20
|
}
|
|
21
21
|
function isMac() {
|
|
22
|
-
return
|
|
22
|
+
return _5F4DVUNScjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|