Socket
Socket
Sign inDemoInstall

@shopify/draggable

Package Overview
Dependencies
Maintainers
25
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/draggable - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

build/cjs/Draggable/DragEvent/DragEvent.js

51

package.json
{
"name": "@shopify/draggable",
"version": "1.0.1",
"version": "1.1.0",
"private": false,

@@ -25,3 +25,6 @@ "license": "MIT",

],
"main": "./lib/draggable.bundle.js",
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
"esnext": "build/esnext/index.esnext",
"umd": "build/umd/index.js",
"types": "./index.d.ts",

@@ -31,16 +34,14 @@ "scripts": {

"build": "yarn build:production",
"watch": "ts-node --project='./scripts/tsconfig.json' ./scripts/watch.ts",
"watch": "yarn build:development --watch",
"release": "yarn run build:production && changeset publish",
"lint": "eslint ./src ./scripts ./test --max-warnings 0",
"type-check": "tsc --noEmit",
"type-check:scripts": "tsc --noEmit --project scripts",
"lint": "eslint ./src ./test --max-warnings 0",
"type-check": "tsc -b",
"esdoc": "esdoc -c esdoc.json",
"test": "jest",
"test-ci": "jest --coverage && codecov",
"build:development": "ts-node --project='./scripts/tsconfig.json' ./scripts/build.ts",
"build:production": "ts-node --project='./scripts/tsconfig.json' ./scripts/build.ts --production",
"verify": "yarn lint && yarn type-check && yarn type-check:scripts && yarn build && yarn test"
"build:development": "yarn rollup --config rollup.development.config.ts --configPlugin @rollup/plugin-typescript",
"build:production": "tsc && yarn rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript && yarn uglifyjs --compress --mangle -- build/umd/index.js -o build/umd/index.min.js",
"verify": "yarn lint && yarn type-check && yarn build && yarn test"
},
"files": [
"lib/**/*.js",
"build/**/*",
"index.d.ts"

@@ -53,2 +54,6 @@ ],

"@microsoft/tsdoc": "^0.14.2",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-typescript": "^11.1.4",
"@shopify/babel-preset": "^25.0.0",

@@ -60,4 +65,2 @@ "@shopify/eslint-plugin": "^43.0.0",

"@types/node": "^20.6.3",
"@types/webpack": "^5.28.2",
"@types/webpack-bundle-analyzer": "^4.6.0",
"babel-jest": "^29.7.0",

@@ -68,3 +71,2 @@ "babel-loader": "^9.1.3",

"concurrently": "^3.5.1",
"core-js": "^3.32.2",
"esdoc": "^1.1.0",

@@ -78,10 +80,9 @@ "esdoc-ecmascript-proposal-plugin": "^1.0.0",

"prettier": "^3.0.3",
"rollup": "^3.29.3",
"rollup-plugin-includepaths": "^0.2.4",
"rollup-plugin-node-externals": "^6.1.1",
"timers": "^0.1.1",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-bundle-analyzer": "^4.9.1",
"webpack-cli": "^5.1.4"
"uglify-js": "^3.17.4"
},

@@ -91,3 +92,13 @@ "publishConfig": {

"@shopify:registry": "https://registry.npmjs.org"
}
},
"browserslist": [
"last 3 chrome versions",
"last 3 firefox versions",
"last 3 opera versions",
"last 3 edge versions",
"last 3 safari versions",
"last 3 chromeandroid versions",
"last 1 firefoxandroid versions",
"ios >= 13.4"
]
}

@@ -1,4 +0,2 @@

[![npm version](https://badge.fury.io/js/%40shopify%2Fdraggable.svg)](https://badge.fury.io/js/%40shopify%2Fdraggable)
[![codecov](https://codecov.io/gh/Shopify/draggable/branch/master/graph/badge.svg)](https://codecov.io/gh/Shopify/draggable)
[![Greenkeeper badge](https://badges.greenkeeper.io/Shopify/draggable.svg)](https://greenkeeper.io/)
[![npm version](https://img.shields.io/npm/v/@shopify/draggable.svg?label=@shopify/draggable)](https://www.npmjs.com/package/@shopify/draggable) [![CI](https://github.com/shopify/draggable/workflows/CI/badge.svg)](https://github.com/Shopify/draggable/actions?query=branch%3Amain) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Shopify/draggable/blob/main/CONTRIBUTING.md) ![Bundle size](https://img.shields.io/badge/Bundle%20size-16.2kB-red.svg)

@@ -43,7 +41,5 @@ <a href="https://shopify.github.io/draggable" title="Visit Draggable website">

**NOTE**: When installing with npm or yarn, `@shopify/draggable@1.0.0-beta.8` will be installed by default. If you want to install the latest version, please install `@shopify/draggable@1.0.0-beta.13` or `@shopify/draggable@next`.
You can install the library via npm.
```
```bash
npm install @shopify/draggable --save

@@ -54,3 +50,3 @@ ```

```
```bash
yarn add @shopify/draggable

@@ -63,15 +59,35 @@ ```

<!-- Entire bundle -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.13/lib/draggable.bundle.js"></script>
<!-- legacy bundle for older browsers (IE11) -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.13/lib/draggable.bundle.legacy.js"></script>
<script type="module">
import {
Draggable,
Sortable,
Droppable,
Swappable,
} from 'https://cdn.jsdelivr.net/npm/@shopify/draggable/build/esm/index.js';
</script>
<!-- Draggable only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.13/lib/draggable.js"></script>
<script type="module">
import Draggable from 'https://cdn.jsdelivr.net/npm/@shopify/draggable/build/esm/Draggable/Draggable.js';
</script>
<!-- Sortable only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.13/lib/sortable.js"></script>
<script type="module">
import Sortable from 'https://cdn.jsdelivr.net/npm/@shopify/draggable/build/esm/Sortable/Sortable.js';
</script>
<!-- Droppable only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.13/lib/droppable.js"></script>
<script type="module">
import Droppable from 'https://cdn.jsdelivr.net/npm/@shopify/draggable/build/esm/Droppable/Droppable.js';
</script>
<!-- Swappable only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.13/lib/swappable.js"></script>
<script type="module">
import Swappable from 'https://cdn.jsdelivr.net/npm/@shopify/draggable/build/esm/Swappable/Swappable.js';
</script>
<!-- Plugins only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.13/lib/plugins.js"></script>
<script type="module">
import * as Plugins from 'https://cdn.jsdelivr.net/npm/@shopify/draggable/build/esm/Plugins/index.js';
</script>
<!-- UMD browser -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/draggable/build/umd/index.min.js"></script>
<script>
console.log(window.Draggable);
</script>
```

@@ -81,21 +97,8 @@

| ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Latest ✔ | Latest ✔ | 11+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
Check the "browserlist" property in [package.json](https://github.com/Shopify/draggable/blob/main/package.json#L88) for more info
## Bundle sizes
| ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Last 3 versions ✔ | Last 3 versions ✔ | Last 3 versions ✔ | Last 3 versions ✔ | Last 3 versions ✔ |
| Package name | ES6 bundle sizes | ES5 bundle sizes |
| -------------------------- | ---------------- | ---------------- |
| draggable.bundle.js | ~11kb | ~19.2kb |
| draggable.bundle.legacy.js | ~19.2kb | ~25.63kb |
| draggable.js | ~8.06kb | ~15.36kb |
| sortable.js | ~8.93kb | ~16.51kb |
| swappable.js | ~8.56kb | ~16.14kb |
| droppable.js | ~8.8kb | ~16.55kb |
| plugins.js | ~2.37kb | ~8.76kb |
| plugins/collidable.js | ~1.45kb | ~7.81kb |
| plugins/snappable.js | ~1.19kb | ~6.94kb |
| plugins/swap-animation.js | ~1kb | ~6.65kb |
## Documentation

@@ -128,3 +131,3 @@

- [SwapAnimation](src/Plugins/SwapAnimation)
- [SortAnimation](src/Plugins/SortAnimation) (Added in: v1.0.0-beta.10)
- [SortAnimation](src/Plugins/SortAnimation)
- [Sortable](src/Sortable)

@@ -135,6 +138,4 @@ - [SortableEvent](src/Sortable/SortableEvent)

## TypeScript
### TypeScript
(Added in: v1.0.0-beta.9)
Draggable includes [TypeScript](http://typescriptlang.org) definitions.

@@ -148,3 +149,3 @@

```
```bash
yarn && yarn start

@@ -160,8 +161,4 @@ ```

For more information, please checkout the [contributing document](https://github.com/Shopify/draggable/blob/master/CONTRIBUTING.md).
For more information, please checkout the [contributing document](https://github.com/Shopify/draggable/blob/main/CONTRIBUTING.md).
## Roadmap
We are currently working on `v1.0.0-beta.12`. Check out the [project board](https://github.com/Shopify/draggable/projects/3) to see tasks and follow progress on the release. Any Pull Requests should be pointed against the feature branch `v1.0.0-beta.12`.
## Related resources

@@ -174,2 +171,2 @@

Copyright (c) 2018 Shopify. See LICENSE.md for further details.
Copyright (c) 2018-present Shopify. See LICENSE.md for further details.
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