forked from Gitlink/forgeplus
1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[86],{"4oKn":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n("M/lh")),o=a(n("17x9")),i=a(n("q1tI")),u=n("JwdM");function a(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}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 s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}function y(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?v(e):t}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=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&&d(e,t)}(l,e);var t,n,o,a=h(l);function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),g(v(t=a.call(this,e)),"assignRef",(function(e){t.containerElement=e})),t.containerElement=void 0,t}return t=l,(n=[{key:"componentDidMount",value:function(){this.initMonaco()}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.language,o=t.theme,i=t.height,u=t.options,a=t.width,l=this.editor.getModel(),c=l.original,s=l.modified;this.props.original!==c.getValue()&&c.setValue(this.props.original),null!=this.props.value&&this.props.value!==s.getValue()&&(this.__prevent_trigger_change_event=!0,this.editor.modifiedEditor.pushUndoStop(),s.pushEditOperations([],[{range:s.getFullModelRange(),text:this.props.value}]),this.editor.modifiedEditor.pushUndoStop(),this.__prevent_trigger_change_event=!1),e.language!==n&&(r.editor.setModelLanguage(c,n),r.editor.setModelLanguage(s,n)),e.theme!==o&&r.editor.setTheme(o),!this.editor||a===e.width&&i===e.height||this.editor.layout(),e.options!==u&&this.editor.updateOptions(u)}},{key:"componentWillUnmount",value:function(){this.destroyMonaco()}},{key:"editorWillMount",value:function(){var e=this.props.editorWillMount;return e(r)||{}}},{key:"editorDidMount",value:function(e){var t=this;this.props.editorDidMount(e,r);var n=e.getModel().modified;this._subscription=n.onDidChangeContent((function(e){t.__prevent_trigger_change_event||t.props.onChange(n.getValue(),e)}))}},{key:"initModels",value:function(e,t){var n=this.props.language,o=r.editor.createModel(t,n),i=r.editor.createModel(e,n);this.editor.setModel({original:o,modified:i})}},{key:"initMonaco",value:function(){var e=null!=this.props.value?this.props.value:this.props.defaultValue,t=this.props,n=t.original,o=t.theme,i=t.options,u=t.overrideServices;this.containerElement&&(this.editorWillMount(),this.editor=r.editor.createDiffEditor(this.containerElement,f(f({},i),o?{theme:o}:{}),u),this.initModels(e,n),this.editorDidMount(this.editor))}},{key:"destroyMonaco",value:function(){if(this.editor){this.editor.dispose();var e=this.editor.getModel(),t=e.original,n=e.modified;t&&t.dispose(),n&&n.dispose()}this._subscription&&this._subscription.dispose()}},{key:"render",value:function(){var e=this.props,t=e.width,n=e.height,r={width:(0,u.processSize)(t),height:(0,u.processSize)(n)};return i.default.createElement("div",{ref:this.assignRef,style:r,className:"react-monaco-editor-container"})}}])&&p(t.prototype,n),o&&p(t,o),l}(i.default.Component);m.propTypes={width:o.default.oneOfType([o.default.string,o.default.number]),height:o.default.oneOfType([o.default.string,o.default.number]),original:o.default.string,value:o.default.string,defaultValue:o.default.string,language:o.default.string,theme:o.default.string,options:o.default.object,overrideServices:o.default.object,editorDidMount:o.default.func,editorWillMount:o.default.func,onChange:o.default.func},m.defaultProps={width:"100%",height:"100%",original:null,value:null,defaultValue:"",language:"javascript",theme:null,options:{},overrideServices:{},editorDidMount:u.noop,editorWillMount:u.noop,onChange:u.noop};var O=m;t.default=O},JwdM:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processSize=function(e){return/^\d+$/.test(e)?"".concat(e,"px"):e},t.noop=function(){}},NJEC:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n("VCL8"),i=n("3S7+"),u=n("CtXQ"),a=n("2/Rp"),l=n("YMnH"),c=n("ZvpZ"),s=n("H84U");function f(e){return(f="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 p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?b(e):t}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},O=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&&h(e,t)}(f,e);var t,n,o,u=y(f);function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=u.call(this,e)).onConfirm=function(e){t.setVisible(!1,e);var n=t.props.onConfirm;n&&n.call(b(t),e)},t.onCancel=function(e){t.setVisible(!1,e);var n=t.props.onCancel;n&&n.call(b(t),e)},t.onVisibleChange=function(e){t.props.disabled||t.setVisible(e)},t.saveTooltip=function(e){t.tooltip=e},t.renderOverlay=function(e,n){var o=t.props,i=o.okButtonProps,u=o.cancelButtonProps,l=o.title,c=o.cancelText,s=o.okText,f=o.okType,d=o.icon;return r.createElement("div",null,r.createElement("div",{className:"".concat(e,"-inner-content")},r.createElement("div",{className:"".concat(e,"-message")},d,r.createElement("div",{className:"".concat(e,"-message-title")},l)),r.createElement("div",{className:"".concat(e,"-buttons")},r.createElement(a.default,p({onClick:t.onCancel,size:"small"},u),c||n.cancelText),r.createElement(a.default,p({onClick:t.onConfirm,type:f,size:"small"},i),s||n.okText))))},t.renderConfirm=function(e){var n=e.getPrefixCls,o=t.props,u=o.prefixCls,a=o.placement,s=m(o,["prefixCls","placement"]),f=n("popover",u),d=r.createElement(l.a,{componentName:"Popconfirm",defaultLocale:c.a.Popconfirm},(function(e){return t.renderOverlay(f,e)}));return r.createElement(i.default,p({},s,{prefixCls:f,placement:a,onVisibleChange:t.onVisibleChange,visible:t.state.visible,overlay:d,ref:t.saveTooltip}))},t.state={visible:e.visible},t}return t=f,o=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:"defaultVisible"in e?{visible:e.defaultVisible}:null}}],(n=[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"setVisible",value:function(e,t){var n=this.props;"visible"in n||this.setState({visible:e});var r=n.onVisibleChange;r&&r(e,t)}},{key:"render",value:function(){return r.createElement(s.a,null,this.renderConfirm)}}])&&d(t.prototype,n),o&&d(t,o),f}(r.Component);O.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:r.createElement(u.default,{type:"exclamation-circle",theme:"filled"}),disabled:!1},Object(o.polyfill)(O),t.default=O},gL5p:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"MonacoDiffEditor",{enumerable:!0,get:function(){return o.default}});var r=i(n("j6EG")),o=i(n("4oKn"));function i(e){return e&&e.__esModule?e:{default:e}}},j6EG:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n("M/lh")),o=a(n("17x9")),i=a(n("q1tI")),u=n("JwdM");function a(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}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 s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?b(e):t}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O=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&&h(e,t)}(l,e);var t,n,o,a=y(l);function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),m(b(t=a.call(this,e)),"assignRef",(function(e){t.containerElement=e})),t.containerElement=void 0,t}return t=l,(n=[{key:"componentDidMount",value:function(){this.initMonaco()}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.value,o=t.language,i=t.theme,u=t.height,a=t.options,l=t.width,c=this.editor,s=c.getModel();if(null!=this.props.value&&this.props.value!==s.getValue()&&(this.__prevent_trigger_change_event=!0,this.editor.pushUndoStop(),s.pushEditOperations([],[{range:s.getFullModelRange(),text:n}]),this.editor.pushUndoStop(),this.__prevent_trigger_change_event=!1),e.language!==o&&r.editor.setModelLanguage(s,o),e.theme!==i&&r.editor.setTheme(i),!c||l===e.width&&u===e.height||c.layout(),e.options!==a){a.model;var f=p(a,["model"]);c.updateOptions(f)}}},{key:"componentWillUnmount",value:function(){this.destroyMonaco()}},{key:"destroyMonaco",value:function(){if(this.editor){this.editor.dispose();var e=this.editor.getModel();e&&e.dispose()}this._subscription&&this._subscription.dispose()}},{key:"initMonaco",value:function(){var e=null!=this.props.value?this.props.value:this.props.defaultValue,t=this.props,n=t.language,o=t.theme,i=t.options,u=t.overrideServices;this.containerElement&&(Object.assign(i,this.editorWillMount()),this.editor=r.editor.create(this.containerElement,f(f({value:e,language:n},i),o?{theme:o}:{}),u),this.editorDidMount(this.editor))}},{key:"editorWillMount",value:function(){var e=this.props.editorWillMount;return e(r)||{}}},{key:"editorDidMount",value:function(e){var t=this;this.props.editorDidMount(e,r),this._subscription=e.onDidChangeModelContent((function(n){t.__prevent_trigger_change_event||t.props.onChange(e.getValue(),n)}))}},{key:"render",value:function(){var e=this.props,t=e.width,n=e.height,r={width:(0,u.processSize)(t),height:(0,u.processSize)(n)};return i.default.createElement("div",{ref:this.assignRef,style:r,className:"react-monaco-editor-container"})}}])&&d(t.prototype,n),o&&d(t,o),l}(i.default.Component);O.propTypes={width:o.default.oneOfType([o.default.string,o.default.number]),height:o.default.oneOfType([o.default.string,o.default.number]),value:o.default.string,defaultValue:o.default.string,language:o.default.string,theme:o.default.string,options:o.default.object,overrideServices:o.default.object,editorDidMount:o.default.func,editorWillMount:o.default.func,onChange:o.default.func},O.defaultProps={width:"100%",height:"100%",value:null,defaultValue:"",language:"javascript",theme:null,options:{},overrideServices:{},editorDidMount:u.noop,editorWillMount:u.noop,onChange:u.noop};var j=O;t.default=j},k994:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("Aosp"),n("L/Qf")}}]); |