Skip to content
Draft
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
4 changes: 4 additions & 0 deletions modules/ROOT/examples/live-demos/tinymceai/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<textarea id="tinymceai">
<h1 style="font-size: 1.5em; color: black; margin-top: 0; text-align: left;">TinyMCE AI</h1>
<p style="font-size: 1em; color: #333; margin: 15px 0;">TinyMCE AI provides AI-powered features including AI chat, AI review, and quick actions.</p>
</textarea>
6 changes: 6 additions & 0 deletions modules/ROOT/examples/live-demos/tinymceai/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tinymce.init({
selector: 'textarea#tinymceai',
height: '800px',
plugins: ["tinymceai", "advlist", "anchor", "autolink", "charmap", "code"],
toolbar: "undo redo | tinymceai | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
});
28 changes: 28 additions & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,34 @@
**** xref:ai-bedrock.adoc[Amazon Bedrock integration guide]
**** xref:ai-gemini.adoc[Google Gemini integration guide]
**** xref:ai-proxy.adoc[AI proxy server reference guide]
*** TinyMCE AI
**** xref:tinymceai-introduction.adoc[Introduction]
***** xref:tinymceai-chat.adoc[Chat]
***** xref:tinymceai-review-plugin.adoc[Review]
***** xref:tinymceai-actions-plugin.adoc[Actions]
***** xref:tinymceai-integration.adoc[Integration]
***** xref:tinymceai-integration-options.adoc[Integration Options]
****** xref:tinymceai.adoc[Plugin quick start]
****** REST API
******* xref:tinymceai-api-overview.adoc[API Overview]
******* xref:tinymceai-api-quick-start.adoc[API quick start]
******* Features
******** xref:tinymceai-conversations.adoc[Conversations]
******** xref:tinymceai-reviews.adoc[Reviews]
******** xref:tinymceai-actions.adoc[Actions]
******* Configuration
******** xref:tinymceai-models.adoc[AI models]
******** xref:tinymceai-permissions.adoc[Permissions]
******** xref:tinymceai-limits.adoc[Limits]
******** xref:tinymceai-streaming.adoc[Streaming]
******* Integration
******** xref:tinymceai-api-overview.adoc#data-handling-and-security[Data Handling and Security]

******** xref:tinymceai-api-overview.adoc#security-features[Security]
******** xref:tinymceai-api-overview.adoc#on-premises-deployment[On-premises deployment]
***** JWT Authentication
****** xref:tinymceai-with-jwt-authentication-nodejs.adoc[JWT authentication (Node.js)]
****** xref:tinymceai-with-jwt-authentication-php.adoc[JWT authentication (PHP)]
*** xref:casechange.adoc[Case Change]
*** xref:checklist.adoc[Checklist]
*** Comments
Expand Down
6 changes: 6 additions & 0 deletions modules/ROOT/pages/available-menu-items.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ include::partial$misc/plugin-menu-item-id-boilerplate.adoc[]
:plugincode: ai
include::partial$misc/plugin-menu-item-id-boilerplate.adoc[]

:plugincategory: premium
:pluginname: TinyMCE AI
:plugincode: tinymceai
:pluginpage: tinymceai.adoc
include::partial$misc/plugin-menu-item-id-boilerplate.adoc[]

:plugincategory: opensource
:pluginname: Anchor
:plugincode: anchor
Expand Down
6 changes: 6 additions & 0 deletions modules/ROOT/pages/available-toolbar-buttons.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]
:plugincode: ai
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]

:plugincategory: premium
:pluginname: TinyMCE AI
:plugincode: tinymceai
:pluginpage: tinymceai.adoc
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]

:plugincategory: premium
:pluginname: Enhanced Code Editor
:plugincode: advcode
Expand Down
8 changes: 8 additions & 0 deletions modules/ROOT/pages/editor-command-identifiers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ Commands are available for the following plugins:
* xref:advancedlists[Advanced Lists]
* xref:Enhanced Tables[Enhanced Tables]
* xref:anchor[Anchor]
* xref:tinymceai[TinyMCE AI]
* xref:autoresize[Autoresize]
* xref:casechange[Case Change]
* xref:charactermap[Character Map]
Expand Down Expand Up @@ -525,6 +526,13 @@ The following commands require the xref:tableofcontents.adoc[Table of Contents (

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

[[tinymceai]]
==== TinyMCE AI

The following commands require the xref:tinymceai.adoc[TinyMCE AI (`+tinymceai+`)] plugin.

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

[[advtemplate]]
==== Templates

Expand Down
8 changes: 8 additions & 0 deletions modules/ROOT/pages/events.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ The following plugins provide events.
* xref:a11ychecker-events[Accessibility Checker events]
* xref:autosave-events[Autosave events]
* xref:character-map-events[Character Map events]
* xref:tinymceai-events[TinyMCE AI events]
* xref:comments-events[Comments events]
* xref:format-painter-events[Format Painter events]
* xref:fullscreen-events[Fullscreen events]
Expand Down Expand Up @@ -292,6 +293,13 @@ The following event is provided by the xref:charmap.adoc[Character Map plugin].
|InsertCustomChar |`+{ chr: string }+` |Fired before a special character is inserted into the editor.
|===

[[tinymceai-events]]
=== TinyMCE AI events

The following events are provided by the xref:tinymceai.adoc[TinyMCE AI plugin].

include::partial$events/tinymceai-events.adoc[]

[[comments-events]]
=== Comments events

Expand Down
183 changes: 183 additions & 0 deletions modules/ROOT/pages/tinymceai-actions-plugin.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
= TinyMCE AI Quick Actions

:navtitle: Quick Actions
:description: quick actions feature for TinyMCE AI plugin
:description_short: quick actions feature
:keywords: AI, quick actions, actions, tinymceai

Quick actions streamline routine content transformations by offering one-click AI-powered suggestions directly within the editor. You can also ask questions about your selected text in AI chat to get instant AI insights and analysis. This feature enhances speed, relevance, and usability, particularly for repeatable or simple tasks. The feature comes with an easy-to-use window interface but can also act as a conversation starter with the xref:tinymceai-chat.adoc[Chat].
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Quick actions streamline routine content transformations by offering one-click AI-powered suggestions directly within the editor. You can also ask questions about your selected text in AI chat to get instant AI insights and analysis. This feature enhances speed, relevance, and usability, particularly for repeatable or simple tasks. The feature comes with an easy-to-use window interface but can also act as a conversation starter with the xref:tinymceai-chat.adoc[Chat].
Quick actions streamline routine content transformations by offering one-click AI-powered suggestions directly within the editor. This feature enhances speed, relevance, and usability, particularly for repeatable or simple tasks. The feature comes with an easy-to-use window interface but can also act as a conversation starter with the xref:tinymceai-chat.adoc[Chat].

that sentence is about chat, not quick actions.


[[demo]]
== Demo

liveDemo::tinymceai[]

[[overview]]
== Overview

Actions are fast, stateless operations that transform content directly. Unlike Reviews that provide suggestions, Actions immediately modify your content based on the selected operation.

**When to use Actions vs Reviews:** Use Actions when you need to transform specific text content (fix grammar, translate, adjust tone). Use Reviews when you need to analyze entire documents for quality improvements and get suggestions without automatically changing the content.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as before - Instead of "specific text content" should we say something like a selection or a small section or something? Since Quick Actions work on selections specifically.


image::https://placehold.net/default.png[TinyMCE AI quick actions showing AI-powered suggestions and Q&A functionality]

[[integration]]
== Integration

To start using the Quick Actions feature, first load the TinyMCE AI plugin in your editor configuration. xref:tinymceai-integration.adoc[Learn more about installing and enabling AI features].

Then, you can add the menu that opens the list of Quick Actions (`tinymceai-actions`) image:https://placehold.net/default.png[Quick Actions icon,24px] to your main toolbar and/or balloon toolbar configurations. To learn more about toolbar configuration, refer to the xref:toolbar-configuration-options.adoc[toolbar configuration] guide.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "balloon toolbar" the equiv of our context toolbars? I assume so. Also want to check if we add the AI features to the selection toolbar by default if the plugin is enabled - Idk if we're doing that currently


image::https://placehold.net/default.png[TinyMCE AI Quick Actions dropdown in the toolbar]

Finally, you can also add individual Quick Actions to the toolbar as shortcuts for even easier access. For example, you can add the `ask-ai` image:https://placehold.net/default.png[Ask AI icon,24px] button, or the `improve-writing` image:https://placehold.net/default.png[Improve Writing icon,24px] button (find it in the demo above). You can add whole categories to the toolbar, too. xref:tinymceai-actions-plugin.adoc#default-actions[Learn more about available actions].

The final example configuration looks as follows:

[source,js]
----
tinymce.init({
selector: '#editor',
plugins: 'tinymceai',
tinymceai_token_provider: function() {
return fetch('/api/token').then(response => response.text());
},

// Adding Quick Actions to the main editor toolbar.
toolbar: [
// The main Quick Actions button
'tinymceai-actions',

// Two individual actions
'ask-ai',
'improve-writing',

// Whole action category
'translate',

// ... other toolbar items
],

// Adding Quick Actions to the balloon toolbar. Since some of the actions are selection-sensitive,
// accessing them might be easier for users using this kind of toolbar.
quickbars_selection_toolbar: 'tinymceai-actions | ask-ai | improve-writing | translate'
});
----

[[types-of-actions]]
== Types of actions

There are two types of actions available in the quick actions feature:

* Some actions, for instance, "Ask AI" or "Summarize", lead to the xref:tinymceai-chat.adoc[Chat] interface with selected text added as context. The former will just open the Chat and allow you to start typing your message. The latter, however, will not only open the Chat but also start the conversation for your current editor selection right away, and expect a summary of that selection from the AI.

* Executing other actions like "Continue writing" or "Make shorter" will open the window interface conveniently right next to your selection and present the answers from the AI for you to accept or reject them.
Copy link
Contributor

Choose a reason for hiding this comment

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

pretty sure our UI ended up being a bit different for this


You can define the behavior of each action when you xref:tinymceai-actions-plugin.adoc#custom-actions[create custom ones].

[[default-actions]]
== Default Actions

By default, the Quick Actions feature includes several built-in actions that speed up the content editing process. All Quick Actions can be accessed through the menu button image:https://placehold.net/default.png[Quick Actions icon,24px] (`tinymceai-actions`) but also individually when handpicked by the integrator in the xref:toolbar-configuration-options.adoc[editor toolbar configuration]. You can add the whole action categories to the toolbar too.

Keep in mind that you can xref:tinymceai-actions-plugin.adoc#custom-actions[add custom actions] to the list and xref:tinymceai-actions-plugin.adoc#removing-default-actions[remove defaults].

Here's the full list of available actions:

* `'ask-ai'`
* **"Chat commands"** category (`'chat-commands'`)
** `'explain'`
** `'summarize'`
** `'highlight-key-points'`
* `'improve-writing'`
* `'continue'`
* `'fix-grammar'`
* **"Adjust length"** category (`'adjust-length'`)
** `'make-shorter'`
** `'make-longer'`
* **"Change tone"** category (`'change-tone'`)
** `'make-tone-casual'`
** `'make-tone-direct'`
** `'make-tone-friendly'`
** `'make-tone-confident'`
** `'make-tone-professional'`
* **"Translate"** category (`'translate'`)
** `'translate-to-english'`
** `'translate-to-chinese'`
** `'translate-to-french'`
** `'translate-to-german'`
** `'translate-to-italian'`
** `'translate-to-portuguese'`
** `'translate-to-russian'`

[[custom-actions]]
== Custom Actions

The `tinymceai_actions_extraCommands` configuration property allows you to add new commands to the Quick actions feature. Below, you will find an example of three extra actions added to the user interface: two of them open the quick actions window, but the last one interacts with AI chat. Learn more about xref:tinymceai-actions-plugin.adoc#types-of-actions[types of actions].
Copy link
Contributor

Choose a reason for hiding this comment

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

tinymceai_custom_commands


[source,js]
----
tinymce.init({
selector: '#editor',
plugins: 'tinymceai',
toolbar: 'tinymceai-actions',
tinymceai_token_provider: function() {
return fetch('/api/token').then(response => response.text());
},
tinymceai_actions_extraCommands: [
{
id: 'add-quote-from-famous-person',
displayedPrompt: '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: 'agent-1'
},
{
id: 'summarize-in-bullet-points',
displayedPrompt: 'Summarize in 5 bullet points',
prompt: 'Summarize the selected text in 5 bullet points.',
type: 'CHAT'
},
{
id: 'include-more-sarcasm',
displayedPrompt: 'Rewrite adding more sarcasm',
prompt: 'Rewrite using a sarcastic tone.',
type: 'ACTION',
model: 'agent-1'
}

// ... More commands ...
]
});
----

[[removing-default-actions]]
== Removing default actions
Copy link
Contributor

Choose a reason for hiding this comment

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

we let people configure the list instead of them having to specify which to remove. option is. tinymceai_quickactions_menu for the main menu, then any sub menus have their own option (tone, length, etc)


The `tinymceai_actions_removeCommands` configuration property allows you to remove existing commands from the Quick actions feature. Here's an example that removes two actions ("Explain" and "Summarize"):

[source,js]
----
tinymce.init({
selector: '#editor',
plugins: 'tinymceai',
toolbar: 'tinymceai-actions',
tinymceai_token_provider: function() {
return fetch('/api/token').then(response => response.text());
},
tinymceai_actions_removeCommands: [
'explain',
'summarize'

// ... More commands to remove ...
]
});
----

[[related-features]]
== Related Features

* xref:tinymceai-chat.adoc[AI chat] – For interactive discussions with document analysis and context.
* xref:tinymceai-review-plugin.adoc[AI review] – For content quality analysis and improvement suggestions.
* xref:tinymceai-actions.adoc[Actions API] – For API-level action functionality.
* xref:tinymceai-introduction.adoc[Introduction] – Overview of all TinyMCE AI features.
Loading
Loading