View Source Philtre.Editor.Engine (philtre v0.12.1)
Holds shared logic for modifying editor blocks
Link to this section Summary
Functions
Splits block into two at cursor, then pastes in the current cliboard contents of the editor, between the two.
Performs action of splitting a block into two separate blocks at current cursor position.
Performs action of spliting a block like into two lines, where both stay part of the same block.
Link to this section Functions
@spec backspace_from_start(Philtre.Editor.t(), Philtre.Block.ContentEditable.t()) :: Philtre.Editor.t()
@spec paste(Philtre.Editor.t(), Philtre.Block.ContentEditable.t(), map()) :: Philtre.Editor.t()
Splits block into two at cursor, then pastes in the current cliboard contents of the editor, between the two.
@spec split_block( Philtre.Block.ContentEditable.t(), %{selection: Philtre.Block.ContentEditable.Selection.t()} ) :: {Philtre.Block.ContentEditable.t(), Philtre.Block.ContentEditable.t()}
Performs action of splitting a block into two separate blocks at current cursor position.
This is the result of a user hitting Enter.
The first block retains the type of the original. The second block is usually a P block.
@spec split_line(Philtre.Editor.t(), Philtre.Block.ContentEditable.t(), %{ selection: map() }) :: Philtre.Editor.t()
Performs action of spliting a block like into two lines, where both stay part of the same block.
This is the result of the user usually hitting Shift + Enter.
@spec toggle_style_on_selection( Philtre.Editor.t(), Philtre.Block.ContentEditable.t(), %{selection: map(), style: String.t()} ) :: Philtre.Editor.t()
@spec update( Philtre.Block.ContentEditable.t(), %{selection: map(), cells: [map()]} ) :: Philtre.Block.ContentEditable.t()