@sheetxl/react 0.8.0-beta.5 → 0.8.0-beta.7
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/cjs/index.cjs +16 -15
- package/browser/esm/{DnLe2b-bkbmyx9f1.mjs → CwXbsCWTrl3QB1t6.mjs} +1 -1
- package/browser/esm/index.mjs +4038 -3131
- package/node/esm/{Dwqmv542iuwb2y2A.mjs → CZc8rKcLzArmqJz2.mjs} +1 -1
- package/node/esm/index.mjs +3844 -2930
- package/package.json +6 -6
- package/resources/locales/de/sheet.cmd.json +47 -14
- package/resources/locales/de/ui.msg.json +9 -1
- package/resources/locales/en/sheet.cmd.json +48 -15
- package/resources/locales/en/ui.msg.json +9 -1
- package/types/src/cell/CornerTriangle.d.ts +6 -0
- package/types/src/cell/SheetHeaderRenderer.d.ts +5 -0
- package/types/src/checklist/ValueChecklist.d.ts +1 -1
- 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 +6 -0
- package/types/src/comment/useCommentThread.d.ts +37 -0
- package/types/src/comment/useSheetComments.d.ts +28 -0
- package/types/src/editor/FunctionPreviewPanel.d.ts +1 -1
- package/types/src/editor/SheetCellEditorLayer.d.ts +0 -8
- package/types/src/editor/SheetCellEditorStartLayer.d.ts +44 -0
- package/types/src/editor/index.d.ts +1 -0
- package/types/src/editor/useFormulaInput.d.ts +9 -0
- package/types/src/index.d.ts +2 -0
- package/types/src/layer/CommentCardLayer.d.ts +45 -0
- package/types/src/layer/CommentsLayer.d.ts +35 -0
- package/types/src/layer/ValidationPromptLayer.d.ts +2 -2
- package/types/src/layer/index.d.ts +2 -0
- package/types/src/listener/useModelListener.d.ts +4 -4
- package/types/src/movable/IMovableArea.d.ts +29 -0
- package/types/src/movable/MovableEdit.d.ts +22 -0
- package/types/src/movable/MovableFrame.d.ts +2 -0
- package/types/src/movable/TextBox.d.ts +34 -0
- package/types/src/movable/index.d.ts +2 -0
- package/types/src/richText/RichTextEditor.d.ts +41 -0
- package/types/src/richText/index.d.ts +2 -0
- package/types/src/sheet/ISheetElement.d.ts +8 -0
- package/types/src/sheet/SheetCommands.d.ts +2 -2
- package/types/src/theme/ThemeState.d.ts +2 -2
- package/types/src/workbook/WorkbookCommands.d.ts +2 -2
|
@@ -123,6 +123,15 @@ export interface UseFormulaInputOptions {
|
|
|
123
123
|
* for anything that genuinely spans sheets, e.g. chart series.
|
|
124
124
|
*/
|
|
125
125
|
allowCrossSheet?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether the field must hold a value. Default `false`: empty text is the CLEARED value (`null`),
|
|
128
|
+
* emitted and committed like any other.
|
|
129
|
+
*
|
|
130
|
+
* `true` makes empty text an ERROR instead, so it can never be committed — for a host whose
|
|
131
|
+
* model has no empty state (the ranges an item is anchored to). A field that MOUNTS empty shows
|
|
132
|
+
* no error until it is edited.
|
|
133
|
+
*/
|
|
134
|
+
required?: boolean;
|
|
126
135
|
/** Disabled: never engages the bus; the text is read-only at the host's discretion. */
|
|
127
136
|
disabled?: boolean;
|
|
128
137
|
/** Resolution context. Defaults to the enclosing `WorkbookContext`. */
|
package/types/src/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export * from './picture';
|
|
|
9
9
|
export * from './shape';
|
|
10
10
|
export * from './chart';
|
|
11
11
|
export * from './slicer';
|
|
12
|
+
export * from './comment';
|
|
13
|
+
export * from './richText';
|
|
12
14
|
export * from './movable';
|
|
13
15
|
export * from './form';
|
|
14
16
|
export * from './editableLabel';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
import { CommentCardRenderProps } from '../comment/CommentCardRequest';
|
|
5
|
+
export interface CommentCardLayerProps extends Omit<LayerProps, 'children'> {
|
|
6
|
+
/** Class for the floated card container. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Style for the floated card container. */
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
/** The sheet whose threads are shown. */
|
|
11
|
+
sheet: ISheet;
|
|
12
|
+
/**
|
|
13
|
+
* Renders the card. The layer places it, keeps it open and keeps its keystrokes and presses from
|
|
14
|
+
* the grid; what it looks like is the renderer's.
|
|
15
|
+
*/
|
|
16
|
+
renderCard: (props: CommentCardRenderProps) => React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The task pane that lists the sheet's threads. While it is the active pane the cards are shown
|
|
19
|
+
* there and this layer shows none.
|
|
20
|
+
* @defaultValue 'comments'
|
|
21
|
+
*/
|
|
22
|
+
paneKey?: string;
|
|
23
|
+
/** Gap (px) between the cell's right edge and the card. @defaultValue 18 */
|
|
24
|
+
offset?: number;
|
|
25
|
+
/** Dwell (ms) on a thread's cell before its card shows. @defaultValue 300 */
|
|
26
|
+
openDelay?: number;
|
|
27
|
+
/** Grace (ms) after leaving the cell and its card before the card hides. @defaultValue 250 */
|
|
28
|
+
closeDelay?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The **comment card** beside a cell — a {@link RangeFloatLayer} showing the thread of the cell the
|
|
32
|
+
* pointer rests on, and the card a command {@link requestCommentCard | asked for}: a draft on a
|
|
33
|
+
* cell with no thread, or the thread a command went to. Selecting a cell shows nothing by itself,
|
|
34
|
+
* as in Excel.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* A note has a box of its own and is not shown here. The card of a requested cell stays until the
|
|
38
|
+
* selection leaves the cell or the card is dismissed; a card that takes the focus is kept the same
|
|
39
|
+
* way, so a reply being typed does not close when the pointer wanders off.
|
|
40
|
+
*
|
|
41
|
+
* The float portals out of the pane, but React events still bubble through the React tree to the
|
|
42
|
+
* grid, so the layer stops the card's keystrokes, presses, clipboard and context-menu events there.
|
|
43
|
+
*/
|
|
44
|
+
export declare const CommentCardLayer: React.MemoExoticComponent<(props: CommentCardLayerProps) => React.JSX.Element>;
|
|
45
|
+
//# sourceMappingURL=CommentCardLayer.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
3
|
+
import { LayerProps } from '@sheetxl/grid-react';
|
|
4
|
+
export interface CommentsLayerProps extends LayerProps {
|
|
5
|
+
/** Class for the layer (devtools identification). */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Style for the indicators host box. */
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/** The sheet whose comments are indicated. */
|
|
10
|
+
sheet: ISheet;
|
|
11
|
+
/** Size (px, unzoomed) of the corner indicator. @defaultValue 7 */
|
|
12
|
+
markSize?: number;
|
|
13
|
+
/** Dwell (ms) on a note's cell before its box shows. @defaultValue 300 */
|
|
14
|
+
openDelay?: number;
|
|
15
|
+
/** Grace (ms) after leaving the cell and its box before the box hides. @defaultValue 150 */
|
|
16
|
+
closeDelay?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The sheet's **comments** on the grid: the corner indicator on every commented cell in view, the
|
|
20
|
+
* box of a note while the pointer rests on its cell, and the leader line from a note's cell to its
|
|
21
|
+
* box for every box on the sheet.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* The indicators are {@link CellTileDiv} snapshots that survive scroll, colored by what the cell
|
|
25
|
+
* carries: a note, a thread, or a resolved thread. They are a property of the cell and not of its
|
|
26
|
+
* value, which is why they are not the cell renderer's: an empty cell can carry a note.
|
|
27
|
+
*
|
|
28
|
+
* The box itself is the note's movable and is drawn by the movable layer with the regular handles.
|
|
29
|
+
* This layer only says which box the pointer is on — through the surface's `movable-hover` state,
|
|
30
|
+
* after the dwell — and keeps saying so while the pointer is on the cell, the box or the leader
|
|
31
|
+
* between them. Clicking the box selects it, and a selected box stays whether the pointer is on it
|
|
32
|
+
* or not.
|
|
33
|
+
*/
|
|
34
|
+
export declare const CommentsLayer: React.MemoExoticComponent<(props: CommentsLayerProps) => React.JSX.Element | null>;
|
|
35
|
+
//# sourceMappingURL=CommentsLayer.d.ts.map
|
|
@@ -25,7 +25,7 @@ export interface ValidationPromptLayerProps extends Omit<LayerProps, 'children'>
|
|
|
25
25
|
style?: React.CSSProperties;
|
|
26
26
|
/** The sheet whose selection is followed. */
|
|
27
27
|
sheet: ISheet;
|
|
28
|
-
/** Gap (px) between the cell's bottom edge and the prompt. @defaultValue
|
|
28
|
+
/** Gap (px) between the cell's bottom edge and the prompt. @defaultValue 4 */
|
|
29
29
|
offset?: number;
|
|
30
30
|
/**
|
|
31
31
|
* Render the prompt yourself. Spread `floatProps` on the returned element. Omit for the default
|
|
@@ -35,7 +35,7 @@ export interface ValidationPromptLayerProps extends Omit<LayerProps, 'children'>
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* The **input prompt** of a data validation — a {@link RangeFloatLayer} activated by the selection,
|
|
38
|
-
* placed under the selected cell (or its merge)
|
|
38
|
+
* placed under the selected cell (or its merge), starting at its horizontal midpoint.
|
|
39
39
|
*
|
|
40
40
|
* @remarks
|
|
41
41
|
* Shows the title and message of the first covering rule that has a prompt to show
|
|
@@ -22,6 +22,8 @@ export * from './ValidationDropdownLayer';
|
|
|
22
22
|
export * from './ValidationPromptLayer';
|
|
23
23
|
export * from './useValidationPicker';
|
|
24
24
|
export * from './CircularIndicatorLayer';
|
|
25
|
+
export * from './CommentsLayer';
|
|
26
|
+
export * from './CommentCardLayer';
|
|
25
27
|
export * from './ProtectionLayer';
|
|
26
28
|
export * from './HeaderSelectionLayer';
|
|
27
29
|
export * from './HeaderResizerLayer';
|
|
@@ -28,7 +28,7 @@ export interface ModelListenerOptions extends Omit<IListener.Options, 'once'> {
|
|
|
28
28
|
* @template SOURCE - The model type (e.g., IWorkbook, ISheet)
|
|
29
29
|
* @template EVENTS - The listener interface type (e.g., ISheet.IListeners)
|
|
30
30
|
*
|
|
31
|
-
* @param source - The model instance to listen to
|
|
31
|
+
* @param source - The model instance to listen to, or `null` to listen to nothing
|
|
32
32
|
* @param listeners - Object containing listener callbacks for various events
|
|
33
33
|
* @param options - Optional configuration
|
|
34
34
|
*
|
|
@@ -56,12 +56,12 @@ export interface ModelListenerOptions extends Omit<IListener.Options, 'once'> {
|
|
|
56
56
|
* }
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
|
-
export declare const useModelListener: <SOURCE, EVENTS>(source: IListener.ISource<SOURCE
|
|
59
|
+
export declare const useModelListener: <SOURCE, EVENTS>(source: IListener.ISource<SOURCE> | null | undefined, listeners: IListener.Callbacks<SOURCE, EVENTS>, options?: ModelListenerOptions) => void;
|
|
60
60
|
/**
|
|
61
61
|
* Used for syncing with model state that causes a rerenders.
|
|
62
62
|
*
|
|
63
|
-
* @param source The source of the model
|
|
63
|
+
* @param source The source of the model, or `null` to listen to nothing.
|
|
64
64
|
* @param eventNames The name of the event or events to listen for.
|
|
65
65
|
*/
|
|
66
|
-
export declare function useModelSync<EVENTS>(source: IListener.ISource<any
|
|
66
|
+
export declare function useModelSync<EVENTS>(source: IListener.ISource<any> | null | undefined, eventNames: keyof EVENTS | Array<keyof EVENTS>): void;
|
|
67
67
|
//# sourceMappingURL=useModelListener.d.ts.map
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import { IMovable } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Props a movable renderer receives from its frame.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Spread `style` onto the root element. It fills the frame, which owns the drawing's bounds (zoom
|
|
7
|
+
* included), AND carries its hit-testing: the frame itself is pointer-transparent, so
|
|
8
|
+
* `style.pointerEvents` (`'auto'` by default, `'none'` while the frame is hidden) is what makes the
|
|
9
|
+
* drawing clickable. A drawing that is not solid — a no-fill shape — overrides it with `'none'` on
|
|
10
|
+
* its root and sets `pointerEvents` back on its painted parts only (e.g. `visibleStroke` on an SVG
|
|
11
|
+
* path), so a click in its unfilled interior reaches the cell beneath, exactly as in Excel.
|
|
12
|
+
*
|
|
13
|
+
* The drawing never sizes itself. `zoom` is given only so that it can scale what it draws inside
|
|
14
|
+
* the frame (text, borders, padding), for example with the CSS `zoom` property; a drawing that
|
|
15
|
+
* stretches to its box, such as a picture, ignores it.
|
|
16
|
+
*/
|
|
2
17
|
export interface MovableElementProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
18
|
/**
|
|
4
19
|
* The movable associated with this element.
|
|
5
20
|
*/
|
|
6
21
|
movable?: IMovable;
|
|
22
|
+
/**
|
|
23
|
+
* The scale of the view the movable is drawn in, where `1` is unscaled.
|
|
24
|
+
* @defaultValue 1
|
|
25
|
+
*/
|
|
26
|
+
zoom?: number;
|
|
7
27
|
/**
|
|
8
28
|
* Called when the movable is hidden from view.
|
|
9
29
|
*
|
|
@@ -18,6 +38,15 @@ export interface MovableElementProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
18
38
|
* Call when the movable is returned to the view.
|
|
19
39
|
*/
|
|
20
40
|
onShow?: (show: (movable: IMovable) => void) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Registers where a press starts a drag: the test answers `true` for a press that should move the
|
|
43
|
+
* movable. Without one, a press anywhere in the frame drags.
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* A press outside the drag zone still selects the movable but is left to the content, so a text
|
|
47
|
+
* box can drag from its border and put the caret where its text is pressed.
|
|
48
|
+
*/
|
|
49
|
+
onDragZone?: (isDragZone: (event: MouseEvent | TouchEvent) => boolean) => void;
|
|
21
50
|
/**
|
|
22
51
|
* If true then the component is disabled.
|
|
23
52
|
* @defaultValue false
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IMovable } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Starts an edit of a movable's content, answering `true` if it took the caret.
|
|
4
|
+
*/
|
|
5
|
+
export type MovableEditStarter = () => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Asks a movable's content to start editing: a text box puts the caret in its text.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is how a command reaches a content component it cannot see. A movable that is not drawn yet
|
|
11
|
+
* — a note that only shows while selected or pointed at — starts editing when its content mounts,
|
|
12
|
+
* as long as it is still selected then.
|
|
13
|
+
*
|
|
14
|
+
* @returns `true` if the edit started now, `false` if it waits for the content.
|
|
15
|
+
*/
|
|
16
|
+
export declare const requestMovableEdit: (movable: IMovable) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Registers how a movable's content starts an edit. Called by the content component; the returned
|
|
19
|
+
* function unregisters it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const registerMovableEdit: (movable: IMovable, starter: MovableEditStarter) => (() => void);
|
|
22
|
+
//# sourceMappingURL=MovableEdit.d.ts.map
|
|
@@ -18,6 +18,8 @@ export interface MovableFrameProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
18
18
|
onRefUnload: (ref: HTMLElement) => void;
|
|
19
19
|
onHide: (hide: (movable: IMovable) => boolean | Promise<boolean> | void) => void;
|
|
20
20
|
onShow: (show: (movable: IMovable) => void) => void;
|
|
21
|
+
/** {@inheritDoc MovableElementProps.onDragZone} */
|
|
22
|
+
onDragZone?: (isDragZone: (event: MouseEvent | TouchEvent) => boolean) => void;
|
|
21
23
|
/**
|
|
22
24
|
* Live drag/resize preview bounds (absolute), or null/undefined when idle. When set, the frame
|
|
23
25
|
* renders HERE instead of at the model bounds (the model isn't touched until the gesture commits).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IMovable } from '@sheetxl/sdk';
|
|
3
|
+
import { MovableElementProps } from './IMovableArea';
|
|
4
|
+
export interface TextBoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The movable this is the text of. With it, a request to edit the movable
|
|
7
|
+
* ({@link requestMovableEdit}) puts the caret at the end of the text.
|
|
8
|
+
*/
|
|
9
|
+
movable?: IMovable;
|
|
10
|
+
/**
|
|
11
|
+
* The movable's drag-zone registration, passed through from {@link MovableElementProps}.
|
|
12
|
+
*/
|
|
13
|
+
onDragZone?: MovableElementProps['onDragZone'];
|
|
14
|
+
/**
|
|
15
|
+
* Styles the text area inside the drag band: the text's own padding, alignment and overflow.
|
|
16
|
+
*/
|
|
17
|
+
contentStyle?: React.CSSProperties;
|
|
18
|
+
/**
|
|
19
|
+
* If true, the text area shows no text cursor.
|
|
20
|
+
* @defaultValue false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A movable's text box: a band along its edge that drags it, and a text area inside that does not.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* A press on the text area still selects the movable (see {@link MovableElementProps.onDragZone})
|
|
30
|
+
* and is left to the text, which is where an editor puts its caret. Notes and shapes with text share
|
|
31
|
+
* it. The box's own look (border, fill, font) is the caller's `style`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const TextBox: React.NamedExoticComponent<Omit<TextBoxProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
//# sourceMappingURL=TextBox.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IRichText, IStyledFont } from '@sheetxl/sdk';
|
|
3
|
+
/**
|
|
4
|
+
* The contract of a rich text editor: text in, edited text out. A host may supply its own in place
|
|
5
|
+
* of the default {@link RichTextEditor}.
|
|
6
|
+
*/
|
|
7
|
+
export interface RichTextEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
8
|
+
/**
|
|
9
|
+
* The text: plain, or formatting runs.
|
|
10
|
+
*/
|
|
11
|
+
value: IRichText.JSON | string;
|
|
12
|
+
/**
|
|
13
|
+
* Called with the edited text when the edit is committed, which is when the editor loses focus.
|
|
14
|
+
* Not called when nothing changed.
|
|
15
|
+
*/
|
|
16
|
+
onChange?: (value: IRichText.JSON | string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Called when the person leaves the editor with Escape, after the commit.
|
|
19
|
+
*/
|
|
20
|
+
onDone?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* If true, the text is shown but cannot be edited.
|
|
23
|
+
* @defaultValue false
|
|
24
|
+
*/
|
|
25
|
+
readOnly?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The CSS for the font properties a run sets.
|
|
28
|
+
*/
|
|
29
|
+
runStyle?: (font: IStyledFont.JSON) => React.CSSProperties | undefined;
|
|
30
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The default rich text editor: the runs drawn as they are formatted, edited in place.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Typing keeps the formatting of the run it is in; it does not apply formatting. The edit is
|
|
37
|
+
* committed when the editor loses focus. Keystrokes and clipboard events stay in the editor, so the
|
|
38
|
+
* grid and the surrounding movable do not act on them.
|
|
39
|
+
*/
|
|
40
|
+
export declare const RichTextEditor: React.NamedExoticComponent<Omit<RichTextEditorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
//# sourceMappingURL=RichTextEditor.d.ts.map
|
|
@@ -4,6 +4,7 @@ import { ViewportMetrics, IShowToolTipProperties, ScrollPaneProps, Viewport, The
|
|
|
4
4
|
import { GridSurfaceProps, IGridSurface, IEditable, LayerNode } from '@sheetxl/grid-react';
|
|
5
5
|
import { SheetCellRendererProps, ColumnButtonConfigProps } from '../cell';
|
|
6
6
|
import { MovableElementProps } from '../movable';
|
|
7
|
+
import { CommentCardRenderProps } from '../comment';
|
|
7
8
|
import { CommandContext } from '../frame';
|
|
8
9
|
import { ISheetHeaderElement, SheetHeaderProps } from './ISheetHeaderElement';
|
|
9
10
|
/**
|
|
@@ -161,6 +162,13 @@ export interface SheetElementProps extends React.HTMLAttributes<HTMLDivElement>,
|
|
|
161
162
|
* @returns A React Element representing the IMovable.
|
|
162
163
|
*/
|
|
163
164
|
renderMovable?: (props: MovableElementProps) => React.ReactElement;
|
|
165
|
+
/**
|
|
166
|
+
* Renders the card of a threaded comment beside its cell: on hover, on selection, and as a draft
|
|
167
|
+
* when a command asks for one. Omit to show no card; the indicators are drawn either way.
|
|
168
|
+
*
|
|
169
|
+
* @param props - {@link CommentCardRenderProps}
|
|
170
|
+
*/
|
|
171
|
+
renderCommentCard?: (props: CommentCardRenderProps) => React.ReactNode;
|
|
164
172
|
/**
|
|
165
173
|
* Render element(s) directly onto the `GridSurface`, bottom → top — the same {@link LayerNode} the
|
|
166
174
|
* grid takes for its children (a node or an array of them). Each layer reads its pane from context
|
|
@@ -31,7 +31,7 @@ export interface ContributeSheetCommandsOptions {
|
|
|
31
31
|
editModeHandler?: EditModeHandler;
|
|
32
32
|
/** Global clipboard — insert-cells reads a copied range reference to "insert copied cells". */
|
|
33
33
|
globalClipboard?: GlobalClipboardLike;
|
|
34
|
-
/** Persistent last-used values for the style pickers (color quick swatch + border) + memory. From the bridge's `
|
|
34
|
+
/** Persistent last-used values for the style pickers (color quick swatch + border) + memory. From the bridge's `usePersistentState`. */
|
|
35
35
|
pickerMemory?: PickerMemory;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
@@ -43,7 +43,7 @@ export interface SheetCommandData extends ContributeSheetCommandsOptions {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Persistent "last used" values for the style pickers — the quick swatch (`quickColor`/`quickBorder`) and the
|
|
46
|
-
* `onColorSelect`/`onBorderSelect` memory. Owned by the bridge (`
|
|
46
|
+
* `onColorSelect`/`onBorderSelect` memory. Owned by the bridge (`usePersistentState`) and passed as **live
|
|
47
47
|
* getters** so the lazy `context` closures read the current value without re-contributing. Only fill/font
|
|
48
48
|
* color + border persist; the tab/gridline color pickers don't (their `onColorSelect` is a no-op).
|
|
49
49
|
*/
|
|
@@ -3,13 +3,13 @@ import { ThemeMode } from '@sheetxl/utils-react';
|
|
|
3
3
|
* Persistence keys for the spreadsheet's self-managed appearance state.
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
|
-
* Owned via `
|
|
6
|
+
* Owned via `usePersistentState` against the surrounding `PersistentStateProvider` (Studio, or a
|
|
7
7
|
* standalone host). A consumer that wants to read or set them (e.g. a VS Code host driving the mode from
|
|
8
8
|
* its editor theme) does so with the same key, or by supplying its own provider/store. They are
|
|
9
9
|
* intentionally not component props — appearance is *state*, theme customization is *config* (see
|
|
10
10
|
* `Studio.theme`).
|
|
11
11
|
*
|
|
12
|
-
* A host changes the starting value of any of these with `
|
|
12
|
+
* A host changes the starting value of any of these with `PersistentStateProvider`'s `defaultValues`;
|
|
13
13
|
* the user's own choice still wins.
|
|
14
14
|
*/
|
|
15
15
|
export declare const ThemeStateKey: {
|
|
@@ -45,7 +45,7 @@ export interface FindMemory {
|
|
|
45
45
|
scope?: CommandContext.FindScopeOptions;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* The last-search memory handle — **live getter/setter** over the bridge's `
|
|
48
|
+
* The last-search memory handle — **live getter/setter** over the bridge's `usePersistentState`, exactly
|
|
49
49
|
* like {@link PickerMemory} for the style pickers. A getter (not the value) so recording a search doesn't
|
|
50
50
|
* change the `data` identity and re-run this whole contributor.
|
|
51
51
|
*/
|
|
@@ -77,7 +77,7 @@ export interface ContributeWorkbookCommandsOptions {
|
|
|
77
77
|
*/
|
|
78
78
|
editable?: SheetEditable | null;
|
|
79
79
|
/**
|
|
80
|
-
* Persisted last-search memory (`workbook.lastFind`), owned by the bridge's `
|
|
80
|
+
* Persisted last-search memory (`workbook.lastFind`), owned by the bridge's `usePersistentState`. Feeds
|
|
81
81
|
* `findNext` / `findPrevious` and the find window's seed. Omit ⇒ those two stay disabled and the window
|
|
82
82
|
* always seeds from the active cell.
|
|
83
83
|
*/
|