npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-drop-zone

v1.0.24

Published

React Native module for drag-n-drop function on iOS

Downloads

1,107

Readme

React Native Drop Zone

React Native Drop Zone makes it easy to support across-app drag-n-drop function to your iOS App! It uses UIDropInteraction & UIDragInteraciton, which makes it comprehensive and simple to use.

Features

  • [x] Native iOS Drag & Drop Session Implemented in Swift
  • [x] Multiple Files Dropping
  • [x] Support Multiple Drag Items
  • [x] Customized Preview for Dragged Items
  • [x] Six Drop Events & Three Drag Events
  • [x] Six Drop Item Types & Three Drag Item Types
  • [x] Edit Droppable Data Types

Installation

1. Install react-native-drop-zone

npm install react-native-drop-zone --save

2. Link to the library to your project

react-native link react-native-drop-zone

3. Go to your ios folder and run

pod install

Demo

Dropping Multiple Files

Dropping Text & Image

Dragging Image

Dragging Text & URL

Customized Preview for Dragging

Run Example

1. Download Example

git clone https://github.com/WeTransfer/react-native-drop-zone.git

2. Building the JavaScript components

cd react-native-drop-zone/Example
npm install

3. Launching the Packager

npm start

4. Run the project on iPad

Open the .xcworkspace file in the ios folder. Run and build the project on XCode (iPad) to check out our example.

Requirements

  • Swift 5.0
  • iOS 11.0+

Usage

Quick Start

Drop

<DropZone
  onDragOver={onDragOver}
  onDrop={onDrop}
  allowedDataTypes={['text', 'url', 'image']}
>
</DropZone>

onDrop(data: {[type: string]: any}) {
  console.log(data);
}
onDragOver(point: any) {
  console.log(point);
}

Drag

<DragView
  context={['Hello World', 'www.apple.com']}
></DragView>

// Customized Preview
<DragView
	dragPreview={<Text>Hellow World</Text>}
  context={['Hello World']}
></DragView>

Drop Props

| Name | Type | Description | Default | | :--------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :------------: | | allowedDataTypes | string[] | Array of data types that are allowed in the dropping session | All Data Types | | onDragEnter | function({dropPoint: {x: number, y: number}}) | The drop session has moved into the drop interaction's view | N/A | | onDragOver | function({dropPoint: {x: number, y: number}}) | The drop session has changed | N/A | | onDragLeave | function() | The drop session has moved out of the drop interaction's view | N/A | | onDragExit | function() | The drop session has ended | N/A | | onProcessingDrop | function({dropPoint: {x: number, y: number}}) | It starts to processing the data from the drag items. | N/A | | onDrop | function({data: {dropPoint: {x: number, y: number}}, texts: string[], urls: string[], files: string[]}) | It completes processing the data from the drag items | N/A |

Drag Props

| Name | Type | Description | Default | | :---------: | :---------------------------------------------: | :----------------------------------------------------------: | :-----: | | context | string[] | Array of drag items | N/A | | onDragBegin | function() | The lift animation has finished and the user is starting to move the items across the screen. | N/A | | onDragOver | function({dropPoint: {x: number, y: number}}) | The user starts to move the drag items | N/A | | OnDragEnd | function() | The drag activity and its related animations have finished. | N/A | | dragPreview | React.ReactNode | Customized preview for dragged items | N/A |

Available Data Types

  • Drop

    Text, URL, Image, Video, Audio, Other

  • Drag

    Text, URL, Image

Documentation

Contributing

As the creators, and maintainers of this project, we're glad to invite contributors to help us stay up to date. Please take a moment to review the contributing document in order to make the contribution process easy and effective for everyone involved.

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

License

React Native Drop Zone is available under the Hippocratic-2.1 license. See the LICENSE file for more info.