svelte-drag-drop-touch
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "svelte-drag-drop-touch", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "HTML5 Drag-and-Drop support for mobile devices", | ||
"type": "module", | ||
"module": "./dist/svelte-drag-drop-touch.esm.js", | ||
"svelte": "./dist/svelte-drag-drop-touch.esm.js", | ||
"svelte": "./dist/svelte-drag-drop-touch.svelte.js", | ||
"exports": { | ||
@@ -13,3 +13,3 @@ "import": "./dist/svelte-drag-drop-touch.esm.js" | ||
"scripts": { | ||
"build": "rimraf dist && tsc && rollup -c rollup.config.js && mv src/*.d.ts dist && rm src/*.js", | ||
"build": "rimraf dist && tsc && rollup -c rollup.config.js && mv src/*.d.ts dist && mv src/*.js ./dist/svelte-drag-drop-touch.svelte.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -16,0 +16,0 @@ }, |
@@ -9,2 +9,6 @@ # svelte-drag-drop-touch # | ||
`svelte-drag-drop-touch` may be used as an ESM, CommonJS or AMD module or from a global variable. | ||
You may either install the package into your build environment using [NPM](https://docs.npmjs.com/) with the command | ||
``` | ||
@@ -14,6 +18,14 @@ npm install svelte-drag-drop-touch | ||
## Usage ## | ||
or load the plain script file directly | ||
``` | ||
<script> | ||
<script src="https://unpkg.com/svelte-drag-drop-touch"></script> | ||
``` | ||
## Access ## | ||
When used with Svelte, you should always import the package in a module context: | ||
``` | ||
<script context="module"> | ||
import DragDropTouch from 'svelte-drag-drop-touch' | ||
@@ -23,4 +35,10 @@ </script> | ||
from then on, HTML5 Drag-and-Drop may also be used on mobile devices. | ||
Otherwise, the kind of import depends on the type of module you prefer. | ||
* ESM: `import DragDropTouch from 'svelte-drag-drop-touch'` | ||
* CommonJS: `const DragDropTouch = require('svelte-drag-drop-touch')` | ||
* AMD: `require(['svelte-drag-drop-touch'], (DragDropTouch) => {...})` | ||
In any case, a simple import is all you need to use HTML5 Drag-and-Drop on mobile devices - (apart from handling DragEvents) there is no extra programming required. | ||
## Example ## | ||
@@ -27,0 +45,0 @@ |
39503
11
126
77