@rowsncolumns/spreadsheet 10.9.1 → 10.10.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 (105) hide show
  1. package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
  2. package/dist/cjs/atoms/sheet-context.atom.d.ts +3 -3
  3. package/dist/cjs/atoms/sheet-context.atom.d.ts.map +1 -1
  4. package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
  5. package/dist/cjs/components/canvas-grid/index.js +28 -11
  6. package/dist/cjs/components/canvas-grid/overflow.d.ts +23 -0
  7. package/dist/cjs/components/canvas-grid/overflow.d.ts.map +1 -1
  8. package/dist/cjs/components/canvas-grid/overflow.js +32 -1
  9. package/dist/cjs/components/canvas-grid/typings.d.ts +10 -3
  10. package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
  11. package/dist/cjs/components/cell/index.d.ts.map +1 -1
  12. package/dist/cjs/components/cell/index.js +25 -13
  13. package/dist/cjs/components/cell/typings.d.ts +9 -0
  14. package/dist/cjs/components/cell/typings.d.ts.map +1 -1
  15. package/dist/cjs/components/cell-editor/index.d.ts.map +1 -1
  16. package/dist/cjs/components/cell-editor/index.js +18 -3
  17. package/dist/cjs/components/cell-input/formula-bar-cell-input.d.ts +8 -1
  18. package/dist/cjs/components/cell-input/formula-bar-cell-input.d.ts.map +1 -1
  19. package/dist/cjs/components/cell-input/formula-bar-cell-input.js +5 -5
  20. package/dist/cjs/components/cell-tooltip/index.d.ts.map +1 -1
  21. package/dist/cjs/components/cell-tooltip/index.js +5 -1
  22. package/dist/cjs/components/embeds/embed-draggable.d.ts.map +1 -1
  23. package/dist/cjs/components/embeds/embed-draggable.js +17 -7
  24. package/dist/cjs/components/filter-box/index.d.ts.map +1 -1
  25. package/dist/cjs/components/filter-box/index.js +4 -1
  26. package/dist/cjs/components/pivot-placeholder/index.d.ts.map +1 -1
  27. package/dist/cjs/components/pivot-placeholder/index.js +4 -4
  28. package/dist/cjs/components/print-preview/page-block.d.ts +9 -0
  29. package/dist/cjs/components/print-preview/page-block.d.ts.map +1 -1
  30. package/dist/cjs/components/print-preview/page-block.js +36 -38
  31. package/dist/cjs/components/print-preview/print-preview-dialog.d.ts.map +1 -1
  32. package/dist/cjs/components/print-preview/print-preview-dialog.js +2 -1
  33. package/dist/cjs/components/selection/index.d.ts.map +1 -1
  34. package/dist/cjs/components/selection/index.js +5 -1
  35. package/dist/cjs/components/selection/title.d.ts.map +1 -1
  36. package/dist/cjs/components/selection/title.js +7 -2
  37. package/dist/cjs/hooks/use-cell-renderer.d.ts +7 -1
  38. package/dist/cjs/hooks/use-cell-renderer.d.ts.map +1 -1
  39. package/dist/cjs/hooks/use-cell-renderer.js +36 -17
  40. package/dist/cjs/hooks/use-conditional-formatting.d.ts +12 -1
  41. package/dist/cjs/hooks/use-conditional-formatting.d.ts.map +1 -1
  42. package/dist/cjs/hooks/use-conditional-formatting.js +16 -5
  43. package/dist/cjs/hooks/use-context-menu.d.ts +6 -1
  44. package/dist/cjs/hooks/use-context-menu.d.ts.map +1 -1
  45. package/dist/cjs/hooks/use-context-menu.js +6 -2
  46. package/dist/cjs/hooks/use-create-formula-tokenizer.d.ts +1 -1
  47. package/dist/cjs/hooks/use-create-formula-tokenizer.d.ts.map +1 -1
  48. package/dist/cjs/hooks/use-selection.d.ts +6 -1
  49. package/dist/cjs/hooks/use-selection.d.ts.map +1 -1
  50. package/dist/cjs/hooks/use-selection.js +7 -6
  51. package/dist/cjs/types.d.ts +4 -69
  52. package/dist/cjs/types.d.ts.map +1 -1
  53. package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
  54. package/dist/esm/atoms/sheet-context.atom.d.ts +3 -3
  55. package/dist/esm/atoms/sheet-context.atom.d.ts.map +1 -1
  56. package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
  57. package/dist/esm/components/canvas-grid/index.js +34 -16
  58. package/dist/esm/components/canvas-grid/overflow.d.ts +23 -0
  59. package/dist/esm/components/canvas-grid/overflow.d.ts.map +1 -1
  60. package/dist/esm/components/canvas-grid/overflow.js +23 -0
  61. package/dist/esm/components/canvas-grid/typings.d.ts +10 -3
  62. package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
  63. package/dist/esm/components/cell/index.d.ts.map +1 -1
  64. package/dist/esm/components/cell/index.js +22 -12
  65. package/dist/esm/components/cell/typings.d.ts +9 -0
  66. package/dist/esm/components/cell/typings.d.ts.map +1 -1
  67. package/dist/esm/components/cell-editor/index.d.ts.map +1 -1
  68. package/dist/esm/components/cell-editor/index.js +19 -3
  69. package/dist/esm/components/cell-input/formula-bar-cell-input.d.ts +8 -1
  70. package/dist/esm/components/cell-input/formula-bar-cell-input.d.ts.map +1 -1
  71. package/dist/esm/components/cell-input/formula-bar-cell-input.js +2 -2
  72. package/dist/esm/components/cell-tooltip/index.d.ts.map +1 -1
  73. package/dist/esm/components/cell-tooltip/index.js +5 -1
  74. package/dist/esm/components/embeds/embed-draggable.d.ts.map +1 -1
  75. package/dist/esm/components/embeds/embed-draggable.js +18 -8
  76. package/dist/esm/components/filter-box/index.d.ts.map +1 -1
  77. package/dist/esm/components/filter-box/index.js +5 -2
  78. package/dist/esm/components/pivot-placeholder/index.d.ts.map +1 -1
  79. package/dist/esm/components/pivot-placeholder/index.js +4 -0
  80. package/dist/esm/components/print-preview/page-block.d.ts +9 -0
  81. package/dist/esm/components/print-preview/page-block.d.ts.map +1 -1
  82. package/dist/esm/components/print-preview/page-block.js +38 -10
  83. package/dist/esm/components/print-preview/print-preview-dialog.d.ts.map +1 -1
  84. package/dist/esm/components/print-preview/print-preview-dialog.js +2 -1
  85. package/dist/esm/components/selection/index.d.ts.map +1 -1
  86. package/dist/esm/components/selection/index.js +5 -1
  87. package/dist/esm/components/selection/title.d.ts.map +1 -1
  88. package/dist/esm/components/selection/title.js +8 -3
  89. package/dist/esm/hooks/use-cell-renderer.d.ts +7 -1
  90. package/dist/esm/hooks/use-cell-renderer.d.ts.map +1 -1
  91. package/dist/esm/hooks/use-cell-renderer.js +26 -6
  92. package/dist/esm/hooks/use-conditional-formatting.d.ts +12 -1
  93. package/dist/esm/hooks/use-conditional-formatting.d.ts.map +1 -1
  94. package/dist/esm/hooks/use-conditional-formatting.js +12 -4
  95. package/dist/esm/hooks/use-context-menu.d.ts +6 -1
  96. package/dist/esm/hooks/use-context-menu.d.ts.map +1 -1
  97. package/dist/esm/hooks/use-context-menu.js +6 -2
  98. package/dist/esm/hooks/use-create-formula-tokenizer.d.ts +1 -1
  99. package/dist/esm/hooks/use-create-formula-tokenizer.d.ts.map +1 -1
  100. package/dist/esm/hooks/use-selection.d.ts +6 -1
  101. package/dist/esm/hooks/use-selection.d.ts.map +1 -1
  102. package/dist/esm/hooks/use-selection.js +4 -3
  103. package/dist/esm/types.d.ts +4 -69
  104. package/dist/esm/types.d.ts.map +1 -1
  105. package/package.json +3 -3
@@ -14,6 +14,7 @@ var cell_backgrounds_1 = require("../components/cell/cell-backgrounds");
14
14
  var number_format_layout_1 = require("../components/cell/number-format-layout");
15
15
  var cell_diff_1 = require("../components/cell-diff");
16
16
  var cell_overlay_1 = require("../components/cell-overlay");
17
+ var overflow_1 = require("../components/canvas-grid/overflow");
17
18
  var config_1 = require("../config");
18
19
  var helpers_1 = require("../helpers");
19
20
  var merged_cell_borders_1 = require("../helpers/merged-cell-borders");
@@ -22,13 +23,13 @@ var show_zeros_1 = require("./show-zeros");
22
23
  var use_cell_diff_highlight_1 = require("./use-cell-diff-highlight");
23
24
  var use_selected_rows_columns_1 = require("./use-selected-rows-columns");
24
25
  var useCellRenderer = function (_a) {
25
- var sheetId = _a.sheetId, scale = _a.scale, showGridLines = _a.showGridLines, showZeros = _a.showZeros, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, selectedRows = _a.selectedRows, selectedColumns = _a.selectedColumns, selectedRowHeaders = _a.selectedRowHeaders, selectedColumnHeaders = _a.selectedColumnHeaders, cellBackgroundColor = _a.cellBackgroundColor, headerBorderColor = _a.headerBorderColor, headerBackgroundColor = _a.headerBackgroundColor, headerColor = _a.headerColor, headerActiveBackgroundColor = _a.headerActiveBackgroundColor, headerSelectedBackgroundColor = _a.headerSelectedBackgroundColor, headerSelectedColor = _a.headerSelectedColor, headerTableBackgroundColor = _a.headerTableBackgroundColor, headerTableActiveBackgroundColor = _a.headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor = _a.headerTableSelectedBackgroundColor, chipBackgroundColor = _a.chipBackgroundColor, filterIconColor = _a.filterIconColor, showCalculatedColumnIcon = _a.showCalculatedColumnIcon, enableTextOverflow = _a.enableTextOverflow, showHeaders = _a.showHeaders, theme = _a.theme, getDefaultHorizontalAlignment = _a.getDefaultHorizontalAlignment, isTableFilterVisible = _a.isTableFilterVisible, columnContainsTable = _a.columnContainsTable, rowsContainsTable = _a.rowsContainsTable, canOverflowToNextCell = _a.canOverflowToNextCell, getTableHeaderSortOrder = _a.getTableHeaderSortOrder, getDataValidation = _a.getDataValidation, getErrorValue = _a.getErrorValue, formulaLocale = _a.formulaLocale, locale = _a.locale, getEffectiveValue = _a.getEffectiveValue, getSparklineGroup = _a.getSparklineGroup, getFormattedValue = _a.getFormattedValue, getNote = _a.getNote, getComment = _a.getComment, getEffectiveCellFormat = _a.getEffectiveCellFormat, getCellBounds = _a.getCellBounds, getCellImageUrl = _a.getCellImageUrl, getCellMetaType = _a.getCellMetaType, getRowHeaderText = _a.getRowHeaderText, getColumnHeaderText = _a.getColumnHeaderText, getMaximumOverflowTextWidth = _a.getMaximumOverflowTextWidth, getCenterAcrossSelectionSpan = _a.getCenterAcrossSelectionSpan, activeCell = _a.activeCell, getTextDimension = _a.getTextDimension, getCellGroupingInfo = _a.getCellGroupingInfo, getTextFormatRuns = _a.getTextFormatRuns, onRequestEdit = _a.onRequestEdit, onFilterClick = _a.onFilterClick, onCheckboxClick = _a.onCheckboxClick, isTableHeader = _a.isTableHeader, isTableTotalsCell = _a.isTableTotalsCell, onTotalsArrowClick = _a.onTotalsArrowClick, isCalculatedColumnHeader = _a.isCalculatedColumnHeader, isTableHeaderFilterActive = _a.isTableHeaderFilterActive, HeaderCell = _a.HeaderCell, Cell = _a.Cell, StructuredResult = _a.StructuredResult, gridLineWidth = _a.gridLineWidth, getErrorCheck = _a.getErrorCheck, _b = _a.circleInvalidData, circleInvalidData = _b === void 0 ? false : _b, showNotes = _a.showNotes, showComments = _a.showComments, defaultFontSizePoint = _a.defaultFontSizePoint, lineHeightMode = _a.lineHeightMode, readonly = _a.readonly, onExpandCollapse = _a.onExpandCollapse, onOverflow = _a.onOverflow, _c = _a.isComparing, isComparing = _c === void 0 ? false : _c, getCellDiff = _a.getCellDiff;
26
+ var sheetId = _a.sheetId, scale = _a.scale, showGridLines = _a.showGridLines, showZeros = _a.showZeros, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, selectedRows = _a.selectedRows, selectedColumns = _a.selectedColumns, selectedRowHeaders = _a.selectedRowHeaders, selectedColumnHeaders = _a.selectedColumnHeaders, cellBackgroundColor = _a.cellBackgroundColor, headerBorderColor = _a.headerBorderColor, headerBackgroundColor = _a.headerBackgroundColor, headerColor = _a.headerColor, headerActiveBackgroundColor = _a.headerActiveBackgroundColor, headerSelectedBackgroundColor = _a.headerSelectedBackgroundColor, headerSelectedColor = _a.headerSelectedColor, headerTableBackgroundColor = _a.headerTableBackgroundColor, headerTableActiveBackgroundColor = _a.headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor = _a.headerTableSelectedBackgroundColor, chipBackgroundColor = _a.chipBackgroundColor, filterIconColor = _a.filterIconColor, showCalculatedColumnIcon = _a.showCalculatedColumnIcon, enableTextOverflow = _a.enableTextOverflow, _b = _a.rightToLeft, rightToLeft = _b === void 0 ? false : _b, showHeaders = _a.showHeaders, theme = _a.theme, getDefaultHorizontalAlignment = _a.getDefaultHorizontalAlignment, isTableFilterVisible = _a.isTableFilterVisible, columnContainsTable = _a.columnContainsTable, rowsContainsTable = _a.rowsContainsTable, canOverflowToNextCell = _a.canOverflowToNextCell, getTableHeaderSortOrder = _a.getTableHeaderSortOrder, getDataValidation = _a.getDataValidation, getErrorValue = _a.getErrorValue, formulaLocale = _a.formulaLocale, locale = _a.locale, getEffectiveValue = _a.getEffectiveValue, getSparklineGroup = _a.getSparklineGroup, getFormattedValue = _a.getFormattedValue, getNote = _a.getNote, getComment = _a.getComment, getEffectiveCellFormat = _a.getEffectiveCellFormat, getCellBounds = _a.getCellBounds, getCellImageUrl = _a.getCellImageUrl, getCellMetaType = _a.getCellMetaType, getRowHeaderText = _a.getRowHeaderText, getColumnHeaderText = _a.getColumnHeaderText, getMaximumOverflowTextWidth = _a.getMaximumOverflowTextWidth, getCenterAcrossSelectionSpan = _a.getCenterAcrossSelectionSpan, activeCell = _a.activeCell, getTextDimension = _a.getTextDimension, getCellGroupingInfo = _a.getCellGroupingInfo, getTextFormatRuns = _a.getTextFormatRuns, onRequestEdit = _a.onRequestEdit, onFilterClick = _a.onFilterClick, onCheckboxClick = _a.onCheckboxClick, isTableHeader = _a.isTableHeader, isTableTotalsCell = _a.isTableTotalsCell, onTotalsArrowClick = _a.onTotalsArrowClick, isCalculatedColumnHeader = _a.isCalculatedColumnHeader, isTableHeaderFilterActive = _a.isTableHeaderFilterActive, HeaderCell = _a.HeaderCell, Cell = _a.Cell, StructuredResult = _a.StructuredResult, gridLineWidth = _a.gridLineWidth, getErrorCheck = _a.getErrorCheck, _c = _a.circleInvalidData, circleInvalidData = _c === void 0 ? false : _c, showNotes = _a.showNotes, showComments = _a.showComments, defaultFontSizePoint = _a.defaultFontSizePoint, lineHeightMode = _a.lineHeightMode, readonly = _a.readonly, onExpandCollapse = _a.onExpandCollapse, onOverflow = _a.onOverflow, _d = _a.isComparing, isComparing = _d === void 0 ? false : _d, getCellDiff = _a.getCellDiff;
26
27
  // Version comparison diff highlighting - only active when isComparing is true
27
- var _d = (0, use_cell_diff_highlight_1.useCellDiffHighlight)(isComparing ? getCellDiff : undefined), mergeCellFormatWithDiff = _d.mergeCellFormatWithDiff, getDiffHighlight = _d.getDiffHighlight;
28
+ var _e = (0, use_cell_diff_highlight_1.useCellDiffHighlight)(isComparing ? getCellDiff : undefined), mergeCellFormatWithDiff = _e.mergeCellFormatWithDiff, getDiffHighlight = _e.getDiffHighlight;
28
29
  // Edit
29
30
  var onRequestEditCell = (0, react_1.useCallback)(function (cell) { return onRequestEdit === null || onRequestEdit === void 0 ? void 0 : onRequestEdit(sheetId, cell); }, [sheetId, onRequestEdit]);
30
31
  var cellRenderer = (0, react_1.useCallback)(function (props) {
31
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
32
33
  var rowIndex = props.rowIndex, columnIndex = props.columnIndex, isMergedCell = props.isMergedCell;
33
34
  // Body cell
34
35
  var rawFormattedValue = getFormattedValue(sheetId, rowIndex, columnIndex);
@@ -44,9 +45,13 @@ var useCellRenderer = function (_a) {
44
45
  : (0, show_zeros_1.applyShowZeros)(rawFormattedValue, effectiveValue, showZeros);
45
46
  var dataValidation = getDataValidation(sheetId, rowIndex, columnIndex);
46
47
  var validationType = (_c = dataValidation === null || dataValidation === void 0 ? void 0 : dataValidation.condition) === null || _c === void 0 ? void 0 : _c.type;
47
- var horizontalAlignment = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.horizontalAlignment;
48
+ // On a mirrored (right-to-left) sheet General text is right-aligned, so
49
+ // the spill decision reads the resolved default alignment too.
50
+ var horizontalAlignment = (_d = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.horizontalAlignment) !== null && _d !== void 0 ? _d : (rightToLeft
51
+ ? getDefaultHorizontalAlignment(sheetId, rowIndex, columnIndex)
52
+ : undefined);
48
53
  // Expandable
49
- var _q = tslib_1.__read(getCellGroupingInfo(sheetId, rowIndex, columnIndex), 2), expandable = _q[0], expanded = _q[1];
54
+ var _r = tslib_1.__read(getCellGroupingInfo(sheetId, rowIndex, columnIndex), 2), expandable = _r[0], expanded = _r[1];
50
55
  // Display style
51
56
  var showChip = getCellMetaType(sheetId, rowIndex, columnIndex) === "people";
52
57
  // Image url
@@ -92,7 +97,7 @@ var useCellRenderer = function (_a) {
92
97
  // Indent
93
98
  var isRightAligned = horizontalAlignment === "right";
94
99
  // Only strings which are right aligned can overflow to neighbours
95
- var isStringValue = !(0, utils_1.isNil)((_d = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.sv) !== null && _d !== void 0 ? _d : effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.stringValue);
100
+ var isStringValue = !(0, utils_1.isNil)((_e = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.sv) !== null && _e !== void 0 ? _e : effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.stringValue);
96
101
  var overflowRight = isRightAligned && isStringValue;
97
102
  // shrinkToFit and rotated text both keep the text inside the cell,
98
103
  // so they must not spill into neighbours regardless of wrapStrategy.
@@ -118,6 +123,10 @@ var useCellRenderer = function (_a) {
118
123
  var centerAcrossSpan = canSpill && isCenterAcross && !(0, utils_1.isNilOrBlank)(displayFormattedValue)
119
124
  ? getCenterAcrossSelectionSpan === null || getCenterAcrossSelectionSpan === void 0 ? void 0 : getCenterAcrossSelectionSpan(sheetId, rowIndex, columnIndex)
120
125
  : undefined;
126
+ // Alignment is physical: left-aligned text spills to the right, which
127
+ // is the next column left-to-right and the previous one on a mirrored
128
+ // (right-to-left) sheet.
129
+ var spillsToNextColumn = rightToLeft ? isRightAligned : !isRightAligned;
121
130
  var shouldOverflow = !!centerAcrossSpan ||
122
131
  (canSpill &&
123
132
  (isRightAligned ? isStringValue : true) &&
@@ -126,19 +135,28 @@ var useCellRenderer = function (_a) {
126
135
  canOverflowToNextCell({ rowIndex: rowIndex, columnIndex: columnIndex + 1 })
127
136
  : canOverflowToNextCell({
128
137
  rowIndex: rowIndex,
129
- columnIndex: columnIndex + (isRightAligned ? -1 : 1),
138
+ columnIndex: columnIndex + (spillsToNextColumn ? 1 : -1),
130
139
  })));
131
- var _r = tslib_1.__read(centerAcrossSpan
140
+ var overflowResult = centerAcrossSpan
132
141
  ? centerAcrossSpan
133
142
  : shouldOverflow
134
143
  ? getMaximumOverflowTextWidth(displayFormattedValue, sheetId, rowIndex, columnIndex,
135
144
  // Investigate why isHiddenCell and the instance from Sheet-Grid differs
136
- canOverflowToNextCell, effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat, shouldWrap, isRightAligned ? grid_1.Direction.Left : grid_1.Direction.Right, isCentered)
145
+ canOverflowToNextCell, effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat, shouldWrap, spillsToNextColumn ? grid_1.Direction.Right : grid_1.Direction.Left, isCentered)
137
146
  : [
138
147
  props.width,
139
148
  config_1.DEFAULT_ARRAY,
140
149
  undefined,
141
- ], 3), cellWidth = _r[0], columnSpans = _r[1], overflowLeft = _r[2];
150
+ ];
151
+ // The cell paints in a frame flipped back to left-to-right: map the
152
+ // sheet-column spill into it.
153
+ var _s = tslib_1.__read(rightToLeft
154
+ ? (0, overflow_1.mirrorOverflowToCellFrame)(overflowResult, {
155
+ columnIndex: columnIndex,
156
+ x: props.x,
157
+ width: props.width,
158
+ })
159
+ : overflowResult, 3), cellWidth = _s[0], columnSpans = _s[1], overflowLeft = _s[2];
142
160
  if (shouldOverflow && cellWidth > props.width) {
143
161
  // Report the full visual width as the required buffer
144
162
  // This ensures that even if we scroll to the far right of the overflow,
@@ -174,7 +192,7 @@ var useCellRenderer = function (_a) {
174
192
  var errorValue = getErrorValue(sheetId, rowIndex, columnIndex);
175
193
  var isInvalid = (errorValue === null || errorValue === void 0 ? void 0 : errorValue.type) === "Invalid";
176
194
  var showCheckbox = !errorValue && validationType === "BOOLEAN";
177
- var isChecked = ((_e = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.bv) !== null && _e !== void 0 ? _e : effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.boolValue) === true;
195
+ var isChecked = ((_f = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.bv) !== null && _f !== void 0 ? _f : effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.boolValue) === true;
178
196
  // Error from formula calculation (Error icon). Both engines store the canonical spelling
179
197
  // (`#VALUE!`); the grid paints the formula locale's (`#ЗНАЧ!`).
180
198
  var isError = (errorValue === null || errorValue === void 0 ? void 0 : errorValue.type) === "Error";
@@ -191,24 +209,24 @@ var useCellRenderer = function (_a) {
191
209
  diffHighlight &&
192
210
  diffHighlight.diffState !== "unchanged") {
193
211
  // Get text color from format or use default
194
- var textColor = ((_f = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _f === void 0 ? void 0 : _f.color)
212
+ var textColor = ((_g = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _g === void 0 ? void 0 : _g.color)
195
213
  ? (0, themes_1.getStringifiedColor)(effectiveCellFormat.textFormat.color, theme)
196
214
  : undefined;
197
215
  // Measure old value width for proper spacing in modified cells
198
216
  // Use the old format for accurate measurement (bold text is wider than normal)
199
217
  var oldValueWidth = diffHighlight.oldFormattedValue
200
- ? getTextDimension(sheetId, rowIndex, columnIndex, diffHighlight.oldFormattedValue, (_h = (_g = diffHighlight.oldFormat) === null || _g === void 0 ? void 0 : _g.textFormat) !== null && _h !== void 0 ? _h : undefined).width
218
+ ? getTextDimension(sheetId, rowIndex, columnIndex, diffHighlight.oldFormattedValue, (_j = (_h = diffHighlight.oldFormat) === null || _h === void 0 ? void 0 : _h.textFormat) !== null && _j !== void 0 ? _j : undefined).width
201
219
  : undefined;
202
- return (react_1.default.createElement(cell_diff_1.CellDiff, tslib_1.__assign({ diffHighlight: diffHighlight, value: formattedValue, defaultColor: textColor, scale: scale, fontSizePt: defaultFontSizePoint, fontFamily: (_j = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _j === void 0 ? void 0 : _j.fontFamily, bold: (_k = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _k === void 0 ? void 0 : _k.bold, italic: (_l = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _l === void 0 ? void 0 : _l.italic, horizontalAlignment: effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.horizontalAlignment, verticalAlignment: (effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.verticalAlignment)
220
+ return (react_1.default.createElement(cell_diff_1.CellDiff, tslib_1.__assign({ diffHighlight: diffHighlight, value: formattedValue, defaultColor: textColor, scale: scale, fontSizePt: defaultFontSizePoint, fontFamily: (_k = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _k === void 0 ? void 0 : _k.fontFamily, bold: (_l = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _l === void 0 ? void 0 : _l.bold, italic: (_m = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _m === void 0 ? void 0 : _m.italic, horizontalAlignment: effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.horizontalAlignment, verticalAlignment: (effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.verticalAlignment)
203
221
  ? (0, alignment_1.resolveCanvasVerticalAlign)(effectiveCellFormat.verticalAlignment)
204
222
  : undefined, oldValueWidth: oldValueWidth }, props)));
205
223
  }
206
224
  var numberFormatLayout = isError
207
225
  ? undefined
208
- : (0, number_format_layout_1.getCellNumberFormatLayout)((_m = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.numberFormat) === null || _m === void 0 ? void 0 : _m.pattern, (_o = (0, utils_1.getExtendedValueNumber)(effectiveValue)) !== null && _o !== void 0 ? _o : (0, utils_1.getExtendedValueString)(effectiveValue), displayValue, locale);
226
+ : (0, number_format_layout_1.getCellNumberFormatLayout)((_o = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.numberFormat) === null || _o === void 0 ? void 0 : _o.pattern, (_p = (0, utils_1.getExtendedValueNumber)(effectiveValue)) !== null && _p !== void 0 ? _p : (0, utils_1.getExtendedValueString)(effectiveValue), displayValue, locale);
209
227
  return (react_1.default.createElement(Cell, tslib_1.__assign({ value: displayValue, numberFormatLayout: numberFormatLayout, cellFormat: effectiveCellFormat, scale: scale, defaultBackgroundColor: cellBackgroundColor, onRequestEdit: onRequestEditCell, onArrowClick: showTotalsArrow ? onTotalsArrowClick : undefined, showArrow: showArrow, arrowOutside: showValidationArrow, showFilter: showFilter, isCalculatedColumn: isCalculatedColumn, showCheckbox: showCheckbox, showChip: showChip, chipBackgroundColor: chipBackgroundColor, filterIconColor: filterIconColor, onFilterClick: onFilterClick, onCheckboxClick: onCheckboxClick, isChecked: isChecked, isInvalid: isInvalid, isError: isError, showErrorIndicator: showErrorIndicator, circleInvalid: circleInvalidData && isInvalid, imageUrl: imageUrl, isFilterActive: isFilterActive, enableOverflow: enableOverflow, cellWidth: cellWidth, showNote: showNote, showComment: showComment, showCalculatedColumnIcon: showCalculatedColumnIcon, theme: theme, expandable: expandable, expanded: expanded, textWidth: textWidth, columnSpans: columnSpans, overflowRight: overflowRight, overflowLeft: enableOverflow && (isCentered || centerAcrossSpan)
210
228
  ? overflowLeft !== null && overflowLeft !== void 0 ? overflowLeft : 0
211
- : undefined, centerOnSpan: !!centerAcrossSpan, showGridLines: showGridLines, structuredValue: effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.structuredValue, sparklineGroupAxis: ((_p = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.structuredValue) === null || _p === void 0 ? void 0 : _p.kind) === "sparkline" &&
229
+ : undefined, centerOnSpan: !!centerAcrossSpan, showGridLines: showGridLines, structuredValue: effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.structuredValue, sparklineGroupAxis: ((_q = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.structuredValue) === null || _q === void 0 ? void 0 : _q.kind) === "sparkline" &&
212
230
  getSparklineGroup
213
231
  ? (0, sparkline_math_1.sparklineGroupAxisFor)(effectiveValue.structuredValue, function () { return getSparklineGroup(sheetId, { rowIndex: rowIndex, columnIndex: columnIndex }); }, function (cell) {
214
232
  var _a;
@@ -220,7 +238,7 @@ var useCellRenderer = function (_a) {
220
238
  args[_i] = arguments[_i];
221
239
  }
222
240
  return onExpandCollapse === null || onExpandCollapse === void 0 ? void 0 : onExpandCollapse.apply(void 0, tslib_1.__spreadArray([sheetId], tslib_1.__read(args), false));
223
- }, getDefaultHorizontalAlignment: getDefaultHorizontalAlignment, sheetId: sheetId }, props)));
241
+ }, getDefaultHorizontalAlignment: getDefaultHorizontalAlignment, sheetId: sheetId, rightToLeft: rightToLeft }, props)));
224
242
  }, [
225
243
  isComparing,
226
244
  sheetId,
@@ -239,6 +257,7 @@ var useCellRenderer = function (_a) {
239
257
  filterIconColor,
240
258
  showCalculatedColumnIcon,
241
259
  enableTextOverflow,
260
+ rightToLeft,
242
261
  getTextFormatRuns,
243
262
  getTableHeaderSortOrder,
244
263
  isTableHeader,
@@ -50,6 +50,17 @@ export type UseConditionalFormattingProps<T extends CellData> = {
50
50
  * caches them per rule until the data changes.
51
51
  */
52
52
  getConditionalFormatRuleStats?: (sheetId: number, rule: ConditionalFormatRule) => CfRangeStats | null | undefined;
53
+ /**
54
+ * The sheet displays right-to-left: a data bar whose direction is
55
+ * `context` (or unset) grows from the right edge, as in Excel.
56
+ */
57
+ rightToLeft?: boolean;
53
58
  };
54
- export declare const useConditionalFormatting: <T extends CellData>({ sheetId, theme, conditionalFormats, locale, getValidationValue, isNumberValue, getSheetRowCount, getSheetColumnCount, window: evaluationWindow, getConditionalFormatResult, getConditionalFormatRuleStats, }: UseConditionalFormattingProps<T>) => Map<string, CellFormat | undefined>;
59
+ export declare const useConditionalFormatting: <T extends CellData>({ sheetId, theme, conditionalFormats, locale, getValidationValue, isNumberValue, getSheetRowCount, getSheetColumnCount, window: evaluationWindow, getConditionalFormatResult, getConditionalFormatRuleStats, rightToLeft, }: UseConditionalFormattingProps<T>) => Map<string, CellFormat | undefined>;
60
+ /**
61
+ * A data bar's painted direction: `leftToRight` / `rightToLeft` are
62
+ * explicit; `context` (and unset) follows the sheet — right-to-left on a
63
+ * right-to-left sheet (Excel).
64
+ */
65
+ export declare const resolveDataBarDirection: (direction: string | null | undefined, sheetRightToLeft: boolean) => "leftToRight" | "rightToLeft";
55
66
  //# sourceMappingURL=use-conditional-formatting.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-conditional-formatting.d.ts","sourceRoot":"","sources":["../../../hooks/use-conditional-formatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAWpE,OAAO,EAIL,KAAK,YAAY,EAKlB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,UAAU,EAClB,OAAO,UAAU,KAChB,UAYF,CAAC;AAmCF,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,QAAQ,IAAI;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,CAAC;IACxB,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,CAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,qBAAqB,KACzB,mBAAmB,CAAC;IACzB,aAAa,CACX,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IACX,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACtD,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC5D;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B;;;;;;;;;OASG;IACH,0BAA0B,CAAC,EAAE,CAC3B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAChC,OAAO,CAAC;IACb;;;;;;;;;OASG;IACH,6BAA6B,CAAC,EAAE,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,qBAAqB,KACxB,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,QAAQ,EAAE,gNAY1D,6BAA6B,CAAC,CAAC,CAAC,wCA0vBlC,CAAC"}
1
+ {"version":3,"file":"use-conditional-formatting.d.ts","sourceRoot":"","sources":["../../../hooks/use-conditional-formatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAWpE,OAAO,EAIL,KAAK,YAAY,EAKlB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,UAAU,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AIG;AACH,eAAO,MAAM,uBAAuB,GAClC,WAAW,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,kBAAkB,OAAO,KACxB,aAAa,GAAG,aAIA,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useConditionalFormatting = exports.layerConditionalFormat = void 0;
3
+ exports.resolveDataBarDirection = exports.useConditionalFormatting = exports.layerConditionalFormat = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var grid_1 = require("@rowsncolumns/grid");
6
6
  var utils_1 = require("@rowsncolumns/utils");
@@ -69,7 +69,7 @@ var fullRangeRankValue = function (stats, rule) {
69
69
  return value !== undefined && Number.isFinite(value) ? value : undefined;
70
70
  };
71
71
  var useConditionalFormatting = function (_a) {
72
- var sheetId = _a.sheetId, theme = _a.theme, conditionalFormats = _a.conditionalFormats, locale = _a.locale, getValidationValue = _a.getValidationValue, isNumberValue = _a.isNumberValue, getSheetRowCount = _a.getSheetRowCount, getSheetColumnCount = _a.getSheetColumnCount, evaluationWindow = _a.window, getConditionalFormatResult = _a.getConditionalFormatResult, getConditionalFormatRuleStats = _a.getConditionalFormatRuleStats;
72
+ var sheetId = _a.sheetId, theme = _a.theme, conditionalFormats = _a.conditionalFormats, locale = _a.locale, getValidationValue = _a.getValidationValue, isNumberValue = _a.isNumberValue, getSheetRowCount = _a.getSheetRowCount, getSheetColumnCount = _a.getSheetColumnCount, evaluationWindow = _a.window, getConditionalFormatResult = _a.getConditionalFormatResult, getConditionalFormatRuleStats = _a.getConditionalFormatRuleStats, _b = _a.rightToLeft, rightToLeft = _b === void 0 ? false : _b;
73
73
  // Whole-range statistics of windowed rules, keyed by rule id. An entry is
74
74
  // reused while the rule object and the data getters are unchanged —
75
75
  // scrolling (a new window) re-runs the memo below without re-scanning the
@@ -744,9 +744,7 @@ var useConditionalFormatting = function (_a) {
744
744
  var axisColor = dataBarRule.axisColor
745
745
  ? (0, themes_1.getStringifiedColor)(dataBarRule.axisColor, theme)
746
746
  : undefined;
747
- var direction = dataBarRule.direction === "rightToLeft"
748
- ? "rightToLeft"
749
- : "leftToRight";
747
+ var direction = (0, exports.resolveDataBarDirection)(dataBarRule.direction, rightToLeft);
750
748
  var hideValue = dataBarRule.showValue === false;
751
749
  try {
752
750
  for (var cellValues_2 = (e_17 = void 0, tslib_1.__values(cellValues)), cellValues_2_1 = cellValues_2.next(); !cellValues_2_1.done; cellValues_2_1 = cellValues_2.next()) {
@@ -817,6 +815,19 @@ var useConditionalFormatting = function (_a) {
817
815
  evaluationWindow,
818
816
  getConditionalFormatResult,
819
817
  getConditionalFormatRuleStats,
818
+ rightToLeft,
820
819
  ]);
821
820
  };
822
821
  exports.useConditionalFormatting = useConditionalFormatting;
822
+ /**
823
+ * A data bar's painted direction: `leftToRight` / `rightToLeft` are
824
+ * explicit; `context` (and unset) follows the sheet — right-to-left on a
825
+ * right-to-left sheet (Excel).
826
+ */
827
+ var resolveDataBarDirection = function (direction, sheetRightToLeft) {
828
+ return direction === "rightToLeft" ||
829
+ (direction !== "leftToRight" && sheetRightToLeft)
830
+ ? "rightToLeft"
831
+ : "leftToRight";
832
+ };
833
+ exports.resolveDataBarDirection = resolveDataBarDirection;
@@ -34,8 +34,13 @@ export type UseContexMenuProps = {
34
34
  getContextMenu(activeCell: CellInterface): React.ReactElement<ContextMenuProps> | null;
35
35
  getScrollPosition: React.ComponentRef<typeof Grid>["getScrollPosition"];
36
36
  getCellOffsetFromCoords: React.ComponentRef<typeof Grid>["getCellOffsetFromCoords"];
37
+ /**
38
+ * Right-to-left sheet: the grid's positions are logical, the menu is placed
39
+ * physically — mirror its x back (`containerWidth - x`).
40
+ */
41
+ toPhysicalX?: (x: number) => number;
37
42
  };
38
- export declare const useContextMenu: ({ getCellCoordsFromOffset, getRelativePositionFromOffset, getCellOffsetFromCoords, getScrollPosition, isRowHeader, isColumnHeader, getContextMenu, ContextMenuWrapper, }: UseContexMenuProps) => {
43
+ export declare const useContextMenu: ({ getCellCoordsFromOffset, getRelativePositionFromOffset, getCellOffsetFromCoords, getScrollPosition, isRowHeader, isColumnHeader, getContextMenu, ContextMenuWrapper, toPhysicalX, }: UseContexMenuProps) => {
39
44
  onContextMenu: (e: React.MouseEvent) => void;
40
45
  contextMenuComponent: React.JSX.Element;
41
46
  onRequestClose: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"use-context-menu.d.ts","sourceRoot":"","sources":["../../../hooks/use-context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAiB,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAInE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kBAAkB,CAAC,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAC1D;;;;;OAKG;IACH,uBAAuB,CACrB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,GAClC,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC;;;;OAIG;IACH,6BAA6B,EAAE,KAAK,CAAC,YAAY,CAC/C,OAAO,IAAI,CACZ,CAAC,+BAA+B,CAAC,CAAC;IACnC;;;OAGG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1C;;;OAGG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1C;;;OAGG;IACH,cAAc,CACZ,UAAU,EAAE,aAAa,GACxB,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAC/C,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC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CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1C;;;OAGG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1C;;;OAGG;IACH,cAAc,CACZ,UAAU,EAAE,aAAa,GACxB,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAC/C,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC;IACxE,uBAAuB,EAAE,KAAK,CAAC,YAAY,CACzC,OAAO,IAAI,CACZ,CAAC,yBAAyB,CAAC,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,uLAU5B,kBAAkB;uBAuDb,KAAK,CAAC,UAAU;;;4BA5Cb,aAAa,MAAM,MAAM,MAAM,MAAM;CAyF/C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,gDAMvC,uBAAuB,sBAYzB,CAAC"}
@@ -7,7 +7,7 @@ var react_1 = tslib_1.__importStar(require("react"));
7
7
  var menu_1 = require("../components/context-menu/menu");
8
8
  var style_1 = require("../components/context-menu/style");
9
9
  var useContextMenu = function (_a) {
10
- var getCellCoordsFromOffset = _a.getCellCoordsFromOffset, getRelativePositionFromOffset = _a.getRelativePositionFromOffset, getCellOffsetFromCoords = _a.getCellOffsetFromCoords, getScrollPosition = _a.getScrollPosition, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, getContextMenu = _a.getContextMenu, _b = _a.ContextMenuWrapper, ContextMenuWrapper = _b === void 0 ? exports.DefaultContextMenuWrapper : _b;
10
+ var getCellCoordsFromOffset = _a.getCellCoordsFromOffset, getRelativePositionFromOffset = _a.getRelativePositionFromOffset, getCellOffsetFromCoords = _a.getCellOffsetFromCoords, getScrollPosition = _a.getScrollPosition, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, getContextMenu = _a.getContextMenu, _b = _a.ContextMenuWrapper, ContextMenuWrapper = _b === void 0 ? exports.DefaultContextMenuWrapper : _b, toPhysicalX = _a.toPhysicalX;
11
11
  var _c = tslib_1.__read((0, react_1.useState)({ left: 0, top: 0 }), 2), menuPosition = _c[0], setMenuPosition = _c[1];
12
12
  var _d = tslib_1.__read((0, react_1.useState)(false), 2), isOpen = _d[0], setIsOpen = _d[1];
13
13
  var activeCellRef = (0, react_1.useRef)(undefined);
@@ -38,7 +38,10 @@ var useContextMenu = function (_a) {
38
38
  return;
39
39
  }
40
40
  // Set menu position
41
- setMenuPosition({ left: position.x, top: position.y });
41
+ setMenuPosition({
42
+ left: toPhysicalX ? toPhysicalX(position.x) : position.x,
43
+ top: position.y,
44
+ });
42
45
  // Show menu
43
46
  showMenu();
44
47
  }, [
@@ -46,6 +49,7 @@ var useContextMenu = function (_a) {
46
49
  getCellOffsetFromCoords,
47
50
  getScrollPosition,
48
51
  showMenu,
52
+ toPhysicalX,
49
53
  ]);
50
54
  // Called when user right-clicks on the sheet
51
55
  var handleContextMenu = (0, react_1.useCallback)(function (e) {
@@ -10,6 +10,6 @@ type UseTokenizerProps = {
10
10
  sheetId: number;
11
11
  activeCell: CellInterface;
12
12
  };
13
- export declare const useCreateFormulaTokenizer: ({ getSelectionFromNamedRange, getSelectionFromTable, tokenizer, editingCellCoordinate, sheetId, activeCell, }: UseTokenizerProps) => (value: string) => import("../types").ParsedToken[];
13
+ export declare const useCreateFormulaTokenizer: ({ getSelectionFromNamedRange, getSelectionFromTable, tokenizer, editingCellCoordinate, sheetId, activeCell, }: UseTokenizerProps) => (value: string) => import("@rowsncolumns/common-types").ParsedToken[];
14
14
  export {};
15
15
  //# sourceMappingURL=use-create-formula-tokenizer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-create-formula-tokenizer.d.ts","sourceRoot":"","sources":["../../../hooks/use-create-formula-tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC3B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAE9F,KAAK,iBAAiB,GAAG;IACvB,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,qBAAqB,EAAE,UAAU,CAAC,OAAO,iCAAiC,CAAC,CAAC;IAC5E,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IACxC,qBAAqB,CAAC,EAAE,eAAe,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,+GAOvC,iBAAiB,aAON,MAAM,qCAkDnB,CAAC"}
1
+ {"version":3,"file":"use-create-formula-tokenizer.d.ts","sourceRoot":"","sources":["../../../hooks/use-create-formula-tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC3B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAE9F,KAAK,iBAAiB,GAAG;IACvB,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,qBAAqB,EAAE,UAAU,CAAC,OAAO,iCAAiC,CAAC,CAAC;IAC5E,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IACxC,qBAAqB,CAAC,EAAE,eAAe,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,+GAOvC,iBAAiB,aAON,MAAM,uDAkDnB,CAAC"}
@@ -283,9 +283,14 @@ export type UseSelectionOptions<T extends AreaStyle = AreaStyle> = {
283
283
  * direction (or stays put). Absent: every range is selectable.
284
284
  */
285
285
  isRangeSelectable?: (range: GridRange) => boolean;
286
+ /**
287
+ * The sheet is mirrored (right-to-left): ← / → move physically, so ← goes
288
+ * to the next column, as in Excel.
289
+ */
290
+ rightToLeft?: boolean;
286
291
  };
287
292
  export type NewSelectionMode = "clear" | "modify" | "append";
288
- export declare const useSelection: <T extends AreaStyle>({ sheetId, activeCell, onChangeActiveCell: onChangeActiveCellProp, selections, onChangeSelections: onChangeSelectionsProp, columnCount, rowCount, selectionPolicy, newSelectionMode, allowDeselectSelection, onFill, onFillHandleRelease, onFillShrink, onInsertCutCells, onCopySelection, onInsertCopiedCells, onSelectionDragMenu, confirmMoveOverwrite, isHiddenRow, isHiddenColumn, alwaysScrollToActiveCell, selectionTopBound, selectionBottomBound, selectionLeftBound, selectionRightBound, mouseDownInterceptor, mouseMoveInterceptor, mergedCells, merges, canSelectionSpanMergedCells, getValue, onMoveSelection, getCellCoordsFromOffset, getCellBounds, getViewPort, focus, scrollToCell, isMergedCell, enableSelectOnEnterKey, enterKeyDirection, formulaMode, isTouchDevice, getDataRowCount, getDataColumnCount, getDataRegion, isRowHeader, isColumnHeader, enableDataBoundaryNavigation, tables, onInsertTableRow, isRangeSelectable: isRangeSelectableProp, }: UseSelectionOptions<T>) => {
293
+ export declare const useSelection: <T extends AreaStyle>({ sheetId, activeCell, onChangeActiveCell: onChangeActiveCellProp, selections, onChangeSelections: onChangeSelectionsProp, columnCount, rowCount, selectionPolicy, newSelectionMode, allowDeselectSelection, onFill, onFillHandleRelease, onFillShrink, onInsertCutCells, onCopySelection, onInsertCopiedCells, onSelectionDragMenu, confirmMoveOverwrite, isHiddenRow, isHiddenColumn, alwaysScrollToActiveCell, selectionTopBound, selectionBottomBound, selectionLeftBound, selectionRightBound, mouseDownInterceptor, mouseMoveInterceptor, mergedCells, merges, canSelectionSpanMergedCells, getValue, onMoveSelection, getCellCoordsFromOffset, getCellBounds, getViewPort, focus, scrollToCell, isMergedCell, enableSelectOnEnterKey, enterKeyDirection, formulaMode, isTouchDevice, getDataRowCount, getDataColumnCount, getDataRegion, isRowHeader, isColumnHeader, enableDataBoundaryNavigation, tables, onInsertTableRow, isRangeSelectable: isRangeSelectableProp, rightToLeft, }: UseSelectionOptions<T>) => {
289
294
  isDragging: boolean;
290
295
  /** True while a selection-border drag would copy on release (Ctrl / ⌥ held). */
291
296
  isDragCopy: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"use-selection.d.ts","sourceRoot":"","sources":["../../../hooks/use-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,aAAa,EACd,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EACL,KAAK,EAYN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/B,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAIzE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,SAAS,GA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;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAKF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAsG7D,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,SAAS,EAAE,+7BAqD/C,mBAAmB,CAAC,CAAC,CAAC;;IAsmFrB,gFAAgF;;;;;;8BA5X3E,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,cACvB,aAAa,GAAG,SAAS,aAC1B,aAAa,GAAG,SAAS,SAC7B,MAAM,GAAG,SAAS;4BAkNnB,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC;qBApnCtC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,YAAY;mBAgM1D,KAAK,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa;0BA1pC1C,aAAa,QAAO,aAAa;+BAskDrC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;iCAmiBhC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;;;;8BA1tE3B,aAAa,kBAAkB,OAAO;;6BAmEvC,aAAa,QAAO,aAAa;;;6BAsL5B,MAAM,UACP,aAAa,kCAEb,KAAK;;6CA40DT,aAAa,GAAG,SAAS,cACnB,aAAa,EAAE,GAAG,SAAS;mCAvnEjC,aAAa,OAAO,aAAa;;;;;;gCAoyB3B,MAAM,GAAG,SAAS;gDA05CpB,MAAM,aAAa,aAAa,KAAG,SAAS;CAkP3D,CAAC"}
@@ -111,7 +111,7 @@ var defaultConfirmMoveOverwrite = function (message) {
111
111
  : window.confirm(message);
112
112
  };
113
113
  var useSelection = function (_a) {
114
- var sheetId = _a.sheetId, activeCell = _a.activeCell, onChangeActiveCellProp = _a.onChangeActiveCell, selections = _a.selections, onChangeSelectionsProp = _a.onChangeSelections, _b = _a.columnCount, columnCount = _b === void 0 ? 0 : _b, _c = _a.rowCount, rowCount = _c === void 0 ? 0 : _c, _d = _a.selectionPolicy, selectionPolicy = _d === void 0 ? "multiple" : _d, _e = _a.newSelectionMode, newSelectionMode = _e === void 0 ? "clear" : _e, _f = _a.allowDeselectSelection, allowDeselectSelection = _f === void 0 ? true : _f, onFill = _a.onFill, onFillHandleRelease = _a.onFillHandleRelease, onFillShrink = _a.onFillShrink, onInsertCutCells = _a.onInsertCutCells, onCopySelection = _a.onCopySelection, onInsertCopiedCells = _a.onInsertCopiedCells, onSelectionDragMenu = _a.onSelectionDragMenu, _g = _a.confirmMoveOverwrite, confirmMoveOverwrite = _g === void 0 ? defaultConfirmMoveOverwrite : _g, _h = _a.isHiddenRow, isHiddenRow = _h === void 0 ? defaultIsHidden : _h, _j = _a.isHiddenColumn, isHiddenColumn = _j === void 0 ? defaultIsHidden : _j, _k = _a.alwaysScrollToActiveCell, alwaysScrollToActiveCell = _k === void 0 ? true : _k, _l = _a.selectionTopBound, selectionTopBound = _l === void 0 ? 0 : _l, _m = _a.selectionBottomBound, selectionBottomBound = _m === void 0 ? rowCount : _m, _o = _a.selectionLeftBound, selectionLeftBound = _o === void 0 ? 0 : _o, _p = _a.selectionRightBound, selectionRightBound = _p === void 0 ? columnCount : _p, mouseDownInterceptor = _a.mouseDownInterceptor, mouseMoveInterceptor = _a.mouseMoveInterceptor, _q = _a.mergedCells, mergedCells = _q === void 0 ? config_1.DEFAULT_ARRAY : _q, merges = _a.merges, _r = _a.canSelectionSpanMergedCells, canSelectionSpanMergedCells = _r === void 0 ? defaultSelectionSpan : _r, getValue = _a.getValue, onMoveSelection = _a.onMoveSelection, getCellCoordsFromOffset = _a.getCellCoordsFromOffset, getCellBounds = _a.getCellBounds, getViewPort = _a.getViewPort, focus = _a.focus, scrollToCell = _a.scrollToCell, isMergedCell = _a.isMergedCell, enableSelectOnEnterKey = _a.enableSelectOnEnterKey, _s = _a.enterKeyDirection, enterKeyDirection = _s === void 0 ? "down" : _s, formulaMode = _a.formulaMode, isTouchDevice = _a.isTouchDevice, getDataRowCount = _a.getDataRowCount, getDataColumnCount = _a.getDataColumnCount, getDataRegion = _a.getDataRegion, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, _t = _a.enableDataBoundaryNavigation, enableDataBoundaryNavigation = _t === void 0 ? false : _t, tables = _a.tables, onInsertTableRow = _a.onInsertTableRow, isRangeSelectableProp = _a.isRangeSelectable;
114
+ var sheetId = _a.sheetId, activeCell = _a.activeCell, onChangeActiveCellProp = _a.onChangeActiveCell, selections = _a.selections, onChangeSelectionsProp = _a.onChangeSelections, _b = _a.columnCount, columnCount = _b === void 0 ? 0 : _b, _c = _a.rowCount, rowCount = _c === void 0 ? 0 : _c, _d = _a.selectionPolicy, selectionPolicy = _d === void 0 ? "multiple" : _d, _e = _a.newSelectionMode, newSelectionMode = _e === void 0 ? "clear" : _e, _f = _a.allowDeselectSelection, allowDeselectSelection = _f === void 0 ? true : _f, onFill = _a.onFill, onFillHandleRelease = _a.onFillHandleRelease, onFillShrink = _a.onFillShrink, onInsertCutCells = _a.onInsertCutCells, onCopySelection = _a.onCopySelection, onInsertCopiedCells = _a.onInsertCopiedCells, onSelectionDragMenu = _a.onSelectionDragMenu, _g = _a.confirmMoveOverwrite, confirmMoveOverwrite = _g === void 0 ? defaultConfirmMoveOverwrite : _g, _h = _a.isHiddenRow, isHiddenRow = _h === void 0 ? defaultIsHidden : _h, _j = _a.isHiddenColumn, isHiddenColumn = _j === void 0 ? defaultIsHidden : _j, _k = _a.alwaysScrollToActiveCell, alwaysScrollToActiveCell = _k === void 0 ? true : _k, _l = _a.selectionTopBound, selectionTopBound = _l === void 0 ? 0 : _l, _m = _a.selectionBottomBound, selectionBottomBound = _m === void 0 ? rowCount : _m, _o = _a.selectionLeftBound, selectionLeftBound = _o === void 0 ? 0 : _o, _p = _a.selectionRightBound, selectionRightBound = _p === void 0 ? columnCount : _p, mouseDownInterceptor = _a.mouseDownInterceptor, mouseMoveInterceptor = _a.mouseMoveInterceptor, _q = _a.mergedCells, mergedCells = _q === void 0 ? config_1.DEFAULT_ARRAY : _q, merges = _a.merges, _r = _a.canSelectionSpanMergedCells, canSelectionSpanMergedCells = _r === void 0 ? defaultSelectionSpan : _r, getValue = _a.getValue, onMoveSelection = _a.onMoveSelection, getCellCoordsFromOffset = _a.getCellCoordsFromOffset, getCellBounds = _a.getCellBounds, getViewPort = _a.getViewPort, focus = _a.focus, scrollToCell = _a.scrollToCell, isMergedCell = _a.isMergedCell, enableSelectOnEnterKey = _a.enableSelectOnEnterKey, _s = _a.enterKeyDirection, enterKeyDirection = _s === void 0 ? "down" : _s, formulaMode = _a.formulaMode, isTouchDevice = _a.isTouchDevice, getDataRowCount = _a.getDataRowCount, getDataColumnCount = _a.getDataColumnCount, getDataRegion = _a.getDataRegion, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, _t = _a.enableDataBoundaryNavigation, enableDataBoundaryNavigation = _t === void 0 ? false : _t, tables = _a.tables, onInsertTableRow = _a.onInsertTableRow, isRangeSelectableProp = _a.isRangeSelectable, _u = _a.rightToLeft, rightToLeft = _u === void 0 ? false : _u;
115
115
  /**
116
116
  * Selectability gate (Excel's Select locked / unlocked cells). Every
117
117
  * gesture checks it before it moves anything, and the two emitters below
@@ -161,8 +161,8 @@ var useSelection = function (_a) {
161
161
  }
162
162
  : undefined;
163
163
  }, [onChangeSelectionsProp, isSelectable]);
164
- var _u = tslib_1.__read((0, react_1.useState)(), 2), fillSelection = _u[0], setFillSelection = _u[1];
165
- var _v = tslib_1.__read((0, react_1.useState)(), 2), fillShrink = _v[0], setFillShrink = _v[1];
164
+ var _v = tslib_1.__read((0, react_1.useState)(), 2), fillSelection = _v[0], setFillSelection = _v[1];
165
+ var _w = tslib_1.__read((0, react_1.useState)(), 2), fillShrink = _w[0], setFillShrink = _w[1];
166
166
  var fillShrinkRef = (0, react_1.useRef)(undefined);
167
167
  // Ctrl/Cmd state of the fill-handle drag, sampled on every mousemove (mouseup carries the
168
168
  // modifier too, but a key released mid-drag should still count — Excel reads it at drop time,
@@ -216,7 +216,7 @@ var useSelection = function (_a) {
216
216
  var onChangeSelectionsRef = (0, use_callback_ref_1.useCallbackRef)(onChangeSelections);
217
217
  /* Drag drop selection */
218
218
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
219
- var _w = tslib_1.__read((0, react_1.useReducer)(function (s) { return s + 1; }, 0), 2), _ = _w[0], forceRender = _w[1];
219
+ var _x = tslib_1.__read((0, react_1.useReducer)(function (s) { return s + 1; }, 0), 2), _ = _x[0], forceRender = _x[1];
220
220
  var isDragging = (0, react_1.useRef)(false);
221
221
  var hasUserMovedSelection = (0, react_1.useRef)(false);
222
222
  var initialDraggedSelection = (0, react_1.useRef)(undefined);
@@ -228,7 +228,7 @@ var useSelection = function (_a) {
228
228
  /** Border element the gesture started on: a right-click that never moved re-opens the context menu there. */
229
229
  var dragTargetRef = (0, react_1.useRef)(null);
230
230
  /** Copy modifier held during the drag (Ctrl / ⌥) — drives the copy cursor; the drop re-reads it. */
231
- var _x = tslib_1.__read((0, react_1.useState)(false), 2), isDragCopy = _x[0], setIsDragCopy = _x[1];
231
+ var _y = tslib_1.__read((0, react_1.useState)(false), 2), isDragCopy = _y[0], setIsDragCopy = _y[1];
232
232
  /**
233
233
  * Need to store in ref because on mousemove and mouseup event that are
234
234
  * registered in document
@@ -1294,7 +1294,7 @@ var useSelection = function (_a) {
1294
1294
  nativeEvent.key !== "PageUp") {
1295
1295
  return;
1296
1296
  }
1297
- switch (nativeEvent.key) {
1297
+ switch ((0, grid_2.getLogicalArrowKey)(nativeEvent.key, rightToLeft)) {
1298
1298
  case "ArrowRight":
1299
1299
  keyNavigate(grid_4.Direction.Right, isShiftKey, isMetaKey);
1300
1300
  e.preventDefault();
@@ -1450,6 +1450,7 @@ var useSelection = function (_a) {
1450
1450
  isHiddenColumn,
1451
1451
  tables,
1452
1452
  onInsertTableRow,
1453
+ rightToLeft,
1453
1454
  ]);
1454
1455
  /**
1455
1456
  * TODO
@@ -1,9 +1,9 @@
1
- import type { BooleanCondition, HorizontalAlign, SheetRange, SortOrder, PivotTable } from "@rowsncolumns/common-types";
1
+ import type { BooleanCondition, DimensionProperties, HorizontalAlign, SheetRange, SortOrder, PivotTable } from "@rowsncolumns/common-types";
2
2
  import type { FormulaResult } from "@rowsncolumns/fast-formula-parser";
3
3
  import type { TableStyleElements, TotalsRowFunction } from "@rowsncolumns/utils";
4
4
  import type { CellInterface, GridRange, SelectionArea, Style } from "@rowsncolumns/grid";
5
5
  import type { ColorIndex } from "./themes";
6
- export type { BooleanCondition, CellData, ConditionType, ConditionValue, CustomFormulaResult, DataValidationInputMessage, DataValidationRule, DataValidationRuleAlert, ErrorValue, HorizontalAlign, IterativeCalculationOptions, NamedCellStyle, ExtendedValue, Mention, PivotArea, PivotAreaReference, PivotCacheField, PivotCalculatedField, PivotFieldItem, PivotSharedItem, PivotSharedItems, PivotGroup, PivotTable, PivotTableChartFormat, PivotTableStyleInfo, PivotValue, PivotValueSummarizeFunction, SheetCoordinate, SheetRange, SortOrder, StructuredValue, StyleReference, TextFormatRun, DataValidationRuleRecord, } from "@rowsncolumns/common-types";
6
+ export type { DimensionProperties, ParsedToken, Token, BooleanCondition, CellData, ConditionType, ConditionValue, CustomFormulaResult, DataValidationInputMessage, DataValidationRule, DataValidationRuleAlert, ErrorValue, HorizontalAlign, IterativeCalculationOptions, NamedCellStyle, ExtendedValue, Mention, PivotArea, PivotAreaReference, PivotCacheField, PivotCalculatedField, PivotFieldItem, PivotSharedItem, PivotSharedItems, PivotGroup, PivotTable, PivotTableChartFormat, PivotTableStyleInfo, PivotValue, PivotValueSummarizeFunction, SheetCoordinate, SheetRange, SortOrder, StructuredValue, StyleReference, TextFormatRun, DataValidationRuleRecord, } from "@rowsncolumns/common-types";
7
7
  export { CONDITION_TYPES } from "@rowsncolumns/common-types";
8
8
  /**
9
9
  * Utility type for values that can be undefined or null
@@ -121,8 +121,8 @@ export type Sheet = {
121
121
  zoomScale?: Maybe<number>;
122
122
  /**
123
123
  * The sheet displays right-to-left (column A on the right). Mirrors
124
- * OOXML `<sheetView rightToLeft="1">`. Round-tripped and queryable;
125
- * the canvas grid does NOT mirror yet. Default false when omitted.
124
+ * OOXML `<sheetView rightToLeft="1">`. Pass it to CanvasGrid's
125
+ * `rightToLeft` to mirror the grid. Default false when omitted.
126
126
  */
127
127
  rightToLeft?: Maybe<boolean>;
128
128
  merges?: Maybe<GridRange[]>;
@@ -2241,42 +2241,6 @@ export type DataBarRule = {
2241
2241
  minLength?: Maybe<number>;
2242
2242
  maxLength?: Maybe<number>;
2243
2243
  };
2244
- export type DimensionProperties = {
2245
- size?: Maybe<number>;
2246
- resizedByUser?: Maybe<boolean>;
2247
- /**
2248
- * Mirrors the xlsx `customHeight="1"` (or `customWidth="1"`) attribute
2249
- * captured at import time. Distinct from `resizedByUser` — that runtime
2250
- * flag can be flipped by engine paths (column-resize side effects,
2251
- * autofit, etc.) and is not safe to use as the export gate for
2252
- * `customHeight`. When the source carried the explicit `customHeight`
2253
- * marker, this stays true through round-trip and tells the exporter
2254
- * to emit `customHeight="1"` even when `size` matches the sheet
2255
- * default — which round-trips Excel's "user locked this row even though
2256
- * it happens to be the default height" behavior verbatim.
2257
- */
2258
- customHeight?: Maybe<boolean>;
2259
- hiddenByUser?: Maybe<boolean>;
2260
- hiddenByFilter?: Maybe<boolean>;
2261
- /**
2262
- * Hidden because the parent outline group is collapsed. Kept separate
2263
- * from `hiddenByUser` so expanding the group doesn't blow away a
2264
- * manual hide. Render layer ORs all three.
2265
- */
2266
- hiddenByGroup?: Maybe<boolean>;
2267
- /**
2268
- * Excel outline depth (0–7). 0 = no grouping. Mirrors OOXML
2269
- * `<row outlineLevel=…>` / `<col outlineLevel=…>`. Persisted only
2270
- * when > 0.
2271
- */
2272
- outlineLevel?: Maybe<number>;
2273
- /**
2274
- * True on the SUMMARY row/column of a group when the group is in
2275
- * the collapsed state — that's where the `+` button is drawn.
2276
- * Mirrors OOXML `<row collapsed="1">` / `<col collapsed="1">`.
2277
- */
2278
- collapsed?: Maybe<boolean>;
2279
- };
2280
2244
  export type SortSpecs = {
2281
2245
  dimensionIndex: number;
2282
2246
  sortOrder: SortOrder;
@@ -2342,35 +2306,6 @@ export declare enum MimeTypes {
2342
2306
  plain = "text/plain",
2343
2307
  json = "application/json"
2344
2308
  }
2345
- export type Token = {
2346
- image: string;
2347
- startOffset: number;
2348
- startColumn: number;
2349
- endOffset: number;
2350
- endColumn: number;
2351
- endLine: number;
2352
- tokenType: {
2353
- name: string;
2354
- };
2355
- tokenTypeIdx: number;
2356
- };
2357
- export type ParsedToken = Token & {
2358
- index?: number;
2359
- sheetName?: string;
2360
- selection?: boolean;
2361
- isNamedRange?: boolean;
2362
- isColumnRange?: boolean;
2363
- isRowRange?: boolean;
2364
- tableName?: string;
2365
- columnNames?: string[];
2366
- thisRow?: boolean;
2367
- specialItem?: SpecialItem;
2368
- structured?: boolean;
2369
- property?: string | null;
2370
- resolvedSheetName?: string;
2371
- resolvedRowIndex?: number;
2372
- resolvedColumnIndex?: number;
2373
- };
2374
2309
  export type SpecialItem = "#Totals" | "#Data" | "#All" | "#Headers" | "#This Row";
2375
2310
  export type AutoFillType = "FillCopy" | "FillDays" | "FillDefault" | "FillFormats" | "FillMonths" | "FillSeries" | "FillValues"
2376
2311
  /** Alias of Excel's `xlFillValues` under the Auto Fill Options label ("Fill Without Formatting"). */