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

Link to this function

add_block(editor, block)

View Source
Link to this function

backspace_from_start(editor, block)

View Source
@spec backspace_from_start(Philtre.Editor.t(), Philtre.Block.ContentEditable.t()) ::
  Philtre.Editor.t()
Link to this function

paste(editor, block, map)

View Source

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.

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.

Link to this function

split_line(editor, block, map)

View Source
@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.

Link to this function

toggle_style_on_selection(editor, block, map)

View Source
@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()