@ariakit/core 0.4.7 → 0.4.8
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 +5 -0
- package/cjs/__chunks/{M2NNCFIJ.cjs → 3QF3ODTR.cjs} +31 -50
- package/cjs/__chunks/{LPDHSEHU.cjs → 7CES7GVE.cjs} +4 -8
- package/cjs/__chunks/{Q2WCPTYS.cjs → 7WYII4AN.cjs} +6 -12
- package/cjs/__chunks/{EEDWPDM2.cjs → BTUHABP4.cjs} +16 -30
- package/cjs/__chunks/{3COGJMN3.cjs → CCI5VM7E.cjs} +24 -30
- package/cjs/__chunks/{MB5TLEVH.cjs → H6ZQSQQL.cjs} +16 -16
- package/cjs/__chunks/{D7M2PCAQ.cjs → KCEXELK7.cjs} +6 -7
- package/cjs/__chunks/{DIYYVJDK.cjs → N667HVED.cjs} +2 -2
- package/cjs/__chunks/{LBFF2BBK.cjs → PW36G76L.cjs} +25 -29
- package/cjs/__chunks/{LAYUSNGM.cjs → QLWAGBAQ.cjs} +20 -22
- package/cjs/__chunks/{5BQ2XS3R.cjs → VJAE2Y4T.cjs} +10 -10
- package/cjs/__chunks/XIZWLBI2.cjs +42 -0
- package/cjs/checkbox/checkbox-store.cjs +7 -7
- package/cjs/collection/collection-store.cjs +6 -6
- package/cjs/combobox/combobox-store.cjs +50 -56
- 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 +32 -36
- package/cjs/hovercard/hovercard-store.cjs +8 -8
- package/cjs/index.cjs +1 -1
- package/cjs/menu/menu-bar-store.cjs +8 -8
- package/cjs/menu/menu-store.cjs +37 -42
- package/cjs/menubar/menubar-store.cjs +8 -8
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +13 -13
- package/cjs/select/select-store.cjs +49 -62
- package/cjs/tab/tab-store.cjs +49 -61
- package/cjs/tag/tag-store.cjs +23 -27
- 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 +3 -3
- package/cjs/utils/events.cjs +22 -36
- package/cjs/utils/focus.cjs +34 -58
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/misc.d.cts +1 -1
- package/cjs/utils/misc.d.ts +1 -1
- package/cjs/utils/platform.cjs +4 -4
- package/cjs/utils/store.cjs +4 -4
- package/cjs/utils/undo.cjs +3 -3
- package/esm/__chunks/{SAZZJI72.js → 3UYWTADI.js} +4 -4
- package/esm/__chunks/{I2WJ7JBQ.js → 6DHTHWXD.js} +10 -16
- package/esm/__chunks/{KDSZSVV5.js → 6E4KKOSB.js} +5 -7
- package/esm/__chunks/{EKIWAN6A.js → 7LM4Q2XB.js} +4 -8
- package/esm/__chunks/{VH2P7HEP.js → D7EIQZAU.js} +8 -12
- package/esm/__chunks/{E4HA32QI.js → EACLTACN.js} +4 -4
- package/esm/__chunks/{KLPDXTDE.js → EQQLU3CG.js} +21 -40
- package/esm/__chunks/{I2NJJ3XW.js → HWOIWM4O.js} +6 -12
- package/esm/__chunks/{22HHDS5F.js → PBFD2E7P.js} +15 -29
- package/esm/__chunks/{RCLYDUHE.js → PIWLWQMB.js} +4 -4
- package/esm/__chunks/{CLSHHUGK.js → US4USQPI.js} +2 -3
- package/esm/__chunks/{NWACXGIN.js → YOHCVXJB.js} +1 -1
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +5 -5
- package/esm/combobox/combobox-store.js +16 -22
- 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 +9 -13
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.js +7 -7
- package/esm/menu/menu-store.js +15 -20
- package/esm/menubar/menubar-store.js +7 -7
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +6 -6
- package/esm/select/select-store.js +22 -35
- package/esm/tab/tab-store.js +18 -30
- package/esm/tag/tag-store.js +11 -15
- 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.js +2 -2
- package/esm/utils/events.js +17 -31
- package/esm/utils/focus.js +26 -50
- package/esm/utils/misc.d.ts +1 -1
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +3 -3
- package/esm/utils/store.js +3 -3
- package/esm/utils/undo.js +2 -2
- package/package.json +1 -1
- package/readme.md +18 -0
- package/cjs/__chunks/XVL5HZ27.cjs +0 -42
- /package/cjs/__chunks/{AV6KTKLE.cjs → 3IVNQNIV.cjs} +0 -0
- /package/esm/__chunks/{4R3V3JGP.js → 3YLGPPWQ.js} +0 -0
package/esm/menu/menu-store.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createHovercardStore
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/EACLTACN.js";
|
|
5
5
|
import {
|
|
6
6
|
createCompositeStore
|
|
7
|
-
} from "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
7
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
8
|
+
import "../__chunks/6DHTHWXD.js";
|
|
9
9
|
import "../__chunks/7PRQYBBV.js";
|
|
10
|
-
import "../__chunks/
|
|
11
|
-
import "../__chunks/
|
|
12
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/3UYWTADI.js";
|
|
11
|
+
import "../__chunks/YOHCVXJB.js";
|
|
12
|
+
import "../__chunks/6E4KKOSB.js";
|
|
13
13
|
import {
|
|
14
14
|
createStore,
|
|
15
15
|
mergeStore,
|
|
@@ -18,17 +18,17 @@ import {
|
|
|
18
18
|
setup,
|
|
19
19
|
sync,
|
|
20
20
|
throwOnConflictingProps
|
|
21
|
-
} from "../__chunks/
|
|
21
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
22
22
|
import {
|
|
23
23
|
applyState,
|
|
24
24
|
defaultValue
|
|
25
|
-
} from "../__chunks/
|
|
26
|
-
import "../__chunks/
|
|
25
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
26
|
+
import "../__chunks/HWOIWM4O.js";
|
|
27
27
|
import {
|
|
28
28
|
__objRest,
|
|
29
29
|
__spreadProps,
|
|
30
30
|
__spreadValues
|
|
31
|
-
} from "../__chunks/
|
|
31
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
32
32
|
|
|
33
33
|
// src/menu/menu-store.ts
|
|
34
34
|
function createMenuStore(_a = {}) {
|
|
@@ -90,8 +90,7 @@ function createMenuStore(_a = {}) {
|
|
|
90
90
|
setup(
|
|
91
91
|
menu,
|
|
92
92
|
() => sync(menu, ["mounted"], (state) => {
|
|
93
|
-
if (state.mounted)
|
|
94
|
-
return;
|
|
93
|
+
if (state.mounted) return;
|
|
95
94
|
menu.setState("activeId", null);
|
|
96
95
|
})
|
|
97
96
|
);
|
|
@@ -115,17 +114,13 @@ function createMenuStore(_a = {}) {
|
|
|
115
114
|
setInitialFocus: (value) => menu.setState("initialFocus", value),
|
|
116
115
|
setValues: (values) => menu.setState("values", values),
|
|
117
116
|
setValue: (name, value) => {
|
|
118
|
-
if (name === "__proto__")
|
|
119
|
-
|
|
120
|
-
if (name
|
|
121
|
-
return;
|
|
122
|
-
if (Array.isArray(name))
|
|
123
|
-
return;
|
|
117
|
+
if (name === "__proto__") return;
|
|
118
|
+
if (name === "constructor") return;
|
|
119
|
+
if (Array.isArray(name)) return;
|
|
124
120
|
menu.setState("values", (values) => {
|
|
125
121
|
const prevValue = values[name];
|
|
126
122
|
const nextValue = applyState(value, prevValue);
|
|
127
|
-
if (nextValue === prevValue)
|
|
128
|
-
return values;
|
|
123
|
+
if (nextValue === prevValue) return values;
|
|
129
124
|
return __spreadProps(__spreadValues({}, values), {
|
|
130
125
|
[name]: nextValue !== void 0 && nextValue
|
|
131
126
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createMenubarStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/PIWLWQMB.js";
|
|
5
|
+
import "../__chunks/D7EIQZAU.js";
|
|
6
|
+
import "../__chunks/6DHTHWXD.js";
|
|
7
7
|
import "../__chunks/7PRQYBBV.js";
|
|
8
|
-
import "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
11
|
-
import "../__chunks/
|
|
8
|
+
import "../__chunks/EQQLU3CG.js";
|
|
9
|
+
import "../__chunks/PBFD2E7P.js";
|
|
10
|
+
import "../__chunks/HWOIWM4O.js";
|
|
11
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
12
12
|
export {
|
|
13
13
|
createMenubarStore
|
|
14
14
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/3UYWTADI.js";
|
|
5
|
+
import "../__chunks/YOHCVXJB.js";
|
|
6
|
+
import "../__chunks/6E4KKOSB.js";
|
|
7
|
+
import "../__chunks/EQQLU3CG.js";
|
|
8
|
+
import "../__chunks/PBFD2E7P.js";
|
|
9
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
10
10
|
export {
|
|
11
11
|
createPopoverStore
|
|
12
12
|
};
|
package/esm/radio/radio-store.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
|
+
import "../__chunks/6DHTHWXD.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
7
|
import {
|
|
8
8
|
createStore
|
|
9
|
-
} from "../__chunks/
|
|
9
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultValue
|
|
12
|
-
} from "../__chunks/
|
|
13
|
-
import "../__chunks/
|
|
12
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
13
|
+
import "../__chunks/HWOIWM4O.js";
|
|
14
14
|
import {
|
|
15
15
|
__objRest,
|
|
16
16
|
__spreadProps,
|
|
17
17
|
__spreadValues
|
|
18
|
-
} from "../__chunks/
|
|
18
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
19
19
|
|
|
20
20
|
// src/radio/radio-store.ts
|
|
21
21
|
function createRadioStore(_a = {}) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
|
+
import "../__chunks/6DHTHWXD.js";
|
|
6
6
|
import {
|
|
7
7
|
toArray
|
|
8
8
|
} from "../__chunks/7PRQYBBV.js";
|
|
9
9
|
import {
|
|
10
10
|
createPopoverStore
|
|
11
|
-
} from "../__chunks/
|
|
12
|
-
import "../__chunks/
|
|
13
|
-
import "../__chunks/
|
|
11
|
+
} from "../__chunks/3UYWTADI.js";
|
|
12
|
+
import "../__chunks/YOHCVXJB.js";
|
|
13
|
+
import "../__chunks/6E4KKOSB.js";
|
|
14
14
|
import {
|
|
15
15
|
batch,
|
|
16
16
|
createStore,
|
|
@@ -19,16 +19,16 @@ import {
|
|
|
19
19
|
setup,
|
|
20
20
|
sync,
|
|
21
21
|
throwOnConflictingProps
|
|
22
|
-
} from "../__chunks/
|
|
22
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
23
23
|
import {
|
|
24
24
|
defaultValue
|
|
25
|
-
} from "../__chunks/
|
|
26
|
-
import "../__chunks/
|
|
25
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
26
|
+
import "../__chunks/HWOIWM4O.js";
|
|
27
27
|
import {
|
|
28
28
|
__objRest,
|
|
29
29
|
__spreadProps,
|
|
30
30
|
__spreadValues
|
|
31
|
-
} from "../__chunks/
|
|
31
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
32
32
|
|
|
33
33
|
// src/select/select-store.ts
|
|
34
34
|
function createSelectStore(_a = {}) {
|
|
@@ -106,42 +106,34 @@ function createSelectStore(_a = {}) {
|
|
|
106
106
|
setup(
|
|
107
107
|
select,
|
|
108
108
|
() => sync(select, ["value", "items"], (state) => {
|
|
109
|
-
if (state.value !== initialValue)
|
|
110
|
-
|
|
111
|
-
if (!state.items.length)
|
|
112
|
-
return;
|
|
109
|
+
if (state.value !== initialValue) return;
|
|
110
|
+
if (!state.items.length) return;
|
|
113
111
|
const item = state.items.find(
|
|
114
112
|
(item2) => !item2.disabled && item2.value != null
|
|
115
113
|
);
|
|
116
|
-
if ((item == null ? void 0 : item.value) == null)
|
|
117
|
-
return;
|
|
114
|
+
if ((item == null ? void 0 : item.value) == null) return;
|
|
118
115
|
select.setState("value", item.value);
|
|
119
116
|
})
|
|
120
117
|
);
|
|
121
118
|
setup(
|
|
122
119
|
select,
|
|
123
120
|
() => sync(select, ["mounted"], (state) => {
|
|
124
|
-
if (state.mounted)
|
|
125
|
-
return;
|
|
121
|
+
if (state.mounted) return;
|
|
126
122
|
select.setState("activeId", initialState.activeId);
|
|
127
123
|
})
|
|
128
124
|
);
|
|
129
125
|
setup(
|
|
130
126
|
select,
|
|
131
127
|
() => sync(select, ["mounted", "items", "value"], (state) => {
|
|
132
|
-
if (combobox)
|
|
133
|
-
|
|
134
|
-
if (state.mounted)
|
|
135
|
-
return;
|
|
128
|
+
if (combobox) return;
|
|
129
|
+
if (state.mounted) return;
|
|
136
130
|
const values = toArray(state.value);
|
|
137
131
|
const lastValue = values[values.length - 1];
|
|
138
|
-
if (lastValue == null)
|
|
139
|
-
return;
|
|
132
|
+
if (lastValue == null) return;
|
|
140
133
|
const item = state.items.find(
|
|
141
134
|
(item2) => !item2.disabled && item2.value === lastValue
|
|
142
135
|
);
|
|
143
|
-
if (!item)
|
|
144
|
-
return;
|
|
136
|
+
if (!item) return;
|
|
145
137
|
select.setState("activeId", item.id);
|
|
146
138
|
})
|
|
147
139
|
);
|
|
@@ -149,17 +141,12 @@ function createSelectStore(_a = {}) {
|
|
|
149
141
|
select,
|
|
150
142
|
() => batch(select, ["setValueOnMove", "moves"], (state) => {
|
|
151
143
|
const { mounted, value, activeId } = select.getState();
|
|
152
|
-
if (!state.setValueOnMove && mounted)
|
|
153
|
-
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
if (!state.moves)
|
|
157
|
-
return;
|
|
158
|
-
if (!activeId)
|
|
159
|
-
return;
|
|
144
|
+
if (!state.setValueOnMove && mounted) return;
|
|
145
|
+
if (Array.isArray(value)) return;
|
|
146
|
+
if (!state.moves) return;
|
|
147
|
+
if (!activeId) return;
|
|
160
148
|
const item = composite.item(activeId);
|
|
161
|
-
if (!item || item.disabled || item.value == null)
|
|
162
|
-
return;
|
|
149
|
+
if (!item || item.disabled || item.value == null) return;
|
|
163
150
|
select.setState("value", item.value);
|
|
164
151
|
})
|
|
165
152
|
);
|
package/esm/tab/tab-store.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
5
|
import {
|
|
6
6
|
createCollectionStore
|
|
7
|
-
} from "../__chunks/
|
|
7
|
+
} from "../__chunks/6DHTHWXD.js";
|
|
8
8
|
import "../__chunks/7PRQYBBV.js";
|
|
9
9
|
import {
|
|
10
10
|
batch,
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
omit,
|
|
14
14
|
setup,
|
|
15
15
|
sync
|
|
16
|
-
} from "../__chunks/
|
|
16
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
17
17
|
import {
|
|
18
18
|
chain,
|
|
19
19
|
defaultValue
|
|
20
|
-
} from "../__chunks/
|
|
21
|
-
import "../__chunks/
|
|
20
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
21
|
+
import "../__chunks/HWOIWM4O.js";
|
|
22
22
|
import {
|
|
23
23
|
__objRest,
|
|
24
24
|
__spreadProps,
|
|
25
25
|
__spreadValues
|
|
26
|
-
} from "../__chunks/
|
|
26
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
27
27
|
|
|
28
28
|
// src/tab/tab-store.ts
|
|
29
29
|
function createTabStore(_a = {}) {
|
|
@@ -88,33 +88,26 @@ function createTabStore(_a = {}) {
|
|
|
88
88
|
tab,
|
|
89
89
|
() => sync(tab, ["moves"], () => {
|
|
90
90
|
const { activeId, selectOnMove } = tab.getState();
|
|
91
|
-
if (!selectOnMove)
|
|
92
|
-
|
|
93
|
-
if (!activeId)
|
|
94
|
-
return;
|
|
91
|
+
if (!selectOnMove) return;
|
|
92
|
+
if (!activeId) return;
|
|
95
93
|
const tabItem = composite.item(activeId);
|
|
96
|
-
if (!tabItem)
|
|
97
|
-
|
|
98
|
-
if (tabItem.
|
|
99
|
-
return;
|
|
100
|
-
if (tabItem.disabled)
|
|
101
|
-
return;
|
|
94
|
+
if (!tabItem) return;
|
|
95
|
+
if (tabItem.dimmed) return;
|
|
96
|
+
if (tabItem.disabled) return;
|
|
102
97
|
tab.setState("selectedId", tabItem.id);
|
|
103
98
|
})
|
|
104
99
|
);
|
|
105
100
|
setup(
|
|
106
101
|
tab,
|
|
107
102
|
() => batch(tab, ["selectedId"], (state, prev) => {
|
|
108
|
-
if (parentComposite && state.selectedId === prev.selectedId)
|
|
109
|
-
return;
|
|
103
|
+
if (parentComposite && state.selectedId === prev.selectedId) return;
|
|
110
104
|
tab.setState("activeId", state.selectedId);
|
|
111
105
|
})
|
|
112
106
|
);
|
|
113
107
|
setup(
|
|
114
108
|
tab,
|
|
115
109
|
() => sync(tab, ["selectedId", "renderedItems"], (state) => {
|
|
116
|
-
if (state.selectedId !== void 0)
|
|
117
|
-
return;
|
|
110
|
+
if (state.selectedId !== void 0) return;
|
|
118
111
|
const { activeId, renderedItems } = tab.getState();
|
|
119
112
|
const tabItem = composite.item(activeId);
|
|
120
113
|
if (tabItem && !tabItem.disabled && !tabItem.dimmed) {
|
|
@@ -131,19 +124,15 @@ function createTabStore(_a = {}) {
|
|
|
131
124
|
tab,
|
|
132
125
|
() => sync(tab, ["renderedItems"], (state) => {
|
|
133
126
|
const tabs = state.renderedItems;
|
|
134
|
-
if (!tabs.length)
|
|
135
|
-
return;
|
|
127
|
+
if (!tabs.length) return;
|
|
136
128
|
return sync(panels, ["renderedItems"], (state2) => {
|
|
137
129
|
const items = state2.renderedItems;
|
|
138
130
|
const hasOrphanPanels = items.some((panel) => !panel.tabId);
|
|
139
|
-
if (!hasOrphanPanels)
|
|
140
|
-
return;
|
|
131
|
+
if (!hasOrphanPanels) return;
|
|
141
132
|
items.forEach((panel, i) => {
|
|
142
|
-
if (panel.tabId)
|
|
143
|
-
return;
|
|
133
|
+
if (panel.tabId) return;
|
|
144
134
|
const tabItem = tabs[i];
|
|
145
|
-
if (!tabItem)
|
|
146
|
-
return;
|
|
135
|
+
if (!tabItem) return;
|
|
147
136
|
panels.renderItem(__spreadProps(__spreadValues({}, panel), { tabId: tabItem.id }));
|
|
148
137
|
});
|
|
149
138
|
});
|
|
@@ -163,8 +152,7 @@ function createTabStore(_a = {}) {
|
|
|
163
152
|
sync(parentComposite, ["open"], restoreSelectedId)
|
|
164
153
|
);
|
|
165
154
|
}
|
|
166
|
-
if (!combobox)
|
|
167
|
-
return;
|
|
155
|
+
if (!combobox) return;
|
|
168
156
|
return chain(
|
|
169
157
|
sync(combobox, ["selectedValue"], backupSelectedId),
|
|
170
158
|
sync(combobox, ["open"], restoreSelectedId)
|
package/esm/tag/tag-store.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
|
+
import "../__chunks/6DHTHWXD.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
7
|
import {
|
|
8
8
|
UndoManager
|
|
9
|
-
} from "../__chunks/
|
|
9
|
+
} from "../__chunks/7LM4Q2XB.js";
|
|
10
10
|
import {
|
|
11
11
|
createStore,
|
|
12
12
|
setup,
|
|
13
13
|
sync
|
|
14
|
-
} from "../__chunks/
|
|
14
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
15
15
|
import {
|
|
16
16
|
applyState,
|
|
17
17
|
defaultValue
|
|
18
|
-
} from "../__chunks/
|
|
19
|
-
import "../__chunks/
|
|
18
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
19
|
+
import "../__chunks/HWOIWM4O.js";
|
|
20
20
|
import {
|
|
21
21
|
__spreadProps,
|
|
22
22
|
__spreadValues
|
|
23
|
-
} from "../__chunks/
|
|
23
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
24
24
|
|
|
25
25
|
// src/tag/tag-store.ts
|
|
26
26
|
function createTagStore(props = {}) {
|
|
@@ -42,10 +42,8 @@ function createTagStore(props = {}) {
|
|
|
42
42
|
setup(
|
|
43
43
|
tag,
|
|
44
44
|
() => sync(tag, ["inputElement", "activeId"], (state) => {
|
|
45
|
-
if (!state.inputElement)
|
|
46
|
-
|
|
47
|
-
if (state.activeId !== void 0)
|
|
48
|
-
return;
|
|
45
|
+
if (!state.inputElement) return;
|
|
46
|
+
if (state.activeId !== void 0) return;
|
|
49
47
|
tag.setState("activeId", state.inputElement.id);
|
|
50
48
|
})
|
|
51
49
|
);
|
|
@@ -60,8 +58,7 @@ function createTagStore(props = {}) {
|
|
|
60
58
|
}
|
|
61
59
|
return next;
|
|
62
60
|
});
|
|
63
|
-
if (!changed)
|
|
64
|
-
return;
|
|
61
|
+
if (!changed) return;
|
|
65
62
|
return () => {
|
|
66
63
|
var _a2;
|
|
67
64
|
tag.setState("values", previousValues);
|
|
@@ -77,8 +74,7 @@ function createTagStore(props = {}) {
|
|
|
77
74
|
setValues,
|
|
78
75
|
addValue: (value) => {
|
|
79
76
|
setValues((values) => {
|
|
80
|
-
if (values.includes(value))
|
|
81
|
-
return values;
|
|
77
|
+
if (values.includes(value)) return values;
|
|
82
78
|
return [...values, value];
|
|
83
79
|
});
|
|
84
80
|
},
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
|
+
import "../__chunks/6DHTHWXD.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
|
-
import "../__chunks/
|
|
7
|
+
import "../__chunks/EQQLU3CG.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
|
-
} from "../__chunks/
|
|
11
|
-
import "../__chunks/
|
|
10
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
11
|
+
import "../__chunks/HWOIWM4O.js";
|
|
12
12
|
import {
|
|
13
13
|
__spreadProps,
|
|
14
14
|
__spreadValues
|
|
15
|
-
} from "../__chunks/
|
|
15
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
16
16
|
|
|
17
17
|
// src/toolbar/toolbar-store.ts
|
|
18
18
|
function createToolbarStore(props = {}) {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createHovercardStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/EACLTACN.js";
|
|
5
|
+
import "../__chunks/3UYWTADI.js";
|
|
6
|
+
import "../__chunks/YOHCVXJB.js";
|
|
7
|
+
import "../__chunks/6E4KKOSB.js";
|
|
8
8
|
import {
|
|
9
9
|
createStore
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
|
-
} from "../__chunks/
|
|
13
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
14
14
|
import {
|
|
15
15
|
__spreadProps,
|
|
16
16
|
__spreadValues
|
|
17
|
-
} from "../__chunks/
|
|
17
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
18
18
|
|
|
19
19
|
// src/tooltip/tooltip-store.ts
|
|
20
20
|
function createTooltipStore(props = {}) {
|
package/esm/utils/array.js
CHANGED
package/esm/utils/dom.js
CHANGED
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
isVisible,
|
|
19
19
|
scrollIntoViewIfNeeded,
|
|
20
20
|
setSelectionRange
|
|
21
|
-
} from "../__chunks/
|
|
22
|
-
import "../__chunks/
|
|
21
|
+
} from "../__chunks/HWOIWM4O.js";
|
|
22
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
23
23
|
export {
|
|
24
24
|
canUseDOM,
|
|
25
25
|
contains,
|
package/esm/utils/events.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
isApple
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/US4USQPI.js";
|
|
5
5
|
import {
|
|
6
6
|
contains
|
|
7
|
-
} from "../__chunks/
|
|
7
|
+
} from "../__chunks/HWOIWM4O.js";
|
|
8
8
|
import {
|
|
9
9
|
__spreadProps,
|
|
10
10
|
__spreadValues
|
|
11
|
-
} from "../__chunks/
|
|
11
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
12
12
|
|
|
13
13
|
// src/utils/events.ts
|
|
14
14
|
function isPortalEvent(event) {
|
|
@@ -21,35 +21,24 @@ function isSelfTarget(event) {
|
|
|
21
21
|
}
|
|
22
22
|
function isOpeningInNewTab(event) {
|
|
23
23
|
const element = event.currentTarget;
|
|
24
|
-
if (!element)
|
|
25
|
-
return false;
|
|
24
|
+
if (!element) return false;
|
|
26
25
|
const isAppleDevice = isApple();
|
|
27
|
-
if (isAppleDevice && !event.metaKey)
|
|
28
|
-
|
|
29
|
-
if (!isAppleDevice && !event.ctrlKey)
|
|
30
|
-
return false;
|
|
26
|
+
if (isAppleDevice && !event.metaKey) return false;
|
|
27
|
+
if (!isAppleDevice && !event.ctrlKey) return false;
|
|
31
28
|
const tagName = element.tagName.toLowerCase();
|
|
32
|
-
if (tagName === "a")
|
|
33
|
-
|
|
34
|
-
if (tagName === "
|
|
35
|
-
return true;
|
|
36
|
-
if (tagName === "input" && element.type === "submit")
|
|
37
|
-
return true;
|
|
29
|
+
if (tagName === "a") return true;
|
|
30
|
+
if (tagName === "button" && element.type === "submit") return true;
|
|
31
|
+
if (tagName === "input" && element.type === "submit") return true;
|
|
38
32
|
return false;
|
|
39
33
|
}
|
|
40
34
|
function isDownloading(event) {
|
|
41
35
|
const element = event.currentTarget;
|
|
42
|
-
if (!element)
|
|
43
|
-
return false;
|
|
36
|
+
if (!element) return false;
|
|
44
37
|
const tagName = element.tagName.toLowerCase();
|
|
45
|
-
if (!event.altKey)
|
|
46
|
-
|
|
47
|
-
if (tagName === "
|
|
48
|
-
|
|
49
|
-
if (tagName === "button" && element.type === "submit")
|
|
50
|
-
return true;
|
|
51
|
-
if (tagName === "input" && element.type === "submit")
|
|
52
|
-
return true;
|
|
38
|
+
if (!event.altKey) return false;
|
|
39
|
+
if (tagName === "a") return true;
|
|
40
|
+
if (tagName === "button" && element.type === "submit") return true;
|
|
41
|
+
if (tagName === "input" && element.type === "submit") return true;
|
|
53
42
|
return false;
|
|
54
43
|
}
|
|
55
44
|
function fireEvent(element, type, eventInit) {
|
|
@@ -85,12 +74,9 @@ function isFocusEventOutside(event, container) {
|
|
|
85
74
|
}
|
|
86
75
|
function getInputType(event) {
|
|
87
76
|
const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
|
|
88
|
-
if (!nativeEvent)
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
return;
|
|
92
|
-
if (typeof nativeEvent.inputType !== "string")
|
|
93
|
-
return;
|
|
77
|
+
if (!nativeEvent) return;
|
|
78
|
+
if (!("inputType" in nativeEvent)) return;
|
|
79
|
+
if (typeof nativeEvent.inputType !== "string") return;
|
|
94
80
|
return nativeEvent.inputType;
|
|
95
81
|
}
|
|
96
82
|
function queueBeforeEvent(element, type, callback, timeout) {
|