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
15 changes: 15 additions & 0 deletions modules/ROOT/pages/8.11.0-release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ The {productname} {release-version} release includes an accompanying release of

For information on the **<Premium plugin name 1>** plugin, see: xref:<plugincode>.adoc[<Premium plugin name 1>].

=== TinyMCE AI

The {productname} {release-version} release includes an accompanying release of the **TinyMCE AI** premium plugin.

**TinyMCE AI** includes the following addition.

==== New `+TinyMCEAIDiscardSuggestions+` command to discard the AI suggestions previewed in an editor
// #TINYMCE-15157

Previously, integrations had no public way to discard the AI suggestions previewed in an editor. In decoupled mode, the **TinyMCE AI** plugin does not show its own confirmation dialog before the AI view closes, so an integration that detected pending suggestions could not complete its own prompt to discard them.

In {productname} {release-version}, the new `+TinyMCEAIDiscardSuggestions+` command discards the AI suggestions previewed in the editor it runs on, without applying any of them. The editor keeps the content it had before the preview, and returns to the editor mode it had before the preview. In a xref:tinymceai-multi-editor.adoc[multi-editor group], the command affects only the editor it runs on, so an integration runs the command on each editor in the group to discard every suggestion. For details, see xref:tinymceai.adoc#tinymceai-discard-suggestions[Discarding previewed suggestions].

For information on the **TinyMCE AI** plugin, see: xref:tinymceai.adoc[TinyMCE AI].


[[accompanying-premium-plugin-end-of-life-announcement]]
== Accompanying Premium plugin end-of-life announcement
Expand Down
22 changes: 22 additions & 0 deletions modules/ROOT/partials/commands/tinymceai-cmds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The xref:tinymceai.adoc[`tinymceai`] plugin registers the following editor comma
|`+TinyMCEAIReviewToneConfident+` | |Runs the **Adjust tone and style** review with the **Confident** tone.
|`+TinyMCEAIReviewToneProfessional+` | |Runs the **Adjust tone and style** review with the **Professional** tone.
|`+TinyMCEAIReviewCustom+` |`+String+`, `+{ prompt, model, name }+`, or `+{ id, value }+` |Runs a review from a custom prompt, or runs an xref:tinymceai.adoc#integrator-defined-reviews[integrator-defined review] by identifier. See <<tinymceai-review-custom-values,Values for `+TinyMCEAIReviewCustom+`>>.
|`+TinyMCEAIDiscardSuggestions+` | |Discards the AI suggestions previewed in the editor without applying them. See <<tinymceai-discard-suggestions,Discarding previewed suggestions>>.
|===

Each `+TinyMCEAIReview…+` command opens the Review sidebar and runs the review, with the same result as selecting that review in the sidebar. Running a review command while another review is in progress stops the earlier review and starts the requested one.
Expand Down Expand Up @@ -135,3 +136,24 @@ tinymce.activeEditor.execCommand('TinyMCEAIReviewCustom', false, {
----

When the value does not match any of these forms, {productname} logs an error to the browser console and runs no review. This also applies when the prompt or identifier is blank, when no integrator-defined review matches the identifier, when a `+list+` review value is not one of its options, and when an `+input+` review is run without a value.

[[tinymceai-discard-suggestions]]
=== Discarding previewed suggestions

include::partial$misc/admon-requires-8.11v.adoc[]

The `+TinyMCEAIDiscardSuggestions+` command discards the AI suggestions previewed in the editor, such as changes proposed in Chat or Review, without applying any of them. The editor keeps the content it had before the preview. If the editor mode changed while the preview was open, the command restores the mode the editor had before the preview. The command takes no third argument.

In a xref:tinymceai-multi-editor.adoc[multi-editor group], the command discards only the suggestions of the editor it runs on. The previews in the other editors of the group stay open, and the Review sidebar keeps the suggestions from those previews. To discard the suggestions of the whole group, run the command on each editor in the group.

.Example: discarding the suggestions previewed in every editor of a group
[source,js]
----
tinymce.get()
.filter((editor) => editor.options.get('tinymceai_group') === 'my-group')
.forEach((editor) => {
if (editor.queryCommandState('TinyMCEAIPreview')) {
editor.execCommand('TinyMCEAIDiscardSuggestions');
}
});
----
1 change: 1 addition & 0 deletions modules/ROOT/partials/misc/admon-requires-8.11v.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NOTE: This feature is only available for {productname} 8.11 and later.
Loading