@ariakit/react 0.4.27 → 0.4.29
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-035.md → CHANGELOG-0314.md} +205 -0
- package/CHANGELOG.md +53 -202
- package/cjs/__chunks/{SXAPGTJ4.cjs → 2ENQD3AS.cjs} +6 -6
- package/cjs/__chunks/{L2IFVMDU.cjs → 2WBRQ3I7.cjs} +7 -6
- package/cjs/__chunks/{N3DLR7OL.cjs → 3B6TF7HK.cjs} +6 -6
- package/cjs/__chunks/{XPQIHUQ7.cjs → 42GL4LKI.cjs} +20 -20
- package/cjs/__chunks/{VXUZM542.cjs → 53Q7HWXL.cjs} +165 -165
- package/cjs/__chunks/{3FIXGHZ2.cjs → 5QRVCRDI.cjs} +5 -5
- package/cjs/__chunks/{7MXJT4IN.cjs → 5XICU34X.cjs} +3 -3
- package/cjs/__chunks/{334WKW6I.cjs → 5ZX5ACFH.cjs} +4 -4
- package/cjs/__chunks/{2MDC3Z3V.cjs → 6BNWLCHF.cjs} +10 -10
- package/cjs/__chunks/{IFZV5LA3.cjs → 6XKLGFUO.cjs} +17 -17
- package/cjs/__chunks/{PZXRBFZF.cjs → 7SEEXNY6.cjs} +7 -7
- package/cjs/__chunks/{VXDLN5CP.cjs → 7XB4QE2H.cjs} +29 -29
- package/cjs/__chunks/{RVXPEX7O.cjs → AI3BA27G.cjs} +18 -18
- package/cjs/__chunks/{NG34QRI6.cjs → BTARPES4.cjs} +79 -32
- package/cjs/__chunks/{LCX235VJ.cjs → CKHOJYDQ.cjs} +6 -6
- package/cjs/__chunks/{C4NVIV6V.cjs → CRPG37KH.cjs} +104 -84
- package/cjs/__chunks/{4RKQMGBK.cjs → CYTUSXPR.cjs} +236 -222
- package/cjs/__chunks/{IHVFJGGN.cjs → D6USTXKA.cjs} +4 -4
- package/cjs/__chunks/{NFZWL7LE.cjs → DDV252ZY.cjs} +4 -4
- package/cjs/__chunks/DVB2WSHD.cjs +41 -0
- package/cjs/__chunks/{YEXJT4IL.cjs → EF57ZMJN.cjs} +10 -10
- package/cjs/__chunks/{RR46KI45.cjs → EQYJ6RA7.cjs} +3 -3
- package/cjs/__chunks/{D4HCGWOU.cjs → FHPV2Q7C.cjs} +182 -78
- package/cjs/__chunks/{FHQ5DVYQ.cjs → FNYFMCD7.cjs} +4 -4
- package/cjs/__chunks/{FELYQPO5.cjs → FWVWDDOL.cjs} +182 -173
- package/cjs/__chunks/{GUY4MKX2.cjs → G2JI2Z7U.cjs} +12 -12
- package/cjs/__chunks/{Z5PDS46M.cjs → GI27TVAM.cjs} +159 -159
- package/cjs/__chunks/{PTE2IJM5.cjs → GQZ5DRPC.cjs} +32 -30
- package/cjs/__chunks/{XH4GE3VE.cjs → GV4SR2CM.cjs} +7 -7
- package/cjs/__chunks/{PU63IQFD.cjs → HCYQ5Z7Z.cjs} +58 -58
- package/cjs/__chunks/{ASOIXRUN.cjs → HGV6FCZP.cjs} +61 -61
- package/cjs/__chunks/{OOFUBC32.cjs → I4JS2KAF.cjs} +17 -19
- package/cjs/__chunks/{DVWS2XPY.cjs → I6N3772N.cjs} +21 -21
- package/cjs/__chunks/{7POA4244.cjs → IEVLYJJP.cjs} +22 -22
- package/cjs/__chunks/{ZNW2LLWJ.cjs → IGWSYIUY.cjs} +15 -15
- package/cjs/__chunks/{QAUJZR6Y.cjs → JBOLBTVU.cjs} +15 -4
- package/cjs/__chunks/{MN5TONXW.cjs → JXYV7OWF.cjs} +33 -36
- package/cjs/__chunks/{FIPBE5IX.cjs → KDVG735H.cjs} +3 -3
- package/cjs/__chunks/{TSBEWPNT.cjs → KFUU3G3B.cjs} +39 -39
- package/cjs/__chunks/{ZYPARRXG.cjs → LGUAIO4Q.cjs} +4 -4
- package/cjs/__chunks/{5NTEPQ2U.cjs → M6YHODMV.cjs} +20 -20
- package/cjs/__chunks/{SIF7IN4L.cjs → MWZS5XD4.cjs} +12 -12
- package/cjs/__chunks/{UUEFM3TG.cjs → NBAYASRC.cjs} +17 -17
- package/cjs/__chunks/{RXZPZPJX.cjs → OFFSDIY3.cjs} +21 -21
- package/cjs/__chunks/{RGH2H3WL.cjs → OP2QHIHD.cjs} +4 -4
- package/cjs/__chunks/{2HXQHKBC.cjs → P6Y2DILA.cjs} +17 -17
- package/cjs/__chunks/{LMCBLO3G.cjs → P7AY4KL3.cjs} +10 -10
- package/cjs/__chunks/{PDPE2VAZ.cjs → QJQWEU4Q.cjs} +134 -120
- package/cjs/__chunks/{UV7CXZEM.cjs → RZJLQJQM.cjs} +9 -9
- package/cjs/__chunks/{34UJGLOZ.cjs → SAFZBKT3.cjs} +61 -48
- package/cjs/__chunks/{LVHC4DSB.cjs → TMY4OIYC.cjs} +19 -19
- package/cjs/__chunks/{LS5VO6AA.cjs → ULDO57DJ.cjs} +12 -12
- package/cjs/__chunks/{NMUCJYMR.cjs → US2XYAXE.cjs} +83 -83
- package/cjs/__chunks/{GUB6WHB6.cjs → VUISVT3V.cjs} +9 -9
- package/cjs/__chunks/{RLKC7JVT.cjs → WHUT2PFL.cjs} +4 -4
- package/cjs/__chunks/WLHP5OM6.cjs +37 -0
- package/cjs/__chunks/{7M4GY5DS.cjs → WYI5CKPV.cjs} +38 -38
- package/cjs/__chunks/{SQ72MZ63.cjs → ZPWE3FTF.cjs} +39 -39
- package/cjs/button.cjs +5 -5
- package/cjs/checkbox.cjs +8 -8
- package/cjs/collection.cjs +6 -6
- package/cjs/combobox.cjs +30 -30
- package/cjs/command.cjs +4 -4
- package/cjs/composite.cjs +17 -17
- package/cjs/dialog.cjs +18 -18
- package/cjs/disclosure.cjs +9 -9
- package/cjs/focus-trap.cjs +5 -5
- package/cjs/focusable.cjs +3 -3
- package/cjs/form.cjs +14 -14
- package/cjs/group.cjs +3 -3
- package/cjs/heading.cjs +3 -3
- package/cjs/hovercard.cjs +25 -25
- package/cjs/index.cjs +59 -59
- package/cjs/menu.cjs +42 -42
- package/cjs/menubar.cjs +8 -8
- package/cjs/popover.cjs +25 -25
- package/cjs/portal.cjs +5 -5
- package/cjs/radio.cjs +12 -12
- package/cjs/role.cjs +3 -3
- package/cjs/select.cjs +36 -36
- package/cjs/separator.cjs +3 -3
- package/cjs/store.cjs +3 -3
- package/cjs/tab.cjs +15 -15
- package/cjs/toolbar.cjs +13 -13
- package/cjs/tooltip.cjs +15 -15
- package/cjs/visually-hidden.cjs +3 -3
- package/package.json +4 -4
- package/cjs/__chunks/FVIS5BFZ.cjs +0 -41
- package/cjs/__chunks/TLUFYZC7.cjs +0 -37
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _KDVG735Hcjs = require('./KDVG735H.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _2WBRQ3I7cjs = require('./2WBRQ3I7.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _JBOLBTVUcjs = require('./JBOLBTVU.cjs');
|
|
12
12
|
|
|
13
13
|
// ../ariakit-react-components/dist/select/select-context.js
|
|
14
14
|
var _react = require('react');
|
|
15
|
-
var ctx =
|
|
15
|
+
var ctx = _JBOLBTVUcjs.createStoreContext.call(void 0, [_KDVG735Hcjs.PopoverContextProvider, _2WBRQ3I7cjs.CompositeContextProvider], [_KDVG735Hcjs.PopoverScopedContextProvider, _2WBRQ3I7cjs.CompositeScopedContextProvider]);
|
|
16
16
|
var useSelectContext = ctx.useContext;
|
|
17
17
|
var useSelectScopedContext = ctx.useScopedContext;
|
|
18
18
|
var useSelectProviderContext = ctx.useProviderContext;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _JBOLBTVUcjs = require('./JBOLBTVU.cjs');
|
|
6
6
|
|
|
7
7
|
// ../ariakit-react-components/dist/separator/separator.js
|
|
8
8
|
var TagName = "hr";
|
|
9
|
-
var useSeparator =
|
|
9
|
+
var useSeparator = _JBOLBTVUcjs.createHook.call(void 0, function useSeparator2({ orientation = "horizontal", ...props }) {
|
|
10
10
|
props = {
|
|
11
11
|
role: "separator",
|
|
12
12
|
"aria-orientation": orientation,
|
|
@@ -14,8 +14,8 @@ var useSeparator = _QAUJZR6Ycjs.createHook.call(void 0, function useSeparator2({
|
|
|
14
14
|
};
|
|
15
15
|
return props;
|
|
16
16
|
});
|
|
17
|
-
var Separator =
|
|
18
|
-
return
|
|
17
|
+
var Separator = _JBOLBTVUcjs.forwardRef.call(void 0, function Separator2(props) {
|
|
18
|
+
return _JBOLBTVUcjs.createElement.call(void 0, TagName, useSeparator(props));
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _NBAYASRCcjs = require('./NBAYASRC.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _WYI5CKPVcjs = require('./WYI5CKPV.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _FHPV2Q7Ccjs = require('./FHPV2Q7C.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _JBOLBTVUcjs = require('./JBOLBTVU.cjs');
|
|
17
|
+
|
|
18
|
+
// ../ariakit-react-components/dist/dialog/dialog-disclosure.js
|
|
19
|
+
var TagName = "button";
|
|
20
|
+
var useDialogDisclosure = _JBOLBTVUcjs.createHook.call(void 0, function useDialogDisclosure2({ store, ...props }) {
|
|
21
|
+
const context = _WYI5CKPVcjs.useDialogProviderContext.call(void 0, );
|
|
22
|
+
store = store || context;
|
|
23
|
+
_JBOLBTVUcjs.invariant.call(void 0, store, process.env.NODE_ENV !== "production" && "DialogDisclosure must receive a `store` prop or be wrapped in a DialogProvider component.");
|
|
24
|
+
props = {
|
|
25
|
+
"aria-haspopup": _JBOLBTVUcjs.getPopupRole.call(void 0, _FHPV2Q7Ccjs.useStoreState.call(void 0, store, "contentElement"), "dialog"),
|
|
26
|
+
...props
|
|
27
|
+
};
|
|
28
|
+
props = _NBAYASRCcjs.useDisclosure.call(void 0, {
|
|
29
|
+
store,
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
return props;
|
|
33
|
+
});
|
|
34
|
+
var DialogDisclosure = _JBOLBTVUcjs.forwardRef.call(void 0, function DialogDisclosure2(props) {
|
|
35
|
+
return _JBOLBTVUcjs.createElement.call(void 0, TagName, useDialogDisclosure(props));
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
exports.useDialogDisclosure = useDialogDisclosure; exports.DialogDisclosure = DialogDisclosure;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _3B6TF7HKcjs = require('./3B6TF7HK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -9,21 +9,21 @@ var _N3DLR7OLcjs = require('./N3DLR7OL.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _JBOLBTVUcjs = require('./JBOLBTVU.cjs');
|
|
13
13
|
|
|
14
14
|
// ../ariakit-react-components/dist/focus-trap/focus-trap-region.js
|
|
15
15
|
var _react = require('react');
|
|
16
16
|
var _jsxruntime = require('react/jsx-runtime');
|
|
17
17
|
var TagName = "div";
|
|
18
|
-
var useFocusTrapRegion =
|
|
18
|
+
var useFocusTrapRegion = _JBOLBTVUcjs.createHook.call(void 0, function useFocusTrapRegion2({ enabled = false, ...props }) {
|
|
19
19
|
const ref = _react.useRef.call(void 0, null);
|
|
20
|
-
props =
|
|
20
|
+
props = _JBOLBTVUcjs.useWrapElement.call(void 0, props, (element) => {
|
|
21
21
|
const renderFocusTrap = () => {
|
|
22
22
|
if (!enabled) return null;
|
|
23
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _3B6TF7HKcjs.FocusTrap, { onFocus: (event) => {
|
|
24
24
|
const container = ref.current;
|
|
25
25
|
if (!container) return;
|
|
26
|
-
const tabbables =
|
|
26
|
+
const tabbables = _JBOLBTVUcjs.getAllTabbableIn.call(void 0, container, true);
|
|
27
27
|
const first = tabbables[0];
|
|
28
28
|
const last = tabbables[tabbables.length - 1];
|
|
29
29
|
if (!tabbables.length) {
|
|
@@ -42,12 +42,12 @@ var useFocusTrapRegion = _QAUJZR6Ycjs.createHook.call(void 0, function useFocusT
|
|
|
42
42
|
}, [enabled]);
|
|
43
43
|
props = {
|
|
44
44
|
...props,
|
|
45
|
-
ref:
|
|
45
|
+
ref: _JBOLBTVUcjs.useMergeRefs.call(void 0, ref, props.ref)
|
|
46
46
|
};
|
|
47
|
-
return
|
|
47
|
+
return _JBOLBTVUcjs.removeUndefinedValues.call(void 0, props);
|
|
48
48
|
});
|
|
49
|
-
var FocusTrapRegion =
|
|
50
|
-
return
|
|
49
|
+
var FocusTrapRegion = _JBOLBTVUcjs.forwardRef.call(void 0, function FocusTrapRegion2(props) {
|
|
50
|
+
return _JBOLBTVUcjs.createElement.call(void 0, TagName, useFocusTrapRegion(props));
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _IEVLYJJPcjs = require('./IEVLYJJP.cjs');
|
|
5
5
|
|
|
6
6
|
// ../ariakit-react-components/dist/checkbox/checkbox-provider.js
|
|
7
7
|
var _jsxruntime = require('react/jsx-runtime');
|
|
8
8
|
function CheckboxProvider(props = {}) {
|
|
9
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10
|
-
value:
|
|
9
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _IEVLYJJPcjs.CheckboxContextProvider, {
|
|
10
|
+
value: _IEVLYJJPcjs.useCheckboxStore.call(void 0, props),
|
|
11
11
|
children: props.children
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -13,14 +13,13 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
var _JBOLBTVUcjs = require('./JBOLBTVU.cjs');
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var require_use_sync_external_store_shim_production = _QAUJZR6Ycjs.__commonJS.call(void 0, {
|
|
21
|
-
"../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
|
|
18
|
+
// ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
|
|
19
|
+
var require_use_sync_external_store_shim_production = _JBOLBTVUcjs.__commonJS.call(void 0, {
|
|
20
|
+
"../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
|
|
22
21
|
"use strict";
|
|
23
|
-
var React2 =
|
|
22
|
+
var React2 = _JBOLBTVUcjs.__require.call(void 0, "react");
|
|
24
23
|
function is(x, y) {
|
|
25
24
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
26
25
|
}
|
|
@@ -69,9 +68,9 @@ var require_use_sync_external_store_shim_production = _QAUJZR6Ycjs.__commonJS.ca
|
|
|
69
68
|
}
|
|
70
69
|
});
|
|
71
70
|
|
|
72
|
-
// ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@
|
|
73
|
-
var require_use_sync_external_store_shim_development =
|
|
74
|
-
"../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@
|
|
71
|
+
// ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
|
72
|
+
var require_use_sync_external_store_shim_development = _JBOLBTVUcjs.__commonJS.call(void 0, {
|
|
73
|
+
"../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
|
|
75
74
|
"use strict";
|
|
76
75
|
"production" !== process.env.NODE_ENV && (function() {
|
|
77
76
|
function is(x, y) {
|
|
@@ -126,16 +125,16 @@ var require_use_sync_external_store_shim_development = _QAUJZR6Ycjs.__commonJS.c
|
|
|
126
125
|
return getSnapshot();
|
|
127
126
|
}
|
|
128
127
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
129
|
-
var React2 =
|
|
128
|
+
var React2 = _JBOLBTVUcjs.__require.call(void 0, "react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React2.useState, useEffect = React2.useEffect, useLayoutEffect = React2.useLayoutEffect, useDebugValue = React2.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
130
129
|
exports.useSyncExternalStore = void 0 !== React2.useSyncExternalStore ? React2.useSyncExternalStore : shim;
|
|
131
130
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
132
131
|
})();
|
|
133
132
|
}
|
|
134
133
|
});
|
|
135
134
|
|
|
136
|
-
// ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@
|
|
137
|
-
var require_shim =
|
|
138
|
-
"../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@
|
|
135
|
+
// ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/shim/index.js
|
|
136
|
+
var require_shim = _JBOLBTVUcjs.__commonJS.call(void 0, {
|
|
137
|
+
"../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/shim/index.js"(exports, module) {
|
|
139
138
|
"use strict";
|
|
140
139
|
if (process.env.NODE_ENV === "production") {
|
|
141
140
|
module.exports = require_use_sync_external_store_shim_production();
|
|
@@ -148,27 +147,63 @@ var require_shim = _QAUJZR6Ycjs.__commonJS.call(void 0, {
|
|
|
148
147
|
// ../ariakit-store/dist/index.js
|
|
149
148
|
function getInternal(store, key) {
|
|
150
149
|
const internals = store.__unstableInternals;
|
|
151
|
-
|
|
150
|
+
_JBOLBTVUcjs.invariant.call(void 0, internals, "Invalid store");
|
|
152
151
|
return internals[key];
|
|
153
152
|
}
|
|
153
|
+
function hasUpdatedKey(keys, updatedKey) {
|
|
154
|
+
if (!keys) return true;
|
|
155
|
+
for (const currentKey of keys) if (updatedKey instanceof Set) {
|
|
156
|
+
if (updatedKey.has(currentKey)) return true;
|
|
157
|
+
} else if (currentKey === updatedKey) return true;
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
function addKeyedListener(map, keys, listener) {
|
|
161
|
+
if (!keys) return;
|
|
162
|
+
for (const key of keys) {
|
|
163
|
+
let listeners = map.get(key);
|
|
164
|
+
if (!listeners) {
|
|
165
|
+
listeners = /* @__PURE__ */ new Set();
|
|
166
|
+
map.set(key, listeners);
|
|
167
|
+
}
|
|
168
|
+
listeners.add(listener);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function deleteKeyedListener(map, keys, listener) {
|
|
172
|
+
if (!map) return;
|
|
173
|
+
if (!keys) return;
|
|
174
|
+
for (const key of keys) {
|
|
175
|
+
const listeners = map.get(key);
|
|
176
|
+
if (!listeners) continue;
|
|
177
|
+
listeners.delete(listener);
|
|
178
|
+
if (!listeners.size) map.delete(key);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
154
181
|
function createStore(initialState, ...stores) {
|
|
155
182
|
let state = initialState;
|
|
156
183
|
let prevStateBatch = state;
|
|
157
|
-
let
|
|
158
|
-
let
|
|
184
|
+
let destroy = _JBOLBTVUcjs.noop;
|
|
185
|
+
let batchPending = false;
|
|
186
|
+
let inDispatch = false;
|
|
187
|
+
let updatedKeys = /* @__PURE__ */ new Set();
|
|
159
188
|
const instances = /* @__PURE__ */ new Set();
|
|
160
|
-
const updatedKeys = /* @__PURE__ */ new Set();
|
|
161
189
|
const setups = /* @__PURE__ */ new Set();
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
190
|
+
const syncListenerGroup = {
|
|
191
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
192
|
+
disposables: /* @__PURE__ */ new Map(),
|
|
193
|
+
listenerKeys: /* @__PURE__ */ new WeakMap()
|
|
194
|
+
};
|
|
195
|
+
const batchListenerGroup = {
|
|
196
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
197
|
+
disposables: /* @__PURE__ */ new Map(),
|
|
198
|
+
listenerKeys: /* @__PURE__ */ new WeakMap()
|
|
199
|
+
};
|
|
166
200
|
const storeSetup = (callback) => {
|
|
167
201
|
setups.add(callback);
|
|
168
202
|
return () => setups.delete(callback);
|
|
169
203
|
};
|
|
170
204
|
const storeInit = () => {
|
|
171
|
-
|
|
205
|
+
var _a;
|
|
206
|
+
const initializedInstances = instances.size;
|
|
172
207
|
const instance = /* @__PURE__ */ Symbol();
|
|
173
208
|
instances.add(instance);
|
|
174
209
|
const maybeDestroy = () => {
|
|
@@ -176,75 +211,143 @@ function createStore(initialState, ...stores) {
|
|
|
176
211
|
if (instances.size) return;
|
|
177
212
|
destroy();
|
|
178
213
|
};
|
|
179
|
-
if (
|
|
180
|
-
const
|
|
181
|
-
|
|
214
|
+
if (initializedInstances) return maybeDestroy;
|
|
215
|
+
const stateKeys = _JBOLBTVUcjs.getKeys.call(void 0, state);
|
|
216
|
+
const desyncs = [];
|
|
217
|
+
for (const store of stores) {
|
|
182
218
|
const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
|
|
183
|
-
if (!storeState)
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
219
|
+
if (!storeState) continue;
|
|
220
|
+
const keys = stateKeys.filter((key) => _JBOLBTVUcjs.hasOwnProperty.call(void 0, storeState, key));
|
|
221
|
+
if (!keys.length) continue;
|
|
222
|
+
if (stores.length === 1 || keys.length === stateKeys.length) {
|
|
223
|
+
for (const key of keys) desyncs.push(sync(store, [key], (state2) => {
|
|
224
|
+
setState(key, state2[key], true);
|
|
225
|
+
}));
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
let didSyncInitialState = false;
|
|
229
|
+
desyncs.push(sync(store, keys, (state2, prevState) => {
|
|
230
|
+
for (const key of keys) {
|
|
231
|
+
if (didSyncInitialState && state2[key] === prevState[key]) continue;
|
|
232
|
+
setState(key, state2[key], true);
|
|
233
|
+
}
|
|
234
|
+
didSyncInitialState = true;
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
189
237
|
const teardowns = [];
|
|
190
238
|
for (const setup2 of setups) teardowns.push(setup2());
|
|
191
239
|
const cleanups = stores.map(init);
|
|
192
|
-
destroy =
|
|
240
|
+
destroy = _JBOLBTVUcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
|
|
193
241
|
return maybeDestroy;
|
|
194
242
|
};
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
243
|
+
const deleteListenerIndexes = (group, listener, keys) => {
|
|
244
|
+
var _a;
|
|
245
|
+
if (keys === void 0) return;
|
|
246
|
+
if (keys) deleteKeyedListener(group.listenersByKey, keys, listener);
|
|
247
|
+
else (_a = group.allKeysListeners) == null ? void 0 : _a.delete(listener);
|
|
248
|
+
};
|
|
249
|
+
const registerListener = (keys, listener, group = syncListenerGroup) => {
|
|
250
|
+
var _a, _b;
|
|
251
|
+
const listenerKeysValue = keys ? [...keys] : null;
|
|
252
|
+
if (group.listeners.has(listener)) deleteListenerIndexes(group, listener, group.listenerKeys.get(listener));
|
|
253
|
+
group.listeners.add(listener);
|
|
254
|
+
if (listenerKeysValue) {
|
|
255
|
+
(_a = group.listenersByKey) != null ? _a : group.listenersByKey = /* @__PURE__ */ new Map();
|
|
256
|
+
addKeyedListener(group.listenersByKey, listenerKeysValue, listener);
|
|
257
|
+
} else {
|
|
258
|
+
(_b = group.allKeysListeners) != null ? _b : group.allKeysListeners = /* @__PURE__ */ new Set();
|
|
259
|
+
group.allKeysListeners.add(listener);
|
|
260
|
+
}
|
|
261
|
+
group.listenerKeys.set(listener, listenerKeysValue);
|
|
198
262
|
return () => {
|
|
199
|
-
var
|
|
200
|
-
(
|
|
201
|
-
disposables.delete(listener);
|
|
202
|
-
listenerKeys.
|
|
203
|
-
|
|
263
|
+
var _a2;
|
|
264
|
+
(_a2 = group.disposables.get(listener)) == null ? void 0 : _a2();
|
|
265
|
+
group.disposables.delete(listener);
|
|
266
|
+
const currentKeys = group.listenerKeys.get(listener);
|
|
267
|
+
deleteListenerIndexes(group, listener, listenerKeysValue);
|
|
268
|
+
if (currentKeys !== listenerKeysValue) deleteListenerIndexes(group, listener, currentKeys);
|
|
269
|
+
group.listenerKeys.delete(listener);
|
|
270
|
+
group.listeners.delete(listener);
|
|
204
271
|
};
|
|
205
272
|
};
|
|
206
|
-
const storeSubscribe = (keys, listener) =>
|
|
273
|
+
const storeSubscribe = (keys, listener) => registerListener(keys, listener);
|
|
274
|
+
const reconcileInitialCleanup = (group, listener, cleanup) => {
|
|
275
|
+
if (cleanup) group.disposables.set(listener, cleanup);
|
|
276
|
+
else group.disposables.delete(listener);
|
|
277
|
+
};
|
|
207
278
|
const storeSync = (keys, listener) => {
|
|
208
|
-
|
|
209
|
-
return
|
|
279
|
+
reconcileInitialCleanup(syncListenerGroup, listener, listener(state, state));
|
|
280
|
+
return registerListener(keys, listener);
|
|
210
281
|
};
|
|
211
282
|
const storeBatch = (keys, listener) => {
|
|
212
|
-
|
|
213
|
-
|
|
283
|
+
if (!batchListenerGroup.listeners.size && !inDispatch) prevStateBatch = state;
|
|
284
|
+
reconcileInitialCleanup(batchListenerGroup, listener, listener(state, prevStateBatch));
|
|
285
|
+
return registerListener(keys, listener, batchListenerGroup);
|
|
214
286
|
};
|
|
215
|
-
const storePick = (keys) => createStore(
|
|
216
|
-
const storeOmit = (keys) => createStore(
|
|
287
|
+
const storePick = (keys) => createStore(_JBOLBTVUcjs.pick.call(void 0, state, keys), finalStore);
|
|
288
|
+
const storeOmit = (keys) => createStore(_JBOLBTVUcjs.omit.call(void 0, state, keys), finalStore);
|
|
217
289
|
const getState = () => state;
|
|
290
|
+
const runListeners = (group, prevState, updatedKey) => {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
const { disposables } = group;
|
|
293
|
+
if (!(updatedKey instanceof Set) && !((_a = group.allKeysListeners) == null ? void 0 : _a.size)) {
|
|
294
|
+
const keyedListeners = (_b = group.listenersByKey) == null ? void 0 : _b.get(updatedKey);
|
|
295
|
+
if (!keyedListeners) return;
|
|
296
|
+
for (const listener of keyedListeners) {
|
|
297
|
+
const cleanup = disposables.size ? disposables.get(listener) : void 0;
|
|
298
|
+
if (cleanup) cleanup();
|
|
299
|
+
const result = listener(state, prevState);
|
|
300
|
+
if (result) disposables.set(listener, result);
|
|
301
|
+
else if (cleanup) disposables.delete(listener);
|
|
302
|
+
}
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const allKeysListeners = group.allKeysListeners;
|
|
306
|
+
for (const listener of group.listeners) {
|
|
307
|
+
if (!(allKeysListeners == null ? void 0 : allKeysListeners.has(listener))) {
|
|
308
|
+
if (!hasUpdatedKey(group.listenerKeys.get(listener), updatedKey)) continue;
|
|
309
|
+
}
|
|
310
|
+
const cleanup = disposables.size ? disposables.get(listener) : void 0;
|
|
311
|
+
if (cleanup) cleanup();
|
|
312
|
+
const result = listener(state, prevState);
|
|
313
|
+
if (result) disposables.set(listener, result);
|
|
314
|
+
else if (cleanup) disposables.delete(listener);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
218
317
|
const setState = (key, value, fromStores = false) => {
|
|
219
318
|
var _a;
|
|
220
|
-
if (!
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
if (
|
|
319
|
+
if (!_JBOLBTVUcjs.hasOwnProperty.call(void 0, state, key)) return;
|
|
320
|
+
const currentValue = state[key];
|
|
321
|
+
const nextValue = typeof value === "function" ? value(currentValue) : value;
|
|
322
|
+
if (nextValue === currentValue) return;
|
|
323
|
+
if (!fromStores && stores.length) for (const store of stores) (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
|
|
224
324
|
const prevState = state;
|
|
225
325
|
state = {
|
|
226
326
|
...state,
|
|
227
327
|
[key]: nextValue
|
|
228
328
|
};
|
|
229
|
-
const
|
|
230
|
-
|
|
329
|
+
const wasInDispatch = inDispatch;
|
|
330
|
+
inDispatch = true;
|
|
331
|
+
try {
|
|
332
|
+
runListeners(syncListenerGroup, prevState, key);
|
|
333
|
+
} finally {
|
|
334
|
+
inDispatch = wasInDispatch;
|
|
335
|
+
}
|
|
336
|
+
if (!batchListenerGroup.listeners.size) {
|
|
337
|
+
if (!inDispatch) prevStateBatch = state;
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
231
340
|
updatedKeys.add(key);
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const keys = listenerKeys.get(listener);
|
|
235
|
-
const updated = (k) => uKeys ? uKeys.has(k) : k === key;
|
|
236
|
-
if (!keys || keys.some(updated)) {
|
|
237
|
-
(_a2 = disposables.get(listener)) == null ? void 0 : _a2();
|
|
238
|
-
disposables.set(listener, listener(state, prev));
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
for (const listener of listeners) run(listener, prevState);
|
|
341
|
+
if (batchPending) return;
|
|
342
|
+
batchPending = true;
|
|
242
343
|
queueMicrotask(() => {
|
|
243
|
-
|
|
344
|
+
batchPending = false;
|
|
244
345
|
const snapshot = state;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
346
|
+
const updatedKeysSnapshot = updatedKeys;
|
|
347
|
+
updatedKeys = /* @__PURE__ */ new Set();
|
|
348
|
+
const prevStateBatchBefore = prevStateBatch;
|
|
349
|
+
runListeners(batchListenerGroup, prevStateBatchBefore, updatedKeysSnapshot);
|
|
350
|
+
if (prevStateBatch === prevStateBatchBefore) prevStateBatch = snapshot;
|
|
248
351
|
});
|
|
249
352
|
};
|
|
250
353
|
const finalStore = {
|
|
@@ -301,6 +404,7 @@ function mergeStore(...stores) {
|
|
|
301
404
|
return Object.assign({}, ...stores, store);
|
|
302
405
|
}
|
|
303
406
|
function throwOnConflictingProps(props, store) {
|
|
407
|
+
if (process.env.NODE_ENV === "production") return;
|
|
304
408
|
if (!store) return;
|
|
305
409
|
const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
|
|
306
410
|
var _a;
|
|
@@ -309,7 +413,7 @@ function throwOnConflictingProps(props, store) {
|
|
|
309
413
|
});
|
|
310
414
|
if (!defaultKeys.length) return;
|
|
311
415
|
const storeState = store.getState();
|
|
312
|
-
if (!defaultKeys.filter((key) =>
|
|
416
|
+
if (!defaultKeys.filter((key) => _JBOLBTVUcjs.hasOwnProperty.call(void 0, storeState, key)).length) return;
|
|
313
417
|
throw new Error(`Passing a store prop in conjunction with a default state is not supported.
|
|
314
418
|
|
|
315
419
|
const store = useSelectStore();
|
|
@@ -328,11 +432,11 @@ If there's a particular need for this, please submit a feature request at https:
|
|
|
328
432
|
}
|
|
329
433
|
|
|
330
434
|
// ../ariakit-react-store/dist/index.js
|
|
331
|
-
var import_shim =
|
|
435
|
+
var import_shim = _JBOLBTVUcjs.__toESM.call(void 0, require_shim(), 1);
|
|
332
436
|
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
333
437
|
var noopSubscribe = () => () => {
|
|
334
438
|
};
|
|
335
|
-
function useStoreState(store, keyOrSelector =
|
|
439
|
+
function useStoreState(store, keyOrSelector = _JBOLBTVUcjs.identity) {
|
|
336
440
|
const storeSubscribe = React.useCallback((callback) => {
|
|
337
441
|
if (!store) return noopSubscribe();
|
|
338
442
|
return subscribe(store, null, callback);
|
|
@@ -344,7 +448,7 @@ function useStoreState(store, keyOrSelector = _QAUJZR6Ycjs.identity) {
|
|
|
344
448
|
if (selector) return selector(state);
|
|
345
449
|
if (!state) return;
|
|
346
450
|
if (!key) return;
|
|
347
|
-
if (!
|
|
451
|
+
if (!_JBOLBTVUcjs.hasOwnProperty.call(void 0, state, key)) return;
|
|
348
452
|
return state[key];
|
|
349
453
|
};
|
|
350
454
|
return (0, import_shim.useSyncExternalStore)(storeSubscribe, getSnapshot, getSnapshot);
|
|
@@ -370,7 +474,7 @@ function useStoreStateObject(store, object) {
|
|
|
370
474
|
}
|
|
371
475
|
if (typeof keyOrSelector === "string") {
|
|
372
476
|
if (!state) continue;
|
|
373
|
-
if (!
|
|
477
|
+
if (!_JBOLBTVUcjs.hasOwnProperty.call(void 0, state, keyOrSelector)) continue;
|
|
374
478
|
const value = state[keyOrSelector];
|
|
375
479
|
if (value !== obj[prop]) {
|
|
376
480
|
obj[prop] = value;
|
|
@@ -384,12 +488,12 @@ function useStoreStateObject(store, object) {
|
|
|
384
488
|
return (0, import_shim.useSyncExternalStore)(storeSubscribe, getSnapshot, getSnapshot);
|
|
385
489
|
}
|
|
386
490
|
function useStoreProps(store, props, key, setKey) {
|
|
387
|
-
const value =
|
|
388
|
-
const propsRef =
|
|
491
|
+
const value = _JBOLBTVUcjs.hasOwnProperty.call(void 0, props, key) ? props[key] : void 0;
|
|
492
|
+
const propsRef = _JBOLBTVUcjs.useLiveRef.call(void 0, {
|
|
389
493
|
value,
|
|
390
494
|
setValue: setKey ? props[setKey] : void 0
|
|
391
495
|
});
|
|
392
|
-
|
|
496
|
+
_JBOLBTVUcjs.useSafeLayoutEffect.call(void 0, () => {
|
|
393
497
|
return sync(store, [key], (state, prev) => {
|
|
394
498
|
const { value: value2, setValue } = propsRef.current;
|
|
395
499
|
if (!setValue) return;
|
|
@@ -398,7 +502,7 @@ function useStoreProps(store, props, key, setKey) {
|
|
|
398
502
|
setValue(state[key]);
|
|
399
503
|
});
|
|
400
504
|
}, [store, key]);
|
|
401
|
-
|
|
505
|
+
_JBOLBTVUcjs.useSafeLayoutEffect.call(void 0, () => {
|
|
402
506
|
if (value === void 0) return;
|
|
403
507
|
store.setState(key, value);
|
|
404
508
|
return batch(store, [key], () => {
|
|
@@ -409,12 +513,12 @@ function useStoreProps(store, props, key, setKey) {
|
|
|
409
513
|
}
|
|
410
514
|
function useStore(createStore2, props) {
|
|
411
515
|
const [store, setStore] = React.useState(() => createStore2(props));
|
|
412
|
-
|
|
516
|
+
_JBOLBTVUcjs.useSafeLayoutEffect.call(void 0, () => init(store), [store]);
|
|
413
517
|
const useState2 = React.useCallback((keyOrSelector) => useStoreState(store, keyOrSelector), [store]);
|
|
414
518
|
return [React.useMemo(() => ({
|
|
415
519
|
...store,
|
|
416
520
|
useState: useState2
|
|
417
|
-
}), [store, useState2]),
|
|
521
|
+
}), [store, useState2]), _JBOLBTVUcjs.useEvent.call(void 0, () => {
|
|
418
522
|
setStore((store2) => createStore2({
|
|
419
523
|
...props,
|
|
420
524
|
...store2.getState()
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _KDVG735Hcjs = require('./KDVG735H.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _2WBRQ3I7cjs = require('./2WBRQ3I7.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _JBOLBTVUcjs = require('./JBOLBTVU.cjs');
|
|
12
12
|
|
|
13
13
|
// ../ariakit-react-components/dist/combobox/combobox-context.js
|
|
14
14
|
var _react = require('react');
|
|
15
15
|
var ComboboxListRoleContext = _react.createContext.call(void 0, void 0);
|
|
16
|
-
var ctx =
|
|
16
|
+
var ctx = _JBOLBTVUcjs.createStoreContext.call(void 0, [_KDVG735Hcjs.PopoverContextProvider, _2WBRQ3I7cjs.CompositeContextProvider], [_KDVG735Hcjs.PopoverScopedContextProvider, _2WBRQ3I7cjs.CompositeScopedContextProvider]);
|
|
17
17
|
var useComboboxContext = ctx.useContext;
|
|
18
18
|
var useComboboxScopedContext = ctx.useScopedContext;
|
|
19
19
|
var useComboboxProviderContext = ctx.useProviderContext;
|