Glossary
Last updated
Last updated
A glossary explaining the terms commonly used in Slate:
An "anchor point" is a point where a range starts.
A "character" is the smallest element that makes up a text node in Slate.
A selection is "collapsed" when text is deselected. A collapse occurs when a range's start and end points are the same.
The "document" is the top-level "node" that contains all other nodes that make up the content of the Slate editor.
Focus is defined differently based on your context:
A "focus point" is where a range ends. Unlike a anchor point, a focus point can be expanded.
The editor value provides a reference to the current "focus block" as a convenience. For example, you access the words within the block a user is focused on like so: const words = editor.value.focusBlock.text.split(' ');
A "keys" is a unique identifier assigned to a node in Slate and is used to reference a node uniquely. As as the document changes, new unique keys are issued to avoid collisions within the data model.
A "mark" represents formatting data that is attached to characters within text. Standard formatting such as bold, italic, code
, or custom formatting for your application can be implemented using marks.
A match
, is an object with possible fields of type
and object
that are used to match Nodes
when defining rules in a Schema. An example of match
could be {type: 'paragraph'}
, {objet: 'inline', type: '@-tag'}
, etc.
An "offset" is a distance from the start of a text node, measured in "characters".
A "plugin" is a reusable object that implements one or more of Slate's plugin hooks to add specific behavior to your editor. A plugin helps you express your application while keeping it easy to maintain and reason about.
A "point" represents a specific location in a document, where a user's cursor could be placed. It is represented by the key
of the node in the document, and the offset
of characters into a node.
A "range" is a way to represent a specific section of a document between two "points". It is modelled after the DOM Range concept.
A Slate "schema" is a JavaScript object with properties that describe the document, block nodes, and inline nodes in your editor. Every Slate editor has a "schema" associated with it, which contains information about the structure of its content. For the most basic cases, you'll just rely on Slate's default core schema. But for advanced use cases, you can enforce rules about what the content of a Slate document can contain. Read Schema reference to learn more.
To "unwrap" is the opposite of to "wrap", removing a surrounding node from a selection.
A Slate "value" is the top-level object in Slate and is an object encapsulating the entire value of a Slate editor. Read the Data Model guide to learn more.
To "wrap" is to surround a piece of text or a node in another node. For example, if you select the text Google
and want to turn it into a link, you'd "wrap" it with an inline link node.