@extend-ai/react-xlsx 0.20.10 → 0.20.12

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.
Files changed (50) hide show
  1. package/README.md +27 -3
  2. package/dist/{chunk-OGZ6ROZC.cjs → chunk-A3S3QKJN.cjs} +445 -3
  3. package/dist/chunk-A3S3QKJN.cjs.map +1 -0
  4. package/dist/chunk-IRC7BQ6E.js +538 -0
  5. package/dist/chunk-IRC7BQ6E.js.map +1 -0
  6. package/dist/{chunk-DWBPSBJ5.cjs → chunk-NIN5D556.cjs} +1387 -1322
  7. package/dist/chunk-NIN5D556.cjs.map +1 -0
  8. package/dist/{chunk-2QENCJUT.js → chunk-O4S5CRDM.js} +192 -127
  9. package/dist/chunk-O4S5CRDM.js.map +1 -0
  10. package/dist/{chunk-CVMHJO5H.js → chunk-WHTV6N6S.js} +443 -1
  11. package/dist/chunk-WHTV6N6S.js.map +1 -0
  12. package/dist/chunk-ZPDHTVL6.cjs +538 -0
  13. package/dist/chunk-ZPDHTVL6.cjs.map +1 -0
  14. package/dist/index.cjs +183 -154
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +60 -2
  17. package/dist/index.d.ts +60 -2
  18. package/dist/index.js +52 -23
  19. package/dist/index.js.map +1 -1
  20. package/dist/{internal-BBaC9yCh.d.cts → internal-D_np3R-w.d.cts} +60 -2
  21. package/dist/{internal-BBaC9yCh.d.ts → internal-D_np3R-w.d.ts} +60 -2
  22. package/dist/internal.cjs +3 -3
  23. package/dist/internal.d.cts +1 -1
  24. package/dist/internal.d.ts +1 -1
  25. package/dist/internal.js +2 -2
  26. package/dist/{shared-chart-XOCTF7KQ.js → shared-chart-7RUN5IKZ.js} +6 -4
  27. package/dist/shared-chart-7RUN5IKZ.js.map +1 -0
  28. package/dist/{shared-chart-CIRSCWTO.cjs → shared-chart-P3KU6TQR.cjs} +15 -13
  29. package/dist/shared-chart-P3KU6TQR.cjs.map +1 -0
  30. package/dist/{shared-chart-BLOOGI7S.js → shared-chart-UTUK46E4.js} +6 -4
  31. package/dist/shared-chart-UTUK46E4.js.map +1 -0
  32. package/dist/{shared-chart-4LUQQI2B.cjs → shared-chart-VRXD57MU.cjs} +6 -4
  33. package/dist/shared-chart-VRXD57MU.cjs.map +1 -0
  34. package/dist/vanilla.cjs +3 -3
  35. package/dist/vanilla.d.cts +2 -2
  36. package/dist/vanilla.d.ts +2 -2
  37. package/dist/vanilla.js +2 -2
  38. package/package.json +1 -1
  39. package/dist/chunk-2QENCJUT.js.map +0 -1
  40. package/dist/chunk-7GBCRNGO.js +0 -94
  41. package/dist/chunk-7GBCRNGO.js.map +0 -1
  42. package/dist/chunk-CVMHJO5H.js.map +0 -1
  43. package/dist/chunk-DWBPSBJ5.cjs.map +0 -1
  44. package/dist/chunk-MFOGLSFJ.cjs +0 -94
  45. package/dist/chunk-MFOGLSFJ.cjs.map +0 -1
  46. package/dist/chunk-OGZ6ROZC.cjs.map +0 -1
  47. package/dist/shared-chart-4LUQQI2B.cjs.map +0 -1
  48. package/dist/shared-chart-BLOOGI7S.js.map +0 -1
  49. package/dist/shared-chart-CIRSCWTO.cjs.map +0 -1
  50. package/dist/shared-chart-XOCTF7KQ.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -45,6 +45,60 @@ interface OfficeCharts {
45
45
  renderChart(xml: string, options?: RenderOptions): string | null;
46
46
  }
47
47
 
48
+ declare const englishMessages: {
49
+ sortAscending: string;
50
+ sortDescending: string;
51
+ openMenuForColumn: string;
52
+ cut: string;
53
+ copy: string;
54
+ paste: string;
55
+ editCell: string;
56
+ clearContents: string;
57
+ undo: string;
58
+ redo: string;
59
+ mergeAndCenter: string;
60
+ mergeAcross: string;
61
+ mergeCells: string;
62
+ unmergeCells: string;
63
+ selectRow: string;
64
+ selectColumn: string;
65
+ selectAll: string;
66
+ contextMenu: string;
67
+ clipboardCopyUnavailable: string;
68
+ clipboardPasteUnavailable: string;
69
+ nothingToPaste: string;
70
+ actionFailed: string;
71
+ workbookSheets: string;
72
+ downloadWorkbook: string;
73
+ zoomIn: string;
74
+ zoomOut: string;
75
+ resetZoom: string;
76
+ hiddenSheet: string;
77
+ veryHiddenSheet: string;
78
+ loadingWorkbook: string;
79
+ emptyWorkbook: string;
80
+ loadWorkbookFailed: string;
81
+ fileTooLarge: string;
82
+ largeWorkbook: string;
83
+ deferredLoadDescription: string;
84
+ loadAnyway: string;
85
+ worksheetGrid: string;
86
+ workbookGrid: string;
87
+ dropdownControl: string;
88
+ listBoxControl: string;
89
+ scrollbarControl: string;
90
+ spinnerControl: string;
91
+ chart: string;
92
+ loadingChart: string;
93
+ loadChartFailed: string;
94
+ mapUnavailable: string;
95
+ chartUnavailable: string;
96
+ chartsheetUnavailable: string;
97
+ };
98
+ type XlsxViewerMessages = {
99
+ [Key in keyof typeof englishMessages]: string;
100
+ };
101
+
48
102
  interface XlsxThemePalette {
49
103
  colorsByIndex: Record<number, string>;
50
104
  majorLatinFont?: string;
@@ -1051,8 +1105,10 @@ interface XlsxScrollerRenderProps {
1051
1105
  };
1052
1106
  }
1053
1107
  interface UseXlsxViewerControllerOptions {
1054
- /** BCP 47 locale for numeric decimal and grouping separators. Defaults to en-US. */
1108
+ /** BCP 47 locale for number formatting and built-in UI text. Defaults to en-US. */
1055
1109
  locale?: string;
1110
+ /** Partial overrides for localized UI text, including accessibility labels. */
1111
+ messages?: Partial<XlsxViewerMessages>;
1056
1112
  /**
1057
1113
  * Allows row and column resizing even while editing is disabled by `readOnly`.
1058
1114
  *
@@ -1166,6 +1222,8 @@ interface XlsxViewerController {
1166
1222
  defineNamedRange: (name: string, range?: XlsxCellRange | null) => void;
1167
1223
  displayFileName: string;
1168
1224
  locale: string;
1225
+ /** Resolved UI text after applying locale defaults and message overrides. */
1226
+ messages: XlsxViewerMessages;
1169
1227
  download: () => void;
1170
1228
  charts: XlsxChart[];
1171
1229
  chartsheets: XlsxChartsheet[];
@@ -1854,4 +1912,4 @@ declare function useXlsxViewerCharts(): XlsxViewerCharts;
1854
1912
  declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOptions): XlsxViewerThumbnails;
1855
1913
  declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
1856
1914
 
1857
- export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, type XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxHighlightRangeOptions, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxMergeMode, type XlsxParsedRange, type XlsxRangeHighlight, type XlsxScrollerRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
1915
+ export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, type XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxHighlightRangeOptions, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxMergeMode, type XlsxParsedRange, type XlsxRangeHighlight, type XlsxScrollerRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerMessages, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
package/dist/index.d.ts CHANGED
@@ -45,6 +45,60 @@ interface OfficeCharts {
45
45
  renderChart(xml: string, options?: RenderOptions): string | null;
46
46
  }
47
47
 
48
+ declare const englishMessages: {
49
+ sortAscending: string;
50
+ sortDescending: string;
51
+ openMenuForColumn: string;
52
+ cut: string;
53
+ copy: string;
54
+ paste: string;
55
+ editCell: string;
56
+ clearContents: string;
57
+ undo: string;
58
+ redo: string;
59
+ mergeAndCenter: string;
60
+ mergeAcross: string;
61
+ mergeCells: string;
62
+ unmergeCells: string;
63
+ selectRow: string;
64
+ selectColumn: string;
65
+ selectAll: string;
66
+ contextMenu: string;
67
+ clipboardCopyUnavailable: string;
68
+ clipboardPasteUnavailable: string;
69
+ nothingToPaste: string;
70
+ actionFailed: string;
71
+ workbookSheets: string;
72
+ downloadWorkbook: string;
73
+ zoomIn: string;
74
+ zoomOut: string;
75
+ resetZoom: string;
76
+ hiddenSheet: string;
77
+ veryHiddenSheet: string;
78
+ loadingWorkbook: string;
79
+ emptyWorkbook: string;
80
+ loadWorkbookFailed: string;
81
+ fileTooLarge: string;
82
+ largeWorkbook: string;
83
+ deferredLoadDescription: string;
84
+ loadAnyway: string;
85
+ worksheetGrid: string;
86
+ workbookGrid: string;
87
+ dropdownControl: string;
88
+ listBoxControl: string;
89
+ scrollbarControl: string;
90
+ spinnerControl: string;
91
+ chart: string;
92
+ loadingChart: string;
93
+ loadChartFailed: string;
94
+ mapUnavailable: string;
95
+ chartUnavailable: string;
96
+ chartsheetUnavailable: string;
97
+ };
98
+ type XlsxViewerMessages = {
99
+ [Key in keyof typeof englishMessages]: string;
100
+ };
101
+
48
102
  interface XlsxThemePalette {
49
103
  colorsByIndex: Record<number, string>;
50
104
  majorLatinFont?: string;
@@ -1051,8 +1105,10 @@ interface XlsxScrollerRenderProps {
1051
1105
  };
1052
1106
  }
1053
1107
  interface UseXlsxViewerControllerOptions {
1054
- /** BCP 47 locale for numeric decimal and grouping separators. Defaults to en-US. */
1108
+ /** BCP 47 locale for number formatting and built-in UI text. Defaults to en-US. */
1055
1109
  locale?: string;
1110
+ /** Partial overrides for localized UI text, including accessibility labels. */
1111
+ messages?: Partial<XlsxViewerMessages>;
1056
1112
  /**
1057
1113
  * Allows row and column resizing even while editing is disabled by `readOnly`.
1058
1114
  *
@@ -1166,6 +1222,8 @@ interface XlsxViewerController {
1166
1222
  defineNamedRange: (name: string, range?: XlsxCellRange | null) => void;
1167
1223
  displayFileName: string;
1168
1224
  locale: string;
1225
+ /** Resolved UI text after applying locale defaults and message overrides. */
1226
+ messages: XlsxViewerMessages;
1169
1227
  download: () => void;
1170
1228
  charts: XlsxChart[];
1171
1229
  chartsheets: XlsxChartsheet[];
@@ -1854,4 +1912,4 @@ declare function useXlsxViewerCharts(): XlsxViewerCharts;
1854
1912
  declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOptions): XlsxViewerThumbnails;
1855
1913
  declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
1856
1914
 
1857
- export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, type XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxHighlightRangeOptions, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxMergeMode, type XlsxParsedRange, type XlsxRangeHighlight, type XlsxScrollerRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
1915
+ export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, type XlsxContextMenuAction, type XlsxContextMenuActionId, type XlsxContextMenuContext, type XlsxContextMenuRenderProps, type XlsxDrawingLayout, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxHighlightRangeOptions, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxMergeMode, type XlsxParsedRange, type XlsxRangeHighlight, type XlsxScrollerRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerMessages, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWorkbookTab, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
package/dist/index.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import {
2
- loadOfficeFonts
3
- } from "./chunk-7GBCRNGO.js";
2
+ formatMessage,
3
+ loadOfficeFonts,
4
+ mergeMessages,
5
+ resolveMessages,
6
+ useXlsxMessages
7
+ } from "./chunk-IRC7BQ6E.js";
4
8
 
5
9
  // src/number-locale.ts
6
10
  var separators = /* @__PURE__ */ new Map();
@@ -9427,6 +9431,7 @@ function useXlsxViewerController(options) {
9427
9431
  file,
9428
9432
  fileName,
9429
9433
  locale = "en-US",
9434
+ messages: messageOverrides,
9430
9435
  maxFileSizeBytes = DEFAULT_MAX_FILE_SIZE_BYTES,
9431
9436
  readOnly: requestedReadOnly = false,
9432
9437
  readOnlyAboveBytes = 0,
@@ -9435,6 +9440,7 @@ function useXlsxViewerController(options) {
9435
9440
  src,
9436
9441
  useWorker = true
9437
9442
  } = options;
9443
+ const messages = React.useMemo(() => resolveMessages(locale, messageOverrides), [locale, messageOverrides]);
9438
9444
  const [isLoading, setIsLoading] = React.useState(Boolean(file ?? src));
9439
9445
  const [error, setError] = React.useState(null);
9440
9446
  const [workbook, setWorkbook] = React.useState(null);
@@ -10692,9 +10698,10 @@ function useXlsxViewerController(options) {
10692
10698
  activeCell,
10693
10699
  activeSheetIndex,
10694
10700
  bytes: createSavedWorkbookBytes(workbook),
10695
- selection
10701
+ selection,
10702
+ sortState
10696
10703
  };
10697
- }, [activeCell, activeSheetIndex, createSavedWorkbookBytes, selection, workbook]);
10704
+ }, [activeCell, activeSheetIndex, createSavedWorkbookBytes, selection, sortState, workbook]);
10698
10705
  const captureCellMutationState = React.useCallback((cell) => {
10699
10706
  const worksheet = getActiveWorksheet();
10700
10707
  if (!worksheet) {
@@ -10734,6 +10741,7 @@ function useXlsxViewerController(options) {
10734
10741
  }
10735
10742
  setActiveCell(entry.activeCell);
10736
10743
  setSelection(entry.selection);
10744
+ setSortState(entry.sortState);
10737
10745
  selectionAnchorRef.current = entry.selection ? normalizeRange(entry.selection).start : entry.activeCell;
10738
10746
  setRevision((current) => current + 1);
10739
10747
  }, [setChartAssets, setImageAssets]);
@@ -10768,6 +10776,7 @@ function useXlsxViewerController(options) {
10768
10776
  for (const mutation of entry.mutations) {
10769
10777
  applyCellMutationState(worksheet, mutation.cell, direction === "undo" ? mutation.before : mutation.after);
10770
10778
  }
10779
+ setSortState(direction === "undo" ? entry.sortStateBefore : entry.sortStateAfter);
10771
10780
  maybeRecalculateWorkbook(workbook);
10772
10781
  refreshWorkbookState(workbook);
10773
10782
  const nextActiveCell = direction === "undo" ? entry.activeCellBefore : entry.activeCellAfter;
@@ -10905,8 +10914,8 @@ function useXlsxViewerController(options) {
10905
10914
  redoStackRef.current = [];
10906
10915
  setHistoryRevision((current) => current + 1);
10907
10916
  }, [activeCell, activeSheet, selection]);
10908
- const recordRangeEditHistory = React.useCallback((mutations, selectionAfter, activeCellAfter) => {
10909
- if (!activeSheet || isApplyingHistoryRef.current || mutations.length === 0) {
10917
+ const recordRangeEditHistory = React.useCallback((mutations, selectionAfter, activeCellAfter, sortStateAfter = sortState) => {
10918
+ if (!activeSheet || isApplyingHistoryRef.current || mutations.length === 0 && sortStateAfter === sortState) {
10910
10919
  return;
10911
10920
  }
10912
10921
  pushHistoryEntry(undoStackRef.current, {
@@ -10916,11 +10925,13 @@ function useXlsxViewerController(options) {
10916
10925
  mutations,
10917
10926
  selectionAfter,
10918
10927
  selectionBefore: selection,
10919
- sheetIndex: activeSheet.workbookSheetIndex
10928
+ sheetIndex: activeSheet.workbookSheetIndex,
10929
+ sortStateAfter,
10930
+ sortStateBefore: sortState
10920
10931
  });
10921
10932
  redoStackRef.current = [];
10922
10933
  setHistoryRevision((current) => current + 1);
10923
- }, [activeCell, activeSheet, selection]);
10934
+ }, [activeCell, activeSheet, selection, sortState]);
10924
10935
  const sortTable = React.useCallback((tableName, columnIndex, direction) => {
10925
10936
  const worksheet = getActiveWorksheet();
10926
10937
  const targetTable = tables.find((table) => table.name === tableName || table.displayName === tableName);
@@ -10972,8 +10983,13 @@ function useXlsxViewerController(options) {
10972
10983
  const comparedText = left.sortText.localeCompare(right.sortText, void 0, { numeric: true, sensitivity: "base" });
10973
10984
  return direction === "ascending" ? comparedText : -comparedText;
10974
10985
  });
10986
+ const nextSortState = { columnIndex, direction, tableName: targetTable.name };
10975
10987
  if (sortedRows.every((row, index) => row.index === rows[index]?.index)) {
10976
- setSortState({ columnIndex, direction, tableName: targetTable.name });
10988
+ if (sortState?.tableName === targetTable.name && sortState.columnIndex === columnIndex && sortState.direction === direction) {
10989
+ return;
10990
+ }
10991
+ setSortState(nextSortState);
10992
+ recordRangeEditHistory([], selection, activeCell, nextSortState);
10977
10993
  return;
10978
10994
  }
10979
10995
  const mutations = [];
@@ -11001,8 +11017,8 @@ function useXlsxViewerController(options) {
11001
11017
  }
11002
11018
  maybeRecalculateWorkbook(workbook);
11003
11019
  refreshWorkbookState(workbook);
11004
- setSortState({ columnIndex, direction, tableName: targetTable.name });
11005
- recordRangeEditHistory(mutations, selection, activeCell);
11020
+ setSortState(nextSortState);
11021
+ recordRangeEditHistory(mutations, selection, activeCell, nextSortState);
11006
11022
  }, [
11007
11023
  activeCell,
11008
11024
  activeSheet,
@@ -11012,6 +11028,7 @@ function useXlsxViewerController(options) {
11012
11028
  recordRangeEditHistory,
11013
11029
  refreshWorkbookState,
11014
11030
  selection,
11031
+ sortState,
11015
11032
  tables,
11016
11033
  workbook
11017
11034
  ]);
@@ -12166,6 +12183,7 @@ function useXlsxViewerController(options) {
12166
12183
  defineNamedRange,
12167
12184
  displayFileName,
12168
12185
  locale,
12186
+ messages,
12169
12187
  download,
12170
12188
  exportCsv,
12171
12189
  exportXlsx,
@@ -12290,6 +12308,7 @@ function useXlsxViewerController(options) {
12290
12308
  defineNamedRange,
12291
12309
  displayFileName,
12292
12310
  locale,
12311
+ messages,
12293
12312
  download,
12294
12313
  error,
12295
12314
  exportCsv,
@@ -12416,6 +12435,7 @@ function CellEditor({
12416
12435
  onNavigate
12417
12436
  }) {
12418
12437
  const rootRef = React2.useRef(null);
12438
+ const messages = useXlsxMessages();
12419
12439
  const mirrorRef = React2.useRef(null);
12420
12440
  const textRef = React2.useRef(null);
12421
12441
  const baselineRef = React2.useRef(null);
@@ -12601,7 +12621,7 @@ function CellEditor({
12601
12621
  if (typeof inputRef === "function") inputRef(element);
12602
12622
  else if (inputRef) inputRef.current = element;
12603
12623
  },
12604
- "aria-label": "Edit cell",
12624
+ "aria-label": messages.editCell,
12605
12625
  autoFocus: true,
12606
12626
  autoComplete: "off",
12607
12627
  spellCheck: false,
@@ -12775,18 +12795,18 @@ function createChartModule(importModule) {
12775
12795
  var officeChartRenderer = createChartModule(async () => {
12776
12796
  const [{ loadOfficeCharts }, { SharedChartSvg }] = await Promise.all([
12777
12797
  import("./browser-AWFV5QM2.js"),
12778
- import("./shared-chart-BLOOGI7S.js")
12798
+ import("./shared-chart-UTUK46E4.js")
12779
12799
  ]);
12780
12800
  return { renderer: await loadOfficeCharts(), SharedChartSvg };
12781
12801
  });
12782
12802
  var suppliedOfficeChartRenderer = createChartModule(async () => {
12783
- const { SharedChartSvg } = await import("./shared-chart-BLOOGI7S.js");
12803
+ const { SharedChartSvg } = await import("./shared-chart-UTUK46E4.js");
12784
12804
  return { renderer: null, SharedChartSvg };
12785
12805
  });
12786
12806
  var officeExtendedChartRenderer = createChartModule(async () => {
12787
12807
  const [{ loadOfficeCharts }, { SharedChartSvg }] = await Promise.all([
12788
12808
  import("./full-ERXNU2LF.js"),
12789
- import("./shared-chart-BLOOGI7S.js")
12809
+ import("./shared-chart-UTUK46E4.js")
12790
12810
  ]);
12791
12811
  return { renderer: await loadOfficeCharts(typeof DecompressionStream === "function" ? void 0 : new URL("./office_charts_full_bg.wasm", import.meta.url)), SharedChartSvg };
12792
12812
  });
@@ -13410,8 +13430,8 @@ function drawCanvasConditionalIcon(context, icon, centerX, centerY, size) {
13410
13430
  context.fill();
13411
13431
  context.restore();
13412
13432
  }
13413
- function formatZoomScale(zoomScale) {
13414
- return `${Math.round(zoomScale)}%`;
13433
+ function formatZoomScale(zoomScale, locale) {
13434
+ return new Intl.NumberFormat(locale, { style: "percent", maximumFractionDigits: 0 }).format(zoomScale / 100);
13415
13435
  }
13416
13436
  function parseRgbColor(color) {
13417
13437
  const match = /^#?([0-9a-f]{6})$/i.exec(color);
@@ -15302,6 +15322,7 @@ function mergeResolvedCellStyle(base, overlay, options) {
15302
15322
  }
15303
15323
  function SegmentedControl({
15304
15324
  items,
15325
+ messages,
15305
15326
  onValueChange,
15306
15327
  palette,
15307
15328
  value
@@ -15309,7 +15330,7 @@ function SegmentedControl({
15309
15330
  return /* @__PURE__ */ jsx4(
15310
15331
  "div",
15311
15332
  {
15312
- "aria-label": "Workbook sheets",
15333
+ "aria-label": messages.workbookSheets,
15313
15334
  role: "tablist",
15314
15335
  style: {
15315
15336
  alignItems: "center",
@@ -15361,6 +15382,8 @@ function DefaultToolbar({ controller, palette }) {
15361
15382
  canZoomIn,
15362
15383
  canZoomOut,
15363
15384
  defaultZoomScale,
15385
+ locale,
15386
+ messages,
15364
15387
  displayFileName,
15365
15388
  download,
15366
15389
  resetZoom,
@@ -15416,6 +15439,7 @@ function DefaultToolbar({ controller, palette }) {
15416
15439
  /* @__PURE__ */ jsx4(
15417
15440
  "button",
15418
15441
  {
15442
+ "aria-label": messages.zoomOut,
15419
15443
  disabled: !canZoomOut,
15420
15444
  onClick: zoomOut,
15421
15445
  style: {
@@ -15434,6 +15458,7 @@ function DefaultToolbar({ controller, palette }) {
15434
15458
  /* @__PURE__ */ jsx4(
15435
15459
  "button",
15436
15460
  {
15461
+ "aria-label": messages.resetZoom,
15437
15462
  onClick: resetZoom,
15438
15463
  style: {
15439
15464
  background: Math.round(zoomScale) === Math.round(defaultZoomScale) ? "transparent" : palette.subtleSurface,
@@ -15448,12 +15473,13 @@ function DefaultToolbar({ controller, palette }) {
15448
15473
  padding: "6px 10px"
15449
15474
  },
15450
15475
  type: "button",
15451
- children: formatZoomScale(zoomScale)
15476
+ children: formatZoomScale(zoomScale, locale)
15452
15477
  }
15453
15478
  ),
15454
15479
  /* @__PURE__ */ jsx4(
15455
15480
  "button",
15456
15481
  {
15482
+ "aria-label": messages.zoomIn,
15457
15483
  disabled: !canZoomIn,
15458
15484
  onClick: zoomIn,
15459
15485
  style: {
@@ -15475,7 +15501,7 @@ function DefaultToolbar({ controller, palette }) {
15475
15501
  canDownload ? /* @__PURE__ */ jsx4(
15476
15502
  "button",
15477
15503
  {
15478
- "aria-label": "Download workbook",
15504
+ "aria-label": messages.downloadWorkbook,
15479
15505
  onClick: download,
15480
15506
  style: {
15481
15507
  alignItems: "center",
@@ -15492,7 +15518,7 @@ function DefaultToolbar({ controller, palette }) {
15492
15518
  padding: 0,
15493
15519
  width: 32
15494
15520
  },
15495
- title: "Download workbook",
15521
+ title: messages.downloadWorkbook,
15496
15522
  type: "button",
15497
15523
  children: "\u2193"
15498
15524
  }
@@ -15513,10 +15539,11 @@ function DefaultToolbar({ controller, palette }) {
15513
15539
  children: /* @__PURE__ */ jsx4(
15514
15540
  SegmentedControl,
15515
15541
  {
15542
+ messages,
15516
15543
  items: tabs.map((tab, index) => ({
15517
15544
  id: String(index),
15518
15545
  label: tab.name,
15519
- title: tab.visibility === "hidden" ? `${tab.name} (hidden)` : tab.visibility === "veryHidden" ? `${tab.name} (very hidden)` : tab.name,
15546
+ title: tab.visibility === "hidden" ? formatMessage(messages.hiddenSheet, { sheet: tab.name }) : tab.visibility === "veryHidden" ? formatMessage(messages.veryHiddenSheet, { sheet: tab.name }) : tab.name,
15520
15547
  visibility: tab.visibility
15521
15548
  })),
15522
15549
  onValueChange: (value) => setActiveTabIndex(Number(value)),
@@ -17971,7 +17998,9 @@ function renderOptions(props, controller, slots, owner) {
17971
17998
  renderTableHeaderMenu: renderTableHeaderMenu ? (value) => slot(`table:${value.table.name}:${value.cell.row}:${value.cell.col}`, renderTableHeaderMenu(value)) : void 0
17972
17999
  };
17973
18000
  }
17974
- function BoundViewer({ props, controller }) {
18001
+ function BoundViewer({ props, controller: sourceController }) {
18002
+ const messages = React7.useMemo(() => mergeMessages(sourceController.messages, props.messages), [sourceController.messages, props.messages]);
18003
+ const controller = React7.useMemo(() => ({ ...sourceController, messages }), [sourceController, messages]);
17975
18004
  const hostRef = React7.useRef(null);
17976
18005
  const viewerRef = React7.useRef(null);
17977
18006
  const slots = React7.useMemo(() => new SlotStore(), []);