Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed devDependencies from output file #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 13 additions & 51 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,11 @@ Object.defineProperty(exports, "__esModule", {
value: true
});

var _redboxReact2 = require('redbox-react');

var _redboxReact3 = _interopRequireDefault(_redboxReact2);

var _reactTransformCatchErrors3 = require('react-transform-catch-errors');

var _reactTransformCatchErrors4 = _interopRequireDefault(_reactTransformCatchErrors3);

var _react2 = require('react');

var _react3 = _interopRequireDefault(_react2);

var _reactTransformHmr3 = require('react-transform-hmr');

var _reactTransformHmr4 = _interopRequireDefault(_reactTransformHmr3);

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _class, _temp;
var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

Expand All @@ -36,33 +22,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var _components = {
Knob: {
displayName: 'Knob'
}
};

var _reactTransformHmr2 = (0, _reactTransformHmr4.default)({
filename: 'Knob.js',
components: _components,
locals: [module],
imports: [_react3.default]
});

var _reactTransformCatchErrors2 = (0, _reactTransformCatchErrors4.default)({
filename: 'Knob.js',
components: _components,
locals: [],
imports: [_react3.default, _redboxReact3.default]
});

function _wrapComponent(id) {
return function (Component) {
return _reactTransformHmr2(_reactTransformCatchErrors2(Component, id), id);
};
}

var Knob = _wrapComponent('Knob')((_temp = _class = function (_React$Component) {
var Knob = function (_React$Component) {
_inherits(Knob, _React$Component);

function Knob(props) {
Expand Down Expand Up @@ -224,7 +184,7 @@ var Knob = _wrapComponent('Knob')((_temp = _class = function (_React$Component)


if (displayInput) {
return _react3.default.createElement('input', {
return _react2.default.createElement('input', {
style: _this.inputStyle(),
type: 'text',
value: value,
Expand Down Expand Up @@ -319,14 +279,14 @@ var Knob = _wrapComponent('Knob')((_temp = _class = function (_React$Component)
value = _props.value;


return _react3.default.createElement(
return _react2.default.createElement(
'div',
{
className: className,
style: { width: this.w, height: this.h, display: 'inline-block' },
onWheel: readOnly || disableMouseWheel ? null : this.handleWheel
},
_react3.default.createElement('canvas', {
_react2.default.createElement('canvas', {
ref: function ref(_ref) {
_this2.canvasRef = _ref;
},
Expand All @@ -341,7 +301,9 @@ var Knob = _wrapComponent('Knob')((_temp = _class = function (_React$Component)
}]);

return Knob;
}(_react3.default.Component), _class.propTypes = {
}(_react2.default.Component);

Knob.propTypes = {
value: _propTypes2.default.number.isRequired,
onChange: _propTypes2.default.func.isRequired,
onChangeEnd: _propTypes2.default.func,
Expand Down Expand Up @@ -371,7 +333,8 @@ var Knob = _wrapComponent('Knob')((_temp = _class = function (_React$Component)
title: _propTypes2.default.string,
className: _propTypes2.default.string,
canvasClassName: _propTypes2.default.string
}, _class.defaultProps = {
};
Knob.defaultProps = {
onChangeEnd: function onChangeEnd() {},
min: 0,
max: 100,
Expand All @@ -397,6 +360,5 @@ var Knob = _wrapComponent('Knob')((_temp = _class = function (_React$Component)
disableMouseWheel: false,
className: null,
canvasClassName: null
}, _temp));

};
exports.default = Knob;
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "HTML5 Canvas-based React knob/dial component",
"main": "index.js",
"scripts": {
"start": "node_modules/webpack-dev-server/bin/webpack-dev-server.js --no-info",
"babel": "node_modules/babel-cli/lib/babel/index.js Knob.js -o index.js",
"start": "webpack-dev-server --no-info",
"babel": "NODE_ENV=production babel Knob.js -o index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": "[email protected]:joshjg/react-canvas-knob.git",
Expand Down Expand Up @@ -41,6 +41,7 @@
"eslint-plugin-react": "^6.3.0",
"html-webpack-plugin": "^2.22.0",
"html-webpack-template": "^5.3.0",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react-transform-catch-errors": "^1.0.2",
"react-transform-hmr": "^1.0.4",
Expand All @@ -49,7 +50,7 @@
"webpack-dev-server": "^1.16.1"
},
"peerDependencies": {
"react": "^15.3.2"
"react": "^15.3.2 || ^16.1.1"
},
"dependencies": {
"prop-types": "^15.5.10"
Expand Down