1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | (function() {
|
7 | "use strict";
|
8 | var __webpack_modules__ = ({
|
9 |
|
10 | "prop-types":
|
11 |
|
12 |
|
13 |
|
14 | (function(module) {
|
15 |
|
16 | module.exports = require("prop-types");
|
17 |
|
18 | }),
|
19 |
|
20 | "react":
|
21 |
|
22 |
|
23 |
|
24 | (function(module) {
|
25 |
|
26 | module.exports = require("react");
|
27 |
|
28 | })
|
29 |
|
30 | });
|
31 |
|
32 |
|
33 | var __webpack_module_cache__ = {};
|
34 |
|
35 |
|
36 | function __webpack_require__(moduleId) {
|
37 |
|
38 | var cachedModule = __webpack_module_cache__[moduleId];
|
39 | if (cachedModule !== undefined) {
|
40 | return cachedModule.exports;
|
41 | }
|
42 |
|
43 | var module = __webpack_module_cache__[moduleId] = {
|
44 |
|
45 |
|
46 | exports: {}
|
47 | };
|
48 |
|
49 |
|
50 | __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
51 |
|
52 |
|
53 | return module.exports;
|
54 | }
|
55 |
|
56 |
|
57 |
|
58 | !function() {
|
59 |
|
60 | __webpack_require__.n = function(module) {
|
61 | var getter = module && module.__esModule ?
|
62 | function() { return module['default']; } :
|
63 | function() { return module; };
|
64 | __webpack_require__.d(getter, { a: getter });
|
65 | return getter;
|
66 | };
|
67 | }();
|
68 |
|
69 |
|
70 | !function() {
|
71 |
|
72 | __webpack_require__.d = function(exports, definition) {
|
73 | for(var key in definition) {
|
74 | if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
75 | Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
76 | }
|
77 | }
|
78 | };
|
79 | }();
|
80 |
|
81 |
|
82 | !function() {
|
83 | __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
84 | }();
|
85 |
|
86 |
|
87 | !function() {
|
88 |
|
89 | __webpack_require__.r = function(exports) {
|
90 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
91 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
92 | }
|
93 | Object.defineProperty(exports, '__esModule', { value: true });
|
94 | };
|
95 | }();
|
96 |
|
97 |
|
98 | var __webpack_exports__ = {};
|
99 |
|
100 | !function() {
|
101 |
|
102 |
|
103 |
|
104 | __webpack_require__.r(__webpack_exports__);
|
105 | __webpack_require__.d(__webpack_exports__, {
|
106 | "default": function() { return ErrorBoundary; }
|
107 | });
|
108 | var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "react");
|
109 | var react__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
110 | var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "prop-types");
|
111 | var prop_types__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
|
112 | 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); }
|
113 |
|
114 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
115 |
|
116 | 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); } }
|
117 |
|
118 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
119 |
|
120 | 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); }
|
121 |
|
122 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
123 |
|
124 | 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); }; }
|
125 |
|
126 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
127 |
|
128 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
129 |
|
130 | 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; } }
|
131 |
|
132 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
133 |
|
134 |
|
135 |
|
136 |
|
137 | var ErrorBoundary = function (_React$Component) {
|
138 | _inherits(ErrorBoundary, _React$Component);
|
139 |
|
140 | var _super = _createSuper(ErrorBoundary);
|
141 |
|
142 | function ErrorBoundary(props) {
|
143 | var _this;
|
144 |
|
145 | _classCallCheck(this, ErrorBoundary);
|
146 |
|
147 | _this = _super.call(this, props);
|
148 | _this.state = {
|
149 | hasError: false
|
150 | };
|
151 | return _this;
|
152 | }
|
153 |
|
154 | _createClass(ErrorBoundary, [{
|
155 | key: "componentDidCatch",
|
156 | value: function componentDidCatch(error, errorInfo) {
|
157 | var onCatch = this.props.onCatch;
|
158 | if (typeof onCatch === 'function') onCatch(error, errorInfo);
|
159 | }
|
160 | }, {
|
161 | key: "render",
|
162 | value: function render() {
|
163 | var children = this.props.children;
|
164 | var hasError = this.state.hasError;
|
165 |
|
166 | if (hasError) {
|
167 |
|
168 | return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("section", null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h1", null, ":( "), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", null, "ArchEditor broken down!"), react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "Please use the browser", react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
|
169 | type: "button",
|
170 | style: {
|
171 | marginLeft: 5,
|
172 | marginRight: 5,
|
173 | border: '1px solid #ccc',
|
174 | backgroundColor: '#f0f0f0',
|
175 | color: '#666'
|
176 | }
|
177 | }, "F12"), "to troubleshoot the error."));
|
178 | }
|
179 |
|
180 | return children;
|
181 | }
|
182 | }], [{
|
183 | key: "getDerivedStateFromError",
|
184 | value: function getDerivedStateFromError() {
|
185 |
|
186 | return {
|
187 | hasError: true
|
188 | };
|
189 | }
|
190 | }]);
|
191 |
|
192 | return ErrorBoundary;
|
193 | }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
|
194 |
|
195 |
|
196 | ErrorBoundary.propTypes = {
|
197 | children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
|
198 | onCatch: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
|
199 | };
|
200 | }();
|
201 | module.exports = __webpack_exports__;
|
202 | })()
|
203 | ; |
\ | No newline at end of file |