@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
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
|
+
"version": "0.8.0-beta.7",
|
|
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.
|
|
52
|
-
"@sheetxl/io": "^0.8.0-beta.
|
|
53
|
-
"@sheetxl/sdk": "^0.8.0-beta.
|
|
54
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
55
|
-
"@sheetxl/utils-react": "^0.8.0-beta.
|
|
51
|
+
"@sheetxl/grid-react": "^0.8.0-beta.7",
|
|
52
|
+
"@sheetxl/io": "^0.8.0-beta.7",
|
|
53
|
+
"@sheetxl/sdk": "^0.8.0-beta.7",
|
|
54
|
+
"@sheetxl/utils": "^0.8.0-beta.7",
|
|
55
|
+
"@sheetxl/utils-react": "^0.8.0-beta.7",
|
|
56
56
|
"clsx": "^2.1.1",
|
|
57
57
|
"react-merge-refs": "^3.0.2",
|
|
58
58
|
"react-moveable": "^0.56.0",
|
|
@@ -861,33 +861,66 @@
|
|
|
861
861
|
"description": "Den Link entfernen.",
|
|
862
862
|
"icon": "HyperlinkDelete"
|
|
863
863
|
},
|
|
864
|
-
"
|
|
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
|
+
"params": {
|
|
870
|
+
"note": "no"
|
|
871
|
+
},
|
|
872
|
+
"groupLabels": {
|
|
873
|
+
"contextMenu": "{note, select, yes{Notiz bearbeiten} other{Notiz einfügen…}}",
|
|
874
|
+
"noteOptions": "Bearbeiten"
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
"showHideNote": {
|
|
878
|
+
"label": "Notiz anzeigen",
|
|
866
879
|
"groupLabels": {
|
|
867
|
-
"
|
|
880
|
+
"noteOptions": "Anzeigen"
|
|
868
881
|
},
|
|
869
|
-
"description": "
|
|
870
|
-
|
|
882
|
+
"description": "Die Notiz auf dem Blatt belassen. Andernfalls erscheint sie nur, während auf ihre Zelle gezeigt wird."
|
|
883
|
+
},
|
|
884
|
+
"showAllNotes": {
|
|
885
|
+
"label": "Alle Notizen anzeigen",
|
|
886
|
+
"description": "Alle Notizen auf dem Blatt belassen. Sind bereits alle sichtbar, werden alle ausgeblendet."
|
|
871
887
|
},
|
|
872
888
|
"updateComments": {
|
|
873
|
-
"label": "
|
|
889
|
+
"label": "{thread, select, yes{Kommentar anzeigen} other{Kommentar einfügen}}",
|
|
874
890
|
"groupLabels": {
|
|
875
|
-
"contextMenu": "
|
|
891
|
+
"contextMenu": "{thread, select, yes{Kommentar anzeigen} other{Kommentar einfügen…}}"
|
|
876
892
|
},
|
|
877
|
-
"description": "Der
|
|
893
|
+
"description": "Der Zelle einen Kommentar hinzufügen oder auf den vorhandenen antworten.",
|
|
878
894
|
"icon": "CommentInsert",
|
|
879
895
|
"shortcut": "ctrl+alt+M",
|
|
880
|
-
"
|
|
881
|
-
"
|
|
882
|
-
|
|
896
|
+
"params": {
|
|
897
|
+
"thread": "no"
|
|
898
|
+
}
|
|
883
899
|
},
|
|
884
900
|
"deleteComments": {
|
|
885
901
|
"label": "Kommentare löschen",
|
|
886
902
|
"description": "Alle Kommentare entfernen.",
|
|
887
903
|
"icon": "CommentDelete",
|
|
888
|
-
"
|
|
889
|
-
"
|
|
890
|
-
|
|
904
|
+
"groupLabels": {
|
|
905
|
+
"noteOptions": "Löschen"
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
"previousComment": {
|
|
909
|
+
"label": "Vorheriger Kommentar",
|
|
910
|
+
"description": "Zum Kommentar vor der ausgewählten Zelle wechseln."
|
|
911
|
+
},
|
|
912
|
+
"nextComment": {
|
|
913
|
+
"label": "Nächster Kommentar",
|
|
914
|
+
"description": "Zum Kommentar nach der ausgewählten Zelle wechseln."
|
|
915
|
+
},
|
|
916
|
+
"showCommentsPane": {
|
|
917
|
+
"label": "Kommentare anzeigen",
|
|
918
|
+
"description": "Alle Kommentare des Blatts in einem Bereich auflisten.",
|
|
919
|
+
"icon": "CommentEdit"
|
|
920
|
+
},
|
|
921
|
+
"convertNotesToComments": {
|
|
922
|
+
"label": "In Kommentare umwandeln",
|
|
923
|
+
"description": "Alle Notizen des Blatts in Kommentare umwandeln, auf die geantwortet werden kann."
|
|
891
924
|
},
|
|
892
925
|
"insertImageFromFile": {
|
|
893
926
|
"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": "
|
|
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,14 +151,19 @@
|
|
|
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.cellHasNote": "Die Zelle hat eine Notiz.",
|
|
155
|
+
"reason.cellHasThread": "Die Zelle hat einen Kommentar mit Antworten.",
|
|
152
156
|
"reason.continuousSpan": "Nicht verfügbar bei fortlaufender Ausrichtung oder Ausfüllen.",
|
|
153
157
|
"reason.entireColumn": "Nicht verfügbar, wenn ganze Spalten ausgewählt sind.",
|
|
154
158
|
"reason.entireRow": "Nicht verfügbar, wenn ganze Zeilen ausgewählt sind.",
|
|
155
159
|
"reason.freezeOrigin": "Wählen Sie eine Zelle unterhalb und/oder rechts der zu fixierenden Stelle aus.",
|
|
156
160
|
"reason.mergeUnavailable": "Verbinden ist für diese Auswahl nicht verfügbar.",
|
|
157
161
|
"reason.mixedSelection": "Nicht verfügbar bei gemischter vollständiger/teilweiser Auswahl.",
|
|
162
|
+
"reason.noComments": "Das Blatt hat keine Kommentare.",
|
|
158
163
|
"reason.noFreeze": "Keine fixierten Bereiche.",
|
|
159
164
|
"reason.noMerge": "Keine verbundenen Zellen in der Auswahl.",
|
|
165
|
+
"reason.noNote": "Die Zelle hat keine Notiz.",
|
|
166
|
+
"reason.noNotes": "Das Blatt hat keine Notizen.",
|
|
160
167
|
"reason.noPreviousSearch": "Es wurde noch nicht gesucht.",
|
|
161
168
|
"reason.noSelection": "Nichts ausgewählt.",
|
|
162
169
|
"reason.noSheetBackground": "Das Blatt hat keinen Hintergrund.",
|
|
@@ -177,6 +184,7 @@
|
|
|
177
184
|
"referenceInput.commit": "Übernehmen",
|
|
178
185
|
"referenceInput.crossSheet": "Bezug muss auf demselben Blatt liegen",
|
|
179
186
|
"referenceInput.invalid": "Ungültiger Bezug",
|
|
187
|
+
"referenceInput.required": "Bezug ist erforderlich",
|
|
180
188
|
"referenceInput.selectCurrent": "Aktuellen Bereich auswählen",
|
|
181
189
|
"resizeIndicator.height": "Höhe",
|
|
182
190
|
"resizeIndicator.hiddenDisplay": "{label}: Ausgeblendet",
|
|
@@ -862,33 +862,66 @@
|
|
|
862
862
|
},
|
|
863
863
|
"icon": "HyperlinkDelete"
|
|
864
864
|
},
|
|
865
|
-
"
|
|
866
|
-
"label": "Insert Note",
|
|
867
|
-
"description": "Add a note to the cell.",
|
|
868
|
-
"
|
|
869
|
-
|
|
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
|
+
"params": {
|
|
871
|
+
"note": "no"
|
|
870
872
|
},
|
|
871
|
-
"
|
|
873
|
+
"groupLabels": {
|
|
874
|
+
"contextMenu": "{note, select, yes{Edit Note} other{Insert Note…}}",
|
|
875
|
+
"noteOptions": "Edit"
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
"showHideNote": {
|
|
879
|
+
"label": "Show Note",
|
|
880
|
+
"description": "Keep the note on the sheet. Otherwise it shows only while its cell is pointed at.",
|
|
881
|
+
"groupLabels": {
|
|
882
|
+
"noteOptions": "Show"
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
"showAllNotes": {
|
|
886
|
+
"label": "Show All Notes",
|
|
887
|
+
"description": "Keep every note on the sheet. When every note is already shown, hide them all."
|
|
872
888
|
},
|
|
873
889
|
"updateComments": {
|
|
874
|
-
"label": "
|
|
875
|
-
"description": "Add a comment to the
|
|
890
|
+
"label": "{thread, select, yes{Show Comment} other{Insert Comment}}",
|
|
891
|
+
"description": "Add a comment to the cell, or reply to the one it has.",
|
|
876
892
|
"groupLabels": {
|
|
877
|
-
"contextMenu": "Insert
|
|
893
|
+
"contextMenu": "{thread, select, yes{Show Comment} other{Insert Comment…}}"
|
|
878
894
|
},
|
|
879
895
|
"icon": "CommentInsert",
|
|
880
896
|
"shortcut": "ctrl+alt+M",
|
|
881
|
-
"
|
|
882
|
-
"
|
|
883
|
-
|
|
897
|
+
"params": {
|
|
898
|
+
"thread": "no"
|
|
899
|
+
}
|
|
884
900
|
},
|
|
885
901
|
"deleteComments": {
|
|
886
902
|
"label": "Delete Comments",
|
|
887
903
|
"description": "Remove any comments.",
|
|
888
904
|
"icon": "CommentDelete",
|
|
889
|
-
"
|
|
890
|
-
"
|
|
891
|
-
|
|
905
|
+
"groupLabels": {
|
|
906
|
+
"noteOptions": "Delete"
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
"previousComment": {
|
|
910
|
+
"label": "Previous Comment",
|
|
911
|
+
"description": "Go to the comment before the selected cell."
|
|
912
|
+
},
|
|
913
|
+
"nextComment": {
|
|
914
|
+
"label": "Next Comment",
|
|
915
|
+
"description": "Go to the comment after the selected cell."
|
|
916
|
+
},
|
|
917
|
+
"showCommentsPane": {
|
|
918
|
+
"label": "Show Comments",
|
|
919
|
+
"description": "List every comment on the sheet in a pane.",
|
|
920
|
+
"icon": "CommentEdit"
|
|
921
|
+
},
|
|
922
|
+
"convertNotesToComments": {
|
|
923
|
+
"label": "Convert to Comments",
|
|
924
|
+
"description": "Convert every note on the sheet to a comment that can be replied to."
|
|
892
925
|
},
|
|
893
926
|
"insertImageFromFile": {
|
|
894
927
|
"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": "
|
|
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,14 +151,19 @@
|
|
|
149
151
|
"picker.noValues": "No values",
|
|
150
152
|
"picker.search": "Search",
|
|
151
153
|
"reason.alreadyTable": "The selection is already in a table.",
|
|
154
|
+
"reason.cellHasNote": "The cell has a note.",
|
|
155
|
+
"reason.cellHasThread": "The cell has a threaded comment.",
|
|
152
156
|
"reason.continuousSpan": "Not available with continuous / fill alignment.",
|
|
153
157
|
"reason.entireColumn": "Not available when entire columns are selected.",
|
|
154
158
|
"reason.entireRow": "Not available when entire rows are selected.",
|
|
155
159
|
"reason.freezeOrigin": "Select a cell below and/or right of where the panes should freeze.",
|
|
156
160
|
"reason.mergeUnavailable": "Merge is not available for this selection.",
|
|
157
161
|
"reason.mixedSelection": "Not available for a mixed full / partial selection.",
|
|
162
|
+
"reason.noComments": "The sheet has no comments.",
|
|
158
163
|
"reason.noFreeze": "No frozen panes.",
|
|
159
164
|
"reason.noMerge": "No merged cells in the selection.",
|
|
165
|
+
"reason.noNote": "The cell has no note.",
|
|
166
|
+
"reason.noNotes": "The sheet has no notes.",
|
|
160
167
|
"reason.noPreviousSearch": "Nothing has been searched for yet.",
|
|
161
168
|
"reason.noSelection": "Nothing is selected.",
|
|
162
169
|
"reason.noSheetBackground": "The sheet has no background.",
|
|
@@ -177,6 +184,7 @@
|
|
|
177
184
|
"referenceInput.commit": "Commit",
|
|
178
185
|
"referenceInput.crossSheet": "Reference must be on the same sheet",
|
|
179
186
|
"referenceInput.invalid": "Invalid Reference",
|
|
187
|
+
"referenceInput.required": "Reference is required",
|
|
180
188
|
"referenceInput.selectCurrent": "Select Current Range",
|
|
181
189
|
"resizeIndicator.height": "Height",
|
|
182
190
|
"resizeIndicator.hiddenDisplay": "{label}: Hidden",
|
|
@@ -21,6 +21,12 @@ export interface CornerTriangleProps extends React.SVGProps<SVGSVGElement> {
|
|
|
21
21
|
inset?: number;
|
|
22
22
|
cellWidth?: number;
|
|
23
23
|
cellHeight?: number;
|
|
24
|
+
/**
|
|
25
|
+
* `'bubble'` draws a speech-bubble corner, Excel's mark for a threaded comment, in place of the
|
|
26
|
+
* triangle. Top right only.
|
|
27
|
+
* @defaultValue 'triangle'
|
|
28
|
+
*/
|
|
29
|
+
shape?: 'triangle' | 'bubble';
|
|
24
30
|
propsPath?: React.SVGProps<SVGPathElement>;
|
|
25
31
|
}
|
|
26
32
|
export declare const CornerTriangle: React.MemoExoticComponent<(props: CornerTriangleProps) => React.JSX.Element>;
|
|
@@ -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:
|
|
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,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
|
|
@@ -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
|
|
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
|