@extend-ai/react-xlsx 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -23687,9 +23687,6 @@ function XlsxGrid({
23687
23687
  };
23688
23688
  }, [activeSheet, asyncViewportRowBatch, getRowsBatchAsync, shouldVirtualizeRows, startBatchTransition, viewportRequest]);
23689
23689
  const viewportRowBatch = getRowsBatchAsync ? asyncViewportRowBatch : syncViewportRowBatch;
23690
- React4.useEffect(() => {
23691
- cellRenderCacheRef.current.clear();
23692
- }, [activeSheetIndex, displayColLimit, displayRowLimit, getCellStyle, palette, revision, viewportRowBatch, worksheet, zoomFactor]);
23693
23690
  React4.useEffect(() => {
23694
23691
  setAsyncViewportRowBatch(null);
23695
23692
  }, [activeSheetIndex, revision]);
@@ -23708,9 +23705,39 @@ function XlsxGrid({
23708
23705
  () => activeSheet ? chartRangeHighlights.filter((highlight) => highlight.workbookSheetIndex === activeSheet.workbookSheetIndex) : [],
23709
23706
  [activeSheet, chartRangeHighlights]
23710
23707
  );
23711
- React4.useEffect(() => {
23708
+ const cellRenderCacheInvalidationKey = React4.useMemo(
23709
+ () => [
23710
+ activeSheetChartHighlights,
23711
+ activeSheetIndex,
23712
+ displayColLimit,
23713
+ displayRowLimit,
23714
+ getCellStyle,
23715
+ palette,
23716
+ revision,
23717
+ selectedChartId,
23718
+ viewportRowBatch,
23719
+ worksheet,
23720
+ zoomFactor
23721
+ ],
23722
+ [
23723
+ activeSheetChartHighlights,
23724
+ activeSheetIndex,
23725
+ displayColLimit,
23726
+ displayRowLimit,
23727
+ getCellStyle,
23728
+ palette,
23729
+ revision,
23730
+ selectedChartId,
23731
+ viewportRowBatch,
23732
+ worksheet,
23733
+ zoomFactor
23734
+ ]
23735
+ );
23736
+ const cellRenderCacheInvalidationRef = React4.useRef(null);
23737
+ if (cellRenderCacheInvalidationRef.current !== cellRenderCacheInvalidationKey) {
23712
23738
  cellRenderCacheRef.current.clear();
23713
- }, [activeSheetChartHighlights, selectedChartId]);
23739
+ cellRenderCacheInvalidationRef.current = cellRenderCacheInvalidationKey;
23740
+ }
23714
23741
  const getCellData = React4.useCallback((row, col) => {
23715
23742
  const cacheKey = `${row}:${col}`;
23716
23743
  const cached = cellRenderCacheRef.current.get(cacheKey);
@@ -23917,6 +23944,7 @@ function XlsxGrid({
23917
23944
  }, [
23918
23945
  activeSheet,
23919
23946
  activeSheetChartHighlights,
23947
+ cellRenderCacheInvalidationKey,
23920
23948
  colIndexByActual,
23921
23949
  colPrefixSums,
23922
23950
  displayDefaultColWidth,