Skip to main content
Version: Next

@editora/core

Core editing runtime and web component implementation.

Installation

npm i @editora/core

Quick Start

import { createEditor } from "@editora/core";

const editor = createEditor({
element: document.getElementById("editor"),
plugins: "bold italic link",
toolbar: "undo redo | bold italic | link",
});

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 vanilla runtime adapter instance
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 / MediaPluginEnterprise exportsOptional enterprise plugin bridge
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.