Skip to content

Commit 7e5a348

Browse files
authored
Merge branch 'master' into master
2 parents e3dbf09 + 9aac903 commit 7e5a348

24 files changed

+8614
-13456
lines changed

.babelrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
extends: [ 'standard', 'standard-react' ],
4+
plugins: [ 'react' ],
5+
rules: {
6+
'jsx-quotes': [ 'error', 'prefer-double' ]
7+
}
8+
}

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
21
# See https://help.github.com/ignore-files/ for more about ignoring files.
32

43
# dependencies
54
node_modules
65

76
# builds
87
build
9-
dist
8+
/dist
9+
/example/dist/index.js
10+
*.tgz
1011

1112
# misc
1213
.DS_Store
@@ -15,6 +16,7 @@ dist
1516
.env.development.local
1617
.env.test.local
1718
.env.production.local
19+
.idea
1820

1921
npm-debug.log*
2022
yarn-debug.log*

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 MockingBot
3+
Copyright (c) 2019 MockingBot
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# React-resizable-rotatable-draggable-rectangle
22

3-
>
4-
53
[![NPM](https://img.shields.io/npm/v/react-resizable-rotatable-draggable.svg)](https://www.npmjs.com/package/react-resizable-rotatable-draggable) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
64

75
A react widget that can be resized and rotated via a handler.
@@ -96,33 +94,32 @@ class App extends Component {
9694
}
9795
9896
export default App
99-
10097
```
10198
10299
### Props
103100
104101
| Props | Type | Default | Example |
105102
|:-----------:|:-----------------------:|:-------:|:-------------------------------------:|
106-
|left | number.isRequired | // | 10 |
107-
|top | number.isRequired | // | 10 |
108-
|width | number.isRequired | // | 100 |
109-
|height | number.isRequired | // | 100 |
103+
|left | number.isRequired | | 10 |
104+
|top | number.isRequired | | 10 |
105+
|width | number.isRequired | | 100 |
106+
|height | number.isRequired | | 100 |
110107
|rotateAngle | number | 0 | 0 |
111108
|rotatable | bool | true | true |
112109
|zoomable | string | '' | 'n, w, s, e, nw, ne, se, sw' |
113110
|minWidth | number | 10 | 0 |
114111
|minHeight | number | 10 | 0 |
115-
|aspectRatio | number (width / height) | // | 1(which makes the rectangle a square) |
116-
|onRotateStart| func | // | // |
117-
|onRotate | func | // | (rotateAngle) |
118-
|onRotateEnd | func | // | // |
119-
|onResizeStart| func | // | // |
120-
|onResize | func | // | (style, isShiftKey, type) |
121-
|onResizeEnd | func | // | // |
122-
|onDragStart | func | // | // |
123-
|onDrag | func | // | (deltaX, deltaY) |
124-
|onDragEnd | func | // | // |
112+
|aspectRatio | number (width / height) | | 1(which makes the rectangle a square) |
113+
|onRotateStart| func | | |
114+
|onRotate | func | | (rotateAngle) |
115+
|onRotateEnd | func | | |
116+
|onResizeStart| func | | |
117+
|onResize | func | | (style, isShiftKey, type) |
118+
|onResizeEnd | func | | |
119+
|onDragStart | func | | |
120+
|onDrag | func | | (deltaX, deltaY) |
121+
|onDragEnd | func | | |
125122
126123
## License
127124
128-
MIT © [Mockingbot](https://github.com/mockingbot)
125+
MIT © [MockingBot](https://github.com/mockingbot)

babel.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
presets: [
3+
[ '@babel/env', { modules: false } ],
4+
'@babel/react'
5+
],
6+
plugins: [
7+
'@babel/proposal-class-properties',
8+
'babel-plugin-styled-components'
9+
]
10+
}

example/dist/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<title>react-resizable-rotatable-draggable</title>
7+
<style>
8+
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; outline-color: #f00; }
9+
html, body, #root { position: absolute; top: 0; left: 0; width: 100vw;height: 100vh; overflow: hidden; }
10+
</style>
11+
</head>
12+
<body>
13+
<noscript>You need to enable JavaScript to run this app.</noscript>
14+
<div id="root"></div>
15+
<script src="./index.js"></script>
16+
<script>window.RRRD.initExample(document.querySelector('#root'))</script>
17+
</body>
18+
</html>

example/index.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)