Gathering detailed insights and metrics for moveable
Gathering detailed insights and metrics for moveable
Gathering detailed insights and metrics for moveable
Gathering detailed insights and metrics for moveable
npm install moveable
Typescript
Module System
Node Version
NPM Version
95.7
Supply Chain
98.1
Quality
76.2
Maintenance
100
Vulnerability
99.6
License
0.53.0 Release (2023-12-03)
Published on 03 Dec 2023
0.52.0 Release (2023-10-28)
Published on 28 Oct 2023
0.51.2 Release (2023-09-20)
Published on 19 Sept 2023
0.51.1 Release (2023-07-12)
Published on 11 Jul 2023
0.51.0 Release (2023-07-09)
Published on 09 Jul 2023
0.50.2 Release (2023-07-05)
Published on 04 Jul 2023
TypeScript (89.82%)
HTML (4.65%)
JavaScript (4.08%)
CSS (0.95%)
Vue (0.4%)
Svelte (0.1%)
Total Downloads
3,176,123
Last Day
2,797
Last Week
21,024
Last Month
104,884
Last Year
1,039,049
10,190 Stars
1,612 Commits
628 Forks
76 Watching
22 Branches
38 Contributors
Minified
Minified + Gzipped
Latest Version
0.53.0
Package Id
moveable@0.53.0
Unpacked Size
2.32 MB
Size
512.99 kB
File Count
29
NPM Version
8.3.1
Node Version
16.14.0
Publised On
03 Dec 2023
Cumulative downloads
Total Downloads
Last day
-43.6%
2,797
Compared to previous day
Last week
-19.1%
21,024
Compared to previous week
Last month
4%
104,884
Compared to previous month
Last year
-9.1%
1,039,049
Compared to previous year
Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable
Demo / Storybook / API / Main Project
Moveable | |||
---|---|---|---|
Draggable | Resizable | Scalable | Rotatable |
Warpable | Pinchable | Groupable | Snappable |
Clippable | Roundable | OriginDraggable | Selecto |
1$ npm i moveable
1<script src="//daybrush.com/moveable/release/latest/dist/moveable.min.js"></script>
1import Moveable from "moveable"; 2 3const moveable = new Moveable(document.body, { 4 target: document.querySelector(".target"), 5 // If the container is null, the position is fixed. (default: parentElement(document.body)) 6 container: document.body, 7 draggable: true, 8 resizable: true, 9 scalable: true, 10 rotatable: true, 11 warpable: true, 12 // Enabling pinchable lets you use events that 13 // can be used in draggable, resizable, scalable, and rotateable. 14 pinchable: true, // ["resizable", "scalable", "rotatable"] 15 origin: true, 16 keepRatio: true, 17 // Resize, Scale Events at edges. 18 edge: false, 19 throttleDrag: 0, 20 throttleResize: 0, 21 throttleScale: 0, 22 throttleRotate: 0, 23}); 24/* draggable */ 25moveable.on("dragStart", ({ target, clientX, clientY }) => { 26 console.log("onDragStart", target); 27}).on("drag", ({ 28 target, transform, 29 left, top, right, bottom, 30 beforeDelta, beforeDist, delta, dist, 31 clientX, clientY, 32}) => { 33 console.log("onDrag left, top", left, top); 34 target!.style.left = `${left}px`; 35 target!.style.top = `${top}px`; 36 // console.log("onDrag translate", dist); 37 // target!.style.transform = transform; 38}).on("dragEnd", ({ target, isDrag, clientX, clientY }) => { 39 console.log("onDragEnd", target, isDrag); 40}); 41 42/* resizable */ 43moveable.on("resizeStart", ({ target, clientX, clientY }) => { 44 console.log("onResizeStart", target); 45}).on("resize", ({ target, width, height, dist, delta, clientX, clientY }) => { 46 console.log("onResize", target); 47 delta[0] && (target!.style.width = `${width}px`); 48 delta[1] && (target!.style.height = `${height}px`); 49}).on("resizeEnd", ({ target, isDrag, clientX, clientY }) => { 50 console.log("onResizeEnd", target, isDrag); 51}); 52 53/* scalable */ 54moveable.on("scaleStart", ({ target, clientX, clientY }) => { 55 console.log("onScaleStart", target); 56}).on("scale", ({ 57 target, scale, dist, delta, transform, clientX, clientY, 58}: OnScale) => { 59 console.log("onScale scale", scale); 60 target!.style.transform = transform; 61}).on("scaleEnd", ({ target, isDrag, clientX, clientY }) => { 62 console.log("onScaleEnd", target, isDrag); 63}); 64 65/* rotatable */ 66moveable.on("rotateStart", ({ target, clientX, clientY }) => { 67 console.log("onRotateStart", target); 68}).on("rotate", ({ target, beforeDelta, delta, dist, transform, clientX, clientY }) => { 69 console.log("onRotate", dist); 70 target!.style.transform = transform; 71}).on("rotateEnd", ({ target, isDrag, clientX, clientY }) => { 72 console.log("onRotateEnd", target, isDrag); 73}); 74 75/* warpable */ 76this.matrix = [ 77 1, 0, 0, 0, 78 0, 1, 0, 0, 79 0, 0, 1, 0, 80 0, 0, 0, 1, 81]; 82moveable.on("warpStart", ({ target, clientX, clientY }) => { 83 console.log("onWarpStart", target); 84}).on("warp", ({ 85 target, 86 clientX, 87 clientY, 88 delta, 89 dist, 90 multiply, 91 transform, 92}) => { 93 console.log("onWarp", target); 94 // target.style.transform = transform; 95 this.matrix = multiply(this.matrix, delta); 96 target.style.transform = `matrix3d(${this.matrix.join(",")})`; 97}).on("warpEnd", ({ target, isDrag, clientX, clientY }) => { 98 console.log("onWarpEnd", target, isDrag); 99}); 100 101/* pinchable */ 102// Enabling pinchable lets you use events that 103// can be used in draggable, resizable, scalable, and rotateable. 104moveable.on("pinchStart", ({ target, clientX, clientY }) => { 105 // pinchStart event occur before dragStart, rotateStart, scaleStart, resizeStart 106 console.log("onPinchStart"); 107}).on("pinch", ({ target, clientX, clientY, datas }) => { 108 // pinch event occur before drag, rotate, scale, resize 109 console.log("onPinch"); 110}).on("pinchEnd", ({ isDrag, target, clientX, clientY, datas }) => { 111 // pinchEnd event occur before dragEnd, rotateEnd, scaleEnd, resizeEnd 112 console.log("onPinchEnd"); 113});
The moveable
repo is managed as a monorepo with yarn
.
The main project was made with react
and I used croact
to make it lighter with umd.
For development and testing, check in packages/react-moveable.
npm run storybook
$ yarn install
$ npm run bootstrap
$ npm run storybook
Runs the app in the development mode.
Open http://localhost:6006 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Please give a ⭐️ if this project helped you!
If you have any questions or requests or want to contribute to moveable
or other packages, please write the issue or give me a Pull Request freely.
This project exists thanks to all the people who contribute. [Contribute].
If you find a bug, please report to us opening a new Issue on GitHub.
This project is MIT licensed.
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
129 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More