@ariakit/core 0.2.7 → 0.2.9
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 +14 -0
- package/cjs/__chunks/{ZXPKRPGY.cjs → DPHJ32KR.cjs} +8 -7
- package/cjs/__chunks/{SXMUYOXB.cjs → F5DMXFQ2.cjs} +30 -31
- package/cjs/__chunks/{5AWPMH4S.cjs → FS2K2N7U.cjs} +72 -25
- package/cjs/__chunks/{NVEPU4WA.cjs → MCCIH6SG.cjs} +4 -4
- package/cjs/__chunks/{PR7FUI5D.cjs → OQIG5VE3.cjs} +16 -16
- package/cjs/__chunks/{K2LZWNNX.cjs → PIEJYPN7.cjs} +2 -2
- package/cjs/__chunks/{RS4LBZRZ.cjs → V7OHZPBO.cjs} +28 -32
- package/cjs/checkbox/checkbox-store.cjs +2 -2
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/combobox/combobox-store.cjs +53 -56
- package/cjs/combobox/combobox-store.d.ts +1 -1
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/form/form-store.cjs +4 -4
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/menu/menu-bar-store.cjs +4 -4
- package/cjs/menu/menu-store.cjs +23 -22
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/radio/radio-store.cjs +5 -5
- package/cjs/select/select-store.cjs +65 -67
- package/cjs/tab/tab-store.cjs +55 -56
- package/cjs/toolbar/toolbar-store.cjs +4 -4
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/events.cjs +5 -11
- package/cjs/utils/events.d.ts +0 -3
- package/cjs/utils/store.cjs +16 -2
- package/cjs/utils/store.d.ts +19 -59
- package/esm/__chunks/{SHUO6V52.js → A7IMXABC.js} +29 -30
- package/esm/__chunks/{XJGRXN57.js → COUCUJML.js} +2 -2
- package/esm/__chunks/{UWW2ZP3K.js → LNMWV6UV.js} +1 -1
- package/esm/__chunks/{FQL4TRMX.js → OGOHEUXI.js} +71 -24
- package/esm/__chunks/{NRXA5QTV.js → ROY5BBHL.js} +15 -15
- package/esm/__chunks/{LM4QG55U.js → SOCHV2LZ.js} +6 -5
- package/esm/__chunks/{L5RO76KW.js → WSKDP2MG.js} +27 -31
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-store.d.ts +1 -1
- package/esm/combobox/combobox-store.js +50 -53
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.js +2 -2
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.js +3 -3
- package/esm/menu/menu-store.js +20 -19
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.js +3 -3
- package/esm/select/select-store.js +62 -64
- package/esm/tab/tab-store.js +53 -54
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/events.d.ts +0 -3
- package/esm/utils/events.js +5 -11
- package/esm/utils/store.d.ts +19 -59
- package/esm/utils/store.js +17 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ariakit/core
|
|
2
2
|
|
|
3
|
+
## 0.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`#2709`](https://github.com/ariakit/ariakit/pull/2709) Fixed `addGlobalEventListener` function when used in a document with sandbox iframes.
|
|
8
|
+
|
|
9
|
+
## 0.2.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Removed private properties from the store object. ([#2706](https://github.com/ariakit/ariakit/pull/2706))
|
|
14
|
+
|
|
15
|
+
Instead of accessing `store.setup`, `store.sync`, `store.subscribe`, etc. directly, use the equivalent functions exported by the `@ariakit/core/utils/store` module.
|
|
16
|
+
|
|
3
17
|
## 0.2.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _PIEJYPN7cjs = require('./PIEJYPN7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
var _FS2K2N7Ucjs = require('./FS2K2N7U.cjs');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
@@ -21,18 +22,18 @@ function createPopoverStore(_a = {}) {
|
|
|
21
22
|
} = _b, props = _72I2GWXFcjs.__objRest.call(void 0, _b, [
|
|
22
23
|
"popover"
|
|
23
24
|
]);
|
|
24
|
-
const store =
|
|
25
|
+
const store = _FS2K2N7Ucjs.mergeStore.call(void 0,
|
|
25
26
|
props.store,
|
|
26
|
-
|
|
27
|
+
_FS2K2N7Ucjs.omit.call(void 0, otherPopover, [
|
|
27
28
|
"arrowElement",
|
|
28
29
|
"anchorElement",
|
|
29
30
|
"contentElement",
|
|
30
31
|
"popoverElement",
|
|
31
32
|
"disclosureElement"
|
|
32
|
-
)
|
|
33
|
+
])
|
|
33
34
|
);
|
|
34
35
|
const syncState = store == null ? void 0 : store.getState();
|
|
35
|
-
const dialog =
|
|
36
|
+
const dialog = _PIEJYPN7cjs.createDialogStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), { store }));
|
|
36
37
|
const placement = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
37
38
|
props.placement,
|
|
38
39
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -46,7 +47,7 @@ function createPopoverStore(_a = {}) {
|
|
|
46
47
|
arrowElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
|
|
47
48
|
rendered: Symbol("rendered")
|
|
48
49
|
});
|
|
49
|
-
const popover =
|
|
50
|
+
const popover = _FS2K2N7Ucjs.createStore.call(void 0, initialState, dialog, store);
|
|
50
51
|
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, dialog), popover), {
|
|
51
52
|
setAnchorElement: (element) => popover.setState("anchorElement", element),
|
|
52
53
|
setPopoverElement: (element) => popover.setState("popoverElement", element),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _FS2K2N7Ucjs = require('./FS2K2N7U.cjs');
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
|
|
@@ -73,45 +75,42 @@ function createCollectionStore(props = {}) {
|
|
|
73
75
|
items,
|
|
74
76
|
renderedItems: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
|
|
75
77
|
};
|
|
76
|
-
const privateStore =
|
|
78
|
+
const privateStore = _FS2K2N7Ucjs.createStore.call(void 0, {
|
|
77
79
|
renderedItems: initialState.renderedItems
|
|
78
80
|
});
|
|
79
|
-
const collection =
|
|
81
|
+
const collection = _FS2K2N7Ucjs.createStore.call(void 0, initialState, props.store);
|
|
80
82
|
const sortItems = () => {
|
|
81
83
|
const state = privateStore.getState();
|
|
82
84
|
const renderedItems = sortBasedOnDOMPosition(state.renderedItems);
|
|
83
85
|
privateStore.setState("renderedItems", renderedItems);
|
|
84
86
|
collection.setState("renderedItems", renderedItems);
|
|
85
87
|
};
|
|
86
|
-
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
_FS2K2N7Ucjs.setup.call(void 0, collection, () => {
|
|
89
|
+
return _FS2K2N7Ucjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
|
|
90
|
+
let firstRun = true;
|
|
91
|
+
let raf = requestAnimationFrame(sortItems);
|
|
92
|
+
if (typeof IntersectionObserver !== "function")
|
|
93
|
+
return;
|
|
94
|
+
const callback = () => {
|
|
95
|
+
if (firstRun) {
|
|
96
|
+
firstRun = false;
|
|
92
97
|
return;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
cancelAnimationFrame(raf);
|
|
110
|
-
observer.disconnect();
|
|
111
|
-
};
|
|
112
|
-
},
|
|
113
|
-
["renderedItems"]
|
|
114
|
-
);
|
|
98
|
+
}
|
|
99
|
+
cancelAnimationFrame(raf);
|
|
100
|
+
raf = requestAnimationFrame(sortItems);
|
|
101
|
+
};
|
|
102
|
+
const root = getCommonParent(state.renderedItems);
|
|
103
|
+
const observer = new IntersectionObserver(callback, { root });
|
|
104
|
+
state.renderedItems.forEach((item) => {
|
|
105
|
+
if (!item.element)
|
|
106
|
+
return;
|
|
107
|
+
observer.observe(item.element);
|
|
108
|
+
});
|
|
109
|
+
return () => {
|
|
110
|
+
cancelAnimationFrame(raf);
|
|
111
|
+
observer.disconnect();
|
|
112
|
+
};
|
|
113
|
+
});
|
|
115
114
|
});
|
|
116
115
|
const mergeItem = (item, setItems, canDeleteFromMap = false) => {
|
|
117
116
|
let prevItem;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
10
11
|
|
|
11
12
|
|
|
@@ -13,6 +14,11 @@ var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
|
13
14
|
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
14
15
|
|
|
15
16
|
// src/utils/store.ts
|
|
17
|
+
function getInternal(store, key) {
|
|
18
|
+
const internals = store.__unstableInternals;
|
|
19
|
+
_RCYVACJOcjs.invariant.call(void 0, internals, "Invalid store");
|
|
20
|
+
return internals[key];
|
|
21
|
+
}
|
|
16
22
|
function createStore(initialState, ...stores) {
|
|
17
23
|
let state = initialState;
|
|
18
24
|
let prevStateBatch = state;
|
|
@@ -24,11 +30,11 @@ function createStore(initialState, ...stores) {
|
|
|
24
30
|
const listenersBatch = /* @__PURE__ */ new Set();
|
|
25
31
|
const disposables = /* @__PURE__ */ new WeakMap();
|
|
26
32
|
const listenerKeys = /* @__PURE__ */ new WeakMap();
|
|
27
|
-
const
|
|
33
|
+
const storeSetup = (callback) => {
|
|
28
34
|
setups.add(callback);
|
|
29
35
|
return () => setups.delete(callback);
|
|
30
36
|
};
|
|
31
|
-
const
|
|
37
|
+
const storeInit = () => {
|
|
32
38
|
if (initialized)
|
|
33
39
|
return _RCYVACJOcjs.noop;
|
|
34
40
|
if (!stores.length)
|
|
@@ -37,28 +43,25 @@ function createStore(initialState, ...stores) {
|
|
|
37
43
|
const desyncs = _RCYVACJOcjs.getKeys.call(void 0, state).map(
|
|
38
44
|
(key) => _RCYVACJOcjs.chain.call(void 0,
|
|
39
45
|
...stores.map((store) => {
|
|
40
|
-
var _a
|
|
46
|
+
var _a;
|
|
41
47
|
const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
|
|
42
48
|
if (!storeState)
|
|
43
49
|
return;
|
|
44
50
|
if (!_RCYVACJOcjs.hasOwnProperty.call(void 0, storeState, key))
|
|
45
51
|
return;
|
|
46
|
-
return
|
|
52
|
+
return sync(store, [key], (state2) => setState(key, state2[key]));
|
|
47
53
|
})
|
|
48
54
|
)
|
|
49
55
|
);
|
|
50
56
|
const teardowns = [];
|
|
51
57
|
setups.forEach((setup2) => teardowns.push(setup2()));
|
|
52
|
-
const cleanups = stores.map(
|
|
53
|
-
var _a;
|
|
54
|
-
return (_a = store == null ? void 0 : store.init) == null ? void 0 : _a.call(store);
|
|
55
|
-
});
|
|
58
|
+
const cleanups = stores.map(init);
|
|
56
59
|
return _RCYVACJOcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups, () => {
|
|
57
60
|
initialized = false;
|
|
58
61
|
});
|
|
59
62
|
};
|
|
60
|
-
const sub = (
|
|
61
|
-
const set =
|
|
63
|
+
const sub = (keys, listener, batch2 = false) => {
|
|
64
|
+
const set = batch2 ? listenersBatch : listeners;
|
|
62
65
|
set.add(listener);
|
|
63
66
|
listenerKeys.set(listener, keys);
|
|
64
67
|
return () => {
|
|
@@ -69,15 +72,17 @@ function createStore(initialState, ...stores) {
|
|
|
69
72
|
set.delete(listener);
|
|
70
73
|
};
|
|
71
74
|
};
|
|
72
|
-
const
|
|
73
|
-
const
|
|
75
|
+
const storeSubscribe = (keys, listener) => sub(keys, listener);
|
|
76
|
+
const storeSync = (keys, listener) => {
|
|
74
77
|
disposables.set(listener, listener(state, state));
|
|
75
|
-
return sub(
|
|
78
|
+
return sub(keys, listener);
|
|
76
79
|
};
|
|
77
|
-
const
|
|
80
|
+
const storeBatch = (keys, listener) => {
|
|
78
81
|
disposables.set(listener, listener(state, prevStateBatch));
|
|
79
|
-
return sub(
|
|
82
|
+
return sub(keys, listener, true);
|
|
80
83
|
};
|
|
84
|
+
const storePick = (keys) => createStore(_RCYVACJOcjs.pick.call(void 0, state, keys), finalStore);
|
|
85
|
+
const storeOmit = (keys) => createStore(_RCYVACJOcjs.omit.call(void 0, state, keys), finalStore);
|
|
81
86
|
const getState = () => state;
|
|
82
87
|
const setState = (key, value) => {
|
|
83
88
|
if (!_RCYVACJOcjs.hasOwnProperty.call(void 0, state, key))
|
|
@@ -115,21 +120,56 @@ function createStore(initialState, ...stores) {
|
|
|
115
120
|
updatedKeys.clear();
|
|
116
121
|
});
|
|
117
122
|
};
|
|
118
|
-
const pick2 = (...keys) => createStore(_RCYVACJOcjs.pick.call(void 0, state, keys), finalStore);
|
|
119
|
-
const omit2 = (...keys) => createStore(_RCYVACJOcjs.omit.call(void 0, state, keys), finalStore);
|
|
120
123
|
const finalStore = {
|
|
121
|
-
setup,
|
|
122
|
-
init,
|
|
123
|
-
subscribe,
|
|
124
|
-
sync,
|
|
125
|
-
syncBatch,
|
|
126
124
|
getState,
|
|
127
125
|
setState,
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
__unstableInternals: {
|
|
127
|
+
setup: storeSetup,
|
|
128
|
+
init: storeInit,
|
|
129
|
+
subscribe: storeSubscribe,
|
|
130
|
+
sync: storeSync,
|
|
131
|
+
batch: storeBatch,
|
|
132
|
+
pick: storePick,
|
|
133
|
+
omit: storeOmit
|
|
134
|
+
}
|
|
130
135
|
};
|
|
131
136
|
return finalStore;
|
|
132
137
|
}
|
|
138
|
+
function setup(store, ...args) {
|
|
139
|
+
if (!store)
|
|
140
|
+
return;
|
|
141
|
+
return getInternal(store, "setup")(...args);
|
|
142
|
+
}
|
|
143
|
+
function init(store, ...args) {
|
|
144
|
+
if (!store)
|
|
145
|
+
return;
|
|
146
|
+
return getInternal(store, "init")(...args);
|
|
147
|
+
}
|
|
148
|
+
function subscribe(store, ...args) {
|
|
149
|
+
if (!store)
|
|
150
|
+
return;
|
|
151
|
+
return getInternal(store, "subscribe")(...args);
|
|
152
|
+
}
|
|
153
|
+
function sync(store, ...args) {
|
|
154
|
+
if (!store)
|
|
155
|
+
return;
|
|
156
|
+
return getInternal(store, "sync")(...args);
|
|
157
|
+
}
|
|
158
|
+
function batch(store, ...args) {
|
|
159
|
+
if (!store)
|
|
160
|
+
return;
|
|
161
|
+
return getInternal(store, "batch")(...args);
|
|
162
|
+
}
|
|
163
|
+
function omit2(store, ...args) {
|
|
164
|
+
if (!store)
|
|
165
|
+
return;
|
|
166
|
+
return getInternal(store, "omit")(...args);
|
|
167
|
+
}
|
|
168
|
+
function pick2(store, ...args) {
|
|
169
|
+
if (!store)
|
|
170
|
+
return;
|
|
171
|
+
return getInternal(store, "pick")(...args);
|
|
172
|
+
}
|
|
133
173
|
function mergeStore(...stores) {
|
|
134
174
|
const initialState = stores.reduce((state, store2) => {
|
|
135
175
|
var _a;
|
|
@@ -145,4 +185,11 @@ function mergeStore(...stores) {
|
|
|
145
185
|
|
|
146
186
|
|
|
147
187
|
|
|
148
|
-
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
exports.createStore = createStore; exports.setup = setup; exports.init = init; exports.subscribe = subscribe; exports.sync = sync; exports.batch = batch; exports.omit = omit2; exports.pick = pick2; exports.mergeStore = mergeStore;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _DPHJ32KRcjs = require('./DPHJ32KR.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _FS2K2N7Ucjs = require('./FS2K2N7U.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
@@ -16,7 +16,7 @@ var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
|
16
16
|
function createHovercardStore(props = {}) {
|
|
17
17
|
var _a;
|
|
18
18
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
19
|
-
const popover =
|
|
19
|
+
const popover = _DPHJ32KRcjs.createPopoverStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
20
20
|
placement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
21
21
|
props.placement,
|
|
22
22
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -30,7 +30,7 @@ function createHovercardStore(props = {}) {
|
|
|
30
30
|
hideTimeout: _RCYVACJOcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
|
|
31
31
|
autoFocusOnShow: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
|
|
32
32
|
});
|
|
33
|
-
const hovercard =
|
|
33
|
+
const hovercard = _FS2K2N7Ucjs.createStore.call(void 0, initialState, popover, props.store);
|
|
34
34
|
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
|
|
35
35
|
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
|
|
36
36
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _F5DMXFQ2cjs = require('./F5DMXFQ2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _FS2K2N7Ucjs = require('./FS2K2N7U.cjs');
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
@@ -121,7 +123,7 @@ function verticalizeItems(items) {
|
|
|
121
123
|
function createCompositeStore(props = {}) {
|
|
122
124
|
var _a;
|
|
123
125
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
124
|
-
const collection =
|
|
126
|
+
const collection = _F5DMXFQ2cjs.createCollectionStore.call(void 0, props);
|
|
125
127
|
const activeId = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
126
128
|
props.activeId,
|
|
127
129
|
syncState == null ? void 0 : syncState.activeId,
|
|
@@ -151,19 +153,17 @@ function createCompositeStore(props = {}) {
|
|
|
151
153
|
focusWrap: _RCYVACJOcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
|
|
152
154
|
focusShift: _RCYVACJOcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
|
|
153
155
|
});
|
|
154
|
-
const composite =
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
["renderedItems", "activeId"]
|
|
166
|
-
)
|
|
156
|
+
const composite = _FS2K2N7Ucjs.createStore.call(void 0, initialState, collection, props.store);
|
|
157
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
158
|
+
composite,
|
|
159
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
|
|
160
|
+
composite.setState("activeId", (activeId2) => {
|
|
161
|
+
var _a2;
|
|
162
|
+
if (activeId2 !== void 0)
|
|
163
|
+
return activeId2;
|
|
164
|
+
return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id;
|
|
165
|
+
});
|
|
166
|
+
})
|
|
167
167
|
);
|
|
168
168
|
const getNextId = (items, orientation, hasNullItem, skip) => {
|
|
169
169
|
var _a2, _b;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _V7OHZPBOcjs = require('./V7OHZPBO.cjs');
|
|
4
4
|
|
|
5
5
|
// src/dialog/dialog-store.ts
|
|
6
6
|
function createDialogStore(props = {}) {
|
|
7
|
-
return
|
|
7
|
+
return _V7OHZPBOcjs.createDisclosureStore.call(void 0, props);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _FS2K2N7Ucjs = require('./FS2K2N7U.cjs');
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
@@ -12,10 +15,9 @@ var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
|
12
15
|
|
|
13
16
|
// src/disclosure/disclosure-store.ts
|
|
14
17
|
function createDisclosureStore(props = {}) {
|
|
15
|
-
|
|
16
|
-
const store = _5AWPMH4Scjs.mergeStore.call(void 0,
|
|
18
|
+
const store = _FS2K2N7Ucjs.mergeStore.call(void 0,
|
|
17
19
|
props.store,
|
|
18
|
-
(
|
|
20
|
+
_FS2K2N7Ucjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
|
|
19
21
|
);
|
|
20
22
|
const syncState = store == null ? void 0 : store.getState();
|
|
21
23
|
const open = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
@@ -33,36 +35,30 @@ function createDisclosureStore(props = {}) {
|
|
|
33
35
|
contentElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
|
|
34
36
|
disclosureElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
|
|
35
37
|
};
|
|
36
|
-
const disclosure =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
["animated", "animating"]
|
|
45
|
-
)
|
|
38
|
+
const disclosure = _FS2K2N7Ucjs.createStore.call(void 0, initialState, store);
|
|
39
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
40
|
+
disclosure,
|
|
41
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
|
|
42
|
+
if (state.animated)
|
|
43
|
+
return;
|
|
44
|
+
disclosure.setState("animating", false);
|
|
45
|
+
})
|
|
46
46
|
);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
["open", "animated"]
|
|
57
|
-
)
|
|
47
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
48
|
+
disclosure,
|
|
49
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, disclosure, ["open", "animated"], (state, prev) => {
|
|
50
|
+
if (!state.animated)
|
|
51
|
+
return;
|
|
52
|
+
const mounting = state === prev;
|
|
53
|
+
const animating = mounting ? state.open : state.open !== prev.open;
|
|
54
|
+
disclosure.setState("animating", animating);
|
|
55
|
+
})
|
|
58
56
|
);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
["open", "animating"]
|
|
65
|
-
)
|
|
57
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
58
|
+
disclosure,
|
|
59
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
|
|
60
|
+
disclosure.setState("mounted", state.open || state.animating);
|
|
61
|
+
})
|
|
66
62
|
);
|
|
67
63
|
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, disclosure), {
|
|
68
64
|
setOpen: (value) => disclosure.setState("open", value),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _FS2K2N7Ucjs = require('../__chunks/FS2K2N7U.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
@@ -21,7 +21,7 @@ function createCheckboxStore(props = {}) {
|
|
|
21
21
|
false
|
|
22
22
|
)
|
|
23
23
|
};
|
|
24
|
-
const checkbox =
|
|
24
|
+
const checkbox = _FS2K2N7Ucjs.createStore.call(void 0, initialState, props.store);
|
|
25
25
|
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, checkbox), {
|
|
26
26
|
setValue: (value) => checkbox.setState("value", value)
|
|
27
27
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _F5DMXFQ2cjs = require('../__chunks/F5DMXFQ2.cjs');
|
|
4
|
+
require('../__chunks/FS2K2N7U.cjs');
|
|
5
5
|
require('../__chunks/RCYVACJO.cjs');
|
|
6
6
|
require('../__chunks/EXM2AW52.cjs');
|
|
7
7
|
require('../__chunks/72I2GWXF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createCollectionStore =
|
|
10
|
+
exports.createCollectionStore = _F5DMXFQ2cjs.createCollectionStore;
|