Kotoba.Issho.Place (Kotoba v0.8.0)

Copy Markdown View Source

A place in a Kotoba document: a selection, kept and sent as it is (in a person's state, in an agent's motion, and in what an app keeps of them), so its format is part of Kotoba's public API and only grows.

%{
  "anchor" => %{"node" => node_id, "before" => atom_id | nil},
  "focus" => %{"node" => node_id, "before" => atom_id | nil}
}

Each end is a caret: in the text node node, after the character before (nil at the node's start). In a block with no text yet, a point is the block and an "offset" (%{"node" => block_id, "before" => nil, "offset" => 0}). Ids are the document's own (at most 160 bytes), so a place stays on the same words however the text around it changes. A caret is a selection whose anchor and focus are the same.