diff --git a/-scripts/README-llm-files.md b/-scripts/README-llm-files.md new file mode 100644 index 0000000000..32216b49fe --- /dev/null +++ b/-scripts/README-llm-files.md @@ -0,0 +1,131 @@ +# Generating LLM Files + +This directory contains scripts to automatically generate `llms.txt` and `llms-full.txt` files for LLM consumption. + +## Overview + +The LLM files provide structured documentation references that help AI assistants: +- Find the correct documentation pages +- Understand the documentation structure +- Reduce hallucinations by providing accurate URLs +- Discover all available integration options + +## Files + +- `generate-llm-files.js` - Node.js script that generates the LLM files +- `generate-llm-files.sh` - Shell wrapper script for easier execution + +## Usage + +### Option 1: After Local Build + +1. Build the documentation site: + ```bash + yarn antora ./antora-playbook.yml + ``` + +2. Generate LLM files from local sitemap: + ```bash + yarn generate-llm-files + # or + ./-scripts/generate-llm-files.sh + ``` + +### Option 2: From Remote Sitemap + +Generate directly from the published sitemap (useful for syncing with production): + +```bash +yarn generate-llm-files-from-url +# or +node ./-scripts/generate-llm-files.js https://www.tiny.cloud/docs/antora-sitemap.xml +``` + +### Option 3: Custom Sitemap Source + +```bash +node ./-scripts/generate-llm-files.js /path/to/sitemap.xml +# or +node ./-scripts/generate-llm-files.js https://example.com/sitemap.xml +``` + +## Workflow + +### Manual Regeneration (Current Approach) + +**After major/minor/patch releases:** +1. Run the script to regenerate files from production sitemap: + ```bash + yarn generate-llm-files-from-url + ``` + This ensures the LLM files match what's actually published on the live site. + + Alternatively, if you need to generate from a local build: + ```bash + yarn generate-llm-files + ``` +2. Review the generated files in a PR +3. Commit and merge + +**Why not automated in CI/CD?** +- The script makes 400+ HTTP requests to fetch H1 titles (~4-5 minutes) +- Resource-intensive and slow for every build +- Manual review ensures quality before committing +- Validates no 404s are listed and titles match actual page content + +### File Locations + +The files are generated in `modules/ROOT/attachments/`: +- `llms.txt` - Simplified, curated documentation index (~105 lines) +- `llms-full.txt` - Complete documentation index with all pages (~700 lines) + +**Post-build:** Files are moved to the root directory (handled in separate PR) and accessible at: +- `https://www.tiny.cloud/docs/tinymce/latest/llms.txt` +- `https://www.tiny.cloud/docs/llms-full.txt` + +## How It Works + +1. **Reads sitemap.xml** - Extracts all documentation URLs from the sitemap (only `/latest/` URLs) +2. **Fetches H1 titles** - Makes HTTP requests to each page to get the actual H1 title (validates no 404s) +3. **Generates titles** - Uses fetched H1 titles, falls back to URL-based titles if fetch fails +4. **Categorizes pages** - Groups by topic (integrations, plugins, API, etc.) based on URL patterns +5. **Deduplicates** - Removes duplicate URLs and makes titles unique within categories +6. **Generates structured markdown** - Creates both simplified (`llms.txt`) and complete (`llms-full.txt`) indexes + +## Customization + +The script uses hardcoded categorization logic. To customize: + +1. Edit `generate-llm-files.js` +2. Modify the `categorizeUrl()` function to adjust categorization +3. Update `generateLLMsTxt()` and `generateLLMsFullTxt()` to change output format + +## Notes + +- The script requires Node.js and `sanitize-html` package (installed via `yarn install`) +- Generated files are written to `modules/ROOT/attachments/` +- Uses only the sitemap (no dependency on `nav.adoc`) +- Fetches actual H1 titles from pages (validates no 404s) +- Rate-limited fetching: 10 concurrent requests with 100ms delay between batches +- Request timeout: 10 seconds per page +- Security: Validates URLs to prevent SSRF attacks (only allows tiny.cloud domains) +- Handles HTML entity decoding (`’` → `'`) +- Filters out error pages and duplicate URLs +- Makes titles unique within categories (e.g., "ES6 and npm (Webpack)", "ES6 and npm (Rollup)") +- Falls back to URL-based title generation if H1 fetch fails + +## Troubleshooting + +**Error: "Source not found"** +- Make sure the sitemap path is correct +- For remote URLs, check your internet connection +- For local files, ensure Antora has generated the site first + +**Missing page titles** +- If H1 fetch fails, the script uses URL-based title generation as fallback +- Check that pages return valid HTML with H1 tags +- 404 pages are automatically filtered out + +**Incorrect categorization** +- Review the `categorizeUrl()` function (note: function name is singular, not plural) +- Add custom patterns for new page types diff --git a/-scripts/generate-llm-files.js b/-scripts/generate-llm-files.js new file mode 100755 index 0000000000..5eafb7c8cc --- /dev/null +++ b/-scripts/generate-llm-files.js @@ -0,0 +1,1226 @@ +#!/usr/bin/env node + +/** + * Script to generate llms.txt and llms-full.txt files from sitemap.xml + * + * Usage: + * node -scripts/generate-llm-files.js [sitemap-path-or-url] + * + * Defaults to build/site/sitemap.xml (local) or can use remote URL + */ + +const fs = require('fs'); +const path = require('path'); +const https = require('https'); +const http = require('http'); +const sanitizeHtml = require('sanitize-html'); + +const BASE_URL = 'https://www.tiny.cloud/docs/tinymce/latest'; +const DOCS_ROOT_URL = 'https://www.tiny.cloud/docs'; +const OUTPUT_DIR = path.join(__dirname, '../modules/ROOT/attachments'); + +// Fetch sitemap from URL or file +async function getSitemap(source) { + if (source.startsWith('http://') || source.startsWith('https://')) { + return new Promise((resolve, reject) => { + const client = source.startsWith('https') ? https : http; + client.get(source, (res) => { + let data = ''; + res.on('data', (chunk) => { data += chunk; }); + res.on('end', () => resolve(data)); + }).on('error', reject); + }); + } else { + // Validate file path to prevent path traversal + const resolvedPath = path.resolve(source); + const projectRoot = path.resolve(__dirname, '..'); + + // Ensure the resolved path is within the project directory + if (!resolvedPath.startsWith(projectRoot)) { + throw new Error(`Invalid sitemap path: ${source}. Path must be within the project directory.`); + } + + if (!fs.existsSync(resolvedPath)) { + throw new Error(`Sitemap not found: ${source}\nPlease run 'yarn antora ./antora-playbook.yml' first to generate the site, or provide a URL.`); + } + + // Only allow .xml files + if (!resolvedPath.endsWith('.xml')) { + throw new Error(`Invalid file type: ${source}. Only .xml files are allowed.`); + } + + return fs.readFileSync(resolvedPath, 'utf8'); + } +} + +// Parse sitemap.xml to extract all URLs +function parseSitemap(xmlContent) { + const urlSet = new Set(); + const urlRegex = /(.*?)<\/loc>/g; + let match; + + while ((match = urlRegex.exec(xmlContent)) !== null) { + let url = match[1].trim(); + // Normalize URLs (ensure trailing slash consistency) + if (url.includes('/latest/')) { + // Remove trailing slash for consistency + url = url.replace(/\/$/, '') + '/'; + urlSet.add(url); + } + } + + // Convert to sorted array + return Array.from(urlSet).sort(); +} + +// Extract URL path from full URL +function getUrlPath(url) { + const match = url.match(/\/latest\/(.+?)\/?$/); + return match ? match[1].replace(/\/$/, '') : ''; +} + +// Fetch H1 title from a page URL +async function fetchH1Title(url) { + return new Promise((resolve) => { + // Validate URL to prevent SSRF - only allow tiny.cloud domains + if (!url.startsWith('https://www.tiny.cloud/') && !url.startsWith('http://www.tiny.cloud/')) { + resolve(null); + return; + } + + const client = url.startsWith('https') ? https : http; + + // codeql[js/file-access-to-http]: URL is validated to only allow tiny.cloud domains, preventing SSRF attacks + const req = client.get(url, (res) => { + // Check for error status codes (404, 500, etc.) + if (res.statusCode >= 400) { + resolve(null); + return; + } + + let data = ''; + + res.on('data', (chunk) => { data += chunk; }); + + res.on('end', () => { + try { + // Extract H1 tag using regex - look for

or

+ const h1Match = data.match(/]*>(.*?)<\/h1>/i); + + if (h1Match && h1Match[1]) { + // Clean up the title using a well-tested HTML sanitization library + let title = h1Match[1]; + + // First, use sanitize-html to strip all HTML tags and attributes while preserving text. + // This avoids fragile hand-written tag parsing and multi-character sanitization pitfalls. + title = sanitizeHtml(title, { + allowedTags: [], + allowedAttributes: {}, + textFilter: (text) => text + }); + + // Then, defensively remove any remaining angle brackets and script/protocol keywords + // to ensure no HTML-like or script-related fragments remain. + title = title + .replace(/[<>]/g, '') + .replace(/(?:javascript|data|vbscript)\s*:?/gi, '') + .replace(/\bscript\b/gi, '') + .trim(); + + // At this point, title is plain text with no angle brackets or script/protocol keywords + // Additionally, defensively strip any residual script/protocol keywords that could + // be used for injection even after angle brackets and colons have been removed + title = title.replace(/\b(?:script|javascript|vbscript|data)\b/gi, ''); + + // Decode HTML entities safely - decode all entities to plain text + // Order matters: decode '&' last to avoid double-unescaping + // Decode all specific entities first, then & at the end + title = title + .replace(/ /g, ' ') + .replace(/"/g, '"') + .replace(/'/g, "'") + .replace(/’/g, "'") // Right single quotation mark (apostrophe) + .replace(/‘/g, "'") // Left single quotation mark + .replace(/“/g, '"') // Left double quotation mark + .replace(/”/g, '"') // Right double quotation mark + .replace(/–/g, '–') // En dash + .replace(/—/g, '—') // Em dash + .replace(/ /g, ' ') // Non-breaking space + // Decode numeric entities ({ format) - safe as we've already removed HTML tags + .replace(/&#(\d+);/g, (match, dec) => { + const code = parseInt(dec, 10); + // Only decode safe character codes (printable ASCII and valid Unicode) + if ((code >= 32 && code <= 126) || (code >= 160 && code <= 1114111)) { + return String.fromCharCode(code); + } + return match; // Keep entity if unsafe + }) + // Decode hex entities ( format) + .replace(/&#x([0-9a-fA-F]+);/gi, (match, hex) => { + const code = parseInt(hex, 16); + // Only decode safe character codes + if ((code >= 32 && code <= 126) || (code >= 160 && code <= 1114111)) { + return String.fromCharCode(code); + } + return match; // Keep entity if unsafe + }) + // Decode remaining named entities (after numeric/hex to avoid conflicts) + .replace(/</g, '<') // Safe: HTML tags already removed + .replace(/>/g, '>') // Safe: HTML tags already removed + .replace(/&/g, '&') // Decode '&' last to prevent double-unescaping + .trim(); + + // Remove extra whitespace + title = title.replace(/\s+/g, ' '); + + // Filter out error page titles + const errorPatterns = [ + /couldn't find the page/i, + /page not found/i, + /404/i, + /error/i, + /not found/i + ]; + + if (errorPatterns.some(pattern => pattern.test(title))) { + resolve(null); + return; + } + + if (title) { + resolve(title); + } else { + resolve(null); + } + } else { + // Fallback to generated title if no H1 found + resolve(null); + } + } catch (error) { + // If parsing fails, fallback to generated title + resolve(null); + } + }); + }); + + req.on('error', (error) => { + // If fetch fails, fallback to generated title + resolve(null); + }); + + req.setTimeout(10000, () => { + req.destroy(); + resolve(null); + }); + }); +} + +// Batch fetch H1 titles with rate limiting +async function fetchH1TitlesBatch(urls, batchSize = 10, delay = 100) { + const results = new Map(); + + for (let i = 0; i < urls.length; i += batchSize) { + const batch = urls.slice(i, i + batchSize); + const promises = batch.map(async (url) => { + const title = await fetchH1Title(url); + return { url, title }; + }); + + const batchResults = await Promise.all(promises); + batchResults.forEach(({ url, title }) => { + results.set(url, title); + }); + + // Rate limiting - wait between batches + if (i + batchSize < urls.length) { + await new Promise(resolve => setTimeout(resolve, delay)); + } + } + + return results; +} + +// Generate a descriptive title from URL path +// NOTE: This script does A LOT of string matching against URL paths. If you encounter +// weirdness (e.g. wrong titles, wrong categories), search for the relevant path strings +// in this file to locate and fix the matching logic. +function generateTitleFromPath(urlPath) { + if (!urlPath) return 'Home'; + + const pathTitleMap = { + '': 'Home', + 'index': 'Home', + 'getting-started': 'Getting Started', + 'introduction-to-tinymce': 'Introduction to TinyMCE', + 'installation': 'Installation', + 'cloud-quick-start': 'Cloud Quick Start', + 'npm-projects': 'NPM Projects Quick Start', + 'zip-install': 'ZIP Installation Quick Start', + 'installation-cloud': 'Cloud', + 'installation-self-hosted': 'Self-hosted', + 'installation-zip': 'ZIP', + 'basic-setup': 'Basic Setup', + 'work-with-plugins': 'Using plugins to extend TinyMCE', + 'filter-content': 'Content Filtering', + 'content-filtering': 'Content filtering', + 'localize-your-language': 'Localization', + 'spell-checking': 'Spell Checking', + 'editor-content-css': 'CSS for rendering content', + 'url-handling': 'URL Handling', + 'plugins': 'Plugins', + 'table': 'Table', + 'table-options': 'Table options', + 'image': 'Image', + 'link': 'Link', + 'lists': 'Lists', + 'code': 'Code', + 'codesample': 'Code Sample', + 'advtable': 'Enhanced Tables', + 'advcode': 'Enhanced Code Editor', + 'editimage': 'Image Editing', + 'linkchecker': 'Link Checker', + 'a11ychecker': 'Accessibility Checker', + 'upgrading': 'Upgrading TinyMCE', + 'migration-guides': 'Migration Guides Overview', + 'migration-from-7x': 'Migration from 7.x', + 'migration-from-6x': 'Migration from 6.x', + 'migration-from-6x-to-8x': 'Migration from 6.x to 8.x', + 'migration-from-5x': 'Migration from 5.x', + 'migration-from-5x-to-8x': 'Migration from 5.x to 8.x', + 'migration-from-4x': 'Migration from 4.x', + 'migration-from-4x-to-8x': 'Migration from 4.x to 8.x', + 'migration-from-froala': 'Migrating from Froala', + 'examples': 'Examples', + 'how-to-guides': 'How To Guides', + 'release-notes': 'Release Notes', + 'changelog': 'Changelog', + 'accessibility': 'Accessibility', + 'security': 'Security guide', + 'support': 'Support', + 'react': 'React', + 'react-cloud': 'React Cloud', + 'react-pm-host': 'React Package Manager', + 'react-pm-bundle': 'React Package Manager (with bundling)', + 'react-zip-host': 'React ZIP', + 'react-zip-bundle': 'React ZIP (with bundling)', + 'react-ref': 'Technical reference (React)', + 'vue': 'Vue.js', + 'vue-cloud': 'Vue Cloud', + 'vue-pm': 'Vue Package Manager', + 'vue-pm-bundle': 'Vue Package Manager (with bundling)', + 'vue-zip': 'Vue ZIP', + 'vue-ref': 'Technical reference (Vue)', + 'angular': 'Angular', + 'angular-cloud': 'Angular Cloud', + 'angular-pm': 'Angular Package Manager', + 'angular-pm-bundle': 'Angular Package Manager (with bundling)', + 'angular-zip': 'Angular ZIP', + 'angular-zip-bundle': 'Angular ZIP (with bundling)', + 'angular-ref': 'Technical reference (Angular)', + 'blazor': 'Blazor', + 'blazor-cloud': 'Blazor Cloud', + 'blazor-pm': 'Blazor Package Manager', + 'blazor-zip': 'Blazor ZIP', + 'blazor-ref': 'Technical reference (Blazor)', + 'svelte': 'Svelte', + 'svelte-cloud': 'Svelte Cloud', + 'svelte-pm': 'Svelte Package Manager', + 'svelte-pm-bundle': 'Svelte Package Manager (with bundling)', + 'svelte-zip': 'Svelte ZIP', + 'svelte-ref': 'Technical reference (Svelte)', + 'webcomponent': 'Web Component', + 'webcomponent-cloud': 'Web Component Cloud', + 'webcomponent-pm': 'Web Component Package Manager', + 'webcomponent-zip': 'Web Component ZIP', + 'webcomponent-ref': 'Technical reference (Web Component)', + 'jquery': 'jQuery', + 'jquery-cloud': 'jQuery Cloud', + 'jquery-pm': 'jQuery Package Manager', + 'django': 'Django', + 'django-cloud': 'Django Cloud', + 'django-zip': 'Django ZIP', + 'laravel': 'Laravel', + 'laravel-tiny-cloud': 'Laravel Cloud', + 'laravel-composer-install': 'Laravel Composer', + 'laravel-zip-install': 'Laravel ZIP', + 'rails': 'Ruby on Rails', + 'rails-cloud': 'Rails Cloud', + 'rails-third-party': 'Rails Package Manager', + 'rails-zip': 'Rails ZIP', + 'expressjs-pm': 'Node.js + Express', + 'bootstrap': 'Bootstrap', + 'bootstrap-cloud': 'Bootstrap Cloud', + 'bootstrap-zip': 'Bootstrap ZIP', + 'php-projects': 'PHP Projects', + 'dotnet-projects': '.NET Projects', + 'wordpress': 'WordPress', + 'shadow-dom': 'Shadow DOM', + 'swing': 'Java Swing' + }; + + if (pathTitleMap[urlPath]) { + return pathTitleMap[urlPath]; + } + + // Handle release notes + if (urlPath.match(/^\d+\.\d+\.\d+-release-notes$/)) { + const version = urlPath.replace('-release-notes', ''); + return `TinyMCE ${version}`; + } + + // Handle bundling entries (order matters: more specific keys first) + const bundlingTitles = { + 'webpack-cjs-npm': 'CommonJS and NPM (Webpack)', + 'webpack-es6-npm': 'ES6 and NPM (Webpack)', + 'webpack-cjs-download': 'CommonJS and a .zip archive (Webpack)', + 'webpack-es6-download': 'ES6 and a .zip archive (Webpack)', + 'rollup-es6-npm': 'ES6 and npm (Rollup)', + 'rollup-es6-download': 'ES6 and a .zip archive (Rollup)', + 'vite-es6-npm': 'ES6 and NPM (Vite)', + 'browserify-cjs-npm': 'CommonJS and npm (Browserify)', + 'browserify-cjs-download': 'CommonJS and a .zip archive (Browserify)' + }; + const bundlingMatch = Object.keys(bundlingTitles).find((k) => urlPath.includes(k)); + if (bundlingMatch) { + return bundlingTitles[bundlingMatch]; + } + + // Handle API references + if (urlPath.startsWith('apis/')) { + const apiPath = urlPath.replace('apis/', ''); + return apiPath.split('/').pop().replace(/\.adoc$/, ''); + } + + // Convert kebab-case to Title Case + const words = urlPath + .replace(/-/g, ' ') + .split(' ') + .map(word => { + // Handle acronyms + if (word.toLowerCase() === 'npm' || word.toLowerCase() === 'cjs' || word.toLowerCase() === 'es6') { + return word.toUpperCase(); + } + return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); + }); + + return words.join(' '); +} + +// Categorize URL based on path +function categorizeUrl(urlPath) { + // Getting Started & Installation + if (urlPath.startsWith('getting-started') || + urlPath === 'introduction-to-tinymce' || + urlPath.startsWith('installation') || + urlPath === 'cloud-quick-start' || + urlPath === 'npm-projects' || + urlPath === 'zip-install' || + urlPath === 'invalid-api-key' || + urlPath === 'usage-based-billing') { + return { category: 'Getting Started & Installation', subcategory: null }; + } + + // Framework Integrations - Frontend + if (urlPath.match(/^(react|vue|angular|blazor|svelte|webcomponent|jquery)/) && + !urlPath.includes('-ref')) { + return { category: 'Framework Integrations', subcategory: 'Frontend Frameworks' }; + } + + // Framework Integrations - Backend + if (urlPath.match(/^(django|laravel|rails|express)/)) { + return { category: 'Framework Integrations', subcategory: 'Backend Frameworks' }; + } + + // Framework Integrations - Other + if (urlPath.startsWith('bootstrap') || urlPath.startsWith('php') || + urlPath.startsWith('dotnet') || urlPath.startsWith('wordpress') || + urlPath.startsWith('shadow-dom') || urlPath === 'swing') { + return { category: 'Framework Integrations', subcategory: 'Other Integrations' }; + } + + // Framework Integrations - Technical References + if (urlPath.includes('-ref')) { + return { category: 'Framework Integrations', subcategory: 'Technical References' }; + } + + // Configuration & Setup + const configPrefixes = [ + 'basic-setup', 'work-with-plugins', 'filter-content', 'content-filtering', + 'localize', 'content-localization', 'spell-checking', 'editor-', 'content-', + 'dialog-', 'menus-configuration', 'toolbar-configuration', 'statusbar', 'ui-mode', + 'initial-configuration', 'editor-important', 'editor-size', 'editor-save', + 'editor-model', 'editor-command', 'editor-context-menu', 'editor-icon-identifiers', + 'available-menu-items', 'available-toolbar-buttons', 'editor-icons', 'editor-skin', + 'editor-theme', 'editor-content-css', 'url-handling', 'tinymce-and-csp', + 'tinymce-and-cors', 'cloud-deployment-guide', 'editor-and-features', 'features-only', + 'editor-plugin-version', 'plugin-editor-version', 'cloud-troubleshooting', + 'multiple-editors', 'understanding-editor-loads' + ]; + if (configPrefixes.some((p) => urlPath.startsWith(p)) || urlPath === 'events') { + return { category: 'Configuration & Setup', subcategory: null }; + } + + // Plugins & Features - Core Plugins + const corePluginPaths = new Set([ + 'plugins', 'table', 'table-options', 'image', 'link', 'lists', 'code', 'codesample', + 'autolink', 'anchor', 'autosave', 'charmap', 'checklist', 'directionality', + 'emoticons', 'fullscreen', 'help', 'insertdatetime', 'nonbreaking', 'pagebreak', + 'preview', 'save', 'searchreplace', 'visualblocks', 'visualchars', 'wordcount', + 'advlist', 'contextmenu', 'contexttoolbar', 'quickbars', 'advanced-templates', + 'fullpagehtml', 'importcss', 'importword', 'media', 'pageembed', 'paste', + 'textcolor', 'colorpicker', 'textpattern', 'hr', 'print', 'spellchecker', + 'tabfocus', 'autoresize', 'markdown', 'math', 'mentions', 'permanentpen', + 'contextform', 'context', + 'advtable', 'advcode', 'editimage', 'linkchecker', 'a11ychecker', 'casechange', + 'footnotes', 'formatpainter', 'tableofcontents', 'advanced-typography', 'typography', + 'mergetags', 'accordion', 'introduction-to-mediaembed', 'file-image-upload' + ]); + if (corePluginPaths.has(urlPath) || urlPath.startsWith('upload-')) { + return { category: 'Plugins & Features', subcategory: 'Core Plugins' }; + } + + // Plugins & Features - Editor Modes + if (urlPath.startsWith('use-tinymce-') || urlPath === 'inline-editor-options') { + return { category: 'Plugins & Features', subcategory: 'Editor Modes' }; + } + + // Plugins & Features - Spell Checking + if (urlPath === 'introduction-to-tiny-spellchecker' || + urlPath.startsWith('autocorrect') || urlPath.startsWith('spelling') || + urlPath.startsWith('custom-dictionaries') || urlPath.startsWith('individual-spelling') || + urlPath.startsWith('configure-spelling') || urlPath.startsWith('self-hosting-hunspell')) { + return { category: 'Plugins & Features', subcategory: 'Spell Checking' }; + } + + // Premium Features - AI Features + if (urlPath === 'ai' || urlPath.startsWith('ai-')) { + return { category: 'Premium Features', subcategory: 'AI Features' }; + } + + // Premium Features - Comments & Collaboration + if (urlPath.startsWith('comments-') || urlPath === 'introduction-to-tiny-comments' || + urlPath === 'annotations' || urlPath === 'suggestededits' || urlPath === 'revisionhistory') { + return { category: 'Premium Features', subcategory: 'Comments & Collaboration' }; + } + + // Premium Features - Export & Import + if (urlPath === 'exportpdf' || urlPath === 'exportword' || urlPath === 'importword' || + urlPath.startsWith('html-to-') || urlPath.startsWith('docx-to-') || + urlPath.startsWith('export-to-') || urlPath.startsWith('import-from-')) { + return { category: 'Premium Features', subcategory: 'Export & Import' }; + } + + // Premium Features - PowerPaste + if (urlPath === 'introduction-to-powerpaste' || urlPath.startsWith('powerpaste')) { + return { category: 'Premium Features', subcategory: 'PowerPaste' }; + } + + // Premium Features - TinyDrive + if (urlPath.startsWith('tinydrive-') || urlPath === 'tinydrive-introduction' || + urlPath === 'introduction-to-tinydrive-apis') { + return { category: 'Premium Features', subcategory: 'TinyDrive' }; + } + + // Premium Features - Media Optimizer + if (urlPath.startsWith('uploadcare')) { + return { category: 'Premium Features', subcategory: 'Media Optimizer' }; + } + + // Premium Features - Services & Infrastructure + if (urlPath.startsWith('individual-') || urlPath.startsWith('configure-') || + urlPath.startsWith('mediaembed-server') || urlPath === 'license-key' || + urlPath === 'generate-rsa-key-pairs' || urlPath === 'troubleshoot-server') { + return { category: 'Premium Features', subcategory: 'Services & Infrastructure' }; + } + + // Customization & Development - Creating Custom Components + if (urlPath.startsWith('creating-') || urlPath.startsWith('custom-') || + urlPath === 'dialog' || urlPath === 'ui-components' || urlPath === 'customize-ui') { + return { category: 'Customization & Development', subcategory: 'Creating Custom Components' }; + } + + // Customization & Development - Bundling & Build Tools + if (urlPath.startsWith('bundle-') || urlPath.startsWith('bundling-') || + urlPath.startsWith('webpack-') || urlPath.startsWith('rollup-') || + urlPath.startsWith('browserify-') || urlPath.startsWith('vite-') || + urlPath === 'bundle-intro-setup' || urlPath === 'plugin-editor-version-compatibility' || + urlPath === 'introduction-to-bundling-tinymce') { + return { category: 'Customization & Development', subcategory: 'Bundling & Build Tools' }; + } + + // Customization & Development - Dialog & UI Components + if (urlPath.startsWith('dialog-') && !urlPath.startsWith('dialog-configuration')) { + return { category: 'Customization & Development', subcategory: 'Dialog & UI Components' }; + } + + // Customization & Development - Enhanced Skins & Icons + if (urlPath.startsWith('enhanced-skins') || urlPath.startsWith('using-the-icon-pack') || + urlPath.startsWith('custom-icon-pack')) { + return { category: 'Customization & Development', subcategory: 'Enhanced Skins & Icons' }; + } + + // API Reference (order matters: first match wins) + const apiSubcategoryPatterns = [ + ['tinymce.editor', 'Core APIs'], + ['tinymce.plugin', 'Core APIs'], + ['tinymce.theme', 'Core APIs'], + ['tinymce.root', 'Core APIs'], + ['tinymce.addonmanager', 'Core APIs'], + ['tinymce.editormanager', 'Core APIs'], + ['tinymce.editormode', 'Core APIs'], + ['tinymce.editoroptions', 'Core APIs'], + ['tinymce.editorupload', 'Core APIs'], + ['windowmanager', 'UI APIs'], + ['notificationmanager', 'UI APIs'], + ['shortcuts', 'UI APIs'], + ['editor.ui', 'UI APIs'], + ['dom.', 'DOM APIs'], + ['html.', 'HTML APIs'], + ['geom.', 'Geometry APIs'], + ['util.', 'Utility APIs'], + ['env', 'Utility APIs'], + ['event', 'Utility APIs'], + ['undomanager', 'Utility APIs'], + ['formatter', 'Utility APIs'], + ['annotator', 'Utility APIs'], + ['userlookup', 'Utility APIs'], + ['fakeclipboard', 'Utility APIs'] + ]; + if (urlPath.startsWith('apis/')) { + const match = apiSubcategoryPatterns.find(([pattern]) => urlPath.includes(pattern)); + return { + category: 'API Reference', + subcategory: match ? match[1] : 'Core APIs' + }; + } + + // Migration Guides + if (urlPath.includes('migration') || urlPath === 'upgrading') { + return { category: 'Migration Guides', subcategory: null }; + } + + // Examples & Demos + if (urlPath.startsWith('examples') || urlPath.startsWith('how-to-guides') || + urlPath.startsWith('basic-example') || urlPath.includes('-demo')) { + return { category: 'Examples & Demos', subcategory: null }; + } + + // Release Information + if (urlPath.includes('release-notes') || urlPath.includes('changelog') || + urlPath.match(/\d+\.\d+\.\d+-release-notes/)) { + return { category: 'Release Information', subcategory: null }; + } + + // Accessibility & Security + if (urlPath.startsWith('accessibility') || urlPath.startsWith('tinymce-and-screenreaders') || + urlPath.startsWith('security') || urlPath.startsWith('tinymce-for-mobile') || + urlPath.startsWith('shortcuts') || urlPath.startsWith('keyboard-shortcuts')) { + return { category: 'Accessibility & Security', subcategory: null }; + } + + // Support & Resources + if (urlPath === 'support' || urlPath === 'index' || urlPath.startsWith('promotions') || + urlPath.startsWith('tiny-docs-ai')) { + return { category: 'Support & Resources', subcategory: null }; + } + + // Legacy & Other + if (urlPath === 'moxiemanager' || urlPath === 'php-upload-handler' || + urlPath.startsWith('ie-template-creation')) { + return { category: 'Legacy & Other', subcategory: null }; + } + + // Everything else + return { category: 'Other', subcategory: null }; +} + +// Make titles unique within a category +function makeTitlesUnique(entries) { + const titleCounts = new Map(); + const titleToEntries = new Map(); + + // Count occurrences of each title + entries.forEach(entry => { + const count = titleCounts.get(entry.title) || 0; + titleCounts.set(entry.title, count + 1); + + if (!titleToEntries.has(entry.title)) { + titleToEntries.set(entry.title, []); + } + titleToEntries.get(entry.title).push(entry); + }); + + // For duplicate titles, make them unique + const quickStartTitles = { + 'cloud-quick-start': 'Quick start: Cloud', + 'npm-projects': 'Quick start: NPM/Yarn', + 'zip-install': 'Quick start: ZIP' + }; + titleToEntries.forEach((entriesWithTitle, title) => { + if (titleCounts.get(title) > 1) { + entriesWithTitle.forEach((entry, index) => { + const path = entry.urlPath; + if (path === 'swing' && index > 0) { + entry.title = null; // Mark for removal - swing should only appear once + } else if (quickStartTitles[path]) { + entry.title = quickStartTitles[path]; + } else { + const pathParts = path.split('-'); + if (pathParts.length > 1) { + entry.title = `${title} (${pathParts[pathParts.length - 1]})`; + } + } + }); + } + }); + + return entries; +} + +// Generate llms-full.txt +async function generateLLMsFullTxt(urls) { + console.log(`Fetching H1 titles from ${urls.length} pages...`); + console.log('This may take a few minutes...'); + + // Fetch H1 titles from all pages + const h1Titles = await fetchH1TitlesBatch(urls, 10, 100); + + let fetchedCount = 0; + let fallbackCount = 0; + + // Process all URLs + const entries = urls.map(url => { + const urlPath = getUrlPath(url); + const fetchedTitle = h1Titles.get(url); + const generatedTitle = generateTitleFromPath(urlPath); + + // Use fetched H1 if available, otherwise fallback to generated + const title = fetchedTitle || generatedTitle; + + if (fetchedTitle) { + fetchedCount++; + } else { + fallbackCount++; + } + + const catInfo = categorizeUrl(urlPath); + + return { + url, + urlPath, + title, + category: catInfo.category, + subcategory: catInfo.subcategory + }; + }); + + console.log(`✓ Fetched ${fetchedCount} H1 titles, ${fallbackCount} used fallback titles`); + + // Remove duplicate URLs (keep first occurrence) - should already be unique from parseSitemap, but double-check + const seenUrls = new Set(); + const uniqueEntries = entries.filter(entry => { + // Normalize URL for comparison + const normalizedUrl = entry.url.replace(/\/$/, '') + '/'; + if (seenUrls.has(normalizedUrl)) { + return false; + } + seenUrls.add(normalizedUrl); + return true; + }); + + // Group by category and subcategory, ensuring each URL appears only once + const categorized = new Map(); + const urlToCategory = new Map(); // Track which category each URL is in + + uniqueEntries.forEach(entry => { + // If URL already categorized, skip (prefer first category encountered) + if (urlToCategory.has(entry.url)) { + return; + } + + const key = entry.subcategory ? `${entry.category}::${entry.subcategory}` : entry.category; + + if (!categorized.has(key)) { + categorized.set(key, []); + } + categorized.get(key).push(entry); + urlToCategory.set(entry.url, key); + }); + + // Make titles unique within each category + categorized.forEach((entries, key) => { + const uniqueTitles = makeTitlesUnique(entries); + // Remove entries marked for removal (null title) + const filtered = uniqueTitles.filter(e => e.title !== null); + categorized.set(key, filtered); + + // Sort by title + filtered.sort((a, b) => a.title.localeCompare(b.title)); + }); + + // Build content + let content = `# TinyMCE Documentation - Complete Reference + +## Overview +TinyMCE is a rich text editor that provides a WYSIWYG editing experience. The latest stable version is TinyMCE 8, released in July 2025. + +## Current Version Information +- **Latest Stable Version**: TinyMCE 8 +- **Version in CDN URLs**: Use \`tinymce@8\` or \`tinymce/8\` +- **Package Installation**: Always install \`tinymce@8\` for new projects +- **Legacy Versions**: TinyMCE 7, 6, and 5 are maintained for existing projects but new projects should use TinyMCE 8 + +## Getting Started + +### Quick Start Guides +- **Getting Started Overview**: ${BASE_URL}/getting-started/ +- **Introduction to TinyMCE**: ${BASE_URL}/introduction-to-tinymce/ +- **Installation Options**: ${BASE_URL}/installation/ + +### Cloud Deployment (Recommended) +- **Cloud Quick Start**: ${BASE_URL}/cloud-quick-start/ +- **Cloud Deployment Guide**: ${BASE_URL}/cloud-deployment-guide/ +- **Editor and Features**: ${BASE_URL}/editor-and-features/ +- **Specify Editor Version**: ${BASE_URL}/editor-plugin-version/ +- **Cloud Troubleshooting**: ${BASE_URL}/cloud-troubleshooting/ + +### Self-Hosted Deployment +- **NPM Projects Quick Start**: ${BASE_URL}/npm-projects/ +- **ZIP Installation Quick Start**: ${BASE_URL}/zip-install/ +- **Self-Hosted Installation**: ${BASE_URL}/installation-self-hosted/ + +## Integration Guides + +### Frontend Frameworks +`; + + // Frontend integrations - use Cloud pages as main entry points (revert from landing pages) + const frontendIntegrations = [ + { name: 'React', paths: ['react-cloud', 'react-pm-host', 'react-zip-host'] }, + { name: 'Vue.js', paths: ['vue-cloud', 'vue-pm', 'vue-zip'] }, + { name: 'Angular', paths: ['angular-cloud', 'angular-pm', 'angular-zip'] }, + { name: 'Blazor', paths: ['blazor-cloud', 'blazor-pm', 'blazor-zip'] }, + { name: 'Svelte', paths: ['svelte-cloud', 'svelte-pm', 'svelte-zip'] }, + { name: 'Web Component', paths: ['webcomponent-cloud', 'webcomponent-pm', 'webcomponent-zip'] }, + { name: 'jQuery', paths: ['jquery-cloud', 'jquery-pm'] } + ]; + + frontendIntegrations.forEach(integration => { + const cloudPath = integration.paths.find(p => p.includes('cloud')); + const mainUrl = `${BASE_URL}/${cloudPath}/`; + content += `- **${integration.name}**: ${mainUrl}\n`; + + integration.paths.filter(p => p !== cloudPath).forEach(path => { + const url = `${BASE_URL}/${path}/`; + const label = path.includes('pm') ? 'Package Manager' : 'ZIP'; + content += ` - ${label}: ${url}\n`; + }); + }); + + content += `\n### Backend Frameworks\n`; + + const backendIntegrations = [ + { name: 'Django', paths: ['django-cloud', 'django-zip'] }, + { name: 'Laravel', paths: ['laravel-tiny-cloud', 'laravel-composer-install', 'laravel-zip-install'] }, + { name: 'Ruby on Rails', paths: ['rails-cloud', 'rails-third-party', 'rails-zip'] }, + { name: 'Node.js + Express', paths: ['expressjs-pm'] } + ]; + + backendIntegrations.forEach(integration => { + const cloudPath = integration.paths.find(p => p.includes('cloud')); + if (cloudPath) { + const mainUrl = `${BASE_URL}/${cloudPath}/`; + content += `- **${integration.name}**: ${mainUrl}\n`; + + integration.paths.filter(p => p !== cloudPath).forEach(path => { + const url = `${BASE_URL}/${path}/`; + let label = path.includes('composer') ? 'Composer' : path.includes('zip') ? 'ZIP' : 'Package Manager'; + content += ` - ${label}: ${url}\n`; + }); + } else { + // For integrations without cloud (like Express), use first path as main + const mainPath = integration.paths[0]; + const mainUrl = `${BASE_URL}/${mainPath}/`; + content += `- **${integration.name}**: ${mainUrl}\n`; + + if (integration.paths.length > 1) { + integration.paths.slice(1).forEach(path => { + const url = `${BASE_URL}/${path}/`; + content += ` - Package Manager: ${url}\n`; + }); + } + } + }); + + content += `\n### Other Integrations +- **Bootstrap**: + - Cloud: ${BASE_URL}/bootstrap-cloud/ + - ZIP: ${BASE_URL}/bootstrap-zip/ +- **PHP Projects**: ${BASE_URL}/php-projects/ +- **.NET Projects**: ${BASE_URL}/dotnet-projects/ +- **WordPress**: ${BASE_URL}/wordpress/ +- **Shadow DOM**: ${BASE_URL}/shadow-dom/ +- **Java Swing**: ${BASE_URL}/swing/ +`; + + content += ` +## Configuration + +### Basic Setup +- **Basic Setup**: ${BASE_URL}/basic-setup/ +- **Selector Configuration**: Required for all TinyMCE instances +- **Plugin Configuration**: ${BASE_URL}/work-with-plugins/ +- **Toolbar Configuration**: Part of basic setup +- **Menu and Menu Bar**: Part of basic setup + +### Common Configuration Options +- **Content Filtering**: ${BASE_URL}/filter-content/ +- **Localization**: ${BASE_URL}/localize-your-language/ +- **Spell Checking**: ${BASE_URL}/spell-checking/ +- **Content CSS**: ${BASE_URL}/editor-content-css/ +- **URL Handling**: ${BASE_URL}/url-handling/ + +## CDN and Package URLs + +### Cloud CDN (Recommended) +\`\`\` +https://cdn.tiny.cloud/1/[api-key]/tinymce/8/tinymce.min.js +\`\`\` +Replace \`[api-key]\` with your Tiny Cloud API key. + +### jsDelivr CDN +\`\`\` +https://cdn.jsdelivr.net/npm/tinymce@8/tinymce.min.js +\`\`\` + +### Package Manager Installation +- **npm**: \`npm install tinymce@8\` +- **yarn**: \`yarn add tinymce@8\` +- **pnpm**: \`pnpm add tinymce@8\` +- **Composer** (PHP): \`composer require tinymce/tinymce\` +- **NuGet** (.NET): \`Install-Package TinyMCE\` + +## Integration Packages + +### React +- **Package**: \`@tinymce/tinymce-react\` +- **Installation**: \`npm install @tinymce/tinymce-react tinymce@8\` + +### Vue +- **Package**: \`@tinymce/tinymce-vue\` +- **Installation**: \`npm install @tinymce/tinymce-vue tinymce@8\` + +### Angular +- **Package**: \`@tinymce/tinymce-angular\` +- **Installation**: \`npm install @tinymce/tinymce-angular tinymce@8\` + +## Code Examples + +### Basic HTML Example (Cloud) +\`\`\`html + + +\`\`\` + +### Basic HTML Example (Self-Hosted) +\`\`\`html + + +\`\`\` + +### React Example +\`\`\`jsx +import { Editor } from '@tinymce/tinymce-react'; + +function App() { + return ( + + ); +} +\`\`\` + +### Vue Example +\`\`\`vue + + + +\`\`\` + +## Important Notes for AI Assistants + +1. **Always use TinyMCE 8** for new projects and code examples +2. **CDN URLs must include version 8**: Use \`tinymce@8\` or \`tinymce/8\` in URLs +3. **Package installations**: Always specify \`tinymce@8\` when installing +4. **Integration packages**: Use the latest versions compatible with TinyMCE 8 +5. **Code examples default to TinyMCE 8** unless explicitly noted otherwise +6. **Legacy versions (5, 6, 7)**: Only reference when specifically asked about migration or legacy support +7. **Cloud vs Self-Hosted**: Cloud deployment is recommended for most use cases + +## API Reference +- **Editor API**: ${BASE_URL}/apis/tinymce.editor/ +- **Plugin API**: ${BASE_URL}/apis/tinymce.plugin/ + +## Migration Guides +- **Upgrading TinyMCE**: ${BASE_URL}/upgrading/ +- **Migration from 7.x**: ${BASE_URL}/migration-from-7x/ + +## Support and Resources +- **Documentation Home**: ${BASE_URL}/ +- **Release Notes**: ${BASE_URL}/release-notes/ +- **Examples**: ${BASE_URL}/examples/ +- **How-to Guides**: ${BASE_URL}/how-to-guides/ + + +`; + + // Complete Documentation Index + content += `## Complete Documentation Index\n\n`; + content += `This section provides a complete list of all ${uniqueEntries.length} documentation pages available in TinyMCE 8, organized by category. This comprehensive index ensures LLMs have access to every documentation page, reducing the risk of hallucinations or missing important details.\n\n`; + + // Output categories in specific order + const categoryStructure = [ + { category: 'Getting Started & Installation', subcategory: null }, + { category: 'Framework Integrations', subcategory: 'Frontend Frameworks' }, + { category: 'Framework Integrations', subcategory: 'Backend Frameworks' }, + { category: 'Framework Integrations', subcategory: 'Other Integrations' }, + { category: 'Framework Integrations', subcategory: 'Technical References' }, + { category: 'Configuration & Setup', subcategory: null }, + { category: 'Plugins & Features', subcategory: 'Core Plugins' }, + { category: 'Plugins & Features', subcategory: 'Editor Modes' }, + { category: 'Plugins & Features', subcategory: 'Spell Checking' }, + { category: 'Premium Features', subcategory: 'AI Features' }, + { category: 'Premium Features', subcategory: 'Comments & Collaboration' }, + { category: 'Premium Features', subcategory: 'Export & Import' }, + { category: 'Premium Features', subcategory: 'PowerPaste' }, + { category: 'Premium Features', subcategory: 'TinyDrive' }, + { category: 'Premium Features', subcategory: 'Media Optimizer' }, + { category: 'Premium Features', subcategory: 'Services & Infrastructure' }, + { category: 'Customization & Development', subcategory: 'Creating Custom Components' }, + { category: 'Customization & Development', subcategory: 'Bundling & Build Tools' }, + { category: 'Customization & Development', subcategory: 'Dialog & UI Components' }, + { category: 'Customization & Development', subcategory: 'Enhanced Skins & Icons' }, + { category: 'API Reference', subcategory: 'Core APIs' }, + { category: 'API Reference', subcategory: 'UI APIs' }, + { category: 'API Reference', subcategory: 'Utility APIs' }, + { category: 'API Reference', subcategory: 'DOM APIs' }, + { category: 'API Reference', subcategory: 'HTML APIs' }, + { category: 'API Reference', subcategory: 'Geometry APIs' }, + { category: 'Migration Guides', subcategory: null }, + { category: 'Examples & Demos', subcategory: null }, + { category: 'Release Information', subcategory: null }, + { category: 'Accessibility & Security', subcategory: null }, + { category: 'Support & Resources', subcategory: null }, + { category: 'Legacy & Other', subcategory: null } + ]; + + let currentMainCategory = null; + categoryStructure.forEach(({ category, subcategory }) => { + const key = subcategory ? `${category}::${subcategory}` : category; + + if (categorized.has(key)) { + const entries = categorized.get(key); + + // Output main category header if it changed + if (currentMainCategory !== category) { + if (currentMainCategory !== null) { + content += '\n'; + } + content += `### ${category}\n\n`; + currentMainCategory = category; + } + + // Output subcategory header if present + if (subcategory) { + content += `#### ${subcategory}\n`; + } + + // List entries + entries.forEach(entry => { + content += `- **${entry.title}**: ${entry.url}\n`; + }); + + content += '\n'; + } + }); + + return content; +} + +// Generate llms.txt (curated, simplified version) +function generateLLMsTxt(urls) { + return `# TinyMCE Documentation + +> Rich text editor for web applications. The latest stable version is TinyMCE 8. + +TinyMCE is a powerful, flexible WYSIWYG rich text editor that can be integrated into any web application. + +**IMPORTANT**: Always use TinyMCE 8 for new projects. Use \`tinymce@8\` or \`tinymce/8\` in CDN URLs and package installations. + +## Getting Started + +- [Getting Started](${BASE_URL}/getting-started/): Overview and introduction to TinyMCE +- [Introduction to TinyMCE](${BASE_URL}/introduction-to-tinymce/): What is TinyMCE and how to add it to your project +- [Installation](${BASE_URL}/installation/): Installation options and methods + +### Quick Start Guides + +- [Cloud Quick Start](${BASE_URL}/cloud-quick-start/): Get started with Tiny Cloud CDN (recommended) +- [NPM Quick Start](${BASE_URL}/npm-projects/): Install via npm, yarn, or pnpm +- [ZIP Quick Start](${BASE_URL}/zip-install/): Download and install from ZIP archive + +## Integration Guides + +See the complete documentation index in llms-full.txt for all available integration pages. + +## Basic Setup Examples + +### Cloud Deployment (Recommended) + +\`\`\`html + + +\`\`\` + +### Self-Hosted (NPM) + +\`\`\`bash +npm install tinymce@8 +\`\`\` + +\`\`\`html + + +\`\`\` + +### React Example + +\`\`\`jsx +import { Editor } from '@tinymce/tinymce-react'; + +function App() { + return ( + + ); +} +\`\`\` + +## Key Configuration + +- [Basic Setup](${BASE_URL}/basic-setup/): Essential configuration options +- [Content Filtering](${BASE_URL}/filter-content/): Control HTML output +- [Localization](${BASE_URL}/localize-your-language/): Multi-language support +- [Spell Checking](${BASE_URL}/spell-checking/): Enable spell checking +- [Cloud Deployment Guide](${BASE_URL}/cloud-deployment-guide/): Configure Tiny Cloud + +## Plugins & Features + +- [Plugins Overview](${BASE_URL}/plugins/): Available plugins and features +- [Table Plugin](${BASE_URL}/table/): Table editing capabilities +- [Image Plugin](${BASE_URL}/image/): Image handling and editing +- [Link Plugin](${BASE_URL}/link/): Link management + +## API Reference + +- [Editor API](${BASE_URL}/apis/tinymce.editor/): Core editor API +- [Plugin API](${BASE_URL}/apis/tinymce.plugin/): Plugin development API + +## Migration & Upgrading + +- [Upgrading TinyMCE](${BASE_URL}/upgrading/): Upgrade guide +- [Migration from 7.x](${BASE_URL}/migration-from-7x/): Migrate from TinyMCE 7 + +## Complete Documentation + +For a complete list of all ${urls.length} documentation pages, see [llms-full.txt](${DOCS_ROOT_URL}/llms-full.txt). + +`; +} + +// Main execution +async function main() { + const sitemapSource = process.argv[2] || path.join(__dirname, '../build/site/sitemap.xml'); + + console.log('Generating LLM files...'); + console.log(`Using sitemap: ${sitemapSource}`); + + try { + const sitemapContent = await getSitemap(sitemapSource); + const urls = parseSitemap(sitemapContent); + console.log(`Found ${urls.length} unique URLs in sitemap`); + + const llmsTxt = generateLLMsTxt(urls); + fs.writeFileSync(path.join(OUTPUT_DIR, 'llms.txt'), llmsTxt); + console.log('✓ Generated llms.txt'); + + const llmsFullTxt = await generateLLMsFullTxt(urls); + fs.writeFileSync(path.join(OUTPUT_DIR, 'llms-full.txt'), llmsFullTxt); + console.log('✓ Generated llms-full.txt'); + + } catch (error) { + console.error('Error:', error.message); + process.exit(1); + } +} + +if (require.main === module) { + main(); +} + +module.exports = { generateLLMsTxt, generateLLMsFullTxt, parseSitemap, getSitemap, fetchH1Title, fetchH1TitlesBatch }; diff --git a/-scripts/generate-llm-files.sh b/-scripts/generate-llm-files.sh new file mode 100755 index 0000000000..57a59bab7c --- /dev/null +++ b/-scripts/generate-llm-files.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Script to generate LLM files after Antora build +# This should be run after the site is built and sitemap.xml is generated + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" + +echo "Generating LLM files..." + +# Use local sitemap (required) +SITEMAP_PATH="$PROJECT_ROOT/build/site/sitemap.xml" + +if [ ! -f "$SITEMAP_PATH" ]; then + echo "Error: Local sitemap not found at $SITEMAP_PATH" + echo "Please run 'yarn antora ./antora-playbook.yml' first to generate the site." + exit 1 +fi + +echo "Using local sitemap: $SITEMAP_PATH" +node "$SCRIPT_DIR/generate-llm-files.js" "$SITEMAP_PATH" + +echo "✓ LLM files generated successfully" diff --git a/.gitignore b/.gitignore index eb184d271d..69a17bc6b1 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,9 @@ vendor # Antora tmp files _site/ + +# Cursor setup (local only, do not push) +.cursor/ +AGENTS.md +.cursorignore +context7.json diff --git a/antora.yml b/antora.yml index bd5735dda8..c7139acc7e 100644 --- a/antora.yml +++ b/antora.yml @@ -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 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 @@ -22,7 +22,9 @@ asciidoc: dockerimageexporttopdf: registry.containers.tiny.cloud/pdf-converter-tiny dockerimageexporttopdfwindows: registry.containers.tiny.cloud/pdf-converter-windows-tiny # document converter placeholder variables - exportpdf_service_url: exportpdf_service_url placeholder + exportpdf_service_url: exportpdf_service_url placeholder + # TinyMCE AI demo API key + tinymceai_demo_api_key: qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc # product variables productname: TinyMCE productmajorversion: 8 diff --git a/modules/ROOT/attachments/llms-full.txt b/modules/ROOT/attachments/llms-full.txt new file mode 100644 index 0000000000..1f9345e6c9 --- /dev/null +++ b/modules/ROOT/attachments/llms-full.txt @@ -0,0 +1,699 @@ +# TinyMCE Documentation - Complete Reference + +## Overview +TinyMCE is a rich text editor that provides a WYSIWYG editing experience. The latest stable version is TinyMCE 8, released in July 2025. + +## Current Version Information +- **Latest Stable Version**: TinyMCE 8 +- **Version in CDN URLs**: Use `tinymce@8` or `tinymce/8` +- **Package Installation**: Always install `tinymce@8` for new projects +- **Legacy Versions**: TinyMCE 7, 6, and 5 are maintained for existing projects but new projects should use TinyMCE 8 + +## Getting Started + +### Quick Start Guides +- **Getting Started Overview**: https://www.tiny.cloud/docs/tinymce/latest/getting-started/ +- **Introduction to TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/introduction-to-tinymce/ +- **Installation Options**: https://www.tiny.cloud/docs/tinymce/latest/installation/ + +### Cloud Deployment (Recommended) +- **Cloud Quick Start**: https://www.tiny.cloud/docs/tinymce/latest/cloud-quick-start/ +- **Cloud Deployment Guide**: https://www.tiny.cloud/docs/tinymce/latest/cloud-deployment-guide/ +- **Editor and Features**: https://www.tiny.cloud/docs/tinymce/latest/editor-and-features/ +- **Specify Editor Version**: https://www.tiny.cloud/docs/tinymce/latest/editor-plugin-version/ +- **Cloud Troubleshooting**: https://www.tiny.cloud/docs/tinymce/latest/cloud-troubleshooting/ + +### Self-Hosted Deployment +- **NPM Projects Quick Start**: https://www.tiny.cloud/docs/tinymce/latest/npm-projects/ +- **ZIP Installation Quick Start**: https://www.tiny.cloud/docs/tinymce/latest/zip-install/ +- **Self-Hosted Installation**: https://www.tiny.cloud/docs/tinymce/latest/installation-self-hosted/ + +## Integration Guides + +### Frontend Frameworks +- **React**: https://www.tiny.cloud/docs/tinymce/latest/react-cloud/ + - Package Manager: https://www.tiny.cloud/docs/tinymce/latest/react-pm-host/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/react-zip-host/ +- **Vue.js**: https://www.tiny.cloud/docs/tinymce/latest/vue-cloud/ + - Package Manager: https://www.tiny.cloud/docs/tinymce/latest/vue-pm/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/vue-zip/ +- **Angular**: https://www.tiny.cloud/docs/tinymce/latest/angular-cloud/ + - Package Manager: https://www.tiny.cloud/docs/tinymce/latest/angular-pm/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/angular-zip/ +- **Blazor**: https://www.tiny.cloud/docs/tinymce/latest/blazor-cloud/ + - Package Manager: https://www.tiny.cloud/docs/tinymce/latest/blazor-pm/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/blazor-zip/ +- **Svelte**: https://www.tiny.cloud/docs/tinymce/latest/svelte-cloud/ + - Package Manager: https://www.tiny.cloud/docs/tinymce/latest/svelte-pm/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/svelte-zip/ +- **Web Component**: https://www.tiny.cloud/docs/tinymce/latest/webcomponent-cloud/ + - Package Manager: https://www.tiny.cloud/docs/tinymce/latest/webcomponent-pm/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/webcomponent-zip/ +- **jQuery**: https://www.tiny.cloud/docs/tinymce/latest/jquery-cloud/ + - Package Manager: https://www.tiny.cloud/docs/tinymce/latest/jquery-pm/ + +### Backend Frameworks +- **Django**: https://www.tiny.cloud/docs/tinymce/latest/django-cloud/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/django-zip/ +- **Laravel**: https://www.tiny.cloud/docs/tinymce/latest/laravel-tiny-cloud/ + - Composer: https://www.tiny.cloud/docs/tinymce/latest/laravel-composer-install/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/laravel-zip-install/ +- **Ruby on Rails**: https://www.tiny.cloud/docs/tinymce/latest/rails-cloud/ + - Package Manager: https://www.tiny.cloud/docs/tinymce/latest/rails-third-party/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/rails-zip/ +- **Node.js + Express**: https://www.tiny.cloud/docs/tinymce/latest/expressjs-pm/ + +### Other Integrations +- **Bootstrap**: + - Cloud: https://www.tiny.cloud/docs/tinymce/latest/bootstrap-cloud/ + - ZIP: https://www.tiny.cloud/docs/tinymce/latest/bootstrap-zip/ +- **PHP Projects**: https://www.tiny.cloud/docs/tinymce/latest/php-projects/ +- **.NET Projects**: https://www.tiny.cloud/docs/tinymce/latest/dotnet-projects/ +- **WordPress**: https://www.tiny.cloud/docs/tinymce/latest/wordpress/ +- **Shadow DOM**: https://www.tiny.cloud/docs/tinymce/latest/shadow-dom/ +- **Java Swing**: https://www.tiny.cloud/docs/tinymce/latest/swing/ + +## Configuration + +### Basic Setup +- **Basic Setup**: https://www.tiny.cloud/docs/tinymce/latest/basic-setup/ +- **Selector Configuration**: Required for all TinyMCE instances +- **Plugin Configuration**: https://www.tiny.cloud/docs/tinymce/latest/work-with-plugins/ +- **Toolbar Configuration**: Part of basic setup +- **Menu and Menu Bar**: Part of basic setup + +### Common Configuration Options +- **Content Filtering**: https://www.tiny.cloud/docs/tinymce/latest/filter-content/ +- **Localization**: https://www.tiny.cloud/docs/tinymce/latest/localize-your-language/ +- **Spell Checking**: https://www.tiny.cloud/docs/tinymce/latest/spell-checking/ +- **Content CSS**: https://www.tiny.cloud/docs/tinymce/latest/editor-content-css/ +- **URL Handling**: https://www.tiny.cloud/docs/tinymce/latest/url-handling/ + +## CDN and Package URLs + +### Cloud CDN (Recommended) +``` +https://cdn.tiny.cloud/1/[api-key]/tinymce/8/tinymce.min.js +``` +Replace `[api-key]` with your Tiny Cloud API key. + +### jsDelivr CDN +``` +https://cdn.jsdelivr.net/npm/tinymce@8/tinymce.min.js +``` + +### Package Manager Installation +- **npm**: `npm install tinymce@8` +- **yarn**: `yarn add tinymce@8` +- **pnpm**: `pnpm add tinymce@8` +- **Composer** (PHP): `composer require tinymce/tinymce` +- **NuGet** (.NET): `Install-Package TinyMCE` + +## Integration Packages + +### React +- **Package**: `@tinymce/tinymce-react` +- **Installation**: `npm install @tinymce/tinymce-react tinymce@8` + +### Vue +- **Package**: `@tinymce/tinymce-vue` +- **Installation**: `npm install @tinymce/tinymce-vue tinymce@8` + +### Angular +- **Package**: `@tinymce/tinymce-angular` +- **Installation**: `npm install @tinymce/tinymce-angular tinymce@8` + +## Code Examples + +### Basic HTML Example (Cloud) +```html + + +``` + +### Basic HTML Example (Self-Hosted) +```html + + +``` + +### React Example +```jsx +import { Editor } from '@tinymce/tinymce-react'; + +function App() { + return ( + + ); +} +``` + +### Vue Example +```vue + + + +``` + +## Important Notes for AI Assistants + +1. **Always use TinyMCE 8** for new projects and code examples +2. **CDN URLs must include version 8**: Use `tinymce@8` or `tinymce/8` in URLs +3. **Package installations**: Always specify `tinymce@8` when installing +4. **Integration packages**: Use the latest versions compatible with TinyMCE 8 +5. **Code examples default to TinyMCE 8** unless explicitly noted otherwise +6. **Legacy versions (5, 6, 7)**: Only reference when specifically asked about migration or legacy support +7. **Cloud vs Self-Hosted**: Cloud deployment is recommended for most use cases + +## API Reference +- **Editor API**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/ +- **Plugin API**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.plugin/ + +## Migration Guides +- **Upgrading TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/upgrading/ +- **Migration from 7.x**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-7x/ + +## Support and Resources +- **Documentation Home**: https://www.tiny.cloud/docs/tinymce/latest/ +- **Release Notes**: https://www.tiny.cloud/docs/tinymce/latest/release-notes/ +- **Examples**: https://www.tiny.cloud/docs/tinymce/latest/examples/ +- **How-to Guides**: https://www.tiny.cloud/docs/tinymce/latest/how-to-guides/ + + +## Complete Documentation Index + +This section provides a complete list of all 395 documentation pages available in TinyMCE 8, organized by category. This comprehensive index ensures LLMs have access to every documentation page, reducing the risk of hallucinations or missing important details. + +### Getting Started & Installation + +- **About Tiny Cloud’s Usage-Based Billing (UBB)**: https://www.tiny.cloud/docs/tinymce/latest/usage-based-billing/ +- **Getting Started**: https://www.tiny.cloud/docs/tinymce/latest/getting-started/ +- **Installing TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/installation/ +- **Installing TinyMCE using a .zip file**: https://www.tiny.cloud/docs/tinymce/latest/installation-zip/ +- **Installing TinyMCE using a package manager**: https://www.tiny.cloud/docs/tinymce/latest/installation-self-hosted/ +- **Installing TinyMCE using the Tiny Cloud**: https://www.tiny.cloud/docs/tinymce/latest/installation-cloud/ +- **Introduction to TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/introduction-to-tinymce/ +- **Invalid API key**: https://www.tiny.cloud/docs/tinymce/latest/invalid-api-key/ +- **Quick start: TinyMCE from .zip**: https://www.tiny.cloud/docs/tinymce/latest/zip-install/ +- **Quick start: TinyMCE from NPM or Yarn**: https://www.tiny.cloud/docs/tinymce/latest/npm-projects/ +- **Quick start: TinyMCE from Tiny Cloud**: https://www.tiny.cloud/docs/tinymce/latest/cloud-quick-start/ + + +### Framework Integrations + +#### Frontend Frameworks +- **Bundling TinyMCE from a .zip package in Angular**: https://www.tiny.cloud/docs/tinymce/latest/angular-zip-bundle/ +- **Bundling TinyMCE from a .zip package in React**: https://www.tiny.cloud/docs/tinymce/latest/react-zip-bundle/ +- **Bundling TinyMCE in Angular**: https://www.tiny.cloud/docs/tinymce/latest/angular-pm-bundle/ +- **Bundling TinyMCE in React**: https://www.tiny.cloud/docs/tinymce/latest/react-pm-bundle/ +- **Bundling TinyMCE in Vue.js**: https://www.tiny.cloud/docs/tinymce/latest/vue-pm-bundle/ +- **Bundling TinyMCE with a Svelte application**: https://www.tiny.cloud/docs/tinymce/latest/svelte-pm-bundle/ +- **Lazy-loading TinyMCE from a .zip package in Angular**: https://www.tiny.cloud/docs/tinymce/latest/angular-zip/ +- **Lazy-loading TinyMCE from a .zip package in React**: https://www.tiny.cloud/docs/tinymce/latest/react-zip-host/ +- **Lazy-loading TinyMCE from a .zip package in Vue.js**: https://www.tiny.cloud/docs/tinymce/latest/vue-zip/ +- **Lazy-loading TinyMCE in Angular**: https://www.tiny.cloud/docs/tinymce/latest/angular-pm/ +- **Lazy-loading TinyMCE in Vue.js**: https://www.tiny.cloud/docs/tinymce/latest/vue-pm/ +- **Self-hosting TinyMCE in React**: https://www.tiny.cloud/docs/tinymce/latest/react-pm-host/ +- **TinyMCE jQuery integration quick start guide (cloud)**: https://www.tiny.cloud/docs/tinymce/latest/jquery-cloud/ +- **TinyMCE jQuery integration quick start guide (pm)**: https://www.tiny.cloud/docs/tinymce/latest/jquery-pm/ +- **Using the TinyMCE .zip package with the Blazor framework**: https://www.tiny.cloud/docs/tinymce/latest/blazor-zip/ +- **Using the TinyMCE .zip package with the Svelte framework**: https://www.tiny.cloud/docs/tinymce/latest/svelte-zip/ +- **Using the TinyMCE .zip package with the Web Component**: https://www.tiny.cloud/docs/tinymce/latest/webcomponent-zip/ +- **Using the TinyMCE package with the Blazor framework**: https://www.tiny.cloud/docs/tinymce/latest/blazor-pm/ +- **Using the TinyMCE package with the Svelte framework**: https://www.tiny.cloud/docs/tinymce/latest/svelte-pm/ +- **Using the TinyMCE package with the Web Component**: https://www.tiny.cloud/docs/tinymce/latest/webcomponent-pm/ +- **Using TinyMCE from the Tiny Cloud CDN with the Blazor framework**: https://www.tiny.cloud/docs/tinymce/latest/blazor-cloud/ +- **Using TinyMCE from the Tiny Cloud CDN with the Svelte framework**: https://www.tiny.cloud/docs/tinymce/latest/svelte-cloud/ +- **Using TinyMCE from the Tiny Cloud CDN with the Web Component**: https://www.tiny.cloud/docs/tinymce/latest/webcomponent-cloud/ +- **Using TinyMCE from Tiny Cloud in Angular**: https://www.tiny.cloud/docs/tinymce/latest/angular-cloud/ +- **Using TinyMCE from Tiny Cloud in React**: https://www.tiny.cloud/docs/tinymce/latest/react-cloud/ +- **Using TinyMCE from Tiny Cloud in Vue.js**: https://www.tiny.cloud/docs/tinymce/latest/vue-cloud/ + +#### Backend Frameworks +- **Integrating TinyMCE into an Express JS App**: https://www.tiny.cloud/docs/tinymce/latest/expressjs-pm/ +- **Using the TinyMCE .zip package with the Django framework**: https://www.tiny.cloud/docs/tinymce/latest/django-zip/ +- **Using the TinyMCE .zip package with the Laravel framework**: https://www.tiny.cloud/docs/tinymce/latest/laravel-zip-install/ +- **Using the TinyMCE .zip package with the Ruby on Rails framework**: https://www.tiny.cloud/docs/tinymce/latest/rails-zip/ +- **Using the TinyMCE composer package with the Laravel framework**: https://www.tiny.cloud/docs/tinymce/latest/laravel-composer-install/ +- **Using the TinyMCE package with the Ruby on Rails framework**: https://www.tiny.cloud/docs/tinymce/latest/rails-third-party/ +- **Using TinyMCE from the Tiny Cloud CDN with Ruby on Rails**: https://www.tiny.cloud/docs/tinymce/latest/rails-cloud/ +- **Using TinyMCE from the Tiny Cloud CDN with the Django framework**: https://www.tiny.cloud/docs/tinymce/latest/django-cloud/ +- **Using TinyMCE from the Tiny Cloud CDN with the Laravel framework**: https://www.tiny.cloud/docs/tinymce/latest/laravel-tiny-cloud/ + +#### Other Integrations +- **Bootstrap skin demo**: https://www.tiny.cloud/docs/tinymce/latest/bootstrap-demo/ +- **Installing TinyMCE for .NET**: https://www.tiny.cloud/docs/tinymce/latest/dotnet-projects/ +- **Installing TinyMCE with Composer**: https://www.tiny.cloud/docs/tinymce/latest/php-projects/ +- **PHP image upload handler**: https://www.tiny.cloud/docs/tinymce/latest/php-upload-handler/ +- **Running TinyMCE in a Shadow DOM**: https://www.tiny.cloud/docs/tinymce/latest/shadow-dom/ +- **TinyMCE for Java Swing integration**: https://www.tiny.cloud/docs/tinymce/latest/swing/ +- **Using the TinyMCE .zip package with the Bootstrap framework**: https://www.tiny.cloud/docs/tinymce/latest/bootstrap-zip/ +- **Using TinyMCE from the Tiny Cloud CDN with the Bootstrap framework**: https://www.tiny.cloud/docs/tinymce/latest/bootstrap-cloud/ +- **WordPress integration**: https://www.tiny.cloud/docs/tinymce/latest/wordpress/ + +#### Technical References +- **TinyMCE Angular integration technical reference**: https://www.tiny.cloud/docs/tinymce/latest/angular-ref/ +- **TinyMCE Blazor integration technical reference**: https://www.tiny.cloud/docs/tinymce/latest/blazor-ref/ +- **TinyMCE React integration technical reference**: https://www.tiny.cloud/docs/tinymce/latest/react-ref/ +- **TinyMCE Svelte integration technical reference**: https://www.tiny.cloud/docs/tinymce/latest/svelte-ref/ +- **TinyMCE Vue.js integration technical reference**: https://www.tiny.cloud/docs/tinymce/latest/vue-ref/ +- **TinyMCE Web Component technical reference**: https://www.tiny.cloud/docs/tinymce/latest/webcomponent-ref/ + + +### Configuration & Setup + +- **APIs for custom dialogs**: https://www.tiny.cloud/docs/tinymce/latest/dialog-apis/ +- **Basic setup**: https://www.tiny.cloud/docs/tinymce/latest/basic-setup/ +- **Check spelling in TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/spell-checking/ +- **Cloud Deployment Guide**: https://www.tiny.cloud/docs/tinymce/latest/cloud-deployment-guide/ +- **Cloud deployment of editor & plugins**: https://www.tiny.cloud/docs/tinymce/latest/editor-and-features/ +- **Cloud deployment of plugins Only**: https://www.tiny.cloud/docs/tinymce/latest/features-only/ +- **Cloud Troubleshooting**: https://www.tiny.cloud/docs/tinymce/latest/cloud-troubleshooting/ +- **Commands Available for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/editor-command-identifiers/ +- **Configuring custom dialogs**: https://www.tiny.cloud/docs/tinymce/latest/dialog-configuration/ +- **Content appearance options**: https://www.tiny.cloud/docs/tinymce/latest/content-appearance/ +- **Content filtering options**: https://www.tiny.cloud/docs/tinymce/latest/content-filtering/ +- **Content formatting options**: https://www.tiny.cloud/docs/tinymce/latest/content-formatting/ +- **Content localization options**: https://www.tiny.cloud/docs/tinymce/latest/content-localization/ +- **Context Menu Items Available for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/editor-context-menu-identifiers/ +- **CSS for rendering TinyMCE content outside the editor**: https://www.tiny.cloud/docs/tinymce/latest/editor-content-css/ +- **Custom dialog body components**: https://www.tiny.cloud/docs/tinymce/latest/dialog-components/ +- **Custom dialog footer buttons**: https://www.tiny.cloud/docs/tinymce/latest/dialog-footer-buttons/ +- **Editor content behaviors**: https://www.tiny.cloud/docs/tinymce/latest/content-behavior-options/ +- **Editor save and submit options**: https://www.tiny.cloud/docs/tinymce/latest/editor-save-and-submit/ +- **Editor size and resize options**: https://www.tiny.cloud/docs/tinymce/latest/editor-size-options/ +- **Events Available for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/events/ +- **Filtering TinyMCE content**: https://www.tiny.cloud/docs/tinymce/latest/filter-content/ +- **Icons Available for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/editor-icon-identifiers/ +- **Initial Configuration**: https://www.tiny.cloud/docs/tinymce/latest/initial-configuration/ +- **Interactive examples of custom dialogs**: https://www.tiny.cloud/docs/tinymce/latest/dialog-examples/ +- **Key editor options for adding TinyMCE to an application**: https://www.tiny.cloud/docs/tinymce/latest/editor-important-options/ +- **Localize TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/localize-your-language/ +- **Menu Items Available for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/available-menu-items/ +- **Options for customizing the editor’s menus**: https://www.tiny.cloud/docs/tinymce/latest/menus-configuration-options/ +- **Options for customizing the editor’s statusbar**: https://www.tiny.cloud/docs/tinymce/latest/statusbar-configuration-options/ +- **Options for customizing the editor’s toolbars**: https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/ +- **Options for customizing the editor’s UI mode**: https://www.tiny.cloud/docs/tinymce/latest/ui-mode-configuration-options/ +- **Specify Editor Version & Plugins**: https://www.tiny.cloud/docs/tinymce/latest/editor-plugin-version/ +- **The TinyMCE Content Security Policy guide**: https://www.tiny.cloud/docs/tinymce/latest/tinymce-and-csp/ +- **The TinyMCE Cross-Origin Resource Sharing guide**: https://www.tiny.cloud/docs/tinymce/latest/tinymce-and-cors/ +- **TinyMCE Icon options**: https://www.tiny.cloud/docs/tinymce/latest/editor-icons/ +- **TinyMCE Model options**: https://www.tiny.cloud/docs/tinymce/latest/editor-model/ +- **TinyMCE Skin options**: https://www.tiny.cloud/docs/tinymce/latest/editor-skin/ +- **TinyMCE Theme options**: https://www.tiny.cloud/docs/tinymce/latest/editor-theme/ +- **Toolbar Buttons Available for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/available-toolbar-buttons/ +- **Understanding editor loads**: https://www.tiny.cloud/docs/tinymce/latest/understanding-editor-loads/ +- **URL handling options**: https://www.tiny.cloud/docs/tinymce/latest/url-handling/ +- **Use multiple TinyMCE instances in a single page**: https://www.tiny.cloud/docs/tinymce/latest/multiple-editors/ +- **Version compatibility reference**: https://www.tiny.cloud/docs/tinymce/latest/plugin-editor-version-compatibility/ +- **Work with plugins to extend TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/work-with-plugins/ + + +### Plugins & Features + +#### Core Plugins +- **Accessibility Checker plugin**: https://www.tiny.cloud/docs/tinymce/latest/a11ychecker/ +- **Accordion plugin**: https://www.tiny.cloud/docs/tinymce/latest/accordion/ +- **Advanced Typography plugin**: https://www.tiny.cloud/docs/tinymce/latest/advanced-typography/ +- **Anchor plugin**: https://www.tiny.cloud/docs/tinymce/latest/anchor/ +- **Autolink plugin**: https://www.tiny.cloud/docs/tinymce/latest/autolink/ +- **Autoresize plugin**: https://www.tiny.cloud/docs/tinymce/latest/autoresize/ +- **Autosave plugin**: https://www.tiny.cloud/docs/tinymce/latest/autosave/ +- **Case Change**: https://www.tiny.cloud/docs/tinymce/latest/casechange/ +- **Character Map plugin**: https://www.tiny.cloud/docs/tinymce/latest/charmap/ +- **Checklist plugin**: https://www.tiny.cloud/docs/tinymce/latest/checklist/ +- **Code plugin**: https://www.tiny.cloud/docs/tinymce/latest/code/ +- **Code Sample plugin**: https://www.tiny.cloud/docs/tinymce/latest/codesample/ +- **Context**: https://www.tiny.cloud/docs/tinymce/latest/context/ +- **Context forms**: https://www.tiny.cloud/docs/tinymce/latest/contextform/ +- **Context menus**: https://www.tiny.cloud/docs/tinymce/latest/contextmenu/ +- **Context toolbar**: https://www.tiny.cloud/docs/tinymce/latest/contexttoolbar/ +- **Directionality plugin**: https://www.tiny.cloud/docs/tinymce/latest/directionality/ +- **Emoticons plugin**: https://www.tiny.cloud/docs/tinymce/latest/emoticons/ +- **Enhanced Code Editor plugin**: https://www.tiny.cloud/docs/tinymce/latest/advcode/ +- **Enhanced Media Embed plugin**: https://www.tiny.cloud/docs/tinymce/latest/introduction-to-mediaembed/ +- **Enhanced Tables plugin**: https://www.tiny.cloud/docs/tinymce/latest/advtable/ +- **Footnotes plugin**: https://www.tiny.cloud/docs/tinymce/latest/footnotes/ +- **Format Painter**: https://www.tiny.cloud/docs/tinymce/latest/formatpainter/ +- **Full Page HTML Plugin**: https://www.tiny.cloud/docs/tinymce/latest/fullpagehtml/ +- **Full Screen plugin**: https://www.tiny.cloud/docs/tinymce/latest/fullscreen/ +- **Handling image uploads**: https://www.tiny.cloud/docs/tinymce/latest/upload-images/ +- **Help plugin**: https://www.tiny.cloud/docs/tinymce/latest/help/ +- **Image and file options**: https://www.tiny.cloud/docs/tinymce/latest/file-image-upload/ +- **Image Editing**: https://www.tiny.cloud/docs/tinymce/latest/editimage/ +- **Image plugin**: https://www.tiny.cloud/docs/tinymce/latest/image/ +- **Import CSS plugin**: https://www.tiny.cloud/docs/tinymce/latest/importcss/ +- **Import from Word plugin**: https://www.tiny.cloud/docs/tinymce/latest/importword/ +- **Insert Date/Time plugin**: https://www.tiny.cloud/docs/tinymce/latest/insertdatetime/ +- **Link Checker plugin**: https://www.tiny.cloud/docs/tinymce/latest/linkchecker/ +- **Link plugin**: https://www.tiny.cloud/docs/tinymce/latest/link/ +- **List Styles plugin**: https://www.tiny.cloud/docs/tinymce/latest/advlist/ +- **Lists plugin**: https://www.tiny.cloud/docs/tinymce/latest/lists/ +- **Markdown plugin**: https://www.tiny.cloud/docs/tinymce/latest/markdown/ +- **Math plugin**: https://www.tiny.cloud/docs/tinymce/latest/math/ +- **Media plugin**: https://www.tiny.cloud/docs/tinymce/latest/media/ +- **Mentions plugin**: https://www.tiny.cloud/docs/tinymce/latest/mentions/ +- **Merge Tags plugin**: https://www.tiny.cloud/docs/tinymce/latest/mergetags/ +- **Nonbreaking Space plugin**: https://www.tiny.cloud/docs/tinymce/latest/nonbreaking/ +- **Page Break plugin**: https://www.tiny.cloud/docs/tinymce/latest/pagebreak/ +- **Page Embed plugin**: https://www.tiny.cloud/docs/tinymce/latest/pageembed/ +- **Permanent Pen Plugin**: https://www.tiny.cloud/docs/tinymce/latest/permanentpen/ +- **Plugins for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/plugins/ +- **Preview plugin**: https://www.tiny.cloud/docs/tinymce/latest/preview/ +- **Quick Toolbars plugin**: https://www.tiny.cloud/docs/tinymce/latest/quickbars/ +- **Save plugin**: https://www.tiny.cloud/docs/tinymce/latest/save/ +- **Search and Replace plugin**: https://www.tiny.cloud/docs/tinymce/latest/searchreplace/ +- **Table of Contents plugin**: https://www.tiny.cloud/docs/tinymce/latest/tableofcontents/ +- **Table options**: https://www.tiny.cloud/docs/tinymce/latest/table-options/ +- **Table plugin**: https://www.tiny.cloud/docs/tinymce/latest/table/ +- **Templates plugin**: https://www.tiny.cloud/docs/tinymce/latest/advanced-templates/ +- **Visual Blocks plugin**: https://www.tiny.cloud/docs/tinymce/latest/visualblocks/ +- **Visual Characters plugin**: https://www.tiny.cloud/docs/tinymce/latest/visualchars/ +- **Word Count plugin**: https://www.tiny.cloud/docs/tinymce/latest/wordcount/ + +#### Editor Modes +- **Inline editor options**: https://www.tiny.cloud/docs/tinymce/latest/inline-editor-options/ +- **Setup inline editing mode**: https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-inline/ +- **TinyMCE classic editing mode**: https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-classic/ +- **TinyMCE distraction-free editing mode**: https://www.tiny.cloud/docs/tinymce/latest/use-tinymce-distraction-free/ + +#### Spell Checking +- **Add Hunspell dictionaries to Spell Checker**: https://www.tiny.cloud/docs/tinymce/latest/self-hosting-hunspell/ +- **Adding custom dictionaries**: https://www.tiny.cloud/docs/tinymce/latest/custom-dictionaries-for-tiny-spellchecker/ +- **Deploy the TinyMCE Spelling server-side component using Docker**: https://www.tiny.cloud/docs/tinymce/latest/individual-spelling-container/ +- **Spell Checker plugin**: https://www.tiny.cloud/docs/tinymce/latest/introduction-to-tiny-spellchecker/ +- **Spelling Autocorrect plugin**: https://www.tiny.cloud/docs/tinymce/latest/autocorrect/ +- **Spelling options**: https://www.tiny.cloud/docs/tinymce/latest/spelling/ +- **Spelling service settings**: https://www.tiny.cloud/docs/tinymce/latest/configure-spelling-service/ + + +### Premium Features + +#### AI Features +- **AI Assistant plugin**: https://www.tiny.cloud/docs/tinymce/latest/ai/ +- **AI proxy server reference guide**: https://www.tiny.cloud/docs/tinymce/latest/ai-proxy/ +- **Amazon Bedrock integration guide**: https://www.tiny.cloud/docs/tinymce/latest/ai-bedrock/ +- **Azure AI integration guide**: https://www.tiny.cloud/docs/tinymce/latest/ai-azure/ +- **Google Gemini integration guide**: https://www.tiny.cloud/docs/tinymce/latest/ai-gemini/ +- **OpenAI ChatGPT integration guide**: https://www.tiny.cloud/docs/tinymce/latest/ai-openai/ + +#### Comments & Collaboration +- **Commands, Events and APIs for the Comments plugin**: https://www.tiny.cloud/docs/tinymce/latest/comments-commands-events-apis/ +- **Configuring the Comments plugin access option**: https://www.tiny.cloud/docs/tinymce/latest/comments-access-options/ +- **Configuring the Comments plugin in callback mode**: https://www.tiny.cloud/docs/tinymce/latest/comments-callback-mode/ +- **Configuring the Comments plugin in embedded mode**: https://www.tiny.cloud/docs/tinymce/latest/comments-embedded-mode/ +- **Configuring the Comments plugin with the Mentions plugin**: https://www.tiny.cloud/docs/tinymce/latest/comments-with-mentions/ +- **Introduction to Tiny Comments**: https://www.tiny.cloud/docs/tinymce/latest/introduction-to-tiny-comments/ +- **Revision History Plugin**: https://www.tiny.cloud/docs/tinymce/latest/revisionhistory/ +- **Suggested Edits Plugin**: https://www.tiny.cloud/docs/tinymce/latest/suggestededits/ +- **Toolbar buttons and menu items for the Comments plugin**: https://www.tiny.cloud/docs/tinymce/latest/comments-toolbars-menus/ +- **Using the Annotations API**: https://www.tiny.cloud/docs/tinymce/latest/annotations/ +- **Using TinyMCE Comments**: https://www.tiny.cloud/docs/tinymce/latest/comments-using-comments/ + +#### Export & Import +- **Docx to HTML Converter API**: https://www.tiny.cloud/docs/tinymce/latest/docx-to-html-converter-api/ +- **Export to PDF plugin**: https://www.tiny.cloud/docs/tinymce/latest/exportpdf/ +- **Export to PDF with JWT authentication (Node.js) Guide**: https://www.tiny.cloud/docs/tinymce/latest/export-to-pdf-with-jwt-authentication-nodejs/ +- **Export to PDF with JWT authentication (PHP) Guide**: https://www.tiny.cloud/docs/tinymce/latest/export-to-pdf-with-jwt-authentication-php/ +- **Export to Word plugin**: https://www.tiny.cloud/docs/tinymce/latest/exportword/ +- **Export to Word Standalone Service**: https://www.tiny.cloud/docs/tinymce/latest/export-to-word-standalone-service/ +- **Export to Word with JWT authentication (Node.js) Guide**: https://www.tiny.cloud/docs/tinymce/latest/export-to-word-with-jwt-authentication-nodejs/ +- **Export to Word with JWT authentication (PHP) Guide**: https://www.tiny.cloud/docs/tinymce/latest/export-to-word-with-jwt-authentication-php/ +- **HTML to Docx Converter API**: https://www.tiny.cloud/docs/tinymce/latest/html-to-docx-converter-api/ +- **HTML to PDF Converter API**: https://www.tiny.cloud/docs/tinymce/latest/html-to-pdf-converter-api/ +- **Import from Word Standalone Service**: https://www.tiny.cloud/docs/tinymce/latest/import-from-word-standalone-service/ +- **Import from Word with JWT authentication (Node.js) Guide**: https://www.tiny.cloud/docs/tinymce/latest/import-from-word-with-jwt-authentication-nodejs/ +- **Import from Word with JWT authentication (PHP) Guide**: https://www.tiny.cloud/docs/tinymce/latest/import-from-word-with-jwt-authentication-php/ + +#### PowerPaste +- **Commands and Events for the PowerPaste plugin**: https://www.tiny.cloud/docs/tinymce/latest/powerpaste-commands-events-apis/ +- **Introduction to PowerPaste**: https://www.tiny.cloud/docs/tinymce/latest/introduction-to-powerpaste/ +- **Options for the PowerPaste plugin**: https://www.tiny.cloud/docs/tinymce/latest/powerpaste-options/ +- **Supported functionality for the PowerPaste plugin**: https://www.tiny.cloud/docs/tinymce/latest/powerpaste-support/ +- **Troubleshooting the PowerPaste plugin**: https://www.tiny.cloud/docs/tinymce/latest/powerpaste-troubleshooting/ + +#### TinyDrive +- **.Net Core**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-dotnet/ +- **Configuring the Tiny Drive UI**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-ui-options/ +- **Dropbox and Google Drive integration options**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-dropbox-and-google-drive/ +- **Dropbox integration**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-dropbox-integration/ +- **Getting started**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-getting-started/ +- **Google Drive integration**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-googledrive-integration/ +- **Introduction to the Tiny Drive plugin APIs**: https://www.tiny.cloud/docs/tinymce/latest/introduction-to-tinydrive-apis/ +- **Java Spring**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-java/ +- **Node.js**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-nodejs/ +- **PHP**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-php/ +- **Set up Tiny Drive JWT Authentication**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-jwt-authentication/ +- **Tiny Drive Browse API**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-browse/ +- **Tiny Drive Changelog**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-changelog/ +- **Tiny Drive Introduction**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-introduction/ +- **Tiny Drive Pick API**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-pick/ +- **Tiny Drive plugin setup options**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-setup-options/ +- **Tiny Drive TypeScript interfaces**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-type-interfaces/ +- **Tiny Drive Upload API**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-upload/ +- **Toolbar buttons and menu items for the Tiny Drive plugin**: https://www.tiny.cloud/docs/tinymce/latest/tinydrive-toolbars-menus/ + +#### Media Optimizer +- **Media Optimizer**: https://www.tiny.cloud/docs/tinymce/latest/uploadcare/ +- **Media Optimizer (Files and Documents)**: https://www.tiny.cloud/docs/tinymce/latest/uploadcare-documents/ +- **Media Optimizer (Image)**: https://www.tiny.cloud/docs/tinymce/latest/uploadcare-image/ +- **Media Optimizer (Video)**: https://www.tiny.cloud/docs/tinymce/latest/uploadcare-video/ + +#### Services & Infrastructure +- **Common server-side component settings**: https://www.tiny.cloud/docs/tinymce/latest/configure-common-settings-services/ +- **Configure Enhanced Media Embed Server**: https://www.tiny.cloud/docs/tinymce/latest/mediaembed-server-config/ +- **Creating a private/public key pair for Tiny Cloud**: https://www.tiny.cloud/docs/tinymce/latest/generate-rsa-key-pairs/ +- **Deploy the TinyMCE Export to PDF service server-side component using Docker (individually licensed)**: https://www.tiny.cloud/docs/tinymce/latest/individual-export-to-pdf-on-premises/ +- **Deploy the TinyMCE Hyperlinking server-side component using Docker**: https://www.tiny.cloud/docs/tinymce/latest/individual-hyperlinking-container/ +- **Deploy the TinyMCE Image Proxy service server-side component using Docker**: https://www.tiny.cloud/docs/tinymce/latest/individual-image-proxy-container/ +- **Deploy the TinyMCE Import from Word and Export to Word service server-side component using Docker (individually licensed)**: https://www.tiny.cloud/docs/tinymce/latest/individual-import-from-word-and-export-to-word-on-premises/ +- **Hyperlinking service settings**: https://www.tiny.cloud/docs/tinymce/latest/configure-hyperlink-service/ +- **Image Proxy service settings**: https://www.tiny.cloud/docs/tinymce/latest/configure-imageproxy-service/ +- **Integrate Enhanced Media Embed Server**: https://www.tiny.cloud/docs/tinymce/latest/mediaembed-server-integration/ +- **License key**: https://www.tiny.cloud/docs/tinymce/latest/license-key/ +- **Required configuration for the server-side components**: https://www.tiny.cloud/docs/tinymce/latest/configure-required-services/ +- **Troubleshoot server-side components**: https://www.tiny.cloud/docs/tinymce/latest/troubleshoot-server/ + + +### Customization & Development + +#### Creating Custom Components +- **Create a plugin for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/creating-a-plugin/ +- **Create a Skin for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/creating-a-skin/ +- **Create an icon pack for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/creating-an-icon-pack/ +- **Create custom notifications**: https://www.tiny.cloud/docs/tinymce/latest/creating-custom-notifications/ +- **Creating custom Basic toolbar buttons**: https://www.tiny.cloud/docs/tinymce/latest/custom-basic-toolbar-button/ +- **Creating custom dialogs**: https://www.tiny.cloud/docs/tinymce/latest/dialog/ +- **Creating custom Group toolbar buttons**: https://www.tiny.cloud/docs/tinymce/latest/custom-group-toolbar-button/ +- **Creating custom menu items**: https://www.tiny.cloud/docs/tinymce/latest/creating-custom-menu-items/ +- **Creating custom Menu toolbar buttons**: https://www.tiny.cloud/docs/tinymce/latest/custom-menu-toolbar-button/ +- **Creating custom Split toolbar buttons**: https://www.tiny.cloud/docs/tinymce/latest/custom-split-toolbar-button/ +- **Creating custom Toggle toolbar buttons**: https://www.tiny.cloud/docs/tinymce/latest/custom-toggle-toolbar-button/ +- **Custom Basic menu items**: https://www.tiny.cloud/docs/tinymce/latest/custom-basic-menu-items/ +- **Custom Icon Pack Demo**: https://www.tiny.cloud/docs/tinymce/latest/custom-icon-pack-demo/ +- **Custom Nested menu items**: https://www.tiny.cloud/docs/tinymce/latest/custom-nested-menu-items/ +- **Custom Toggle menu items**: https://www.tiny.cloud/docs/tinymce/latest/custom-toggle-menu-items/ +- **Custom view**: https://www.tiny.cloud/docs/tinymce/latest/custom-view/ +- **Customizing the editor UI**: https://www.tiny.cloud/docs/tinymce/latest/customize-ui/ +- **Toolbar buttons**: https://www.tiny.cloud/docs/tinymce/latest/custom-toolbarbuttons/ +- **User interface components**: https://www.tiny.cloud/docs/tinymce/latest/ui-components/ + +#### Bundling & Build Tools +- **Bundling a .zip version of TinyMCE with CommonJS and Browserify**: https://www.tiny.cloud/docs/tinymce/latest/browserify-cjs-download/ +- **Bundling a .zip version of TinyMCE with CommonJS and Webpack**: https://www.tiny.cloud/docs/tinymce/latest/webpack-cjs-download/ +- **Bundling a .zip version of TinyMCE with ES6 and Rollup.js**: https://www.tiny.cloud/docs/tinymce/latest/rollup-es6-download/ +- **Bundling a .zip version of TinyMCE with ES6 and Webpack**: https://www.tiny.cloud/docs/tinymce/latest/webpack-es6-download/ +- **Bundling an NPM version of TinyMCE with CommonJS and Browserify**: https://www.tiny.cloud/docs/tinymce/latest/browserify-cjs-npm/ +- **Bundling an NPM version of TinyMCE with ES6 and Rollup.js**: https://www.tiny.cloud/docs/tinymce/latest/rollup-es6-npm/ +- **Bundling the User Interface localizations for TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/bundling-localization/ +- **Bundling TinyMCE content CSS using module loading**: https://www.tiny.cloud/docs/tinymce/latest/bundling-content-css/ +- **Bundling TinyMCE from NPM using Webpack and CommonJS**: https://www.tiny.cloud/docs/tinymce/latest/webpack-cjs-npm/ +- **Bundling TinyMCE from NPM with ES6 and Vite**: https://www.tiny.cloud/docs/tinymce/latest/vite-es6-npm/ +- **Bundling TinyMCE from NPM with Webpack using ES6 modules**: https://www.tiny.cloud/docs/tinymce/latest/webpack-es6-npm/ +- **Bundling TinyMCE icon packs using module loading**: https://www.tiny.cloud/docs/tinymce/latest/bundling-icons/ +- **Bundling TinyMCE models using module loading**: https://www.tiny.cloud/docs/tinymce/latest/bundling-models/ +- **Bundling TinyMCE plugins using module loading**: https://www.tiny.cloud/docs/tinymce/latest/bundling-plugins/ +- **Bundling TinyMCE skins using module loading**: https://www.tiny.cloud/docs/tinymce/latest/bundling-skins/ +- **Bundling TinyMCE themes using module loading**: https://www.tiny.cloud/docs/tinymce/latest/bundling-themes/ +- **Introduction and initial setup for containerized server-side services from the premium self-hosted bundles**: https://www.tiny.cloud/docs/tinymce/latest/bundle-intro-setup/ +- **Introduction to bundling TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/introduction-to-bundling-tinymce/ + +#### Enhanced Skins & Icons +- **Enhanced Skins & Icon Packs**: https://www.tiny.cloud/docs/tinymce/latest/enhanced-skins-and-icon-packs/ +- **Using the icon pack template tool**: https://www.tiny.cloud/docs/tinymce/latest/using-the-icon-pack-template/ + + +### API Reference + +#### Core APIs +- **tinymce**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.root/ +- **tinymce.AddOnManager**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.addonmanager/ +- **tinymce.Editor**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/ +- **tinymce.editor.ui.Registry**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.registry/ +- **tinymce.editor.ui.Ui**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.ui/ +- **tinymce.EditorManager**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editormanager/ +- **tinymce.EditorMode**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editormode/ +- **tinymce.EditorOptions**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editoroptions/ +- **tinymce.EditorUpload**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editorupload/ +- **tinymce.Plugin**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.plugin/ +- **tinymce.Theme**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.theme/ + +#### UI APIs +- **tinymce.NotificationManager**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.notificationmanager/ +- **tinymce.Shortcuts**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.shortcuts/ +- **tinymce.WindowManager**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.windowmanager/ + +#### Utility APIs +- **tinymce.Annotator**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.annotator/ +- **tinymce.Env**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.env/ +- **tinymce.Event**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.event/ +- **tinymce.FakeClipboard**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.fakeclipboard/ +- **tinymce.Formatter**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.formatter/ +- **tinymce.UndoManager**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.undomanager/ +- **tinymce.UserLookup**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.userlookup/ +- **tinymce.util.Delay**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.util.delay/ +- **tinymce.util.EventDispatcher**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.util.eventdispatcher/ +- **tinymce.util.I18n**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.util.i18n/ +- **tinymce.util.ImageUploader**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.util.imageuploader/ +- **tinymce.util.Observable**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.util.observable/ +- **tinymce.util.Tools**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.util.tools/ +- **tinymce.util.URI**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.util.uri/ + +#### DOM APIs +- **tinymce.dom.BookmarkManager**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.bookmarkmanager/ +- **tinymce.dom.DOMUtils**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.domutils/ +- **tinymce.dom.EventUtils**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.eventutils/ +- **tinymce.dom.RangeUtils**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.rangeutils/ +- **tinymce.dom.ScriptLoader**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.scriptloader/ +- **tinymce.dom.Selection**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/ +- **tinymce.dom.Serializer**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.serializer/ +- **tinymce.dom.StyleSheetLoader**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.stylesheetloader/ +- **tinymce.dom.TextSeeker**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.textseeker/ +- **tinymce.dom.TreeWalker**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.treewalker/ + +#### HTML APIs +- **tinymce.html.DomParser**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.domparser/ +- **tinymce.html.Entities**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.entities/ +- **tinymce.html.Node**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.node/ +- **tinymce.html.Schema**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.schema/ +- **tinymce.html.Serializer**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.serializer/ +- **tinymce.html.Styles**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.styles/ +- **tinymce.html.Writer**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.html.writer/ + +#### Geometry APIs +- **tinymce.geom.Rect**: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.geom.rect/ + + +### Migration Guides + +- **Migrating from Froala to TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-froala/ +- **Migrating from TinyMCE 4 to TinyMCE 7.0**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-4x/ +- **Migrating from TinyMCE 4 to TinyMCE 8**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-4x-to-8x/ +- **Migrating from TinyMCE 5 to TinyMCE 7.0**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-5x/ +- **Migrating from TinyMCE 5 to TinyMCE 8**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-5x-to-8x/ +- **Migrating from TinyMCE 6 to TinyMCE 7.0**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-6x/ +- **Migrating from TinyMCE 6 to TinyMCE 8**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-6x-to-8x/ +- **Migrating from TinyMCE 7 to TinyMCE 8**: https://www.tiny.cloud/docs/tinymce/latest/migration-from-7x/ +- **TinyMCE Migration Guides**: https://www.tiny.cloud/docs/tinymce/latest/migration-guides/ +- **Upgrading TinyMCE**: https://www.tiny.cloud/docs/tinymce/latest/upgrading/ + + +### Examples & Demos + +- **Basic example**: https://www.tiny.cloud/docs/tinymce/latest/basic-example/ +- **Borderless skin demo**: https://www.tiny.cloud/docs/tinymce/latest/borderless-demo/ +- **Classic editor example**: https://www.tiny.cloud/docs/tinymce/latest/classic-demo/ +- **Distraction-free editor example**: https://www.tiny.cloud/docs/tinymce/latest/distraction-free-demo/ +- **Fabric skin demo**: https://www.tiny.cloud/docs/tinymce/latest/fabric-demo/ +- **Fluent skin demo**: https://www.tiny.cloud/docs/tinymce/latest/fluent-demo/ +- **Full featured demo: Including Premium Plugins**: https://www.tiny.cloud/docs/tinymce/latest/full-featured-premium-demo/ +- **Full featured demo: Non-Premium Plugins only**: https://www.tiny.cloud/docs/tinymce/latest/full-featured-open-source-demo/ +- **How To Guides**: https://www.tiny.cloud/docs/tinymce/latest/how-to-guides/ +- **Inline editor example**: https://www.tiny.cloud/docs/tinymce/latest/inline-demo/ +- **Jam icons pack demo**: https://www.tiny.cloud/docs/tinymce/latest/jam-demo/ +- **Material Classic skin demo**: https://www.tiny.cloud/docs/tinymce/latest/material-classic-demo/ +- **Material Outline skin demo**: https://www.tiny.cloud/docs/tinymce/latest/material-outline-demo/ +- **Naked skin demo**: https://www.tiny.cloud/docs/tinymce/latest/naked-demo/ +- **Outside skin demo**: https://www.tiny.cloud/docs/tinymce/latest/outside-demo/ +- **Small icons pack demo**: https://www.tiny.cloud/docs/tinymce/latest/small-demo/ +- **Snow skin demo**: https://www.tiny.cloud/docs/tinymce/latest/snow-demo/ +- **TinyMCE 8 examples**: https://www.tiny.cloud/docs/tinymce/latest/examples/ + + +### Release Information + +- **Changelog**: https://www.tiny.cloud/docs/tinymce/latest/changelog/ +- **Release notes for TinyMCE 8**: https://www.tiny.cloud/docs/tinymce/latest/release-notes/ +- **TinyMCE 8.0.0**: https://www.tiny.cloud/docs/tinymce/latest/8.0-release-notes/ +- **TinyMCE 8.0.1**: https://www.tiny.cloud/docs/tinymce/latest/8.0.1-release-notes/ +- **TinyMCE 8.0.2**: https://www.tiny.cloud/docs/tinymce/latest/8.0.2-release-notes/ +- **TinyMCE 8.1**: https://www.tiny.cloud/docs/tinymce/latest/8.1.0-release-notes/ +- **TinyMCE 8.1.1**: https://www.tiny.cloud/docs/tinymce/latest/8.1.1-release-notes/ +- **TinyMCE 8.1.2**: https://www.tiny.cloud/docs/tinymce/latest/8.1.2-release-notes/ +- **TinyMCE 8.2.0**: https://www.tiny.cloud/docs/tinymce/latest/8.2.0-release-notes/ +- **TinyMCE 8.2.1**: https://www.tiny.cloud/docs/tinymce/latest/8.2.1-release-notes/ +- **TinyMCE 8.2.2**: https://www.tiny.cloud/docs/tinymce/latest/8.2.2-release-notes/ +- **TinyMCE 8.3.0**: https://www.tiny.cloud/docs/tinymce/latest/8.3.0-release-notes/ +- **TinyMCE 8.3.1**: https://www.tiny.cloud/docs/tinymce/latest/8.3.1-release-notes/ +- **TinyMCE 8.3.2**: https://www.tiny.cloud/docs/tinymce/latest/8.3.2-release-notes/ + + +### Accessibility & Security + +- **Accessibility options**: https://www.tiny.cloud/docs/tinymce/latest/accessibility/ +- **Accessible navigation guide**: https://www.tiny.cloud/docs/tinymce/latest/tinymce-and-screenreaders/ +- **Custom Keyboard Shortcuts**: https://www.tiny.cloud/docs/tinymce/latest/shortcuts/ +- **Security guide**: https://www.tiny.cloud/docs/tinymce/latest/security/ +- **TinyMCE for Touch-Enabled and Mobile Devices**: https://www.tiny.cloud/docs/tinymce/latest/tinymce-for-mobile/ +- **TinyMCE Keyboard shortcuts**: https://www.tiny.cloud/docs/tinymce/latest/keyboard-shortcuts/ + + +### Support & Resources + +- **Premium upgrade promotion**: https://www.tiny.cloud/docs/tinymce/latest/promotions/ +- **Support**: https://www.tiny.cloud/docs/tinymce/latest/support/ +- **Tiny Docs Ai**: https://www.tiny.cloud/docs/tinymce/latest/tiny-docs-ai/ + + +### Legacy & Other + +- **Interactive integration example**: https://www.tiny.cloud/docs/tinymce/latest/ie-template-creation/ +- **MoxieManager plugin**: https://www.tiny.cloud/docs/tinymce/latest/moxiemanager/ + diff --git a/modules/ROOT/attachments/llms.txt b/modules/ROOT/attachments/llms.txt new file mode 100644 index 0000000000..b1857d5fb3 --- /dev/null +++ b/modules/ROOT/attachments/llms.txt @@ -0,0 +1,105 @@ +# TinyMCE Documentation + +> Rich text editor for web applications. The latest stable version is TinyMCE 8. + +TinyMCE is a powerful, flexible WYSIWYG rich text editor that can be integrated into any web application. + +**IMPORTANT**: Always use TinyMCE 8 for new projects. Use `tinymce@8` or `tinymce/8` in CDN URLs and package installations. + +## Getting Started + +- [Getting Started](https://www.tiny.cloud/docs/tinymce/latest/getting-started/): Overview and introduction to TinyMCE +- [Introduction to TinyMCE](https://www.tiny.cloud/docs/tinymce/latest/introduction-to-tinymce/): What is TinyMCE and how to add it to your project +- [Installation](https://www.tiny.cloud/docs/tinymce/latest/installation/): Installation options and methods + +### Quick Start Guides + +- [Cloud Quick Start](https://www.tiny.cloud/docs/tinymce/latest/cloud-quick-start/): Get started with Tiny Cloud CDN (recommended) +- [NPM Quick Start](https://www.tiny.cloud/docs/tinymce/latest/npm-projects/): Install via npm, yarn, or pnpm +- [ZIP Quick Start](https://www.tiny.cloud/docs/tinymce/latest/zip-install/): Download and install from ZIP archive + +## Integration Guides + +See the complete documentation index in llms-full.txt for all available integration pages. + +## Basic Setup Examples + +### Cloud Deployment (Recommended) + +```html + + +``` + +### Self-Hosted (NPM) + +```bash +npm install tinymce@8 +``` + +```html + + +``` + +### React Example + +```jsx +import { Editor } from '@tinymce/tinymce-react'; + +function App() { + return ( + + ); +} +``` + +## Key Configuration + +- [Basic Setup](https://www.tiny.cloud/docs/tinymce/latest/basic-setup/): Essential configuration options +- [Content Filtering](https://www.tiny.cloud/docs/tinymce/latest/filter-content/): Control HTML output +- [Localization](https://www.tiny.cloud/docs/tinymce/latest/localize-your-language/): Multi-language support +- [Spell Checking](https://www.tiny.cloud/docs/tinymce/latest/spell-checking/): Enable spell checking +- [Cloud Deployment Guide](https://www.tiny.cloud/docs/tinymce/latest/cloud-deployment-guide/): Configure Tiny Cloud + +## Plugins & Features + +- [Plugins Overview](https://www.tiny.cloud/docs/tinymce/latest/plugins/): Available plugins and features +- [Table Plugin](https://www.tiny.cloud/docs/tinymce/latest/table/): Table editing capabilities +- [Image Plugin](https://www.tiny.cloud/docs/tinymce/latest/image/): Image handling and editing +- [Link Plugin](https://www.tiny.cloud/docs/tinymce/latest/link/): Link management + +## API Reference + +- [Editor API](https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor/): Core editor API +- [Plugin API](https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.plugin/): Plugin development API + +## Migration & Upgrading + +- [Upgrading TinyMCE](https://www.tiny.cloud/docs/tinymce/latest/upgrading/): Upgrade guide +- [Migration from 7.x](https://www.tiny.cloud/docs/tinymce/latest/migration-from-7x/): Migrate from TinyMCE 7 + +## Complete Documentation + +For a complete list of all 395 documentation pages, see [llms-full.txt](https://www.tiny.cloud/docs/llms-full.txt). + diff --git a/modules/ROOT/examples/live-demos/tinymceai/example.js b/modules/ROOT/examples/live-demos/tinymceai/example.js new file mode 100644 index 0000000000..0b369a464b --- /dev/null +++ b/modules/ROOT/examples/live-demos/tinymceai/example.js @@ -0,0 +1,13 @@ +// Step 1: Set up session - this should be part of the application's user management process. +tinymce.init({ + selector: 'textarea#tinymceai', + height: '610px', + plugins: ["tinymceai", "advlist", "anchor", "autolink", "charmap", "code"], + toolbar: "undo redo | tinymceai-chat tinymceai-quickactions tinymceai-review | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", + tinymceai_token_provider: async () => { + // Step 2: Check we have a session then fetch JWT from your backend + return fetch('/api/tinymceai-token', { credentials: "include" }) + .then(resp => resp.text()) + .then(token => ({ token })); + } +}); diff --git a/modules/ROOT/examples/live-demos/tinymceai/index.html b/modules/ROOT/examples/live-demos/tinymceai/index.html new file mode 100644 index 0000000000..1d9c508cf8 --- /dev/null +++ b/modules/ROOT/examples/live-demos/tinymceai/index.html @@ -0,0 +1,71 @@ + diff --git a/modules/ROOT/examples/live-demos/tinymceai/index.js b/modules/ROOT/examples/live-demos/tinymceai/index.js new file mode 100644 index 0000000000..78926754c9 --- /dev/null +++ b/modules/ROOT/examples/live-demos/tinymceai/index.js @@ -0,0 +1,18 @@ +// Step 1: Set up session - this should be part of the application's user management process. We simulate that here by creating a session for a random user. +const apiKey = '{{tinymceai_demo_api_key}}'; +const isLoggedIn = fetch(`https://demo.api.tiny.cloud/1/${apiKey}/auth/random`, { method: "POST", credentials: "include" }); + +tinymce.init({ + selector: 'textarea#tinymceai', + height: '610px', + plugins: ["tinymceai", "advlist", "anchor", "autolink", "charmap", "code"], + toolbar: "undo redo | tinymceai-chat tinymceai-quickactions tinymceai-review | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", + tinymceai_token_provider: async () => { + // Step 2: Check we have a session then fetch JWT + return isLoggedIn.then(() => + fetch(`https://demo.api.tiny.cloud/1/${apiKey}/jwt/tinymceai`, { credentials: "include" }) + .then(resp => resp.text()) + .then(token => ({ token })) + ); + } +}); diff --git a/modules/ROOT/images/icons/adjust-length.svg b/modules/ROOT/images/icons/adjust-length.svg new file mode 100644 index 0000000000..745ddb676f --- /dev/null +++ b/modules/ROOT/images/icons/adjust-length.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/ai-assistant.svg b/modules/ROOT/images/icons/ai-assistant.svg new file mode 100644 index 0000000000..a7e31873f5 --- /dev/null +++ b/modules/ROOT/images/icons/ai-assistant.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/ai-chat-response.svg b/modules/ROOT/images/icons/ai-chat-response.svg new file mode 100644 index 0000000000..6964984d49 --- /dev/null +++ b/modules/ROOT/images/icons/ai-chat-response.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/ai-model.svg b/modules/ROOT/images/icons/ai-model.svg new file mode 100644 index 0000000000..c225787860 --- /dev/null +++ b/modules/ROOT/images/icons/ai-model.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/ai-review.svg b/modules/ROOT/images/icons/ai-review.svg new file mode 100644 index 0000000000..139cf4c603 --- /dev/null +++ b/modules/ROOT/images/icons/ai-review.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/attachment.svg b/modules/ROOT/images/icons/attachment.svg new file mode 100644 index 0000000000..4885951b3b --- /dev/null +++ b/modules/ROOT/images/icons/attachment.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/change-tone.svg b/modules/ROOT/images/icons/change-tone.svg new file mode 100644 index 0000000000..e915836bd1 --- /dev/null +++ b/modules/ROOT/images/icons/change-tone.svg @@ -0,0 +1,4 @@ + + + + diff --git a/modules/ROOT/images/icons/chat-commands.svg b/modules/ROOT/images/icons/chat-commands.svg new file mode 100644 index 0000000000..b01f4a0a03 --- /dev/null +++ b/modules/ROOT/images/icons/chat-commands.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/chat-reasoning.svg b/modules/ROOT/images/icons/chat-reasoning.svg new file mode 100644 index 0000000000..b56c0150f2 --- /dev/null +++ b/modules/ROOT/images/icons/chat-reasoning.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/chat-send.svg b/modules/ROOT/images/icons/chat-send.svg new file mode 100644 index 0000000000..f0a9cfb21d --- /dev/null +++ b/modules/ROOT/images/icons/chat-send.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/chat-web-search.svg b/modules/ROOT/images/icons/chat-web-search.svg new file mode 100644 index 0000000000..e20b98635c --- /dev/null +++ b/modules/ROOT/images/icons/chat-web-search.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/collapse.svg b/modules/ROOT/images/icons/collapse.svg new file mode 100644 index 0000000000..65ad8b182e --- /dev/null +++ b/modules/ROOT/images/icons/collapse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/continue-writing.svg b/modules/ROOT/images/icons/continue-writing.svg new file mode 100644 index 0000000000..d12fb72b68 --- /dev/null +++ b/modules/ROOT/images/icons/continue-writing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/document-gear-properties.svg b/modules/ROOT/images/icons/document-gear-properties.svg new file mode 100644 index 0000000000..bc305f278e --- /dev/null +++ b/modules/ROOT/images/icons/document-gear-properties.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/document-properties.svg b/modules/ROOT/images/icons/document-properties.svg new file mode 100644 index 0000000000..eba5de0b3f --- /dev/null +++ b/modules/ROOT/images/icons/document-properties.svg @@ -0,0 +1,10 @@ + + + + icon-document-properties + Created with Sketch. + + + + + \ No newline at end of file diff --git a/modules/ROOT/images/icons/explain.svg b/modules/ROOT/images/icons/explain.svg new file mode 100644 index 0000000000..f67923bb5a --- /dev/null +++ b/modules/ROOT/images/icons/explain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/fix-grammar.svg b/modules/ROOT/images/icons/fix-grammar.svg new file mode 100644 index 0000000000..a662954b3a --- /dev/null +++ b/modules/ROOT/images/icons/fix-grammar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/folder.svg b/modules/ROOT/images/icons/folder.svg index 9bd6f4a888..ae0a8ba4a0 100644 --- a/modules/ROOT/images/icons/folder.svg +++ b/modules/ROOT/images/icons/folder.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/modules/ROOT/images/icons/highlight-key-points.svg b/modules/ROOT/images/icons/highlight-key-points.svg new file mode 100644 index 0000000000..ac55d21952 --- /dev/null +++ b/modules/ROOT/images/icons/highlight-key-points.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/image-enhancements.svg b/modules/ROOT/images/icons/image-enhancements.svg new file mode 100644 index 0000000000..c813b13aba --- /dev/null +++ b/modules/ROOT/images/icons/image-enhancements.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/improve-writing.svg b/modules/ROOT/images/icons/improve-writing.svg new file mode 100644 index 0000000000..91667e17ef --- /dev/null +++ b/modules/ROOT/images/icons/improve-writing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/mentions.svg b/modules/ROOT/images/icons/mentions.svg new file mode 100644 index 0000000000..f8ac71642f --- /dev/null +++ b/modules/ROOT/images/icons/mentions.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/new-chat.svg b/modules/ROOT/images/icons/new-chat.svg new file mode 100644 index 0000000000..82f2efe376 --- /dev/null +++ b/modules/ROOT/images/icons/new-chat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/other-actions.svg b/modules/ROOT/images/icons/other-actions.svg new file mode 100644 index 0000000000..4f92bff29e --- /dev/null +++ b/modules/ROOT/images/icons/other-actions.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/pin.svg b/modules/ROOT/images/icons/pin.svg new file mode 100644 index 0000000000..e28175472e --- /dev/null +++ b/modules/ROOT/images/icons/pin.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/reasoning.svg b/modules/ROOT/images/icons/reasoning.svg new file mode 100644 index 0000000000..3e84782564 --- /dev/null +++ b/modules/ROOT/images/icons/reasoning.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/revert-changes.svg b/modules/ROOT/images/icons/revert-changes.svg new file mode 100644 index 0000000000..1c417c9686 --- /dev/null +++ b/modules/ROOT/images/icons/revert-changes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/source-close.svg b/modules/ROOT/images/icons/source-close.svg new file mode 100644 index 0000000000..894df4eb83 --- /dev/null +++ b/modules/ROOT/images/icons/source-close.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/source-file.svg b/modules/ROOT/images/icons/source-file.svg new file mode 100644 index 0000000000..a82a0fc0a5 --- /dev/null +++ b/modules/ROOT/images/icons/source-file.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/source-image.svg b/modules/ROOT/images/icons/source-image.svg new file mode 100644 index 0000000000..f250e829f7 --- /dev/null +++ b/modules/ROOT/images/icons/source-image.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/source-link.svg b/modules/ROOT/images/icons/source-link.svg new file mode 100644 index 0000000000..4ff86432a1 --- /dev/null +++ b/modules/ROOT/images/icons/source-link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/source-selection.svg b/modules/ROOT/images/icons/source-selection.svg new file mode 100644 index 0000000000..8fc4eb63eb --- /dev/null +++ b/modules/ROOT/images/icons/source-selection.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/stop.svg b/modules/ROOT/images/icons/stop.svg new file mode 100644 index 0000000000..ac0676d46d --- /dev/null +++ b/modules/ROOT/images/icons/stop.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/images/icons/summarize.svg b/modules/ROOT/images/icons/summarize.svg new file mode 100644 index 0000000000..2a5f83eb4b --- /dev/null +++ b/modules/ROOT/images/icons/summarize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/ROOT/images/icons/table-properties.svg b/modules/ROOT/images/icons/table-properties.svg new file mode 100644 index 0000000000..9e14616a49 --- /dev/null +++ b/modules/ROOT/images/icons/table-properties.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/modules/ROOT/images/icons/unpin.svg b/modules/ROOT/images/icons/unpin.svg new file mode 100644 index 0000000000..6e14e3420a --- /dev/null +++ b/modules/ROOT/images/icons/unpin.svg @@ -0,0 +1,4 @@ + + + + diff --git a/modules/ROOT/images/icons/web-search.svg b/modules/ROOT/images/icons/web-search.svg new file mode 100644 index 0000000000..27f9630fdf --- /dev/null +++ b/modules/ROOT/images/icons/web-search.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 35fd12a1c3..7fe983a16e 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -260,6 +260,24 @@ **** 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-models.adoc[AI Models] +**** xref:tinymceai-limits.adoc[Limits] +**** 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] +****** xref:tinymceai-streaming.adoc[Streaming] +**** xref:tinymceai-jwt-authentication-intro.adoc[JWT Authentication] +***** xref:tinymceai-permissions.adoc[Permissions] +***** Guides +****** 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 diff --git a/modules/ROOT/pages/available-menu-items.adoc b/modules/ROOT/pages/available-menu-items.adoc index 65d7edf122..19e1c3d121 100644 --- a/modules/ROOT/pages/available-menu-items.adoc +++ b/modules/ROOT/pages/available-menu-items.adoc @@ -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 diff --git a/modules/ROOT/pages/available-toolbar-buttons.adoc b/modules/ROOT/pages/available-toolbar-buttons.adoc index 065e97ac95..fa62ebcb2c 100644 --- a/modules/ROOT/pages/available-toolbar-buttons.adoc +++ b/modules/ROOT/pages/available-toolbar-buttons.adoc @@ -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 diff --git a/modules/ROOT/pages/editor-command-identifiers.adoc b/modules/ROOT/pages/editor-command-identifiers.adoc index 134b326630..87ce38f82d 100644 --- a/modules/ROOT/pages/editor-command-identifiers.adoc +++ b/modules/ROOT/pages/editor-command-identifiers.adoc @@ -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] @@ -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 diff --git a/modules/ROOT/pages/events.adoc b/modules/ROOT/pages/events.adoc index 22f2175abb..def921efae 100644 --- a/modules/ROOT/pages/events.adoc +++ b/modules/ROOT/pages/events.adoc @@ -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] diff --git a/modules/ROOT/pages/exportpdf.adoc b/modules/ROOT/pages/exportpdf.adoc index 1be2a9d008..7bdb1c607e 100644 --- a/modules/ROOT/pages/exportpdf.adoc +++ b/modules/ROOT/pages/exportpdf.adoc @@ -92,4 +92,4 @@ include::partial$commands/{plugincode}-cmds.adoc[] == API Reference -> Explore the comprehensive API documentation for the {pluginname} Premium plugin at https://exportpdf.api.tiny.cloud/docs[{pluginname} API Reference Documentation.^] +> Explore the comprehensive API documentation for the {pluginname} Premium plugin at https://exportpdf.api.tiny.cloud/v1/convert/docs[{pluginname} API Reference Documentation.^] diff --git a/modules/ROOT/pages/html-to-pdf-converter-api.adoc b/modules/ROOT/pages/html-to-pdf-converter-api.adoc index 3beeff4ac2..2a655566ab 100644 --- a/modules/ROOT/pages/html-to-pdf-converter-api.adoc +++ b/modules/ROOT/pages/html-to-pdf-converter-api.adoc @@ -27,9 +27,9 @@ The {servicename} is a powerful tool that seamlessly integrates advanced documen Tailor your PDF documents to suit your needs: -* **Custom CSS Styling:** Apply link:https://exportpdf.api.tiny.cloud/docs#section/General/CSS[custom CSS^] styles to your PDFs for brand consistency and enhanced presentation. -* **Header and Footer Options:** Add link:https://exportpdf.api.tiny.cloud/docs#section/PDF-options/Header-and-footer[headers, footers^], and other branding elements to your PDF documents for a professional touch. -* **Page Formatting:** Control page settings such as orientation, link:https://exportpdf.api.tiny.cloud/docs#section/PDF-options/Margins[margins^], and link:https://exportpdf.api.tiny.cloud/docs#section/PDF-options/Page-format[page size] to optimize readability. +* **Custom CSS Styling:** Apply link:https://exportpdf.api.tiny.cloud/v1/convert/docs#section/General/CSS[custom CSS^] styles to your PDFs for brand consistency and enhanced presentation. +* **Header and Footer Options:** Add link:https://exportpdf.api.tiny.cloud/v1/convert/docs#section/PDF-options/Header-and-footer[headers, footers^], and other branding elements to your PDF documents for a professional touch. +* **Page Formatting:** Control page settings such as orientation, link:https://exportpdf.api.tiny.cloud/v1/convert/docs#section/PDF-options/Margins[margins^], and link:https://exportpdf.api.tiny.cloud/v1/convert/docs#section/PDF-options/Page-format[page size] to optimize readability. == Ideal for Various Use Cases @@ -40,4 +40,4 @@ Tailor your PDF documents to suit your needs: == PDF Converter API Reference -> Explore the comprehensive API documentation at link:https://exportpdf.api.tiny.cloud/docs[PDF Converter API Reference documentation.^] \ No newline at end of file +> Explore the comprehensive API documentation at link:https://exportpdf.api.tiny.cloud/v1/convert/docs[PDF Converter API Reference documentation.^] \ No newline at end of file diff --git a/modules/ROOT/pages/installation.adoc b/modules/ROOT/pages/installation.adoc index 2adf73388b..6092f662d5 100644 --- a/modules/ROOT/pages/installation.adoc +++ b/modules/ROOT/pages/installation.adoc @@ -32,43 +32,43 @@ The following packages are thin wrappers around {productname} to make it easier [.lead] xref:react-cloud.adoc[React] -Integrate {productname} into your React application using the {cloudname}. +Integrate {productname} into your React application. | [.lead] xref:angular-cloud.adoc[Angular] -Integrate {productname} into your Angular application using the {cloudname}. +Integrate {productname} into your Angular application. | [.lead] xref:vue-cloud.adoc[Vue.js] -Integrate {productname} into your Vue.js application using the {cloudname}. +Integrate {productname} into your Vue.js application. | [.lead] xref:blazor-cloud.adoc[Blazor] -Integrate {productname} into your Blazor application using the {cloudname}. +Integrate {productname} into your Blazor application. | [.lead] xref:svelte-cloud.adoc[Svelte] -Integrate {productname} into your Svelte application using the {cloudname}. +Integrate {productname} into your Svelte application. | [.lead] xref:webcomponent-cloud.adoc[Web Component] -Integrate {productname} as a web component using the {cloudname}. +Integrate {productname} as a web component. | [.lead] xref:jquery-cloud.adoc[jQuery] -Integrate {productname} with the jQuery JavaScript library using the {cloudname}. +Integrate {productname} with the jQuery JavaScript library. // Empty cell to even out rows | @@ -83,19 +83,19 @@ Integrate {productname} with the jQuery JavaScript library using the {cloudname} [.lead] xref:django-cloud.adoc[Django] -Integrate {productname} into your Django application using the {cloudname}. +Integrate {productname} into your Django application. | [.lead] xref:laravel-tiny-cloud.adoc[Laravel] -Integrate {productname} into your Laravel application using the {cloudname}. +Integrate {productname} into your Laravel application. | [.lead] xref:rails-cloud.adoc[Ruby on Rails] -Integrate {productname} into your Ruby on Rails application using the {cloudname}. +Integrate {productname} into your Ruby on Rails application. // Empty cell to even out rows | @@ -112,6 +112,6 @@ Integrate {productname} into your Ruby on Rails application using the {cloudname [.lead] xref:bootstrap-cloud.adoc[Bootstrap] -Integrate {productname} with the Bootstrap CSS framework using the {cloudname}. +Integrate {productname} with the Bootstrap CSS framework. | |=== diff --git a/modules/ROOT/pages/tiny-docs-ai.adoc b/modules/ROOT/pages/tiny-docs-ai.adoc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/ROOT/pages/tinymceai-actions-plugin.adoc b/modules/ROOT/pages/tinymceai-actions-plugin.adoc new file mode 100644 index 0000000000..252b22fe9e --- /dev/null +++ b/modules/ROOT/pages/tinymceai-actions-plugin.adoc @@ -0,0 +1,265 @@ += TinyMCE AI Quick Actions +:navtitle: Quick Actions +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: Quick actions feature for TinyMCE AI plugin +:description_short: quick actions feature +:keywords: AI, quick actions, actions, tinymceai +:page-role: -toc + +Quick actions simplify 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]. + +The Quick Actions feature is available as a plugin UI and through the xref:tinymceai-actions-plugin.adoc#actions-api[Actions API]. This page covers both: + +* Plugin sections describe user-facing features and configuration. +* API sections cover REST API access (starting at xref:tinymceai-actions-plugin.adoc#actions-api[Actions API]). + +[[demo]] +== Demo + +liveDemo::tinymceai[] + +Actions are fast, stateless operations that transform content directly. Unlike Reviews that provide suggestions, Actions immediately modify content based on the selected operation. + +**When to use Actions vs Reviews:** Use Actions when transforming a selection or small section of text (fix grammar, translate, adjust tone). Use Reviews when analyzing entire documents for quality improvements and getting suggestions without automatically changing the content. + +image::https://placehold.net/default.png[{pluginname} quick actions showing AI-powered suggestions and Q&A functionality] + +[[integration]] +== Integration + +To start using the Quick Actions feature, first load the {pluginname} plugin in the editor configuration. See xref:tinymceai.adoc[Plugin Reference] for installation and enabling AI features. + +Then, add the menu that opens the list of Quick Actions (`tinymceai-quickactions`) image:icons/ai-prompt.svg[Quick Actions icon,24px] to the main toolbar and/or context toolbar (selection toolbar) configurations. + +[NOTE] +==== +AI features are added to the selection toolbar by default when the plugin is enabled. Use the toolbar configuration options to customize which AI features appear. +==== + +To learn more about toolbar configuration, refer to the xref:toolbar-configuration-options.adoc[toolbar configuration] guide. + +image::https://placehold.net/default.png[{pluginname} Quick Actions dropdown in the toolbar] + +Finally, individual Quick Actions can also be added to the toolbar as shortcuts for even easier access. For example, add the `ai-quickactions-improve-writing` image:icons/improve-writing.svg[Improve Writing icon,24px] button, or the `ai-chat-explain` image:icons/explain.svg[Explain icon,24px] button (find it in the demo above). Whole categories can be added 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', + toolbar: 'undo redo tinymceai-chat tinymceai-quickactions tinymceai-review | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', + tinymceai_quickactions_menu: [ + 'ai-quickactions-chat-prompts', + 'ai-quickactions-improve-writing', + 'ai-quickactions-continue-writing', + 'ai-quickactions-check-grammar', + 'ai-quickactions-change-length', + 'ai-quickactions-change-tone', + 'ai-quickactions-translate' + ], + + // Configure a sub-menu (e.g., chat commands) + tinymceai_quickactions_chat_prompts: [ + 'ai-chat-explain', + 'ai-chat-summarize', + 'ai-chat-highlight-key-points' + ], + tinymceai_sidebar_type: 'static', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.text()).then(token => ({ token })); + } +}); +---- + +[[types-of-actions]] +== Types of actions + +There are two types of actions available in the quick actions feature: + +* Chat actions, such as "Explain" or "Summarize", open the xref:tinymceai-chat.adoc[Chat] interface with the selected text added as context and automatically start the conversation with a pre-filled prompt. + +* Preview actions, such as "Continue writing", "Make shorter", "Improve writing", or "Fix grammar", display the AI response in a preview interface where users can review and accept or reject the suggested changes. + +The behavior of each action can be defined when xref:tinymceai-actions-plugin.adoc#custom-actions[creating 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:icons/ai-prompt.svg[Quick Actions icon,24px] (`tinymceai-quickactions`) but also individually when handpicked by the integrator in the xref:toolbar-configuration-options.adoc[editor toolbar configuration]. Whole action categories can be added to the toolbar too. + +Keep in mind that xref:tinymceai-actions-plugin.adoc#custom-actions[custom actions] can be added to the list and xref:tinymceai-actions-plugin.adoc#removing-default-actions[defaults can be removed]. + +Here is the full list of available actions. The identifiers below are used by the REST API. For the plugin UI, configure the Translate submenu using `tinymceai_languages`. + +* **"Chat commands"** category +** `'explain'` +** `'summarize'` +** `'highlight-key-points'` +* `'improve-writing'` +* `'continue'` +* `'fix-grammar'` +* **"Adjust length"** category +** `'make-shorter'` +** `'make-longer'` +* **"Change tone"** category +** `'make-tone-casual'` +** `'make-tone-direct'` +** `'make-tone-friendly'` +** `'make-tone-confident'` +** `'make-tone-professional'` +* **"Translate"** category (API identifiers) +** `'translate-to-english'` +** `'translate-to-chinese'` +** `'translate-to-spanish'` +** `'translate-to-german'` +** `'translate-to-japanese'` +** `'translate-to-portuguese'` +** `'translate-to-korean'` +** `'translate-to-italian'` +** `'translate-to-russian'` + +[[custom-actions]] +== Custom Actions + +The `tinymceai_quickactions_custom` configuration property allows adding new commands to the Quick actions feature. The items can be type `action` (a quick action that goes straight to the preview rendering) or type `chat` (opens the chat interface). The `title` is used in the menu items, while the `prompt` is what is actually sent to the AI. The `model` is required for `action` type commands. Learn more about xref:tinymceai-actions-plugin.adoc#types-of-actions[types of actions]. + +[source,js] +---- +tinymce.init({ + selector: '#editor', + plugins: 'tinymceai', + toolbar: 'tinymceai-quickactions', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.text()).then(token => ({ token })); + }, + tinymceai_quickactions_custom: [ + { + 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' + }, + { + title: 'Summarize in 5 bullet points', + prompt: 'Summarize the selected text in 5 bullet points.', + type: 'chat' + }, + { + title: 'Rewrite adding more sarcasm', + prompt: 'Rewrite using a sarcastic tone.', + type: 'action', + model: 'gemini-2-5-flash' + } + ] +}); +---- + +[[configuring-quick-actions-menu]] +== Configuring Quick Actions menu + +Which actions appear in the Quick Actions menu can be configured by specifying the list of actions to include. The `tinymceai_quickactions_menu` configuration option controls the main menu items. + +Sub-menus have their own configuration options: + +* `tinymceai_quickactions_chat_prompts`: Controls items in the **"Chat commands"** sub-menu +* `tinymceai_quickactions_change_tone_menu`: Controls items in the **"Change tone"** sub-menu +* `tinymceai_languages`: Controls languages in the **"Translate"** sub-menu + +[source,js] +---- +tinymce.init({ + selector: '#editor', + plugins: 'tinymceai', + toolbar: 'tinymceai-quickactions', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.text()).then(token => ({ token })); + }, + // Configure the main Quick Actions menu + tinymceai_quickactions_menu: [ + 'ai-quickactions-chat-prompts', + 'ai-quickactions-improve-writing', + 'ai-quickactions-continue-writing', + 'ai-quickactions-check-grammar', + 'ai-quickactions-change-length', + 'ai-quickactions-change-tone', + 'ai-quickactions-translate', + 'ai-quickactions-custom' + ], + // Configure a sub-menu (e.g., chat commands) + tinymceai_quickactions_chat_prompts: [ + 'ai-chat-explain', + 'ai-chat-summarize', + 'ai-chat-highlight-key-points' + ] +}); +---- + +[[actions-api]] +== Actions API + +The Quick Actions plugin feature is built on top of the Actions API, which provides REST API access to action functionality. Actions are fast, stateless operations that transform content directly. Unlike Reviews that provide suggestions, Actions immediately modify the document content based on the selected operation. + +**When to use Actions vs Reviews:** Use Actions when transforming a selection or small section of text (fix grammar, translate, adjust tone). Use Reviews when analyzing entire documents for quality improvements and getting suggestions without automatically changing the content. + +Unlike conversations, actions do not remember previous interactions. Each action is independent and focused on a single task. Actions use streaming output with Server-Sent Events for real-time feedback as results are generated. + +[[actions-system-actions-api]] +=== System Actions + +{pluginname} provides built-in system actions for common content transformations through the API. These correspond to the default actions available in the plugin UI: + +[cols="2,4,1",options="header"] +|=== +|Action|Description|API +|**Fix Grammar**|Correct grammar, spelling, and punctuation errors.|https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +|**Improve Writing**|Enhance clarity, word choice, and sentence structure.|https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +|**Continue Writing**|Complete unfinished sentences, paragraphs, or entire documents.|https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +|**Make Longer**|Expand content with more detail, examples, and explanations.|https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +|**Make Shorter**|Condense lengthy text while keeping the essential information.|https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +|**Adjust Tone**|Change writing style to casual, professional, friendly, or confident.|https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +|**Translate**|Convert content between languages with proper cultural context.|https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +|=== + +[[actions-custom-actions-api]] +=== Custom Actions through the API + +In addition to system actions, custom actions can be created for specific use cases through the API. Custom actions allow specialized content transformations using custom prompts to control AI behavior. + +Unlike system actions that use predefined identifiers, custom actions use a unified endpoint where the transformation behavior is defined through a prompt parameter. See https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] for the custom actions endpoint and implementation details. + +Custom actions require the `ai:actions:custom` permission in the JWT token. + +[[actions-streaming]] +=== Streaming Responses + +Actions use Server-Sent Events (SSE) for real-time streaming results. See the xref:tinymceai-streaming.adoc[Streaming Responses guide] for detailed implementation information. + +[[actions-api-reference]] +=== API Reference + +For complete endpoint documentation, request/response schemas, authentication details, and additional parameters, see: + +* **https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API Reference]** – Full documentation for system and custom actions endpoints with interactive examples + +The REST API documentation includes examples for: + +* Grammar fix - see https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +* Writing improvement - see https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +* Content expansion (make longer) - see https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +* Content condensation (make shorter) - see https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +* Tone adjustment - see https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +* Translation - see https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +* Custom actions with custom prompts - see https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] +* Streaming responses - see https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API] + +[[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. diff --git a/modules/ROOT/pages/tinymceai-api-overview.adoc b/modules/ROOT/pages/tinymceai-api-overview.adoc new file mode 100644 index 0000000000..ea84c8e588 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-api-overview.adoc @@ -0,0 +1,41 @@ += TinyMCE AI API Overview + +:navtitle: API Overview +:description: Overview of TinyMCE AI service features and capabilities +:description_short: API Overview +:keywords: AI, API, AI service, overview, tinymceai + +TinyMCE AI integrates AI-assisted authoring with rich-text editing. Users can interact through Actions, Reviews, or Conversations that can use relevant context from multiple sources. + +[NOTE] +==== +**API Reference**: The complete API documentation with all endpoints, parameters, request/response schemas, and interactive examples is available at link:https://tinymceai.api.tiny.cloud/docs[TinyMCE AI API Documentation] +==== + +[[getting-started]] +== Getting Started + +New to TinyMCE AI? Kick your adventure off with the xref:tinymceai-api-quick-start.adoc[Quick Start] guide to set up your environment, generate access credentials, and make your first API call. + +[[tinymce-ai-features]] +== TinyMCE AI features + +* xref:tinymceai-chat.adoc[**Chat**] – Interactive AI chats with history and persistent context. +* xref:tinymceai-review-plugin.adoc[**Review**] – Content analysis and proofreading, optimized for larger content. +* xref:tinymceai-actions-plugin.adoc[**Quick Actions**] – Fast, stateless operations for specific tasks. + +[[architecture]] +== Architecture + +The following pages cover the system architecture. + +* xref:tinymceai-models.adoc[**Models**] – AI model selection, capabilities, and configuration. +* xref:tinymceai-streaming.adoc[**Streaming**] – Real-time streaming of AI-generated responses. +* xref:tinymceai-permissions.adoc[**Permissions**] – How to control user access to features. +* xref:tinymceai-limits.adoc[**Limits**] – Rate limits, context size limits, and file restrictions. + +[[resources-and-support]] +== Resources and Support + +* **API Documentation**: link:https://tinymceai.api.tiny.cloud/docs[Complete API reference for TinyMCE AI]. +* **Customer Support**: link:https://www.tiny.cloud/contact/[Contact us] to get help from our support team or speak with sales. diff --git a/modules/ROOT/pages/tinymceai-api-quick-start.adoc b/modules/ROOT/pages/tinymceai-api-quick-start.adoc new file mode 100644 index 0000000000..45902d6e89 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-api-quick-start.adoc @@ -0,0 +1,91 @@ += TinyMCE AI API Quick Start + +:navtitle: API Quick Start +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: Quick start guide for TinyMCE AI service +:description_short: API quick start guide +:keywords: AI, quick start, API, AI service, tinymceai, setup + +The aim of this article is to get users up and running with the {pluginname} service. + +[TIP] +==== +Sign up for the link:https://www.tiny.cloud/auth/signup/[{productname} Premium Features 14-day free trial] to test this feature first. + +The {productname} Premium Features free trial allows for testing SaaS services. For on-premises solutions, link:https://www.tiny.cloud/contact/[contact us]. +==== + +== Getting Started + +To start using the {pluginname} service, follow the steps below: + +* Sign up for one of the link:https://www.tiny.cloud/pricing/[self-service plans], or link:https://www.tiny.cloud/contact/[contact us] to purchase the {pluginname} license. +* Generate access credentials in the link:https://www.tiny.cloud/my-account/[Customer Portal]. +* Write a script that generates one-time tokens for authorizing end users of the application in {productname} Cloud Services (using access credentials created earlier). + +All steps are explained in details below. + +[[get-the-tinymce-ai-license]] +== Get the {pluginname} license + +{pluginname} can be purchased as a plugin for selected tiers of the self-service plans. Details are available on the link:https://www.tiny.cloud/pricing/[pricing page]. + +For custom plans, link:https://www.tiny.cloud/contact/[contact us] directly. + +For testing purposes, sign up for the link:https://www.tiny.cloud/auth/signup/[free trial]. + +After signing up, access to the link:https://www.tiny.cloud/my-account/[customer dashboard (Customer Portal)] is provided. + +[[log-in-to-the-customer-portal]] +== Log in to the Customer Portal + +Log in to the link:https://www.tiny.cloud/my-account/[Customer Portal] and navigate to link:https://www.tiny.cloud/my-account/jwt/["JWT Keys"]. + +image::https://placehold.net/default.png[{pluginname} trial view] + +[[create-token-endpoint]] +== Create token endpoint + +The next step is to create a security token endpoint in the application. This endpoint securely authorizes end users to use {pluginname} features based on their permissions and access rights. + +[[writing-your-own-token-endpoint]] +=== Writing your own token endpoint + +To create a custom security token endpoint, create access credentials for the selected environment by going to the "Access credentials" tab and clicking the "Create a new access key" button. + +Read more in the Creating access credentials section of the Environments management guide. + +[[cloud-region]] +== Cloud region + +Cloud Services can reside in either US or EU region or in both. The region is set per subscription and cannot be changed for existing environments. For Custom plan with multi-region, the region can be chosen during environment creation. This topic is addressed in more detail in the Environment management guide. + +[[api-integration]] +== API Integration + +All features are accessible through the API at `https://tinymceai.api.tiny.cloud` with JWT authentication. + +For an overview of all API features, see xref:tinymceai-api-overview.adoc[API Overview]. + +For feature documentation and API access information, see: + +* xref:tinymceai-chat.adoc#conversations-api[Chat] – Interactive AI discussions and document analysis through the Conversations API. +* xref:tinymceai-review-plugin.adoc#reviews-api[Review] – Content improvement and quality analysis through the Reviews API. +* xref:tinymceai-actions-plugin.adoc#actions-api[Quick Actions] – Content transformation through the Actions API. +* xref:tinymceai-streaming.adoc[Streaming] – Real-time AI interactions with code examples. + +link:https://tinymceai.api.tiny.cloud/docs[Complete API Documentation] – Full API reference with interactive examples for all endpoints + +[[next-steps]] +== Next Steps + +After setting up the JWT endpoint, continue with: + +* xref:tinymceai-api-overview.adoc[API Overview] – Overview of all API features and capabilities. +* xref:tinymceai-models.adoc[AI Models] – Choose the right model for your use case. +* xref:tinymceai-permissions.adoc[Permissions] – Set up user access control for production. +* xref:tinymceai-streaming.adoc[Streaming] – Learn how to handle real-time streaming responses. +* xref:tinymceai-chat.adoc#conversations-api[Chat API] – Start with interactive AI discussions. +* xref:tinymceai-review-plugin.adoc#reviews-api[Review API] – Add content improvement features. +* xref:tinymceai-actions-plugin.adoc#actions-api[Quick Actions API] – Implement content transformation. diff --git a/modules/ROOT/pages/tinymceai-chat.adoc b/modules/ROOT/pages/tinymceai-chat.adoc new file mode 100644 index 0000000000..85e3d4dbf0 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-chat.adoc @@ -0,0 +1,258 @@ += TinyMCE AI Chat +:navtitle: Chat +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: AI Chat feature for TinyMCE AI plugin +:description_short: AI Chat feature +:keywords: AI, chat, conversations, tinymceai +:page-role: -toc + +The {pluginname} Chat is a conversational AI that facilitates rich, multi-turn interactions between users and an AI Assistant for content creation and editing. It provides context setting, model selection, chat history, and capabilities for web search and reasoning. + +The Chat feature is available as a plugin UI and through the xref:tinymceai-chat.adoc#conversations-api[Conversations API]. This page covers both: + +* Plugin sections describe user-facing features and configuration. +* API sections cover REST API access (starting at xref:tinymceai-chat.adoc#conversations-api[Conversations API]). + +[[using-chat]] +== Using Chat + +image::https://placehold.net/default.png[{pluginname} Chat interface showing the conversational AI assistant] + +[[working-with-the-document]] +=== Working with the document + +{pluginname} operates directly within the context of the document. Users can ask questions about specific sections, request a full-document proofreading, and more. + +By enabling xref:tinymceai-chat.adoc#web-search[Web search] or xref:tinymceai-chat.adoc#reasoning[Reasoning], the chat capabilities can be extended — allowing the chat to look up information online and tackle complex tasks step by step. + +[[making-changes-to-the-content]] +=== Making changes to the content + +Users can chat with the AI and use it to introduce changes to the document. Ask it to _"Summarize the document"_, _"Turn this report into a one-page executive summary"_, or _"Suggest better section titles and subheadings"_. The AI will then propose a series of changes to the document that can be xref:tinymceai-chat.adoc#previewing-changes[reviewed] and xref:tinymceai-chat.adoc#applying-changes[accepted or discarded one by one]. Long AI responses can be expanded using the **Expand** button to view the full suggestion. **Copying and pasting chat transcripts is over; {pluginname} understands the content and edits hand in hand**. + +[[brainstorming]] +=== Brainstorming + +The chat feature jump-starts the creative process. Begin with a blank document and ask the AI for ideas. Build content step by step by chatting and applying changes. Then review — or have the AI rewrite — the final draft for best results. All in one place. + +[[demo]] +== Demo + +liveDemo::tinymceai[] + +[[integration]] +== Integration + +To start using the Chat feature, first load the {pluginname} plugin in the editor configuration. The Chat button image:icons/ai-assistant.svg[Chat icon,24px] will appear in the AI user interface along with the Chat history image:icons/restore-draft.svg[History icon,24px]. See xref:tinymceai.adoc[Plugin Reference] for installation and enabling AI features. + +[[available-models]] +== Available models + +Users can select the desired AI model for their conversation from a dropdown at the bottom of the chat. + +image::https://placehold.net/default.png[{pluginname} Chat available models dropdown] + +Once selected, the AI model will persist for the duration of the conversation. To change the model, start a new conversation using the image:icons/new-chat.svg[New Chat icon,24px] **New Chat** button at the top-right corner of the chat panel. + +[[web-search]] +=== Web search + +Web search in Chat allows it to access and retrieve real-time information from the internet. Instead of relying only on pre-trained knowledge, the model can search the web to find up-to-date facts, verify details, and provide more accurate, current answers. + +Some models use web search automatically, while others may require manual activation. Whether the "Enable web search" button image:icons/web-search.svg[Web search icon,24px] below the prompt input needs to be toggled depends on the model and sometimes even how the prompt is worded. For models that support it, use the toggle button to enable web search functionality. + +[[reasoning]] +=== Reasoning + +Reasoning in Chat models turns on the ability to think through problems, draw logical conclusions, and make sense of complex information. It enables the model to analyze context, connect ideas, and produce well-structured, coherent answers beyond simple pattern matching. + +Some models use reasoning automatically, while others may require manual activation. Whether the "Enable reasoning" button image:icons/reasoning.svg[Reasoning icon,24px] below the prompt input needs to be toggled depends on the model and sometimes even how the prompt is worded. For models that support it, use the toggle button to enable reasoning functionality. + +[[model-selection-configuration]] +=== Configuration + +Model selection for AI chat can be configured using two configuration options: + +* `tinymceai_default_model`: Set the default model to use for AI chat. +* `tinymceai_allow_model_selection`: Control whether users can select from available models (defaults to `true`). + +xref:tinymceai-models.adoc#supported-models-table[Learn more about available AI models]. + +[source,js] +---- +tinymce.init({ + selector: '#editor', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_default_model: 'claude-3-5-haiku', + tinymceai_allow_model_selection: true, + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.text()).then(token => ({ token })); + } +}); +---- + +[[adding-context-to-conversations]] +== Adding context to conversations + +The AI chat can work with the document and beyond. Use the "Add context" image:icons/plus.svg[Add context icon,24px] button below the prompt input, to add URLs, files, and external resources to the conversation. + +image::https://placehold.net/default.png[{pluginname} Chat add context user interface] + +Ask the AI about specific resources, for instance, _"Describe the attached image"_ or _"Summarize the key points from the attached Word document"_. The AI will analyze those resources and provide information that can be easily used in the document. + +External resources enable seamless integration of knowledge bases and other centralized data into AI chat conversations. Instead of uploading documents each time, they can be selected from a list and referenced during the conversation. + +[[context-configuration]] +=== Configuration + +Built-in options for adding the current document, URLs, and files to the conversation context are always available to users. There is no configuration option to enable or disable these built-in options. + +To add custom external sources for users to select from, use the following configuration options: + +* `tinymceai_chat_fetch_sources`: A function that returns a promise resolving to an array of available external sources. This is typically used to fetch a list of resources from a database or external API. +* `tinymceai_chat_fetch_source`: A function that retrieves the content of a specific source by ID. This is used for hooking into a repository of custom sources and fetching content on demand. + +[source,js] +---- +tinymce.init({ + selector: '#editor', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_chat_fetch_sources: async () => [ + { + label: 'My Documents', + sources: [ + { id: 'doc-1', label: 'Document 1', type: 'file' }, + { id: 'url-1', label: 'Web Page', type: 'web-resource' } + ] + } + ], + tinymceai_chat_fetch_source: async (id) => { + const res = await fetch(`/api/documents/${id}`); + const blob = await res.blob(); + const filename = `${id}.pdf`; + return { type: 'file', file: new File([blob], filename, { type: blob.type }) }; + }, + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.text()).then(token => ({ token })); + } +}); +---- + +[[working-with-ai-generated-changes]] +== Working with AI-generated changes + +When asking the AI for changes to the document, for instance, _"Bold key facts in the document"_, a series of proposed changes will be received. The changes are displayed directly in the document content, making it easy to see what will be modified. + +[NOTE] +==== +AI output may need review. The chat interface displays this reminder below the prompt input. +==== + +[[previewing-changes]] +=== Previewing changes + +A review bar appears at the bottom of the editor with **Diff mode** and **Preview** tabs. Toggle between them to show proposed changes inline (with markers for additions, removals, and formatting) or to preview the final result. When Diff mode is enabled, the proposed changes are highlighted in the document with markers indicating additions (green), removals (red), and formatting changes (blue). Navigate through the changes using the arrows in the suggestion overlay. As navigation occurs, the overlay automatically follows the corresponding sections of the document. + +[[applying-changes]] +=== Applying changes + +Click the checkmark image:icons/checkmark.svg[Accept suggestion icon,24px] in the suggestion overlay to accept the current change. Use the arrow buttons to move between suggestions. + +image::https://placehold.net/default.png[{pluginname} Chat apply changes] + +Click **Apply pending** in the review bar at the bottom of the editor to apply all remaining suggestions at once. The button shows the number of pending changes, for example, "Apply pending (4)". + +image::https://placehold.net/default.png[{pluginname} Chat apply all changes] + +[[rejecting-suggestions]] +=== Rejecting suggestions + +Click the image:icons/close.svg[Reject suggestion icon,24px] in the suggestion overlay to reject the current suggestion. Click **Skip pending** in the review bar at the bottom of the editor to skip all remaining suggestions. + +image::https://placehold.net/default.png[{pluginname} Chat reject button] + + +[[chat-history]] +== Chat history + +All past conversations appear in the Chat history. Click the button image:icons/restore-draft.svg[Chat history icon,24px] in the chat header to open the list. Click a conversation to reopen it, or use the menu on each entry to pin, rename, or delete it. Click **Go to AI Chat** to return from the history view to the active conversation. + +Conversations are grouped by date to help navigate the project easily. Conversations can be filtered by name using the search field at the top of the user interface. + +image::https://placehold.net/default.png[AI Chat history] + +[NOTE] +==== +Any conversation from the chat history can be continued as long as the AI model used for that conversation is xref:tinymceai-models.adoc#supported-models[still supported] by the feature. Click the conversation in the history to load it in the Chat interface. +==== + +[NOTE] +==== +The ability to apply suggestions to the document or generate Suggested Edits from historical conversations may be restricted in some scenarios: + +After closing the browser and reopening AI chat, previous conversations will no longer interact with the document content. To continue working with a conversation, reopen it from the chat history. +==== + +[[conversations-api]] +== Conversations API + +The Chat plugin feature is built on top of the Conversations API, which provides REST API access to conversation functionality. Conversations allow exchanging multiple messages with AI that maintains them in its context. Conversations can be extended by external context sources like websites or files, and have the ability to refer to editor content and suggest modifications. + +[[conversations-key-features]] +=== Key Features + +Upload PDFs, Word docs, and images for the AI to read and understand. Ask questions about specific sections and get intelligent answers. The AI extracts text while preserving structure from PDFs, maintains formatting context from Word documents, parses web content from HTML files, and processes images with OCR and object recognition. + +Each conversation builds on previous messages, so the AI keeps track of the entire discussion and any files that have been shared. Documents, images, web links, and text can be mixed in one conversation, and the AI connects information across all formats. + +[[example-product-launch-workflow]] +=== Example: Product Launch Workflow + +. **Upload product spec** → _"What are the key features for marketing?"_ +. **Add competitor analysis** → _"How do we compare to competitors?"_ +. **Reference blog post** → _"Write a press release using this blog post and our competitive advantages"_ +. **Include brand guidelines** → _"Match our brand voice and key messaging"_ + +The AI remembers everything that has been shared and builds on it throughout the conversation. + +[[conversations-api-capabilities]] +=== API Capabilities + +When using the Conversations API directly, advanced capabilities can be configured: + +* **Web Search** – Enable real-time web search to access current information during conversations. Configure using the `webSearch` capability in API requests. See https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Web-Resources[Conversation Web Resources API] for endpoint details. +* **Reasoning** – Enable step-by-step reasoning to see the AI's problem-solving process. Configure using the `reasoning` capability in API requests. See https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Messages[Conversation Messages API] for endpoint details. + +[[conversations-streaming]] +=== Streaming Responses + +Conversations use Server-Sent Events (SSE) for real-time streaming responses. See the xref:tinymceai-streaming.adoc[Streaming Responses guide] for detailed implementation information and code examples. + +[[conversations-api-reference]] +=== API Reference + +For complete API documentation including endpoints, parameters, request/response schemas, and interactive examples, see: + +* **https://tinymceai.api.tiny.cloud/docs#tag/Conversations[REST API Conversations Documentation]** – Full documentation for conversations endpoints with interactive examples + +The REST API documentation includes examples for: + +* Creating conversations - see https://tinymceai.api.tiny.cloud/docs#tag/Conversations[Conversations API] +* Uploading documents - see https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Documents[Conversation Documents API] +* Uploading files - see https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Files[Conversation Files API] +* Uploading web resources - see https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Web-Resources[Conversation Web Resources API] +* Sending messages with context - see https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Messages[Conversation Messages API] +* Configuring web search capabilities - see https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Web-Resources[Conversation Web Resources API] +* Configuring reasoning capabilities - see https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Messages[Conversation Messages API] +* Streaming responses - see https://tinymceai.api.tiny.cloud/docs#tag/Conversation-Messages[Conversation Messages API] + +[[related-features]] +== Related Features + +* xref:tinymceai-review-plugin.adoc[AI review] – For content quality analysis and improvement suggestions. +* xref:tinymceai-actions-plugin.adoc[Quick actions] – For fast, stateless content transformations. diff --git a/modules/ROOT/pages/tinymceai-integration-options.adoc b/modules/ROOT/pages/tinymceai-integration-options.adoc new file mode 100644 index 0000000000..244f726b26 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-integration-options.adoc @@ -0,0 +1,25 @@ += TinyMCE AI Integration Options + +:navtitle: Integration Options +:description: Choose how to integrate TinyMCE AI with applications +:description_short: Integration options for TinyMCE AI +:keywords: AI, integration, plugin, API, AI service, tinymceai + +TinyMCE AI can be integrated with applications through two methods: + +[cols=2*a] +|=== + +| +[.lead] +xref:tinymceai.adoc[**Plugin Quick Start**] + +Integrate AI features directly into the TinyMCE editor interface. Works with CDN or self-hosted TinyMCE installations. The fastest way to add AI capabilities to the editor. + +| +[.lead] +xref:tinymceai-api-overview.adoc[**AI service**] + +Use the AI service API to build custom integrations and workflows. Perfect for server-side processing, custom UI implementations, and advanced use cases. Start with the xref:tinymceai-api-quick-start.adoc[API Quick Start] guide. + +|=== diff --git a/modules/ROOT/pages/tinymceai-introduction.adoc b/modules/ROOT/pages/tinymceai-introduction.adoc new file mode 100644 index 0000000000..8716925ef6 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-introduction.adoc @@ -0,0 +1,81 @@ += TinyMCE AI Introduction +:navtitle: Introduction +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: Introduction to TinyMCE AI features and capabilities +:description_short: TinyMCE AI introduction +:keywords: AI, introduction, tinymceai +:page-role: -toc + +By integrating AI writing assistance directly into the editing experience, {pluginname} empowers authors with real-time AI writing support, speeds up content creation, and enhances editorial workflows across a wide range of use cases – from productivity boosts and proof-reading to content quality and consistency. + +[[demo]] +== Demo + +liveDemo::tinymceai[] + +[[what-is-tinymce-ai]] +== What is {pluginname} + +{pluginname} is an AI-powered writing assistant that integrates directly into the rich-text editor, {productname}, providing instant text rewriting, summarization, correction, and contextual chat help based on internal style guides. The platform includes automated review tools and enterprise-ready functionality that plugs into existing systems without requiring custom infrastructure. + +Teams can implement a full suite of AI writing tools in weeks rather than months, delivering efficient, compliant content workflows that maintain brand consistency and integrate seamlessly with existing document management systems. + +The core components of {pluginname} are: + +* **xref:introduction-to-tinymce.adoc[{productname}]**: A modern rich text editor with dozens of features that improve writing workflows, including collaboration. +* **xref:tinymceai-api-overview.adoc[AI service]**: A state-of-the-art back-end AI engine that incorporates multiple models and delivers high-quality content. Currently available in Cloud setup. See xref:tinymceai-introduction.adoc#on-premises-deployment[On-Premises Deployment] for deployment options. + +[[features]] +== {pluginname} features + +There are three main features of {pluginname}. All features can be tested using the free trial. + +* xref:tinymceai-chat.adoc[**Chat**] – Interactive AI chats with history and persistent context. +* xref:tinymceai-review-plugin.adoc[**Review**] – Content analysis and proofreading, optimized for larger content. +* xref:tinymceai-actions-plugin.adoc[**Actions**] – Fast, stateless operations for specific tasks. + +[[integration-options]] +== Integration Options + +{pluginname} can be integrated with applications through two methods. See xref:tinymceai-integration-options.adoc[Integration Options] for details. + +[[permissions]] +== Permissions + +Developers can control access to AI features, models, and capabilities based on user roles, subscription tiers, and organizational requirements. Learn more about the xref:tinymceai-permissions.adoc[permissions system]. + +[[privacy-and-data-handling]] +== Privacy and data handling + +[[regional-data-storage]] +=== Regional Data Storage + +All data stored by {pluginname} follows the region settings of the {productname} Cloud Services environment, ensuring compliance with data residency requirements and optimal performance for the geographic location. + +[IMPORTANT] +==== +Data sent to LLM providers for processing is currently processed in the US region, regardless of the Cloud Services environment region. +==== + +[[data-retention-policy]] +=== Data Retention Policy + +Conversation data is automatically deleted after 12 months of inactivity, including: + +* all conversation messages and history, +* attached documents, files, and web resources, +* conversation metadata and settings. + +[[security]] +=== Security + +All data is encrypted in transit and at rest with end-to-end encryption. Conversations and attachments are stored in secure cloud infrastructure with fine-grained access control and comprehensive permission systems. Audit Logs are available through our Customer Portal and the API. + +[[on-premises-deployment]] +== On-Premises Deployment + +[NOTE] +==== +On-premises deployment is currently in development. Follow {productname} social accounts and our newsletter for updates. +==== diff --git a/modules/ROOT/pages/tinymceai-jwt-authentication-intro.adoc b/modules/ROOT/pages/tinymceai-jwt-authentication-intro.adoc new file mode 100644 index 0000000000..3a5f66b2cd --- /dev/null +++ b/modules/ROOT/pages/tinymceai-jwt-authentication-intro.adoc @@ -0,0 +1,261 @@ += TinyMCE AI JWT Authentication + +:navtitle: JWT Authentication +:description: JWT authentication requirements and permissions for TinyMCE AI +:description_short: JWT Authentication +:keywords: AI, JWT, authentication, permissions, tinymceai +:pluginname: TinyMCE AI +:plugincode: tinymceai + +{pluginname} requires JWT (JSON Web Token) authentication when using the Tiny Cloud service. JWT authentication provides secure, user-specific access to {pluginname} features. Each JWT token contains claims that identify the user and specify which AI features they can access. + +{productname} recommends using the libraries listed on link:https://www.jwt.io/libraries[jwt.io/libraries] to create JWT tokens. These libraries support the algorithms required by {pluginname}. For details on supported algorithms, see xref:#supported-algorithms[Supported Algorithms]. + +[[token-endpoint-overview]] +== Token Endpoint Overview + +To connect {productname} with {pluginname}, a token endpoint must be created. This guide outlines the principles required to create it. + +[[how-tinymce-ai-uses-tokens]] +== How {pluginname} Uses Tokens + +To authenticate users, {pluginname} uses tokens. The purpose of tokens is to inform the AI service that the user has access to AI features and which API key the user should connect to. The authenticity of tokens is provided by a digital signature. + +*The token endpoint*: is where {productname} makes a request to get the token. It is required to return the token only if the user proves their identity. It should be placed inside the system, not exposed as a public endpoint without proper authentication. + +The following diagram shows how {pluginname} uses tokens: + +image::JWT-flow.svg[JSON Web Token Call Flow,title="JSON Web Token Call Flow"] + +[[jwt-specification]] +== The JSON Web Tokens Specification + +{pluginname} tokens are represented as JSON Web Tokens (JWT). JWT is an open link:https://datatracker.ietf.org/doc/html/rfc7519[standard] (RFC 7519) for transmitting digitally signed information. Using it ensures that the data comes from a trusted source and has not been tampered with. + +A JWT consists of three parts separated by dots `.` + +* **Header**: Contains metadata about the token, including the signing algorithm +* **Payload**: Contains the claims (user information, permissions, and similar) +* **Signature**: Used to verify the token's authenticity + +[source,json] +---- +{header}.{payload}.{signature} +---- + +.Example: +[source,json] +---- +eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyLTQ4NzI5IiwibmFtZSI6Ikplc3NpY2EgV2lsbGlhbXMiLCJpYXQiOjE3Mjg0NzM2NDJ9.kX9mP2qL8vN4rT7wY3zA5bC6dE1fG2hI3jK4lM5nO6pQ7rS8tU9vW0xY1zA2b +---- + +[[jwt-header]] +=== Header + +The JWT header identifies the token type and specifies the cryptographic algorithm used to sign the token. For {pluginname}, the header must be a JSON object containing: + +* `alg` – The signing algorithm used to create the token signature. See xref:#supported-algorithms[Supported Algorithms] for the list of supported algorithms. {companyname} recommends using `RS256`. +* `typ` – The token type identifier, which must always be `JWT` + +The header is Base64URL-encoded to form the first part of the JWT token. + +.Example header +[source,json] +---- +{ + "alg": "RS256", + "typ": "JWT" +} +---- + +[[jwt-payload]] +=== Payload + +The JWT payload is a JSON object containing claims that identify the user, specify their AI permissions, and control token validity. The payload is Base64URL-encoded to form the second part of the JWT token. + +[[payload-properties]] +==== Payload Properties + +The following properties **must** be included in the payload: + +* `aud` – The API key that has entitlements to use {pluginname}. +* `sub` – The user ID. This should be a unique identifier for the user making the request. This identifier is used to lock down conversation history, AI-generated content, and other user-specific data to individual users, ensuring privacy and data isolation. +* `iat` – "Issued at". Make sure that `iat` is present and contains a correct time stated in seconds. Some JWT implementations do not include it by default. Sometimes the system time may also be invalid, causing issues. +* `exp` – Token expiration time. Identifies the expiration time after which the JWT will not be accepted. {pluginname} only accepts tokens no older than 24 hours. This field can be used to shorten the token validity time. +* `auth` – The `auth.ai.permissions` array inside is required. This defines which AI features the user can access. See xref:#permissions[Permissions] below for details. + +The properties that are optional: + +* `user` – User information. Providing `name` and `email` is recommended for better user experience and debugging. + +[[example-token-payload]] +==== Example Token Payload + +The example below presents a complete token payload with access to all AI features: + +[source,json] +---- +{ + "aud": "your-api-key", + "iat": 1511963669, + "exp": 1511967269, + "sub": "user-123", + "user": { + "email": "user@example.com", + "name": "John Doe" + }, + "auth": { + "ai": { + "permissions": [ + "ai:conversations:read", + "ai:conversations:write", + "ai:models:agent", + "ai:actions:system:*", + "ai:reviews:system:*" + ] + } + } +} +---- + +[[permissions]] +==== Permissions + +Permissions are specified in the `auth.ai.permissions` array within the JWT token and control which AI features, models, and capabilities users can access. + +For a complete list of available permissions, permission examples, and best practices, see xref:tinymceai-permissions.adoc[Permissions]. + +For complete details on all required claims, including types, formats, and implementation examples, see: + +* xref:tinymceai-with-jwt-authentication-nodejs.adoc#required-jwt-claims-for-tinymce-ai[Node.js guide - Required JWT claims] +* xref:tinymceai-with-jwt-authentication-php.adoc#required-jwt-claims-for-tinymce-ai[PHP guide - Required JWT claims] + +[[jwt-signature]] +=== Signature + +The signature is created by encoding the header and payload using Base64URL, then signing them with the private key using the specified algorithm. The {pluginname} service verifies the signature using the corresponding public key stored in the {accountpage}. + +[[supported-algorithms]] +=== Supported Algorithms + +{productname} does not support symmetrical encryption algorithms, such as `HS256`. {companyname} recommends using the `RS256` algorithm. The following algorithms are supported: + +* RS256 +* RS384 +* RS512 +* PS256 +* PS384 +* PS512 + +For details on each of these algorithms, visit: link:https://tools.ietf.org/html/rfc7518#section-3[RFC 7518, JSON Web Algorithms (JWA) Section 3 - Cryptographic Algorithms for Digital Signatures and MACs]. + +[[token-requests]] +== Requests to the Token Endpoint + +The token for {pluginname} is requested by the {pluginname} plugin. The easiest way to configure this is to set the `tinymceai_token_provider` option to a function that fetches the token from the endpoint. + +The token endpoint will be requested: +* At editor initialization +* Periodically to refresh the token (typically every hour) + +[[simple-token-request]] +=== Simple Usage + +[source,javascript] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_token_provider: () => { + return fetch('https://example.com/cs-token-endpoint', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }).then(response => response.json()); + }, +}); +---- + +[TIP] +==== +The editor will not be ready to use until the first token is obtained from the token endpoint. If an error occurs during the initial request, the editor will not start correctly. +==== + +For more advanced token request customization, see xref:tinymceai-with-jwt-authentication-nodejs.adoc#configure-tinymce[Configure {productname}] in the implementation guides. + +[[token-responses]] +== Responses from the Token Endpoint + +The token provider must return an object with a `+token+` property: `+{ token: string }+`. The endpoint may respond in either format: + +* **JSON response** – Endpoint returns `+{ "token": "eyJ..." }+`. Use `+response.json()+` and return `+{ token: data.token }+`. +* **Plain text response** – Endpoint returns the raw JWT string. Use `+response.text()+` and return `+{ token }+`. + +.Example: JSON response +[source,json] +---- +{ + "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..." +} +---- + +.Example: Plain text response +[source,text] +---- +eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9... +---- + +[[quick-setup]] +== Quick Setup + +To set up JWT authentication for {pluginname}: + +. Generate a public/private key pair and add the public key to the {accountpage} via link:{accountjwturl}[{accountpage} - JWT Keys]. +. Set up a JWT endpoint that generates tokens with the required claims. +. Configure {productname} to use the JWT endpoint via the `tinymceai_token_provider` option. + +For step-by-step implementation instructions with complete code examples, see: + +* xref:tinymceai-with-jwt-authentication-nodejs.adoc[JWT authentication (Node.js)] – Complete Node.js implementation guide +* xref:tinymceai-with-jwt-authentication-php.adoc[JWT authentication (PHP)] – Complete PHP implementation guide + +[[tools]] +== Tools + +JWT tokens can be validated and debugged using the link:https://jwt.io/[jwt.io debugger]. + +[[troubleshooting]] +== Troubleshooting + +[[invalid-token-error]] +=== Invalid token + +If an error message indicates an invalid token: + +* Verify that the token was created in accordance with the required claims and format +* Ensure the API key in the `aud` claim is correct and valid +* Verify that the token is signed with one of the xref:#supported-algorithms[supported algorithms] +* Check that the public key in the {accountpage} matches the private key used to sign the token +* Validate the token structure using the link:https://jwt.io/[jwt.io debugger] +* Ensure the `iat` (issued at) timestamp is correct and not in the future +* Verify that system time is accurate (time drift can cause token validation issues) + +[[insufficient-permissions-error]] +=== Insufficient permissions + +If an error indicates insufficient permissions: + +* Verify that the token includes the `auth.ai.permissions` array with the required permissions +* Check that the permissions match the AI features being accessed +* Review the xref:tinymceai-permissions.adoc[Permissions] guide for the correct permission format +* Ensure permissions are specified correctly (for example, `ai:conversations:read`, `ai:conversations:write`) + +[[related-features]] +== Related Features + +* xref:tinymceai-permissions.adoc[Permissions]: Complete permissions reference and examples. +* xref:tinymceai-models.adoc[AI Models]: Model selection and capabilities. +* xref:tinymceai-chat.adoc[Chat]: Interactive AI discussions. +* xref:tinymceai-review-plugin.adoc[Review]: Content improvement. +* xref:tinymceai-actions-plugin.adoc[Quick Actions]: Content transformation. +* link:https://tinymceai.api.tiny.cloud/docs[API Documentation]: Complete API reference for {pluginname}. diff --git a/modules/ROOT/pages/tinymceai-limits.adoc b/modules/ROOT/pages/tinymceai-limits.adoc new file mode 100644 index 0000000000..da83067b32 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-limits.adoc @@ -0,0 +1,53 @@ += TinyMCE AI Limits + +:navtitle: Limits +:description: Usage limits configuration for TinyMCE AI +:description_short: Usage limits configuration +:keywords: AI, limits, configuration, tinymceai + +Understand the limits that ensure fair usage, optimal performance, and cost control across all TinyMCE AI features. + +[[overview]] +== Overview + +TinyMCE AI implements various limits to ensure fair usage, optimal performance, and cost control. These include rate limits for API requests, context limits for content size and processing, model-specific constraints, and file restrictions. + +[[rate-limits]] +== Rate Limits + +Rate limits control the frequency of requests to prevent abuse and ensure service stability. These limits apply to both plugin usage and direct API calls, as the plugin uses the API under the hood. The service implements limits on requests, token usage, web search, and web scraping requests per minute. All rate limits are applied at both organization level (higher limits) and individual user level (lower limits) to ensure fair usage. + +NOTE: Specific rate limit values are subject to change and may vary based on the subscription tier. Contact support for current rate limit details for the environment. + +[[context-limits]] +== Context Limits + +Context limits control how much content can be attached to conversations to ensure AI models can process all information effectively. These limits vary by model based on their specific capabilities and processing requirements. + +[[file-limits]] +=== File Limits + +Files are limited to 7MB each (PDF, DOCX, PNG, JPEG, Markdown, HTML, Plain text). Up to 100 files can be uploaded per conversation with a total size limit of 30MB. PDF files are limited to 100 pages total across all PDFs in a conversation. + +[[model-specific-file-limits]] +==== Model-specific file limits + +Anthropic and agent models may use files up to 5MB each. + +[[context-optimization-tips]] +=== Context Optimization Tips + +Compress images and split large documents into smaller sections. Use text formats (TXT or MD) over PDF when possible for better processing. Attach only relevant files to conversations and provide document summaries for very large files. + +[[model-specific-limits]] +== Model-Specific Limits + +Different AI models have varying capabilities and limitations that affect context processing. Each model has different context window sizes that determine how much content can be processed. Models have response timeouts, file processing timeouts, web resource timeouts, and streaming response limits. All models include content moderation for inappropriate content, safety checks, and moderation response time limits. + +[[next-steps]] +== Next Steps + +* xref:tinymceai-models.adoc[Learn about AI Models] for model-specific limitations. +* xref:tinymceai-permissions.adoc[Set up Permisssions] to control user access. +* xref:tinymceai-chat.adoc[Explore Chat] for context management. +* https://tinymceai.api.tiny.cloud/docs[API Documentation] – Complete API reference for TinyMCE AI. diff --git a/modules/ROOT/pages/tinymceai-models.adoc b/modules/ROOT/pages/tinymceai-models.adoc new file mode 100644 index 0000000000..9893be0dd3 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-models.adoc @@ -0,0 +1,314 @@ += TinyMCE AI Models + +:navtitle: AI Models +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: AI model configuration for TinyMCE AI +:description_short: AI model configuration +:keywords: AI, models, configuration, tinymceai + +{pluginname} supports multiple AI models from different providers. Model selection and configuration can be done through the plugin UI or through the REST API. This page covers model capabilities, configuration options, and limitations that apply to both plugin and API usage. + +[[recommended-agent-models]] +== Recommended: Agent Models + +The `agent-1` model automatically selects the best AI model for requests based on speed, quality, and cost. It's the recommended choice for most use cases as it optimizes performance and cost automatically. + +[[available-models]] +== Available Models + +{pluginname} supports multiple AI models from different providers. Each model has unique capabilities, performance characteristics, and cost profiles. By default, the automatically selected model (`agent-1`) will be used for optimal cost and performance. + +[[supported-models-table]] +=== Supported Models + +Here's a detailed list of available models with their capabilities: + +[cols="1,2,1,1,2"] +|=== +|Model |Description |xref:tinymceai-chat.adoc#web-search[Web Search] |xref:tinymceai-chat.adoc#reasoning[Reasoning] |Configuration id + +|**Auto (default)** +|Automatically selects best model for speed, quality, and cost. +|Yes +|Yes +|`'auto'` (also `'agent-1'`, learn more about xref:tinymceai-models.adoc#model-compatibility-versions[compatibility versions]) + +|**GPT-5.2** +|OpenAI's flagship model for advanced reasoning, creativity, and complex tasks +|Yes +|Yes +|`'gpt-5.2'` + +|**GPT-5.1** +|OpenAI's flagship model for advanced reasoning, creativity, and complex tasks +|Yes +|Yes +|`'gpt-5.1'` + +|**GPT-5** +|OpenAI's flagship model for advanced reasoning, creativity, and complex tasks +|Yes +|Yes +|`'gpt-5'` + +|**GPT-5 Mini** +|A lightweight version of GPT-5 – faster, more cost-efficient +|Yes +|Yes +|`'gpt-5-mini'` + +|**Claude 4.5 Haiku** +|Cost-efficient model for quick interactions with improved reasoning +|Yes +|Yes +|`'claude-4-5-haiku'` + +|**Claude 4.5 Sonnet** +|Advanced model with improved creativity, reliability, and reasoning +|Yes +|Yes +|`'claude-4-5-sonnet'` + +|**Gemini 3 Pro** +|Google's advanced model for versatile problem-solving and research +|Yes +|Yes +|`'gemini-3-pro'` + +|**Gemini 3 Flash** +|Lightweight Gemini model for fast, cost-efficient interactions +|Yes +|Yes +|`'gemini-3-flash'` + +|**Gemini 2.5 Flash** +|Lightweight Gemini model for fast, cost-efficient interactions +|Yes +|Yes +|`'gemini-2-5-flash'` + +|**GPT-4.1** +|OpenAI's model for reliable reasoning, speed, and versatility +|Yes +|No +|`'gpt-4.1'` + +|**GPT-4.1 Mini** +|A lighter variant of GPT-4.1 that balances speed and cost while maintaining solid accuracy +|Yes +|No +|`'gpt-4.1-mini'` +|=== + +[[limitations]] +=== Limitations + +Model availability depends on the subscription tier and service compatibility version. Some models may have specific limitations or requirements. + +[[how-model-selection-works]] +== How Model Selection Works + +The agent model (`agent-1`) automatically selects the best underlying model based on: + +* **Request complexity** – Simple queries use faster, cost-effective models +* **Content size** – Larger content uses models with better context windows +* **Required capabilities** – Web search and reasoning require compatible models +* **Cost optimization** – Balances quality with cost efficiency + +[[model-configuration]] +=== Model Configuration + +Models can be configured in two ways: + +* **Plugin Configuration** – Use `tinymceai_default_model` and `tinymceai_allow_model_selection` options. See xref:tinymceai-chat.adoc#model-selection-configuration[Chat model configuration] for details. +* **API Configuration** – Specify the model directly in API requests for more control. See xref:tinymceai-models.adoc#api-examples[API Examples] below. + +[[model-compatibility-versions]] +== Model Compatibility Versions + +Models are organized by compatibility versions to ensure API stability. When new models are introduced or existing models are updated, they may be added to a new compatibility version. + +[[how-it-works]] +=== How It Works + +Compatibility versions allow {pluginname} to introduce new models and capabilities without breaking existing integrations. Each version maintains a stable set of models and capabilities. + +[[checking-compatibility]] +=== Checking Compatibility + +To see available models for your compatibility version: + +* **Via API** – Check the `/v1/models` endpoint. The API response includes model capabilities, limits, and availability. +* **Via Plugin** – Available models are shown in the model selection dropdown when `tinymceai_allow_model_selection` is enabled. + +[[model-capabilities]] +== Model Capabilities + +Different models support different capabilities. Check the model information via the API endpoint or the plugin's model selection UI to see which capabilities are available for each model. + +[[web-search]] +=== Web Search + +Enable real-time web search to access current information during conversations. Not all models support web search. Check model capabilities to see which models support this feature. + +[[reasoning]] +=== Reasoning + +Enable step-by-step reasoning to see the AI's problem-solving process. Some models have reasoning always enabled and cannot be turned off. + +**Always-on reasoning models:** + +* Reasoning is always active during inference. +* Reasoning cannot be turned off through the API. + +To determine if a model has always-on reasoning, check the API response when listing models or refer to the model capabilities in the plugin UI. Models with mandatory reasoning will indicate this in their capability structure. + +NOTE: Model names such as `gpt-5`, `claude-4-sonnet`, and similar are examples. Actual available models depend on the service compatibility version. Use the `/v1/models` API endpoint or check the plugin model selection dropdown to see current available models for the environment. + +[[web-scraping]] +=== Web Scraping + +Extract and process content from web pages for analysis and summarization. + +[[model-limitations]] +== Model Limitations + +[[file-processing-limits]] +=== File Processing Limits + +Files are limited to 7MB each (PDF, DOCX, PNG, JPEG, Markdown, HTML, Plain text). Up to 100 files can be uploaded per conversation with a total size limit of 30MB. PDF files are limited to 100 pages total across all PDFs in a conversation. + +[[model-specific-file-limits]] +==== Model-specific file limits + +Anthropic and agent models may use files up to 5MB each. + +[[content-moderation]] +=== Content Moderation + +All models include moderation for inappropriate content, harmful instructions, personal information, copyrighted material, misinformation, sensitive topics, and security threats. + +[[model-descriptions]] +=== Model Descriptions + +Model descriptions returned by the API are provided in English and may be updated over time to reflect model improvements or capability changes. + +[[translation-and-localization]] +=== Translation and Localization + +NOTE: Back-end translation handling for model descriptions is planned in a future release. Until then, use the approach described below. + +If the application requires translated model descriptions, maintain a translation map in the code keyed by `model.id`, with fallback to the English description from the API for unknown models. This allows new models to work immediately while translations are added at a custom pace. + +[[model-deprecation]] +=== Model Deprecation + +Models scheduled for removal will include a `removal` field with an ISO 8601 date (for example, `"removal": "2025-11-17T00:00:00.000Z"`). When a model is removed, API requests will fail with error code `MODEL_NOT_FOUND` and the models endpoint will stop returning that particular model. + +[[api-examples]] +== API Examples + +The following examples show how to configure models when using the REST API directly. For plugin configuration, see xref:tinymceai-chat.adoc#model-selection-configuration[Chat model configuration]. + +[[model-selection]] +=== Model Selection + +[source,http] +---- +POST /v1/conversations/my-conversation-123/messages +Content-Type: application/json +Authorization: Bearer + +{ + "prompt": "Analyze this document and provide insights", + "model": "agent-1", + "content": [ + { + "type": "document", + "id": "doc-1234567890123" + } + ] +} +---- + +[[capability-configuration]] +=== Capability Configuration + +[source,http] +---- +POST /v1/conversations/my-conversation-123/messages +Content-Type: application/json +Authorization: Bearer + +{ + "prompt": "Research the latest developments in AI", + "model": "gpt-4o", + "capabilities": { + "webSearch": {}, + "reasoning": {} + } +} +---- + +[[model-information]] +=== Model Information + +Get all available models for compatibility version `1`: + +[source,http] +---- +GET /v1/models/1 +Authorization: Bearer +---- + +Response: + +[source,json] +---- +{ + "items": [ + { + "id": "agent-1", + "name": "Agent", + "provider": "Agent", + "description": "Automatically selects the best model for speed, quality, and cost", + "allowed": true, + "capabilities": { + "webSearch": { + "enabled": true, + "allowed": true + }, + "reasoning": { + "enabled": true, + "allowed": true + } + }, + "limits": { + "maxPromptLength": 30000, + "maxConversationLength": 256000, + "maxFiles": 100, + "maxFileSize": 7000000, + "maxTotalFileSize": 30000000, + "maxTotalPdfFilePages": 100 + } + } + ] +} +---- + +[[api-reference]] +== API Reference + +For complete documentation on model endpoints, compatibility versions, and capability schemas, see: + +* **https://tinymceai.api.tiny.cloud/docs#tag/Models[Models API Reference]** – Full documentation for model listing and configuration. +* **https://tinymceai.api.tiny.cloud/docs[Complete API Documentation]** – Interactive API reference with all {pluginname} endpoints. + +[[related-features]] +== Related Features + +* xref:tinymceai-chat.adoc[Chat] – Use models in interactive AI discussions and configure model selection. +* xref:tinymceai-review-plugin.adoc[Review] – Apply models to content analysis and improvement. +* xref:tinymceai-actions-plugin.adoc[Quick Actions] – Use models for content transformation tasks. +* xref:tinymceai.adoc[Plugin Reference] – Complete plugin configuration options including model settings. \ No newline at end of file diff --git a/modules/ROOT/pages/tinymceai-permissions.adoc b/modules/ROOT/pages/tinymceai-permissions.adoc new file mode 100644 index 0000000000..7bf772d537 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-permissions.adoc @@ -0,0 +1,265 @@ += TinyMCE AI JWT Permissions + +:navtitle: Permissions +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: JWT permissions system for TinyMCE AI +:description_short: JWT Permissions +:keywords: AI, JWT, permissions, authentication, tinymceai + +{pluginname} uses a permission-based access control system to manage user access to AI features. Permissions are specified in JWT tokens and control which features, models, and capabilities users can access. + +For information about JWT authentication setup and required claims, see xref:tinymceai-jwt-authentication-intro.adoc[JWT Authentication]. + +[[quick-reference]] +== Quick Reference + +[cols="2,3"] +|=== +|Category |Permissions + +|Admin +|`ai:admin` + +|Models +|`ai:models:*`, `ai:models::*`, `ai:models::`, `ai:models:agent` + +|Conversations +|`ai:conversations:*`, `ai:conversations:read`, `ai:conversations:write`, `ai:conversations:websearch`, `ai:conversations:reasoning` + +|Context +|`ai:conversations:context:*`, `ai:conversations:context:files:*`, `ai:conversations:context:files:`, `ai:conversations:context:urls` + +|Actions +|`ai:actions:*`, `ai:actions:custom`, `ai:actions:system:*`, `ai:actions:system:` + +|Reviews +|`ai:reviews:*`, `ai:reviews:custom`, `ai:reviews:system:*`, `ai:reviews:system:` +|=== + +[[use-cases]] +== Use Cases + +* **Role-based access** – Different user roles have different AI capabilities +* **Cost control** – Limit access to expensive models or features +* **Feature gating** – Enable specific AI features for premium users +* **Security** – Restrict access to sensitive AI operations + +[[permission-format]] +== Permission Format + +Permissions follow a hierarchical format: `ai:::` + +[[admin-permissions]] +== Admin Permissions + +[cols="2,3"] +|=== +|Permission |Description + +|`ai:admin` +|Grants full access to all {pluginname} features, models, and capabilities. Use with caution in production environments. +|=== + +[[model-permissions]] +== Model Permissions + +[cols="2,3"] +|=== +|Permission |Description + +|`ai:models:*` +|Access to all available AI models. Use with caution as this includes access to new models that may be more expensive. + +|`ai:models::*` +|Access to all models from a specific provider (for example, `ai:models:openai:*`, `ai:models:anthropic:*`). + +|`ai:models::` +|Access to a specific model (for example, `ai:models:openai:gpt-4o`, `ai:models:anthropic:claude-3-sonnet`). + +|`ai:models:agent` ⭐ Recommended +|Access to the agent model which automatically selects the best model for each request. This is the recommended permission for most use cases. +|=== + +[[conversation-permissions]] +== Conversation Permissions + +[cols="2,3"] +|=== +|Permission |Description + +|`ai:conversations:*` +|Full access to all conversation features including read, write, web search, and reasoning. + +|`ai:conversations:read` +|Ability to read and list conversations. + +|`ai:conversations:write` +|Ability to create and send messages in conversations. + +|`ai:conversations:websearch` +|Ability to use web search capability in conversations. + +|`ai:conversations:reasoning` +|Ability to use reasoning capability in conversations. +|=== + +[[context-permissions]] +== Context Permissions + +[cols="2,3"] +|=== +|Permission |Description + +|`ai:conversations:context:*` +|Access to all context types (files and URLs). + +|`ai:conversations:context:files:*` +|Access to all file types for context. + +|`ai:conversations:context:files:` +|Access to specific file formats (for example, `ai:conversations:context:files:pdf`, `ai:conversations:context:files:docx`). + +|`ai:conversations:context:urls` +|Ability to use web URLs as context sources. +|=== + +[[actions-permissions]] +== Actions Permissions + +[cols="2,3"] +|=== +|Permission |Description + +|`ai:actions:*` +|Access to all action types, including custom and system actions. + +|`ai:actions:custom` +|Ability to run custom actions with free-form prompts. + +|`ai:actions:system:*` +|Access to all pre-defined system actions. + +|`ai:actions:system:` +|Access to specific system actions. Examples: `ai:actions:system:improve-writing`, `ai:actions:system:fix-grammar`, `ai:actions:system:translate` +|=== + +[[reviews-permissions]] +== Reviews Permissions + +[cols="2,3"] +|=== +|Permission |Description + +|`ai:reviews:*` +|Access to all review types, including custom and system reviews. + +|`ai:reviews:custom` +|Ability to run custom reviews with free-form prompts. + +|`ai:reviews:system:*` +|Access to all pre-defined system reviews. + +|`ai:reviews:system:` +|Access to specific system reviews. Examples: `ai:reviews:system:correctness`, `ai:reviews:system:clarity`, `ai:reviews:system:make-tone-professional` +|=== + +[[permission-examples]] +== Permission Examples + +[[basic-user]] +=== Basic User + +[source,json] +---- +{ + "auth": { + "ai": { + "permissions": [ + "ai:conversations:read", + "ai:conversations:write", + "ai:models:agent", + "ai:conversations:context:files:pdf", + "ai:conversations:context:files:docx" + ] + } + } +} +---- + +[[premium-user]] +=== Premium User + +[source,json] +---- +{ + "auth": { + "ai": { + "permissions": [ + "ai:conversations:*", + "ai:models:*", + "ai:actions:system:*", + "ai:reviews:system:*" + ] + } + } +} +---- + +[[enterprise-admin]] +=== Enterprise Admin + +[source,json] +---- +{ + "auth": { + "ai": { + "permissions": [ + "ai:admin" + ] + } + } +} +---- + +[[restricted-user-review-only]] +=== Restricted User (Review Only) + +[source,json] +---- +{ + "auth": { + "ai": { + "permissions": [ + "ai:reviews:system:correctness", + "ai:reviews:system:clarity", + "ai:models:gpt-4.1-mini" + ] + } + } +} +---- + +[[best-practices]] +== Best Practices + +[[permission-design]] +=== Permission Design + +Begin with minimal, specific permissions based on actual requirements. Use wildcards only for testing environments and power users who need comprehensive access. Gradually expand permissions based on user needs and usage patterns. + +Avoid `ai:models:*` in production to prevent unexpected access to new expensive models. Use provider-specific permissions like `ai:models:openai:*` for better control, or specify exact models for maximum control. Start with common formats (PDF, DOCX, TXT, PNG, JPEG) and add specialized formats only when needed. + +[[error-handling]] +== Error Handling + +When a user lacks required permissions, the API returns a `403 Forbidden` error with the message "No permissions to the resource". Common issues include missing model permissions, file type restrictions, feature access without permission, and action/review access without permission. + +[[related-features]] +== Related Features + +* xref:tinymceai-jwt-authentication-intro.adoc[JWT Authentication] – JWT authentication setup and required claims. +* xref:tinymceai-models.adoc[AI Models] – Model selection and capabilities. +* xref:tinymceai-chat.adoc[Chat] – Interactive AI discussions. +* xref:tinymceai-review-plugin.adoc[Review] – Content improvement. +* xref:tinymceai-actions-plugin.adoc[Quick Actions] – Content transformation. diff --git a/modules/ROOT/pages/tinymceai-privacy.adoc b/modules/ROOT/pages/tinymceai-privacy.adoc new file mode 100644 index 0000000000..d63b40582c --- /dev/null +++ b/modules/ROOT/pages/tinymceai-privacy.adoc @@ -0,0 +1,6 @@ += TinyMCE AI Privacy + +:navtitle: Privacy +:description: Privacy considerations for TinyMCE AI +:description_short: Privacy considerations +:keywords: AI, privacy, data privacy, tinymceai diff --git a/modules/ROOT/pages/tinymceai-rest-api.adoc b/modules/ROOT/pages/tinymceai-rest-api.adoc new file mode 100644 index 0000000000..34cc830b23 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-rest-api.adoc @@ -0,0 +1,8 @@ += {pluginname} REST API Reference + +:navtitle: REST API Reference +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: REST API reference for TinyMCE AI +:description_short: REST API reference +:keywords: AI, REST API, API reference, tinymceai diff --git a/modules/ROOT/pages/tinymceai-review-plugin.adoc b/modules/ROOT/pages/tinymceai-review-plugin.adoc new file mode 100644 index 0000000000..8d30dc532e --- /dev/null +++ b/modules/ROOT/pages/tinymceai-review-plugin.adoc @@ -0,0 +1,123 @@ += TinyMCE AI Review +:navtitle: Review +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: AI Review feature for TinyMCE AI plugin +:description_short: AI Review feature +:keywords: AI, review, reviews, tinymceai +:page-role: -toc + +The Review feature provides AI-powered quality assurance for content by running checks for grammar, style, tone, and more. It introduces an intuitive interface for reviewing and managing AI-suggested edits directly within the document, ensuring content meets professional standards with minimal manual effort. + +The Review feature is available as a plugin UI and through the xref:tinymceai-review-plugin.adoc#reviews-api[Reviews API]. This page covers both: + +* Plugin sections describe user-facing features and configuration. +* API sections cover REST API access (starting at xref:tinymceai-review-plugin.adoc#reviews-api[Reviews API]). + +[[demo]] +== Demo + +liveDemo::tinymceai[] + +The Review feature analyzes content and provides specific recommendations for grammar, style, clarity, and tone improvements. Unlike Actions that transform content directly, Reviews analyze content and provide suggestions without automatically changing the content. + +image::https://placehold.net/default.png[{pluginname} Review feature showing AI-powered quality assurance and suggested edits] + +[[integration]] +== Integration + +To start using the Review feature, first load the {pluginname} plugin in the editor configuration. The Review Mode button image:icons/ai-review.svg[Review icon,24px] will appear in the AI user interface. See xref:tinymceai.adoc[Plugin Reference] for installation and enabling AI features. + +After picking one of the available commands in the Review Mode tab, AI will analyze the document and propose a series of suggestions: + +image::https://placehold.net/default.png[{pluginname} Review sidebar with suggestions] + +While in the Review Mode, the editor remains read-only and allows browsing suggestions. Suggestions can be clicked in the sidebar or selected in the editor content (underlined): + +image::https://placehold.net/default.png[{pluginname} Review suggestion in content] + +Review suggestions can be accepted or dismissed by clicking the corresponding buttons. All suggestions can also be accepted by using the "Accept all" button in the top of the user interface and xref:tinymceai-chat.adoc#previewing-changes[previewing changes similar to chat suggestions]. Changes that were accepted or dismissed become greyed out in the interface. The review can also be abandoned by clicking the "Exit review" button. + +Once reviewing is complete and all changes are accepted or rejected, click "Finish review" (the button state changes automatically) to return to the normal operation of the editor, where typing is possible. + +[[review-commands]] +== Review commands + +The feature comes with several review commands: + +[cols="1,1,1"] +|=== +|Command name |Command description |Additional information + +|**Proofread** |Check the text for errors in grammar, spelling and punctuation | + +|**Improve clarity** |Improve the logical structure and precision for clearer message | + +|**Improve readability** |Adjust sentence structure and word choice for an easier read | + +|**Adjust length** |Shorten or lengthen the text as needed |_Longer_ and _Shorter_ options available + +|**Adjust tone and style** |Modify the text to a desired tone and style |Several tone and style options are available: _Casual, Direct, Friendly, Confident, Professional_ +|=== + +[NOTE] +==== +Custom commands and translation are not currently supported in the Review feature. This may change in future updates. +==== + +[[reviews-api]] +== Reviews API + +The Review plugin feature is built on top of the Reviews API, which provides REST API access to review functionality. Reviews provide comprehensive content analysis and improvement suggestions. Unlike Actions that transform content directly, Reviews analyze content and provide specific recommendations for grammar, style, clarity, and tone improvements. + +**When to use Reviews vs Actions:** Use Reviews when analyzing entire documents for quality improvements and getting suggestions without automatically changing the content. Use Actions when transforming specific text content (fix grammar, translate, adjust tone). + +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 + +{pluginname} provides built-in system reviews for comprehensive content analysis through the API. These correspond to the review commands available in the plugin UI: + +* **Correctness** (corresponds to "Proofread" in plugin) – Fix grammar, spelling, and factual errors. See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the correctness endpoint. +* **Clarity** (corresponds to "Improve clarity" in plugin) – Improve sentence structure, word choice, and logical flow. See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the clarity endpoint. +* **Readability** (corresponds to "Improve readability" in plugin) – Enhance paragraph structure, transitions, and reading level. See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the readability endpoint. +* **Length Optimization** (corresponds to "Adjust length" in plugin) – Expand or condense content while preserving key information. See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the length optimization endpoint. +* **Tone Adjustment** (corresponds to "Adjust tone and style" in plugin) – Modify tone to casual, direct, friendly, confident, or professional styles. See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for tone adjustment endpoints. +* **Translation** – Translate content between languages with cultural adaptation. (Note: Translation is not currently available in the plugin UI, but is available via the API.) See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the translation endpoint. + +[[reviews-custom-reviews]] +=== Custom Reviews + +In addition to system reviews, custom reviews can be created tailored to specific content quality standards and editorial guidelines. Custom reviews allow defining specialized analysis criteria using custom prompts to control the review behavior. + +Unlike system reviews that use predefined identifiers, custom reviews use a unified endpoint where the analysis behavior is defined through a prompt parameter. See https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] for the custom reviews endpoint and implementation details. + +Custom reviews require the `ai:reviews:custom` permission in the JWT token. + +[[reviews-streaming]] +=== 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-api-reference]] +=== API Reference + +For complete endpoint documentation, request/response schemas, authentication details, and additional parameters, see: + +* **https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API Reference]** – Full documentation for system and custom reviews endpoints with interactive examples + +The REST API documentation includes examples for: + +* Basic grammar review - see https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] +* Clarity improvement - see https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] +* Tone adjustment - see https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] +* Translation reviews - see https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] +* Custom reviews with custom prompts - see https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] +* Streaming responses - see https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API] + +[[related-features]] +== Related Features + +* xref:tinymceai-chat.adoc[AI chat] – For interactive discussions with document analysis and context. +* xref:tinymceai-actions-plugin.adoc[Quick actions] – For content transformation and batch processing. diff --git a/modules/ROOT/pages/tinymceai-streaming.adoc b/modules/ROOT/pages/tinymceai-streaming.adoc new file mode 100644 index 0000000000..f095e12a27 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-streaming.adoc @@ -0,0 +1,128 @@ += TinyMCE AI Streaming + +:navtitle: Streaming +:pluginname: TinyMCE AI +:plugincode: tinymceai +:description: Streaming configuration for TinyMCE AI +:description_short: Streaming configuration +:keywords: AI, streaming, configuration, tinymceai + +Real-time AI interactions using Server-Sent Events (SSE) for immediate feedback and progressive content generation. + +[[overview]] +== Overview + +{pluginname} services use Server-Sent Events (SSE) to provide real-time streaming responses. This allows users to see AI-generated content as it is being created, providing immediate feedback and enabling interactive experiences. + +[[sse-event-types]] +== SSE Event Types + +Different AI services provide different types of streaming events. For service-specific event details, see: + +* xref:tinymceai-chat.adoc#conversations-streaming[Chat] – Interactive AI discussions with text streaming, web search sources, and reasoning. +* xref:tinymceai-review-plugin.adoc#reviews-streaming[Review] – Content improvement suggestions and review progress. +* xref:tinymceai-actions-plugin.adoc#actions-streaming[Quick Actions] – Content transformations and action progress. + +[[basic-implementation]] +== Basic Implementation + +Here is the standard pattern for consuming SSE streams: + +[source,javascript] +---- +const response = await fetch('/v1/your-endpoint', { + method: 'POST', + headers: { + 'Authorization': 'Bearer ', + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + // Request payload + }) +}); + +const reader = response.body.getReader(); +const decoder = new TextDecoder(); + +while (true) { + const { done, value } = await reader.read(); + if (done) break; + + const chunk = decoder.decode(value); + const lines = chunk.split('\n'); + + for (const line of lines) { + if (line.startsWith('data: ')) { + const data = JSON.parse(line.slice(6)); + + // Handle different event types + // See service-specific guides for detailed event handling: + // - Conversations: text-delta, source, reasoning, modification-delta + // - Reviews: review-delta, review-metadata + // - Actions: modification-delta, action-metadata + + switch (data.event) { + case 'error': + // Handle errors + console.error('Error:', data.data.message); + break; + default: + // Handle all other events + console.log('Event:', data.event, data.data); + } + } + } +} +---- + +[[event-handling-patterns]] +== Event Handling Patterns + +For detailed event handling examples specific to each service, see: + +* xref:tinymceai-chat.adoc#conversations-streaming[Chat] – Text streaming, web search sources, reasoning, and document modifications. +* xref:tinymceai-review-plugin.adoc#reviews-streaming[Review] – Review suggestions and progress tracking. +* xref:tinymceai-actions-plugin.adoc#actions-streaming[Quick Actions] – Content transformations and action progress. + +[[error-handling]] +== Error Handling + +Always handle errors gracefully: + +[source,javascript] +---- +if (data.event === 'error') { + const error = data.data; + console.error('Streaming error:', error.message); + + // Show user-friendly error message + showErrorMessage(error.message); + + // Optionally retry or fallback + if (error.retryable) { + setTimeout(() => retryRequest(), 1000); + } +} +---- + +[[progress-tracking]] +== Progress Tracking + +Use metadata events to show progress. For service-specific progress tracking examples, see xref:tinymceai-review-plugin.adoc[Review progress and status information]. + +[[api-reference]] +== API Reference + +For complete documentation on streaming endpoints, event schemas, and error codes, see: + +* **https://tinymceai.api.tiny.cloud/docs[Complete API Documentation]** – Interactive API reference with streaming implementation details. +* **https://tinymceai.api.tiny.cloud/docs#tag/Conversations[Conversations API]** – Streaming events for conversations. +* **https://tinymceai.api.tiny.cloud/docs#tag/Reviews[Reviews API]** – Streaming events for reviews. +* **https://tinymceai.api.tiny.cloud/docs#tag/Actions[Actions API]** – Streaming events for actions. + +[[next-steps]] +== Next Steps + +* xref:tinymceai-chat.adoc[Learn about Chat] for interactive AI discussions. +* xref:tinymceai-review-plugin.adoc[Explore Review] for content improvement. +* xref:tinymceai-actions-plugin.adoc[Discover Quick Actions] for content transformation. diff --git a/modules/ROOT/pages/tinymceai-with-jwt-authentication-nodejs.adoc b/modules/ROOT/pages/tinymceai-with-jwt-authentication-nodejs.adoc new file mode 100644 index 0000000000..ff21992b26 --- /dev/null +++ b/modules/ROOT/pages/tinymceai-with-jwt-authentication-nodejs.adoc @@ -0,0 +1,235 @@ += {pluginname} with JWT authentication (Node.js) Guide +:plugincode: tinymceai +:pluginname: TinyMCE AI +:navtitle: JWT Authentication setup for TinyMCE AI +:description: Guide on how to setup JWT Authentication with Node.js for TinyMCE AI with TinyMCE +:keywords: jwt, authentication, tinymceai, ai, node.js + +include::partial$auth/tinymceai/nodejs/intro-and-prerequisites.adoc[] + +include::partial$auth/tinymceai/nodejs/initial-project-setup.adoc[] + +== Generate a Public/Private Key Pair + +include::partial$auth/private-public-key-pairs-for-tiny-cloud-services.adoc[] + +== JWT Configuration Requirements + +This section explains what needs to be configured for JWT authentication, whether using a managed service (such as AWS or Azure JWT services) or setting up a manual endpoint. + +For complete information about JWT requirements, claims, and permissions, see xref:tinymceai-jwt-authentication-intro.adoc[JWT Authentication]. + +include::partial$auth/how-jwts-are-used.adoc[] + +=== JWT endpoint requirements + +A JSON Web Token (JWT) endpoint for {pluginname} requires: + +* The endpoint or server accepts a JSON HTTP POST request. +* User authentication - A method of verifying the user, and that they should have access to the {pluginname}. +* The JWTs are generated (signed) using the _private_ key that pairs with the _public_ key provided to link:{accountjwturl}[{accountpage} - JWT Keys]. +* The endpoint or server produces a JSON response with the token. {pluginname} will submit the token with requests to the AI service. + +=== Required JWT claims for {pluginname} + +JSON Web Tokens produced by the JWT endpoint must include the following claims: + +`+aud+` _(required)_:: +*Type:* `+String+` ++ +The `aud` is a case-sensitive string that must match a valid API key that has the {pluginname} plugin enabled. + +`+sub+` _(required)_:: +*Type:* `+String+` ++ +The `sub` claim identifies the user. This should be a unique identifier for the user making the request. + +`+iat+` _(required)_:: +*Type:* `+Number+` ++ +The `iat` represents the issue timestamp, specified as the number of seconds. For example, to set the issue time to the current timestamp, calculate the issue time as the current timestamp divided by 1000. + +.Example +[source,json] +---- +iat: Math.floor(Date.now() / 1000), // Issue timestamp +---- + +`+exp+` _(required)_:: +*Type:* `+Number+` ++ +The `exp` represents the expiration timestamp, specified as the number of seconds. For example, to set a validity period of 10 minutes, calculate the expiration time as the current timestamp plus 600 seconds. + +.Example +[source,json] +---- +exp: Math.floor(Date.now() / 1000) + (60 * 10) // Expiration time (10 minutes) +---- + +`+auth+` _(required)_:: +*Type:* `+Object+` ++ +The `auth` object contains AI-specific permissions that control which features the user can access. + +The following example grants access to conversations, the recommended agent model, and system actions and reviews. See xref:tinymceai-permissions.adoc[Permissions] for the full list of available permissions. + +.Example +[source,json] +---- +auth: { + ai: { + permissions: [ + "ai:conversations:read", + "ai:conversations:write", + "ai:models:agent", + "ai:actions:system:*", + "ai:reviews:system:*" + ] + } +} +---- + +[NOTE] +==== +See xref:tinymceai-permissions.adoc[Permissions] for a complete list of available permissions and best practices for configuring user access. +==== + +== Set up JWT Endpoint + +The following section shows how to create a JWT endpoint manually. If using a managed JWT service (such as AWS or Azure), configure it according to the requirements above and skip to the xref:#configure-tinymce[Configure {productname}] section. + +=== Server Setup (jwt.js) + +In the root directory, copy and paste the server setup code into the `jwt.js` file. + +[source,javascript] +---- +const express = require('express'); // Sets up the web server. +const jwt = require('jsonwebtoken'); // Generates and signs JWTs. +const cors = require('cors'); // Allows cross-origin requests. +const path = require('path'); // Handles file paths. + +const app = express(); +app.use(cors()); + +// Private key (Replace this with the actual key) +const privateKey = ` +-----BEGIN PRIVATE KEY----- +{Your private PKCS8 key goes here} +-----END PRIVATE KEY----- +`; + +app.use(express.static(path.join(__dirname, 'public'))); + +// JWT token generation endpoint +app.post('/jwt', (req, res) => { + const payload = { + aud: 'no-api-key', // Replace with the actual API key + sub: 'user-id', // Replace with actual user identifier + iat: Math.floor(Date.now() / 1000), // Issue timestamp + exp: Math.floor(Date.now() / 1000) + (60 * 10), // Expiration time (10 minutes) + // Permissions control which AI features the user can access. See the Permissions page for full details. + auth: { + ai: { + permissions: [ + 'ai:conversations:read', + 'ai:conversations:write', + 'ai:models:agent', + 'ai:actions:system:*', + 'ai:reviews:system:*' + ] + } + } + }; + + try { + // Tokens are signed with the RS256 algorithm using the private key + const token = jwt.sign(payload, privateKey, { algorithm: 'RS256' }); + res.json({ token }); + } catch (error) { + res.status(500).send('Failed to generate JWT token.'); + console.error(error.message); + } +}); + +const PORT = 3000; +app.listen(PORT, () => { + console.log(`Server running at http://localhost:${PORT}`); +}); +---- + +[NOTE] +==== +The JWT payload includes an `auth.ai.permissions` array that defines what AI features the user can access. Adjust these permissions based on requirements. See xref:tinymceai-permissions.adoc[Permissions] for more details on available permissions. +==== + +== Configure {productname} + +[[configure-tinymce]] +=== Web Page (public/index.html) + +Inside the `public` folder where the `index.html` file was created, add the HTML setup code. + +[source,html] +---- + + + + {productname} with {pluginname} + + + + +

{pluginname} Demo

+ + + +---- + +[[model-configuration]] +=== Model configuration + +Model selection can be configured using `tinymceai_default_model` and `tinymceai_allow_model_selection`. See xref:tinymceai-chat.adoc#model-selection-configuration[Chat model configuration] for details. Model access is controlled by JWT permissions; see xref:tinymceai-permissions.adoc#model-permissions[Model permissions] for available model permissions and xref:tinymceai-models.adoc[AI Models] for the list of available models. + +.Example: Adding model options to the JWT setup +[source,html] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_default_model: 'agent-1', + tinymceai_allow_model_selection: true, + // This demo does not verify user session; it simulates an already-authenticated user. Integrate with your auth before returning tokens. + tinymceai_token_provider: () => { + return fetch('http://localhost:3000/jwt', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }).then(response => response.json()); + }, +}); +---- + +== Configuration and Running + +include::partial$auth/tinymceai/nodejs/configuration-steps.adoc[] diff --git a/modules/ROOT/pages/tinymceai-with-jwt-authentication-php.adoc b/modules/ROOT/pages/tinymceai-with-jwt-authentication-php.adoc new file mode 100644 index 0000000000..074360c64e --- /dev/null +++ b/modules/ROOT/pages/tinymceai-with-jwt-authentication-php.adoc @@ -0,0 +1,238 @@ += {pluginname} with JWT authentication (PHP) Guide +:navtitle: JWT Authentication setup for TinyMCE AI +:description: Guide on how to setup JWT Authentication with PHP for TinyMCE AI with TinyMCE +:keywords: jwt, authentication, tinymceai, ai, php +:pluginname: TinyMCE AI +:plugincode: tinymceai + +include::partial$auth/tinymceai/php/intro-and-prerequisites.adoc[] + +include::partial$auth/tinymceai/php/initial-project-setup.adoc[] + +== Generate a Public/Private Key Pair + +include::partial$auth/private-public-key-pairs-for-tiny-cloud-services.adoc[] + +== JWT Configuration Requirements + +This section explains what needs to be configured for JWT authentication, whether using a managed service (such as AWS or Azure JWT services) or setting up a manual endpoint. + +For complete information about JWT requirements, claims, and permissions, see xref:tinymceai-jwt-authentication-intro.adoc[JWT Authentication]. + +include::partial$auth/how-jwts-are-used.adoc[] + +=== JWT endpoint requirements + +A JSON Web Token (JWT) endpoint for {pluginname} requires: + +* The endpoint or server accepts a JSON HTTP POST request. +* User authentication - A method of verifying the user, and that they should have access to the {pluginname}. +* The JWTs are generated (signed) using the _private_ key that pairs with the _public_ key provided to link:{accountjwturl}[{accountpage} - JWT Keys]. +* The endpoint or server produces a JSON response with the token. {pluginname} will submit the token with requests to the AI service. + +=== Required JWT claims for {pluginname} + +JSON Web Tokens produced by the JWT endpoint must include the following claims: + +`+aud+` _(required)_:: +*Type:* `+String+` ++ +The `aud` is a case-sensitive string that must match a valid API key that has the {pluginname} plugin enabled. + +`+sub+` _(required)_:: +*Type:* `+String+` ++ +The `sub` claim identifies the user. This should be a unique identifier for the user making the request. + +`+iat+` _(required)_:: +*Type:* `+Number+` ++ +The `iat` represents the issue timestamp, specified as the number of seconds. For example, to set the issue time to the current timestamp, calculate the issue time as the current timestamp divided by 1000. + +.Example +[source,json] +---- +iat: Math.floor(Date.now() / 1000), // Issue timestamp +---- + +`+exp+` _(required)_:: +*Type:* `+Number+` ++ +The `exp` represents the expiration timestamp, specified as the number of seconds. For example, to set a validity period of 10 minutes, calculate the expiration time as the current timestamp plus 600 seconds. + +.Example +[source,json] +---- +exp: Math.floor(Date.now() / 1000) + (60 * 10) // Expiration time (10 minutes) +---- + +`+auth+` _(required)_:: +*Type:* `+Object+` ++ +The `auth` object contains AI-specific permissions that control which features the user can access. + +The following example grants access to conversations, the recommended agent model, and system actions and reviews. See xref:tinymceai-permissions.adoc[Permissions] for the full list of available permissions. + +.Example +[source,json] +---- +auth: { + ai: { + permissions: [ + "ai:conversations:read", + "ai:conversations:write", + "ai:models:agent", + "ai:actions:system:*", + "ai:reviews:system:*" + ] + } +} +---- + +[NOTE] +==== +See xref:tinymceai-permissions.adoc[Permissions] for a complete list of available permissions and best practices for configuring user access. +==== + +== Set up JWT Endpoint + +The following section shows how to create a JWT endpoint manually. If using a managed JWT service (such as AWS or Azure), configure it according to the requirements above and skip to the xref:#configure-tinymce[Configure {productname}] section. + +=== Server Setup (jwt.php) + +In the root directory, copy and paste the server setup code into the `jwt.php` file. + +[source,php] +---- + "JWT auth failed: " . $message))); +} + +// Check for OpenSSL extension +if (!extension_loaded('openssl')) { + fatalError('The openssl extension must be enabled in php.ini.'); +} + +// Enable CORS +header("Access-Control-Allow-Origin: *"); +header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept"); + +// JWT payload +$payload = array( + "aud" => "no-api-key", // Replace with the actual API key + "sub" => "user-id", // Replace with actual user identifier + "iat" => time(), // Issue timestamp + "exp" => time() + 60 * 10, // Expiration time (10 minutes) + // Permissions control which AI features the user can access. See the Permissions page for full details. + "auth" => array( + "ai" => array( + "permissions" => array( + "ai:conversations:read", + "ai:conversations:write", + "ai:models:agent", + "ai:actions:system:*", + "ai:reviews:system:*" + ) + ) + ) +); + +try { + // Tokens are signed with the RS256 algorithm using the private key + $privateKey = << $token)); +} catch (Exception $e) { + fatalError($e->getMessage()); +} +?> +---- + +[NOTE] +==== +The JWT payload includes an `auth.ai.permissions` array that defines what AI features the user can access. Adjust these permissions based on requirements. See xref:tinymceai-permissions.adoc[Permissions] for more details on available permissions. +==== + +== Configure {productname} + +[[configure-tinymce]] +=== Web Page (index.html) + +Inside the root directory where the `index.html` file was created, add the HTML setup code. + +[source,html] +---- + + + + {productname} with {pluginname} + + + + +

{pluginname} Demo

+ + + +---- + +[[model-configuration]] +=== Model configuration + +Model selection can be configured using `tinymceai_default_model` and `tinymceai_allow_model_selection`. See xref:tinymceai-chat.adoc#model-selection-configuration[Chat model configuration] for details. Model access is controlled by JWT permissions; see xref:tinymceai-permissions.adoc#model-permissions[Model permissions] for available model permissions and xref:tinymceai-models.adoc[AI Models] for the list of available models. + +.Example: Adding model options to the JWT setup +[source,html] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_default_model: 'agent-1', + tinymceai_allow_model_selection: true, + // This demo does not verify user session; it simulates an already-authenticated user. Integrate with your auth before returning tokens. + tinymceai_token_provider: () => { + return fetch('http://localhost:3000/jwt.php', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }).then(response => response.json()); + }, +}); +---- + +== Configuration and Running + +include::partial$auth/tinymceai/php/configuration-steps.adoc[] diff --git a/modules/ROOT/pages/tinymceai.adoc b/modules/ROOT/pages/tinymceai.adoc new file mode 100644 index 0000000000..94623b0d87 --- /dev/null +++ b/modules/ROOT/pages/tinymceai.adoc @@ -0,0 +1,130 @@ += TinyMCE AI Plugin +:navtitle: TinyMCE AI +:description: AI-powered features for TinyMCE AI including AI chat, AI review, and quick actions +:description_short: AI-powered features for {productname} +:keywords: AI, artificial intelligence, chat, review, quick actions, tinymceai +:pluginname: TinyMCE AI +:plugincode: tinymceai +:pluginminimumplan: enterpriseplan +:plugincategory: premium +:page-role: -toc + +include::partial$misc/admon-premium-plugin.adoc[] + +The {pluginname} plugin integrates AI-assisted authoring with rich-text editing. Users can interact through Actions, Reviews, or Conversations that can use relevant context from multiple sources. + +[[interactive-example]] +== Interactive example + +liveDemo::{plugincode}[] + +[[basic-setup]] +== Basic setup + +To setup the {pluginname} plugin in the editor: + +* add `{plugincode}` to the `plugins` option in the editor configuration; +* configure the `tinymceai_token_provider` option to provide authentication tokens (must return `+{ token: string }+`); +* add the AI toolbar buttons to the `toolbar` option. The plugin provides: `+tinymceai-chat+` image:icons/ai-assistant.svg[Chat icon,24px], `+tinymceai-quickactions+` image:icons/ai-prompt.svg[Quick Actions icon,24px], and `+tinymceai-review+` image:icons/ai-review.svg[Review icon,24px]; + +[[minimal-setup]] +=== Minimal setup + +[source,js] +---- +tinymce.init({ + selector: 'textarea', // change this value according to the HTML + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[complete-setup]] +=== Complete setup example + +[source,js] +---- +tinymce.init({ + selector: '#editor', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + content_id: 'document-123', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + }, + tinymceai_sidebar_type: 'static', + tinymceai_default_model: 'agent-1', + tinymceai_allow_model_selection: true, + tinymceai_chat_fetch_sources: async () => [ + { + label: 'My Documents', + sources: [ + { id: 'doc-1', label: 'Document 1', type: 'file' }, + { id: 'url-1', label: 'Web Page', type: 'web-resource' } + ] + } + ], + tinymceai_chat_fetch_source: async (id) => { + const res = await fetch(`/api/documents/${id}`); + const blob = await res.blob(); + const filename = `${id}.pdf`; + return { type: 'file', file: new File([blob], filename, { type: blob.type }) }; + }, + tinymceai_quickactions_custom: [ + { title: 'Explain like I am five', prompt: 'Explain the following text in simple terms.', type: 'chat' } + ] +}); +---- + +[[ui-control]] +== UI Control + +The AI interface is toggled through toolbar buttons or menu items. Clicking `+tinymceai-chat+` image:icons/ai-assistant.svg[Chat icon,24px] opens the chat sidebar; clicking again minimizes it (chat history is preserved). Clicking `+tinymceai-review+` image:icons/ai-review.svg[Review icon,24px] opens the review sidebar. + +To toggle sidebars programmatically, use the core `+ToggleSidebar+` command: + +[source,js] +---- +editor.execCommand('ToggleSidebar', false, 'tinymceai-chat'); +editor.execCommand('ToggleSidebar', false, 'tinymceai-review'); +---- + +To show the chat sidebar on load: + +[source,js] +---- +tinymce.init({ + selector: '#editor', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + sidebar_show: 'tinymceai-chat', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[options]] +== Options + +The following configuration options affect the behavior of the {pluginname} plugin. + +include::partial$configuration/tinymceai_options.adoc[leveloffset=+1] + +include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[] + +include::partial$misc/plugin-menu-item-id-boilerplate.adoc[] + +[[commands]] +== Commands + +The {pluginname} plugin provides the following {productname} commands. + +include::partial$commands/{plugincode}-cmds.adoc[] + + diff --git a/modules/ROOT/partials/auth/how-jwts-are-used.adoc b/modules/ROOT/partials/auth/how-jwts-are-used.adoc index 5b50ac1b35..811b1a5e6f 100644 --- a/modules/ROOT/partials/auth/how-jwts-are-used.adoc +++ b/modules/ROOT/partials/auth/how-jwts-are-used.adoc @@ -11,4 +11,33 @@ ifeval::["{plugincode}" == "tinydrive"] . If your JWT endpoint authorizes the user, your JWT endpoint will send a JWT to {pluginname}, certifying the user. . When the user makes a request (such as adding or deleting a file), the JWT will be sent with the request to show that the user is authorized. This JWT is verified using the _public_ key stored on the {cloudname} Server. . The {cloudname} Server sends a response, indicating that content submission was successful (or unauthorized if necessary). +endif::[] + +ifeval::["{plugincode}" == "tinymceai"] +. {pluginname} requests a signed JWT on behalf of the user. +. If your JWT endpoint authorizes the user, your JWT endpoint will send a JWT to {pluginname}, certifying the user. +. The JWT includes a `sub` (subject) claim that identifies the user. This user identifier is used to lock down conversation history, AI-generated content, and other user-specific data to individual users, ensuring privacy and data isolation. +. When the user makes a request (such as starting a chat conversation, requesting AI actions, or submitting reviews), the JWT will be sent with the request to show that the user is authorized. This JWT is verified using the _public_ key stored on the AI service. +. The AI service sends a response, indicating that the request was successful (or unauthorized if necessary). +endif::[] + +ifeval::["{plugincode}" == "importword"] +. {pluginname} requests a signed JWT on behalf of the user. +. If your JWT endpoint authorizes the user, your JWT endpoint will send a JWT to {pluginname}, certifying the user. +. When the user makes a request (such as importing a document), the JWT will be sent with the request to show that the user is authorized. This JWT is verified using the _public_ key stored on the {pluginname} Server. +. The {pluginname} Server sends a response, indicating that content submission was successful (or unauthorized if necessary). +endif::[] + +ifeval::["{plugincode}" == "exportword"] +. {pluginname} requests a signed JWT on behalf of the user. +. If your JWT endpoint authorizes the user, your JWT endpoint will send a JWT to {pluginname}, certifying the user. +. When the user makes a request (such as exporting a document), the JWT will be sent with the request to show that the user is authorized. This JWT is verified using the _public_ key stored on the {pluginname} Server. +. The {pluginname} Server sends a response, indicating that content submission was successful (or unauthorized if necessary). +endif::[] + +ifeval::["{plugincode}" == "exportpdf"] +. {pluginname} requests a signed JWT on behalf of the user. +. If your JWT endpoint authorizes the user, your JWT endpoint will send a JWT to {pluginname}, certifying the user. +. When the user makes a request (such as exporting a document), the JWT will be sent with the request to show that the user is authorized. This JWT is verified using the _public_ key stored on the {pluginname} Server. +. The {pluginname} Server sends a response, indicating that content submission was successful (or unauthorized if necessary). endif::[] \ No newline at end of file diff --git a/modules/ROOT/partials/auth/private-public-key-pairs-for-tiny-cloud-services.adoc b/modules/ROOT/partials/auth/private-public-key-pairs-for-tiny-cloud-services.adoc index 5e4b309b95..456d573004 100644 --- a/modules/ROOT/partials/auth/private-public-key-pairs-for-tiny-cloud-services.adoc +++ b/modules/ROOT/partials/auth/private-public-key-pairs-for-tiny-cloud-services.adoc @@ -1,16 +1,20 @@ -The **{pluginname}** Server requires a _public_ key generated from the same _private_ key that will be used on your JSON Web Token (JWT) provider endpoint. The public key(s) stored on the {pluginname} Server are used to ensure that content is sent by authorized users. +The **{pluginname}** Server requires a _public_ key generated from the same _private_ key that will be used on the JSON Web Token (JWT) provider endpoint. The public key(s) stored on the {pluginname} Server are used to ensure that content is sent by authorized users. -There are two methods for generating and adding a public key in the JWT Keys section of your account portal: +There are two methods for generating and adding a public key in the JWT Keys section of the account portal: . Generate New Keypair at link:{accountjwturl}[{accountpage} - JWT Keys] (recommended). . Generate a key pair locally and Import Public Key at link:{accountjwturl}[{accountpage} - JWT Keys]. -== Generate a key pair using the {accountpage} JWT Keys page +=== Generate a key pair using the {accountpage} JWT Keys page The link:{accountjwturl}[{accountpage} - JWT Keys] page provides a "Generate New Keypair" option, providing a quick and secure way of generating the required keys. This will store a copy of the _public_ key, and provide a downloadable file for both the public and private keys. {companyname} does **not store** the _private_ key and the key pair **cannot** be retrieved later. +=== Generate a key pair locally and add it to the account + +This method involves two steps: generating the key pair locally, then adding the public key to the account portal. + [[generate-a-key-pair-locally]] -== Generate a key pair locally +==== Generate a key pair locally When generating a key pair locally, use one of the supported algorithms. include::partial$auth/jwt-supported-algorithms.adoc[] @@ -19,11 +23,11 @@ For instructions on generating a key pair locally, see: xref:generate-rsa-key-pa [[add-a-public-key-to-the-tiny-cloud-api-key]] ifeval::[{numberedHeading} == true] -= 2. Add a public key in the JWT Keys section of your account portal +==== 2. Add a public key in the JWT Keys section of the account portal endif::[] ifeval::[{numberedHeading} != true] -== Add a public key in the JWT Keys section of your account portal +==== Add a public key in the JWT Keys section of the account portal endif::[] -Once a public key has been generated locally, use the "Import Public Key" option in the JWT Keys section of your account portal at: link:{accountjwturl}[{accountpage} - JWT Keys]. +Once a public key has been generated locally, use the "Import Public Key" option in the JWT Keys section of the account portal at: link:{accountjwturl}[{accountpage} - JWT Keys]. diff --git a/modules/ROOT/partials/auth/tinymceai/jwt-setup-tinymceai.adoc b/modules/ROOT/partials/auth/tinymceai/jwt-setup-tinymceai.adoc new file mode 100644 index 0000000000..8980e84aff --- /dev/null +++ b/modules/ROOT/partials/auth/tinymceai/jwt-setup-tinymceai.adoc @@ -0,0 +1,86 @@ +[[setting-up-jwt-authentication]] +== Setting up JWT authentication + +To set up JSON Web Token (JWT) authentication for {productname} {pluginname}: + +. Add a public key to the {accountpage}, link:https://www.tiny.cloud/auth/login/[login]. +. Set up a JSON Web Token (JWT) Provider endpoint using link:{accountjwturl}[{accountpage} - JWT Keys] +. Configure {productname} to use the JWT endpoint. + +include::partial$auth/private-public-key-pairs-for-tiny-cloud-services.adoc[] + +[[set-up-a-json-web-token-jwt-endpoint]] +== Set up a JSON Web Token (JWT) endpoint + +include::partial$auth/how-jwts-are-used.adoc[] + +=== JWT endpoint requirements + +A JSON Web Token (JWT) endpoint for {pluginname} requires: + +* The endpoint or server accepts a JSON HTTP POST request. +* User authentication - A method of verifying the user, and that they should have access to the {pluginname}. +* The JWTs are generated (signed) using the _private_ key that pairs with the _public_ key provided to link:{accountjwturl}[{accountpage} - JWT Keys]. +* The endpoint or server produces a response containing the token (JSON or plain text). {pluginname} will submit the token with requests to the AI service. + +=== Required JWT claims for {pluginname} + +JSON Web Tokens produced by the JWT endpoint must include the following claims: + +`+aud+` _(required)_:: +*Type:* `+String+` ++ +The `aud` is a case-sensitive string that must match a valid API key that has the {pluginname} plugin enabled. + +`+sub+` _(required)_:: +*Type:* `+String+` ++ +The `sub` claim identifies the user. This should be a unique identifier for the user making the request. + +`+iat+` _(required)_:: +*Type:* `+Number+` ++ +The `iat` represents the issue timestamp, specified as the number of seconds. For example, to set the issue time to the current timestamp, calculate the issue time as the current timestamp divided by 1000. + +.Example +[source,json] +---- +iat: Math.floor(Date.now() / 1000), // Issue timestamp +---- + +`+exp+` _(required)_:: +*Type:* `+Number+` ++ +The `exp` represents the expiration timestamp, specified as the number of seconds. For example, to set a validity period of 10 minutes, calculate the expiration time as the current timestamp plus 600 seconds. + +.Example +[source,json] +---- +exp: Math.floor(Date.now() / 1000) + (60 * 10) // Expiration time (10 minutes) +---- + +`+auth+` _(required)_:: +*Type:* `+Object+` ++ +The `auth` object contains AI-specific permissions that control which features the user can access. + +.Example +[source,json] +---- +auth: { + ai: { + permissions: [ + "ai:conversations:read", + "ai:conversations:write", + "ai:models:agent", + "ai:actions:system:*", + "ai:reviews:system:*" + ] + } +} +---- + +[NOTE] +==== +See xref:tinymceai-permissions.adoc[Permissions] for a complete list of available permissions and best practices for configuring user access. +==== diff --git a/modules/ROOT/partials/auth/tinymceai/nodejs/configuration-steps.adoc b/modules/ROOT/partials/auth/tinymceai/nodejs/configuration-steps.adoc new file mode 100644 index 0000000000..89580518d4 --- /dev/null +++ b/modules/ROOT/partials/auth/tinymceai/nodejs/configuration-steps.adoc @@ -0,0 +1,36 @@ +== Configuration Steps + +=== Add API Key + +* Replace `no-api-key` in both files with the actual {productname} API key +* The API key should be the same in both the HTML script source and the JWT payload + +=== Add Private Key + +* Replace the private key placeholder in `jwt.js` with the actual private key +* Make sure it's in `PKCS8` format +* Keep this key secure and never share it publicly + +=== Configure AI Permissions + +* Adjust the `auth.ai.permissions` array in the JWT payload based on requirements +* See xref:tinymceai-permissions.adoc[Permissions] for available permissions and best practices + +=== Configure model selection (optional) + +* Add `tinymceai_default_model` and `tinymceai_allow_model_selection` to the editor config if needed +* See xref:tinymceai-with-jwt-authentication-nodejs.adoc#model-configuration[Model configuration] for details + +=== Running the Project + +. Start the server: ++ +[source,bash] +---- +node jwt.js +---- + +. Open the browser to: `http://localhost:3000` +. The following should be visible: +* The {productname} editor +* AI feature buttons in the toolbar (tinymceai-chat, tinymceai-quickactions, tinymceai-review) diff --git a/modules/ROOT/partials/auth/tinymceai/nodejs/initial-project-setup.adoc b/modules/ROOT/partials/auth/tinymceai/nodejs/initial-project-setup.adoc new file mode 100644 index 0000000000..51213d134e --- /dev/null +++ b/modules/ROOT/partials/auth/tinymceai/nodejs/initial-project-setup.adoc @@ -0,0 +1,41 @@ +== Quick Start Guide + +If a Node.js project is not already set up, follow the steps below to create a basic environment for integrating TinyMCE AI with JWT authentication. If a project is already configured, skip this section and proceed to the xref:tinymceai-with-jwt-authentication-nodejs.adoc#jwt-configuration-requirements[JWT Configuration Requirements] section. + +=== Project Setup + +[source,bash] +---- +# Create and enter project directory +mkdir tinymce-my-app +cd tinymce-my-app + +# Initialize project +npm init -y + +# Install required packages +npm install express cors jsonwebtoken +---- + +Verify that the `package.json` file now includes the required dependencies. + +=== Create Project Structure + +[source,bash] +---- +# Create the public folder for web files +mkdir public +touch public/index.html +touch jwt.js +---- + +The project should look like this: + +[source] +---- +/tinymce-my-app + /public + index.html (TinyMCE webpage) + jwt.js (Server code) + package.json (Project configuration) +---- diff --git a/modules/ROOT/partials/auth/tinymceai/nodejs/intro-and-prerequisites.adoc b/modules/ROOT/partials/auth/tinymceai/nodejs/intro-and-prerequisites.adoc new file mode 100644 index 0000000000..b9ccddc90d --- /dev/null +++ b/modules/ROOT/partials/auth/tinymceai/nodejs/intro-and-prerequisites.adoc @@ -0,0 +1,31 @@ +== Introduction + +{pluginname} requires setting up JSON Web Token (JWT) authentication to maintain control over AI feature access. A JWT endpoint generates and provides authorization tokens that verify users are authorized to use AI features, preventing unauthorized access. As a standard web services authorization solution, JWT is documented extensively at link:https://jwt.io/[https://jwt.io/]. {productname} recommends using the libraries listed on link:https://www.jwt.io/libraries[jwt.io/libraries] to create JWT tokens. + +This guide provides a comprehensive walkthrough for integrating {pluginname} with {productname}, including {pluginname} functionality, by using a Node.js server for JWT token generation. It covers project setup, server configuration, and {productname} customization. + +=== What Will Be Built + +Before diving into the technical details, here's what will be achieved with this guide: + +* A working {productname} editor running the {pluginname} plugin +* A secure authentication system using JWT tokens +* A simple Node.js server to handle the authentication + +[TIP] +==== +This guide is designed for developers new to JWT authentication and {productname} integration. +==== + +=== Prerequisites + +Before starting, ensure you have: + +* Node.js installed on the computer (to check, run `node -v` in the terminal) +* A {productname} API key with TinyMCE AI enabled (get one from link:https://www.tiny.cloud/signup[TinyMCE's website]) +* Basic familiarity with the command line + +[IMPORTANT] +==== +Make sure the API key is ready before starting. It will be needed for both the server and client configuration. +==== diff --git a/modules/ROOT/partials/auth/tinymceai/php/configuration-steps.adoc b/modules/ROOT/partials/auth/tinymceai/php/configuration-steps.adoc new file mode 100644 index 0000000000..ea07404a7b --- /dev/null +++ b/modules/ROOT/partials/auth/tinymceai/php/configuration-steps.adoc @@ -0,0 +1,36 @@ +== Configuration Steps + +=== Add API Key + +* Replace `no-api-key` in both files with the actual {productname} API key +* The API key should be the same in both the HTML script source and the JWT payload + +=== Add Private Key + +* Replace the private key placeholder in `jwt.php` with the actual private key +* Make sure it's in `PKCS8` format +* Keep this key secure and never share it publicly + +=== Configure AI Permissions + +* Adjust the `auth.ai.permissions` array in the JWT payload based on requirements +* See xref:tinymceai-permissions.adoc[Permissions] for available permissions and best practices + +=== Configure model selection (optional) + +* Add `tinymceai_default_model` and `tinymceai_allow_model_selection` to the editor config if needed +* See xref:tinymceai-with-jwt-authentication-php.adoc#model-configuration[Model configuration] for details + +=== Running the Project + +. Start the server: ++ +[source,bash] +---- +php -S localhost:3000 +---- + +. Open the browser to: `http://localhost:3000` +. The following should be visible: +* The {productname} editor +* AI feature buttons in the toolbar (tinymceai-chat, tinymceai-quickactions, tinymceai-review) diff --git a/modules/ROOT/partials/auth/tinymceai/php/initial-project-setup.adoc b/modules/ROOT/partials/auth/tinymceai/php/initial-project-setup.adoc new file mode 100644 index 0000000000..b8f8f89a3c --- /dev/null +++ b/modules/ROOT/partials/auth/tinymceai/php/initial-project-setup.adoc @@ -0,0 +1,53 @@ +== Update PHP Configuration File + +Use the following command to locate the PHP configuration file: + +[source,bash] +---- +php --ini +---- + +Open the configuration file in a text editor and ensure the following settings are enabled: + +[source,ini] +---- +extension=openssl +extension_dir='ext' +---- + +[TIP] +The path to the extension directory may vary depending on the system. + +== Quick Start Guide + +=== Project Setup + +[source,bash] +---- +# Create and enter project directory +mkdir tinymce-app +cd tinymce-app +# Initialize Composer +composer require firebase/php-jwt +---- + +=== Create Project Structure + +[source,bash] +---- +# Create the public folder for web files +touch index.html +touch jwt.php +---- + +The project should look like this: + +[source] +---- +/tinymce-app + index.html (TinyMCE webpage) + jwt.php (Server code) + composer.json + composer.lock + vendor +---- diff --git a/modules/ROOT/partials/auth/tinymceai/php/intro-and-prerequisites.adoc b/modules/ROOT/partials/auth/tinymceai/php/intro-and-prerequisites.adoc new file mode 100644 index 0000000000..9ec88dcce2 --- /dev/null +++ b/modules/ROOT/partials/auth/tinymceai/php/intro-and-prerequisites.adoc @@ -0,0 +1,33 @@ +== Introduction + +{pluginname} requires setting up JSON Web Token (JWT) authentication to maintain control over AI feature access. A JWT endpoint generates and provides authorization tokens that verify users are authorized to use AI features, preventing unauthorized access. As a standard web services authorization solution, JWT is documented extensively at link:https://jwt.io/[https://jwt.io/]. {productname} recommends using the libraries listed on link:https://www.jwt.io/libraries[jwt.io/libraries] to create JWT tokens. + +This guide provides a comprehensive walkthrough for integrating {pluginname} with {productname}, including {pluginname} functionality, by using a PHP server for JWT token generation. It covers project setup, server configuration, and {productname} customization. + +=== What Will Be Built + +Before diving into the technical details, here's what will be achieved with this guide: + +* A working {productname} editor running the {pluginname} plugin +* A secure authentication system using JWT tokens +* A simple PHP server to handle the authentication + +[TIP] +==== +This guide is designed for developers new to JWT authentication and {productname} integration. +==== + +=== Prerequisites + +Before starting, ensure you have: + +* PHP installed on the computer (to check, run `php -v` in the terminal) +* OpenSSL installed on the computer (to check, run `openssl version` in the terminal) +* Composer installed on the computer (to check, run `composer -v` in the terminal) +* A {productname} API key with TinyMCE AI enabled (get one from link:https://www.tiny.cloud/signup[TinyMCE's website]) +* Basic familiarity with the command line + +[IMPORTANT] +==== +Make sure the API key is ready before starting. It will be needed for both the server and client configuration. +==== diff --git a/modules/ROOT/partials/commands/tinymceai-cmds.adoc b/modules/ROOT/partials/commands/tinymceai-cmds.adoc new file mode 100644 index 0000000000..b7f011a83c --- /dev/null +++ b/modules/ROOT/partials/commands/tinymceai-cmds.adoc @@ -0,0 +1,19 @@ +[cols="1,3",options="header"] +|=== +|Command name |Description + +|`+ToggleSidebar+` |Core command. Use `+editor.execCommand('ToggleSidebar', false, 'tinymceai-chat')+` or `+editor.execCommand('ToggleSidebar', false, 'tinymceai-review')+` to toggle the AI Chat or AI Review sidebar. +|=== + +.Examples +[source,js] +---- +// Open the AI Chat sidebar +tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-chat'); + +// Open the AI Review sidebar +tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-review'); + +// Close the current sidebar (pass same ID again to toggle off) +tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-chat'); +---- diff --git a/modules/ROOT/partials/configuration/exportpdf_converter_options.adoc b/modules/ROOT/partials/configuration/exportpdf_converter_options.adoc index 806eea7d6b..667d77a730 100644 --- a/modules/ROOT/partials/configuration/exportpdf_converter_options.adoc +++ b/modules/ROOT/partials/configuration/exportpdf_converter_options.adoc @@ -39,4 +39,4 @@ tinymce.init({ [NOTE] The `exportpdf_service_url` option must be configured for the {pluginname} plugin to work. -> For comprehensive details regarding the `exportpdf_converter_options`, please refer to the https://exportpdf.api.tiny.cloud/docs[API documentation^] available for the {pluginname} Premium plugin. \ No newline at end of file +> For comprehensive details regarding the `exportpdf_converter_options`, please refer to the https://exportpdf.api.tiny.cloud/v1/convert/docs[API documentation^] available for the {pluginname} Premium plugin. \ No newline at end of file diff --git a/modules/ROOT/partials/configuration/icon_list.adoc b/modules/ROOT/partials/configuration/icon_list.adoc index 17901d0db6..c6b1e13aa3 100644 --- a/modules/ROOT/partials/configuration/icon_list.adoc +++ b/modules/ROOT/partials/configuration/icon_list.adoc @@ -8,8 +8,13 @@ | `+action-prev+` | image:icons/action-prev.svg[action-prev.svg] | `+action-prev.svg+` | `+add-file+` | image:icons/add-file.svg[add-file.svg] | `+add-file.svg+` | `+addtag+` | image:icons/addtag.svg[addtag.svg] | `+addtag.svg+` +| `+adjust-length+` | image:icons/adjust-length.svg[adjust-length.svg] | `+adjust-length.svg+` | `+adjustments+` | image:icons/adjustments.svg[adjustments.svg] | `+adjustments.svg+` +| `+ai-assistant+` | image:icons/ai-assistant.svg[ai-assistant.svg] | `+ai-assistant.svg+` +| `+ai-chat-response+` | image:icons/ai-chat-response.svg[ai-chat-response.svg] | `+ai-chat-response.svg+` | `+ai-prompt+` | image:icons/ai-prompt.svg[ai-prompt.svg] | `+ai-prompt.svg+` +| `+ai-review+` | image:icons/ai-review.svg[ai-review.svg] | `+ai-review.svg+` +| `+attachment+` | image:icons/attachment.svg[attachment.svg] | `+attachment.svg+` | `+ai+` | image:icons/ai.svg[ai.svg] | `+ai.svg+` | `+align-center+` | image:icons/align-center.svg[align-center.svg] | `+align-center.svg+` | `+align-justify+` | image:icons/align-justify.svg[align-justify.svg] | `+align-justify.svg+` @@ -33,6 +38,11 @@ | `+cell-background-color+` | image:icons/cell-background-color.svg[cell-background-color.svg] | `+cell-background-color.svg+` | `+cell-border-color+` | image:icons/cell-border-color.svg[cell-border-color.svg] | `+cell-border-color.svg+` | `+change-case+` | image:icons/change-case.svg[change-case.svg] | `+change-case.svg+` +| `+change-tone+` | image:icons/change-tone.svg[change-tone.svg] | `+change-tone.svg+` +| `+chat-commands+` | image:icons/chat-commands.svg[chat-commands.svg] | `+chat-commands.svg+` +| `+chat-reasoning+` | image:icons/chat-reasoning.svg[chat-reasoning.svg] | `+chat-reasoning.svg+` +| `+chat-send+` | image:icons/chat-send.svg[chat-send.svg] | `+chat-send.svg+` +| `+chat-web-search+` | image:icons/chat-web-search.svg[chat-web-search.svg] | `+chat-web-search.svg+` | `+character-count+` | image:icons/character-count.svg[character-count.svg] | `+character-count.svg+` | `+checklist-rtl+` | image:icons/checklist-rtl.svg[checklist-rtl.svg] | `+checklist-rtl.svg+` | `+checklist+` | image:icons/checklist.svg[checklist.svg] | `+checklist.svg+` @@ -45,12 +55,14 @@ | `+close+` | image:icons/close.svg[close.svg] | `+close.svg+` | `+close-filled+` | image:icons/close-filled.svg[close-filled.svg] | `+close-filled.svg+` | `+code-sample+` | image:icons/code-sample.svg[code-sample.svg] | `+code-sample.svg+` +| `+collapse+` | image:icons/collapse.svg[collapse.svg] | `+collapse.svg+` | `+color-levels+` | image:icons/color-levels.svg[color-levels.svg] | `+color-levels.svg+` | `+color-picker+` | image:icons/color-picker.svg[color-picker.svg] | `+color-picker.svg+` | `+color-swatch-remove-color+` | image:icons/color-swatch-remove-color.svg[color-swatch-remove-color.svg] | `+color-swatch-remove-color.svg+` | `+color-swatch+` | image:icons/color-swatch.svg[color-swatch.svg] | `+color-swatch.svg+` | `+comment-add+` | image:icons/comment-add.svg[comment-add.svg] | `+comment-add.svg+` | `+comment+` | image:icons/comment.svg[comment.svg] | `+comment.svg+` +| `+continue-writing+` | image:icons/continue-writing.svg[continue-writing.svg] | `+continue-writing.svg+` | `+contrast+` | image:icons/contrast.svg[contrast.svg] | `+contrast.svg+` | `+copy+` | image:icons/copy.svg[copy.svg] | `+copy.svg+` | `+crop+` | image:icons/crop.svg[crop.svg] | `+crop.svg+` @@ -72,9 +84,11 @@ | `+export-pdf+` | image:icons/export-pdf.svg[export-pdf.svg] | `+export-pdf.svg+` | `+export-word+` | image:icons/export-word.svg[export-word.svg] | `+export-word.svg+` | `+exposure+` | image:icons/exposure.svg[exposure.svg] | `+exposure.svg+` +| `+explain+` | image:icons/explain.svg[explain.svg] | `+explain.svg+` | `+fb+` | image:icons/fb.svg[fb.svg] | `+fb.svg+` | `+feedback+` | image:icons/feedback.svg[feedback.svg] | `+feedback.svg+` | `+fill+` | image:icons/fill.svg[fill.svg] | `+fill.svg+` +| `+fix-grammar+` | image:icons/fix-grammar.svg[fix-grammar.svg] | `+fix-grammar.svg+` | `+flickr+` | image:icons/flickr.svg[flickr.svg] | `+flickr.svg+` | `+flip-horizontally+` | image:icons/flip-horizontally.svg[flip-horizontally.svg] | `+flip-horizontally.svg+` | `+flip-vertically+` | image:icons/flip-vertically.svg[flip-vertically.svg] | `+flip-vertically.svg+` @@ -91,6 +105,7 @@ | `+grayscale+` | image:icons/grayscale.svg[grayscale.svg] | `+grayscale.svg+` | `+help+` | image:icons/help.svg[help.svg] | `+help.svg+` | `+highlight-bg-color+` | image:icons/highlight-bg-color.svg[highlight-bg-color.svg] | `+highlight-bg-color.svg+` +| `+highlight-key-points+` | image:icons/highlight-key-points.svg[highlight-key-points.svg] | `+highlight-key-points.svg+` | `+home+` | image:icons/home.svg[home.svg] | `+home.svg+` | `+horizontal-rule+` | image:icons/horizontal-rule.svg[horizontal-rule.svg] | `+horizontal-rule.svg+` | `+huddle+` | image:icons/huddle.svg[huddle.svg] | `+huddle.svg+` @@ -98,6 +113,7 @@ | `+auto-image-enhancement+` | image:icons/auto-image-enhancement.svg[auto-image-enhancement.svg] | `+auto-image-enhancement.svg+` | `+image-options+` | image:icons/image-options.svg[image-options.svg] | `+image-options.svg+` | `+image+` | image:icons/image.svg[image.svg] | `+image.svg+` +| `+improve-writing+` | image:icons/improve-writing.svg[improve-writing.svg] | `+improve-writing.svg+` | `+import-word+` | image:icons/import-word.svg[import-word.svg] | `+import-word.svg+` | `+indent+` | image:icons/indent.svg[indent.svg] | `+indent.svg+` | `+info+` | image:icons/info.svg[info.svg] | `+info.svg+` @@ -131,6 +147,7 @@ | `+math+` | image:icons/math-equation.svg[math-equation.svg] | `+math-equation.svg+` | `+minus+` | image:icons/minus.svg[minus.svg] | `+minus.svg+` | `+more-drawer+` | image:icons/more-drawer.svg[more-drawer.svg] | `+more-drawer.svg+` +| `+new-chat+` | image:icons/new-chat.svg[new-chat.svg] | `+new-chat.svg+` | `+new-document+` | image:icons/new-document.svg[new-document.svg] | `+new-document.svg+` | `+new-tab+` | image:icons/new-tab.svg[new-tab.svg] | `+new-tab.svg+` | `+non-breaking+` | image:icons/non-breaking.svg[non-breaking.svg] | `+non-breaking.svg+` @@ -138,7 +155,9 @@ | `+onedrive+` | image:icons/onedrive.svg[onedrive.svg] | `+onedrive.svg+` | `+ordered-list-rtl+` | image:icons/ordered-list-rtl.svg[ordered-list-rtl.svg] | `+ordered-list-rtl.svg+` | `+ordered-list+` | image:icons/ordered-list.svg[ordered-list.svg] | `+ordered-list.svg+` +| `+other-actions+` | image:icons/other-actions.svg[other-actions.svg] | `+other-actions.svg+` | `+orientation+` | image:icons/orientation.svg[orientation.svg] | `+orientation.svg+` +| `+pin+` | image:icons/pin.svg[pin.svg] | `+pin.svg+` | `+outdent+` | image:icons/outdent.svg[outdent.svg] | `+outdent.svg+` | `+page-break+` | image:icons/page-break.svg[page-break.svg] | `+page-break.svg+` | `+paragraph+` | image:icons/paragraph.svg[paragraph.svg] | `+paragraph.svg+` @@ -154,6 +173,7 @@ | `+preview+` | image:icons/preview.svg[preview.svg] | `+preview.svg+` | `+print+` | image:icons/print.svg[print.svg] | `+print.svg+` | `+quote+` | image:icons/quote.svg[quote.svg] | `+quote.svg+` +| `+reasoning+` | image:icons/reasoning.svg[reasoning.svg] | `+reasoning.svg+` | `+redo+` | image:icons/redo.svg[redo.svg] | `+redo.svg+` | `+reload+` | image:icons/reload.svg[reload.svg] | `+reload.svg+` | `+remove-formatting+` | image:icons/remove-formatting.svg[remove-formatting.svg] | `+remove-formatting.svg+` @@ -174,9 +194,15 @@ | `+send+` | image:icons/send.svg[send.svg] | `+send.svg+` | `+settings+` | image:icons/settings.svg[settings.svg] | `+settings.svg+` | `+sharpen+` | image:icons/sharpen.svg[sharpen.svg] | `+sharpen.svg+` +| `+source-file+` | image:icons/source-file.svg[source-file.svg] | `+source-file.svg+` +| `+source-image+` | image:icons/source-image.svg[source-image.svg] | `+source-image.svg+` +| `+source-link+` | image:icons/source-link.svg[source-link.svg] | `+source-link.svg+` +| `+source-selection+` | image:icons/source-selection.svg[source-selection.svg] | `+source-selection.svg+` | `+sourcecode+` | image:icons/sourcecode.svg[sourcecode.svg] | `+sourcecode.svg+` | `+spell-check+` | image:icons/spell-check.svg[spell-check.svg] | `+spell-check.svg+` +| `+stop+` | image:icons/stop.svg[stop.svg] | `+stop.svg+` | `+strike-through+` | image:icons/strike-through.svg[strike-through.svg] | `+strike-through.svg+` +| `+summarize+` | image:icons/summarize.svg[summarize.svg] | `+summarize.svg+` | `+subscript+` | image:icons/subscript.svg[subscript.svg] | `+subscript.svg+` | `+superscript+` | image:icons/superscript.svg[superscript.svg] | `+superscript.svg+` | `+suggestededits+` | image:icons/suggestededits.svg[suggestededits.svg] | `+suggestededits.svg+` @@ -216,6 +242,7 @@ | `+undo+` | image:icons/undo.svg[undo.svg] | `+undo.svg+` | `+unlink+` | image:icons/unlink.svg[unlink.svg] | `+unlink.svg+` | `+unlock+` | image:icons/unlock.svg[unlock.svg] | `+unlock.svg+` +| `+unpin+` | image:icons/unpin.svg[unpin.svg] | `+unpin.svg+` | `+unordered-list+` | image:icons/unordered-list.svg[unordered-list.svg] | `+unordered-list.svg+` | `+unselected+` | image:icons/unselected.svg[unselected.svg] | `+unselected.svg+` | `+upload+` | image:icons/upload.svg[upload.svg] | `+upload.svg+` @@ -229,6 +256,7 @@ | `+vk+` | image:icons/vk.svg[vk.svg] | `+vk.svg+` | `+warmth+` | image:icons/warmth.svg[warmth.svg] | `+warmth.svg+` | `+warning+` | image:icons/warning.svg[warning.svg] | `+warning.svg+` +| `+web-search+` | image:icons/web-search.svg[web-search.svg] | `+web-search.svg+` | `+zoom-in+` | image:icons/zoom-in.svg[zoom-in.svg] | `+zoom-in.svg+` | `+zoom-out+` | image:icons/zoom-out.svg[zoom-out.svg] | `+zoom-out.svg+` |=== \ No newline at end of file diff --git a/modules/ROOT/partials/configuration/tinymceai_options.adoc b/modules/ROOT/partials/configuration/tinymceai_options.adoc new file mode 100644 index 0000000000..1f17b4d49b --- /dev/null +++ b/modules/ROOT/partials/configuration/tinymceai_options.adoc @@ -0,0 +1,461 @@ +Configuration options are grouped by the feature they configure. Options in the General section apply to the plugin as a whole or to multiple features. + +[[options-general]] +== General options + +These options apply to the plugin overall or to multiple AI features (Chat, Quick Actions, Review). + +[TIP] +==== +For context toolbar use cases (a toolbar that appears when text is selected), use the xref:quickbars.adoc[Quick Toolbars] plugin and configure `+quickbars_selection_toolbar+` instead. +==== + +[[content_id]] +=== `+content_id+` + +A unique identifier for the document or content being edited. When set, chat history is scoped to this ID, allowing conversations to be preserved and associated with the specific document across sessions. When not set, all conversations are shown regardless of document. + +*Type:* `+String+` + +*Default value:* `+undefined+` + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + content_id: 'document-123', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[tinymceai_token_provider]] +=== `+tinymceai_token_provider+` + +A function that returns a Promise resolving to an object with a `+token+` property containing the signed JWT token for authenticating with the {pluginname} service. + +The JWT payload must include these required claims: + +* `+iat+` - Issued at time (provided by JWT libraries) +* `+exp+` - Expiration time (tokens cannot exceed 24 hours; 5-15 minutes recommended) +* `+aud+` - The {productname} API key +* `+auth+` - Authentication object (see separate authentication documentation) +* `+sub+` - Unique user ID + +*Type:* `+Function+` (`+() => Promise<{ token: string }>+`) + +*Default value:* `+undefined+` + +For JWT setup and required claims, see xref:tinymceai-jwt-authentication-intro.adoc[JWT Authentication]. + +The token endpoint may return the JWT in different formats. Handle both: + +* **JSON response** – Endpoint returns `+{ "token": "eyJ..." }+`. Use `+fetch(url).then(r => r.json())+`. +* **Plain text response** – Endpoint returns the raw JWT string. Use `+fetch(url).then(r => r.text()).then(token => ({ token }))+`. + +.Example: JSON response from custom endpoint +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_token_provider: () => { + return fetch('/api/tinymceai-token').then(r => r.json()); + } +}); +---- + +.Example: Plain text response from custom endpoint +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.text()).then(token => ({ token })); + } +}); +---- + +[[tinymceai_sidebar_type]] +=== `+tinymceai_sidebar_type+` + +Controls how the AI sidebar is displayed. With `+static+`, the sidebar renders inside the editor. With `+floating+`, it renders in a separate container outside the editor and can be dragged on the page. + +*Type:* `+String+` + +*Possible Values:* `+'static'+`, `+'floating'+` + +*Default value:* `+'static'+` + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_sidebar_type: 'floating', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[NOTE] +==== +Changing this property dynamically (after the editor has been initialized) is not supported and can result in unpredictable behavior. +==== + +[[tinymceai_default_model]] +=== `+tinymceai_default_model+` + +The default AI model to use when no model is explicitly selected. + +*Type:* `+String+` + +*Default value:* `+undefined+` + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_default_model: 'gemini-2-5-flash', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[tinymceai_allow_model_selection]] +=== `+tinymceai_allow_model_selection+` + +Whether users can select a different AI model from the chat interface. + +*Type:* `+Boolean+` + +*Possible Values:* `+true+`, `+false+` + +*Default value:* `+true+` + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_allow_model_selection: false, + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[options-chat]] +== Options for Chat + +These options configure the AI Chat sidebar, where users have interactive conversations with the AI and can add external sources for context. + +[[tinymceai_chat_fetch_sources]] +=== `+tinymceai_chat_fetch_sources+` + +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'+`). + +*Type:* `+Function+` (`+() => Promise+`) + +*Possible Values:* For source `+type+` property: `+'web-resource'+`, `+'file'+` + +*Default value:* `+() => Promise.resolve([])+` + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_chat_fetch_sources: async () => [ + { + label: 'My Documents', + icon: 'folder', + sources: [ + { id: 'doc-1', label: 'Document 1', type: 'file' }, + { id: 'url-1', label: 'Web Page', type: 'web-resource' } + ] + } + ], + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[tinymceai_chat_fetch_source]] +=== `+tinymceai_chat_fetch_source+` + +A function that fetches the content for an additional source by ID. Receives the source `+id+` and returns a Promise resolving to the source content (either `+{ type: 'file', file: File }+` or `+{ type: 'web-resource', url: string }+`). + +*Type:* `+Function+` (`+(id: string) => Promise+`) + +*Possible Values:* For return object `+type+` property: `+'file'+`, `+'web-resource'+` + +*Default value:* `+(id) => Promise.resolve(\`Should fetch additional source with given ${id}\`)+` + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_chat_fetch_sources: async () => [ + { label: 'Docs', sources: [{ id: 'doc-1', label: 'Document 1', type: 'file' }] } + ], + tinymceai_chat_fetch_source: async (id) => { + const res = await fetch(`/api/documents/${id}`); + const blob = await res.blob(); + const filename = `${id}.pdf`; + return { type: 'file', file: new File([blob], filename, { type: blob.type }) }; + }, + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[tinymceai_chat_welcome_message]] +=== `+tinymceai_chat_welcome_message+` + +Customises the welcome message displayed in the Chat sidebar when starting a new conversation. + +*Type:* `+String+` + +*Default value:* A default message introducing the AI assistant and its capabilities. + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_chat_welcome_message: '

Welcome! How can I help you today?

', + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[options-quickactions]] +== Options for Quick Actions + +These options configure the Quick Actions menu, which provides one-click AI transformations such as improve writing, fix grammar, translate, and change tone. + +[[tinymceai_quickactions_menu]] +=== `+tinymceai_quickactions_menu+` + +Array of control IDs that define the order of items in the Quick Actions menu. + +*Type:* `+Array+` of `+String+` + +*Default value:* +[source,js] +---- +[ + 'ai-quickactions-chat-prompts', + 'ai-quickactions-improve-writing', + 'ai-quickactions-continue-writing', + 'ai-quickactions-check-grammar', + 'ai-quickactions-change-length', + 'ai-quickactions-change-tone', + 'ai-quickactions-translate', + 'ai-quickactions-custom' +] +---- + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_quickactions_menu: [ + 'ai-quickactions-improve-writing', + 'ai-quickactions-check-grammar', + 'ai-quickactions-custom' + ], + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[tinymceai_quickactions_chat_prompts]] +=== `+tinymceai_quickactions_chat_prompts+` + +Array of control IDs for the Chat Commands submenu within Quick Actions. + +*Type:* `+Array+` of `+String+` + +*Default value:* `+['ai-chat-explain', 'ai-chat-summarize', 'ai-chat-highlight-key-points']+` + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_quickactions_chat_prompts: [ + 'ai-chat-explain', + 'ai-chat-summarize', + 'ai-chat-highlight-key-points' + ], + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[tinymceai_quickactions_change_tone_menu]] +=== `+tinymceai_quickactions_change_tone_menu+` + +Array of control IDs for the Change Tone submenu. + +*Type:* `+Array+` of `+String+` + +*Default value:* +[source,js] +---- +[ + 'ai-quickactions-tone-casual', + 'ai-quickactions-tone-direct', + 'ai-quickactions-tone-friendly', + 'ai-quickactions-tone-confident', + 'ai-quickactions-tone-professional' +] +---- + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_quickactions_change_tone_menu: [ + 'ai-quickactions-tone-casual', + 'ai-quickactions-tone-professional' + ], + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[tinymceai_languages]] +=== `+tinymceai_languages+` + +Array of language options for the Translate submenu within Quick Actions. Each item has `+title+` (displayed in the menu) and `+language+` (language code sent to the API, for example `+'english'+`, `+'chinese'+`). + +*Type:* `+Array+` of `+Object+` + +*Default value:* +[source,js] +---- +[ + { title: 'English', language: 'english' }, + { title: 'Chinese (Simplified)', language: 'chinese' }, + { title: 'Spanish', language: 'spanish' }, + { title: 'German', language: 'german' }, + { title: 'Japanese', language: 'japanese' }, + { title: 'Portuguese', language: 'portuguese' }, + { title: 'Korean', language: 'korean' }, + { title: 'Italian', language: 'italian' }, + { title: 'Russian', language: 'russian' } +] +---- + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_languages: [ + { title: 'English', language: 'english' }, + { title: 'French', language: 'french' }, + { title: 'German', language: 'german' } + ], + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + +[[tinymceai_quickactions_custom]] +=== `+tinymceai_quickactions_custom+` + +Array of custom command objects rendered in the Custom Commands menu item. Each item can be type `+action+` (quick action with immediate preview) or type `+chat+` (opens in chat). + +* `+title+` - Text shown in the menu and chat history +* `+prompt+` - The actual prompt sent to the AI +* `+type+` - `+'action'+` or `+'chat'+` +* `+model+` - Required for `+action+` type only + +*Type:* `+Array+` of `+Object+` + +*Possible Values:* For `+type+` property: `+'action'+`, `+'chat'+` + +*Default value:* `+[]+` + +.Example +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'tinymceai', + toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review', + tinymceai_quickactions_custom: [ + { + 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' + }, + { + title: 'Summarize in 5 bullet points', + prompt: 'Summarize the selected text in 5 bullet points.', + type: 'chat' + } + ], + // Required for authentication + tinymceai_token_provider: () => { + return fetch('/api/token').then(r => r.json()); + } +}); +---- + diff --git a/modules/ROOT/partials/index-pages/premium-plugins.adoc b/modules/ROOT/partials/index-pages/premium-plugins.adoc index 8f1777535e..90b06e5a2a 100644 --- a/modules/ROOT/partials/index-pages/premium-plugins.adoc +++ b/modules/ROOT/partials/index-pages/premium-plugins.adoc @@ -200,6 +200,12 @@ xref:tableofcontents.adoc[Table of Contents] Insert a simple Table of Contents into the {productname} editor. +a| +[.lead] +xref:tinymceai-introduction.adoc[TinyMCE AI] + +AI-powered features for {productname} including AI chat, AI review, and quick actions. + a| [.lead] xref:tinydrive-introduction.adoc[Tiny Drive] diff --git a/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-api-usage.adoc b/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-api-usage.adoc index f79a093ec6..4ed99e7aec 100644 --- a/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-api-usage.adoc +++ b/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-api-usage.adoc @@ -7,7 +7,7 @@ The API is available on `+http://localhost:[port]+` (by default the `port` is `8 [NOTE] The REST API documentation is available at `+http://localhost:[port]/docs+`. -Alternatively, refer to the specifications in link:https://exportpdf.api.tiny.cloud/docs[https://exportpdf.api.tiny.cloud/docs^]. +Alternatively, refer to the specifications in link:https://exportpdf.api.tiny.cloud/v1/convert/docs[https://exportpdf.api.tiny.cloud/v1/convert/docs^]. If the authorization for the API is enabled, provided an authorization token. More instructions can be found in the xref:individual-export-to-pdf-on-premises.adoc#authorization[authorization] section. diff --git a/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-autorization.adoc b/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-autorization.adoc index eba8d6e67b..6d895410be 100644 --- a/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-autorization.adoc +++ b/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-autorization.adoc @@ -91,7 +91,7 @@ axios.post( 'http://localhost:8080/v1/convert', data, config ) `SECRET_KEY` it’s the key which has been passed to the {pluginname} On-Premises instance -Please refer to the link:https://exportpdf.api.tiny.cloud/docs[{pluginname} REST API documentation] to start using the service. +Please refer to the link:https://exportpdf.api.tiny.cloud/v1/convert/docs[{pluginname} REST API documentation] to start using the service. [NOTE] If API clients like Postman or Insomnia are used, then set the JWT token as an `Authorization` header in the `Headers` tab. Do not use the built-in token authorization as this will generate invalid header with a `Bearer` prefix added to the token. \ No newline at end of file diff --git a/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-fonts.adoc b/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-fonts.adoc index 648b948eee..0b68a02c09 100644 --- a/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-fonts.adoc +++ b/modules/ROOT/partials/individually-licensed-components/export-to-pdf/export-to-pdf-fonts.adoc @@ -5,7 +5,7 @@ During document writing, the possibility of using many different fonts can be ve Using the appropriate font can change the appearance of the document and emphasize its style. -{pluginname} Converter allows link:https://exportpdf.api.tiny.cloud/docs#section/Web-Fonts[Web Fonts^] to be used, which provided the integrator with the ability to use standard operating system fonts or use custom fonts without the need to import them using CSS. +{pluginname} Converter allows link:https://exportpdf.api.tiny.cloud/v1/convert/docs#section/Web-Fonts[Web Fonts^] to be used, which provided the integrator with the ability to use standard operating system fonts or use custom fonts without the need to import them using CSS. Below is a list of the basic fonts included in the image: @@ -31,7 +31,7 @@ However, additional fonts can be added to {pluginname} Converter in two ways: ** See Use Windows fonts in PDF Converter section. [NOTE] -The fonts inside the mounted volume will be installed on the docker image operating system. Only the `.ttf` and `.otf` font formats are supported. If other font formats are used, these will need to be converted to the supported format prior or use fonts such as link:https://exportpdf.api.tiny.cloud/docs#section/Web-Fonts[Web Fonts^]. +The fonts inside the mounted volume will be installed on the docker image operating system. Only the `.ttf` and `.otf` font formats are supported. If other font formats are used, these will need to be converted to the supported format prior or use fonts such as link:https://exportpdf.api.tiny.cloud/v1/convert/docs#section/Web-Fonts[Web Fonts^]. [TIP] Ensure that the converted fonts can be installed and used on your local machine first, before installing them on the docker container. diff --git a/modules/ROOT/partials/menu-item-ids/tinymceai-menu-items.adoc b/modules/ROOT/partials/menu-item-ids/tinymceai-menu-items.adoc new file mode 100644 index 0000000000..d32049e6ec --- /dev/null +++ b/modules/ROOT/partials/menu-item-ids/tinymceai-menu-items.adoc @@ -0,0 +1,10 @@ +[cols="1,1,2",options="header"] +|=== +|Menu item identifier |Default Menu Location |Description + +|image:icons/ai-assistant.svg[Chat icon,24px] `+tinymceai-chat+` |Tools |Opens the AI Chat sidebar. +|image:icons/ai-prompt.svg[Quick Actions icon,24px] `+tinymceai-quickactions+` |Tools |Opens the Quick Actions menu. +|image:icons/ai-review.svg[Review icon,24px] `+tinymceai-review+` |Tools |Opens the AI Review sidebar. +|=== + +For submenu and individual menu item identifiers (for example, `+ai-quickactions-improve-writing+`, `+ai-chat-explain+`), see xref:tinymceai-actions-plugin.adoc#configuring-quick-actions-menu[Configuring Quick Actions menu]. diff --git a/modules/ROOT/partials/misc/supported-versions.adoc b/modules/ROOT/partials/misc/supported-versions.adoc index c085c5d3f8..70108327b0 100644 --- a/modules/ROOT/partials/misc/supported-versions.adoc +++ b/modules/ROOT/partials/misc/supported-versions.adoc @@ -8,7 +8,7 @@ Supported versions of {productname}: |Version |Release Date |End of Premium Support |8.4 |2026-02-04 |2027-02-04 |8.3 |2025-12-10 |2027-06-10 -|8.2 |2025-10-22 |2027-10-22 +|8.2 |2025-10-22 |2027-04-22 |8.1 |2025-09-17 |2027-03-17 |8.0 |2025-07-23 |2027-01-23 |7.9 |2025-05-14 |2026-11-14 diff --git a/modules/ROOT/partials/toolbar-button-ids/tinymceai-toolbar-buttons.adoc b/modules/ROOT/partials/toolbar-button-ids/tinymceai-toolbar-buttons.adoc new file mode 100644 index 0000000000..8e60d44073 --- /dev/null +++ b/modules/ROOT/partials/toolbar-button-ids/tinymceai-toolbar-buttons.adoc @@ -0,0 +1,10 @@ +[cols="2,3",options="header"] +|=== +|Toolbar button identifier |Description + +|image:icons/ai-assistant.svg[Chat icon,24px] `+tinymceai-chat+` |Opens the AI Chat sidebar for conversations with the AI assistant. +|image:icons/ai-prompt.svg[Quick Actions icon,24px] `+tinymceai-quickactions+` |Opens the Quick Actions menu (improve writing, fix grammar, translate, and similar). +|image:icons/ai-review.svg[Review icon,24px] `+tinymceai-review+` |Opens the AI Review sidebar for suggested edits and content review. +|=== + +For submenu and individual action identifiers (for example, `+ai-quickactions-improve-writing+`, `+ai-chat-explain+`), see xref:tinymceai-actions-plugin.adoc#configuring-quick-actions-menu[Configuring Quick Actions menu]. diff --git a/package.json b/package.json index b038529b0b..3994f1bc67 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "build": "./-scripts/api-reference.sh", "build-local-ref": "./-scripts/api-reference-local.sh", "clean": "rm -rf ./build", + "generate-llm-files": "node ./-scripts/generate-llm-files.js", + "generate-llm-files-from-url": "node ./-scripts/generate-llm-files.js https://www.tiny.cloud/docs/antora-sitemap.xml", "nodemon": "nodemon --exec yarn antora ./antora-playbook.yml", "nodemon-dev": "nodemon --exec yarn antora ./antora-playbook-local.yml", "server": "http-server build/site/ --port 4000 -a localhost", @@ -43,5 +45,7 @@ "nodemon": "^3.1.10", "npm-run-all": "^4.1.5" }, - "dependencies": {} + "dependencies": { + "sanitize-html": "^2.17.1" + } }