@legendapp/list 3.0.0-beta.50 → 3.0.0-beta.51

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.
@@ -5082,12 +5082,14 @@ function handleLayout(ctx, layoutParam, setCanRender) {
5082
5082
  }
5083
5083
 
5084
5084
  // src/core/updateScroll.ts
5085
- function updateScroll(ctx, newScroll, forceUpdate) {
5085
+ function updateScroll(ctx, newScroll, forceUpdate, options) {
5086
5086
  var _a3;
5087
5087
  const state = ctx.state;
5088
5088
  const { ignoreScrollFromMVCP, lastScrollAdjustForHistory, scrollAdjustHandler, scrollHistory, scrollingTo } = state;
5089
5089
  const prevScroll = state.scroll;
5090
- state.hasScrolled = true;
5090
+ if ((options == null ? void 0 : options.markHasScrolled) !== false) {
5091
+ state.hasScrolled = true;
5092
+ }
5091
5093
  state.lastBatchingAction = Date.now();
5092
5094
  const currentTime = Date.now();
5093
5095
  const adjust = scrollAdjustHandler.getAdjust();
@@ -5666,7 +5668,7 @@ function createImperativeHandle(ctx) {
5666
5668
  }),
5667
5669
  reportContentInset: (inset) => {
5668
5670
  state.contentInsetOverride = inset != null ? inset : void 0;
5669
- updateScroll(ctx, state.scroll, true);
5671
+ updateScroll(ctx, state.scroll, true, { markHasScrolled: false });
5670
5672
  },
5671
5673
  scrollIndexIntoView: (options) => runScrollWithPromise(() => scrollIndexIntoView(options)),
5672
5674
  scrollItemIntoView: ({ item, ...props }) => runScrollWithPromise(() => {
@@ -5735,32 +5737,32 @@ var addIndex = (result, dataLength, index) => {
5735
5737
  result.add(index);
5736
5738
  }
5737
5739
  };
5738
- function getAlwaysRenderIndices(config, data, keyExtractor) {
5740
+ function getAlwaysRenderIndices(config, data, keyExtractor, anchoredEndSpaceAnchorIndex) {
5739
5741
  var _a3, _b;
5740
- if (!config || data.length === 0) {
5742
+ if (data.length === 0) {
5741
5743
  return [];
5742
5744
  }
5743
5745
  const result = /* @__PURE__ */ new Set();
5744
5746
  const dataLength = data.length;
5745
- const topCount = toCount(config.top);
5747
+ const topCount = toCount(config == null ? void 0 : config.top);
5746
5748
  if (topCount > 0) {
5747
5749
  for (let i = 0; i < Math.min(topCount, dataLength); i++) {
5748
5750
  addIndex(result, dataLength, i);
5749
5751
  }
5750
5752
  }
5751
- const bottomCount = toCount(config.bottom);
5753
+ const bottomCount = toCount(config == null ? void 0 : config.bottom);
5752
5754
  if (bottomCount > 0) {
5753
5755
  for (let i = Math.max(0, dataLength - bottomCount); i < dataLength; i++) {
5754
5756
  addIndex(result, dataLength, i);
5755
5757
  }
5756
5758
  }
5757
- if ((_a3 = config.indices) == null ? void 0 : _a3.length) {
5759
+ if ((_a3 = config == null ? void 0 : config.indices) == null ? void 0 : _a3.length) {
5758
5760
  for (const index of config.indices) {
5759
5761
  if (!Number.isFinite(index)) continue;
5760
5762
  addIndex(result, dataLength, Math.floor(index));
5761
5763
  }
5762
5764
  }
5763
- if ((_b = config.keys) == null ? void 0 : _b.length) {
5765
+ if ((_b = config == null ? void 0 : config.keys) == null ? void 0 : _b.length) {
5764
5766
  const keys = new Set(config.keys);
5765
5767
  for (let i = 0; i < dataLength && keys.size > 0; i++) {
5766
5768
  const key = keyExtractor(data[i], i);
@@ -5770,6 +5772,12 @@ function getAlwaysRenderIndices(config, data, keyExtractor) {
5770
5772
  }
5771
5773
  }
5772
5774
  }
5775
+ if (anchoredEndSpaceAnchorIndex !== void 0 && Number.isFinite(anchoredEndSpaceAnchorIndex)) {
5776
+ const anchorIndex = Math.floor(anchoredEndSpaceAnchorIndex);
5777
+ for (let i = anchorIndex >= 0 ? anchorIndex : dataLength; i < dataLength; i++) {
5778
+ addIndex(result, dataLength, i);
5779
+ }
5780
+ }
5773
5781
  const indices = Array.from(result);
5774
5782
  indices.sort(sortAsc);
5775
5783
  return indices;
@@ -5933,7 +5941,7 @@ var LegendList = typedMemo(
5933
5941
  })
5934
5942
  );
5935
5943
  var LegendListInner = typedForwardRef(function LegendListInner2(props, forwardedRef) {
5936
- var _a3, _b, _c, _d, _e, _f, _g, _h;
5944
+ var _a3, _b, _c, _d, _e, _f, _g, _h, _i;
5937
5945
  const noopOnScroll = useCallback((_event) => {
5938
5946
  }, []);
5939
5947
  if (props.recycleItems === void 0) {
@@ -6062,9 +6070,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6062
6070
  const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString());
6063
6071
  const stickyHeaderIndices = stickyHeaderIndicesProp != null ? stickyHeaderIndicesProp : stickyIndicesDeprecated;
6064
6072
  const alwaysRenderIndices = useMemo(() => {
6065
- const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor);
6073
+ const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
6066
6074
  return { arr: indices, set: new Set(indices) };
6067
6075
  }, [
6076
+ anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex,
6068
6077
  alwaysRender == null ? void 0 : alwaysRender.top,
6069
6078
  alwaysRender == null ? void 0 : alwaysRender.bottom,
6070
6079
  (_d = alwaysRender == null ? void 0 : alwaysRender.indices) == null ? void 0 : _d.join(","),
@@ -6170,6 +6179,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6170
6179
  const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
6171
6180
  const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
6172
6181
  const anchoredEndSpaceResolved = anchoredEndSpace ? { ...anchoredEndSpace, includeInEndInset: true } : anchoredEndSpace;
6182
+ const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_g = state.props.anchoredEndSpace) == null ? void 0 : _g.anchorIndex) !== (anchoredEndSpaceResolved == null ? void 0 : anchoredEndSpaceResolved.anchorIndex);
6173
6183
  state.props = {
6174
6184
  alignItemsAtEnd,
6175
6185
  alwaysRender,
@@ -6279,6 +6289,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6279
6289
  });
6280
6290
  }, [dataProp.length, didDataChangeLocal, initialScrollAtEnd, stylePaddingBottomState, usesBootstrapInitialScroll]);
6281
6291
  useLayoutEffect(() => {
6292
+ var _a4;
6293
+ if (didAnchoredEndSpaceAnchorIndexChange) {
6294
+ state.scrollForNextCalculateItemsInView = void 0;
6295
+ (_a4 = state.triggerCalculateItemsInView) == null ? void 0 : _a4.call(state);
6296
+ }
6282
6297
  maybeUpdateAnchoredEndSpace(ctx);
6283
6298
  }, [
6284
6299
  ctx,
@@ -6287,6 +6302,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6287
6302
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex,
6288
6303
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorMaxSize,
6289
6304
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorOffset,
6305
+ didAnchoredEndSpaceAnchorIndexChange,
6290
6306
  numColumnsProp
6291
6307
  ]);
6292
6308
  const onLayoutFooter = useCallback(
@@ -6440,7 +6456,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6440
6456
  onScroll: onScrollHandler,
6441
6457
  recycleItems,
6442
6458
  refreshControl: refreshControlElement ? stylePaddingTopState > 0 ? React3.cloneElement(refreshControlElement, {
6443
- progressViewOffset: ((_g = refreshControlElement.props.progressViewOffset) != null ? _g : 0) + stylePaddingTopState
6459
+ progressViewOffset: ((_h = refreshControlElement.props.progressViewOffset) != null ? _h : 0) + stylePaddingTopState
6444
6460
  }) : refreshControlElement : onRefresh && /* @__PURE__ */ React3.createElement(
6445
6461
  RefreshControl,
6446
6462
  {
@@ -6451,7 +6467,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6451
6467
  ),
6452
6468
  refScrollView: combinedRef,
6453
6469
  renderScrollComponent,
6454
- scrollAdjustHandler: (_h = refState.current) == null ? void 0 : _h.scrollAdjustHandler,
6470
+ scrollAdjustHandler: (_i = refState.current) == null ? void 0 : _i.scrollAdjustHandler,
6455
6471
  scrollEventThrottle: 0,
6456
6472
  snapToIndices,
6457
6473
  stickyHeaderIndices,
package/react.js CHANGED
@@ -5103,12 +5103,14 @@ function handleLayout(ctx, layoutParam, setCanRender) {
5103
5103
  }
5104
5104
 
5105
5105
  // src/core/updateScroll.ts
5106
- function updateScroll(ctx, newScroll, forceUpdate) {
5106
+ function updateScroll(ctx, newScroll, forceUpdate, options) {
5107
5107
  var _a3;
5108
5108
  const state = ctx.state;
5109
5109
  const { ignoreScrollFromMVCP, lastScrollAdjustForHistory, scrollAdjustHandler, scrollHistory, scrollingTo } = state;
5110
5110
  const prevScroll = state.scroll;
5111
- state.hasScrolled = true;
5111
+ if ((options == null ? void 0 : options.markHasScrolled) !== false) {
5112
+ state.hasScrolled = true;
5113
+ }
5112
5114
  state.lastBatchingAction = Date.now();
5113
5115
  const currentTime = Date.now();
5114
5116
  const adjust = scrollAdjustHandler.getAdjust();
@@ -5687,7 +5689,7 @@ function createImperativeHandle(ctx) {
5687
5689
  }),
5688
5690
  reportContentInset: (inset) => {
5689
5691
  state.contentInsetOverride = inset != null ? inset : void 0;
5690
- updateScroll(ctx, state.scroll, true);
5692
+ updateScroll(ctx, state.scroll, true, { markHasScrolled: false });
5691
5693
  },
5692
5694
  scrollIndexIntoView: (options) => runScrollWithPromise(() => scrollIndexIntoView(options)),
5693
5695
  scrollItemIntoView: ({ item, ...props }) => runScrollWithPromise(() => {
@@ -5756,32 +5758,32 @@ var addIndex = (result, dataLength, index) => {
5756
5758
  result.add(index);
5757
5759
  }
5758
5760
  };
5759
- function getAlwaysRenderIndices(config, data, keyExtractor) {
5761
+ function getAlwaysRenderIndices(config, data, keyExtractor, anchoredEndSpaceAnchorIndex) {
5760
5762
  var _a3, _b;
5761
- if (!config || data.length === 0) {
5763
+ if (data.length === 0) {
5762
5764
  return [];
5763
5765
  }
5764
5766
  const result = /* @__PURE__ */ new Set();
5765
5767
  const dataLength = data.length;
5766
- const topCount = toCount(config.top);
5768
+ const topCount = toCount(config == null ? void 0 : config.top);
5767
5769
  if (topCount > 0) {
5768
5770
  for (let i = 0; i < Math.min(topCount, dataLength); i++) {
5769
5771
  addIndex(result, dataLength, i);
5770
5772
  }
5771
5773
  }
5772
- const bottomCount = toCount(config.bottom);
5774
+ const bottomCount = toCount(config == null ? void 0 : config.bottom);
5773
5775
  if (bottomCount > 0) {
5774
5776
  for (let i = Math.max(0, dataLength - bottomCount); i < dataLength; i++) {
5775
5777
  addIndex(result, dataLength, i);
5776
5778
  }
5777
5779
  }
5778
- if ((_a3 = config.indices) == null ? void 0 : _a3.length) {
5780
+ if ((_a3 = config == null ? void 0 : config.indices) == null ? void 0 : _a3.length) {
5779
5781
  for (const index of config.indices) {
5780
5782
  if (!Number.isFinite(index)) continue;
5781
5783
  addIndex(result, dataLength, Math.floor(index));
5782
5784
  }
5783
5785
  }
5784
- if ((_b = config.keys) == null ? void 0 : _b.length) {
5786
+ if ((_b = config == null ? void 0 : config.keys) == null ? void 0 : _b.length) {
5785
5787
  const keys = new Set(config.keys);
5786
5788
  for (let i = 0; i < dataLength && keys.size > 0; i++) {
5787
5789
  const key = keyExtractor(data[i], i);
@@ -5791,6 +5793,12 @@ function getAlwaysRenderIndices(config, data, keyExtractor) {
5791
5793
  }
5792
5794
  }
5793
5795
  }
5796
+ if (anchoredEndSpaceAnchorIndex !== void 0 && Number.isFinite(anchoredEndSpaceAnchorIndex)) {
5797
+ const anchorIndex = Math.floor(anchoredEndSpaceAnchorIndex);
5798
+ for (let i = anchorIndex >= 0 ? anchorIndex : dataLength; i < dataLength; i++) {
5799
+ addIndex(result, dataLength, i);
5800
+ }
5801
+ }
5794
5802
  const indices = Array.from(result);
5795
5803
  indices.sort(sortAsc);
5796
5804
  return indices;
@@ -5954,7 +5962,7 @@ var LegendList = typedMemo(
5954
5962
  })
5955
5963
  );
5956
5964
  var LegendListInner = typedForwardRef(function LegendListInner2(props, forwardedRef) {
5957
- var _a3, _b, _c, _d, _e, _f, _g, _h;
5965
+ var _a3, _b, _c, _d, _e, _f, _g, _h, _i;
5958
5966
  const noopOnScroll = React3.useCallback((_event) => {
5959
5967
  }, []);
5960
5968
  if (props.recycleItems === void 0) {
@@ -6083,9 +6091,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6083
6091
  const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString());
6084
6092
  const stickyHeaderIndices = stickyHeaderIndicesProp != null ? stickyHeaderIndicesProp : stickyIndicesDeprecated;
6085
6093
  const alwaysRenderIndices = React3.useMemo(() => {
6086
- const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor);
6094
+ const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
6087
6095
  return { arr: indices, set: new Set(indices) };
6088
6096
  }, [
6097
+ anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex,
6089
6098
  alwaysRender == null ? void 0 : alwaysRender.top,
6090
6099
  alwaysRender == null ? void 0 : alwaysRender.bottom,
6091
6100
  (_d = alwaysRender == null ? void 0 : alwaysRender.indices) == null ? void 0 : _d.join(","),
@@ -6191,6 +6200,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6191
6200
  const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
6192
6201
  const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
6193
6202
  const anchoredEndSpaceResolved = anchoredEndSpace ? { ...anchoredEndSpace, includeInEndInset: true } : anchoredEndSpace;
6203
+ const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_g = state.props.anchoredEndSpace) == null ? void 0 : _g.anchorIndex) !== (anchoredEndSpaceResolved == null ? void 0 : anchoredEndSpaceResolved.anchorIndex);
6194
6204
  state.props = {
6195
6205
  alignItemsAtEnd,
6196
6206
  alwaysRender,
@@ -6300,6 +6310,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6300
6310
  });
6301
6311
  }, [dataProp.length, didDataChangeLocal, initialScrollAtEnd, stylePaddingBottomState, usesBootstrapInitialScroll]);
6302
6312
  React3.useLayoutEffect(() => {
6313
+ var _a4;
6314
+ if (didAnchoredEndSpaceAnchorIndexChange) {
6315
+ state.scrollForNextCalculateItemsInView = void 0;
6316
+ (_a4 = state.triggerCalculateItemsInView) == null ? void 0 : _a4.call(state);
6317
+ }
6303
6318
  maybeUpdateAnchoredEndSpace(ctx);
6304
6319
  }, [
6305
6320
  ctx,
@@ -6308,6 +6323,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6308
6323
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex,
6309
6324
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorMaxSize,
6310
6325
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorOffset,
6326
+ didAnchoredEndSpaceAnchorIndexChange,
6311
6327
  numColumnsProp
6312
6328
  ]);
6313
6329
  const onLayoutFooter = React3.useCallback(
@@ -6461,7 +6477,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6461
6477
  onScroll: onScrollHandler,
6462
6478
  recycleItems,
6463
6479
  refreshControl: refreshControlElement ? stylePaddingTopState > 0 ? React3__namespace.cloneElement(refreshControlElement, {
6464
- progressViewOffset: ((_g = refreshControlElement.props.progressViewOffset) != null ? _g : 0) + stylePaddingTopState
6480
+ progressViewOffset: ((_h = refreshControlElement.props.progressViewOffset) != null ? _h : 0) + stylePaddingTopState
6465
6481
  }) : refreshControlElement : onRefresh && /* @__PURE__ */ React3__namespace.createElement(
6466
6482
  RefreshControl,
6467
6483
  {
@@ -6472,7 +6488,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6472
6488
  ),
6473
6489
  refScrollView: combinedRef,
6474
6490
  renderScrollComponent,
6475
- scrollAdjustHandler: (_h = refState.current) == null ? void 0 : _h.scrollAdjustHandler,
6491
+ scrollAdjustHandler: (_i = refState.current) == null ? void 0 : _i.scrollAdjustHandler,
6476
6492
  scrollEventThrottle: 0,
6477
6493
  snapToIndices,
6478
6494
  stickyHeaderIndices,
package/react.mjs CHANGED
@@ -5082,12 +5082,14 @@ function handleLayout(ctx, layoutParam, setCanRender) {
5082
5082
  }
5083
5083
 
5084
5084
  // src/core/updateScroll.ts
5085
- function updateScroll(ctx, newScroll, forceUpdate) {
5085
+ function updateScroll(ctx, newScroll, forceUpdate, options) {
5086
5086
  var _a3;
5087
5087
  const state = ctx.state;
5088
5088
  const { ignoreScrollFromMVCP, lastScrollAdjustForHistory, scrollAdjustHandler, scrollHistory, scrollingTo } = state;
5089
5089
  const prevScroll = state.scroll;
5090
- state.hasScrolled = true;
5090
+ if ((options == null ? void 0 : options.markHasScrolled) !== false) {
5091
+ state.hasScrolled = true;
5092
+ }
5091
5093
  state.lastBatchingAction = Date.now();
5092
5094
  const currentTime = Date.now();
5093
5095
  const adjust = scrollAdjustHandler.getAdjust();
@@ -5666,7 +5668,7 @@ function createImperativeHandle(ctx) {
5666
5668
  }),
5667
5669
  reportContentInset: (inset) => {
5668
5670
  state.contentInsetOverride = inset != null ? inset : void 0;
5669
- updateScroll(ctx, state.scroll, true);
5671
+ updateScroll(ctx, state.scroll, true, { markHasScrolled: false });
5670
5672
  },
5671
5673
  scrollIndexIntoView: (options) => runScrollWithPromise(() => scrollIndexIntoView(options)),
5672
5674
  scrollItemIntoView: ({ item, ...props }) => runScrollWithPromise(() => {
@@ -5735,32 +5737,32 @@ var addIndex = (result, dataLength, index) => {
5735
5737
  result.add(index);
5736
5738
  }
5737
5739
  };
5738
- function getAlwaysRenderIndices(config, data, keyExtractor) {
5740
+ function getAlwaysRenderIndices(config, data, keyExtractor, anchoredEndSpaceAnchorIndex) {
5739
5741
  var _a3, _b;
5740
- if (!config || data.length === 0) {
5742
+ if (data.length === 0) {
5741
5743
  return [];
5742
5744
  }
5743
5745
  const result = /* @__PURE__ */ new Set();
5744
5746
  const dataLength = data.length;
5745
- const topCount = toCount(config.top);
5747
+ const topCount = toCount(config == null ? void 0 : config.top);
5746
5748
  if (topCount > 0) {
5747
5749
  for (let i = 0; i < Math.min(topCount, dataLength); i++) {
5748
5750
  addIndex(result, dataLength, i);
5749
5751
  }
5750
5752
  }
5751
- const bottomCount = toCount(config.bottom);
5753
+ const bottomCount = toCount(config == null ? void 0 : config.bottom);
5752
5754
  if (bottomCount > 0) {
5753
5755
  for (let i = Math.max(0, dataLength - bottomCount); i < dataLength; i++) {
5754
5756
  addIndex(result, dataLength, i);
5755
5757
  }
5756
5758
  }
5757
- if ((_a3 = config.indices) == null ? void 0 : _a3.length) {
5759
+ if ((_a3 = config == null ? void 0 : config.indices) == null ? void 0 : _a3.length) {
5758
5760
  for (const index of config.indices) {
5759
5761
  if (!Number.isFinite(index)) continue;
5760
5762
  addIndex(result, dataLength, Math.floor(index));
5761
5763
  }
5762
5764
  }
5763
- if ((_b = config.keys) == null ? void 0 : _b.length) {
5765
+ if ((_b = config == null ? void 0 : config.keys) == null ? void 0 : _b.length) {
5764
5766
  const keys = new Set(config.keys);
5765
5767
  for (let i = 0; i < dataLength && keys.size > 0; i++) {
5766
5768
  const key = keyExtractor(data[i], i);
@@ -5770,6 +5772,12 @@ function getAlwaysRenderIndices(config, data, keyExtractor) {
5770
5772
  }
5771
5773
  }
5772
5774
  }
5775
+ if (anchoredEndSpaceAnchorIndex !== void 0 && Number.isFinite(anchoredEndSpaceAnchorIndex)) {
5776
+ const anchorIndex = Math.floor(anchoredEndSpaceAnchorIndex);
5777
+ for (let i = anchorIndex >= 0 ? anchorIndex : dataLength; i < dataLength; i++) {
5778
+ addIndex(result, dataLength, i);
5779
+ }
5780
+ }
5773
5781
  const indices = Array.from(result);
5774
5782
  indices.sort(sortAsc);
5775
5783
  return indices;
@@ -5933,7 +5941,7 @@ var LegendList = typedMemo(
5933
5941
  })
5934
5942
  );
5935
5943
  var LegendListInner = typedForwardRef(function LegendListInner2(props, forwardedRef) {
5936
- var _a3, _b, _c, _d, _e, _f, _g, _h;
5944
+ var _a3, _b, _c, _d, _e, _f, _g, _h, _i;
5937
5945
  const noopOnScroll = useCallback((_event) => {
5938
5946
  }, []);
5939
5947
  if (props.recycleItems === void 0) {
@@ -6062,9 +6070,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6062
6070
  const keyExtractor = keyExtractorProp != null ? keyExtractorProp : ((_item, index) => index.toString());
6063
6071
  const stickyHeaderIndices = stickyHeaderIndicesProp != null ? stickyHeaderIndicesProp : stickyIndicesDeprecated;
6064
6072
  const alwaysRenderIndices = useMemo(() => {
6065
- const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor);
6073
+ const indices = getAlwaysRenderIndices(alwaysRender, dataProp, keyExtractor, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
6066
6074
  return { arr: indices, set: new Set(indices) };
6067
6075
  }, [
6076
+ anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex,
6068
6077
  alwaysRender == null ? void 0 : alwaysRender.top,
6069
6078
  alwaysRender == null ? void 0 : alwaysRender.bottom,
6070
6079
  (_d = alwaysRender == null ? void 0 : alwaysRender.indices) == null ? void 0 : _d.join(","),
@@ -6170,6 +6179,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6170
6179
  const throttledOnScroll = useThrottledOnScroll(onScrollProp != null ? onScrollProp : noopOnScroll, scrollEventThrottle != null ? scrollEventThrottle : 0);
6171
6180
  const throttleScrollFn = scrollEventThrottle && onScrollProp ? throttledOnScroll : onScrollProp;
6172
6181
  const anchoredEndSpaceResolved = anchoredEndSpace ? { ...anchoredEndSpace, includeInEndInset: true } : anchoredEndSpace;
6182
+ const didAnchoredEndSpaceAnchorIndexChange = !isFirstLocal && !didDataChangeLocal && ((_g = state.props.anchoredEndSpace) == null ? void 0 : _g.anchorIndex) !== (anchoredEndSpaceResolved == null ? void 0 : anchoredEndSpaceResolved.anchorIndex);
6173
6183
  state.props = {
6174
6184
  alignItemsAtEnd,
6175
6185
  alwaysRender,
@@ -6279,6 +6289,11 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6279
6289
  });
6280
6290
  }, [dataProp.length, didDataChangeLocal, initialScrollAtEnd, stylePaddingBottomState, usesBootstrapInitialScroll]);
6281
6291
  useLayoutEffect(() => {
6292
+ var _a4;
6293
+ if (didAnchoredEndSpaceAnchorIndexChange) {
6294
+ state.scrollForNextCalculateItemsInView = void 0;
6295
+ (_a4 = state.triggerCalculateItemsInView) == null ? void 0 : _a4.call(state);
6296
+ }
6282
6297
  maybeUpdateAnchoredEndSpace(ctx);
6283
6298
  }, [
6284
6299
  ctx,
@@ -6287,6 +6302,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6287
6302
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex,
6288
6303
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorMaxSize,
6289
6304
  anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorOffset,
6305
+ didAnchoredEndSpaceAnchorIndexChange,
6290
6306
  numColumnsProp
6291
6307
  ]);
6292
6308
  const onLayoutFooter = useCallback(
@@ -6440,7 +6456,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6440
6456
  onScroll: onScrollHandler,
6441
6457
  recycleItems,
6442
6458
  refreshControl: refreshControlElement ? stylePaddingTopState > 0 ? React3.cloneElement(refreshControlElement, {
6443
- progressViewOffset: ((_g = refreshControlElement.props.progressViewOffset) != null ? _g : 0) + stylePaddingTopState
6459
+ progressViewOffset: ((_h = refreshControlElement.props.progressViewOffset) != null ? _h : 0) + stylePaddingTopState
6444
6460
  }) : refreshControlElement : onRefresh && /* @__PURE__ */ React3.createElement(
6445
6461
  RefreshControl,
6446
6462
  {
@@ -6451,7 +6467,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
6451
6467
  ),
6452
6468
  refScrollView: combinedRef,
6453
6469
  renderScrollComponent,
6454
- scrollAdjustHandler: (_h = refState.current) == null ? void 0 : _h.scrollAdjustHandler,
6470
+ scrollAdjustHandler: (_i = refState.current) == null ? void 0 : _i.scrollAdjustHandler,
6455
6471
  scrollEventThrottle: 0,
6456
6472
  snapToIndices,
6457
6473
  stickyHeaderIndices,
package/reanimated.js CHANGED
@@ -137,10 +137,6 @@ function setSharedValueValue(sharedValue, value) {
137
137
  return;
138
138
  }
139
139
  const sharedValueWithMethods = sharedValue;
140
- const currentValue = typeof sharedValueWithMethods.get === "function" ? sharedValueWithMethods.get() : sharedValueWithMethods.value;
141
- if (currentValue === value) {
142
- return;
143
- }
144
140
  if (typeof sharedValueWithMethods.set === "function") {
145
141
  sharedValueWithMethods.set(value);
146
142
  } else {
package/reanimated.mjs CHANGED
@@ -113,10 +113,6 @@ function setSharedValueValue(sharedValue, value) {
113
113
  return;
114
114
  }
115
115
  const sharedValueWithMethods = sharedValue;
116
- const currentValue = typeof sharedValueWithMethods.get === "function" ? sharedValueWithMethods.get() : sharedValueWithMethods.value;
117
- if (currentValue === value) {
118
- return;
119
- }
120
116
  if (typeof sharedValueWithMethods.set === "function") {
121
117
  sharedValueWithMethods.set(value);
122
118
  } else {