Installations
npm install vue-moveable
Score
72.5
Supply Chain
97
Quality
79.4
Maintenance
100
Vulnerability
99.6
License
Releases
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
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
Yes
Node Version
16.14.0
NPM Version
8.3.1
Statistics
10,150 Stars
1,612 Commits
623 Forks
76 Watching
22 Branches
38 Contributors
Updated on 28 Nov 2024
Bundle Size
242.53 kB
Minified
76.55 kB
Minified + Gzipped
Languages
TypeScript (89.82%)
HTML (4.65%)
JavaScript (4.08%)
CSS (0.95%)
Vue (0.4%)
Svelte (0.1%)
Total Downloads
Cumulative downloads
Total Downloads
417,283
Last day
19.2%
354
Compared to previous day
Last week
3.2%
1,468
Compared to previous week
Last month
4.2%
6,251
Compared to previous month
Last year
-16.8%
92,962
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Moveable
Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable
Github / Demo / Storybook / API / Main Project
Moveable | |||
---|---|---|---|
Draggable | Resizable | Scalable | Rotatable |
Warpable | Pinchable | Groupable | Snappable |
Clippable | Roundable | OriginDraggable | Selecto |
🔥 Features
- Draggable refers to the ability to drag and move targets.
- Resizable indicates whether the target's width and height can be increased or decreased.
- Scalable indicates whether the target's x and y can be scale of transform.
- Rotatable indicates whether the target can be rotated.
- Warpable indicates whether the target can be warped (distorted, bented).
- Pinchable indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.
- Groupable indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
- Snappable indicates whether to snap to the guideline.
- OriginDraggable* indicates Whether to drag origin.
- Clippable indicates Whether to clip the target.
- Roundable indicates Whether to show and drag or double click border-radius.
- Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)
- Support Major Browsers
- Support 3d Transform
⚙️ Installation
npm
1$ npm i moveable
scripts
1<script src="//daybrush.com/moveable/release/latest/dist/moveable.min.js"></script>
📄 Documents
🚀 How to use
- All classes of moveable control box and able elements have a
moveable-
prefix. So please don't putmoveable-
class name in target.
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});
📦 Packages
- moveable: A Vanilla Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
- react-moveable: A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
- preact-moveable: A Preact Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
- ngx-moveable: An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
- svelte-moveable: A Svelte Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
- lit-moveable: A Lit Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
- vue-moveable: A Vue Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
- vue3-moveable: A Vue 3 Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
⚙️ Developments
The moveable
repo is managed as a monorepo with yarn
.
1yarn config set registry https://registry.npmjs.org/
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
$ npm run packages:build
$ 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.
⭐️ Show Your Support
Please give a ⭐️ if this project helped you!
👏 Contributing
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.
Code Contributors
This project exists thanks to all the people who contribute. [Contribute].
🐞 Bug Report
If you find a bug, please report to us opening a new Issue on GitHub.
Sponsors
Open Collective Financial Contributors
Become a financial contributor and help us sustain our community. [Contribute]
Individuals
Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
📝 License
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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/run-e2e.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-e2e.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/daybrush/moveable/run-e2e.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-e2e.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/daybrush/moveable/run-e2e.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-e2e.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/daybrush/moveable/run-e2e.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-e2e.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/daybrush/moveable/run-e2e.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 3 are checked with a SAST tool
Reason
127 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-hpx4-r86g-5jrg
- Warn: Project is vulnerable to: GHSA-prr3-c3m5-p7q2
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-9pv7-vfvm-6vr7
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-4wx3-54gh-9fr9
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-8266-84wp-wv5c
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw
- Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986 / GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c75v-2vq8-878f
- Warn: Project is vulnerable to: GHSA-c2jc-4fpr-4vhg
- Warn: Project is vulnerable to: GHSA-mh2x-fcqh-fmqv
- Warn: Project is vulnerable to: GHSA-rjjv-87mx-6x3h
- Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99
- Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m
- Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-8mmm-9v2q-x3f9
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c
- Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q
- Warn: Project is vulnerable to: GHSA-6vfc-qv3f-vr6c
- Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4
- Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653
- Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj
- Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67
- Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w
- Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2
- Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-3965-hpx2-q597
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-fxwf-4rqh-v8g3
- Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj
- Warn: Project is vulnerable to: GHSA-xfhh-g9f5-x4m4
- Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq
- Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9
- Warn: Project is vulnerable to: GHSA-325j-24f4-qv5x
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-g36h-6r4f-3mqp
- Warn: Project is vulnerable to: GHSA-38h8-x697-gh8q
- Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v
- Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx
- Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p
- Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3
- Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq
- Warn: Project is vulnerable to: GHSA-wqq4-5wpv-mx2g
- Warn: Project is vulnerable to: GHSA-3787-6prv-h9w3
- Warn: Project is vulnerable to: GHSA-9qxr-qj54-h672
- Warn: Project is vulnerable to: GHSA-m4v8-wqvr-p9f7
- Warn: Project is vulnerable to: GHSA-mgfv-m47x-4wqp
- Warn: Project is vulnerable to: GHSA-5j4c-8p2g-v4jx
- Warn: Project is vulnerable to: GHSA-g3ch-rx76-35fx
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc
- Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5
- Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.6
/10
Last Scanned on 2024-11-25
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 MoreOther packages similar to vue-moveable
moveable
Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.
react-moveable
A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.
vue3-moveable
A Vue 3 Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.
ngx-moveable
An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.