@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.js CHANGED
@@ -23653,9 +23653,6 @@ function XlsxGrid({
23653
23653
  };
23654
23654
  }, [activeSheet, asyncViewportRowBatch, getRowsBatchAsync, shouldVirtualizeRows, startBatchTransition, viewportRequest]);
23655
23655
  const viewportRowBatch = getRowsBatchAsync ? asyncViewportRowBatch : syncViewportRowBatch;
23656
- React4.useEffect(() => {
23657
- cellRenderCacheRef.current.clear();
23658
- }, [activeSheetIndex, displayColLimit, displayRowLimit, getCellStyle, palette, revision, viewportRowBatch, worksheet, zoomFactor]);
23659
23656
  React4.useEffect(() => {
23660
23657
  setAsyncViewportRowBatch(null);
23661
23658
  }, [activeSheetIndex, revision]);
@@ -23674,9 +23671,39 @@ function XlsxGrid({
23674
23671
  () => activeSheet ? chartRangeHighlights.filter((highlight) => highlight.workbookSheetIndex === activeSheet.workbookSheetIndex) : [],
23675
23672
  [activeSheet, chartRangeHighlights]
23676
23673
  );
23677
- React4.useEffect(() => {
23674
+ const cellRenderCacheInvalidationKey = React4.useMemo(
23675
+ () => [
23676
+ activeSheetChartHighlights,
23677
+ activeSheetIndex,
23678
+ displayColLimit,
23679
+ displayRowLimit,
23680
+ getCellStyle,
23681
+ palette,
23682
+ revision,
23683
+ selectedChartId,
23684
+ viewportRowBatch,
23685
+ worksheet,
23686
+ zoomFactor
23687
+ ],
23688
+ [
23689
+ activeSheetChartHighlights,
23690
+ activeSheetIndex,
23691
+ displayColLimit,
23692
+ displayRowLimit,
23693
+ getCellStyle,
23694
+ palette,
23695
+ revision,
23696
+ selectedChartId,
23697
+ viewportRowBatch,
23698
+ worksheet,
23699
+ zoomFactor
23700
+ ]
23701
+ );
23702
+ const cellRenderCacheInvalidationRef = React4.useRef(null);
23703
+ if (cellRenderCacheInvalidationRef.current !== cellRenderCacheInvalidationKey) {
23678
23704
  cellRenderCacheRef.current.clear();
23679
- }, [activeSheetChartHighlights, selectedChartId]);
23705
+ cellRenderCacheInvalidationRef.current = cellRenderCacheInvalidationKey;
23706
+ }
23680
23707
  const getCellData = React4.useCallback((row, col) => {
23681
23708
  const cacheKey = `${row}:${col}`;
23682
23709
  const cached = cellRenderCacheRef.current.get(cacheKey);
@@ -23883,6 +23910,7 @@ function XlsxGrid({
23883
23910
  }, [
23884
23911
  activeSheet,
23885
23912
  activeSheetChartHighlights,
23913
+ cellRenderCacheInvalidationKey,
23886
23914
  colIndexByActual,
23887
23915
  colPrefixSums,
23888
23916
  displayDefaultColWidth,