Classic API
Public composition, context, actions and resource lifetime.
Presets and instances
createClassicEditor(options) returns a product instance. document is content; preset resolves model/View; plugins declare product capabilities; extensions add ordinary features; shell configures UI; media and host supply services.
instance.editor exists only while mounted. Locale, editability and built-in preset theme updates retain Core and history; structural configuration still rebuilds Core/View. A custom Core workspace uses editor.changeMode() for different semantics. See the instance reference for settings and methods.
@quirekit/classic-editorAGPL-3.0-onlyReusable product preset resolved independently for every editor instance.
export interface ClassicEditorPreset {
readonly id: string;
readonly features: ClassicEditorFeatureOptions;
readonly plugins?: readonly ClassicEditorPlugin[] | undefined;
readonly theme?: QuireKitTheme | undefined;
readonly shell?: ClassicEditorShellOptions | undefined;
readonly ui?: ClassicEditorUiProfileOptions | undefined;
readonly updatePresentation?: ((context: ClassicEditorPresetPresentationContext) => void) | undefined;
resolveExtensions(context: ClassicEditorPresetContext): readonly QuireAnyExtension[];
}preset.resolveExtensions(context) returns ordinary extensions. Its plugins still need a product registry. Consuming only extensions does not install preset file services, license feedback or product keyboard plugins.
A custom preset uses updatePresentation(context) to refresh theme/locale-derived paint in a retained session. Update owned presentation, preserve explicit host overrides and refresh cache dependencies. Do not change Schema, install plugins or write content. Call public updateClassicEditorPresetPresentation(context) to reuse built-in Canvas/SVG color updates, then refresh custom extensions. Without this hook, theme changes still rebuild Core.
Plugins
@quirekit/classic-editorAGPL-3.0-onlyProduct-level plugin for UI, services, shortcuts, and lifecycle.
export interface ClassicEditorPlugin {
readonly id: string;
readonly audience?: ClassicEditorAudience | undefined;
readonly contributions?: readonly ClassicEditorContribution[] | undefined;
readonly extensions?: readonly QuireAnyExtension[] | undefined;
readonly toolbarItems?: readonly (ClassicEditorToolbarControlContribution | ClassicEditorActionToolbarControlContribution)[] | undefined;
readonly contextMenuItems?: readonly (ClassicEditorContextMenuItemContribution | ClassicEditorActionContextMenuItemContribution)[] | undefined;
readonly selectionPopupItems?: readonly (ClassicEditorSelectionPopupItemContribution | ClassicEditorActionSelectionPopupItemContribution | ClassicEditorSelectionPopupWidgetContribution)[] | undefined;
readonly contextualPopupItems?: readonly ClassicEditorContextualPopupItemContribution[] | undefined;
readonly sidebarPanels?: readonly ClassicEditorSidebarPanelContribution[] | undefined;
readonly globalSettingsSections?: readonly ClassicEditorGlobalSettingsSectionContribution[] | undefined;
readonly keyboardShortcuts?: readonly ClassicEditorKeyboardShortcut[] | undefined;
readonly services?: readonly ClassicEditorImportExportService[] | undefined;
readonly onCreate?: ((context: ClassicEditorHookContext) => void) | undefined;
readonly onMount?: ((context: ClassicEditorHookContext) => void) | undefined;
readonly onUpdate?: ((context: ClassicEditorHookContext) => void) | undefined;
readonly onPaste?: ((context: ClassicEditorHookContext, event: QuireEditorPasteEvent) => boolean | void) | undefined;
readonly onUnmount?: ((context: ClassicEditorHookContext) => void) | undefined;
readonly onDestroy?: ((context: ClassicEditorHookContext) => void) | undefined;
}Plugin IDs are unique per instance. extensions supply content capabilities; contributions and independent toolbar/popup/sidebar declarations supply product surfaces; services register formats. Hooks distinguish reusable mounting from final disposal.
Typed actions
@quirekit/classic-editorAGPL-3.0-onlyOne typed command definition shared by every projected product surface.
export interface ClassicEditorActionDefinition {
readonly id: string;
readonly label: ClassicEditorText;
readonly icon?: string | undefined;
readonly group?: string | undefined;
readonly order: number;
readonly shortcut?: ClassicEditorText | undefined;
readonly isAvailable?: ((context: ClassicEditorActionContext) => boolean) | undefined;
readonly canExecute?: ((context: ClassicEditorActionContext) => boolean) | undefined;
readonly isActive?: ((context: ClassicEditorActionContext) => boolean) | undefined;
readonly disabledReason?: ((context: ClassicEditorActionContext) => ClassicEditorActionReason | undefined) | undefined;
readonly run: (context: ClassicEditorActionContext) => boolean | Promise<boolean>;
}run(context) receives editor, instance, ui, root, locale, backend and trigger. Availability, executability, active state and disabled reasons are read-only queries without commands or requests. Core owns document mutation; context.ui owns chrome.
@quirekit/classic-editorAGPL-3.0-onlyProjects one direct action onto Ribbon chrome without accepting a behavior. @param id - Stable contribution id. @param groupId - Parent ribbon group id. @param action - Shared direct typed action definition. @returns Ribbon action contribution.
function createClassicEditorRibbonAction(id: string, groupId: string, action: ClassicEditorActionDefinition): ClassicEditorActionRibbonControlContributionReference an installed group ID. IDs are not another command-routing protocol. See the runnable plugin.
Interactive panels
@quirekit/classic-editorAGPL-3.0-onlyFramework-neutral mounted content returned by an interactive contribution.
export interface ClassicEditorMountedRenderable {
readonly element: Node | string | null;
update?(context: ClassicEditorRenderContext): void;
destroy(): void;
}Render acquires resources once; update refreshes retained DOM/Vue roots; destroy cleans up. Keep a current context reference for locale/selection rather than permanently capturing the initial mount context.
File services
@quirekit/classic-editorAGPL-3.0-onlyNamed import/export service contributed to the product registry.
export interface ClassicEditorImportExportService {
readonly id: string;
readonly label: ClassicEditorText;
readonly format: ClassicEditorDocumentFormat;
import?(context: ClassicEditorImportContext, input: ClassicEditorImportArtifact): void | Promise<void>;
export?(context: ClassicEditorServiceContext): ClassicEditorExportArtifact | Promise<ClassicEditorExportArtifact>;
}instance.importDocument(serviceId, artifact) selects an installed format and supplies text/bytes with filename/MIME. exportDocument(serviceId) returns data/fileName/mimeType; the host downloads it. File menus need explicit document-service contributions.
Import services receive ClassicEditorImportContext. Parse and validate, then perform one synchronous write through context.commit(() => context.editor.commands.replaceDocument(document, { errorOnInvalidContent: true })). Commit checks latest-operation ownership, original Core, document revision, editability and signal. Async callbacks are invalid; a false command result fails. Older services that write directly must migrate; the product cannot roll back arbitrary effects bypassing commit.
Hosts can pass { signal } as the third argument to cancel preparation. New imports, edits, editability updates and unmounts also invalidate preparation. Official DOCX import uses this boundary and stages images until commit. Its export captures the starting document and reports diagnostics through onReport; artifacts contain only data/fileName/mimeType. See files for complete cancellation semantics.