@extend-ai/react-xlsx 0.20.11 → 0.21.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.
Files changed (50) hide show
  1. package/README.md +171 -4
  2. package/dist/{chunk-VSM7WKLM.js → chunk-2UFSVI5Z.js} +565 -142
  3. package/dist/chunk-2UFSVI5Z.js.map +1 -0
  4. package/dist/{chunk-SXHHFUXA.cjs → chunk-7IL4KLCD.cjs} +1729 -1306
  5. package/dist/chunk-7IL4KLCD.cjs.map +1 -0
  6. package/dist/{chunk-OGZ6ROZC.cjs → chunk-A3S3QKJN.cjs} +445 -3
  7. package/dist/chunk-A3S3QKJN.cjs.map +1 -0
  8. package/dist/chunk-IRC7BQ6E.js +538 -0
  9. package/dist/chunk-IRC7BQ6E.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 +245 -159
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +135 -2
  17. package/dist/index.d.ts +135 -2
  18. package/dist/index.js +203 -117
  19. package/dist/index.js.map +1 -1
  20. package/dist/{internal-BBaC9yCh.d.cts → internal-BO70EPFy.d.cts} +130 -2
  21. package/dist/{internal-BBaC9yCh.d.ts → internal-BO70EPFy.d.ts} +130 -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-7GBCRNGO.js +0 -94
  40. package/dist/chunk-7GBCRNGO.js.map +0 -1
  41. package/dist/chunk-CVMHJO5H.js.map +0 -1
  42. package/dist/chunk-MFOGLSFJ.cjs +0 -94
  43. package/dist/chunk-MFOGLSFJ.cjs.map +0 -1
  44. package/dist/chunk-OGZ6ROZC.cjs.map +0 -1
  45. package/dist/chunk-SXHHFUXA.cjs.map +0 -1
  46. package/dist/chunk-VSM7WKLM.js.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[];
@@ -1249,6 +1307,11 @@ interface XlsxViewerController {
1249
1307
  * @param style Partial Excel style patch to apply to the target cell.
1250
1308
  */
1251
1309
  setCellStyle: (cell: XlsxCellAddress, style: XlsxCellStyleInput) => void;
1310
+ /** Applies individual cell styles as one undoable workbook edit. */
1311
+ setCellStyles: (updates: ReadonlyArray<{
1312
+ cell: XlsxCellAddress;
1313
+ style: XlsxCellStyleInput;
1314
+ }>) => void;
1252
1315
  /**
1253
1316
  * Sets the value for a cell in the active worksheet.
1254
1317
  *
@@ -1369,6 +1432,10 @@ interface XlsxContextMenuRenderProps {
1369
1432
  /** Returns whether the command completed; failures remain visible in the menu. */
1370
1433
  runAction: (actionId: XlsxContextMenuActionId) => Promise<boolean>;
1371
1434
  closeMenu: () => void;
1435
+ /** Aborted when the menu closes or its selection expires. */
1436
+ signal: AbortSignal;
1437
+ /** Applies a synchronous custom mutation, then closes the menu. Rejects stale or read-only menus. */
1438
+ commit: (apply: (context: XlsxContextMenuContext) => void) => boolean;
1372
1439
  /** Viewport coordinates. The menu container handles positioning and edge clamping. */
1373
1440
  position: {
1374
1441
  x: number;
@@ -1424,6 +1491,11 @@ interface XlsxViewerEditing {
1424
1491
  * @param style Partial Excel style patch to apply to the target cell.
1425
1492
  */
1426
1493
  setCellStyle: (cell: XlsxCellAddress, style: XlsxCellStyleInput) => void;
1494
+ /** Applies individual cell styles as one undoable workbook edit. */
1495
+ setCellStyles: (updates: ReadonlyArray<{
1496
+ cell: XlsxCellAddress;
1497
+ style: XlsxCellStyleInput;
1498
+ }>) => void;
1427
1499
  /**
1428
1500
  * Sets the value for a cell in the active worksheet.
1429
1501
  *
@@ -1565,6 +1637,61 @@ interface XlsxActiveCellOverlayRenderProps {
1565
1637
  */
1566
1638
  rect: XlsxImageRect;
1567
1639
  }
1640
+ interface XlsxCellEditorContext {
1641
+ cell: XlsxCellAddress;
1642
+ sheetIndex: number;
1643
+ sheetName: string;
1644
+ /** The saved cell input before editing started, including a leading equals sign for formulas. */
1645
+ originalValue: string;
1646
+ /** The interaction that opened this editing session. */
1647
+ trigger: "double-click" | "typing" | "keyboard" | "context-menu";
1648
+ }
1649
+ interface XlsxCellEditorSession {
1650
+ context: XlsxCellEditorContext;
1651
+ value: string;
1652
+ isPreview: boolean;
1653
+ /** Aborted when editing ends or the target changes. Pass to asynchronous requests. */
1654
+ signal: AbortSignal;
1655
+ /** Reads the latest draft, or null after this session ends. */
1656
+ getValue: () => string | null;
1657
+ /** Replaces the draft without writing to the workbook. Returns false after this session ends. */
1658
+ setValue: (value: string) => boolean;
1659
+ /** Replaces the draft for review. Leaving the editor cancels an unconfirmed preview. */
1660
+ preview: (value: string) => boolean;
1661
+ /** Restores the draft from before the preview and keeps editing. */
1662
+ discardPreview: () => boolean;
1663
+ /** Saves the supplied input, or the current draft, using the existing undo history. */
1664
+ commit: (value?: string) => boolean;
1665
+ /** Ends editing without saving. */
1666
+ cancel: () => boolean;
1667
+ /** Returns focus to the built-in input. */
1668
+ focus: () => boolean;
1669
+ }
1670
+ interface XlsxCellEditorOverlayRenderProps extends XlsxCellEditorSession {
1671
+ /** The live editor element, for anchoring and scoped visual effects. */
1672
+ editorElement: HTMLDivElement;
1673
+ /** The expanded editor rectangle in viewport pixels. The overlay container already fills it. */
1674
+ rect: XlsxImageRect;
1675
+ }
1676
+ interface XlsxSelectionPopoverContext {
1677
+ cell: XlsxCellAddress;
1678
+ selection: XlsxCellRange;
1679
+ sheetIndex: number;
1680
+ sheetName: string;
1681
+ readOnly: boolean;
1682
+ }
1683
+ interface XlsxSelectionPopoverRenderProps {
1684
+ context: XlsxSelectionPopoverContext;
1685
+ /** The visible selection rectangle in viewport pixels. The container already fills it. */
1686
+ rect: XlsxImageRect;
1687
+ /** Aborted when the selection changes, editing starts, or the popover closes. */
1688
+ signal: AbortSignal;
1689
+ /** Saves a formula in the active cell and closes. Returns false for stale or read-only selections. */
1690
+ applyFormula: (formula: string) => boolean;
1691
+ /** Runs a synchronous custom mutation for the current selection and closes. */
1692
+ commit: (apply: (context: XlsxSelectionPopoverContext) => void) => boolean;
1693
+ close: () => void;
1694
+ }
1568
1695
  interface XlsxCellStyleContext {
1569
1696
  /** Address of the cell being styled. */
1570
1697
  cell: XlsxCellAddress;
@@ -1816,6 +1943,12 @@ interface XlsxViewerProps extends UseXlsxViewerControllerOptions {
1816
1943
  * ```
1817
1944
  */
1818
1945
  renderActiveCellOverlay?: (props: XlsxActiveCellOverlayRenderProps) => React.ReactNode;
1946
+ /** Styling for the built-in editor. Layout and text measurement remain managed by the viewer. */
1947
+ cellEditorStyle?: React.CSSProperties;
1948
+ /** Opt-in decoration and actions around the editing input. Nothing is rendered on cell selection. */
1949
+ renderCellEditorOverlay?: (props: XlsxCellEditorOverlayRenderProps) => React.ReactNode;
1950
+ /** Opt-in custom content around a selected cell or range. Hidden while editing. No default UI. */
1951
+ renderSelectionPopover?: (props: XlsxSelectionPopoverRenderProps) => React.ReactNode;
1819
1952
  /**
1820
1953
  * Shows worksheet images, charts, shapes, and form controls.
1821
1954
  *
@@ -1854,4 +1987,4 @@ declare function useXlsxViewerCharts(): XlsxViewerCharts;
1854
1987
  declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOptions): XlsxViewerThumbnails;
1855
1988
  declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
1856
1989
 
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 };
1990
+ export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellEditorContext, type XlsxCellEditorOverlayRenderProps, type XlsxCellEditorSession, 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 XlsxSelectionPopoverContext, type XlsxSelectionPopoverRenderProps, 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[];
@@ -1249,6 +1307,11 @@ interface XlsxViewerController {
1249
1307
  * @param style Partial Excel style patch to apply to the target cell.
1250
1308
  */
1251
1309
  setCellStyle: (cell: XlsxCellAddress, style: XlsxCellStyleInput) => void;
1310
+ /** Applies individual cell styles as one undoable workbook edit. */
1311
+ setCellStyles: (updates: ReadonlyArray<{
1312
+ cell: XlsxCellAddress;
1313
+ style: XlsxCellStyleInput;
1314
+ }>) => void;
1252
1315
  /**
1253
1316
  * Sets the value for a cell in the active worksheet.
1254
1317
  *
@@ -1369,6 +1432,10 @@ interface XlsxContextMenuRenderProps {
1369
1432
  /** Returns whether the command completed; failures remain visible in the menu. */
1370
1433
  runAction: (actionId: XlsxContextMenuActionId) => Promise<boolean>;
1371
1434
  closeMenu: () => void;
1435
+ /** Aborted when the menu closes or its selection expires. */
1436
+ signal: AbortSignal;
1437
+ /** Applies a synchronous custom mutation, then closes the menu. Rejects stale or read-only menus. */
1438
+ commit: (apply: (context: XlsxContextMenuContext) => void) => boolean;
1372
1439
  /** Viewport coordinates. The menu container handles positioning and edge clamping. */
1373
1440
  position: {
1374
1441
  x: number;
@@ -1424,6 +1491,11 @@ interface XlsxViewerEditing {
1424
1491
  * @param style Partial Excel style patch to apply to the target cell.
1425
1492
  */
1426
1493
  setCellStyle: (cell: XlsxCellAddress, style: XlsxCellStyleInput) => void;
1494
+ /** Applies individual cell styles as one undoable workbook edit. */
1495
+ setCellStyles: (updates: ReadonlyArray<{
1496
+ cell: XlsxCellAddress;
1497
+ style: XlsxCellStyleInput;
1498
+ }>) => void;
1427
1499
  /**
1428
1500
  * Sets the value for a cell in the active worksheet.
1429
1501
  *
@@ -1565,6 +1637,61 @@ interface XlsxActiveCellOverlayRenderProps {
1565
1637
  */
1566
1638
  rect: XlsxImageRect;
1567
1639
  }
1640
+ interface XlsxCellEditorContext {
1641
+ cell: XlsxCellAddress;
1642
+ sheetIndex: number;
1643
+ sheetName: string;
1644
+ /** The saved cell input before editing started, including a leading equals sign for formulas. */
1645
+ originalValue: string;
1646
+ /** The interaction that opened this editing session. */
1647
+ trigger: "double-click" | "typing" | "keyboard" | "context-menu";
1648
+ }
1649
+ interface XlsxCellEditorSession {
1650
+ context: XlsxCellEditorContext;
1651
+ value: string;
1652
+ isPreview: boolean;
1653
+ /** Aborted when editing ends or the target changes. Pass to asynchronous requests. */
1654
+ signal: AbortSignal;
1655
+ /** Reads the latest draft, or null after this session ends. */
1656
+ getValue: () => string | null;
1657
+ /** Replaces the draft without writing to the workbook. Returns false after this session ends. */
1658
+ setValue: (value: string) => boolean;
1659
+ /** Replaces the draft for review. Leaving the editor cancels an unconfirmed preview. */
1660
+ preview: (value: string) => boolean;
1661
+ /** Restores the draft from before the preview and keeps editing. */
1662
+ discardPreview: () => boolean;
1663
+ /** Saves the supplied input, or the current draft, using the existing undo history. */
1664
+ commit: (value?: string) => boolean;
1665
+ /** Ends editing without saving. */
1666
+ cancel: () => boolean;
1667
+ /** Returns focus to the built-in input. */
1668
+ focus: () => boolean;
1669
+ }
1670
+ interface XlsxCellEditorOverlayRenderProps extends XlsxCellEditorSession {
1671
+ /** The live editor element, for anchoring and scoped visual effects. */
1672
+ editorElement: HTMLDivElement;
1673
+ /** The expanded editor rectangle in viewport pixels. The overlay container already fills it. */
1674
+ rect: XlsxImageRect;
1675
+ }
1676
+ interface XlsxSelectionPopoverContext {
1677
+ cell: XlsxCellAddress;
1678
+ selection: XlsxCellRange;
1679
+ sheetIndex: number;
1680
+ sheetName: string;
1681
+ readOnly: boolean;
1682
+ }
1683
+ interface XlsxSelectionPopoverRenderProps {
1684
+ context: XlsxSelectionPopoverContext;
1685
+ /** The visible selection rectangle in viewport pixels. The container already fills it. */
1686
+ rect: XlsxImageRect;
1687
+ /** Aborted when the selection changes, editing starts, or the popover closes. */
1688
+ signal: AbortSignal;
1689
+ /** Saves a formula in the active cell and closes. Returns false for stale or read-only selections. */
1690
+ applyFormula: (formula: string) => boolean;
1691
+ /** Runs a synchronous custom mutation for the current selection and closes. */
1692
+ commit: (apply: (context: XlsxSelectionPopoverContext) => void) => boolean;
1693
+ close: () => void;
1694
+ }
1568
1695
  interface XlsxCellStyleContext {
1569
1696
  /** Address of the cell being styled. */
1570
1697
  cell: XlsxCellAddress;
@@ -1816,6 +1943,12 @@ interface XlsxViewerProps extends UseXlsxViewerControllerOptions {
1816
1943
  * ```
1817
1944
  */
1818
1945
  renderActiveCellOverlay?: (props: XlsxActiveCellOverlayRenderProps) => React.ReactNode;
1946
+ /** Styling for the built-in editor. Layout and text measurement remain managed by the viewer. */
1947
+ cellEditorStyle?: React.CSSProperties;
1948
+ /** Opt-in decoration and actions around the editing input. Nothing is rendered on cell selection. */
1949
+ renderCellEditorOverlay?: (props: XlsxCellEditorOverlayRenderProps) => React.ReactNode;
1950
+ /** Opt-in custom content around a selected cell or range. Hidden while editing. No default UI. */
1951
+ renderSelectionPopover?: (props: XlsxSelectionPopoverRenderProps) => React.ReactNode;
1819
1952
  /**
1820
1953
  * Shows worksheet images, charts, shapes, and form controls.
1821
1954
  *
@@ -1854,4 +1987,4 @@ declare function useXlsxViewerCharts(): XlsxViewerCharts;
1854
1987
  declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOptions): XlsxViewerThumbnails;
1855
1988
  declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
1856
1989
 
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 };
1990
+ export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxActiveCellOverlayRenderProps, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellEditorContext, type XlsxCellEditorOverlayRenderProps, type XlsxCellEditorSession, 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 XlsxSelectionPopoverContext, type XlsxSelectionPopoverRenderProps, 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 };