Gathering detailed insights and metrics for croact-moveable-kk
Gathering detailed insights and metrics for croact-moveable-kk
npm install croact-moveable-kk
Typescript
Module System
Node Version
NPM Version
0.53.0 Release (2023-12-03)
Updated on Dec 03, 2023
0.52.0 Release (2023-10-28)
Updated on Oct 28, 2023
0.51.2 Release (2023-09-20)
Updated on Sep 19, 2023
0.51.1 Release (2023-07-12)
Updated on Jul 11, 2023
0.51.0 Release (2023-07-09)
Updated on Jul 09, 2023
0.50.2 Release (2023-07-05)
Updated on Jul 04, 2023
TypeScript (89.82%)
HTML (4.65%)
JavaScript (4.08%)
CSS (0.95%)
Vue (0.4%)
Svelte (0.1%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
411
Last Day
1
Last Week
1
Last Month
20
Last Year
189
MIT License
10,250 Stars
1,612 Commits
637 Forks
76 Watchers
22 Branches
38 Contributors
Updated on Feb 13, 2025
Minified
Minified + Gzipped
Latest Version
0.0.3
Package Id
croact-moveable-kk@0.0.3
Unpacked Size
1.17 MB
Size
217.57 kB
File Count
14
NPM Version
9.6.7
Node Version
18.17.0
Published on
Nov 22, 2023
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
-75%
1
Compared to previous week
Last Month
122.2%
20
Compared to previous month
Last Year
-14.9%
189
Compared to previous year
14
1
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 |
![]() | ![]() | ![]() | ![]() |
1$ npm i moveable
1<script src="//daybrush.com/moveable/release/latest/dist/moveable.min.js"></script>
moveable-
prefix. So please don't put moveable-
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});
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.
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.
Become a financial contributor and help us sustain our community. [Contribute]
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
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
136 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-10
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