@sheetxl/react 0.8.0-beta.11 → 0.8.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/browser/esm/{94dxo1A-z8lgiiGw.mjs → B4mT3G7GHwgDYFGP.mjs} +2 -2
  2. package/browser/esm/{B26QVfjer2oY2ewK.mjs → BDlpRkuBok0Uu4Hn.mjs} +1 -1
  3. package/browser/esm/{CRi6DQ3UXmPEv-w_.mjs → BR-AiOwuQlYh5-tr.mjs} +147 -146
  4. package/browser/esm/{ClAtIfYbsUPA073B.mjs → BapujiblfiXDlu67.mjs} +1 -1
  5. package/browser/esm/{D2u6THGErqw64KQI.mjs → CSFORKZ8zrVL_Y0w.mjs} +1 -1
  6. package/browser/esm/{Bl2BFCQ00fotauKB.mjs → CUekkfE6uwwsdQpc.mjs} +1 -1
  7. package/browser/esm/{DgL7Dy-Lqcr1TvW6.mjs → C_LUq-BnguetvGZz.mjs} +4851 -4818
  8. package/browser/esm/{BQYS2Yf-EAV_tBLr.mjs → Ck1LbcsdSfKNi6xq.mjs} +1 -1
  9. package/browser/esm/{1-LEUre9ZLG0OYYB.mjs → Cslk_qRdBSuJIi1O.mjs} +6 -6
  10. package/browser/esm/CtGhA0kS2MCfEsHN.mjs +262 -0
  11. package/browser/esm/{BegvsXeRs7e-9t8k.mjs → D22NJmTiky4NL8tM.mjs} +1 -1
  12. package/browser/esm/{B93LSmhnvkxNXTq-.mjs → D2GydDzPuvIjdpok.mjs} +1 -1
  13. package/browser/esm/{CzRIbc-Lk__VMLKM.mjs → DGG1auUKsjFbAazu.mjs} +3 -3
  14. package/browser/esm/{Bos4Rkp8UTF7QXUB.mjs → DN3lqq95KY0K6f1x.mjs} +1 -1
  15. package/browser/esm/{Dnh1kpz3v1JKtRD_.mjs → D_usN3pWuCJU2GN-.mjs} +2 -2
  16. package/browser/esm/{cQ6xdPFkEcuDlNTN.mjs → DhYQRc8L2kALmFNz.mjs} +1 -1
  17. package/browser/esm/{DS66lAIM-9M-YoZQ.mjs → DxEczXCHTerDemDP.mjs} +112 -104
  18. package/browser/esm/{C1pc9F4Rt2C5FKUo.mjs → LBQDhVhz7S7i6a8i.mjs} +1 -1
  19. package/browser/esm/{CPnnESfZz2jjJd82.mjs → ZoS0cpNEBcv6p-Z1.mjs} +1 -1
  20. package/browser/esm/{DMdsMPT0fWBbTkNn.mjs → _6Sb6ElRcZftxMNh.mjs} +1 -1
  21. package/browser/esm/chart.mjs +28 -27
  22. package/browser/esm/control.mjs +2 -2
  23. package/browser/esm/group.mjs +3 -3
  24. package/browser/esm/index.mjs +5750 -5089
  25. package/browser/esm/note.mjs +4 -4
  26. package/browser/esm/picture.mjs +41 -41
  27. package/browser/esm/shape.mjs +2 -2
  28. package/browser/esm/slicer.mjs +4 -4
  29. package/node/esm/{BaRfst1euuhquupX.mjs → Apcuz4_QtBHt7G47.mjs} +1 -1
  30. package/node/esm/{b-XRVRI1fYQQMkTC.mjs → Bi2Jwc0zpweaNzKc.mjs} +525 -492
  31. package/node/esm/{D_pCpfdQowV_4Aje.mjs → C0KLMCRb3sbd5Q20.mjs} +5 -5
  32. package/node/esm/{sigD1UFqvPlWUw_9.mjs → CH1DVfFhjdd_3pw1.mjs} +2 -2
  33. package/node/esm/{Be9c1GwQkPo8Piuh.mjs → CNOLkUDURBElaaIf.mjs} +1 -1
  34. package/node/esm/{BiaDWnN3tT7neoRL.mjs → CalVk3o4-kX79s3v.mjs} +1 -1
  35. package/node/esm/{DgGEHydEjD7nfsDB.mjs → Cp1DuCae46eQKzWy.mjs} +1 -1
  36. package/node/esm/{BlxXufqBBg1PtsXd.mjs → CzN6c6KyxVmNvayz.mjs} +1 -1
  37. package/node/esm/{6zApGj9DozhFy-bx.mjs → DKqdv5JubgVaq-g9.mjs} +1 -1
  38. package/node/esm/{umljAT66yb3_rURh.mjs → DWkPWuf5ZrLRMixG.mjs} +118 -110
  39. package/node/esm/{JiQGhLkoL8CJpVvA.mjs → DXiNwr6ZnXBe7TlG.mjs} +1 -1
  40. package/node/esm/{DTMTIrYIK1eZswsM.mjs → DayGI0Bt57FDNbVF.mjs} +1 -1
  41. package/node/esm/{C_SNx7TlFEcwbYjx.mjs → DyetXBW7vFLJWB22.mjs} +1 -1
  42. package/node/esm/{Dj5FM7_-YWhCtCCt.mjs → MWges5ywL3aEdChp.mjs} +1 -1
  43. package/node/esm/{BMVK5plvmBOAIlxP.mjs → T5lfCrudsUnOTxEn.mjs} +1 -1
  44. package/node/esm/YB_qExw23Ci4nMYy.mjs +263 -0
  45. package/node/esm/{DxQZmb-j4NLUO9Af.mjs → bRD1KCpSpAYTEs50.mjs} +1 -1
  46. package/node/esm/chart.mjs +26 -25
  47. package/node/esm/control.mjs +2 -2
  48. package/node/esm/group.mjs +3 -3
  49. package/node/esm/{gpD-9LDW92phhoma.mjs → iL9jKJcnED6oi0B4.mjs} +1 -1
  50. package/node/esm/index.mjs +7658 -6996
  51. package/node/esm/note.mjs +4 -4
  52. package/node/esm/picture.mjs +41 -41
  53. package/node/esm/shape.mjs +50 -49
  54. package/node/esm/slicer.mjs +4 -4
  55. package/package.json +7 -7
  56. package/resources/locales/de/sheet.cmd.json +21 -0
  57. package/resources/locales/de/workbook.cmd.json +6 -0
  58. package/resources/locales/en/sheet.cmd.json +21 -0
  59. package/resources/locales/en/ui.msg.json +2 -0
  60. package/resources/locales/en/workbook.cmd.json +6 -0
  61. package/types/src/border/useBorders.d.ts +2 -2
  62. package/types/src/cell/CellCheckboxRenderer.d.ts +20 -0
  63. package/types/src/cell/CellContent.d.ts +68 -0
  64. package/types/src/cell/CellControlContext.d.ts +37 -0
  65. package/types/src/cell/{FormulaCellRenderer.d.ts → CellFormulaRenderer.d.ts} +5 -5
  66. package/types/src/cell/CellImageRenderer.d.ts +11 -0
  67. package/types/src/cell/CellRenderers.d.ts +190 -0
  68. package/types/src/cell/{SheetCellRenderer.d.ts → CellTextRenderer.d.ts} +9 -6
  69. package/types/src/cell/ColumnButton.d.ts +3 -3
  70. package/types/src/cell/OutlineButton.d.ts +4 -4
  71. package/types/src/cell/SheetHeaderRenderer.d.ts +1 -1
  72. package/types/src/cell/index.d.ts +8 -2
  73. package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
  74. package/types/src/cell/useInsertableCellControls.d.ts +25 -0
  75. package/types/src/chart/ChartEditor.d.ts +2 -0
  76. package/types/src/chart/ChartElement.d.ts +14 -3
  77. package/types/src/chart/paint/_mode.d.ts +6 -0
  78. package/types/src/chart/paint/echarts.d.ts +5 -2
  79. package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +8 -0
  80. package/types/src/chart/paint/toEChartsOption.d.ts +11 -0
  81. package/types/src/editableLabel/EditableLabel.d.ts +3 -1
  82. package/types/src/editor/SheetReferenceHeaderLayer.d.ts +1 -1
  83. package/types/src/editor/useFormulaHints.d.ts +1 -1
  84. package/types/src/layer/CellErrorLayer.d.ts +3 -2
  85. package/types/src/layer/CellIndicatorLayer.d.ts +31 -0
  86. package/types/src/layer/HeaderSelectionLayer.d.ts +4 -4
  87. package/types/src/layer/HyperlinkLayer.d.ts +8 -5
  88. package/types/src/layer/ProtectionLayer.d.ts +1 -2
  89. package/types/src/layer/SheetCellLayer.d.ts +11 -4
  90. package/types/src/layer/SheetMovableLayer.d.ts +2 -1
  91. package/types/src/layer/SheetOutlineLayer.d.ts +1 -1
  92. package/types/src/layer/TableLayer.d.ts +1 -1
  93. package/types/src/layer/TableToolbar.d.ts +1 -1
  94. package/types/src/layer/ValidationPromptLayer.d.ts +16 -4
  95. package/types/src/layer/index.d.ts +1 -0
  96. package/types/src/listener/useRangeListener.d.ts +13 -7
  97. package/types/src/movable/DefaultMovable.d.ts +1 -1
  98. package/types/src/movable/MovableControl.d.ts +3 -1
  99. package/types/src/movable/MovableFrame.d.ts +2 -1
  100. package/types/src/movable/MovableLayer.d.ts +6 -3
  101. package/types/src/sheet/ISheetHeaderElement.d.ts +2 -2
  102. package/types/src/sheet/IWorksheetElement.d.ts +21 -22
  103. package/types/src/sheet/SheetCommandProvider.d.ts +3 -0
  104. package/types/src/sheet/SheetOutlineElement.d.ts +2 -2
  105. package/types/src/sheet/SheetPanels.d.ts +2 -2
  106. package/types/src/tabStrip/Sortable.d.ts +5 -5
  107. package/types/src/tabStrip/TabStrip.d.ts +6 -6
  108. package/types/src/tabStrip/TabStripItem.d.ts +15 -13
  109. package/types/src/taskPane/CellControlPane.d.ts +17 -0
  110. package/types/src/taskPane/index.d.ts +1 -0
  111. package/types/src/taskPane/useTaskPane.d.ts +6 -3
  112. package/types/src/workbook/DefaultRenderers.d.ts +4 -4
  113. package/types/src/workbook/IWorkbookElement.d.ts +52 -20
  114. package/types/src/workbook/WorkbookStrip.d.ts +5 -5
  115. package/browser/esm/ugfE7YeZALQURDKF.mjs +0 -241
  116. package/node/esm/DJPgbB1X22YmhbaR.mjs +0 -242
@@ -0,0 +1,31 @@
1
+ import { default as React } from 'react';
2
+ import { IWorksheet } from '@sheetxl/sdk';
3
+ import { LayerProps } from '@sheetxl/grid-react';
4
+ export interface CellIndicatorLayerProps extends LayerProps {
5
+ /** Class for the layer (devtools identification). */
6
+ className?: string;
7
+ /** Style for the indicators host box. */
8
+ style?: React.CSSProperties;
9
+ /** The sheet whose cells are marked. */
10
+ sheet: IWorksheet;
11
+ /** Size (px, unzoomed) of the error triangle. @defaultValue 7 */
12
+ markSize?: number;
13
+ /** Height (px) of the pending bar. Not zoomed, like a gridline. @defaultValue 2 */
14
+ barHeight?: number;
15
+ }
16
+ /**
17
+ * The marks a cell's **result** earns: the error-checking triangle at the top left of a cell
18
+ * holding an error (or whose calculation failed), and the pending bar along the bottom of a cell
19
+ * whose result has not settled (`ICalculation.ResultStatus.Pending` / `Waiting`).
20
+ *
21
+ * @remarks
22
+ * A {@link CellTileDiv} over the cells in view, so the marks survive scroll and the cell renderer
23
+ * only paints text. The scan resolves only the calc state (and merges, for the box a mark sits
24
+ * in), never styles. `#BUSY!` and `#GETTING_DATA` take no triangle: they are placeholders for an
25
+ * answer still coming, not something to fix. A reference cycle has its own glyph (`CircularIndicatorLayer`); it takes the
26
+ * triangle only when iteration is off, when the cycle is an error (`ICell.getErrors`).
27
+ *
28
+ * Passive paint below the selection (`pointerEvents: none`).
29
+ */
30
+ export declare const CellIndicatorLayer: React.MemoExoticComponent<(props: CellIndicatorLayerProps) => React.JSX.Element | null>;
31
+ //# sourceMappingURL=CellIndicatorLayer.d.ts.map
@@ -49,11 +49,11 @@ export interface HeaderSelectionLayerProps extends LayerProps {
49
49
  */
50
50
  scrollIntoView?: (coords: Partial<CellCoords>) => void;
51
51
  /**
52
- * Render the selection accent (the header underline for selected rows/columns). Turn off for a picker
53
- * overlay, whose reference rectangles are drawn by `RangesPickerLayer` — the accent would compete.
54
- * @defaultValue true
52
+ * Hide the selection accent (the header underline for selected rows/columns). For a picker overlay,
53
+ * whose reference rectangles are drawn by `RangesPickerLayer` — the accent would compete.
54
+ * @defaultValue false
55
55
  */
56
- renderBorders?: boolean;
56
+ hideAccent?: boolean;
57
57
  /**
58
58
  * Keep the current focus on pointer-up instead of focusing the grid pane. On for a picker overlay used
59
59
  * while editing a formula (focusing the pane would blur the editor). @defaultValue false
@@ -29,10 +29,13 @@ export interface HyperlinkCardRenderProps {
29
29
  open: () => Promise<void>;
30
30
  /** Copy the address to the clipboard. */
31
31
  copy: () => Promise<void>;
32
- /** Select the cell and open the hyperlink editor. */
33
- edit: () => void;
34
- /** Remove the link; the cell's text stays. */
35
- remove: () => void;
32
+ /**
33
+ * Select the cell and open the hyperlink editor. Absent for a read-only link
34
+ * ({@link IHyperlink.isReadOnly}).
35
+ */
36
+ edit?: () => void;
37
+ /** Remove the link; the cell's text stays. Absent for a read-only link. */
38
+ remove?: () => void;
36
39
  /**
37
40
  * The linked page's preview once the lookup resolved, or `null` — see
38
41
  * {@link HyperlinkLayerProps.preview}. Draw its picture with {@link LinkPreviewImage}, which shows it
@@ -49,7 +52,7 @@ export interface HyperlinkCardRenderProps {
49
52
  export interface HyperlinkLayerProps extends Omit<LayerProps, 'children'> {
50
53
  sheet: IWorksheet;
51
54
  /** The card. @defaultValue the plain card: address · copy · edit · remove */
52
- renderCard?: (props: HyperlinkCardRenderProps) => React.ReactNode;
55
+ renderCard?: ((props: HyperlinkCardRenderProps) => React.ReactNode) | null;
53
56
  /**
54
57
  * Looks up a preview of the linked page to show under the actions. Off by default: it is a request to
55
58
  * a third party per hovered web link. {@link linkPreviewMicrolink} (the page's social card) and
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { RangeCoordValue } from '@sheetxl/utils';
3
2
  import { ICellRegion, IWorksheet, IWorksheetView } from '@sheetxl/sdk';
4
3
  import { LayerProps } from '@sheetxl/grid-react';
@@ -48,5 +47,5 @@ export interface ProtectionLayerProps extends LayerProps {
48
47
  *
49
48
  * Passive paint (`pointerEvents: none`), below the selection.
50
49
  */
51
- export declare const ProtectionLayer: React.MemoExoticComponent<(props: ProtectionLayerProps) => React.JSX.Element | null>;
50
+ export declare const ProtectionLayer: import('react').MemoExoticComponent<(props: ProtectionLayerProps) => import("react").JSX.Element | null>;
52
51
  //# sourceMappingURL=ProtectionLayer.d.ts.map
@@ -1,7 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
  import { IWorksheet, IWorksheetView } from '@sheetxl/sdk';
3
3
  import { CellRendererProps, IEditable, LayerProps } from '@sheetxl/grid-react';
4
- import { SheetCellRendererProps, ColumnButtonConfigProps } from '../cell';
4
+ import { CellTextRendererProps, ColumnButtonConfigProps } from '../cell';
5
+ import { EditRejectedNotice } from '../editor/useEditRejectedNotice';
5
6
  export interface SheetCellLayerProps extends LayerProps {
6
7
  /** Class for the layer (devtools identification). */
7
8
  className?: string;
@@ -10,7 +11,7 @@ export interface SheetCellLayerProps extends LayerProps {
10
11
  /** The sheet view — drives show-zeros / show-formulas (which cells are worth rendering). */
11
12
  sheetView: IWorksheetView;
12
13
  /**
13
- * Custom per-cell renderer. Default: {@link SheetCellRenderer} wired to the sheet (doc theme,
14
+ * Custom per-cell renderer. Default: {@link CellTextRenderer} wired to the sheet (doc theme,
14
15
  * hyperlink taps, formula-view flags) — the layer owns cell styling, so most hosts never pass this.
15
16
  */
16
17
  renderCell?: (props: CellRendererProps) => React.ReactNode;
@@ -19,13 +20,19 @@ export interface SheetCellLayerProps extends LayerProps {
19
20
  * column-button members ride along on the shared type but are consumed by
20
21
  * `SheetColumnButtonLayer`, not here — they are stripped before the spread.
21
22
  */
22
- propsCellRender?: Partial<SheetCellRendererProps> & ColumnButtonConfigProps;
23
+ propsCellRender?: Partial<CellTextRendererProps> & ColumnButtonConfigProps;
23
24
  /**
24
25
  * The shared editable. Subscribed so the edited cell is suppressed while its editor is open —
25
26
  * via the layer's live CSS channel (`suppressCell`), so no tile is ever invalidated by an edit
26
27
  * start/stop and the grid above is never touched.
27
28
  */
28
29
  editable: IEditable<any, any, any>;
30
+ /**
31
+ * Told when a cell control's write is refused, as a click on a checkbox in a locked cell is.
32
+ * Share the host's callback ({@link useEditRejectedNotice}) so every pane forms one notice scope.
33
+ * @defaultValue this layer's own {@link useEditRejectedNotice}
34
+ */
35
+ onEditRejected?: EditRejectedNotice;
29
36
  }
30
37
  /**
31
38
  * The sheet's cell layer.
@@ -41,7 +48,7 @@ export interface SheetCellLayerProps extends LayerProps {
41
48
  * - the edited cell is suppressed while its editor is open (live CSS `suppressCell` channel);
42
49
  * - **formula view** ({@link IWorksheetView.isShowFormulas}): when the selection anchor sits on a
43
50
  * formula cell, that cell's plain snapshot is suppressed through the SAME channel and a
44
- * tokenized, syntax-colored {@link FormulaCellRenderer} overlay is drawn in its place — the
51
+ * tokenized, syntax-colored {@link CellFormulaRenderer} overlay is drawn in its place — the
45
52
  * references themselves are outlined by `SheetReferenceLayer`, both keyed off
46
53
  * {@link useFormulaViewAnchor} so text and rectangles share colors.
47
54
  */
@@ -1,6 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { IWorksheet } from '@sheetxl/sdk';
3
3
  import { LayerProps } from '@sheetxl/grid-react';
4
+ import { RenderSlotFn } from '@sheetxl/utils-react';
4
5
  import { IMovableLayerElement, MovableLayerProps, MovableElementProps } from '../movable';
5
6
  export interface SheetMovableLayerProps extends LayerProps {
6
7
  /** Class forwarded to the inner layer's host box (devtools identification). */
@@ -12,7 +13,7 @@ export interface SheetMovableLayerProps extends LayerProps {
12
13
  * @param props The props for the movable element
13
14
  * @returns The rendered movable element
14
15
  */
15
- renderMovable: (props: MovableElementProps) => React.ReactElement;
16
+ renderMovable: RenderSlotFn<MovableElementProps>;
16
17
  /**
17
18
  * Props to pass to MovableLayer
18
19
  */
@@ -10,7 +10,7 @@ export interface SheetOutlineLayerProps extends LayerProps {
10
10
  /** The lanes across the gutter: one per level, plus one. */
11
11
  lanes: number;
12
12
  /** Renders a group's collapse / expand button. Defaults to `OutlineButton`. */
13
- renderButton?: (props: OutlineButtonProps) => React.ReactNode;
13
+ renderButton?: ((props: OutlineButtonProps) => React.ReactNode) | null;
14
14
  /**
15
15
  * The space around the buttons, in pixels: between neighbors, before the first and after the last.
16
16
  *
@@ -11,7 +11,7 @@ export interface TableLayerProps extends LayerProps {
11
11
  * The toolbar that floats at a hovered table's top-right corner.
12
12
  * @defaultValue a plain split button: edit the table · a menu of the table commands
13
13
  */
14
- renderToolbar?: (props: TableToolbarRenderProps) => React.ReactNode;
14
+ renderToolbar?: ((props: TableToolbarRenderProps) => React.ReactNode) | null;
15
15
  }
16
16
  /**
17
17
  * Is the outline, resizer, and row selection.
@@ -22,7 +22,7 @@ export interface TableToolbarFloatProps {
22
22
  sheet: IWorksheet;
23
23
  /** The table under the pointer, as the table layer's hover found it. */
24
24
  hovered: ITable | null;
25
- renderToolbar?: (props: TableToolbarRenderProps) => React.ReactNode;
25
+ renderToolbar?: ((props: TableToolbarRenderProps) => React.ReactNode) | null;
26
26
  }
27
27
  /**
28
28
  * The **table toolbar** — hover a table and its commands float at its top-right corner: a quick action
@@ -36,14 +36,26 @@ export interface ValidationPromptLayerProps extends Omit<LayerProps, 'children'>
36
36
  offset?: number;
37
37
  /**
38
38
  * Render the prompt yourself. Spread `floatProps` on the returned element. Omit for the default
39
- * box: the title in bold over the message.
39
+ * box: the title in bold over the message; `null` for none.
40
40
  */
41
- renderPrompt?: (prompt: ValidationPrompt, floatProps: React.HTMLAttributes<HTMLElement>) => React.ReactNode;
41
+ renderPrompt?: ((props: ValidationPromptRenderProps) => React.ReactNode) | null;
42
42
  /**
43
43
  * Render the alert yourself. Spread `floatProps` on the returned element. Omit for the default
44
- * card: the rule's alert title and message, and what to do next.
44
+ * card: the rule's alert title and message, and what to do next; `null` for none.
45
45
  */
46
- renderAlert?: (alert: ValidationAlert, floatProps: React.HTMLAttributes<HTMLElement>) => React.ReactNode;
46
+ renderAlert?: ((props: ValidationAlertRenderProps) => React.ReactNode) | null;
47
+ }
48
+ /** What {@link ValidationPromptLayerProps.renderPrompt} is handed. */
49
+ export interface ValidationPromptRenderProps {
50
+ prompt: ValidationPrompt;
51
+ /** Spread on the returned element: its placement and pointer handling. */
52
+ floatProps: React.HTMLAttributes<HTMLElement>;
53
+ }
54
+ /** What {@link ValidationPromptLayerProps.renderAlert} is handed. */
55
+ export interface ValidationAlertRenderProps {
56
+ alert: ValidationAlert;
57
+ /** Spread on the returned element: its placement and pointer handling. */
58
+ floatProps: React.HTMLAttributes<HTMLElement>;
47
59
  }
48
60
  /**
49
61
  * The **input prompt** of a data validation, and the **alert** an entry raised in its place — one
@@ -25,6 +25,7 @@ export * from './ValidationDropdownLayer';
25
25
  export * from './ValidationPromptLayer';
26
26
  export * from './useValidationPicker';
27
27
  export * from './CircularIndicatorLayer';
28
+ export * from './CellIndicatorLayer';
28
29
  export * from './CommentsLayer';
29
30
  export * from './CommentCardLayer';
30
31
  export * from './RangeAnnotationLayer';
@@ -1,15 +1,21 @@
1
1
  import { ICellRange } from '@sheetxl/sdk';
2
- export interface useRangeListenerOptions extends ICellRange.ListenerOptions {
3
- fireOnAddressChange: boolean;
4
- }
2
+ export type useRangeListenerOptions = ICellRange.ListenerOptions;
5
3
  export interface RangeContainer {
6
4
  getRange(address: ICellRange.Address, options?: ICellRange.GetRangeOptions): ICellRange;
7
5
  }
8
6
  /**
9
- * This hook delegates to the an model that contains a getRange(address) method.
7
+ * Listen to a range of `model` for as long as the component is mounted.
8
+ *
9
+ * @param model What the range is read from: a workbook or a sheet.
10
+ * @param address The range to listen to. Nothing is listened to while it is `null`.
11
+ * @param listener Called with each {@link ICellRange.Event}. The latest render's listener is the
12
+ * one called, so it may close over state without re-subscribing.
13
+ * @param options Which events to hear and how the range follows inserts and deletes
14
+ * ({@link ICellRange.ListenerOptions}). Read once per subscription.
10
15
  *
11
- * @param model
12
- * @param listener
16
+ * @remarks
17
+ * The subscription is renewed when `model` or `address` changes. Nothing is delivered for that
18
+ * renewal: the listener only hears what the range itself reports.
13
19
  */
14
- export declare const useRangeListener: (model: RangeContainer, address: ICellRange.Address, listener: ICellRange.Listener, options?: useRangeListenerOptions) => void;
20
+ export declare const useRangeListener: (model: RangeContainer | null | undefined, address: ICellRange.Address | null | undefined, listener: ICellRange.Listener, options?: useRangeListenerOptions) => void;
15
21
  //# sourceMappingURL=useRangeListener.d.ts.map
@@ -4,5 +4,5 @@ import { MovableElementProps } from './IMovableArea';
4
4
  * Renders a movable with the renderer for its kind of content, or a placeholder for a kind with
5
5
  * none. The default `renderMovable` of a sheet element.
6
6
  */
7
- export declare const renderDefaultMovable: (props: MovableElementProps) => React.ReactElement;
7
+ export declare const defaultRenderMovable: (props: MovableElementProps) => React.ReactElement;
8
8
  //# sourceMappingURL=DefaultMovable.d.ts.map
@@ -2,11 +2,13 @@ import { default as React } from 'react';
2
2
  import { IMovable } from '@sheetxl/sdk';
3
3
  import { ResizeDirection } from './geometry';
4
4
  import { MovablePreview } from './framePlacement';
5
+ /** A resize handle by its compass name, as `MovableLayerProps.resizeDirections` lists them. */
6
+ export type ResizeDirectionName = 'nw' | 'n' | 'ne' | 'w' | 'e' | 'sw' | 's' | 'se';
5
7
  /** The resize cursor for a handle on a frame turned `rotation` degrees, so it follows the turn. */
6
8
  export declare const resizeCursor: (direction: ResizeDirection, rotation: number) => string;
7
9
  export interface MovableControlProps {
8
10
  /** Compass names of the handles to draw (`nw`, `n`, … `se`). */
9
- directions: readonly string[];
11
+ directions: readonly ResizeDirectionName[];
10
12
  /** Degrees clockwise the frame is turned; only the cursors use it, the box turns itself. */
11
13
  rotation: number;
12
14
  /**
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { IMovable } from '@sheetxl/sdk';
3
+ import { RenderSlotFn } from '@sheetxl/utils-react';
3
4
  import { MovableElementProps } from './IMovableArea';
4
5
  import { MovableGestureHost } from './MovableControl';
5
6
  import { MovablePreview } from './framePlacement';
@@ -14,7 +15,7 @@ export interface MovableFrameProps extends React.HTMLAttributes<HTMLElement> {
14
15
  * @param props - {@link MovableElementProps}
15
16
  * @returns A React Element representing the IMovable.
16
17
  */
17
- renderMovable: (props: MovableElementProps) => React.ReactElement;
18
+ renderMovable: RenderSlotFn<MovableElementProps>;
18
19
  onRefLoad: (ref: HTMLElement) => void;
19
20
  onRefUnload: (ref: HTMLElement) => void;
20
21
  onHide: (hide: (movable: IMovable) => boolean | Promise<boolean> | void) => void;
@@ -1,7 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
  import { Bounds } from '@sheetxl/utils';
3
3
  import { IMovableCollection, IMovableSelection, IMovable } from '@sheetxl/sdk';
4
+ import { RenderSlotFn } from '@sheetxl/utils-react';
4
5
  import { MovableElementProps } from './IMovableArea';
6
+ import { ResizeDirectionName } from './MovableControl';
5
7
  export interface MovableLayerAttributes {
6
8
  /**
7
9
  * Will put focus on the the movable object.
@@ -45,7 +47,7 @@ export interface MovableLayerProps extends React.HTMLAttributes<HTMLDivElement>
45
47
  * @param props MovableElementProps
46
48
  * @returns A React Element representing the IMovable.
47
49
  */
48
- renderMovable: (props: MovableElementProps) => React.ReactElement;
50
+ renderMovable: RenderSlotFn<MovableElementProps>;
49
51
  /**
50
52
  * Called when the final movable is unselected.
51
53
  */
@@ -72,9 +74,10 @@ export interface MovableLayerProps extends React.HTMLAttributes<HTMLDivElement>
72
74
  */
73
75
  disableResize?: boolean;
74
76
  /**
75
- * Provider the anchor element to render.
77
+ * The resize handles to show, by compass name.
78
+ * @defaultValue all eight
76
79
  */
77
- renderDirections?: string[];
80
+ resizeDirections?: ResizeDirectionName[];
78
81
  /**
79
82
  * Called after the first render of a movable.
80
83
  */
@@ -3,7 +3,7 @@ import { FixedEdge } from '@sheetxl/utils';
3
3
  import { ISheetHeader } from '@sheetxl/sdk';
4
4
  import { Viewport, ThemeMode } from '@sheetxl/utils-react';
5
5
  import { IGridSurface } from '@sheetxl/grid-react';
6
- import { SheetCellRendererProps, ColumnButtonConfigProps } from '../cell';
6
+ import { CellTextRendererProps, ColumnButtonConfigProps } from '../cell';
7
7
  import { SheetLocation } from './IWorksheetElement';
8
8
  /**
9
9
  * Props for the SheetHeaderElement component.
@@ -108,7 +108,7 @@ export interface SheetHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
108
108
  * This is used to customize columnButton popup action and any other customizations desired.
109
109
  * This does not invalidate the rendering.
110
110
  */
111
- propsCellRender?: Partial<SheetCellRendererProps> & ColumnButtonConfigProps;
111
+ propsCellRender?: Partial<CellTextRendererProps> & ColumnButtonConfigProps;
112
112
  /**
113
113
  * Ref for the HTMLDivElement.
114
114
  */
@@ -1,13 +1,12 @@
1
1
  import { IWorksheet, ICell, IMovable } from '@sheetxl/sdk';
2
- import { ViewportMetrics, ScrollPaneProps, Viewport, ThemeMode, LoadingPanelProps, ErrorPanelProps } from '@sheetxl/utils-react';
2
+ import { ViewportMetrics, ScrollPaneProps, Viewport, ThemeMode, LoadingPanelProps, ErrorPanelProps, RenderSlotFn } from '@sheetxl/utils-react';
3
3
  import { GridSurfaceProps, IGridSurface, IEditable, LayerNode } from '@sheetxl/grid-react';
4
- import { SheetCellRendererProps, ColumnButtonConfigProps, OutlineProps } from '../cell';
4
+ import { CellTextRendererProps, ColumnButtonConfigProps, OutlineProps } from '../cell';
5
5
  import { MovableElementProps } from '../movable';
6
6
  import { CommentCardRenderProps } from '../comment';
7
7
  import { HyperlinkCardRenderProps, HyperlinkLayerProps } from '../layer/HyperlinkLayer';
8
8
  import { CellErrorTip } from '../layer/CellErrorLayer';
9
- import { ValidationPrompt } from '../layer/ValidationPromptLayer';
10
- import { ValidationAlert } from '../editor/validationAlert';
9
+ import { ValidationPromptRenderProps, ValidationAlertRenderProps } from '../layer/ValidationPromptLayer';
11
10
  import { TableToolbarRenderProps } from '../layer/TableToolbar';
12
11
  import { CommandContext } from '../frame';
13
12
  import { ISheetHeaderElement, SheetHeaderProps } from './ISheetHeaderElement';
@@ -55,12 +54,12 @@ export interface WorksheetElementProps extends React.HTMLAttributes<HTMLDivEleme
55
54
  * Custom loading panel, shown while a `Promise` {@link WorksheetElementProps.sheet} resolves or the
56
55
  * text engine loads. Defaults to a spinner.
57
56
  */
58
- renderSheetLoading?: (props: LoadingPanelProps) => React.ReactElement;
57
+ renderSheetLoading?: RenderSlotFn<LoadingPanelProps> | null;
59
58
  /**
60
59
  * Custom error panel, shown when a `Promise` {@link WorksheetElementProps.sheet} fails to resolve.
61
60
  * Defaults to a minimal message.
62
61
  */
63
- renderSheetError?: (props: ErrorPanelProps) => React.ReactElement;
62
+ renderSheetError?: RenderSlotFn<ErrorPanelProps> | null;
64
63
  /**
65
64
  * The app (chrome / header) color scheme — selects the header/app surface mode.
66
65
  */
@@ -149,52 +148,52 @@ export interface WorksheetElementProps extends React.HTMLAttributes<HTMLDivEleme
149
148
  */
150
149
  viewportComponent?: React.ReactNode;
151
150
  /**
152
- * Render components for movable elements.
151
+ * Render a movable element (a chart, shape or picture).
153
152
  *
154
153
  * @param props - {@link MovableElementProps}
155
- * @returns A React Element representing the IMovable.
156
154
  */
157
- renderMovable?: (props: MovableElementProps) => React.ReactElement;
155
+ renderMovable?: RenderSlotFn<MovableElementProps>;
158
156
  /**
159
157
  * Renders the card of a threaded comment beside its cell: on hover, on selection, and as a draft
160
- * when a command asks for one. Omit to show no card; the indicators are drawn either way.
158
+ * when a command asks for one. The default shows no card; the indicators are drawn either way.
161
159
  *
162
160
  * @param props - {@link CommentCardRenderProps}
163
161
  */
164
- renderCommentCard?: (props: CommentCardRenderProps) => React.ReactNode;
162
+ renderCommentCard?: RenderSlotFn<CommentCardRenderProps> | null;
165
163
  /**
166
164
  * Renders the card beside a hovered hyperlink cell: its address, copy, edit and remove. Omit for the
167
- * plain default card.
165
+ * plain default card; `null` for none.
168
166
  *
169
167
  * @param props - {@link HyperlinkCardRenderProps}
170
168
  */
171
- renderHyperlinkCard?: (props: HyperlinkCardRenderProps) => React.ReactNode;
169
+ renderHyperlinkCard?: RenderSlotFn<HyperlinkCardRenderProps> | null;
172
170
  /** The hyperlink card's options — e.g. `preview` to show a picture of the linked page. */
173
171
  propsHyperlink?: Omit<HyperlinkLayerProps, 'sheet' | 'renderCard'>;
174
172
  /**
175
173
  * Renders the tip beside a hovered cell that carries an error, a warning, a reference cycle or a
176
- * failed validation. Omit for the plain default tip.
174
+ * failed validation. Omit for the plain default tip; `null` for none.
177
175
  *
178
176
  * @param tip - {@link CellErrorTip}
179
177
  */
180
- renderCellErrorTip?: (tip: CellErrorTip) => React.ReactNode;
178
+ renderCellErrorTip?: RenderSlotFn<CellErrorTip> | null;
181
179
  /**
182
180
  * Renders the input prompt of a data validation under the selected cell. Spread `floatProps` on
183
- * the returned element. Omit for the plain default box: the title in bold over the message.
181
+ * the returned element. Omit for the plain default box: the title in bold over the message; `null`
182
+ * for none.
184
183
  */
185
- renderValidationPrompt?: (prompt: ValidationPrompt, floatProps: React.HTMLAttributes<HTMLElement>) => React.ReactNode;
184
+ renderValidationPrompt?: RenderSlotFn<ValidationPromptRenderProps> | null;
186
185
  /**
187
186
  * Renders the alert a refused or questioned entry raises in the prompt's place. Spread `floatProps`
188
- * on the returned element. Omit for the plain default card.
187
+ * on the returned element. Omit for the plain default card; `null` for none.
189
188
  */
190
- renderValidationAlert?: (alert: ValidationAlert, floatProps: React.HTMLAttributes<HTMLElement>) => React.ReactNode;
189
+ renderValidationAlert?: RenderSlotFn<ValidationAlertRenderProps> | null;
191
190
  /**
192
191
  * Renders the toolbar that floats at a hovered table's top-right corner: a quick action and a
193
- * dropdown of the table's commands. Omit for the plain default split button.
192
+ * dropdown of the table's commands. Omit for the plain default split button; `null` for none.
194
193
  *
195
194
  * @param props - {@link TableToolbarRenderProps}
196
195
  */
197
- renderTableToolbar?: (props: TableToolbarRenderProps) => React.ReactNode;
196
+ renderTableToolbar?: RenderSlotFn<TableToolbarRenderProps> | null;
198
197
  /**
199
198
  * Render element(s) directly onto the `GridSurface`, bottom → top — the same {@link LayerNode} the
200
199
  * grid takes for its children (a node or an array of them). Each layer reads its pane from context
@@ -215,7 +214,7 @@ export interface WorksheetElementProps extends React.HTMLAttributes<HTMLDivEleme
215
214
  * This is used to customize columnButton popup action and any other customizations desired.
216
215
  * This does not invalidate the rendering
217
216
  */
218
- propsCellRender?: Partial<SheetCellRendererProps> & ColumnButtonConfigProps;
217
+ propsCellRender?: Partial<CellTextRendererProps> & ColumnButtonConfigProps;
219
218
  /**
220
219
  * Props for the outline: the gutters that show row and column groups, and their level buttons.
221
220
  *
@@ -7,6 +7,9 @@ import { SheetCommandData } from './SheetCommands';
7
7
  * ready-mode `'startEdit'` insert commands). */
8
8
  export interface SheetCommandContributorData extends SheetCommandData {
9
9
  editable?: SheetEditable | null;
10
+ /** Set when the sheet owns `manager` (no workbook above publishes one): the sheet then also contributes
11
+ * `undo`/`redo`, which a workbook otherwise authors. */
12
+ ownsUndo?: boolean;
10
13
  }
11
14
  /**
12
15
  * The `sheet` feature's command contributor: `static` seeds the catalog presentation; `dynamic` attaches the
@@ -19,7 +19,7 @@ export interface SheetOutlineElementProps extends React.HTMLAttributes<HTMLEleme
19
19
  /** The app color scheme. */
20
20
  colorScheme?: ThemeMode;
21
21
  /** Renders a group's collapse / expand button. Defaults to `OutlineButton`. */
22
- renderButton?: (props: OutlineButtonProps) => React.ReactNode;
22
+ renderButton?: ((props: OutlineButtonProps) => React.ReactNode) | null;
23
23
  /** The space around the buttons, in pixels: between neighbors, before the first and after the last. */
24
24
  laneGap?: number;
25
25
  /** Space between a bracket's end and its button, in pixels. */
@@ -56,7 +56,7 @@ export interface SheetOutlineLevelsProps extends React.HTMLAttributes<HTMLElemen
56
56
  /** The app color scheme. */
57
57
  colorScheme?: ThemeMode;
58
58
  /** Renders a level button. Defaults to `OutlineLevelButton`. */
59
- renderLevelButton?: (props: OutlineLevelButtonProps) => React.ReactNode;
59
+ renderLevelButton?: ((props: OutlineLevelButtonProps) => React.ReactNode) | null;
60
60
  }
61
61
  /**
62
62
  * The level buttons `1`..`n` for one axis: button *k* shows the groups above level *k* and collapses
@@ -3,9 +3,9 @@ import { ErrorPanelProps, LoadingPanelProps } from '@sheetxl/utils-react';
3
3
  /**
4
4
  * The default loading panel of a sheet or workbook element: a spinner, centered.
5
5
  */
6
- export declare const renderSheetLoading: (props: LoadingPanelProps) => React.ReactElement;
6
+ export declare const defaultRenderSheetLoading: (props: LoadingPanelProps) => React.ReactElement;
7
7
  /**
8
8
  * The default error panel of a sheet or workbook element: the error's message, centered.
9
9
  */
10
- export declare const renderSheetError: (props: ErrorPanelProps) => React.ReactElement;
10
+ export declare const defaultRenderSheetError: (props: ErrorPanelProps) => React.ReactElement;
11
11
  //# sourceMappingURL=SheetPanels.d.ts.map
@@ -1,6 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
  import { CollisionDetection, DragStartEvent, DropAnimation, KeyboardCoordinateGetter, Modifiers, MeasuringConfiguration, PointerActivationConstraint, UniqueIdentifier } from '@dnd-kit/core';
3
3
  import { arrayMove, SortingStrategy, AnimateLayoutChanges, NewIndexGetter } from '@dnd-kit/sortable';
4
+ import { RenderSlotFn } from '@sheetxl/utils-react';
5
+ import { TabStripItemRenderProps } from './TabStripItem';
4
6
  export interface SortableProps {
5
7
  className?: string;
6
8
  activationConstraint?: PointerActivationConstraint;
@@ -15,11 +17,9 @@ export interface SortableProps {
15
17
  onMove?: (indexFrom: number, indexTo: number) => void;
16
18
  measuring?: MeasuringConfiguration;
17
19
  modifiers?: Modifiers;
18
- renderItem?: any;
20
+ renderItem?: (props: TabStripItemRenderProps) => React.ReactNode;
19
21
  removable?: boolean;
20
- renderDivider?: (props: React.HTMLAttributes<HTMLElement> & {
21
- key: string;
22
- }) => React.ReactElement;
22
+ renderDivider?: RenderSlotFn<React.HTMLAttributes<HTMLElement>>;
23
23
  reorderItems?: typeof arrayMove;
24
24
  strategy?: SortingStrategy;
25
25
  style?: React.CSSProperties;
@@ -54,7 +54,7 @@ interface SortableItemProps {
54
54
  useDragOverlay?: boolean;
55
55
  onRemove?(id: string): void;
56
56
  style(values: any): React.CSSProperties;
57
- renderItem?(args: any): React.ReactElement;
57
+ renderItem?(props: TabStripItemRenderProps): React.ReactNode;
58
58
  wrapperStyle({ index, isDragging, id, }: {
59
59
  index: number;
60
60
  isDragging: boolean;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ScrollButtonProps } from '@sheetxl/utils-react';
2
+ import { RenderSlotFn, ScrollButtonProps } from '@sheetxl/utils-react';
3
3
  import { EditableLabelProps } from '../editableLabel';
4
4
  import { TabProps } from './Tab';
5
5
  export interface TabStripRef extends HTMLDivElement {
@@ -12,11 +12,11 @@ export interface TabStripProps extends Omit<React.HTMLAttributes<HTMLDivElement>
12
12
  onSelectedTabIndexChange?: (index: number) => void;
13
13
  onTabNameChange?: (index: number, tabName: string) => void;
14
14
  onTabMove?: (indexFrom: number, indexTo: number) => void;
15
- renderScrollButtonStart?: ((props: ScrollButtonProps) => React.ReactElement) | null;
16
- renderScrollButtonEnd?: ((props: ScrollButtonProps) => React.ReactElement) | null;
17
- renderScrollButtonEdge?: ((props: ScrollButtonProps) => React.ReactElement) | null;
18
- renderTabButton?: (props: TabProps) => React.ReactElement<any>;
19
- renderTabDivider?: (props: React.HTMLAttributes<HTMLElement> & React.Attributes) => React.ReactElement;
15
+ renderScrollButtonStart?: RenderSlotFn<ScrollButtonProps> | null;
16
+ renderScrollButtonEnd?: RenderSlotFn<ScrollButtonProps> | null;
17
+ renderScrollButtonEdge?: RenderSlotFn<ScrollButtonProps> | null;
18
+ renderTabButton?: RenderSlotFn<TabProps>;
19
+ renderTabDivider?: RenderSlotFn<React.HTMLAttributes<HTMLElement>>;
20
20
  propsEditLabel?: EditableLabelProps;
21
21
  disabled?: boolean;
22
22
  disableDrag?: boolean;
@@ -18,19 +18,21 @@ export interface TabStripItemProps {
18
18
  wrapperStyle?: React.CSSProperties;
19
19
  value: React.ReactNode;
20
20
  onRemove?(): void;
21
- renderItem?(args: {
22
- dragOverlay: boolean;
23
- dragging: boolean;
24
- sorting: boolean;
25
- index: number | undefined;
26
- fadeIn: boolean;
27
- listeners: DraggableSyntheticListeners;
28
- ref: React.Ref<HTMLElement>;
29
- style: React.CSSProperties | undefined;
30
- transform: TabStripItemProps['transform'];
31
- transition: TabStripItemProps['transition'];
32
- value: TabStripItemProps['value'];
33
- }): React.ReactElement;
21
+ renderItem?(props: TabStripItemRenderProps): React.ReactNode;
22
+ }
23
+ /** What a tab strip's item renderer is handed. */
24
+ export interface TabStripItemRenderProps {
25
+ dragOverlay: boolean;
26
+ dragging: boolean;
27
+ sorting: boolean;
28
+ index: number | undefined;
29
+ fadeIn: boolean;
30
+ listeners: DraggableSyntheticListeners;
31
+ ref: React.Ref<HTMLElement>;
32
+ style: React.CSSProperties | undefined;
33
+ transform: TabStripItemProps['transform'];
34
+ transition: TabStripItemProps['transition'];
35
+ value: TabStripItemProps['value'];
34
36
  }
35
37
  export declare const TabStripItem: React.NamedExoticComponent<TabStripItemProps & React.RefAttributes<HTMLDivElement>>;
36
38
  //# sourceMappingURL=TabStripItem.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { TaskPaneProps } from './ITaskPane';
3
+ /** The key the cell control pane is registered under, and of the command that opens it. */
4
+ export declare const CELL_CONTROL_PANE_KEY = "formatCellControl";
5
+ /**
6
+ * The cell control pane: follows the selection's anchor and shows the body the anchor's content
7
+ * entry supplies ({@link CellContentEntry.pane}). With no control under the anchor, or for a type
8
+ * without a body, it says so.
9
+ */
10
+ export declare const CellControlPane: (props: TaskPaneProps) => React.ReactElement;
11
+ /**
12
+ * Registers the cell control pane ({@link CellControlPane}) with the default task pane registry,
13
+ * unless a pane is already registered under its key. The `formatCellControl` command calls it before
14
+ * opening the pane.
15
+ */
16
+ export declare function registerCellControlPane(): void;
17
+ //# sourceMappingURL=CellControlPane.d.ts.map
@@ -5,4 +5,5 @@ export * from './TaskPaneTitle';
5
5
  export * from './TaskPaneStrip';
6
6
  export * from './TaskPaneRegistry';
7
7
  export * from './MovablePane';
8
+ export * from './CellControlPane';
8
9
  //# sourceMappingURL=index.d.ts.map