invoke-prompt-editor-demo/src/components/PromptItem.tsx

25 lines
771 B
TypeScript

import {PromptItem as PIType} from "../lib/prompt"
/**
* NOTE: Drag-n-drop rules!
*
* - Nuggets can be dragged and dropped into...
* - another nugget
* - when this happens, an Operation is created.
* - an operation
* - when this happens, the Nugget is added to the operation.
* - Operations can be dragged, but only to reorder.
* - Nuggets can also be dragged to be re-ordered.
*/
export interface PromptItemProps {
onDragStart?: (item : PIType) => void,
onDragEnd?: () => void,
onDragOver?: (item: PIType) => void,
onDrop?: (item : PIType) => void,
onMouseEnter?: (item : PIType) => void,
onMouseLeave?: (item : PIType) => void,
onDelete : (item : PIType) => void,
}
export type EditorMode = "dnd" | "sort" | "score"