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

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 (141) hide show
  1. package/browser/esm/{B93LSmhnvkxNXTq-.mjs → -wQNyCnoJdQUTTfP.mjs} +1 -1
  2. package/browser/esm/{Bl2BFCQ00fotauKB.mjs → AL94cpxFjPurAMQG.mjs} +1 -1
  3. package/browser/esm/{BQYS2Yf-EAV_tBLr.mjs → B4K8rf7TAv0SBkbG.mjs} +1 -1
  4. package/browser/esm/{ClAtIfYbsUPA073B.mjs → BrwfFgqKdMG_-iar.mjs} +1 -1
  5. package/browser/esm/ByBGwdqhc_l75i5G.mjs +145 -0
  6. package/browser/esm/{DgL7Dy-Lqcr1TvW6.mjs → C1zqAqKQ6oa4FiTH.mjs} +4851 -4818
  7. package/browser/esm/C9lQPmVMIlUwXkKr.mjs +303 -0
  8. package/browser/esm/{Dnh1kpz3v1JKtRD_.mjs → CIrcPI7uOT93ydNn.mjs} +2 -2
  9. package/browser/esm/{DS66lAIM-9M-YoZQ.mjs → CZsNidKZjsn0lNnA.mjs} +112 -104
  10. package/browser/esm/{Bos4Rkp8UTF7QXUB.mjs → CcewpxckpDrXSiZ-.mjs} +1 -1
  11. package/browser/esm/{BegvsXeRs7e-9t8k.mjs → CdDvFP8Fqm8uU7Rw.mjs} +1 -1
  12. package/browser/esm/{D2u6THGErqw64KQI.mjs → CfewUx0gINn-wXt3.mjs} +1 -1
  13. package/browser/esm/{C1pc9F4Rt2C5FKUo.mjs → CfvYfq6ALVqkCsdg.mjs} +1 -1
  14. package/browser/esm/CulxiChz6lj3G9lw.mjs +341 -0
  15. package/browser/esm/D5Uy22WeT7vUS36Z.mjs +19 -0
  16. package/browser/esm/{1-LEUre9ZLG0OYYB.mjs → Dd8deQ2CDMdrhzF1.mjs} +6 -6
  17. package/browser/esm/Dit7p67J_fDF5RDj.mjs +262 -0
  18. package/browser/esm/{CPnnESfZz2jjJd82.mjs → DzWFl-_dCN-EOkio.mjs} +3 -3
  19. package/browser/esm/{94dxo1A-z8lgiiGw.mjs → MIDbAwdzknMaoTU5.mjs} +2 -2
  20. package/browser/esm/{B26QVfjer2oY2ewK.mjs → ao9zR4H88b7AmZEV.mjs} +1 -1
  21. package/browser/esm/chart.mjs +28 -27
  22. package/browser/esm/control.mjs +74 -73
  23. package/browser/esm/group.mjs +3 -3
  24. package/browser/esm/index.mjs +6195 -5307
  25. package/browser/esm/note.mjs +5 -5
  26. package/browser/esm/picture.mjs +2 -81
  27. package/browser/esm/sXn9faQLuh4P0TZ9.mjs +401 -0
  28. package/browser/esm/shape.mjs +2 -2
  29. package/browser/esm/slicer.mjs +112 -111
  30. package/browser/esm/{CzRIbc-Lk__VMLKM.mjs → u3A8I4A7GKIOLOOb.mjs} +3 -3
  31. package/browser/esm/{DMdsMPT0fWBbTkNn.mjs → x6A47UA3fzV361tO.mjs} +1 -1
  32. package/node/esm/{BiaDWnN3tT7neoRL.mjs → A_4Y7EtzCWp1AG3Y.mjs} +1 -1
  33. package/node/esm/BNwVylzKMErhrx4i.mjs +406 -0
  34. package/node/esm/BPBUSXc5TVnD15By.mjs +146 -0
  35. package/node/esm/{DxQZmb-j4NLUO9Af.mjs → BTT6UB5lGvPxcq3F.mjs} +1 -1
  36. package/node/esm/{JiQGhLkoL8CJpVvA.mjs → BYiAmyF-aOOuMkD1.mjs} +1 -1
  37. package/node/esm/BqS8o-CmPoCjHDHp.mjs +263 -0
  38. package/node/esm/{b-XRVRI1fYQQMkTC.mjs → CC_XgLOFPvqmFyZ_.mjs} +525 -492
  39. package/node/esm/{BaRfst1euuhquupX.mjs → CMGUrHMaBDeCezK5.mjs} +1 -1
  40. package/node/esm/{umljAT66yb3_rURh.mjs → CP07qkepi21zlB0n.mjs} +118 -110
  41. package/node/esm/{BlxXufqBBg1PtsXd.mjs → CQJJMfuXl6mbgHdT.mjs} +1 -1
  42. package/node/esm/{C_SNx7TlFEcwbYjx.mjs → CVDVFhM7OIpaOlyN.mjs} +1 -1
  43. package/node/esm/{gpD-9LDW92phhoma.mjs → CVMuO9bpR5YK0pPb.mjs} +1 -1
  44. package/node/esm/{BMVK5plvmBOAIlxP.mjs → CaZG4HD3SmHvD-Tu.mjs} +1 -1
  45. package/node/esm/{6zApGj9DozhFy-bx.mjs → CuRPfxQCj2jookWL.mjs} +1 -1
  46. package/node/esm/D8mYmUPUA6i8oFgR.mjs +19 -0
  47. package/node/esm/{Dj5FM7_-YWhCtCCt.mjs → DAUtyjkW5uSdnTli.mjs} +1 -1
  48. package/node/esm/{D_pCpfdQowV_4Aje.mjs → DfvJ0Dpn-AP2mGtz.mjs} +5 -5
  49. package/node/esm/{DTMTIrYIK1eZswsM.mjs → DipZYwHed-W6QMtQ.mjs} +1 -1
  50. package/node/esm/{Be9c1GwQkPo8Piuh.mjs → NvP_j9pSsDiJ_PyY.mjs} +3 -3
  51. package/node/esm/chart.mjs +26 -25
  52. package/node/esm/control.mjs +79 -78
  53. package/node/esm/{sigD1UFqvPlWUw_9.mjs → eecr5gnC2KqVhOzX.mjs} +2 -2
  54. package/node/esm/group.mjs +3 -3
  55. package/node/esm/index.mjs +6594 -5705
  56. package/node/esm/note.mjs +18 -18
  57. package/node/esm/picture.mjs +269 -50
  58. package/node/esm/shape.mjs +185 -578
  59. package/node/esm/slicer.mjs +51 -50
  60. package/package.json +7 -7
  61. package/resources/locales/de/picture.cmd.json +157 -0
  62. package/resources/locales/de/sheet.cmd.json +45 -2
  63. package/resources/locales/de/ui.msg.json +3 -0
  64. package/resources/locales/de/workbook.cmd.json +6 -0
  65. package/resources/locales/en/picture.cmd.json +157 -0
  66. package/resources/locales/en/sheet.cmd.json +45 -2
  67. package/resources/locales/en/ui.msg.json +5 -0
  68. package/resources/locales/en/workbook.cmd.json +6 -0
  69. package/types/src/border/useBorders.d.ts +2 -2
  70. package/types/src/cell/CellCheckboxRenderer.d.ts +20 -0
  71. package/types/src/cell/CellContent.d.ts +68 -0
  72. package/types/src/cell/CellControlContext.d.ts +37 -0
  73. package/types/src/cell/{FormulaCellRenderer.d.ts → CellFormulaRenderer.d.ts} +5 -5
  74. package/types/src/cell/CellImageRenderer.d.ts +11 -0
  75. package/types/src/cell/CellRenderers.d.ts +190 -0
  76. package/types/src/cell/{SheetCellRenderer.d.ts → CellTextRenderer.d.ts} +9 -6
  77. package/types/src/cell/ColumnButton.d.ts +3 -3
  78. package/types/src/cell/OutlineButton.d.ts +4 -4
  79. package/types/src/cell/SheetHeaderRenderer.d.ts +1 -1
  80. package/types/src/cell/index.d.ts +8 -2
  81. package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
  82. package/types/src/cell/useInsertableCellControls.d.ts +25 -0
  83. package/types/src/chart/ChartCommands.d.ts +1 -1
  84. package/types/src/chart/ChartEditor.d.ts +2 -0
  85. package/types/src/chart/ChartElement.d.ts +14 -3
  86. package/types/src/chart/paint/_graphics.d.ts +0 -8
  87. package/types/src/chart/paint/_mode.d.ts +6 -0
  88. package/types/src/chart/paint/echarts.d.ts +6 -3
  89. package/types/src/chart/paint/index.d.ts +1 -1
  90. package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +9 -1
  91. package/types/src/chart/paint/kinds/_builtIns.d.ts +0 -9
  92. package/types/src/chart/paint/toEChartsOption.d.ts +12 -1
  93. package/types/src/editableLabel/EditableLabel.d.ts +3 -1
  94. package/types/src/editor/SheetReferenceHeaderLayer.d.ts +1 -1
  95. package/types/src/editor/useFormulaHints.d.ts +1 -1
  96. package/types/src/layer/CellErrorLayer.d.ts +3 -2
  97. package/types/src/layer/CellIndicatorLayer.d.ts +31 -0
  98. package/types/src/layer/CircularIndicatorLayer.d.ts +1 -1
  99. package/types/src/layer/HeaderSelectionLayer.d.ts +4 -4
  100. package/types/src/layer/HyperlinkLayer.d.ts +12 -5
  101. package/types/src/layer/ProtectionLayer.d.ts +1 -2
  102. package/types/src/layer/SheetCellLayer.d.ts +11 -4
  103. package/types/src/layer/SheetMovableLayer.d.ts +2 -1
  104. package/types/src/layer/SheetOutlineLayer.d.ts +1 -1
  105. package/types/src/layer/TableLayer.d.ts +1 -1
  106. package/types/src/layer/TableToolbar.d.ts +1 -1
  107. package/types/src/layer/ValidationPromptLayer.d.ts +16 -4
  108. package/types/src/layer/_visibleCellFeatures.d.ts +11 -0
  109. package/types/src/layer/index.d.ts +1 -0
  110. package/types/src/layer/useValidationPicker.d.ts +1 -1
  111. package/types/src/listener/useRangeListener.d.ts +13 -7
  112. package/types/src/movable/DefaultMovable.d.ts +1 -1
  113. package/types/src/movable/MovableControl.d.ts +3 -1
  114. package/types/src/movable/MovableFrame.d.ts +2 -1
  115. package/types/src/movable/MovableLayer.d.ts +6 -3
  116. package/types/src/movable/useFramePreview.d.ts +17 -0
  117. package/types/src/picture/PictureCommands.d.ts +8 -0
  118. package/types/src/picture/_pictureHyperlink.d.ts +13 -0
  119. package/types/src/picture/pictureCrop.d.ts +32 -0
  120. package/types/src/sheet/ISheetHeaderElement.d.ts +2 -2
  121. package/types/src/sheet/IWorksheetElement.d.ts +21 -22
  122. package/types/src/sheet/SheetCommandProvider.d.ts +3 -0
  123. package/types/src/sheet/SheetOutlineElement.d.ts +2 -2
  124. package/types/src/sheet/SheetPanels.d.ts +2 -2
  125. package/types/src/sheet/_hyperlinkEdit.d.ts +7 -0
  126. package/types/src/sheet/circularReferences.d.ts +1 -1
  127. package/types/src/tabStrip/Sortable.d.ts +5 -5
  128. package/types/src/tabStrip/TabStrip.d.ts +6 -6
  129. package/types/src/tabStrip/TabStripItem.d.ts +15 -13
  130. package/types/src/taskPane/CellControlPane.d.ts +17 -0
  131. package/types/src/taskPane/index.d.ts +1 -0
  132. package/types/src/taskPane/useTaskPane.d.ts +6 -3
  133. package/types/src/theme/buildDocThemeCSS.d.ts +4 -1
  134. package/types/src/workbook/DefaultRenderers.d.ts +4 -4
  135. package/types/src/workbook/IWorkbookElement.d.ts +52 -20
  136. package/types/src/workbook/WorkbookStrip.d.ts +5 -5
  137. package/browser/esm/CRi6DQ3UXmPEv-w_.mjs +0 -729
  138. package/browser/esm/cQ6xdPFkEcuDlNTN.mjs +0 -75
  139. package/browser/esm/ugfE7YeZALQURDKF.mjs +0 -241
  140. package/node/esm/DJPgbB1X22YmhbaR.mjs +0 -242
  141. package/node/esm/DgGEHydEjD7nfsDB.mjs +0 -76
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { ICell, ICellStyle, ITheme } from '@sheetxl/sdk';
3
3
  import { CellRendererProps } from '@sheetxl/grid-react';
4
- export interface SheetCellRendererProps extends CellRendererProps<ICell> {
4
+ export interface CellTextRendererProps extends CellRendererProps<ICell> {
5
5
  /**
6
6
  * If true, prefer to show the formulas over values
7
7
  */
@@ -37,14 +37,17 @@ export interface SheetCellRendererProps extends CellRendererProps<ICell> {
37
37
  */
38
38
  normalStyle?: ICellStyle;
39
39
  /**
40
- * Callback for when a link has been clicked.
40
+ * Called when the cell's hyperlink is clicked: on release, as Excel follows a link on mouse up
41
+ * (the press itself selects the cell). The link text is interactive content of the cell.
41
42
  *
42
43
  * @param event - The mouse event
43
44
  */
44
- onLinkMouseDown?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
45
+ onLinkClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
45
46
  }
46
47
  /**
47
- * CellRender is used for rendering text values on ICell.
48
+ * Paints a cell's value as text: the formatted value (or its formula in formula view), laid out
49
+ * and decorated the way the sheet shows it. Everything else a cell shows (fill, borders,
50
+ * conditional icons and bars, column buttons, indicators) is a layer of its own.
48
51
  *
49
52
  * Some of the features are:
50
53
  * 1. Text Color
@@ -63,5 +66,5 @@ export interface SheetCellRendererProps extends CellRendererProps<ICell> {
63
66
  *
64
67
  * @param props
65
68
  */
66
- export declare const SheetCellRenderer: React.FC<SheetCellRendererProps>;
67
- //# sourceMappingURL=SheetCellRenderer.d.ts.map
69
+ export declare const CellTextRenderer: React.FC<CellTextRendererProps>;
70
+ //# sourceMappingURL=CellTextRenderer.d.ts.map
@@ -24,15 +24,15 @@ export interface ColumnButtonConfigProps {
24
24
  /**
25
25
  * Callback for creating a custom column button.
26
26
  *
27
- * @returns A React Element representing the ColumnButton.
28
27
  */
29
- renderColumnButton?: (props: ColumnButtonProps) => React.ReactElement;
28
+ renderColumnButton?: (props: ColumnButtonProps) => React.ReactNode;
30
29
  }
31
30
  /**
32
31
  * Property for the filter button
33
32
  */
34
33
  export interface ColumnButtonProps extends React.HTMLAttributes<HTMLElement> {
35
- renderBounds: Bounds;
34
+ /** The header cell's box the button pins itself into. */
35
+ bounds: Bounds;
36
36
  zoom: number;
37
37
  disabled: boolean;
38
38
  column: ITable.IColumn;
@@ -53,12 +53,12 @@ export interface OutlineProps extends React.HTMLAttributes<HTMLDivElement> {
53
53
  * Renders a group's collapse / expand button, filling the square it is placed in. Defaults to
54
54
  * {@link OutlineButton}.
55
55
  */
56
- renderButton?: (props: OutlineButtonProps) => React.ReactNode;
56
+ renderButton?: ((props: OutlineButtonProps) => React.ReactNode) | null;
57
57
  /**
58
58
  * Renders a level button, filling the square it is placed in. Defaults to
59
59
  * {@link OutlineLevelButton}.
60
60
  */
61
- renderLevelButton?: (props: OutlineLevelButtonProps) => React.ReactNode;
61
+ renderLevelButton?: ((props: OutlineLevelButtonProps) => React.ReactNode) | null;
62
62
  /**
63
63
  * The size of one level's lane across the gutter, in pixels at 100% zoom. A button fills its lane,
64
64
  * less {@link laneGap}.
@@ -118,6 +118,6 @@ export declare const OutlineButton: React.MemoExoticComponent<(props: OutlineBut
118
118
  * The chromeless level button: a square with its level number, in the corner knob's colors.
119
119
  */
120
120
  export declare const OutlineLevelButton: React.MemoExoticComponent<(props: OutlineLevelButtonProps) => React.JSX.Element>;
121
- export declare const renderOutlineButton: (props: OutlineButtonProps) => React.ReactNode;
122
- export declare const renderOutlineLevelButton: (props: OutlineLevelButtonProps) => React.ReactNode;
121
+ export declare const defaultRenderOutlineButton: (props: OutlineButtonProps) => React.ReactNode;
122
+ export declare const defaultRenderOutlineLevelButton: (props: OutlineLevelButtonProps) => React.ReactNode;
123
123
  //# sourceMappingURL=OutlineButton.d.ts.map
@@ -36,7 +36,7 @@ export interface SheetHeaderRendererProps extends CellRendererProps {
36
36
  *
37
37
  * @returns A React Element representing the ColumnButton.
38
38
  */
39
- renderColumnButton?: (props: ColumnButtonProps) => React.ReactElement;
39
+ renderColumnButton?: (props: ColumnButtonProps) => React.ReactNode;
40
40
  }
41
41
  export declare const SheetHeaderRenderer: React.MemoExoticComponent<(props: SheetHeaderRendererProps) => React.JSX.Element>;
42
42
  //# sourceMappingURL=SheetHeaderRenderer.d.ts.map
@@ -1,6 +1,12 @@
1
- export * from './SheetCellRenderer';
1
+ export * from './CellTextRenderer';
2
+ export { registerCellControl, registerRichData, getCellContent, getCellControlEntry, addCellContentListener, type CellContentEntry, type CellContentRenderer, type CellContentRendererProps, type CellInteractiveProps, type CellPressEvent, type CellKeyTarget, type CellControlPaneProps, type DefaultCellContentProps, type ResolvedCellContent } from './CellRenderers';
3
+ export * from './CellControlContext';
4
+ export * from './CellContent';
5
+ export * from './CellCheckboxRenderer';
6
+ export * from './CellImageRenderer';
7
+ export * from './useInsertableCellControls';
2
8
  export * from './StaticCellRenderer';
3
- export * from './FormulaCellRenderer';
9
+ export * from './CellFormulaRenderer';
4
10
  export * from './useFormulaViewAnchor';
5
11
  export * from './SheetHeaderRenderer';
6
12
  export * from './ColumnButton';
@@ -28,7 +28,7 @@ export interface FormulaViewAnchor {
28
28
  * The shared **formula-view spotlight** source: while `sheetView.isShowFormulas()` is on, tracks the
29
29
  * sheet's selection anchor and — when it sits on a formula cell — returns that formula's tokens and
30
30
  * scoped reference ranges. Consumed by `SheetCellLayer` (suppress the anchor's plain tile text +
31
- * overlay the colored `FormulaCellRenderer`) and `SheetReferenceLayer` (outline the references via
31
+ * overlay the colored `CellFormulaRenderer`) and `SheetReferenceLayer` (outline the references via
32
32
  * the ranges picker), so the two always agree on what is spotlighted — and colors line up, both
33
33
  * keying off `referenceIndex`.
34
34
  *
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ /** A type of cell content that a UI can offer to insert: a cell control or a rich data value. */
3
+ export interface InsertableCellControl {
4
+ /** The control type or the rich data type, as registered in the SDK. */
5
+ type: string;
6
+ /**
7
+ * What inserting it does: `'control'` puts the control on the cells and keeps their values;
8
+ * `'richData'` writes the kind's default value into them.
9
+ */
10
+ family: 'control' | 'richData';
11
+ /** The sdk kind's `label`, or the type when the kind has none. */
12
+ label: string;
13
+ /** The entry's `icon`, or `null`. */
14
+ icon: string | React.ReactElement | null;
15
+ }
16
+ /**
17
+ * The cell content types that can be inserted: cell control types and rich data types registered
18
+ * in the SDK whose UI entry draws them, built-ins included.
19
+ *
20
+ * @remarks
21
+ * Follows {@link registerCellControl} and {@link registerRichData} live. The SDK registries have no
22
+ * change signal, so register a type's sdk kind before its UI entry.
23
+ */
24
+ export declare function useInsertableCellControls(): readonly InsertableCellControl[];
25
+ //# sourceMappingURL=useInsertableCellControls.d.ts.map
@@ -8,7 +8,7 @@ import { MovableKindCommandData } from '../movable';
8
8
  * plots the other way; `chartSelectData` takes an address, or asks for one, and plots those cells;
9
9
  * `chartAddElement` takes an element by VBA's name (`legendTop`), and the toggles are the Add Chart
10
10
  * Element checkboxes, each with the element's state. Quick layouts, chart styles and colors wait on
11
- * the style parts (PLAN-CHART Phase 4). Each setter is one step to undo on its own; the middleware
11
+ * the style parts. Each setter is one step to undo on its own; the middleware
12
12
  * reports an error and arms repeat.
13
13
  */
14
14
  export declare const contributeChartCommands: Command.DynamicCommandContributor<MovableKindCommandData>;
@@ -17,6 +17,8 @@ export interface ChartEditorProps extends MovableElementProps {
17
17
  * shows the frame's states (disabled, dragging).
18
18
  *
19
19
  * @remarks
20
+ * The chart is drawn in the grid's color scheme, as the cells about it are.
21
+ *
20
22
  * A press inside the chart selects what is under the pointer in the sheet view's chart element
21
23
  * selection, Excel's way (the series first, its point next), and is the element's: the frame
22
24
  * drags the chart from its chart area alone, as Excel does.
@@ -1,15 +1,19 @@
1
1
  import { default as React } from 'react';
2
2
  import { IChart, IChartElementSelection } from '@sheetxl/sdk';
3
3
  import { Point } from '@sheetxl/utils';
4
+ import { ThemeMode } from '@sheetxl/utils-react';
4
5
  export interface ChartElementAttributes {
5
6
  isChartElement: () => true;
6
7
  /** The chart drawn; `null` until a `Promise` input resolves. */
7
8
  getChart: () => IChart | null;
8
9
  /**
9
- * The chart as it is drawn now, as an SVG document of the element's unzoomed size; `null` while
10
- * the chart has no layout or the element no size.
10
+ * The chart as an SVG document of the element's unzoomed size; `null` while the chart has no
11
+ * layout or the element no size. It is drawn light, a chart area with no fill of its own white,
12
+ * unless `darkMode`.
11
13
  */
12
- toSVG: () => Promise<string | null>;
14
+ toSVG: (options?: {
15
+ darkMode?: boolean;
16
+ }) => Promise<string | null>;
13
17
  /**
14
18
  * The chart element drawn under a point of the page (`clientX`, `clientY`), as the chart is
15
19
  * painted now; `null` outside the chart, or before it is painted.
@@ -76,6 +80,13 @@ export interface ChartElementProps extends React.HTMLAttributes<HTMLDivElement>
76
80
  * A press on the chart area empties the selection: the chart is then what is selected.
77
81
  */
78
82
  selection?: IChartElementSelection | null;
83
+ /**
84
+ * Whether the chart is drawn light or dark. Dark, its colors are drawn as a dark grid draws its
85
+ * cells. A chart area with no fill of its own is the surface's background
86
+ * (`--sxl-color-base-100`) in either mode.
87
+ * @defaultValue the app's scheme (`useAppColorScheme`); a chart on a sheet is drawn in the grid's
88
+ */
89
+ colorScheme?: ThemeMode;
79
90
  /**
80
91
  * Called on a press inside the chart with what is under the pointer, before the selection (if
81
92
  * any) changes.
@@ -16,14 +16,6 @@ export declare const strokeStyle: (stroke: Stroke | null | undefined) => Record<
16
16
  export declare const lineStyle: (stroke: Stroke | null | undefined) => Record<string, unknown>;
17
17
  /** Lines across a unit square: Excel's x, star and plus, drawn in the marker's outline color. */
18
18
  export declare const MARKER_LINES: Readonly<Record<string, readonly [number, number, number, number][]>>;
19
- /**
20
- * How ECharts draws a marker of the layout's: its symbol, box and offset from the point. A marker's
21
- * size is its box (measured, `probe-chart-markers.ps1`): a dash is that wide and a fifth of it tall,
22
- * a dot half as wide, from the point to the right. A circle, square, dash and dot keep their outline
23
- * inside the box, along a dot's height but not its width; the other symbols center it on the box.
24
- * An x, star or plus is its lines; its fill, a square of the size with no outline, is
25
- * {@link markerFill}'s.
26
- */
27
19
  export declare const markerSymbol: (marker: MarkerLayout) => {
28
20
  symbol: string;
29
21
  symbolSize: number | [number, number];
@@ -0,0 +1,6 @@
1
+ import { ChartLayout } from '@sheetxl/sdk';
2
+ /** A concrete CSS color as a dark grid draws it; one that cannot be read as it is. */
3
+ export declare const darkColor: (css: string) => string;
4
+ /** The layout with each of its colors as a dark grid draws it; the layout itself when light. */
5
+ export declare const layoutInMode: (layout: ChartLayout, darkMode: boolean) => ChartLayout;
6
+ //# sourceMappingURL=_mode.d.ts.map
@@ -18,13 +18,16 @@ export declare function renderChartToSVG(layout: ChartLayout, options?: Translat
18
18
  * what is under the pointer asks the chart (`IChart.getElementAt`) with the layout it painted.
19
19
  */
20
20
  export interface MountedChart {
21
- /** Paints a new layout; a new size resizes the instance first. */
22
- update(layout: ChartLayout): void;
21
+ /**
22
+ * Paints a new layout; a new size resizes the instance first.
23
+ * @param options How it is translated now; by default as it was mounted.
24
+ */
25
+ update(layout: ChartLayout, options?: TranslateOptions): void;
23
26
  dispose(): void;
24
27
  }
25
28
  /**
26
29
  * Paints the layout into `host`, sized at the layout's px. The host is not measured: the frame
27
- * scales it (DESIGN-CHART §5 "Size and zoom").
30
+ * scales it.
28
31
  */
29
32
  export declare function mountChart(host: HTMLElement, layout: ChartLayout, options?: TranslateOptions): MountedChart;
30
33
  //# sourceMappingURL=echarts.d.ts.map
@@ -6,7 +6,7 @@ export type ChartPaintModule = typeof import('./echarts');
6
6
  /**
7
7
  * The painter. It carries ECharts, so nothing imports it statically: it loads the first time a
8
8
  * chart is painted or rendered to SVG, or earlier when `LazyModules.prefetch` warms the lazy
9
- * modules (DESIGN-CHART §7).
9
+ * modules.
10
10
  */
11
11
  export declare const ChartPaint: import('@sheetxl/utils').LazyModule<typeof import("./echarts")>;
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -7,7 +7,7 @@ import { Bounds } from '@sheetxl/utils';
7
7
  * (`ChartLayout.CustomGroupLayout`) is painted by the kind registered under `custom:<its kind>`.
8
8
  *
9
9
  * @remarks
10
- * The painter translates the layout and decides nothing (DESIGN-CHART §2): a kind reads where the
10
+ * The painter translates the layout and decides nothing: a kind reads where the
11
11
  * layout put things, in px, and says how ECharts draws them. It is given the shared vocabulary as
12
12
  * a {@link ChartPaintKind.Context}: fills and strokes as ECharts states them, markers, text boxes,
13
13
  * and for a group on axes the grid indexes and how a series' data is placed on them.
@@ -58,7 +58,15 @@ export declare namespace ChartPaintKind {
58
58
  }
59
59
  /** What a kind is given to paint a group. */
60
60
  interface Context {
61
+ /** The layout to paint, its colors already in the mode painted. */
61
62
  readonly layout: ChartLayout;
63
+ /** Whether the chart is drawn as a dark grid draws its cells. */
64
+ readonly darkMode: boolean;
65
+ /**
66
+ * A concrete CSS color of the kind's own (not the layout's, which are in the mode already) as
67
+ * the chart is drawn: as a dark grid draws it when {@link darkMode}.
68
+ */
69
+ color(css: string): string;
62
70
  axisOf(id: number): ChartLayout.AxisLayout | undefined;
63
71
  /** The grid a group's axes are on. */
64
72
  cartesian(group: {
@@ -1,12 +1,3 @@
1
1
  import { ChartPaintKind } from './ChartPaintKind';
2
- /**
3
- * Registers the painters the package ships, through the same door a host's kind comes in by.
4
- * Called by the translation before its first use.
5
- *
6
- * @remarks
7
- * The built-ins name no ECharts modules of their own: `echarts.ts`, the lazy painter, brings the
8
- * series types they use when it registers ECharts' pieces, so this module and the kinds stay free
9
- * of ECharts and the package index stays light (DESIGN-CHART §7).
10
- */
11
2
  export declare function registerBuiltInPaintKinds(register: (kind: ChartPaintKind) => () => void): void;
12
3
  //# sourceMappingURL=_builtIns.d.ts.map
@@ -15,12 +15,23 @@ export interface TranslateOptions {
15
15
  * @defaultValue 'graphic'
16
16
  */
17
17
  legend?: 'native' | 'graphic';
18
+ /**
19
+ * Whether the chart is drawn as a dark grid draws its cells: each color through `IColor.toRGBA(true)`.
20
+ * @defaultValue false
21
+ */
22
+ darkMode?: boolean;
23
+ /**
24
+ * What a chart area that states no fill is filled with, light: the background of where it is
25
+ * drawn. `'transparent'` leaves it to what is behind the chart.
26
+ * @defaultValue '#FFFFFF'
27
+ */
28
+ background?: string;
18
29
  }
19
30
  /**
20
31
  * Translates a {@link ChartLayout} to an ECharts option.
21
32
  *
22
33
  * @remarks
23
- * A translation table and nothing else (DESIGN-CHART §2): the grid is the plot rect in px with
34
+ * A translation table and nothing else: the grid is the plot rect in px with
24
35
  * `containLabel:false`; value axes get `min`, `max` and `interval` and a formatter that answers
25
36
  * the layout's strings; bars get `barWidth` in px and `barGap` from the overlap; every DrawingML
26
37
  * axis is an ECharts axis, a deleted one with `show:false`. Nothing is left for ECharts to decide.
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { RenderSlotFn } from '@sheetxl/utils-react';
2
3
  export interface EditableLabelAttributes {
3
4
  startEdit(): void;
4
5
  cancel(): void;
@@ -18,7 +19,8 @@ export interface EditableLabelProps extends Omit<React.HTMLAttributes<HTMLDivEle
18
19
  onChange?: (value: string) => void;
19
20
  onSubmit?: (value: string) => boolean | void;
20
21
  onCancel?: () => void;
21
- renderInput?: (props: any) => React.ReactElement<HTMLInputElement>;
22
+ /** Render the input shown while editing. Spread the props on an `<input>`. */
23
+ renderInput?: RenderSlotFn<React.InputHTMLAttributes<HTMLInputElement>>;
22
24
  /**
23
25
  * Reference to the HTMLInputElement (or other) used for editing
24
26
  */
@@ -34,7 +34,7 @@ export interface SheetReferenceHeaderLayerProps extends LayerProps {
34
34
  * primary header selection fully in charge. The producer's gates — `scope` and `allowMulti` — are read
35
35
  * here exactly as {@link SheetReferenceLayer} reads them for the body: the two surfaces drive one
36
36
  * selection, so a gate honored by only one of them is no gate at all. It is a pointer surface
37
- * only ({@link HeaderSelectionLayer} with `renderBorders={false}`) — the reference rectangles are drawn on
37
+ * only ({@link HeaderSelectionLayer} with `hideAccent`) — the reference rectangles are drawn on
38
38
  * the body grid by {@link SheetReferenceLayer}; `preserveFocus` keeps the formula editor focused across a
39
39
  * header drag; `replaceActive` re-scopes/inserts the active reference instead of the primary's whole-
40
40
  * selection replace.
@@ -195,7 +195,7 @@ export interface FormulaHintsApi {
195
195
  */
196
196
  getAnchorOffset(): number;
197
197
  /**
198
- * STABLE-identity panel renderer for `useFloatStack.createPopupPanel` — the autocomplete list when
198
+ * STABLE-identity panel renderer for `useFloatStack.renderPopupPanel` — the autocomplete list when
199
199
  * it has matches, else the signature preview. Returns `null` when there is nothing to show.
200
200
  */
201
201
  renderPanel(): React.ReactNode;
@@ -60,9 +60,10 @@ export interface CellErrorLayerProps extends Omit<LayerProps, 'children'> {
60
60
  closeDelay?: number;
61
61
  /**
62
62
  * Optional custom tip renderer. Spread `tipProps` (from context via `useSticky`, or reuse the
63
- * default) onto the returned element to keep the tip open while hovered. Omit for the default card.
63
+ * default) onto the returned element to keep the tip open while hovered. Omit for the default card;
64
+ * `null` for none.
64
65
  */
65
- renderTip?: (tip: CellErrorTip) => React.ReactNode;
66
+ renderTip?: ((tip: CellErrorTip) => React.ReactNode) | null;
66
67
  }
67
68
  /**
68
69
  * A grid layer that shows a **hover tooltip on cells carrying errors / warnings**. A thin
@@ -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
@@ -21,7 +21,7 @@ export interface CircularIndicatorLayerProps extends LayerProps {
21
21
  * A {@link CellTileDiv} fed the sheet's `Feature.Circular` regions (engine-merged blocks: a
22
22
  * 28K-cell block downstream of one cycle is one region, not 28K nodes), so a sheet with no cycles
23
23
  * costs one lookup per frame. Members only get the glyph — a downstream cell is `0` for the same
24
- * reason (DESIGN-CIRCULAR-CALC.md §2.1) but the fix is never there, and a column of glyphs reads
24
+ * reason but the fix is never there, and a column of glyphs reads
25
25
  * as a column of problems. The tooltip (`CellErrorLayer`) still answers for downstream cells.
26
26
  *
27
27
  * The glyph shows in every state; an unresolved cycle — iterative calculation off, or capped
@@ -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
@@ -19,10 +19,10 @@ export interface LinkPreview {
19
19
  * a URL (a screenshot service), a promise when it has to be looked up (a social card).
20
20
  */
21
21
  export type LinkPreviewLookup = (address: string) => LinkPreview | Promise<LinkPreview | null> | null;
22
- /** What a hyperlink card is handed. The actions are bound to the hovered cell. */
22
+ /** What a hyperlink card is handed. The actions are bound to the hovered cell or picture. */
23
23
  export interface HyperlinkCardRenderProps {
24
24
  sheet: IWorksheet;
25
- /** The hovered cell (the card anchors to its range, a merge included). */
25
+ /** The hovered cell (the card anchors to its range, a merge included), or a linked picture's first. */
26
26
  coords: CellCoords;
27
27
  hyperlink: IHyperlink;
28
28
  /** Follow the link. */
@@ -33,6 +33,11 @@ export interface HyperlinkCardRenderProps {
33
33
  edit: () => void;
34
34
  /** Remove the link; the cell's text stays. */
35
35
  remove: () => void;
36
+ /**
37
+ * `true` when the link cannot be changed, so {@link edit} and {@link remove} should show disabled:
38
+ * it is read-only ({@link IHyperlink.isReadOnly}) or the sheet's protection refuses the change.
39
+ */
40
+ disabled: boolean;
36
41
  /**
37
42
  * The linked page's preview once the lookup resolved, or `null` — see
38
43
  * {@link HyperlinkLayerProps.preview}. Draw its picture with {@link LinkPreviewImage}, which shows it
@@ -49,7 +54,7 @@ export interface HyperlinkCardRenderProps {
49
54
  export interface HyperlinkLayerProps extends Omit<LayerProps, 'children'> {
50
55
  sheet: IWorksheet;
51
56
  /** The card. @defaultValue the plain card: address · copy · edit · remove */
52
- renderCard?: (props: HyperlinkCardRenderProps) => React.ReactNode;
57
+ renderCard?: ((props: HyperlinkCardRenderProps) => React.ReactNode) | null;
53
58
  /**
54
59
  * Looks up a preview of the linked page to show under the actions. Off by default: it is a request to
55
60
  * a third party per hovered web link. {@link linkPreviewMicrolink} (the page's social card) and
@@ -90,8 +95,9 @@ export declare const linkPreviewMShots: (address: string, width?: number) => Lin
90
95
  */
91
96
  export declare const HyperlinkLayer: React.MemoExoticComponent<(props: HyperlinkLayerProps) => React.JSX.Element>;
92
97
  /**
93
- * The preview picture, shown only once it exists and has loaded — a missing card or a failed request
94
- * draws nothing, so the card never shows a broken image.
98
+ * The preview picture, shown once it exists and has loaded — a missing card or a failed request draws
99
+ * nothing, so the card never shows a broken image. A picture that has to load slides open as it arrives;
100
+ * one the browser already has is simply there.
95
101
  *
96
102
  * A screenshot service answers while it is still rendering with a **placeholder picture** (mShots
97
103
  * does). The caller says what width it asked for (`expectedWidth`); a loaded picture of another width
@@ -104,6 +110,7 @@ export declare const LinkPreviewImage: React.FC<{
104
110
  expectedWidth?: number;
105
111
  /** The width to draw at. @defaultValue the container's */
106
112
  width?: number | string;
113
+ /** Style for the picture. A margin here takes no room until the picture shows. */
107
114
  style?: React.CSSProperties;
108
115
  }>;
109
116
  //# sourceMappingURL=HyperlinkLayer.d.ts.map
@@ -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