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..b05a681c92 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,45 @@ // 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', + toolbar: 'undo redo | tinymceai-chat tinymceai-review ai-quickactions-translate | styles | bold italic underline | bullist numlist | link table', + menubar: false, tinymceai_sidebar_type: 'floating', - tinymceai_chat_welcome_message: '
Welcome to TinyMCE AI. Pick an action below or type your own prompt.
', + tinymceai_chat_welcome_message: 'Hi! I’m your writing assistant.
I can read and write across all three sections of this hiring pack — refine the role, generate interview questions, or draft notes for HR.
', + // 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: 'Draft notes for HR', + command: 'TinyMCEAIChatPrompt', + value: { + prompt: 'Based on the Role description and the Interview questions, draft additional notes for HR about scheduling and running the interviews for this role, and add them to the Notes for HR section.', + displayedPrompt: 'Draft notes for HR' + }, + icon: 'no-icon' + }, + { + title: 'Flag any unclear or biased wording', + command: 'TinyMCEAIChatPrompt', + value: { + prompt: 'Check all three 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 +86,28 @@ 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', + sidebar_show: 'tinymceai-chat', + 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-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.' }); 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-notes-for-hr', + height: '260px', + tinymceai_group: 'hiring-pack', + tinymceai_document_name: 'Notes for HR', + tinymceai_document_description: 'Notes for the HR team about scheduling and running the hiring process for the role.' }); 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..9c8b98d8a4 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,26 @@ -