Core plugin system and editor functionality for the Plate rich text editor framework
—
Essential plugins that provide fundamental editor functionality including history, debugging, DOM management, and node handling.
Provides undo/redo functionality for the editor with configurable history stack management.
/**
* History plugin for undo/redo functionality
*/
const HistoryPlugin: SlatePlugin;Usage Examples:
import { createSlateEditor, HistoryPlugin } from "@platejs/core";
const editor = createSlateEditor({
plugins: [HistoryPlugin]
});
// Undo last operation
editor.undo();
// Redo last undone operation
editor.redo();Development and debugging plugin with configurable logging and error handling.
/**
* Debug plugin for development and error handling
*/
const DebugPlugin: SlatePlugin;Manages DOM state including focus, composition, and read-only states.
/**
* DOM plugin for state management
*/
const DOMPlugin: SlatePlugin;Features:
Generic data format parsing system with extensible parser registration.
/**
* Parser plugin for data format handling
*/
const ParserPlugin: SlatePlugin;
/**
* Register a custom parser for a specific data format
* @param format - Format identifier
* @param parser - Parser function
*/
function registerParser(
format: string,
parser: (data: string) => any[]
): void;Automatic node ID management for tracking and referencing editor nodes.
/**
* Node ID plugin for automatic ID assignment
*/
const NodeIdPlugin: SlatePlugin;Handles Slate AST fragment serialization for clipboard and drag-and-drop operations.
/**
* AST plugin for fragment handling
*/
const AstPlugin: SlatePlugin;Performance optimization plugin that implements Slate's chunking for better typing performance.
/**
* Chunking plugin for performance optimization
*/
const ChunkingPlugin: SlatePlugin;Character count limitations and length tracking functionality.
/**
* Length plugin for character counting
*/
const LengthPlugin: SlatePlugin;Controls mark and element boundary behavior for consistent selection handling.
/**
* Affinity plugin for boundary behavior
*/
const AffinityPlugin: SlatePlugin;Plugin override system for customizing and extending existing plugin behavior.
/**
* Override plugin for plugin customization
*/
const OverridePlugin: SlatePlugin;Opinionated extensions to Slate's default behavior for improved editor experience.
/**
* Slate extension plugin for enhanced behavior
*/
const SlateExtensionPlugin: SlatePlugin;Default paragraph handling and normalization functionality.
/**
* Base paragraph plugin for default text blocks
*/
const BaseParagraphPlugin: SlatePlugin;Core plugins can be configured with options:
interface CorePluginOptions {
/** History plugin options */
history?: {
maxSize?: number;
delay?: number;
};
/** Debug plugin options */
debug?: {
logLevel?: 'error' | 'warn' | 'info' | 'debug';
enabled?: boolean;
};
/** Length plugin options */
length?: {
maxLength?: number;
units?: 'character' | 'word';
};
}Usage Examples:
import { createSlateEditor, getCorePlugins } from "@platejs/core";
// Configure core plugins with options
const editor = createSlateEditor({
plugins: getCorePlugins().map(plugin => {
if (plugin.key === 'history') {
return {
...plugin,
options: { maxSize: 100, delay: 500 }
};
}
return plugin;
})
});All core plugins work together to provide:
Install with Tessl CLI
npx tessl i tessl/npm-platejs--core