diff --git a/modules/ROOT/examples/live-demos/suggestededits-auto-approve/index.js b/modules/ROOT/examples/live-demos/suggestededits-auto-approve/index.js index d0885abd23..c555ac1526 100644 --- a/modules/ROOT/examples/live-demos/suggestededits-auto-approve/index.js +++ b/modules/ROOT/examples/live-demos/suggestededits-auto-approve/index.js @@ -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, diff --git a/modules/ROOT/examples/live-demos/suggestededits/index.js b/modules/ROOT/examples/live-demos/suggestededits/index.js index 6f1d8b92de..e8a9c99ea5 100644 --- a/modules/ROOT/examples/live-demos/suggestededits/index.js +++ b/modules/ROOT/examples/live-demos/suggestededits/index.js @@ -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, diff --git a/modules/ROOT/pages/8.7.0-release-notes.adoc b/modules/ROOT/pages/8.7.0-release-notes.adoc index b5d8bc15cc..656780ad44 100644 --- a/modules/ROOT/pages/8.7.0-release-notes.adoc +++ b/modules/ROOT/pages/8.7.0-release-notes.adoc @@ -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. diff --git a/modules/ROOT/partials/commands/suggestededits-cmds.adoc b/modules/ROOT/partials/commands/suggestededits-cmds.adoc index 5ac738e8ff..4a6f353caf 100644 --- a/modules/ROOT/partials/commands/suggestededits-cmds.adoc +++ b/modules/ROOT/partials/commands/suggestededits-cmds.adoc @@ -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. ---- diff --git a/modules/ROOT/partials/configuration/suggestededits_auto_approve.adoc b/modules/ROOT/partials/configuration/suggestededits_auto_approve.adoc index 928ddd7358..f9b560aa40 100644 --- a/modules/ROOT/partials/configuration/suggestededits_auto_approve.adoc +++ b/modules/ROOT/partials/configuration/suggestededits_auto_approve.adoc @@ -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+` @@ -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 }); ---- diff --git a/modules/ROOT/partials/events/suggestededits-events.adoc b/modules/ROOT/partials/events/suggestededits-events.adoc index 094c76c1fc..48233cabc1 100644 --- a/modules/ROOT/partials/events/suggestededits-events.adoc +++ b/modules/ROOT/partials/events/suggestededits-events.adoc @@ -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. |=== \ No newline at end of file diff --git a/modules/ROOT/partials/menu-item-ids/suggestededits-menu-items.adoc b/modules/ROOT/partials/menu-item-ids/suggestededits-menu-items.adoc index d45e2420b5..f6c9324b04 100644 --- a/modules/ROOT/partials/menu-item-ids/suggestededits-menu-items.adoc +++ b/modules/ROOT/partials/menu-item-ids/suggestededits-menu-items.adoc @@ -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. |=== \ No newline at end of file diff --git a/modules/ROOT/partials/toolbar-button-ids/suggestededits-toolbar-buttons.adoc b/modules/ROOT/partials/toolbar-button-ids/suggestededits-toolbar-buttons.adoc index 83f8b4fb4c..7d766a3c2b 100644 --- a/modules/ROOT/partials/toolbar-button-ids/suggestededits-toolbar-buttons.adoc +++ b/modules/ROOT/partials/toolbar-button-ids/suggestededits-toolbar-buttons.adoc @@ -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. |=== \ No newline at end of file