@wix/site-ui 1.185.0 → 1.187.0
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/dist/1763.js +836 -0
- package/dist/2205.js +26 -0
- package/dist/2445.js +470 -0
- package/dist/285.js +1 -1
- package/dist/3485.js +4 -3
- package/dist/4863.js +61 -0
- package/dist/{4388.js → 487.js} +5 -57
- package/dist/5992.js +5 -471
- package/dist/6046.js +2 -26
- package/dist/6089.js +6 -3
- package/dist/6270.js +5 -3
- package/dist/6535.js +2 -1
- package/dist/6588.js +2 -1
- package/dist/6882.js +8 -4
- package/dist/6917.js +55 -0
- package/dist/7871.js +1 -1
- package/dist/8052.js +2 -1
- package/dist/8106.js +3 -2
- package/dist/8171.js +1 -1
- package/dist/8750.js +3 -2
- package/dist/8960.js +1 -1
- package/dist/904.js +1 -1
- package/dist/9352.js +2 -2
- package/dist/{880.js → 9369.js} +2 -60
- package/dist/Accordion/index.js +1 -1
- package/dist/Avatar/index.js +2 -1
- package/dist/Checkbox/index.js +2 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/Combobox/index.js +3 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/Drawer/index.js +10 -836
- package/dist/Field/index.js +2 -1
- package/dist/Menu/index.js +3 -2
- package/dist/NavigationMenu/index.js +6 -3
- package/dist/Popover/index.js +5 -3
- package/dist/PreviewCard/index.js +5 -3
- package/dist/Radio/index.js +2 -1
- package/dist/Select/index.js +6 -3
- package/dist/Tabs/index.js +2 -1
- package/dist/Toast/index.css +111 -0
- package/dist/Toast/index.d.ts +846 -0
- package/dist/Toast/index.js +1204 -0
- package/dist/Tooltip/index.js +5 -3
- package/dist/index.d.ts +501 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
- /package/dist/{5992.js.LICENSE.txt → 2445.js.LICENSE.txt} +0 -0
package/dist/5992.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
|
-
import "./4586.js";
|
|
4
|
-
import { NOOP, useRefWithInit, isReactVersionAtLeast, esm_formatErrorMessage } from "./8272.js";
|
|
5
|
-
import { useIsoLayoutEffect } from "./6499.js";
|
|
6
|
-
import { useStableCallback } from "./7541.js";
|
|
1
|
+
import { ReactStore, createAttribute, createSelector } from "./2445.js";
|
|
7
2
|
import { createEventEmitter, useFloatingTree } from "./285.js";
|
|
8
3
|
import { isReactEvent, isClickLikeEvent } from "./6330.js";
|
|
4
|
+
import { useStableCallback } from "./7541.js";
|
|
9
5
|
import { Timeout, useTimeout } from "./42.js";
|
|
10
6
|
import { isEventTargetWithin, isRootElement } from "./8758.js";
|
|
11
7
|
import { createChangeEventDetails } from "./4768.js";
|
|
@@ -16,154 +12,6 @@ import { ownerDocument } from "./9829.js";
|
|
|
16
12
|
import { addEventListener } from "./4723.js";
|
|
17
13
|
import { mergeCleanups } from "./4495.js";
|
|
18
14
|
import * as __rspack_external_react from "react";
|
|
19
|
-
__webpack_require__.add({
|
|
20
|
-
"../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
21
|
-
/**
|
|
22
|
-
* @license React
|
|
23
|
-
* use-sync-external-store-with-selector.development.js
|
|
24
|
-
*
|
|
25
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
26
|
-
*
|
|
27
|
-
* This source code is licensed under the MIT license found in the
|
|
28
|
-
* LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/ "production" !== process.env.NODE_ENV && function() {
|
|
30
|
-
function is(x, y) {
|
|
31
|
-
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
32
|
-
}
|
|
33
|
-
"u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
34
|
-
var React = __webpack_require__("react?1096"), objectIs = "function" == typeof Object.is ? Object.is : is, useSyncExternalStore = React.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
|
|
35
|
-
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
36
|
-
var instRef = useRef(null);
|
|
37
|
-
if (null === instRef.current) {
|
|
38
|
-
var inst = {
|
|
39
|
-
hasValue: !1,
|
|
40
|
-
value: null
|
|
41
|
-
};
|
|
42
|
-
instRef.current = inst;
|
|
43
|
-
} else inst = instRef.current;
|
|
44
|
-
instRef = useMemo(function() {
|
|
45
|
-
function memoizedSelector(nextSnapshot) {
|
|
46
|
-
if (!hasMemo) {
|
|
47
|
-
hasMemo = !0;
|
|
48
|
-
memoizedSnapshot = nextSnapshot;
|
|
49
|
-
nextSnapshot = selector(nextSnapshot);
|
|
50
|
-
if (void 0 !== isEqual && inst.hasValue) {
|
|
51
|
-
var currentSelection = inst.value;
|
|
52
|
-
if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
|
|
53
|
-
}
|
|
54
|
-
return memoizedSelection = nextSnapshot;
|
|
55
|
-
}
|
|
56
|
-
currentSelection = memoizedSelection;
|
|
57
|
-
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
58
|
-
var nextSelection = selector(nextSnapshot);
|
|
59
|
-
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
60
|
-
memoizedSnapshot = nextSnapshot;
|
|
61
|
-
return memoizedSelection = nextSelection;
|
|
62
|
-
}
|
|
63
|
-
var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
64
|
-
return [
|
|
65
|
-
function() {
|
|
66
|
-
return memoizedSelector(getSnapshot());
|
|
67
|
-
},
|
|
68
|
-
null === maybeGetServerSnapshot ? void 0 : function() {
|
|
69
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
70
|
-
}
|
|
71
|
-
];
|
|
72
|
-
}, [
|
|
73
|
-
getSnapshot,
|
|
74
|
-
getServerSnapshot,
|
|
75
|
-
selector,
|
|
76
|
-
isEqual
|
|
77
|
-
]);
|
|
78
|
-
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
79
|
-
useEffect(function() {
|
|
80
|
-
inst.hasValue = !0;
|
|
81
|
-
inst.value = value;
|
|
82
|
-
}, [
|
|
83
|
-
value
|
|
84
|
-
]);
|
|
85
|
-
useDebugValue(value);
|
|
86
|
-
return value;
|
|
87
|
-
};
|
|
88
|
-
"u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
89
|
-
}();
|
|
90
|
-
},
|
|
91
|
-
"../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
92
|
-
/**
|
|
93
|
-
* @license React
|
|
94
|
-
* use-sync-external-store-with-selector.production.js
|
|
95
|
-
*
|
|
96
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the MIT license found in the
|
|
99
|
-
* LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/ var React = __webpack_require__("react?1096");
|
|
101
|
-
function is(x, y) {
|
|
102
|
-
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
103
|
-
}
|
|
104
|
-
var objectIs = "function" == typeof Object.is ? Object.is : is, useSyncExternalStore = React.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
|
|
105
|
-
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
106
|
-
var instRef = useRef(null);
|
|
107
|
-
if (null === instRef.current) {
|
|
108
|
-
var inst = {
|
|
109
|
-
hasValue: !1,
|
|
110
|
-
value: null
|
|
111
|
-
};
|
|
112
|
-
instRef.current = inst;
|
|
113
|
-
} else inst = instRef.current;
|
|
114
|
-
instRef = useMemo(function() {
|
|
115
|
-
function memoizedSelector(nextSnapshot) {
|
|
116
|
-
if (!hasMemo) {
|
|
117
|
-
hasMemo = !0;
|
|
118
|
-
memoizedSnapshot = nextSnapshot;
|
|
119
|
-
nextSnapshot = selector(nextSnapshot);
|
|
120
|
-
if (void 0 !== isEqual && inst.hasValue) {
|
|
121
|
-
var currentSelection = inst.value;
|
|
122
|
-
if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
|
|
123
|
-
}
|
|
124
|
-
return memoizedSelection = nextSnapshot;
|
|
125
|
-
}
|
|
126
|
-
currentSelection = memoizedSelection;
|
|
127
|
-
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
128
|
-
var nextSelection = selector(nextSnapshot);
|
|
129
|
-
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
130
|
-
memoizedSnapshot = nextSnapshot;
|
|
131
|
-
return memoizedSelection = nextSelection;
|
|
132
|
-
}
|
|
133
|
-
var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
134
|
-
return [
|
|
135
|
-
function() {
|
|
136
|
-
return memoizedSelector(getSnapshot());
|
|
137
|
-
},
|
|
138
|
-
null === maybeGetServerSnapshot ? void 0 : function() {
|
|
139
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
140
|
-
}
|
|
141
|
-
];
|
|
142
|
-
}, [
|
|
143
|
-
getSnapshot,
|
|
144
|
-
getServerSnapshot,
|
|
145
|
-
selector,
|
|
146
|
-
isEqual
|
|
147
|
-
]);
|
|
148
|
-
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
149
|
-
useEffect(function() {
|
|
150
|
-
inst.hasValue = !0;
|
|
151
|
-
inst.value = value;
|
|
152
|
-
}, [
|
|
153
|
-
value
|
|
154
|
-
]);
|
|
155
|
-
useDebugValue(value);
|
|
156
|
-
return value;
|
|
157
|
-
};
|
|
158
|
-
},
|
|
159
|
-
"../../node_modules/use-sync-external-store/with-selector.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
160
|
-
if ('production' === process.env.NODE_ENV) module.exports = __webpack_require__("../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js");
|
|
161
|
-
else module.exports = __webpack_require__("../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js");
|
|
162
|
-
},
|
|
163
|
-
"react?1096" (module) {
|
|
164
|
-
module.exports = __rspack_external_react;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
15
|
function getNodeChildren(nodes, id, onlyOpenChildren = true) {
|
|
168
16
|
const directChildren = nodes.filter((node)=>node.parentId === id);
|
|
169
17
|
return directChildren.flatMap((child)=>[
|
|
@@ -183,321 +31,7 @@ function getNodeAncestors(nodes, id) {
|
|
|
183
31
|
}
|
|
184
32
|
return allAncestors;
|
|
185
33
|
}
|
|
186
|
-
|
|
187
|
-
return `data-base-ui-${name}`;
|
|
188
|
-
}
|
|
189
|
-
const createSelector = (a, b, c, d, e, f, ...other)=>{
|
|
190
|
-
if (other.length > 0) throw new Error("production" !== process.env.NODE_ENV ? 'Unsupported number of selectors' : esm_formatErrorMessage(1));
|
|
191
|
-
let selector;
|
|
192
|
-
if (a && b && c && d && e && f) selector = (state, a1, a2, a3)=>{
|
|
193
|
-
const va = a(state, a1, a2, a3);
|
|
194
|
-
const vb = b(state, a1, a2, a3);
|
|
195
|
-
const vc = c(state, a1, a2, a3);
|
|
196
|
-
const vd = d(state, a1, a2, a3);
|
|
197
|
-
const ve = e(state, a1, a2, a3);
|
|
198
|
-
return f(va, vb, vc, vd, ve, a1, a2, a3);
|
|
199
|
-
};
|
|
200
|
-
else if (a && b && c && d && e) selector = (state, a1, a2, a3)=>{
|
|
201
|
-
const va = a(state, a1, a2, a3);
|
|
202
|
-
const vb = b(state, a1, a2, a3);
|
|
203
|
-
const vc = c(state, a1, a2, a3);
|
|
204
|
-
const vd = d(state, a1, a2, a3);
|
|
205
|
-
return e(va, vb, vc, vd, a1, a2, a3);
|
|
206
|
-
};
|
|
207
|
-
else if (a && b && c && d) selector = (state, a1, a2, a3)=>{
|
|
208
|
-
const va = a(state, a1, a2, a3);
|
|
209
|
-
const vb = b(state, a1, a2, a3);
|
|
210
|
-
const vc = c(state, a1, a2, a3);
|
|
211
|
-
return d(va, vb, vc, a1, a2, a3);
|
|
212
|
-
};
|
|
213
|
-
else if (a && b && c) selector = (state, a1, a2, a3)=>{
|
|
214
|
-
const va = a(state, a1, a2, a3);
|
|
215
|
-
const vb = b(state, a1, a2, a3);
|
|
216
|
-
return c(va, vb, a1, a2, a3);
|
|
217
|
-
};
|
|
218
|
-
else if (a && b) selector = (state, a1, a2, a3)=>{
|
|
219
|
-
const va = a(state, a1, a2, a3);
|
|
220
|
-
return b(va, a1, a2, a3);
|
|
221
|
-
};
|
|
222
|
-
else if (a) selector = a;
|
|
223
|
-
else throw new Error('Missing arguments');
|
|
224
|
-
return selector;
|
|
225
|
-
};
|
|
226
|
-
const hooks = [];
|
|
227
|
-
let currentInstance;
|
|
228
|
-
function getInstance() {
|
|
229
|
-
return currentInstance;
|
|
230
|
-
}
|
|
231
|
-
function register(hook) {
|
|
232
|
-
hooks.push(hook);
|
|
233
|
-
}
|
|
234
|
-
function fastComponent(fn) {
|
|
235
|
-
const FastComponent = (props, forwardedRef)=>{
|
|
236
|
-
const instance = useRefWithInit(createInstance).current;
|
|
237
|
-
let result;
|
|
238
|
-
try {
|
|
239
|
-
currentInstance = instance;
|
|
240
|
-
for (const hook of hooks)hook.before(instance);
|
|
241
|
-
result = fn(props, forwardedRef);
|
|
242
|
-
for (const hook of hooks)hook.after(instance);
|
|
243
|
-
instance.didInitialize = true;
|
|
244
|
-
} finally{
|
|
245
|
-
currentInstance = void 0;
|
|
246
|
-
}
|
|
247
|
-
return result;
|
|
248
|
-
};
|
|
249
|
-
FastComponent.displayName = fn.displayName || fn.name;
|
|
250
|
-
return FastComponent;
|
|
251
|
-
}
|
|
252
|
-
function fastComponentRef(fn) {
|
|
253
|
-
return /*#__PURE__*/ __rspack_external_react.forwardRef(fastComponent(fn));
|
|
254
|
-
}
|
|
255
|
-
function createInstance() {
|
|
256
|
-
return {
|
|
257
|
-
didInitialize: false
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
const use_sync_external_store = __webpack_require__("../../node_modules/use-sync-external-store/index.js");
|
|
261
|
-
const with_selector = __webpack_require__("../../node_modules/use-sync-external-store/with-selector.js");
|
|
262
|
-
const canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);
|
|
263
|
-
const useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;
|
|
264
|
-
function useStore(store, selector, a1, a2, a3) {
|
|
265
|
-
return useStoreImplementation(store, selector, a1, a2, a3);
|
|
266
|
-
}
|
|
267
|
-
function useStoreR19(store, selector, a1, a2, a3) {
|
|
268
|
-
const getSelection = __rspack_external_react.useCallback(()=>selector(store.getSnapshot(), a1, a2, a3), [
|
|
269
|
-
store,
|
|
270
|
-
selector,
|
|
271
|
-
a1,
|
|
272
|
-
a2,
|
|
273
|
-
a3
|
|
274
|
-
]);
|
|
275
|
-
return (0, use_sync_external_store.useSyncExternalStore)(store.subscribe, getSelection, getSelection);
|
|
276
|
-
}
|
|
277
|
-
register({
|
|
278
|
-
before (instance) {
|
|
279
|
-
instance.syncIndex = 0;
|
|
280
|
-
if (!instance.didInitialize) {
|
|
281
|
-
instance.syncTick = 1;
|
|
282
|
-
instance.syncHooks = [];
|
|
283
|
-
instance.didChangeStore = true;
|
|
284
|
-
instance.getSnapshot = ()=>{
|
|
285
|
-
let didChange = false;
|
|
286
|
-
for(let i = 0; i < instance.syncHooks.length; i += 1){
|
|
287
|
-
const hook = instance.syncHooks[i];
|
|
288
|
-
const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
|
|
289
|
-
if (hook.didChange || !Object.is(hook.value, value)) {
|
|
290
|
-
didChange = true;
|
|
291
|
-
hook.value = value;
|
|
292
|
-
hook.didChange = false;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
if (didChange) instance.syncTick += 1;
|
|
296
|
-
return instance.syncTick;
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
after (instance) {
|
|
301
|
-
if (instance.syncHooks.length > 0) {
|
|
302
|
-
if (instance.didChangeStore) {
|
|
303
|
-
instance.didChangeStore = false;
|
|
304
|
-
instance.subscribe = (onStoreChange)=>{
|
|
305
|
-
const stores = new Set();
|
|
306
|
-
for (const hook of instance.syncHooks)stores.add(hook.store);
|
|
307
|
-
const unsubscribes = [];
|
|
308
|
-
for (const store of stores)unsubscribes.push(store.subscribe(onStoreChange));
|
|
309
|
-
return ()=>{
|
|
310
|
-
for (const unsubscribe of unsubscribes)unsubscribe();
|
|
311
|
-
};
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
(0, use_sync_external_store.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
function useStoreFast(store, selector, a1, a2, a3) {
|
|
319
|
-
const instance = getInstance();
|
|
320
|
-
if (!instance) return useStoreR19(store, selector, a1, a2, a3);
|
|
321
|
-
const index = instance.syncIndex;
|
|
322
|
-
instance.syncIndex += 1;
|
|
323
|
-
let hook;
|
|
324
|
-
if (instance.didInitialize) {
|
|
325
|
-
hook = instance.syncHooks[index];
|
|
326
|
-
if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {
|
|
327
|
-
if (hook.store !== store) instance.didChangeStore = true;
|
|
328
|
-
hook.store = store;
|
|
329
|
-
hook.selector = selector;
|
|
330
|
-
hook.a1 = a1;
|
|
331
|
-
hook.a2 = a2;
|
|
332
|
-
hook.a3 = a3;
|
|
333
|
-
hook.didChange = true;
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
hook = {
|
|
337
|
-
store,
|
|
338
|
-
selector,
|
|
339
|
-
a1,
|
|
340
|
-
a2,
|
|
341
|
-
a3,
|
|
342
|
-
value: selector(store.getSnapshot(), a1, a2, a3),
|
|
343
|
-
didChange: false
|
|
344
|
-
};
|
|
345
|
-
instance.syncHooks.push(hook);
|
|
346
|
-
}
|
|
347
|
-
return hook.value;
|
|
348
|
-
}
|
|
349
|
-
function useStoreLegacy(store, selector, a1, a2, a3) {
|
|
350
|
-
return (0, with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state)=>selector(state, a1, a2, a3));
|
|
351
|
-
}
|
|
352
|
-
class Store {
|
|
353
|
-
constructor(state){
|
|
354
|
-
this.state = state;
|
|
355
|
-
this.listeners = new Set();
|
|
356
|
-
this.updateTick = 0;
|
|
357
|
-
}
|
|
358
|
-
subscribe = (fn)=>{
|
|
359
|
-
this.listeners.add(fn);
|
|
360
|
-
return ()=>{
|
|
361
|
-
this.listeners.delete(fn);
|
|
362
|
-
};
|
|
363
|
-
};
|
|
364
|
-
getSnapshot = ()=>this.state;
|
|
365
|
-
setState(newState) {
|
|
366
|
-
if (this.state === newState) return;
|
|
367
|
-
this.state = newState;
|
|
368
|
-
this.updateTick += 1;
|
|
369
|
-
const currentTick = this.updateTick;
|
|
370
|
-
for (const listener of this.listeners){
|
|
371
|
-
if (currentTick !== this.updateTick) return;
|
|
372
|
-
listener(newState);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
update(changes) {
|
|
376
|
-
for(const key in changes)if (!Object.is(this.state[key], changes[key])) return void this.setState({
|
|
377
|
-
...this.state,
|
|
378
|
-
...changes
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
set(key, value) {
|
|
382
|
-
if (!Object.is(this.state[key], value)) this.setState({
|
|
383
|
-
...this.state,
|
|
384
|
-
[key]: value
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
notifyAll() {
|
|
388
|
-
const newState = {
|
|
389
|
-
...this.state
|
|
390
|
-
};
|
|
391
|
-
this.setState(newState);
|
|
392
|
-
}
|
|
393
|
-
use(selector, a1, a2, a3) {
|
|
394
|
-
return useStore(this, selector, a1, a2, a3);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
class ReactStore extends Store {
|
|
398
|
-
constructor(state, context = {}, selectors){
|
|
399
|
-
super(state);
|
|
400
|
-
this.context = context;
|
|
401
|
-
this.selectors = selectors;
|
|
402
|
-
}
|
|
403
|
-
useSyncedValue(key, value) {
|
|
404
|
-
__rspack_external_react.useDebugValue(key);
|
|
405
|
-
const store = this;
|
|
406
|
-
useIsoLayoutEffect(()=>{
|
|
407
|
-
if (store.state[key] !== value) store.set(key, value);
|
|
408
|
-
}, [
|
|
409
|
-
store,
|
|
410
|
-
key,
|
|
411
|
-
value
|
|
412
|
-
]);
|
|
413
|
-
}
|
|
414
|
-
useSyncedValueWithCleanup(key, value) {
|
|
415
|
-
const store = this;
|
|
416
|
-
useIsoLayoutEffect(()=>{
|
|
417
|
-
if (store.state[key] !== value) store.set(key, value);
|
|
418
|
-
return ()=>{
|
|
419
|
-
store.set(key, void 0);
|
|
420
|
-
};
|
|
421
|
-
}, [
|
|
422
|
-
store,
|
|
423
|
-
key,
|
|
424
|
-
value
|
|
425
|
-
]);
|
|
426
|
-
}
|
|
427
|
-
useSyncedValues(statePart) {
|
|
428
|
-
const store = this;
|
|
429
|
-
if ('production' !== process.env.NODE_ENV) {
|
|
430
|
-
__rspack_external_react.useDebugValue(statePart, (p)=>Object.keys(p));
|
|
431
|
-
const keys = __rspack_external_react.useRef(Object.keys(statePart)).current;
|
|
432
|
-
const nextKeys = Object.keys(statePart);
|
|
433
|
-
if (keys.length !== nextKeys.length || keys.some((key, index)=>key !== nextKeys[index])) console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');
|
|
434
|
-
}
|
|
435
|
-
const dependencies = Object.values(statePart);
|
|
436
|
-
useIsoLayoutEffect(()=>{
|
|
437
|
-
store.update(statePart);
|
|
438
|
-
}, [
|
|
439
|
-
store,
|
|
440
|
-
...dependencies
|
|
441
|
-
]);
|
|
442
|
-
}
|
|
443
|
-
useControlledProp(key, controlled) {
|
|
444
|
-
__rspack_external_react.useDebugValue(key);
|
|
445
|
-
const store = this;
|
|
446
|
-
const isControlled = void 0 !== controlled;
|
|
447
|
-
useIsoLayoutEffect(()=>{
|
|
448
|
-
if (isControlled && !Object.is(store.state[key], controlled)) store.setState({
|
|
449
|
-
...store.state,
|
|
450
|
-
[key]: controlled
|
|
451
|
-
});
|
|
452
|
-
}, [
|
|
453
|
-
store,
|
|
454
|
-
key,
|
|
455
|
-
controlled,
|
|
456
|
-
isControlled
|
|
457
|
-
]);
|
|
458
|
-
if ('production' !== process.env.NODE_ENV) {
|
|
459
|
-
const cache = this.controlledValues ??= new Map();
|
|
460
|
-
if (!cache.has(key)) cache.set(key, isControlled);
|
|
461
|
-
const previouslyControlled = cache.get(key);
|
|
462
|
-
if (void 0 !== previouslyControlled && previouslyControlled !== isControlled) console.error(`A component is changing the ${isControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${isControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
select(key, a1, a2, a3) {
|
|
466
|
-
const selector = this.selectors[key];
|
|
467
|
-
return selector(this.state, a1, a2, a3);
|
|
468
|
-
}
|
|
469
|
-
useState(key, a1, a2, a3) {
|
|
470
|
-
__rspack_external_react.useDebugValue(key);
|
|
471
|
-
return useStore(this, this.selectors[key], a1, a2, a3);
|
|
472
|
-
}
|
|
473
|
-
useContextCallback(key, fn) {
|
|
474
|
-
__rspack_external_react.useDebugValue(key);
|
|
475
|
-
const stableFunction = useStableCallback(fn ?? NOOP);
|
|
476
|
-
this.context[key] = stableFunction;
|
|
477
|
-
}
|
|
478
|
-
useStateSetter(key) {
|
|
479
|
-
const ref = __rspack_external_react.useRef(void 0);
|
|
480
|
-
if (void 0 === ref.current) ref.current = (value)=>{
|
|
481
|
-
this.set(key, value);
|
|
482
|
-
};
|
|
483
|
-
return ref.current;
|
|
484
|
-
}
|
|
485
|
-
observe(selector, listener) {
|
|
486
|
-
let selectFn;
|
|
487
|
-
selectFn = 'function' == typeof selector ? selector : this.selectors[selector];
|
|
488
|
-
let prevValue = selectFn(this.state);
|
|
489
|
-
listener(prevValue, prevValue, this);
|
|
490
|
-
return this.subscribe((nextState)=>{
|
|
491
|
-
const nextValue = selectFn(nextState);
|
|
492
|
-
if (!Object.is(prevValue, nextValue)) {
|
|
493
|
-
const oldValue = prevValue;
|
|
494
|
-
prevValue = nextValue;
|
|
495
|
-
listener(nextValue, oldValue, this);
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
const FloatingRootStore_selectors = {
|
|
34
|
+
const selectors = {
|
|
501
35
|
open: createSelector((state)=>state.open),
|
|
502
36
|
transitionStatus: createSelector((state)=>state.transitionStatus),
|
|
503
37
|
domReferenceElement: createSelector((state)=>state.domReferenceElement),
|
|
@@ -520,7 +54,7 @@ class FloatingRootStore extends ReactStore {
|
|
|
520
54
|
events: createEventEmitter(),
|
|
521
55
|
nested,
|
|
522
56
|
triggerElements
|
|
523
|
-
},
|
|
57
|
+
}, selectors);
|
|
524
58
|
this.syncOnly = syncOnly;
|
|
525
59
|
}
|
|
526
60
|
syncOpenEvent = (newOpen, event)=>{
|
|
@@ -910,4 +444,4 @@ class PopupTriggerMap {
|
|
|
910
444
|
return this.idMap.size;
|
|
911
445
|
}
|
|
912
446
|
}
|
|
913
|
-
export { FloatingRootStore, PopupTriggerMap,
|
|
447
|
+
export { FloatingRootStore, PopupTriggerMap, getNodeAncestors, getNodeChildren, useDismiss };
|
package/dist/6046.js
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as __rspack_external_react from "react";
|
|
3
|
-
let globalId = 0;
|
|
4
|
-
function useGlobalId(idOverride, prefix = 'mui') {
|
|
5
|
-
const [defaultId, setDefaultId] = __rspack_external_react.useState(idOverride);
|
|
6
|
-
const id = idOverride || defaultId;
|
|
7
|
-
__rspack_external_react.useEffect(()=>{
|
|
8
|
-
if (null == defaultId) {
|
|
9
|
-
globalId += 1;
|
|
10
|
-
setDefaultId(`${prefix}-${globalId}`);
|
|
11
|
-
}
|
|
12
|
-
}, [
|
|
13
|
-
defaultId,
|
|
14
|
-
prefix
|
|
15
|
-
]);
|
|
16
|
-
return id;
|
|
17
|
-
}
|
|
18
|
-
const maybeReactUseId = SafeReact.useId;
|
|
19
|
-
function useId(idOverride, prefix) {
|
|
20
|
-
if (void 0 !== maybeReactUseId) {
|
|
21
|
-
const reactId = maybeReactUseId();
|
|
22
|
-
return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
|
|
23
|
-
}
|
|
24
|
-
return useGlobalId(idOverride, prefix);
|
|
25
|
-
}
|
|
1
|
+
import { useId } from "./2205.js";
|
|
26
2
|
function useBaseUiId(idOverride) {
|
|
27
3
|
return useId(idOverride, 'base-ui');
|
|
28
4
|
}
|
|
29
|
-
export { useBaseUiId
|
|
5
|
+
export { useBaseUiId };
|
package/dist/6089.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { esm_formatErrorMessage, EMPTY_OBJECT, EMPTY_ARRAY, useMergedRefs, useRefWithInit, mergeProps, useRenderElement, NOOP } from "./8272.js";
|
|
3
|
-
import { Store,
|
|
3
|
+
import { Store, useStore, createSelector } from "./2445.js";
|
|
4
4
|
import { defaultItemEquality, findItemIndex, stringifyAsLabel, hasNullItemLabel, stringifyAsValue, compareItemEquality, isGroupedItems, selectedValueIncludes, removeItem } from "./7366.js";
|
|
5
|
-
import {
|
|
5
|
+
import { triggerOpenStateMapping, popupStateMapping, pressableTriggerOpenStateMapping } from "./6917.js";
|
|
6
6
|
import { FieldRootContext, DEFAULT_FIELD_STATE_ATTRIBUTES, DEFAULT_FIELD_ROOT_CONTEXT, useLabelableContext, fieldValidityMapping, useFieldRootContext } from "./1477.js";
|
|
7
7
|
import { getTarget, contains as shadowDom_contains } from "./4549.js";
|
|
8
8
|
import { isElement } from "./3829.js";
|
|
@@ -19,9 +19,11 @@ import { useBaseUiId } from "./6046.js";
|
|
|
19
19
|
import { resolveAriaLabelledBy } from "./6825.js";
|
|
20
20
|
import { isAndroid, isFirefox, isIOS } from "./8971.js";
|
|
21
21
|
import { stopEvent } from "./6330.js";
|
|
22
|
-
import { transitionStatusMapping, useOpenChangeComplete
|
|
22
|
+
import { transitionStatusMapping, useOpenChangeComplete } from "./9369.js";
|
|
23
|
+
import { useTransitionStatus } from "./4863.js";
|
|
23
24
|
import { CompositeList } from "./9255.js";
|
|
24
25
|
import { useTimeout } from "./42.js";
|
|
26
|
+
import { FloatingPortal_FloatingPortal, DROPDOWN_COLLISION_AVOIDANCE } from "./487.js";
|
|
25
27
|
import { usePositioner, useFloatingRootContext, useAnchorPositioning, getDisabledMountTransitionStyles } from "./8750.js";
|
|
26
28
|
import { useAnchoredPopupScrollLock } from "./6247.js";
|
|
27
29
|
import { useOpenInteractionType, FloatingFocusManager, InternalBackdrop_InternalBackdrop } from "./3485.js";
|
|
@@ -36,6 +38,7 @@ import { useControlled } from "./8527.js";
|
|
|
36
38
|
import { useValueAsRef } from "./4707.js";
|
|
37
39
|
import { useRegisterFieldControl } from "./4281.js";
|
|
38
40
|
import { useValueChanged } from "./2801.js";
|
|
41
|
+
import { useDismiss } from "./5992.js";
|
|
39
42
|
import { FOCUSABLE_POPUP_PROPS, useOnFirstRender } from "./8106.js";
|
|
40
43
|
import * as __rspack_external_react from "react";
|
|
41
44
|
import * as __rspack_external_react_dom_7136dc57 from "react-dom";
|
package/dist/6270.js
CHANGED
|
@@ -4,14 +4,16 @@ import { useButton } from "./9189.js";
|
|
|
4
4
|
import { createChangeEventDetails } from "./4768.js";
|
|
5
5
|
import { closePress, imperativeAction } from "./2418.js";
|
|
6
6
|
import { useBaseUiId } from "./6046.js";
|
|
7
|
-
import {
|
|
8
|
-
import { transitionStatusMapping } from "./
|
|
7
|
+
import { popupStateMapping_CommonPopupDataAttributes, popupStateMapping, triggerOpenStateMapping } from "./6917.js";
|
|
8
|
+
import { transitionStatusMapping } from "./9369.js";
|
|
9
9
|
import { useTriggerDataForwarding, usePopupInteractionProps, usePopupRootSync, setOpenTriggerState, usePopupStore, useImplicitActiveTrigger, useOnFirstRender, useOpenStateTransitions, FOCUSABLE_POPUP_PROPS } from "./8106.js";
|
|
10
10
|
import { useClick } from "./5864.js";
|
|
11
11
|
import { InternalBackdrop_InternalBackdrop, useOpenMethodTriggerProps, useScrollLock } from "./3485.js";
|
|
12
|
-
import {
|
|
12
|
+
import { FloatingPortal_FloatingPortal, CLICK_TRIGGER_IDENTIFIER } from "./487.js";
|
|
13
|
+
import { PopupTriggerMap, useDismiss } from "./5992.js";
|
|
13
14
|
import { getTarget, contains } from "./4549.js";
|
|
14
15
|
import { createPopupFloatingRootContext, popupStoreSelectors, createInitialPopupStoreState } from "./6535.js";
|
|
16
|
+
import { ReactStore, createSelector } from "./2445.js";
|
|
15
17
|
import { inertValue } from "./167.js";
|
|
16
18
|
import * as __rspack_external_react from "react";
|
|
17
19
|
const IsDrawerContext = /*#__PURE__*/ __rspack_external_react.createContext(false);
|
package/dist/6535.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getEmptyRootContext } from "./4922.js";
|
|
2
2
|
import { EMPTY_OBJECT } from "./8272.js";
|
|
3
|
-
import {
|
|
3
|
+
import { FloatingRootStore } from "./5992.js";
|
|
4
|
+
import { createSelector } from "./2445.js";
|
|
4
5
|
function createInitialPopupStoreState() {
|
|
5
6
|
return {
|
|
6
7
|
open: false,
|
package/dist/6588.js
CHANGED
|
@@ -12,10 +12,11 @@ import { focusOut, outsidePress, triggerHover, linkPress } from "./2418.js";
|
|
|
12
12
|
import { CompositeItem } from "./951.js";
|
|
13
13
|
import { getCssDimensions } from "./7642.js";
|
|
14
14
|
import { useControlled } from "./8527.js";
|
|
15
|
-
import {
|
|
15
|
+
import { useTransitionStatus } from "./4863.js";
|
|
16
16
|
import { useStableCallback } from "./7541.js";
|
|
17
17
|
import { ownerDocument } from "./9829.js";
|
|
18
18
|
import { isHTMLElement } from "./3829.js";
|
|
19
|
+
import { useOpenChangeComplete } from "./9369.js";
|
|
19
20
|
import * as __rspack_external_react from "react";
|
|
20
21
|
const NavigationMenuRootContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
21
22
|
if ("production" !== process.env.NODE_ENV) NavigationMenuRootContext.displayName = "NavigationMenuRootContext";
|
package/dist/6882.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { EMPTY_OBJECT, EMPTY_ARRAY, useMergedRefs, useRefWithInit, warn, mergeProps, useRenderElement, esm_formatErrorMessage } from "./8272.js";
|
|
3
3
|
import { isLastTraversableNode, getParentNode, isHTMLElement } from "./3829.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { popupStateMapping, triggerOpenStateMapping } from "./6917.js";
|
|
5
|
+
import { transitionStatusMapping, useAnimationsFinished, useOpenChangeComplete } from "./9369.js";
|
|
6
6
|
import { itemPress, siblingOpen, outsidePress, imperativeAction, triggerFocus, focusOut, listNavigation as reason_parts_listNavigation, triggerHover, triggerPress, escapeKey } from "./2418.js";
|
|
7
|
+
import { FloatingPortal_FloatingPortal, DROPDOWN_COLLISION_AVOIDANCE, POPUP_COLLISION_AVOIDANCE } from "./487.js";
|
|
7
8
|
import { usePositioner, adaptiveOriginMiddleware_adaptiveOrigin, useAnchorPositioning, getDisabledMountTransitionStyles } from "./8750.js";
|
|
8
9
|
import { createChangeEventDetails } from "./4768.js";
|
|
9
10
|
import { useTimeout } from "./42.js";
|
|
@@ -16,19 +17,22 @@ import { CompositeList } from "./9255.js";
|
|
|
16
17
|
import { useToolbarRootContext } from "./6107.js";
|
|
17
18
|
import { useHoverFloatingInteraction } from "./3056.js";
|
|
18
19
|
import { COMPOSITE_KEYS } from "./1500.js";
|
|
19
|
-
import { useBaseUiId
|
|
20
|
+
import { useBaseUiId } from "./6046.js";
|
|
20
21
|
import { isMac } from "./8971.js";
|
|
21
22
|
import { useButton } from "./9189.js";
|
|
22
23
|
import { useCompositeListItem } from "./3021.js";
|
|
23
24
|
import { useControlled } from "./8527.js";
|
|
25
|
+
import { useTransitionStatus } from "./4863.js";
|
|
24
26
|
import { useStableCallback } from "./7541.js";
|
|
25
27
|
import { useSyncedFloatingRootContext, useTriggerRegistration, useImplicitActiveTrigger, useOpenStateTransitions, usePopupInteractionProps, FOCUSABLE_POPUP_PROPS, useOnFirstRender } from "./8106.js";
|
|
26
28
|
import { isElementDisabled } from "./3140.js";
|
|
27
29
|
import { safePolygon, useHoverReferenceInteraction } from "./3670.js";
|
|
28
30
|
import { useClick } from "./5864.js";
|
|
29
31
|
import { popupStoreSelectors, createInitialPopupStoreState } from "./6535.js";
|
|
30
|
-
import {
|
|
32
|
+
import { ReactStore, fastComponent, createSelector } from "./2445.js";
|
|
33
|
+
import { PopupTriggerMap, useDismiss } from "./5992.js";
|
|
31
34
|
import { useMenubarContext } from "./7564.js";
|
|
35
|
+
import { useId } from "./2205.js";
|
|
32
36
|
import { useDirection } from "./9863.js";
|
|
33
37
|
import { useListNavigation, useTypeahead } from "./5299.js";
|
|
34
38
|
import * as __rspack_external_react from "react";
|