@legendapp/list 2.0.0-beta.2 → 2.0.0-beta.4
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/index.d.mts +10 -11
- package/index.d.ts +10 -11
- package/index.js +163 -690
- package/index.mjs +164 -691
- package/package.json +1 -1
- package/.DS_Store +0 -0
package/index.js
CHANGED
|
@@ -24,453 +24,7 @@ function _interopNamespace(e) {
|
|
|
24
24
|
|
|
25
25
|
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
var __defProp = Object.defineProperty;
|
|
29
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
30
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
31
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
32
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
33
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
34
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
35
|
-
}) : x)(function(x) {
|
|
36
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
37
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
38
|
-
});
|
|
39
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
40
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
41
|
-
};
|
|
42
|
-
var __copyProps = (to, from, except, desc) => {
|
|
43
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
44
|
-
for (let key of __getOwnPropNames(from))
|
|
45
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
46
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
47
|
-
}
|
|
48
|
-
return to;
|
|
49
|
-
};
|
|
50
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
51
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
52
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
53
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
54
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
55
|
-
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
56
|
-
mod
|
|
57
|
-
));
|
|
58
|
-
|
|
59
|
-
// node_modules/react-dom/cjs/react-dom.production.js
|
|
60
|
-
var require_react_dom_production = __commonJS({
|
|
61
|
-
"node_modules/react-dom/cjs/react-dom.production.js"(exports) {
|
|
62
|
-
var React13 = __require("react");
|
|
63
|
-
function formatProdErrorMessage(code) {
|
|
64
|
-
var url = "https://react.dev/errors/" + code;
|
|
65
|
-
if (1 < arguments.length) {
|
|
66
|
-
url += "?args[]=" + encodeURIComponent(arguments[1]);
|
|
67
|
-
for (var i = 2; i < arguments.length; i++)
|
|
68
|
-
url += "&args[]=" + encodeURIComponent(arguments[i]);
|
|
69
|
-
}
|
|
70
|
-
return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
|
|
71
|
-
}
|
|
72
|
-
function noop2() {
|
|
73
|
-
}
|
|
74
|
-
var Internals = {
|
|
75
|
-
d: {
|
|
76
|
-
f: noop2,
|
|
77
|
-
r: function() {
|
|
78
|
-
throw Error(formatProdErrorMessage(522));
|
|
79
|
-
},
|
|
80
|
-
D: noop2,
|
|
81
|
-
C: noop2,
|
|
82
|
-
L: noop2,
|
|
83
|
-
m: noop2,
|
|
84
|
-
X: noop2,
|
|
85
|
-
S: noop2,
|
|
86
|
-
M: noop2
|
|
87
|
-
},
|
|
88
|
-
p: 0,
|
|
89
|
-
findDOMNode: null
|
|
90
|
-
};
|
|
91
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
92
|
-
function createPortal$1(children, containerInfo, implementation) {
|
|
93
|
-
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
94
|
-
return {
|
|
95
|
-
$$typeof: REACT_PORTAL_TYPE,
|
|
96
|
-
key: null == key ? null : "" + key,
|
|
97
|
-
children,
|
|
98
|
-
containerInfo,
|
|
99
|
-
implementation
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
var ReactSharedInternals = React13.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
103
|
-
function getCrossOriginStringAs(as, input) {
|
|
104
|
-
if ("font" === as) return "";
|
|
105
|
-
if ("string" === typeof input)
|
|
106
|
-
return "use-credentials" === input ? input : "";
|
|
107
|
-
}
|
|
108
|
-
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
109
|
-
exports.createPortal = function(children, container) {
|
|
110
|
-
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
111
|
-
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
|
112
|
-
throw Error(formatProdErrorMessage(299));
|
|
113
|
-
return createPortal$1(children, container, null, key);
|
|
114
|
-
};
|
|
115
|
-
exports.flushSync = function(fn) {
|
|
116
|
-
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
117
|
-
try {
|
|
118
|
-
if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
|
|
119
|
-
} finally {
|
|
120
|
-
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
exports.preconnect = function(href, options) {
|
|
124
|
-
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
125
|
-
};
|
|
126
|
-
exports.prefetchDNS = function(href) {
|
|
127
|
-
"string" === typeof href && Internals.d.D(href);
|
|
128
|
-
};
|
|
129
|
-
exports.preinit = function(href, options) {
|
|
130
|
-
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
131
|
-
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
132
|
-
"style" === as ? Internals.d.S(
|
|
133
|
-
href,
|
|
134
|
-
"string" === typeof options.precedence ? options.precedence : void 0,
|
|
135
|
-
{
|
|
136
|
-
crossOrigin,
|
|
137
|
-
integrity,
|
|
138
|
-
fetchPriority
|
|
139
|
-
}
|
|
140
|
-
) : "script" === as && Internals.d.X(href, {
|
|
141
|
-
crossOrigin,
|
|
142
|
-
integrity,
|
|
143
|
-
fetchPriority,
|
|
144
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
exports.preinitModule = function(href, options) {
|
|
149
|
-
if ("string" === typeof href)
|
|
150
|
-
if ("object" === typeof options && null !== options) {
|
|
151
|
-
if (null == options.as || "script" === options.as) {
|
|
152
|
-
var crossOrigin = getCrossOriginStringAs(
|
|
153
|
-
options.as,
|
|
154
|
-
options.crossOrigin
|
|
155
|
-
);
|
|
156
|
-
Internals.d.M(href, {
|
|
157
|
-
crossOrigin,
|
|
158
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
159
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
} else null == options && Internals.d.M(href);
|
|
163
|
-
};
|
|
164
|
-
exports.preload = function(href, options) {
|
|
165
|
-
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
166
|
-
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
|
|
167
|
-
Internals.d.L(href, as, {
|
|
168
|
-
crossOrigin,
|
|
169
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
170
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
171
|
-
type: "string" === typeof options.type ? options.type : void 0,
|
|
172
|
-
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
173
|
-
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
174
|
-
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
175
|
-
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
176
|
-
media: "string" === typeof options.media ? options.media : void 0
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
exports.preloadModule = function(href, options) {
|
|
181
|
-
if ("string" === typeof href)
|
|
182
|
-
if (options) {
|
|
183
|
-
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
|
|
184
|
-
Internals.d.m(href, {
|
|
185
|
-
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
186
|
-
crossOrigin,
|
|
187
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
188
|
-
});
|
|
189
|
-
} else Internals.d.m(href);
|
|
190
|
-
};
|
|
191
|
-
exports.requestFormReset = function(form) {
|
|
192
|
-
Internals.d.r(form);
|
|
193
|
-
};
|
|
194
|
-
exports.unstable_batchedUpdates = function(fn, a) {
|
|
195
|
-
return fn(a);
|
|
196
|
-
};
|
|
197
|
-
exports.useFormState = function(action, initialState, permalink) {
|
|
198
|
-
return ReactSharedInternals.H.useFormState(action, initialState, permalink);
|
|
199
|
-
};
|
|
200
|
-
exports.useFormStatus = function() {
|
|
201
|
-
return ReactSharedInternals.H.useHostTransitionStatus();
|
|
202
|
-
};
|
|
203
|
-
exports.version = "19.1.1";
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
// node_modules/react-dom/cjs/react-dom.development.js
|
|
208
|
-
var require_react_dom_development = __commonJS({
|
|
209
|
-
"node_modules/react-dom/cjs/react-dom.development.js"(exports) {
|
|
210
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
211
|
-
function noop2() {
|
|
212
|
-
}
|
|
213
|
-
function testStringCoercion(value) {
|
|
214
|
-
return "" + value;
|
|
215
|
-
}
|
|
216
|
-
function createPortal$1(children, containerInfo, implementation) {
|
|
217
|
-
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
218
|
-
try {
|
|
219
|
-
testStringCoercion(key);
|
|
220
|
-
var JSCompiler_inline_result = false;
|
|
221
|
-
} catch (e) {
|
|
222
|
-
JSCompiler_inline_result = true;
|
|
223
|
-
}
|
|
224
|
-
JSCompiler_inline_result && (console.error(
|
|
225
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
226
|
-
"function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"
|
|
227
|
-
), testStringCoercion(key));
|
|
228
|
-
return {
|
|
229
|
-
$$typeof: REACT_PORTAL_TYPE,
|
|
230
|
-
key: null == key ? null : "" + key,
|
|
231
|
-
children,
|
|
232
|
-
containerInfo,
|
|
233
|
-
implementation
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
function getCrossOriginStringAs(as, input) {
|
|
237
|
-
if ("font" === as) return "";
|
|
238
|
-
if ("string" === typeof input)
|
|
239
|
-
return "use-credentials" === input ? input : "";
|
|
240
|
-
}
|
|
241
|
-
function getValueDescriptorExpectingObjectForWarning(thing) {
|
|
242
|
-
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"';
|
|
243
|
-
}
|
|
244
|
-
function getValueDescriptorExpectingEnumForWarning(thing) {
|
|
245
|
-
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
|
|
246
|
-
}
|
|
247
|
-
function resolveDispatcher() {
|
|
248
|
-
var dispatcher = ReactSharedInternals.H;
|
|
249
|
-
null === dispatcher && console.error(
|
|
250
|
-
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
251
|
-
);
|
|
252
|
-
return dispatcher;
|
|
253
|
-
}
|
|
254
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
255
|
-
var React13 = __require("react"), Internals = {
|
|
256
|
-
d: {
|
|
257
|
-
f: noop2,
|
|
258
|
-
r: function() {
|
|
259
|
-
throw Error(
|
|
260
|
-
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
|
261
|
-
);
|
|
262
|
-
},
|
|
263
|
-
D: noop2,
|
|
264
|
-
C: noop2,
|
|
265
|
-
L: noop2,
|
|
266
|
-
m: noop2,
|
|
267
|
-
X: noop2,
|
|
268
|
-
S: noop2,
|
|
269
|
-
M: noop2
|
|
270
|
-
},
|
|
271
|
-
p: 0,
|
|
272
|
-
findDOMNode: null
|
|
273
|
-
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = React13.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
274
|
-
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
|
275
|
-
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
|
276
|
-
);
|
|
277
|
-
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
278
|
-
exports.createPortal = function(children, container) {
|
|
279
|
-
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
280
|
-
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
|
281
|
-
throw Error("Target container is not a DOM element.");
|
|
282
|
-
return createPortal$1(children, container, null, key);
|
|
283
|
-
};
|
|
284
|
-
exports.flushSync = function(fn) {
|
|
285
|
-
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
286
|
-
try {
|
|
287
|
-
if (ReactSharedInternals.T = null, Internals.p = 2, fn)
|
|
288
|
-
return fn();
|
|
289
|
-
} finally {
|
|
290
|
-
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
|
|
291
|
-
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
exports.preconnect = function(href, options) {
|
|
296
|
-
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
|
|
297
|
-
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
|
298
|
-
getValueDescriptorExpectingEnumForWarning(options)
|
|
299
|
-
) : null != options && "string" !== typeof options.crossOrigin && console.error(
|
|
300
|
-
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
|
301
|
-
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
|
|
302
|
-
) : console.error(
|
|
303
|
-
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
304
|
-
getValueDescriptorExpectingObjectForWarning(href)
|
|
305
|
-
);
|
|
306
|
-
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
307
|
-
};
|
|
308
|
-
exports.prefetchDNS = function(href) {
|
|
309
|
-
if ("string" !== typeof href || !href)
|
|
310
|
-
console.error(
|
|
311
|
-
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
312
|
-
getValueDescriptorExpectingObjectForWarning(href)
|
|
313
|
-
);
|
|
314
|
-
else if (1 < arguments.length) {
|
|
315
|
-
var options = arguments[1];
|
|
316
|
-
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
|
|
317
|
-
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
318
|
-
getValueDescriptorExpectingEnumForWarning(options)
|
|
319
|
-
) : console.error(
|
|
320
|
-
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
321
|
-
getValueDescriptorExpectingEnumForWarning(options)
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
"string" === typeof href && Internals.d.D(href);
|
|
325
|
-
};
|
|
326
|
-
exports.preinit = function(href, options) {
|
|
327
|
-
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error(
|
|
328
|
-
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
|
329
|
-
getValueDescriptorExpectingEnumForWarning(options)
|
|
330
|
-
) : "style" !== options.as && "script" !== options.as && console.error(
|
|
331
|
-
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
|
|
332
|
-
getValueDescriptorExpectingEnumForWarning(options.as)
|
|
333
|
-
) : console.error(
|
|
334
|
-
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
335
|
-
getValueDescriptorExpectingObjectForWarning(href)
|
|
336
|
-
);
|
|
337
|
-
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
338
|
-
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
339
|
-
"style" === as ? Internals.d.S(
|
|
340
|
-
href,
|
|
341
|
-
"string" === typeof options.precedence ? options.precedence : void 0,
|
|
342
|
-
{
|
|
343
|
-
crossOrigin,
|
|
344
|
-
integrity,
|
|
345
|
-
fetchPriority
|
|
346
|
-
}
|
|
347
|
-
) : "script" === as && Internals.d.X(href, {
|
|
348
|
-
crossOrigin,
|
|
349
|
-
integrity,
|
|
350
|
-
fetchPriority,
|
|
351
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
exports.preinitModule = function(href, options) {
|
|
356
|
-
var encountered = "";
|
|
357
|
-
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
358
|
-
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
|
359
|
-
if (encountered)
|
|
360
|
-
console.error(
|
|
361
|
-
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
|
|
362
|
-
encountered
|
|
363
|
-
);
|
|
364
|
-
else
|
|
365
|
-
switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
|
366
|
-
case "script":
|
|
367
|
-
break;
|
|
368
|
-
default:
|
|
369
|
-
encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error(
|
|
370
|
-
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
|
|
371
|
-
encountered,
|
|
372
|
-
href
|
|
373
|
-
);
|
|
374
|
-
}
|
|
375
|
-
if ("string" === typeof href)
|
|
376
|
-
if ("object" === typeof options && null !== options) {
|
|
377
|
-
if (null == options.as || "script" === options.as)
|
|
378
|
-
encountered = getCrossOriginStringAs(
|
|
379
|
-
options.as,
|
|
380
|
-
options.crossOrigin
|
|
381
|
-
), Internals.d.M(href, {
|
|
382
|
-
crossOrigin: encountered,
|
|
383
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
384
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
385
|
-
});
|
|
386
|
-
} else null == options && Internals.d.M(href);
|
|
387
|
-
};
|
|
388
|
-
exports.preload = function(href, options) {
|
|
389
|
-
var encountered = "";
|
|
390
|
-
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
391
|
-
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
392
|
-
encountered && console.error(
|
|
393
|
-
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
|
394
|
-
encountered
|
|
395
|
-
);
|
|
396
|
-
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
397
|
-
encountered = options.as;
|
|
398
|
-
var crossOrigin = getCrossOriginStringAs(
|
|
399
|
-
encountered,
|
|
400
|
-
options.crossOrigin
|
|
401
|
-
);
|
|
402
|
-
Internals.d.L(href, encountered, {
|
|
403
|
-
crossOrigin,
|
|
404
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
405
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
406
|
-
type: "string" === typeof options.type ? options.type : void 0,
|
|
407
|
-
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
408
|
-
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
409
|
-
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
410
|
-
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
411
|
-
media: "string" === typeof options.media ? options.media : void 0
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
};
|
|
415
|
-
exports.preloadModule = function(href, options) {
|
|
416
|
-
var encountered = "";
|
|
417
|
-
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
418
|
-
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
419
|
-
encountered && console.error(
|
|
420
|
-
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
|
421
|
-
encountered
|
|
422
|
-
);
|
|
423
|
-
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(
|
|
424
|
-
options.as,
|
|
425
|
-
options.crossOrigin
|
|
426
|
-
), Internals.d.m(href, {
|
|
427
|
-
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
428
|
-
crossOrigin: encountered,
|
|
429
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
430
|
-
})) : Internals.d.m(href));
|
|
431
|
-
};
|
|
432
|
-
exports.requestFormReset = function(form) {
|
|
433
|
-
Internals.d.r(form);
|
|
434
|
-
};
|
|
435
|
-
exports.unstable_batchedUpdates = function(fn, a) {
|
|
436
|
-
return fn(a);
|
|
437
|
-
};
|
|
438
|
-
exports.useFormState = function(action, initialState, permalink) {
|
|
439
|
-
return resolveDispatcher().useFormState(action, initialState, permalink);
|
|
440
|
-
};
|
|
441
|
-
exports.useFormStatus = function() {
|
|
442
|
-
return resolveDispatcher().useHostTransitionStatus();
|
|
443
|
-
};
|
|
444
|
-
exports.version = "19.1.1";
|
|
445
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
446
|
-
}();
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
// node_modules/react-dom/index.js
|
|
451
|
-
var require_react_dom = __commonJS({
|
|
452
|
-
"node_modules/react-dom/index.js"(exports, module) {
|
|
453
|
-
function checkDCE() {
|
|
454
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
if (process.env.NODE_ENV !== "production") {
|
|
458
|
-
throw new Error("^_^");
|
|
459
|
-
}
|
|
460
|
-
try {
|
|
461
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
|
462
|
-
} catch (err) {
|
|
463
|
-
console.error(err);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
if (process.env.NODE_ENV === "production") {
|
|
467
|
-
checkDCE();
|
|
468
|
-
module.exports = require_react_dom_production();
|
|
469
|
-
} else {
|
|
470
|
-
module.exports = require_react_dom_development();
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
});
|
|
27
|
+
// src/components/LegendList.tsx
|
|
474
28
|
var ContextState = React3__namespace.createContext(null);
|
|
475
29
|
function StateProvider({ children }) {
|
|
476
30
|
const [value] = React3__namespace.useState(() => ({
|
|
@@ -1139,30 +693,33 @@ function useThrottleDebounce(mode) {
|
|
|
1139
693
|
timeoutRef.current = null;
|
|
1140
694
|
}
|
|
1141
695
|
};
|
|
1142
|
-
const execute = React3.useCallback(
|
|
1143
|
-
{
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
lastCallTimeRef.current
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
696
|
+
const execute = React3.useCallback(
|
|
697
|
+
(callback, delay, ...args) => {
|
|
698
|
+
{
|
|
699
|
+
const now = Date.now();
|
|
700
|
+
lastArgsRef.current = args;
|
|
701
|
+
if (now - lastCallTimeRef.current >= delay) {
|
|
702
|
+
lastCallTimeRef.current = now;
|
|
703
|
+
callback(...args);
|
|
704
|
+
clearTimeoutRef();
|
|
705
|
+
} else {
|
|
706
|
+
clearTimeoutRef();
|
|
707
|
+
timeoutRef.current = setTimeout(
|
|
708
|
+
() => {
|
|
709
|
+
if (lastArgsRef.current) {
|
|
710
|
+
lastCallTimeRef.current = Date.now();
|
|
711
|
+
callback(...lastArgsRef.current);
|
|
712
|
+
timeoutRef.current = null;
|
|
713
|
+
lastArgsRef.current = null;
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
delay - (now - lastCallTimeRef.current)
|
|
717
|
+
);
|
|
718
|
+
}
|
|
1163
719
|
}
|
|
1164
|
-
}
|
|
1165
|
-
|
|
720
|
+
},
|
|
721
|
+
[mode]
|
|
722
|
+
);
|
|
1166
723
|
return execute;
|
|
1167
724
|
}
|
|
1168
725
|
|
|
@@ -1358,7 +915,7 @@ function calculateOffsetForIndex(ctx, state, index) {
|
|
|
1358
915
|
}
|
|
1359
916
|
|
|
1360
917
|
// src/utils/getItemSize.ts
|
|
1361
|
-
function getItemSize(state, key, index, data, useAverageSize, defaultAverageSize
|
|
918
|
+
function getItemSize(state, key, index, data, useAverageSize, defaultAverageSize) {
|
|
1362
919
|
var _a, _b;
|
|
1363
920
|
const {
|
|
1364
921
|
sizesKnown,
|
|
@@ -1379,11 +936,7 @@ function getItemSize(state, key, index, data, useAverageSize, defaultAverageSize
|
|
|
1379
936
|
sizesKnown.set(key, size);
|
|
1380
937
|
}
|
|
1381
938
|
}
|
|
1382
|
-
|
|
1383
|
-
if (size === void 0 && preferRenderedCache && renderedSize !== void 0) {
|
|
1384
|
-
return renderedSize;
|
|
1385
|
-
}
|
|
1386
|
-
if (size === void 0 && useAverageSize && !scrollingTo) {
|
|
939
|
+
if (size === void 0 && useAverageSize && sizeKnown === void 0 && !scrollingTo) {
|
|
1387
940
|
if (itemType === "") {
|
|
1388
941
|
size = defaultAverageSize;
|
|
1389
942
|
} else {
|
|
@@ -1393,8 +946,11 @@ function getItemSize(state, key, index, data, useAverageSize, defaultAverageSize
|
|
|
1393
946
|
}
|
|
1394
947
|
}
|
|
1395
948
|
}
|
|
1396
|
-
if (size === void 0
|
|
1397
|
-
|
|
949
|
+
if (size === void 0) {
|
|
950
|
+
size = sizes.get(key);
|
|
951
|
+
if (size !== void 0) {
|
|
952
|
+
return size;
|
|
953
|
+
}
|
|
1398
954
|
}
|
|
1399
955
|
if (size === void 0) {
|
|
1400
956
|
size = getEstimatedItemSize ? getEstimatedItemSize(index, data, itemType) : estimatedItemSize;
|
|
@@ -1621,44 +1177,6 @@ function addTotalSize(ctx, state, key, add) {
|
|
|
1621
1177
|
}
|
|
1622
1178
|
}
|
|
1623
1179
|
|
|
1624
|
-
// src/utils/getScrollVelocity.ts
|
|
1625
|
-
var getScrollVelocity = (state) => {
|
|
1626
|
-
const { scrollHistory } = state;
|
|
1627
|
-
let velocity = 0;
|
|
1628
|
-
if (scrollHistory.length >= 1) {
|
|
1629
|
-
const newest = scrollHistory[scrollHistory.length - 1];
|
|
1630
|
-
let oldest;
|
|
1631
|
-
let start = 0;
|
|
1632
|
-
const now = Date.now();
|
|
1633
|
-
for (let i = 0; i < scrollHistory.length - 1; i++) {
|
|
1634
|
-
const entry = scrollHistory[i];
|
|
1635
|
-
const nextEntry = scrollHistory[i + 1];
|
|
1636
|
-
if (i > 0) {
|
|
1637
|
-
const prevEntry = scrollHistory[i - 1];
|
|
1638
|
-
const prevDirection = entry.scroll - prevEntry.scroll;
|
|
1639
|
-
const currentDirection = nextEntry.scroll - entry.scroll;
|
|
1640
|
-
if (prevDirection > 0 && currentDirection < 0 || prevDirection < 0 && currentDirection > 0) {
|
|
1641
|
-
start = i;
|
|
1642
|
-
break;
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
for (let i = start; i < scrollHistory.length - 1; i++) {
|
|
1647
|
-
const entry = scrollHistory[i];
|
|
1648
|
-
if (now - entry.time <= 1e3) {
|
|
1649
|
-
oldest = entry;
|
|
1650
|
-
break;
|
|
1651
|
-
}
|
|
1652
|
-
}
|
|
1653
|
-
if (oldest && oldest !== newest) {
|
|
1654
|
-
const scrollDiff = newest.scroll - oldest.scroll;
|
|
1655
|
-
const timeDiff = newest.time - oldest.time;
|
|
1656
|
-
velocity = timeDiff > 0 ? scrollDiff / timeDiff : 0;
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1659
|
-
return velocity;
|
|
1660
|
-
};
|
|
1661
|
-
|
|
1662
1180
|
// src/utils/updateSnapToOffsets.ts
|
|
1663
1181
|
function updateSnapToOffsets(ctx, state) {
|
|
1664
1182
|
const {
|
|
@@ -1675,84 +1193,48 @@ function updateSnapToOffsets(ctx, state) {
|
|
|
1675
1193
|
}
|
|
1676
1194
|
|
|
1677
1195
|
// src/core/updateAllPositions.ts
|
|
1678
|
-
function updateAllPositions(ctx, state, dataChanged) {
|
|
1679
|
-
var _a, _b, _c, _d, _e;
|
|
1196
|
+
function updateAllPositions(ctx, state, dataChanged, startIndex = 0) {
|
|
1197
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1680
1198
|
const {
|
|
1681
1199
|
averageSizes,
|
|
1682
1200
|
columns,
|
|
1683
1201
|
indexByKey,
|
|
1684
1202
|
positions,
|
|
1685
|
-
firstFullyOnScreenIndex,
|
|
1686
1203
|
idCache,
|
|
1687
1204
|
sizesKnown,
|
|
1688
|
-
props: { getEstimatedItemSize, snapToIndices }
|
|
1205
|
+
props: { getEstimatedItemSize, snapToIndices, enableAverages }
|
|
1689
1206
|
} = state;
|
|
1690
1207
|
const data = state.props.data;
|
|
1691
1208
|
const numColumns = peek$(ctx, "numColumns");
|
|
1692
1209
|
const indexByKeyForChecking = __DEV__ ? /* @__PURE__ */ new Map() : void 0;
|
|
1693
|
-
const
|
|
1694
|
-
const useAverageSize = !getEstimatedItemSize;
|
|
1210
|
+
const useAverageSize = enableAverages && !getEstimatedItemSize;
|
|
1695
1211
|
const itemType = "";
|
|
1696
1212
|
let averageSize = (_a = averageSizes[itemType]) == null ? void 0 : _a.avg;
|
|
1697
1213
|
if (averageSize !== void 0) {
|
|
1698
1214
|
averageSize = roundSize(averageSize);
|
|
1699
1215
|
}
|
|
1700
|
-
const shouldUseBackwards = !dataChanged && scrollVelocity < 0 && firstFullyOnScreenIndex > 5 && firstFullyOnScreenIndex < data.length;
|
|
1701
|
-
if (shouldUseBackwards && firstFullyOnScreenIndex !== void 0) {
|
|
1702
|
-
const anchorId = getId(state, firstFullyOnScreenIndex);
|
|
1703
|
-
const anchorPosition = positions.get(anchorId);
|
|
1704
|
-
if (anchorPosition !== void 0) {
|
|
1705
|
-
let currentRowTop2 = anchorPosition;
|
|
1706
|
-
let maxSizeInRow2 = 0;
|
|
1707
|
-
let bailout = false;
|
|
1708
|
-
for (let i = firstFullyOnScreenIndex - 1; i >= 0; i--) {
|
|
1709
|
-
const id = (_b = idCache.get(i)) != null ? _b : getId(state, i);
|
|
1710
|
-
const size = (_c = sizesKnown.get(id)) != null ? _c : getItemSize(
|
|
1711
|
-
state,
|
|
1712
|
-
id,
|
|
1713
|
-
i,
|
|
1714
|
-
data[i],
|
|
1715
|
-
useAverageSize,
|
|
1716
|
-
averageSize,
|
|
1717
|
-
/*preferRenderedCache*/
|
|
1718
|
-
!!dataChanged
|
|
1719
|
-
);
|
|
1720
|
-
const itemColumn = columns.get(id);
|
|
1721
|
-
maxSizeInRow2 = Math.max(maxSizeInRow2, size);
|
|
1722
|
-
if (itemColumn === 1) {
|
|
1723
|
-
currentRowTop2 -= maxSizeInRow2;
|
|
1724
|
-
maxSizeInRow2 = 0;
|
|
1725
|
-
}
|
|
1726
|
-
if (currentRowTop2 < -2e3) {
|
|
1727
|
-
bailout = true;
|
|
1728
|
-
break;
|
|
1729
|
-
}
|
|
1730
|
-
positions.set(id, currentRowTop2);
|
|
1731
|
-
}
|
|
1732
|
-
if (!bailout) {
|
|
1733
|
-
updateTotalSize(ctx, state);
|
|
1734
|
-
return;
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
1216
|
let currentRowTop = 0;
|
|
1739
1217
|
let column = 1;
|
|
1740
1218
|
let maxSizeInRow = 0;
|
|
1741
1219
|
const hasColumns = numColumns > 1;
|
|
1220
|
+
if (startIndex > 0) {
|
|
1221
|
+
const prevIndex = startIndex - 1;
|
|
1222
|
+
const prevId = (_b = idCache.get(prevIndex)) != null ? _b : getId(state, prevIndex);
|
|
1223
|
+
const prevPosition = (_c = positions.get(prevId)) != null ? _c : 0;
|
|
1224
|
+
if (hasColumns) {
|
|
1225
|
+
const prevColumn = (_d = columns.get(prevId)) != null ? _d : 1;
|
|
1226
|
+
currentRowTop = prevPosition;
|
|
1227
|
+
column = prevColumn % numColumns + 1;
|
|
1228
|
+
} else {
|
|
1229
|
+
const prevSize = (_e = sizesKnown.get(prevId)) != null ? _e : getItemSize(state, prevId, prevIndex, data[prevIndex], useAverageSize, averageSize);
|
|
1230
|
+
currentRowTop = prevPosition + prevSize;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1742
1233
|
const needsIndexByKey = dataChanged || indexByKey.size === 0;
|
|
1743
1234
|
const dataLength = data.length;
|
|
1744
|
-
for (let i =
|
|
1745
|
-
const id = (
|
|
1746
|
-
const size = (
|
|
1747
|
-
state,
|
|
1748
|
-
id,
|
|
1749
|
-
i,
|
|
1750
|
-
data[i],
|
|
1751
|
-
useAverageSize,
|
|
1752
|
-
averageSize,
|
|
1753
|
-
/*preferRenderedCache*/
|
|
1754
|
-
!!dataChanged
|
|
1755
|
-
);
|
|
1235
|
+
for (let i = startIndex; i < dataLength; i++) {
|
|
1236
|
+
const id = (_f = idCache.get(i)) != null ? _f : getId(state, i);
|
|
1237
|
+
const size = (_g = sizesKnown.get(id)) != null ? _g : getItemSize(state, id, i, data[i], useAverageSize, averageSize);
|
|
1756
1238
|
if (__DEV__ && needsIndexByKey) {
|
|
1757
1239
|
if (indexByKeyForChecking.has(id)) {
|
|
1758
1240
|
console.error(
|
|
@@ -2115,6 +1597,44 @@ function comparatorByDistance(a, b) {
|
|
|
2115
1597
|
return b.distance - a.distance;
|
|
2116
1598
|
}
|
|
2117
1599
|
|
|
1600
|
+
// src/utils/getScrollVelocity.ts
|
|
1601
|
+
var getScrollVelocity = (state) => {
|
|
1602
|
+
const { scrollHistory } = state;
|
|
1603
|
+
let velocity = 0;
|
|
1604
|
+
if (scrollHistory.length >= 1) {
|
|
1605
|
+
const newest = scrollHistory[scrollHistory.length - 1];
|
|
1606
|
+
let oldest;
|
|
1607
|
+
let start = 0;
|
|
1608
|
+
const now = Date.now();
|
|
1609
|
+
for (let i = 0; i < scrollHistory.length - 1; i++) {
|
|
1610
|
+
const entry = scrollHistory[i];
|
|
1611
|
+
const nextEntry = scrollHistory[i + 1];
|
|
1612
|
+
if (i > 0) {
|
|
1613
|
+
const prevEntry = scrollHistory[i - 1];
|
|
1614
|
+
const prevDirection = entry.scroll - prevEntry.scroll;
|
|
1615
|
+
const currentDirection = nextEntry.scroll - entry.scroll;
|
|
1616
|
+
if (prevDirection > 0 && currentDirection < 0 || prevDirection < 0 && currentDirection > 0) {
|
|
1617
|
+
start = i;
|
|
1618
|
+
break;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
for (let i = start; i < scrollHistory.length - 1; i++) {
|
|
1623
|
+
const entry = scrollHistory[i];
|
|
1624
|
+
if (now - entry.time <= 1e3) {
|
|
1625
|
+
oldest = entry;
|
|
1626
|
+
break;
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
if (oldest && oldest !== newest) {
|
|
1630
|
+
const scrollDiff = newest.scroll - oldest.scroll;
|
|
1631
|
+
const timeDiff = newest.time - oldest.time;
|
|
1632
|
+
velocity = timeDiff > 0 ? scrollDiff / timeDiff : 0;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
return velocity;
|
|
1636
|
+
};
|
|
1637
|
+
|
|
2118
1638
|
// src/core/scrollToIndex.ts
|
|
2119
1639
|
function scrollToIndex(ctx, state, { index, viewOffset = 0, animated = true, viewPosition }) {
|
|
2120
1640
|
if (index >= state.props.data.length) {
|
|
@@ -2225,9 +1745,6 @@ function setDidLayout(ctx, state) {
|
|
|
2225
1745
|
}
|
|
2226
1746
|
}
|
|
2227
1747
|
|
|
2228
|
-
// src/platform/BatchedUpdates.ts
|
|
2229
|
-
var import_react_dom = __toESM(require_react_dom());
|
|
2230
|
-
|
|
2231
1748
|
// src/core/calculateItemsInView.ts
|
|
2232
1749
|
function findCurrentStickyIndex(stickyArray, scroll, state) {
|
|
2233
1750
|
var _a;
|
|
@@ -2292,7 +1809,7 @@ function handleStickyRecycling(ctx, state, stickyArray, scroll, scrollBuffer, pe
|
|
|
2292
1809
|
}
|
|
2293
1810
|
}
|
|
2294
1811
|
function calculateItemsInView(ctx, state, params = {}) {
|
|
2295
|
-
|
|
1812
|
+
reactNative.unstable_batchedUpdates(() => {
|
|
2296
1813
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2297
1814
|
const {
|
|
2298
1815
|
columns,
|
|
@@ -2329,7 +1846,11 @@ function calculateItemsInView(ctx, state, params = {}) {
|
|
|
2329
1846
|
idCache.clear();
|
|
2330
1847
|
positions.clear();
|
|
2331
1848
|
}
|
|
2332
|
-
|
|
1849
|
+
const startIndex = dataChanged ? 0 : minIndexSizeChanged != null ? minIndexSizeChanged : 0;
|
|
1850
|
+
updateAllPositions(ctx, state, dataChanged, startIndex);
|
|
1851
|
+
if (minIndexSizeChanged !== void 0) {
|
|
1852
|
+
state.minIndexSizeChanged = void 0;
|
|
1853
|
+
}
|
|
2333
1854
|
checkMVCP == null ? void 0 : checkMVCP();
|
|
2334
1855
|
}
|
|
2335
1856
|
const scrollExtra = 0;
|
|
@@ -2376,10 +1897,6 @@ function calculateItemsInView(ctx, state, params = {}) {
|
|
|
2376
1897
|
let endNoBuffer = null;
|
|
2377
1898
|
let endBuffered = null;
|
|
2378
1899
|
let loopStart = startBufferedIdOrig ? indexByKey.get(startBufferedIdOrig) || 0 : 0;
|
|
2379
|
-
if (minIndexSizeChanged !== void 0) {
|
|
2380
|
-
loopStart = Math.min(minIndexSizeChanged, loopStart);
|
|
2381
|
-
state.minIndexSizeChanged = void 0;
|
|
2382
|
-
}
|
|
2383
1900
|
for (let i = loopStart; i >= 0; i--) {
|
|
2384
1901
|
const id = (_a = idCache.get(i)) != null ? _a : getId(state, i);
|
|
2385
1902
|
const top = positions.get(id);
|
|
@@ -2749,7 +2266,8 @@ function updateScroll(ctx, state, newScroll) {
|
|
|
2749
2266
|
state.lastBatchingAction = Date.now();
|
|
2750
2267
|
const currentTime = Date.now();
|
|
2751
2268
|
if (scrollingTo === void 0 && !(state.scrollHistory.length === 0 && newScroll === state.scroll)) {
|
|
2752
|
-
state.
|
|
2269
|
+
const adjust = state.scrollAdjustHandler.getAdjust();
|
|
2270
|
+
state.scrollHistory.push({ scroll: newScroll - adjust, time: currentTime });
|
|
2753
2271
|
}
|
|
2754
2272
|
if (state.scrollHistory.length > 5) {
|
|
2755
2273
|
state.scrollHistory.shift();
|
|
@@ -2785,13 +2303,19 @@ var ScrollAdjustHandler = class {
|
|
|
2785
2303
|
setMounted() {
|
|
2786
2304
|
this.mounted = true;
|
|
2787
2305
|
}
|
|
2306
|
+
getAdjust() {
|
|
2307
|
+
return this.appliedAdjust;
|
|
2308
|
+
}
|
|
2788
2309
|
};
|
|
2789
2310
|
|
|
2790
2311
|
// src/core/updateItemSize.ts
|
|
2791
|
-
function
|
|
2792
|
-
var _a;
|
|
2312
|
+
function updateItemSize(ctx, state, itemKey, sizeObj) {
|
|
2313
|
+
var _a, _b;
|
|
2793
2314
|
const {
|
|
2315
|
+
sizesKnown,
|
|
2794
2316
|
props: {
|
|
2317
|
+
getFixedItemSize,
|
|
2318
|
+
getItemType,
|
|
2795
2319
|
horizontal,
|
|
2796
2320
|
maintainVisibleContentPosition,
|
|
2797
2321
|
suggestEstimatedItemSize,
|
|
@@ -2801,47 +2325,60 @@ function updateItemSizes(ctx, state, itemUpdates) {
|
|
|
2801
2325
|
}
|
|
2802
2326
|
} = state;
|
|
2803
2327
|
if (!data) return;
|
|
2328
|
+
if (getFixedItemSize) {
|
|
2329
|
+
const index2 = state.indexByKey.get(itemKey);
|
|
2330
|
+
if (index2 === void 0) {
|
|
2331
|
+
return;
|
|
2332
|
+
}
|
|
2333
|
+
const itemData = state.props.data[index2];
|
|
2334
|
+
if (itemData === void 0) {
|
|
2335
|
+
return;
|
|
2336
|
+
}
|
|
2337
|
+
const type = getItemType ? (_a = getItemType(itemData, index2)) != null ? _a : "" : "";
|
|
2338
|
+
const size2 = getFixedItemSize(index2, itemData, type);
|
|
2339
|
+
if (size2 !== void 0 && size2 === sizesKnown.get(itemKey)) {
|
|
2340
|
+
return;
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2804
2343
|
const containersDidLayout = peek$(ctx, "containersDidLayout");
|
|
2805
2344
|
let needsRecalculate = !containersDidLayout;
|
|
2806
2345
|
let shouldMaintainScrollAtEnd = false;
|
|
2807
2346
|
let minIndexSizeChanged;
|
|
2808
2347
|
let maxOtherAxisSize = peek$(ctx, "otherAxisSize") || 0;
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
break;
|
|
2827
|
-
}
|
|
2348
|
+
const index = state.indexByKey.get(itemKey);
|
|
2349
|
+
const prevSizeKnown = state.sizesKnown.get(itemKey);
|
|
2350
|
+
const diff = updateOneItemSize(state, itemKey, sizeObj);
|
|
2351
|
+
const size = Math.floor((horizontal ? sizeObj.width : sizeObj.height) * 8) / 8;
|
|
2352
|
+
if (diff !== 0) {
|
|
2353
|
+
minIndexSizeChanged = minIndexSizeChanged !== void 0 ? Math.min(minIndexSizeChanged, index) : index;
|
|
2354
|
+
if (((_b = state.scrollingTo) == null ? void 0 : _b.viewPosition) && maintainVisibleContentPosition && index === state.scrollingTo.index && diff > 0) {
|
|
2355
|
+
requestAdjust(ctx, state, diff * state.scrollingTo.viewPosition);
|
|
2356
|
+
}
|
|
2357
|
+
const { startBuffered, endBuffered } = state;
|
|
2358
|
+
needsRecalculate || (needsRecalculate = index >= startBuffered && index <= endBuffered);
|
|
2359
|
+
if (!needsRecalculate) {
|
|
2360
|
+
const numContainers = ctx.values.get("numContainers");
|
|
2361
|
+
for (let i = 0; i < numContainers; i++) {
|
|
2362
|
+
if (peek$(ctx, `containerItemKey${i}`) === itemKey) {
|
|
2363
|
+
needsRecalculate = true;
|
|
2364
|
+
break;
|
|
2828
2365
|
}
|
|
2829
2366
|
}
|
|
2830
|
-
if (state.needsOtherAxisSize) {
|
|
2831
|
-
const otherAxisSize = horizontal ? sizeObj.height : sizeObj.width;
|
|
2832
|
-
maxOtherAxisSize = Math.max(maxOtherAxisSize, otherAxisSize);
|
|
2833
|
-
}
|
|
2834
|
-
if (prevSizeKnown !== void 0 && Math.abs(prevSizeKnown - size) > 5) {
|
|
2835
|
-
shouldMaintainScrollAtEnd = true;
|
|
2836
|
-
}
|
|
2837
|
-
onItemSizeChanged == null ? void 0 : onItemSizeChanged({
|
|
2838
|
-
index,
|
|
2839
|
-
itemData: state.props.data[index],
|
|
2840
|
-
itemKey,
|
|
2841
|
-
previous: size - diff,
|
|
2842
|
-
size
|
|
2843
|
-
});
|
|
2844
2367
|
}
|
|
2368
|
+
if (state.needsOtherAxisSize) {
|
|
2369
|
+
const otherAxisSize = horizontal ? sizeObj.height : sizeObj.width;
|
|
2370
|
+
maxOtherAxisSize = Math.max(maxOtherAxisSize, otherAxisSize);
|
|
2371
|
+
}
|
|
2372
|
+
if (prevSizeKnown !== void 0 && Math.abs(prevSizeKnown - size) > 5) {
|
|
2373
|
+
shouldMaintainScrollAtEnd = true;
|
|
2374
|
+
}
|
|
2375
|
+
onItemSizeChanged == null ? void 0 : onItemSizeChanged({
|
|
2376
|
+
index,
|
|
2377
|
+
itemData: state.props.data[index],
|
|
2378
|
+
itemKey,
|
|
2379
|
+
previous: size - diff,
|
|
2380
|
+
size
|
|
2381
|
+
});
|
|
2845
2382
|
}
|
|
2846
2383
|
if (minIndexSizeChanged !== void 0) {
|
|
2847
2384
|
state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, minIndexSizeChanged) : minIndexSizeChanged;
|
|
@@ -2874,45 +2411,6 @@ function updateItemSizes(ctx, state, itemUpdates) {
|
|
|
2874
2411
|
}
|
|
2875
2412
|
}
|
|
2876
2413
|
}
|
|
2877
|
-
function updateItemSize(ctx, state, itemKey, sizeObj) {
|
|
2878
|
-
var _a;
|
|
2879
|
-
const {
|
|
2880
|
-
queuedItemSizeUpdates,
|
|
2881
|
-
queuedItemSizeUpdatesWaiting,
|
|
2882
|
-
sizesKnown,
|
|
2883
|
-
props: { getFixedItemSize, getItemType }
|
|
2884
|
-
} = state;
|
|
2885
|
-
if (getFixedItemSize) {
|
|
2886
|
-
const index = state.indexByKey.get(itemKey);
|
|
2887
|
-
if (index === void 0) {
|
|
2888
|
-
return;
|
|
2889
|
-
}
|
|
2890
|
-
const itemData = state.props.data[index];
|
|
2891
|
-
if (itemData === void 0) {
|
|
2892
|
-
return;
|
|
2893
|
-
}
|
|
2894
|
-
const type = getItemType ? (_a = getItemType(itemData, index)) != null ? _a : "" : "";
|
|
2895
|
-
const size = getFixedItemSize(index, itemData, type);
|
|
2896
|
-
if (size !== void 0 && size === sizesKnown.get(itemKey)) {
|
|
2897
|
-
return;
|
|
2898
|
-
}
|
|
2899
|
-
}
|
|
2900
|
-
const containersDidLayout = peek$(ctx, "containersDidLayout");
|
|
2901
|
-
const speed = getScrollVelocity(state);
|
|
2902
|
-
if (!containersDidLayout || !queuedItemSizeUpdatesWaiting || Math.abs(speed) < 1) {
|
|
2903
|
-
updateItemSizes(ctx, state, [{ itemKey, sizeObj }]);
|
|
2904
|
-
if (containersDidLayout) {
|
|
2905
|
-
state.queuedItemSizeUpdatesWaiting = true;
|
|
2906
|
-
requestAnimationFrame(() => {
|
|
2907
|
-
state.queuedItemSizeUpdatesWaiting = false;
|
|
2908
|
-
updateItemSizes(ctx, state, queuedItemSizeUpdates);
|
|
2909
|
-
queuedItemSizeUpdates.length = 0;
|
|
2910
|
-
});
|
|
2911
|
-
}
|
|
2912
|
-
} else {
|
|
2913
|
-
queuedItemSizeUpdates.push({ itemKey, sizeObj });
|
|
2914
|
-
}
|
|
2915
|
-
}
|
|
2916
2414
|
function updateOneItemSize(state, itemKey, sizeObj) {
|
|
2917
2415
|
var _a;
|
|
2918
2416
|
const {
|
|
@@ -3000,11 +2498,9 @@ function getRenderedItem(ctx, state, key) {
|
|
|
3000
2498
|
}
|
|
3001
2499
|
|
|
3002
2500
|
// src/utils/throttledOnScroll.ts
|
|
3003
|
-
function
|
|
2501
|
+
function useThrottledOnScroll(originalHandler, scrollEventThrottle) {
|
|
3004
2502
|
const throttle = useThrottleDebounce("throttle");
|
|
3005
|
-
return (event) => {
|
|
3006
|
-
throttle(originalHandler, scrollEventThrottle, event);
|
|
3007
|
-
};
|
|
2503
|
+
return (event) => throttle(originalHandler, scrollEventThrottle, { nativeEvent: event.nativeEvent });
|
|
3008
2504
|
}
|
|
3009
2505
|
|
|
3010
2506
|
// src/utils/updateAveragesOnDataChange.ts
|
|
@@ -3086,6 +2582,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3086
2582
|
contentContainerStyle: contentContainerStyleProp,
|
|
3087
2583
|
data: dataProp = [],
|
|
3088
2584
|
drawDistance = 250,
|
|
2585
|
+
enableAverages = true,
|
|
3089
2586
|
estimatedItemSize: estimatedItemSizeProp,
|
|
3090
2587
|
estimatedListSize,
|
|
3091
2588
|
extraData,
|
|
@@ -3172,11 +2669,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3172
2669
|
loadStartTime: Date.now(),
|
|
3173
2670
|
minIndexSizeChanged: 0,
|
|
3174
2671
|
nativeMarginTop: 0,
|
|
3175
|
-
pendingAdjust: 0,
|
|
3176
2672
|
positions: /* @__PURE__ */ new Map(),
|
|
3177
2673
|
props: {},
|
|
3178
2674
|
queuedCalculateItemsInView: 0,
|
|
3179
|
-
queuedItemSizeUpdates: [],
|
|
3180
2675
|
refScroller: void 0,
|
|
3181
2676
|
scroll: 0,
|
|
3182
2677
|
scrollAdjustHandler: new ScrollAdjustHandler(ctx),
|
|
@@ -3206,9 +2701,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3206
2701
|
const state = refState.current;
|
|
3207
2702
|
const isFirst = !state.props.renderItem;
|
|
3208
2703
|
const didDataChange = state.props.data !== dataProp;
|
|
2704
|
+
const throttleScrollFn = scrollEventThrottle && onScrollProp ? useThrottledOnScroll(onScrollProp, scrollEventThrottle) : onScrollProp;
|
|
3209
2705
|
state.props = {
|
|
3210
2706
|
alignItemsAtEnd,
|
|
3211
2707
|
data: dataProp,
|
|
2708
|
+
enableAverages,
|
|
3212
2709
|
estimatedItemSize,
|
|
3213
2710
|
getEstimatedItemSize,
|
|
3214
2711
|
getFixedItemSize,
|
|
@@ -3226,7 +2723,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3226
2723
|
onEndReachedThreshold,
|
|
3227
2724
|
onItemSizeChanged,
|
|
3228
2725
|
onLoad,
|
|
3229
|
-
onScroll:
|
|
2726
|
+
onScroll: throttleScrollFn,
|
|
3230
2727
|
onStartReached,
|
|
3231
2728
|
onStartReachedThreshold,
|
|
3232
2729
|
recycleItems: !!recycleItems,
|
|
@@ -3484,8 +2981,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3484
2981
|
}),
|
|
3485
2982
|
[]
|
|
3486
2983
|
);
|
|
3487
|
-
const
|
|
3488
|
-
const onScrollFn =
|
|
2984
|
+
const onScrollHandler = React3.useMemo(() => {
|
|
2985
|
+
const onScrollFn = fns.onScroll;
|
|
3489
2986
|
if (stickyIndices == null ? void 0 : stickyIndices.length) {
|
|
3490
2987
|
const { animatedScrollY } = ctx;
|
|
3491
2988
|
return reactNative.Animated.event([{ nativeEvent: { contentOffset: { [horizontal ? "x" : "y"]: animatedScrollY } } }], {
|
|
@@ -3524,7 +3021,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3524
3021
|
onMomentumScrollEnd(event);
|
|
3525
3022
|
}
|
|
3526
3023
|
},
|
|
3527
|
-
onScroll:
|
|
3024
|
+
onScroll: onScrollHandler,
|
|
3528
3025
|
recycleItems,
|
|
3529
3026
|
refreshControl: refreshControl ? stylePaddingTopState > 0 ? React3__namespace.cloneElement(refreshControl, {
|
|
3530
3027
|
progressViewOffset: (refreshControl.props.progressViewOffset || 0) + stylePaddingTopState
|
|
@@ -3547,30 +3044,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3547
3044
|
}
|
|
3548
3045
|
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */ React3__namespace.createElement(DebugView, { state: refState.current }));
|
|
3549
3046
|
});
|
|
3550
|
-
/*! Bundled license information:
|
|
3551
|
-
|
|
3552
|
-
react-dom/cjs/react-dom.production.js:
|
|
3553
|
-
(**
|
|
3554
|
-
* @license React
|
|
3555
|
-
* react-dom.production.js
|
|
3556
|
-
*
|
|
3557
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3558
|
-
*
|
|
3559
|
-
* This source code is licensed under the MIT license found in the
|
|
3560
|
-
* LICENSE file in the root directory of this source tree.
|
|
3561
|
-
*)
|
|
3562
|
-
|
|
3563
|
-
react-dom/cjs/react-dom.development.js:
|
|
3564
|
-
(**
|
|
3565
|
-
* @license React
|
|
3566
|
-
* react-dom.development.js
|
|
3567
|
-
*
|
|
3568
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3569
|
-
*
|
|
3570
|
-
* This source code is licensed under the MIT license found in the
|
|
3571
|
-
* LICENSE file in the root directory of this source tree.
|
|
3572
|
-
*)
|
|
3573
|
-
*/
|
|
3574
3047
|
|
|
3575
3048
|
exports.LegendList = LegendList;
|
|
3576
3049
|
exports.useIsLastItem = useIsLastItem;
|