Skip to content
Open
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
2 changes: 1 addition & 1 deletion antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ asciidoc:
companyurl: https://www.tiny.cloud
cdnurl: https://cdn.tiny.cloud/1/no-api-key/tinymce/8/tinymce.min.js
tdcdnurl: https://cdn.tiny.cloud/1/_your_api_key_/tinydrive/8/tinydrive.min.js
tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/8/tinymce.min.js
tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/8-dev/tinymce.min.js
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Revert before merging
Suggested change
tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/8-dev/tinymce.min.js
tinymce_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/8/tinymce.min.js

tinydrive_live_demo_url: https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinydrive/8/tinydrive.min.js
webcomponent_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-webcomponent/dist/tinymce-webcomponent.min.js
jquery_url: https://cdn.jsdelivr.net/npm/@tinymce/tinymce-jquery@2/dist/tinymce-jquery.min.js
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules/ROOT/pages/editor-command-identifiers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ include::partial$commands/tableofcontents-cmds.adoc[leveloffset=+3]
[[tinymceai]]
==== TinyMCE AI

The xref:tinymceai.adoc[TinyMCE AI (`+tinymceai+`)] plugin registers AI Chat and AI Review sidebars. The following subsection describes how to open and close them using a core editor command.
The xref:tinymceai.adoc[TinyMCE AI (`+tinymceai+`)] plugin registers AI Chat and AI Review sidebars, Quick Actions-related editor commands, and uses the core `+ToggleSidebar+` command for sidebar visibility. The following partial covers `+ToggleSidebar+`, floating-sidebar behavior, and plugin command names.

include::partial$commands/tinymceai-cmds.adoc[leveloffset=+3]

Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/tinymceai-actions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ tinymce.init({

[NOTE]
====
AI controls are not added to the xref:quickbars.adoc#quickbars_selection_toolbar[`+quickbars_selection_toolbar+`] automatically; add the desired toolbar button identifiers to that option when they should appear there.
AI controls are not added to the xref:quickbars.adoc#quickbars_selection_toolbar[`+quickbars_selection_toolbar+`] automatically; add the desired toolbar button identifiers to that option when they should appear there. Custom actions defined by xref:tinymceai.adoc#tinymceai_quickactions_custom[`+id+`] can also be listed in `+quickbars_selection_toolbar+`.

For example:

Expand Down
32 changes: 21 additions & 11 deletions modules/ROOT/pages/tinymceai-review.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ image::tinymceai/tinymce-ai-review-sidebar-command-categories-proofread-clarity.
[[integration]]
== Integration

To start using the Review feature, add `+tinymceai+` to the plugins option. This will automatically add the image:icons-premium/ai-review.svg[Review icon,24px] Review toolbar button and menu item to the default {productname} toolbar and menu.
To start using the Review feature, add `+tinymceai+` to the plugins configuration option. This will automatically add the image:icons-premium/ai-review.svg[Review icon,24px] Review toolbar button and menu item to the default {productname} toolbar and menu.

See xref:tinymceai.adoc[Plugin Reference] for more information regarding installation and enabling AI features.

Expand All @@ -42,7 +42,7 @@ While in the Review Mode, the editor remains read-only and allows browsing sugge

image::tinymceai/tinymce-ai-review-improve-readability-suggestion-cards-and-underlines.png[{pluginname} Review sidebar with suggestions,width=80%]

Review suggestions can be individually skipped or applied by clicking the corresponding buttons. Changes that were accepted or dismissed become greyed out in the interface. The "Complete" button in the top of the sidebar enables actions such as:
Review suggestions can be individually skipped or applied by clicking the corresponding buttons. Changes that were accepted or dismissed become grayed out in the interface. The "Complete" button in the top of the sidebar enables actions such as:

- Skipping or applying the remaining suggestions in bulk
- Completing the review with the currently applied suggestions (and skipping the rest)
Expand All @@ -67,16 +67,26 @@ Built-in system reviews are listed below. The **Editor** column is the label in

|**Adjust tone and style** |Tone Adjustment |Adjust tone and style. The editor includes _Casual_, _Direct_, _Friendly_, _Confident_, and _Professional_ options. |✓ |✓

|**Custom review** |— |xref:tinymceai-review.adoc#custom-review-choose-review[Custom review]: custom prompt and model; streams like other reviews. |✓ |✓ (custom review calls endpoint)

| |Translation |Translate between languages with cultural adaptation. | |✓
|===

[NOTE]
====
* A checkmark in the Editor UI column means that review type can appear in the Review sidebar when it is listed in xref:tinymceai.adoc#tinymceai_reviews[`tinymceai_reviews`].
* Custom reviews (analysis defined with a prompt) are available through the xref:tinymceai-review.adoc#reviews-custom-reviews[Custom reviews (API)]. _Note: The same capability in the Review sidebar is coming soon._
* xref:tinymceai-review.adoc#custom-review-choose-review[Custom review] is included in the Review sidebar by default. The xref:tinymceai-review.adoc#reviews-custom-reviews[Custom reviews (API)] section describes the REST endpoint used for the same streaming review flow.
* Translation Review is API-only (not listed in the Review sidebar); see the xref:tinymceai-review.adoc#built-in-reviews[Translation row] in the table above. For translation from the editor, see **Translate** in xref:tinymceai-actions.adoc#quick-actions-reference-table[Quick Actions reference table].
====

[[custom-review-choose-review]]
== Custom review

The Review sidebar includes a **Custom review** category by default. A natural-language prompt can be entered, and an AI model can be selected when xref:tinymceai.adoc#tinymceai_allow_model_selection[`tinymceai_allow_model_selection`] allows it; the review runs from **Run**. The document is analyzed with streaming suggestions like xref:tinymceai-review.adoc#review-sidebar-and-built-in-reviews[built-in reviews]; **Run** remains disabled until the prompt is entered and a model is selected. To hide Custom review, remove `+'ai-reviews-custom'+` from xref:tinymceai.adoc#tinymceai_reviews[`tinymceai_reviews`].

[TIP]
The backend uses the custom review call (`POST /v1/reviews/custom/calls`) with `content`, `prompt`, and `model` in the request body. After a run completes, **Retry** in the Review UI can re-run the last review with the same parameters for both system and custom reviews.

[[review-configuration]]
== Configuration

Expand All @@ -92,7 +102,7 @@ The Review plugin feature is built on top of the Reviews API, which provides RES
Reviews use streaming output with Server-Sent Events for real-time feedback as suggestions are generated. Each review type is optimized for specific improvement tasks, providing consistent, high-quality analysis of text structure, style, and quality. Reviews provide specific, actionable recommendations for content improvement.

[[reviews-system-reviews-api]]
=== System Reviews
=== System reviews

System reviews are default review operations for common use cases, which each use the AI agent most suitable for their functionality. The API includes one endpoint for running system reviews, which is passed the review name.

Expand All @@ -103,26 +113,26 @@ For endpoint details, request and response schemas, authentication, and streamin
[[reviews-custom-reviews]]
=== Custom reviews (API)

Integrators can also define custom reviews using the Custom Review API endpoint, which returns a output in a similar manner to system reviews but which takes a custom prompt to define the analysis behavior. Custom reviews can be as simple as checking for specific words or phrases, or as complex as applying a company style guide that includes business logic, specific terminology, and more.
Integrators can also call the Custom Review API endpoint directly. It streams suggestions in the same way as system reviews but takes a custom `prompt` (and `model`) with document `content` in the request body. Custom reviews can be as simple as checking for specific words or phrases, or as complex as applying a company style guide that includes business logic, specific terminology, and more.

See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the endpoint, parameters, and examples.
See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the endpoint, parameters, and examples.

The Review sidebar only exposes those built-in types for now; sidebar support for custom reviews is coming soon.
Users can also run custom reviews directly from the editor through the xref:tinymceai-review.adoc#custom-review-choose-review[Custom review] category in the Review sidebar.

Custom reviews require the `ai:reviews:custom` permission in the JWT token.

[[reviews-streaming]]
=== Streaming Responses
=== Streaming responses

Reviews use Server-Sent Events (SSE) for real-time streaming results. See the xref:tinymceai-streaming.adoc[Streaming Responses guide] for detailed implementation information.
Reviews use Server-Sent Events (SSE) for real-time streaming results. See the xref:tinymceai-streaming.adoc[Streaming responses guide] for detailed implementation information.

[[reviews-api-reference]]
=== API Reference
=== API reference

The https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] reference (interactive OpenAPI documentation) is the full source for endpoints, request and response schemas, authentication, system and custom review calls, worked examples, and streaming review responses.

[[related-features]]
== Related Features
== Related features

* xref:tinymceai-chat.adoc[AI chat]: For interactive discussions with document analysis and context.
* xref:tinymceai-actions.adoc[Quick actions]: Shortcuts to individual AI operations on a selection or range (transformations, translation, chat, and custom actions).
1 change: 0 additions & 1 deletion modules/ROOT/pages/tinymceai.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,3 @@ The {pluginname} plugin provides the following {productname} commands.

include::partial$commands/{plugincode}-cmds.adoc[]


61 changes: 59 additions & 2 deletions modules/ROOT/partials/commands/tinymceai-cmds.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[tinymceai-toggling-sidebars]]
.Toggling the AI Chat and AI Review sidebars
=== Toggling the AI Chat and AI Review sidebars

AI Chat and AI Review use sidebars registered by the plugin. To show or hide them programmatically, use the core `+ToggleSidebar+` command (listed in the xref:editor-command-identifiers.adoc#miscellaneous-core-commands[Miscellaneous Core Commands] table), not a command defined by the TinyMCE AI plugin. Pass the sidebar identifier as the third argument:
AI Chat and AI Review use sidebars registered by the plugin. To show or hide them programmatically, use the core `+ToggleSidebar+` command (listed in the xref:editor-command-identifiers.adoc#miscellaneous-core-commands[Miscellaneous Core Commands] table), not a command defined by the `+tinymceai+` plugin. Pass the sidebar identifier as the third argument:

* `+'tinymceai-chat'+` — AI Chat
* `+'tinymceai-review'+` — AI Review
Expand All @@ -18,3 +18,60 @@ tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-chat');
// Open the AI Review sidebar
tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-review');
----

[[tinymceai-floating-sidebar-api]]
=== Floating sidebar and `+ToggleSidebar+`

When xref:tinymceai.adoc#tinymceai_sidebar_type[`tinymceai_sidebar_type`] is `+'floating'+`, the core `+ToggleSidebar+` command, the `+ToggleSidebar+` event, and `+queryCommandValue('ToggleSidebar')+` work the same as for a static sidebar for `+'tinymceai-chat'+` and `+'tinymceai-review'+`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we even need to include this info I treated it more like a bug that we didn't fully support this API but maybe we could have general notes or some example on how to deal with these events and the query state in general not specifically for floating sidebars?


[[tinymceai-plugin-commands]]
=== TinyMCE AI plugin commands

The xref:tinymceai.adoc[`tinymceai`] plugin registers the following editor commands. They mirror the Quick Actions and related UI: each invocation returns immediately while the plugin performs any network and UI work asynchronously.

[cols="2,2,3",options="header"]
|===
|Command |Third argument |Description

|`+TinyMCEAIQuickActionImproveWriting+` | |Runs the **Improve writing** quick action.
|`+TinyMCEAIQuickActionContinueWriting+` | |Runs the **Continue writing** quick action.
|`+TinyMCEAIQuickActionCheckGrammar+` | |Runs the **Fix grammar** quick action.
|`+TinyMCEAIQuickActionMakeShorter+` | |Runs **Make shorter**.
|`+TinyMCEAIQuickActionMakeLonger+` | |Runs **Make longer**.
|`+TinyMCEAIQuickActionToneCasual+` | |Runs **More casual** tone.
|`+TinyMCEAIQuickActionToneDirect+` | |Runs **More direct** tone.
|`+TinyMCEAIQuickActionToneFriendly+` | |Runs **More friendly** tone.
|`+TinyMCEAIQuickActionToneConfident+` | |Runs **More confident** tone.
|`+TinyMCEAIQuickActionToneProfessional+` | |Runs **More professional** tone.
|`+TinyMCEAIQuickActionTranslate+` |`+string+` |Runs **Translate** with the given language label (same string family as xref:tinymceai.adoc#tinymceai_languages[`tinymceai_languages`] `+language+` values).
|`+TinyMCEAIQuickActionCustom+` |`+{ prompt, model }+` |Runs a custom quick action with the given prompt and model (same behavior as xref:tinymceai.adoc#tinymceai_quickactions_custom[`tinymceai_quickactions_custom`] preview actions).
|`+TinyMCEAIQuickActionsExplain+` | |Opens Chat with the built-in **Explain** prompt.
|`+TinyMCEAIQuickActionsSummarize+` | |Opens Chat with the built-in **Summarize** prompt.
|`+TinyMCEAIQuickActionsHighlightKeyPoints+` | |Opens Chat with the built-in **Highlight key points** prompt.
|`+TinyMCEAIChatPrompt+` |`+{ prompt, displayedPrompt? }+` |Opens the Chat sidebar if needed, then sends `+prompt+` to the back end. Optional `+displayedPrompt+` controls the label shown in the chat UI when it differs from the text sent to the model.
|===

[NOTE]
====
Command names use the `+TinyMCEAIQuickActions…+` prefix (with an `+s+`) for **Explain**, **Summarize**, and **Highlight key points** — these map to the xref:tinymceai.adoc#tinymceai_quickactions_chat_prompts[chat prompts] submenu, not to standalone `+TinyMCEAIQuickAction…+` spellings.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, right I wonder if this will be confusing not to have the s suffix but then again executing a command like TinyMCEAIQuickActionsCustom could be interpreted that you are executing multiple quick actions when we are just executing one. 🤔

====

.Example: translate and custom quick action
[source,js]
----
tinymce.activeEditor.execCommand('TinyMCEAIQuickActionTranslate', false, 'swedish');

tinymce.activeEditor.execCommand('TinyMCEAIQuickActionCustom', false, {
prompt: 'Uppercase text',
model: 'gpt-4.1'
});
----

.Example: chat prompt with a shorter label in the UI
[source,js]
----
tinymce.activeEditor.execCommand('TinyMCEAIChatPrompt', false, {
prompt: 'Explain the current selection in Klingon',
displayedPrompt: 'Explain'
});
----
45 changes: 42 additions & 3 deletions modules/ROOT/partials/configuration/tinymceai_options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ These options configure the AI Chat sidebar, where users have interactive conver

Populates the sources menu with submenus of files and web resources. Users can select these sources as additional context for chat conversations.

Takes a function that returns a Promise resolving to an array of additional context source groups. Each group has `+label+`, optional `+icon+`, and `+sources+` array. Each source has `+id+`, `+label+`, and `+type+` (`+'web-resource'+` or `+'file'+`). A source's `+id+` is used to fetch its content via xref:tinymceai.adoc#tinymceai_chat_fetch_source[`tinymceai_chat_fetch_source`].
Takes a function that returns a Promise resolving to an array of additional context source groups. Each group has `+label+`, optional `+icon+`, and `+sources+` array. Each source has `+id+`, `+label+`, and `+type+` (`+'web-resource'+` or `+'file'+`). A source's `+id+` is used to fetch its content through xref:tinymceai.adoc#tinymceai_chat_fetch_source[`tinymceai_chat_fetch_source`].

*Type:* `+Function+` (`+() => Promise<Array>+`)

Expand Down Expand Up @@ -255,7 +255,7 @@ tinymce.init({
[[tinymceai_chat_welcome_message]]
=== `+tinymceai_chat_welcome_message+`

Customises the welcome message displayed in the Chat sidebar when starting a new conversation.
Customizes the welcome message displayed in the Chat sidebar when starting a new conversation.

*Type:* `+String+`

Expand Down Expand Up @@ -440,6 +440,7 @@ Array of custom actions rendered in the Custom submenu within the AI Quick Actio
* `+prompt+`: The prompt sent to the AI
* `+type+`: `+'action'+` or `+'chat'+`
* `+model+`: Required for `+action+` type only
* `+id+` (optional): Stable identifier for the custom action. When set, the same string can be listed in xref:tinymceai.adoc#tinymceai_quickactions_menu[`tinymceai_quickactions_menu`] so the action appears as its own top-level menu item instead of only inside the Custom submenu. The identifier can also be used in xref:quickbars.adoc#quickbars_selection_toolbar[`+quickbars_selection_toolbar+`], the xref:menus-configuration-options.adoc#menu[`+menu+`] option, or any other toolbar or menu configuration that accepts control identifiers.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually only menu items. So the id makes it possible to use the custom menu item in any place we expect menu ids.


*Type:* `+Array+` of `+Object+`

Expand Down Expand Up @@ -474,6 +475,40 @@ tinymce.init({
});
----

.Example: custom actions as top-level Quick Actions menu items using `+id+`
[source,js]
----
tinymce.init({
selector: 'textarea',
plugins: 'quickbars tinymceai',
toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review',
quickbars_selection_toolbar: 'tinymceai-quickactions | bold italic',
tinymceai_quickactions_menu: [
'ai-quickactions-chat-prompts',
'ai-quote',
'ai-summarize'
],
tinymceai_quickactions_custom: [
{
id: 'ai-quote',
title: 'Add a quote from a famous person',
prompt: 'Add a quote from a known person, which would make sense in the context of the selected text.',
type: 'action',
model: 'gemini-2-5-flash'
},
{
id: 'ai-summarize',
title: 'Summarize in 5 bullet points',
prompt: 'Summarize the selected text in 5 bullet points.',
type: 'chat'
}
],
tinymceai_token_provider: () => {
return fetch('/api/token').then(r => r.json());
}
});
----

[[options-review]]
== Options for Review

Expand All @@ -493,6 +528,9 @@ Array of review command IDs that define which review types appear in the Review
* `+'ai-reviews-improve-readability'+`: Adjust sentence structure and word choice
* `+'ai-reviews-change-length'+`: Shorten or lengthen text
* `+'ai-reviews-change-tone'+`: Modify tone and style
* `+'ai-reviews-custom'+`: xref:tinymceai-review.adoc#custom-review-choose-review[Custom review] — accepts a prompt and model, then runs the same streaming preview and apply flow as other reviews

To hide Custom review from the Review sidebar, omit `+'ai-reviews-custom'+` from the array.

*Default value:*
[source,js]
Expand All @@ -502,7 +540,8 @@ Array of review command IDs that define which review types appear in the Review
'ai-reviews-improve-clarity',
'ai-reviews-improve-readability',
'ai-reviews-change-length',
'ai-reviews-change-tone'
'ai-reviews-change-tone',
'ai-reviews-custom'
]
----

Expand Down
Loading