v2.0.1: The pointer-first release
The pointer-first release. In-app drag and drop now runs entirely on pointer
events and keyboard input with typed Rust payloads; native browser drag is
reserved for the app boundary, where DataTransfer is the only transport.
Styling is Tailwind-ready through presence-based data attributes, and the
project website is a new multi-page gallery that teaches every pattern.
Breaking: one input model
- In-app components are pointer + keyboard only. Removed
PointerDraggable,
DragInputMode,DragMode::Native,Draggable::native, theinput
props on sortable/grid/board/multiselect components, and every in-app
nativeondrag*branch (DropZone,SortableList,SortableGrid,
BoardSlot,TreeNodeTarget,CanvasDropZone).Draggableis now the
one in-app drag source, and there is no mode to choose. - Native
DataTransferremains exactly where the app boundary requires it:
FileDropZone,ExternalDropZone,ExternalDragSource,
external::typed, andAutoScroll's dragover listener. DropOutcomegained two fields:mode: DragMode(Pointeror
Keyboard) andgrab: Point(the pointer offset inside the element at
pickup;element - grabis the landing top-left). ManualDropOutcome
literals must add both.ZoneId::autoandDragId::autonow start at 2^32 so auto-generated ids
can never collide with explicitu32-range ids and silently replace a
neighboring zone in the registry (previously dependent on mount order).
Styling: presence-based data attributes
- Drag state is exposed as attributes that are present while active and
absent otherwise, so Tailwind variants likedata-dragging:opacity-50
and CSS[data-over]selectors match only active elements:data-over+
data-activeonDropZone,FileDropZoneandExternalDropZone,
data-dragging+data-disabledonDraggable,data-dragging+
data-drop-targeton sortable/grid items,data-active+data-overon
BoardSlot,data-selectedonSelectableDraggable,data-intenton
TreeNodeTarget,data-activeonCanvasDropZone, and
data-sort-handleon touch grips. - Forwarded
styleprops merge after functional inline styles instead of
replacing them, sotouch-action, overlay positioning and the grid's
display: gridsurvive while your declarations win per property. - New
item_classprop onSortableGridfor the library-rendered tile
wrappers;DragOverlayforwardsclassand friends to the ghost.
Pointer path
- New
webfeature: real pointer capture viaweb-sys, so a mouse drag
stays glued to its source when the cursor leaves it. Off by default; the
core stays dependency-free with a held-button recovery fallback, and a
formal gesture state machine (transition,GesturePhase,
GestureEvent,GestureEffect) drives every drag. - New
SortableList::overlayprop: a fixed-position ghost sized from the
measured source row while the in-flow row becomes the live gap. - Live preview translates rows by the measured slot pitch (margins and gaps
included) so spacing never squashes mid-drag; hover hit-tests client
coordinates against rects measured at drag start. - A release outside a list or grid commits no reorder, and a drop over a
rejecting zone falls through to an accepting zone stacked beneath it.
Missed drops re-measure zones and retry within 48px for touch. AutoScrollfollows default mouse pointer drags via held-button state,
never scrolls on passive hover, stops when the pointer leaves the
container, and takes an optionalactivegate.Ctrl/Cmdat release resolves pointer drops toCopyandAltto
Link(effective_effectis public); keyboard drops report the selected
zone's center inDropOutcome::elementand honor
CanvasKeyboardPlacement(Center,Origin,Fixed).BoardSlotregisters as a real zone (pointer, touch and keyboard can
target it) andapply_moveadjusts same-column forward insertions.TreeNodeTarget,BoardSlotandCanvasDropZonemirror changing props
through signals so their one-time registry callbacks always read current
values.FileFilter::content_typesgained a real MIME matcher (exact types,
type/*,*/*, structured*+jsonsuffixes, parameters and case
ignored, malformed patterns rejected), andextensionsnormalizes dots,
case and whitespace.
The gallery website
examples/gallery/replaces the showcase, tailwind and canvas examples:
a multi-page site with one page per pattern (fourteen in all), each
pairing a live demo with a numbered walkthrough, an annotated snippet, a
"New to Dioxus?" callout and a real API reference. Deployed to GitHub
Pages by CI.- The design follows the KI-U paper system: paper and ink scales, one
forest-green accent, earth tones used sparingly, Poppins for UI text and
Geist Mono for code, no glow shadows. Code panels are inverse-ink with a
homegrown Rust/rsx highlighter (no JavaScript highlighter). - The landing page hero is itself a demo: draggable paper scraps on a
CanvasDropZone. - Removed
examples/showcase.rs,examples/tailwind.rsand
examples/canvas.rs. The Playwright suite now drives headless fixtures
inexamples/regressions.rson a single dev server, covering overlay
geometry and cleanup, outside-release cancellation for lists and grids,
autoscroll edge behavior, canvas grab-offset placement, drop
fall-through, the Ctrl-drag copy convention, reorder buttons inside
sortable rows, and the native boundary paths.
2.0.1 docs patch
Docs-only patch. The README packaged into 2.0.0 still carried a stale
pre-release warning line and a malformed crates.io badge link, which
rendered on crates.io and the docs.rs front page. This release ships the
refreshed README: fixed badges, the 2.0 compatibility table, a prominent
link to the live gallery, highlighted code fences, and a precise claim
about JavaScript (the library ships none of its own; the optional web
feature uses web-sys bindings for pointer capture).
Links
- Live gallery: https://kindintelligence.github.io/dioxus-dnd/
- crates.io: https://crates.io/crates/dioxus-dnd
- docs.rs: https://docs.rs/dioxus-dnd
- Full changelog: v1.0.0...v2.0.1