Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-reorder-list

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-reorder-list - npm Package Compare versions

Comparing version 0.6.4 to 0.6.5

9

dist/hooks.d.ts

@@ -1,10 +0,9 @@

import { MouseEvent, TouchEvent } from "react";
export declare function useDraggable(initValue?: boolean): {
draggable: boolean;
draggableProps: {
onMouseEnter: (event: MouseEvent | TouchEvent) => void;
onMouseLeave: (event: MouseEvent | TouchEvent) => void;
onTouchStart: (event: MouseEvent | TouchEvent) => void;
onTouchEnd: (event: MouseEvent | TouchEvent) => void;
onMouseEnter: () => void;
onMouseLeave: () => void;
onTouchStart: () => void;
onTouchEnd: () => void;
};
};
import { useState } from "react";
export function useDraggable(initValue = false) {
const [draggable, setDraggable] = useState(initValue);
const enableDragging = (event) => {
event.stopPropagation();
setDraggable(true);
};
const disableDragging = (event) => {
event.stopPropagation();
setDraggable(false);
};
const enableDragging = () => setDraggable(true);
const disableDragging = () => setDraggable(false);
const draggableProps = { onMouseEnter: enableDragging, onMouseLeave: disableDragging, onTouchStart: enableDragging, onTouchEnd: disableDragging };
return { draggable, draggableProps };
}

@@ -93,3 +93,2 @@ var __rest = (this && this.__rest) || function (s, e) {

}, onDragEnd: handleDragEnd, onTouchMove: (event) => {
event.stopPropagation();
if (start === -1)

@@ -123,4 +122,3 @@ return;

return (React.createElement("div", Object.assign({ ref: ref, draggable: draggable }, props, (!useOnlyIconToDrag && draggableProps), { onTouchEnd: (event) => {
event.stopPropagation();
draggableOnTouchEnd(event);
draggableOnTouchEnd();
propOnTouchEnd(event);

@@ -127,0 +125,0 @@ } }), recursiveChildren));

{
"name": "react-reorder-list",
"version": "0.6.4",
"version": "0.6.5",
"description": "A simple react component that facilitates the reordering of JSX/HTML elements through drag-and-drop functionality, allowing for easy position changes.",

@@ -32,3 +32,3 @@ "type": "module",

"devDependencies": {
"@types/react": "^18.2.54"
"@types/react": "^18.2.55"
},

@@ -35,0 +35,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc