@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,166 @@
1
+ import { default as React, CSSProperties } from 'react';
2
+ import { IFunction } from '@sheetxl/sdk';
3
+ /**
4
+ * The caret-derived function context that drives the preview: which function the caret is inside
5
+ * (`name`), which argument it's on (`argIndex`), and that function's declared parameters (used to
6
+ * render the signature with the active argument emphasized). Derived synchronously in the editor from
7
+ * the caret token's `context`.
8
+ */
9
+ export interface FunctionHint {
10
+ /** The function's canonical name (as reported by the SDK) — the identity used to match descriptors. */
11
+ name: string;
12
+ /** The function's name in the user's language (`SUMME`), for DISPLAY; falls back to {@link name}. */
13
+ nameLocal?: string;
14
+ /** The workbook locale's argument separator (`,` or `;`), for the displayed signature. */
15
+ argSeparator?: string;
16
+ /** The zero-based index of the argument the caret currently sits in. */
17
+ argIndex: number;
18
+ /** The function's declared parameters, in order (name / optional / rest). */
19
+ params: readonly IFunction.IParameterType[];
20
+ }
21
+ /**
22
+ * The function's self-describing text, loaded lazily (async) from `getDescriptor()`. Keyed by `name`
23
+ * so a stale descriptor (from the previous function) is ignored while the next one loads.
24
+ */
25
+ export interface FunctionDescriptor {
26
+ /** The function this descriptor belongs to — must match {@link FunctionHint.name} to be shown. */
27
+ name: string;
28
+ /** One-line summary of what the function does. */
29
+ summary: string;
30
+ /** Per-parameter descriptions, keyed by parameter name (each field optional — may be absent). */
31
+ params: Readonly<Record<string, {
32
+ description?: string;
33
+ }>>;
34
+ }
35
+ export declare const argTypeKey: (param: IFunction.IParameterType) => string;
36
+ export interface FunctionArgIconsProps {
37
+ /** The declared parameter — its scalar type names the value icon. */
38
+ param: IFunction.IParameterType;
39
+ /** Whether more of this argument may follow (a rest parameter / repeating group). */
40
+ repeat?: boolean;
41
+ /** Whether it may be omitted. */
42
+ optional?: boolean;
43
+ /**
44
+ * Show the value-TYPE icon.
45
+ *
46
+ * @defaultValue `true`
47
+ *
48
+ * @remarks
49
+ * `false` leaves only the repeatable/optional markers — the shape a surface wants when it says the
50
+ * type in WORDS somewhere the icon would only repeat (the argument form puts it in the field's
51
+ * placeholder, where an empty field has room for it and a filled one no longer needs it). The type
52
+ * icon is also the least legible of the three: it is the same glyph whatever the type, so it can
53
+ * only ever mean "hover me".
54
+ */
55
+ showType?: boolean;
56
+ /** Icon size in px. @defaultValue `15` */
57
+ size?: number;
58
+ /** Style for the cluster itself (the preview pushes it to the end of its row). */
59
+ style?: CSSProperties;
60
+ }
61
+ /**
62
+ * The per-argument metadata icons — repeatable / optional / value type, each with a native tooltip.
63
+ *
64
+ * @remarks
65
+ * Exported so the argument FORM can trail the same cluster after each of its labels: an argument
66
+ * carries the same three facts wherever it is met, and the icons are how they are said without
67
+ * spending a line of prose on each.
68
+ *
69
+ * TODO (scheme still to finalize): `Repeat` for a rest parameter, `DataArray` (the `[…]` brackets) for
70
+ * an OPTIONAL slot, and `DataObject` as the generic value/type marker. The scalar-type → icon mapping
71
+ * (number / text / logical / lambda …) is the part we still want to design.
72
+ */
73
+ export declare const FunctionArgIcons: React.FC<FunctionArgIconsProps>;
74
+ export interface FunctionSignatureProps {
75
+ /** The caret's function context — drives the name + which argument is emphasized. */
76
+ hint: FunctionHint;
77
+ /**
78
+ * Allow the signature to wrap onto more than one line.
79
+ *
80
+ * @defaultValue `false` — one line, as the editor's floating bar needs (it ellipsizes what does
81
+ * not fit rather than growing).
82
+ *
83
+ * @remarks
84
+ * `true` for a signature laid out in a fixed-width panel, where a long one (`PV(rate, nper, pmt,
85
+ * [fv], [type])`) should use the second line instead of a horizontal scrollbar. Wrapping also
86
+ * switches the separator's trailing space to a breaking one, so a line ends after `rate,` rather
87
+ * than starting with the comma of the argument below it.
88
+ */
89
+ wrap?: boolean;
90
+ }
91
+ /**
92
+ * The one-line function **signature** — `NAME(arg1, arg2, …)` with the active argument emphasized and a
93
+ * **rest** parameter expanded into its two slots. Extracted so the same rendering serves the collapsible
94
+ * {@link FunctionPreviewHeader} and a future standalone tooltip (which would stack it over
95
+ * {@link FunctionPreviewContent}). Presentational; nothing here mutates the edit.
96
+ */
97
+ export declare const FunctionSignature: React.FC<FunctionSignatureProps>;
98
+ export interface FunctionPreviewContentProps {
99
+ /** The caret's current function context. */
100
+ hint: FunctionHint;
101
+ /** The lazily-loaded descriptor text, or `null` until it resolves (or if it fails). */
102
+ descriptor: FunctionDescriptor | null;
103
+ /**
104
+ * Render the stacked argument list under the summary.
105
+ *
106
+ * @defaultValue `true`
107
+ *
108
+ * @remarks
109
+ * `false` leaves just the summary — the shape a BROWSING surface wants (the Insert Function
110
+ * dialog's function list, where the signature above already says what the arguments are and the
111
+ * per-argument prose belongs to the next step). While EDITING, the argument list is the point of
112
+ * the panel, so the editor leaves this alone.
113
+ */
114
+ showParameters?: boolean;
115
+ }
116
+ /**
117
+ * The function preview **body** — the one-line summary over a stacked argument list (each argument's
118
+ * name above its own description, with type/repeatable icons, inactive ones dimmed RowZero-style). This
119
+ * is the informative half, deliberately free of any collapse/close chrome so it can be reused verbatim
120
+ * as a hover **tooltip** (compose it under a {@link FunctionSignature}); inside the editor it's the
121
+ * collapsible body of {@link FunctionPreviewPanel}. Renders nothing when there's neither a summary nor
122
+ * any arguments. Presentational — nothing here mutates the edit.
123
+ */
124
+ export declare const FunctionPreviewContent: React.FC<FunctionPreviewContentProps>;
125
+ export interface FunctionPreviewHeaderProps {
126
+ /** The caret's function context — rendered as the signature. */
127
+ hint: FunctionHint;
128
+ /** Whether the body is currently collapsed (drives the chevron direction). */
129
+ collapsed: boolean;
130
+ /** Toggle collapse. Fired by clicking anywhere on the bar (or the chevron). */
131
+ onToggle: () => void;
132
+ /** Optional — dismiss the panel (renders the trailing close affordance when provided). */
133
+ onClose?: () => void;
134
+ }
135
+ /**
136
+ * The collapsible **bar title** of the preview: the function signature with a trailing collapse chevron
137
+ * (and an optional close). The **entire bar** toggles collapse — Excel/RowZero-style — so the chevron is
138
+ * just the affordance, not the only hit target; the close button stops propagation so dismissing never
139
+ * also toggles. `onMouseDown` is prevented throughout so a click never blurs the textarea being edited.
140
+ */
141
+ export declare const FunctionPreviewHeader: React.FC<FunctionPreviewHeaderProps>;
142
+ export interface FunctionPreviewPanelProps {
143
+ /** The caret's current function context; the panel renders nothing meaningful without it. */
144
+ hint: FunctionHint;
145
+ /** The lazily-loaded descriptor text, or `null` until it resolves (or if it fails). */
146
+ descriptor: FunctionDescriptor | null;
147
+ /** Optional — dismiss the panel (renders the header's close affordance when provided). */
148
+ onClose?: () => void;
149
+ }
150
+ /**
151
+ * The function **preview panel** shown while editing a formula, modeled after RowZero/Excel Online: a
152
+ * collapsible {@link FunctionPreviewHeader} (the signature with the active argument highlighted, plus an
153
+ * accordion collapse and an optional close) over the {@link FunctionPreviewContent} body (description +
154
+ * stacked argument list). This component is just the composition — the two halves are exported so the
155
+ * body can be reused as a hover tooltip independent of the collapse chrome.
156
+ *
157
+ * @remarks
158
+ * This is the "B" half of the formula-editor hint UI (the autocomplete *list* is "A"). Presentational
159
+ * and props-driven — the editor owns the caret → hint derivation and passes it down. The expand/collapse
160
+ * state persists (via {@link usePersistenceState}); close is delegated via
161
+ * {@link FunctionPreviewPanelProps.onClose}. No **Example** is shown: `IDescriptor` has no function-level
162
+ * example and we won't fabricate one. The active-argument emphasis is driven by `hint.argIndex`. Nothing
163
+ * here mutates the edit.
164
+ */
165
+ export declare const FunctionPreviewPanel: React.FC<FunctionPreviewPanelProps>;
166
+ //# sourceMappingURL=FunctionPreviewPanel.d.ts.map
@@ -0,0 +1,38 @@
1
+ import { default as React } from 'react';
2
+ import { NamedItem } from './NamedItemsPanel';
3
+ import { FunctionHint, FunctionDescriptor } from './FunctionPreviewPanel';
4
+ /** Autocomplete-list state (the "A" half) — the matches plus the current selection + callbacks. */
5
+ export interface NamedHintList {
6
+ items: readonly NamedItem[];
7
+ selectedIndex: number;
8
+ /** Summary for the selected row only (loaded lazily by the editor). */
9
+ selectedSummary?: string;
10
+ onSelect: (item: NamedItem, index: number) => void;
11
+ onHighlight?: (index: number) => void;
12
+ }
13
+ /** Function-preview state (the "B" half) — the caret's function context + its lazily-loaded copy. */
14
+ export interface NamedHintPreview {
15
+ hint: FunctionHint;
16
+ descriptor: FunctionDescriptor | null;
17
+ }
18
+ export interface NamedHintPanelProps {
19
+ /** Autocomplete matches; when present and non-empty, the list is shown in preference to the preview. */
20
+ list?: NamedHintList | null;
21
+ /** The function preview; shown when there is no active autocomplete list. */
22
+ preview?: NamedHintPreview | null;
23
+ }
24
+ /**
25
+ * The container for the formula-editor hint popup (modeled after Excel Online). It renders exactly one
26
+ * of the two hint surfaces based on caret state:
27
+ *
28
+ * - **List** ({@link NamedItemsPanel}) — while typing a *name* (`=SU`), an autocomplete of matching
29
+ * items (functions today; named ranges / tables later).
30
+ * - **Preview** ({@link FunctionPreviewPanel}) — once inside a call (`=SUM(`), the signature +
31
+ * argument/description panel.
32
+ *
33
+ * The list wins when it has matches — Excel drops the preview while the name-completion list is up.
34
+ * This is the component the editor's float renders; the editor owns caret → state derivation and
35
+ * passes both halves down, letting this stay a pure switch with no SDK/caret coupling.
36
+ */
37
+ export declare const NamedHintPanel: React.FC<NamedHintPanelProps>;
38
+ //# sourceMappingURL=NamedHintPanel.d.ts.map
@@ -0,0 +1,59 @@
1
+ /**
2
+ * What a row IS — the leading glyph, and (for the editor) whether accepting it opens a paren.
3
+ *
4
+ * @remarks
5
+ * `'named'` covers every non-table entry of the workbook's `INamedCollection` (a named range, a named
6
+ * constant, a named formula): they differ in what they resolve to, but not in how they are completed —
7
+ * the name goes in bare and stands on its own.
8
+ */
9
+ export type NamedItemKind = 'function' | 'named' | 'table';
10
+ /**
11
+ * One row in the formula autocomplete list. Deliberately minimal — the presentational panel needs a
12
+ * display `name`, its {@link NamedItemKind}, and optionally a `category` / an `iconKey` override. The
13
+ * row layout is identical for every kind; only the leading glyph distinguishes them.
14
+ */
15
+ export interface NamedItem {
16
+ /** The item's canonical name — inserted (with an opening paren, for a function) when the row is chosen. */
17
+ name: string;
18
+ /** What the row is. Defaults to `'function'`, which is what an omitted kind meant before names joined the list. */
19
+ kind?: NamedItemKind;
20
+ /** Optional category (e.g. `Math & Trig`), shown dimmed at the row's trailing edge. */
21
+ category?: string;
22
+ /** Optional icon-pack key for the leading glyph; overrides the {@link NamedItemKind} default. */
23
+ iconKey?: string;
24
+ }
25
+ export interface NamedItemsPanelProps {
26
+ /** The matching items, already filtered/sorted by the editor. */
27
+ items: readonly NamedItem[];
28
+ /** The highlighted row (keyboard/hover selection). Clamped by the caller. */
29
+ selectedIndex: number;
30
+ /**
31
+ * Summary for the **selected** item only, loaded lazily by the editor. Shown as a single dimmed
32
+ * line under the selected row — one at a time (so the panel never bounces) and non-wrapping.
33
+ */
34
+ selectedSummary?: string;
35
+ /** Commit a row — the editor splices `name(` into the formula at the caret. */
36
+ onSelect: (item: NamedItem, index: number) => void;
37
+ /** Move the highlight (hover). Optional so the panel works read-only. */
38
+ onHighlight?: (index: number) => void;
39
+ /** Cap the visible rows before the list scrolls. */
40
+ maxVisibleRows?: number;
41
+ }
42
+ /**
43
+ * The formula **autocomplete list** shown while typing a name in a formula (the "A" half of the
44
+ * formula-editor hint UI, modeled after Excel Online). Presentational only: it renders the matches
45
+ * with one highlighted, a leading type glyph per row, and — under the selected row only — that item's
46
+ * summary. The editor owns the caret → matches derivation, the selection index, insertion, and
47
+ * resolving the selected summary. Functions, named ranges and tables all render here, distinguished
48
+ * only by their {@link NamedItemKind} glyph.
49
+ *
50
+ * @remarks
51
+ * Kept mouse-first so it works with the passive (`autoFocus: false`) hint popup — rows use
52
+ * `onMouseDown` + `preventDefault` so choosing one never blurs the textarea being typed in. Keyboard
53
+ * navigation (arrow/enter) is driven by the editor's textarea keymap, which just moves
54
+ * {@link NamedItemsPanelProps.selectedIndex}; nothing here needs to own focus. The summary is shown
55
+ * for exactly one row and forced to a single line, so moving the selection never reflows the panel
56
+ * width (no "bounce").
57
+ */
58
+ export declare const NamedItemsPanel: React.FC<NamedItemsPanelProps>;
59
+ //# sourceMappingURL=NamedItemsPanel.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { default as React } from 'react';
2
+ import { ISheet } from '@sheetxl/sdk';
3
+ import { EditorAlignment, VirtualDivProps } from '@sheetxl/grid-react';
4
+ import { SheetEditable } from './SheetEditable';
5
+ /**
6
+ * Props for {@link SheetCellEditorLayer}.
7
+ *
8
+ * @typeParam C - clean value type. @typeParam D - dirty value type. @typeParam A - commit args.
9
+ */
10
+ export interface SheetCellEditorLayerProps extends VirtualDivProps {
11
+ /**
12
+ * Stacking override, read by the grid's sorter **off this element** when the editor is a grid
13
+ * child (law 1: z belongs to Layers; the editor's Layer takes its slot from the sorted order).
14
+ */
15
+ zIndex?: number;
16
+ /** The sheet — its selection drives the input's leave-key nav, its active cell the edit-session commands. */
17
+ sheet: ISheet;
18
+ /** The editable (UI model) — anchor + the single current edit. Shared with peers (the formula bar). */
19
+ editable: SheetEditable;
20
+ /**
21
+ * The grid's light/dark intent — drives the box background resolution (`resolveCellBackground`, which
22
+ * bakes a concrete color). The input's own font/token colors are theme-adaptive (`light-dark()`) and need
23
+ * no flag.
24
+ */
25
+ darkMode?: boolean;
26
+ /** Horizontal anchor used when the editor grows past its cell (Excel-style overflow). @defaultValue `'left'` */
27
+ alignment?: EditorAlignment;
28
+ /**
29
+ * Notified when a start-edit attempt is rejected (`startEdit` returned `false` — a non-editable
30
+ * cell). The host that mounts one layer per pane (`SheetElement`) passes a SHARED callback
31
+ * ({@link useProtectedEditNotice}) so all panes form one once-per-visit notice scope.
32
+ * @defaultValue this layer's own {@link useProtectedEditNotice}
33
+ */
34
+ onEditRejected?: () => void;
35
+ }
36
+ export declare function SheetCellEditorLayer(props: SheetCellEditorLayerProps): React.ReactElement;
37
+ export declare namespace SheetCellEditorLayer {
38
+ var displayName: string;
39
+ }
40
+ //# sourceMappingURL=SheetCellEditorLayer.d.ts.map
@@ -0,0 +1,99 @@
1
+ import { Direction, RangeAxis } from '@sheetxl/utils';
2
+ import { ICell } from '@sheetxl/sdk';
3
+ import { EditorInputProps, IEditable } from '@sheetxl/grid-react';
4
+ /**
5
+ * The minimal selection the input moves on a committed leave-key. Enter/Tab **traverse** — cycle the
6
+ * active cell *within* the current selection (Excel's contract: stay inside a selected range, wrap at
7
+ * its edges); enter-mode arrows **navigate** — a single logical move of the active cell. Both the
8
+ * grid's `ISelection` (e.g. `DefaultSelection`) and the sheet's selection (`sheet.getSelection()`)
9
+ * satisfy this: their `navigate` shares one `Direction` (the SDK's `IRange.Direction` is the same
10
+ * aliased enum) and their `traverse` one `RangeAxis`, so no mapping is needed.
11
+ */
12
+ export interface NavigableSelection {
13
+ navigate(direction: Direction, select?: boolean): void;
14
+ traverse(axis?: RangeAxis, reverse?: boolean): void;
15
+ }
16
+ /** Options bound once (by the app) when building the input — the SDK context the cell can't supply. */
17
+ export interface SheetCellInputOptions {
18
+ /**
19
+ * The selection moved on a committed leave-key. This is the ONLY thing the input needed the sheet
20
+ * for, so it takes the selection directly — the grid and the editor then move the SAME selection
21
+ * (pass `sheet.getSelection()` for a sheet-backed grid, or the grid's own `DefaultSelection`).
22
+ */
23
+ selection: NavigableSelection;
24
+ /**
25
+ * **Hack** Ignore fill.
26
+ *
27
+ * @remarks
28
+ * We should be able to set the fill to none but conditionals and tables are ignoring.
29
+ */
30
+ fillNone?: boolean;
31
+ }
32
+ /**
33
+ * The **ghost formula** for a spilled-INTO cell: the spill anchor's formula, as Excel greys it in the
34
+ * formula bar. `null` for every other cell (including the anchor itself, which owns the formula and so
35
+ * shows it as real text via {@link editStringFromCell}).
36
+ *
37
+ * @remarks
38
+ * This is the other half of a deliberate SDK contract: `ICell.getText` blanks a spill-overflow cell and
39
+ * `getFormulaText` returns null there (the formula lives only on the anchor), so `editStringFromCell`
40
+ * yields `''` — leaving the field empty for this ghost to fill. Host-called, not called by the input; see
41
+ * {@link SheetCellInputProps.placeholder} for why the grid editor must not use it.
42
+ */
43
+ export declare const placeholderFromCell: (cell: ICell | null) => string | null;
44
+ /**
45
+ * Build the **cell-aware** editor input —
46
+ * projects the cell's edit string, paints the cell background, and applies the cell's font, horizontal
47
+ * alignment, wrap, insets, and vertical alignment. Lifecycle (open/commit/cancel/placement).
48
+ *
49
+ * @remarks
50
+ * `C` = `() => ICell` (a live cell getter — see `createSheetCreateEdit`); `D` = `string`. The factory
51
+ * closes over the SDK context (`sheet`, dark-mode) the per-cell handle can't provide.
52
+ *
53
+ * **Placement** is driven by {@link ICell.getTextPlacement} — the *same* SDK geometry the cell
54
+ * renderer uses — so the editor's text sits exactly where the rendered cell's does. Insets define the
55
+ * content box; the cell's line height sets the line rhythm; vertical alignment is flex `justifyContent`
56
+ * within the content box. Horizontal overflow + wrap ride the `cellSize`/`onNaturalSize` seam: a
57
+ * wrapped cell measures its own height (clip-proof) and reports width 0 so the layer grows the box
58
+ * *down*; an unwrapped cell reports the shrink-to-content width so the layer grows it *across* columns.
59
+ */
60
+ /** {@link SheetCellInput}'s props: the grid-react editor props plus the shared **edit model**. The host owns
61
+ * the editor's command scope and its edit-session command contribution (`contributeEditorCommands`); the
62
+ * input only renders + marks itself the session's active editor on focus. `editable` absent ⇒ a bare grid. */
63
+ export type SheetCellInputProps = EditorInputProps<() => ICell, string> & {
64
+ /** The shared edit model, provided by the host — the anchor + current edit this input participates in. */
65
+ editable?: IEditable<() => ICell, string, any> | null;
66
+ /**
67
+ * Greyed ghost text shown when the input renders EMPTY — Excel's spilled-into-cell formula bar, which
68
+ * shows the spilling anchor's formula in grey (see {@link placeholderFromCell}).
69
+ *
70
+ * @remarks
71
+ * A **host** concern, deliberately not derived here: only the formula bar wants it. The in-grid editor
72
+ * (`EditorLayer`) must NOT set it — a ghost formula painted over a spilled cell would sit on top of the
73
+ * grid's own rendered spill value. So this stays a prop the formula bar opts into, rather than something
74
+ * the input infers from the cell.
75
+ */
76
+ placeholder?: string | null;
77
+ /**
78
+ * The widest the editor box may become, in **logical** px — how much room is left on screen from the
79
+ * cell's left edge. Supplied by the host, which is the only side that knows it (the layer owns the pane
80
+ * and the surface); today that's the grid surface, and it becomes the browser width if the editor is ever
81
+ * portaled out. Absent for a box-less host (the formula bar), which simply breaks at its own width.
82
+ *
83
+ * Only a FORMULA uses it, and only as a last resort — see the wrap rules on `formulaBreak`.
84
+ */
85
+ maxContentWidth?: number;
86
+ /**
87
+ * The line rhythm, in **logical** px, for a **box-less** host (one that passes no `cellSize`). A placed
88
+ * host takes it from the cell's own resolved placement instead, so this is ignored there.
89
+ *
90
+ * @remarks
91
+ * A box-less host wraps (see the wrap rules on `cellWrap`), so its box height is now a count of LINES —
92
+ * the formula bar snaps its resize to a line and reports how many are visible. Left to the browser's
93
+ * `normal`, the rendered line and the host's idea of one differ by a few px and every expanded row shows
94
+ * a sliver of the next; supplying it makes the two exact.
95
+ */
96
+ lineHeight?: number;
97
+ };
98
+ export declare const createSheetCellInput: (options: SheetCellInputOptions) => React.FC<SheetCellInputProps>;
99
+ //# sourceMappingURL=SheetCellInput.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { ISheet, IWorkbook, ICell } from '@sheetxl/sdk';
2
+ import { CreateEdit, IEditable, EditCommitArgs } from '@sheetxl/grid-react';
3
+ import { ReferenceModeHandler } from './useReferenceMode';
4
+ /** The editable shape for a spreadsheet: `clean` is a live cell getter, `dirty` is the working text. */
5
+ export type SheetEditable = IEditable<() => ICell, string, EditCommitArgs>;
6
+ /**
7
+ * The **grid** background a cell renders with, cascading cell fill → the sheet's normal-style fill →
8
+ * the grid body fill. This is the grid's rendering rule (not a cell property), so the grid editor box
9
+ * uses it to cover the cell while editing. The cell-aware input itself paints only the cell's *own*
10
+ * fill; this fallback is the container's job.
11
+ */
12
+ export declare const resolveCellBackground: (cell: ICell, sheet: ISheet, darkMode?: boolean, bodyFill?: string) => string;
13
+ /**
14
+ * An `ISheet`-backed {@link CreateEdit} for the new {@link DefaultEditable} / {@link EditorLayer}.
15
+ *
16
+ * @remarks
17
+ * - **clean** is `() => ICell` — a *live* cell getter (not a captured value), so a cell-aware input
18
+ * reads the cell's formula/format/style/fill through to the model even if the handle is replaced.
19
+ * - **commit** writes the dirty string via `range.setValue(text, { autoFit })` — the SDK coerces the
20
+ * string to a formula / number / date / text.
21
+ * - **`null`** ⇒ the cell is not editable (protected / read-only), via {@link ICell.isEditAllowed}.
22
+ * - **scope-aware**: `coords.scope` (a sheet name) picks the sheet to edit, via `workbook.getSheet`,
23
+ * falling back to `sheet`. This is what makes a commit write back to the session's *origin* sheet even
24
+ * if a different sheet is currently displayed — `coords` here is the session's own (fixed) coords, not
25
+ * whatever the anchor currently reports.
26
+ *
27
+ * Construct the editable with it: `new DefaultEditable(anchor, createSheetCreateEdit(sheet))` — or use
28
+ * the {@link createEditable} factory, which wires both.
29
+ */
30
+ export declare const createSheetCreateEdit: (sheet: ISheet, workbook?: IWorkbook | null) => CreateEdit<() => ICell, string, EditCommitArgs>;
31
+ /**
32
+ * Build the production {@link SheetEditable} for a sheet — the {@link DefaultEditable} wired with a
33
+ * workbook-aware active-cell anchor ({@link createEditableAnchor}) and SDK edit strategy
34
+ * ({@link createSheetCreateEdit}), self-published to the edit-mode bus ({@link publishEditableToBus})
35
+ * and the reference-mode bus ({@link wireReferenceMode}). The one place that composition lives, so call
36
+ * sites (the grid and the app's auto-editable) don't repeat it.
37
+ *
38
+ * @remarks
39
+ * A factory, not a subclass: the editable's only varying behavior is *how* an edit is created, which
40
+ * is already the injected `CreateEdit` strategy — there is nothing for a subclass to override. Returns
41
+ * the {@link IEditable} interface so callers and props stay implementation-agnostic.
42
+ */
43
+ export interface CreateEditableOptions {
44
+ /**
45
+ * The reference-mode bus this editable publishes its pick state to. Model-side wiring can't resolve
46
+ * a React context, so a COMPONENT call site under a custom `ReferenceModeProvider` must thread its
47
+ * store through here (`useReferenceModeStore()`). Default: the app-wide default store — zero-config
48
+ * behavior unchanged.
49
+ */
50
+ referenceMode?: ReferenceModeHandler;
51
+ }
52
+ export declare const createEditable: (sheet: ISheet, options?: CreateEditableOptions) => SheetEditable;
53
+ //# sourceMappingURL=SheetEditable.d.ts.map
@@ -0,0 +1,46 @@
1
+ import { default as React } from 'react';
2
+ import { IRange } from '@sheetxl/sdk';
3
+ import { CellCoords, RangeCoords } from '@sheetxl/utils';
4
+ import { LayerProps } from '@sheetxl/grid-react';
5
+ /**
6
+ * Props for {@link SheetReferenceHeaderLayer}.
7
+ */
8
+ export interface SheetReferenceHeaderLayerProps extends LayerProps {
9
+ /** Class forwarded to the inner layer's host box (devtools identification). */
10
+ className?: string;
11
+ /** The axis of the header this overlay sits on (row or column). */
12
+ axis: IRange.Axis;
13
+ /**
14
+ * The body's entire range (full rows × full columns) — the header projects every pick across the
15
+ * opposite axis with it. Typically `sheet.getEntireRange().getCoords()`.
16
+ */
17
+ entireCoords: RangeCoords;
18
+ /**
19
+ * Scroll a header cell into view during a pick drag (incl. held-still auto-scroll) — routed through the
20
+ * sheet so the body scrolls. Supplied by `SheetHeaderElement`; see {@link HeaderSelectionLayer.scrollIntoView}.
21
+ */
22
+ scrollIntoView?: (coords: Partial<CellCoords>) => void;
23
+ }
24
+ /**
25
+ * The **header** counterpart to {@link SheetReferenceLayer}: lets a header click/drag pick a whole
26
+ * row/column reference into the current formula (or chart data range) while POINT mode is armed. A header
27
+ * overlay (mounted per header by `SheetHeaderElement`), it reads the app-wide reference-mode bus
28
+ * ({@link useReferenceMode}) — not any edit session — and drives the SAME picker {@link IRangeSelection}
29
+ * as the body layer, so a header pick and a body draw write back through one model.
30
+ *
31
+ * @remarks
32
+ * Renders **only while `mode === 'point'`** (armed) and only on a sheet the pick is allowed to reach
33
+ * (`ReferenceModeState.scope`). Otherwise it renders nothing and registers no responder, leaving the
34
+ * primary header selection fully in charge. The producer's gates — `scope` and `allowMulti` — are read
35
+ * here exactly as {@link SheetReferenceLayer} reads them for the body: the two surfaces drive one
36
+ * selection, so a gate honored by only one of them is no gate at all. It is a pointer surface
37
+ * only ({@link HeaderSelectionLayer} with `renderBorders={false}`) — the reference rectangles are drawn on
38
+ * the body grid by {@link SheetReferenceLayer}; `preserveFocus` keeps the formula editor focused across a
39
+ * header drag; `replaceActive` re-scopes/inserts the active reference instead of the primary's whole-
40
+ * selection replace.
41
+ */
42
+ export declare function SheetReferenceHeaderLayer(props: SheetReferenceHeaderLayerProps): React.ReactElement | null;
43
+ export declare namespace SheetReferenceHeaderLayer {
44
+ var displayName: string;
45
+ }
46
+ //# sourceMappingURL=SheetReferenceHeaderLayer.d.ts.map
@@ -0,0 +1,55 @@
1
+ import { default as React } from 'react';
2
+ import { ISheet, ISheetView } from '@sheetxl/sdk';
3
+ import { LayerProps } from '@sheetxl/grid-react';
4
+ import { SheetSelection } from '../selection';
5
+ /**
6
+ * Draws the current **reference selection** over the grid (Excel-style colored rectangles), highlighting
7
+ * the active reference. A pane layer (mounted per pane by `SheetElement`), it reads the app-wide
8
+ * reference-mode bus ({@link useReferenceMode}) — not any edit session — so it renders whenever a
9
+ * reference selection is present, regardless of what produced it: a formula edit (via `SheetCellInput`)
10
+ * or, later, a selected chart showing its source data with no active input at all.
11
+ *
12
+ * @remarks
13
+ * The bus's `IRangeSelection` can hold a **multi-sheet** set of ranges (a formula's references, each
14
+ * with its own `RangeCoords.scope`) — e.g. editing `=B1+Sheet2!C1` on Sheet1: `B1` and `Sheet2!C1` are
15
+ * both ranges in the ONE shared selection, but only `B1` belongs on Sheet1's pane. The MODEL handed to
16
+ * `RangesPickerLayer` is the shared selection **unfiltered** (a plain `SheetSelection`, same one every
17
+ * pane uses) — each pane instead filters what it *draws* via `getRangeStyle`, returning `null` for a
18
+ * range whose scope isn't this pane's `sheet`. This is a per-instance render filter, not a data split
19
+ * (see `RangesPickerLayer.getRangeStyle`'s doc): writes still land at the range's real, unfiltered index
20
+ * with no remapping, and every committed write is stamped with the committing pane's sheet by
21
+ * `scopeDrawnRanges` (always-scoped reporting — the consumer localizes; `commitRange`'s
22
+ * `{...range, ...box}` spread preserves an existing range's `scope` mid-gesture either way).
23
+ */
24
+ export interface SheetReferenceLayerProps extends LayerProps {
25
+ /** The sheet this pane renders — ranges belonging to a different sheet are filtered out of this pane. */
26
+ sheet: ISheet;
27
+ /**
28
+ * The sheet view — enables the **formula-view** fallback: while `isShowFormulas()` and no
29
+ * reference-mode state is on the bus, the selection anchor's formula (when it IS a formula)
30
+ * has its references outlined read-only (same palette as the anchor's colored formula text —
31
+ * see {@link useFormulaViewAnchor}). Omit for a host with no formula view.
32
+ */
33
+ sheetView?: ISheetView;
34
+ }
35
+ /**
36
+ * Wrap a selection so a range **committed through this pane** is stamped with this pane's sheet.
37
+ *
38
+ * @remarks
39
+ * Applies to the range at `rangeIndex` — the ONE the picker just wrote — for **both** of its gestures, since
40
+ * a gesture on this pane places the range on this sheet either way:
41
+ * - **insert** (append past the current length) — a brand-new reference drawn here;
42
+ * - **re-scope** (replace in place) — dragging the ACTIVE reference here moves it to this sheet, which is how
43
+ * `=A1` (Sheet1's) becomes `=Sheet2!A1` when you drag it while viewing Sheet2.
44
+ *
45
+ * Guarded on the range having actually CHANGED (identity compare against the current one), so a bare
46
+ * activation — `setActive` merely moving `rangeIndex` to a different reference, reusing the same range
47
+ * objects — never re-homes anything. That distinction is what keeps *selecting* a reference from silently
48
+ * moving it: only a geometry write re-homes, never a change of which reference is active.
49
+ */
50
+ export declare const scopeDrawnRanges: (base: SheetSelection, scope: string) => SheetSelection;
51
+ export declare function SheetReferenceLayer(props: SheetReferenceLayerProps): React.ReactElement | null;
52
+ export declare namespace SheetReferenceLayer {
53
+ var displayName: string;
54
+ }
55
+ //# sourceMappingURL=SheetReferenceLayer.d.ts.map
@@ -0,0 +1,84 @@
1
+ import { ICalculation } from '@sheetxl/sdk';
2
+ /**
3
+ * The token whose right edge the `caret` rests at (right-edge ownership: `pos < caret <= pos+len`, so a
4
+ * boundary belongs to the token just LEFT of the caret — the one being typed into), plus that token's
5
+ * `start` offset. Offsets start after the leading formula prefix (`base`): `1` for a stripped `=`, `0`
6
+ * for a `+`/`-` lead the tokenizer keeps as a `prefix` token. `null` when no token owns the caret (e.g.
7
+ * caret before the first token). This is the single "which token is the caret on?" primitive the editor
8
+ * dispatches on — {@link resolveFunctionContext} applies the same rule.
9
+ */
10
+ export declare const caretOwnerToken: (tokens: readonly ICalculation.FormulaToken[], caret: number, base?: number) => {
11
+ token: ICalculation.FormulaToken;
12
+ start: number;
13
+ } | null;
14
+ /**
15
+ * The character span of the name being **completed** at the caret, or `null` when nothing is.
16
+ *
17
+ * A candidate is an `isLookup` token (a function name, a named reference, or a partial identifier the
18
+ * recoverer split off a broken tail) that is **not already a call** — i.e. no `(` immediately follows it
19
+ * in `text`. That second half is the whole point: a name that already has its paren is finished work, and
20
+ * clicking back into it (to read it, to fix an argument) is a navigation gesture, not a request to complete
21
+ * it — re-popping the autocomplete list there covers the very formula you came back to look at. Excel
22
+ * behaves the same way.
23
+ *
24
+ * Typing is unaffected: `=SU` has no trailing paren, so the list still appears as you type, and accepting a
25
+ * row parks the caret INSIDE the parens where the signature preview takes over.
26
+ *
27
+ * The editor shares this between the list and the signature preview so the two can never both claim the
28
+ * caret — exactly one shows, and suppressing the list here is what lets the preview show the enclosing
29
+ * call's signature instead.
30
+ *
31
+ * `text` is the full editor string and the returned offsets index into it (not into the token stream).
32
+ */
33
+ export declare const completionSpanAtCaret: (tokens: readonly ICalculation.FormulaToken[], caret: number, base: number, text: string) => {
34
+ start: number;
35
+ end: number;
36
+ } | null;
37
+ /** The function + argument the caret is currently in. */
38
+ export interface FunctionCaretContext {
39
+ /** The (canonical) function name. */
40
+ name: string;
41
+ /** Zero-based index of the argument the caret is in. */
42
+ argIndex: number;
43
+ }
44
+ /**
45
+ * Resolve which function + argument the caret sits in, from a formula's token stream.
46
+ *
47
+ * Offsets start after the leading formula prefix (`base`; `1` for a stripped `=`, `0` for a `+`/`-` lead
48
+ * kept as a `prefix` token), matching how `FormulaToken.text` concatenates back to the source (after that
49
+ * prefix). The SDK stamps each token's enclosing function
50
+ * `context` (name + argIndex): the `(`/`)` get argIndex `-1`, each argument's tokens their index, and
51
+ * the separator `,` after argument *i* gets index *i* (it belongs to the argument BEFORE it).
52
+ *
53
+ * We resolve with **right-edge ownership**: the token whose right edge the caret rests at owns it
54
+ * (`pos < caret <= pos+len`), so a boundary belongs to the token just LEFT of the caret — the one just
55
+ * typed into — and every caret position is owned by exactly one token. Per token type:
56
+ * - **function name** → that function, argument 0 (its own `context` is the ENCLOSING call, for nesting);
57
+ * - **separator `,`** → the NEXT argument (the caret is past the comma);
58
+ * - **closing `)`** → `null` (the caret is just outside the call) — without this the `)`'s argIndex `-1`
59
+ * snaps the LAST argument back to arg 0 (the `=PV(…,0)` bug);
60
+ * - otherwise the token's own `context` (inside an argument, or just inside `(` where `-1` clamps to 0).
61
+ *
62
+ * Returns `null` when the caret is not inside any function call.
63
+ */
64
+ /**
65
+ * The argument index to light in the function preview for the token being **hovered** (`ti`), or `null`
66
+ * when the hover shouldn't move it.
67
+ *
68
+ * While the pointer is over a formula, the preview panel follows it instead of the caret: hovering an
69
+ * argument of the previewed call lights that argument. Same rule the paren emphasis follows — a hover is a
70
+ * transient "tell me about THIS", so the panel answers about what you're pointing at, not what you last
71
+ * clicked, and reverts when you leave.
72
+ *
73
+ * Resolved by asking {@link resolveFunctionContext} at the hovered token's END offset — "as if the caret
74
+ * were here" — rather than reading `token.context` raw. That way hovering a `)` (outside the call) or a
75
+ * separator (which belongs to the argument BEFORE it) behaves exactly as the caret does in the same spot;
76
+ * re-deriving those edge rules here is how the two would drift apart.
77
+ *
78
+ * `hintName` gates it to the call actually being previewed, so pointing at an argument of a DIFFERENT
79
+ * function doesn't relabel the panel. Nested calls of the same name (`=SUM(SUM(1,2),3)`) can't be told
80
+ * apart by name alone — the innermost wins, which is the one under the pointer.
81
+ */
82
+ export declare const hoveredArgIndex: (tokens: readonly ICalculation.FormulaToken[], ti: number, base: number, hintName: string) => number | null;
83
+ export declare const resolveFunctionContext: (tokens: readonly ICalculation.FormulaToken[], caret: number, base?: number) => FunctionCaretContext | null;
84
+ //# sourceMappingURL=formulaCaret.d.ts.map