Skip to content

Releases: TahaSh/swapy

v1.0.3

20 Dec 13:43
Compare
Choose a tag to compare
  • Allow scroll on non-handle elements. (#47)

v1.0.2

16 Dec 07:56
Compare
Choose a tag to compare
  • Fix setting width on swap. (#97)
  • Fix swapping for items containing SVG elements. (#97)
  • Fix an item's position when parent elements use CSS transform: translate. (#54)
  • Fix data-swapy-dragging when swapping with manualSwap.

v1.0.1

14 Dec 16:55
Compare
Choose a tag to compare
  • Fix click interactions in items. (#101)

v1.0.0

14 Dec 08:29
Compare
Choose a tag to compare

I’m excited to announce that v1.0.0 is a complete rewrite of Swapy, with lots of new features, performance improvements, and bug fixes.

What's New:

  • New Full Docs – Check out the new, detailed documentation to learn everything you need about Swapy.
  • Minor API Tweaks – Some event objects have been updated for better consistency and clarity. Check out the events section to learn about them.
  • Zero Dependencies – Swapy is now fully written in pure JS with no external dependencies (without Veloxi).
  • New Config Options – Added dragOnHold, dragAxis, and enabled to give you more control over your setup.
  • Non-Draggable Areas – You can now specify areas in your items that are not draggable. Check out no-drag attribute.
  • Dynamic Updates – Use the new update method to refresh your Swapy instance dynamically as the DOM changes.
  • Swap Control – Now you can easily enable or disable swaps dynamically with onBeforeSwap.
  • Custom Drag Styling – Customize your drag item styles using the new [data-swapy-dragging] CSS selector.
  • Easier Framework Integration – New utility functions to seamlessly integrate with frameworks and dynamically add/remove items.
  • Dual Licensing – I’ve switched to a dual license model: GPLv3 and Commercial. Read more about the licensing.

I hope you find these updates useful! As always, feel free to reach out with feedback or questions.

v0.4.2

08 Oct 17:13
Compare
Choose a tag to compare
  • Clean up event listeners when swapping with manualSwap. (#70)

v0.4.1

30 Sep 16:55
Compare
Choose a tag to compare
  • Fix hasChanged in swapEnd event (#58)

v0.4.0

30 Sep 15:25
Compare
Choose a tag to compare

This version supports auto-scrolling while dragging.

Features

autoScrollOnDrag (#73)

Enabling autoScrollOnDrag in Swapy's config options will cause the page or container to auto-scroll when dragging an item near the edge.

createSwapy(container, {
  autoScrollOnDrag: true
})

Add hasChanged to swapEnd event (#58)

The swapEnd event object now includes a new parameter, hasChanged, which indicates whether any items were swapped during the drag session.

swapy.onSwapEnd(({ data, hasChanged }) => {
  console.log(hasChanged);
  console.log('end', data);
})

Fixes

  • Fix drag jump for moved parent (#59)
  • Fix scrolling while dragging items (#30)
  • Prevent swapEnd event on click without dragging (#67, #58)
  • Fix swapy.enable() on component remount (when using React's strict mode for example) (#68)

v0.3.1

21 Sep 16:59
Compare
Choose a tag to compare
  • Fix conflict between drop swap mode and continuous mode.
  • Prevent the swapEnd event from firing multiple times per dragging session.

v0.3.0

21 Sep 15:11
Compare
Choose a tag to compare

This version introduces swap modes and new swap events.

Features

swapMode (#53, #31)

Swapy now has 3 different swapping modes: hover, stop, and drop.

  • hover (default): swaps items as soon as you hover over slots.
  • stop: swaps items when you hover over a slot and stop moving the cursor.
  • drop: swaps the item when you drop it over a slot.

Example:

createSwapy(container, { swapMode: 'drop' })

Note: Before this version, the stop mode was enabled by disabling continuousMode. It’s now recommended to use swapMode: 'stop' instead, as continuousMode will soon be deprecated.

New swap events (#58, #64)

swapy.onSwapEnd((event) => {}): fires when you drop the item. It will include the last slot items' order in the event.data object.

swapy.onSwapStart(() => {}): fires when you start dragging any item. It will only trigger once per dragging session.

Fixes

  • Fix dragging position for items with handles. (#65)
  • Export swap event types. (#62)
  • Replace SwapyApi with Swapy interface.

v0.2.1

09 Sep 16:22
Compare
Choose a tag to compare
  • Fix calling swapy.setData() error when the Swapy instance is being installed.
  • Add missing TypeScript types.