@sheetxl/react 0.7.27 → 0.7.28-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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/BPJdKxa9KFZWhw7o.mjs +6286 -0
  5. package/browser/esm/index.mjs +19258 -4911
  6. package/licenses/dependencies.txt +42 -214
  7. package/node/esm/CUEW3f18r-pU7F0q.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,86 @@
1
+ import { default as React } from 'react';
2
+ import { ICalculation, ICellRanges, IRange, IWorkbook } from '@sheetxl/sdk';
3
+ import { FormulaInputApi, FormulaInputGrammar, FormulaInputEquals } from '../editor/useFormulaInput';
4
+ import { ReferenceDoneArgs } from '../editor/useReferenceMode';
5
+ /**
6
+ * Props for the plain-DOM {@link FormulaInput} — the UI-kit-free field whose value is an
7
+ * `ICalculation.IFormula`.
8
+ */
9
+ export interface FormulaInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
10
+ /**
11
+ * The field's grammar. `'formula'` (default) accepts any expression (`=SUM(A1:A5)*2`);
12
+ * `'reference'` is the "limit input" specialization — a pure reference list
13
+ * (`Sheet1!A1:B2, Sheet2!C1`), rejecting function calls and computed references per
14
+ * `ICalculation.IFormula.isReferenceOnly` (Excel's RefEdit contract). See {@link FormulaInputGrammar}.
15
+ */
16
+ grammar?: FormulaInputGrammar;
17
+ /** The committed value. See `UseFormulaInputOptions.value`. */
18
+ value: ICalculation.IFormula | ICellRanges | string | null;
19
+ /** Live change notification (valid states only). See `UseFormulaInputOptions.onChange`. */
20
+ onChangeInput?: (value: ICalculation.IFormula | null) => void;
21
+ /**
22
+ * Raw display-text notification — invalid states included, regardless of `changeOn`. For hosts that
23
+ * persist authored TEXT rather than a parsed value. See `UseFormulaInputOptions.onChangeText`.
24
+ */
25
+ onChangeText?: (text: string) => void;
26
+ /** The commit channel. See `UseFormulaInputOptions.onDone`. */
27
+ onDone?: (value: ICalculation.IFormula | null, args: ReferenceDoneArgs) => void;
28
+ /** `'done'` suppresses the live notifications — the host hears only `onDone`. Default `'live'`. */
29
+ changeOn?: 'live' | 'done';
30
+ /** Resolution/picking context. Defaults to the enclosing `WorkbookContext`. */
31
+ workbook?: IWorkbook | null;
32
+ /** The headless field API, for host-driven commit points (a dialog's OK → `apiRef.current?.commit()`). */
33
+ apiRef?: React.Ref<FormulaInputApi>;
34
+ /** Hide the adornment cluster (✓/✗ while engaged in modal mode; the select-current action). */
35
+ hideAdornment?: boolean;
36
+ /** Hide the error line under the field (hosts that surface `api.error` themselves). */
37
+ hideError?: boolean;
38
+ /**
39
+ * The field's HOME anchor — the coords (with `scope`) a bare reference (`A1`) resolves against and
40
+ * serializes bare for. Pass it when the host has one (a table's sheet, a conditional-format rule's
41
+ * cell, a chart's sheet). BOTH grammars honor it — a field with no home has no bare form and stays
42
+ * fully qualified, picks included; the visible tab does not stand in for one.
43
+ */
44
+ home?: Partial<IRange.CellCoords>;
45
+ /**
46
+ * Leading-`=` policy. Default `'optional'` (`=SUM(A1)` and `SUM(A1)` mean the same formula).
47
+ * `'formula'` grammar only — a `'reference'` field never takes one.
48
+ */
49
+ equals?: FormulaInputEquals;
50
+ /**
51
+ * What a PICK writes — `'absolute'` (`$A$1:$B$2`) or `'relative'` (`A1:B2`). Default `'relative'`
52
+ * (the cell editor's behavior). A DEFAULT, not a constraint: typing and F4 still reach either form,
53
+ * and a value handed in keeps the fixability it came with. `'absolute'` is the defined-name and
54
+ * table-resize shape. See `UseFormulaInputOptions.pickAs`.
55
+ */
56
+ pickAs?: 'absolute' | 'relative';
57
+ /**
58
+ * Allow a comma-separated multi-range reference (typed, or Ctrl+click-picked). Default `false`.
59
+ * `'reference'` grammar only — a `'formula'` field always allows every reference its expression holds.
60
+ */
61
+ allowMulti?: boolean;
62
+ /**
63
+ * Whether references may reach other sheets. Default `true`. Set `false` for a single-sheet input (a
64
+ * table's range, conditional formatting's "Applies to"): typed cross-sheet references become errors,
65
+ * the grid refuses picks on other sheets, and addresses display bare. See
66
+ * `UseFormulaInputOptions.allowCrossSheet`; independent of {@link allowMulti}.
67
+ */
68
+ allowCrossSheet?: boolean;
69
+ }
70
+ /**
71
+ * The **formula field** — the plain-DOM (UI-kit-free) input whose value is an
72
+ * `ICalculation.IFormula` (accepted as `IFormula | string`; always emitted as `IFormula`). One
73
+ * component covers both grammars (see {@link FormulaInputProps.grammar}): a `'formula'` field colors
74
+ * its TOKENS with the editor's syntax palette (references by picker index), a `'reference'` field
75
+ * colors its comma-SEGMENTS by picker index (segment i IS picker range i IS its on-grid rectangle).
76
+ * Hovering an evaluable span shows its value, and while focused the field is the reference-mode bus
77
+ * producer — clicking/dragging on the grid writes references into the text, exactly like the cell
78
+ * editor.
79
+ *
80
+ * A thin chrome over the headless `useFormulaInput` + the shared parts (`useFormulaInputParts`),
81
+ * themed via `--sxl-*` CSS variables. A UI-kit adapter (the MUI
82
+ * `FormulaField` in `studio-mui`) composes that same hook + parts around its own field — it does not
83
+ * wrap this component (a kit's field insists on owning the `<input>`).
84
+ */
85
+ export declare const FormulaInput: React.NamedExoticComponent<FormulaInputProps & React.RefAttributes<HTMLDivElement>>;
86
+ //# sourceMappingURL=FormulaInput.d.ts.map
@@ -0,0 +1,94 @@
1
+ import { default as React } from 'react';
2
+ import { IRange, IWorkbook } from '@sheetxl/sdk';
3
+ import { FormulaInputApi, FormulaInputGrammar } from '../editor/useFormulaInput';
4
+ export interface UseFormulaInputPartsOptions {
5
+ /** The headless field API driving this chrome (`useFormulaInput`). */
6
+ api: FormulaInputApi;
7
+ /** {@inheritDoc FormulaInputGrammar} */
8
+ grammar: FormulaInputGrammar;
9
+ /** Disabled fields render plain glyphs — no overlay, no tip. */
10
+ disabled?: boolean;
11
+ /**
12
+ * Resolution context for the `'formula'`-grammar eval tip. Defaults to the enclosing
13
+ * `WorkbookContext` (the same resolution the headless core applies).
14
+ */
15
+ workbook?: IWorkbook | null;
16
+ /** The formula's HOME anchor (`'formula'` grammar) — bare references evaluate against it. */
17
+ home?: Partial<IRange.CellCoords>;
18
+ }
19
+ /**
20
+ * What {@link useFormulaInputParts} hands a field chrome. Wire the three refs (the positioned
21
+ * container is the overlay's containing block; the input is what gets measured), spread
22
+ * {@link FormulaInputParts.inputHandlers} onto the `<input>` (merging with the chrome's own), make
23
+ * the input's glyphs transparent while {@link FormulaInputParts.overlayActive}, and render
24
+ * {@link FormulaInputParts.overlayElement} inside the container and
25
+ * {@link FormulaInputParts.tipElement} anywhere (it portals to `document.body`).
26
+ */
27
+ export interface FormulaInputParts {
28
+ /** Attach to the `position: relative` container — the overlay's containing block. */
29
+ containerRef: React.RefObject<HTMLDivElement | null>;
30
+ /** Attach to the real `<input>` (alongside `api.inputProps.ref`). */
31
+ inputElRef: React.RefObject<HTMLInputElement | null>;
32
+ /**
33
+ * `true` while the coloring overlay paints the glyphs — the input's own text should go
34
+ * `color: transparent` (keep the caret via `caretColor`).
35
+ */
36
+ overlayActive: boolean;
37
+ /** Handlers for the `<input>` — scroll sync, hover eval hit-testing, caret tracking. */
38
+ inputHandlers: {
39
+ onScroll: (e: React.UIEvent<HTMLInputElement>) => void;
40
+ onMouseMove: (e: React.MouseEvent) => void;
41
+ onMouseLeave: () => void;
42
+ /** Chain AFTER `api.inputProps.onSelect` — tracks the caret for the paren-pair emphasis. */
43
+ onSelect: (e: React.SyntheticEvent) => void;
44
+ /** Clicking back into the field re-summons a dismissed hint popup (Excel-style). */
45
+ onPointerDown: (e: React.PointerEvent) => void;
46
+ };
47
+ /**
48
+ * The shared parts' keyboard: the hint popup's (autocomplete list nav; Escape dismisses an open
49
+ * popup without cancelling) plus **F9** (evaluate in place). Chromes call this FIRST in their
50
+ * `onKeyDown` — `true` = consumed.
51
+ */
52
+ handleKeyDown(e: React.KeyboardEvent): boolean;
53
+ /** The hint float (function autocomplete + signature preview). Render anywhere in the chrome. */
54
+ hintElement: React.ReactNode;
55
+ /**
56
+ * `'formula'` grammar, while engaged: an operand is expected at the caret (the "input expected"
57
+ * marker is showing — trailing `=A1+|`, or a cleared argument `=SUM(|,A1:C3)`). The user is 99%
58
+ * mid-typing — chromes should NOT present `api.error` as "invalid" while this holds (the commit
59
+ * gate still blocks an incomplete accept).
60
+ */
61
+ inputExpected: boolean;
62
+ /** The measured coloring overlay (`null` while inactive/unmeasured). Render inside the container. */
63
+ overlayElement: React.ReactNode;
64
+ /** The hover eval bubble, portaled to `document.body` (`null` when nothing is hovered). */
65
+ tipElement: React.ReactNode;
66
+ }
67
+ /**
68
+ * The shared **field chrome parts** — everything a formula-backed field paints, extracted so each
69
+ * chrome (the plain-DOM `FormulaInput` here, the MUI `FormulaField` in `studio-mui`) is only its
70
+ * kit-specific field + adornments around the same headless hook + these parts. The presentation
71
+ * pieces themselves (paren matching, the eval-run band, the "input expected" marker) live in the
72
+ * shared `formulaPresentation` module — the SAME code the cell editor (`SheetCellInput`) renders, so
73
+ * a formula reads identically in a field and in the grid by construction.
74
+ *
75
+ * Fields are ALWAYS colored (the Excel-online model) — with one exception: while ANOTHER input is
76
+ * the reference-mode bus producer (another field picking, a cell-formula edit), this field stands
77
+ * down to plain text. Every field shares one picker palette and only the producer's ranges are on
78
+ * the grid, so the active editor must own the highlight language alone — a bystander painted in the
79
+ * same colors reads as linked to the pick when it isn't.
80
+ *
81
+ * The overlay itself is the formula editor's trick: the input's own glyphs go transparent and an
82
+ * identically-measured overlay paints each span — TOKENS with the editor's syntax palette in
83
+ * `'formula'` grammar (references by picker index via `tokenColor`, parens by nesting depth, orphan
84
+ * closes red, the caret's/hovered pair emphasized), comma-SEGMENTS by picker index in `'reference'`
85
+ * grammar (segment i = picker range i = its on-grid rectangle's color). The overlay copies the
86
+ * input's measured box + computed text styles, so it tracks any host styling (a MUI TextField
87
+ * variant, a `--sxl-*`-themed plain input) without duplicating it. Hovering an evaluable span shows
88
+ * its value in the shared eval bubble (portaled to body — a transformed/overflow-clipped dialog
89
+ * ancestor can't trap or offset it) and bands the run being evaluated. While ENGAGED, a `'formula'`
90
+ * field whose last character expects an operand shows the trailing "input expected" marker
91
+ * (Sheets-style).
92
+ */
93
+ export declare const useFormulaInputParts: (options: UseFormulaInputPartsOptions) => FormulaInputParts;
94
+ //# sourceMappingURL=FormulaInputParts.d.ts.map
@@ -0,0 +1,5 @@
1
+ export * from './useEditCommit';
2
+ export * from './useInputField';
3
+ export * from './FormulaInput';
4
+ export * from './FormulaInputParts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,174 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Why an edit finished, and (when keyboard-driven) on which key — the argument every field's COMMIT
4
+ * channel (`onDone`) carries.
5
+ *
6
+ * @remarks
7
+ * `'cancel'` delivers the value the field REVERTED to (the session baseline), not the abandoned text.
8
+ */
9
+ export interface EditDoneArgs {
10
+ reason: 'accept' | 'cancel';
11
+ /** The done key that triggered this, when keyboard-driven. */
12
+ key?: 'Enter' | 'Tab' | 'Escape';
13
+ /** Shift held on the done key (e.g. reverse traverse/field direction). */
14
+ shiftKey?: boolean;
15
+ /** Alt held on the done key. */
16
+ altKey?: boolean;
17
+ }
18
+ /**
19
+ * What a field's text→value step returns.
20
+ *
21
+ * @remarks
22
+ * `value: undefined` is NOT `null`: it means "this text yields no opinion" — the last valid value
23
+ * stands and nothing is emitted (a formula field with no workbook degrades this way). `null` is a
24
+ * real value ("cleared") and IS emitted.
25
+ */
26
+ export interface EditParseResult<V> {
27
+ /** The parsed value, `null` for cleared, `undefined` for "no opinion" (see the remarks). */
28
+ value?: V | null;
29
+ /** A message KEY for invalid text (translated at display), or `null` when valid. */
30
+ error: string | null;
31
+ }
32
+ /**
33
+ * The host's modal-edit SESSION, as the commit policy needs to see it. What a session *is* differs
34
+ * per field — a formula field is engaged on the reference-mode bus (grid picks write into it); a
35
+ * plain field is simply focused — but the done rules only need "is one open" and "end it".
36
+ */
37
+ export interface EditCommitSession {
38
+ /** Whether a session is open right now. */
39
+ isActive(): boolean;
40
+ /**
41
+ * End the OPEN session: revert to the session baseline on a cancel, return to idle, and deliver the
42
+ * commit channel ({@link EditCommitApi.notifyDone}). Never called while {@link isActive} is `false`.
43
+ */
44
+ end(args: EditDoneArgs): void;
45
+ }
46
+ export interface UseEditCommitOptions<V> {
47
+ /** The display text at mount (the committed value, serialized). */
48
+ initialText?: string;
49
+ /** Text → value (or an error key). Called on every text state; must not throw. */
50
+ parse: (text: string) => EditParseResult<V>;
51
+ /**
52
+ * `'done'` suppresses the live {@link onChange} notifications entirely (parsing still runs, so the
53
+ * error state and the commit-channel value stay current) and makes Enter the field's OWN commit
54
+ * point rather than a key the host form gets to see. Default `'live'`.
55
+ */
56
+ changeOn?: 'live' | 'done';
57
+ /** The live PREVIEW channel — every valid text state. */
58
+ onChange?: (value: V | null) => void;
59
+ /**
60
+ * The raw TEXT channel: every display-text change the user causes (typed, picked, reverted) —
61
+ * INVALID states included, and regardless of `changeOn`.
62
+ *
63
+ * For hosts that persist authored text rather than a parsed value (an editor writing through to a
64
+ * draft, which validates at save): {@link onChange} would leave them holding the last VALID text
65
+ * while the field shows something else. An outside {@link resetCommitted} does NOT fire it — the
66
+ * host already has that text.
67
+ */
68
+ onChangeText?: (text: string) => void;
69
+ /** The COMMIT channel — see {@link EditCommitApi.notifyDone}. */
70
+ onDone?: (value: V | null, args: EditDoneArgs) => void;
71
+ /** {@inheritDoc EditCommitSession} */
72
+ session: EditCommitSession;
73
+ }
74
+ /** {@inheritDoc useEditCommit} */
75
+ export interface EditCommitApi<V> {
76
+ /** The live display text. */
77
+ text: string;
78
+ /** Parse/validation error for the current text (a message key; `null` when valid). */
79
+ error: string | null;
80
+ /** `true` when the text differs from the committed value's text. */
81
+ dirty: boolean;
82
+ /** {@link text} readable synchronously (the handlers run outside render). */
83
+ textRef: React.RefObject<string>;
84
+ /** The last COMMITTED text — what an idle revert returns to. */
85
+ committedTextRef: React.RefObject<string>;
86
+ /** The text as of the current session's start — what a cancel reverts to. */
87
+ baselineTextRef: React.RefObject<string>;
88
+ /** {@link dirty}, synchronously. */
89
+ dirtyRef: React.RefObject<boolean>;
90
+ /** {@link error}, synchronously (the commit gate runs inside event handlers). */
91
+ errorRef: React.RefObject<string | null>;
92
+ /**
93
+ * Whether the user has EDITED since the session started — what Escape claims the key on. Distinct
94
+ * from {@link dirty} (text ≠ committed) and from "text ≠ baseline": a round-trip back to the
95
+ * starting text leaves this `true`.
96
+ */
97
+ touchedRef: React.RefObject<boolean>;
98
+ /** The last successfully parsed value — what the commit channel delivers. */
99
+ lastValidRef: React.RefObject<V | null>;
100
+ /** Set the display text (and re-derive {@link dirty}). Does NOT parse — pair with {@link liveChange}. */
101
+ setText(next: string): void;
102
+ /** Set the error state directly (e.g. clearing it alongside a revert). */
103
+ setError(next: string | null): void;
104
+ /** Parse `next` → error state + last valid value, emitting on the live channel per `changeOn`. */
105
+ liveChange(next: string): void;
106
+ /**
107
+ * Deliver the COMMIT channel once for a finished edit. An accept while the text is INVALID is
108
+ * swallowed (the stale last-valid value must not escape; the error stays shown to fix or Escape); a
109
+ * cancel always fires. A delivered accept re-bases the committed text, so the field reads clean and
110
+ * a follow-up blur cannot re-deliver the same accept.
111
+ */
112
+ notifyDone(args: EditDoneArgs): void;
113
+ /** Restore the committed text (the idle, field-level Escape) and re-parse it. */
114
+ revertToCommitted(): void;
115
+ /** Restore the session-start text (a cancel) and re-parse it. */
116
+ revertToBaseline(): void;
117
+ /** Adopt `next` as the committed text (an outside value change): clean, unerrored, revert target. */
118
+ resetCommitted(next: string, value?: V | null): void;
119
+ /** A session is starting: the CURRENT text becomes the cancel baseline. */
120
+ beginSession(): void;
121
+ /**
122
+ * The shared done-key policy — Escape / Enter / Tab, per `changeOn` (see the module doc). Returns
123
+ * `true` when the key was the field's to handle, so the host can stop there.
124
+ */
125
+ handleDoneKeys(e: React.KeyboardEvent): boolean;
126
+ /**
127
+ * The keys a focused input owns NATIVELY — consume them so the app's command dispatch never sees
128
+ * them. Returns `true` when the key was consumed; call AFTER {@link handleDoneKeys}.
129
+ */
130
+ handleTextKeys(e: React.KeyboardEvent): boolean;
131
+ /** Any new key resets the one-shot blur guard — call at the TOP of the host's key handler. */
132
+ resetBlurGuard(): void;
133
+ /**
134
+ * Read + clear the one-shot guard: `true` means a done key already delivered this gesture's commit
135
+ * and the blur that follows it must not deliver a second one.
136
+ */
137
+ consumeBlurGuard(): boolean;
138
+ /** Explicit accept (a dialog's OK, the adornment ✓). */
139
+ commit(): void;
140
+ /** Explicit cancel (a dialog's Cancel, the adornment ✗) — always fires the commit channel. */
141
+ cancel(): void;
142
+ }
143
+ /**
144
+ * The **edit/commit state machine** shared by every value-controlled field — the part of a field that
145
+ * has nothing to do with what it edits: the two baselines, the dirty flag, the live vs commit
146
+ * channels, and the done-key policy.
147
+ *
148
+ * The rules it owns, once, for every field:
149
+ *
150
+ * - **Two baselines.** `committedText` is the last ACCEPTED value; `baselineText` is the text when the
151
+ * current session started. They differ because the live-change model applies every intermediate
152
+ * change — "the value before" can then only mean before-the-session, not before-the-last-change.
153
+ * - **Escape is two-level.** Session open + TOUCHED → cancel (revert to the baseline, `onDone` with
154
+ * `reason: 'cancel'`). Idle + dirty → a plain revert to the committed text, no commit channel.
155
+ * An UNTOUCHED session → the key is NOT captured, so a host dialog still closes on it. "Touched",
156
+ * not "changed": an edit that lands back on the starting text is still one to Escape out of.
157
+ * - **Enter belongs to whoever owns the commit.** `changeOn: 'done'` captures it (the field is the
158
+ * commit point); `'live'` lets it bubble to the host's default button, finishing any open session
159
+ * first.
160
+ * - **Tab commits then advances** — un-captured, so the natural tab order still runs. Invalid text
161
+ * CANCELS instead of committing, so focus never advances carrying an error.
162
+ * - **Invalid never commits** on any accept path; **blur commits only when dirty**; and a done key
163
+ * plus the blur it causes are ONE gesture, delivered once (the one-shot guard).
164
+ * - **The input owns its text keys.** Delete / caret motion / the native chords are consumed
165
+ * ({@link EditCommitApi.handleTextKeys}) so they never reach the app's command dispatch.
166
+ *
167
+ * Hosts keep their own concerns — a formula field's reference bus and grammar, a plain field's
168
+ * validation — and wire them in through {@link UseEditCommitOptions.parse} and
169
+ * {@link EditCommitSession}.
170
+ *
171
+ * @see `useFormulaInput` and `useInputField`, the two hooks built on this.
172
+ */
173
+ export declare const useEditCommit: <V>(options: UseEditCommitOptions<V>) => EditCommitApi<V>;
174
+ //# sourceMappingURL=useEditCommit.d.ts.map
@@ -0,0 +1,86 @@
1
+ import { default as React } from 'react';
2
+ import { EditDoneArgs } from './useEditCommit';
3
+ export interface UseInputFieldOptions {
4
+ /** The committed value. The display text re-derives whenever it changes. */
5
+ value: string | null;
6
+ /**
7
+ * Live change notification — fires on every VALID text state. A PREVIEW channel: hosts that mutate
8
+ * the model per change (renaming a table) should act on {@link onDone} instead.
9
+ */
10
+ onChange?: (value: string) => void;
11
+ /**
12
+ * The raw TEXT channel: every display-text change the user causes — INVALID states included, and
13
+ * regardless of {@link changeOn}. For hosts that persist authored text and validate it later;
14
+ * {@link onChange} would leave them holding the last VALID text while the field shows something
15
+ * else. An outside `value` change does not fire it.
16
+ */
17
+ onChangeText?: (text: string) => void;
18
+ /**
19
+ * The COMMIT channel: fires once with the final text when the edit finishes — a done key
20
+ * (Enter/Tab/Escape), the adornment ✓/✗, {@link InputFieldApi.commit}/`.cancel()`, or blur.
21
+ * `args.reason` distinguishes accept from cancel (a cancel delivers the reverted session baseline).
22
+ * Not fired on an accept while the text is invalid — the error stays shown instead.
23
+ */
24
+ onDone?: (value: string, args: EditDoneArgs) => void;
25
+ /**
26
+ * `'done'` suppresses the live {@link onChange} notifications entirely (validation still runs, so
27
+ * the error state and the commit-channel value stay current) and makes Enter the field's own commit
28
+ * point. Default `'live'`.
29
+ */
30
+ changeOn?: 'live' | 'done';
31
+ /**
32
+ * Validate the text — THROW to reject it. The thrown `message` (an SDK validation error carries a
33
+ * message key) becomes the field's error, which blocks every accept path until it clears.
34
+ */
35
+ onValidate?: (text: string) => void;
36
+ /** The error key used when a rejection carries no message of its own. */
37
+ invalidKey?: string;
38
+ /** Disabled: never engages, so no session, no commits. */
39
+ disabled?: boolean;
40
+ }
41
+ /** What {@link useInputField} hands the host input component. */
42
+ export interface InputFieldApi {
43
+ /** Spread onto the `<input>`: value + handlers + element ref. */
44
+ inputProps: {
45
+ value: string;
46
+ onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
47
+ onKeyDown: (e: React.KeyboardEvent) => void;
48
+ onFocus: (e: React.FocusEvent) => void;
49
+ onBlur: (e: React.FocusEvent) => void;
50
+ ref: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;
51
+ };
52
+ /** The live display text. */
53
+ text: string;
54
+ /** Validation error for the current text — a message KEY (translate at display). `null` when valid. */
55
+ error: string | null;
56
+ /** `true` when the text differs from the committed value's text. */
57
+ dirty: boolean;
58
+ /**
59
+ * `true` while an edit SESSION is open — for a plain field that means focused (or edited while
60
+ * focus stayed after a commit), and it is what the modal ✓/✗ adornments key off. A done key ends
61
+ * the session even though focus stays, exactly like the formula field's engagement.
62
+ */
63
+ engaged: boolean;
64
+ /** Restore the committed value's text (the field-level Escape). */
65
+ revert(): void;
66
+ /** Explicit accept — a dialog's OK, the adornment ✓. */
67
+ commit(): void;
68
+ /** Explicit cancel — a dialog's Cancel, the adornment ✗. Reverts and fires `reason: 'cancel'`. */
69
+ cancel(): void;
70
+ }
71
+ /**
72
+ * The **headless text field** — a plain value-controlled `<input>` with the SAME edit contract as the
73
+ * formula field: live vs commit channels (`changeOn`), a two-level Escape, commit-then-tab, an invalid
74
+ * state that blocks every accept, and imperative `commit`/`cancel`/`revert` for host-driven commit
75
+ * points a blur can't see.
76
+ *
77
+ * @remarks
78
+ * Everything except the validation lives in the shared {@link useEditCommit} — the same instance the
79
+ * formula input uses — so the two fields cannot drift. What differs is only what a "value" is (text,
80
+ * validated by {@link UseInputFieldOptions.onValidate}, instead of a parsed formula) and what a
81
+ * "session" is (focus, instead of engagement on the reference-mode bus). There is no external producer
82
+ * writing into this field, so ending a session never moves focus — the caret stays where the user
83
+ * left it.
84
+ */
85
+ export declare const useInputField: (options: UseInputFieldOptions) => InputFieldApi;
86
+ //# sourceMappingURL=useInputField.d.ts.map
@@ -0,0 +1,179 @@
1
+ import { IRange, ICell, ICellRanges, ICellRange, IColor, ITable, INamedCollection, IStyleCollection, IStyle, IBorder, ITheme, IThemeCollection, IFunction, IFunctionCollection, IWorkbook } from '@sheetxl/sdk';
2
+ /**
3
+ * For providing Adjustable Color Commands additional rendering capabilities.
4
+ *
5
+ * @remarks
6
+ * The grid's light/dark intent and its `--sxl-sys-color-*` re-establishment are no longer threaded here — a
7
+ * portaled picker self-sources the mode (`useGridColorScheme`) and adopts `data-sxl-theme-surface="grid"`
8
+ * on its own root, so `auto`/system swatches resolve from the cascade. See THEMING-DESIGN.md.
9
+ */
10
+ export interface Color {
11
+ readonly schemeLookup: IColor.SchemeLookup;
12
+ readonly autoColor: IColor;
13
+ readonly quickColor?: IColor;
14
+ recentColors: readonly IColor[] | (() => readonly IColor[]);
15
+ addRecentColor: (color: IColor) => readonly IColor[];
16
+ clearRecentColors: () => void;
17
+ onColorSelect: (color: IColor) => void;
18
+ }
19
+ export interface Border {
20
+ readonly autoColor: IColor;
21
+ readonly autoStyle: IBorder.StrokeStyle;
22
+ readonly quickBorder?: Partial<IBorder.Properties>;
23
+ readonly schemeLookup: IColor.SchemeLookup;
24
+ createBorder: (update: IBorder.Properties) => IBorder;
25
+ onBorderSelect: (border: Partial<IBorder.Properties>) => void;
26
+ }
27
+ export interface NamedStyle {
28
+ readonly named: () => IStyle.INamed;
29
+ readonly styles: () => IStyleCollection;
30
+ createCell: (update: ICell.Update) => ICell;
31
+ }
32
+ export interface Table {
33
+ readonly table: () => ITable | null;
34
+ readonly styles: () => IStyleCollection;
35
+ /**
36
+ * Need so that we can add the table to the names.
37
+ */
38
+ getNames: () => INamedCollection;
39
+ /**
40
+ * Resolves an address to absolute, workbook-scoped ranges — backs the reference input.
41
+ *
42
+ * @remarks
43
+ * Separate from {@link getNames} because it has nothing to do with names: it used to be
44
+ * `INamedCollection.getRanges`, which lived there only because that collection happened to hold
45
+ * an address resolver.
46
+ */
47
+ resolveRanges: (address: ICellRanges.Address) => ICellRanges;
48
+ }
49
+ export interface Theme {
50
+ readonly theme: ITheme;
51
+ readonly themes: IThemeCollection;
52
+ }
53
+ export interface NamedReference {
54
+ /** used when creating new names */
55
+ selection: () => ICellRanges;
56
+ getNames: () => INamedCollection;
57
+ /** Resolves an address to absolute, workbook-scoped ranges — see {@link Table.resolveRanges}. */
58
+ resolveRanges: (address: ICellRanges.Address) => ICellRanges;
59
+ }
60
+ /**
61
+ * Used for the workbook-statistics dialog — the dialog profiles the live workbook itself
62
+ * (`IWorkbook.getStats` / `ISheet.getStats`), so the context is just the model getter.
63
+ */
64
+ export interface WorkbookStatistics {
65
+ getWorkbook: () => IWorkbook;
66
+ }
67
+ export interface ResizeHeaderOptions {
68
+ size: number;
69
+ unit?: string;
70
+ }
71
+ export interface ResizeHeaderContext {
72
+ getAxis(): IRange.Axis;
73
+ getUnitText(): string;
74
+ toUnits?(value: number): number;
75
+ toPixels?(value: number): number;
76
+ }
77
+ export interface NewTable {
78
+ ranges: ICellRanges;
79
+ hasHeader?: boolean;
80
+ }
81
+ export interface SelectedRange {
82
+ range: ICellRange;
83
+ cell?: ICell.Address;
84
+ }
85
+ /**
86
+ * The function-discovery context the `insertFunction` command carries — everything a picker (the
87
+ * category menus, and the Insert Function dialog) needs to browse the workbook's functions, built-in
88
+ * and custom alike, without reaching for the workbook itself.
89
+ *
90
+ * @remarks
91
+ * Each call reads descriptors, which load lazily per language — cheap after the first, but not
92
+ * something to call per keystroke without debouncing.
93
+ */
94
+ export interface FormulaFunction {
95
+ /**
96
+ * Every function in `category`, ordered by name. Excludes deprecated/hidden ones.
97
+ *
98
+ * @param category Omit (or pass an empty string) for every category — the picker's "All".
99
+ */
100
+ searchByCategory: (category?: string) => Promise<IFunction[]>;
101
+ /**
102
+ * The functions matching `text`, best match first — an exact name, then name prefixes, then name
103
+ * substrings, then a mention in the summary. Empty `text` yields nothing (not everything).
104
+ *
105
+ * @param options {@link FormulaFunction.SearchTextOptions}
106
+ */
107
+ searchByText: (text: string, options?: FormulaFunction.SearchTextOptions) => Promise<IFunction[]>;
108
+ /**
109
+ * The categories that actually have functions in them, ordered by name, each with its population.
110
+ *
111
+ * @remarks
112
+ * The list is derived from what is REGISTERED (a module's custom functions included), which is why
113
+ * a picker builds its category strip from this rather than from a fixed table — the two drift.
114
+ * The `name` is the identity `searchByCategory` takes and the fallback label; a picker maps the
115
+ * ones it knows to its own translated label and icon.
116
+ */
117
+ getCategories: () => Promise<IFunctionCollection.Category[]>;
118
+ }
119
+ export declare namespace FormulaFunction {
120
+ /** Options for {@link FormulaFunction.searchByText}. */
121
+ interface SearchTextOptions {
122
+ /**
123
+ * Narrow the results to one category.
124
+ *
125
+ * @remarks
126
+ * The picker's category selection is a FILTER, not a mode: it applies while searching too, so a
127
+ * chosen category keeps meaning what it says instead of being silently ignored the moment a
128
+ * query is typed. Omit for every category.
129
+ */
130
+ category?: string;
131
+ /** Cap the results; applied after ranking, so it yields the best N. */
132
+ limit?: number;
133
+ }
134
+ }
135
+ export declare const FindScopeOptions: {
136
+ /**
137
+ * Search the entire workbook
138
+ */
139
+ readonly Workbook: "workbook";
140
+ /**
141
+ * Search the current sheet or range
142
+ */
143
+ readonly Sheet: "sheet";
144
+ };
145
+ export type FindScopeOptions = typeof FindScopeOptions[keyof typeof FindScopeOptions];
146
+ /**
147
+ * Used for the find/replace dialog.
148
+ */
149
+ export interface FindReplaceOptions {
150
+ /**
151
+ * Options for find.
152
+ */
153
+ findOptions?: ICellRange.FindOptions;
154
+ /**
155
+ * If replacing with null then set to true.
156
+ */
157
+ replace?: boolean;
158
+ /**
159
+ * The text to replace the found text with.
160
+ */
161
+ replaceText?: string | null;
162
+ /**
163
+ * Options for replace.
164
+ */
165
+ replaceOptions?: IWorkbook.ReplaceOptions;
166
+ /**
167
+ * If true the operation will signal to the ui container to
168
+ * autoFocus.
169
+ *
170
+ * @remarks
171
+ * For replaceAll this is ignored.
172
+ */
173
+ autoFocus?: boolean;
174
+ /**
175
+ * Default value 'Sheet'
176
+ */
177
+ scope?: FindScopeOptions;
178
+ }
179
+ //# sourceMappingURL=CommandContext.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { RemoveListener } from '@sheetxl/utils';
2
+ import { FocusWindowOptions } from '@sheetxl/utils-react';
3
+ export interface IFrameContainerListener {
4
+ onShow?: () => void;
5
+ onBeforeHide?: () => void | Promise<boolean>;
6
+ onHide?: () => void;
7
+ }
8
+ export interface IFrame {
9
+ addListener: (listener: IFrameContainerListener) => RemoveListener;
10
+ close: () => void;
11
+ focus: (options?: FocusWindowOptions) => void;
12
+ }
13
+ export interface ModalFrame extends IFrame {
14
+ onCancel?: () => void;
15
+ onDone?: (results?: any) => void;
16
+ }
17
+ //# sourceMappingURL=IFrame.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * as CommandContext from './CommandContext';
2
+ export * from './IFrame';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export declare const LogoNoPaddingIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
3
+ //# sourceMappingURL=LogoNoPaddingIcon.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ /** @internal */
3
+ export declare const LogoTextNoPaddingIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
4
+ //# sourceMappingURL=LogoTextNoPaddingIcon.d.ts.map