image Drag And Drop Target
No-op on Android — touch platforms don't expose OS-level file drag-drop the same way Desktop does. The existing image picker covers this flow.
Attach an OS-level drag-and-drop target to a composable so files dropped onto it from Finder / Explorer / a browser tab get decoded and surfaced through onImagesDropped.
One callback fire per drop event — if the user drops three files at once, onImagesDropped receives a list of three triples in drop order:
(bytes, intrinsicSize, dropPositionScreen) for each accepted fileThe host is expected to translate dropPositionScreen to world space via the viewport and dispatch Intent.InsertImage per entry, offsetting subsequent placements so they don't perfectly overlap.
Per-platform behavior:
JVM (Desktop): Hooks
Modifier.dragAndDropTargetand readsevent.awtTransferable.getTransferData(DataFlavor.javaFileListFlavor). Image MIME sniffing via io.ak1.drawbox.decodeImageBitmap isn't run — we just attemptImageIO.readand skip files that can't be decoded.Web (WasmJS / JS): Out of scope for this PR. The Compose Multiplatform drag-drop API doesn't surface a stable web payload yet; tracked separately.
Android / iOS: No-op. Touch platforms don't expose OS-level drag-drop in the same shape.
iOS drag-and-drop probe. Compose Multiplatform 1.11 exposes Modifier.dragAndDropTarget on iOS targets but doesn't (yet) surface a payload accessor on the DragAndDropEvent analogous to JVM's awtTransferable. Without DragData or nativeEvent, the contents of the drop session (an array of NSItemProviders in UIKit terms) aren't reachable through the Compose API.
Reaching the underlying UIDropInteraction requires going outside Compose's modifier — adding UIDropInteraction to the host view's UIView and implementing UIDropInteractionDelegate. That's a real implementation but warrants a separate design pass (locating the host view, lifecycle ownership of the interaction, threading the host callback back through the SDK boundary).
Tracked as part of the residual on issue #78.
No-op on legacy Kotlin/JS — same status as the WasmJS actual.
Attach an OS-level drag-and-drop target to a composable so files dropped onto it from Finder / Explorer / a browser tab get decoded and surfaced through onImagesDropped.
One callback fire per drop event — if the user drops three files at once, onImagesDropped receives a list of three triples in drop order:
(bytes, intrinsicSize, dropPositionScreen) for each accepted fileThe host is expected to translate dropPositionScreen to world space via the viewport and dispatch Intent.InsertImage per entry, offsetting subsequent placements so they don't perfectly overlap.
Per-platform behavior:
JVM (Desktop): Hooks
Modifier.dragAndDropTargetand readsevent.awtTransferable.getTransferData(DataFlavor.javaFileListFlavor). Image MIME sniffing via io.ak1.drawbox.decodeImageBitmap isn't run — we just attemptImageIO.readand skip files that can't be decoded.Web (WasmJS / JS): Out of scope for this PR. The Compose Multiplatform drag-drop API doesn't surface a stable web payload yet; tracked separately.
Android / iOS: No-op. Touch platforms don't expose OS-level drag-drop in the same shape.
No-op on WasmJS. Investigated against Compose Multiplatform 1.11 — the androidx.compose.ui.draganddrop package doesn't expose either:
DragData(the cross-platform abstraction overDataTransfer), norDragAndDropEvent.nativeEvent(the browserDragEventescape hatch we use on JVM viaawtTransferable).
Both would land on web targets in a future Compose release; until they do, the only path is raw DOM dragover / drop listeners attached outside Compose's modifier. That's a real implementation but warrants a separate design pass (positioning the listener relative to the canvas bounds, filtering drops, cleaning up on disposal).
Tracked as the residual on issue #78.