@legendapp/list 2.0.10 → 2.0.11
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 +3 -0
- package/index.js +113 -113
- package/index.mjs +58 -58
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React2 = require('react');
|
|
4
4
|
var reactNative = require('react-native');
|
|
5
5
|
var shim = require('use-sync-external-store/shim');
|
|
6
6
|
|
|
@@ -22,12 +22,12 @@ function _interopNamespace(e) {
|
|
|
22
22
|
return Object.freeze(n);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
26
26
|
|
|
27
27
|
// src/components/LegendList.tsx
|
|
28
|
-
var ContextState =
|
|
28
|
+
var ContextState = React2__namespace.createContext(null);
|
|
29
29
|
function StateProvider({ children }) {
|
|
30
|
-
const [value] =
|
|
30
|
+
const [value] = React2__namespace.useState(() => ({
|
|
31
31
|
animatedScrollY: new reactNative.Animated.Value(0),
|
|
32
32
|
columnWrapperStyle: void 0,
|
|
33
33
|
internalState: void 0,
|
|
@@ -46,10 +46,10 @@ function StateProvider({ children }) {
|
|
|
46
46
|
]),
|
|
47
47
|
viewRefs: /* @__PURE__ */ new Map()
|
|
48
48
|
}));
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ React2__namespace.createElement(ContextState.Provider, { value }, children);
|
|
50
50
|
}
|
|
51
51
|
function useStateContext() {
|
|
52
|
-
return
|
|
52
|
+
return React2__namespace.useContext(ContextState);
|
|
53
53
|
}
|
|
54
54
|
function createSelectorFunctionsArr(ctx, signalNames) {
|
|
55
55
|
let lastValues = [];
|
|
@@ -119,23 +119,23 @@ function getContentSize(ctx) {
|
|
|
119
119
|
return headerSize + footerSize + totalSize + stylePaddingTop;
|
|
120
120
|
}
|
|
121
121
|
function useArr$(signalNames) {
|
|
122
|
-
const ctx =
|
|
123
|
-
const { subscribe, get } =
|
|
122
|
+
const ctx = React2__namespace.useContext(ContextState);
|
|
123
|
+
const { subscribe, get } = React2__namespace.useMemo(() => createSelectorFunctionsArr(ctx, signalNames), [ctx, signalNames]);
|
|
124
124
|
const value = shim.useSyncExternalStore(subscribe, get);
|
|
125
125
|
return value;
|
|
126
126
|
}
|
|
127
127
|
function useSelector$(signalName, selector) {
|
|
128
|
-
const ctx =
|
|
129
|
-
const { subscribe, get } =
|
|
128
|
+
const ctx = React2__namespace.useContext(ContextState);
|
|
129
|
+
const { subscribe, get } = React2__namespace.useMemo(() => createSelectorFunctionsArr(ctx, [signalName]), [ctx, signalName]);
|
|
130
130
|
const value = shim.useSyncExternalStore(subscribe, () => selector(get()[0]));
|
|
131
131
|
return value;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
// src/components/DebugView.tsx
|
|
135
135
|
var DebugRow = ({ children }) => {
|
|
136
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ React2__namespace.createElement(reactNative.View, { style: { alignItems: "center", flexDirection: "row", justifyContent: "space-between" } }, children);
|
|
137
137
|
};
|
|
138
|
-
var DebugView =
|
|
138
|
+
var DebugView = React2__namespace.memo(function DebugView2({ state }) {
|
|
139
139
|
const ctx = useStateContext();
|
|
140
140
|
const [totalSize = 0, scrollAdjust = 0, rawScroll = 0, scroll = 0, _numContainers = 0, _numContainersPooled = 0] = useArr$([
|
|
141
141
|
"totalSize",
|
|
@@ -146,11 +146,11 @@ var DebugView = React3__namespace.memo(function DebugView2({ state }) {
|
|
|
146
146
|
"numContainersPooled"
|
|
147
147
|
]);
|
|
148
148
|
const contentSize = getContentSize(ctx);
|
|
149
|
-
const [, forceUpdate] =
|
|
149
|
+
const [, forceUpdate] = React2.useReducer((x) => x + 1, 0);
|
|
150
150
|
useInterval(() => {
|
|
151
151
|
forceUpdate();
|
|
152
152
|
}, 100);
|
|
153
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ React2__namespace.createElement(
|
|
154
154
|
reactNative.View,
|
|
155
155
|
{
|
|
156
156
|
pointerEvents: "none",
|
|
@@ -166,18 +166,18 @@ var DebugView = React3__namespace.memo(function DebugView2({ state }) {
|
|
|
166
166
|
top: 0
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ React2__namespace.createElement(DebugRow, null, /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, "TotalSize:"), /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, totalSize.toFixed(2))),
|
|
170
|
+
/* @__PURE__ */ React2__namespace.createElement(DebugRow, null, /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, "ContentSize:"), /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, contentSize.toFixed(2))),
|
|
171
|
+
/* @__PURE__ */ React2__namespace.createElement(DebugRow, null, /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, "At end:"), /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, String(state.isAtEnd))),
|
|
172
|
+
/* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null),
|
|
173
|
+
/* @__PURE__ */ React2__namespace.createElement(DebugRow, null, /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, "ScrollAdjust:"), /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, scrollAdjust.toFixed(2))),
|
|
174
|
+
/* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null),
|
|
175
|
+
/* @__PURE__ */ React2__namespace.createElement(DebugRow, null, /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, "RawScroll: "), /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, rawScroll.toFixed(2))),
|
|
176
|
+
/* @__PURE__ */ React2__namespace.createElement(DebugRow, null, /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, "ComputedScroll: "), /* @__PURE__ */ React2__namespace.createElement(reactNative.Text, null, scroll.toFixed(2)))
|
|
177
177
|
);
|
|
178
178
|
});
|
|
179
179
|
function useInterval(callback, delay) {
|
|
180
|
-
|
|
180
|
+
React2.useEffect(() => {
|
|
181
181
|
const interval = setInterval(callback, delay);
|
|
182
182
|
return () => clearInterval(interval);
|
|
183
183
|
}, [delay]);
|
|
@@ -189,7 +189,7 @@ var ENABLE_DEVMODE = __DEV__ && false;
|
|
|
189
189
|
var ENABLE_DEBUG_VIEW = __DEV__ && false;
|
|
190
190
|
var IsNewArchitecture = global.nativeFabricUIManager != null;
|
|
191
191
|
var useAnimatedValue = (initialValue) => {
|
|
192
|
-
return
|
|
192
|
+
return React2.useRef(new reactNative.Animated.Value(initialValue)).current;
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
// src/hooks/useValue$.ts
|
|
@@ -198,7 +198,7 @@ function useValue$(key, params) {
|
|
|
198
198
|
const { getValue, delay } = params || {};
|
|
199
199
|
const ctx = useStateContext();
|
|
200
200
|
const animValue = useAnimatedValue((_a = getValue ? getValue(peek$(ctx, key)) : peek$(ctx, key)) != null ? _a : 0);
|
|
201
|
-
|
|
201
|
+
React2.useMemo(() => {
|
|
202
202
|
let newValue;
|
|
203
203
|
let prevValue;
|
|
204
204
|
let didQueueTask = false;
|
|
@@ -230,8 +230,8 @@ function useValue$(key, params) {
|
|
|
230
230
|
}, []);
|
|
231
231
|
return animValue;
|
|
232
232
|
}
|
|
233
|
-
var typedForwardRef =
|
|
234
|
-
var typedMemo =
|
|
233
|
+
var typedForwardRef = React2.forwardRef;
|
|
234
|
+
var typedMemo = React2.memo;
|
|
235
235
|
|
|
236
236
|
// src/components/PositionView.tsx
|
|
237
237
|
var PositionViewState = typedMemo(function PositionView({
|
|
@@ -242,7 +242,7 @@ var PositionViewState = typedMemo(function PositionView({
|
|
|
242
242
|
...rest
|
|
243
243
|
}) {
|
|
244
244
|
const [position = POSITION_OUT_OF_VIEW] = useArr$([`containerPosition${id}`]);
|
|
245
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ React2__namespace.createElement(
|
|
246
246
|
reactNative.View,
|
|
247
247
|
{
|
|
248
248
|
ref: refView,
|
|
@@ -270,7 +270,7 @@ var PositionViewAnimated = typedMemo(function PositionView2({
|
|
|
270
270
|
} else {
|
|
271
271
|
position = horizontal ? { left: position$ } : { top: position$ };
|
|
272
272
|
}
|
|
273
|
-
return /* @__PURE__ */
|
|
273
|
+
return /* @__PURE__ */ React2__namespace.createElement(reactNative.Animated.View, { ref: refView, style: [style, position], ...rest });
|
|
274
274
|
});
|
|
275
275
|
var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
276
276
|
id,
|
|
@@ -283,7 +283,7 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
283
283
|
...rest
|
|
284
284
|
}) {
|
|
285
285
|
const [position = POSITION_OUT_OF_VIEW, headerSize] = useArr$([`containerPosition${id}`, "headerSize"]);
|
|
286
|
-
const transform =
|
|
286
|
+
const transform = React2__namespace.useMemo(() => {
|
|
287
287
|
if (animatedScrollY && stickyOffset !== void 0) {
|
|
288
288
|
const stickyPosition = animatedScrollY.interpolate({
|
|
289
289
|
extrapolate: "clamp",
|
|
@@ -293,13 +293,13 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
293
293
|
return horizontal ? [{ translateX: stickyPosition }] : [{ translateY: stickyPosition }];
|
|
294
294
|
}
|
|
295
295
|
}, [animatedScrollY, headerSize, horizontal, stickyOffset, position]);
|
|
296
|
-
const viewStyle =
|
|
297
|
-
return /* @__PURE__ */
|
|
296
|
+
const viewStyle = React2__namespace.useMemo(() => [style, { zIndex: index + 1e3 }, { transform }], [style, transform]);
|
|
297
|
+
return /* @__PURE__ */ React2__namespace.createElement(reactNative.Animated.View, { ref: refView, style: viewStyle, ...rest });
|
|
298
298
|
});
|
|
299
299
|
var PositionView3 = IsNewArchitecture ? PositionViewState : PositionViewAnimated;
|
|
300
300
|
var symbolFirst = Symbol();
|
|
301
301
|
function useInit(cb) {
|
|
302
|
-
const refValue =
|
|
302
|
+
const refValue = React2.useRef(symbolFirst);
|
|
303
303
|
if (refValue.current === symbolFirst) {
|
|
304
304
|
refValue.current = cb();
|
|
305
305
|
}
|
|
@@ -338,10 +338,10 @@ function extractPadding(style, contentContainerStyle, type) {
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
// src/state/ContextContainer.ts
|
|
341
|
-
var ContextContainer =
|
|
341
|
+
var ContextContainer = React2.createContext(null);
|
|
342
342
|
function useViewability(callback, configId) {
|
|
343
343
|
const ctx = useStateContext();
|
|
344
|
-
const { containerId } =
|
|
344
|
+
const { containerId } = React2.useContext(ContextContainer);
|
|
345
345
|
const key = containerId + (configId != null ? configId : "");
|
|
346
346
|
useInit(() => {
|
|
347
347
|
const value = ctx.mapViewabilityValues.get(key);
|
|
@@ -350,7 +350,7 @@ function useViewability(callback, configId) {
|
|
|
350
350
|
}
|
|
351
351
|
});
|
|
352
352
|
ctx.mapViewabilityCallbacks.set(key, callback);
|
|
353
|
-
|
|
353
|
+
React2.useEffect(
|
|
354
354
|
() => () => {
|
|
355
355
|
ctx.mapViewabilityCallbacks.delete(key);
|
|
356
356
|
},
|
|
@@ -359,7 +359,7 @@ function useViewability(callback, configId) {
|
|
|
359
359
|
}
|
|
360
360
|
function useViewabilityAmount(callback) {
|
|
361
361
|
const ctx = useStateContext();
|
|
362
|
-
const { containerId } =
|
|
362
|
+
const { containerId } = React2.useContext(ContextContainer);
|
|
363
363
|
useInit(() => {
|
|
364
364
|
const value = ctx.mapViewabilityAmountValues.get(containerId);
|
|
365
365
|
if (value) {
|
|
@@ -367,7 +367,7 @@ function useViewabilityAmount(callback) {
|
|
|
367
367
|
}
|
|
368
368
|
});
|
|
369
369
|
ctx.mapViewabilityAmountCallbacks.set(containerId, callback);
|
|
370
|
-
|
|
370
|
+
React2.useEffect(
|
|
371
371
|
() => () => {
|
|
372
372
|
ctx.mapViewabilityAmountCallbacks.delete(containerId);
|
|
373
373
|
},
|
|
@@ -375,12 +375,12 @@ function useViewabilityAmount(callback) {
|
|
|
375
375
|
);
|
|
376
376
|
}
|
|
377
377
|
function useRecyclingEffect(effect) {
|
|
378
|
-
const { index, value } =
|
|
379
|
-
const prevValues =
|
|
378
|
+
const { index, value } = React2.useContext(ContextContainer);
|
|
379
|
+
const prevValues = React2.useRef({
|
|
380
380
|
prevIndex: void 0,
|
|
381
381
|
prevItem: void 0
|
|
382
382
|
});
|
|
383
|
-
|
|
383
|
+
React2.useEffect(() => {
|
|
384
384
|
let ret;
|
|
385
385
|
if (prevValues.current.prevIndex !== void 0 && prevValues.current.prevItem !== void 0) {
|
|
386
386
|
ret = effect({
|
|
@@ -398,12 +398,12 @@ function useRecyclingEffect(effect) {
|
|
|
398
398
|
}, [index, value, effect]);
|
|
399
399
|
}
|
|
400
400
|
function useRecyclingState(valueOrFun) {
|
|
401
|
-
const { index, value, itemKey, triggerLayout } =
|
|
402
|
-
const refState =
|
|
401
|
+
const { index, value, itemKey, triggerLayout } = React2.useContext(ContextContainer);
|
|
402
|
+
const refState = React2.useRef({
|
|
403
403
|
itemKey: null,
|
|
404
404
|
value: null
|
|
405
405
|
});
|
|
406
|
-
const [_, setRenderNum] =
|
|
406
|
+
const [_, setRenderNum] = React2.useState(0);
|
|
407
407
|
const state = refState.current;
|
|
408
408
|
if (state.itemKey !== itemKey) {
|
|
409
409
|
state.itemKey = itemKey;
|
|
@@ -414,7 +414,7 @@ function useRecyclingState(valueOrFun) {
|
|
|
414
414
|
prevItem: void 0
|
|
415
415
|
}) : valueOrFun;
|
|
416
416
|
}
|
|
417
|
-
const setState =
|
|
417
|
+
const setState = React2.useCallback(
|
|
418
418
|
(newState) => {
|
|
419
419
|
state.value = isFunction(newState) ? newState(state.value) : newState;
|
|
420
420
|
setRenderNum((v) => v + 1);
|
|
@@ -425,7 +425,7 @@ function useRecyclingState(valueOrFun) {
|
|
|
425
425
|
return [state.value, setState];
|
|
426
426
|
}
|
|
427
427
|
function useIsLastItem() {
|
|
428
|
-
const { itemKey } =
|
|
428
|
+
const { itemKey } = React2.useContext(ContextContainer);
|
|
429
429
|
const isLast = useSelector$("lastItemKeys", (lastItemKeys) => (lastItemKeys == null ? void 0 : lastItemKeys.includes(itemKey)) || false);
|
|
430
430
|
return isLast;
|
|
431
431
|
}
|
|
@@ -437,7 +437,7 @@ var noop = () => {
|
|
|
437
437
|
};
|
|
438
438
|
function useSyncLayout() {
|
|
439
439
|
if (IsNewArchitecture) {
|
|
440
|
-
const { triggerLayout: syncLayout } =
|
|
440
|
+
const { triggerLayout: syncLayout } = React2.useContext(ContextContainer);
|
|
441
441
|
return syncLayout;
|
|
442
442
|
} else {
|
|
443
443
|
return noop;
|
|
@@ -447,14 +447,14 @@ function useSyncLayout() {
|
|
|
447
447
|
// src/components/Separator.tsx
|
|
448
448
|
function Separator({ ItemSeparatorComponent, leadingItem }) {
|
|
449
449
|
const isLastItem = useIsLastItem();
|
|
450
|
-
return isLastItem ? null : /* @__PURE__ */
|
|
450
|
+
return isLastItem ? null : /* @__PURE__ */ React2__namespace.createElement(ItemSeparatorComponent, { leadingItem });
|
|
451
451
|
}
|
|
452
452
|
function useOnLayoutSync({
|
|
453
453
|
ref,
|
|
454
454
|
onLayoutProp,
|
|
455
455
|
onLayoutChange
|
|
456
456
|
}, deps = []) {
|
|
457
|
-
const onLayout =
|
|
457
|
+
const onLayout = React2.useCallback(
|
|
458
458
|
(event) => {
|
|
459
459
|
onLayoutChange(event.nativeEvent.layout, false);
|
|
460
460
|
onLayoutProp == null ? void 0 : onLayoutProp(event);
|
|
@@ -462,7 +462,7 @@ function useOnLayoutSync({
|
|
|
462
462
|
[onLayoutChange]
|
|
463
463
|
);
|
|
464
464
|
if (IsNewArchitecture) {
|
|
465
|
-
|
|
465
|
+
React2.useLayoutEffect(() => {
|
|
466
466
|
if (ref.current) {
|
|
467
467
|
ref.current.measure((x, y, width, height) => {
|
|
468
468
|
onLayoutChange({ height, width, x, y }, true);
|
|
@@ -493,13 +493,13 @@ var Container = typedMemo(function Container2({
|
|
|
493
493
|
`containerSticky${id}`,
|
|
494
494
|
`containerStickyOffset${id}`
|
|
495
495
|
]);
|
|
496
|
-
const refLastSize =
|
|
497
|
-
const ref =
|
|
498
|
-
const [layoutRenderCount, forceLayoutRender] =
|
|
496
|
+
const refLastSize = React2.useRef();
|
|
497
|
+
const ref = React2.useRef(null);
|
|
498
|
+
const [layoutRenderCount, forceLayoutRender] = React2.useState(0);
|
|
499
499
|
const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
|
|
500
500
|
const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
|
|
501
|
-
const didLayoutRef =
|
|
502
|
-
const style =
|
|
501
|
+
const didLayoutRef = React2.useRef(false);
|
|
502
|
+
const style = React2.useMemo(() => {
|
|
503
503
|
let paddingStyles;
|
|
504
504
|
if (columnWrapperStyle) {
|
|
505
505
|
const { columnGap, rowGap, gap } = columnWrapperStyle;
|
|
@@ -531,12 +531,12 @@ var Container = typedMemo(function Container2({
|
|
|
531
531
|
...paddingStyles || {}
|
|
532
532
|
};
|
|
533
533
|
}, [horizontal, otherAxisPos, otherAxisSize, columnWrapperStyle, numColumns]);
|
|
534
|
-
const renderedItemInfo =
|
|
534
|
+
const renderedItemInfo = React2.useMemo(
|
|
535
535
|
() => itemKey !== void 0 ? getRenderedItem2(itemKey) : null,
|
|
536
536
|
[itemKey, data, extraData]
|
|
537
537
|
);
|
|
538
538
|
const { index, renderedItem } = renderedItemInfo || {};
|
|
539
|
-
const contextValue =
|
|
539
|
+
const contextValue = React2.useMemo(() => {
|
|
540
540
|
ctx.viewRefs.set(id, ref);
|
|
541
541
|
return {
|
|
542
542
|
containerId: id,
|
|
@@ -577,7 +577,7 @@ var Container = typedMemo(function Container2({
|
|
|
577
577
|
[itemKey, layoutRenderCount]
|
|
578
578
|
);
|
|
579
579
|
if (!IsNewArchitecture) {
|
|
580
|
-
|
|
580
|
+
React2.useEffect(() => {
|
|
581
581
|
if (!isNullOrUndefined(itemKey)) {
|
|
582
582
|
const timeout = setTimeout(() => {
|
|
583
583
|
if (!didLayoutRef.current && refLastSize.current) {
|
|
@@ -592,7 +592,7 @@ var Container = typedMemo(function Container2({
|
|
|
592
592
|
}, [itemKey]);
|
|
593
593
|
}
|
|
594
594
|
const PositionComponent = isSticky ? PositionViewSticky : PositionView3;
|
|
595
|
-
return /* @__PURE__ */
|
|
595
|
+
return /* @__PURE__ */ React2__namespace.createElement(
|
|
596
596
|
PositionComponent,
|
|
597
597
|
{
|
|
598
598
|
animatedScrollY: isSticky ? animatedScrollY : void 0,
|
|
@@ -605,7 +605,7 @@ var Container = typedMemo(function Container2({
|
|
|
605
605
|
stickyOffset: isSticky ? stickyOffset : void 0,
|
|
606
606
|
style
|
|
607
607
|
},
|
|
608
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ React2__namespace.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && /* @__PURE__ */ React2__namespace.createElement(Separator, { ItemSeparatorComponent, leadingItem: renderedItemInfo.item }))
|
|
609
609
|
);
|
|
610
610
|
});
|
|
611
611
|
|
|
@@ -634,7 +634,7 @@ var Containers = typedMemo(function Containers2({
|
|
|
634
634
|
const containers = [];
|
|
635
635
|
for (let i = 0; i < numContainers; i++) {
|
|
636
636
|
containers.push(
|
|
637
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ React2__namespace.createElement(
|
|
638
638
|
Container,
|
|
639
639
|
{
|
|
640
640
|
getRenderedItem: getRenderedItem2,
|
|
@@ -669,18 +669,18 @@ var Containers = typedMemo(function Containers2({
|
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
|
-
return /* @__PURE__ */
|
|
672
|
+
return /* @__PURE__ */ React2__namespace.createElement(reactNative.Animated.View, { style }, containers);
|
|
673
673
|
});
|
|
674
674
|
var LayoutView = ({ onLayoutChange, refView, ...rest }) => {
|
|
675
|
-
const ref = refView != null ? refView :
|
|
675
|
+
const ref = refView != null ? refView : React2.useRef();
|
|
676
676
|
const { onLayout } = useOnLayoutSync({ onLayoutChange, ref });
|
|
677
|
-
return /* @__PURE__ */
|
|
677
|
+
return /* @__PURE__ */ React2__namespace.createElement(reactNative.View, { ...rest, onLayout, ref });
|
|
678
678
|
};
|
|
679
679
|
function ScrollAdjust() {
|
|
680
680
|
const bias = 1e7;
|
|
681
681
|
const [scrollAdjust, scrollAdjustUserOffset] = useArr$(["scrollAdjust", "scrollAdjustUserOffset"]);
|
|
682
682
|
const scrollOffset = (scrollAdjust || 0) + (scrollAdjustUserOffset || 0) + bias;
|
|
683
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ React2__namespace.createElement(
|
|
684
684
|
reactNative.View,
|
|
685
685
|
{
|
|
686
686
|
style: {
|
|
@@ -695,26 +695,26 @@ function ScrollAdjust() {
|
|
|
695
695
|
}
|
|
696
696
|
function SnapWrapper({ ScrollComponent, ...props }) {
|
|
697
697
|
const [snapToOffsets] = useArr$(["snapToOffsets"]);
|
|
698
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ React2__namespace.default.createElement(ScrollComponent, { ...props, snapToOffsets });
|
|
699
699
|
}
|
|
700
700
|
|
|
701
701
|
// src/components/ListComponent.tsx
|
|
702
702
|
var getComponent = (Component) => {
|
|
703
|
-
if (
|
|
703
|
+
if (React2__namespace.isValidElement(Component)) {
|
|
704
704
|
return Component;
|
|
705
705
|
}
|
|
706
706
|
if (Component) {
|
|
707
|
-
return /* @__PURE__ */
|
|
707
|
+
return /* @__PURE__ */ React2__namespace.createElement(Component, null);
|
|
708
708
|
}
|
|
709
709
|
return null;
|
|
710
710
|
};
|
|
711
711
|
var Padding = () => {
|
|
712
712
|
const animPaddingTop = useValue$("alignItemsPaddingTop", { delay: 0 });
|
|
713
|
-
return /* @__PURE__ */
|
|
713
|
+
return /* @__PURE__ */ React2__namespace.createElement(reactNative.Animated.View, { style: { paddingTop: animPaddingTop } });
|
|
714
714
|
};
|
|
715
715
|
var PaddingDevMode = () => {
|
|
716
716
|
const animPaddingTop = useValue$("alignItemsPaddingTop", { delay: 0 });
|
|
717
|
-
return /* @__PURE__ */
|
|
717
|
+
return /* @__PURE__ */ React2__namespace.createElement(React2__namespace.Fragment, null, /* @__PURE__ */ React2__namespace.createElement(reactNative.Animated.View, { style: { paddingTop: animPaddingTop } }), /* @__PURE__ */ React2__namespace.createElement(
|
|
718
718
|
reactNative.Animated.View,
|
|
719
719
|
{
|
|
720
720
|
style: {
|
|
@@ -757,11 +757,11 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
757
757
|
...rest
|
|
758
758
|
}) {
|
|
759
759
|
const ctx = useStateContext();
|
|
760
|
-
const ScrollComponent = renderScrollComponent ?
|
|
761
|
-
() =>
|
|
760
|
+
const ScrollComponent = renderScrollComponent ? React2.useMemo(
|
|
761
|
+
() => React2__namespace.forwardRef((props, ref) => renderScrollComponent({ ...props, ref })),
|
|
762
762
|
[renderScrollComponent]
|
|
763
763
|
) : reactNative.Animated.ScrollView;
|
|
764
|
-
|
|
764
|
+
React2__namespace.useEffect(() => {
|
|
765
765
|
if (canRender) {
|
|
766
766
|
setTimeout(() => {
|
|
767
767
|
scrollAdjustHandler.setMounted();
|
|
@@ -769,7 +769,7 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
769
769
|
}
|
|
770
770
|
}, [canRender]);
|
|
771
771
|
const SnapOrScroll = snapToIndices ? SnapWrapper : ScrollComponent;
|
|
772
|
-
return /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ React2__namespace.createElement(
|
|
773
773
|
SnapOrScroll,
|
|
774
774
|
{
|
|
775
775
|
...rest,
|
|
@@ -788,11 +788,11 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
788
788
|
ScrollComponent: snapToIndices ? ScrollComponent : void 0,
|
|
789
789
|
style
|
|
790
790
|
},
|
|
791
|
-
maintainVisibleContentPosition && /* @__PURE__ */
|
|
792
|
-
ENABLE_DEVMODE ? /* @__PURE__ */
|
|
793
|
-
ListHeaderComponent && /* @__PURE__ */
|
|
791
|
+
maintainVisibleContentPosition && /* @__PURE__ */ React2__namespace.createElement(ScrollAdjust, null),
|
|
792
|
+
ENABLE_DEVMODE ? /* @__PURE__ */ React2__namespace.createElement(PaddingDevMode, null) : /* @__PURE__ */ React2__namespace.createElement(Padding, null),
|
|
793
|
+
ListHeaderComponent && /* @__PURE__ */ React2__namespace.createElement(LayoutView, { onLayoutChange: onLayoutHeader, style: ListHeaderComponentStyle }, getComponent(ListHeaderComponent)),
|
|
794
794
|
ListEmptyComponent && getComponent(ListEmptyComponent),
|
|
795
|
-
canRender && !ListEmptyComponent && /* @__PURE__ */
|
|
795
|
+
canRender && !ListEmptyComponent && /* @__PURE__ */ React2__namespace.createElement(
|
|
796
796
|
Containers,
|
|
797
797
|
{
|
|
798
798
|
getRenderedItem: getRenderedItem2,
|
|
@@ -803,7 +803,7 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
803
803
|
waitForInitialLayout
|
|
804
804
|
}
|
|
805
805
|
),
|
|
806
|
-
ListFooterComponent && /* @__PURE__ */
|
|
806
|
+
ListFooterComponent && /* @__PURE__ */ React2__namespace.createElement(
|
|
807
807
|
LayoutView,
|
|
808
808
|
{
|
|
809
809
|
onLayoutChange: (layout) => {
|
|
@@ -814,11 +814,11 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
814
814
|
},
|
|
815
815
|
getComponent(ListFooterComponent)
|
|
816
816
|
),
|
|
817
|
-
__DEV__ && ENABLE_DEVMODE && /* @__PURE__ */
|
|
817
|
+
__DEV__ && ENABLE_DEVMODE && /* @__PURE__ */ React2__namespace.createElement(DevNumbers, null)
|
|
818
818
|
);
|
|
819
819
|
});
|
|
820
|
-
var DevNumbers = __DEV__ &&
|
|
821
|
-
return Array.from({ length: 100 }).map((_, index) => /* @__PURE__ */
|
|
820
|
+
var DevNumbers = __DEV__ && React2__namespace.memo(function DevNumbers2() {
|
|
821
|
+
return Array.from({ length: 100 }).map((_, index) => /* @__PURE__ */ React2__namespace.createElement(
|
|
822
822
|
reactNative.View,
|
|
823
823
|
{
|
|
824
824
|
key: index,
|
|
@@ -830,7 +830,7 @@ var DevNumbers = __DEV__ && React3__namespace.memo(function DevNumbers2() {
|
|
|
830
830
|
width: "100%"
|
|
831
831
|
}
|
|
832
832
|
},
|
|
833
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ React2__namespace.createElement(reactNative.Text, { style: { color: "red" } }, index * 100)
|
|
834
834
|
));
|
|
835
835
|
});
|
|
836
836
|
|
|
@@ -2605,7 +2605,7 @@ function updateOneItemSize(state, itemKey, sizeObj) {
|
|
|
2605
2605
|
return 0;
|
|
2606
2606
|
}
|
|
2607
2607
|
var useCombinedRef = (...refs) => {
|
|
2608
|
-
const callback =
|
|
2608
|
+
const callback = React2.useCallback((element) => {
|
|
2609
2609
|
for (const ref of refs) {
|
|
2610
2610
|
if (!ref) {
|
|
2611
2611
|
continue;
|
|
@@ -2658,21 +2658,21 @@ function getRenderedItem(ctx, state, key) {
|
|
|
2658
2658
|
item,
|
|
2659
2659
|
type: getItemType ? (_a = getItemType(item, index)) != null ? _a : "" : ""
|
|
2660
2660
|
};
|
|
2661
|
-
renderedItem = isFunction(renderItem) ? renderItem(itemProps) :
|
|
2661
|
+
renderedItem = isFunction(renderItem) ? renderItem(itemProps) : React2__namespace.default.createElement(renderItem, itemProps);
|
|
2662
2662
|
}
|
|
2663
2663
|
return { index, item: data[index], renderedItem };
|
|
2664
2664
|
}
|
|
2665
2665
|
function useThrottleDebounce(mode) {
|
|
2666
|
-
const timeoutRef =
|
|
2667
|
-
const lastCallTimeRef =
|
|
2668
|
-
const lastArgsRef =
|
|
2666
|
+
const timeoutRef = React2.useRef(null);
|
|
2667
|
+
const lastCallTimeRef = React2.useRef(0);
|
|
2668
|
+
const lastArgsRef = React2.useRef(null);
|
|
2669
2669
|
const clearTimeoutRef = () => {
|
|
2670
2670
|
if (timeoutRef.current) {
|
|
2671
2671
|
clearTimeout(timeoutRef.current);
|
|
2672
2672
|
timeoutRef.current = null;
|
|
2673
2673
|
}
|
|
2674
2674
|
};
|
|
2675
|
-
const execute =
|
|
2675
|
+
const execute = React2.useCallback(
|
|
2676
2676
|
(callback, delay, ...args) => {
|
|
2677
2677
|
{
|
|
2678
2678
|
const now = Date.now();
|
|
@@ -2717,14 +2717,14 @@ var LegendList = typedMemo(
|
|
|
2717
2717
|
const isChildrenMode = children !== void 0 && dataProp === void 0;
|
|
2718
2718
|
const processedProps = isChildrenMode ? {
|
|
2719
2719
|
...restProps,
|
|
2720
|
-
data: (isArray(children) ? children :
|
|
2720
|
+
data: (isArray(children) ? children : React2__namespace.Children.toArray(children)).flat(1),
|
|
2721
2721
|
renderItem: ({ item }) => item
|
|
2722
2722
|
} : {
|
|
2723
2723
|
...restProps,
|
|
2724
2724
|
data: dataProp || [],
|
|
2725
2725
|
renderItem: renderItemProp
|
|
2726
2726
|
};
|
|
2727
|
-
return /* @__PURE__ */
|
|
2727
|
+
return /* @__PURE__ */ React2__namespace.createElement(StateProvider, null, /* @__PURE__ */ React2__namespace.createElement(LegendListInner, { ...processedProps, ref: forwardedRef }));
|
|
2728
2728
|
})
|
|
2729
2729
|
);
|
|
2730
2730
|
var LegendListInner = typedForwardRef(function LegendListInner2(props, forwardedRef) {
|
|
@@ -2782,21 +2782,21 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2782
2782
|
waitForInitialLayout = true,
|
|
2783
2783
|
...rest
|
|
2784
2784
|
} = props;
|
|
2785
|
-
const [renderNum, setRenderNum] =
|
|
2785
|
+
const [renderNum, setRenderNum] = React2.useState(0);
|
|
2786
2786
|
const initialScroll = initialScrollIndexProp || initialScrollOffsetProp ? typeof initialScrollIndexProp === "object" ? { index: initialScrollIndexProp.index || 0, viewOffset: initialScrollIndexProp.viewOffset || 0 } : { index: initialScrollIndexProp || 0, viewOffset: initialScrollOffsetProp || 0 } : void 0;
|
|
2787
|
-
const [canRender, setCanRender] =
|
|
2787
|
+
const [canRender, setCanRender] = React2__namespace.useState(!IsNewArchitecture);
|
|
2788
2788
|
const contentContainerStyle = { ...reactNative.StyleSheet.flatten(contentContainerStyleProp) };
|
|
2789
2789
|
const style = { ...reactNative.StyleSheet.flatten(styleProp) };
|
|
2790
2790
|
const stylePaddingTopState = extractPadding(style, contentContainerStyle, "Top");
|
|
2791
2791
|
const stylePaddingBottomState = extractPadding(style, contentContainerStyle, "Bottom");
|
|
2792
2792
|
const ctx = useStateContext();
|
|
2793
2793
|
ctx.columnWrapperStyle = columnWrapperStyle || (contentContainerStyle ? createColumnWrapperStyle(contentContainerStyle) : void 0);
|
|
2794
|
-
const refScroller =
|
|
2794
|
+
const refScroller = React2.useRef(null);
|
|
2795
2795
|
const combinedRef = useCombinedRef(refScroller, refScrollView);
|
|
2796
2796
|
const estimatedItemSize = estimatedItemSizeProp != null ? estimatedItemSizeProp : DEFAULT_ITEM_SIZE;
|
|
2797
2797
|
const scrollBuffer = (drawDistance != null ? drawDistance : DEFAULT_DRAW_DISTANCE) || 1;
|
|
2798
2798
|
const keyExtractor = keyExtractorProp != null ? keyExtractorProp : (_item, index) => index.toString();
|
|
2799
|
-
const refState =
|
|
2799
|
+
const refState = React2.useRef();
|
|
2800
2800
|
if (!refState.current) {
|
|
2801
2801
|
if (!ctx.internalState) {
|
|
2802
2802
|
const initialScrollLength = (estimatedListSize != null ? estimatedListSize : IsNewArchitecture ? { height: 0, width: 0 } : reactNative.Dimensions.get("window"))[horizontal ? "width" : "height"];
|
|
@@ -2893,13 +2893,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2893
2893
|
scrollBuffer,
|
|
2894
2894
|
snapToIndices,
|
|
2895
2895
|
stickyIndicesArr: stickyIndices != null ? stickyIndices : [],
|
|
2896
|
-
stickyIndicesSet:
|
|
2896
|
+
stickyIndicesSet: React2.useMemo(() => new Set(stickyIndices != null ? stickyIndices : []), [stickyIndices == null ? void 0 : stickyIndices.join(",")]),
|
|
2897
2897
|
stylePaddingBottom: stylePaddingBottomState,
|
|
2898
2898
|
stylePaddingTop: stylePaddingTopState,
|
|
2899
2899
|
suggestEstimatedItemSize: !!suggestEstimatedItemSize
|
|
2900
2900
|
};
|
|
2901
2901
|
state.refScroller = refScroller;
|
|
2902
|
-
const memoizedLastItemKeys =
|
|
2902
|
+
const memoizedLastItemKeys = React2.useMemo(() => {
|
|
2903
2903
|
if (!dataProp.length) return [];
|
|
2904
2904
|
return Array.from(
|
|
2905
2905
|
{ length: Math.min(numColumnsProp, dataProp.length) },
|
|
@@ -2929,7 +2929,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2929
2929
|
true
|
|
2930
2930
|
);
|
|
2931
2931
|
}
|
|
2932
|
-
const initialContentOffset =
|
|
2932
|
+
const initialContentOffset = React2.useMemo(() => {
|
|
2933
2933
|
if (initialScroll) {
|
|
2934
2934
|
const { index, viewOffset } = initialScroll;
|
|
2935
2935
|
let initialContentOffset2 = viewOffset || 0;
|
|
@@ -2961,7 +2961,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2961
2961
|
refState.current.positions.clear();
|
|
2962
2962
|
}
|
|
2963
2963
|
}
|
|
2964
|
-
const onLayoutHeader =
|
|
2964
|
+
const onLayoutHeader = React2.useCallback((rect, fromLayoutEffect) => {
|
|
2965
2965
|
const size = rect[horizontal ? "width" : "height"];
|
|
2966
2966
|
set$(ctx, "headerSize", size);
|
|
2967
2967
|
if ((initialScroll == null ? void 0 : initialScroll.index) !== void 0) {
|
|
@@ -2976,12 +2976,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2976
2976
|
}
|
|
2977
2977
|
}
|
|
2978
2978
|
}, []);
|
|
2979
|
-
|
|
2979
|
+
React2.useLayoutEffect(() => {
|
|
2980
2980
|
if (snapToIndices) {
|
|
2981
2981
|
updateSnapToOffsets(ctx, state);
|
|
2982
2982
|
}
|
|
2983
2983
|
}, [snapToIndices]);
|
|
2984
|
-
|
|
2984
|
+
React2.useLayoutEffect(() => {
|
|
2985
2985
|
const didAllocateContainers = dataProp.length > 0 && doInitialAllocateContainers(ctx, state);
|
|
2986
2986
|
if (!didAllocateContainers) {
|
|
2987
2987
|
checkResetContainers(
|
|
@@ -2993,16 +2993,16 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2993
2993
|
);
|
|
2994
2994
|
}
|
|
2995
2995
|
}, [dataProp, numColumnsProp]);
|
|
2996
|
-
|
|
2996
|
+
React2.useLayoutEffect(() => {
|
|
2997
2997
|
set$(ctx, "extraData", extraData);
|
|
2998
2998
|
}, [extraData]);
|
|
2999
|
-
|
|
2999
|
+
React2.useLayoutEffect(initializeStateVars, [
|
|
3000
3000
|
memoizedLastItemKeys.join(","),
|
|
3001
3001
|
numColumnsProp,
|
|
3002
3002
|
stylePaddingTopState,
|
|
3003
3003
|
stylePaddingBottomState
|
|
3004
3004
|
]);
|
|
3005
|
-
|
|
3005
|
+
React2.useEffect(() => {
|
|
3006
3006
|
const viewability = setupViewability({
|
|
3007
3007
|
onViewableItemsChanged,
|
|
3008
3008
|
viewabilityConfig,
|
|
@@ -3016,7 +3016,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3016
3016
|
doInitialAllocateContainers(ctx, state);
|
|
3017
3017
|
});
|
|
3018
3018
|
}
|
|
3019
|
-
const onLayoutChange =
|
|
3019
|
+
const onLayoutChange = React2.useCallback((layout) => {
|
|
3020
3020
|
handleLayout(ctx, state, layout, setCanRender);
|
|
3021
3021
|
}, []);
|
|
3022
3022
|
const { onLayout } = useOnLayoutSync({
|
|
@@ -3025,7 +3025,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3025
3025
|
ref: refScroller
|
|
3026
3026
|
// the type of ScrollView doesn't include measure?
|
|
3027
3027
|
});
|
|
3028
|
-
|
|
3028
|
+
React2.useImperativeHandle(forwardedRef, () => {
|
|
3029
3029
|
const scrollIndexIntoView = (options) => {
|
|
3030
3030
|
const state2 = refState.current;
|
|
3031
3031
|
if (state2) {
|
|
@@ -3108,13 +3108,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3108
3108
|
};
|
|
3109
3109
|
}, []);
|
|
3110
3110
|
if (reactNative.Platform.OS === "web") {
|
|
3111
|
-
|
|
3111
|
+
React2.useEffect(() => {
|
|
3112
3112
|
if (initialContentOffset) {
|
|
3113
3113
|
scrollTo(state, { animated: false, offset: initialContentOffset });
|
|
3114
3114
|
}
|
|
3115
3115
|
}, []);
|
|
3116
3116
|
}
|
|
3117
|
-
const fns =
|
|
3117
|
+
const fns = React2.useMemo(
|
|
3118
3118
|
() => ({
|
|
3119
3119
|
getRenderedItem: (key) => getRenderedItem(ctx, state, key),
|
|
3120
3120
|
onScroll: (event) => onScroll(ctx, state, event),
|
|
@@ -3122,7 +3122,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3122
3122
|
}),
|
|
3123
3123
|
[]
|
|
3124
3124
|
);
|
|
3125
|
-
const onScrollHandler =
|
|
3125
|
+
const onScrollHandler = React2.useMemo(() => {
|
|
3126
3126
|
const onScrollFn = fns.onScroll;
|
|
3127
3127
|
if (stickyIndices == null ? void 0 : stickyIndices.length) {
|
|
3128
3128
|
const { animatedScrollY } = ctx;
|
|
@@ -3133,7 +3133,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3133
3133
|
}
|
|
3134
3134
|
return onScrollFn;
|
|
3135
3135
|
}, [stickyIndices == null ? void 0 : stickyIndices.length, horizontal, scrollEventThrottle]);
|
|
3136
|
-
return /* @__PURE__ */
|
|
3136
|
+
return /* @__PURE__ */ React2__namespace.createElement(React2__namespace.Fragment, null, /* @__PURE__ */ React2__namespace.createElement(
|
|
3137
3137
|
ListComponent,
|
|
3138
3138
|
{
|
|
3139
3139
|
...rest,
|
|
@@ -3164,9 +3164,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3164
3164
|
},
|
|
3165
3165
|
onScroll: onScrollHandler,
|
|
3166
3166
|
recycleItems,
|
|
3167
|
-
refreshControl: refreshControl ? stylePaddingTopState > 0 ?
|
|
3167
|
+
refreshControl: refreshControl ? stylePaddingTopState > 0 ? React2__namespace.cloneElement(refreshControl, {
|
|
3168
3168
|
progressViewOffset: (refreshControl.props.progressViewOffset || 0) + stylePaddingTopState
|
|
3169
|
-
}) : refreshControl : onRefresh && /* @__PURE__ */
|
|
3169
|
+
}) : refreshControl : onRefresh && /* @__PURE__ */ React2__namespace.createElement(
|
|
3170
3170
|
reactNative.RefreshControl,
|
|
3171
3171
|
{
|
|
3172
3172
|
onRefresh,
|
|
@@ -3183,7 +3183,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3183
3183
|
updateItemSize: fns.updateItemSize,
|
|
3184
3184
|
waitForInitialLayout
|
|
3185
3185
|
}
|
|
3186
|
-
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */
|
|
3186
|
+
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */ React2__namespace.createElement(DebugView, { state: refState.current }));
|
|
3187
3187
|
});
|
|
3188
3188
|
|
|
3189
3189
|
exports.LegendList = LegendList;
|
package/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React2 from 'react';
|
|
2
|
+
import React2__default, { useReducer, useEffect, createContext, useRef, useState, useMemo, useCallback, useLayoutEffect, useImperativeHandle, forwardRef, memo, useContext } from 'react';
|
|
3
3
|
import { View, Text, Platform, Animated, StyleSheet, Dimensions, RefreshControl, unstable_batchedUpdates } from 'react-native';
|
|
4
4
|
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
5
5
|
|
|
6
6
|
// src/components/LegendList.tsx
|
|
7
|
-
var ContextState =
|
|
7
|
+
var ContextState = React2.createContext(null);
|
|
8
8
|
function StateProvider({ children }) {
|
|
9
|
-
const [value] =
|
|
9
|
+
const [value] = React2.useState(() => ({
|
|
10
10
|
animatedScrollY: new Animated.Value(0),
|
|
11
11
|
columnWrapperStyle: void 0,
|
|
12
12
|
internalState: void 0,
|
|
@@ -25,10 +25,10 @@ function StateProvider({ children }) {
|
|
|
25
25
|
]),
|
|
26
26
|
viewRefs: /* @__PURE__ */ new Map()
|
|
27
27
|
}));
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ React2.createElement(ContextState.Provider, { value }, children);
|
|
29
29
|
}
|
|
30
30
|
function useStateContext() {
|
|
31
|
-
return
|
|
31
|
+
return React2.useContext(ContextState);
|
|
32
32
|
}
|
|
33
33
|
function createSelectorFunctionsArr(ctx, signalNames) {
|
|
34
34
|
let lastValues = [];
|
|
@@ -98,23 +98,23 @@ function getContentSize(ctx) {
|
|
|
98
98
|
return headerSize + footerSize + totalSize + stylePaddingTop;
|
|
99
99
|
}
|
|
100
100
|
function useArr$(signalNames) {
|
|
101
|
-
const ctx =
|
|
102
|
-
const { subscribe, get } =
|
|
101
|
+
const ctx = React2.useContext(ContextState);
|
|
102
|
+
const { subscribe, get } = React2.useMemo(() => createSelectorFunctionsArr(ctx, signalNames), [ctx, signalNames]);
|
|
103
103
|
const value = useSyncExternalStore(subscribe, get);
|
|
104
104
|
return value;
|
|
105
105
|
}
|
|
106
106
|
function useSelector$(signalName, selector) {
|
|
107
|
-
const ctx =
|
|
108
|
-
const { subscribe, get } =
|
|
107
|
+
const ctx = React2.useContext(ContextState);
|
|
108
|
+
const { subscribe, get } = React2.useMemo(() => createSelectorFunctionsArr(ctx, [signalName]), [ctx, signalName]);
|
|
109
109
|
const value = useSyncExternalStore(subscribe, () => selector(get()[0]));
|
|
110
110
|
return value;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// src/components/DebugView.tsx
|
|
114
114
|
var DebugRow = ({ children }) => {
|
|
115
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ React2.createElement(View, { style: { alignItems: "center", flexDirection: "row", justifyContent: "space-between" } }, children);
|
|
116
116
|
};
|
|
117
|
-
var DebugView =
|
|
117
|
+
var DebugView = React2.memo(function DebugView2({ state }) {
|
|
118
118
|
const ctx = useStateContext();
|
|
119
119
|
const [totalSize = 0, scrollAdjust = 0, rawScroll = 0, scroll = 0, _numContainers = 0, _numContainersPooled = 0] = useArr$([
|
|
120
120
|
"totalSize",
|
|
@@ -129,7 +129,7 @@ var DebugView = React3.memo(function DebugView2({ state }) {
|
|
|
129
129
|
useInterval(() => {
|
|
130
130
|
forceUpdate();
|
|
131
131
|
}, 100);
|
|
132
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ React2.createElement(
|
|
133
133
|
View,
|
|
134
134
|
{
|
|
135
135
|
pointerEvents: "none",
|
|
@@ -145,14 +145,14 @@ var DebugView = React3.memo(function DebugView2({ state }) {
|
|
|
145
145
|
top: 0
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ React2.createElement(DebugRow, null, /* @__PURE__ */ React2.createElement(Text, null, "TotalSize:"), /* @__PURE__ */ React2.createElement(Text, null, totalSize.toFixed(2))),
|
|
149
|
+
/* @__PURE__ */ React2.createElement(DebugRow, null, /* @__PURE__ */ React2.createElement(Text, null, "ContentSize:"), /* @__PURE__ */ React2.createElement(Text, null, contentSize.toFixed(2))),
|
|
150
|
+
/* @__PURE__ */ React2.createElement(DebugRow, null, /* @__PURE__ */ React2.createElement(Text, null, "At end:"), /* @__PURE__ */ React2.createElement(Text, null, String(state.isAtEnd))),
|
|
151
|
+
/* @__PURE__ */ React2.createElement(Text, null),
|
|
152
|
+
/* @__PURE__ */ React2.createElement(DebugRow, null, /* @__PURE__ */ React2.createElement(Text, null, "ScrollAdjust:"), /* @__PURE__ */ React2.createElement(Text, null, scrollAdjust.toFixed(2))),
|
|
153
|
+
/* @__PURE__ */ React2.createElement(Text, null),
|
|
154
|
+
/* @__PURE__ */ React2.createElement(DebugRow, null, /* @__PURE__ */ React2.createElement(Text, null, "RawScroll: "), /* @__PURE__ */ React2.createElement(Text, null, rawScroll.toFixed(2))),
|
|
155
|
+
/* @__PURE__ */ React2.createElement(DebugRow, null, /* @__PURE__ */ React2.createElement(Text, null, "ComputedScroll: "), /* @__PURE__ */ React2.createElement(Text, null, scroll.toFixed(2)))
|
|
156
156
|
);
|
|
157
157
|
});
|
|
158
158
|
function useInterval(callback, delay) {
|
|
@@ -221,7 +221,7 @@ var PositionViewState = typedMemo(function PositionView({
|
|
|
221
221
|
...rest
|
|
222
222
|
}) {
|
|
223
223
|
const [position = POSITION_OUT_OF_VIEW] = useArr$([`containerPosition${id}`]);
|
|
224
|
-
return /* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ React2.createElement(
|
|
225
225
|
View,
|
|
226
226
|
{
|
|
227
227
|
ref: refView,
|
|
@@ -249,7 +249,7 @@ var PositionViewAnimated = typedMemo(function PositionView2({
|
|
|
249
249
|
} else {
|
|
250
250
|
position = horizontal ? { left: position$ } : { top: position$ };
|
|
251
251
|
}
|
|
252
|
-
return /* @__PURE__ */
|
|
252
|
+
return /* @__PURE__ */ React2.createElement(Animated.View, { ref: refView, style: [style, position], ...rest });
|
|
253
253
|
});
|
|
254
254
|
var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
255
255
|
id,
|
|
@@ -262,7 +262,7 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
262
262
|
...rest
|
|
263
263
|
}) {
|
|
264
264
|
const [position = POSITION_OUT_OF_VIEW, headerSize] = useArr$([`containerPosition${id}`, "headerSize"]);
|
|
265
|
-
const transform =
|
|
265
|
+
const transform = React2.useMemo(() => {
|
|
266
266
|
if (animatedScrollY && stickyOffset !== void 0) {
|
|
267
267
|
const stickyPosition = animatedScrollY.interpolate({
|
|
268
268
|
extrapolate: "clamp",
|
|
@@ -272,8 +272,8 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
272
272
|
return horizontal ? [{ translateX: stickyPosition }] : [{ translateY: stickyPosition }];
|
|
273
273
|
}
|
|
274
274
|
}, [animatedScrollY, headerSize, horizontal, stickyOffset, position]);
|
|
275
|
-
const viewStyle =
|
|
276
|
-
return /* @__PURE__ */
|
|
275
|
+
const viewStyle = React2.useMemo(() => [style, { zIndex: index + 1e3 }, { transform }], [style, transform]);
|
|
276
|
+
return /* @__PURE__ */ React2.createElement(Animated.View, { ref: refView, style: viewStyle, ...rest });
|
|
277
277
|
});
|
|
278
278
|
var PositionView3 = IsNewArchitecture ? PositionViewState : PositionViewAnimated;
|
|
279
279
|
var symbolFirst = Symbol();
|
|
@@ -426,7 +426,7 @@ function useSyncLayout() {
|
|
|
426
426
|
// src/components/Separator.tsx
|
|
427
427
|
function Separator({ ItemSeparatorComponent, leadingItem }) {
|
|
428
428
|
const isLastItem = useIsLastItem();
|
|
429
|
-
return isLastItem ? null : /* @__PURE__ */
|
|
429
|
+
return isLastItem ? null : /* @__PURE__ */ React2.createElement(ItemSeparatorComponent, { leadingItem });
|
|
430
430
|
}
|
|
431
431
|
function useOnLayoutSync({
|
|
432
432
|
ref,
|
|
@@ -571,7 +571,7 @@ var Container = typedMemo(function Container2({
|
|
|
571
571
|
}, [itemKey]);
|
|
572
572
|
}
|
|
573
573
|
const PositionComponent = isSticky ? PositionViewSticky : PositionView3;
|
|
574
|
-
return /* @__PURE__ */
|
|
574
|
+
return /* @__PURE__ */ React2.createElement(
|
|
575
575
|
PositionComponent,
|
|
576
576
|
{
|
|
577
577
|
animatedScrollY: isSticky ? animatedScrollY : void 0,
|
|
@@ -584,7 +584,7 @@ var Container = typedMemo(function Container2({
|
|
|
584
584
|
stickyOffset: isSticky ? stickyOffset : void 0,
|
|
585
585
|
style
|
|
586
586
|
},
|
|
587
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ React2.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && /* @__PURE__ */ React2.createElement(Separator, { ItemSeparatorComponent, leadingItem: renderedItemInfo.item }))
|
|
588
588
|
);
|
|
589
589
|
});
|
|
590
590
|
|
|
@@ -613,7 +613,7 @@ var Containers = typedMemo(function Containers2({
|
|
|
613
613
|
const containers = [];
|
|
614
614
|
for (let i = 0; i < numContainers; i++) {
|
|
615
615
|
containers.push(
|
|
616
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ React2.createElement(
|
|
617
617
|
Container,
|
|
618
618
|
{
|
|
619
619
|
getRenderedItem: getRenderedItem2,
|
|
@@ -648,18 +648,18 @@ var Containers = typedMemo(function Containers2({
|
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
|
-
return /* @__PURE__ */
|
|
651
|
+
return /* @__PURE__ */ React2.createElement(Animated.View, { style }, containers);
|
|
652
652
|
});
|
|
653
653
|
var LayoutView = ({ onLayoutChange, refView, ...rest }) => {
|
|
654
654
|
const ref = refView != null ? refView : useRef();
|
|
655
655
|
const { onLayout } = useOnLayoutSync({ onLayoutChange, ref });
|
|
656
|
-
return /* @__PURE__ */
|
|
656
|
+
return /* @__PURE__ */ React2.createElement(View, { ...rest, onLayout, ref });
|
|
657
657
|
};
|
|
658
658
|
function ScrollAdjust() {
|
|
659
659
|
const bias = 1e7;
|
|
660
660
|
const [scrollAdjust, scrollAdjustUserOffset] = useArr$(["scrollAdjust", "scrollAdjustUserOffset"]);
|
|
661
661
|
const scrollOffset = (scrollAdjust || 0) + (scrollAdjustUserOffset || 0) + bias;
|
|
662
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ React2.createElement(
|
|
663
663
|
View,
|
|
664
664
|
{
|
|
665
665
|
style: {
|
|
@@ -674,26 +674,26 @@ function ScrollAdjust() {
|
|
|
674
674
|
}
|
|
675
675
|
function SnapWrapper({ ScrollComponent, ...props }) {
|
|
676
676
|
const [snapToOffsets] = useArr$(["snapToOffsets"]);
|
|
677
|
-
return /* @__PURE__ */
|
|
677
|
+
return /* @__PURE__ */ React2__default.createElement(ScrollComponent, { ...props, snapToOffsets });
|
|
678
678
|
}
|
|
679
679
|
|
|
680
680
|
// src/components/ListComponent.tsx
|
|
681
681
|
var getComponent = (Component) => {
|
|
682
|
-
if (
|
|
682
|
+
if (React2.isValidElement(Component)) {
|
|
683
683
|
return Component;
|
|
684
684
|
}
|
|
685
685
|
if (Component) {
|
|
686
|
-
return /* @__PURE__ */
|
|
686
|
+
return /* @__PURE__ */ React2.createElement(Component, null);
|
|
687
687
|
}
|
|
688
688
|
return null;
|
|
689
689
|
};
|
|
690
690
|
var Padding = () => {
|
|
691
691
|
const animPaddingTop = useValue$("alignItemsPaddingTop", { delay: 0 });
|
|
692
|
-
return /* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ React2.createElement(Animated.View, { style: { paddingTop: animPaddingTop } });
|
|
693
693
|
};
|
|
694
694
|
var PaddingDevMode = () => {
|
|
695
695
|
const animPaddingTop = useValue$("alignItemsPaddingTop", { delay: 0 });
|
|
696
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Animated.View, { style: { paddingTop: animPaddingTop } }), /* @__PURE__ */ React2.createElement(
|
|
697
697
|
Animated.View,
|
|
698
698
|
{
|
|
699
699
|
style: {
|
|
@@ -737,10 +737,10 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
737
737
|
}) {
|
|
738
738
|
const ctx = useStateContext();
|
|
739
739
|
const ScrollComponent = renderScrollComponent ? useMemo(
|
|
740
|
-
() =>
|
|
740
|
+
() => React2.forwardRef((props, ref) => renderScrollComponent({ ...props, ref })),
|
|
741
741
|
[renderScrollComponent]
|
|
742
742
|
) : Animated.ScrollView;
|
|
743
|
-
|
|
743
|
+
React2.useEffect(() => {
|
|
744
744
|
if (canRender) {
|
|
745
745
|
setTimeout(() => {
|
|
746
746
|
scrollAdjustHandler.setMounted();
|
|
@@ -748,7 +748,7 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
748
748
|
}
|
|
749
749
|
}, [canRender]);
|
|
750
750
|
const SnapOrScroll = snapToIndices ? SnapWrapper : ScrollComponent;
|
|
751
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ React2.createElement(
|
|
752
752
|
SnapOrScroll,
|
|
753
753
|
{
|
|
754
754
|
...rest,
|
|
@@ -767,11 +767,11 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
767
767
|
ScrollComponent: snapToIndices ? ScrollComponent : void 0,
|
|
768
768
|
style
|
|
769
769
|
},
|
|
770
|
-
maintainVisibleContentPosition && /* @__PURE__ */
|
|
771
|
-
ENABLE_DEVMODE ? /* @__PURE__ */
|
|
772
|
-
ListHeaderComponent && /* @__PURE__ */
|
|
770
|
+
maintainVisibleContentPosition && /* @__PURE__ */ React2.createElement(ScrollAdjust, null),
|
|
771
|
+
ENABLE_DEVMODE ? /* @__PURE__ */ React2.createElement(PaddingDevMode, null) : /* @__PURE__ */ React2.createElement(Padding, null),
|
|
772
|
+
ListHeaderComponent && /* @__PURE__ */ React2.createElement(LayoutView, { onLayoutChange: onLayoutHeader, style: ListHeaderComponentStyle }, getComponent(ListHeaderComponent)),
|
|
773
773
|
ListEmptyComponent && getComponent(ListEmptyComponent),
|
|
774
|
-
canRender && !ListEmptyComponent && /* @__PURE__ */
|
|
774
|
+
canRender && !ListEmptyComponent && /* @__PURE__ */ React2.createElement(
|
|
775
775
|
Containers,
|
|
776
776
|
{
|
|
777
777
|
getRenderedItem: getRenderedItem2,
|
|
@@ -782,7 +782,7 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
782
782
|
waitForInitialLayout
|
|
783
783
|
}
|
|
784
784
|
),
|
|
785
|
-
ListFooterComponent && /* @__PURE__ */
|
|
785
|
+
ListFooterComponent && /* @__PURE__ */ React2.createElement(
|
|
786
786
|
LayoutView,
|
|
787
787
|
{
|
|
788
788
|
onLayoutChange: (layout) => {
|
|
@@ -793,11 +793,11 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
793
793
|
},
|
|
794
794
|
getComponent(ListFooterComponent)
|
|
795
795
|
),
|
|
796
|
-
__DEV__ && ENABLE_DEVMODE && /* @__PURE__ */
|
|
796
|
+
__DEV__ && ENABLE_DEVMODE && /* @__PURE__ */ React2.createElement(DevNumbers, null)
|
|
797
797
|
);
|
|
798
798
|
});
|
|
799
|
-
var DevNumbers = __DEV__ &&
|
|
800
|
-
return Array.from({ length: 100 }).map((_, index) => /* @__PURE__ */
|
|
799
|
+
var DevNumbers = __DEV__ && React2.memo(function DevNumbers2() {
|
|
800
|
+
return Array.from({ length: 100 }).map((_, index) => /* @__PURE__ */ React2.createElement(
|
|
801
801
|
View,
|
|
802
802
|
{
|
|
803
803
|
key: index,
|
|
@@ -809,7 +809,7 @@ var DevNumbers = __DEV__ && React3.memo(function DevNumbers2() {
|
|
|
809
809
|
width: "100%"
|
|
810
810
|
}
|
|
811
811
|
},
|
|
812
|
-
/* @__PURE__ */
|
|
812
|
+
/* @__PURE__ */ React2.createElement(Text, { style: { color: "red" } }, index * 100)
|
|
813
813
|
));
|
|
814
814
|
});
|
|
815
815
|
|
|
@@ -2637,7 +2637,7 @@ function getRenderedItem(ctx, state, key) {
|
|
|
2637
2637
|
item,
|
|
2638
2638
|
type: getItemType ? (_a = getItemType(item, index)) != null ? _a : "" : ""
|
|
2639
2639
|
};
|
|
2640
|
-
renderedItem = isFunction(renderItem) ? renderItem(itemProps) :
|
|
2640
|
+
renderedItem = isFunction(renderItem) ? renderItem(itemProps) : React2__default.createElement(renderItem, itemProps);
|
|
2641
2641
|
}
|
|
2642
2642
|
return { index, item: data[index], renderedItem };
|
|
2643
2643
|
}
|
|
@@ -2696,14 +2696,14 @@ var LegendList = typedMemo(
|
|
|
2696
2696
|
const isChildrenMode = children !== void 0 && dataProp === void 0;
|
|
2697
2697
|
const processedProps = isChildrenMode ? {
|
|
2698
2698
|
...restProps,
|
|
2699
|
-
data: (isArray(children) ? children :
|
|
2699
|
+
data: (isArray(children) ? children : React2.Children.toArray(children)).flat(1),
|
|
2700
2700
|
renderItem: ({ item }) => item
|
|
2701
2701
|
} : {
|
|
2702
2702
|
...restProps,
|
|
2703
2703
|
data: dataProp || [],
|
|
2704
2704
|
renderItem: renderItemProp
|
|
2705
2705
|
};
|
|
2706
|
-
return /* @__PURE__ */
|
|
2706
|
+
return /* @__PURE__ */ React2.createElement(StateProvider, null, /* @__PURE__ */ React2.createElement(LegendListInner, { ...processedProps, ref: forwardedRef }));
|
|
2707
2707
|
})
|
|
2708
2708
|
);
|
|
2709
2709
|
var LegendListInner = typedForwardRef(function LegendListInner2(props, forwardedRef) {
|
|
@@ -2763,7 +2763,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2763
2763
|
} = props;
|
|
2764
2764
|
const [renderNum, setRenderNum] = useState(0);
|
|
2765
2765
|
const initialScroll = initialScrollIndexProp || initialScrollOffsetProp ? typeof initialScrollIndexProp === "object" ? { index: initialScrollIndexProp.index || 0, viewOffset: initialScrollIndexProp.viewOffset || 0 } : { index: initialScrollIndexProp || 0, viewOffset: initialScrollOffsetProp || 0 } : void 0;
|
|
2766
|
-
const [canRender, setCanRender] =
|
|
2766
|
+
const [canRender, setCanRender] = React2.useState(!IsNewArchitecture);
|
|
2767
2767
|
const contentContainerStyle = { ...StyleSheet.flatten(contentContainerStyleProp) };
|
|
2768
2768
|
const style = { ...StyleSheet.flatten(styleProp) };
|
|
2769
2769
|
const stylePaddingTopState = extractPadding(style, contentContainerStyle, "Top");
|
|
@@ -3112,7 +3112,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3112
3112
|
}
|
|
3113
3113
|
return onScrollFn;
|
|
3114
3114
|
}, [stickyIndices == null ? void 0 : stickyIndices.length, horizontal, scrollEventThrottle]);
|
|
3115
|
-
return /* @__PURE__ */
|
|
3115
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
3116
3116
|
ListComponent,
|
|
3117
3117
|
{
|
|
3118
3118
|
...rest,
|
|
@@ -3143,9 +3143,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3143
3143
|
},
|
|
3144
3144
|
onScroll: onScrollHandler,
|
|
3145
3145
|
recycleItems,
|
|
3146
|
-
refreshControl: refreshControl ? stylePaddingTopState > 0 ?
|
|
3146
|
+
refreshControl: refreshControl ? stylePaddingTopState > 0 ? React2.cloneElement(refreshControl, {
|
|
3147
3147
|
progressViewOffset: (refreshControl.props.progressViewOffset || 0) + stylePaddingTopState
|
|
3148
|
-
}) : refreshControl : onRefresh && /* @__PURE__ */
|
|
3148
|
+
}) : refreshControl : onRefresh && /* @__PURE__ */ React2.createElement(
|
|
3149
3149
|
RefreshControl,
|
|
3150
3150
|
{
|
|
3151
3151
|
onRefresh,
|
|
@@ -3162,7 +3162,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3162
3162
|
updateItemSize: fns.updateItemSize,
|
|
3163
3163
|
waitForInitialLayout
|
|
3164
3164
|
}
|
|
3165
|
-
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */
|
|
3165
|
+
), __DEV__ && ENABLE_DEBUG_VIEW && /* @__PURE__ */ React2.createElement(DebugView, { state: refState.current }));
|
|
3166
3166
|
});
|
|
3167
3167
|
|
|
3168
3168
|
export { LegendList, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|
package/package.json
CHANGED