Skip to main content

Module edit

Module edit 

Source
Expand description

Pure op emitters.

One emitter per row of docs/document_mutations.md: a pure function from (indexed document, parameters) to the primitive ops the gesture produced, pushed through a CommitBuilder. Anything the gesture measured or solved — text widths, re-routed polylines — arrives as a parameter; anything derivable by list arithmetic — free slots, block growth, trims, cascades — is emitter work. Emitters filter non-edits (an update equal to what the document holds pushes nothing, so a no-op gesture seals to no commit), push nothing at absent targets, and never pre-validate what the fold refuses — try_apply stays the authority.

That authority covers edits alone: a history step adopts the document a rev was written as rather than folding its way back to it, so the fold validates what a session writes and the trail then adopts what the fold already accepted. The one invariant validate enforces that no emitter restates is dangling_endpoints — a pin may not leave under a route — and it is unreachable from here because delete.rs’s cascade emits every dependent route delete itself, wires owned outside the deleted subtree included (delete::tests::deleting_a_block_takes_its_subtree_and_leaves_the_sibling_standing).

Modules§

assets
The artwork family: the emitters that place a picked image file, and the payload op that carries its bytes into the log beside the reference.
clipboard
The clipboard family: copy, cut, and the two pastes.
create
The create family: the emitters that mint entities. Every one takes its new ids pre-minted — ops land with concrete ids, so a compound gesture (a wire and the pin it lands on) is one commit.
delete
The delete family: the emitters that remove what a gesture deleted, and the closure they all walk.
describe
What a commit is called: the verb the gesture opened under, the entity its ops touched, and the scope it happened in.
embed
Embedding: another document, grafted in as a block of this one.
geometry
The geometry family: the emitters that move, resize, and re-slot what already exists, plus the route lists those gestures carry. The gesture solved its own constraints — magnetism, minimum sizes, the re-routed polyline — and hands the result in; the list arithmetic over the indexed document is the emitter’s own.
lock
What a block’s lock protects, as a capability rather than a check.
lower
The editor’s own rules about grid geometry: the block-height ladder, a block’s pin capacity, the accent↔role mapping the pickers speak, and the label and asset reads the shapes draw from. The coordinate conversions these build on are crate::grid’s, so a rect drawn and a rect committed cannot disagree about where a cell is.
naming
The naming and flag family: one- or two-register updates on an existing entity.