@sheetxl/react 0.8.0-beta.4 → 0.8.0-beta.6

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 (33) hide show
  1. package/browser/cjs/index.cjs +16 -15
  2. package/browser/esm/{DlcxLIcj0AOi11oL.mjs → CFCvoIa_w1ERjvMW.mjs} +1 -1
  3. package/browser/esm/index.mjs +3333 -2770
  4. package/node/esm/{BNfJsRdVZSz2923x.mjs → B9g0FgUjU-KLHkGu.mjs} +1 -1
  5. package/node/esm/index.mjs +3012 -2444
  6. package/package.json +6 -6
  7. package/resources/locales/de/sheet.cmd.json +35 -7
  8. package/resources/locales/de/ui.msg.json +6 -1
  9. package/resources/locales/en/sheet.cmd.json +36 -8
  10. package/resources/locales/en/ui.msg.json +6 -1
  11. package/types/src/cell/SheetHeaderRenderer.d.ts +5 -0
  12. package/types/src/checklist/ValueChecklist.d.ts +1 -1
  13. package/types/src/comment/NoteEditor.d.ts +20 -0
  14. package/types/src/comment/index.d.ts +2 -0
  15. package/types/src/editor/FunctionPreviewPanel.d.ts +1 -1
  16. package/types/src/editor/SheetCellEditorLayer.d.ts +0 -8
  17. package/types/src/editor/SheetCellEditorStartLayer.d.ts +44 -0
  18. package/types/src/editor/index.d.ts +1 -0
  19. package/types/src/editor/useFormulaInput.d.ts +9 -0
  20. package/types/src/index.d.ts +2 -0
  21. package/types/src/layer/CommentsLayer.d.ts +35 -0
  22. package/types/src/layer/index.d.ts +1 -0
  23. package/types/src/movable/IMovableArea.d.ts +20 -0
  24. package/types/src/movable/MovableEdit.d.ts +22 -0
  25. package/types/src/movable/MovableFrame.d.ts +2 -0
  26. package/types/src/movable/TextBox.d.ts +34 -0
  27. package/types/src/movable/index.d.ts +2 -0
  28. package/types/src/richText/RichTextEditor.d.ts +41 -0
  29. package/types/src/richText/index.d.ts +2 -0
  30. package/types/src/sheet/SheetCommands.d.ts +2 -2
  31. package/types/src/theme/ThemeState.d.ts +14 -1
  32. package/types/src/theme/useGridColorScheme.d.ts +1 -1
  33. package/types/src/workbook/WorkbookCommands.d.ts +2 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/react",
3
3
  "description": "React - React components needed to build advanced grid and spreadsheet UIs.",
4
- "version": "0.8.0-beta.4",
4
+ "version": "0.8.0-beta.6",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -48,11 +48,11 @@
48
48
  "@dnd-kit/modifiers": "^9.0.0",
49
49
  "@dnd-kit/sortable": "^10.0.0",
50
50
  "@dnd-kit/utilities": "^3.2.2",
51
- "@sheetxl/grid-react": "^0.8.0-beta.4",
52
- "@sheetxl/io": "^0.8.0-beta.4",
53
- "@sheetxl/sdk": "^0.8.0-beta.4",
54
- "@sheetxl/utils": "^0.8.0-beta.4",
55
- "@sheetxl/utils-react": "^0.8.0-beta.4",
51
+ "@sheetxl/grid-react": "^0.8.0-beta.6",
52
+ "@sheetxl/io": "^0.8.0-beta.6",
53
+ "@sheetxl/sdk": "^0.8.0-beta.6",
54
+ "@sheetxl/utils": "^0.8.0-beta.6",
55
+ "@sheetxl/utils-react": "^0.8.0-beta.6",
56
56
  "clsx": "^2.1.1",
57
57
  "react-merge-refs": "^3.0.2",
58
58
  "react-moveable": "^0.56.0",
@@ -861,18 +861,43 @@
861
861
  "description": "Den Link entfernen.",
862
862
  "icon": "HyperlinkDelete"
863
863
  },
864
- "insertNote": {
865
- "label": "Notiz einfügen",
864
+ "editNote": {
865
+ "label": "{note, select, yes{Notiz bearbeiten} other{Notiz einfügen}}",
866
+ "description": "Der Zelle eine Notiz hinzufügen oder die vorhandene bearbeiten.",
867
+ "icon": "NoteInsert",
868
+ "shortcut": "shift+F2",
869
+ "tags": [
870
+ "mutator"
871
+ ],
872
+ "params": {
873
+ "note": "no"
874
+ },
866
875
  "groupLabels": {
867
- "contextMenu": "Notiz einfügen…"
876
+ "contextMenu": "{note, select, yes{Notiz bearbeiten} other{Notiz einfügen…}}",
877
+ "noteOptions": "Bearbeiten"
878
+ }
879
+ },
880
+ "showHideNote": {
881
+ "label": "Notiz anzeigen",
882
+ "groupLabels": {
883
+ "noteOptions": "Anzeigen"
868
884
  },
869
- "description": "Der Zelle eine Notiz hinzufügen.",
870
- "shortcut": "shift+F2"
885
+ "description": "Die Notiz auf dem Blatt belassen. Andernfalls erscheint sie nur, während auf ihre Zelle gezeigt wird.",
886
+ "tags": [
887
+ "mutator"
888
+ ]
889
+ },
890
+ "showAllNotes": {
891
+ "label": "Alle Notizen anzeigen",
892
+ "description": "Alle Notizen auf dem Blatt belassen. Sind bereits alle sichtbar, werden alle ausgeblendet.",
893
+ "tags": [
894
+ "mutator"
895
+ ]
871
896
  },
872
897
  "updateComments": {
873
898
  "label": "Kommentare",
874
899
  "groupLabels": {
875
- "contextMenu": "Kommentare einfügen…"
900
+ "contextMenu": "Kommentar einfügen…"
876
901
  },
877
902
  "description": "Der aktuellen Zelle einen Kommentar hinzufügen.",
878
903
  "icon": "CommentInsert",
@@ -887,7 +912,10 @@
887
912
  "icon": "CommentDelete",
888
913
  "tags": [
889
914
  "mutator"
890
- ]
915
+ ],
916
+ "groupLabels": {
917
+ "noteOptions": "Löschen"
918
+ }
891
919
  },
892
920
  "insertImageFromFile": {
893
921
  "label": "Bild einfügen",
@@ -38,7 +38,8 @@
38
38
  "checklist.count": "{checked} / {total}",
39
39
  "checklist.countFiltered": "{checked} / {total} (gefiltert)",
40
40
  "checklist.selectAll": "(Alle auswählen)",
41
- "checklist.truncated": "Diese Spalte hat mehr als 10.000 eindeutige Einträge. Nur die ersten 10.000 werden angezeigt.",
41
+ "checklist.truncated": "(gekürzt)",
42
+ "checklist.truncatedDetail": "Nicht alle eindeutigen Einträge werden aufgelistet.",
42
43
  "circular.converged": "{count, plural, one {Konvergiert nach # Iteration} other {Konvergiert nach # Iterationen}}",
43
44
  "circular.reads": "Liest einen Zirkelbezug in",
44
45
  "circular.title": "Zirkelbezug",
@@ -96,6 +97,7 @@
96
97
  "findReplace.replaced": "{count} Zellen wurden ersetzt.",
97
98
  "formulaInput.equalsRequired": "Die Formel muss mit '=' beginnen.",
98
99
  "formulaInput.invalid": "Ungültige Formel",
100
+ "formulaInput.required": "Formel ist erforderlich",
99
101
  "formulaTrace.noDependents": "Keine Formeln verweisen auf die ausgewählten Zellen.",
100
102
  "formulaTrace.noPrecedents": "Die ausgewählten Zellen enthalten keine Formeln, die auf andere Zellen verweisen.",
101
103
  "functionPreview.anyValue": "Beliebiger Wert",
@@ -149,6 +151,7 @@
149
151
  "picker.noValues": "Keine Werte",
150
152
  "picker.search": "Suchen",
151
153
  "reason.alreadyTable": "Die Auswahl befindet sich bereits in einer Tabelle.",
154
+ "reason.cellHasThread": "Die Zelle hat einen Kommentar mit Antworten.",
152
155
  "reason.continuousSpan": "Nicht verfügbar bei fortlaufender Ausrichtung oder Ausfüllen.",
153
156
  "reason.entireColumn": "Nicht verfügbar, wenn ganze Spalten ausgewählt sind.",
154
157
  "reason.entireRow": "Nicht verfügbar, wenn ganze Zeilen ausgewählt sind.",
@@ -157,6 +160,7 @@
157
160
  "reason.mixedSelection": "Nicht verfügbar bei gemischter vollständiger/teilweiser Auswahl.",
158
161
  "reason.noFreeze": "Keine fixierten Bereiche.",
159
162
  "reason.noMerge": "Keine verbundenen Zellen in der Auswahl.",
163
+ "reason.noNote": "Die Zelle hat keine Notiz.",
160
164
  "reason.noPreviousSearch": "Es wurde noch nicht gesucht.",
161
165
  "reason.noSelection": "Nichts ausgewählt.",
162
166
  "reason.noSheetBackground": "Das Blatt hat keinen Hintergrund.",
@@ -177,6 +181,7 @@
177
181
  "referenceInput.commit": "Übernehmen",
178
182
  "referenceInput.crossSheet": "Bezug muss auf demselben Blatt liegen",
179
183
  "referenceInput.invalid": "Ungültiger Bezug",
184
+ "referenceInput.required": "Bezug ist erforderlich",
180
185
  "referenceInput.selectCurrent": "Aktuellen Bereich auswählen",
181
186
  "resizeIndicator.height": "Höhe",
182
187
  "resizeIndicator.hiddenDisplay": "{label}: Ausgeblendet",
@@ -862,19 +862,44 @@
862
862
  },
863
863
  "icon": "HyperlinkDelete"
864
864
  },
865
- "insertNote": {
866
- "label": "Insert Note",
867
- "description": "Add a note to the cell.",
868
- "groupLabels": {
869
- "contextMenu": "Insert Note…"
865
+ "editNote": {
866
+ "label": "{note, select, yes{Edit Note} other{Insert Note}}",
867
+ "description": "Add a note to the cell, or edit the one it has.",
868
+ "icon": "NoteInsert",
869
+ "shortcut": "shift+F2",
870
+ "tags": [
871
+ "mutator"
872
+ ],
873
+ "params": {
874
+ "note": "no"
870
875
  },
871
- "shortcut": "shift+F2"
876
+ "groupLabels": {
877
+ "contextMenu": "{note, select, yes{Edit Note} other{Insert Note…}}",
878
+ "noteOptions": "Edit"
879
+ }
880
+ },
881
+ "showHideNote": {
882
+ "label": "Show Note",
883
+ "description": "Keep the note on the sheet. Otherwise it shows only while its cell is pointed at.",
884
+ "tags": [
885
+ "mutator"
886
+ ],
887
+ "groupLabels": {
888
+ "noteOptions": "Show"
889
+ }
890
+ },
891
+ "showAllNotes": {
892
+ "label": "Show All Notes",
893
+ "description": "Keep every note on the sheet. When every note is already shown, hide them all.",
894
+ "tags": [
895
+ "mutator"
896
+ ]
872
897
  },
873
898
  "updateComments": {
874
899
  "label": "Comments",
875
900
  "description": "Add a comment to the current cell.",
876
901
  "groupLabels": {
877
- "contextMenu": "Insert Comments…"
902
+ "contextMenu": "Insert Comment…"
878
903
  },
879
904
  "icon": "CommentInsert",
880
905
  "shortcut": "ctrl+alt+M",
@@ -888,7 +913,10 @@
888
913
  "icon": "CommentDelete",
889
914
  "tags": [
890
915
  "mutator"
891
- ]
916
+ ],
917
+ "groupLabels": {
918
+ "noteOptions": "Delete"
919
+ }
892
920
  },
893
921
  "insertImageFromFile": {
894
922
  "label": "Insert Image",
@@ -38,7 +38,8 @@
38
38
  "checklist.count": "{checked} / {total}",
39
39
  "checklist.countFiltered": "{checked} / {total} (filtered)",
40
40
  "checklist.selectAll": "(Select All)",
41
- "checklist.truncated": "This column has more than 10,000 unique items. Only the first 10,000 unique items are displayed.",
41
+ "checklist.truncated": "(truncated)",
42
+ "checklist.truncatedDetail": "Not all unique items are listed.",
42
43
  "circular.converged": "{count, plural, one {Converged after # iteration} other {Converged after # iterations}}",
43
44
  "circular.reads": "Reads a circular reference at",
44
45
  "circular.title": "Circular reference",
@@ -96,6 +97,7 @@
96
97
  "findReplace.replaced": "We replaced {count} cells.",
97
98
  "formulaInput.equalsRequired": "Formula must start with '='.",
98
99
  "formulaInput.invalid": "Invalid Formula",
100
+ "formulaInput.required": "Formula is required",
99
101
  "formulaTrace.noDependents": "No formulas refer to the selected cells.",
100
102
  "formulaTrace.noPrecedents": "The selected cells have no formulas that refer to other cells.",
101
103
  "functionPreview.anyValue": "Any value",
@@ -149,6 +151,7 @@
149
151
  "picker.noValues": "No values",
150
152
  "picker.search": "Search",
151
153
  "reason.alreadyTable": "The selection is already in a table.",
154
+ "reason.cellHasThread": "The cell has a threaded comment.",
152
155
  "reason.continuousSpan": "Not available with continuous / fill alignment.",
153
156
  "reason.entireColumn": "Not available when entire columns are selected.",
154
157
  "reason.entireRow": "Not available when entire rows are selected.",
@@ -157,6 +160,7 @@
157
160
  "reason.mixedSelection": "Not available for a mixed full / partial selection.",
158
161
  "reason.noFreeze": "No frozen panes.",
159
162
  "reason.noMerge": "No merged cells in the selection.",
163
+ "reason.noNote": "The cell has no note.",
160
164
  "reason.noPreviousSearch": "Nothing has been searched for yet.",
161
165
  "reason.noSelection": "Nothing is selected.",
162
166
  "reason.noSheetBackground": "The sheet has no background.",
@@ -177,6 +181,7 @@
177
181
  "referenceInput.commit": "Commit",
178
182
  "referenceInput.crossSheet": "Reference must be on the same sheet",
179
183
  "referenceInput.invalid": "Invalid Reference",
184
+ "referenceInput.required": "Reference is required",
180
185
  "referenceInput.selectCurrent": "Select Current Range",
181
186
  "resizeIndicator.height": "Height",
182
187
  "resizeIndicator.hiddenDisplay": "{label}: Hidden",
@@ -11,6 +11,11 @@ export interface SheetHeaderRendererProps extends CellRendererProps {
11
11
  headerText?: (index: number) => string;
12
12
  isSelected?: (index: number) => boolean;
13
13
  isSelectedAll?: (index: number) => boolean;
14
+ /**
15
+ * Whether a filter holds a condition over this header ({@link ISheetHeader.getFilteredRanges}):
16
+ * a row header draws it as filtered, as Excel's blue row numbers.
17
+ */
18
+ isFiltered?: (index: number) => boolean;
14
19
  /**
15
20
  * This is not the default grid zoom this is just for rendering.
16
21
  * @defaultValue 100
@@ -30,7 +30,7 @@ export interface ValueChecklistProps {
30
30
  blanksChecked?: boolean;
31
31
  /** The blanks row was set. Select All names it through this, not through `onCheckedChange`. */
32
32
  onBlanksChange?: (checked: boolean) => void;
33
- /** The host stopped listing values at its cap: a notice says so under the list. */
33
+ /** The host stopped listing values at its cap: the count says so, the reason in its tooltip. */
34
34
  truncated?: boolean;
35
35
  /** A search field above the list. @defaultValue true */
36
36
  search?: boolean;
@@ -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,2 @@
1
+ export * from './NoteEditor';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -171,7 +171,7 @@ export interface FunctionPreviewPanelProps {
171
171
  * @remarks
172
172
  * This is the "B" half of the formula-editor hint UI (the autocomplete *list* is "A"). Presentational
173
173
  * and props-driven — the editor owns the caret → hint derivation and passes it down. The expand/collapse
174
- * state persists (via {@link usePersistenceState}); close is delegated via
174
+ * state persists (via {@link usePersistentState}); close is delegated via
175
175
  * {@link FunctionPreviewPanelProps.onClose}. No **Example** is shown: `IDescriptor` has no function-level
176
176
  * example and we won't fabricate one. The active-argument emphasis is driven by `hint.argIndex`. Nothing
177
177
  * here mutates the edit.
@@ -2,7 +2,6 @@ import { default as React } from 'react';
2
2
  import { ISheet } from '@sheetxl/sdk';
3
3
  import { EditorAlignment, VirtualDivProps } from '@sheetxl/grid-react';
4
4
  import { SheetEditable } from './SheetEditable';
5
- import { EditRejectedNotice } from './useEditRejectedNotice';
6
5
  /**
7
6
  * Props for {@link SheetCellEditorLayer}.
8
7
  *
@@ -29,13 +28,6 @@ export interface SheetCellEditorLayerProps extends VirtualDivProps {
29
28
  * default, which follows the edited cell's rendered alignment (formulas always grow to the right).
30
29
  */
31
30
  alignment?: EditorAlignment;
32
- /**
33
- * Notified when a start-edit attempt is rejected (`startEdit` returned `false` — a non-editable
34
- * cell). The host that mounts one layer per pane (`SheetElement`) passes a SHARED callback
35
- * ({@link useEditRejectedNotice}) so all panes form one notice scope; it receives the rejected cell.
36
- * @defaultValue this layer's own {@link useEditRejectedNotice}
37
- */
38
- onEditRejected?: EditRejectedNotice;
39
31
  }
40
32
  export declare function SheetCellEditorLayer(props: SheetCellEditorLayerProps): React.ReactElement;
41
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
@@ -14,6 +14,7 @@ export * from './NamedHintPanel';
14
14
  export * from './EditorCommands';
15
15
  export * from './useEditRejectedNotice';
16
16
  export * from './SheetCellEditorLayer';
17
+ export * from './SheetCellEditorStartLayer';
17
18
  export * from './SheetReferenceLayer';
18
19
  export * from './SheetReferenceHeaderLayer';
19
20
  //# sourceMappingURL=index.d.ts.map
@@ -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`. */
@@ -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,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
@@ -22,6 +22,7 @@ export * from './ValidationDropdownLayer';
22
22
  export * from './ValidationPromptLayer';
23
23
  export * from './useValidationPicker';
24
24
  export * from './CircularIndicatorLayer';
25
+ export * from './CommentsLayer';
25
26
  export * from './ProtectionLayer';
26
27
  export * from './HeaderSelectionLayer';
27
28
  export * from './HeaderResizerLayer';
@@ -1,4 +1,15 @@
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 positions and sizes the drawing in its frame AND carries
7
+ * its hit-testing: the frame itself is pointer-transparent, so `style.pointerEvents` (`'auto'` by
8
+ * default, `'none'` while the frame is hidden) is what makes the drawing clickable. A drawing that
9
+ * is not solid — a no-fill shape — overrides it with `'none'` on its root and sets `pointerEvents`
10
+ * back on its painted parts only (e.g. `visibleStroke` on an SVG path), so a click in its unfilled
11
+ * interior reaches the cell beneath, exactly as in Excel.
12
+ */
2
13
  export interface MovableElementProps extends React.HTMLAttributes<HTMLElement> {
3
14
  /**
4
15
  * The movable associated with this element.
@@ -18,6 +29,15 @@ export interface MovableElementProps extends React.HTMLAttributes<HTMLElement> {
18
29
  * Call when the movable is returned to the view.
19
30
  */
20
31
  onShow?: (show: (movable: IMovable) => void) => void;
32
+ /**
33
+ * Registers where a press starts a drag: the test answers `true` for a press that should move the
34
+ * movable. Without one, a press anywhere in the frame drags.
35
+ *
36
+ * @remarks
37
+ * A press outside the drag zone still selects the movable but is left to the content, so a text
38
+ * box can drag from its border and put the caret where its text is pressed.
39
+ */
40
+ onDragZone?: (isDragZone: (event: MouseEvent | TouchEvent) => boolean) => void;
21
41
  /**
22
42
  * If true then the component is disabled.
23
43
  * @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
@@ -1,4 +1,6 @@
1
1
  export * from './IMovableArea';
2
2
  export * from './MovableLayer';
3
+ export * from './MovableEdit';
3
4
  export * from './EmptyFrame';
5
+ export * from './TextBox';
4
6
  //# sourceMappingURL=index.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
@@ -0,0 +1,2 @@
1
+ export * from './RichTextEditor';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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 `usePersistenceState`. */
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 (`usePersistenceState`) and passed as **live
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
  */