Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
456b886
refactor: replace svelte transitions with css animations
Horuse Feb 22, 2026
2dcd1c8
fix: eliminate post-drop translation snap animation
Horuse Feb 22, 2026
305c345
fix: ghost and dragging visibility
Horuse Feb 22, 2026
d69c4f2
fix: prevent drag and cursor grab in draggable padding area
Horuse Feb 22, 2026
b9115c1
feat: wrap DndPreview inside DndDraggable via position prop
Horuse Mar 16, 2026
0f73225
feat: drag slot size calculate
Horuse Mar 16, 2026
a0605fe
fix: use DOM-based element lookup in translations to prevent registry…
Horuse Mar 16, 2026
915134a
feat: simplify DndDraggable API by making position required and remov…
Horuse Mar 16, 2026
ebe2d3a
refactor: make DOMHelper methods static and centralize DOM selectors
Horuse Mar 16, 2026
a5832a9
fix: scope findPlaceholder to direct container to prevent nested prev…
Horuse Mar 16, 2026
941fa74
feat: add DndPreview visible animation with CSS variable overrides
Horuse Mar 16, 2026
9c3225c
fix: collapse gap in origin container when dragging across containers…
Horuse Mar 16, 2026
eacc3d7
refactor: extract DragEventEmitter and TranslationCalculator from Dra…
Horuse Mar 16, 2026
239d019
refactor: improve DragController - dead code removal, slot size extra…
Horuse Mar 17, 2026
9583403
refactor: reorganize core/ into controller, animation, zones, scroll,…
Horuse Mar 17, 2026
7c610e0
docs: add JSDoc to DragController
Horuse Mar 17, 2026
b1f53ab
fix: animate drop preview out smoothly on zone leave and drop
Horuse Mar 17, 2026
f8a924f
fix: show drop preview instantly at origin on drag start and during r…
Horuse Mar 17, 2026
bfc49cb
fix: enable touch scroll with momentum and long-press drag on mobile
Horuse Mar 17, 2026
4065235
refactor: reorganize core/ structure - dnd/, handlers/, utils/ folder…
Horuse Mar 17, 2026
b9aed41
refactor: extract DropHandler and PreviewHandler classes
Horuse Mar 17, 2026
7786776
fix: show drop preview when hovering at end of cross-container list
Horuse Mar 17, 2026
ebc8100
fix: use slot wrapper rect for drop animation target to avoid CSS tra…
Horuse Mar 17, 2026
337249e
refactor: extract DnD example logic into reusable components under sr…
Horuse Mar 17, 2026
8d7a420
feat: add TrashZone component to sortable-containers example
Horuse Mar 17, 2026
81bc208
feat: add mode="target" to DndDroppable for non-sortable drop zones
Horuse Mar 17, 2026
2dfe0f1
feat: add overlap prop to DndDroppable for intersection-based hit det…
Horuse Mar 17, 2026
a191da1
fix: keep tail preview mounted for proper exit animation, instant hid…
Horuse Mar 18, 2026
68324ff
fix: use tail preview wrapper as slot size reference to capture flex gap
Horuse Mar 18, 2026
203eb69
fix: use slot wrapper rect for all animation strategies via findPlace…
Horuse Mar 18, 2026
99bc625
refactor: architectural overhaul with ContainerStrategy, DragSession,…
Horuse Mar 18, 2026
535768e
feat: add DndSimulator with simulateDrop and simulateReturn
Horuse Mar 18, 2026
37a02dc
feat: add DragSource to session to distinguish user vs programmatic d…
Horuse Mar 18, 2026
e306791
fix: use target container slot size in simulator to account for item…
Horuse Mar 18, 2026
740b5b9
feat: add new docs app
Horuse Mar 19, 2026
01d766b
feat(docs): custom markdown components and new pages
Horuse Apr 3, 2026
cfc7656
fix: use bun for main scripts
Horuse Apr 3, 2026
49d7cbe
build: migrate to turborepo
Horuse Apr 4, 2026
5cbf3f9
fix: add build dependency order in turbo.json
Horuse Apr 4, 2026
26ab533
fix: remove --bun flag from build script
Horuse Apr 4, 2026
78d4b71
Merge pull request #15 from Horuse/new-docs
Horuse Apr 4, 2026
e9712bc
fix: clone ghost element, cache DnD strategies, replace setInterval w…
Horuse Apr 4, 2026
44e942b
feat: add explicit type and accepts props, fix ARIA and registry issues
Horuse Apr 4, 2026
1b86860
refactor(types): replace any with Record<string, unknown>
Horuse Apr 4, 2026
79f05e5
fix(drag-handler): explicitly release pointer capture on pointer up
Horuse Apr 4, 2026
70522b1
fix(dnd-controller): cancel pending hide-preview timeout on rapid moves
Horuse Apr 4, 2026
bf49470
feat: add scroll config to scroll controller
Horuse Apr 4, 2026
534bbd5
feat: add PreviewConfig for customizable drop preview animation delays
Horuse Apr 4, 2026
f48119e
fix(dnd-state): reset isPerformingDrop and shouldSkipDropPreviewAnima…
Horuse Apr 4, 2026
b32079e
feat: add onDropCancelled callback to distinguish cancel from success…
Horuse Apr 4, 2026
b0688ba
refactor: consolidate DndController constructor params into single co…
Horuse Apr 4, 2026
90d9566
feat: expose ContainerStrategy API with custom strategy support via D…
Horuse Apr 4, 2026
da7f365
fix(dnd-state): remove transient flags from reset
Horuse Apr 4, 2026
7527cd4
fix(dnd-simulator): use strategyMap for container registration
Horuse Apr 4, 2026
da62e4d
refactor(dnd-provider): remove config prop, update docs
Horuse Apr 4, 2026
d44dff0
fix: guard window/document access for SSR compatibility
Horuse Apr 4, 2026
6aa0347
docs: overhaul README, fix stale docs, add frontmatter, export Previe…
Horuse Apr 5, 2026
1f86162
docs: symbolic link readme
Horuse Apr 5, 2026
9aeb77e
docs: fix path for symbolic link
Horuse Apr 5, 2026
13bb4b6
docs: add CHANGELOG and migration guide from v0.3.0
Horuse Apr 5, 2026
fc974e6
chore: update adapter-vercel
Horuse Apr 5, 2026
1c8e653
build: add bunx to scripts
Horuse Apr 5, 2026
5938e44
build: publish from packages/svelte-dnd directory
Horuse Apr 5, 2026
d135429
feat: publish with dynamic dist-tag based on version suffix
Horuse Apr 5, 2026
be85ef9
fix: clearAll cleanup + droppable reactivity
Horuse Apr 7, 2026
6e3d8df
fix: disabled not blocking drag, remove grid direction, clear hidePre…
Horuse Apr 7, 2026
5608a94
fix: deduplicate scheduleRefresh calls during auto-scroll
Horuse Apr 7, 2026
ddd67a2
refactor: extract PointerSensor, make DragHandler a sensor coordinator
Horuse Apr 7, 2026
faa31ac
refactor: pluggable collision detection, replace overlap prop with Co…
Horuse Apr 7, 2026
4fde36b
refactor: split DndController into DragSessionManager, DropAnimationC…
Horuse Apr 7, 2026
1627b5e
feat: enable grid direction
Horuse Apr 7, 2026
b5af652
feat: KeyboardSensor, ARIA live region, and screen reader announcements
Horuse Apr 7, 2026
0e73f51
feat: pluggable transform modifiers with restrict and snap-to-grid bu…
Horuse Apr 7, 2026
b1eb49f
feat: generic DndController<TData>, onDragOver event, simulateDrop em…
Horuse Apr 7, 2026
f0891ef
docs: add sensors, collision, modifiers, accessibility pages and upda…
Horuse Apr 7, 2026
f8421f4
refactor: move announcements to DndController config, rename route to…
Horuse Apr 7, 2026
7edc3ad
docs: replace configs/sensors example pages with inline ComponentPrev…
Horuse Apr 7, 2026
371609d
feat: simulateSwap, keyboard scroll tracking, modifier improvements
Horuse Apr 7, 2026
1a9dbd0
feat: simulateBatchSwap, group-by-color example, collapsible Componen…
Horuse Apr 7, 2026
3578073
feat: auto-resolve ComponentPreview sources to fenced code blocks in …
Horuse Apr 7, 2026
843456f
feat: configurable sensor system with pointer/keyboard sensors
Horuse Apr 8, 2026
4ae5ee6
fix: correct preview alignment and slot size for variable-height items
Horuse Apr 10, 2026
15fbbb4
fix: align drop ghost animation to preview element position
Horuse Apr 10, 2026
92cdd7c
fix: stabilize ghost drop target position for variable-height previews
Horuse Apr 10, 2026
8825545
fix: use dragged element size with target gap for cross-container slo…
Horuse Apr 10, 2026
be73356
fix: extend variable-height preview alignment to horizontal lists
Horuse Apr 10, 2026
ad94c46
refactor: add entity classes Slot, Draggable, Preview, Droppable, Dra…
Horuse Apr 13, 2026
4a1904f
refactor: add entity maps, session, attachDroppable and startSession …
Horuse Apr 13, 2026
e76491e
refactor: switch DndDroppable and DndDraggable to entity-based archit…
Horuse Apr 13, 2026
d5a5cfa
refactor: replace DOM/registry lookups in strategies with Droppable e…
Horuse Apr 13, 2026
56c94df
refactor: replace DOM traversal in animation steps and simulator with…
Horuse Apr 13, 2026
4f82ff1
refactor: delete legacy handlers, registrar, session manager, clean D…
Horuse Apr 13, 2026
9a44665
fix: sync slot.position with position prop to prevent stale order aft…
Horuse Apr 14, 2026
8bdf1cd
feat!: replace primitive event callbacks with rich event objects
Horuse Apr 14, 2026
9ada30f
docs: update all pages for rich events API and attribute changes
Horuse Apr 14, 2026
9d7345e
fix: data-dnd-scroll auto-scroll
Horuse Apr 14, 2026
003cb7f
feat: animate cross-container slot collapse with ghost tracking
Horuse Apr 15, 2026
caab13a
refactor: run slot collapse in parallel with ghost flight
Horuse Apr 16, 2026
efce71d
docs: redesign home page and migrate examples to spacing prop
Horuse Apr 16, 2026
0a61f77
fix: stop auto-scroll and preserve scroll position during drop animation
Horuse Apr 16, 2026
16a0e7a
feat: add stopOnDrop scroll config option
Horuse Apr 16, 2026
879bd68
refactor: replace --dnd-slot-spacing CSS vars with reactive droppable…
Horuse Apr 16, 2026
8668bcf
refactor: rename internal placeholder to preview for consistency
Horuse Apr 16, 2026
577cdb1
refactor: migrate DndPreview to Preview entity, drop PreviewHandler
Horuse Apr 16, 2026
20438da
refactor: unify DragSession to single class, remove legacy interface
Horuse Apr 16, 2026
66b3b0b
feat!: remove per-item drag callbacks, use reactive entity state or c…
Horuse Apr 16, 2026
0797e4b
refactor!: stop exporting DndState and DndSimulator class from public…
Horuse Apr 16, 2026
2b3bdd0
refactor!: unify ghost size naming to ghostSize, drop redundant field…
Horuse Apr 16, 2026
92f742e
fix: escape container id in querySelector to support ids with special…
Horuse Apr 16, 2026
4bcf574
chore: tidy destroy cleanup + document drop-flag ordering
Horuse Apr 16, 2026
9495a58
refactor!: expose StrategyContext and animation primitives for custom…
Horuse Apr 17, 2026
baccb85
refactor: move drag session ownership to DndState
Horuse Apr 17, 2026
c5ca00f
feat!: centerPoint now tests ghost center; split old behavior into cu…
Horuse Apr 17, 2026
e910d70
fix: wire DndController preview config to live Preview entities
Horuse Apr 17, 2026
d3e90e1
refactor: make DndContainerInfo a plain snapshot
Horuse Apr 17, 2026
35bc3b1
refactor: mark internal DndController plumbing with @internal
Horuse Apr 17, 2026
4f4d1ba
feat: throw explicit error when DnD components render outside DndProv…
Horuse Apr 17, 2026
189f21b
fix: sync reactive props to Droppable and Draggable entities
Horuse Apr 17, 2026
ec20ca7
fix: cancel deferred KeyboardSensor listener on destroy
Horuse Apr 17, 2026
f8a2f06
refactor!: overlap() accepts flat threshold arg, drop object form
Horuse Apr 17, 2026
8c82d8b
docs: clarify position field as insertion index in events
Horuse Apr 17, 2026
bb94cc7
refactor!: drop fake TData generic from DndController and events
Horuse Apr 17, 2026
df54278
refactor: align DroppableControllerRef callbacks with public types
Horuse Apr 17, 2026
9e16df5
fix: populate item data and type in simulator drop events
Horuse Apr 17, 2026
9c316cd
fix: reset drop-animation flags on new drag session
Horuse Apr 17, 2026
aa9511b
docs: document component props and fix stale README onDrop example
Horuse Apr 17, 2026
9613eb5
refactor: rename internal draggedElement for clarity in Droppable
Horuse Apr 17, 2026
eb06682
refactor: ensure event emitter unsubscribers return void
Horuse Apr 17, 2026
4a87968
feat: accept SimulateOptions in simulateReturn with onDropCancelled emit
Horuse Apr 17, 2026
1262329
refactor!: drop DropPreview.visible flag in favour of nullable
Horuse Apr 17, 2026
51d5bdd
docs: align v0.3.0 migration page with actual v1 API surface
Horuse Apr 17, 2026
b8d7f2c
docs: audit and fix docs pages against v1 API
Horuse Apr 17, 2026
2aa07b0
feat!: grid layout + strategy-instance API
Horuse Apr 18, 2026
3f2677e
fix: shift siblings by dragged slot size, not adjacent rects
Horuse Apr 18, 2026
edcc878
docs: align docs with strategy-instance API and grid direction
Horuse Apr 18, 2026
16212c5
refactor!: replace DndDirection with DndLayout
Horuse Apr 18, 2026
bf7ddc4
docs: update changelog
Horuse Apr 18, 2026
e776350
fix: honour explicit spacing={0} and clean horizontal example style typo
Horuse Apr 29, 2026
9a4511a
refactor!: drop empty TargetOptions interface
Horuse Apr 29, 2026
10b23df
docs: align docs and README with rc.1 strategy API
Horuse Apr 29, 2026
dcad39c
feat: add setters for sensors, announcements, and debug
Horuse Apr 29, 2026
4b2d813
feat: add AnimationConfig for tunable drop/return/swap timings
Horuse Apr 29, 2026
a31f171
test: add 105 DOM-aware tests for sensors, zones, strategies, modifie…
Horuse Apr 29, 2026
70b6489
docs: use setModifiers/setSensors instead of remounting controller
Horuse Apr 29, 2026
a73dca6
feat: default flex direction for sortable DndDroppable
Horuse Apr 29, 2026
6d32d29
feat: target-zones example + flushSync fix in simulateBatchSwap
Horuse Apr 30, 2026
26d1f18
refactor!: collapse 4 simulator methods into animateItem + animateLayout
Horuse Apr 30, 2026
28c5f13
feat: ghost and preview auto-resize to target's item size
Horuse Apr 30, 2026
94264fa
feat!: pluggable Behavior plugins replace flat ScrollConfig
Horuse May 1, 2026
66d9553
docs(behaviors): live example with sound + ripple + confetti + bounce
Horuse May 1, 2026
eb6f0a8
refactor!: unified animation config with configurable easing
Horuse May 1, 2026
60a18ff
refactor!: fold preview delays into DelayedTransition show/hide
Horuse May 1, 2026
9c68732
fix: prevent siblings from jumping during slot collapse in scrollable…
Horuse May 1, 2026
22ad7ce
fix: clamp sortable drop zones to the scroll viewport
Horuse May 2, 2026
65c0336
feat(sortable): support virtualized lists via VirtualSource
Horuse May 2, 2026
18aebdf
fix(sortable): stop fighting virtualizer scroll-jump compensation on …
Horuse May 3, 2026
1ddb407
fix(sortable): keep ghost tracking tail-preview when source slot coll…
Horuse May 8, 2026
65b834e
fix(preview): prevent invisible-but-revealed state from leaked collap…
Horuse May 8, 2026
74c8ed0
chore(lint): add package-local prettier config and reformat
Horuse May 9, 2026
d064f31
fix(components): untrack entity-init, drop aria-grabbed, exports.impo…
Horuse May 9, 2026
ceee09c
fix(animation): reject overlapping animateLayout, clean ghost-step ca…
Horuse May 9, 2026
8f541aa
perf(controller): SvelteMap droppables, cache first-slot rect
Horuse May 9, 2026
b1554ff
test(collision): cover centerPoint, cursorOver, overlap, closestCenter
Horuse May 9, 2026
8faa6a9
fix(exports): add GhostSnippet, ZonesInvalidatedCallback, drop unused…
Horuse May 9, 2026
59b7f64
docs: VirtualSource section, SSR FAQ, sortable behaviors/virtual opti…
Horuse May 9, 2026
969c32b
chore(lint): add eslint config, drop unused imports, key debug-zone each
Horuse May 9, 2026
1b385cb
fix(scrollSync): drop degenerate-rect early-out so tail-preview engag…
Horuse May 9, 2026
bb8b2bf
feat(docs): SEO meta + auto llms.txt and sitemap from .svx frontmatter
Horuse May 10, 2026
1d332d9
feat(docs): add modified date to all pages, surface in layouts and si…
Horuse May 10, 2026
dc33be3
feat(keyboard): cross-axis nav, ghost flight to live slot rect, scrol…
Horuse May 11, 2026
7418e84
fix(keyboard): defer rect read by 1 frame so tail-position spacing is…
Horuse May 11, 2026
75ffbce
fix(keyboard): navigate full position list, same-row grid lateral, ig…
Horuse May 11, 2026
5676f3d
feat(keyboard): smooth scroll-sync flight
Horuse May 11, 2026
20ce20f
feat(docs): improved mobile support
Horuse May 11, 2026
b1a00b2
fix(keyboard): allow bubbled-event guard to skip when target is unset
Horuse May 11, 2026
e85c61e
docs: changelog for v1.0.0
Horuse May 11, 2026
480ff2f
build: include .vercel output in turbo cache
Horuse May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
push:
pull_request:
types: [opened, synchronize]

Expand All @@ -20,5 +21,8 @@ jobs:
- name: Install dependencies
run: bun install

- name: Install dependencies
run: bun run test

- name: Build
run: bun run build
10 changes: 8 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,11 @@ jobs:
uses: oven-sh/setup-bun@v2

- run: bun ci
- run: bun run build --if-present
- run: bunx npm publish --provenance
- run: bun run build
- run: |
TAG=""
if [[ "$GITHUB_REF_NAME" == *"-beta"* ]]; then TAG="--tag beta"; fi
if [[ "$GITHUB_REF_NAME" == *"-alpha"* ]]; then TAG="--tag alpha"; fi
if [[ "$GITHUB_REF_NAME" == *"-rc"* ]]; then TAG="--tag rc"; fi
bunx npm publish --provenance $TAG
working-directory: packages/svelte-dnd
50 changes: 31 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
# dependencies (bun install)
node_modules

# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/build
/dist
# output
out
dist
*.tgz

# OS
.DS_Store
Thumbs.db
# code coverage
coverage
*.lcov

# Env
# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# dotenv environment variable files
.env
.env.*
!.env.example
!.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local

# caches
.eslintcache
.cache
*.tsbuildinfo

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
/old
# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
/.turbo


.turbo
.vercel
2 changes: 1 addition & 1 deletion .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/svelte-dnd.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

209 changes: 209 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.0.0] - 2026-05-11

First stable release.

### Breaking Changes

- **`scroll` config replaced by `behaviors[]`**. Auto-scroll and scroll-sync are now `Behavior` plugins; built-in factories `autoScroll()` and `scrollSync()`, both included by default. Per-droppable override via `sortable({ behaviors })` / `target({ behaviors })`. `controller.setScrollConfig` removed — use `controller.setBehaviors`. `ScrollConfig` type replaced by `AutoScrollConfig`.
- **Simulator API consolidated**. `simulateReturn`, `simulateDrop`, `simulateSwap`, `simulateBatchSwap` are replaced by `controller.animateItem` and `controller.animateLayout`. `SimulateOptions` removed; new types `AnimateItemOptions`, `AnimateLayoutOptions`, `ContainerPosition`.
- **Animation config unified under `animation`**. Top-level `preview` option on `DndController` removed. Renames: `dropDuration` → `drop`, `returnDuration` → `return`, `slotCollapseDuration` → `slotCollapse`, `swapDuration` → `layout`. Preview delays moved into `animation.preview.show` / `animation.preview.hide` as `DelayedTransition` (`{ delay, duration, easing }`). `siblingShift` and `ghostResize` take a `Transition`; `drop`, `return`, `slotCollapse`, `layout`, `keyboardFlight` take a number or `Transition`.
- **`controller.previewConfig` and `setPreviewConfig` removed**. Read from `controller.animation`, patch via `controller.setAnimation`.
- **Ghost rotation no longer applied by the library**. Removed CSS vars `--dnd-ghost-rotation`, `--dnd-ghost-rotation-duration` and the `.dnd-ghost--returning` reset rule. Implement rotation in custom CSS if needed.
- **`PreviewConfig` and `ScrollConfig` types are no longer exported**. Use `AnimationConfig` / `AutoScrollConfig` instead.

### Features

- **Sortable virtualization** via `sortable({ virtual })`. New `VirtualSource` and `SortableSource` types let a virtualizer drive zone geometry from live slot rects. Tested with virtua; other virtualizers should work via the same interface but are unverified. Grid layout falls back to DOM mode.
- **Pluggable `Behavior` plugins**. Custom plugins implement `wrapDropAnimation(next, ctx)` and/or expose `autoScrollConfig`. New exports: `Behavior`, `BehaviorContext`, `AutoScrollConfig`, `autoScroll`, `scrollSync`, `ScrollSyncOptions`.
- **`scrollSync({ threshold })`** — engagement gated by the destination slot's visible fraction.
- **Ghost & preview auto-resize to the destination's item size**, mixing target-sibling and dragged-item dimensions per layout. Exposed reactively as `controller.dropPreviewSize`. CSS vars `--dnd-ghost-resize-duration` / `--dnd-ghost-resize-easing` driven by `animation.ghostResize`.
- **Keyboard navigation expansions**. `Home` / `End`, cross-axis hops between sibling containers, same-row / same-column grid movement, per-keystroke ghost flight to the live slot rect, lockstep scroll-into-view for off-screen targets. Iterates the full position list, so virtualized slots stay reachable. Tunable via `animation.keyboardFlight`.
- **Configurable easing for every animation**. rAF-driven steps accept a number or `{ duration, easing }`; CSS-driven steps (preview show/hide, `siblingShift`, `ghostResize`) gain matching easing fields. `scrollSync` inherits the wrapped step's easing.
- **`parseEasing(str)` helper** exported for custom `AnimationStep` implementations.
- **New CSS vars** `--dnd-preview-easing-in`, `--dnd-preview-easing-out`, `--dnd-ghost-resize-easing` written from `controller.animation`; user CSS still overrides.
- **Runtime setters**: `setBehaviors`, `setAnimation` (deep-merge), `setSensors`, `setAnnouncements`, `setModifiers`, `setDebug`. No need to recreate the controller.
- **Default flex direction for sortable `DndDroppable`** via `:where(.dnd-droppable[data-dnd-layout='vertical'|'horizontal'])`. Consumer classes (Tailwind, custom) win without `!important`. Grid sortables get no default.
- **`Droppable.itemCount` and `Droppable.isVirtualized`** getters expose data length and virtualization mode.
- **Per-call `behaviors` / `easing` override on `animateItem`**.
- **`animateLayout({ morph: true })`** copies missing classes from pre- to post-state element so class-driven CSS transitions run in lockstep with the FLIP transform.
- **New exports**: `GhostSnippet`, `GhostSnippetProps`, `ZonesInvalidatedCallback`.

### Bug Fixes

- Honour explicit `spacing={0}` on `DndDraggable`.
- Clamp sortable drop zones to the container's scroll viewport.
- Siblings no longer jump during slot collapse in scrollable sources.
- Drop no longer fights the virtualizer's scroll-jump compensation.
- Ghost tracks the tail preview correctly when the source slot collapses.
- Repeated `preview.hide()` calls no longer leak collapse timers.
- Overlapping `animateLayout` invocations reject with a clear error instead of corrupting state silently.
- `scrollSync` now engages on tail previews in empty containers (degenerate-rect case).
- Keyboard ghost flight reads the post-update tail spacing, so the first key after a drop lands at the correct rect.
- `KeyboardSensor` no longer activates twice when `Enter` / `Space` bubbles from nested draggables.
- Keyboard navigation no longer triggers auto-scroll (auto-scroll was tied to pointer updates).
- Reactive prop updates on `DndDraggable` / `DndDroppable` / `DndPreview` propagate from the first read — entities are no longer pinned to the initial snapshot.
- Post-drop rect reads in `animateLayout` happen against the updated DOM, fixing stale FLIP transforms.
- `package.json` gains `exports.import` and `exports.default` conditions for correct ESM resolution.
- Removed `aria-grabbed` from the dragged element (deprecated in ARIA 1.1).

### Performance

- Droppables mounting or unmounting mid-drag update zone derivations reactively instead of going stale until the next pointermove.
- First-slot rect cached per drag session, avoiding a synchronous layout on every pointermove when computing `dropPreviewSize`.

### Docs

- New examples: virtualization, target-zones, behaviors live demo.
- New pages: behaviors, `VirtualSource`, SSR FAQ. Examples updated to the consolidated simulator API and runtime setters.

## [v1.0.0-rc.1] - 2026-04-19

Release candidate for v1.0. Public API stabilized — please report regressions before stable.

### Breaking Changes

- **Strategy-instance API on `DndDroppable`**. The `mode` and `direction` props are replaced with a single `strategy` prop that takes a strategy instance. Factories exported: `sortable({ layout, flow })`, `target()`. Custom strategies implement the `ContainerStrategy` interface.
- **`DndLayout` replaces `DndDirection`**. New values: `'vertical' | 'horizontal' | 'grid'`.
- **Rich event objects replace primitive callback arguments**. `onDragStart`, `onDragEnd`, `onDrop`, `onDragOver`, `onDropCancelled` now receive structured `{ item, source, target, … }` objects (`DragStartEvent`, `DropEvent`, `DragEndEvent`, `DragOverEvent`, `DropCancelledEvent`).
- **Per-item drag callbacks removed from `DndDraggable`**. Subscribe via `controller.onDragStart(…)` / `onDrop(…)` / `onDragEnd(…)` / `onDropCancelled(…)` / `onDragOver(…)` instead.
- **Collision API replaces `overlap` prop**. `DndDroppable` now accepts a `collision` prop (or set globally via `DndController({ collision })`) conforming to the `CollisionAlgorithm` contract. Built-ins: `centerPoint` (default), `cursorOver`, `overlap`, `closestCenter`.
- **`overlap()` takes a flat threshold**: `overlap(25)` or `overlap('25%')` instead of the previous object form.
- **`centerPoint` semantics split**: it now tests the ghost's center; the previous cursor-based behaviour is now `cursorOver`.
- **`DndSimulator` class no longer exported**. Use `controller.simulateReturn / simulateDrop / simulateSwap / simulateBatchSwap` instead.
- **`DndState` class no longer exported** (type export remains for advanced use).
- **`--dnd-slot-spacing` CSS variable removed**. Use the reactive `spacing` prop on `DndDroppable` instead.
- **`DropPreview` shape simplified**: `.visible` flag removed (use nullable `DropPreview | null`); ghost-size fields unified into `ghostSize` on the controller.

### Features

- **Grid layout**. `sortable({ layout: 'grid', flow: 'row' | 'column' })` with dedicated grid zone geometry and cross-container slot animations.
- **Sensor system + keyboard accessibility**. Configurable `sensors` on `DndController` (defaults to `[PointerSensor, KeyboardSensor]`) with per-item override on `DndDraggable`. `KeyboardSensor` enables Space/Enter to grab, arrow keys to navigate, Escape to cancel. ARIA live region built into `DndProvider`, plus customizable `announcements` (with `defaultAnnouncements` helper) on `DndController`. Exports: `PointerSensor`, `KeyboardSensor`, `Distance`, `Delay`, plus `SensorDescriptor` / `DistanceConfig` / `DelayConfig` types.
- **Transform modifiers**. Pluggable `Modifier` pipeline on `DndController`. Built-ins: `restrictToVerticalAxis`, `restrictToHorizontalAxis`, `restrictToContainer`, `snapToGrid`.
- **Pluggable collision algorithms** as described above.
- **`onDragOver` event**. Fires when the drag-over target container or position changes.
- **Simulator expansions**. New `simulateSwap` (two-item swap) and `simulateBatchSwap` (FLIP-based multi-item reorder). `simulateReturn` / `simulateDrop` accept `SimulateOptions` with `emitEvents` to fire real `onDrop` / `onDropCancelled`.
- **`stopOnDrop` scroll option** on `ScrollConfig`.
- **Reactive `spacing` prop** on `DndDroppable` (replaces the removed CSS var).
- **Explicit runtime error** when `DndDraggable` / `DndDroppable` render outside a `DndProvider`.

### Bug Fixes

- Slot `position` now syncs reactively with the prop, preventing stale order after `{#each}` reorders.
- Variable-height previews: correct alignment, slot sizing and ghost positioning in both vertical and horizontal lists.
- Cross-container slot size uses the dragged element's own dimensions plus the target container's gap.
- Drop animation no longer resets scroll position; auto-scroll stops cleanly before the ghost flight.
- Drop-animation flags reset on each new drag session so rapid successive drags render correctly.
- Reactive props on `DndDroppable` / `DndDraggable` (`disabled`, `data`, `type`, `accepts`, `collision`, `strategy`, `spacing`, `sensors`) propagate live to the underlying entities.
- Container IDs with special characters work (querySelector escaping).
- `disabled` on `DndDraggable` blocks drag activation in all sensors.
- `KeyboardSensor` deferred listener is cleaned up on destroy.
- Preview `hidePreviewTimeout` cleared on destroy; `clearAll` cleanup regression fixed.
- `data-dnd-scroll` auto-scroll honours scope again; `scheduleRefresh` deduplicated during auto-scroll.

### Internal

- Entity-based architecture (`Draggable`, `Droppable`, `Preview`, `Slot`, `DragSession`) replaces the legacy handler/registrar/session-manager plumbing; strategies read entity state directly rather than traversing the DOM.
- `DndController` split into `DragSessionManager` + `DropAnimationCoordinator` + `TranslationEngine` + `DropResolver`.
- Layout snapshot captured at drag start (transform-free) so reactive transforms never feed back into zone calculations.
- Internal-only surface marked with `@internal`.
- Custom-strategy primitives exposed for advanced use: `AnimationStep`, `InstantStep`, `GhostToTargetStep`, `GhostReturnStep`, `StrategyBindContext`, `ContainerStrategy`, `Droppable`, `DragSession`, `DragSource`.

### Docs

- New pages: sensors, collision, modifiers, accessibility, custom strategies, `DndController` API, simulations.
- Home page redesign.

## [v1.0.0-beta.1] - 2025-04-06

Complete rewrite with a new modular architecture. All previous APIs have changed — see the documentation.

### Breaking Changes
- `DragController` renamed to `DndController`
- `position` is now a required prop on `DndDraggable`
- Type filtering moved from `data={{ type, accepts }}` to dedicated `type` / `accepts` props
- `DndPreview` is no longer used directly — remove all manual placements

### Features
- Drop previews and dragged item visibility handled automatically — no manual `DndPreview`, `hiddenId`, or `visibleItems` needed
- `onDragStart` / `onDragEnd` callbacks no longer return an unsubscribe function — cleanup is automatic
- `DndSimulator` for programmatic drag simulation
- `mode="target"` on `DndDroppable` for non-sortable drop zones (trash, board columns)
- `overlap` prop for intersection-based hit detection
- `onDropCancelled` callback
- `PreviewConfig` and `ScrollConfig` for fine-tuning animations and auto-scroll
- `DndControllerConfig` constructor config on `DndController`
- Touch support: long-press delay, momentum scroll, configurable scroll cancel threshold
- SSR compatibility

### Bug Fixes
- Post-drop translation snap eliminated
- Ghost return animation is scroll-aware
- Drop preview correctly scoped in nested containers
- Drag activation prevented in draggable padding area

### Build
- Migrated to Turborepo monorepo

### Docs
- New docs with live examples

## [v0.3.0] - 2025-02-19

### Features
- Drag handle support via `data-dnd-handle` attribute
- Cursor styling applied to handles only
- Multiple handles per item supported

### Bug Fixes
- Drop zone visibility in debug overlay
- Drag event propagation in nested draggables
- Debug overlay state persistence

### Internal
- Data attributes now use the `data-dnd-` prefix to prevent conflicts with other libraries

### Documentation
- Updated attribute references
- Added drag handle examples
- Expanded FAQ

## [v0.2.0] - 2025-02-17

### Features
- Ghost animation returns to origin with scrolling during cancelled drags
- Auto-scroll functionality scoped to `data-dnd-scroll` attribute

### Bug Fixes
- Mobile support improvements
- Drop zones clipped to visible container viewport boundaries

### Refactoring
- DOM operations and animation logic separated into dedicated modules

## [v0.1.2] - 2025-02-14

No notable changes.

## [v0.1.1] - 2025-02-14

### Bug Fixes
- Fixed placeholder flicker during drag initiation

## [v0.1.0] - 2025-02-14

Initial release.

[v1.0.0]: https://github.com/Horuse/svelte-dnd/compare/v1.0.0-rc.1...v1.0.0
[v1.0.0-rc.1]: https://github.com/Horuse/svelte-dnd/compare/v1.0.0-beta.1...v1.0.0-rc.1
[v1.0.0-beta.1]: https://github.com/Horuse/svelte-dnd/compare/v0.3.0...v1.0.0-beta.1
[v0.3.0]: https://github.com/Horuse/svelte-dnd/compare/v0.2.0...v0.3.0
[v0.2.0]: https://github.com/Horuse/svelte-dnd/compare/v0.1.2...v0.2.0
[v0.1.2]: https://github.com/Horuse/svelte-dnd/compare/v0.1.1...v0.1.2
[v0.1.1]: https://github.com/Horuse/svelte-dnd/compare/v0.1.0...v0.1.1
[v0.1.0]: https://github.com/Horuse/svelte-dnd/releases/tag/v0.1.0
Loading
Loading