# garrytan/tinymce architecture

> Architecture diagram of the GitHub repository garrytan/tinymce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/garrytan/tinymce
- Repository: https://github.com/garrytan/tinymce

## Overview

TinyMCE is a browser-based JavaScript rich-text editor. Its principal workflow is to create and render an editor for a target element, let users edit through commands and interface controls, and manage editor content and history. The tree also shows themes and a broad plugin ecosystem, including media, tables, paste, autosave, and document-formatting features. The README identifies the product but does not describe runtime wiring; connections below are limited to calls visible in excerpts, with unsampled plugin-to-editor wiring omitted.

Main entry points: [`jscripts/tiny_mce/classes/Editor.js`](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/Editor.js) (Editor instance), [`jscripts/tiny_mce/classes/EditorManager.js`](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/EditorManager.js) (Editor manager), [`jscripts/tiny_mce/classes/adapter/jquery/jquery.tinymce.js`](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/adapter/jquery/jquery.tinymce.js) (jQuery adapter), [`jscripts/tiny_mce/classes/UndoManager.js`](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/UndoManager.js) (Undo history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Editor lifecycle"]
  node_manager["Editor manager<br/>[EditorManager.js]"]
  node_editor["Editor instance<br/>[Editor.js]"]
  node_jquery["jQuery adapter<br/>[jquery.tinymce.js]"]
  node_scriptloader["Script loader<br/>[ScriptLoader.js]"]
end

subgraph group_editing["Editing core"]
  node_undo["Undo history<br/>[UndoManager.js]"]
  node_searchdialog["Search dialog<br/>[searchreplace.js]"]
end

subgraph group_interface["Editor interface"]
  node_advanced["Advanced theme"]
  node_simple["Simple theme"]
  node_controls["Control manager<br/>[ControlManager.js]"]
  node_menus["Drop menus<br/>[DropMenu.js]"]
  node_windows["Window manager<br/>[WindowManager.js]"]
end

subgraph group_extensions["Themes and plugins"]
  node_addons["Add-on manager<br/>[AddOnManager.js]"]
  node_pluginlink["Link editing<br/>[advlink.js]"]
  node_pluginmedia["Media editing<br/>[media.js]"]
  node_plugintable["Table editing"]
  node_pluginpaste["Paste handling"]
  node_pluginautosave["Autosave"]
  node_pluginfullpage["Full-page editing<br/>[fullpage.js]"]
  node_pluginstyle["Style editing<br/>[props.js]"]
  node_pluginpopup["Inline popups"]
end

subgraph group_content["Content operations"]
  node_serializer["Content serializer<br/>[Serializer.js]"]
end

node_user(("Editor user"))
node_browser(("Browser window"))

node_user -.->|"requests editor"| node_manager
node_manager -->|"creates and renders"| node_editor
node_jquery -->|"creates and renders"| node_editor
node_controls -->|"executes commands"| node_editor
node_undo -->|"restores content"| node_editor
node_addons -->|"loads scripts"| node_scriptloader
node_windows -->|"opens popup"| node_browser
node_searchdialog -->|"searches and replaces"| node_editor

click node_manager "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/EditorManager.js"
click node_editor "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/Editor.js"
click node_jquery "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/adapter/jquery/jquery.tinymce.js"
click node_addons "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/AddOnManager.js"
click node_scriptloader "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/dom/ScriptLoader.js"
click node_advanced "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/themes/advanced/editor_template_src.js"
click node_simple "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/themes/simple/editor_template_src.js"
click node_controls "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/ControlManager.js"
click node_menus "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/ui/DropMenu.js"
click node_windows "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/WindowManager.js"
click node_undo "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/UndoManager.js"
click node_serializer "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/dom/Serializer.js"
click node_pluginlink "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/advlink/js/advlink.js"
click node_pluginmedia "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/media/js/media.js"
click node_plugintable "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/table/editor_plugin_src.js"
click node_pluginpaste "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js"
click node_pluginautosave "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js"
click node_pluginfullpage "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js"
click node_pluginstyle "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/style/js/props.js"
click node_pluginpopup "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js"
click node_searchdialog "https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manager,node_editor,node_jquery,node_scriptloader,node_user,node_browser toneBlue
class node_undo,node_searchdialog toneAmber
class node_advanced,node_simple,node_controls,node_menus,node_windows toneMint
class node_addons,node_pluginlink,node_pluginmedia,node_plugintable,node_pluginpaste,node_pluginautosave,node_pluginfullpage,node_pluginstyle,node_pluginpopup toneRose
class node_serializer toneIndigo
```

## Components

### Editor lifecycle

- [Editor manager](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/EditorManager.js): `jscripts/tiny_mce/classes/EditorManager.js`
- [Editor instance](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/Editor.js): `jscripts/tiny_mce/classes/Editor.js`
- [jQuery adapter](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/adapter/jquery/jquery.tinymce.js): `jscripts/tiny_mce/classes/adapter/jquery/jquery.tinymce.js`
- [Script loader](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/dom/ScriptLoader.js): `jscripts/tiny_mce/classes/dom/ScriptLoader.js`

### Editing core

- [Undo history](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/UndoManager.js): `jscripts/tiny_mce/classes/UndoManager.js`
- [Search dialog](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js): `jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js`

### Editor interface

- [Advanced theme](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/themes/advanced/editor_template_src.js): `jscripts/tiny_mce/themes/advanced/editor_template_src.js`
- [Simple theme](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/themes/simple/editor_template_src.js): `jscripts/tiny_mce/themes/simple/editor_template_src.js`
- [Control manager](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/ControlManager.js): `jscripts/tiny_mce/classes/ControlManager.js`
- [Drop menus](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/ui/DropMenu.js): `jscripts/tiny_mce/classes/ui/DropMenu.js`
- [Window manager](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/WindowManager.js): `jscripts/tiny_mce/classes/WindowManager.js`

### Themes and plugins

- [Add-on manager](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/AddOnManager.js): `jscripts/tiny_mce/classes/AddOnManager.js`
- [Link editing](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/advlink/js/advlink.js): `jscripts/tiny_mce/plugins/advlink/js/advlink.js`
- [Media editing](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/media/js/media.js): `jscripts/tiny_mce/plugins/media/js/media.js`
- [Table editing](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/table/editor_plugin_src.js): `jscripts/tiny_mce/plugins/table/editor_plugin_src.js`
- [Paste handling](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js): `jscripts/tiny_mce/plugins/paste/editor_plugin_src.js`
- [Autosave](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js): `jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js`
- [Full-page editing](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js): `jscripts/tiny_mce/plugins/fullpage/js/fullpage.js`
- [Style editing](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/style/js/props.js): `jscripts/tiny_mce/plugins/style/js/props.js`
- [Inline popups](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js): `jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js`

### Content operations

- [Content serializer](https://github.com/garrytan/tinymce/blob/master/jscripts/tiny_mce/classes/dom/Serializer.js): `jscripts/tiny_mce/classes/dom/Serializer.js`

### Other components

- **Editor user**
- **Browser window**

## Connections

- Editor user → Editor manager: requests editor
- Editor manager → Editor instance: creates and renders (evidence: `jscripts/tiny_mce/classes/EditorManager.js`)
- jQuery adapter → Editor instance: creates and renders (evidence: `jscripts/tiny_mce/classes/adapter/jquery/jquery.tinymce.js`)
- Control manager → Editor instance: executes commands (evidence: `jscripts/tiny_mce/classes/ControlManager.js`)
- Undo history → Editor instance: restores content (evidence: `jscripts/tiny_mce/classes/UndoManager.js`)
- Add-on manager → Script loader: loads scripts (evidence: `jscripts/tiny_mce/classes/AddOnManager.js`)
- Window manager → Browser window: opens popup (evidence: `jscripts/tiny_mce/classes/WindowManager.js`)
- Search dialog → Editor instance: searches and replaces (evidence: `jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js`)
