logisheets 1.1.0 → 1.2.0
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/dist/src/api/author.d.ts +41 -0
- package/dist/src/api/author.js +22 -0
- package/dist/src/api/index.d.ts +2 -0
- package/dist/src/api/index.js +1 -0
- package/dist/src/api/workbook.d.ts +52 -1
- package/dist/src/api/workbook.js +99 -0
- package/dist/src/api/worksheet.d.ts +8 -1
- package/dist/src/api/worksheet.js +9 -0
- package/dist/src/bindings/add_comment.d.ts +44 -0
- package/dist/src/bindings/add_comment.js +66 -0
- package/dist/src/bindings/author_input.d.ts +5 -0
- package/dist/src/bindings/author_input.js +1 -0
- package/dist/src/bindings/comment.d.ts +2 -2
- package/dist/src/bindings/comment_mention.d.ts +7 -0
- package/dist/src/bindings/comment_mention.js +1 -0
- package/dist/src/bindings/comment_mention_info.d.ts +6 -0
- package/dist/src/bindings/comment_mention_info.js +1 -0
- package/dist/src/bindings/comment_note.d.ts +11 -0
- package/dist/src/bindings/comment_note.js +1 -0
- package/dist/src/bindings/comment_person.d.ts +5 -0
- package/dist/src/bindings/comment_person.js +1 -0
- package/dist/src/bindings/delete_comment.d.ts +14 -0
- package/dist/src/bindings/delete_comment.js +19 -0
- package/dist/src/bindings/edit_comment.d.ts +23 -0
- package/dist/src/bindings/edit_comment.js +33 -0
- package/dist/src/bindings/edit_payload.d.ts +20 -0
- package/dist/src/bindings/index.d.ts +11 -0
- package/dist/src/bindings/index.js +11 -0
- package/dist/src/bindings/resolve_comment.d.ts +18 -0
- package/dist/src/bindings/resolve_comment.js +26 -0
- package/dist/src/bindings/rpc_get_comments_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_comments_params.js +1 -0
- package/dist/src/bindings/rpc_workbook_methods.d.ts +3 -0
- package/dist/src/bindings/upsert_person.d.ts +18 -0
- package/dist/src/bindings/upsert_person.js +22 -0
- package/dist/wasm/logisheets_wasm_server.d.ts +8 -0
- package/dist/wasm/logisheets_wasm_server.js +583 -0
- package/dist/wasm/logisheets_wasm_server_bg.wasm +0 -0
- package/dist/wasm/logisheets_wasm_server_bg.wasm.d.ts +12 -0
- package/dist/wasm/package.json +14 -0
- package/package.json +2 -2
- package/wasm/logisheets_wasm_server.d.ts +8 -0
- package/wasm/logisheets_wasm_server.js +583 -0
- package/wasm/logisheets_wasm_server_bg.wasm +0 -0
- package/wasm/logisheets_wasm_server_bg.wasm.d.ts +12 -0
- package/wasm/package.json +14 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AuthorInput } from '../bindings';
|
|
2
|
+
/**
|
|
3
|
+
* A person the host knows about — the comment author or an `@mention` target.
|
|
4
|
+
*
|
|
5
|
+
* `displayName` is always present. `userId` + `providerId` are the enterprise
|
|
6
|
+
* directory hooks: enterprise builds fill them from their corporate user
|
|
7
|
+
* system (e.g. `providerId: 'AD'`), while the open-source `src` app leaves them
|
|
8
|
+
* unset and only supplies a typed-in `displayName`.
|
|
9
|
+
*
|
|
10
|
+
* This is structurally the generated {@link AuthorInput} payload shape, re-aliased
|
|
11
|
+
* here so host code can depend on the concept without importing a payload type.
|
|
12
|
+
*/
|
|
13
|
+
export type Author = AuthorInput;
|
|
14
|
+
/**
|
|
15
|
+
* The single seam an enterprise deployment overrides to wire LogiSheets
|
|
16
|
+
* comments into its user directory.
|
|
17
|
+
*
|
|
18
|
+
* - `getCurrentAuthor` resolves who is authoring a comment right now.
|
|
19
|
+
* - `searchUsers` backs `@mention` autocomplete.
|
|
20
|
+
*
|
|
21
|
+
* The Rust core stays identity-provider agnostic: it only ever stores the
|
|
22
|
+
* `Author` records this service produces. Nothing in the engine calls a
|
|
23
|
+
* directory — all remote calls live behind an implementation of this interface.
|
|
24
|
+
*/
|
|
25
|
+
export interface AuthorService {
|
|
26
|
+
getCurrentAuthor(): Promise<Author>;
|
|
27
|
+
searchUsers(query: string): Promise<Author[]>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Default {@link AuthorService} for the open-source `src` app: the author types
|
|
31
|
+
* their own name and there is no directory to search. Enterprise builds inject
|
|
32
|
+
* their own implementation instead of using this.
|
|
33
|
+
*/
|
|
34
|
+
export declare class DefaultAuthorService implements AuthorService {
|
|
35
|
+
constructor(author?: Author);
|
|
36
|
+
/** Update the manually-entered author (e.g. from a name input field). */
|
|
37
|
+
setAuthor(author: Author): void;
|
|
38
|
+
getCurrentAuthor(): Promise<Author>;
|
|
39
|
+
searchUsers(_query: string): Promise<Author[]>;
|
|
40
|
+
private _author;
|
|
41
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default {@link AuthorService} for the open-source `src` app: the author types
|
|
3
|
+
* their own name and there is no directory to search. Enterprise builds inject
|
|
4
|
+
* their own implementation instead of using this.
|
|
5
|
+
*/
|
|
6
|
+
export class DefaultAuthorService {
|
|
7
|
+
constructor(author = { displayName: '' }) {
|
|
8
|
+
this._author = author;
|
|
9
|
+
}
|
|
10
|
+
/** Update the manually-entered author (e.g. from a name input field). */
|
|
11
|
+
setAuthor(author) {
|
|
12
|
+
this._author = author;
|
|
13
|
+
}
|
|
14
|
+
async getCurrentAuthor() {
|
|
15
|
+
return this._author;
|
|
16
|
+
}
|
|
17
|
+
// No directory in the open-source build — `@mention` autocomplete is empty.
|
|
18
|
+
async searchUsers(_query) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
_author;
|
|
22
|
+
}
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './workbook';
|
|
2
2
|
export * from './worksheet';
|
|
3
|
+
export { DefaultAuthorService } from './author';
|
|
4
|
+
export type { Author, AuthorService } from './author';
|
|
3
5
|
export { CalcException, CustomFunc, Calculator } from './calculator';
|
|
4
6
|
export type { Executor } from './calculator';
|
|
5
7
|
export * from './cell';
|
package/dist/src/api/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ActionEffect, BlockField, BlockInfo, FormulaDisplayInfo, ShadowCellInfo, SheetCellId, SheetInfo, SaveFileResult, AppData, CellInfo, CellCoordinateWithSheet, Transaction, GetBlockValuesParams, GetCellIdParams, GetShadowCellIdParams, GetShadowCellIdsParams, GetAvailableBlockIdParams, TempStatusDiff, BlockDataRow } from '../bindings';
|
|
1
|
+
import { ActionEffect, BlockField, BlockInfo, FormulaDisplayInfo, ShadowCellInfo, SheetCellId, SheetInfo, SaveFileResult, AppData, CellInfo, CellCoordinateWithSheet, Transaction, GetBlockValuesParams, GetCellIdParams, GetShadowCellIdParams, GetShadowCellIdsParams, GetAvailableBlockIdParams, TempStatusDiff, BlockDataRow, CommentMention } from '../bindings';
|
|
2
2
|
import { ColId, RowId } from '../types';
|
|
3
3
|
import { Worksheet } from './worksheet';
|
|
4
4
|
import { CustomFunc } from './calculator';
|
|
5
5
|
import { Result } from './utils';
|
|
6
|
+
import { Author } from './author';
|
|
6
7
|
export type ReturnCode = number;
|
|
7
8
|
export type Callback = () => void;
|
|
8
9
|
export type CellIdCallback = (cellId: SheetCellId) => void;
|
|
@@ -17,6 +18,56 @@ export declare class Workbook {
|
|
|
17
18
|
* It is caller's responsibility to store the block id.
|
|
18
19
|
*/
|
|
19
20
|
createBlockForNewCraft(sheetIdx: number, masterRow: number, masterCol: number, rowCnt: number, colCnt: number): Result<number>;
|
|
21
|
+
/**
|
|
22
|
+
* Add a comment (a new root thread, or a reply when `parentId` is given) to
|
|
23
|
+
* a cell. `author` and any `mentions[].author` are identities resolved by
|
|
24
|
+
* the host's {@link AuthorService}; the core dedupes them into stable
|
|
25
|
+
* persons. The note id (GUID) and timestamp are generated here and the id
|
|
26
|
+
* is returned so the host can later edit / reply to / delete this note.
|
|
27
|
+
*/
|
|
28
|
+
addComment(p: {
|
|
29
|
+
sheetIdx: number;
|
|
30
|
+
row: number;
|
|
31
|
+
col: number;
|
|
32
|
+
author: Author;
|
|
33
|
+
content: string;
|
|
34
|
+
mentions?: readonly CommentMention[];
|
|
35
|
+
parentId?: string;
|
|
36
|
+
undoable?: boolean;
|
|
37
|
+
}): {
|
|
38
|
+
commentId: string;
|
|
39
|
+
effect: ActionEffect;
|
|
40
|
+
};
|
|
41
|
+
/** Replace an existing note's text + mentions. */
|
|
42
|
+
editComment(p: {
|
|
43
|
+
sheetIdx: number;
|
|
44
|
+
commentId: string;
|
|
45
|
+
content: string;
|
|
46
|
+
mentions?: readonly CommentMention[];
|
|
47
|
+
undoable?: boolean;
|
|
48
|
+
}): ActionEffect;
|
|
49
|
+
/**
|
|
50
|
+
* Delete a note. Deleting a thread's root note removes the whole thread
|
|
51
|
+
* (root + all replies).
|
|
52
|
+
*/
|
|
53
|
+
deleteComment(p: {
|
|
54
|
+
sheetIdx: number;
|
|
55
|
+
commentId: string;
|
|
56
|
+
undoable?: boolean;
|
|
57
|
+
}): ActionEffect;
|
|
58
|
+
/** Mark a comment thread resolved / reopened. */
|
|
59
|
+
resolveComment(p: {
|
|
60
|
+
sheetIdx: number;
|
|
61
|
+
commentId: string;
|
|
62
|
+
resolved: boolean;
|
|
63
|
+
undoable?: boolean;
|
|
64
|
+
}): ActionEffect;
|
|
65
|
+
/**
|
|
66
|
+
* Pre-register (or refresh) a directory person so they can be `@mentioned`
|
|
67
|
+
* before they've authored anything. Typically fed from an enterprise
|
|
68
|
+
* {@link AuthorService.searchUsers} result.
|
|
69
|
+
*/
|
|
70
|
+
upsertPerson(author: Author): ActionEffect;
|
|
20
71
|
undo(): boolean;
|
|
21
72
|
redo(): boolean;
|
|
22
73
|
registerCellUpdatedCallback(callback: Callback): void;
|
package/dist/src/api/workbook.js
CHANGED
|
@@ -9,6 +9,11 @@ function rpc(method, params, bookId
|
|
|
9
9
|
const msg = params === undefined ? method : { method, value: params };
|
|
10
10
|
return handle(msg, bookId ?? null);
|
|
11
11
|
}
|
|
12
|
+
// GUID for comment / thread ids, wrapped in braces to match the OOXML
|
|
13
|
+
// threaded-comment convention (`{XXXX-...}`).
|
|
14
|
+
function newGuid() {
|
|
15
|
+
return `{${crypto.randomUUID()}}`;
|
|
16
|
+
}
|
|
12
17
|
export class Workbook {
|
|
13
18
|
constructor() {
|
|
14
19
|
this._id = rpc('newWorkbook');
|
|
@@ -66,6 +71,100 @@ export class Workbook {
|
|
|
66
71
|
}
|
|
67
72
|
return id;
|
|
68
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Add a comment (a new root thread, or a reply when `parentId` is given) to
|
|
76
|
+
* a cell. `author` and any `mentions[].author` are identities resolved by
|
|
77
|
+
* the host's {@link AuthorService}; the core dedupes them into stable
|
|
78
|
+
* persons. The note id (GUID) and timestamp are generated here and the id
|
|
79
|
+
* is returned so the host can later edit / reply to / delete this note.
|
|
80
|
+
*/
|
|
81
|
+
addComment(p) {
|
|
82
|
+
const commentId = newGuid();
|
|
83
|
+
const effect = this.execTransaction({
|
|
84
|
+
payloads: [
|
|
85
|
+
{
|
|
86
|
+
type: 'addComment',
|
|
87
|
+
value: {
|
|
88
|
+
sheetIdx: p.sheetIdx,
|
|
89
|
+
row: p.row,
|
|
90
|
+
col: p.col,
|
|
91
|
+
commentId,
|
|
92
|
+
parentId: p.parentId,
|
|
93
|
+
author: p.author,
|
|
94
|
+
dt: new Date().toISOString(),
|
|
95
|
+
content: p.content,
|
|
96
|
+
mentions: p.mentions ?? [],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
undoable: p.undoable ?? true,
|
|
101
|
+
temp: false,
|
|
102
|
+
});
|
|
103
|
+
return { commentId, effect };
|
|
104
|
+
}
|
|
105
|
+
/** Replace an existing note's text + mentions. */
|
|
106
|
+
editComment(p) {
|
|
107
|
+
return this.execTransaction({
|
|
108
|
+
payloads: [
|
|
109
|
+
{
|
|
110
|
+
type: 'editComment',
|
|
111
|
+
value: {
|
|
112
|
+
sheetIdx: p.sheetIdx,
|
|
113
|
+
commentId: p.commentId,
|
|
114
|
+
content: p.content,
|
|
115
|
+
mentions: p.mentions ?? [],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
undoable: p.undoable ?? true,
|
|
120
|
+
temp: false,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Delete a note. Deleting a thread's root note removes the whole thread
|
|
125
|
+
* (root + all replies).
|
|
126
|
+
*/
|
|
127
|
+
deleteComment(p) {
|
|
128
|
+
return this.execTransaction({
|
|
129
|
+
payloads: [
|
|
130
|
+
{
|
|
131
|
+
type: 'deleteComment',
|
|
132
|
+
value: { sheetIdx: p.sheetIdx, commentId: p.commentId },
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
undoable: p.undoable ?? true,
|
|
136
|
+
temp: false,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/** Mark a comment thread resolved / reopened. */
|
|
140
|
+
resolveComment(p) {
|
|
141
|
+
return this.execTransaction({
|
|
142
|
+
payloads: [
|
|
143
|
+
{
|
|
144
|
+
type: 'resolveComment',
|
|
145
|
+
value: {
|
|
146
|
+
sheetIdx: p.sheetIdx,
|
|
147
|
+
commentId: p.commentId,
|
|
148
|
+
resolved: p.resolved,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
undoable: p.undoable ?? true,
|
|
153
|
+
temp: false,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Pre-register (or refresh) a directory person so they can be `@mentioned`
|
|
158
|
+
* before they've authored anything. Typically fed from an enterprise
|
|
159
|
+
* {@link AuthorService.searchUsers} result.
|
|
160
|
+
*/
|
|
161
|
+
upsertPerson(author) {
|
|
162
|
+
return this.execTransaction({
|
|
163
|
+
payloads: [{ type: 'upsertPerson', value: author }],
|
|
164
|
+
undoable: false,
|
|
165
|
+
temp: false,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
69
168
|
undo() {
|
|
70
169
|
const result = rpc('undo', undefined, this._id);
|
|
71
170
|
if (result) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockInfo, CellPosition, ColInfo, DisplayWindow, DisplayWindowWithStartPoint, RowInfo, Style, Value, CellInfo, SheetDimension, MergeCell, AppendixWithCell, ReproducibleCell, SheetCoordinate, CellInput } from '../bindings';
|
|
1
|
+
import { BlockInfo, CellPosition, ColInfo, DisplayWindow, DisplayWindowWithStartPoint, RowInfo, Style, Value, CellInfo, SheetDimension, MergeCell, AppendixWithCell, ReproducibleCell, SheetCoordinate, CellInput, Comment } from '../bindings';
|
|
2
2
|
import { Cell } from './cell';
|
|
3
3
|
import { Result } from './utils';
|
|
4
4
|
export declare class Worksheet {
|
|
@@ -55,6 +55,13 @@ export declare class Worksheet {
|
|
|
55
55
|
getValue(rowIdx: number, colIdx: number): Result<Value>;
|
|
56
56
|
getDiyCellIdWithBlockId(blockId: number, row: number, col: number): Result<number>;
|
|
57
57
|
lookupAppendixUpward(blockId: number, row: number, col: number, craftId: string, tag: number): Result<AppendixWithCell>;
|
|
58
|
+
/**
|
|
59
|
+
* All comment threads on this sheet. Each `Comment` is a cell-anchored
|
|
60
|
+
* thread whose `notes` carry author identity, timestamp, text and resolved
|
|
61
|
+
* `@mentions`. Mutations go through the workbook transaction API
|
|
62
|
+
* (`addComment` / `editComment` / `deleteComment` / `resolveComment`).
|
|
63
|
+
*/
|
|
64
|
+
getComments(): Result<Comment[]>;
|
|
58
65
|
getFullyCoveredBlocks(rowIdx: number, colIdx: number, rowCnt: number, colCnt: number): Result<BlockInfo[]>;
|
|
59
66
|
private _id;
|
|
60
67
|
private _sheetId;
|
|
@@ -197,6 +197,15 @@ export class Worksheet {
|
|
|
197
197
|
tag,
|
|
198
198
|
}, this._id);
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* All comment threads on this sheet. Each `Comment` is a cell-anchored
|
|
202
|
+
* thread whose `notes` carry author identity, timestamp, text and resolved
|
|
203
|
+
* `@mentions`. Mutations go through the workbook transaction API
|
|
204
|
+
* (`addComment` / `editComment` / `deleteComment` / `resolveComment`).
|
|
205
|
+
*/
|
|
206
|
+
getComments() {
|
|
207
|
+
return rpc('getComments', { sheetIdx: this._sheetIdx }, this._id);
|
|
208
|
+
}
|
|
200
209
|
getFullyCoveredBlocks(rowIdx, colIdx, rowCnt, colCnt) {
|
|
201
210
|
return rpc('getFullyCoveredBlocks', {
|
|
202
211
|
sheetId: this._sheetId,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AuthorInput } from './author_input';
|
|
2
|
+
import { CommentMention } from './comment_mention';
|
|
3
|
+
export interface AddComment {
|
|
4
|
+
sheetIdx: number;
|
|
5
|
+
row: number;
|
|
6
|
+
col: number;
|
|
7
|
+
commentId: string;
|
|
8
|
+
parentId?: string;
|
|
9
|
+
author: AuthorInput;
|
|
10
|
+
dt: string;
|
|
11
|
+
content: string;
|
|
12
|
+
mentions: readonly CommentMention[];
|
|
13
|
+
}
|
|
14
|
+
export declare class AddCommentBuilder {
|
|
15
|
+
private _sheetIdx;
|
|
16
|
+
private _row;
|
|
17
|
+
private _col;
|
|
18
|
+
private _commentId;
|
|
19
|
+
private _parentId?;
|
|
20
|
+
private _author;
|
|
21
|
+
private _dt;
|
|
22
|
+
private _content;
|
|
23
|
+
private _mentions;
|
|
24
|
+
sheetIdx(value: number): this;
|
|
25
|
+
row(value: number): this;
|
|
26
|
+
col(value: number): this;
|
|
27
|
+
commentId(value: string): this;
|
|
28
|
+
parentId(value: string): this;
|
|
29
|
+
author(value: AuthorInput): this;
|
|
30
|
+
dt(value: string): this;
|
|
31
|
+
content(value: string): this;
|
|
32
|
+
mentions(value: readonly CommentMention[]): this;
|
|
33
|
+
build(): {
|
|
34
|
+
sheetIdx: number;
|
|
35
|
+
row: number;
|
|
36
|
+
col: number;
|
|
37
|
+
commentId: string;
|
|
38
|
+
parentId: string | undefined;
|
|
39
|
+
author: AuthorInput;
|
|
40
|
+
dt: string;
|
|
41
|
+
content: string;
|
|
42
|
+
mentions: readonly CommentMention[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export class AddCommentBuilder {
|
|
2
|
+
_sheetIdx;
|
|
3
|
+
_row;
|
|
4
|
+
_col;
|
|
5
|
+
_commentId;
|
|
6
|
+
_parentId;
|
|
7
|
+
_author;
|
|
8
|
+
_dt;
|
|
9
|
+
_content;
|
|
10
|
+
_mentions;
|
|
11
|
+
sheetIdx(value) {
|
|
12
|
+
this._sheetIdx = value;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
row(value) {
|
|
16
|
+
this._row = value;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
col(value) {
|
|
20
|
+
this._col = value;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
commentId(value) {
|
|
24
|
+
this._commentId = value;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
parentId(value) {
|
|
28
|
+
this._parentId = value;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
author(value) {
|
|
32
|
+
this._author = value;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
dt(value) {
|
|
36
|
+
this._dt = value;
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
content(value) {
|
|
40
|
+
this._content = value;
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
mentions(value) {
|
|
44
|
+
this._mentions = value;
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
build() {
|
|
48
|
+
if (this._sheetIdx === undefined)
|
|
49
|
+
throw new Error('missing sheetIdx');
|
|
50
|
+
if (this._row === undefined)
|
|
51
|
+
throw new Error('missing row');
|
|
52
|
+
if (this._col === undefined)
|
|
53
|
+
throw new Error('missing col');
|
|
54
|
+
if (this._commentId === undefined)
|
|
55
|
+
throw new Error('missing commentId');
|
|
56
|
+
if (this._author === undefined)
|
|
57
|
+
throw new Error('missing author');
|
|
58
|
+
if (this._dt === undefined)
|
|
59
|
+
throw new Error('missing dt');
|
|
60
|
+
if (this._content === undefined)
|
|
61
|
+
throw new Error('missing content');
|
|
62
|
+
if (this._mentions === undefined)
|
|
63
|
+
throw new Error('missing mentions');
|
|
64
|
+
return { sheetIdx: this._sheetIdx, row: this._row, col: this._col, commentId: this._commentId, parentId: this._parentId, author: this._author, dt: this._dt, content: this._content, mentions: this._mentions };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommentMentionInfo } from './comment_mention_info';
|
|
2
|
+
import { CommentPerson } from './comment_person';
|
|
3
|
+
export interface CommentNote {
|
|
4
|
+
id: string;
|
|
5
|
+
author: CommentPerson;
|
|
6
|
+
dt: string;
|
|
7
|
+
content: string;
|
|
8
|
+
parentId?: string;
|
|
9
|
+
mentions: readonly CommentMentionInfo[];
|
|
10
|
+
resolved: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DeleteComment {
|
|
2
|
+
sheetIdx: number;
|
|
3
|
+
commentId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class DeleteCommentBuilder {
|
|
6
|
+
private _sheetIdx;
|
|
7
|
+
private _commentId;
|
|
8
|
+
sheetIdx(value: number): this;
|
|
9
|
+
commentId(value: string): this;
|
|
10
|
+
build(): {
|
|
11
|
+
sheetIdx: number;
|
|
12
|
+
commentId: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class DeleteCommentBuilder {
|
|
2
|
+
_sheetIdx;
|
|
3
|
+
_commentId;
|
|
4
|
+
sheetIdx(value) {
|
|
5
|
+
this._sheetIdx = value;
|
|
6
|
+
return this;
|
|
7
|
+
}
|
|
8
|
+
commentId(value) {
|
|
9
|
+
this._commentId = value;
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
build() {
|
|
13
|
+
if (this._sheetIdx === undefined)
|
|
14
|
+
throw new Error('missing sheetIdx');
|
|
15
|
+
if (this._commentId === undefined)
|
|
16
|
+
throw new Error('missing commentId');
|
|
17
|
+
return { sheetIdx: this._sheetIdx, commentId: this._commentId };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CommentMention } from './comment_mention';
|
|
2
|
+
export interface EditComment {
|
|
3
|
+
sheetIdx: number;
|
|
4
|
+
commentId: string;
|
|
5
|
+
content: string;
|
|
6
|
+
mentions: readonly CommentMention[];
|
|
7
|
+
}
|
|
8
|
+
export declare class EditCommentBuilder {
|
|
9
|
+
private _sheetIdx;
|
|
10
|
+
private _commentId;
|
|
11
|
+
private _content;
|
|
12
|
+
private _mentions;
|
|
13
|
+
sheetIdx(value: number): this;
|
|
14
|
+
commentId(value: string): this;
|
|
15
|
+
content(value: string): this;
|
|
16
|
+
mentions(value: readonly CommentMention[]): this;
|
|
17
|
+
build(): {
|
|
18
|
+
sheetIdx: number;
|
|
19
|
+
commentId: string;
|
|
20
|
+
content: string;
|
|
21
|
+
mentions: readonly CommentMention[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class EditCommentBuilder {
|
|
2
|
+
_sheetIdx;
|
|
3
|
+
_commentId;
|
|
4
|
+
_content;
|
|
5
|
+
_mentions;
|
|
6
|
+
sheetIdx(value) {
|
|
7
|
+
this._sheetIdx = value;
|
|
8
|
+
return this;
|
|
9
|
+
}
|
|
10
|
+
commentId(value) {
|
|
11
|
+
this._commentId = value;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
content(value) {
|
|
15
|
+
this._content = value;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
mentions(value) {
|
|
19
|
+
this._mentions = value;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
build() {
|
|
23
|
+
if (this._sheetIdx === undefined)
|
|
24
|
+
throw new Error('missing sheetIdx');
|
|
25
|
+
if (this._commentId === undefined)
|
|
26
|
+
throw new Error('missing commentId');
|
|
27
|
+
if (this._content === undefined)
|
|
28
|
+
throw new Error('missing content');
|
|
29
|
+
if (this._mentions === undefined)
|
|
30
|
+
throw new Error('missing mentions');
|
|
31
|
+
return { sheetIdx: this._sheetIdx, commentId: this._commentId, content: this._content, mentions: this._mentions };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AddComment } from './add_comment';
|
|
1
2
|
import { BindFormSchema } from './bind_form_schema';
|
|
2
3
|
import { BindRandomSchema } from './bind_random_schema';
|
|
3
4
|
import { BlockInput } from './block_input';
|
|
@@ -16,9 +17,11 @@ import { CreateDiyCellById } from './create_diy_cell_by_id';
|
|
|
16
17
|
import { CreateSheet } from './create_sheet';
|
|
17
18
|
import { DeleteCols } from './delete_cols';
|
|
18
19
|
import { DeleteColsInBlock } from './delete_cols_in_block';
|
|
20
|
+
import { DeleteComment } from './delete_comment';
|
|
19
21
|
import { DeleteRows } from './delete_rows';
|
|
20
22
|
import { DeleteRowsInBlock } from './delete_rows_in_block';
|
|
21
23
|
import { DeleteSheet } from './delete_sheet';
|
|
24
|
+
import { EditComment } from './edit_comment';
|
|
22
25
|
import { EphemeralCellInput } from './ephemeral_cell_input';
|
|
23
26
|
import { EphemeralCellRemove } from './ephemeral_cell_remove';
|
|
24
27
|
import { EphemeralCellStyleUpdate } from './ephemeral_cell_style_update';
|
|
@@ -38,6 +41,7 @@ import { RemoveDiyCellById } from './remove_diy_cell_by_id';
|
|
|
38
41
|
import { ReorderBlockLines } from './reorder_block_lines';
|
|
39
42
|
import { ReproduceCells } from './reproduce_cells';
|
|
40
43
|
import { ResizeBlock } from './resize_block';
|
|
44
|
+
import { ResolveComment } from './resolve_comment';
|
|
41
45
|
import { RestoreCheckpoint } from './restore_checkpoint';
|
|
42
46
|
import { SetColWidth } from './set_col_width';
|
|
43
47
|
import { SetRowHeight } from './set_row_height';
|
|
@@ -48,6 +52,7 @@ import { SheetRename } from './sheet_rename';
|
|
|
48
52
|
import { SplitMergedCells } from './split_merged_cells';
|
|
49
53
|
import { UpsertFieldFormulas } from './upsert_field_formulas';
|
|
50
54
|
import { UpsertFieldRenderInfo } from './upsert_field_render_info';
|
|
55
|
+
import { UpsertPerson } from './upsert_person';
|
|
51
56
|
export type EditPayload = {
|
|
52
57
|
type: 'blockInput';
|
|
53
58
|
value: BlockInput;
|
|
@@ -153,6 +158,21 @@ export type EditPayload = {
|
|
|
153
158
|
} | {
|
|
154
159
|
type: 'splitMergedCells';
|
|
155
160
|
value: SplitMergedCells;
|
|
161
|
+
} | {
|
|
162
|
+
type: 'addComment';
|
|
163
|
+
value: AddComment;
|
|
164
|
+
} | {
|
|
165
|
+
type: 'editComment';
|
|
166
|
+
value: EditComment;
|
|
167
|
+
} | {
|
|
168
|
+
type: 'deleteComment';
|
|
169
|
+
value: DeleteComment;
|
|
170
|
+
} | {
|
|
171
|
+
type: 'resolveComment';
|
|
172
|
+
value: ResolveComment;
|
|
173
|
+
} | {
|
|
174
|
+
type: 'upsertPerson';
|
|
175
|
+
value: UpsertPerson;
|
|
156
176
|
} | {
|
|
157
177
|
type: 'sheetRename';
|
|
158
178
|
value: SheetRename;
|