list/documentlist/utils/model
@ckeditor/ckeditor5-list/src/documentlist/utils/model
Filtering
Classes
Functions
-
protected
expandListBlocksToCompleteItems( blocks, [ options ] = { [options.withNested] } ) → Array.<Element>
module:list/documentlist/utils/model~expandListBlocksToCompleteItems
Expands the given list of selected blocks to include the leading and tailing blocks of partially selected list items.
Parameters
blocks : Element | Array.<Element>
The list of selected blocks.
[ options ] : Object
-
Properties
[ options.withNested ] : Boolean
Whether should include nested list items.
Defaults to
true
Returns
Array.<Element>
-
protected
expandListBlocksToCompleteList( blocks ) → Array.<Element>
module:list/documentlist/utils/model~expandListBlocksToCompleteList
Expands the given list of selected blocks to include all the items of the lists they're in.
Parameters
Returns
Array.<Element>
-
protected
getAllListItemBlocks( listItem, [ options ] = { [options.higherIndent] } ) → Array.<Element>
module:list/documentlist/utils/model~getAllListItemBlocks
Returns an array with all elements that represents the same list item.
It means that values for
listIndent
, andlistItemId
for all items are equal.Parameters
listItem : Element
Starting list item element.
[ options ] : Object
-
Properties
[ options.higherIndent ] : Boolean
Whether blocks with a higher indent level than the start block should be included in the result.
Defaults to
false
Returns
Array.<Element>
-
protected
getListItemBlocks( listItem, [ options ] = { [options.direction], [options.higherIndent] } ) → Array.<Element>
module:list/documentlist/utils/model~getListItemBlocks
Returns an array with elements that represents the same list item in the specified direction.
It means that values for
listIndent
andlistItemId
for all items are equal.Note: For backward search the provided item is not included, but for forward search it is included in the result.
Parameters
listItem : Element
Starting list item element.
[ options ] : Object
-
Properties
[ options.direction ] : 'forward' | 'backward'
Walking direction.
Defaults to
'backward'
[ options.higherIndent ] : Boolean
Whether blocks with a higher indent level than the start block should be included in the result.
Defaults to
false
Returns
Array.<Element>
-
protected
getListItems( listItem ) → Array.<Element>
module:list/documentlist/utils/model~getListItems
-
protected
getNestedListBlocks( listItem ) → Array.<Element>
module:list/documentlist/utils/model~getNestedListBlocks
-
protected
getSelectedBlockObject( model ) → Element | null
module:list/documentlist/utils/model~getSelectedBlockObject
-
protected
indentBlocks( blocks, writer, [ options ] = { [options.expand], [options.indentBy] } )
module:list/documentlist/utils/model~indentBlocks
Increases indentation of given list blocks.
Parameters
blocks : Element | Iterable.<Element>
The block or iterable of blocks.
writer : Writer
The model writer.
[ options ] : Object
-
Properties
[ options.expand ] : Boolean
Whether should expand the list of blocks to include complete list items.
Defaults to
false
[ options.indentBy ] : Number
The number of levels the indentation should change (could be negative).
Defaults to
1
-
protected
isFirstBlockOfListItem( listBlock ) → Boolean
module:list/documentlist/utils/model~isFirstBlockOfListItem
Check if the given block is the first in the list item.
Parameters
listBlock : Element
The list block element.
Returns
Boolean
-
protected
isLastBlockOfListItem( listBlock ) → Boolean
module:list/documentlist/utils/model~isLastBlockOfListItem
Check if the given block is the last in the list item.
Parameters
listBlock : Element
The list block element.
Returns
Boolean
-
Returns true if the given model node is a list item block.
Parameters
node : Node
A model node.
Returns
Boolean
-
Checks whether the given blocks are related to a single list item.
Parameters
blocks : Array.<Element>
The list block elements.
Returns
Boolean
-
protected
mergeListItemBefore( listBlock, parentBlock, writer ) → Array.<Element>
module:list/documentlist/utils/model~mergeListItemBefore
-
protected
outdentBlocksWithMerge( blocks, writer )
module:list/documentlist/utils/model~outdentBlocksWithMerge
Decreases indentation of given list of blocks. If the indentation of some blocks matches the indentation of surrounding blocks, they get merged together.
Parameters
-
protected
outdentFollowingItems( lastBlock, writer ) → Array.<Element>
module:list/documentlist/utils/model~outdentFollowingItems
Modifies the indents of list blocks following the given list block so the indentation is valid after the given block is no longer a list item.
Parameters
lastBlock : Element
The last list block that has become a non-list element.
writer : Writer
The model writer.
Returns
Array.<Element>
Array of altered blocks.
-
protected
removeListAttributes( blocks, writer ) → Array.<Element>
module:list/documentlist/utils/model~removeListAttributes
-
protected
splitListItemBefore( listBlock, writer ) → Array.<Element>
module:list/documentlist/utils/model~splitListItemBefore
Splits the list item just before the provided list block.
Parameters
Returns
Array.<Element>
The array of updated blocks.
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.