on-CodeMerge Plugins
Plugins register onto the core-owned toolbar and use SDK popup / context menu / notify. Prefer createDefaultPlugins() or pick factories explicitly.
Document SoT is JSON (getJSON / setJSON). HTML and Markdown are boundaries (getHTML / setHTML, getMarkdown / setMarkdown). Published hydrate: getPublishedHTML / getPublishedDocument. See Editor API and SDK reference.
Plugin sets
| Helper | Contents |
|---|---|
createDefaultPlugins() | Full ship set: toolbar marks, history, typography/color/font/link/clear-styles/alignment, lists, block, block-style, table, media (image/video/youtube/file/pdf), code, JSON embed, Markdown embed, math, charts, calendar, timer, form builder, comments, mentions, footnotes, footer, shortcuts, export, HTML viewer, templates, responsive, language, AI, track changes, anchor links. Not collaboration (opt-in). |
createCorePlugins() | Lean essentials: Toolbar, History, Typography, Color, Font, Link, ClearStyles, Alignment, Lists, Block, Table, Image, CodeBlock, Math, Export, Shortcuts. |
Toolbar overflow menus (insert / review / tools) are registered by Editor, not by these helpers. See Authoring plugins — Toolbar.
Plugin overview
Essential
| Plugin | Description | Docs |
|---|---|---|
| ToolbarPlugin | Default B/I/U/S mark buttons (chrome is core-owned). | Details |
Text formatting
| Plugin | Description | Docs |
|---|---|---|
| FontPlugin | Font family, size, and style. | Details |
| TypographyPlugin | Line height, letter spacing, etc. | Details |
| ColorPlugin | Text and background colors. | Details |
| ClearStylesPlugin | Clear style marks + block style/align (selection or whole document). | Details |
| AlignmentPlugin | Left, center, right, justify. | Details |
| BlockStylePlugin | Class and style editor. | Details |
Content
| Plugin | Description | Docs |
|---|---|---|
| BlockPlugin | Resizable pane-tree containers (split / stack). | Details |
| ListsPlugin | Ordered and unordered lists. | Details |
| TablePlugin | Prose tables (atom) / grid JSON workspace (on-codemerge/tables). | Details |
| TemplatesPlugin | Document templates. | Details |
Media
| Plugin | Description | Docs |
|---|---|---|
| ImagePlugin | Images. | Details |
| VideoPlugin | Video files. | Details |
| YouTubeVideoPlugin | YouTube embeds. | Details |
| FileUploadPlugin | File upload / attach. | Details |
Code and technical
| Plugin | Description | Docs |
|---|---|---|
| CodeBlockPlugin | Code embed atom (WYSIWYG) / source workspace (on-codemerge/code). | Details |
| JsonPlugin | JSON embed atom (WYSIWYG) / Tree+Raw workspace (on-codemerge/json). | Details |
| MarkdownPlugin | Markdown embed atom (WYSIWYG) / dual-pane workspace (on-codemerge/markdown). | Details |
| MathPlugin | TeX-subset → MathML formulas. | Details | | HTMLViewerPlugin | Raw HTML view. | Details |
Interactive
| Plugin | Description | Docs |
|---|---|---|
| LinkPlugin | Hyperlinks. | Details |
| ChartsPlugin | Charts. | Details |
| FormBuilderPlugin | Interactive forms. | Details |
Collaboration and communication
| Plugin | Description | Docs |
|---|---|---|
| CollaborationPlugin | Real-time ops sync (opt-in; requires token). | Details |
| CommentsPlugin | Comments / annotations. | Details |
| FootnotesPlugin | Footnotes. | Details |
Utility
| Plugin | Description | Docs |
|---|---|---|
| HistoryPlugin | Undo / redo. | Details |
| ExportPlugin | Export (HTML, PDF, …). | Details |
| ShortcutsPlugin | Keyboard shortcuts UI. | Details |
| ResponsivePlugin | Responsive layout helpers. | Details |
| LanguagePlugin | Locale picker UI. | Details |
| SpellCheckerPlugin | Spell-check (in-house Hunspell + your dictionaries). | Details |
AI and advanced
| Plugin | Description | Docs |
|---|---|---|
| AIAssistantPlugin | AI assistant. | Details |
| FooterPlugin | Editor footer chrome. | Details |
Extra
| Plugin | Description | Docs |
|---|---|---|
| CalendarPlugin | Calendar / events. | Details |
| TimerPlugin | Countdown / timer blocks. | Details |
| PDFEmbedPlugin | Embed PDF documents. | Details |
| MentionsPlugin | @mentions. | Details |
| TrackChangesPlugin | Track and review changes. | Details |
| AnchorLinkPlugin | In-document anchors. | Details |
Usage
import { Editor, createDefaultPlugins, createCorePlugins } from 'on-codemerge';
import { ToolbarPlugin, AlignmentPlugin, TablePlugin } from 'on-codemerge/plugins';
import 'on-codemerge/index.css';
import 'on-codemerge/public.css';
// Full set
const editor = new Editor(container, {
plugins: createDefaultPlugins(),
});
// Lean + extras
const lean = new Editor(container, {
plugins: [...createCorePlugins(), TablePlugin()],
});
// Explicit
const custom = new Editor(container, {
plugins: [ToolbarPlugin(), AlignmentPlugin()],
});
// Late registration
lean.use(TablePlugin());There is no editor.remove() / editor.getPlugins() in v2. To change the set, destroy and recreate the editor (plugin setup scope disposes on editor.destroy()).
editor.on('docChanged', () => {
const json = editor.getJSON();
// persist json
});
editor.setHTML('<p>Hello</p>'); // boundary onlyOptions at construction
const editor = new Editor(container, {
plugins: createDefaultPlugins(),
history: { maxDepth: 100 },
locale: 'en',
});Dependencies
- Toolbar chrome is always present (core).
ToolbarPluginis optional (marks only). HistoryPluginrecommended for undo/redo UI.CollaborationPluginneeds a WebSocket ops server + matchingtoken/COLLAB_TOKEN.