@3kles/richtext-transactions
v1.4.1
Published
The original transaction layer for the native v1 profile supports atomic commits, revisions, range, node, and gap selections, text and marks across blocks, hard breaks, compatible splits and joins, block conversion and attributes, insertion, removal, move
Keywords
Readme
@3kles/richtext-transactions
The original transaction layer for the native v1 profile supports atomic commits, revisions, range, node, and gap selections, text and marks across blocks, hard breaks, compatible splits and joins, block conversion and attributes, insertion, removal, moves, and wrapping and unwrapping lists and blockquotes. Structural mappings compose using current container sizes and preserve unselected fragments.
Switching read-only mode preserves the session and its history. Read-only mode blocks user edits and allows explicit external loads. If validation fails, the document, selection, and revision stay intact. Operations that conflict with the schema fail to protect marks and content from loss.
prepareTransaction validates a plan and returns a candidate state, owned steps, and metadata without creating a commit or public mapping. An explicit final selection lets it skip intermediate structural tables. When the plan omits a final selection, preparation maps it as usual. canApplyTransaction uses this preparation. The function captures values from external accessors before validation, so the returned steps match the values it checked. Dispatch uses applyTransaction with full mappings and an inverse.
This experimental ESM package uses the native engine. src/public-api.ts defines its public API. The workspace builds distribution archives under dist/richtext-transactions. The schema is fixed at v1. Reusing canonical subtrees reduces repeated validation, while root arrays and some operations still scale with document size. Inverses use snapshots. The phase reports preserve their historical results. Transaction contracts · Validation results
