ackee-frontend-toolkit
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -32,3 +32,3 @@ # `makeDropzone(GraphicComponent): DropzoneComponent` | ||
makeDropzone(({ isMouseOver, uploadState }) => ( | ||
<div style={ backgroundColor: isMouseOver ? 'yellow' : 'grey' } > | ||
<div style={{ backgroundColor: isMouseOver ? 'yellow' : 'grey' }}> | ||
<span className="button--blue button"> | ||
@@ -35,0 +35,0 @@ {uploadState === FS.uploaded || uploadState === FS.failed ? 'Change' : 'Select'} |
@@ -6,1 +6,5 @@ # Selectors | ||
Selector for `react-router` state - select `locationBeforeTransitions`. | ||
### `translateSelector` | ||
Select `translate` part of store. Used in [translatable HOC](../HOC/translatable.md) |
@@ -87,3 +87,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
onDrop = _props.onDrop, | ||
restProps = _objectWithoutProperties(_props, ['onDrop']); | ||
wrapperId = _props.wrapperId, | ||
restProps = _objectWithoutProperties(_props, ['onDrop', 'wrapperId']); | ||
@@ -100,2 +101,3 @@ return React.createElement( | ||
key: 'logo', | ||
wrapperId: wrapperId, | ||
onFileDrop: function onFileDrop(e, file) { | ||
@@ -120,6 +122,6 @@ return _this2.onDrop(e, file); | ||
'div', | ||
{ style: { visibility: "hidden" } }, | ||
{ style: { visibility: 'hidden' } }, | ||
React.createElement('input', { ref: function ref(r) { | ||
return _this2.imageInput = r; | ||
}, type: 'file', name: 'photo', onChange: function onChange(e, file) { | ||
}, type: 'file', name: 'photo', onChange: function onChange(e) { | ||
return _this2.onDrop(e, e.target.files); | ||
@@ -135,4 +137,7 @@ } }) | ||
}(React.Component), _class.propTypes = { | ||
onDrop: PropTypes.func.isRequired | ||
onDrop: PropTypes.func.isRequired, | ||
wrapperId: PropTypes.string | ||
}, _class.defaultProps = { | ||
wrapperId: null | ||
}, _temp; | ||
}); |
// react-router routing selector | ||
// eslint-disable-next-line import/prefer-default-export | ||
export var routingSelector = function routingSelector(state) { | ||
return state.routing.locationBeforeTransitions; | ||
}; | ||
export var translateSelector = function translateSelector(state) { | ||
return state.translate; | ||
}; |
@@ -102,3 +102,4 @@ 'use strict'; | ||
onDrop = _props.onDrop, | ||
restProps = _objectWithoutProperties(_props, ['onDrop']); | ||
wrapperId = _props.wrapperId, | ||
restProps = _objectWithoutProperties(_props, ['onDrop', 'wrapperId']); | ||
@@ -115,2 +116,3 @@ return _react2.default.createElement( | ||
key: 'logo', | ||
wrapperId: wrapperId, | ||
onFileDrop: function onFileDrop(e, file) { | ||
@@ -135,6 +137,6 @@ return _this2.onDrop(e, file); | ||
'div', | ||
{ style: { visibility: "hidden" } }, | ||
{ style: { visibility: 'hidden' } }, | ||
_react2.default.createElement('input', { ref: function ref(r) { | ||
return _this2.imageInput = r; | ||
}, type: 'file', name: 'photo', onChange: function onChange(e, file) { | ||
}, type: 'file', name: 'photo', onChange: function onChange(e) { | ||
return _this2.onDrop(e, e.target.files); | ||
@@ -150,4 +152,7 @@ } }) | ||
}(_react2.default.Component), _class.propTypes = { | ||
onDrop: _propTypes2.default.func.isRequired | ||
onDrop: _propTypes2.default.func.isRequired, | ||
wrapperId: _propTypes2.default.string | ||
}, _class.defaultProps = { | ||
wrapperId: null | ||
}, _temp; | ||
}; |
@@ -7,5 +7,8 @@ "use strict"; | ||
// react-router routing selector | ||
// eslint-disable-next-line import/prefer-default-export | ||
var routingSelector = exports.routingSelector = function routingSelector(state) { | ||
return state.routing.locationBeforeTransitions; | ||
}; | ||
var translateSelector = exports.translateSelector = function translateSelector(state) { | ||
return state.translate; | ||
}; |
{ | ||
"name": "ackee-frontend-toolkit", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "Set of tools, libraries and all stuff useful for frontend development in Ackee having DRY in mind", | ||
@@ -13,3 +13,4 @@ "main": "lib/index.js", | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook" | ||
"build-storybook": "build-storybook", | ||
"lint": "eslint \"src/**/*.{js,jsx}\"" | ||
}, | ||
@@ -29,2 +30,4 @@ "author": "Lukáš Horák <lukas.horak@ackee.cz>", | ||
"react-intl": "^2.4.0", | ||
"react-redux": "^5.0.6", | ||
"redux": "^3.7.2", | ||
"redux-saga": "^0.16.0" | ||
@@ -31,0 +34,0 @@ }, |
@@ -14,4 +14,23 @@ ![Ackee Froentend Toolkit](https://cdn6.aptoide.com/imgs/f/2/e/f2e4802678264d40830b66f0459f7527_icon.png?w=256) | ||
2. Import | ||
Depending on your prefered module managment system, you can use directory `ackee-frontend-toolkit/lib` (CommonJS) or `ackee-frontend-toolkit/es` (ES2015) to import things you nned. | ||
Depending on your prefered module managment system, you can use directory `ackee-frontend-toolkit/lib` (CommonJS) or `ackee-frontend-toolkit/es` (ES2015) to import things you need. | ||
You can choose one of three ways for importing: | ||
1. Import partially | ||
```js | ||
import loadable from 'ackee-frontend-toolkit/HOC/loadable'; | ||
loadable(...) | ||
``` | ||
2. Import from namespace | ||
```js | ||
import * HOC from 'ackee-frontend-toolkit/HOC'; | ||
HOC.loadable(...) | ||
``` | ||
3. Import from full package | ||
```js | ||
import * ackee from 'ackee-frontend-toolkit'; | ||
ackee.loadable(...) | ||
``` | ||
## How to develop | ||
@@ -26,2 +45,3 @@ | ||
* [makeDropzone](/docs/HOC/makeDropzone.md) | ||
* [translatable](/docs/HOC/translatable.md) | ||
@@ -28,0 +48,0 @@ ### Helpers |
@@ -12,3 +12,3 @@ export const colors = { | ||
}; | ||
export const styles = { | ||
@@ -46,2 +46,2 @@ dropArea: { | ||
}, | ||
}; | ||
}; |
@@ -6,3 +6,3 @@ import React from 'react'; | ||
import loadable, { FS } from '../../src/HOC/loadable.jsx'; | ||
import loadable from '../../src/HOC/loadable'; | ||
@@ -9,0 +9,0 @@ const ContentComponent = () => <h1 style={{ color: 'red' }}>Content component</h1>; |
@@ -7,3 +7,3 @@ import React from 'react'; | ||
import makeDropzone, { FS } from '../../src/HOC/makeDropzone.jsx'; | ||
import makeDropzone, { FS } from '../../src/HOC/makeDropzone'; | ||
import { colors, styles } from './dropzoneStyles'; | ||
@@ -10,0 +10,0 @@ |
@@ -1,2 +0,3 @@ | ||
import './HOC/makeDropzone.story.jsx'; | ||
import './HOC/loadable.story.jsx'; | ||
import './HOC/makeDropzone.story'; | ||
import './HOC/loadable.story'; | ||
import './HOC/translatable.story'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
300930
57
1589
60
9
+ Addedreact-redux@^5.0.6
+ Addedredux@^3.7.2
+ Added@babel/runtime@7.26.0(transitive)
+ Addedlodash-es@4.17.21(transitive)
+ Addedreact-lifecycles-compat@3.0.4(transitive)
+ Addedreact-redux@5.1.2(transitive)
+ Addedredux@3.7.2(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedsymbol-observable@1.2.0(transitive)