On this pageFunctions
Ui/DragAndDrop
/**
* Returns attributes the parent attaches to a droppable container element.
* Handler-free, so the bundle is built with `inertHtml` and spreads into
* any Message universe's attribute array.
*/
(
containerId: string,
label?: string
): readonly Array<Attribute<never>>/**
* Returns attributes the parent attaches to a sortable item element.
* Typically combined with `draggable`. Handler-free, so the bundle is built
* with `inertHtml` and spreads into any Message universe's attribute
* array.
*/
(itemId: string): readonly Array<Attribute<never>>/** Identifies the draggable item and its current location. */
type DraggableAttributesInput = Readonly<{
containerId: string
index: number
itemId: string
}>type InitConfig = Readonly<{
activationThreshold: number
id: string
orientation: "Horizontal" | "Vertical"
}>/** Attribute builders supplied to the consumer's `toView` callback. */
type RenderInfo = Readonly<{
draggable: (input: DraggableAttributesInput) => ReadonlyArray<ChildAttribute>
droppable: (containerId: string, label?: string) => ReadonlyArray<ChildAttribute>
sortable: (itemId: string) => ReadonlyArray<ChildAttribute>
}>/** Per-render inputs passed to the DragAndDrop connection's `embedView` method. */
type ViewInputs = Readonly<{
toView: (render: RenderInfo) => Html
}>/** Schema for the current pointer or keyboard drag phase. */
const DragState: TaggedUnion<{
Dragging: {
current: Struct<{
clientX: Number
clientY: Number
}>
itemId: String
maybeDropTarget: Option<Struct<{
containerId: String
index: Number
}>>
origin: Struct<{
screenX: Number
screenY: Number
}>
sourceContainerId: String
sourceIndex: Number
}
Idle: {}
KeyboardDragging: {
itemId: String
sourceContainerId: String
sourceIndex: Number
targetContainerId: String
targetIndex: Number
}
Pending: {
containerId: String
index: Number
itemId: String
origin: Struct<{
screenX: Number
screenY: Number
}>
}
}>