@extend-ai/react-xlsx 0.3.0 → 0.4.0

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
@@ -18567,6 +18567,12 @@ function renderFileTooLarge(fileTooLargeState, renderProps, palette) {
18567
18567
  }
18568
18568
  return defaultNode;
18569
18569
  }
18570
+ function renderCustomFileTooLarge(fileTooLargeState, renderProps, palette) {
18571
+ if (fileTooLargeState === void 0) {
18572
+ return void 0;
18573
+ }
18574
+ return renderFileTooLarge(fileTooLargeState, renderProps, palette);
18575
+ }
18570
18576
  function renderDefaultChartLoadingCard(rect) {
18571
18577
  const bars = [18, 32, 24];
18572
18578
  const barWidth = Math.max(8, Math.min(12, Math.round(rect.width * 0.018)));
@@ -22895,7 +22901,17 @@ function XlsxViewerInner({
22895
22901
  toolbar
22896
22902
  }) {
22897
22903
  const palette = useViewerPalette(isDark);
22898
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ViewerAppearanceContext.Provider, { value: { isDark }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ViewerContext.Provider, { value: controller, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
22904
+ const { displayFileName, error } = controller;
22905
+ const customFileTooLarge = error instanceof XlsxFileSizeLimitExceededError ? renderCustomFileTooLarge(
22906
+ fileTooLargeState,
22907
+ {
22908
+ displayFileName,
22909
+ fileSizeBytes: error.fileSizeBytes,
22910
+ maxFileSizeBytes: error.maxFileSizeBytes
22911
+ },
22912
+ palette
22913
+ ) : void 0;
22914
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ViewerAppearanceContext.Provider, { value: { isDark }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ViewerContext.Provider, { value: controller, children: customFileTooLarge !== void 0 ? customFileTooLarge : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
22899
22915
  "div",
22900
22916
  {
22901
22917
  className: classNames("react-xlsx-viewer", className),