@sheetxl/react 0.7.27 → 0.7.28-beta.1

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 (257) hide show
  1. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +1 -0
  2. package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +156 -0
  3. package/browser/cjs/index.cjs +24 -24
  4. package/browser/esm/D_suN0U6XvrHxTak.mjs +6286 -0
  5. package/browser/esm/index.mjs +19258 -4911
  6. package/licenses/dependencies.txt +42 -214
  7. package/node/esm/CH084kteEgVy0a8H.mjs +9 -0
  8. package/node/esm/index.mjs +17035 -3691
  9. package/package.json +10 -11
  10. package/resources/contents.json +60 -0
  11. package/resources/locales/contents.json +114 -0
  12. package/resources/locales/de/clipboard.cmd.json +36 -0
  13. package/resources/locales/de/editor.cmd.json +128 -0
  14. package/resources/locales/de/movable.cmd.json +123 -0
  15. package/resources/locales/de/selection.cmd.json +373 -0
  16. package/resources/locales/de/sheet.cmd.json +1563 -0
  17. package/resources/locales/de/table.cmd.json +83 -0
  18. package/resources/locales/de/ui.msg.json +166 -0
  19. package/resources/locales/de/workbook.cmd.json +282 -0
  20. package/resources/locales/en/clipboard.cmd.json +36 -0
  21. package/resources/locales/en/editor.cmd.json +128 -0
  22. package/resources/locales/en/movable.cmd.json +123 -0
  23. package/resources/locales/en/selection.cmd.json +373 -0
  24. package/resources/locales/en/sheet.cmd.json +1563 -0
  25. package/resources/locales/en/table.cmd.json +83 -0
  26. package/resources/locales/en/ui.msg.json +166 -0
  27. package/resources/locales/en/workbook.cmd.json +282 -0
  28. package/types/index.d.ts +2 -1767
  29. package/types/src/border/StaticBorderRenderer.d.ts +32 -0
  30. package/types/src/border/StyledStrokePath.d.ts +14 -0
  31. package/types/src/border/index.d.ts +4 -0
  32. package/types/src/border/useBorders.d.ts +87 -0
  33. package/types/src/cell/ColumnButton.d.ts +45 -0
  34. package/types/src/cell/CornerTriangle.d.ts +27 -0
  35. package/types/src/cell/FormulaCellRenderer.d.ts +34 -0
  36. package/types/src/cell/SheetCellRenderer.d.ts +52 -0
  37. package/types/src/cell/SheetHeaderRenderer.d.ts +37 -0
  38. package/types/src/cell/index.d.ts +7 -0
  39. package/types/src/cell/useFormulaViewAnchor.d.ts +42 -0
  40. package/types/src/chart/ChartEditor.d.ts +17 -0
  41. package/types/src/chart/PresetChartTypeDescriptors.d.ts +35 -0
  42. package/types/src/chart/index.d.ts +3 -0
  43. package/types/src/chart/templates/area-stacked-percent-template.json.d.ts +10 -0
  44. package/types/src/chart/templates/area-stacked-template.json.d.ts +10 -0
  45. package/types/src/chart/templates/area-template.json.d.ts +9 -0
  46. package/types/src/chart/templates/bar-stacked-percent-template.json.d.ts +10 -0
  47. package/types/src/chart/templates/bar-stacked-template.json.d.ts +10 -0
  48. package/types/src/chart/templates/bar-template.json.d.ts +9 -0
  49. package/types/src/chart/templates/column-stacked-percent-template.json.d.ts +10 -0
  50. package/types/src/chart/templates/column-stacked-template.json.d.ts +10 -0
  51. package/types/src/chart/templates/column-template.json.d.ts +9 -0
  52. package/types/src/chart/templates/line-markers-template.json.d.ts +10 -0
  53. package/types/src/chart/templates/line-stacked-markers-template.json.d.ts +11 -0
  54. package/types/src/chart/templates/line-stacked-percent-markers-template.json.d.ts +11 -0
  55. package/types/src/chart/templates/line-stacked-percent-template.json.d.ts +10 -0
  56. package/types/src/chart/templates/line-stacked-template.json.d.ts +10 -0
  57. package/types/src/chart/templates/line-template.json.d.ts +9 -0
  58. package/types/src/chart/templates/pie-doughnut-template.json.d.ts +10 -0
  59. package/types/src/chart/templates/pie-template.json.d.ts +9 -0
  60. package/types/src/chart/templates/scatter-lines-markers-smooth-template.json.d.ts +10 -0
  61. package/types/src/chart/templates/scatter-lines-markers-template.json.d.ts +10 -0
  62. package/types/src/chart/templates/scatter-lines-smooth-template.json.d.ts +10 -0
  63. package/types/src/chart/templates/scatter-lines-template.json.d.ts +10 -0
  64. package/types/src/chart/templates/scatter-markers-template.json.d.ts +10 -0
  65. package/types/src/clipboard/ClipboardCommands.d.ts +68 -0
  66. package/types/src/clipboard/SheetClipboardLayer.d.ts +22 -0
  67. package/types/src/clipboard/index.d.ts +3 -0
  68. package/types/src/commands/Catalog.d.ts +8 -0
  69. package/types/src/commands/CommandRootProvider.d.ts +36 -0
  70. package/types/src/commands/InputClipboardCommands.d.ts +41 -0
  71. package/types/src/commands/InputClipboardInjector.d.ts +16 -0
  72. package/types/src/commands/MainFocusContext.d.ts +13 -0
  73. package/types/src/commands/PaneScopeProvider.d.ts +40 -0
  74. package/types/src/commands/createTransactionalMiddleware.d.ts +49 -0
  75. package/types/src/commands/index.d.ts +7 -0
  76. package/types/src/context/SheetContext.d.ts +18 -0
  77. package/types/src/context/WorkbookContext.d.ts +20 -0
  78. package/types/src/context/index.d.ts +3 -0
  79. package/types/src/editableLabel/EditableLabel.d.ts +28 -0
  80. package/types/src/editableLabel/index.d.ts +2 -0
  81. package/types/src/editor/EditorCommands.d.ts +98 -0
  82. package/types/src/editor/FunctionPreviewPanel.d.ts +166 -0
  83. package/types/src/editor/NamedHintPanel.d.ts +38 -0
  84. package/types/src/editor/NamedItemsPanel.d.ts +59 -0
  85. package/types/src/editor/SheetCellEditorLayer.d.ts +40 -0
  86. package/types/src/editor/SheetCellInput.d.ts +99 -0
  87. package/types/src/editor/SheetEditable.d.ts +53 -0
  88. package/types/src/editor/SheetReferenceHeaderLayer.d.ts +46 -0
  89. package/types/src/editor/SheetReferenceLayer.d.ts +55 -0
  90. package/types/src/editor/formulaCaret.d.ts +84 -0
  91. package/types/src/editor/formulaEval.d.ts +202 -0
  92. package/types/src/editor/formulaPresentation.d.ts +136 -0
  93. package/types/src/editor/formulaText.d.ts +80 -0
  94. package/types/src/editor/functionArgs.d.ts +111 -0
  95. package/types/src/editor/functionHint.d.ts +37 -0
  96. package/types/src/editor/index.d.ts +18 -0
  97. package/types/src/editor/referencePointNav.d.ts +39 -0
  98. package/types/src/editor/useFormulaHints.d.ts +126 -0
  99. package/types/src/editor/useFormulaInput.d.ts +326 -0
  100. package/types/src/editor/useProtectedEditNotice.d.ts +14 -0
  101. package/types/src/editor/useReferenceMode.d.ts +177 -0
  102. package/types/src/form/FormulaInput.d.ts +86 -0
  103. package/types/src/form/FormulaInputParts.d.ts +94 -0
  104. package/types/src/form/index.d.ts +5 -0
  105. package/types/src/form/useEditCommit.d.ts +174 -0
  106. package/types/src/form/useInputField.d.ts +86 -0
  107. package/types/src/frame/CommandContext.d.ts +179 -0
  108. package/types/src/frame/IFrame.d.ts +17 -0
  109. package/types/src/frame/index.d.ts +3 -0
  110. package/types/src/icons/LogoNoPaddingIcon.d.ts +3 -0
  111. package/types/src/icons/LogoTextNoPaddingIcon.d.ts +4 -0
  112. package/types/src/icons/WaterMark.d.ts +12 -0
  113. package/types/src/icons/chart/ChartAreaIcon.d.ts +5 -0
  114. package/types/src/icons/chart/ChartAreaStackedIcon.d.ts +5 -0
  115. package/types/src/icons/chart/ChartAreaStackedPercentIcon.d.ts +5 -0
  116. package/types/src/icons/chart/ChartBarIcon.d.ts +5 -0
  117. package/types/src/icons/chart/ChartBarStackedIcon.d.ts +5 -0
  118. package/types/src/icons/chart/ChartBarStackedPercentIcon.d.ts +5 -0
  119. package/types/src/icons/chart/ChartBubble3DIcon.d.ts +5 -0
  120. package/types/src/icons/chart/ChartBubbleIcon.d.ts +5 -0
  121. package/types/src/icons/chart/ChartColumnIcon.d.ts +5 -0
  122. package/types/src/icons/chart/ChartColumnStackedIcon.d.ts +5 -0
  123. package/types/src/icons/chart/ChartColumnStackedPercentIcon.d.ts +5 -0
  124. package/types/src/icons/chart/ChartLineIcon.d.ts +5 -0
  125. package/types/src/icons/chart/ChartLineMarkersIcon.d.ts +5 -0
  126. package/types/src/icons/chart/ChartLineStackedIcon.d.ts +5 -0
  127. package/types/src/icons/chart/ChartLineStackedMarkersIcon.d.ts +5 -0
  128. package/types/src/icons/chart/ChartLineStackedPercentIcon.d.ts +5 -0
  129. package/types/src/icons/chart/ChartLineStackedPercentMarkersIcon.d.ts +5 -0
  130. package/types/src/icons/chart/ChartPieDoughnutIcon.d.ts +5 -0
  131. package/types/src/icons/chart/ChartPieIcon.d.ts +5 -0
  132. package/types/src/icons/chart/ChartScatterLinesIcon.d.ts +5 -0
  133. package/types/src/icons/chart/ChartScatterLinesMarkersIcon.d.ts +5 -0
  134. package/types/src/icons/chart/ChartScatterLinesMarkersSmoothIcon.d.ts +5 -0
  135. package/types/src/icons/chart/ChartScatterLinesSmoothIcon.d.ts +5 -0
  136. package/types/src/icons/chart/ChartScatterMarkersIcon.d.ts +5 -0
  137. package/types/src/icons/chart/ChartWaterfallIcon.d.ts +5 -0
  138. package/types/src/icons/chart/ThemedChartIcon.d.ts +20 -0
  139. package/types/src/icons/chart/index.d.ts +50 -0
  140. package/types/src/icons/index.d.ts +4 -0
  141. package/types/src/index.d.ts +27 -0
  142. package/types/src/io/WorkbookIO.d.ts +50 -0
  143. package/types/src/io/index.d.ts +2 -0
  144. package/types/src/layer/BorderLayer.d.ts +14 -0
  145. package/types/src/layer/CellErrorLayer.d.ts +49 -0
  146. package/types/src/layer/CellFillLayer.d.ts +15 -0
  147. package/types/src/layer/ConditionalBarLayer.d.ts +41 -0
  148. package/types/src/layer/ConditionalIcons.d.ts +34 -0
  149. package/types/src/layer/ConditionalIconsLayer.d.ts +31 -0
  150. package/types/src/layer/ContextMenuLayer.d.ts +27 -0
  151. package/types/src/layer/HeaderResizerLayer.d.ts +28 -0
  152. package/types/src/layer/HeaderSelectionLayer.d.ts +89 -0
  153. package/types/src/layer/ResizeIndicator.d.ts +19 -0
  154. package/types/src/layer/SheetBackgroundLayer.d.ts +22 -0
  155. package/types/src/layer/SheetCellLayer.d.ts +49 -0
  156. package/types/src/layer/SheetColumnButtonLayer.d.ts +23 -0
  157. package/types/src/layer/SheetGridLineLayer.d.ts +22 -0
  158. package/types/src/layer/SheetHeaderCellLayer.d.ts +30 -0
  159. package/types/src/layer/SheetMovableLayer.d.ts +26 -0
  160. package/types/src/layer/SheetTableCommandLayer.d.ts +16 -0
  161. package/types/src/layer/SpillLayer.d.ts +22 -0
  162. package/types/src/layer/TableLayer.d.ts +22 -0
  163. package/types/src/layer/ValidationIndicatorLayer.d.ts +41 -0
  164. package/types/src/layer/index.d.ts +25 -0
  165. package/types/src/layer/resizeIndicatorState.d.ts +26 -0
  166. package/types/src/layer/useSheetFeatureRegions.d.ts +21 -0
  167. package/types/src/layer/useSheetVisibleCells.d.ts +60 -0
  168. package/types/src/layer/useSheetVisibleDecorations.d.ts +42 -0
  169. package/types/src/layer/useTableHeaderCells.d.ts +22 -0
  170. package/types/src/layer/useVisibleTables.d.ts +27 -0
  171. package/types/src/listener/index.d.ts +3 -0
  172. package/types/src/listener/useModelListener.d.ts +67 -0
  173. package/types/src/listener/useRangeListener.d.ts +15 -0
  174. package/types/src/movable/EmptyFrame.d.ts +16 -0
  175. package/types/src/movable/IMovableArea.d.ts +34 -0
  176. package/types/src/movable/MovableCommands.d.ts +22 -0
  177. package/types/src/movable/MovableFrame.d.ts +48 -0
  178. package/types/src/movable/MovableLayer.d.ts +77 -0
  179. package/types/src/movable/MoveableBundle.d.ts +4 -0
  180. package/types/src/movable/index.d.ts +4 -0
  181. package/types/src/picture/IPictureEditor.d.ts +39 -0
  182. package/types/src/picture/PictureEditor.d.ts +4 -0
  183. package/types/src/picture/index.d.ts +3 -0
  184. package/types/src/selection/SelectionCommands.d.ts +23 -0
  185. package/types/src/selection/SheetSelection.d.ts +53 -0
  186. package/types/src/selection/SheetSelectionLayer.d.ts +30 -0
  187. package/types/src/selection/index.d.ts +4 -0
  188. package/types/src/shape/ShapeEditor.d.ts +16 -0
  189. package/types/src/shape/index.d.ts +2 -0
  190. package/types/src/sheet/ConditionalFormatPresets.d.ts +56 -0
  191. package/types/src/sheet/ISheetElement.d.ts +233 -0
  192. package/types/src/sheet/ISheetHeaderElement.d.ts +138 -0
  193. package/types/src/sheet/NotImplemented.d.ts +3 -0
  194. package/types/src/sheet/SheetCommandProvider.d.ts +57 -0
  195. package/types/src/sheet/SheetCommands.d.ts +75 -0
  196. package/types/src/sheet/SheetElement.d.ts +15 -0
  197. package/types/src/sheet/SheetHeaderElement.d.ts +4 -0
  198. package/types/src/sheet/SheetScrollbar.d.ts +28 -0
  199. package/types/src/sheet/TopLeftCorner.d.ts +17 -0
  200. package/types/src/sheet/index.d.ts +7 -0
  201. package/types/src/slicer/SlicerEditor.d.ts +16 -0
  202. package/types/src/slicer/index.d.ts +2 -0
  203. package/types/src/tabStrip/SheetTab.d.ts +41 -0
  204. package/types/src/tabStrip/Sortable.d.ts +66 -0
  205. package/types/src/tabStrip/Tab.d.ts +19 -0
  206. package/types/src/tabStrip/TabStrip.d.ts +41 -0
  207. package/types/src/tabStrip/TabStripItem.d.ts +36 -0
  208. package/types/src/tabStrip/TabStripRow.d.ts +9 -0
  209. package/types/src/tabStrip/index.d.ts +7 -0
  210. package/types/src/table/TableCommands.d.ts +16 -0
  211. package/types/src/taskPane/ITaskPane.d.ts +72 -0
  212. package/types/src/taskPane/TaskPaneArea.d.ts +144 -0
  213. package/types/src/taskPane/TaskPaneFrame.d.ts +48 -0
  214. package/types/src/taskPane/TaskPaneRegistry.d.ts +108 -0
  215. package/types/src/taskPane/TaskPaneStrip.d.ts +33 -0
  216. package/types/src/taskPane/TaskPaneTitle.d.ts +24 -0
  217. package/types/src/taskPane/index.d.ts +7 -0
  218. package/types/src/taskPane/useTaskPane.d.ts +29 -0
  219. package/types/src/theme/DocThemesContext.d.ts +3 -0
  220. package/types/src/theme/DocThemesProvider.d.ts +15 -0
  221. package/types/src/theme/ThemeState.d.ts +19 -0
  222. package/types/src/theme/buildDocThemeCSS.d.ts +16 -0
  223. package/types/src/theme/buildOOXMLThemeCSS.d.ts +13 -0
  224. package/types/src/theme/createCSSSystemLookup.d.ts +51 -0
  225. package/types/src/theme/index.d.ts +11 -0
  226. package/types/src/theme/useAppColorScheme.d.ts +15 -0
  227. package/types/src/theme/useDocThemes.d.ts +3 -0
  228. package/types/src/theme/useGridColorScheme.d.ts +20 -0
  229. package/types/src/theme/useSystemColors.d.ts +44 -0
  230. package/types/src/undo/UndoCommands.d.ts +28 -0
  231. package/types/src/undo/UndoManagerContext.d.ts +14 -0
  232. package/types/src/undo/index.d.ts +3 -0
  233. package/types/src/workbook/DefaultRenderers.d.ts +14 -0
  234. package/types/src/workbook/GlobalWorkbookElement.d.ts +10 -0
  235. package/types/src/workbook/IWorkbookElement.d.ts +178 -0
  236. package/types/src/workbook/WindowChrome.d.ts +61 -0
  237. package/types/src/workbook/WorkbookCommandContributor.d.ts +24 -0
  238. package/types/src/workbook/WorkbookCommands.d.ts +97 -0
  239. package/types/src/workbook/WorkbookElement.d.ts +9 -0
  240. package/types/src/workbook/WorkbookStrip.d.ts +73 -0
  241. package/types/src/workbook/index.d.ts +17 -0
  242. package/types/src/workbook/resolveWorkbookInput.d.ts +27 -0
  243. package/types/src/workbook/useResolvedWorkbook.d.ts +31 -0
  244. package/types/src/workbook/useWindowChrome.d.ts +24 -0
  245. package/types/src/workbook/useWorkbookApp.d.ts +47 -0
  246. package/types/src/workbook/useWorkbookEncrypted.d.ts +15 -0
  247. package/types/src/workbook/useWorkbookFormat.d.ts +18 -0
  248. package/types/src/workbook/useWorkbookName.d.ts +13 -0
  249. package/types/src/workbook/useWorkbookSaveState.d.ts +29 -0
  250. package/browser/cjs/DNki9dGbSn_gUfd3.cjs +0 -7
  251. package/browser/cjs/Da611GSWMp5ncOGO.cjs +0 -16
  252. package/browser/cjs/F8ZECny0CwW2OV5X.cjs +0 -161
  253. package/browser/esm/BYGSBjns_83FWXAx.mjs +0 -3905
  254. package/browser/esm/CmObbQiLq9AAM7-q.mjs +0 -394
  255. package/browser/esm/Daa2g2QALCIHFgqP.mjs +0 -1377
  256. package/node/assets/style.css +0 -1
  257. package/node/esm/Bu9xI_rgkuupQ2AO.mjs +0 -11
@@ -0,0 +1,202 @@
1
+ import { CSSProperties } from 'react';
2
+ import { ICalculation } from '@sheetxl/sdk';
3
+ /** Gap (px) between the top of a hovered segment and the bottom of its eval tip. */
4
+ export declare const EVAL_TIP_GAP = 6;
5
+ /**
6
+ * The hover eval tip bubble — a small, non-interactive card showing a segment's evaluated value.
7
+ * Shared by every formula-hosting input (the cell editor, the reference field) so the tip reads the
8
+ * same everywhere; the host supplies `left`/`top` (viewport coords — the style is `position: fixed`,
9
+ * anchored bottom-center via the translate).
10
+ */
11
+ export declare const EVAL_TIP_STYLE: CSSProperties;
12
+ /** {@link useSelectDrag}'s handle. */
13
+ export interface SelectDrag {
14
+ /** `true` while a pointer-driven text selection is in progress. */
15
+ isDragging: () => boolean;
16
+ /**
17
+ * `true` while a pointer press OWNS the input — during the drag, and afterwards until the pointer
18
+ * actually moves ({@link HOVER_WAKE_DISTANCE}). The second half is what makes a click *dismiss*:
19
+ * the press leaves the pointer parked over the very text it just acted on, so without it the next
20
+ * stray `mousemove` re-arms a hover tip in the same place — indistinguishable from the tip the user
21
+ * clicked to get rid of. Moving the pointer at all is a deliberate hover and wakes it back up.
22
+ */
23
+ blocksHover: (e: {
24
+ clientX: number;
25
+ clientY: number;
26
+ }) => boolean;
27
+ /** Call from the input's `pointerdown`/`mousedown` — non-primary buttons are ignored. */
28
+ begin: (e?: {
29
+ button?: number;
30
+ clientX?: number;
31
+ clientY?: number;
32
+ }) => void;
33
+ }
34
+ /**
35
+ * Tracks a **text-selection drag** inside an input/textarea: `true` from the pointerdown that starts
36
+ * one until the pointer is released — which routinely happens OUTSIDE the input, hence the window
37
+ * listeners rather than a local `mouseup`.
38
+ *
39
+ * The hover eval tip has to yield to it. The tip is a *hover* affordance, but a drag-select is a
40
+ * mousemove with the button down, so it armed the tip on the very gesture meant to select text — and
41
+ * an armed tip both bands its run in the selection tint AND (in the cell editor) clears the input's
42
+ * own `::selection` tint so the two don't stack. Net effect: dragging over a formula painted a
43
+ * highlight that looked like, but wasn't, the selection, and the real selection was invisible
44
+ * underneath — reading as "this field can't select text". So hosts `begin()` on pointerdown and gate
45
+ * their hover handler on `isDragging()`.
46
+ */
47
+ export declare const useSelectDrag: (onBegin?: () => void, onEnd?: () => void) => SelectDrag;
48
+ /**
49
+ * Whether `el` holds a NON-COLLAPSED selection — the other half of the rule above: once the drag ends
50
+ * the user is *looking at* a selection, and re-arming the tip on the next stray mousemove would wipe
51
+ * its tint again. The tip returns as soon as the selection collapses (a plain click).
52
+ */
53
+ export declare const hasTextSelection: (el: HTMLInputElement | HTMLTextAreaElement | null) => boolean;
54
+ /**
55
+ * A hovered formula **segment**: the token range `[lo, hi]` (inclusive, into the full token list) that
56
+ * makes up one evaluable sub-expression, plus the `evalIndex` to evaluate it with. See
57
+ * {@link evalSegmentAt}.
58
+ */
59
+ export interface EvalSegment {
60
+ /** First token of the segment (inclusive). */
61
+ lo: number;
62
+ /** Last token of the segment (inclusive). */
63
+ hi: number;
64
+ /** The subtree-root eval index — pass to `IFormula.evaluate({ evalIndex })`. */
65
+ evalIndex: number;
66
+ }
67
+ /**
68
+ * The evaluable segment (AST subtree) that the token at `i` belongs to — the contiguous run of tokens
69
+ * whose `evalIndex` stays **≥** the hovered token's, bounded on each side by an enclosing token with a
70
+ * smaller `evalIndex` (or the ends of the array).
71
+ *
72
+ * @remarks
73
+ * `evalIndex` is BFS-assigned (root = 0, descendants strictly larger), so a subtree's tokens are
74
+ * contiguous in source order and every descendant carries a larger index than its subtree root. Two
75
+ * sibling subtrees are always parted by a parent-owned token (an operator, separator, or paren) that
76
+ * carries the *smaller* parent index — which is exactly where the ≥ scan stops. So hovering an
77
+ * operator/function token yields the whole call it heads.
78
+ *
79
+ * A range reference (`A1:A3`) reads as ONE unit here because the SDK gives every token of a reference
80
+ * literal the reference root's `evalIndex` (mirroring how they share one `referenceIndex`) — so hovering a
81
+ * corner evaluates the whole range, not the lone corner cell. That merge is the SDK's job, not this scan's.
82
+ *
83
+ * Returns `null` for a token with no `evalIndex` (whitespace in an unparsed tail, punctuation the engine
84
+ * couldn't place) — nothing to evaluate there.
85
+ */
86
+ export declare const evalSegmentAt: (tokens: readonly ICalculation.FormulaToken[], i: number) => EvalSegment | null;
87
+ /** What a text selection resolves to — see {@link evalTargetForSelection}. */
88
+ export interface SelectionTarget {
89
+ /** First token of the resolved run (inclusive) — what the host outlines. */
90
+ lo: number;
91
+ /** Last token of the resolved run (inclusive). */
92
+ hi: number;
93
+ /** Character span of `[lo, hi]` in the text — what F9 replaces. */
94
+ start: number;
95
+ end: number;
96
+ /**
97
+ * The run's text, to evaluate as a **standalone expression** (`=<fragment>`), or `null` to evaluate
98
+ * {@link evalIndex} on the whole formula instead. Set only when the run is a valid expression that
99
+ * ISN'T a subtree of the formula — see the note on {@link evalTargetForSelection}.
100
+ */
101
+ fragment: string | null;
102
+ /** The subtree to evaluate when {@link fragment} is `null`. */
103
+ evalIndex: number;
104
+ }
105
+ /**
106
+ * What a **text selection** in a formula resolves to — the eval tip's target, and F9's.
107
+ *
108
+ * Three rules, in order, because no single one is right:
109
+ *
110
+ * 1. **Exactly a subtree** → evaluate it in place (`evalIndex`). The common case: selecting
111
+ * `SUM(A1:A5)` inside `=SUM(A1:A5)*2`.
112
+ *
113
+ * 2. **A whole-token run that parses on its own** → evaluate that TEXT as its own expression. The
114
+ * subtree rule alone is not enough, because an operator chain is left-nested: `=1+1+1+1` is
115
+ * `(((1+1)+1)+1)`, so the middle `1+1` is *not* any node — its two operands live in different
116
+ * subtrees. Rule 1 would widen to `1+1+1` and answer 3 for a selection that plainly reads as 2.
117
+ * Excel's F9 works this way throughout (it evaluates the selected text, not a node), and this is
118
+ * where that shows.
119
+ *
120
+ * Whole-token alignment is what keeps this honest: `1*2` inside `=A1*2` parses, but it starts
121
+ * mid-token (`A1`), so it never reaches this rule and can't invent a value out of a coincidence.
122
+ *
123
+ * 3. **Otherwise** → snap OUTWARD to the smallest evaluable segment containing the selection. A drag
124
+ * that lands mid-token (`UM(A1:A5` in `=SUM(A1:A5)*2`) still answers — for `SUM(A1:A5)` — and the
125
+ * host's outline shows that it widened. Requiring a clean selection instead would leave the tip
126
+ * silent most of the time a human made the selection by hand.
127
+ *
128
+ * `null` when the selection touches nothing evaluable (whitespace only, an unparsed tail, or a
129
+ * selection past the tokens).
130
+ *
131
+ * @param base The offset of the first token within the text (`formulaPrefixLen` — a stripped `=`).
132
+ * @param isFragment Whether a run of text compiles as a standalone expression. Supplied by the host
133
+ * (it owns the calc engine); rule 2 is skipped entirely without it.
134
+ */
135
+ export declare const evalTargetForSelection: (tokens: readonly ICalculation.FormulaToken[] | null, base: number, text: string, start: number, end: number, isFragment?: (fragment: string) => boolean) => SelectionTarget | null;
136
+ /**
137
+ * The ROOT segment — the whole expression, `evalIndex` 0. Any trailing tokens the engine couldn't
138
+ * place (the `unparsed` tail of an in-progress formula, e.g. the `+` in `=SUM(A1)+`) are EXCLUDED:
139
+ * the root eval is the valid prefix, so the broken tail isn't part of what's evaluated. `null` when
140
+ * nothing parsed at all.
141
+ */
142
+ export declare const rootEvalSegment: (tokens: readonly ICalculation.FormulaToken[] | null) => EvalSegment | null;
143
+ /** The character span of tokens `[lo, hi]` within the text (`base` = the offset of token 0). */
144
+ export declare const charSpanOfTokens: (tokens: readonly ICalculation.FormulaToken[], base: number, lo: number, hi: number) => {
145
+ start: number;
146
+ end: number;
147
+ };
148
+ /** The separators {@link formatEvalLiteral} images a value with. */
149
+ export interface LiteralSeparators {
150
+ /** Decimal point within a number. */
151
+ decimal: string;
152
+ /** Between array COLUMNS. */
153
+ column: string;
154
+ /** Between array ROWS. */
155
+ row: string;
156
+ }
157
+ /**
158
+ * The formula separators a user of this locale types, keyed off the locale's decimal point — Excel's
159
+ * rule: a comma decimal pushes the argument/column separator to `;` and rows to the one remaining
160
+ * character.
161
+ *
162
+ * @remarks
163
+ * Mirrors the SDK's `formulaSeparatorsForDecimal` (`calculation/compiler/FormulaSeparators`), which is
164
+ * internal to the engine. This is the presentation side of the same rule, and it is only ever used to
165
+ * BUILD text that is then re-parsed and validated before it replaces anything (see
166
+ * {@link formatEvalLiteral}'s note) — so a drift between the two degrades F9 to a no-op rather than
167
+ * writing a formula the engine can't read.
168
+ */
169
+ export declare const literalSeparatorsForDecimal: (decimal: string) => LiteralSeparators;
170
+ /**
171
+ * An evaluated value as formula **source** — what F9 (evaluate-in-place) splices back into the text.
172
+ *
173
+ * The counterpart to {@link formatEvalValue}, and deliberately NOT the same function: that one
174
+ * produces DISPLAY text for a tip bubble (a string shows unquoted, a big range collapses to
175
+ * `{rows×cols}`), while this has to produce something the parser reads back as the same value —
176
+ * strings quoted, booleans as literals, arrays as real array syntax with this locale's separators.
177
+ *
178
+ * `null` (⇒ the host leaves the text alone) for anything that can't round-trip: a parse error, a
179
+ * non-finite number, an empty or oversized array ({@link MAX_LITERAL_CELLS}).
180
+ *
181
+ * @remarks
182
+ * Callers must re-parse the spliced result and abandon the edit if it doesn't compile. The locale
183
+ * surface here (separators, boolean words) is a mirror of the engine's, and a mismatch must cost the
184
+ * user nothing more than an F9 that didn't fire.
185
+ */
186
+ export declare const formatEvalLiteral: (v: unknown, seps: LiteralSeparators, booleans?: {
187
+ t: string;
188
+ f: string;
189
+ }) => string | null;
190
+ /**
191
+ * Human-readable text for a segment's evaluated value — the body of the hover eval tip — or `null` to show
192
+ * **nothing**. A scalar renders directly; a range renders as an Excel-style array literal (`{a, b; c, d}`,
193
+ * comma between columns, semicolon between rows) up to {@link MAX_TIP_CELLS} cells, then collapses to its
194
+ * `{rows×cols}` shape so a whole-column result can't blow up the tip.
195
+ *
196
+ * A **parse** error returns `null` (no tip): while typing, a segment is often a partial (unparsed) formula,
197
+ * and flashing `#…!` at the pointer is noise, not information. Genuine evaluation errors (`#DIV/0!`, `#REF!`,
198
+ * …) still render their code — those are real results worth showing. (Error cells inside an otherwise-valid
199
+ * array result likewise keep their code via {@link scalarText}.)
200
+ */
201
+ export declare const formatEvalValue: (v: unknown) => string | null;
202
+ //# sourceMappingURL=formulaEval.d.ts.map
@@ -0,0 +1,136 @@
1
+ import { default as React, CSSProperties } from 'react';
2
+ import { ICalculation } from '@sheetxl/sdk';
3
+ /**
4
+ * Shared **formula presentation** — what a formula LOOKS like while hosted in any editor chrome:
5
+ * paren pair matching (rainbow depth colors, caret/hover emphasis, orphan-close errors), the hover
6
+ * eval-run band, and the trailing "input expected" marker. Pure computations + tiny presentational
7
+ * pieces over `(tokens, caret, hover)` — no sessions, no DOM measurement, no component state.
8
+ *
9
+ * Consumed by BOTH editor tiers: the session stack's `SheetCellInput` (the in-grid editor + formula
10
+ * bar mirror) and the session-less field widgets (`useFormulaInputParts` → the plain `FormulaInput`,
11
+ * the MUI `FormulaField`). One home means a formula reads identically everywhere by construction.
12
+ */
13
+ /**
14
+ * Footprint of the trailing "input expected" marker, shared by the marker itself and the measurement
15
+ * mirror. The marker is real painted content that sits PAST the last character, so a host that sizes
16
+ * to its text has to reserve the same space — otherwise the reported natural width is short by this
17
+ * much and the box clips the end of the formula (the marker pushes the text out from under the
18
+ * visible box).
19
+ */
20
+ export declare const INPUT_EXPECTED_WIDTH = "0.6em";
21
+ export declare const INPUT_EXPECTED_MARGIN_LEFT = "1px";
22
+ /** The marker's total horizontal footprint — the space a text-sized host reserves while it shows. */
23
+ export declare const INPUT_EXPECTED_FOOTPRINT = "calc(0.6em + 1px)";
24
+ /**
25
+ * The "input expected" marker.
26
+ *
27
+ * Painted where an operand/argument is expected at the caret (`isInputExpectedAt`) — TRAILING after
28
+ * the last character (`=A1+|`), or mid-text in a cleared argument's slot (`=SUM(|,A1:C3)`), where it
29
+ * rides zero-width inside the caret's token span. Modeled on the marker Google Sheets shows.
30
+ *
31
+ * Takes ZERO in-flow width — the glyph overflows a 0-width anchor and paints into the
32
+ * {@link INPUT_EXPECTED_FOOTPRINT} of `paddingRight` a text-sized host reserves while it shows. The
33
+ * marker lives only in an overlay (a textarea/input can't hold elements), so any in-flow width here
34
+ * would shift the overlay's glyphs relative to the real control's under a right/center alignment —
35
+ * parking the caret visually AFTER the marker. Zero width + shared padding keeps the two layers'
36
+ * text layout (positions AND wrap points) identical in every alignment, with the caret before the
37
+ * marker.
38
+ */
39
+ export declare const InputExpectedMarker: React.FC;
40
+ /** Token types whose value equals what's typed — no eval tip for a lone literal (self-evident). */
41
+ export declare const SELF_EVIDENT_LITERAL: ReadonlySet<string>;
42
+ /**
43
+ * The hovered eval run's box style — background + a rounded 1px outline — applied to a SINGLE
44
+ * wrapper element around the run's tokens. Because it's one element rather than a per-token
45
+ * reconstruction, it styles like any ordinary box: swap these constants, target the
46
+ * `.formula-eval-run` class, or hoist this to a prop/theme token. The outline is an INSET box-shadow
47
+ * rather than a `border` so it adds no inline box and never shifts the overlaid text off the control.
48
+ */
49
+ export declare const EVAL_RUN_STYLE: CSSProperties;
50
+ /**
51
+ * The eval run as an OUTLINE only — the {@link EVAL_RUN_STYLE} box minus its fill.
52
+ *
53
+ * Used when the run was named by a text SELECTION rather than the pointer. There the control is
54
+ * already painting the native selection tint, and this band is the same color by design (see
55
+ * {@link EVAL_RUN_BG}), so filling it too would stack two identical highlights and blur the boundary
56
+ * of what the user actually selected. The outline alone says "this is the expression being
57
+ * evaluated" — and because the selection snaps outward to the enclosing expression, it will often
58
+ * enclose MORE than the tinted text, which is exactly the thing worth showing.
59
+ */
60
+ export declare const EVAL_RUN_OUTLINE_STYLE: CSSProperties;
61
+ /**
62
+ * The hue for a paren at `depth` (0 = outermost), cycling once the palette is exhausted.
63
+ * Theme-adaptive: emits `light-dark(light, dark)` so the browser re-picks from the subtree's
64
+ * `color-scheme` with no re-render — no `darkMode` flag needed (see `IColor.CSSMode`'s `'adaptive'`).
65
+ */
66
+ export declare const parenDepthColor: (depth: number) => string;
67
+ /**
68
+ * The zero-width slot the enlarged copy is painted from — the reason emphasis costs no layout.
69
+ *
70
+ * The overlay is painted over a TRANSPARENT-TEXT control, so its glyphs must stay metrically
71
+ * identical to the real ones: scaling or bolding anything in flow would slide every following
72
+ * character off the text it covers. So the real glyph stays in flow (transparent — it still owns the
73
+ * advance width and the hit-test box the hover eval tip measures) and the visible, scaled copy is
74
+ * painted from this box, which takes up no width and lets its content overflow. `inline-block` is
75
+ * what makes it exact: the copy is baseline-aligned to the surrounding text automatically, so it
76
+ * lands dead-on the glyph it replaces without any absolute-positioning arithmetic. `transform` never
77
+ * affects layout, so the scale is free.
78
+ */
79
+ export declare const PAREN_EMPHASIS_SLOT: CSSProperties;
80
+ export declare const parenEmphasisGlyph: (hue: string) => CSSProperties;
81
+ /** An unbalanced paren (no partner) — reuses the reference red so it reads as an error. */
82
+ export declare const PAREN_ERROR_COLOR = "var(--sxl-color-error, #d93025)";
83
+ /** The paren pairing of a token stream — see {@link computeParenMatch}. */
84
+ export interface ParenMatch {
85
+ /** Pairs each `(`/`)` token index with its partner (both directions). */
86
+ matchOf: ReadonlyMap<number, number>;
87
+ /** Each paren's nesting depth (0 = outermost) — drives the pair's color. */
88
+ depthOf: ReadonlyMap<number, number>;
89
+ /** Orphan CLOSE parens only — a `)` with no `(` (rendered red). */
90
+ unmatched: ReadonlySet<number>;
91
+ }
92
+ /**
93
+ * One stack pass over the tokens: `matchOf` pairs each `(`/`)` token index with its partner;
94
+ * `depthOf` records each paren's nesting depth (0 = outermost), which drives the pair's color;
95
+ * `unmatched` holds only an ORPHAN CLOSE — a `)` with no `(` (rendered red). A still-open `(` is NOT
96
+ * flagged: mid-typing a formula is unbalanced by nature (`=sum(` isn't an error yet), and reddening
97
+ * the open paren would make normal editing read as broken. Round parens only — braces/brackets later.
98
+ *
99
+ * An unclosed `(` still gets a depth, so a pair being typed picks up its color immediately rather
100
+ * than popping into one only once the `)` lands. An orphan `)` gets none — it renders as an error.
101
+ */
102
+ export declare const computeParenMatch: (tokens: readonly ICalculation.FormulaToken[] | null) => ParenMatch;
103
+ /**
104
+ * The round-paren `(`/`)` pair to emphasize when the caret is adjacent to one — prefers the paren
105
+ * just LEFT of the caret (the just-typed case), else the one just right. Returns the pair token
106
+ * indices sorted, or `null` (caret not next to a paren, or the paren is unbalanced — those render
107
+ * red instead).
108
+ */
109
+ export declare const parenPairAtCaret: (tokens: readonly ICalculation.FormulaToken[], matchOf: ReadonlyMap<number, number>, caret: number, base: number) => readonly [number, number] | null;
110
+ export declare const isSamePair: (a: readonly [number, number] | null, b: readonly [number, number] | null) => boolean;
111
+ /**
112
+ * Which parens paint EMPHASIZED (bigger + bolder). **Exactly one pair at a time** — in a formula
113
+ * with a dozen nested calls, two loud pairs read as two answers to "which pair is active?" and the
114
+ * emphasis stops meaning anything. So the two sources are a PRIORITY, not a union:
115
+ *
116
+ * 1. HOVER WINS. While the eval tip is up it owns the emphasis: the pair BOUNDING the hovered run.
117
+ * The band already says "this is the sub-expression"; its outer pair says which parens delimit
118
+ * it — the part that's genuinely hard to see when nested. Transient, so it overrides the caret
119
+ * and reverts.
120
+ * 2. Otherwise the caret's pair.
121
+ *
122
+ * "Bounding" = the first COMPLETE pair at the run's minimum depth (a close paren whose partner sits
123
+ * outside the run is skipped — it bounds something larger, not this). A run holding siblings —
124
+ * `(A1)+(B1)` — therefore lights the first pair only, keeping the one-pair rule.
125
+ *
126
+ * A hover owns the emphasis WHETHER OR NOT it lands on a pair: hovering a bare reference emphasizes
127
+ * nothing, rather than falling back to the caret's pair. The state you're pointing at is the state
128
+ * being described — a pair still lit somewhere else while you inspect a plain token is the same
129
+ * "which one is active?" ambiguity, just spread across two gestures instead of two pairs.
130
+ * Orphan `)` has no depth, so an error never emphasizes.
131
+ */
132
+ export declare const pickEmphasizedParens: (hoverRun: {
133
+ lo: number;
134
+ hi: number;
135
+ } | null, caretPair: readonly [number, number] | null, parenMatch: ParenMatch) => ReadonlySet<number>;
136
+ //# sourceMappingURL=formulaPresentation.d.ts.map
@@ -0,0 +1,80 @@
1
+ import { ICalculation, IRange } from '@sheetxl/sdk';
2
+ /**
3
+ * Characters after which an operand/argument is expected — the binary operators plus what can only
4
+ * PRECEDE an operand: the formula lead / unary `+` `-`, a group/call `(`, and the intersection
5
+ * operator ` `.
6
+ *
7
+ * Used to determine if we may enter 'point' mode (and whether a picked reference needs a `,`
8
+ * separator before it — see `SheetCellInput.insertReferenceToText`).
9
+ */
10
+ export declare const INPUT_EXPECTED_CHAR: string;
11
+ /**
12
+ * Whether an operand/argument is expected AT `caret` — the gate for the "input expected" marker and
13
+ * for insert-arming the reference picker at the caret.
14
+ *
15
+ * True when the character before the caret opens an operand slot ({@link INPUT_EXPECTED_CHAR}) AND
16
+ * nothing after the caret already fills it: the caret is at the end of the text (the classic trailing
17
+ * case — `=A1+|`), or the next non-space character still leaves the slot empty
18
+ * ({@link OPERAND_STILL_MISSING_CHAR}) — the mid-formula case a cleared argument leaves behind
19
+ * (`=SUM(|,A1:C3)`). A next character that STARTS an operand (`=|SUM(A1)`, `=SUM(1,|-2)`) means the
20
+ * slot is taken: the caret is doing text work there, and splicing a reference in would corrupt the
21
+ * token after it.
22
+ *
23
+ * (The caller decides what the text IS — a formula, a reference segment; this is the pure caret rule.)
24
+ */
25
+ export declare const isInputExpectedAt: (text: string, caret: number) => boolean;
26
+ /** Whether `value` is a formula being typed — Excel starts one with `=`, `+`, or `-`. */
27
+ export declare const isFormulaText: (value: string) => boolean;
28
+ /**
29
+ * How many leading characters of a formula the tokenizer leaves uncovered — the offset at which the SDK's
30
+ * tokens begin. `createFormula` strips a leading `=` (its tokens then start at offset 1), but
31
+ * keeps a leading `+`/`-` as a `prefix` token (tokens start at offset 0). Every caret↔token walk and every
32
+ * text-reassembly keys off this instead of assuming a bare `=`.
33
+ */
34
+ export declare const formulaPrefixLen: (value: string) => number;
35
+ /**
36
+ * Syntax color for a formula token, or `undefined` to inherit the cell's font color (operators, parens,
37
+ * separators, whitespace). Reference-literal tokens (`token.isReference` — cells AND the range operators
38
+ * that bind them, e.g. `:`) rotate through `PICKER_COLORS` by `referenceIndex`, so co-referenced ranges
39
+ * share a hue — LITERALLY the same color expressions the range picker draws its rectangles with, so text
40
+ * and on-grid rectangle always match, both follow light/dark for free, AND a field OUTSIDE any themed
41
+ * workbook surface (a standalone dialog/panel — no `--sxl-color-series-*` definitions in scope) still
42
+ * colors through the palette's built-in literal fallbacks. (A bare `var()` with no fallback computes to
43
+ * *nothing* there — references silently rendered in the plain text color.) Keying off the SDK's
44
+ * `isReference` (not a hardcoded type list) keeps the whole span, operators included, one color while a
45
+ * function that merely returns a reference stays function-colored.
46
+ */
47
+ export declare const tokenColor: (token: ICalculation.FormulaToken) => string | undefined;
48
+ /**
49
+ * Index of the token whose span contains `caret` (offsets start after the leading prefix — `base`; see
50
+ * {@link formulaPrefixLen}). At a boundary the LEFT token wins — the one just typed into — so the caret
51
+ * adopts the color of the character behind it. `-1` when the caret is in the prefix or past the end.
52
+ */
53
+ export declare const tokenIndexAtCaret: (tokens: readonly ICalculation.FormulaToken[], caret: number, base: number) => number;
54
+ /**
55
+ * Character span (after the leading prefix — `base`; see {@link formulaPrefixLen}) of the reference at
56
+ * `refIndex` — `start` = its first token's start, `end` = its last token's end. `null` if that reference
57
+ * isn't present. Walks the ORIGINAL tokens (faithful `text`); used to tell whether the caret is on a
58
+ * reference the picker rewrote, and to park it at that reference's end.
59
+ */
60
+ export declare const referenceSpan: (tokens: readonly ICalculation.FormulaToken[], refIndex: number, base: number) => {
61
+ start: number;
62
+ end: number;
63
+ } | null;
64
+ /**
65
+ * F4 — cycle `$` (relative ⇄ absolute) on the reference under the caret, as a PURE text rewrite.
66
+ * Tokenizes `value` (a formula string — `=`/`+`/`-` lead), reads the caret cell token's `refSide`
67
+ * (`self` / `left` / `right` — the range corner, provided by the SDK), cycles that corner on a
68
+ * throwaway formula (no commit), and returns the rewritten text plus the caret position at the END of
69
+ * the cell that was toggled (so the caret stays roughly in place rather than jumping mid-reference,
70
+ * and a repeat F4 stays on the same range). `null` when the caret isn't on a reference cell, the text
71
+ * isn't a formula, or the rewrite fails — the caller leaves the edit untouched.
72
+ *
73
+ * Shared by the cell editor's caret handle (`SheetCellInput`) and the reference field
74
+ * (`useFormulaInput`'s reference grammar, which runs it per comma-segment) so F4 behaves identically in both.
75
+ */
76
+ export declare const toggleReferenceInFormula: (calc: ICalculation, value: string, caret: number, home?: Partial<IRange.CellCoords>) => {
77
+ value: string;
78
+ caret: number;
79
+ } | null;
80
+ //# sourceMappingURL=formulaText.d.ts.map
@@ -0,0 +1,111 @@
1
+ import { IFunction } from '@sheetxl/sdk';
2
+ /**
3
+ * Split a rest/repeating parameter's name into its base and starting number: the trailing digits (or
4
+ * `1` if none), so `number` → `{ base: 'number', n: 1 }` and `values2` → `{ base: 'values', n: 2 }`.
5
+ *
6
+ * @remarks
7
+ * The shared numbering convention — the signature (`toSlots` in `FunctionPreviewPanel`) and the
8
+ * argument form ({@link toArgRows}) MUST agree on it, or `SUM`'s second slot reads `number2` in the
9
+ * hint and `number1` in the form.
10
+ */
11
+ export declare const restBase: (raw: string) => {
12
+ base: string;
13
+ n: number;
14
+ };
15
+ /**
16
+ * One row of the argument FORM — a concrete, fillable argument position.
17
+ *
18
+ * @remarks
19
+ * The counterpart to `FunctionPreviewPanel`'s `ArgSlot`, and deliberately not the same thing: a slot
20
+ * is a *caret window* over the signature (two wide, sliding, with `…` markers), while a row is one
21
+ * materialized field. Both derive their label / `descKey` / optionality the same way, so a parameter
22
+ * reads identically in the hint and in the form.
23
+ */
24
+ export interface ArgRow {
25
+ /** Stable React key. Rows only ever APPEND, so an index is stable too — this reads better. */
26
+ key: string;
27
+ /**
28
+ * The label as shown (`number1`, `criteriaRange2`).
29
+ *
30
+ * @remarks
31
+ * UNBRACKETED, unlike the signature's `[number2]`: the brackets are how one line of text says
32
+ * "optional" when it has nowhere else to put it. A form row has {@link optional} and its own
33
+ * emphasis (Excel bolds the required ones), so repeating the brackets would only be noise.
34
+ */
35
+ label: string;
36
+ /** The declared parameter this row fills (its type/enums drive the field). */
37
+ param: IFunction.IParameterType;
38
+ /**
39
+ * The key this row's description is filed under in the descriptor. Usually the parameter's name; a
40
+ * period-2+ repeating group documents its slots nested, as `group.slot`.
41
+ */
42
+ descKey: string;
43
+ /** Whether this row may be left empty. A repeating group's FIRST repetition is required. */
44
+ optional: boolean;
45
+ /**
46
+ * Whether MORE of this argument may follow — set on the trailing (spare) repetition of a rest
47
+ * parameter or repeating group, the row whose filling grows the form. The same fact the signature
48
+ * marks with its trailing `…`.
49
+ */
50
+ repeat?: boolean;
51
+ }
52
+ /**
53
+ * Expand a function's declared parameters into the concrete rows of an argument form, GROWN to fit
54
+ * what has been filled in so far.
55
+ *
56
+ * A plain parameter is one row. A **rest** parameter or a **repeating group** (`SUMIFS`'s
57
+ * range/criteria pair) is emitted a whole repetition at a time, with one spare repetition always
58
+ * waiting past the last one the user has touched — Excel's behavior: `SUM` opens on `number1` +
59
+ * `number2`, and typing into `number2` is what makes `number3` appear.
60
+ *
61
+ * @param params The callee's declared parameters, in order.
62
+ * @param filled The per-row texts the form currently holds (index-aligned with the returned rows),
63
+ * shorter or absent when nothing has been typed.
64
+ *
65
+ * @remarks
66
+ * Growth is driven by the LAST filled row rather than by a count of the non-empty ones: a blank in
67
+ * the middle is a legal argument (`=IF(A1,,B1)`), so `['A1', '', 'A3']` must keep three rows plus the
68
+ * spare, not shrink back to two and drop what the user typed.
69
+ *
70
+ * A declaration may also carry parameters AFTER the group (`SWITCH`'s `default`). Those rows follow
71
+ * the repetitions, and are excluded from the scan that grows them — otherwise filling the trailing
72
+ * one would keep adding repetitions in front of itself. The one case that stays ambiguous is a group
73
+ * whose final repetition AND suffix are both filled: a flat, positional text array cannot say which
74
+ * of the two a value belongs to once the rows in between move. No declaration in the catalog has that
75
+ * shape today (every repeating group is the last parameter).
76
+ */
77
+ export declare const toArgRows: (params: readonly IFunction.IParameterType[], filled?: readonly string[]) => ArgRow[];
78
+ /** Options for {@link assembleCall}. */
79
+ export interface AssembleCallOptions {
80
+ /**
81
+ * The workbook locale's argument separator (`,` or `;`).
82
+ *
83
+ * @defaultValue `','`
84
+ *
85
+ * @remarks
86
+ * `FunctionHint.argSeparator` is where a caller with a hint already has it.
87
+ */
88
+ separator?: string;
89
+ /**
90
+ * Prefix the call with `=`.
91
+ *
92
+ * @defaultValue `true` — the text is a formula (what a cell takes, and what
93
+ * `createFormula` evaluates).
94
+ */
95
+ equals?: boolean;
96
+ }
97
+ /**
98
+ * Assemble the argument texts into the call to insert — `=SUM(A1:A5,B1)`.
99
+ *
100
+ * Trailing **optional** arguments that were left empty are dropped; nothing else is. A blank in the
101
+ * middle is meaningful — `=IF(A1,,B1)` is a legal formula and is NOT `=IF(A1,B1)` — and so is a blank
102
+ * required argument, which keeps the call's arity honest while the form is half-filled. An untouched
103
+ * form assembles to the bare `=NAME()`.
104
+ *
105
+ * @param name The function name to write — the LOCALIZED one where the user is typing in their own
106
+ * language (`hint.nameLocal`), since that is what the cell will hold.
107
+ * @param rows The form's rows, from {@link toArgRows} (their optionality is what may be trimmed).
108
+ * @param filled The per-row texts, index-aligned with `rows`.
109
+ */
110
+ export declare const assembleCall: (name: string, rows: readonly ArgRow[], filled: readonly string[], options?: AssembleCallOptions) => string;
111
+ //# sourceMappingURL=functionArgs.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { IFunction } from '@sheetxl/sdk';
2
+ import { FunctionHint, FunctionDescriptor } from './FunctionPreviewPanel';
3
+ /** Options for {@link createFunctionHint}. */
4
+ export interface CreateFunctionHintOptions {
5
+ /**
6
+ * Which argument to emphasize.
7
+ *
8
+ * @defaultValue `-1` — none, the BROWSING state (a function being read rather than filled in).
9
+ */
10
+ argIndex?: number;
11
+ /**
12
+ * The workbook locale, for the argument separator (`,` vs `;`).
13
+ *
14
+ * @defaultValue `'en'`
15
+ */
16
+ locale?: string | null;
17
+ }
18
+ /**
19
+ * Builds the {@link FunctionHint} that {@link FunctionSignature} / {@link FunctionPreviewContent}
20
+ * render, from a function the caller ALREADY has.
21
+ *
22
+ * @remarks
23
+ * The editor derives its hint from the caret (which function is open, which argument the caret sits
24
+ * in — see `useFormulaHints`); a picker derives it from a chosen function and no caret. Same hint,
25
+ * two sources, so the display conventions live here rather than in each: the localized display name
26
+ * read synchronously from the active pack (Plane 3, canonical name stays the identity), and the
27
+ * argument separator from the workbook locale (Plane 1) rather than a hard-coded comma.
28
+ */
29
+ export declare const createFunctionHint: (fn: IFunction, options?: CreateFunctionHintOptions) => FunctionHint;
30
+ /**
31
+ * Adapts a resolved SDK descriptor to the {@link FunctionDescriptor} the preview renders.
32
+ *
33
+ * @param name The CANONICAL function name — what the preview matches against the hint to tell a
34
+ * current descriptor from one still arriving for the previous function.
35
+ */
36
+ export declare const createFunctionDescriptor: (name: string, descriptor: IFunction.IDescriptor) => FunctionDescriptor;
37
+ //# sourceMappingURL=functionHint.d.ts.map
@@ -0,0 +1,18 @@
1
+ export * from './SheetEditable';
2
+ export * from './formulaText';
3
+ export * from './formulaEval';
4
+ export * from './useReferenceMode';
5
+ export * from './referencePointNav';
6
+ export * from './useFormulaInput';
7
+ export * from './SheetCellInput';
8
+ export * from './FunctionPreviewPanel';
9
+ export * from './functionHint';
10
+ export * from './functionArgs';
11
+ export * from './NamedItemsPanel';
12
+ export * from './NamedHintPanel';
13
+ export * from './EditorCommands';
14
+ export * from './useProtectedEditNotice';
15
+ export * from './SheetCellEditorLayer';
16
+ export * from './SheetReferenceLayer';
17
+ export * from './SheetReferenceHeaderLayer';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { default as React } from 'react';
2
+ import { ReferenceModeState } from './useReferenceMode';
3
+ /** `true` while a point-nav seed / re-home write is in flight (see the fence note above). */
4
+ export declare const isReferencePointSeeding: () => boolean;
5
+ /**
6
+ * The shared **point-mode navigation** keymap — the reference-picking keys every host routes the same
7
+ * way, so key routing "just works" wherever focus happens to be (the inline editor, the formula bar, a
8
+ * grid pane layer, a dialog range field):
9
+ *
10
+ * - Arrow → move the active reference (`navigate`)
11
+ * - Shift+Arrow → extend it (`navigate` select)
12
+ * - Ctrl/Cmd+Arrow → jump to the content edge (`navigate` contentful)
13
+ * - Ctrl+Space → select the whole column (`selectRegion` column)
14
+ * - Shift+Space → select the whole row (`selectRegion` row)
15
+ * - Ctrl+Shift+Space → select the whole region (`selectRegion` both)
16
+ *
17
+ * Only these are consumed (`preventDefault` + `stopPropagation`); anything else returns `false` and the
18
+ * host's own handling proceeds. **Done/leave keys (Enter / Tab / Escape and their variants) are
19
+ * deliberately NOT here** — they are host policy: a focused editor commits/cancels through its own
20
+ * keymap, the grid layer routes them to the bus's producer-supplied `onDone`, and a dialog picker wants
21
+ * them back in the dialog. A shared table for them would steal exactly the keys hosts must own.
22
+ *
23
+ * Operates purely on the bus state's {@link ReferenceModeState.selection} — no editor, no session. When
24
+ * the caret isn't on a reference yet (INSERT: `rangeIndex < 0`) the first key seeds an active range at
25
+ * the selection's anchor cell (fenced — see {@link isReferencePointSeeding}) and then navigates, so the
26
+ * write-back inserts the *navigated* range, even for the first keystroke.
27
+ *
28
+ * @param e The keydown, from whatever host captured it.
29
+ * @param state The current bus state (caller checks armedness policy; this checks `mode === 'point'`).
30
+ * @param pointScope The sheet the user is POINTING AT — always required, always stamped (the inverted
31
+ * reporting rule: a picker's report carries its scope unconditionally; the consumer localizes). A grid
32
+ * pane passes its own sheet; an input host passes the workbook's DISPLAYED sheet (Excel: keyboard
33
+ * pointing targets the sheet you are looking at). The seed — and, on a re-scope, the active
34
+ * reference — is re-homed here before the move, the same semantics as the mouse path's pane-side
35
+ * stamping (`scopeDrawnRanges`).
36
+ * @returns `true` when the key was consumed (a point-nav key while `'point'` is armed).
37
+ */
38
+ export declare const handleReferencePointNav: (e: React.KeyboardEvent, state: ReferenceModeState | null, pointScope: string) => boolean;
39
+ //# sourceMappingURL=referencePointNav.d.ts.map