EditorStoreinterface
import { EditorStore } from '@mortar-kit/admin'
interface EditorStoreThe editor's state and the only ways to change it.
Properties
readonly state: EditorStateselect: (target: Target | null) => voidsetSlug: (slug: string) => voidSets the document's slug (checked when saving).
addEntry: (brickName: string, index?: number) => string | undefinedAdds an entry of the named brick with its default data at
index(default: the end) and selects it. Returns the new id, or undefined if no brick has that name or the collection has no body.removeEntry: (id: string) => voidRemoves an entry. If it was selected, a neighbour (or the fields) is selected.
moveEntry: (id: string, toIndex: number) => voidMoves an entry to
toIndex. Indexes past either end are ignored.duplicateEntry: (id: string) => string | undefinedInserts a copy of an entry (new id, cloned data) after it and selects it. Returns the new id.
setValue: (target: Target, path: Path, value: unknown) => voidSets the value at
pathin an entry's data or the document's fields.insertItem: (target: Target, path: Path, index: number, value: unknown) => voidInserts
valueinto the list atpath.