arch-editor
Version:
Rich text editor with a high degree of customization.
2 lines • 3.18 kB
JavaScript
/*! For license information please see ErrorBoundary.js.LICENSE.txt */
!function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:function(){return p}});var r=require("react"),n=e.n(r),o=require("prop-types"),u=e.n(o);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(s,e);var t,r,o,u,c,p=(u=s,c=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(e){return!1}}(),function(){var e,t=a(u);if(c){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return l(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=p.call(this,e)).state={hasError:!1},t}return t=s,o=[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}],(r=[{key:"componentDidCatch",value:function(e,t){var r=this.props.onCatch;"function"==typeof r&&r(e,t)}},{key:"render",value:function(){var e=this.props.children;return this.state.hasError?n().createElement("section",null,n().createElement("h1",null,":( "),n().createElement("h3",null,"ArchEditor broken down!"),n().createElement("p",null,"Please use the browser",n().createElement("button",{type:"button",style:{marginLeft:5,marginRight:5,border:"1px solid #ccc",backgroundColor:"#f0f0f0",color:"#666"}},"F12"),"to troubleshoot the error.")):e}}])&&i(t.prototype,r),o&&i(t,o),s}(n().Component);p.propTypes={children:u().element,onCatch:u().func},module.exports=t}();