amis/gh-pages/pkg/rest_a42f484.js

22 lines
32 KiB
JavaScript
Raw Normal View History

2020-07-31 11:19:51 +08:00
;/*!examples/index.jsx*/
amis.define("ca626e1",function(e,t){"use strict";function o(e){l.render(a.default.createElement(n.default,null),e)}Object.defineProperty(t,"__esModule",{value:!0}),t.bootstrap=void 0;var d=e("node_modules/tslib/tslib"),a=d.__importDefault(e("node_modules/react/index")),l=e("node_modules/react-dom/index"),n=d.__importDefault(e("5f106aa"));t.bootstrap=o});
;/*!examples/polyfills/Object.assign.ts*/
amis.define("d89b1f2",function(){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},writable:!0,configurable:!0})});
;/*!examples/polyfills/Array.from.ts*/
amis.define("804ccfd",function(){Array.from||(Array.from=function(){var r=Object.prototype.toString,n=function(n){return"function"==typeof n||"[object Function]"===r.call(n)},e=function(r){var n=Number(r);return isNaN(n)?0:0!==n&&isFinite(n)?(n>0?1:-1)*Math.floor(Math.abs(n)):n},t=Math.pow(2,53)-1,o=function(r){var n=e(r);return Math.min(Math.max(n,0),t)};return function(r){var e=this,t=Object(r);if(null==r)throw new TypeError("Array.from requires an array-like object - not null or undefined");var a,i=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof i){if(!n(i))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(a=arguments[2])}for(var u,f=o(t.length),c=n(e)?Object(new e(f)):new Array(f),h=0;f>h;)u=t[h],c[h]=i?"undefined"==typeof a?i(u,h):i.call(a,u,h):u,h+=1;return c.length=f,c}}())});
;/*!examples/polyfills/Array.find.ts*/
amis.define("5982bcf",function(){Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(r){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof r)throw new TypeError("predicate must be a function");for(var n=arguments[1],i=0;t>i;){var o=e[i];if(r.call(n,o,i,e))return o;i++}return void 0},configurable:!0,writable:!0})});
;/*!examples/polyfills/cloest.ts*/
amis.define("ba41ebe",function(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement}while(null!==t);return null})});
;/*!examples/polyfills/index.ts*/
amis.define("835699d",function(e,d){"use strict";Object.defineProperty(d,"__esModule",{value:!0}),e("d89b1f2"),e("804ccfd"),e("5982bcf"),e("ba41ebe"),e("node_modules/promise/polyfill"),e("node_modules/es6-symbol/implement")});
;/*!examples/embed.tsx*/
amis.define("2ab197b",function(e,t){"use strict";function n(e,t,n,c){if("string"==typeof e&&(e=document.querySelector(e)),!e)return void console.error("选择器不对,页面上没有此元素");if("BODY"===e.tagName){var l=document.createElement("div");e.appendChild(l),e=l}e.classList.add("amis-scope");var f,p=function(e){e=e||"";var t=window.location;e&&"#"===e[0]?e=t.pathname+t.search+e:e&&"?"===e[0]&&(e=t.pathname+e);var n=e.indexOf("?"),r=e.indexOf("#"),o=~n?e.substring(0,n):~r?e.substring(0,r):e,a=~n?e.substring(n,~r?r:void 0):"",i=~r?e.substring(r):t.hash;if(o){if("/"!=o[0]&&!/^https?\:\/\//.test(o)){var s=t.pathname,u=s.split("/");u.pop();for(var d=void 0;d=/^\.\.?\//.exec(o);)"../"===d[0]&&u.pop(),o=o.substring(d[0].length);o=u.concat(o).join("/")}}else o=t.pathname;return o+a+i},m=function(e){return function(t){var n=t.data;if(c&&c.responseAdpater){var o=(e.url,e.url.indexOf("?")),a=~o?u.default.parse(e.url.substring(o)):{},i=r.__assign(r.__assign({},e),{query:a,body:e.data});n=c.responseAdpater(e,n,a,i)}else n.hasOwnProperty("errno")?(n.status=n.errno,n.msg=n.errmsg):n.hasOwnProperty("no")&&(n.status=n.no,n.msg=n.error);var s=r.__assign(r.__assign({},t),{data:n});return s}};return a.render(o.default.createElement("div",{className:"amis-routes-wrapper"},o.default.createElement(d.ToastComponent,{position:c&&c.toastPosition||"top-right",closeButton:!1,timeOut:5e3,extendedTimeOut:3e3}),o.default.createElement(d.AlertComponent,{container:e}),d.render(t,r.__assign(r.__assign({},n),{scopeRef:function(e){return f=e}}),r.__assign({getModalContainer:function(){return document.querySelector(".amis-scope")},notify:function(e,t){return d.toast[e]?d.toast[e](t,"error"===e?"系统错误":"系统消息"):console.warn("[Notify]",e,t)},alert:d.alert,confirm:d.confirm,updateLocation:function(e,t){return"goBack"===e?window.history.back():void(t||(location.href=p(e)))},isCurrentUrl:function(e){var t=p(e),n=window.location,r=t,o="",a=t.indexOf("?");if(~a&&(r=t.substring(0,a),o=t.substring(a)),o){if(r!==n.pathname||!n.search)return!1;var i=u.default.parse(o.substring(1)),s=u.default.parse(n.search.substring(1));return Object.keys(i).every(function(e){return i[e]===s[e]})}return r===n.pathname?!0:!1},jumpTo:function(e,t){return"goBack"===e?window.history.back():(e=p(e),t&&"url"===t.actionType?void(t.blank===!1?window.location.href=e:window.open(e)):void(/^https?:\/\//.test(e)?window.location.replace(e):location.href=e))},fetcher:function(e){var t=e.url,n=e.method,r=e.data,o=e.responseType,a=e.config,s=e.headers;return a=a||{},a.withCredentials=!0,o&&(a.responseType=o),a.cancelExecutor&&(a.cancelToken=new i.default.CancelToken(a.cancelExecutor)),a.headers=s||{},a.method=n,"get"===n&&r?a.params=r:r&&r instanceof FormData||!r||"string"==typeof r||r instanceof Blob||r instanceof ArrayBuffer||(r=JSON.stringify(r),a.headers["Content-Type"]="application/json"),r&&(a.data=r),i.default(t,a).then(m(e))},isCancel:function(e){return i.default.isCancel(e)},copy:function(e,t){void 0===t&&(t={});var n=s.default(e,t);return n&&t.shutup!==!0&&d.toast.info("内容已拷贝到剪切板"),n},richTextToken:"",affixOffsetBottom:0},c))),e),f}Object.defineProperty(t,"__esModule",{value:!0}),t.embed=void 0;var r=e("node_modules/tslib/tslib");e("835699d");var o=r.__importDefault(e("node_modules/react/index")),a=e("node_modules/react-dom/index"),i=r.__importDefault(e("node_modules/axios/index")),s=r.__importDefault(e("node_modules/copy-to-clipboard/index")),u=r.__importDefault(e("node_modules/qs/lib/index")),d=e("d019970");t.embed=n});
;/*!examples/loader.ts*/
amis.define("3be4436",function(){function e(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var n=e.shift();return n=Array.isArray(n)?n.map(function(e){return d[e]||e}):d[n]||n,e.unshift(n),amis.require.apply(this,e)}var d={jquery:"node_modules/jquery/dist/jquery",react:"node_modules/react/index","react-dom":"node_modules/react-dom/index","react-addons-update":"node_modules/react-addons-update/index","immutability-helper":"node_modules/react-addons-update/index","react-cropper":"node_modules/react-cropper/dist/react-cropper","react-dropzone":"node_modules/react-dropzone/dist/index",classnames:"node_modules/classnames/index",axios:"node_modules/axios/index",moment:"node_modules/moment/moment",mobx:"node_modules/mobx/lib/index","mobx-state-tree":"node_modules/mobx-state-tree/dist/mobx-state-tree","react-transition-group":"node_modules/react-transition-group/index",echarts:"node_modules/echarts/index",zrender:"node_modules/zrender/index",sortablejs:"node_modules/sortablejs/Sortable",amis:"d019970","amis/embed":"2ab197b","prop-types":"node_modules/prop-types/index","async/mapLimit":"node_modules/async/mapLimit",qs:"node_modules/qs/lib/index"};window.amisRequire=e});
;/*!src/components/RichText.tsx*/
amis.define("1e5b785",function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=e("node_modules/tslib/tslib"),o=t.__importDefault(e("node_modules/react/index")),n=t.__importDefault(e("node_modules/jquery/dist/jquery"));[e("node_modules/froala-editor/js/froala_editor.min"),e("node_modules/froala-editor/js/plugins/align.min"),e("node_modules/froala-editor/js/plugins/char_counter.min"),e("node_modules/froala-editor/js/plugins/code_beautifier.min"),e("node_modules/froala-editor/js/plugins/code_view.min"),e("node_modules/froala-editor/js/plugins/colors.min"),e("node_modules/froala-editor/js/plugins/draggable.min"),e("node_modules/froala-editor/js/plugins/emoticons.min"),e("node_modules/froala-editor/js/plugins/entities.min"),e("node_modules/froala-editor/js/plugins/font_family.min"),e("node_modules/froala-editor/js/plugins/font_size.min"),e("node_modules/froala-editor/js/plugins/forms.min"),e("node_modules/froala-editor/js/plugins/fullscreen.min"),e("node_modules/froala-editor/js/plugins/help.min"),e("node_modules/froala-editor/js/plugins/image.min"),e("node_modules/froala-editor/js/plugins/image_manager.min"),e("node_modules/froala-editor/js/plugins/inline_class.min"),e("node_modules/froala-editor/js/plugins/inline_style.min"),e("node_modules/froala-editor/js/plugins/line_breaker.min"),e("node_modules/froala-editor/js/plugins/line_height.min"),e("node_modules/froala-editor/js/plugins/link.min"),e("node_modules/froala-editor/js/plugins/lists.min"),e("node_modules/froala-editor/js/plugins/paragraph_format.min"),e("node_modules/froala-editor/js/plugins/paragraph_style.min"),e("node_modules/froala-editor/js/plugins/print.min"),e("node_modules/froala-editor/js/plugins/quick_insert.min"),e("node_modules/froala-editor/js/plugins/quote.min"),e("node_modules/froala-editor/js/plugins/save.min"),e("node_modules/froala-editor/js/plugins/special_characters.min"),e("node_modules/froala-editor/js/plugins/table.min"),e("node_modules/froala-editor/js/plugins/url.min"),e("node_modules/froala-editor/js/plugins/video.min"),e("node_modules/froala-editor/js/plugins/word_paste.min")].forEach(function(e){return e()});var a=e("67d35e6"),l=function(e){function i(i){var t=e.call(this,i)||this;return t.listeningEvents=[],t.$element=null,t.$editor=null,t.config={immediateReactModelUpdate:!1,reactIgnoreAttrs:null},t.editorInitialized=!1,t.oldModel=null,t.textareaRef=t.textareaRef.bind(t),t}return t.__extends(i,e),i.prototype.componentDidUpdate=function(){JSON.stringify(this.oldModel)!=JSON.stringify(this.props.model)&&this.setContent()},i.prototype.textareaRef=function(e){e?this.createEditor(e):this.destroyEditor()},i.prototype.createEditor=function(e){this.editorInitialized||(this.config=this.props.config||this.config,this.$element=n.default(e),this.setContent(!0),this.registerEvents(),a.resizeSensor(e.parentElement,function(){n.default(e).prev(".fr-box").find(".fr-toolbar").css("width","")}),this.$editor=this.$element.froalaEditor(this.config).data("froala.editor").$el,this.initListeners(),this.editorInitialized=!0)},i.prototype.setContent=function(e){void 0===e&&(e=!1),(this.editorInitialized||e)&&(this.props.model||""==this.props.model)&&(this.oldModel=this.props.model,this.setNormalTagContent(e))},i.prototype.setNormalTagContent=function(e){function i(){t.$element.froalaEditor("html.set",t.props.model||"",!0),t.$element.froalaEditor("undo.reset"),t.$element.froalaEditor("undo.saveStep")}var t=this;e?this.registerEvent(this.$element,"froalaEditor.initialized",i):i()},i.prototype.getEditor=function(){return this.$element?this.$element.froalaEditor.bind(this.$element):null},i.prototype.updateModel=function(){if(this.props.onModelChange){var e="",i=this.$element.froalaEditor("html.get");"string"==typeof i&&(e=i),this.oldModel=e,this.props.onModelChange(e)}},i.prototype.initListeners=function(){var e=this;this.registerEvent(this.$element,"froalaEditor.contentChanged",function(){e.updateModel()}),this.config.immediateReactModelUpdate&&this.registerEvent(this.$editor,"keyup",function(){e.updateModel()})},i.prototype.registerEvent=f
;/*!examples/loadMonacoEditor.ts*/
amis.define("b961301",function(s,a){"use strict";function e(s){var a="https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/loader_e45cf1a.js",e=amis.require.loadJs(c(a));e.onload=function(){return i(window.require,s)}}function c(s){return s}function i(s,a){var e={"vs/nls":{availableLanguages:{"*":"zh-cn"}},paths:{vs:"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/editor/editor.main_147bfda.js".replace(/\/vs\/.*$/,""),"vs/base/worker/workerMain":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/base/worker/workerMain_3c46a35.js","vs/basic-languages/apex/apex":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/apex/apex_d4ae4dd.js","vs/basic-languages/azcli/azcli":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/azcli/azcli_1b0ef3f.js","vs/basic-languages/clojure/clojure":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/clojure/clojure_903e94b.js","vs/basic-languages/bat/bat":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/bat/bat_9d67e6c.js","vs/basic-languages/coffee/coffee":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/coffee/coffee_ed86fc7.js","vs/basic-languages/cpp/cpp":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/cpp/cpp_4f3f527.js","vs/basic-languages/csharp/csharp":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/csharp/csharp_6d526d9.js","vs/basic-languages/css/css":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/css/css_9b5d23e.js","vs/basic-languages/dockerfile/dockerfile":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/dockerfile/dockerfile_ae15175.js","vs/basic-languages/fsharp/fsharp":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/fsharp/fsharp_899ae6c.js","vs/basic-languages/go/go":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/go/go_c9012ae.js","vs/basic-languages/handlebars/handlebars":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/handlebars/handlebars_3b4ba3a.js","vs/basic-languages/html/html":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/html/html_cae751f.js","vs/basic-languages/ini/ini":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/ini/ini_d156643.js","vs/basic-languages/java/java":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/java/java_d1eb191.js","vs/basic-languages/javascript/javascript":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/javascript/javascript_b58352d.js","vs/basic-languages/less/less":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/less/less_a309479.js","vs/basic-languages/lua/lua":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/lua/lua_c8b58eb.js","vs/basic-languages/markdown/markdown":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/markdown/markdown_7c5bc2f.js","vs/basic-languages/msdax/msdax":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/msdax/msdax_d5bc491.js","vs/basic-languages/objective-c/objective-c":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/objective-c/objective-c_1fec7dc.js","vs/basic-languages/php/php":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/php/php_b5da4f5.js","vs/basic-languages/postiats/postiats":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/postiats/postiats_20abb55.js","vs/basic-languages/powershell/powershell":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monaco-editor/min/vs/basic-languages/powershell/powershell_d8ffc04.js","vs/basic-languages/pug/pug":"https://bce.bdstatic.com/fex/amis-gh-pages/n/monac
;/*!examples/components/Play.jsx*/
2020-08-01 00:31:48 +08:00
amis.define("9b1667d",function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=e("node_modules/tslib/tslib"),n=o.__importDefault(e("node_modules/react/index")),a=e("6ae88e0"),s=e("d019970"),i=o.__importDefault(e("node_modules/axios/index")),r=o.__importDefault(e("node_modules/react-frame-component/lib/index")),l=o.__importDefault(e("node_modules/strip-json-comments/index")),d=o.__importDefault(e("997c87d")),h='{\n "$schema": "https://houtai.baidu.com/v2/schemas/page.json#",\n "type": "page",\n "title": "Title",\n "body": "Body",\n "aside": "Aside",\n "toolbar": "Toolbar"\n}',u={none:"",body:'{\n "type": "page",\n "body": SCHEMA_PLACEHOLDER\n }',form:'{\n "type": "page",\n "body": {\n "title": "",\n "type": "form",\n "autoFocus": false,\n "api": "https://houtai.baidu.com/api/mock2/saveForm?waitSeconds=1",\n "mode": "horizontal",\n "controls": SCHEMA_PLACEHOLDER,\n "submitText": null,\n "actions": []\n }\n }',"form-item":'{\n "type": "page",\n "body": {\n "title": "",\n "type": "form",\n "mode": "horizontal",\n "autoFocus": false,\n "controls": [\n SCHEMA_PLACEHOLDER\n ],\n "submitText": null,\n "actions": []\n }\n }'},c=function(e){function t(t){var n=e.call(this,t)||this;n.state=null,n.startX=0,n.oldContents="";var s=n.buildSchema(t.code||h,t);n.state={asideWidth:t.asideWidth||Math.max(300,.3*window.innerWidth),schema:s,schemaCode:JSON.stringify(s,null,2)},n.handleMouseDown=n.handleMouseDown.bind(n),n.handleMouseMove=n.handleMouseMove.bind(n),n.handleMouseUp=n.handleMouseUp.bind(n),n.removeWindowEvents=n.removeWindowEvents.bind(n),n.handleChange=n.handleChange.bind(n),n.schemaProps={style:{height:"100%"}},n.env={session:"doc",updateLocation:function(){},fetcher:function(e){return e=o.__assign({dataType:"json"},e),"json"===e.dataType&&e.data&&(e.data=JSON.stringify(e.data),e.headers=e.headers||{},e.headers["Content-Type"]="application/json"),i.default[e.method](e.url,e.data,e)},notify:function(e,t){return a.toast[e]?a.toast[e](t,"error"===e?"系统错误":"系统消息"):console.warn("[Notify]",e,t)}};var r=[].slice.call(document.head.querySelectorAll("link,style")).map(function(e){return e.outerHTML});return n.frameTemplate="<!DOCTYPE html><html><head>"+r.join("")+"</head><body><div></div></body></html>",n}return o.__extends(t,e),t.prototype.componentWillReceiveProps=function(e){var t=this.props;if(t.code!==e.code){var o=this.buildSchema(e.code||h,e);this.setState({schema:o,schemaCode:JSON.stringify(o,null,2)})}},t.prototype.componentDidMount=function(){this.props.setAsideFolded&&this.props.setAsideFolded(!0)},t.prototype.componentWillUnmount=function(){this.props.setAsideFolded&&this.props.setAsideFolded(!1)},t.prototype.buildSchema=function(e,t){void 0===t&&(t=this.props);var o=t.location.query;try{var n=o.scope||t.scope;return n&&u[n]&&(e=u[n].replace("SCHEMA_PLACEHOLDER",e)),e=l.default(e).replace(/('|")raw:/g,"$1"),JSON.parse(e)}catch(a){console.error(this.formatMessage(a.message,e))}return{}},t.prototype.formatMessage=function(e,t){if(/position\s?(\d+)$/.test(e)){var o=t.substring(0,parseInt(RegExp.$1,10)).split(/\n|\r\n|\r/);e="Json 语法错误,请检测。出错位置:"+o.length+",列:"+o[o.length-1].length+"。"}return e},t.prototype.renderPreview=function(){var e=this.state.schema,t=o.__assign(o.__assign({},this.schemaProps),{theme:this.props.theme,locale:this.props.locale,affixHeader:!1,affixFooter:!1});return this.props.useIFrame?n.default.createElement(r.default,{width:"100%",height:"100%",frameBorder:0,initialContent:this.frameTemplate},s.render(e,t,this.env)):s.render(e,t,this.env)},t.prototype.handleChange=function(e){this.setState({schemaCode:e});try{var t=JSON.parse(e);this.setState({schema:t})}catch(o){}},t.prototype.handleMouseDown=function(e){return this.startX=e.clientX,this.startWidth=this.state