list/documentlist/utils/model
@ckeditor/ckeditor5-list/src/documentlist/utils/model
Filtering
Classes
-
ListItemUid
module:list/documentlist/utils/model~ListItemUid
protected
The list item ID generator.
Functions
-
expandListBlocksToCompleteItems( blocks, [ options ] = { [options.withNested] } ) → Array.<Element>
module:list/documentlist/utils/model~expandListBlocksToCompleteItems
protected
Expands the given list of selected blocks to include the leading and tailing blocks of partially selected list items.
-
expandListBlocksToCompleteList( blocks ) → Array.<Element>
module:list/documentlist/utils/model~expandListBlocksToCompleteList
protected
Expands the given list of selected blocks to include all the items of the lists they're in.
-
getAllListItemBlocks( listItem, [ options ] = { [options.higherIndent] } ) → Array.<Element>
module:list/documentlist/utils/model~getAllListItemBlocks
protected
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>
-
getListItemBlocks( listItem, [ options ] = { [options.direction], [options.higherIndent] } ) → Array.<Element>
module:list/documentlist/utils/model~getListItemBlocks
protected
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>
-
getListItems( listItem ) → Array.<Element>
module:list/documentlist/utils/model~getListItems
protected
Returns array of all blocks/items of the same list as given block (same indent, same type and properties).
-
getNestedListBlocks( listItem ) → Array.<Element>
module:list/documentlist/utils/model~getNestedListBlocks
protected
Returns a list items nested inside the given list item.
-
getSelectedBlockObject( model ) → Element | null
module:list/documentlist/utils/model~getSelectedBlockObject
protected
Returns a selected block object. If a selected object is inline or when there is no selected object,
null
is returned. -
indentBlocks( blocks, writer, [ options ] = { [options.expand], [options.indentBy] } )
module:list/documentlist/utils/model~indentBlocks
protected
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
-
isFirstBlockOfListItem( listBlock ) → Boolean
module:list/documentlist/utils/model~isFirstBlockOfListItem
protected
Check if the given block is the first in the list item.
-
isLastBlockOfListItem( listBlock ) → Boolean
module:list/documentlist/utils/model~isLastBlockOfListItem
protected
Check if the given block is the last in the list item.
-
isListItemBlock( node ) → Boolean
module:list/documentlist/utils/model~isListItemBlock
protected
Returns true if the given model node is a list item block.
-
isSingleListItem( blocks ) → Boolean
module:list/documentlist/utils/model~isSingleListItem
protected
Checks whether the given blocks are related to a single list item.
-
mergeListItemBefore( listBlock, parentBlock, writer ) → Array.<Element>
module:list/documentlist/utils/model~mergeListItemBefore
protected
Merges the list item with the parent list item.
-
outdentBlocksWithMerge( blocks, writer )
module:list/documentlist/utils/model~outdentBlocksWithMerge
protected
Decreases indentation of given list of blocks. If the indentation of some blocks matches the indentation of surrounding blocks, they get merged together.
-
outdentFollowingItems( lastBlock, writer ) → Array.<Element>
module:list/documentlist/utils/model~outdentFollowingItems
protected
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.
-
removeListAttributes( blocks, writer ) → Array.<Element>
module:list/documentlist/utils/model~removeListAttributes
protected
Removes all list attributes from the given blocks.
-
sortBlocks( blocks ) → Array.<Element>
module:list/documentlist/utils/model~sortBlocks
protected
Returns the array of given blocks sorted by model indexes (document order).
-
splitListItemBefore( listBlock, writer ) → Array.<Element>
module:list/documentlist/utils/model~splitListItemBefore
protected
Splits the list item just before the provided list block.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.