Skip to content

Commit abd40b1

Browse files
committed
Merge pull request #3 from tbolis/react-15-upgrade
Upgrading to latest libraries
2 parents 0f52008 + 200b47c commit abd40b1

File tree

9 files changed

+90
-51
lines changed

9 files changed

+90
-51
lines changed

.babelrc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
{
2-
"stage": 1
3-
}
2+
"presets": [
3+
"es2015",
4+
"react",
5+
"stage-0"
6+
],
7+
"env": {
8+
"development": {
9+
"presets": [
10+
"react-hmre"
11+
]
12+
}
13+
},
14+
"plugins": [
15+
"transform-runtime",
16+
"transform-object-assign",
17+
"transform-react-display-name"
18+
]
19+
}

.eslintrc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
22
"parser": "babel-eslint",
33
"plugins": [
4-
"react"
4+
"react",
5+
"eslint-plugin-react"
56
],
67
"ecmaFeatures": {
7-
"defaultParams": true,
8-
"modules": true,
9-
"jsx": true
8+
"jsx": true,
9+
"modules": true
1010
},
1111
"env": {
1212
"browser": true,
1313
"amd": true,
1414
"es6": true,
15-
"mocha": true,
16-
"phantomjs": true,
17-
"node": true
15+
"node": false
1816
},
1917
"rules": {
2018
"comma-dangle": 1,
@@ -26,6 +24,7 @@
2624
"global-strict": 0,
2725
"no-extra-semi": 1,
2826
"no-underscore-dangle": 0,
27+
"no-extra-parens": 0,
2928
"no-console": 1,
3029
"no-unused-vars": 1,
3130
"no-trailing-spaces": [
@@ -34,8 +33,9 @@
3433
"skipBlankLines": true
3534
}
3635
],
37-
"no-unreachable": 1,
3836
"no-alert": 0,
39-
"react/jsx-uses-react": 1
37+
"no-unreachable": 1,
38+
"react/jsx-uses-react": 1,
39+
"react/jsx-uses-vars": 1
4040
}
4141
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
## Changelog
22

33

4+
* **0.2.3** Upgrading to latest libraries
5+
- Major
6+
- React 15.0.1
7+
- Fabric 1.6.0
8+
- Other
9+
- babel
10+
- react-color
11+
- etc.
412
* **0.2.2** Minor bug fixes and improvements release
513
* **0.2.1** Bundling fabric to the library, to avoid complexity by adding it as external dependency
614
* **0.2.0** Adding FabricJS as the core of the sketch field

examples/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<title>{%= o.htmlWebpackPlugin.options.title %}</title>
7+
<title><%= htmlWebpackPlugin.options.title %></title>
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<meta name="keywords" content="{%= o.htmlWebpackPlugin.options.keywords %}">
1010
<meta name="description" content="{%= o.htmlWebpackPlugin.options.description %}">

examples/main.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'use strict';
33

44
import React from 'react';
5-
import ColorPicker from 'react-color';
5+
import {CompactPicker} from 'react-color';
66

77
import 'flexboxgrid';
88
import './main.css';
@@ -40,7 +40,7 @@ const styles = {
4040
gridList: {
4141
width: '100%',
4242
overflowY: 'auto',
43-
marginBottom: 24
43+
marginBottom: '24px'
4444
},
4545
gridTile: {
4646
backgroundColor: '#fcfcfc'
@@ -287,16 +287,17 @@ class SketchFieldDemo extends React.Component {
287287
<CardTitle title='Colors'/>
288288
<CardText>
289289
<label htmlFor='lineColor'>Line</label>
290-
<ColorPicker ref='lineColor' type='compact' color={this.state.lineColor}
291-
onChange={(color) => this.setState({lineColor:'#'+color.hex})}/>
290+
<CompactPicker
291+
id='lineColor' color={this.state.lineColor}
292+
onChange={(color) => this.setState({lineColor:'#'+color.hex})}/>
292293
<br/>
293294
<br/>
294295
<Toggle label="Fill"
295296
defaultToggled={this.state.fillWithColor}
296297
onToggle={(e) => this.setState({fillWithColor:!this.state.fillWithColor})}/>
297-
<ColorPicker type="compact"
298-
color={this.state.fillColor}
299-
onChange={(color) => this.setState({fillColor:'#'+color.hex})}/>
298+
<CompactPicker
299+
color={this.state.fillColor}
300+
onChange={(color) => this.setState({fillColor:'#'+color.hex})}/>
300301
</CardText>
301302
</Card>
302303
</div>

examples/run.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
'use strict';
2+
13
(function () {
24
let React = require('react');
35
let ReactDOM = require('react-dom');
46
let injectTapEventPlugin = require('react-tap-event-plugin');
57

6-
let Demo = require('./main');
8+
let Demo = require('./main').default;
79

810
// Needed for React Developer Tools (Chrome Extension)
911
window.React = React;

karma.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ const path = require('path');
33
const srcPath = path.join(__dirname, 'src');
44
const testPath = path.join(__dirname, 'test');
55

6+
// Set environment to testing
7+
process.env.NODE_ENV = 'testing';
8+
69
module.exports = function (config) {
710
config.set({
811
basePath: './',

package.json

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-sketch",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Sketch Element for React based applications, backed-up by fabricjs as its core",
55
"keywords": [
66
"react",
@@ -39,49 +39,58 @@
3939
"node": ">0.4.0 <1.0.0"
4040
},
4141
"peerDependencies": {
42-
"react": "^0.14.7",
43-
"react-dom": "^0.14.7"
42+
"react": "^15.0.1",
43+
"react-dom": "^15.0.1"
4444
},
4545
"devDependencies": {
46-
"babel": "^5.0.0",
47-
"babel-core": "^5.0.0",
48-
"babel-eslint": "^4.1.6",
49-
"babel-loader": "^5.0.0",
46+
"babel-cli": "^6.7.7",
47+
"babel-core": "^6.7.7",
48+
"babel-eslint": "^6.0.4",
49+
"babel-loader": "^6.2.4",
50+
"babel-plugin-transform-object-assign": "^6.5.0",
51+
"babel-plugin-transform-react-display-name": "^6.5.0",
52+
"babel-plugin-transform-runtime": "^6.7.5",
53+
"babel-preset-react-hmre": "^1.0.1",
54+
"babel-polyfill": "^6.7.4",
55+
"babel-preset-es2015": "^6.6.0",
56+
"babel-preset-es2015-loose": "^7.0.0",
57+
"babel-preset-react": "^6.5.0",
58+
"babel-preset-stage-0": "^6.5.0",
5059
"canvas": "^1.3.12",
51-
"chai": "^3.4.1",
52-
"core-js": "^2.0.3",
60+
"chai": "^3.5.0",
61+
"core-js": "^2.3.0",
5362
"css-loader": "^0.23.1",
54-
"eslint": "^1.2.1",
55-
"eslint-loader": "^1.0.0",
56-
"eslint-plugin-react": "^3.3.0",
57-
"fabric": "^1.5.0",
63+
"eslint": "^2.8.0",
64+
"eslint-loader": "^1.3.0",
65+
"eslint-plugin-react": "^5.0.1",
66+
"fabric": "^1.6.0",
5867
"flexboxgrid": "^6.3.0",
59-
"html-webpack-plugin": "^1.7.0",
60-
"karma": "^0.13.19",
68+
"html-webpack-plugin": "^2.16.0",
69+
"karma": "^0.13.22",
6170
"karma-babel-preprocessor": "^6.0.1",
6271
"karma-chai": "^0.1.0",
63-
"karma-coverage": "^0.5.3",
64-
"karma-mocha": "^0.2.1",
65-
"karma-mocha-reporter": "^1.1.5",
72+
"karma-coverage": "^0.5.5",
73+
"karma-mocha": "^0.2.2",
74+
"karma-mocha-reporter": "^2.0.2",
6675
"karma-phantomjs-launcher": "^1.0.0",
67-
"karma-phantomjs-shim": "^1.2.0",
76+
"karma-phantomjs-shim": "^1.3.0",
6877
"karma-sourcemap-loader": "^0.3.7",
6978
"karma-webpack": "^1.7.0",
70-
"material-ui": "^0.14.2",
71-
"mocha": "^2.3.4",
79+
"material-ui": "^0.14.4",
80+
"mocha": "^2.4.5",
7281
"open": "0.0.5",
7382
"open-browser-webpack-plugin": "0.0.2",
74-
"phantomjs": "^1.9.19",
75-
"phantomjs-prebuilt": "^2.1.3",
76-
"react": "latest",
77-
"react-addons-test-utils": "^0.14.6",
78-
"react-color": "^1.3.6",
83+
"phantomjs": "^2.1.7",
84+
"phantomjs-prebuilt": "^2.1.7",
85+
"react": "^15.0.1",
86+
"react-addons-test-utils": "^15.0.1",
87+
"react-color": "^2.0.0",
7988
"react-dom": "latest",
8089
"react-hot-loader": "^1.3.0",
8190
"react-tap-event-plugin": "latest",
82-
"rimraf": "^2.5.1",
83-
"style-loader": "^0.13.0",
84-
"webpack": "^1.12.11",
91+
"rimraf": "^2.5.2",
92+
"style-loader": "^0.13.1",
93+
"webpack": "^1.13.0",
8594
"webpack-dev-server": "^1.14.1"
8695
}
8796
}

src/SketchField.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,9 @@ class SketchField extends React.Component {
400400
<div className={className} style={style}>
401401
<canvas
402402
id={uuid4()}
403-
height={height || 512}
403+
height={(height || 512) + 'px'}
404404
ref={(c) => this._canvas = c}
405-
width={width || this.state.parentWidth}>
405+
width={(width || this.state.parentWidth) + 'px'}>
406406
Sorry, Canvas HTML5 element is not supported by your browser :(
407407
</canvas>
408408
</div>

0 commit comments

Comments
 (0)