You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/features/server-side-editor-api.md
+49-74Lines changed: 49 additions & 74 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,6 +283,55 @@ for ( const item of items ) {
283
283
}
284
284
```
285
285
286
+
#### Working with annotations
287
+
288
+
Each suggestion in the editor is always connected with an annotation. Sometimes, you may want to gather additional data for suggestions based on their annotations, such as the suggestion label or the content in the document on which the suggestion is made, which are not available in the database.
289
+
290
+
The following example demonstrates retrieving suggestion data:
The {@link features/comments comments} feature allows your users to have discussions attached to certain parts of your documents. You can use the comments feature API to implement interactions with comments with no need to open the editor itself.
@@ -338,80 +387,6 @@ for ( const thread of threads ) {
338
387
339
388
This code is particularly useful when you need to clean up a document. You might use it to automatically resolve old discussions, prepare documents for publication, or maintain a clean comment history in your content management system.
340
389
341
-
### Working with collaboration UI elements
342
-
343
-
Every comment thread and suggestion is connected with an annotation that is used to display it in the editor. You can get the corresponding UI annotation for a collaboration element, or get the collaboration element for a given annotation using dedicated methods.
344
-
345
-
#### Comment annotations
346
-
347
-
The `CommentsRepository` plugin provides methods to get the corresponding annotation for a comment thread or find a comment thread for a given annotation:
for ( constadjacentSuggestionofsuggestion.getAllAdjacentSuggestions() ) {
400
-
ranges.push( ...adjacentSuggestion.getRanges() );
401
-
}
402
-
403
-
results.push( {
404
-
type:'suggestion',
405
-
id:suggestion.id,
406
-
label:annotation.innerView.description,
407
-
context: ranges
408
-
} );
409
-
}
410
-
}
411
-
412
-
returnJSON.stringify( results );
413
-
```
414
-
415
390
### Working with revision history
416
391
417
392
Use the {@link features/revision-history revision history} feature API to build more functional integration between your application and the document revisions data.
0 commit comments