Skip to main content
Version: Next

@editora/core

Core editing runtime and web component implementation.

Installation​

npm i @editora/core

Quick Start​

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@editora/core/dist/webcomponent.min.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@editora/core/dist/webcomponent.js"></script>

<editora-editor
height="320"
plugins="heading bold italic underline list link history"
toolbar="undo redo | heading | bold italic underline | bullist numlist | link"
placeholder="Start writing..."
>
<h2>Hello, Editora</h2>
<p>This is a <strong>web component</strong>. Select some text and use the toolbar.</p>
</editora-editor>

List the plugins you want in plugins: only those are loaded. Leave the attribute out and every plugin in the bundle is loaded except collaboration, which sends the document to a server: it loads only when you name it (or configure it under pluginConfig), and then stays off until you give it your own websocketUrl or a provider.

Usage​

Use @editora/core as the runtime foundation for command execution, plugin registration, and selection-aware editing.

Examples​

  • Framework-agnostic editor instance via createEditor(...)
  • Web component registration via initWebComponent()
  • Multi-instance pages with isolated command routing

API Reference​

SurfaceTypeNotes
createEditor(options)FunctionCreates a low-level vanilla adapter. It takes plugin objects, not plugin names; prefer <editora-editor>
initWebComponent()FunctionRegisters <editora-editor> if not already defined
EditorClass exportLegacy runtime export for compatibility
EditorStateClass exportSelection and content state model
SchemaClass exportNode schema utilities
PluginManagerClass exportPlugin registration/execution manager
PluginRuntime / createPluginRuntimeRuntime APIPlugin execution context helpers
KeyboardShortcutManagerClass exportShortcut registration and dispatch
SpellcheckPlugin / MediaPluginDeprecated exportsNon-functional scaffolds; use @editora/spell-check / @editora/media-manager
export * from './core'Module re-exportCore architecture layer
export * from './ui'Module re-exportUI primitives used by core/editor
export * from './config'Module re-exportRuntime configuration layer
export * from './adapters'Module re-exportAdapter interfaces/implementations
export * from './webcomponent'Module re-exportWeb component runtime + element exports
./webcomponentPackage export pathDedicated webcomponent runtime build
./webcomponent-corePackage export pathMinimal webcomponent bundle
./plugin-loaderPackage export pathPlugin loader entry
./webcomponent.cssPackage export pathDistributed webcomponent CSS

Best Practices​

  • Keep command execution scoped to the active editor instance.
  • Preserve selection before running dialog-driven commands.
  • Test multi-instance pages for panel/dialog host isolation.

Accessibility​

Enable ARIA and keyboard navigation in runtime config and verify focus flow for toolbar, content, and dialogs.

Performance Notes​

Use performance.debounceInputMs and performance.viewportOnlyScan for large documents and multi-editor screens.