@rowsncolumns/spreadsheet 10.20.1 → 10.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
  2. package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
  3. package/dist/cjs/components/canvas-grid/index.js +75 -69
  4. package/dist/cjs/components/canvas-grid/typings.d.ts +17 -4
  5. package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
  6. package/dist/cjs/components/cell-arrow/index.d.ts +10 -0
  7. package/dist/cjs/components/cell-arrow/index.d.ts.map +1 -1
  8. package/dist/cjs/components/cell-arrow/index.js +34 -2
  9. package/dist/cjs/hooks/use-cell-renderer.d.ts +3 -1
  10. package/dist/cjs/hooks/use-cell-renderer.d.ts.map +1 -1
  11. package/dist/cjs/hooks/use-cell-renderer.js +12 -6
  12. package/dist/cjs/hooks/use-editor-submit.d.ts +17 -6
  13. package/dist/cjs/hooks/use-editor-submit.d.ts.map +1 -1
  14. package/dist/cjs/hooks/use-editor-submit.js +104 -21
  15. package/dist/cjs/release-date.js +1 -1
  16. package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
  17. package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
  18. package/dist/esm/components/canvas-grid/index.js +10 -4
  19. package/dist/esm/components/canvas-grid/typings.d.ts +17 -4
  20. package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
  21. package/dist/esm/components/cell-arrow/index.d.ts +10 -0
  22. package/dist/esm/components/cell-arrow/index.d.ts.map +1 -1
  23. package/dist/esm/components/cell-arrow/index.js +32 -2
  24. package/dist/esm/hooks/use-cell-renderer.d.ts +3 -1
  25. package/dist/esm/hooks/use-cell-renderer.d.ts.map +1 -1
  26. package/dist/esm/hooks/use-cell-renderer.js +11 -5
  27. package/dist/esm/hooks/use-editor-submit.d.ts +17 -6
  28. package/dist/esm/hooks/use-editor-submit.d.ts.map +1 -1
  29. package/dist/esm/hooks/use-editor-submit.js +73 -11
  30. package/dist/esm/release-date.js +1 -1
  31. package/package.json +1 -1
@@ -1,9 +1,39 @@
1
- import React, { useCallback, useState } from "react";
1
+ import React, { useCallback, useLayoutEffect, useRef, useState } from "react";
2
2
  import { Group, Path, Rect } from "react-konva";
3
3
  import { ARROW_DOWN_COLOR, ARROW_DOWN_ICON_PATH, ARROW_DOWN_WIDTH, } from "../../config";
4
4
  import { getIconSpacing } from "../../helpers";
5
+ /**
6
+ * Keeps `node` the last of its parent's children, now and before every draw
7
+ * of its layer: painted over its siblings and hit before them. The cells of a
8
+ * pane are siblings painted in order, so an arrow that sits over the next
9
+ * cell is otherwise under that cell's value, which also takes the press.
10
+ * Cells mounted later (a scroll, an edit) are added after it, hence the check
11
+ * before each draw. Returns the function that stops it.
12
+ */
13
+ export const keepAboveSiblings = (node) => {
14
+ const raise = () => {
15
+ const siblings = node.getParent()?.getChildren().length ?? 0;
16
+ if (siblings > 0 && node.getZIndex() !== siblings - 1)
17
+ node.moveToTop();
18
+ };
19
+ raise();
20
+ const layer = node.getLayer();
21
+ layer?.on("beforeDraw.cellArrowOutside", raise);
22
+ return () => {
23
+ layer?.off("beforeDraw.cellArrowOutside", raise);
24
+ };
25
+ };
5
26
  export const CellArrow = ({ x = 0, y = 0, width = 0, height = 0, scale, rowIndex, columnIndex, onClick, verticalAlignment, outside = false, }) => {
6
27
  const [isHovered, setIsHovered] = useState(false);
28
+ const groupRef = useRef(null);
29
+ // An arrow outside its cell is over the next cell: Excel paints the button
30
+ // over that cell's value, and a press on it opens the list.
31
+ useLayoutEffect(() => {
32
+ const node = groupRef.current;
33
+ if (!outside || !node)
34
+ return;
35
+ return keepAboveSiblings(node);
36
+ }, [outside]);
7
37
  const padding = getIconSpacing(verticalAlignment, height, ARROW_DOWN_WIDTH, scale, 2 * scale);
8
38
  const posX = x + width - ARROW_DOWN_WIDTH * scale - 2 * scale;
9
39
  const posY = y + padding + 0.5;
@@ -36,7 +66,7 @@ export const CellArrow = ({ x = 0, y = 0, width = 0, height = 0, scale, rowIndex
36
66
  if (e.evt.cancelable)
37
67
  e.evt.preventDefault();
38
68
  };
39
- return (React.createElement(Group, { ...(outside
69
+ return (React.createElement(Group, { ref: groupRef, ...(outside
40
70
  ? { onMouseDown: handleMouseDown, onPointerDown: handlePointerDown }
41
71
  : { onClick: handleClick }), onTap: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, perfectDrawEnabled: false },
42
72
  React.createElement(Rect, { x: posX, y: posY, width: ARROW_DOWN_WIDTH * scale, height: ARROW_DOWN_WIDTH * scale, fill: isHovered ? ARROW_DOWN_COLOR : "transparent", cornerRadius: 2, perfectDrawEnabled: false }),
@@ -37,6 +37,8 @@ export type CellRendererProps<T extends CellData = CellData> = {
37
37
  chipBackgroundColor: string;
38
38
  filterIconColor: string;
39
39
  showCalculatedColumnIcon: boolean;
40
+ /** See `CanvasGridProps.listArrowPlacement`. */
41
+ listArrowPlacement?: CanvasGridProps["listArrowPlacement"];
40
42
  enableTextOverflow: boolean;
41
43
  /**
42
44
  * The sheet is mirrored (right-to-left): text spills toward the physical
@@ -304,5 +306,5 @@ export type CellRendererProps<T extends CellData = CellData> = {
304
306
  */
305
307
  getDefaultHorizontalAlignment(sheetId: number, rowIndex: number, columnIndex: number): HorizontalAlign | undefined;
306
308
  };
307
- export declare const useCellRenderer: <T extends CellData = CellData>({ sheetId, scale, showGridLines, showZeros, isRowHeader, isColumnHeader, selectedRows, selectedColumns, selectedRowHeaders, selectedColumnHeaders, cellBackgroundColor, automaticBorderColor, headerBorderColor, headerBackgroundColor, headerColor, headerActiveBackgroundColor, headerSelectedBackgroundColor, headerSelectedColor, headerTableBackgroundColor, headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor, chipBackgroundColor, filterIconColor, showCalculatedColumnIcon, enableTextOverflow, rightToLeft, showHeaders, theme, getDefaultHorizontalAlignment, isTableFilterVisible, columnContainsTable, rowsContainsTable, canOverflowToNextCell, getTableHeaderSortOrder, getDataValidation, getErrorValue, formulaLocale, locale, getEffectiveValue, getSparklineGroup, getFormattedValue, getNote, getComment, getEffectiveCellFormat, getCellBounds, getCellImageUrl, getCellMetaType, getRowHeaderText, getColumnHeaderText, getMaximumOverflowTextWidth, getCenterAcrossSelectionSpan, activeCell, getTextDimension, getCellGroupingInfo, getTextFormatRuns, onRequestEdit, onFilterClick, onCheckboxClick, isTableHeader, isTableTotalsCell, onTotalsArrowClick, isCalculatedColumnHeader, isTableHeaderFilterActive, HeaderCell, Cell, StructuredResult, gridLineWidth, getErrorCheck, circleInvalidData, showNotes, showComments, defaultFontSizePoint, lineHeightMode, readonly, onExpandCollapse, onOverflow, isComparing, getCellDiff, }: CellRendererProps<T>) => readonly [(props: RendererProps) => React.JSX.Element | null, (props: RendererProps) => React.JSX.Element, (props: RendererProps) => React.JSX.Element | null, (props: RendererProps) => React.JSX.Element | null | undefined, (cells: RendererProps[]) => React.JSX.Element];
309
+ export declare const useCellRenderer: <T extends CellData = CellData>({ sheetId, scale, showGridLines, showZeros, isRowHeader, isColumnHeader, selectedRows, selectedColumns, selectedRowHeaders, selectedColumnHeaders, cellBackgroundColor, automaticBorderColor, headerBorderColor, headerBackgroundColor, headerColor, headerActiveBackgroundColor, headerSelectedBackgroundColor, headerSelectedColor, headerTableBackgroundColor, headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor, chipBackgroundColor, filterIconColor, showCalculatedColumnIcon, listArrowPlacement, enableTextOverflow, rightToLeft, showHeaders, theme, getDefaultHorizontalAlignment, isTableFilterVisible, columnContainsTable, rowsContainsTable, canOverflowToNextCell, getTableHeaderSortOrder, getDataValidation, getErrorValue, formulaLocale, locale, getEffectiveValue, getSparklineGroup, getFormattedValue, getNote, getComment, getEffectiveCellFormat, getCellBounds, getCellImageUrl, getCellMetaType, getRowHeaderText, getColumnHeaderText, getMaximumOverflowTextWidth, getCenterAcrossSelectionSpan, activeCell, getTextDimension, getCellGroupingInfo, getTextFormatRuns, onRequestEdit, onFilterClick, onCheckboxClick, isTableHeader, isTableTotalsCell, onTotalsArrowClick, isCalculatedColumnHeader, isTableHeaderFilterActive, HeaderCell, Cell, StructuredResult, gridLineWidth, getErrorCheck, circleInvalidData, showNotes, showComments, defaultFontSizePoint, lineHeightMode, readonly, onExpandCollapse, onOverflow, isComparing, getCellDiff, }: CellRendererProps<T>) => readonly [(props: RendererProps) => React.JSX.Element | null, (props: RendererProps) => React.JSX.Element, (props: RendererProps) => React.JSX.Element | null, (props: RendererProps) => React.JSX.Element | null | undefined, (cells: RendererProps[]) => React.JSX.Element];
308
310
  //# sourceMappingURL=use-cell-renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-cell-renderer.d.ts","sourceRoot":"","sources":["../../../hooks/use-cell-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,4BAA4B,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAQ/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAqB3C,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,UAAU,EACX,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE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OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B;;OAEG;IACH,oBAAoB,EAAE,WAAW,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAC3E;;;OAGG;IACH,cAAc,EAAE,WAAW,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,gBAAgB,CAAC,CACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,EACnB,aAAa,EAAE,OAAO,GACrB,IAAI,CAAC;IACR,UAAU,CAAC,EAAE,CACX,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,KAChB,QAAQ,GAAG,IAAI,CAAC;IAErB;;;;;OAKG;IACH,6BAA6B,CAC3B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,eAAe,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAE,y6CAgF5D,iBAAiB,CAAC,CAAC,CAAC,uBAmpBX,aAAa,uCAtoBb,aAAa,gCA4hBb,aAAa,uCApFb,aAAa,mDA6Qb,aAAa,EAAE,uBA0B1B,CAAC"}
@@ -18,7 +18,7 @@ import { getStringifiedColor, isAutomaticBorderColor } from "../themes";
18
18
  import { applyShowZeros } from "./show-zeros";
19
19
  import { useCellDiffHighlight } from "./use-cell-diff-highlight";
20
20
  import { isIndexSelected } from "./use-selected-rows-columns";
21
- export const useCellRenderer = ({ sheetId, scale, showGridLines, showZeros, isRowHeader, isColumnHeader, selectedRows, selectedColumns, selectedRowHeaders, selectedColumnHeaders, cellBackgroundColor, automaticBorderColor, headerBorderColor, headerBackgroundColor, headerColor, headerActiveBackgroundColor, headerSelectedBackgroundColor, headerSelectedColor, headerTableBackgroundColor, headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor, chipBackgroundColor, filterIconColor, showCalculatedColumnIcon, enableTextOverflow, rightToLeft = false, showHeaders, theme, getDefaultHorizontalAlignment, isTableFilterVisible, columnContainsTable, rowsContainsTable, canOverflowToNextCell, getTableHeaderSortOrder, getDataValidation, getErrorValue, formulaLocale, locale, getEffectiveValue, getSparklineGroup, getFormattedValue, getNote, getComment, getEffectiveCellFormat, getCellBounds, getCellImageUrl, getCellMetaType, getRowHeaderText, getColumnHeaderText, getMaximumOverflowTextWidth, getCenterAcrossSelectionSpan, activeCell, getTextDimension, getCellGroupingInfo, getTextFormatRuns, onRequestEdit, onFilterClick, onCheckboxClick, isTableHeader, isTableTotalsCell, onTotalsArrowClick, isCalculatedColumnHeader, isTableHeaderFilterActive, HeaderCell, Cell, StructuredResult, gridLineWidth, getErrorCheck, circleInvalidData = false, showNotes, showComments, defaultFontSizePoint, lineHeightMode, readonly, onExpandCollapse, onOverflow, isComparing = false, getCellDiff, }) => {
21
+ export const useCellRenderer = ({ sheetId, scale, showGridLines, showZeros, isRowHeader, isColumnHeader, selectedRows, selectedColumns, selectedRowHeaders, selectedColumnHeaders, cellBackgroundColor, automaticBorderColor, headerBorderColor, headerBackgroundColor, headerColor, headerActiveBackgroundColor, headerSelectedBackgroundColor, headerSelectedColor, headerTableBackgroundColor, headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor, chipBackgroundColor, filterIconColor, showCalculatedColumnIcon, listArrowPlacement = "besideActiveCell", enableTextOverflow, rightToLeft = false, showHeaders, theme, getDefaultHorizontalAlignment, isTableFilterVisible, columnContainsTable, rowsContainsTable, canOverflowToNextCell, getTableHeaderSortOrder, getDataValidation, getErrorValue, formulaLocale, locale, getEffectiveValue, getSparklineGroup, getFormattedValue, getNote, getComment, getEffectiveCellFormat, getCellBounds, getCellImageUrl, getCellMetaType, getRowHeaderText, getColumnHeaderText, getMaximumOverflowTextWidth, getCenterAcrossSelectionSpan, activeCell, getTextDimension, getCellGroupingInfo, getTextFormatRuns, onRequestEdit, onFilterClick, onCheckboxClick, isTableHeader, isTableTotalsCell, onTotalsArrowClick, isCalculatedColumnHeader, isTableHeaderFilterActive, HeaderCell, Cell, StructuredResult, gridLineWidth, getErrorCheck, circleInvalidData = false, showNotes, showComments, defaultFontSizePoint, lineHeightMode, readonly, onExpandCollapse, onOverflow, isComparing = false, getCellDiff, }) => {
22
22
  // Version comparison diff highlighting - only active when isComparing is true
23
23
  const { mergeCellFormatWithDiff, getDiffHighlight } = useCellDiffHighlight(isComparing ? getCellDiff : undefined);
24
24
  // Edit
@@ -58,11 +58,16 @@ export const useCellRenderer = ({ sheetId, scale, showGridLines, showZeros, isRo
58
58
  const showTotalsArrow = !showFilter && !!isTableTotalsCell?.(rowIndex, columnIndex);
59
59
  // Excel shows a list's in-cell dropdown button only beside the active
60
60
  // cell, outside its right edge — it never takes room from the value.
61
+ // With `listArrowPlacement: "inCell"`, every list cell shows it inside
62
+ // its right edge instead, and the value keeps clear of it.
63
+ const listArrowInCell = listArrowPlacement === "inCell";
61
64
  const showValidationArrow = !showTotalsArrow &&
62
- activeCell?.rowIndex === rowIndex &&
63
- activeCell?.columnIndex === columnIndex &&
65
+ (listArrowInCell ||
66
+ (activeCell?.rowIndex === rowIndex &&
67
+ activeCell?.columnIndex === columnIndex)) &&
64
68
  showValidationDropdownArrow(dataValidation);
65
69
  const showArrow = showValidationArrow || showTotalsArrow;
70
+ const showInCellArrow = showTotalsArrow || (listArrowInCell && showValidationArrow);
66
71
  // Has notes
67
72
  const showNote = showNotes
68
73
  ? !!getNote(sheetId, rowIndex, columnIndex)
@@ -107,7 +112,7 @@ export const useCellRenderer = ({ sheetId, scale, showGridLines, showZeros, isRo
107
112
  isWrapEnabled &&
108
113
  !showFilter &&
109
114
  !isCalculatedColumn &&
110
- !showTotalsArrow &&
115
+ !showInCellArrow &&
111
116
  !expandable &&
112
117
  !containsTextInside &&
113
118
  // Following Excel and Google sheets behavior
@@ -220,7 +225,7 @@ export const useCellRenderer = ({ sheetId, scale, showGridLines, showZeros, isRo
220
225
  ? undefined
221
226
  : getCellNumberFormatLayout(effectiveCellFormat?.numberFormat?.pattern, getExtendedValueNumber(effectiveValue) ??
222
227
  getExtendedValueString(effectiveValue), displayValue, locale);
223
- return (React.createElement(Cell, { 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)
228
+ return (React.createElement(Cell, { value: displayValue, numberFormatLayout: numberFormatLayout, cellFormat: effectiveCellFormat, scale: scale, defaultBackgroundColor: cellBackgroundColor, onRequestEdit: onRequestEditCell, onArrowClick: showTotalsArrow ? onTotalsArrowClick : undefined, showArrow: showArrow, arrowOutside: showValidationArrow && !listArrowInCell, 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)
224
229
  ? overflowLeft ?? 0
225
230
  : undefined, centerOnSpan: !!centerAcrossSpan, showGridLines: showGridLines, structuredValue: effectiveValue?.structuredValue, sparklineGroupAxis: effectiveValue?.structuredValue?.kind === "sparkline" &&
226
231
  getSparklineGroup
@@ -244,6 +249,7 @@ export const useCellRenderer = ({ sheetId, scale, showGridLines, showZeros, isRo
244
249
  chipBackgroundColor,
245
250
  filterIconColor,
246
251
  showCalculatedColumnIcon,
252
+ listArrowPlacement,
247
253
  enableTextOverflow,
248
254
  rightToLeft,
249
255
  getTextFormatRuns,
@@ -65,15 +65,26 @@ export declare const isEntryLimitRefusal: (result: unknown) => boolean;
65
65
  */
66
66
  export declare const writeEntryFill: (fill: EntryFill, { onChange, onChangeBatch, onChangeFormatting }: EntryFillWriters) => boolean;
67
67
  /**
68
- * The first write of a fill that reaches part of a legacy (Ctrl+Shift+Enter) array without
69
- * holding it whole, which the engine refuses ("You can't change part of an array"): the active
68
+ * The first write of a fill that reaches part of a legacy (Ctrl+Shift+Enter) array the fill does
69
+ * not hold whole, which the engine refuses ("You can't change part of an array"): the active
70
70
  * cell's (`"activeCell"`) or one rectangle's. A fill is the active cell's write and one write for
71
71
  * each rectangle, and only writes that share one history batch are refused together, so the grid
72
- * asks before it writes anything. An array a rectangle cuts has a cell on the rectangle's edge:
73
- * the edges are read, an array found there is stepped over whole, and a fill whose edges are
74
- * longer than {@link TORN_ARRAY_CHECK_CELLS} is not judged here (`undefined`).
72
+ * asks before it writes anything. Only for a host without `onFillEntry`: a host with it is handed
73
+ * the fill unjudged and no write handler is called.
74
+ *
75
+ * The selection is judged, as Excel judges it: an array the fill's cells together hold whole is
76
+ * replaced, though each write holds only part of it (C2:D3 with C2 active over an array in
77
+ * D2:D3). The engine judges one `batch` the same way and refuses each of those writes sent as a
78
+ * command of its own, so `eachWrite` is passed for a host whose writes do not reach the engine
79
+ * as one batch (no `batchHistory`): there a write that holds part of an array is refused although
80
+ * the selection holds it whole.
81
+ *
82
+ * An array a rectangle cuts has a cell on the rectangle's edge: the edges are read, an array
83
+ * found there is stepped over whole, and a fill whose edges are longer than
84
+ * {@link TORN_ARRAY_CHECK_CELLS} is not judged here (`undefined`): it is written, and the engine
85
+ * refuses a torn one whole when the writes reach it as one batch.
75
86
  */
76
- export declare const entryFillTornArrayWrite: (fill: Pick<EntryFill, "sheetId" | "activeCell" | "writes">, getArrayFormula: NonNullable<CanvasGridProps["getArrayFormula"]>) => "activeCell" | EntryFillWrite | undefined;
87
+ export declare const entryFillTornArrayWrite: (fill: Pick<EntryFill, "sheetId" | "activeCell" | "writes">, getArrayFormula: NonNullable<CanvasGridProps["getArrayFormula"]>, eachWrite?: boolean) => "activeCell" | EntryFillWrite | undefined;
77
88
  /**
78
89
  * Commit-time data-validation enforcement decision for a value about to be
79
90
  * written. `block` rejects the value (Excel `errorStyle="stop"`); `confirm`
@@ -1 +1 @@
1
- {"version":3,"file":"use-editor-submit.d.ts","sourceRoot":"","sources":["../../../hooks/use-editor-submit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAo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AAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,kVAsB7B,oBAAoB,aAQV,MAAM,GAAG,OAAO,kBACP,aAAa,EAAE,GAAG,SAAS,GAAG,IAAI,iBACnC,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,kBAClC,MAAM,cACV,aAAa,mBACR,aAAa,GAAG,IAAI,YAC3B,OAAO,YACP,mBAAmB,kBAwTlC,CAAC"}
@@ -171,21 +171,79 @@ export const writeEntryFill = (fill, { onChange, onChangeBatch, onChangeFormatti
171
171
  };
172
172
  /** How many cells the array check of one fill reads at most; past that the engine alone judges. */
173
173
  const TORN_ARRAY_CHECK_CELLS = 20_000;
174
+ /** Whether the `cover` rectangles together hold every cell of `range`. */
175
+ const rangeCoveredBy = (range, cover) => {
176
+ let left = [range];
177
+ for (const c of cover) {
178
+ const rest = [];
179
+ for (const r of left) {
180
+ if (r.startRowIndex > c.endRowIndex ||
181
+ r.endRowIndex < c.startRowIndex ||
182
+ r.startColumnIndex > c.endColumnIndex ||
183
+ r.endColumnIndex < c.startColumnIndex) {
184
+ rest.push(r);
185
+ continue;
186
+ }
187
+ if (r.startRowIndex < c.startRowIndex) {
188
+ rest.push({ ...r, endRowIndex: c.startRowIndex - 1 });
189
+ }
190
+ if (r.endRowIndex > c.endRowIndex) {
191
+ rest.push({ ...r, startRowIndex: c.endRowIndex + 1 });
192
+ }
193
+ const rows = {
194
+ startRowIndex: Math.max(r.startRowIndex, c.startRowIndex),
195
+ endRowIndex: Math.min(r.endRowIndex, c.endRowIndex),
196
+ };
197
+ if (r.startColumnIndex < c.startColumnIndex) {
198
+ rest.push({ ...r, ...rows, endColumnIndex: c.startColumnIndex - 1 });
199
+ }
200
+ if (r.endColumnIndex > c.endColumnIndex) {
201
+ rest.push({ ...r, ...rows, startColumnIndex: c.endColumnIndex + 1 });
202
+ }
203
+ }
204
+ left = rest;
205
+ if (!left.length)
206
+ break;
207
+ }
208
+ return !left.length;
209
+ };
174
210
  /**
175
- * The first write of a fill that reaches part of a legacy (Ctrl+Shift+Enter) array without
176
- * holding it whole, which the engine refuses ("You can't change part of an array"): the active
211
+ * The first write of a fill that reaches part of a legacy (Ctrl+Shift+Enter) array the fill does
212
+ * not hold whole, which the engine refuses ("You can't change part of an array"): the active
177
213
  * cell's (`"activeCell"`) or one rectangle's. A fill is the active cell's write and one write for
178
214
  * each rectangle, and only writes that share one history batch are refused together, so the grid
179
- * asks before it writes anything. An array a rectangle cuts has a cell on the rectangle's edge:
180
- * the edges are read, an array found there is stepped over whole, and a fill whose edges are
181
- * longer than {@link TORN_ARRAY_CHECK_CELLS} is not judged here (`undefined`).
215
+ * asks before it writes anything. Only for a host without `onFillEntry`: a host with it is handed
216
+ * the fill unjudged and no write handler is called.
217
+ *
218
+ * The selection is judged, as Excel judges it: an array the fill's cells together hold whole is
219
+ * replaced, though each write holds only part of it (C2:D3 with C2 active over an array in
220
+ * D2:D3). The engine judges one `batch` the same way and refuses each of those writes sent as a
221
+ * command of its own, so `eachWrite` is passed for a host whose writes do not reach the engine
222
+ * as one batch (no `batchHistory`): there a write that holds part of an array is refused although
223
+ * the selection holds it whole.
224
+ *
225
+ * An array a rectangle cuts has a cell on the rectangle's edge: the edges are read, an array
226
+ * found there is stepped over whole, and a fill whose edges are longer than
227
+ * {@link TORN_ARRAY_CHECK_CELLS} is not judged here (`undefined`): it is written, and the engine
228
+ * refuses a torn one whole when the writes reach it as one batch.
182
229
  */
183
- export const entryFillTornArrayWrite = (fill, getArrayFormula) => {
230
+ export const entryFillTornArrayWrite = (fill, getArrayFormula, eachWrite = false) => {
184
231
  const { sheetId, activeCell } = fill;
232
+ const filled = [
233
+ {
234
+ startRowIndex: activeCell.rowIndex,
235
+ endRowIndex: activeCell.rowIndex,
236
+ startColumnIndex: activeCell.columnIndex,
237
+ endColumnIndex: activeCell.columnIndex,
238
+ },
239
+ ...fill.writes.map((write) => write.range),
240
+ ];
241
+ const replaced = (array) => !eachWrite && rangeCoveredBy(array, filled);
185
242
  const own = getArrayFormula(sheetId, activeCell.rowIndex, activeCell.columnIndex)?.range;
186
243
  if (own &&
187
244
  (own.startRowIndex !== own.endRowIndex ||
188
- own.startColumnIndex !== own.endColumnIndex)) {
245
+ own.startColumnIndex !== own.endColumnIndex) &&
246
+ !replaced(own)) {
189
247
  return "activeCell";
190
248
  }
191
249
  let left = TORN_ARRAY_CHECK_CELLS;
@@ -201,7 +259,7 @@ export const entryFillTornArrayWrite = (fill, getArrayFormula) => {
201
259
  if (left-- <= 0)
202
260
  return undefined;
203
261
  const array = getArrayFormula(sheetId, row, col)?.range;
204
- if (array && !holds(array))
262
+ if (array && !holds(array) && !replaced(array))
205
263
  return write;
206
264
  col = array ? array.endColumnIndex : col;
207
265
  }
@@ -212,7 +270,7 @@ export const entryFillTornArrayWrite = (fill, getArrayFormula) => {
212
270
  if (left-- <= 0)
213
271
  return undefined;
214
272
  const array = getArrayFormula(sheetId, row, col)?.range;
215
- if (array && !holds(array))
273
+ if (array && !holds(array) && !replaced(array))
216
274
  return write;
217
275
  row = array ? array.endRowIndex : row;
218
276
  }
@@ -340,8 +398,12 @@ export const useEditorSubmit = ({ sheetId, onChangeActiveSheet, setActiveCell, o
340
398
  writes: fillWrites,
341
399
  wrapText: Boolean(wrapLineBreak),
342
400
  };
343
- const torn = isFill && getArrayFormula
344
- ? entryFillTornArrayWrite(entry, getArrayFormula)
401
+ // A host with `onFillEntry` gates the whole fill before any write and hands it to the
402
+ // engine as one operation, which the engine refuses whole: no write handler is called
403
+ // ahead of that gate, so the fill is not judged here. Without `batchHistory` each write
404
+ // is a command of its own for the engine, so each write is judged, not the selection.
405
+ const torn = isFill && !onFillEntry && getArrayFormula
406
+ ? entryFillTornArrayWrite(entry, getArrayFormula, !batchHistory)
345
407
  : undefined;
346
408
  if (torn) {
347
409
  // Excel refuses the whole fill ("You can't change part of an array") and changes
@@ -1,3 +1,3 @@
1
1
  export const releaseDate =
2
2
  // @ts-ignore
3
- new Date("2026-11-25") ?? new Date("2025-06-18");
3
+ new Date("2026-11-26") ?? new Date("2025-06-18");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowsncolumns/spreadsheet",
3
- "version": "10.20.1",
3
+ "version": "10.20.2",
4
4
  "author": "Vinay M",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./dist/cjs/index.js",