Engine
dart
import 'package:vyuh_document/engine.dart';
import 'package:vyuh_document/engine_sessions.dart'; // sessions and workflows onlyThe engine turns commands into validated transactions over the canonical model and owns history. The editor runtime, the typed controller and headless workflows all run on it. The integration-facing types are below.
Sessions and workflows
| Type | Purpose |
|---|---|
DocumentEngineSession | The canonical state machine: admission, transactions, history, selection |
DocumentEngineSessionSetup | DocumentEngineSessionSetup.standard(elements:, ...) |
DocumentWorkflowSession | Headless editing without a widget; transaction(recipe) |
DocumentWorkflowResult | committed, diagnostics, state |
DocumentWorkflowDiagnostic, DocumentWorkflowReceipt | Why a recipe was rejected; what it did |
DocumentAnchors, DocumentWorkflowAnchor (DocumentStartAnchor, DocumentEndAnchor, BeforeBlockAnchor, AfterBlockAnchor, SectionBodyAnchor, PageRegionAnchor) | Where a recipe inserts |
Guide: Transactions and history.
Transactions and commands
| Type | Purpose |
|---|---|
DocumentTransaction | An atomic list of commands with mapping and inversion |
DocumentCommand | Base of engine commands (InsertBlockCommand, ReplaceBlockCommand, SetSectionFormatCommand, AddCommentCommand, RecordRevisionCommand, ...) |
TransactionResult, DocumentCommandException | Outcome of applying a transaction |
PositionMap, Mapping | Map positions through edits |
UndoHistory | History grouping |
DocumentEngine, DocumentTransactionValidation | Validation level |
Command targets
| Type | Purpose |
|---|---|
DocumentCommandTarget | What controller extension methods run on: state, hasCommand(key), executeCommand(key, args) |
DocumentCommandFacet, DocumentCommandContributor | How an extension contributes commands |
DocumentCommandUnavailableException | A command whose extension is not installed |
Operations (serialized edits)
DocumentOperationRegistry, operation envelopes, records and scripts decode and replay edits as JSON through the installed registry. Operations are named by a typed DocumentOperationId (CoreDocumentOperation.textInsert); JSON carries its wireName. See Serialized operations and Typed identifiers.
Protection, search and collaboration
| Type | Purpose |
|---|---|
DocumentProtectionPolicy, DocumentSessionIdentity, ProtectedRegionEditException | Who may edit protected regions |
DocumentSearchOptions, DocumentSearchMatch | Search and replace |
DocumentCollaborationTransport, EncodedDocumentCollaborationMessage, LocalNonCollaborativeAdapter | Transport seam for collaboration |
DocumentTransactionIntent, SemanticOperationEnvelope, DocumentProtocolCodec | Collaboration protocol envelopes |
Paragraph runtime: paragraph_extension.dart
Extension methods on DocumentCommandTarget (so on DocumentEditorController):
| Extension | Methods |
|---|---|
DocumentTextControllerApi | insertText, toggleMark, selectionHasMark, setSelectionCharacterFormat, editSelectionFont, stepSelectionFontSize, clearSelectionFormatting, transformTextCase, setBlockStyle, upsertDocumentStyle, text highlighter |
DocumentTextEditingControllerApi | deleteBackward, deleteForward, deleteWordBackward, splitBlock, insertLineBreak, indentSelection, outdentSelection, deleteRange, replaceRange, insertPlainText |
DocumentParagraphControllerApi | setParagraphAlignment, setParagraphIndents, setParagraphSpacing, setParagraphTabStops, setParagraphDropCap, setParagraphPagination, setParagraphDecoration, setParagraphTextDirection |
DocumentParagraphBlockControllerApi | setBlockParagraph, setBlockHeading(level), insertParagraph, insertHeading(level) |
DocumentLinkControllerApi | setLink(url), removeLink(), requestLink() |
Plus ParagraphDocumentExtensionContract and the command key families (ParagraphDocumentCommands, TextEditingDocumentCommands, ...).
Other libraries
| Library | Contents |
|---|---|
engine_integration.dart | Contracts for sibling packages (link requests, generated-graphic placement, selection style) |
paragraph_extension_integration.dart | Paragraph command contributions for the editor |
performance_probe.dart | PerformanceProbeRequest, EditorPerformanceScenario, frame budget |