@times-components/error-view 2.4.5 → 2.5.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.
- package/CHANGELOG.md +11 -0
- package/babel.config.js +6 -5
- package/dist/error-view.js +88 -1
- package/package.json +12 -21
- package/rnw.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.5.0](https://github.com/newsuk/times-components/compare/@times-components/error-view@2.4.5...@times-components/error-view@2.5.0) (2022-08-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **TDP-1712:** remove react-native foreverrrrr ([#3064](https://github.com/newsuk/times-components/issues/3064)) ([2a20cb5](https://github.com/newsuk/times-components/commit/2a20cb5abc10a4e7ca2d62487967f8fcf4eccb62)), closes [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3050](https://github.com/newsuk/times-components/issues/3050) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3057](https://github.com/newsuk/times-components/issues/3057) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3065](https://github.com/newsuk/times-components/issues/3065) [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3069](https://github.com/newsuk/times-components/issues/3069) [#3068](https://github.com/newsuk/times-components/issues/3068) [#3070](https://github.com/newsuk/times-components/issues/3070) [#3072](https://github.com/newsuk/times-components/issues/3072) [#3073](https://github.com/newsuk/times-components/issues/3073) [#3071](https://github.com/newsuk/times-components/issues/3071) [#3074](https://github.com/newsuk/times-components/issues/3074) [#3076](https://github.com/newsuk/times-components/issues/3076) [#3079](https://github.com/newsuk/times-components/issues/3079) [#3078](https://github.com/newsuk/times-components/issues/3078) [#3083](https://github.com/newsuk/times-components/issues/3083) [#3087](https://github.com/newsuk/times-components/issues/3087) [#3091](https://github.com/newsuk/times-components/issues/3091) [#3096](https://github.com/newsuk/times-components/issues/3096) [#3102](https://github.com/newsuk/times-components/issues/3102) [#3105](https://github.com/newsuk/times-components/issues/3105) [#3108](https://github.com/newsuk/times-components/issues/3108) [#3111](https://github.com/newsuk/times-components/issues/3111) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3113](https://github.com/newsuk/times-components/issues/3113) [#3114](https://github.com/newsuk/times-components/issues/3114) [#3120](https://github.com/newsuk/times-components/issues/3120) [#3119](https://github.com/newsuk/times-components/issues/3119) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3127](https://github.com/newsuk/times-components/issues/3127) [#3116](https://github.com/newsuk/times-components/issues/3116) [#3128](https://github.com/newsuk/times-components/issues/3128) [#3132](https://github.com/newsuk/times-components/issues/3132) [#3133](https://github.com/newsuk/times-components/issues/3133)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.4.5](https://github.com/newsuk/times-components/compare/@times-components/error-view@2.4.4...@times-components/error-view@2.4.5) (2022-08-05)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @times-components/error-view
|
package/babel.config.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
module.exports = api => {
|
|
2
2
|
api.cache(true);
|
|
3
3
|
return {
|
|
4
|
-
plugins: [
|
|
5
|
-
|
|
6
|
-
"@babel/
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
plugins: ["babel-plugin-styled-components"],
|
|
5
|
+
presets: [
|
|
6
|
+
"@babel/preset-env",
|
|
7
|
+
"@babel/preset-react",
|
|
8
|
+
"@babel/preset-typescript"
|
|
9
|
+
]
|
|
9
10
|
};
|
|
10
11
|
};
|
package/dist/error-view.js
CHANGED
|
@@ -1 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
+
|
|
18
|
+
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); } }
|
|
19
|
+
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21
|
+
|
|
22
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
23
|
+
|
|
24
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
+
|
|
26
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
27
|
+
|
|
28
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
29
|
+
|
|
30
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
|
+
|
|
32
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
33
|
+
|
|
34
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
|
+
|
|
36
|
+
var ErrorView = /*#__PURE__*/function (_Component) {
|
|
37
|
+
_inherits(ErrorView, _Component);
|
|
38
|
+
|
|
39
|
+
var _super = _createSuper(ErrorView);
|
|
40
|
+
|
|
41
|
+
function ErrorView(props) {
|
|
42
|
+
var _this;
|
|
43
|
+
|
|
44
|
+
_classCallCheck(this, ErrorView);
|
|
45
|
+
|
|
46
|
+
_this = _super.call(this, props);
|
|
47
|
+
_this.state = {
|
|
48
|
+
error: null
|
|
49
|
+
};
|
|
50
|
+
_this.handleError = _this.handleError.bind(_assertThisInitialized(_this));
|
|
51
|
+
return _this;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
_createClass(ErrorView, [{
|
|
55
|
+
key: "componentDidCatch",
|
|
56
|
+
value: function componentDidCatch(e) {
|
|
57
|
+
this.setState({
|
|
58
|
+
error: e
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
key: "handleError",
|
|
63
|
+
value: function handleError(e) {
|
|
64
|
+
this.setState({
|
|
65
|
+
error: e
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "render",
|
|
70
|
+
value: function render() {
|
|
71
|
+
var children = this.props.children;
|
|
72
|
+
var error = this.state.error;
|
|
73
|
+
return children({
|
|
74
|
+
error: error,
|
|
75
|
+
hasError: !!error,
|
|
76
|
+
onError: this.handleError
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}]);
|
|
80
|
+
|
|
81
|
+
return ErrorView;
|
|
82
|
+
}(_react.Component);
|
|
83
|
+
|
|
84
|
+
ErrorView.propTypes = {
|
|
85
|
+
children: _propTypes["default"].func.isRequired
|
|
86
|
+
};
|
|
87
|
+
var _default = ErrorView;
|
|
88
|
+
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/error-view",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Handles errors",
|
|
5
5
|
"main": "dist/error-view",
|
|
6
6
|
"dev": "src/error-view",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"prettier:diff": "prettier --list-different '**/*.*'",
|
|
10
10
|
"depcheck": "depcheck --ignores='@babel/*,babel-*,depcheck,eslint,jest,prettier,react-art,webpack*' --ignore-bin-package=false --skip-missing",
|
|
11
11
|
"lint": "eslint . && yarn prettier:diff && yarn depcheck",
|
|
12
|
-
"test:web": "jest --config='./__tests__/
|
|
12
|
+
"test:web": "jest --config='./__tests__/jest.config.js'",
|
|
13
13
|
"prepublishOnly": "yarn transpile && yarn bundle",
|
|
14
14
|
"watch": "watch 'yarn bundle' ./src --ignoreDotFiles --ignoreUnreadable",
|
|
15
15
|
"cleanup-dist": "rm -rf dist",
|
|
@@ -21,9 +21,7 @@
|
|
|
21
21
|
"url": "git+https://github.com/newsuk/times-components.git"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
|
-
"react-native-web",
|
|
25
24
|
"react",
|
|
26
|
-
"native",
|
|
27
25
|
"web",
|
|
28
26
|
"error",
|
|
29
27
|
"component"
|
|
@@ -36,30 +34,25 @@
|
|
|
36
34
|
"devDependencies": {
|
|
37
35
|
"@babel/core": "7.4.4",
|
|
38
36
|
"@times-components/eslint-config-thetimes": "0.8.18",
|
|
39
|
-
"@times-components/jest-configurator": "
|
|
40
|
-
"@times-components/jest-serializer": "3.
|
|
41
|
-
"@times-components/storybook": "4.
|
|
42
|
-
"@times-components/test-utils": "2.
|
|
43
|
-
"@times-components/webpack-configurator": "2.0
|
|
37
|
+
"@times-components/jest-configurator-web": "0.8.0",
|
|
38
|
+
"@times-components/jest-serializer": "3.4.0",
|
|
39
|
+
"@times-components/storybook": "4.5.0",
|
|
40
|
+
"@times-components/test-utils": "2.4.0",
|
|
41
|
+
"@times-components/webpack-configurator": "2.1.0",
|
|
44
42
|
"babel-jest": "24.8.0",
|
|
45
43
|
"babel-loader": "8.0.5",
|
|
46
|
-
"babel-plugin-add-react-displayname": "0.0.5",
|
|
47
|
-
"babel-plugin-styled-components": "1.10.6",
|
|
48
44
|
"depcheck": "0.6.9",
|
|
49
45
|
"eslint": "5.9.0",
|
|
50
46
|
"jest": "24.8.0",
|
|
51
47
|
"prettier": "1.14.3",
|
|
52
48
|
"react": "16.9.0",
|
|
53
|
-
"react-art": "16.6.3",
|
|
54
49
|
"react-dom": "16.9.0",
|
|
55
|
-
"react-native": "0.61.5",
|
|
56
|
-
"react-native-web": "0.11.4",
|
|
57
50
|
"react-test-renderer": "16.9.0",
|
|
58
|
-
"webpack": "4.30.0"
|
|
59
|
-
"webpack-cli": "3.3.1"
|
|
51
|
+
"webpack": "4.30.0"
|
|
60
52
|
},
|
|
61
53
|
"dependencies": {
|
|
62
|
-
"@times-components/ts-styleguide": "1.
|
|
54
|
+
"@times-components/ts-styleguide": "1.37.0",
|
|
55
|
+
"@times-components/utils": "6.15.0",
|
|
63
56
|
"prop-types": "15.7.2"
|
|
64
57
|
},
|
|
65
58
|
"resolutions": {
|
|
@@ -68,12 +61,10 @@
|
|
|
68
61
|
},
|
|
69
62
|
"peerDependencies": {
|
|
70
63
|
"react": ">=16.9",
|
|
71
|
-
"react-dom": ">=16.9"
|
|
72
|
-
"react-native": ">=0.59",
|
|
73
|
-
"react-native-web": "0.11.4"
|
|
64
|
+
"react-dom": ">=16.9"
|
|
74
65
|
},
|
|
75
66
|
"publishConfig": {
|
|
76
67
|
"access": "public"
|
|
77
68
|
},
|
|
78
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "fe2f12b7448a88662c53f840772282cd97756c5c"
|
|
79
70
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(
|
|
1
|
+
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e){t.exports=require("react")},function(t,e,r){"use strict";r.r(e);var n=r(0);r(2);function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=a(t);if(e){var o=a(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}function f(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?l(t):e}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var p=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}(f,t);var e,r,n,o=c(f);function f(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),(e=o.call(this,t)).state={error:null},e.handleError=e.handleError.bind(l(e)),e}return e=f,(r=[{key:"componentDidCatch",value:function(t){this.setState({error:t})}},{key:"handleError",value:function(t){this.setState({error:t})}},{key:"render",value:function(){var t=this.props.children,e=this.state.error;return t({error:e,hasError:!!e,onError:this.handleError})}}])&&u(e.prototype,r),n&&u(e,n),f}(n.Component);e.default=p},function(t,e){t.exports=require("prop-types")}]);
|