diff --git a/modules/ROOT/examples/live-demos/tinymceai-multi-editor-groups/example.js b/modules/ROOT/examples/live-demos/tinymceai-multi-editor-groups/example.js index 1e6f3cbbe6..632c15fa93 100644 --- a/modules/ROOT/examples/live-demos/tinymceai-multi-editor-groups/example.js +++ b/modules/ROOT/examples/live-demos/tinymceai-multi-editor-groups/example.js @@ -5,14 +5,13 @@ const sharedSettings = { height: '400px', plugins: ['tinymceai', 'advlist', 'lists', 'link', 'autolink', 'table', 'wordcount'], toolbar: 'undo redo | tinymceai-chat tinymceai-review ai-quickactions-translate | styles | bold italic | bullist numlist | link', - tinymceai_sidebar_type: 'floating', tinymceai_chat_welcome_message: '
Welcome to TinyMCE AI. Pick an action below or type your own prompt.
', tinymceai_chat_welcome_actions: [ { text: 'Here are some actions to get started:' }, { title: 'Summarize the document', command: 'TinyMCEAIQuickActionsSummarize' }, { title: 'Continue writing', command: 'TinyMCEAIQuickActionContinueWriting' }, { title: 'Translate to Spanish', command: 'TinyMCEAIQuickActionTranslate', value: 'spanish' }, - { title: 'Review my document', command: 'ToggleSidebar', value: 'tinymceai-review' } + { title: 'Review my document', command: 'TinyMCEAIToggleApp', value: 'tinymceai-review', icon: 'ai-review' } ], tinymceai_token_provider: async () => { return fetch('/api/tinymceai-token', { credentials: 'include' }) @@ -58,11 +57,12 @@ const sharedSettings = { ] }; -// Group 1: the Introduction and Native integration editors share one AI sidebar. +// Group 1: the Introduction and Native integration editors share AI Chat and AI Review in one panel. tinymce.init({ ...sharedSettings, selector: 'textarea#tinymceai-multi-editor-groups-introduction', tinymceai_group: 'article-opening', + tinymceai_decoupled_container: '#tinymceai-multi-editor-groups-opening-panel', // Decoupled mode: each group renders AI Chat and AI Review in its own panel. tinymceai_document_name: 'Introduction', tinymceai_document_description: 'The introduction of the article. A title, a short paragraph that sets out the topic, and a figure.' }); @@ -71,15 +71,17 @@ tinymce.init({ ...sharedSettings, selector: 'textarea#tinymceai-multi-editor-groups-native-integration', tinymceai_group: 'article-opening', + tinymceai_decoupled_container: '#tinymceai-multi-editor-groups-opening-panel', // Decoupled mode: each group renders AI Chat and AI Review in its own panel. tinymceai_document_name: 'Native integration', tinymceai_document_description: 'The section on moving from external AI tools to AI built into the editor, with a bulleted list of benefits.' }); -// Group 2: the Workflow comparison and Adoption challenges editors share a separate AI sidebar and never see the content of group 1. +// Group 2: the Workflow comparison and Adoption challenges editors share a separate panel and never see the content of group 1. tinymce.init({ ...sharedSettings, selector: 'textarea#tinymceai-multi-editor-groups-workflow-comparison', tinymceai_group: 'article-analysis', + tinymceai_decoupled_container: '#tinymceai-multi-editor-groups-analysis-panel', // Decoupled mode: each group renders AI Chat and AI Review in its own panel. tinymceai_document_name: 'Workflow comparison', tinymceai_document_description: 'The section that compares traditional and AI-enhanced workflows. Keep the comparison table.' }); @@ -88,6 +90,7 @@ tinymce.init({ ...sharedSettings, selector: 'textarea#tinymceai-multi-editor-groups-adoption-challenges', tinymceai_group: 'article-analysis', + tinymceai_decoupled_container: '#tinymceai-multi-editor-groups-analysis-panel', // Decoupled mode: each group renders AI Chat and AI Review in its own panel. tinymceai_document_name: 'Adoption challenges', tinymceai_document_description: 'The closing section on adoption challenges. Two short paragraphs.' }); diff --git a/modules/ROOT/examples/live-demos/tinymceai-multi-editor-groups/index.html b/modules/ROOT/examples/live-demos/tinymceai-multi-editor-groups/index.html index a64691acbf..a99124eb07 100644 --- a/modules/ROOT/examples/live-demos/tinymceai-multi-editor-groups/index.html +++ b/modules/ROOT/examples/live-demos/tinymceai-multi-editor-groups/index.html @@ -1,7 +1,9 @@ -article-openingarticle-analysisWelcome to TinyMCE AI. Pick an action below or type your own prompt.
', tinymceai_chat_welcome_actions: [ @@ -62,7 +61,7 @@ const sharedSettings = { { title: 'Summarize the document', command: 'TinyMCEAIQuickActionsSummarize' }, { title: 'Continue writing', command: 'TinyMCEAIQuickActionContinueWriting' }, { title: 'Translate to Spanish', command: 'TinyMCEAIQuickActionTranslate', value: 'spanish' }, - { title: 'Review my document', command: 'ToggleSidebar', value: 'tinymceai-review' } + { title: 'Review my document', command: 'TinyMCEAIToggleApp', value: 'tinymceai-review', icon: 'ai-review' } ], toolbar_mode: 'sliding', visual: false, @@ -126,12 +125,13 @@ const sharedSettings = { ] }; -// Group 1: the Introduction and Native integration editors share one AI sidebar. +// Group 1: the Introduction and Native integration editors share AI Chat and AI Review in one panel. tinymce.init({ ...sharedSettings, selector: 'textarea#tinymceai-multi-editor-groups-introduction', revisionhistory_fetch: createRevisionHistoryFetch('textarea#tinymceai-multi-editor-groups-introduction'), tinymceai_group: 'article-opening', + tinymceai_decoupled_container: '#tinymceai-multi-editor-groups-opening-panel', // Decoupled mode: each group renders AI Chat and AI Review in its own panel. tinymceai_document_name: 'Introduction', tinymceai_document_description: 'The introduction of the article. A title, a short paragraph that sets out the topic, and a figure.' }); @@ -141,16 +141,18 @@ tinymce.init({ selector: 'textarea#tinymceai-multi-editor-groups-native-integration', revisionhistory_fetch: createRevisionHistoryFetch('textarea#tinymceai-multi-editor-groups-native-integration'), tinymceai_group: 'article-opening', + tinymceai_decoupled_container: '#tinymceai-multi-editor-groups-opening-panel', // Decoupled mode: each group renders AI Chat and AI Review in its own panel. tinymceai_document_name: 'Native integration', tinymceai_document_description: 'The section on moving from external AI tools to AI built into the editor, with a bulleted list of benefits.' }); -// Group 2: the Workflow comparison and Adoption challenges editors share a separate AI sidebar and never see the content of group 1. +// Group 2: the Workflow comparison and Adoption challenges editors share a separate panel and never see the content of group 1. tinymce.init({ ...sharedSettings, selector: 'textarea#tinymceai-multi-editor-groups-workflow-comparison', revisionhistory_fetch: createRevisionHistoryFetch('textarea#tinymceai-multi-editor-groups-workflow-comparison'), tinymceai_group: 'article-analysis', + tinymceai_decoupled_container: '#tinymceai-multi-editor-groups-analysis-panel', // Decoupled mode: each group renders AI Chat and AI Review in its own panel. tinymceai_document_name: 'Workflow comparison', tinymceai_document_description: 'The section that compares traditional and AI-enhanced workflows. Keep the comparison table.' }); @@ -160,6 +162,7 @@ tinymce.init({ selector: 'textarea#tinymceai-multi-editor-groups-adoption-challenges', revisionhistory_fetch: createRevisionHistoryFetch('textarea#tinymceai-multi-editor-groups-adoption-challenges'), tinymceai_group: 'article-analysis', + tinymceai_decoupled_container: '#tinymceai-multi-editor-groups-analysis-panel', // Decoupled mode: each group renders AI Chat and AI Review in its own panel. tinymceai_document_name: 'Adoption challenges', tinymceai_document_description: 'The closing section on adoption challenges. Two short paragraphs.' }); diff --git a/modules/ROOT/examples/live-demos/tinymceai-multi-editor/example.js b/modules/ROOT/examples/live-demos/tinymceai-multi-editor/example.js index 59f9baea49..ed69220da5 100644 --- a/modules/ROOT/examples/live-demos/tinymceai-multi-editor/example.js +++ b/modules/ROOT/examples/live-demos/tinymceai-multi-editor/example.js @@ -1,18 +1,39 @@ // Open-source plugins below are only for editing the demo HTML (lists, links, tables). TinyMCE AI options are the focus. // Share one TinyMCE AI configuration between every editor in the group. const sharedSettings = { - height: '400px', - plugins: ['tinymceai', 'advlist', 'lists', 'link', 'autolink', 'table', 'wordcount'], - toolbar: 'undo redo | tinymceai-chat tinymceai-review ai-quickactions-translate | styles | bold italic | bullist numlist | link', - tinymceai_sidebar_type: 'floating', - tinymceai_chat_welcome_message: 'Welcome to TinyMCE AI. Pick an action below or type your own prompt.
', + plugins: ['tinymceai', 'advlist', 'lists', 'link', 'autolink', 'table'], + toolbar: 'undo redo | tinymceai-chat tinymceai-review ai-quickactions-translate | styles | bold italic underline | bullist numlist | link table', + menubar: false, + help_accessibility: false, + // Decoupled mode: AI Chat and AI Review render in the panel next to the editors instead of in a sidebar. + tinymceai_decoupled_container: '#tinymceai-multi-editor-panel', + tinymceai_decoupled_show: 'tinymceai-chat', + tinymceai_chat_welcome_message: 'Hi! I’m your writing assistant.
I can read and write across both sections of this hiring pack — refine the role or generate interview questions.
', + // Every welcome action uses the empty 'no-icon' icon registered in setup, so the buttons show text only. tinymceai_chat_welcome_actions: [ - { text: 'Here are some actions to get started:' }, - { title: 'Summarize the document', command: 'TinyMCEAIQuickActionsSummarize' }, - { title: 'Continue writing', command: 'TinyMCEAIQuickActionContinueWriting' }, - { title: 'Translate to Spanish', command: 'TinyMCEAIQuickActionTranslate', value: 'spanish' }, - { title: 'Review my document', command: 'ToggleSidebar', value: 'tinymceai-review' } + { text: '**Try one of these:**' }, + { + title: 'Suggest more interview questions', + command: 'TinyMCEAIChatPrompt', + value: { + prompt: 'Based on the Role description, suggest three or four more interview questions and add them to the end of the numbered list in the Interview questions section. Match the style of the existing questions.', + displayedPrompt: 'Suggest more interview questions' + }, + icon: 'no-icon' + }, + { + title: 'Flag any unclear or biased wording', + command: 'TinyMCEAIChatPrompt', + value: { + prompt: 'Check both sections of this hiring pack for unclear or biased wording. For each phrase, explain the problem and suggest clearer, more inclusive wording.', + displayedPrompt: 'Flag any unclear or biased wording' + }, + icon: 'no-icon' + } ], + setup: (editor) => { + editor.ui.registry.addIcon('no-icon', ''); + }, tinymceai_token_provider: async () => { return fetch('/api/token', { credentials: 'include' }) .then(resp => resp.text()) @@ -59,16 +80,18 @@ const sharedSettings = { tinymce.init({ ...sharedSettings, - selector: 'textarea#tinymceai-multi-editor-introduction', - tinymceai_group: 'article', - tinymceai_document_name: 'Introduction', - tinymceai_document_description: 'The introduction of the article. A title, a short paragraph that sets out the topic, and a figure.' + selector: 'textarea#tinymceai-multi-editor-role-description', + height: '270px', + tinymceai_group: 'hiring-pack', + tinymceai_document_name: 'Role description', + tinymceai_document_description: 'The job advert for the role: the job title and location, what the role involves, and the requirements for candidates.' }); tinymce.init({ ...sharedSettings, - selector: 'textarea#tinymceai-multi-editor-body', - tinymceai_group: 'article', - tinymceai_document_name: 'Body', - tinymceai_document_description: 'The main body of the article. Uses h2 and h3 subheadings, short paragraphs, a bulleted list, and a comparison table.' + selector: 'textarea#tinymceai-multi-editor-interview-questions', + height: '340px', + tinymceai_group: 'hiring-pack', + tinymceai_document_name: 'Interview questions', + tinymceai_document_description: 'The interview guide for the role: a heading followed by a numbered list of interview questions.' }); diff --git a/modules/ROOT/examples/live-demos/tinymceai-multi-editor/index.html b/modules/ROOT/examples/live-demos/tinymceai-multi-editor/index.html index 6c2a5ef576..d788dbe648 100644 --- a/modules/ROOT/examples/live-demos/tinymceai-multi-editor/index.html +++ b/modules/ROOT/examples/live-demos/tinymceai-multi-editor/index.html @@ -1,62 +1,33 @@ -