This library facilitates editing of multi-level tables of contents and can be used, as in the demo, to construct a drag-and-drop editor for such tables.
This is the type of items that the init function
operates on to produce a list of Item. If the table
editor must operate on a list of items from "outside,"
those items must have the fields level, title, and id.
Transform a list of SimpleItems to a list of items. The essential point is to compute a levels field, which is used internally to ensure that the TOC is well-formed.
Update the levels and section numbers of each item. These change if the items or reordered or their levels are changed. The update function repairs lists that are not well-formed.
Increment the level of the item in a list with given id.
Decrement the level of the item in a list with given id.
These helpers are useful if a List Item must
be transformed to a List SomeOtherKindOfItem.
Return the updated level of an item.
Return the updated section number of an item.
The type for tables of content.