@spark-ui/hooks 17.2.1-beta.0 → 17.2.1
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 +10 -0
- package/dist/use-combined-state/index.d.ts +1 -12
- package/dist/use-combined-state/index.js +670 -47
- package/dist/use-combined-state/index.js.map +1 -1
- package/dist/use-combined-state/index.mjs +664 -4
- package/dist/use-combined-state/index.mjs.map +1 -1
- package/dist/use-merge-refs/index.d.ts +1 -7
- package/dist/use-merge-refs/index.js +7 -37
- package/dist/use-merge-refs/index.js.map +1 -1
- package/dist/use-merge-refs/index.mjs +1 -2
- package/dist/use-merge-refs/index.mjs.map +1 -1
- package/dist/use-mounted-state/index.d.ts +1 -3
- package/dist/use-mounted-state/index.js +7 -35
- package/dist/use-mounted-state/index.js.map +1 -1
- package/dist/use-mounted-state/index.mjs +2 -3
- package/dist/use-mounted-state/index.mjs.map +1 -1
- package/dist/use-scroll-overflow/index.d.ts +2 -22
- package/dist/use-scroll-overflow/index.js +8 -36
- package/dist/use-scroll-overflow/index.js.map +1 -1
- package/dist/use-scroll-overflow/index.mjs +2 -3
- package/dist/use-scroll-overflow/index.mjs.map +1 -1
- package/dist/use-sortable-list/index.d.ts +2 -98
- package/dist/use-sortable-list/index.js +6 -36
- package/dist/use-sortable-list/index.js.map +1 -1
- package/dist/use-sortable-list/index.mjs +2 -5
- package/dist/use-sortable-list/index.mjs.map +1 -1
- package/package.json +2 -2
- package/vite.config.ts +43 -0
- package/.turbo/turbo-build.log +0 -35
- package/.turbo/turbo-lint.log +0 -327
- package/dist/use-combined-state/index.d.mts +0 -12
- package/dist/use-merge-refs/index.d.mts +0 -7
- package/dist/use-mounted-state/index.d.mts +0 -3
- package/dist/use-scroll-overflow/index.d.mts +0 -22
- package/dist/use-sortable-list/index.d.mts +0 -98
- package/tsup.config.ts +0 -11
|
@@ -1,49 +1,675 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const react = require("react");
|
|
4
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
5
|
+
function getDefaultExportFromCjs(x) {
|
|
6
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
7
|
+
}
|
|
8
|
+
var lodash_isequal = { exports: {} };
|
|
9
|
+
lodash_isequal.exports;
|
|
10
|
+
var hasRequiredLodash_isequal;
|
|
11
|
+
function requireLodash_isequal() {
|
|
12
|
+
if (hasRequiredLodash_isequal) return lodash_isequal.exports;
|
|
13
|
+
hasRequiredLodash_isequal = 1;
|
|
14
|
+
(function(module2, exports$1) {
|
|
15
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
16
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
17
|
+
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
18
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
19
|
+
var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]";
|
|
20
|
+
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
21
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
22
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
23
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
24
|
+
var typedArrayTags = {};
|
|
25
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
26
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
27
|
+
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
28
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
29
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
30
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
31
|
+
var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
|
|
32
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
33
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
34
|
+
var nodeUtil = (function() {
|
|
35
|
+
try {
|
|
36
|
+
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
37
|
+
} catch (e) {
|
|
38
|
+
}
|
|
39
|
+
})();
|
|
40
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
41
|
+
function arrayFilter(array, predicate) {
|
|
42
|
+
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
43
|
+
while (++index < length) {
|
|
44
|
+
var value = array[index];
|
|
45
|
+
if (predicate(value, index, array)) {
|
|
46
|
+
result[resIndex++] = value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
function arrayPush(array, values) {
|
|
52
|
+
var index = -1, length = values.length, offset = array.length;
|
|
53
|
+
while (++index < length) {
|
|
54
|
+
array[offset + index] = values[index];
|
|
55
|
+
}
|
|
56
|
+
return array;
|
|
57
|
+
}
|
|
58
|
+
function arraySome(array, predicate) {
|
|
59
|
+
var index = -1, length = array == null ? 0 : array.length;
|
|
60
|
+
while (++index < length) {
|
|
61
|
+
if (predicate(array[index], index, array)) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
function baseTimes(n, iteratee) {
|
|
68
|
+
var index = -1, result = Array(n);
|
|
69
|
+
while (++index < n) {
|
|
70
|
+
result[index] = iteratee(index);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
function baseUnary(func) {
|
|
75
|
+
return function(value) {
|
|
76
|
+
return func(value);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function cacheHas(cache, key) {
|
|
80
|
+
return cache.has(key);
|
|
81
|
+
}
|
|
82
|
+
function getValue(object, key) {
|
|
83
|
+
return object == null ? void 0 : object[key];
|
|
84
|
+
}
|
|
85
|
+
function mapToArray(map) {
|
|
86
|
+
var index = -1, result = Array(map.size);
|
|
87
|
+
map.forEach(function(value, key) {
|
|
88
|
+
result[++index] = [key, value];
|
|
89
|
+
});
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
function overArg(func, transform) {
|
|
93
|
+
return function(arg) {
|
|
94
|
+
return func(transform(arg));
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function setToArray(set) {
|
|
98
|
+
var index = -1, result = Array(set.size);
|
|
99
|
+
set.forEach(function(value) {
|
|
100
|
+
result[++index] = value;
|
|
101
|
+
});
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
|
|
105
|
+
var coreJsData = root["__core-js_shared__"];
|
|
106
|
+
var funcToString = funcProto.toString;
|
|
107
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
108
|
+
var maskSrcKey = (function() {
|
|
109
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
110
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
111
|
+
})();
|
|
112
|
+
var nativeObjectToString = objectProto.toString;
|
|
113
|
+
var reIsNative = RegExp(
|
|
114
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
115
|
+
);
|
|
116
|
+
var Buffer = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array = root.Uint8Array, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
117
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
|
|
118
|
+
var DataView = getNative(root, "DataView"), Map = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
|
|
119
|
+
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
|
|
120
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
121
|
+
function Hash(entries) {
|
|
122
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
123
|
+
this.clear();
|
|
124
|
+
while (++index < length) {
|
|
125
|
+
var entry = entries[index];
|
|
126
|
+
this.set(entry[0], entry[1]);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function hashClear() {
|
|
130
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
131
|
+
this.size = 0;
|
|
132
|
+
}
|
|
133
|
+
function hashDelete(key) {
|
|
134
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
135
|
+
this.size -= result ? 1 : 0;
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
function hashGet(key) {
|
|
139
|
+
var data = this.__data__;
|
|
140
|
+
if (nativeCreate) {
|
|
141
|
+
var result = data[key];
|
|
142
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
143
|
+
}
|
|
144
|
+
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
145
|
+
}
|
|
146
|
+
function hashHas(key) {
|
|
147
|
+
var data = this.__data__;
|
|
148
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
149
|
+
}
|
|
150
|
+
function hashSet(key, value) {
|
|
151
|
+
var data = this.__data__;
|
|
152
|
+
this.size += this.has(key) ? 0 : 1;
|
|
153
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
154
|
+
return this;
|
|
155
|
+
}
|
|
156
|
+
Hash.prototype.clear = hashClear;
|
|
157
|
+
Hash.prototype["delete"] = hashDelete;
|
|
158
|
+
Hash.prototype.get = hashGet;
|
|
159
|
+
Hash.prototype.has = hashHas;
|
|
160
|
+
Hash.prototype.set = hashSet;
|
|
161
|
+
function ListCache(entries) {
|
|
162
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
163
|
+
this.clear();
|
|
164
|
+
while (++index < length) {
|
|
165
|
+
var entry = entries[index];
|
|
166
|
+
this.set(entry[0], entry[1]);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function listCacheClear() {
|
|
170
|
+
this.__data__ = [];
|
|
171
|
+
this.size = 0;
|
|
172
|
+
}
|
|
173
|
+
function listCacheDelete(key) {
|
|
174
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
175
|
+
if (index < 0) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
var lastIndex = data.length - 1;
|
|
179
|
+
if (index == lastIndex) {
|
|
180
|
+
data.pop();
|
|
181
|
+
} else {
|
|
182
|
+
splice.call(data, index, 1);
|
|
183
|
+
}
|
|
184
|
+
--this.size;
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
function listCacheGet(key) {
|
|
188
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
189
|
+
return index < 0 ? void 0 : data[index][1];
|
|
190
|
+
}
|
|
191
|
+
function listCacheHas(key) {
|
|
192
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
193
|
+
}
|
|
194
|
+
function listCacheSet(key, value) {
|
|
195
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
196
|
+
if (index < 0) {
|
|
197
|
+
++this.size;
|
|
198
|
+
data.push([key, value]);
|
|
199
|
+
} else {
|
|
200
|
+
data[index][1] = value;
|
|
201
|
+
}
|
|
202
|
+
return this;
|
|
203
|
+
}
|
|
204
|
+
ListCache.prototype.clear = listCacheClear;
|
|
205
|
+
ListCache.prototype["delete"] = listCacheDelete;
|
|
206
|
+
ListCache.prototype.get = listCacheGet;
|
|
207
|
+
ListCache.prototype.has = listCacheHas;
|
|
208
|
+
ListCache.prototype.set = listCacheSet;
|
|
209
|
+
function MapCache(entries) {
|
|
210
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
211
|
+
this.clear();
|
|
212
|
+
while (++index < length) {
|
|
213
|
+
var entry = entries[index];
|
|
214
|
+
this.set(entry[0], entry[1]);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function mapCacheClear() {
|
|
218
|
+
this.size = 0;
|
|
219
|
+
this.__data__ = {
|
|
220
|
+
"hash": new Hash(),
|
|
221
|
+
"map": new (Map || ListCache)(),
|
|
222
|
+
"string": new Hash()
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function mapCacheDelete(key) {
|
|
226
|
+
var result = getMapData(this, key)["delete"](key);
|
|
227
|
+
this.size -= result ? 1 : 0;
|
|
228
|
+
return result;
|
|
229
|
+
}
|
|
230
|
+
function mapCacheGet(key) {
|
|
231
|
+
return getMapData(this, key).get(key);
|
|
232
|
+
}
|
|
233
|
+
function mapCacheHas(key) {
|
|
234
|
+
return getMapData(this, key).has(key);
|
|
235
|
+
}
|
|
236
|
+
function mapCacheSet(key, value) {
|
|
237
|
+
var data = getMapData(this, key), size = data.size;
|
|
238
|
+
data.set(key, value);
|
|
239
|
+
this.size += data.size == size ? 0 : 1;
|
|
240
|
+
return this;
|
|
241
|
+
}
|
|
242
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
243
|
+
MapCache.prototype["delete"] = mapCacheDelete;
|
|
244
|
+
MapCache.prototype.get = mapCacheGet;
|
|
245
|
+
MapCache.prototype.has = mapCacheHas;
|
|
246
|
+
MapCache.prototype.set = mapCacheSet;
|
|
247
|
+
function SetCache(values) {
|
|
248
|
+
var index = -1, length = values == null ? 0 : values.length;
|
|
249
|
+
this.__data__ = new MapCache();
|
|
250
|
+
while (++index < length) {
|
|
251
|
+
this.add(values[index]);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function setCacheAdd(value) {
|
|
255
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
256
|
+
return this;
|
|
257
|
+
}
|
|
258
|
+
function setCacheHas(value) {
|
|
259
|
+
return this.__data__.has(value);
|
|
260
|
+
}
|
|
261
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
262
|
+
SetCache.prototype.has = setCacheHas;
|
|
263
|
+
function Stack(entries) {
|
|
264
|
+
var data = this.__data__ = new ListCache(entries);
|
|
265
|
+
this.size = data.size;
|
|
266
|
+
}
|
|
267
|
+
function stackClear() {
|
|
268
|
+
this.__data__ = new ListCache();
|
|
269
|
+
this.size = 0;
|
|
270
|
+
}
|
|
271
|
+
function stackDelete(key) {
|
|
272
|
+
var data = this.__data__, result = data["delete"](key);
|
|
273
|
+
this.size = data.size;
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
function stackGet(key) {
|
|
277
|
+
return this.__data__.get(key);
|
|
278
|
+
}
|
|
279
|
+
function stackHas(key) {
|
|
280
|
+
return this.__data__.has(key);
|
|
281
|
+
}
|
|
282
|
+
function stackSet(key, value) {
|
|
283
|
+
var data = this.__data__;
|
|
284
|
+
if (data instanceof ListCache) {
|
|
285
|
+
var pairs = data.__data__;
|
|
286
|
+
if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
287
|
+
pairs.push([key, value]);
|
|
288
|
+
this.size = ++data.size;
|
|
289
|
+
return this;
|
|
290
|
+
}
|
|
291
|
+
data = this.__data__ = new MapCache(pairs);
|
|
292
|
+
}
|
|
293
|
+
data.set(key, value);
|
|
294
|
+
this.size = data.size;
|
|
295
|
+
return this;
|
|
296
|
+
}
|
|
297
|
+
Stack.prototype.clear = stackClear;
|
|
298
|
+
Stack.prototype["delete"] = stackDelete;
|
|
299
|
+
Stack.prototype.get = stackGet;
|
|
300
|
+
Stack.prototype.has = stackHas;
|
|
301
|
+
Stack.prototype.set = stackSet;
|
|
302
|
+
function arrayLikeKeys(value, inherited) {
|
|
303
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
304
|
+
for (var key in value) {
|
|
305
|
+
if (hasOwnProperty.call(value, key) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
306
|
+
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
307
|
+
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
308
|
+
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
309
|
+
isIndex(key, length)))) {
|
|
310
|
+
result.push(key);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return result;
|
|
314
|
+
}
|
|
315
|
+
function assocIndexOf(array, key) {
|
|
316
|
+
var length = array.length;
|
|
317
|
+
while (length--) {
|
|
318
|
+
if (eq(array[length][0], key)) {
|
|
319
|
+
return length;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return -1;
|
|
323
|
+
}
|
|
324
|
+
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
325
|
+
var result = keysFunc(object);
|
|
326
|
+
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
327
|
+
}
|
|
328
|
+
function baseGetTag(value) {
|
|
329
|
+
if (value == null) {
|
|
330
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
331
|
+
}
|
|
332
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
333
|
+
}
|
|
334
|
+
function baseIsArguments(value) {
|
|
335
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
336
|
+
}
|
|
337
|
+
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
338
|
+
if (value === other) {
|
|
339
|
+
return true;
|
|
340
|
+
}
|
|
341
|
+
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
342
|
+
return value !== value && other !== other;
|
|
343
|
+
}
|
|
344
|
+
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
345
|
+
}
|
|
346
|
+
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
347
|
+
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
348
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
|
349
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
|
350
|
+
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
351
|
+
if (isSameTag && isBuffer(object)) {
|
|
352
|
+
if (!isBuffer(other)) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
objIsArr = true;
|
|
356
|
+
objIsObj = false;
|
|
357
|
+
}
|
|
358
|
+
if (isSameTag && !objIsObj) {
|
|
359
|
+
stack || (stack = new Stack());
|
|
360
|
+
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
361
|
+
}
|
|
362
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
363
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
364
|
+
if (objIsWrapped || othIsWrapped) {
|
|
365
|
+
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
366
|
+
stack || (stack = new Stack());
|
|
367
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (!isSameTag) {
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
stack || (stack = new Stack());
|
|
374
|
+
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
375
|
+
}
|
|
376
|
+
function baseIsNative(value) {
|
|
377
|
+
if (!isObject(value) || isMasked(value)) {
|
|
378
|
+
return false;
|
|
379
|
+
}
|
|
380
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
381
|
+
return pattern.test(toSource(value));
|
|
382
|
+
}
|
|
383
|
+
function baseIsTypedArray(value) {
|
|
384
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
385
|
+
}
|
|
386
|
+
function baseKeys(object) {
|
|
387
|
+
if (!isPrototype(object)) {
|
|
388
|
+
return nativeKeys(object);
|
|
389
|
+
}
|
|
390
|
+
var result = [];
|
|
391
|
+
for (var key in Object(object)) {
|
|
392
|
+
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
393
|
+
result.push(key);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return result;
|
|
397
|
+
}
|
|
398
|
+
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
399
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
400
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
401
|
+
return false;
|
|
402
|
+
}
|
|
403
|
+
var stacked = stack.get(array);
|
|
404
|
+
if (stacked && stack.get(other)) {
|
|
405
|
+
return stacked == other;
|
|
406
|
+
}
|
|
407
|
+
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
|
|
408
|
+
stack.set(array, other);
|
|
409
|
+
stack.set(other, array);
|
|
410
|
+
while (++index < arrLength) {
|
|
411
|
+
var arrValue = array[index], othValue = other[index];
|
|
412
|
+
if (customizer) {
|
|
413
|
+
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
414
|
+
}
|
|
415
|
+
if (compared !== void 0) {
|
|
416
|
+
if (compared) {
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
result = false;
|
|
420
|
+
break;
|
|
421
|
+
}
|
|
422
|
+
if (seen) {
|
|
423
|
+
if (!arraySome(other, function(othValue2, othIndex) {
|
|
424
|
+
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
425
|
+
return seen.push(othIndex);
|
|
426
|
+
}
|
|
427
|
+
})) {
|
|
428
|
+
result = false;
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
432
|
+
result = false;
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
stack["delete"](array);
|
|
437
|
+
stack["delete"](other);
|
|
438
|
+
return result;
|
|
439
|
+
}
|
|
440
|
+
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
441
|
+
switch (tag) {
|
|
442
|
+
case dataViewTag:
|
|
443
|
+
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
object = object.buffer;
|
|
447
|
+
other = other.buffer;
|
|
448
|
+
case arrayBufferTag:
|
|
449
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
return true;
|
|
453
|
+
case boolTag:
|
|
454
|
+
case dateTag:
|
|
455
|
+
case numberTag:
|
|
456
|
+
return eq(+object, +other);
|
|
457
|
+
case errorTag:
|
|
458
|
+
return object.name == other.name && object.message == other.message;
|
|
459
|
+
case regexpTag:
|
|
460
|
+
case stringTag:
|
|
461
|
+
return object == other + "";
|
|
462
|
+
case mapTag:
|
|
463
|
+
var convert = mapToArray;
|
|
464
|
+
case setTag:
|
|
465
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
466
|
+
convert || (convert = setToArray);
|
|
467
|
+
if (object.size != other.size && !isPartial) {
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
var stacked = stack.get(object);
|
|
471
|
+
if (stacked) {
|
|
472
|
+
return stacked == other;
|
|
473
|
+
}
|
|
474
|
+
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
475
|
+
stack.set(object, other);
|
|
476
|
+
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
477
|
+
stack["delete"](object);
|
|
478
|
+
return result;
|
|
479
|
+
case symbolTag:
|
|
480
|
+
if (symbolValueOf) {
|
|
481
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
487
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
488
|
+
if (objLength != othLength && !isPartial) {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
var index = objLength;
|
|
492
|
+
while (index--) {
|
|
493
|
+
var key = objProps[index];
|
|
494
|
+
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
495
|
+
return false;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
var stacked = stack.get(object);
|
|
499
|
+
if (stacked && stack.get(other)) {
|
|
500
|
+
return stacked == other;
|
|
501
|
+
}
|
|
502
|
+
var result = true;
|
|
503
|
+
stack.set(object, other);
|
|
504
|
+
stack.set(other, object);
|
|
505
|
+
var skipCtor = isPartial;
|
|
506
|
+
while (++index < objLength) {
|
|
507
|
+
key = objProps[index];
|
|
508
|
+
var objValue = object[key], othValue = other[key];
|
|
509
|
+
if (customizer) {
|
|
510
|
+
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
511
|
+
}
|
|
512
|
+
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
513
|
+
result = false;
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
skipCtor || (skipCtor = key == "constructor");
|
|
517
|
+
}
|
|
518
|
+
if (result && !skipCtor) {
|
|
519
|
+
var objCtor = object.constructor, othCtor = other.constructor;
|
|
520
|
+
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
521
|
+
result = false;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
stack["delete"](object);
|
|
525
|
+
stack["delete"](other);
|
|
526
|
+
return result;
|
|
527
|
+
}
|
|
528
|
+
function getAllKeys(object) {
|
|
529
|
+
return baseGetAllKeys(object, keys, getSymbols);
|
|
530
|
+
}
|
|
531
|
+
function getMapData(map, key) {
|
|
532
|
+
var data = map.__data__;
|
|
533
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
534
|
+
}
|
|
535
|
+
function getNative(object, key) {
|
|
536
|
+
var value = getValue(object, key);
|
|
537
|
+
return baseIsNative(value) ? value : void 0;
|
|
538
|
+
}
|
|
539
|
+
function getRawTag(value) {
|
|
540
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
541
|
+
try {
|
|
542
|
+
value[symToStringTag] = void 0;
|
|
543
|
+
var unmasked = true;
|
|
544
|
+
} catch (e) {
|
|
545
|
+
}
|
|
546
|
+
var result = nativeObjectToString.call(value);
|
|
547
|
+
if (unmasked) {
|
|
548
|
+
if (isOwn) {
|
|
549
|
+
value[symToStringTag] = tag;
|
|
550
|
+
} else {
|
|
551
|
+
delete value[symToStringTag];
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
return result;
|
|
555
|
+
}
|
|
556
|
+
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
557
|
+
if (object == null) {
|
|
558
|
+
return [];
|
|
559
|
+
}
|
|
560
|
+
object = Object(object);
|
|
561
|
+
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
562
|
+
return propertyIsEnumerable.call(object, symbol);
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
var getTag = baseGetTag;
|
|
566
|
+
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
|
|
567
|
+
getTag = function(value) {
|
|
568
|
+
var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
569
|
+
if (ctorString) {
|
|
570
|
+
switch (ctorString) {
|
|
571
|
+
case dataViewCtorString:
|
|
572
|
+
return dataViewTag;
|
|
573
|
+
case mapCtorString:
|
|
574
|
+
return mapTag;
|
|
575
|
+
case promiseCtorString:
|
|
576
|
+
return promiseTag;
|
|
577
|
+
case setCtorString:
|
|
578
|
+
return setTag;
|
|
579
|
+
case weakMapCtorString:
|
|
580
|
+
return weakMapTag;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return result;
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
function isIndex(value, length) {
|
|
587
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
588
|
+
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
589
|
+
}
|
|
590
|
+
function isKeyable(value) {
|
|
591
|
+
var type = typeof value;
|
|
592
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
593
|
+
}
|
|
594
|
+
function isMasked(func) {
|
|
595
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
596
|
+
}
|
|
597
|
+
function isPrototype(value) {
|
|
598
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
599
|
+
return value === proto;
|
|
600
|
+
}
|
|
601
|
+
function objectToString(value) {
|
|
602
|
+
return nativeObjectToString.call(value);
|
|
603
|
+
}
|
|
604
|
+
function toSource(func) {
|
|
605
|
+
if (func != null) {
|
|
606
|
+
try {
|
|
607
|
+
return funcToString.call(func);
|
|
608
|
+
} catch (e) {
|
|
609
|
+
}
|
|
610
|
+
try {
|
|
611
|
+
return func + "";
|
|
612
|
+
} catch (e) {
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return "";
|
|
616
|
+
}
|
|
617
|
+
function eq(value, other) {
|
|
618
|
+
return value === other || value !== value && other !== other;
|
|
619
|
+
}
|
|
620
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
|
|
621
|
+
return arguments;
|
|
622
|
+
})()) ? baseIsArguments : function(value) {
|
|
623
|
+
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
624
|
+
};
|
|
625
|
+
var isArray = Array.isArray;
|
|
626
|
+
function isArrayLike(value) {
|
|
627
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
628
|
+
}
|
|
629
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
630
|
+
function isEqual2(value, other) {
|
|
631
|
+
return baseIsEqual(value, other);
|
|
632
|
+
}
|
|
633
|
+
function isFunction(value) {
|
|
634
|
+
if (!isObject(value)) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
637
|
+
var tag = baseGetTag(value);
|
|
638
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
639
|
+
}
|
|
640
|
+
function isLength(value) {
|
|
641
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
642
|
+
}
|
|
643
|
+
function isObject(value) {
|
|
644
|
+
var type = typeof value;
|
|
645
|
+
return value != null && (type == "object" || type == "function");
|
|
646
|
+
}
|
|
647
|
+
function isObjectLike(value) {
|
|
648
|
+
return value != null && typeof value == "object";
|
|
649
|
+
}
|
|
650
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
651
|
+
function keys(object) {
|
|
652
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
653
|
+
}
|
|
654
|
+
function stubArray() {
|
|
655
|
+
return [];
|
|
656
|
+
}
|
|
657
|
+
function stubFalse() {
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
module2.exports = isEqual2;
|
|
661
|
+
})(lodash_isequal, lodash_isequal.exports);
|
|
662
|
+
return lodash_isequal.exports;
|
|
663
|
+
}
|
|
664
|
+
var lodash_isequalExports = requireLodash_isequal();
|
|
665
|
+
const isEqual = /* @__PURE__ */ getDefaultExportFromCjs(lodash_isequalExports);
|
|
40
666
|
function useCombinedState(controlledValue, defaultValue, onChange) {
|
|
41
667
|
const isControlled = controlledValue !== void 0;
|
|
42
|
-
const { current: initialValue } =
|
|
43
|
-
const [innerValue, setInnerValue] =
|
|
668
|
+
const { current: initialValue } = react.useRef(isControlled ? controlledValue : defaultValue);
|
|
669
|
+
const [innerValue, setInnerValue] = react.useState(defaultValue);
|
|
44
670
|
const value = isControlled ? controlledValue : innerValue;
|
|
45
|
-
const updater =
|
|
46
|
-
(next, shouldUpdateProp = (prevValue, nextValue) => !(
|
|
671
|
+
const updater = react.useCallback(
|
|
672
|
+
(next, shouldUpdateProp = (prevValue, nextValue) => !isEqual(prevValue, nextValue)) => {
|
|
47
673
|
const nextValue = typeof next !== "function" ? next : next(value);
|
|
48
674
|
const shouldUpdate = shouldUpdateProp(value, nextValue);
|
|
49
675
|
if (shouldUpdate && !isControlled) {
|
|
@@ -55,8 +681,5 @@ function useCombinedState(controlledValue, defaultValue, onChange) {
|
|
|
55
681
|
);
|
|
56
682
|
return [value, updater, isControlled, initialValue];
|
|
57
683
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
useCombinedState
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
|
684
|
+
exports.useCombinedState = useCombinedState;
|
|
685
|
+
//# sourceMappingURL=index.js.map
|