@sheetxl/react 0.7.28-beta.4 → 0.8.0-beta.10
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.
- package/browser/esm/BHjeSMaycUkS5dVL.mjs +66 -0
- package/browser/esm/BZcQ-KYwS62Ut45c.mjs +20 -0
- package/browser/esm/Bow9CzRJrYxak2i5.mjs +318 -0
- package/browser/esm/BuvXl14hs-1CvjeA.mjs +2706 -0
- package/browser/esm/BwRduT8FTrk5n72r.mjs +32 -0
- package/browser/esm/C6urN77szrYwODXF.mjs +134 -0
- package/browser/esm/CYMRbtPIr6SklGpp.mjs +775 -0
- package/browser/esm/CYoUd5KIl7W3AsxH.mjs +196 -0
- package/browser/esm/Cfe0kofqVKGxLqO6.mjs +31 -0
- package/browser/esm/CiRN-woJZWYOgTn4.mjs +36 -0
- package/browser/esm/Dd-ZybXAgoq9pgGv.mjs +45 -0
- package/browser/esm/DjiBz4H74I6nPUY6.mjs +79 -0
- package/browser/esm/DyU9UInRnfkPYYlR.mjs +63 -0
- package/browser/esm/J8cPagZBeXz86Lnd.mjs +777 -0
- package/browser/esm/Sp6PJavGKpF8SJzA.mjs +75 -0
- package/browser/esm/cYjYjqEsyd63x8t4.mjs +67 -0
- package/browser/esm/chart.mjs +60 -0
- package/browser/esm/control.mjs +216 -0
- package/browser/esm/group.mjs +123 -0
- package/browser/esm/index.mjs +14122 -8944
- package/browser/esm/note.mjs +86 -0
- package/browser/esm/picture.mjs +86 -0
- package/{node/esm/Ban9guHVB-Vxa-tq.mjs → browser/esm/shape.mjs} +2 -4
- package/browser/esm/slicer.mjs +276 -0
- package/licenses/dependencies.txt +6 -599
- package/node/esm/BJ7ZZm63j5O6cvrB.mjs +134 -0
- package/node/esm/BfRn5S5V4X8xIAEa.mjs +20 -0
- package/node/esm/BpwE3HqTnrLLzE3C.mjs +775 -0
- package/node/esm/Buw-VKYJy3y5dbaJ.mjs +197 -0
- package/node/esm/CFFlJxNwgyInjEnh.mjs +45 -0
- package/node/esm/CM5BT7h-hMtST2bE.mjs +2706 -0
- package/node/esm/CV3bT3Hql74GcHoU.mjs +37 -0
- package/node/esm/C_ANM4feA1xV-pri.mjs +32 -0
- package/node/esm/D3YXHeOyFp00Xk3m.mjs +323 -0
- package/node/esm/DPN0n6MGYQ9vZ2KO.mjs +80 -0
- package/node/esm/DYosMUJKp-3MSO4q.mjs +76 -0
- package/node/esm/DhSq680c5tgMFFbj.mjs +68 -0
- package/node/esm/Dxbm6ryIDCEi26RO.mjs +66 -0
- package/node/esm/GkmuxU7OwRZtm2Rf.mjs +63 -0
- package/node/esm/chart.mjs +60 -0
- package/node/esm/control.mjs +216 -0
- package/node/esm/group.mjs +123 -0
- package/node/esm/index.mjs +16649 -11320
- package/node/esm/note.mjs +87 -0
- package/node/esm/picture.mjs +86 -0
- package/node/esm/shape.mjs +783 -0
- package/node/esm/slicer.mjs +278 -0
- package/package.json +53 -14
- package/resources/contents.json +18 -0
- package/resources/locales/contents.json +42 -0
- package/resources/locales/de/movable.cmd.json +154 -0
- package/resources/locales/de/picture.cmd.json +31 -0
- package/resources/locales/de/selection.cmd.json +8 -0
- package/resources/locales/de/shape.cmd.json +17 -0
- package/resources/locales/de/sheet.cmd.json +328 -21
- package/resources/locales/de/slicer.cmd.json +17 -0
- package/resources/locales/de/table.cmd.json +9 -1
- package/resources/locales/de/ui.msg.json +309 -3
- package/resources/locales/de/workbook.cmd.json +10 -6
- package/resources/locales/en/movable.cmd.json +154 -0
- package/resources/locales/en/picture.cmd.json +31 -0
- package/resources/locales/en/selection.cmd.json +8 -0
- package/resources/locales/en/shape.cmd.json +17 -0
- package/resources/locales/en/sheet.cmd.json +342 -22
- package/resources/locales/en/slicer.cmd.json +17 -0
- package/resources/locales/en/table.cmd.json +9 -1
- package/resources/locales/en/ui.msg.json +309 -3
- package/resources/locales/en/workbook.cmd.json +11 -7
- package/types/chart.d.ts +2 -0
- package/types/control.d.ts +2 -0
- package/types/group.d.ts +2 -0
- package/types/note.d.ts +2 -0
- package/types/picture.d.ts +2 -0
- package/types/shape.d.ts +2 -0
- package/types/slicer.d.ts +2 -0
- package/types/src/annotation/RangeAnnotations.d.ts +119 -0
- package/types/src/annotation/index.d.ts +2 -0
- package/types/src/autoFill/AutoFillPresets.d.ts +14 -0
- package/types/src/autoFill/FillMenu.d.ts +36 -0
- package/types/src/autoFill/FillSeries.d.ts +38 -0
- package/types/src/autoFill/index.d.ts +4 -0
- package/types/src/border/StaticBorderRenderer.d.ts +2 -2
- package/types/src/border/useBorders.d.ts +7 -7
- package/types/src/cell/CornerTriangle.d.ts +6 -0
- package/types/src/cell/FormulaCellRenderer.d.ts +1 -1
- package/types/src/cell/OutlineButton.d.ts +123 -0
- package/types/src/cell/SheetCellRenderer.d.ts +17 -2
- package/types/src/cell/SheetHeaderRenderer.d.ts +5 -0
- package/types/src/cell/StaticCellRenderer.d.ts +57 -0
- package/types/src/cell/index.d.ts +2 -0
- package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
- package/types/src/chart/index.d.ts +0 -1
- package/types/src/checklist/ValueChecklist.d.ts +112 -0
- package/types/src/checklist/index.d.ts +2 -0
- package/types/src/commands/ContextualToolbar.d.ts +19 -0
- package/types/src/commands/createTransactionalMiddleware.d.ts +4 -1
- package/types/src/commands/index.d.ts +1 -0
- package/types/src/comment/CommentCardRequest.d.ts +94 -0
- package/types/src/comment/CommentUtils.d.ts +43 -0
- package/types/src/comment/NoteEditor.d.ts +20 -0
- package/types/src/comment/index.d.ts +5 -0
- package/types/src/comment/useCommentThread.d.ts +37 -0
- package/types/src/comment/useSheetComments.d.ts +28 -0
- package/types/src/{sheet → conditionalFormat}/ConditionalFormatPresets.d.ts +6 -6
- package/types/src/conditionalFormat/index.d.ts +1 -0
- package/types/src/control/FormControlRenderers.d.ts +22 -0
- package/types/src/editor/FunctionPreviewPanel.d.ts +15 -1
- package/types/src/editor/NamedItemLabel.d.ts +29 -0
- package/types/src/editor/NamedItemsPanel.d.ts +13 -2
- package/types/src/editor/SheetCellEditorLayer.d.ts +3 -7
- package/types/src/editor/SheetCellEditorStartLayer.d.ts +44 -0
- package/types/src/editor/SheetCellInput.d.ts +26 -2
- package/types/src/editor/SheetEditable.d.ts +8 -2
- package/types/src/editor/formulaCaret.d.ts +39 -10
- package/types/src/editor/formulaEval.d.ts +9 -5
- package/types/src/editor/formulaLint.d.ts +36 -0
- package/types/src/editor/formulaPresentation.d.ts +7 -0
- package/types/src/editor/formulaText.d.ts +17 -5
- package/types/src/editor/functionArgs.d.ts +20 -0
- package/types/src/editor/index.d.ts +4 -1
- package/types/src/editor/pickedReference.d.ts +76 -0
- package/types/src/editor/useEditRejectedNotice.d.ts +32 -0
- package/types/src/editor/useFormulaHints.d.ts +93 -3
- package/types/src/editor/useFormulaInput.d.ts +30 -4
- package/types/src/editor/useReferenceMode.d.ts +12 -0
- package/types/src/editor/validationAlert.d.ts +24 -0
- package/types/src/externalLink/ExternalLinksPaneArgs.d.ts +23 -0
- package/types/src/externalLink/index.d.ts +2 -0
- package/types/src/form/FormulaInput.d.ts +18 -2
- package/types/src/form/FormulaInputParts.d.ts +10 -1
- package/types/src/form/useEditCommit.d.ts +23 -3
- package/types/src/form/useInputField.d.ts +2 -3
- package/types/src/frame/CommandContext.d.ts +188 -6
- package/types/src/group/GroupEditor.d.ts +25 -0
- package/types/src/index.d.ts +12 -1
- package/types/src/io/WorkbookIO.d.ts +2 -0
- package/types/src/layer/CellErrorLayer.d.ts +24 -7
- package/types/src/layer/CommentCardLayer.d.ts +43 -0
- package/types/src/layer/CommentsLayer.d.ts +35 -0
- package/types/src/layer/ConditionalIcons.d.ts +4 -4
- package/types/src/layer/FreezeDragLines.d.ts +17 -0
- package/types/src/layer/GridFreezeLayer.d.ts +11 -0
- package/types/src/layer/HeaderFreezeLayer.d.ts +12 -0
- package/types/src/layer/HeaderResizerLayer.d.ts +2 -1
- package/types/src/layer/HyperlinkLayer.d.ts +109 -0
- package/types/src/layer/MovableKindScope.d.ts +17 -0
- package/types/src/layer/ProtectionLayer.d.ts +52 -0
- package/types/src/layer/RangeAnnotationLayer.d.ts +71 -0
- package/types/src/layer/ResizeIndicator.d.ts +9 -8
- package/types/src/layer/ResizeTooltip.d.ts +13 -0
- package/types/src/layer/SheetHeaderCellLayer.d.ts +10 -1
- package/types/src/layer/SheetOutlineLayer.d.ts +40 -0
- package/types/src/layer/TableLayer.d.ts +5 -4
- package/types/src/layer/TableToolbar.d.ts +42 -0
- package/types/src/layer/ValidationDropdownLayer.d.ts +61 -0
- package/types/src/layer/ValidationIndicatorLayer.d.ts +14 -21
- package/types/src/layer/ValidationPromptLayer.d.ts +64 -0
- package/types/src/layer/_tableColor.d.ts +4 -0
- package/types/src/layer/cellTip.d.ts +13 -0
- package/types/src/layer/freezeDragState.d.ts +21 -0
- package/types/src/layer/index.d.ts +14 -0
- package/types/src/layer/resizeIndicatorState.d.ts +3 -1
- package/types/src/layer/useFreezeDrag.d.ts +22 -0
- package/types/src/layer/useValidationPicker.d.ts +54 -0
- package/types/src/layer/validationMark.d.ts +63 -0
- package/types/src/listener/useModelListener.d.ts +4 -4
- package/types/src/movable/ConnectionSites.d.ts +18 -0
- package/types/src/movable/IMovableArea.d.ts +56 -0
- package/types/src/movable/MovableAdornment.d.ts +26 -0
- package/types/src/movable/MovableCommandGroups.d.ts +40 -0
- package/types/src/movable/MovableCommands.d.ts +6 -1
- package/types/src/movable/MovableControl.d.ts +78 -0
- package/types/src/movable/MovableEdit.d.ts +22 -0
- package/types/src/movable/MovableFrame.d.ts +16 -13
- package/types/src/movable/MovableLayer.d.ts +25 -7
- package/types/src/movable/MovableRenderers.d.ts +210 -0
- package/types/src/movable/PlaceholderFrames.d.ts +11 -0
- package/types/src/movable/RotateHandle.d.ts +37 -0
- package/types/src/movable/TextBox.d.ts +34 -0
- package/types/src/movable/connect.d.ts +16 -0
- package/types/src/movable/framePlacement.d.ts +72 -0
- package/types/src/movable/geometry.d.ts +61 -0
- package/types/src/movable/index.d.ts +10 -0
- package/types/src/movable/pressTarget.d.ts +20 -0
- package/types/src/picker/PickerPanel.d.ts +52 -0
- package/types/src/picker/cellPickerOpen.d.ts +6 -0
- package/types/src/picker/index.d.ts +4 -0
- package/types/src/picker/useCellPicker.d.ts +95 -0
- package/types/src/picture/PictureCommands.d.ts +12 -0
- package/types/src/picture/PictureKind.d.ts +7 -0
- package/types/src/picture/index.d.ts +0 -1
- package/types/src/protection/ProtectionPaneArgs.d.ts +31 -0
- package/types/src/protection/index.d.ts +3 -0
- package/types/src/protection/unlockProtectedRanges.d.ts +23 -0
- package/types/src/richText/RichTextEditor.d.ts +41 -0
- package/types/src/richText/index.d.ts +2 -0
- package/types/src/selection/SheetSelectionLayer.d.ts +14 -10
- package/types/src/shape/ConnectorControl.d.ts +46 -0
- package/types/src/shape/ShapeCommands.d.ts +11 -0
- package/types/src/shape/ShapeControl.d.ts +8 -0
- package/types/src/shape/ShapeEditor.d.ts +15 -2
- package/types/src/shape/ShapeGallery.d.ts +31 -0
- package/types/src/shape/ShapeHandles.d.ts +28 -0
- package/types/src/shape/ShapeKind.d.ts +7 -0
- package/types/src/shape/ShapeSVG.d.ts +22 -0
- package/types/src/shape/ShapeText.d.ts +17 -0
- package/types/src/shape/icons/ShapeIcons.d.ts +16 -0
- package/types/src/shape/icons/_ShapeIconPack.d.ts +4 -0
- package/types/src/shape/index.d.ts +3 -1
- package/types/src/shape/shapeFrame.d.ts +50 -0
- package/types/src/shape/shapeStyle.d.ts +82 -0
- package/types/src/sheet/ISheetElement.d.ts +62 -65
- package/types/src/sheet/SheetCommandProvider.d.ts +9 -4
- package/types/src/sheet/SheetCommands.d.ts +21 -6
- package/types/src/sheet/SheetOutlineElement.d.ts +70 -0
- package/types/src/sheet/SheetScrollbar.d.ts +1 -10
- package/types/src/sheet/_freezeAt.d.ts +10 -0
- package/types/src/sheet/_useHeaderMetrics.d.ts +11 -0
- package/types/src/sheet/circularReferences.d.ts +9 -1
- package/types/src/sheet/index.d.ts +1 -1
- package/types/src/sheet/useCycleHighlight.d.ts +21 -0
- package/types/src/slicer/SlicerCommands.d.ts +10 -0
- package/types/src/slicer/SlicerEditor.d.ts +8 -2
- package/types/src/slicer/SlicerKind.d.ts +7 -0
- package/types/src/slicer/SlicerStylePreview.d.ts +18 -0
- package/types/src/slicer/index.d.ts +2 -1
- package/types/src/slicer/slicerStyles.d.ts +32 -0
- package/types/src/tabStrip/TabStrip.d.ts +7 -0
- package/types/src/taskPane/ITaskPane.d.ts +12 -1
- package/types/src/taskPane/MovablePane.d.ts +17 -0
- package/types/src/taskPane/index.d.ts +1 -0
- package/types/src/theme/ThemeState.d.ts +14 -1
- package/types/src/theme/useGridColorScheme.d.ts +1 -1
- package/types/src/workbook/DefaultMovableRenderers.d.ts +20 -0
- package/types/src/workbook/IWorkbookElement.d.ts +24 -0
- package/types/src/workbook/WorkbookCommands.d.ts +2 -4
- package/types/src/workbook/WorkbookStrip.d.ts +9 -0
- package/types/src/workbook/_followOrigin.d.ts +9 -0
- package/types/src/workbook/useWorkbookFormat.d.ts +3 -3
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
- package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +0 -156
- package/browser/cjs/index.cjs +0 -35
- package/browser/esm/BdJpSdwyWuh-Te5p.mjs +0 -6286
- package/types/src/editor/useProtectedEditNotice.d.ts +0 -14
- package/types/src/movable/MoveableBundle.d.ts +0 -4
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CellCoords } from '@sheetxl/utils';
|
|
2
|
+
import { IComment, ISheet } from '@sheetxl/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* What a comments task pane is asked to open on — `activateTaskPane('comments', { args })`.
|
|
5
|
+
*/
|
|
6
|
+
export interface CommentsPaneArgs {
|
|
7
|
+
/**
|
|
8
|
+
* Scroll to this thread and put the caret in its reply box.
|
|
9
|
+
*/
|
|
10
|
+
focus?: IComment;
|
|
11
|
+
/**
|
|
12
|
+
* Open a draft on the active cell. Nothing is written until it is posted.
|
|
13
|
+
*/
|
|
14
|
+
insert?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* What a comment card is rendered from.
|
|
18
|
+
*/
|
|
19
|
+
export interface CommentCardRenderProps {
|
|
20
|
+
/** The sheet the card's cell is on. */
|
|
21
|
+
sheet: ISheet;
|
|
22
|
+
/** The cell the card belongs to. */
|
|
23
|
+
coords: CellCoords;
|
|
24
|
+
/** The thread on the cell, or `null` for a draft: a comment that has not been posted. */
|
|
25
|
+
comment: IComment | null;
|
|
26
|
+
/**
|
|
27
|
+
* A new value each time a command asks for the card, whose text then takes the caret; `0` when
|
|
28
|
+
* none has.
|
|
29
|
+
*/
|
|
30
|
+
focusRequest: number;
|
|
31
|
+
/** Dismisses the card; a draft that was not posted is dropped. */
|
|
32
|
+
onClose: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A cell whose comment card is asked to stay beside it with the caret in its text: a draft when the
|
|
36
|
+
* cell has no thread, the thread's reply box when it has one.
|
|
37
|
+
*/
|
|
38
|
+
export interface CommentCardRequest extends CellCoords {
|
|
39
|
+
/**
|
|
40
|
+
* A new value each time the card's text is asked to take the caret; `0` when the card is only
|
|
41
|
+
* asked to stay.
|
|
42
|
+
*/
|
|
43
|
+
focusRequest: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Options for {@link requestCommentCard}.
|
|
47
|
+
*/
|
|
48
|
+
export interface RequestCommentCardOptions {
|
|
49
|
+
/**
|
|
50
|
+
* Whether the card's text takes the caret.
|
|
51
|
+
* @defaultValue true
|
|
52
|
+
*/
|
|
53
|
+
autoFocus?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Asks for the comment card of a cell: a draft when the cell has no thread, its thread otherwise.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* This is how a command reaches a card it cannot see. The card floats beside the cell until the
|
|
60
|
+
* request is {@link clearCommentCard | cleared}, which the layer drawing it does when the selection
|
|
61
|
+
* leaves the cell. A draft writes nothing until it is posted.
|
|
62
|
+
*/
|
|
63
|
+
export declare const requestCommentCard: (sheet: ISheet, coords: CellCoords, options?: RequestCommentCardOptions) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Takes back a {@link requestCommentCard | request}; a draft that was not posted is dropped.
|
|
66
|
+
*/
|
|
67
|
+
export declare const clearCommentCard: (sheet: ISheet) => void;
|
|
68
|
+
/**
|
|
69
|
+
* The cell whose card is asked for on the sheet, or `null` for none.
|
|
70
|
+
*/
|
|
71
|
+
export declare const getCommentCardRequest: (sheet: ISheet) => CommentCardRequest | null;
|
|
72
|
+
/**
|
|
73
|
+
* Whether anything draws the sheet's comment cards. A command falls back to the comments task pane
|
|
74
|
+
* when nothing does.
|
|
75
|
+
*/
|
|
76
|
+
export declare const hasCommentCard: (sheet: ISheet) => boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Listens for the sheet's card request changing. Whatever draws the cards listens; the returned
|
|
79
|
+
* function stops listening.
|
|
80
|
+
*/
|
|
81
|
+
export declare const addCommentCardListener: (sheet: ISheet, listener: () => void) => (() => void);
|
|
82
|
+
/**
|
|
83
|
+
* The cell a draft is open on: a requested card whose cell has no comment yet. `null` for none.
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* For what marks the cell while its comment is being written. Following this does not count as
|
|
87
|
+
* drawing the cards, so {@link hasCommentCard} is unchanged by it.
|
|
88
|
+
*/
|
|
89
|
+
export declare const useCommentDraftCell: (sheet: ISheet) => CommentCardRequest | null;
|
|
90
|
+
/**
|
|
91
|
+
* {@link getCommentCardRequest}, kept current.
|
|
92
|
+
*/
|
|
93
|
+
export declare const useCommentCardRequest: (sheet: ISheet) => CommentCardRequest | null;
|
|
94
|
+
//# sourceMappingURL=CommentCardRequest.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CellCoords } from '@sheetxl/utils';
|
|
2
|
+
import { IComment } from '@sheetxl/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* The cell a comment is on, as plain coordinates.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* A comment's own range is anchored (`$B$2`); selecting or comparing cells wants the plain cell.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getCommentCoords: (comment: IComment) => CellCoords;
|
|
10
|
+
/**
|
|
11
|
+
* Orders comments as they are read on the sheet: by row, then by column.
|
|
12
|
+
*/
|
|
13
|
+
export declare const compareComments: (a: IComment, b: IComment) => number;
|
|
14
|
+
/**
|
|
15
|
+
* The initials shown in a person's avatar: the first letter of the first and of the last word of
|
|
16
|
+
* their name, or of the one word it has.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getPersonInitials: (displayName: string | null | undefined) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Options for {@link formatCommentTime}.
|
|
21
|
+
*/
|
|
22
|
+
export interface FormatCommentTimeOptions {
|
|
23
|
+
/** The moment the time is relative to. Defaults to now. */
|
|
24
|
+
now?: Date;
|
|
25
|
+
/** A BCP 47 language tag. Defaults to the runtime's. */
|
|
26
|
+
locale?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* When a comment was written, as a card shows it.
|
|
30
|
+
*/
|
|
31
|
+
export interface CommentTime {
|
|
32
|
+
/** How long ago, in words: `2 hours ago`, `yesterday`. */
|
|
33
|
+
relative: string;
|
|
34
|
+
/** The full date and time, for a tooltip. */
|
|
35
|
+
absolute: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Formats when a comment was written: relative for the card, absolute for its tooltip.
|
|
39
|
+
*
|
|
40
|
+
* @returns `null` for no date, which is what a note converted to a comment has.
|
|
41
|
+
*/
|
|
42
|
+
export declare const formatCommentTime: (date: Date | null | undefined, options?: FormatCommentTimeOptions) => CommentTime | null;
|
|
43
|
+
//# sourceMappingURL=CommentUtils.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IComment } from '@sheetxl/sdk';
|
|
3
|
+
import { MovableElementProps } from '../movable';
|
|
4
|
+
export interface NoteEditorAttributes {
|
|
5
|
+
isNoteEditor: () => true;
|
|
6
|
+
}
|
|
7
|
+
export interface INoteEditorElement extends HTMLDivElement, NoteEditorAttributes {
|
|
8
|
+
}
|
|
9
|
+
export interface NoteEditorProps extends MovableElementProps {
|
|
10
|
+
/**
|
|
11
|
+
* The note whose box this draws.
|
|
12
|
+
*/
|
|
13
|
+
note: IComment;
|
|
14
|
+
ref?: React.Ref<INoteEditorElement>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Draws a note in its box: the text with its formatting runs, edited in place.
|
|
18
|
+
*/
|
|
19
|
+
export declare const NoteEditor: React.NamedExoticComponent<Omit<NoteEditorProps, "ref"> & React.RefAttributes<INoteEditorElement>>;
|
|
20
|
+
//# sourceMappingURL=NoteEditor.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IComment, IPerson } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* One thread as a card shows it: the comment's current values, read once per change.
|
|
4
|
+
*/
|
|
5
|
+
export interface CommentThread {
|
|
6
|
+
/** The comment's text. */
|
|
7
|
+
content: string;
|
|
8
|
+
/** Who wrote it, or `null` if the workbook does not know them. */
|
|
9
|
+
author: IPerson | null;
|
|
10
|
+
/** When it was written, or `null` if it carries no date. */
|
|
11
|
+
date: Date | null;
|
|
12
|
+
/** Whether the thread is resolved. */
|
|
13
|
+
resolved: boolean;
|
|
14
|
+
/** The replies, oldest first. */
|
|
15
|
+
replies: IComment.IReply[];
|
|
16
|
+
/** `true` once the comment has been deleted; the other values are then empty. */
|
|
17
|
+
deleted: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A comment's thread, kept current: its text, author, replies and resolved state.
|
|
21
|
+
*
|
|
22
|
+
* @param comment The comment, or `null` for none (a draft that has not been posted).
|
|
23
|
+
* @returns The thread, or `null` when there is no comment.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* The object keeps its identity until the comment's content, replies or resolved state changes,
|
|
27
|
+
* or the comment is deleted.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* const thread = useCommentThread(comment);
|
|
32
|
+
* if (!thread || thread.deleted) return null;
|
|
33
|
+
* return <p>{thread.author?.getDisplayName()}: {thread.content} ({thread.replies.length} replies)</p>;
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const useCommentThread: (comment: IComment | null) => CommentThread | null;
|
|
37
|
+
//# sourceMappingURL=useCommentThread.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IComment, ISheet } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link useSheetComments}.
|
|
4
|
+
*/
|
|
5
|
+
export interface UseSheetCommentsOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Only threads with this resolved state. Omit for every thread.
|
|
8
|
+
*/
|
|
9
|
+
resolved?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The threaded comments on a sheet, in reading order, kept current.
|
|
13
|
+
*
|
|
14
|
+
* @param sheet The sheet, or `null` for none.
|
|
15
|
+
* @param options {@link UseSheetCommentsOptions}
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Notes are not threads and are left out. The array keeps its identity until a comment on the
|
|
19
|
+
* sheet is added, removed, moved, edited, replied to or resolved.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const open = useSheetComments(sheet, { resolved: false });
|
|
24
|
+
* return <ul>{open.map((comment) => <li key={comment.getId()}>{comment.getContent()}</li>)}</ul>;
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const useSheetComments: (sheet: ISheet | null, options?: UseSheetCommentsOptions) => IComment[];
|
|
28
|
+
//# sourceMappingURL=useSheetComments.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConditionalFormat,
|
|
1
|
+
import { IConditionalFormat, ICellStyle } from '@sheetxl/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* Shared authoring presets for the conditional-format editor.
|
|
4
4
|
*
|
|
@@ -13,7 +13,7 @@ import { IConditionalFormat, IStyle } from '@sheetxl/sdk';
|
|
|
13
13
|
export interface StylePreset {
|
|
14
14
|
/** Stable identifier; UI layers key their localized tooltip off it. */
|
|
15
15
|
key: string;
|
|
16
|
-
style:
|
|
16
|
+
style: ICellStyle.Properties;
|
|
17
17
|
}
|
|
18
18
|
export declare const STYLE_PRESETS: readonly StylePreset[];
|
|
19
19
|
/**
|
|
@@ -42,7 +42,7 @@ export declare const defaultIconSet: () => IConditionalFormat.IconSet;
|
|
|
42
42
|
export interface IconSetGalleryBlock {
|
|
43
43
|
key: 'directional' | 'shapes' | 'indicators' | 'ratings';
|
|
44
44
|
/** Each row is a pair of sets; the right seat may be empty. */
|
|
45
|
-
rows: readonly (readonly [
|
|
45
|
+
rows: readonly (readonly [ICellStyle.IconSet, ICellStyle.IconSet | null])[];
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Every set the gallery offers, laid out the way Excel Online's own gallery is — two sets to a
|
|
@@ -64,13 +64,13 @@ export declare const ICON_SET_GALLERY_BLOCKS: readonly IconSetGalleryBlock[];
|
|
|
64
64
|
*/
|
|
65
65
|
export declare const iconSetSize: (set: string) => number;
|
|
66
66
|
/** A ready-to-apply rule for a built-in set — the set at Excel's default even banding. */
|
|
67
|
-
export declare const iconSetPreset: (set:
|
|
67
|
+
export declare const iconSetPreset: (set: ICellStyle.IconSet) => IConditionalFormat.IconSet;
|
|
68
68
|
/**
|
|
69
69
|
* The per-band override that draws nothing — Excel's "No Cell Icon", spelled the way its x14
|
|
70
70
|
* writer spells it.
|
|
71
71
|
*/
|
|
72
72
|
export declare const NO_CELL_ICON: Readonly<{
|
|
73
|
-
set:
|
|
73
|
+
set: ICellStyle.IconSet;
|
|
74
74
|
id: number;
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
@@ -87,7 +87,7 @@ export declare const NO_CELL_ICON: Readonly<{
|
|
|
87
87
|
* @param icon The icon to draw there, or `null` to restore the band's own.
|
|
88
88
|
*/
|
|
89
89
|
export declare const withIconOverride: (scale: IConditionalFormat.IconSet, band: number, icon: {
|
|
90
|
-
set:
|
|
90
|
+
set: ICellStyle.IconSet;
|
|
91
91
|
id: number;
|
|
92
92
|
} | null) => IConditionalFormat.IconSet;
|
|
93
93
|
//# sourceMappingURL=ConditionalFormatPresets.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MovableRendererProps } from '../movable';
|
|
3
|
+
export declare const ButtonRenderer: React.ComponentType<MovableRendererProps>;
|
|
4
|
+
export declare const CheckBoxRenderer: React.ComponentType<MovableRendererProps>;
|
|
5
|
+
export declare const OptionButtonRenderer: React.ComponentType<MovableRendererProps>;
|
|
6
|
+
/**
|
|
7
|
+
* The browser's own slider, lying the way the shape does. A vertical one runs downward, its
|
|
8
|
+
* minimum at the top, as Excel's scroll bar does.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ScrollBarRenderer: React.ComponentType<MovableRendererProps>;
|
|
11
|
+
/**
|
|
12
|
+
* A spinner is its two buttons and nothing else; the number it holds is in its linked cell. The
|
|
13
|
+
* browser's own buttons, as the button control's are.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SpinnerRenderer: React.ComponentType<MovableRendererProps>;
|
|
16
|
+
export declare const DropDownRenderer: React.ComponentType<MovableRendererProps>;
|
|
17
|
+
export declare const ListBoxRenderer: React.ComponentType<MovableRendererProps>;
|
|
18
|
+
export declare const GroupBoxRenderer: React.ComponentType<MovableRendererProps>;
|
|
19
|
+
export declare const LabelRenderer: React.ComponentType<MovableRendererProps>;
|
|
20
|
+
/** A kind with no look of its own: a neutral frame with its name. */
|
|
21
|
+
export declare const UnmodeledControlRenderer: React.ComponentType<MovableRendererProps>;
|
|
22
|
+
//# sourceMappingURL=FormControlRenderers.d.ts.map
|
|
@@ -17,6 +17,18 @@ export interface FunctionHint {
|
|
|
17
17
|
argIndex: number;
|
|
18
18
|
/** The function's declared parameters, in order (name / optional / rest). */
|
|
19
19
|
params: readonly IFunction.IParameterType[];
|
|
20
|
+
/**
|
|
21
|
+
* The argument the caret is in holds a literal outside the values its parameter is limited to
|
|
22
|
+
* (`findEnumLints`). Shown under that argument's description while it is the one lit.
|
|
23
|
+
*/
|
|
24
|
+
warning?: {
|
|
25
|
+
/** The argument, as {@link argIndex} counts. */
|
|
26
|
+
argIndex: number;
|
|
27
|
+
/** The literal as written. */
|
|
28
|
+
value: string;
|
|
29
|
+
/** The values it could be, as literals, joined for display. */
|
|
30
|
+
values: string;
|
|
31
|
+
};
|
|
20
32
|
}
|
|
21
33
|
/**
|
|
22
34
|
* The function's self-describing text, loaded lazily (async) from `getDescriptor()`. Keyed by `name`
|
|
@@ -31,6 +43,8 @@ export interface FunctionDescriptor {
|
|
|
31
43
|
params: Readonly<Record<string, {
|
|
32
44
|
description?: string;
|
|
33
45
|
}>>;
|
|
46
|
+
/** The copy for each enum a parameter is limited to, keyed by enum id — see `IFunction.IDescriptor.getEnums`. */
|
|
47
|
+
enums?: Readonly<Record<string, IFunction.IEnumDescription>>;
|
|
34
48
|
}
|
|
35
49
|
export declare const argTypeKey: (param: IFunction.IParameterType) => string;
|
|
36
50
|
export interface FunctionArgIconsProps {
|
|
@@ -157,7 +171,7 @@ export interface FunctionPreviewPanelProps {
|
|
|
157
171
|
* @remarks
|
|
158
172
|
* This is the "B" half of the formula-editor hint UI (the autocomplete *list* is "A"). Presentational
|
|
159
173
|
* and props-driven — the editor owns the caret → hint derivation and passes it down. The expand/collapse
|
|
160
|
-
* state persists (via {@link
|
|
174
|
+
* state persists (via {@link usePersistentState}); close is delegated via
|
|
161
175
|
* {@link FunctionPreviewPanelProps.onClose}. No **Example** is shown: `IDescriptor` has no function-level
|
|
162
176
|
* example and we won't fabricate one. The active-argument emphasis is driven by `hint.argIndex`. Nothing
|
|
163
177
|
* here mutates the edit.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NamedItem } from './NamedItemsPanel';
|
|
3
|
+
export interface NamedItemLabelProps {
|
|
4
|
+
/** What the row shows: its name, its kind (the glyph) and an optional trailing category. */
|
|
5
|
+
item: NamedItem;
|
|
6
|
+
/** A dimmed line under the name, shown when given. */
|
|
7
|
+
summary?: string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Let the summary wrap.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue `false` — one clipped line (with the full text as a tooltip), so a floating list
|
|
12
|
+
* does not change height as its selection moves.
|
|
13
|
+
*/
|
|
14
|
+
wrapSummary?: boolean;
|
|
15
|
+
/** Height of the name line, in px. @defaultValue `22` */
|
|
16
|
+
rowHeight?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The content of one row in a list of functions, names and tables — the kind glyph, the name, an
|
|
20
|
+
* optional trailing category and an optional summary under it.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Shared so an item reads the same wherever it is listed: the formula autocomplete
|
|
24
|
+
* ({@link NamedItemsPanel}) and the Insert Function dialog. Presentational only — the host owns the
|
|
25
|
+
* row element, its selection styling and its events. The name carries the class `named-item-name`,
|
|
26
|
+
* for a host that styles it (the dialog sets it in the monospace font).
|
|
27
|
+
*/
|
|
28
|
+
export declare const NamedItemLabel: React.FC<NamedItemLabelProps>;
|
|
29
|
+
//# sourceMappingURL=NamedItemLabel.d.ts.map
|
|
@@ -4,9 +4,16 @@
|
|
|
4
4
|
* @remarks
|
|
5
5
|
* `'named'` covers every non-table entry of the workbook's `INamedCollection` (a named range, a named
|
|
6
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.
|
|
7
|
+
* the name goes in bare and stands on its own. `'parameter'` is a `LET`/`LAMBDA` name in scope at the
|
|
8
|
+
* caret — completed the same way, but it lives in the formula rather than the workbook. `'lambda'` is a
|
|
9
|
+
* name bound to a literal `LAMBDA(…)` — a defined name whose body is one, or a `LET` name whose value is
|
|
10
|
+
* one: a name, but completed like a function, with its paren.
|
|
11
|
+
* `'column'` and `'specifier'` (`#Data`, `@ - This Row`) are offered inside a table's brackets; the
|
|
12
|
+
* bracket is left for the user to close.
|
|
13
|
+
* `'enum'` is one value an argument is limited to, offered in an empty argument of that type; its
|
|
14
|
+
* name is the literal a formula spells (`1`, `"osversion"`), and it goes in as written.
|
|
8
15
|
*/
|
|
9
|
-
export type NamedItemKind = 'function' | 'named' | 'table';
|
|
16
|
+
export type NamedItemKind = 'function' | 'named' | 'lambda' | 'table' | 'parameter' | 'column' | 'specifier' | 'enum';
|
|
10
17
|
/**
|
|
11
18
|
* One row in the formula autocomplete list. Deliberately minimal — the presentational panel needs a
|
|
12
19
|
* display `name`, its {@link NamedItemKind}, and optionally a `category` / an `iconKey` override. The
|
|
@@ -17,6 +24,10 @@ export interface NamedItem {
|
|
|
17
24
|
name: string;
|
|
18
25
|
/** What the row is. Defaults to `'function'`, which is what an omitted kind meant before names joined the list. */
|
|
19
26
|
kind?: NamedItemKind;
|
|
27
|
+
/** Optional text shown right after the name, unemphasized — an `'enum'` label's value (`AVERAGE 1`). */
|
|
28
|
+
detail?: string;
|
|
29
|
+
/** What choosing the row inserts, when that is not `name` — an `'enum'` label inserts its value. */
|
|
30
|
+
insert?: string;
|
|
20
31
|
/** Optional category (e.g. `Math & Trig`), shown dimmed at the row's trailing edge. */
|
|
21
32
|
category?: string;
|
|
22
33
|
/** Optional icon-pack key for the leading glyph; overrides the {@link NamedItemKind} default. */
|
|
@@ -23,15 +23,11 @@ export interface SheetCellEditorLayerProps extends VirtualDivProps {
|
|
|
23
23
|
* no flag.
|
|
24
24
|
*/
|
|
25
25
|
darkMode?: boolean;
|
|
26
|
-
/** Horizontal anchor used when the editor grows past its cell (Excel-style overflow). @defaultValue `'left'` */
|
|
27
|
-
alignment?: EditorAlignment;
|
|
28
26
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* ({@link useProtectedEditNotice}) so all panes form one once-per-visit notice scope.
|
|
32
|
-
* @defaultValue this layer's own {@link useProtectedEditNotice}
|
|
27
|
+
* Horizontal anchor used when the editor grows past its cell (Excel-style overflow). Overrides the
|
|
28
|
+
* default, which follows the edited cell's rendered alignment (formulas always grow to the right).
|
|
33
29
|
*/
|
|
34
|
-
|
|
30
|
+
alignment?: EditorAlignment;
|
|
35
31
|
}
|
|
36
32
|
export declare function SheetCellEditorLayer(props: SheetCellEditorLayerProps): React.ReactElement;
|
|
37
33
|
export declare namespace SheetCellEditorLayer {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
3
|
+
import { SheetEditable } from './SheetEditable';
|
|
4
|
+
import { EditRejectedNotice } from './useEditRejectedNotice';
|
|
5
|
+
/**
|
|
6
|
+
* Props for {@link SheetCellEditorStartLayer}.
|
|
7
|
+
*/
|
|
8
|
+
export interface SheetCellEditorStartLayerProps {
|
|
9
|
+
/** The sheet — stamps the double-clicked cell's scope (sheet name) onto the coords it starts on. */
|
|
10
|
+
sheet: ISheet;
|
|
11
|
+
/** The editable (UI model) — the same instance the {@link SheetCellEditorLayer} renders. */
|
|
12
|
+
editable: SheetEditable;
|
|
13
|
+
/**
|
|
14
|
+
* Notified when a start-edit attempt is rejected (`startEdit` returned `false` — a non-editable
|
|
15
|
+
* cell). The host that mounts one layer per pane (`SheetElement`) passes a SHARED callback
|
|
16
|
+
* ({@link useEditRejectedNotice}) so all panes form one notice scope; it receives the rejected cell.
|
|
17
|
+
* @defaultValue this layer's own {@link useEditRejectedNotice}
|
|
18
|
+
*/
|
|
19
|
+
onEditRejected?: EditRejectedNotice;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The sheet's **ready-mode** edit starters — the `@sheetxl/react` counterpart of grid-react's
|
|
23
|
+
* `EditorStartLayer`: a typed character / `F2` / `Backspace` opens an edit on the anchor, a
|
|
24
|
+
* double-click opens one on the cell under the pointer, and a rejected start raises the Excel-style
|
|
25
|
+
* heads-up (protected sheet, array part, unlock-range prompt).
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* A content-less layer, separate from the {@link SheetCellEditorLayer} that paints the box. The box
|
|
29
|
+
* sits at the **top** of the stack to paint over everything, but a Layer's handlers are its slot's
|
|
30
|
+
* tap — grid-wide ears that fire on every layer's turn, top first — so start handlers on the top
|
|
31
|
+
* layer intercepted keys and double-clicks aimed at a chart or note before that widget's own handlers
|
|
32
|
+
* ran. Starting an edit is the grid *floor's* behavior: `SheetElement` mounts this as the first grid
|
|
33
|
+
* child, where it only hears what no widget above consumed.
|
|
34
|
+
*
|
|
35
|
+
* Keys are positionless, so the floor slot alone is not enough: a focused widget that does not consume
|
|
36
|
+
* a printable key (it must let keys through so its own commands can resolve) would still reach this
|
|
37
|
+
* tap. The key start therefore acts only when the key is aimed at the grid surface itself — the
|
|
38
|
+
* surface is the focused element. A double-click has a position; a widget that owns it consumes it.
|
|
39
|
+
*/
|
|
40
|
+
export declare function SheetCellEditorStartLayer(props: SheetCellEditorStartLayerProps): React.ReactElement;
|
|
41
|
+
export declare namespace SheetCellEditorStartLayer {
|
|
42
|
+
var displayName: string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=SheetCellEditorStartLayer.d.ts.map
|
|
@@ -29,6 +29,15 @@ export interface SheetCellInputOptions {
|
|
|
29
29
|
*/
|
|
30
30
|
fillNone?: boolean;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Project the cell's **edit string**: the formula (`=…`), else the formatted text, with the leading
|
|
34
|
+
* `'` restored for a quote-prefixed (text-forced) cell.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Exported for the grid editor layer, which needs the same text the input will display to decide which way
|
|
38
|
+
* the box grows (a formula always grows to the right, whatever the cell's alignment).
|
|
39
|
+
*/
|
|
40
|
+
export declare const editStringFromCell: (cell: ICell) => string;
|
|
32
41
|
/**
|
|
33
42
|
* The **ghost formula** for a spilled-INTO cell: the spill anchor's formula, as Excel greys it in the
|
|
34
43
|
* formula bar. `null` for every other cell (including the anchor itself, which owns the formula and so
|
|
@@ -52,8 +61,9 @@ export declare const placeholderFromCell: (cell: ICell | null) => string | null;
|
|
|
52
61
|
*
|
|
53
62
|
* **Placement** is driven by {@link ICell.getTextPlacement} — the *same* SDK geometry the cell
|
|
54
63
|
* renderer uses — so the editor's text sits exactly where the rendered cell's does. Insets define the
|
|
55
|
-
* content box; the
|
|
56
|
-
*
|
|
64
|
+
* content box horizontally; the placement's text block (Excel's baseline rules) bounds it vertically; the
|
|
65
|
+
* cell's line height sets the line rhythm; vertical alignment is flex `justifyContent` within that
|
|
66
|
+
* box. Horizontal overflow + wrap ride the `cellSize`/`onNaturalSize` seam: a
|
|
57
67
|
* wrapped cell measures its own height (clip-proof) and reports width 0 so the layer grows the box
|
|
58
68
|
* *down*; an unwrapped cell reports the shrink-to-content width so the layer grows it *across* columns.
|
|
59
69
|
*/
|
|
@@ -94,6 +104,20 @@ export type SheetCellInputProps = EditorInputProps<() => ICell, string> & {
|
|
|
94
104
|
* a sliver of the next; supplying it makes the two exact.
|
|
95
105
|
*/
|
|
96
106
|
lineHeight?: number;
|
|
107
|
+
/**
|
|
108
|
+
* The virtual keyboard a touch host asks for (`'decimal'` for a number pad). Applied to the
|
|
109
|
+
* textarea; a change takes effect on the next focus on some platforms.
|
|
110
|
+
*/
|
|
111
|
+
inputMode?: React.TextareaHTMLAttributes<HTMLTextAreaElement>['inputMode'];
|
|
112
|
+
/** The action label of the virtual keyboard's Enter key. */
|
|
113
|
+
enterKeyHint?: React.TextareaHTMLAttributes<HTMLTextAreaElement>['enterKeyHint'];
|
|
114
|
+
/**
|
|
115
|
+
* Which side of the caret the function hint opens on. A host at the bottom of the screen (the
|
|
116
|
+
* phone's formula bar) asks for `'above'`, where the room is.
|
|
117
|
+
*
|
|
118
|
+
* @defaultValue 'below'
|
|
119
|
+
*/
|
|
120
|
+
hintPlacement?: 'below' | 'above';
|
|
97
121
|
};
|
|
98
122
|
export declare const createSheetCellInput: (options: SheetCellInputOptions) => React.FC<SheetCellInputProps>;
|
|
99
123
|
//# sourceMappingURL=SheetCellInput.d.ts.map
|
|
@@ -16,8 +16,10 @@ export declare const resolveCellBackground: (cell: ICell, sheet: ISheet, darkMod
|
|
|
16
16
|
* @remarks
|
|
17
17
|
* - **clean** is `() => ICell` — a *live* cell getter (not a captured value), so a cell-aware input
|
|
18
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
|
|
20
|
-
* string to a formula / number / date / text.
|
|
19
|
+
* - **commit** writes the dirty string via `range.setValue(text, { autoFit, autoSelectRestore })` — the SDK
|
|
20
|
+
* coerces the string to a formula / number / date / text. `autoSelectRestore` without `autoSelect`: the
|
|
21
|
+
* write leaves the selection as it is (a block typed into stays selected for Enter to move within),
|
|
22
|
+
* and an undo or a redo of it lands on the cell.
|
|
21
23
|
* - **`null`** ⇒ the cell is not editable (protected / read-only), via {@link ICell.isEditAllowed}.
|
|
22
24
|
* - **scope-aware**: `coords.scope` (a sheet name) picks the sheet to edit, via `workbook.getSheet`,
|
|
23
25
|
* falling back to `sheet`. This is what makes a commit write back to the session's *origin* sheet even
|
|
@@ -26,6 +28,10 @@ export declare const resolveCellBackground: (cell: ICell, sheet: ISheet, darkMod
|
|
|
26
28
|
*
|
|
27
29
|
* Construct the editable with it: `new DefaultEditable(anchor, createSheetCreateEdit(sheet))` — or use
|
|
28
30
|
* the {@link createEditable} factory, which wires both.
|
|
31
|
+
*
|
|
32
|
+
* A write the model REFUSES (an `ExpectedError` such as "You can't change part of an array") throws
|
|
33
|
+
* out of `commit`, which rejects it; the editable fans the error out to
|
|
34
|
+
* `IEditable.subscribeCommitError`, where the host shows it.
|
|
29
35
|
*/
|
|
30
36
|
export declare const createSheetCreateEdit: (sheet: ISheet, workbook?: IWorkbook | null) => CreateEdit<() => ICell, string, EditCommitArgs>;
|
|
31
37
|
/**
|
|
@@ -10,29 +10,47 @@ import { ICalculation } from '@sheetxl/sdk';
|
|
|
10
10
|
export declare const caretOwnerToken: (tokens: readonly ICalculation.FormulaToken[], caret: number, base?: number) => {
|
|
11
11
|
token: ICalculation.FormulaToken;
|
|
12
12
|
start: number;
|
|
13
|
+
index: number;
|
|
13
14
|
} | null;
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* Whether `token` names something the autocomplete list can offer: a function, a workbook name or
|
|
17
|
+
* table, a use of a `LET`/`LAMBDA` parameter, or the unfinished part of a structured reference. A
|
|
18
|
+
* partial identifier being typed is a `named` token too, even at the end of a formula that no longer
|
|
19
|
+
* parses.
|
|
16
20
|
*
|
|
17
|
-
* A
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
21
|
+
* A parameter's DECLARATION is not one — it introduces a new name, so there is nothing to complete.
|
|
22
|
+
* Nor is a table part the SDK has not marked `partial`: a finished part is not reopened.
|
|
23
|
+
*/
|
|
24
|
+
export declare const isCompletionToken: (token: ICalculation.FormulaToken) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The span of the name being **completed** at the caret, or `null` when nothing is. Offsets are text offsets
|
|
27
|
+
* past the leading formula prefix (`base`), like {@link caretOwnerToken}'s.
|
|
28
|
+
*
|
|
29
|
+
* A candidate is an {@link isCompletionToken} that is **not already a call** — no `(` token immediately follows
|
|
30
|
+
* a name, and no `[` follows a table name. That second half is the whole point: a name that already has its
|
|
31
|
+
* paren is finished work, and clicking back into it (to read it, to fix an argument) is a navigation gesture,
|
|
32
|
+
* not a request to complete it — re-popping the autocomplete list there covers the very formula you came back
|
|
33
|
+
* to look at. Excel behaves the same way.
|
|
23
34
|
*
|
|
24
35
|
* Typing is unaffected: `=SU` has no trailing paren, so the list still appears as you type, and accepting a
|
|
25
36
|
* row parks the caret INSIDE the parens where the signature preview takes over.
|
|
26
37
|
*
|
|
38
|
+
* What the list is built from comes off the token, as the SDK stated it:
|
|
39
|
+
* - `part` — the unfinished part of a structured reference (`Sales[Co`, or the empty part after `Sales[`):
|
|
40
|
+
* which table, and what may finish it (`TablePartRef.partial`); `nested` when it is an item of a
|
|
41
|
+
* bracketed list (`Sales[[#This Row],[Co`) rather than the reference's only part;
|
|
42
|
+
* - `bound` — otherwise, the `LET` / `LAMBDA` names in scope there (`FormulaTokenContext.bound`).
|
|
43
|
+
*
|
|
27
44
|
* The editor shares this between the list and the signature preview so the two can never both claim the
|
|
28
45
|
* caret — exactly one shows, and suppressing the list here is what lets the preview show the enclosing
|
|
29
46
|
* 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
47
|
*/
|
|
33
|
-
export declare const completionSpanAtCaret: (tokens: readonly ICalculation.FormulaToken[], caret: number, base: number
|
|
48
|
+
export declare const completionSpanAtCaret: (tokens: readonly ICalculation.FormulaToken[], caret: number, base: number) => {
|
|
34
49
|
start: number;
|
|
35
50
|
end: number;
|
|
51
|
+
part?: ICalculation.TablePartRef;
|
|
52
|
+
nested?: true;
|
|
53
|
+
bound?: readonly ICalculation.BoundName[];
|
|
36
54
|
} | null;
|
|
37
55
|
/** The function + argument the caret is currently in. */
|
|
38
56
|
export interface FunctionCaretContext {
|
|
@@ -40,7 +58,18 @@ export interface FunctionCaretContext {
|
|
|
40
58
|
name: string;
|
|
41
59
|
/** Zero-based index of the argument the caret is in. */
|
|
42
60
|
argIndex: number;
|
|
61
|
+
/** The `LET` / `LAMBDA` names in scope at the call ({@link ICalculation.FormulaTokenContext.bound}), when any are. */
|
|
62
|
+
bound?: readonly ICalculation.BoundName[];
|
|
43
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Whether the argument the caret is in (`ctx`, from {@link resolveFunctionContext}) holds nothing yet:
|
|
66
|
+
* the caret sits right after the call's `(` or a separator, or in whitespace there, and only a
|
|
67
|
+
* separator, the call's `)` or the end of the text follows.
|
|
68
|
+
*
|
|
69
|
+
* Read off the `empty` token the SDK emits for an argument with no content. That token carries the
|
|
70
|
+
* argument's own context, so an empty argument of a nested call is never taken for this one's.
|
|
71
|
+
*/
|
|
72
|
+
export declare const isEmptyArgumentAt: (tokens: readonly ICalculation.FormulaToken[], caret: number, base: number, ctx: FunctionCaretContext) => boolean;
|
|
44
73
|
/**
|
|
45
74
|
* Resolve which function + argument the caret sits in, from a formula's token stream.
|
|
46
75
|
*
|