Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tinymce.init({
selector: 'textarea#suggestededits-auto-approve',
height: 500,
plugins: 'suggestededits advlist anchor autolink code charmap emoticons fullscreen help image link lists media preview searchreplace table',
toolbar: 'undo redo | suggestededits | styles fontsizeinput | bold italic | align bullist numlist | table link image | code',
toolbar: 'undo redo | suggestededits suggestededits-tracking | styles fontsizeinput | bold italic | align bullist numlist | table link image | code',
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',

suggestededits_model: model,
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/examples/live-demos/suggestededits/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tinymce.init({
selector: 'textarea#suggestededits',
height: 500,
plugins: 'suggestededits advlist anchor autolink code charmap emoticons fullscreen help image link lists media preview searchreplace table',
toolbar: 'undo redo | suggestededits | styles fontsizeinput | bold italic | align bullist numlist | table link image | code',
toolbar: 'undo redo | suggestededits suggestededits-tracking | styles fontsizeinput | bold italic | align bullist numlist | table link image | code',
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',

suggestededits_model: model,
Expand Down
8 changes: 7 additions & 1 deletion modules/ROOT/pages/8.7.0-release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ Suggested Edits now records edits made with the xref:tinymceai.adoc[{productname

The `+suggestededits_model+` schema is now version 2. Models saved with version 1 are migrated automatically when loaded.

==== Suggested Edits API should not be tied to the existence of the suggested edits toolbar button
==== Tracking suggestions can now be toggled

Suggested Edits now supports toggling suggestion tracking while editing. The new `+suggestededits-tracking+` xref:suggestededits.adoc#toolbar-buttons[toolbar button] and xref:suggestededits.adoc#menu-items[menu item], along with the `+SuggestedEditsToggleTracking+` xref:suggestededits.adoc#commands[command], let users switch between tracking edits as suggestions or applying them directly to the content. The xref:suggestededits.adoc#suggestededits_auto_approve[`+suggestededits_auto_approve+`] configuration option now also controls their default state.

Because toggling tracking fundamentally changes the Suggested Edits experience, the button and menu item are not included by default. They must be explicitly added to the toolbar or menu in the editor configuration.

==== Suggested Edits `hasChanges` event now also fires when a review completes
// #TINYMCE-13256

Previously, the `SuggestedEditsHasChangesUpdate` event only fired alongside other editor events, such as typing, selecting, or focusing. Completing a review did not fire the event on its own, so the value returned by the `hasChanges` API could become outdated. As a result, any integration that relied upon the API would not receive an update when a review finished.
Expand Down
4 changes: 4 additions & 0 deletions modules/ROOT/partials/commands/suggestededits-cmds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
|===
|Command |Description
|suggestededits |Toggles the Suggested Edits view.
|suggestededitsToggleTracking |Toggles the tracking of suggested edits.
|===

.Example
[source,js]
----
tinymce.activeEditor.execCommand('suggestededits');
tinymce.activeEditor.execCommand('suggestededitsToggleTracking');

tinymce.activeEditor.queryCommandState('suggestededitsToggleTracking'); // Returns true if tracking of suggested edits is enabled, otherwise false.
----
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ When set to:
* `false`: All edits require manual approval before being applied.
* `true`: All new edits are automatically approved and applied.

NOTE: In {productname} 8.7, this option controls the default state of the `suggestededits-tracking` toolbar button and menu item. When set to `false`, the `suggestededits-tracking` button will be active by default and edits will appear in the review. When set to `true`, the button will be inactive by default, meaning edits will not appear in the review. Toggling the button or menu item will override the default state set by this option for the current session.

*Type:* `+Boolean+`

Expand All @@ -19,7 +20,7 @@ When set to:
tinymce.init({
selector: 'textarea#suggestededits', // Change this value according to your HTML
plugins: 'suggestededits',
toolbar: 'suggestededits',
toolbar: 'suggestededits suggestededits-tracking',
suggestededits_auto_approve: true, // Change this value to auto-approve suggested edits
});
----
Expand Down
1 change: 1 addition & 0 deletions modules/ROOT/partials/events/suggestededits-events.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ The following events are provided by the xref:{plugincode}.adoc[{pluginname} plu
|SuggestedEditsReviewComplete |N/A |A review in the Suggested Edits view has been completed.
|SuggestedEditsReviewCancelled |N/A |A review in the Suggested Edits view was cancelled.
|SuggestedEditsHasChangesUpdate |`+hasChanges+` |The Suggested Edits model is updated. The `+hasChanges+` data is a boolean value indicating whether there are suggestions to review.
|SuggestedEditsTrackingToggle |`+tracking+` |The tracking state of suggested edits has changed. The `+tracking+` data is a boolean value indicating whether edits are being tracked.
|===
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
|Menu item identifier |xref:menus-configuration-options.adoc#example-the-tinymce-default-menu-items[Default Menu Location] |Description

|`suggestededits` |View |Opens the Suggested Edits view.
|`suggestededits-tracking` |_Not Applicable_ |Toggles the tracking of suggested edits.
|===
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

|`+suggestededits+` |Opens the Review edits view.
|`+suggestededits-label+` |Opens the Review edits view (this button uses text instead of an icon).
|`+suggestededits-tracking+` |Toggles the tracking of suggested edits.
|===
Loading