x25 2.9.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.json +275 -0
  3. package/.flowconfig +23 -0
  4. package/conf/dev.js +19 -0
  5. package/conf/dist.js +19 -0
  6. package/conf/polyfills/tempPolyfills.js +7 -0
  7. package/package.json +16 -16
  8. package/src/Account/Load.jsx +79 -0
  9. package/src/Account/actions.js +10 -0
  10. package/src/Account/index.js +11 -0
  11. package/src/Account/reducer.js +139 -0
  12. package/src/Account/request.js +36 -0
  13. package/src/Async/InitModule.jsx +114 -0
  14. package/src/Async/RouteLoading.jsx +52 -0
  15. package/src/Async/SimulatedException.jsx +19 -0
  16. package/src/Async/index.jsx +75 -0
  17. package/src/Async/types.js +39 -0
  18. package/src/Company/Load.jsx +84 -0
  19. package/src/Company/actions.js +10 -0
  20. package/src/Company/index.js +11 -0
  21. package/src/Company/reducer.js +201 -0
  22. package/src/Company/request.js +30 -0
  23. package/src/Company/util.js +7 -0
  24. package/src/Header/AccountOptionsContainer.jsx +124 -0
  25. package/src/Header/AdminSelectCompany.jsx +101 -0
  26. package/src/Header/ClientSelectCompany.jsx +90 -0
  27. package/src/Header/Header.jsx +120 -0
  28. package/src/Header/HeaderContainer.jsx +30 -0
  29. package/src/Header/Logo.jsx +16 -0
  30. package/src/Header/LogoutButton.jsx +34 -0
  31. package/src/Header/index.jsx +9 -0
  32. package/src/Header/request.js +28 -0
  33. package/src/Header/types.js +6 -0
  34. package/src/Header/util.jsx +61 -0
  35. package/src/Inputs/Business/BankAccount.jsx +39 -0
  36. package/src/Inputs/Business/BankName.jsx +40 -0
  37. package/src/Inputs/Business/CifField.jsx +93 -0
  38. package/src/Inputs/Business/CifFieldContainer.jsx +142 -0
  39. package/src/Inputs/Business/Email.jsx +23 -0
  40. package/src/Inputs/Business/NidField.jsx +77 -0
  41. package/src/Inputs/Business/Phone.jsx +23 -0
  42. package/src/Inputs/Business/index.js +16 -0
  43. package/src/Inputs/Business/request.js +39 -0
  44. package/src/Inputs/CaptchaBox.jsx +131 -0
  45. package/src/Inputs/DateInput.jsx +188 -0
  46. package/src/Inputs/DateTemplate.jsx +213 -0
  47. package/src/Inputs/DelayInputChange.jsx +130 -0
  48. package/src/Inputs/FocusTemplate.jsx +41 -0
  49. package/src/Inputs/InputTemplate.jsx +79 -0
  50. package/src/Inputs/LabelTemplate.jsx +47 -0
  51. package/src/Inputs/NumericInput.jsx +142 -0
  52. package/src/Inputs/NumericTemplate.jsx +155 -0
  53. package/src/Inputs/Selects/County.jsx +19 -0
  54. package/src/Inputs/Selects/Custom.jsx +55 -0
  55. package/src/Inputs/Selects/Simple.jsx +73 -0
  56. package/src/Inputs/Selects/index.jsx +37 -0
  57. package/src/Inputs/SimpleInput.jsx +40 -0
  58. package/src/Inputs/SimpleTextarea.jsx +55 -0
  59. package/src/Inputs/TextareaTemplate.jsx +57 -0
  60. package/src/Inputs/Tooltip.jsx +61 -0
  61. package/src/Inputs/index.js +22 -0
  62. package/src/Messages/Error.jsx +83 -0
  63. package/src/Messages/Loading.jsx +43 -0
  64. package/src/Messages/index.jsx +4 -0
  65. package/src/Modal/Delete.jsx +237 -0
  66. package/src/Modal/Root.jsx +57 -0
  67. package/src/Modal/SimpleModal.jsx +47 -0
  68. package/src/Modal/actions.js +7 -0
  69. package/src/Modal/getComponent.jsx +32 -0
  70. package/src/Modal/index.jsx +12 -0
  71. package/src/Modal/reducer.js +40 -0
  72. package/src/Modal/types.js +6 -0
  73. package/src/Modal/util.js +15 -0
  74. package/src/Payment/EstimatePrice/Description.jsx +101 -0
  75. package/src/Payment/EstimatePrice/PayBox.jsx +173 -0
  76. package/src/Payment/EstimatePrice/index.jsx +63 -0
  77. package/src/Payment/EstimatePrice/util.js +15 -0
  78. package/src/Payment/MobilpayForm.jsx +77 -0
  79. package/src/Payment/Modal/BankTransfer.jsx +129 -0
  80. package/src/Payment/Modal/CompanyValability.jsx +14 -0
  81. package/src/Payment/Modal/DoneForm.jsx +209 -0
  82. package/src/Payment/Modal/PaymentDone.jsx +27 -0
  83. package/src/Payment/Modal/index.js +13 -0
  84. package/src/Payment/actions.jsx +22 -0
  85. package/{Payment → src/Payment}/codes.js +16 -19
  86. package/src/Payment/index.jsx +124 -0
  87. package/src/Payment/request.js +50 -0
  88. package/src/Payment/types.js +14 -0
  89. package/src/Payment/util.jsx +52 -0
  90. package/src/Payment/validate.js +25 -0
  91. package/src/Sidebar.jsx +158 -0
  92. package/src/Things.jsx +35 -0
  93. package/src/actions.js +36 -0
  94. package/src/config.js +7 -0
  95. package/src/dev/ErrorBoundary.jsx +98 -0
  96. package/src/dev/TheError.jsx +87 -0
  97. package/src/dev/index.js +127 -0
  98. package/src/dev/types.js +10 -0
  99. package/src/prod/SentryErrorBoundary.jsx +98 -0
  100. package/src/reducer/captchas.js +44 -0
  101. package/src/reducer/counties.js +46 -0
  102. package/src/reducer/index.js +25 -0
  103. package/src/reducer/module.jsx +43 -0
  104. package/src/style/.sass-lint.yml +84 -0
  105. package/src/style/.stylelintrc.json +161 -0
  106. package/src/style/_fancy-text.scss +37 -0
  107. package/src/style/_fix_bootstrap_placeholder_color.scss +14 -0
  108. package/src/style/_header-company.scss +69 -0
  109. package/src/style/_inputs.scss +12 -0
  110. package/src/style/_minimal.scss +31 -0
  111. package/src/style/_navigation.scss +24 -0
  112. package/src/style/_others.scss +79 -0
  113. package/src/style/index.scss +7 -0
  114. package/src/style/sidebar/_animations.scss +21 -0
  115. package/src/style/sidebar/_dark-theme.scss +77 -0
  116. package/src/style/sidebar/_scroll.scss +37 -0
  117. package/src/style/sidebar/_structure.scss +299 -0
  118. package/src/style/sidebar.scss +4 -0
  119. package/src/types.js +31 -0
  120. package/src/utility/calendar.js +39 -0
  121. package/src/utility/date.js +100 -0
  122. package/src/utility/index.js +12 -0
  123. package/src/utility/language.js +17 -0
  124. package/src/utility/mql.js +3 -0
  125. package/src/utility/normalize-test.js +58 -0
  126. package/src/utility/normalize.js +119 -0
  127. package/src/utility/numbers.js +87 -0
  128. package/src/utility/numeric.js +114 -0
  129. package/src/utility/others.jsx +160 -0
  130. package/src/utility/strings-test.js +136 -0
  131. package/src/utility/strings.js +80 -0
  132. package/src/utility/validation/common.js +360 -0
  133. package/src/utility/validation/index.js +70 -0
  134. package/src/utility/validation/specific.js +9 -0
  135. package/src/utility/validation/validate/bank-test.js +129 -0
  136. package/src/utility/validation/validate/bank.js +176 -0
  137. package/src/utility/validation/validate/cif-test.js +105 -0
  138. package/src/utility/validation/validate/cif.js +44 -0
  139. package/src/utility/validation/validate/cnp-test.js +216 -0
  140. package/src/utility/validation/validate/cnp.js +261 -0
  141. package/{utility → src/utility}/validation/validate/date.js +73 -61
  142. package/src/utility/validation/validate/email-test.js +36 -0
  143. package/src/utility/validation/validate/email.js +6 -0
  144. package/src/utility/validation/validate/index.js +7 -0
  145. package/webpack.config.js +90 -0
  146. package/x25.wiki/Account.md +41 -0
  147. package/x25.wiki/Company.md +39 -0
  148. package/x25.wiki/Header.md +21 -0
  149. package/x25.wiki/Home.md +1 -0
  150. package/x25.wiki/Inputs.md +33 -0
  151. package/x25.wiki/Messages.md +27 -0
  152. package/x25.wiki/Payment.md +42 -0
  153. package/Account/Load.js +0 -75
  154. package/Account/actions.js +0 -15
  155. package/Account/index.js +0 -20
  156. package/Account/reducer.js +0 -122
  157. package/Account/request.js +0 -44
  158. package/Async/InitModule.js +0 -190
  159. package/Async/RouteLoading.js +0 -64
  160. package/Async/SimulatedException.js +0 -44
  161. package/Async/index.js +0 -95
  162. package/Async/types.js +0 -1
  163. package/Company/Load.js +0 -82
  164. package/Company/actions.js +0 -15
  165. package/Company/index.js +0 -20
  166. package/Company/reducer.js +0 -165
  167. package/Company/request.js +0 -36
  168. package/Company/util.js +0 -10
  169. package/Header/AccountOptionsContainer.js +0 -144
  170. package/Header/AdminSelectCompany.js +0 -109
  171. package/Header/ClientSelectCompany.js +0 -104
  172. package/Header/Header.js +0 -127
  173. package/Header/HeaderContainer.js +0 -39
  174. package/Header/Logo.js +0 -30
  175. package/Header/LogoutButton.js +0 -39
  176. package/Header/index.js +0 -19
  177. package/Header/request.js +0 -26
  178. package/Header/types.js +0 -1
  179. package/Header/util.js +0 -58
  180. package/Inputs/Business/BankAccount.js +0 -48
  181. package/Inputs/Business/BankName.js +0 -49
  182. package/Inputs/Business/CifField.js +0 -112
  183. package/Inputs/Business/CifFieldContainer.js +0 -157
  184. package/Inputs/Business/Email.js +0 -37
  185. package/Inputs/Business/NidField.js +0 -91
  186. package/Inputs/Business/Phone.js +0 -37
  187. package/Inputs/Business/index.js +0 -34
  188. package/Inputs/Business/request.js +0 -39
  189. package/Inputs/CaptchaBox.js +0 -151
  190. package/Inputs/DateInput.js +0 -172
  191. package/Inputs/DateTemplate.js +0 -200
  192. package/Inputs/DelayInputChange.js +0 -135
  193. package/Inputs/FocusTemplate.js +0 -47
  194. package/Inputs/InputTemplate.js +0 -78
  195. package/Inputs/LabelTemplate.js +0 -59
  196. package/Inputs/NumericInput.js +0 -139
  197. package/Inputs/NumericTemplate.js +0 -148
  198. package/Inputs/Selects/County.js +0 -29
  199. package/Inputs/Selects/Custom.js +0 -56
  200. package/Inputs/Selects/Simple.js +0 -75
  201. package/Inputs/Selects/index.js +0 -52
  202. package/Inputs/SimpleInput.js +0 -42
  203. package/Inputs/SimpleTextarea.js +0 -47
  204. package/Inputs/TextareaTemplate.js +0 -55
  205. package/Inputs/Tooltip.js +0 -82
  206. package/Inputs/index.js +0 -185
  207. package/Messages/Error.js +0 -106
  208. package/Messages/Loading.js +0 -68
  209. package/Messages/index.js +0 -29
  210. package/Modal/Delete.js +0 -240
  211. package/Modal/Root.js +0 -81
  212. package/Modal/SimpleModal.js +0 -57
  213. package/Modal/actions.js +0 -10
  214. package/Modal/getComponent.js +0 -42
  215. package/Modal/index.js +0 -22
  216. package/Modal/reducer.js +0 -53
  217. package/Modal/types.js +0 -7
  218. package/Modal/util.js +0 -17
  219. package/Payment/EstimatePrice/Description.js +0 -92
  220. package/Payment/EstimatePrice/PayBox.js +0 -220
  221. package/Payment/EstimatePrice/index.js +0 -92
  222. package/Payment/EstimatePrice/util.js +0 -21
  223. package/Payment/MobilpayForm.js +0 -86
  224. package/Payment/Modal/BankTransfer.js +0 -233
  225. package/Payment/Modal/CompanyValability.js +0 -28
  226. package/Payment/Modal/DoneForm.js +0 -222
  227. package/Payment/Modal/PaymentDone.js +0 -53
  228. package/Payment/Modal/index.js +0 -27
  229. package/Payment/actions.js +0 -23
  230. package/Payment/index.js +0 -141
  231. package/Payment/request.js +0 -49
  232. package/Payment/types.js +0 -1
  233. package/Payment/util.js +0 -50
  234. package/Payment/validate.js +0 -23
  235. package/Sidebar.js +0 -156
  236. package/Things.js +0 -53
  237. package/actions.js +0 -73
  238. package/config.js +0 -10
  239. package/dev/ErrorBoundary.js +0 -109
  240. package/dev/TheError.js +0 -113
  241. package/dev/index.js +0 -132
  242. package/dev/types.js +0 -1
  243. package/prod/SentryErrorBoundary.js +0 -150
  244. package/reducer/captchas.js +0 -51
  245. package/reducer/counties.js +0 -57
  246. package/reducer/index.js +0 -38
  247. package/reducer/module.js +0 -48
  248. package/style/index.css +0 -1
  249. package/style/sidebar.css +0 -1
  250. package/types.js +0 -1
  251. package/utility/calendar.js +0 -45
  252. package/utility/date.js +0 -111
  253. package/utility/index.js +0 -125
  254. package/utility/language.js +0 -20
  255. package/utility/mql.js +0 -6
  256. package/utility/normalize-test.js +0 -54
  257. package/utility/normalize.js +0 -108
  258. package/utility/numbers.js +0 -93
  259. package/utility/numeric.js +0 -103
  260. package/utility/others.js +0 -142
  261. package/utility/strings-test.js +0 -216
  262. package/utility/strings.js +0 -85
  263. package/utility/validation/common.js +0 -278
  264. package/utility/validation/index.js +0 -110
  265. package/utility/validation/specific.js +0 -14
  266. package/utility/validation/validate/bank-test.js +0 -41
  267. package/utility/validation/validate/bank.js +0 -176
  268. package/utility/validation/validate/cif-test.js +0 -37
  269. package/utility/validation/validate/cif.js +0 -44
  270. package/utility/validation/validate/cnp-test.js +0 -68
  271. package/utility/validation/validate/cnp.js +0 -193
  272. package/utility/validation/validate/email-test.js +0 -30
  273. package/utility/validation/validate/email.js +0 -11
  274. package/utility/validation/validate/index.js +0 -65
package/Sidebar.js DELETED
@@ -1,156 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- 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; };
8
-
9
- 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; }; }();
10
-
11
- var _react = require("react");
12
-
13
- var React = _interopRequireWildcard(_react);
14
-
15
- var _reactSidebar = require("react-sidebar");
16
-
17
- var _reactSidebar2 = _interopRequireDefault(_reactSidebar);
18
-
19
- var _utility = require("./utility");
20
-
21
- var _Header = require("./Header");
22
-
23
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
-
25
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
26
-
27
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28
-
29
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
30
-
31
- 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; }
32
-
33
- var styles = {
34
- sidebar: {
35
- zIndex: 2,
36
- position: "absolute",
37
- top: 0,
38
- bottom: 0,
39
- transition: "transform .3s ease-out",
40
- WebkitTransition: "-webkit-transform .3s ease-out",
41
- willChange: "transform",
42
- overflowY: "auto"
43
- },
44
- overlay: {
45
- zIndex: 3,
46
- left: 240
47
- }
48
- };
49
-
50
- var Sidebar = function (_React$PureComponent) {
51
- _inherits(Sidebar, _React$PureComponent);
52
-
53
- function Sidebar(props) {
54
- _classCallCheck(this, Sidebar);
55
-
56
- var _this = _possibleConstructorReturn(this, (Sidebar.__proto__ || Object.getPrototypeOf(Sidebar)).call(this, props));
57
-
58
- _this.state = {
59
- showNavbar: false,
60
- sidebarDocked: _utility.mql.matches,
61
- sidebarOpen: false
62
- };
63
-
64
- _this.updateSidebar = function () {
65
- _this.setState(function (current) {
66
- return {
67
- sidebarOpen: !_utility.mql.matches && current.sidebarOpen,
68
- sidebarDocked: _utility.mql.matches
69
- };
70
- });
71
- };
72
-
73
- _this.toggleNavbar = function () {
74
- _this.setState(function (current) {
75
- return {
76
- showNavbar: !current.showNavbar
77
- };
78
- });
79
- };
80
-
81
- _this.toggleSidebarOpen = function (value) {
82
- _this.setState({
83
- sidebarOpen: value
84
- });
85
- };
86
-
87
- _this.showSidebar = function () {
88
- var theMetch = _utility.mql.matches;
89
-
90
- _this.setState({
91
- sidebarOpen: !theMetch,
92
- sidebarDocked: theMetch
93
- });
94
- };
95
-
96
- _this.closeSidebar = function () {
97
- _this.setState({
98
- sidebarOpen: false,
99
- sidebarDocked: false
100
- });
101
- };
102
- return _this;
103
- }
104
-
105
- _createClass(Sidebar, [{
106
- key: "componentDidMount",
107
- value: function componentDidMount() {
108
- _utility.mql.addListener(this.updateSidebar);
109
- }
110
- }, {
111
- key: "componentWillUnmount",
112
- value: function componentWillUnmount() {
113
- _utility.mql.removeListener(this.updateSidebar);
114
- }
115
- }, {
116
- key: "render",
117
- value: function render() {
118
- var _props = this.props,
119
- data = _props.data,
120
- children = _props.children;
121
-
122
-
123
- var sidebarprops = {
124
- closeSidebar: this.closeSidebar
125
- };
126
-
127
- return React.createElement(
128
- _reactSidebar2.default,
129
- _extends({}, this.props, {
130
- contentClassName: "wrapper",
131
- docked: this.state.sidebarDocked,
132
- onSetOpen: this.toggleSidebarOpen,
133
- open: this.state.sidebarOpen,
134
- rootClassName: "page-wrapper dark-theme toggled",
135
- sidebar: React.cloneElement(this.props.Menu, sidebarprops),
136
- sidebarClassName: "sidebar-wrapper",
137
- styles: styles,
138
- touch: false,
139
- transitions: false }),
140
- React.createElement(_Header.Header, {
141
- brand: this.props.brand,
142
- company: data,
143
- showNavbar: this.state.showNavbar,
144
- showSidebar: this.showSidebar,
145
- sidebarDocked: this.state.sidebarDocked,
146
- toggleNavbar: this.toggleNavbar
147
- }),
148
- children
149
- );
150
- }
151
- }]);
152
-
153
- return Sidebar;
154
- }(React.PureComponent);
155
-
156
- exports.default = Sidebar;
package/Things.js DELETED
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _react = require("react");
8
-
9
- var _react2 = _interopRequireDefault(_react);
10
-
11
- var _Root = require("./Modal/Root");
12
-
13
- var _Root2 = _interopRequireDefault(_Root);
14
-
15
- var _reactRedux = require("react-redux");
16
-
17
- var _reactNotificationSystemRedux = require("react-notification-system-redux");
18
-
19
- var _reactNotificationSystemRedux2 = _interopRequireDefault(_reactNotificationSystemRedux);
20
-
21
- var _actions = require("./actions");
22
-
23
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
-
25
- var mapStateToProps = function mapStateToProps(state) {
26
- return {
27
- notifications: state.get("notifications", [])
28
- };
29
- },
30
- mapDispatchToProps = function mapDispatchToProps(dispatch) {
31
- return {
32
- handleDismiss: function handleDismiss(notification) {
33
- dispatch((0, _actions.deleteNotification)(notification.key));
34
- }
35
- };
36
- };
37
-
38
- var NotificationsContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_reactNotificationSystemRedux2.default);
39
-
40
- var Things = function Things() {
41
- return _react2.default.createElement(
42
- _react2.default.Fragment,
43
- null,
44
- _react2.default.createElement(
45
- "div",
46
- { className: "d-print-none" },
47
- _react2.default.createElement(NotificationsContainer, null)
48
- ),
49
- _react2.default.createElement(_Root2.default, null)
50
- );
51
- };
52
-
53
- exports.default = Things;
package/actions.js DELETED
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.hideCaptcha = exports.showCaptcha = exports.deleteNotification = exports.notifyError = exports.notify = undefined;
7
-
8
- 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; };
9
-
10
- var _actions = require("./Modal/actions");
11
-
12
- Object.keys(_actions).forEach(function (key) {
13
- if (key === "default" || key === "__esModule") return;
14
- Object.defineProperty(exports, key, {
15
- enumerable: true,
16
- get: function get() {
17
- return _actions[key];
18
- }
19
- });
20
- });
21
-
22
- var _actions2 = require("./Account/actions");
23
-
24
- Object.keys(_actions2).forEach(function (key) {
25
- if (key === "default" || key === "__esModule") return;
26
- Object.defineProperty(exports, key, {
27
- enumerable: true,
28
- get: function get() {
29
- return _actions2[key];
30
- }
31
- });
32
- });
33
-
34
- var _reactNotificationSystemRedux = require("react-notification-system-redux");
35
-
36
- var _reactNotificationSystemRedux2 = _interopRequireDefault(_reactNotificationSystemRedux);
37
-
38
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
-
40
- var createNotification = function createNotification(level) {
41
- return function (title, options) {
42
- return _reactNotificationSystemRedux2.default.show(_extends({
43
- title: title,
44
- position: "tc",
45
- autoDismiss: 3
46
- }, options), level);
47
- };
48
- };
49
-
50
- var notify = exports.notify = createNotification("success");
51
- // export const notifyWarning = createNotification("warning");
52
- var notifyError = exports.notifyError = createNotification("error");
53
-
54
- var deleteNotification = exports.deleteNotification = function deleteNotification(position) {
55
- return {
56
- type: "DELETE_NOTIFICATION",
57
- payload: position
58
- };
59
- };
60
-
61
- var showCaptcha = exports.showCaptcha = function showCaptcha(payload) {
62
- return {
63
- type: "SHOW_CAPTCHA",
64
- payload: payload
65
- };
66
- };
67
-
68
- var hideCaptcha = exports.hideCaptcha = function hideCaptcha(payload) {
69
- return {
70
- type: "HIDE_CAPTCHA",
71
- payload: payload
72
- };
73
- };
package/config.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var config = exports.config = {};
7
-
8
- var setConfiguration = exports.setConfiguration = function setConfiguration(current) {
9
- exports.config = config = current;
10
- };
@@ -1,109 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- 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; }; }();
8
-
9
- var _react = require("react");
10
-
11
- var _react2 = _interopRequireDefault(_react);
12
-
13
- var _TheError = require("./TheError");
14
-
15
- var _TheError2 = _interopRequireDefault(_TheError);
16
-
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
-
19
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
-
21
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
22
-
23
- 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; }
24
-
25
- var refreshKeyCode = 82,
26
- timeoutDelay = 200;
27
-
28
- var ErrorBoundary = function (_React$Component) {
29
- _inherits(ErrorBoundary, _React$Component);
30
-
31
- _createClass(ErrorBoundary, [{
32
- key: "componentDidCatch",
33
- value: function componentDidCatch(error, info) {
34
- this.setState({
35
- error: error,
36
- info: info
37
- });
38
- }
39
- }]);
40
-
41
- function ErrorBoundary(props) {
42
- _classCallCheck(this, ErrorBoundary);
43
-
44
- var _this = _possibleConstructorReturn(this, (ErrorBoundary.__proto__ || Object.getPrototypeOf(ErrorBoundary)).call(this, props));
45
-
46
- _this.state = {
47
- status: null,
48
- error: null,
49
- info: null
50
- };
51
-
52
- _this.handleKey = function (event) {
53
- if (event.keyCode === refreshKeyCode) {
54
- _this.refresh();
55
- }
56
- };
57
-
58
- _this.refresh = function () {
59
- _this.setState({
60
- status: "Trying to recover...",
61
- error: null,
62
- info: null
63
- }, function () {
64
- setTimeout(function () {
65
- _this.setState({
66
- status: null,
67
- error: null,
68
- info: null
69
- });
70
- }, timeoutDelay);
71
- });
72
- };
73
- return _this;
74
- }
75
-
76
- _createClass(ErrorBoundary, [{
77
- key: "shouldComponentUpdate",
78
- value: function shouldComponentUpdate() {
79
- return true;
80
- }
81
- }, {
82
- key: "render",
83
- value: function render() {
84
- var _state = this.state,
85
- info = _state.info,
86
- error = _state.error,
87
- status = _state.status;
88
-
89
- // render fallback UI
90
-
91
- if (error) {
92
- return _react2.default.createElement(_TheError2.default, {
93
- error: error,
94
- handleKey: this.handleKey,
95
- info: info,
96
- refresh: this.refresh,
97
- status: status
98
- });
99
- }
100
-
101
- // when there's not an error, render children untouched
102
- return this.props.children;
103
- }
104
- }]);
105
-
106
- return ErrorBoundary;
107
- }(_react2.default.Component);
108
-
109
- exports.default = ErrorBoundary;
package/dev/TheError.js DELETED
@@ -1,113 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _react = require("react");
8
-
9
- var _react2 = _interopRequireDefault(_react);
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- var TheError = function TheError(props) {
14
-
15
- _react2.default.useEffect(function () {
16
- document.addEventListener("keydown", props.handleKey);
17
-
18
- return function () {
19
- document.removeEventListener("keydown", props.handleKey);
20
- };
21
- }, []);
22
-
23
- var error = props.error,
24
- info = props.info,
25
- status = props.status,
26
- refresh = props.refresh;
27
-
28
- // render fallback UI
29
-
30
- return _react2.default.createElement(
31
- "div",
32
- { className: "small", tabIndex: "0" },
33
- _react2.default.createElement(
34
- "div",
35
- { className: " m-2" },
36
- status ? _react2.default.createElement(
37
- "div",
38
- { className: "text-fancy" },
39
- "Trying to recover app..."
40
- ) : _react2.default.createElement(
41
- "div",
42
- null,
43
- _react2.default.createElement(
44
- "button",
45
- {
46
- className: "btn btn-block btn-sm btn-primary",
47
- onClick: refresh, type: "button" },
48
- "Recover the app"
49
- ),
50
- _react2.default.createElement(
51
- "div",
52
- { className: "mt-2 mb-2" },
53
- "Press ",
54
- _react2.default.createElement(
55
- "kbd",
56
- null,
57
- "R"
58
- ),
59
- " to recover the app, after you've done the changes"
60
- ),
61
- _react2.default.createElement("hr", null),
62
- error ? _react2.default.createElement(
63
- _react2.default.Fragment,
64
- null,
65
- _react2.default.createElement(
66
- "h5",
67
- { className: "text-danger" },
68
- error.message
69
- ),
70
- _react2.default.createElement(
71
- "b",
72
- null,
73
- "Stack:"
74
- ),
75
- _react2.default.createElement(
76
- "pre",
77
- null,
78
- error.stack ? error.stack.split("↵").map(function (line, index) {
79
- return _react2.default.createElement(
80
- "div",
81
- { key: index },
82
- line
83
- );
84
- }) : null
85
- )
86
- ) : null,
87
- _react2.default.createElement("br", null),
88
- info && info.componentStack ? _react2.default.createElement(
89
- _react2.default.Fragment,
90
- null,
91
- _react2.default.createElement(
92
- "b",
93
- null,
94
- "React info:"
95
- ),
96
- _react2.default.createElement(
97
- "pre",
98
- null,
99
- info.componentStack.split("↵").map(function (line, index) {
100
- return _react2.default.createElement(
101
- "div",
102
- { key: index },
103
- line
104
- );
105
- })
106
- )
107
- ) : null
108
- )
109
- )
110
- );
111
- };
112
-
113
- exports.default = TheError;
package/dev/index.js DELETED
@@ -1,132 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ensureImmutableState = exports.setFavIconToDev = undefined;
7
-
8
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
9
- /* eslint-disable no-alert, no-console, no-undefined, callback-return, max-len */
10
-
11
- var _immutable = require("immutable");
12
-
13
- var Immutable = _interopRequireWildcard(_immutable);
14
-
15
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
16
-
17
- var setFavIconToDev = function setFavIconToDev() {
18
- var element = document.querySelector("link[rel*='icon");
19
-
20
- if (element !== null && element.href) {
21
- element.href = "/static/dev.ico";
22
- }
23
- };
24
-
25
- var ensureImmutableState = function ensureImmutableState() {
26
- var ignored = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
27
-
28
-
29
- var ignore = function ignore(key) {
30
- return ignored.includes(key);
31
- };
32
-
33
- var isGood = function isGood(data, key) {
34
- return ignore(key) || data === null || data === undefined || Immutable.isImmutable(data) || typeof data === "number" || typeof data === "boolean" || typeof data === "string";
35
- };
36
-
37
- var problems = Immutable.Map(),
38
- allKeys = Immutable.List(),
39
- currentKey = Immutable.List();
40
-
41
- var listCurrentProblems = function listCurrentProblems() {
42
- if (currentKey.size !== 0) {
43
- var log = function log(_ref) {
44
- var data = _ref.data,
45
- state = _ref.state,
46
- key = _ref.key;
47
-
48
- var itExists = typeof data !== "undefined" || typeof state !== "undefined" || typeof key !== "undefined";
49
-
50
- if (itExists) {
51
- console.group("redux-ensure-state-is-immutable");
52
- console.log("data:", data);
53
- console.log("parent:", state.toJS());
54
- console.log("typeof data:", typeof data === "undefined" ? "undefined" : _typeof(data));
55
- console.log("key:", key);
56
- console.groupEnd();
57
- }
58
- };
59
-
60
- alert("something is not immutable. check console");
61
-
62
- currentKey.map(function (current) {
63
- return log(problems.get(current));
64
- });
65
- currentKey = currentKey.clear();
66
- }
67
- };
68
-
69
- var addProblem = function addProblem(_ref2) {
70
- var data = _ref2.data,
71
- state = _ref2.state,
72
- key = _ref2.key;
73
-
74
- problems = problems.set(key, {
75
- key: key,
76
- state: state,
77
- data: data
78
- });
79
-
80
- if (!allKeys.includes(key)) {
81
- allKeys = allKeys.push(key);
82
- currentKey = currentKey.push(key);
83
- }
84
- };
85
-
86
- var shouldParse = function shouldParse(data, key) {
87
- return !ignore(key) && Immutable.isImmutable(data);
88
- };
89
-
90
- var checkStateContainsOnlyImmutable = function checkStateContainsOnlyImmutable(state) {
91
- var parse = function parse(data, key) {
92
- var goodData = isGood(data, key);
93
- var canParse = shouldParse(data, key);
94
-
95
- if (!goodData) {
96
- addProblem({
97
- data: data,
98
- state: state,
99
- key: key
100
- });
101
- }
102
-
103
- listCurrentProblems();
104
-
105
- if (canParse) {
106
- checkStateContainsOnlyImmutable(data);
107
- }
108
- };
109
-
110
- state.forEach(function (current, key) {
111
- parse(current, key);
112
- });
113
- };
114
-
115
- return function (_ref3) {
116
- var getState = _ref3.getState;
117
- return function (next) {
118
- return function (action) {
119
-
120
- var returnValue = next(action),
121
- state = getState();
122
-
123
- checkStateContainsOnlyImmutable(state);
124
-
125
- return returnValue;
126
- };
127
- };
128
- };
129
- };
130
-
131
- exports.setFavIconToDev = setFavIconToDev;
132
- exports.ensureImmutableState = ensureImmutableState;
package/dev/types.js DELETED
@@ -1 +0,0 @@
1
- "use strict";