@alifd/adaptor-render
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -77,3 +77,4 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
var Adaptor = findAdaptor(name); | ||
var demos = getDemos(Adaptor); | ||
if (!Adaptor || !Adaptor.name) return null; | ||
var demos = getDemos(Adaptor) || []; | ||
count += demos.length; | ||
@@ -80,0 +81,0 @@ return React.createElement("div", { |
@@ -72,3 +72,4 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
return Promise.all(components.map(function (_ref2) { | ||
var script = _ref2.script, | ||
var name = _ref2.name, | ||
script = _ref2.script, | ||
stylesheet = _ref2.stylesheet; | ||
@@ -84,6 +85,10 @@ if (!script) return; | ||
} | ||
}).catch(function () { | ||
console.error("[".concat(name, "] script (").concat(script, ") load error ! please contact the developer")); | ||
})); | ||
if (stylesheet) { | ||
tasks.push(loadStylesheet(stylesheet)); | ||
tasks.push(loadStylesheet(stylesheet).catch(function () { | ||
console.error("[".concat(name, "] stylesheet (").concat(stylesheet, ") load error ! please contact the developer")); | ||
})); | ||
} | ||
@@ -90,0 +95,0 @@ |
{ | ||
"name": "@alifd/adaptor-render", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"main": "umd/react/adaptor-render.development.js", | ||
@@ -5,0 +5,0 @@ "unpkg": "umd/react/adaptor-render.production.min.js", |
@@ -39,4 +39,6 @@ import React, { useState } from 'react'; | ||
const Adaptor = findAdaptor(name); | ||
if (!Adaptor || !Adaptor.name) return null; | ||
let demos = getDemos(Adaptor); | ||
let demos = getDemos(Adaptor) || []; | ||
@@ -43,0 +45,0 @@ count += demos.length; |
@@ -68,3 +68,3 @@ import { normalizeAdaptor, generateDemos, getDefaultProps, STATE_MARK, Types, findProp } from '@alifd/adaptor-helper'; | ||
if (components) { // 加载业务组件 adaptor | ||
await Promise.all(components.map(({ script, stylesheet }) => { | ||
await Promise.all(components.map(({ name, script, stylesheet }) => { | ||
if (!script) return; | ||
@@ -84,6 +84,11 @@ const tasks = []; | ||
}) | ||
.catch(() => { | ||
console.error(`[${name}] script (${script}) load error ! please contact the developer`) | ||
}) | ||
); | ||
if (stylesheet) { | ||
tasks.push(loadStylesheet(stylesheet)) | ||
tasks.push(loadStylesheet(stylesheet).catch(() => { | ||
console.error(`[${name}] stylesheet (${stylesheet}) load error ! please contact the developer`); | ||
})); | ||
} | ||
@@ -90,0 +95,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):(t=t||self).AdaptorRender=e(t.React,t.ReactDOM)}(this,function(g,d){"use strict";var b="default"in g?g.default:g;d=d&&d.hasOwnProperty("default")?d.default:d;var t,h=(function(t){var e=function(i){var u,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function a(t,e,n,r){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new _(r||[]);return i._invoke=function(i,a,c){var u=f;return function(t,e){if(u===d)throw new Error("Generator is already running");if(u===h){if("throw"===t)throw e;return L()}for(c.method=t,c.arg=e;;){var n=c.delegate;if(n){var r=S(n,c);if(r){if(r===m)continue;return r}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(u===f)throw u=h,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u=d;var o=s(i,a,c);if("normal"===o.type){if(u=c.done?h:p,o.arg===m)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u=h,c.method="throw",c.arg=o.arg)}}}(t,n,a),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=a;var f="suspendedStart",p="suspendedYield",d="executing",h="completed",m={};function c(){}function v(){}function y(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,C=b&&b(b(j([])));C&&C!==t&&l.call(C,o)&&(g=C);var w=y.prototype=c.prototype=Object.create(g);function E(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function x(u){var e;this._invoke=function(n,r){function t(){return new Promise(function(t,e){!function e(t,n,r,o){var i=s(u[t],u,n);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==typeof c&&l.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):Promise.resolve(c).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function S(t,e){var n=t.iterator[e.method];if(n===u){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=u,S(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,m;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u),e.delegate=null,m):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=u,t.done=!0,t};return r.next=r}}return{next:L}}function L(){return{value:u,done:!0}}return v.prototype=w.constructor=y,y.constructor=v,y[r]=v.displayName="GeneratorFunction",i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,r in t||(t[r]="GeneratorFunction")),t.prototype=Object.create(w),t},i.awrap=function(t){return{__await:t}},E(x.prototype),x.prototype[n]=function(){return this},i.AsyncIterator=x,i.async=function(t,e,n,r){var o=new x(a(t,e,n,r));return i.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},E(w),w[r]="Generator",w[o]=function(){return this},w.toString=function(){return"[object Generator]"},i.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},i.values=j,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),c=l.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=u),m}},i}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(t={exports:{}},t.exports),t.exports);function C(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},e=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable}))),e.forEach(function(t){var e,n,r;e=o,r=i[n=t],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return o}function u(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function n(c){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=c.apply(t,a);function o(t){u(r,e,n,o,i,"next",t)}function i(t){u(r,e,n,o,i,"throw",t)}o(void 0)})}}var e,r,o,i,a,c,w={"-":"disabled","*":"active","~":"hover","":"normal"},m={};Object.keys(w).forEach(function(t){m[w[t]]=t}),(r=e||(e={})).divider="divider",r.node="node",r.comment="comment",(i=o||(o={})).text="text",i.icon="icon",(c=a||(a={})).enum="enum",c.string="string",c.number="number",c.bool="bool",c.node="node",c.nodeList="node-list";function l(t){return t.replace(/\B([A-Z])/g,"-$1").split(/[-|_]/).map(function(t){return function(t){return t?[t.substring(0,1).toUpperCase(),t.substring(1)].join(""):""}(t)}).join(" ")}var y=a;function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){s(e,t,n[t])})}return e}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}for(var f=function(){return(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).filter(function(t){return!!t}).map(function(t){return v({},t,{label:t.label||l(t.name),options:function(){return(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).filter(function(t){return!!t}).map(function(t){var e=t.value||t;return{value:e,label:t.label||l(e)}})}(t.options)})})},p=function(n){if(!n.name)return console.error("[error] muse be have name:"),n;var t;t=!n.shape||!Array.isArray(n.shape)||n.shape.length<1?[{label:n.name,value:"normal"}]:n.shape.filter(function(t){return!!t}).map(function(t){var e=t.value||t;return{value:e,label:t.label||"".concat(l(e)," ").concat("normal"===e?"":n.name)}});return v({},n,{shape:t,editor:function(t){var e=n.editor?n.editor(t):{};return e.props||(e.props=[]),e.nodes||(e.nodes=[]),v({},e,{props:f(e.props),nodes:f(e.nodes)})},content:function(t){var e=n.content?n.content(t):{};return v({},e,{options:f(e.options)})}})},E=function(t,e){var n=t.editor(e),r={shape:e,data:n.data&&n.data.default||""};return n.props.forEach(function(t){var e=t.default;if(null==e)switch(t.type){case y.string:e="";break;case y.number:e=0;break;case y.bool:e=!1;break;case y.enum:e=t.options?t.options[0].value:""}r[t.name]=e}),n.nodes.forEach(function(t){var e=t.name,n=t.default;r[e]=n}),r},x=function(e){return(1<arguments.length&&void 0!==arguments[1]?arguments[1]:[]).find(function(t){return t.name===e})},S=1,O=(new Date).getTime(),k=function(f){var p=[];return f.shape.forEach(function(t){var i=t.value,e=f.editor(i),a=x("size",e.props),c=x("state",e.props),u=x("level",e.props),l=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{default:""},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n={normal:!0,hover:!!t.hover,active:!!t.active,disabled:!!t.disable},r=!1===t.generate?null:Object.keys(n).filter(function(t){return n[t]}),o=x("state",e);return o&&(r=(o.options||[]).map(function(t){return t.value})),r||["normal"]}(e.data,e.props),n=a&&a.options?a.options.map(function(t){return t.value}):["medium"],s=u&&u.options?u.options.map(function(t){return t.value}):["normal"];l.forEach(function(o){n.forEach(function(r){s.forEach(function(t){var e=v({},E(f,i));a&&(e.size=r),u&&(e.level=t),1<l.length&&(c?e.state=o:(e.data&&w[e.data.substring(0,1)]&&(e.data=e.data.substring(1)),e.data=m[o]+e.data));var n={id:(O+S++).toString(16),node:{adaptor:f.name,props:e}};p.push(v({},n,f.demoOptions&&f.demoOptions(n)))})})})}),p},_=[],j=[],L=0;L<256;L+=1)j[L]=(L<16?"0":"")+L.toString(16);function P(){return function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return"".concat(j[255&t]+j[t>>8&255]+j[t>>16&255]+j[t>>24&255],"-").concat(j[255&e]).concat(j[e>>8&255],"-").concat(j[e>>16&15|64]).concat(j[e>>24&255],"-").concat(j[63&n|128]).concat(j[n>>8&255],"-").concat(j[n>>16&255]).concat(j[n>>24&255]).concat(j[255&r]).concat(j[r>>8&255]).concat(j[r>>16&255]).concat(j[r>>24&255])}()}function I(e){return _.find(function(t){return t.name===e})}function A(t){var l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=2<arguments.length?arguments[2]:void 0,f=3<arguments.length?arguments[3]:void 0,p=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"",e=5<arguments.length?arguments[5]:void 0,d=6<arguments.length&&void 0!==arguments[6]?arguments[6]:{},n=I(t);if(!n)return null;var r=l.shape,o=void 0===r?"normal":r,h=n.editor(o),m={},v={};return Object.keys(l).forEach(function(i){var t=l[i],e=(x(i,h.props)||{}).type;switch(void 0===e?"any":e){case y.node:if(!t||!t.adaptor)return;var n=t.id||P(),r=[p,i].filter(function(t){return!!t}).join("-"),o={};v[i]=A(t.adaptor,t.props,s,n,r,i,o),m[i]=C({adaptor:t.adaptor,label:t.label,propName:i,id:n,path:r},f?{}:{props:o}),d[i]={adaptor:t.adaptor,label:t.label,propName:i,id:n,path:r,props:o};break;case y.nodeList:if(!t||!Array.isArray(t)||0===t.length||0===t.filter(function(t){return t&&t.adaptor}).length)return;var a=[],c=[],u=[];t.filter(function(t){return t&&t.adaptor}).forEach(function(t,e){var n=t.id||P(),r="".concat(p||"").concat(p?"-":"").concat(i,"_").concat(e),o={};a.push(A(t.adaptor,t.props,s,n,r,i,o)),c.push(C({adaptor:t.adaptor,label:t.label,propName:i,id:n,path:r,index:e.toString()},f?{}:{props:o})),u.push({adaptor:t.adaptor,label:t.label,propName:i,id:n,path:r,index:e.toString(),props:o})}),v[i]=a,m[i]=c,d[i]=u;break;default:v[i]=t,m[i]=t,d[i]=t}}),n.adaptor(C({},v,{"data-fusioncool":JSON.stringify(C({name:t,props:m,type:"adaptor-component",root:!p,themeId:String(s)},e?{propName:e}:{},p?{path:p}:{}))},f?{"data-id":f}:{}))}var M=function(){var e=n(h.mark(function t(e){return h.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(window.Adaptors&&Object.keys(window.Adaptors).forEach(function(t){_.push(C({},p(window.Adaptors[t]),{type:"basic"}))}),e)return t.next=4,Promise.all(e.map(function(t){var e=t.script,n=t.stylesheet;if(e){var r,o,i=[];return i.push((r=e,new Promise(function(t,e){var n=document.createElement("script");n.type="text/javascript",n.setAttribute("crossorigin",!0),n.onload=t,n.onerror=e,n.src=r,document.body.appendChild(n)})).then(function(){window.Adaptor&&(_.push(C({},p(window.Adaptor),{type:"expanded"})),window.Adaptor=null)})),n&&i.push((o=n,new Promise(function(t,e){var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.onload=t,n.onerror=e,n.href=o,document.head.appendChild(n)}))),Promise.all(i)}}));t.next=4;break;case 4:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}();function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N(t,e,n){return e&&D(t.prototype,e),n&&D(t,n),t}function B(t){return(B="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 F(t){return(F="function"==typeof Symbol&&"symbol"===B(Symbol.iterator)?function(t){return B(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":B(t)})(t)}function G(t,e){return!e||"object"!==F(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function R(t){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function z(t,e){return(z=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function V(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&&z(t,e)}var q=function(t){function n(t){var e;return T(this,n),(e=G(this,R(n).call(this,t))).state={hasError:!1},e}return V(n,g.Component),N(n,[{key:"componentDidCatch",value:function(t,e){this.props.onError(t,e)}},{key:"render",value:function(){return this.state.hasError?b.createElement("div",{className:"__error__"}," This demo is running incorrectly, please contact the developer. "):this.props.children}}],[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}]),n}();q.defaultProps={onError:function(){}};function H(r,o,i){function n(t){var e=t.onError,n=A(r,o,i);return b.createElement(q,{onError:e},n)}var a=function(){var t=document.getElementById("mount-node");return t||((t=document.createElement("div")).setAttribute("id","mount-node"),"undefined"!=typeof window&&"watch"!==window.__ENV__&&(t.style.position="fixed",t.style.left="-1000px",t.style.top="-1000px"),document.body.appendChild(t)),t}();return new Promise(function(t,e){d.render(b.createElement(n,{onError:e}),a,function(){a.querySelector(".__error__")||setTimeout(function(){t(a.firstElementChild)},50)})})}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var W=function(t){function e(t){var o;return T(this,e),(o=G(this,R(e).call(this,t))).saveRef=function(t){o.demo=t},o.handleDragStart=function(){var t=o.props,e=t.onDragStart,n=t.node,r=t.themeId;return H(n.adaptor,n.props,r).then(e)},o.state={scale:1,height:t.height||"auto",loaded:!1,error:!1},o}return V(e,g.Component),N(e,[{key:"componentDidCatch",value:function(t,e){this.props.onError(t,e)}},{key:"componentDidMount",value:function(){var t=this;setTimeout(function(){t.computeScale()},50)}},{key:"computeScale",value:function(){var t=this.props.onLoad,e=1,n=this.state.height;if(this.demo){var r=d.findDOMNode(this.demo),o=r.firstElementChild;1<(e=(r.offsetWidth-20)/o.offsetWidth)&&(e=1),n=this.props.height?this.props.height*e:o.offsetHeight*e+20}this.setState({loaded:!0,scale:e,height:n},function(){t()})}},{key:"render",value:function(){var t=this.props,e=t.background,n=t.node,r=t.themeId,o=this.state,i=o.scale,a=o.height,c=o.loaded,u=o.error,l=A(n.adaptor,n.props||{},r);if(!l)return null;if(u)return b.createElement("div",null," This demo is running incorrectly, please contact the developer ");return b.createElement("div",{ref:this.saveRef,style:{background:e,height:a||"auto",padding:10,overflow:"hidden",position:"relative",display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"flex-start",visibility:c?"":"hidden"}},b.cloneElement(l,{style:C({transform:"scale(".concat(i,")"),transformOrigin:"top left",flexShrink:0,flexGrow:0,position:"relative"},l.props.style||{})}),b.createElement("img",{onDragStart:this.handleDragStart,draggable:!0,alt:"drag layer",src:function(t,e,n,r){var o=!(4<arguments.length&&void 0!==arguments[4])||arguments[4];return'data:image/svg+xml;charset=UTF-8,<svg width="'.concat(t,'px" height="').concat(e,'px" viewBox="0 0 ').concat(t," ").concat(e,'" version="1.1" xmlns="http://www.w3.org/2000/svg"><rect stroke="none" fill="none" id=\'__magic:FC_').concat(n,",").concat(r,'\' x="0" y="0" width="').concat(t,'" height="').concat(e,'" />\n ').concat(o?'<g id="loading" transform="translate('.concat(t/2-27,", ").concat(e/2-25,')" fill="#5A5A5A" opacity="0.5">\n <text id="text" font-family="PingFangSC-Regular, PingFang SC" font-size="16" font-weight="normal">\n <tspan x="0" y="45">Loading</tspan>\n </text>\n <g id="icon" transform="translate(18.000000, 0.000000)" fill-rule="nonzero">\n <path d="M14.3390969,12.0749978 C14.3390969,12.1289011 14.3881236,12.1779078 14.441947,12.1779078 C14.4957704,12.1779078 14.5447771,12.1289011 14.5447771,12.0749978 C14.5447771,12.0211744 14.4958303,11.9720678 14.441947,11.9720678 C14.3881636,11.9720478 14.3390969,12.0211544 14.3390969,12.0749978 M12.0693204,14.4193036 C12.0693204,14.4730071 12.0913854,14.5262309 12.1292396,14.5641052 C12.1670739,14.6019994 12.2202777,14.6240644 12.2737813,14.6240644 C12.3274249,14.6240644 12.3805887,14.6019994 12.418403,14.5641052 C12.4562173,14.526211 12.4783223,14.4729671 12.4783223,14.4193036 C12.4783223,14.3657201 12.4562373,14.3124763 12.418403,14.274662 C12.3805687,14.2367678 12.3273649,14.2146828 12.2737813,14.2146828 C12.2202178,14.2146828 12.1670539,14.2367478 12.1292396,14.274662 C12.0913654,14.3124763 12.0693204,14.3657201 12.0693204,14.4193036 M9.00980084,15.626023 C9.00980084,15.7065283 9.04285836,15.7866138 9.09977965,15.8435551 C9.15666098,15.9005164 9.23664658,15.9336538 9.31709187,15.9336538 C9.39745723,15.9336538 9.47744283,15.9005164 9.53436412,15.8435551 C9.59128541,15.7866138 9.62438291,15.7065683 9.62438291,15.626023 C9.62438291,15.5455578 9.59128541,15.4654922 9.53436412,15.4085309 C9.47744283,15.3515497 9.39745723,15.3184122 9.31709187,15.3184122 C9.23664658,15.3184122 9.15666098,15.3515497 9.09977965,15.4085309 C9.04285836,15.4654922 9.00980084,15.5455378 9.00980084,15.626023 M5.71628043,15.464353 C5.71628043,15.5714801 5.76041043,15.6779677 5.83607896,15.7537962 C5.91174752,15.8295447 6.01819512,15.8736347 6.12530229,15.8736347 C6.23234949,15.8736347 6.33881709,15.8295447 6.41448564,15.7537962 C6.49025412,15.6779677 6.53430416,15.5714802 6.53430416,15.464353 C6.53430416,15.3570859 6.49025412,15.2506383 6.41448564,15.1747699 C6.33881709,15.0990414 6.23236949,15.0549514 6.12530229,15.0549514 C6.0182151,15.0549514 5.9117475,15.0990414 5.83607896,15.1747699 C5.76041043,15.2506383 5.71628043,15.3570859 5.71628043,15.464353 M2.79454721,13.9635735 C2.79454721,14.0977623 2.84970969,14.2310516 2.94444527,14.3258871 C3.03918086,14.4206827 3.17237029,14.4759251 3.30641914,14.4759251 C3.44032809,14.4759251 3.57351752,14.4206827 3.66825309,14.3258871 C3.76298867,14.2310516 3.81815115,14.0977623 3.81815115,13.9635735 C3.81815115,13.8294847 3.76298867,13.6961754 3.66825309,13.6013798 C3.5735175,13.5065643 3.44032807,13.4513218 3.30641914,13.4513218 C3.17237029,13.4513218 3.03918086,13.5065643 2.94444527,13.6013798 C2.84968971,13.6961754 2.79454721,13.8294847 2.79454721,13.9635735 M0.771023203,11.4122684 C0.771023203,11.5733788 0.837238184,11.73339 0.95100082,11.8473126 C1.06480344,11.9611951 1.22479465,12.02757 1.38562527,12.02757 C1.54657582,12.02757 1.70646711,11.9612151 1.82024973,11.8473126 C1.93401236,11.73343 2.00030729,11.5733788 2.00030729,11.4122684 C2.00030729,11.2512779 1.93403234,11.0912267 1.82024973,10.9773242 C1.70646709,10.8634416 1.54657582,10.7970667 1.38562527,10.7970667 C1.22479463,10.7970667 1.06480344,10.8634016 0.95100082,10.9773242 C0.837218184,11.0912267 0.771023203,11.2512779 0.771023203,11.4122684 M0.0117595117,8.27969855 C0.0117595117,8.46747088 0.0890069922,8.65400402 0.221576836,8.78677375 C0.35414668,8.91944354 0.540519961,8.99667102 0.728092402,8.99667102 C0.915664844,8.99667102 1.10201813,8.91944354 1.23460797,8.78677375 C1.36717781,8.65396406 1.44442529,8.4674309 1.44442529,8.27969855 C1.44442529,8.09200619 1.36717781,7.90547303 1.23460797,7.77270332 C1.10201813,7.63999355 0.915664844,7.56276607 0.728092402,7.56276607 C0.540519961,7.56276607 0.35414668,7.63999355 0.221576836,7.77270332 C0.0890269531,7.90549301 0.0117595117,8.09202617 0.0117595117,8.27969855 M0.636554648,5.16747486 C0.636554648,5.38212891 0.724814629,5.59552379 0.876551445,5.74728059 C1.02816834,5.89905738 1.24124346,5.9873973 1.45571762,5.9873973 C1.67019178,5.9873973 1.88328688,5.89905738 2.03490377,5.74728059 C2.18662061,5.59552379 2.27488059,5.38212889 2.27488059,5.16747486 C2.27488059,4.95290078 2.18662061,4.73952586 2.03490377,4.58776906 C1.88328687,4.43597229 1.67019178,4.34763236 1.45571762,4.34763236 C1.24124346,4.34763236 1.02816836,4.43597229 0.876551445,4.58776906 C0.724814629,4.73950588 0.636554648,4.95290078 0.636554648,5.16747486 M2.51094006,2.65808125 C2.51094006,2.89963699 2.61035246,3.13969375 2.78101641,3.31053758 C2.95170033,3.48136143 3.19159721,3.58083377 3.43293311,3.58083377 C3.67428898,3.58083377 3.91408592,3.48132145 4.08474986,3.31053758 C4.25545379,3.13969375 4.35482621,2.89963699 4.35482621,2.65808125 C4.35482621,2.41646555 4.25545379,2.17634883 4.08474986,2.00554498 C3.91408592,1.83470115 3.67428898,1.73524879 3.43293311,1.73524879 C3.19159721,1.73524879 2.95170035,1.83472115 2.78101641,2.00554498 C2.61035246,2.17636883 2.51094006,2.41646555 2.51094006,2.65808125 M5.2632285,1.22063871 C5.2632285,1.48887631 5.37355348,1.755515 5.56300465,1.94512605 C5.75253576,2.13485703 6.01883469,2.24522199 6.28683244,2.24522199 C6.5548302,2.24522199 6.8211491,2.13487703 7.01064025,1.94512605 C7.20019137,1.75551498 7.31053633,1.48887631 7.31053633,1.22063871 C7.31053633,0.952381133 7.20019137,0.685882344 7.01064025,0.496131367 C6.8211691,0.306520293 6.5548302,0.19605541 6.28683244,0.19605541 C6.01883469,0.19605541 5.75255574,0.306500313 5.56300465,0.496131367 C5.37355348,0.685902344 5.2632285,0.952401113 5.2632285,1.22063871 M8.35448645,1.13137941 C8.35448645,1.42653871 8.47582395,1.71987924 8.68438211,1.9285973 C8.89288033,2.13731537 9.18596104,2.2588927 9.48084053,2.2588927 C9.77583992,2.2588927 10.0689206,2.13731537 10.2773989,1.9285973 C10.4858971,1.71989922 10.6072945,1.42653871 10.6072945,1.13137941 C10.6072945,0.836200137 10.4859371,0.542859609 10.2773989,0.334061582 C10.0688607,0.125343516 9.77581994,0.00386611328 9.48084053,0.00386611328 C9.18596105,0.00386611328 8.89288033,0.125343516 8.68438211,0.334061582 C8.47582395,0.542819629 8.35448645,0.836200137 8.35448645,1.13137941 M11.184642,2.40591273 C11.184642,2.72773389 11.3170519,3.04755643 11.5443573,3.27506172 C11.7717427,3.50270691 12.0912854,3.63513687 12.4128268,3.63513687 C12.7343282,3.63513687 13.0538709,3.50270693 13.2811763,3.27506172 C13.5085617,3.04755643 13.6408917,2.72771391 13.6408917,2.40591273 C13.6408917,2.08407158 13.5085617,1.76424906 13.2811763,1.53662385 C13.0538709,1.30909857 12.7343282,1.17656869 12.4128268,1.17656869 C12.0912854,1.17656869 11.7717427,1.30909857 11.5443573,1.53662385 C11.3170519,1.76424906 11.184642,2.08407158 11.184642,2.40591273 M13.1957344,4.79996477 C13.1957344,5.1487276 13.3391968,5.49531193 13.5855493,5.74200418 C13.8319817,5.9885965 14.1782663,6.13215887 14.5267093,6.13215887 C14.8751524,6.13215887 15.2214769,5.9885765 15.4678294,5.74200418 C15.7141819,5.49531193 15.8576043,5.14872762 15.8576043,4.79996477 C15.8576043,4.45116195 15.7141819,4.10455764 15.4678294,3.85796533 C15.2214769,3.61129307 14.8751524,3.46773068 14.5267093,3.46773068 C14.1782663,3.46773068 13.8319818,3.61131305 13.5855493,3.85796533 C13.3391969,4.10455766 13.1957344,4.45118195 13.1957344,4.79996477 M13.9957104,7.90093611 C13.9957104,8.27658068 14.1501854,8.65000674 14.4156648,8.91566609 C14.6811043,9.18134543 15.0540907,9.33604023 15.4295154,9.33604023 C15.8048002,9.33604023 16.1778665,9.18134543 16.4432861,8.91566609 C16.7087256,8.65002674 16.8632405,8.27658066 16.8632405,7.90093611 C16.8632405,7.52517164 16.7087456,7.15176555 16.4432861,6.88610619 C16.1778865,6.62044684 15.8048202,6.46585197 15.4295154,6.46585197 C15.0541107,6.46585197 14.6811243,6.62044686 14.4156648,6.88610619 C14.1501654,7.15174557 13.9957104,7.52515164 13.9957104,7.90093611" id="Shape"></path>\n </g>\n </g>'):"","\n </svg>")}(0,0,n.adaptor,"group"),style:{opacity:0,position:"absolute",top:"10px",left:"10px",width:"100%",height:"calc(100% - 20px)",cursor:"pointer",zIndex:1e7}}))}}],[{key:"getDerivedStateFromError",value:function(){return{error:!0}}}]),e}();W.defaultProps={background:"transparent",node:{adaptor:"__test__",props:{}},onLoad:function(){},onError:function(){},onDragStart:function(){}};function Y(t){var e=t.onClick,n=void 0===e?null:e;return b.createElement("svg",{viewBox:"0 0 1024 1024",onClick:n,style:{cursor:"pointer",width:"1em",height:"1em",fill:"currentColor"},version:"1.1",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M512 853.333c-188.211 0-341.333-153.122-341.333-341.333 0-111.343 53.828-210.057 136.533-272.418A339.217 339.217 0 0 1 512 170.667c76.902 0 147.66 25.873 204.8 68.915C799.505 301.943 853.333 400.657 853.333 512c0 188.211-153.122 341.333-341.333 341.333m204.8-695.5A406.63 406.63 0 0 0 512 102.4c-74.65 0-144.452 20.412-204.8 55.433C184.969 228.796 102.4 360.789 102.4 512c0 225.86 183.74 409.6 409.6 409.6S921.6 737.86 921.6 512c0-151.21-82.569-283.204-204.8-354.167","p-id":"1366"}),b.createElement("path",{d:"M512 409.6a34.133 34.133 0 0 0-34.133 34.133V716.8a34.133 34.133 0 0 0 68.266 0V443.733A34.133 34.133 0 0 0 512 409.6m0-136.533a34.133 34.133 0 1 0 0 68.266 34.133 34.133 0 0 0 0-68.266","p-id":"1367"}))}function J(t){function i(){++p===d&&(v(!0),r())}var e=t.components,a=t.onDragStart,n=t.onIconClick,c=void 0===n?function(){}:n,r=t.onLoad,u=t.onError,o=t.onScroll,l=void 0===o?function(){}:o,s=t.themeId,f=t.type,p=0,d=0,h=U(g.useState(!1),2),m=h[0],v=h[1],y=b.createElement("div",{id:f,onScroll:l,style:{position:"absolute",left:0,right:0,top:0,bottom:0,opacity:m?1:0,paddingBottom:390,overflow:"auto"}},e.map(function(t,e){var n=t.name,r=I(n),o=function(a){if(!a)return[];if(a.demos&&0<a.demos.length)return a.demos.map(function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{node:{props:{}}};return C({},t,{node:C({},t.node||{},{props:C({},E(a,t.node.props.shape||"normal"),t.node.props||{})})})});var t=k(a).filter(function(t){var e=t.node.props,n=e.size,r=e.shape,o=E(a,r);return!n||n===o.size});return 10<t.length&&(t=t.filter(function(t){var e=t.node.props,n=e.state,r=e.data,o=e.shape,i=E(a,o);return n?n===i.state:!r||!w[r.substring(0,1)]})),t}(r);return d+=o.length,b.createElement("div",{id:"component-".concat(r.name),key:e},b.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",color:"#888",fontSize:11,padding:"0 10px",height:24,lineHeight:"22px",position:"relative",borderTop:"1px solid hsla(0,0%,53.7%,.4)",borderBottom:"1px solid hsla(0,0%,53.7%,.4)",backgroundColor:"rgba(137, 137, 137, .1)"}},n," ","basic"===f&&b.createElement(Y,{onClick:function(){return c(r.name)}})," "),o.map(function(t){return b.createElement(W,Object.assign({key:t.id,onDragStart:a,onError:u,themeId:s,onLoad:i},t))}))}));return 0===d&&r(),y}return{init:function(){var r=n(h.mark(function t(o,i,a){var c,u,e,l,n,s,f,p,r=arguments;return h.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=3<r.length&&void 0!==r[3]?r[3]:[],u=4<r.length&&void 0!==r[4]?r[4]:"expanded",e=5<r.length&&void 0!==r[5]?r[5]:{},l=e.onIconClick,n=e.onVisibleComponentChange,s=void 0===n?function(){}:n,t.next=5,M(o);case 5:return f=document.createElement("div"),document.body.appendChild(f),p=function(t){var r=t.target.scrollTop,e="hidden"===document.getElementById("expanded").style.visibility?"basic":"expanded",o="";_.filter(function(t){return t.type===e}).forEach(function(t){var e=t.name,n=document.getElementById("component-".concat(e));r>n.offsetTop&&r<=n.offsetHeight+n.offsetTop&&(o=e)}),o&&s(o)},t.next=10,new Promise(function(n,t){function e(){if(2<=++r){var t=document.getElementById("basic"),e=document.getElementById("expanded");"basic"===u?(t.style.visibility="",e.style.visibility="hidden"):(e.style.visibility="",t.style.visibility="hidden"),n()}}var r=0;d.render([b.createElement(J,{type:"expanded",onScroll:p,components:o,themeId:a,onDragStart:i,onIconClick:l,onError:t,onLoad:function(){return e()}}),b.createElement(J,{type:"basic",onScroll:p,components:c.map(function(t){return{name:t}}),themeId:a,onIconClick:l,onDragStart:i,onError:t,onLoad:function(){return e()}})],f)}).then(function(){s(_.filter(function(t){return t.type===u})[0].name)});case 10:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),findEditor:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"normal",n=I(t);if(n)return n.editor(e)},render:H,scrollTo:function(t){var e=I(t).type;this.show(e);var n=document.getElementById("component-".concat(t));n&&document.getElementById(e).scrollTo(0,n.offsetTop)},show:function(t){var e=document.getElementById("basic"),n=document.getElementById("expanded");"basic"===t?(e.style.visibility="",n.style.visibility="hidden"):(n.style.visibility="",e.style.visibility="hidden")}}}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):(t=t||self).AdaptorRender=e(t.React,t.ReactDOM)}(this,function(g,d){"use strict";var b="default"in g?g.default:g;d=d&&d.hasOwnProperty("default")?d.default:d;var t,h=(function(t){var e=function(i){var u,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function a(t,e,n,r){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new _(r||[]);return i._invoke=function(i,a,c){var u=f;return function(t,e){if(u===d)throw new Error("Generator is already running");if(u===h){if("throw"===t)throw e;return L()}for(c.method=t,c.arg=e;;){var n=c.delegate;if(n){var r=S(n,c);if(r){if(r===m)continue;return r}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(u===f)throw u=h,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u=d;var o=s(i,a,c);if("normal"===o.type){if(u=c.done?h:p,o.arg===m)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u=h,c.method="throw",c.arg=o.arg)}}}(t,n,a),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=a;var f="suspendedStart",p="suspendedYield",d="executing",h="completed",m={};function c(){}function v(){}function y(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,C=b&&b(b(j([])));C&&C!==t&&l.call(C,o)&&(g=C);var w=y.prototype=c.prototype=Object.create(g);function E(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function x(u){var e;this._invoke=function(n,r){function t(){return new Promise(function(t,e){!function e(t,n,r,o){var i=s(u[t],u,n);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==typeof c&&l.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):Promise.resolve(c).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function S(t,e){var n=t.iterator[e.method];if(n===u){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=u,S(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,m;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u),e.delegate=null,m):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=u,t.done=!0,t};return r.next=r}}return{next:L}}function L(){return{value:u,done:!0}}return v.prototype=w.constructor=y,y.constructor=v,y[r]=v.displayName="GeneratorFunction",i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,r in t||(t[r]="GeneratorFunction")),t.prototype=Object.create(w),t},i.awrap=function(t){return{__await:t}},E(x.prototype),x.prototype[n]=function(){return this},i.AsyncIterator=x,i.async=function(t,e,n,r){var o=new x(a(t,e,n,r));return i.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},E(w),w[r]="Generator",w[o]=function(){return this},w.toString=function(){return"[object Generator]"},i.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},i.values=j,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),c=l.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=u),m}},i}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(t={exports:{}},t.exports),t.exports);function C(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},e=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable}))),e.forEach(function(t){var e,n,r;e=o,r=i[n=t],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return o}function u(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function n(c){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=c.apply(t,a);function o(t){u(r,e,n,o,i,"next",t)}function i(t){u(r,e,n,o,i,"throw",t)}o(void 0)})}}var e,r,o,i,a,c,w={"-":"disabled","*":"active","~":"hover","":"normal"},m={};Object.keys(w).forEach(function(t){m[w[t]]=t}),(r=e||(e={})).divider="divider",r.node="node",r.comment="comment",(i=o||(o={})).text="text",i.icon="icon",(c=a||(a={})).enum="enum",c.string="string",c.number="number",c.bool="bool",c.node="node",c.nodeList="node-list";function l(t){return t.replace(/\B([A-Z])/g,"-$1").split(/[-|_]/).map(function(t){return function(t){return t?[t.substring(0,1).toUpperCase(),t.substring(1)].join(""):""}(t)}).join(" ")}var y=a;function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){s(e,t,n[t])})}return e}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}for(var f=function(){return(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).filter(function(t){return!!t}).map(function(t){return v({},t,{label:t.label||l(t.name),options:function(){return(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).filter(function(t){return!!t}).map(function(t){var e=t.value||t;return{value:e,label:t.label||l(e)}})}(t.options)})})},p=function(n){if(!n.name)return console.error("[error] muse be have name:"),n;var t;t=!n.shape||!Array.isArray(n.shape)||n.shape.length<1?[{label:n.name,value:"normal"}]:n.shape.filter(function(t){return!!t}).map(function(t){var e=t.value||t;return{value:e,label:t.label||"".concat(l(e)," ").concat("normal"===e?"":n.name)}});return v({},n,{shape:t,editor:function(t){var e=n.editor?n.editor(t):{};return e.props||(e.props=[]),e.nodes||(e.nodes=[]),v({},e,{props:f(e.props),nodes:f(e.nodes)})},content:function(t){var e=n.content?n.content(t):{};return v({},e,{options:f(e.options)})}})},E=function(t,e){var n=t.editor(e),r={shape:e,data:n.data&&n.data.default||""};return n.props.forEach(function(t){var e=t.default;if(null==e)switch(t.type){case y.string:e="";break;case y.number:e=0;break;case y.bool:e=!1;break;case y.enum:e=t.options?t.options[0].value:""}r[t.name]=e}),n.nodes.forEach(function(t){var e=t.name,n=t.default;r[e]=n}),r},x=function(e){return(1<arguments.length&&void 0!==arguments[1]?arguments[1]:[]).find(function(t){return t.name===e})},S=1,O=(new Date).getTime(),k=function(f){var p=[];return f.shape.forEach(function(t){var i=t.value,e=f.editor(i),a=x("size",e.props),c=x("state",e.props),u=x("level",e.props),l=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{default:""},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n={normal:!0,hover:!!t.hover,active:!!t.active,disabled:!!t.disable},r=!1===t.generate?null:Object.keys(n).filter(function(t){return n[t]}),o=x("state",e);return o&&(r=(o.options||[]).map(function(t){return t.value})),r||["normal"]}(e.data,e.props),n=a&&a.options?a.options.map(function(t){return t.value}):["medium"],s=u&&u.options?u.options.map(function(t){return t.value}):["normal"];l.forEach(function(o){n.forEach(function(r){s.forEach(function(t){var e=v({},E(f,i));a&&(e.size=r),u&&(e.level=t),1<l.length&&(c?e.state=o:(e.data&&w[e.data.substring(0,1)]&&(e.data=e.data.substring(1)),e.data=m[o]+e.data));var n={id:(O+S++).toString(16),node:{adaptor:f.name,props:e}};p.push(v({},n,f.demoOptions&&f.demoOptions(n)))})})})}),p},_=[],j=[],L=0;L<256;L+=1)j[L]=(L<16?"0":"")+L.toString(16);function P(){return function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return"".concat(j[255&t]+j[t>>8&255]+j[t>>16&255]+j[t>>24&255],"-").concat(j[255&e]).concat(j[e>>8&255],"-").concat(j[e>>16&15|64]).concat(j[e>>24&255],"-").concat(j[63&n|128]).concat(j[n>>8&255],"-").concat(j[n>>16&255]).concat(j[n>>24&255]).concat(j[255&r]).concat(j[r>>8&255]).concat(j[r>>16&255]).concat(j[r>>24&255])}()}function I(e){return _.find(function(t){return t.name===e})}function A(t){var l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=2<arguments.length?arguments[2]:void 0,f=3<arguments.length?arguments[3]:void 0,p=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"",e=5<arguments.length?arguments[5]:void 0,d=6<arguments.length&&void 0!==arguments[6]?arguments[6]:{},n=I(t);if(!n)return null;var r=l.shape,o=void 0===r?"normal":r,h=n.editor(o),m={},v={};return Object.keys(l).forEach(function(i){var t=l[i],e=(x(i,h.props)||{}).type;switch(void 0===e?"any":e){case y.node:if(!t||!t.adaptor)return;var n=t.id||P(),r=[p,i].filter(function(t){return!!t}).join("-"),o={};v[i]=A(t.adaptor,t.props,s,n,r,i,o),m[i]=C({adaptor:t.adaptor,label:t.label,propName:i,id:n,path:r},f?{}:{props:o}),d[i]={adaptor:t.adaptor,label:t.label,propName:i,id:n,path:r,props:o};break;case y.nodeList:if(!t||!Array.isArray(t)||0===t.length||0===t.filter(function(t){return t&&t.adaptor}).length)return;var a=[],c=[],u=[];t.filter(function(t){return t&&t.adaptor}).forEach(function(t,e){var n=t.id||P(),r="".concat(p||"").concat(p?"-":"").concat(i,"_").concat(e),o={};a.push(A(t.adaptor,t.props,s,n,r,i,o)),c.push(C({adaptor:t.adaptor,label:t.label,propName:i,id:n,path:r,index:e.toString()},f?{}:{props:o})),u.push({adaptor:t.adaptor,label:t.label,propName:i,id:n,path:r,index:e.toString(),props:o})}),v[i]=a,m[i]=c,d[i]=u;break;default:v[i]=t,m[i]=t,d[i]=t}}),n.adaptor(C({},v,{"data-fusioncool":JSON.stringify(C({name:t,props:m,type:"adaptor-component",root:!p,themeId:String(s)},e?{propName:e}:{},p?{path:p}:{}))},f?{"data-id":f}:{}))}var M=function(){var e=n(h.mark(function t(e){return h.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(window.Adaptors&&Object.keys(window.Adaptors).forEach(function(t){_.push(C({},p(window.Adaptors[t]),{type:"basic"}))}),e)return t.next=4,Promise.all(e.map(function(t){var e=t.name,n=t.script,r=t.stylesheet;if(n){var o,i,a=[];return a.push((o=n,new Promise(function(t,e){var n=document.createElement("script");n.type="text/javascript",n.setAttribute("crossorigin",!0),n.onload=t,n.onerror=e,n.src=o,document.body.appendChild(n)})).then(function(){window.Adaptor&&(_.push(C({},p(window.Adaptor),{type:"expanded"})),window.Adaptor=null)}).catch(function(){console.error("[".concat(e,"] script (").concat(n,") load error ! please contact the developer"))})),r&&a.push((i=r,new Promise(function(t,e){var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.onload=t,n.onerror=e,n.href=i,document.head.appendChild(n)})).catch(function(){console.error("[".concat(e,"] stylesheet (").concat(r,") load error ! please contact the developer"))})),Promise.all(a)}}));t.next=4;break;case 4:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}();function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N(t,e,n){return e&&D(t.prototype,e),n&&D(t,n),t}function B(t){return(B="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 F(t){return(F="function"==typeof Symbol&&"symbol"===B(Symbol.iterator)?function(t){return B(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":B(t)})(t)}function G(t,e){return!e||"object"!==F(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function R(t){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function z(t,e){return(z=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function V(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&&z(t,e)}var q=function(t){function n(t){var e;return T(this,n),(e=G(this,R(n).call(this,t))).state={hasError:!1},e}return V(n,g.Component),N(n,[{key:"componentDidCatch",value:function(t,e){this.props.onError(t,e)}},{key:"render",value:function(){return this.state.hasError?b.createElement("div",{className:"__error__"}," This demo is running incorrectly, please contact the developer. "):this.props.children}}],[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}]),n}();q.defaultProps={onError:function(){}};function H(r,o,i){function n(t){var e=t.onError,n=A(r,o,i);return b.createElement(q,{onError:e},n)}var a=function(){var t=document.getElementById("mount-node");return t||((t=document.createElement("div")).setAttribute("id","mount-node"),"undefined"!=typeof window&&"watch"!==window.__ENV__&&(t.style.position="fixed",t.style.left="-1000px",t.style.top="-1000px"),document.body.appendChild(t)),t}();return new Promise(function(t,e){d.render(b.createElement(n,{onError:e}),a,function(){a.querySelector(".__error__")||setTimeout(function(){t(a.firstElementChild)},50)})})}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var W=function(t){function e(t){var o;return T(this,e),(o=G(this,R(e).call(this,t))).saveRef=function(t){o.demo=t},o.handleDragStart=function(){var t=o.props,e=t.onDragStart,n=t.node,r=t.themeId;return H(n.adaptor,n.props,r).then(e)},o.state={scale:1,height:t.height||"auto",loaded:!1,error:!1},o}return V(e,g.Component),N(e,[{key:"componentDidCatch",value:function(t,e){this.props.onError(t,e)}},{key:"componentDidMount",value:function(){var t=this;setTimeout(function(){t.computeScale()},50)}},{key:"computeScale",value:function(){var t=this.props.onLoad,e=1,n=this.state.height;if(this.demo){var r=d.findDOMNode(this.demo),o=r.firstElementChild;1<(e=(r.offsetWidth-20)/o.offsetWidth)&&(e=1),n=this.props.height?this.props.height*e:o.offsetHeight*e+20}this.setState({loaded:!0,scale:e,height:n},function(){t()})}},{key:"render",value:function(){var t=this.props,e=t.background,n=t.node,r=t.themeId,o=this.state,i=o.scale,a=o.height,c=o.loaded,u=o.error,l=A(n.adaptor,n.props||{},r);if(!l)return null;if(u)return b.createElement("div",null," This demo is running incorrectly, please contact the developer ");return b.createElement("div",{ref:this.saveRef,style:{background:e,height:a||"auto",padding:10,overflow:"hidden",position:"relative",display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"flex-start",visibility:c?"":"hidden"}},b.cloneElement(l,{style:C({transform:"scale(".concat(i,")"),transformOrigin:"top left",flexShrink:0,flexGrow:0,position:"relative"},l.props.style||{})}),b.createElement("img",{onDragStart:this.handleDragStart,draggable:!0,alt:"drag layer",src:function(t,e,n,r){var o=!(4<arguments.length&&void 0!==arguments[4])||arguments[4];return'data:image/svg+xml;charset=UTF-8,<svg width="'.concat(t,'px" height="').concat(e,'px" viewBox="0 0 ').concat(t," ").concat(e,'" version="1.1" xmlns="http://www.w3.org/2000/svg"><rect stroke="none" fill="none" id=\'__magic:FC_').concat(n,",").concat(r,'\' x="0" y="0" width="').concat(t,'" height="').concat(e,'" />\n ').concat(o?'<g id="loading" transform="translate('.concat(t/2-27,", ").concat(e/2-25,')" fill="#5A5A5A" opacity="0.5">\n <text id="text" font-family="PingFangSC-Regular, PingFang SC" font-size="16" font-weight="normal">\n <tspan x="0" y="45">Loading</tspan>\n </text>\n <g id="icon" transform="translate(18.000000, 0.000000)" fill-rule="nonzero">\n <path d="M14.3390969,12.0749978 C14.3390969,12.1289011 14.3881236,12.1779078 14.441947,12.1779078 C14.4957704,12.1779078 14.5447771,12.1289011 14.5447771,12.0749978 C14.5447771,12.0211744 14.4958303,11.9720678 14.441947,11.9720678 C14.3881636,11.9720478 14.3390969,12.0211544 14.3390969,12.0749978 M12.0693204,14.4193036 C12.0693204,14.4730071 12.0913854,14.5262309 12.1292396,14.5641052 C12.1670739,14.6019994 12.2202777,14.6240644 12.2737813,14.6240644 C12.3274249,14.6240644 12.3805887,14.6019994 12.418403,14.5641052 C12.4562173,14.526211 12.4783223,14.4729671 12.4783223,14.4193036 C12.4783223,14.3657201 12.4562373,14.3124763 12.418403,14.274662 C12.3805687,14.2367678 12.3273649,14.2146828 12.2737813,14.2146828 C12.2202178,14.2146828 12.1670539,14.2367478 12.1292396,14.274662 C12.0913654,14.3124763 12.0693204,14.3657201 12.0693204,14.4193036 M9.00980084,15.626023 C9.00980084,15.7065283 9.04285836,15.7866138 9.09977965,15.8435551 C9.15666098,15.9005164 9.23664658,15.9336538 9.31709187,15.9336538 C9.39745723,15.9336538 9.47744283,15.9005164 9.53436412,15.8435551 C9.59128541,15.7866138 9.62438291,15.7065683 9.62438291,15.626023 C9.62438291,15.5455578 9.59128541,15.4654922 9.53436412,15.4085309 C9.47744283,15.3515497 9.39745723,15.3184122 9.31709187,15.3184122 C9.23664658,15.3184122 9.15666098,15.3515497 9.09977965,15.4085309 C9.04285836,15.4654922 9.00980084,15.5455378 9.00980084,15.626023 M5.71628043,15.464353 C5.71628043,15.5714801 5.76041043,15.6779677 5.83607896,15.7537962 C5.91174752,15.8295447 6.01819512,15.8736347 6.12530229,15.8736347 C6.23234949,15.8736347 6.33881709,15.8295447 6.41448564,15.7537962 C6.49025412,15.6779677 6.53430416,15.5714802 6.53430416,15.464353 C6.53430416,15.3570859 6.49025412,15.2506383 6.41448564,15.1747699 C6.33881709,15.0990414 6.23236949,15.0549514 6.12530229,15.0549514 C6.0182151,15.0549514 5.9117475,15.0990414 5.83607896,15.1747699 C5.76041043,15.2506383 5.71628043,15.3570859 5.71628043,15.464353 M2.79454721,13.9635735 C2.79454721,14.0977623 2.84970969,14.2310516 2.94444527,14.3258871 C3.03918086,14.4206827 3.17237029,14.4759251 3.30641914,14.4759251 C3.44032809,14.4759251 3.57351752,14.4206827 3.66825309,14.3258871 C3.76298867,14.2310516 3.81815115,14.0977623 3.81815115,13.9635735 C3.81815115,13.8294847 3.76298867,13.6961754 3.66825309,13.6013798 C3.5735175,13.5065643 3.44032807,13.4513218 3.30641914,13.4513218 C3.17237029,13.4513218 3.03918086,13.5065643 2.94444527,13.6013798 C2.84968971,13.6961754 2.79454721,13.8294847 2.79454721,13.9635735 M0.771023203,11.4122684 C0.771023203,11.5733788 0.837238184,11.73339 0.95100082,11.8473126 C1.06480344,11.9611951 1.22479465,12.02757 1.38562527,12.02757 C1.54657582,12.02757 1.70646711,11.9612151 1.82024973,11.8473126 C1.93401236,11.73343 2.00030729,11.5733788 2.00030729,11.4122684 C2.00030729,11.2512779 1.93403234,11.0912267 1.82024973,10.9773242 C1.70646709,10.8634416 1.54657582,10.7970667 1.38562527,10.7970667 C1.22479463,10.7970667 1.06480344,10.8634016 0.95100082,10.9773242 C0.837218184,11.0912267 0.771023203,11.2512779 0.771023203,11.4122684 M0.0117595117,8.27969855 C0.0117595117,8.46747088 0.0890069922,8.65400402 0.221576836,8.78677375 C0.35414668,8.91944354 0.540519961,8.99667102 0.728092402,8.99667102 C0.915664844,8.99667102 1.10201813,8.91944354 1.23460797,8.78677375 C1.36717781,8.65396406 1.44442529,8.4674309 1.44442529,8.27969855 C1.44442529,8.09200619 1.36717781,7.90547303 1.23460797,7.77270332 C1.10201813,7.63999355 0.915664844,7.56276607 0.728092402,7.56276607 C0.540519961,7.56276607 0.35414668,7.63999355 0.221576836,7.77270332 C0.0890269531,7.90549301 0.0117595117,8.09202617 0.0117595117,8.27969855 M0.636554648,5.16747486 C0.636554648,5.38212891 0.724814629,5.59552379 0.876551445,5.74728059 C1.02816834,5.89905738 1.24124346,5.9873973 1.45571762,5.9873973 C1.67019178,5.9873973 1.88328688,5.89905738 2.03490377,5.74728059 C2.18662061,5.59552379 2.27488059,5.38212889 2.27488059,5.16747486 C2.27488059,4.95290078 2.18662061,4.73952586 2.03490377,4.58776906 C1.88328687,4.43597229 1.67019178,4.34763236 1.45571762,4.34763236 C1.24124346,4.34763236 1.02816836,4.43597229 0.876551445,4.58776906 C0.724814629,4.73950588 0.636554648,4.95290078 0.636554648,5.16747486 M2.51094006,2.65808125 C2.51094006,2.89963699 2.61035246,3.13969375 2.78101641,3.31053758 C2.95170033,3.48136143 3.19159721,3.58083377 3.43293311,3.58083377 C3.67428898,3.58083377 3.91408592,3.48132145 4.08474986,3.31053758 C4.25545379,3.13969375 4.35482621,2.89963699 4.35482621,2.65808125 C4.35482621,2.41646555 4.25545379,2.17634883 4.08474986,2.00554498 C3.91408592,1.83470115 3.67428898,1.73524879 3.43293311,1.73524879 C3.19159721,1.73524879 2.95170035,1.83472115 2.78101641,2.00554498 C2.61035246,2.17636883 2.51094006,2.41646555 2.51094006,2.65808125 M5.2632285,1.22063871 C5.2632285,1.48887631 5.37355348,1.755515 5.56300465,1.94512605 C5.75253576,2.13485703 6.01883469,2.24522199 6.28683244,2.24522199 C6.5548302,2.24522199 6.8211491,2.13487703 7.01064025,1.94512605 C7.20019137,1.75551498 7.31053633,1.48887631 7.31053633,1.22063871 C7.31053633,0.952381133 7.20019137,0.685882344 7.01064025,0.496131367 C6.8211691,0.306520293 6.5548302,0.19605541 6.28683244,0.19605541 C6.01883469,0.19605541 5.75255574,0.306500313 5.56300465,0.496131367 C5.37355348,0.685902344 5.2632285,0.952401113 5.2632285,1.22063871 M8.35448645,1.13137941 C8.35448645,1.42653871 8.47582395,1.71987924 8.68438211,1.9285973 C8.89288033,2.13731537 9.18596104,2.2588927 9.48084053,2.2588927 C9.77583992,2.2588927 10.0689206,2.13731537 10.2773989,1.9285973 C10.4858971,1.71989922 10.6072945,1.42653871 10.6072945,1.13137941 C10.6072945,0.836200137 10.4859371,0.542859609 10.2773989,0.334061582 C10.0688607,0.125343516 9.77581994,0.00386611328 9.48084053,0.00386611328 C9.18596105,0.00386611328 8.89288033,0.125343516 8.68438211,0.334061582 C8.47582395,0.542819629 8.35448645,0.836200137 8.35448645,1.13137941 M11.184642,2.40591273 C11.184642,2.72773389 11.3170519,3.04755643 11.5443573,3.27506172 C11.7717427,3.50270691 12.0912854,3.63513687 12.4128268,3.63513687 C12.7343282,3.63513687 13.0538709,3.50270693 13.2811763,3.27506172 C13.5085617,3.04755643 13.6408917,2.72771391 13.6408917,2.40591273 C13.6408917,2.08407158 13.5085617,1.76424906 13.2811763,1.53662385 C13.0538709,1.30909857 12.7343282,1.17656869 12.4128268,1.17656869 C12.0912854,1.17656869 11.7717427,1.30909857 11.5443573,1.53662385 C11.3170519,1.76424906 11.184642,2.08407158 11.184642,2.40591273 M13.1957344,4.79996477 C13.1957344,5.1487276 13.3391968,5.49531193 13.5855493,5.74200418 C13.8319817,5.9885965 14.1782663,6.13215887 14.5267093,6.13215887 C14.8751524,6.13215887 15.2214769,5.9885765 15.4678294,5.74200418 C15.7141819,5.49531193 15.8576043,5.14872762 15.8576043,4.79996477 C15.8576043,4.45116195 15.7141819,4.10455764 15.4678294,3.85796533 C15.2214769,3.61129307 14.8751524,3.46773068 14.5267093,3.46773068 C14.1782663,3.46773068 13.8319818,3.61131305 13.5855493,3.85796533 C13.3391969,4.10455766 13.1957344,4.45118195 13.1957344,4.79996477 M13.9957104,7.90093611 C13.9957104,8.27658068 14.1501854,8.65000674 14.4156648,8.91566609 C14.6811043,9.18134543 15.0540907,9.33604023 15.4295154,9.33604023 C15.8048002,9.33604023 16.1778665,9.18134543 16.4432861,8.91566609 C16.7087256,8.65002674 16.8632405,8.27658066 16.8632405,7.90093611 C16.8632405,7.52517164 16.7087456,7.15176555 16.4432861,6.88610619 C16.1778865,6.62044684 15.8048202,6.46585197 15.4295154,6.46585197 C15.0541107,6.46585197 14.6811243,6.62044686 14.4156648,6.88610619 C14.1501654,7.15174557 13.9957104,7.52515164 13.9957104,7.90093611" id="Shape"></path>\n </g>\n </g>'):"","\n </svg>")}(0,0,n.adaptor,"group"),style:{opacity:0,position:"absolute",top:"10px",left:"10px",width:"100%",height:"calc(100% - 20px)",cursor:"pointer",zIndex:1e7}}))}}],[{key:"getDerivedStateFromError",value:function(){return{error:!0}}}]),e}();W.defaultProps={background:"transparent",node:{adaptor:"__test__",props:{}},onLoad:function(){},onError:function(){},onDragStart:function(){}};function Y(t){var e=t.onClick,n=void 0===e?null:e;return b.createElement("svg",{viewBox:"0 0 1024 1024",onClick:n,style:{cursor:"pointer",width:"1em",height:"1em",fill:"currentColor"},version:"1.1",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M512 853.333c-188.211 0-341.333-153.122-341.333-341.333 0-111.343 53.828-210.057 136.533-272.418A339.217 339.217 0 0 1 512 170.667c76.902 0 147.66 25.873 204.8 68.915C799.505 301.943 853.333 400.657 853.333 512c0 188.211-153.122 341.333-341.333 341.333m204.8-695.5A406.63 406.63 0 0 0 512 102.4c-74.65 0-144.452 20.412-204.8 55.433C184.969 228.796 102.4 360.789 102.4 512c0 225.86 183.74 409.6 409.6 409.6S921.6 737.86 921.6 512c0-151.21-82.569-283.204-204.8-354.167","p-id":"1366"}),b.createElement("path",{d:"M512 409.6a34.133 34.133 0 0 0-34.133 34.133V716.8a34.133 34.133 0 0 0 68.266 0V443.733A34.133 34.133 0 0 0 512 409.6m0-136.533a34.133 34.133 0 1 0 0 68.266 34.133 34.133 0 0 0 0-68.266","p-id":"1367"}))}function J(t){function i(){++p===d&&(v(!0),r())}var e=t.components,a=t.onDragStart,n=t.onIconClick,c=void 0===n?function(){}:n,r=t.onLoad,u=t.onError,o=t.onScroll,l=void 0===o?function(){}:o,s=t.themeId,f=t.type,p=0,d=0,h=U(g.useState(!1),2),m=h[0],v=h[1],y=b.createElement("div",{id:f,onScroll:l,style:{position:"absolute",left:0,right:0,top:0,bottom:0,opacity:m?1:0,paddingBottom:390,overflow:"auto"}},e.map(function(t,e){var n=t.name,r=I(n);if(!r||!r.name)return null;var o=function(a){if(!a)return[];if(a.demos&&0<a.demos.length)return a.demos.map(function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{node:{props:{}}};return C({},t,{node:C({},t.node||{},{props:C({},E(a,t.node.props.shape||"normal"),t.node.props||{})})})});var t=k(a).filter(function(t){var e=t.node.props,n=e.size,r=e.shape,o=E(a,r);return!n||n===o.size});return 10<t.length&&(t=t.filter(function(t){var e=t.node.props,n=e.state,r=e.data,o=e.shape,i=E(a,o);return n?n===i.state:!r||!w[r.substring(0,1)]})),t}(r)||[];return d+=o.length,b.createElement("div",{id:"component-".concat(r.name),key:e},b.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",color:"#888",fontSize:11,padding:"0 10px",height:24,lineHeight:"22px",position:"relative",borderTop:"1px solid hsla(0,0%,53.7%,.4)",borderBottom:"1px solid hsla(0,0%,53.7%,.4)",backgroundColor:"rgba(137, 137, 137, .1)"}},n," ","basic"===f&&b.createElement(Y,{onClick:function(){return c(r.name)}})," "),o.map(function(t){return b.createElement(W,Object.assign({key:t.id,onDragStart:a,onError:u,themeId:s,onLoad:i},t))}))}));return 0===d&&r(),y}return{init:function(){var r=n(h.mark(function t(o,i,a){var c,u,e,l,n,s,f,p,r=arguments;return h.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=3<r.length&&void 0!==r[3]?r[3]:[],u=4<r.length&&void 0!==r[4]?r[4]:"expanded",e=5<r.length&&void 0!==r[5]?r[5]:{},l=e.onIconClick,n=e.onVisibleComponentChange,s=void 0===n?function(){}:n,t.next=5,M(o);case 5:return f=document.createElement("div"),document.body.appendChild(f),p=function(t){var r=t.target.scrollTop,e="hidden"===document.getElementById("expanded").style.visibility?"basic":"expanded",o="";_.filter(function(t){return t.type===e}).forEach(function(t){var e=t.name,n=document.getElementById("component-".concat(e));r>n.offsetTop&&r<=n.offsetHeight+n.offsetTop&&(o=e)}),o&&s(o)},t.next=10,new Promise(function(n,t){function e(){if(2<=++r){var t=document.getElementById("basic"),e=document.getElementById("expanded");"basic"===u?(t.style.visibility="",e.style.visibility="hidden"):(e.style.visibility="",t.style.visibility="hidden"),n()}}var r=0;d.render([b.createElement(J,{type:"expanded",onScroll:p,components:o,themeId:a,onDragStart:i,onIconClick:l,onError:t,onLoad:function(){return e()}}),b.createElement(J,{type:"basic",onScroll:p,components:c.map(function(t){return{name:t}}),themeId:a,onIconClick:l,onDragStart:i,onError:t,onLoad:function(){return e()}})],f)}).then(function(){s(_.filter(function(t){return t.type===u})[0].name)});case 10:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),findEditor:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"normal",n=I(t);if(n)return n.editor(e)},render:H,scrollTo:function(t){var e=I(t).type;this.show(e);var n=document.getElementById("component-".concat(t));n&&document.getElementById(e).scrollTo(0,n.offsetTop)},show:function(t){var e=document.getElementById("basic"),n=document.getElementById("expanded");"basic"===t?(e.style.visibility="",n.style.visibility="hidden"):(n.style.visibility="",e.style.visibility="hidden")}}}); |
Sorry, the diff of this file is too big to display
330986
8630