@prisma-cms/front-editor
Version:
57 lines (56 loc) • 2.1 kB
TypeScript
import EditorComponent, { EditorComponentProps, EditorComponentObject } from './EditorComponent';
import { EditorContextValue } from './context/EditorContext/interfaces';
declare type ComponentsArray = Array<typeof EditorComponent>;
export interface FrontEditorProps {
object: EditorComponentObject | undefined;
className?: string;
inEditMode?: boolean;
onChange?: (components: EditorComponentObject[]) => void;
createTemplate?: (options: any) => Promise<any>;
updateTemplate?: (options: any) => Promise<any>;
deleteTemplate?: (options: any) => Promise<any>;
Components: ComponentsArray;
/**
* Show items only
*/
itemsOnly?: boolean;
/**
* Handle on change components data
*/
onChangeState?: EditorComponentProps['onChangeState'];
/**
* Danger! If true, can user <script> in HtmlTag component
*/
allowScriptTags?: EditorContextValue['allowScriptTags'];
}
export interface FrontEditorState {
/**
* Элемент в панели управления, который может быть перетянут на страницу
*/
dragItem: EditorComponent | EditorComponentObject | null;
/**
* Текущий элемент на странице, в который может быть заброшен новый элемент
*/
dragTarget: EditorComponent | null;
/**
* Текущий элемент на странице, свойства которого можно редактировать (выбирается по клику)
*/
activeItem: EditorComponent | null;
/**
* Элемент, на который наведена мышь
*/
hoveredItem: EditorComponent | null;
/**
* Компоненты редактора
*/
Components: ComponentsArray;
/**
* Открыта ли панель с каталогом шаблонов
*/
templatesOpened: boolean;
/**
* Основной контекст фронт-редактора
*/
editorContext: EditorContextValue;
}
export {};