@univerjs/sheets-thread-comment 0.5.5 → 0.6.0-experimental.20250125-1d060b9

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/lib/es/facade.js CHANGED
@@ -45,8 +45,8 @@ class T {
45
45
  * @example
46
46
  * ```ts
47
47
  * const comment = univerAPI.getActiveWorkbook()
48
- * .getSheetById(sheetId)
49
- * .getCommentById(commentId);
48
+ * .getSheetById(sheetId)
49
+ * .getCommentById(commentId);
50
50
  * const personId = comment.personId;
51
51
  * ```
52
52
  */
@@ -59,8 +59,8 @@ class T {
59
59
  * @example
60
60
  * ```ts
61
61
  * const comment = univerAPI.getActiveWorkbook()
62
- * .getSheetById(sheetId)
63
- * .getCommentById(commentId);
62
+ * .getSheetById(sheetId)
63
+ * .getCommentById(commentId);
64
64
  * const dateTime = comment.dateTime;
65
65
  * ```
66
66
  */
@@ -73,8 +73,8 @@ class T {
73
73
  * @example
74
74
  * ```ts
75
75
  * const comment = univerAPI.getActiveWorkbook()
76
- * .getSheetById(sheetId)
77
- * .getCommentById(commentId);
76
+ * .getSheetById(sheetId)
77
+ * .getCommentById(commentId);
78
78
  * const content = comment.content;
79
79
  * ```
80
80
  */
@@ -87,8 +87,8 @@ class T {
87
87
  * @example
88
88
  * ```ts
89
89
  * const comment = univerAPI.getActiveWorkbook()
90
- * .getSheetById(sheetId)
91
- * .getCommentById(commentId);
90
+ * .getSheetById(sheetId)
91
+ * .getCommentById(commentId);
92
92
  * const id = comment.id;
93
93
  * ```
94
94
  */
@@ -101,8 +101,8 @@ class T {
101
101
  * @example
102
102
  * ```ts
103
103
  * const comment = univerAPI.getActiveWorkbook()
104
- * .getSheetById(sheetId)
105
- * .getCommentById(commentId);
104
+ * .getSheetById(sheetId)
105
+ * .getCommentById(commentId);
106
106
  * const threadId = comment.threadId;
107
107
  * ```
108
108
  */
@@ -115,8 +115,8 @@ class T {
115
115
  * @example
116
116
  * ```ts
117
117
  * const comment = univerAPI.getActiveWorkbook()
118
- * .getSheetById(sheetId)
119
- * .getCommentById(commentId);
118
+ * .getSheetById(sheetId)
119
+ * .getCommentById(commentId);
120
120
  * const newComment = comment.copy();
121
121
  * ```
122
122
  */
@@ -135,7 +135,7 @@ class U extends T {
135
135
  * @example
136
136
  * ```ts
137
137
  * const comment = univerAPI.newTheadComment()
138
- * .setContent(univerAPI.newRichText().insertText('hello zhangsan'));
138
+ * .setContent(univerAPI.newRichText().insertText('hello zhangsan'));
139
139
  * ```
140
140
  */
141
141
  setContent(e) {
@@ -148,7 +148,7 @@ class U extends T {
148
148
  * @example
149
149
  * ```ts
150
150
  * const comment = univerAPI.newTheadComment()
151
- * .setPersonId('123');
151
+ * .setPersonId('123');
152
152
  * ```
153
153
  */
154
154
  setPersonId(e) {
@@ -161,7 +161,7 @@ class U extends T {
161
161
  * @example
162
162
  * ```ts
163
163
  * const comment = univerAPI.newTheadComment()
164
- * .setDateTime(new Date());
164
+ * .setDateTime(new Date());
165
165
  * ```
166
166
  */
167
167
  setDateTime(e) {
@@ -174,7 +174,7 @@ class U extends T {
174
174
  * @example
175
175
  * ```ts
176
176
  * const comment = univerAPI.newTheadComment()
177
- * .setId('123');
177
+ * .setId('123');
178
178
  * ```
179
179
  */
180
180
  setId(e) {
@@ -187,7 +187,7 @@ class U extends T {
187
187
  * @example
188
188
  * ```ts
189
189
  * const comment = univerAPI.newTheadComment()
190
- * .setThreadId('123');
190
+ * .setThreadId('123');
191
191
  * ```
192
192
  */
193
193
  setThreadId(e) {
@@ -199,8 +199,8 @@ class U extends T {
199
199
  * @example
200
200
  * ```ts
201
201
  * const comment = univerAPI.newTheadComment()
202
- * .setContent(univerAPI.newRichText().insertText('hello zhangsan'))
203
- * .build();
202
+ * .setContent(univerAPI.newRichText().insertText('hello zhangsan'))
203
+ * .build();
204
204
  * ```
205
205
  */
206
206
  build() {
@@ -208,6 +208,9 @@ class U extends T {
208
208
  }
209
209
  }
210
210
  let i = class {
211
+ /**
212
+ * @ignore
213
+ */
211
214
  constructor(r, e, t, n, o, m, s) {
212
215
  this._thread = r, this._parent = e, this._injector = t, this._commandService = n, this._univerInstanceService = o, this._threadCommentModel = m, this._userManagerService = s;
213
216
  }
@@ -218,12 +221,12 @@ let i = class {
218
221
  }
219
222
  /**
220
223
  * Whether the comment is a root comment
221
- * @returns Whether the comment is a root comment
224
+ * @returns {boolean} Whether the comment is a root comment
222
225
  * @example
223
226
  * ```ts
224
227
  * const comment = univerAPI.getActiveWorkbook()
225
- * .getSheetById(sheetId)
226
- * .getCommentById(commentId);
228
+ * .getSheetById(sheetId)
229
+ * .getCommentById(commentId);
227
230
  * const isRoot = comment.getIsRoot();
228
231
  * ```
229
232
  */
@@ -232,12 +235,12 @@ let i = class {
232
235
  }
233
236
  /**
234
237
  * Get the comment data
235
- * @returns The comment data
238
+ * @returns {IBaseComment} The comment data
236
239
  * @example
237
240
  * ```ts
238
241
  * const comment = univerAPI.getActiveWorkbook()
239
- * .getSheetById(sheetId)
240
- * .getCommentById(commentId);
242
+ * .getSheetById(sheetId)
243
+ * .getCommentById(commentId);
241
244
  * const commentData = comment.getCommentData();
242
245
  * ```
243
246
  */
@@ -247,12 +250,12 @@ let i = class {
247
250
  }
248
251
  /**
249
252
  * Get the replies of the comment
250
- * @returns the replies of the comment
253
+ * @returns {FThreadComment[]} the replies of the comment
251
254
  * @example
252
255
  * ```ts
253
256
  * const comment = univerAPI.getActiveWorkbook()
254
- * .getSheetById(sheetId)
255
- * .getCommentById(commentId);
257
+ * .getSheetById(sheetId)
258
+ * .getCommentById(commentId);
256
259
  * const replies = comment.getReplies();
257
260
  * ```
258
261
  */
@@ -263,12 +266,12 @@ let i = class {
263
266
  }
264
267
  /**
265
268
  * Get the range of the comment
266
- * @returns The range of the comment
269
+ * @returns {FRange | null} The range of the comment
267
270
  * @example
268
271
  * ```ts
269
272
  * const comment = univerAPI.getActiveWorkbook()
270
- * .getSheetById(sheetId)
271
- * .getCommentById(commentId);
273
+ * .getSheetById(sheetId)
274
+ * .getCommentById(commentId);
272
275
  * const range = comment.getRange();
273
276
  * ```
274
277
  */
@@ -282,6 +285,7 @@ let i = class {
282
285
  const t = this._getRef();
283
286
  return this._injector.createInstance(x, r, e, t);
284
287
  }
288
+ // eslint-disable-next-line
285
289
  /**
286
290
  * @deprecated use `getRichText` as instead
287
291
  */
@@ -294,8 +298,8 @@ let i = class {
294
298
  * @example
295
299
  * ```ts
296
300
  * const comment = univerAPI.getActiveWorkbook()
297
- * .getSheetById(sheetId)
298
- * .getCommentById(commentId);
301
+ * .getSheetById(sheetId)
302
+ * .getCommentById(commentId);
299
303
  * const richText = comment.getRichText();
300
304
  * ```
301
305
  */
@@ -309,8 +313,8 @@ let i = class {
309
313
  * @example
310
314
  * ```ts
311
315
  * const comment = univerAPI.getActiveWorkbook()
312
- * .getSheetById(sheetId)
313
- * .getCommentById(commentId);
316
+ * .getSheetById(sheetId)
317
+ * .getCommentById(commentId);
314
318
  * const success = await comment.deleteAsync();
315
319
  * ```
316
320
  */
@@ -324,14 +328,15 @@ let i = class {
324
328
  }
325
329
  );
326
330
  }
331
+ // eslint-disable-next-line
327
332
  /**
328
333
  * @deprecated use `deleteAsync` as instead.
329
334
  */
330
335
  delete() {
331
336
  return this.deleteAsync();
332
337
  }
338
+ // eslint-disable-next-line
333
339
  /**
334
- * @param content
335
340
  * @deprecated use `updateAsync` as instead
336
341
  */
337
342
  async update(r) {
@@ -339,13 +344,13 @@ let i = class {
339
344
  }
340
345
  /**
341
346
  * Update the comment content
342
- * @param content The new content of the comment
343
- * @returns success or not
347
+ * @param {IDocumentBody | RichTextValue} content The new content of the comment
348
+ * @returns {Promise<boolean>} success or not
344
349
  * @example
345
350
  * ```ts
346
351
  * const comment = univerAPI.getActiveWorkbook()
347
- * .getSheetById(sheetId)
348
- * .getCommentById(commentId);
352
+ * .getSheetById(sheetId)
353
+ * .getCommentById(commentId);
349
354
  * const success = await comment.updateAsync(univerAPI.newRichText().insertText('hello zhangsan'));
350
355
  * ```
351
356
  */
@@ -365,8 +370,8 @@ let i = class {
365
370
  }
366
371
  );
367
372
  }
373
+ // eslint-disable-next-line
368
374
  /**
369
- * @param resolved
370
375
  * @deprecated use `resolveAsync` as instead
371
376
  */
372
377
  resolve(r) {
@@ -374,13 +379,13 @@ let i = class {
374
379
  }
375
380
  /**
376
381
  * Resolve the comment
377
- * @param resolved Whether the comment is resolved
378
- * @returns success or not
382
+ * @param {boolean} resolved Whether the comment is resolved
383
+ * @returns {Promise<boolean>} success or not
379
384
  * @example
380
385
  * ```ts
381
386
  * const comment = univerAPI.getActiveWorkbook()
382
- * .getSheetById(sheetId)
383
- * .getCommentById(commentId);
387
+ * .getSheetById(sheetId)
388
+ * .getCommentById(commentId);
384
389
  * const success = await comment.resolveAsync(true);
385
390
  * ```
386
391
  */
@@ -397,16 +402,16 @@ let i = class {
397
402
  }
398
403
  /**
399
404
  * Reply to the comment
400
- * @param comment The comment to reply to
401
- * @returns success or not
405
+ * @param {FTheadCommentBuilder} comment The comment to reply to
406
+ * @returns {Promise<boolean>} success or not
402
407
  * @example
403
408
  * ```ts
404
409
  * const comment = univerAPI.getActiveWorkbook()
405
- * .getSheetById(sheetId)
406
- * .getCommentById(commentId);
410
+ * .getSheetById(sheetId)
411
+ * .getCommentById(commentId);
407
412
  *
408
413
  * const reply = univerAPI.newTheadComment()
409
- * .setContent(univerAPI.newRichText().insertText('hello zhangsan'));
414
+ * .setContent(univerAPI.newRichText().insertText('hello zhangsan'));
410
415
  *
411
416
  * const success = await comment.replyAsync(reply);
412
417
  * ```
@@ -506,6 +511,9 @@ class K extends x {
506
511
  }
507
512
  x.extend(K);
508
513
  class Q extends j {
514
+ /**
515
+ * @ignore
516
+ */
509
517
  _initialize() {
510
518
  Object.defineProperty(this, "_threadCommentModel", {
511
519
  get() {
@@ -1,6 +1,9 @@
1
1
  import { IEventBase, RichTextValue, FEventName } from '@univerjs/core';
2
2
  import { FWorkbook, FWorksheet } from '@univerjs/sheets/facade';
3
3
  import { FTheadCommentItem, FThreadComment } from './f-thread-comment';
4
+ /**
5
+ * @ignore
6
+ */
4
7
  interface ICommentEventMixin {
5
8
  /**
6
9
  * Event fired after comment added
@@ -99,6 +102,9 @@ interface ICommentEventMixin {
99
102
  */
100
103
  readonly BeforeCommentResolve: 'BeforeCommentResolve';
101
104
  }
105
+ /**
106
+ * @ignore
107
+ */
102
108
  export declare class FCommentEvent extends FEventName {
103
109
  get CommentAdded(): 'CommentAdded';
104
110
  get BeforeCommentAdd(): 'BeforeCommentAdd';
@@ -228,6 +234,9 @@ export interface ISheetCommentResolveEvent extends IEventBase {
228
234
  /** The new resolve status */
229
235
  resolved: boolean;
230
236
  }
237
+ /**
238
+ * @ignore
239
+ */
231
240
  export interface ISheetCommentEventConfig {
232
241
  BeforeCommentAdd: IBeforeSheetCommentAddEvent;
233
242
  CommentAdded: ISheetCommentAddEvent;
@@ -1,6 +1,9 @@
1
1
  import { IDocumentBody, Nullable } from '@univerjs/core';
2
2
  import { FRange } from '@univerjs/sheets/facade';
3
3
  import { FTheadCommentBuilder, FThreadComment } from './f-thread-comment';
4
+ /**
5
+ * @ignore
6
+ */
4
7
  export interface IFRangeCommentMixin {
5
8
  /**
6
9
  * Get the comment of the start cell in the current range.
@@ -75,6 +78,9 @@ export interface IFRangeCommentMixin {
75
78
  */
76
79
  clearCommentsAsync(): Promise<boolean>;
77
80
  }
81
+ /**
82
+ * @ignore
83
+ */
78
84
  export declare class FRangeCommentMixin extends FRange implements IFRangeCommentMixin {
79
85
  getComment(): Nullable<FThreadComment>;
80
86
  getComments(): FThreadComment[];
@@ -2,6 +2,10 @@ import { IDocumentBody, ICommandService, Injector, IUniverInstanceService, RichT
2
2
  import { IBaseComment, IThreadComment } from '@univerjs/thread-comment';
3
3
  import { SheetsThreadCommentModel } from '@univerjs/sheets-thread-comment';
4
4
  import { FRange } from '@univerjs/sheets/facade';
5
+ /**
6
+ * An readonly class that represents a comment.
7
+ * @ignore
8
+ */
5
9
  export declare class FTheadCommentItem {
6
10
  protected _comment: IThreadComment;
7
11
  /**
@@ -21,8 +25,8 @@ export declare class FTheadCommentItem {
21
25
  * @example
22
26
  * ```ts
23
27
  * const comment = univerAPI.getActiveWorkbook()
24
- * .getSheetById(sheetId)
25
- * .getCommentById(commentId);
28
+ * .getSheetById(sheetId)
29
+ * .getCommentById(commentId);
26
30
  * const personId = comment.personId;
27
31
  * ```
28
32
  */
@@ -33,8 +37,8 @@ export declare class FTheadCommentItem {
33
37
  * @example
34
38
  * ```ts
35
39
  * const comment = univerAPI.getActiveWorkbook()
36
- * .getSheetById(sheetId)
37
- * .getCommentById(commentId);
40
+ * .getSheetById(sheetId)
41
+ * .getCommentById(commentId);
38
42
  * const dateTime = comment.dateTime;
39
43
  * ```
40
44
  */
@@ -45,8 +49,8 @@ export declare class FTheadCommentItem {
45
49
  * @example
46
50
  * ```ts
47
51
  * const comment = univerAPI.getActiveWorkbook()
48
- * .getSheetById(sheetId)
49
- * .getCommentById(commentId);
52
+ * .getSheetById(sheetId)
53
+ * .getCommentById(commentId);
50
54
  * const content = comment.content;
51
55
  * ```
52
56
  */
@@ -57,8 +61,8 @@ export declare class FTheadCommentItem {
57
61
  * @example
58
62
  * ```ts
59
63
  * const comment = univerAPI.getActiveWorkbook()
60
- * .getSheetById(sheetId)
61
- * .getCommentById(commentId);
64
+ * .getSheetById(sheetId)
65
+ * .getCommentById(commentId);
62
66
  * const id = comment.id;
63
67
  * ```
64
68
  */
@@ -69,8 +73,8 @@ export declare class FTheadCommentItem {
69
73
  * @example
70
74
  * ```ts
71
75
  * const comment = univerAPI.getActiveWorkbook()
72
- * .getSheetById(sheetId)
73
- * .getCommentById(commentId);
76
+ * .getSheetById(sheetId)
77
+ * .getCommentById(commentId);
74
78
  * const threadId = comment.threadId;
75
79
  * ```
76
80
  */
@@ -81,13 +85,16 @@ export declare class FTheadCommentItem {
81
85
  * @example
82
86
  * ```ts
83
87
  * const comment = univerAPI.getActiveWorkbook()
84
- * .getSheetById(sheetId)
85
- * .getCommentById(commentId);
88
+ * .getSheetById(sheetId)
89
+ * .getCommentById(commentId);
86
90
  * const newComment = comment.copy();
87
91
  * ```
88
92
  */
89
93
  copy(): FTheadCommentBuilder;
90
94
  }
95
+ /**
96
+ * A builder for thread comment. use {@link FUniver} `univerAPI.newTheadComment()` to create a new builder.
97
+ */
91
98
  export declare class FTheadCommentBuilder extends FTheadCommentItem {
92
99
  static create(comment?: IThreadComment): FTheadCommentBuilder;
93
100
  /**
@@ -97,7 +104,7 @@ export declare class FTheadCommentBuilder extends FTheadCommentItem {
97
104
  * @example
98
105
  * ```ts
99
106
  * const comment = univerAPI.newTheadComment()
100
- * .setContent(univerAPI.newRichText().insertText('hello zhangsan'));
107
+ * .setContent(univerAPI.newRichText().insertText('hello zhangsan'));
101
108
  * ```
102
109
  */
103
110
  setContent(content: IDocumentBody | RichTextValue): FTheadCommentBuilder;
@@ -108,7 +115,7 @@ export declare class FTheadCommentBuilder extends FTheadCommentItem {
108
115
  * @example
109
116
  * ```ts
110
117
  * const comment = univerAPI.newTheadComment()
111
- * .setPersonId('123');
118
+ * .setPersonId('123');
112
119
  * ```
113
120
  */
114
121
  setPersonId(userId: string): FTheadCommentBuilder;
@@ -119,7 +126,7 @@ export declare class FTheadCommentBuilder extends FTheadCommentItem {
119
126
  * @example
120
127
  * ```ts
121
128
  * const comment = univerAPI.newTheadComment()
122
- * .setDateTime(new Date());
129
+ * .setDateTime(new Date());
123
130
  * ```
124
131
  */
125
132
  setDateTime(date: Date): FTheadCommentBuilder;
@@ -130,7 +137,7 @@ export declare class FTheadCommentBuilder extends FTheadCommentItem {
130
137
  * @example
131
138
  * ```ts
132
139
  * const comment = univerAPI.newTheadComment()
133
- * .setId('123');
140
+ * .setId('123');
134
141
  * ```
135
142
  */
136
143
  setId(id: string): FTheadCommentBuilder;
@@ -141,7 +148,7 @@ export declare class FTheadCommentBuilder extends FTheadCommentItem {
141
148
  * @example
142
149
  * ```ts
143
150
  * const comment = univerAPI.newTheadComment()
144
- * .setThreadId('123');
151
+ * .setThreadId('123');
145
152
  * ```
146
153
  */
147
154
  setThreadId(threadId: string): FTheadCommentBuilder;
@@ -151,12 +158,15 @@ export declare class FTheadCommentBuilder extends FTheadCommentItem {
151
158
  * @example
152
159
  * ```ts
153
160
  * const comment = univerAPI.newTheadComment()
154
- * .setContent(univerAPI.newRichText().insertText('hello zhangsan'))
155
- * .build();
161
+ * .setContent(univerAPI.newRichText().insertText('hello zhangsan'))
162
+ * .build();
156
163
  * ```
157
164
  */
158
165
  build(): IThreadComment;
159
166
  }
167
+ /**
168
+ * A class that represents a thread comment already in the sheet.
169
+ */
160
170
  export declare class FThreadComment {
161
171
  private readonly _thread;
162
172
  private readonly _parent;
@@ -165,52 +175,55 @@ export declare class FThreadComment {
165
175
  private readonly _univerInstanceService;
166
176
  private readonly _threadCommentModel;
167
177
  private readonly _userManagerService;
178
+ /**
179
+ * @ignore
180
+ */
168
181
  constructor(_thread: IThreadComment | IBaseComment, _parent: IThreadComment | undefined, _injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _threadCommentModel: SheetsThreadCommentModel, _userManagerService: UserManagerService);
169
182
  private _getRef;
170
183
  /**
171
184
  * Whether the comment is a root comment
172
- * @returns Whether the comment is a root comment
185
+ * @returns {boolean} Whether the comment is a root comment
173
186
  * @example
174
187
  * ```ts
175
188
  * const comment = univerAPI.getActiveWorkbook()
176
- * .getSheetById(sheetId)
177
- * .getCommentById(commentId);
189
+ * .getSheetById(sheetId)
190
+ * .getCommentById(commentId);
178
191
  * const isRoot = comment.getIsRoot();
179
192
  * ```
180
193
  */
181
194
  getIsRoot(): boolean;
182
195
  /**
183
196
  * Get the comment data
184
- * @returns The comment data
197
+ * @returns {IBaseComment} The comment data
185
198
  * @example
186
199
  * ```ts
187
200
  * const comment = univerAPI.getActiveWorkbook()
188
- * .getSheetById(sheetId)
189
- * .getCommentById(commentId);
201
+ * .getSheetById(sheetId)
202
+ * .getCommentById(commentId);
190
203
  * const commentData = comment.getCommentData();
191
204
  * ```
192
205
  */
193
206
  getCommentData(): IBaseComment;
194
207
  /**
195
208
  * Get the replies of the comment
196
- * @returns the replies of the comment
209
+ * @returns {FThreadComment[]} the replies of the comment
197
210
  * @example
198
211
  * ```ts
199
212
  * const comment = univerAPI.getActiveWorkbook()
200
- * .getSheetById(sheetId)
201
- * .getCommentById(commentId);
213
+ * .getSheetById(sheetId)
214
+ * .getCommentById(commentId);
202
215
  * const replies = comment.getReplies();
203
216
  * ```
204
217
  */
205
218
  getReplies(): FThreadComment[] | undefined;
206
219
  /**
207
220
  * Get the range of the comment
208
- * @returns The range of the comment
221
+ * @returns {FRange | null} The range of the comment
209
222
  * @example
210
223
  * ```ts
211
224
  * const comment = univerAPI.getActiveWorkbook()
212
- * .getSheetById(sheetId)
213
- * .getCommentById(commentId);
225
+ * .getSheetById(sheetId)
226
+ * .getCommentById(commentId);
214
227
  * const range = comment.getRange();
215
228
  * ```
216
229
  */
@@ -225,8 +238,8 @@ export declare class FThreadComment {
225
238
  * @example
226
239
  * ```ts
227
240
  * const comment = univerAPI.getActiveWorkbook()
228
- * .getSheetById(sheetId)
229
- * .getCommentById(commentId);
241
+ * .getSheetById(sheetId)
242
+ * .getCommentById(commentId);
230
243
  * const richText = comment.getRichText();
231
244
  * ```
232
245
  */
@@ -237,8 +250,8 @@ export declare class FThreadComment {
237
250
  * @example
238
251
  * ```ts
239
252
  * const comment = univerAPI.getActiveWorkbook()
240
- * .getSheetById(sheetId)
241
- * .getCommentById(commentId);
253
+ * .getSheetById(sheetId)
254
+ * .getCommentById(commentId);
242
255
  * const success = await comment.deleteAsync();
243
256
  * ```
244
257
  */
@@ -248,53 +261,51 @@ export declare class FThreadComment {
248
261
  */
249
262
  delete(): Promise<boolean>;
250
263
  /**
251
- * @param content
252
264
  * @deprecated use `updateAsync` as instead
253
265
  */
254
266
  update(content: IDocumentBody): Promise<boolean>;
255
267
  /**
256
268
  * Update the comment content
257
- * @param content The new content of the comment
258
- * @returns success or not
269
+ * @param {IDocumentBody | RichTextValue} content The new content of the comment
270
+ * @returns {Promise<boolean>} success or not
259
271
  * @example
260
272
  * ```ts
261
273
  * const comment = univerAPI.getActiveWorkbook()
262
- * .getSheetById(sheetId)
263
- * .getCommentById(commentId);
274
+ * .getSheetById(sheetId)
275
+ * .getCommentById(commentId);
264
276
  * const success = await comment.updateAsync(univerAPI.newRichText().insertText('hello zhangsan'));
265
277
  * ```
266
278
  */
267
279
  updateAsync(content: IDocumentBody | RichTextValue): Promise<boolean>;
268
280
  /**
269
- * @param resolved
270
281
  * @deprecated use `resolveAsync` as instead
271
282
  */
272
283
  resolve(resolved?: boolean): Promise<boolean>;
273
284
  /**
274
285
  * Resolve the comment
275
- * @param resolved Whether the comment is resolved
276
- * @returns success or not
286
+ * @param {boolean} resolved Whether the comment is resolved
287
+ * @returns {Promise<boolean>} success or not
277
288
  * @example
278
289
  * ```ts
279
290
  * const comment = univerAPI.getActiveWorkbook()
280
- * .getSheetById(sheetId)
281
- * .getCommentById(commentId);
291
+ * .getSheetById(sheetId)
292
+ * .getCommentById(commentId);
282
293
  * const success = await comment.resolveAsync(true);
283
294
  * ```
284
295
  */
285
296
  resolveAsync(resolved?: boolean): Promise<boolean>;
286
297
  /**
287
298
  * Reply to the comment
288
- * @param comment The comment to reply to
289
- * @returns success or not
299
+ * @param {FTheadCommentBuilder} comment The comment to reply to
300
+ * @returns {Promise<boolean>} success or not
290
301
  * @example
291
302
  * ```ts
292
303
  * const comment = univerAPI.getActiveWorkbook()
293
- * .getSheetById(sheetId)
294
- * .getCommentById(commentId);
304
+ * .getSheetById(sheetId)
305
+ * .getCommentById(commentId);
295
306
  *
296
307
  * const reply = univerAPI.newTheadComment()
297
- * .setContent(univerAPI.newRichText().insertText('hello zhangsan'));
308
+ * .setContent(univerAPI.newRichText().insertText('hello zhangsan'));
298
309
  *
299
310
  * const success = await comment.replyAsync(reply);
300
311
  * ```
@@ -2,6 +2,9 @@ import { IDisposable, Injector, FUniver } from '@univerjs/core';
2
2
  import { IThreadComment } from '@univerjs/thread-comment';
3
3
  import { ISheetCommentAddEvent, ISheetCommentDeleteEvent, ISheetCommentResolveEvent, ISheetCommentUpdateEvent } from './f-event';
4
4
  import { FTheadCommentBuilder } from './f-thread-comment';
5
+ /**
6
+ * @ignore
7
+ */
5
8
  export interface IFUniverCommentMixin {
6
9
  /**
7
10
  * @deprecated use `univerAPI.addEvent(univerAPI.event.CommentAdded, () => {})` as instead
@@ -29,9 +32,15 @@ export interface IFUniverCommentMixin {
29
32
  */
30
33
  newTheadComment(): FTheadCommentBuilder;
31
34
  }
35
+ /**
36
+ * @ignore
37
+ */
32
38
  export declare class FUniverCommentMixin extends FUniver implements IFUniverCommentMixin {
33
39
  private _handleCommentCommand;
34
40
  private _handleBeforeCommentCommand;
41
+ /**
42
+ * @ignore
43
+ */
35
44
  _initialize(injector: Injector): void;
36
45
  newTheadComment(comment?: IThreadComment): FTheadCommentBuilder;
37
46
  }
@@ -3,6 +3,9 @@ import { CommentUpdate, IAddCommentCommandParams, IDeleteCommentCommandParams, T
3
3
  import { FWorkbook } from '@univerjs/sheets/facade';
4
4
  import { FThreadComment } from './f-thread-comment';
5
5
  type IUpdateCommandParams = any;
6
+ /**
7
+ * @ignore
8
+ */
6
9
  export interface IFWorkbookThreadCommentMixin {
7
10
  /**
8
11
  * Get all comments in the current sheet
@@ -41,8 +44,14 @@ export interface IFWorkbookThreadCommentMixin {
41
44
  */
42
45
  onBeforeDeleteThreadComment(this: FWorkbook, callback: (params: IDeleteCommentCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
43
46
  }
47
+ /**
48
+ * @ignore
49
+ */
44
50
  export declare class FWorkbookThreadCommentMixin extends FWorkbook implements IFWorkbookThreadCommentMixin {
45
51
  _threadCommentModel: ThreadCommentModel;
52
+ /**
53
+ * @ignore
54
+ */
46
55
  _initialize(): void;
47
56
  getComments(): FThreadComment[];
48
57
  clearComments(): Promise<boolean>;
@@ -2,6 +2,9 @@ import { IDisposable } from '@univerjs/core';
2
2
  import { IAddCommentCommandParams } from '@univerjs/thread-comment';
3
3
  import { FWorksheet } from '@univerjs/sheets/facade';
4
4
  import { FThreadComment } from './f-thread-comment';
5
+ /**
6
+ * @ignore
7
+ */
5
8
  export interface IFWorksheetCommentMixin {
6
9
  /**
7
10
  * Get all comments in the current sheet
@@ -33,6 +36,9 @@ export interface IFWorksheetCommentMixin {
33
36
  */
34
37
  getCommentById(commentId: string): FThreadComment | undefined;
35
38
  }
39
+ /**
40
+ * @ignore
41
+ */
36
42
  export declare class FWorksheetCommentMixin extends FWorksheet implements IFWorksheetCommentMixin {
37
43
  getComments(): FThreadComment[];
38
44
  clearComments(): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-thread-comment",
3
- "version": "0.5.5",
3
+ "version": "0.6.0-experimental.20250125-1d060b9",
4
4
  "private": false,
5
5
  "description": "Univer sheets thread comment base plugin",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -51,17 +51,17 @@
51
51
  "rxjs": ">=7.0.0"
52
52
  },
53
53
  "dependencies": {
54
- "@univerjs/core": "0.5.5",
55
- "@univerjs/sheets": "0.5.5",
56
- "@univerjs/thread-comment": "0.5.5",
57
- "@univerjs/engine-formula": "0.5.5"
54
+ "@univerjs/engine-formula": "0.6.0-experimental.20250125-1d060b9",
55
+ "@univerjs/core": "0.6.0-experimental.20250125-1d060b9",
56
+ "@univerjs/thread-comment": "0.6.0-experimental.20250125-1d060b9",
57
+ "@univerjs/sheets": "0.6.0-experimental.20250125-1d060b9"
58
58
  },
59
59
  "devDependencies": {
60
60
  "rxjs": "^7.8.1",
61
- "typescript": "^5.7.2",
61
+ "typescript": "^5.7.3",
62
62
  "vite": "^6.0.7",
63
63
  "vitest": "^2.1.8",
64
- "@univerjs-infra/shared": "0.5.5"
64
+ "@univerjs-infra/shared": "0.6.0-alpha.0"
65
65
  },
66
66
  "scripts": {
67
67
  "test": "vitest run",
package/LICENSE DELETED
@@ -1,176 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS