@rowsncolumns/spreadsheet 10.9.0 → 10.9.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 (73) hide show
  1. package/dist/cjs/api/scheduler.d.ts +1 -1
  2. package/dist/cjs/api/scheduler.d.ts.map +1 -1
  3. package/dist/cjs/api/scheduler.js +2 -4
  4. package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
  5. package/dist/cjs/atoms/sheet-context.atom.d.ts +3 -3
  6. package/dist/cjs/atoms/sheet-context.atom.d.ts.map +1 -1
  7. package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
  8. package/dist/cjs/components/canvas-grid/index.js +1 -0
  9. package/dist/cjs/components/canvas-grid/typings.d.ts +6 -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 +1 -1
  13. package/dist/cjs/components/cell-arrow/index.d.ts +7 -1
  14. package/dist/cjs/components/cell-arrow/index.d.ts.map +1 -1
  15. package/dist/cjs/components/cell-arrow/index.js +27 -3
  16. package/dist/cjs/components/toolbar/text-horizontal-align-selector.d.ts +5 -0
  17. package/dist/cjs/components/toolbar/text-horizontal-align-selector.d.ts.map +1 -1
  18. package/dist/cjs/components/toolbar/text-horizontal-align-selector.js +36 -30
  19. package/dist/cjs/components/toolbar/text-vertical-align-selector.d.ts +5 -0
  20. package/dist/cjs/components/toolbar/text-vertical-align-selector.d.ts.map +1 -1
  21. package/dist/cjs/components/toolbar/text-vertical-align-selector.js +26 -21
  22. package/dist/cjs/components/toolbar/text-wrap-selector.d.ts +3 -0
  23. package/dist/cjs/components/toolbar/text-wrap-selector.d.ts.map +1 -1
  24. package/dist/cjs/components/toolbar/text-wrap-selector.js +33 -28
  25. package/dist/cjs/config.d.ts +1 -1
  26. package/dist/cjs/config.d.ts.map +1 -1
  27. package/dist/cjs/config.js +2 -1
  28. package/dist/cjs/hooks/use-context-setter.d.ts.map +1 -1
  29. package/dist/cjs/hooks/use-context-setter.js +3 -1
  30. package/dist/cjs/hooks/use-copy-paste-cut.d.ts.map +1 -1
  31. package/dist/cjs/hooks/use-copy-paste-cut.js +5 -0
  32. package/dist/cjs/hooks/use-create-formula-tokenizer.d.ts +1 -1
  33. package/dist/cjs/hooks/use-create-formula-tokenizer.d.ts.map +1 -1
  34. package/dist/cjs/release-date.js +1 -1
  35. package/dist/cjs/types.d.ts +2 -67
  36. package/dist/cjs/types.d.ts.map +1 -1
  37. package/dist/esm/api/scheduler.d.ts +1 -1
  38. package/dist/esm/api/scheduler.d.ts.map +1 -1
  39. package/dist/esm/api/scheduler.js +2 -2
  40. package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
  41. package/dist/esm/atoms/sheet-context.atom.d.ts +3 -3
  42. package/dist/esm/atoms/sheet-context.atom.d.ts.map +1 -1
  43. package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
  44. package/dist/esm/components/canvas-grid/index.js +1 -0
  45. package/dist/esm/components/canvas-grid/typings.d.ts +6 -3
  46. package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
  47. package/dist/esm/components/cell/index.d.ts.map +1 -1
  48. package/dist/esm/components/cell/index.js +1 -1
  49. package/dist/esm/components/cell-arrow/index.d.ts +7 -1
  50. package/dist/esm/components/cell-arrow/index.d.ts.map +1 -1
  51. package/dist/esm/components/cell-arrow/index.js +24 -2
  52. package/dist/esm/components/toolbar/text-horizontal-align-selector.d.ts +5 -0
  53. package/dist/esm/components/toolbar/text-horizontal-align-selector.d.ts.map +1 -1
  54. package/dist/esm/components/toolbar/text-horizontal-align-selector.js +29 -25
  55. package/dist/esm/components/toolbar/text-vertical-align-selector.d.ts +5 -0
  56. package/dist/esm/components/toolbar/text-vertical-align-selector.d.ts.map +1 -1
  57. package/dist/esm/components/toolbar/text-vertical-align-selector.js +23 -20
  58. package/dist/esm/components/toolbar/text-wrap-selector.d.ts +3 -0
  59. package/dist/esm/components/toolbar/text-wrap-selector.d.ts.map +1 -1
  60. package/dist/esm/components/toolbar/text-wrap-selector.js +30 -27
  61. package/dist/esm/config.d.ts +1 -1
  62. package/dist/esm/config.d.ts.map +1 -1
  63. package/dist/esm/config.js +1 -1
  64. package/dist/esm/hooks/use-context-setter.d.ts.map +1 -1
  65. package/dist/esm/hooks/use-context-setter.js +3 -1
  66. package/dist/esm/hooks/use-copy-paste-cut.d.ts.map +1 -1
  67. package/dist/esm/hooks/use-copy-paste-cut.js +5 -0
  68. package/dist/esm/hooks/use-create-formula-tokenizer.d.ts +1 -1
  69. package/dist/esm/hooks/use-create-formula-tokenizer.d.ts.map +1 -1
  70. package/dist/esm/release-date.js +1 -1
  71. package/dist/esm/types.d.ts +2 -67
  72. package/dist/esm/types.d.ts.map +1 -1
  73. package/package.json +6 -6
@@ -2,7 +2,7 @@ import React, { useCallback, 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
- export const CellArrow = ({ x = 0, y = 0, width = 0, height = 0, scale, rowIndex, columnIndex, onClick, verticalAlignment, }) => {
5
+ export const CellArrow = ({ x = 0, y = 0, width = 0, height = 0, scale, rowIndex, columnIndex, onClick, verticalAlignment, outside = false, }) => {
6
6
  const [isHovered, setIsHovered] = useState(false);
7
7
  const padding = getIconSpacing(verticalAlignment, height, ARROW_DOWN_WIDTH, scale, 2 * scale);
8
8
  const posX = x + width - ARROW_DOWN_WIDTH * scale - 2 * scale;
@@ -16,7 +16,29 @@ export const CellArrow = ({ x = 0, y = 0, width = 0, height = 0, scale, rowIndex
16
16
  const handleClick = () => {
17
17
  onClick?.({ rowIndex, columnIndex });
18
18
  };
19
- return (React.createElement(Group, { onClick: handleClick, onTap: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, perfectDrawEnabled: false },
19
+ // An arrow painted outside its cell (a list's, beside the active cell) is
20
+ // over the next cell, so the grid would select that cell and remove the
21
+ // arrow before a click or tap could complete on it. A mouse acts on
22
+ // mousedown and keeps it from the grid. A touch keeps its pointerdown from
23
+ // the grid (which selects on the tap's pointerup) and acts on the tap;
24
+ // preventing the pointerdown's default drops the compatibility mousedown,
25
+ // so the tap acts once.
26
+ const handleMouseDown = (e) => {
27
+ e.cancelBubble = true;
28
+ e.evt?.stopPropagation();
29
+ handleClick();
30
+ };
31
+ const handlePointerDown = (e) => {
32
+ if (e.evt?.pointerType !== "touch")
33
+ return;
34
+ e.cancelBubble = true;
35
+ e.evt.stopPropagation();
36
+ if (e.evt.cancelable)
37
+ e.evt.preventDefault();
38
+ };
39
+ return (React.createElement(Group, { ...(outside
40
+ ? { onMouseDown: handleMouseDown, onPointerDown: handlePointerDown }
41
+ : { onClick: handleClick }), onTap: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, perfectDrawEnabled: false },
20
42
  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 }),
21
43
  React.createElement(Path, { data: ARROW_DOWN_ICON_PATH, x: posX - 1.5 * scale, y: posY - 1.5 * scale, fill: isHovered ? "white" : ARROW_DOWN_COLOR, scaleY: 0.8 * scale, scaleX: 0.8 * scale, listening: true, perfectDrawEnabled: false })));
22
44
  };
@@ -13,6 +13,11 @@ export declare const EXTENDED_HORIZONTAL_ALIGNMENTS: ReadonlyArray<{
13
13
  value: HorizontalAlign;
14
14
  label: string;
15
15
  }>;
16
+ export declare const TextHorizontalAlignSelectorContent: ({ value, onChange, close, }: {
17
+ value: HorizontalAlign | undefined | null;
18
+ onChange(value: HorizontalAlign): void;
19
+ close(): void;
20
+ }) => React.JSX.Element;
16
21
  export declare const TextHorizontalAlignSelector: ({ value, onChange, disabled, }: TextHorizontalAlignSelectorProps) => React.JSX.Element;
17
22
  export {};
18
23
  //# sourceMappingURL=text-horizontal-align-selector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-horizontal-align-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-horizontal-align-selector.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,KAAK,gCAAgC,GAAG;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,aAAa,CAAC;IACzD,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAGA,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,gCAIzC,gCAAgC,sBA6FlC,CAAC"}
1
+ {"version":3,"file":"text-horizontal-align-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-horizontal-align-selector.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,KAAK,gCAAgC,GAAG;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,aAAa,CAAC;IACzD,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAGA,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAAI,6BAIhD;IACD,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IACvC,KAAK,IAAI,IAAI,CAAC;CACf,sBAqEA,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,gCAIzC,gCAAgC,sBAkClC,CAAC"}
@@ -12,41 +12,45 @@ export const EXTENDED_HORIZONTAL_ALIGNMENTS = [
12
12
  { value: "distributed", label: "Distributed" },
13
13
  { value: "fill", label: "Fill" },
14
14
  ];
15
- export const TextHorizontalAlignSelector = ({ value = "left", onChange, disabled, }) => {
15
+ export const TextHorizontalAlignSelectorContent = ({ value, onChange, close, }) => {
16
16
  const focusSheet = useFocusSheet();
17
- const [isOpen, onOpenChange] = useState(false);
18
- const close = () => onOpenChange(false);
19
17
  const select = (next) => {
20
18
  onChange(next);
21
19
  focusSheet?.();
22
20
  close();
23
21
  };
22
+ return (React.createElement(React.Fragment, null,
23
+ React.createElement(Stack, { direction: "horizontal", className: "gap-1 max-w-[140px] flex-wrap" },
24
+ React.createElement(IconButton, { size: "lg", isActive: value === "left", onClick: () => {
25
+ onChange("left");
26
+ focusSheet?.();
27
+ close();
28
+ } },
29
+ React.createElement(MdFormatAlignLeft, null)),
30
+ React.createElement(IconButton, { size: "lg", isActive: value === "center", onClick: () => {
31
+ onChange("center");
32
+ focusSheet?.();
33
+ close();
34
+ } },
35
+ React.createElement(MdFormatAlignCenter, null)),
36
+ React.createElement(IconButton, { size: "lg", isActive: value === "right", onClick: () => {
37
+ onChange("right");
38
+ focusSheet?.();
39
+ close();
40
+ } },
41
+ React.createElement(MdFormatAlignRight, null)),
42
+ React.createElement(IconButton, { size: "lg", tooltip: "Justify", "aria-label": "Justify", isActive: value === "justify", onClick: () => select("justify") },
43
+ React.createElement(MdFormatAlignJustify, null))),
44
+ React.createElement(Stack, { direction: "horizontal", className: "gap-1 pt-1 max-w-[140px]" }, EXTENDED_HORIZONTAL_ALIGNMENTS.map(({ value: option, label }) => (React.createElement(Button, { key: option, type: "button", variant: value === option ? "secondary" : "ghost", size: "xs", "aria-pressed": value === option, onClick: () => select(option) }, label))))));
45
+ };
46
+ export const TextHorizontalAlignSelector = ({ value = "left", onChange, disabled, }) => {
47
+ const [isOpen, onOpenChange] = useState(false);
48
+ const close = () => onOpenChange(false);
24
49
  return (React.createElement(Popover, { open: isOpen, onOpenChange: onOpenChange },
25
50
  React.createElement(PopoverTrigger, { asChild: true },
26
51
  React.createElement(IconButton, { size: "lg", tooltip: "Horizontal align", "aria-label": "Horizontal align", disabled: disabled },
27
52
  value === "right" ? (React.createElement(MdFormatAlignRight, null)) : value === "center" || value === "centerContinuous" ? (React.createElement(MdFormatAlignCenter, null)) : value === "justify" || value === "distributed" ? (React.createElement(MdFormatAlignJustify, null)) : (React.createElement(MdFormatAlignLeft, null)),
28
53
  React.createElement(MdOutlineArrowDropDown, null))),
29
54
  React.createElement(PopoverContent, { align: "start" },
30
- React.createElement(Stack, { direction: "horizontal", className: "gap-1 max-w-[140px] flex-wrap" },
31
- React.createElement(IconButton, { size: "lg", isActive: value === "left", onClick: () => {
32
- onChange("left");
33
- focusSheet?.();
34
- close();
35
- } },
36
- React.createElement(MdFormatAlignLeft, null)),
37
- React.createElement(IconButton, { size: "lg", isActive: value === "center", onClick: () => {
38
- onChange("center");
39
- focusSheet?.();
40
- close();
41
- } },
42
- React.createElement(MdFormatAlignCenter, null)),
43
- React.createElement(IconButton, { size: "lg", isActive: value === "right", onClick: () => {
44
- onChange("right");
45
- focusSheet?.();
46
- close();
47
- } },
48
- React.createElement(MdFormatAlignRight, null)),
49
- React.createElement(IconButton, { size: "lg", tooltip: "Justify", "aria-label": "Justify", isActive: value === "justify", onClick: () => select("justify") },
50
- React.createElement(MdFormatAlignJustify, null))),
51
- React.createElement(Stack, { direction: "horizontal", className: "gap-1 pt-1 max-w-[140px]" }, EXTENDED_HORIZONTAL_ALIGNMENTS.map(({ value: option, label }) => (React.createElement(Button, { key: option, type: "button", variant: value === option ? "secondary" : "ghost", size: "xs", "aria-pressed": value === option, onClick: () => select(option) }, label)))))));
55
+ React.createElement(TextHorizontalAlignSelectorContent, { value: value, onChange: onChange, close: close }))));
52
56
  };
@@ -4,6 +4,11 @@ type TextVerticalAlignSelectorProps = {
4
4
  value: VerticalAlign | undefined | null;
5
5
  onChange(value: VerticalAlign): void;
6
6
  };
7
+ export declare const TextVerticalAlignSelectorContent: ({ value, onChange, close, }: {
8
+ value?: VerticalAlign | null;
9
+ onChange(value: VerticalAlign): void;
10
+ close(): void;
11
+ }) => React.JSX.Element;
7
12
  export declare const TextVerticalAlignSelector: ({ value, onChange, }: TextVerticalAlignSelectorProps) => React.JSX.Element;
8
13
  export {};
9
14
  //# sourceMappingURL=text-vertical-align-selector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-vertical-align-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-vertical-align-selector.tsx"],"names":[],"mappings":"AASA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,sBAGvC,8BAA8B,sBA0DhC,CAAC"}
1
+ {"version":3,"file":"text-vertical-align-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-vertical-align-selector.tsx"],"names":[],"mappings":"AASA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,6BAI9C;IACD,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,KAAK,IAAI,IAAI,CAAC;CACf,sBAuCA,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,sBAGvC,8BAA8B,sBA2BhC,CAAC"}
@@ -4,8 +4,29 @@ import { Popover, PopoverContent, PopoverTrigger } from "@rowsncolumns/ui";
4
4
  import { Stack } from "@rowsncolumns/ui";
5
5
  import React, { useState } from "react";
6
6
  import { useFocusSheet } from "../../atoms";
7
- export const TextVerticalAlignSelector = ({ value = "bottom", onChange, }) => {
7
+ export const TextVerticalAlignSelectorContent = ({ value, onChange, close, }) => {
8
8
  const focusSheet = useFocusSheet();
9
+ return (React.createElement(Stack, { direction: "horizontal", className: "gap-1 flex-wrap max-w-[140px]" },
10
+ React.createElement(IconButton, { size: "lg", isActive: value === "top", onClick: () => {
11
+ onChange("top");
12
+ focusSheet?.();
13
+ close();
14
+ } },
15
+ React.createElement(MdVerticalAlignTop, null)),
16
+ React.createElement(IconButton, { size: "lg", isActive: value === "middle", onClick: () => {
17
+ onChange("middle");
18
+ focusSheet?.();
19
+ close();
20
+ } },
21
+ React.createElement(MdVerticalAlignCenter, null)),
22
+ React.createElement(IconButton, { size: "lg", isActive: value === "bottom", onClick: () => {
23
+ onChange("bottom");
24
+ focusSheet?.();
25
+ close();
26
+ } },
27
+ React.createElement(MdVerticalAlignBottom, null))));
28
+ };
29
+ export const TextVerticalAlignSelector = ({ value = "bottom", onChange, }) => {
9
30
  const [isOpen, onOpenChange] = useState(false);
10
31
  const close = () => onOpenChange(false);
11
32
  return (React.createElement(Popover, { open: isOpen, onOpenChange: onOpenChange },
@@ -14,23 +35,5 @@ export const TextVerticalAlignSelector = ({ value = "bottom", onChange, }) => {
14
35
  value === "top" ? (React.createElement(MdVerticalAlignTop, null)) : value === "middle" ? (React.createElement(MdVerticalAlignCenter, null)) : (React.createElement(MdVerticalAlignBottom, null)),
15
36
  React.createElement(MdOutlineArrowDropDown, null))),
16
37
  React.createElement(PopoverContent, { align: "start" },
17
- React.createElement(Stack, { direction: "horizontal", className: "gap-1 flex-wrap max-w-[140px]" },
18
- React.createElement(IconButton, { size: "lg", isActive: value === "top", onClick: () => {
19
- onChange("top");
20
- focusSheet?.();
21
- close();
22
- } },
23
- React.createElement(MdVerticalAlignTop, null)),
24
- React.createElement(IconButton, { size: "lg", isActive: value === "middle", onClick: () => {
25
- onChange("middle");
26
- focusSheet?.();
27
- close();
28
- } },
29
- React.createElement(MdVerticalAlignCenter, null)),
30
- React.createElement(IconButton, { size: "lg", isActive: value === "bottom", onClick: () => {
31
- onChange("bottom");
32
- focusSheet?.();
33
- close();
34
- } },
35
- React.createElement(MdVerticalAlignBottom, null))))));
38
+ React.createElement(TextVerticalAlignSelectorContent, { value: value, onChange: onChange, close: close }))));
36
39
  };
@@ -10,6 +10,9 @@ type TextWrapSelectorProps = {
10
10
  shrinkToFit?: boolean | null;
11
11
  onChangeShrinkToFit?(value: boolean): void;
12
12
  };
13
+ export declare const TextWrapSelectorContent: ({ value, onChange, shrinkToFit, onChangeShrinkToFit, close, }: TextWrapSelectorProps & {
14
+ close(): void;
15
+ }) => React.JSX.Element;
13
16
  export declare const TextWrapSelector: ({ value, onChange, shrinkToFit, onChangeShrinkToFit, }: TextWrapSelectorProps) => React.JSX.Element;
14
17
  export {};
15
18
  //# sourceMappingURL=text-wrap-selector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-wrap-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-wrap-selector.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,qBAAqB,GAAG;IAC3B,KAAK,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,mBAAmB,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wDAK9B,qBAAqB,sBAoFvB,CAAC"}
1
+ {"version":3,"file":"text-wrap-selector.d.ts","sourceRoot":"","sources":["../../../../components/toolbar/text-wrap-selector.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,qBAAqB,GAAG;IAC3B,KAAK,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,mBAAmB,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,+DAMrC,qBAAqB,GAAG;IACzB,KAAK,IAAI,IAAI,CAAC;CACf,sBA6DA,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wDAK9B,qBAAqB,sBAiCvB,CAAC"}
@@ -3,8 +3,36 @@ import { MdOutlineArrowDropDown } from "@rowsncolumns/icons";
3
3
  import { IconButton, Popover, PopoverContent, PopoverTrigger, Stack, } from "@rowsncolumns/ui";
4
4
  import React, { useState } from "react";
5
5
  import { useFocusSheet } from "../../atoms";
6
- export const TextWrapSelector = ({ value = "overflow", onChange, shrinkToFit, onChangeShrinkToFit, }) => {
6
+ export const TextWrapSelectorContent = ({ value, onChange, shrinkToFit, onChangeShrinkToFit, close, }) => {
7
7
  const focusSheet = useFocusSheet();
8
+ return (React.createElement(Stack, { direction: "horizontal", className: "flex-wrap gap-1 max-w-[140px]" },
9
+ React.createElement(IconButton, { size: "lg", isActive: value === "overflow", tooltip: "Overflow", onClick: () => {
10
+ onChange("overflow");
11
+ focusSheet?.();
12
+ close();
13
+ } },
14
+ React.createElement(TextOverflowIcon, null)),
15
+ React.createElement(IconButton, { size: "lg", isActive: value === "wrap", tooltip: "Wrap", onClick: () => {
16
+ onChange("wrap");
17
+ focusSheet?.();
18
+ close();
19
+ } },
20
+ React.createElement(TextOverflowWrapIcon, null)),
21
+ React.createElement(IconButton, { size: "lg", isActive: value === "clip", tooltip: "Clip", onClick: () => {
22
+ onChange("clip");
23
+ focusSheet?.();
24
+ close();
25
+ } },
26
+ React.createElement(TextoverflowClipIcon, null)),
27
+ onChangeShrinkToFit ? (React.createElement(IconButton, { size: "lg", isActive: !!shrinkToFit, "aria-pressed": !!shrinkToFit, tooltip: "Shrink text to fit the cell", "aria-label": "Shrink text to fit the cell", className: "w-full justify-start gap-1", onClick: () => {
28
+ onChangeShrinkToFit(!shrinkToFit);
29
+ focusSheet?.();
30
+ close();
31
+ } },
32
+ React.createElement(TextoverflowClipIcon, null),
33
+ React.createElement("span", { className: "text-xs" }, "Shrink to fit"))) : null));
34
+ };
35
+ export const TextWrapSelector = ({ value = "overflow", onChange, shrinkToFit, onChangeShrinkToFit, }) => {
8
36
  const [isOpen, onOpenChange] = useState(false);
9
37
  const close = () => onOpenChange(false);
10
38
  return (React.createElement(Popover, { open: isOpen, onOpenChange: onOpenChange },
@@ -13,30 +41,5 @@ export const TextWrapSelector = ({ value = "overflow", onChange, shrinkToFit, on
13
41
  value === "overflow" ? (React.createElement(TextOverflowIcon, null)) : value === "wrap" ? (React.createElement(TextOverflowWrapIcon, null)) : (React.createElement(TextoverflowClipIcon, null)),
14
42
  React.createElement(MdOutlineArrowDropDown, null))),
15
43
  React.createElement(PopoverContent, { align: "start" },
16
- React.createElement(Stack, { direction: "horizontal", className: "flex-wrap gap-1 max-w-[140px]" },
17
- React.createElement(IconButton, { size: "lg", isActive: value === "overflow", tooltip: "Overflow", onClick: () => {
18
- onChange("overflow");
19
- focusSheet?.();
20
- close();
21
- } },
22
- React.createElement(TextOverflowIcon, null)),
23
- React.createElement(IconButton, { size: "lg", isActive: value === "wrap", tooltip: "Wrap", onClick: () => {
24
- onChange("wrap");
25
- focusSheet?.();
26
- close();
27
- } },
28
- React.createElement(TextOverflowWrapIcon, null)),
29
- React.createElement(IconButton, { size: "lg", isActive: value === "clip", tooltip: "Clip", onClick: () => {
30
- onChange("clip");
31
- focusSheet?.();
32
- close();
33
- } },
34
- React.createElement(TextoverflowClipIcon, null)),
35
- onChangeShrinkToFit ? (React.createElement(IconButton, { size: "lg", isActive: !!shrinkToFit, "aria-pressed": !!shrinkToFit, tooltip: "Shrink text to fit the cell", "aria-label": "Shrink text to fit the cell", className: "w-full justify-start gap-1", onClick: () => {
36
- onChangeShrinkToFit(!shrinkToFit);
37
- focusSheet?.();
38
- close();
39
- } },
40
- React.createElement(TextoverflowClipIcon, null),
41
- React.createElement("span", { className: "text-xs" }, "Shrink to fit"))) : null))));
44
+ React.createElement(TextWrapSelectorContent, { value: value, onChange: onChange, shrinkToFit: shrinkToFit, onChangeShrinkToFit: onChangeShrinkToFit, close: close }))));
42
45
  };
@@ -4,7 +4,7 @@ import type { SpreadsheetTheme } from "./components/canvas-grid/typings";
4
4
  import type { OverlayPosition, TextFormat } from "./types";
5
5
  export declare const DEFAULT_ACTIVE_CELL: CellInterface;
6
6
  export declare const DEFAULT_SELECTIONS: readonly never[];
7
- export declare const DEFAULT_ARRAY: Array<any>;
7
+ export { DEFAULT_ARRAY } from "@rowsncolumns/utils";
8
8
  export declare const FROZEN_EMPTY_ARRAY: readonly never[];
9
9
  export declare const DEFAULT_SCROLL_POSITION: ScrollCoords;
10
10
  export declare const MAX_ROW_COUNT = 1048576;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"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EhH,eAAO,MAAM,aAAa,mBAyExB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,wDACiB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,mDACE,CAAC"}
@@ -4,7 +4,7 @@ export const DEFAULT_ACTIVE_CELL = Object.freeze({
4
4
  columnIndex: 1,
5
5
  });
6
6
  export const DEFAULT_SELECTIONS = Object.freeze([]);
7
- export const DEFAULT_ARRAY = [];
7
+ export { DEFAULT_ARRAY } from "@rowsncolumns/utils";
8
8
  export const FROZEN_EMPTY_ARRAY = DEFAULT_SELECTIONS;
9
9
  export const DEFAULT_SCROLL_POSITION = Object.freeze({
10
10
  scrollLeft: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"use-context-setter.d.ts","sourceRoot":"","sources":["../../../hooks/use-context-setter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,eAAO,MAAM,gBAAgB,GAC3B,cAAc,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,EACnD,cAAc,iBAAiB,SA6MhC,CAAC"}
1
+ {"version":3,"file":"use-context-setter.d.ts","sourceRoot":"","sources":["../../../hooks/use-context-setter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,eAAO,MAAM,gBAAgB,GAC3B,cAAc,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,EACnD,cAAc,iBAAiB,SAgNhC,CAAC"}
@@ -3,7 +3,7 @@ import { useSetSpreadsheetContext } from "../atoms/sheet-context.atom";
3
3
  import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect";
4
4
  export const useContextSetter = (forwardedRef, contextValue) => {
5
5
  const setSpreadsheetContext = useSetSpreadsheetContext();
6
- const { submitEditor, cancelEditor, commit, makeEditable, editCell, getNextFocusableCell, onEditorKeyDown, scrollToCell, scrollToChart, selectAllObjects, scrollToBottom, focusSheet, canEditCell, isSheetProtected, isWorkbookProtected, getSheetProtection, getSelectionsFromFormula, getAddressFromSelection, getR1C1AddressFromSelection, tokenizer, localeTokenizer, formulaLocale, referenceStyle, setEditorValue, getCellBounds, getTableNames, getStructuredProperties, getNamedRanges, getTableColumnNames, updateSelectionStartEndReference, getCellDimensions, getRowHeight, getContentfulGridRangeAroundCell, getCellCoordsFromOffset, getCellOffsetFromCoords, getEffectiveValuesFromRange, getSheetDimensions, getFinalRowHeight, getColumnWidth, getSheetId, getSheetName, onInsertNote, onPinToolTip, onUnpinTooltip, showCellPopover, showFilterMenu, redrawGrid, flash, navigateToSheetRange, mark, unmark, exportRange, getViewPort, setActiveCell, getGridRef, getMentions, dispatchEvent, splitTextToColumns, copy, cut, paste, } = contextValue;
6
+ const { submitEditor, cancelEditor, commit, makeEditable, editCell, getNextFocusableCell, onEditorKeyDown, scrollToCell, scrollToChart, selectAllObjects, scrollToBottom, focusSheet, canEditCell, isSheetProtected, isWorkbookProtected, getSheetProtection, getSelectionsFromFormula, getAddressFromSelection, getR1C1AddressFromSelection, tokenizer, localeTokenizer, formulaLocale, referenceStyle, setEditorValue, getCellBounds, getTableNames, getStructuredProperties, getNamedRanges, getTableColumnNames, updateSelectionStartEndReference, getCellDimensions, getRowHeight, getContentfulGridRangeAroundCell, getCellCoordsFromOffset, getCellOffsetFromCoords, getEffectiveCellFormat, getEffectiveValuesFromRange, getSheetDimensions, getFinalRowHeight, getColumnWidth, getSheetId, getSheetName, onInsertNote, onPinToolTip, onUnpinTooltip, showCellPopover, showFilterMenu, redrawGrid, flash, navigateToSheetRange, mark, unmark, exportRange, getViewPort, setActiveCell, getGridRef, getMentions, dispatchEvent, splitTextToColumns, copy, cut, paste, } = contextValue;
7
7
  // Expose grid methods in context and ref
8
8
  const imperativeHandleRefs = useMemo(() => ({
9
9
  submitEditor,
@@ -41,6 +41,7 @@ export const useContextSetter = (forwardedRef, contextValue) => {
41
41
  getContentfulGridRangeAroundCell,
42
42
  getCellCoordsFromOffset,
43
43
  getCellOffsetFromCoords,
44
+ getEffectiveCellFormat,
44
45
  getEffectiveValuesFromRange,
45
46
  getSheetDimensions,
46
47
  getFinalRowHeight,
@@ -103,6 +104,7 @@ export const useContextSetter = (forwardedRef, contextValue) => {
103
104
  getContentfulGridRangeAroundCell,
104
105
  getCellCoordsFromOffset,
105
106
  getCellOffsetFromCoords,
107
+ getEffectiveCellFormat,
106
108
  getEffectiveValuesFromRange,
107
109
  getSheetDimensions,
108
110
  getFinalRowHeight,
@@ -1 +1 @@
1
- {"version":3,"file":"use-copy-paste-cut.d.ts","sourceRoot":"","sources":["../../../hooks/use-copy-paste-cut.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcvE,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,uCAAuC,CAAC;AAK/C,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC;IAC1B;;OAEG;IACH,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,IAAI,IAAI,CAAC;IACnB;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CACpD,CAAC;AA8BF,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,SAAS,GACT,MAAM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AACxF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEzE,eAAO,MAAM,eAAe,GAAI,oGAU7B,oBAAoB;;;;2BA2ZG,mBAAmB;;IA4DzC,wEAAwE;;IAExE,kDAAkD;;;;wBAjS9C,cAAc;yBAqEd,cAAc;uBA3Bd,cAAc;kCA8HD,aAAa;CAkIjC,CAAC"}
@@ -145,6 +145,11 @@ export const useCopyPasteCut = ({ selections, activeCell, sheetId, readonly = fa
145
145
  return;
146
146
  if (/^(Arrow|Page|Home|End|Tab|Escape)/.test(e.key))
147
147
  return;
148
+ // A key pressed on the Paste Options button itself (Enter or Space to
149
+ // open it) keeps it.
150
+ if (e.target instanceof Element &&
151
+ e.target.closest('[data-testid="paste-options"]'))
152
+ return;
148
153
  setShowPasteMenu(false);
149
154
  };
150
155
  // Capture phase: the grid's own shortcuts stop propagation.
@@ -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"}
@@ -1,3 +1,3 @@
1
1
  export const releaseDate =
2
2
  // @ts-ignore
3
- new Date("2026-11-06") ?? new Date("2025-06-18");
3
+ new Date("2026-11-10") ?? new Date("2025-06-18");
@@ -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
@@ -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"). */