Skip to content

Commit 129183b

Browse files
MitchC1999TheSpyderkemister85
authored
Apply suggestions from code review
Co-authored-by: Andrew Herron <[email protected]> Co-authored-by: Karl Kemister-Sheppard <[email protected]>
1 parent 152ae37 commit 129183b

File tree

10 files changed

+38
-31
lines changed

10 files changed

+38
-31
lines changed

modules/ROOT/pages/suggestededits.adoc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ The {pluginname} plugin provides a dedicated `'suggestededits'` xref:custom-view
3232

3333
The view contains a few controls to manage the review process:
3434

35-
* Show edits: A toggle button which hides/unhides the highlighted annotations.
36-
* Complete review: Ends the review, applying the resolved changes to the document.
37-
* Cancel: Exits the review with no change to the document.
35+
* Show edits: Toggles whether suggested edits are shown. When hidden, the view shows what the document will look like if the review is completed.
36+
* Complete review: Ends the review, applying resolved suggestions to the document.
37+
* Cancel: Ignores any resolved suggestions and makes no change to the document. Feedback given on suggestions will be retained.
3838

3939
=== Document
4040

@@ -50,9 +50,9 @@ Replaced content is represented as both added and removed content, and indicates
5050

5151
Each suggested edit is listed as a card in the sidebar and color coded by the type of change, along with the user who made the suggestion, when the edit was made, and any feedback provided on that suggestion. When selected, each suggestion can be handled in the following ways:
5252

53-
* Accept: Resolves the edit and will be applied to the document when .
54-
* Reject: Removes the change from the document.
55-
* Revert: Undoes a previously accepted or rejected change.
53+
* Accept: Resolves the suggestion, applying the edit to the document when the review is completed.
54+
* Reject: Resolves the suggestion, turning back the edit to the original state.
55+
* Revert: Reverts the current "Accept" or "Reject" resolution on the suggestion.
5656
* Provide feedback: Opens a text area for you to provide feedback on the suggestion.
5757

5858
Any feedback will be stored in the model and displayed underneath the card details and in chronological order. This feedback thread can be used to discuss the suggestion with the author or other reviewers. The feedback author can edit or delete their own feedback.
@@ -99,13 +99,11 @@ tinymce.init({
9999
});
100100
----
101101

102-
This configuration will add {pluginname} to the editor toolbar, allowing users to access the plugin features. However, to fully utilize the plugin, you will need to provide additional configuration options.
103-
104-
102+
This configuration adds {pluginname} to the editor toolbar, enabling access to the plugin features. To fully utilize the plugin, additional configuration options must be provided.
105103

106104
== Options
107105

108-
The {pluginname} plugin requires a model to store. If the model is not provided in the editor configuration, or is `+undefined+`, the plugin will generate a new model. The model contains all the current suggested edits, so unless you are starting a new document, the current model for the document should always be provided. This model can be retrieved from the editor at any time using the xref:#get_model[`getModel` API], and should be saved externally alongside the document.
106+
The {pluginname} plugin requires a model for storing suggestions. If a model is not provided in the editor configuration or is set to `+undefined+`, the plugin generates a new model. This model contains all current suggested edits. To maintain continuity across sessions, the current model for the document should always be supplied unless initializing a new document. The model can be retrieved from the editor at any time using the xref:#get_model[getModel API], and should be saved externally alongside the document.
109107

110108
Both the xref:#user_id[`+user_id+`] and xref:#fetch_users[`+fetch_users+`] options are required to configure the xref:userlookup.adoc[User Lookup API]. This API is used in the {pluginname} plugin to provide user information for each user who has made a change, allowing other users to see who made which suggestion.
111109

modules/ROOT/pages/userlookup.adoc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is useful when building features that rely on user context, such as comment
88

99
== Using the User Lookup API
1010

11-
Follow the steps below to configure and use the `userLookup` API within your integration.
11+
Follow the steps below to configure and use the `userLookup` API.
1212

1313
[[step-1-set-the-current-user]]
1414
=== 1. Set the current user ID
@@ -33,6 +33,7 @@ To simulate a backend lookup, define a local object that maps user IDs to their
3333

3434
include::partial$configuration/fetch_users.adoc[]
3535

36+
.Example
3637
[source,js]
3738
----
3839
const userDb = {
@@ -81,6 +82,7 @@ The returned array should include objects with:
8182

8283
Once the editor is initialized, use the API to look up multiple users:
8384

85+
.Example
8486
[source,js]
8587
----
8688
editor.on('init', () => {
@@ -103,13 +105,14 @@ NOTE: All lookups are cached. If a user has already been fetched, the same promi
103105
[[step-4-handle-missing-or-default-users]]
104106
=== 4. Handle default users if `fetch_users` is not provided
105107

106-
If no `fetch_users` function is configured, TinyMCE will return fallback users:
108+
If no `fetch_users` function is configured, {productname} will return fallback users:
107109

108110
* `name` will default to the ID
109111
* `avatar` will be a generated SVG using the first letter of the name
110112

111113
This is useful for simpler setups or prototyping.
112114

115+
.Example
113116
[source,js]
114117
----
115118
tinymce.init({
@@ -128,8 +131,7 @@ editor.on('init', () => {
128131
[[step-5-integrate-user-lookup-in-a-ui]]
129132
=== 5. Integrate User Lookup in a UI Button (Optional)
130133

131-
Here's how you might use the API to show the current user's name via a toolbar button.
132-
134+
. Example: Using the API to show the current user's name via a toolbar button.
133135
[source,js]
134136
----
135137
setup: (editor) => {
@@ -174,6 +176,7 @@ The `userLookup` API provides two main functions:
174176

175177
Each returned user object from `fetchUsers()` has the following structure:
176178

179+
.Example
177180
[source,js]
178181
----
179182
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
IMPORTANT: This option has been deprecated in {productname} 8.0 and may be removed in a future major {productname} release. Use a combination of `user_id` and `fetch_users` instead. | `xref:apis/tinymce.editor.userlookup.adoc[UserLookup]`
1+
IMPORTANT: This option has been deprecated in {productname} {productmajorversion} and may be removed in a future major {productname} release. Use a combination of `user_id` and `fetch_users` instead. | `xref:apis/tinymce.editor.userlookup.adoc[UserLookup]`

modules/ROOT/partials/configuration/suggestededits_content.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In a `'html'`-first approach, the editor loads content normally and the {pluginn
66

77
If a model is not provided the plugin will generate a new one from the initial content of the editor.
88

9-
When `suggestededits_content` is set to `'model'`, the plugin bypasses the editor's content load procedures and instead uses the `suggestededits_model` option to generate initial content. This would allow an integrator to only require the model for document tracking, and treat the editor content as simply a rendering of it.
9+
When `suggestededits_content` is set to `'model'`, the plugin bypasses the editor's content load procedures and instead uses the `suggestededits_model` option to generate the initial content. This would allow an integrator to only require the model for document tracking, and treat the editor content as simply a rendering of it.
1010

1111
If a model is not provided, the plugin will allow the editor to load content normally and generate a new model from there (the same way `html` works).
1212

modules/ROOT/partials/configuration/tinycomments_can_delete.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[tinycomments_can_delete]]
22
== `+tinycomments_can_delete+`
33

4-
_Optional_: This option sets the author permissions for _deleting comment conversations_. If the `+tinycomments_can_delete+` option is not included, the current author (`+user_id+`) cannot delete comment conversations created by other authors.
4+
_Optional_: This option sets the author permissions for _deleting comment conversations_. If the `+tinycomments_can_delete+` option is **not included**, the current author (`+user_id+`) cannot delete comment conversations created by other authors.
55

66
*Type:* `+Function+`
77

modules/ROOT/partials/configuration/tinycomments_can_delete_comment.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[tinycomments_can_delete_comment]]
22
== `+tinycomments_can_delete_comment+`
33

4-
_Optional_: This option sets the author permissions for _deleting comments_. If the `+tinycomments_can_delete_comment+` option is not included, the current author (`+user_id+`) **cannot** delete comments added by other authors.
4+
_Optional_: This option sets the author permissions for _deleting comments_. If the `+tinycomments_can_delete_comment+` option is **not included**, the current author (`+user_id+`) **cannot** delete comments added by other authors.
55

66
*Type:* `+Function+`
77

modules/ROOT/partials/configuration/tinycomments_can_edit_comment.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[tinycomments_can_edit_comment]]
22
== `+tinycomments_can_edit_comment+`
33

4-
_Optional_: This option sets the author permissions for _editing comments_. If the `+tinycomments_can_edit_comment+` option is not included, the current author (`+user_id+`) cannot edit comments added by other authors.
4+
_Optional_: This option sets the author permissions for _editing comments_. If the `+tinycomments_can_edit_comment+` option is **not included**, the current author (`+user_id+`) cannot edit comments added by other authors.
55

66
*Type:* `+Function+`
77

modules/ROOT/partials/events/suggestededits-events.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ The following events are provided by the xref:{plugincode}.adoc[{pluginname} plu
22

33
[cols="1,1,2",options="header"]
44
|===
5-
|Name |Data |Description
6-
|suggestededitsBeginReview. |N/A |The Suggested Edits view has opened.
7-
|suggestededitsReviewComplete |N/A |A review in the Suggested Edits view has been completed.
8-
|suggestededitsReviewCancelled |N/A |A review in the Suggested Edits view was cancelled.
5+
|Name |Data |Description
6+
|suggestededitsBeginReview |N/A |The Suggested Edits view has opened.
7+
|suggestededitsReviewComplete |N/A |A review in the Suggested Edits view has been completed.
8+
|suggestededitsReviewCancelled |N/A |A review in the Suggested Edits view was cancelled.
99
|===

modules/ROOT/partials/plugin-apis/suggestededits-apis.adoc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[cols="1,1,4",options="header"]
22
|===
3-
|Name |Arguments |Description
3+
|Name |Arguments |Description
44

55
|getModel |N/A |Returns a JSON object representing the document model and all suggested edits.
6-
|setModel | `+Object+` | Set the current model of the document.
7-
//|resetModel |N/A |Reset the document to its original state.
8-
|hasChanges |N/A |Return a boolean value indicating whether the document contains suggested edits.
6+
|setModel | `+Object+` | Sets the current model of the document.
7+
//|resetModel |N/A |Resets the document to its original state.
8+
|hasChanges |N/A |Returns a boolean value indicating whether the document contains any suggested edits.
99
|===
1010

1111
.Examples
@@ -22,7 +22,9 @@ tinymce.activeEditor.plugins.suggestededits.hasChanges();
2222
----
2323

2424
[[get_model]]
25-
.`getModel` Example
25+
== `getModel`
26+
27+
.Example
2628
[source,js]
2729
----
2830
const documentId = '<YOUR_DOCUMENT_ID>'; // Replace with your document ID
@@ -72,7 +74,9 @@ tinymce.init({
7274
----
7375

7476
[[set_model]]
75-
.`setModel` Example
77+
== `setModel`
78+
79+
.Example
7680
[source,js]
7781
----
7882
const documentIds = ['doc1', 'doc2', 'doc3']; // Example document IDs
@@ -114,7 +118,9 @@ tinymce.init({
114118
----
115119

116120
[[has_changes]]
117-
.`hasChanges` Example
121+
==`hasChanges`
122+
123+
.Example
118124
[source,js]
119125
----
120126
tinymce.init({

modules/ROOT/partials/toolbar-button-ids/suggestededits-toolbar-buttons.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
|===
33
|Toolbar button identifier |Description
44

5-
|`+suggestededits+` |Open the Review edits view.
5+
|`+suggestededits+` |Opens the Review edits view.
66
|`+suggestededits-label+` |Opens the Review edits view (this button uses text instead of an icon).
77
|===

0 commit comments

Comments
 (0)