@gaoding/editor-sdk
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -1,1 +0,1 @@ | ||
(function(Z,M){typeof exports=="object"&&typeof module=="object"?module.exports=M():typeof define=="function"&&define.amd?define([],M):typeof exports=="object"?exports["gd-editor-sdk"]=M():Z["gd-editor-sdk"]=M()})(this,function(){return(()=>{var re={3913:r=>{function s(t,n){for(var a=0;a<n.length;a++){var i=n[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(t,n,a){return n&&s(t.prototype,n),a&&s(t,a),t}r.exports=e},6738:(r,s,e)=>{"use strict";e.r(s),e.d(s,{GdEditorSdk:()=>O,default:()=>P});var t={};if(e.r(t),e.d(t,{j:()=>O}),typeof window!="undefined"){e(8344);var n;(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(e.p=n[1])}const a=null;var i=e(5115),o=e(1181),c=e(6253),l=e(2773),f=e(851),d=e(3913),v=e.n(d),x={};const b=x;var w=function(){v()(E,[{key:"width",get:function(){return this.config.width}},{key:"height",get:function(){return this.config.height}}]);function E(j){this.config=j}var g=E.prototype;return g.addElement=function(u){var h=JSON.parse(JSON.stringify(u)),y=Math.random();return this.postMessage("editor.addElement",h,y)},g.postMessage=function(u,h,y){var S=this,A=function(){S.config.frame.contentWindow.postMessage({action:u,asyncId:y,payload:h},"*")};if(y)return new Promise(function(R){A(),b[y]=R});A()},E}(),O=function(){function E(j){var u=this;if(this.wrapper=null,this.frame=null,this.mask=null,this.container=null,this.cb=function(h){if(!h.origin.includes(".gaoding.com"))return!1;h.data.action==="editor.download"&&(u.config.onUpload&&u.config.onUpload(h.data.blob),u.config.onCompleted&&u.config.onCompleted(h.data.file),u.config.autoClose!==!1&&u.close()),h.data.action==="editor.templetLoaded"&&(u.config.onTempletLoaded&&u.config.onTempletLoaded(new w({width:h.data.payload.width,height:h.data.payload.height,frame:u.frame}))),h.data.asyncId&&b[h.data.asyncId]&&b[h.data.asyncId](h.data.payload)},!j.onCompleted&&!j.onUpload)throw new Error("缺少必填参数 onCompleted");this.config=j,this.autoResize(),window.addEventListener("resize",this.autoResize.bind(this))}var g=E.prototype;return g.autoResize=function(){var u=this.container;u&&(u.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",u.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px")},g.open=function(u){var h=this;if(!this.wrapper){var y=document.createElement("div");y.className="gaoding-iframe",y.style.position="absolute",y.style.top="0px",y.style.right="0px",y.style.bottom="0px",y.style.left="0px",y.style.zIndex="1000",document.documentElement.clientHeight>800&&(y.style.display="flex",y.style.alignItems="center",y.style.justifyContent="center"),this.wrapper=y;var S=this.container=document.createElement("div");S.style.position="relative",S.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",S.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px",S.style.minHeight="604px",S.style.margin="50px auto",S.style.background="#fff",S.style.display="block",S.appendChild(this.createCloseBtn()),this.config.style&&Object.keys(this.config.style).forEach(function(L){S.style[L]=h.config.style[L]});var A=document.createElement("iframe");A.style.display="block",A.style.width="100%",A.style.height="100%",A.setAttribute("frameborder","0"),this.frame=A,S.appendChild(A),y.append(S)}this.createMask();var R=u.ext||{};Object.assign(R,{filterFont:u.filterFont,buttonText:this.config.buttonText});var B=Object.keys(R).reduce(function(L,G){return R[G]!==void 0&&(L+="&"+G+"="+R[G]),L},""),C="";u.filterFont&&(C+="filterFont="+Number(u.filterFont)),C+=""+B;var N="https://www.gaoding.com";this.config.env==="local"?N="http://design.dev.gaoding.com":this.config.env==="dev"?N="https://www.dev.gaoding.com":this.config.env==="stage"&&(N="https://stage.gaoding.com"),this.frame.src=N+"/utm-editors/"+(this.config.appId?this.config.appId:encodeURIComponent(location.hostname))+"?"+C,document.body.appendChild(this.wrapper),window.addEventListener("message",this.cb)},g.close=function(){window.removeEventListener("message",this.cb),this.wrapper&&this.wrapper.parentElement&&this.wrapper.parentElement.removeChild(this.wrapper),this.mask&&this.mask.parentElement&&this.mask.parentElement.removeChild(this.mask),window.removeEventListener("resize",this.autoResize.bind(this))},g.createMask=function(){var u=document.createElement("div");u.style.position="fixed",u.style.top="0px",u.style.left="0px",u.style.bottom="0px",u.style.right="0px",u.style.zIndex=parseFloat(this.wrapper.style.zIndex)-1+"",u.style.backgroundColor="#000",u.style.opacity=".5",this.mask=u,document.body.appendChild(u)},g.createCloseBtn=function(){var u=this,h=document.createElement("div");h.style.fontSize="13px",h.style.width="42px",h.style.height="42px",h.style.textAlign="right",h.style.position="absolute",h.style.right="-42px",h.style.top="0px",h.style.background="#000",h.style.cursor="pointer",h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.backgroundRepeat="no-repeat";var y=document.createElement("img");return y.style.display="block",y.style.width="24px",y.src="https://st-gdx.dancf.com/gaodingx/34555636/design/20190509-142237-249d.png",h.appendChild(y),h.addEventListener("click",function(){return u.close()}),h},E}();window&&(window.GdEditorSdk=O);const P=t.default},4963:r=>{r.exports=function(s){if(typeof s!="function")throw TypeError(s+" is not a function!");return s}},7722:(r,s,e)=>{var t=e(6314)("unscopables"),n=Array.prototype;n[t]==null&&e(7728)(n,t,{}),r.exports=function(a){n[t][a]=!0}},3328:r=>{r.exports=function(s,e,t,n){if(!(s instanceof e)||n!==void 0&&n in s)throw TypeError(t+": incorrect invocation!");return s}},7007:(r,s,e)=>{var t=e(5286);r.exports=function(n){if(!t(n))throw TypeError(n+" is not an object!");return n}},9315:(r,s,e)=>{var t=e(2110),n=e(875),a=e(2337);r.exports=function(i){return function(o,c,l){var f=t(o),d=n(f.length),v=a(l,d),x;if(i&&c!=c){for(;d>v;)if(x=f[v++],x!=x)return!0}else for(;d>v;v++)if((i||v in f)&&f[v]===c)return i||v||0;return!i&&-1}}},1488:(r,s,e)=>{var t=e(2032),n=e(6314)("toStringTag"),a=t(function(){return arguments}())=="Arguments",i=function(o,c){try{return o[c]}catch(l){}};r.exports=function(o){var c,l,f;return o===void 0?"Undefined":o===null?"Null":typeof(l=i(c=Object(o),n))=="string"?l:a?t(c):(f=t(c))=="Object"&&typeof c.callee=="function"?"Arguments":f}},2032:r=>{var s={}.toString;r.exports=function(e){return s.call(e).slice(8,-1)}},5645:r=>{var s=r.exports={version:"2.6.11"};typeof __e=="number"&&(__e=s)},741:(r,s,e)=>{var t=e(4963);r.exports=function(n,a,i){if(t(n),a===void 0)return n;switch(i){case 1:return function(o){return n.call(a,o)};case 2:return function(o,c){return n.call(a,o,c)};case 3:return function(o,c,l){return n.call(a,o,c,l)}}return function(){return n.apply(a,arguments)}}},1355:r=>{r.exports=function(s){if(s==null)throw TypeError("Can't call method on "+s);return s}},7057:(r,s,e)=>{r.exports=!e(4253)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},2457:(r,s,e)=>{var t=e(5286),n=e(3816).document,a=t(n)&&t(n.createElement);r.exports=function(i){return a?n.createElement(i):{}}},4430:r=>{r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},2985:(r,s,e)=>{var t=e(3816),n=e(5645),a=e(7728),i=e(7234),o=e(741),c="prototype",l=function(f,d,v){var x=f&l.F,b=f&l.G,w=f&l.S,O=f&l.P,P=f&l.B,E=b?t:w?t[d]||(t[d]={}):(t[d]||{})[c],g=b?n:n[d]||(n[d]={}),j=g[c]||(g[c]={}),u,h,y,S;b&&(v=d);for(u in v)h=!x&&E&&E[u]!==void 0,y=(h?E:v)[u],S=P&&h?o(y,t):O&&typeof y=="function"?o(Function.call,y):y,E&&i(E,u,y,f&l.U),g[u]!=y&&a(g,u,S),O&&j[u]!=y&&(j[u]=y)};t.core=n,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,r.exports=l},4253:r=>{r.exports=function(s){try{return!!s()}catch(e){return!0}}},3531:(r,s,e)=>{var t=e(741),n=e(8851),a=e(6555),i=e(7007),o=e(875),c=e(9002),l={},f={},d=r.exports=function(v,x,b,w,O){var P=O?function(){return v}:c(v),E=t(b,w,x?2:1),g=0,j,u,h,y;if(typeof P!="function")throw TypeError(v+" is not iterable!");if(a(P)){for(j=o(v.length);j>g;g++)if(y=x?E(i(u=v[g])[0],u[1]):E(v[g]),y===l||y===f)return y}else for(h=P.call(v);!(u=h.next()).done;)if(y=n(h,E,u.value,x),y===l||y===f)return y};d.BREAK=l,d.RETURN=f},18:(r,s,e)=>{r.exports=e(3825)("native-function-to-string",Function.toString)},3816:r=>{var s=r.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=s)},9181:r=>{var s={}.hasOwnProperty;r.exports=function(e,t){return s.call(e,t)}},7728:(r,s,e)=>{var t=e(9275),n=e(681);r.exports=e(7057)?function(a,i,o){return t.f(a,i,n(1,o))}:function(a,i,o){return a[i]=o,a}},639:(r,s,e)=>{var t=e(3816).document;r.exports=t&&t.documentElement},1734:(r,s,e)=>{r.exports=!e(7057)&&!e(4253)(function(){return Object.defineProperty(e(2457)("div"),"a",{get:function(){return 7}}).a!=7})},7242:r=>{r.exports=function(s,e,t){var n=t===void 0;switch(e.length){case 0:return n?s():s.call(t);case 1:return n?s(e[0]):s.call(t,e[0]);case 2:return n?s(e[0],e[1]):s.call(t,e[0],e[1]);case 3:return n?s(e[0],e[1],e[2]):s.call(t,e[0],e[1],e[2]);case 4:return n?s(e[0],e[1],e[2],e[3]):s.call(t,e[0],e[1],e[2],e[3])}return s.apply(t,e)}},9797:(r,s,e)=>{var t=e(2032);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return t(n)=="String"?n.split(""):Object(n)}},6555:(r,s,e)=>{var t=e(2803),n=e(6314)("iterator"),a=Array.prototype;r.exports=function(i){return i!==void 0&&(t.Array===i||a[n]===i)}},5286:r=>{r.exports=function(s){return typeof s=="object"?s!==null:typeof s=="function"}},8851:(r,s,e)=>{var t=e(7007);r.exports=function(n,a,i,o){try{return o?a(t(i)[0],i[1]):a(i)}catch(l){var c=n.return;throw c!==void 0&&t(c.call(n)),l}}},9988:(r,s,e)=>{"use strict";var t=e(2503),n=e(681),a=e(2943),i={};e(7728)(i,e(6314)("iterator"),function(){return this}),r.exports=function(o,c,l){o.prototype=t(i,{next:n(1,l)}),a(o,c+" Iterator")}},2923:(r,s,e)=>{"use strict";var t=e(4461),n=e(2985),a=e(7234),i=e(7728),o=e(2803),c=e(9988),l=e(2943),f=e(468),d=e(6314)("iterator"),v=!([].keys&&"next"in[].keys()),x="@@iterator",b="keys",w="values",O=function(){return this};r.exports=function(P,E,g,j,u,h,y){c(g,E,j);var S=function($){if(!v&&$ in C)return C[$];switch($){case b:return function(){return new g(this,$)};case w:return function(){return new g(this,$)}}return function(){return new g(this,$)}},A=E+" Iterator",R=u==w,B=!1,C=P.prototype,N=C[d]||C[x]||u&&C[u],L=N||S(u),G=u?R?S("entries"):L:void 0,V=E=="Array"&&C.entries||N,W,H,k;if(V&&(k=f(V.call(new P)),k!==Object.prototype&&k.next&&(l(k,A,!0),!t&&typeof k[d]!="function"&&i(k,d,O))),R&&N&&N.name!==w&&(B=!0,L=function(){return N.call(this)}),(!t||y)&&(v||B||!C[d])&&i(C,d,L),o[E]=L,o[A]=O,u)if(W={values:R?L:S(w),keys:h?L:S(b),entries:G},y)for(H in W)H in C||a(C,H,W[H]);else n(n.P+n.F*(v||B),E,W);return W}},7462:(r,s,e)=>{var t=e(6314)("iterator"),n=!1;try{var a=[7][t]();a.return=function(){n=!0},Array.from(a,function(){throw 2})}catch(i){}r.exports=function(i,o){if(!o&&!n)return!1;var c=!1;try{var l=[7],f=l[t]();f.next=function(){return{done:c=!0}},l[t]=function(){return f},i(l)}catch(d){}return c}},5436:r=>{r.exports=function(s,e){return{value:e,done:!!s}}},2803:r=>{r.exports={}},4461:r=>{r.exports=!1},4351:(r,s,e)=>{var t=e(3816),n=e(4193).set,a=t.MutationObserver||t.WebKitMutationObserver,i=t.process,o=t.Promise,c=e(2032)(i)=="process";r.exports=function(){var l,f,d,v=function(){var O,P;for(c&&(O=i.domain)&&O.exit();l;){P=l.fn,l=l.next;try{P()}catch(E){throw l?d():f=void 0,E}}f=void 0,O&&O.enter()};if(c)d=function(){i.nextTick(v)};else if(a&&!(t.navigator&&t.navigator.standalone)){var x=!0,b=document.createTextNode("");new a(v).observe(b,{characterData:!0}),d=function(){b.data=x=!x}}else if(o&&o.resolve){var w=o.resolve(void 0);d=function(){w.then(v)}}else d=function(){n.call(t,v)};return function(O){var P={fn:O,next:void 0};f&&(f.next=P),l||(l=P,d()),f=P}}},3499:(r,s,e)=>{"use strict";var t=e(4963);function n(a){var i,o;this.promise=new a(function(c,l){if(i!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");i=c,o=l}),this.resolve=t(i),this.reject=t(o)}r.exports.f=function(a){return new n(a)}},5345:(r,s,e)=>{"use strict";var t=e(7057),n=e(7184),a=e(4548),i=e(4682),o=e(508),c=e(9797),l=Object.assign;r.exports=!l||e(4253)(function(){var f={},d={},v=Symbol(),x="abcdefghijklmnopqrst";return f[v]=7,x.split("").forEach(function(b){d[b]=b}),l({},f)[v]!=7||Object.keys(l({},d)).join("")!=x})?function(d,v){for(var x=o(d),b=arguments.length,w=1,O=a.f,P=i.f;b>w;)for(var E=c(arguments[w++]),g=O?n(E).concat(O(E)):n(E),j=g.length,u=0,h;j>u;)h=g[u++],(!t||P.call(E,h))&&(x[h]=E[h]);return x}:l},2503:(r,s,e)=>{var t=e(7007),n=e(5588),a=e(4430),i=e(9335)("IE_PROTO"),o=function(){},c="prototype",l=function(){var f=e(2457)("iframe"),d=a.length,v="<",x=">",b;for(f.style.display="none",e(639).appendChild(f),f.src="javascript:",b=f.contentWindow.document,b.open(),b.write(v+"script"+x+"document.F=Object"+v+"/script"+x),b.close(),l=b.F;d--;)delete l[c][a[d]];return l()};r.exports=Object.create||function(d,v){var x;return d!==null?(o[c]=t(d),x=new o,o[c]=null,x[i]=d):x=l(),v===void 0?x:n(x,v)}},9275:(r,s,e)=>{var t=e(7007),n=e(1734),a=e(1689),i=Object.defineProperty;s.f=e(7057)?Object.defineProperty:function(c,l,f){if(t(c),l=a(l,!0),t(f),n)try{return i(c,l,f)}catch(d){}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(c[l]=f.value),c}},5588:(r,s,e)=>{var t=e(9275),n=e(7007),a=e(7184);r.exports=e(7057)?Object.defineProperties:function(o,c){n(o);for(var l=a(c),f=l.length,d=0,v;f>d;)t.f(o,v=l[d++],c[v]);return o}},4548:(r,s)=>{s.f=Object.getOwnPropertySymbols},468:(r,s,e)=>{var t=e(9181),n=e(508),a=e(9335)("IE_PROTO"),i=Object.prototype;r.exports=Object.getPrototypeOf||function(o){return o=n(o),t(o,a)?o[a]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?i:null}},189:(r,s,e)=>{var t=e(9181),n=e(2110),a=e(9315)(!1),i=e(9335)("IE_PROTO");r.exports=function(o,c){var l=n(o),f=0,d=[],v;for(v in l)v!=i&&(t(l,v)&&d.push(v));for(;c.length>f;)t(l,v=c[f++])&&(~a(d,v)||d.push(v));return d}},7184:(r,s,e)=>{var t=e(189),n=e(4430);r.exports=Object.keys||function(i){return t(i,n)}},4682:(r,s)=>{s.f={}.propertyIsEnumerable},188:r=>{r.exports=function(s){try{return{e:!1,v:s()}}catch(e){return{e:!0,v:e}}}},94:(r,s,e)=>{var t=e(7007),n=e(5286),a=e(3499);r.exports=function(i,o){if(t(i),n(o)&&o.constructor===i)return o;var c=a.f(i),l=c.resolve;return l(o),c.promise}},681:r=>{r.exports=function(s,e){return{enumerable:!(s&1),configurable:!(s&2),writable:!(s&4),value:e}}},4408:(r,s,e)=>{var t=e(7234);r.exports=function(n,a,i){for(var o in a)t(n,o,a[o],i);return n}},7234:(r,s,e)=>{var t=e(3816),n=e(7728),a=e(9181),i=e(3953)("src"),o=e(18),c="toString",l=(""+o).split(c);e(5645).inspectSource=function(f){return o.call(f)},(r.exports=function(f,d,v,x){var b=typeof v=="function";if(b&&(a(v,"name")||n(v,"name",d)),f[d]===v)return;b&&(a(v,i)||n(v,i,f[d]?""+f[d]:l.join(String(d)))),f===t?f[d]=v:x?f[d]?f[d]=v:n(f,d,v):(delete f[d],n(f,d,v))})(Function.prototype,c,function(){return typeof this=="function"&&this[i]||o.call(this)})},2974:(r,s,e)=>{"use strict";var t=e(3816),n=e(9275),a=e(7057),i=e(6314)("species");r.exports=function(o){var c=t[o];a&&c&&!c[i]&&n.f(c,i,{configurable:!0,get:function(){return this}})}},2943:(r,s,e)=>{var t=e(9275).f,n=e(9181),a=e(6314)("toStringTag");r.exports=function(i,o,c){i&&!n(i=c?i:i.prototype,a)&&t(i,a,{configurable:!0,value:o})}},9335:(r,s,e)=>{var t=e(3825)("keys"),n=e(3953);r.exports=function(a){return t[a]||(t[a]=n(a))}},3825:(r,s,e)=>{var t=e(5645),n=e(3816),a="__core-js_shared__",i=n[a]||(n[a]={});(r.exports=function(o,c){return i[o]||(i[o]=c!==void 0?c:{})})("versions",[]).push({version:t.version,mode:e(4461)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},8364:(r,s,e)=>{var t=e(7007),n=e(4963),a=e(6314)("species");r.exports=function(i,o){var c=t(i).constructor,l;return c===void 0||(l=t(c)[a])==null?o:n(l)}},4193:(r,s,e)=>{var t=e(741),n=e(7242),a=e(639),i=e(2457),o=e(3816),c=o.process,l=o.setImmediate,f=o.clearImmediate,d=o.MessageChannel,v=o.Dispatch,x=0,b={},w="onreadystatechange",O,P,E,g=function(){var u=+this;if(b.hasOwnProperty(u)){var h=b[u];delete b[u],h()}},j=function(u){g.call(u.data)};(!l||!f)&&(l=function(h){for(var y=[],S=1;arguments.length>S;)y.push(arguments[S++]);return b[++x]=function(){n(typeof h=="function"?h:Function(h),y)},O(x),x},f=function(h){delete b[h]},e(2032)(c)=="process"?O=function(u){c.nextTick(t(g,u,1))}:v&&v.now?O=function(u){v.now(t(g,u,1))}:d?(P=new d,E=P.port2,P.port1.onmessage=j,O=t(E.postMessage,E,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(O=function(u){o.postMessage(u+"","*")},o.addEventListener("message",j,!1)):w in i("script")?O=function(u){a.appendChild(i("script"))[w]=function(){a.removeChild(this),g.call(u)}}:O=function(u){setTimeout(t(g,u,1),0)}),r.exports={set:l,clear:f}},2337:(r,s,e)=>{var t=e(1467),n=Math.max,a=Math.min;r.exports=function(i,o){return i=t(i),i<0?n(i+o,0):a(i,o)}},1467:r=>{var s=Math.ceil,e=Math.floor;r.exports=function(t){return isNaN(t=+t)?0:(t>0?e:s)(t)}},2110:(r,s,e)=>{var t=e(9797),n=e(1355);r.exports=function(a){return t(n(a))}},875:(r,s,e)=>{var t=e(1467),n=Math.min;r.exports=function(a){return a>0?n(t(a),9007199254740991):0}},508:(r,s,e)=>{var t=e(1355);r.exports=function(n){return Object(t(n))}},1689:(r,s,e)=>{var t=e(5286);r.exports=function(n,a){if(!t(n))return n;var i,o;if(a&&typeof(i=n.toString)=="function"&&!t(o=i.call(n)))return o;if(typeof(i=n.valueOf)=="function"&&!t(o=i.call(n)))return o;if(!a&&typeof(i=n.toString)=="function"&&!t(o=i.call(n)))return o;throw TypeError("Can't convert object to primitive value")}},3953:r=>{var s=0,e=Math.random();r.exports=function(t){return"Symbol(".concat(t===void 0?"":t,")_",(++s+e).toString(36))}},575:(r,s,e)=>{var t=e(3816),n=t.navigator;r.exports=n&&n.userAgent||""},6314:(r,s,e)=>{var t=e(3825)("wks"),n=e(3953),a=e(3816).Symbol,i=typeof a=="function",o=r.exports=function(c){return t[c]||(t[c]=i&&a[c]||(i?a:n)("Symbol."+c))};o.store=t},9002:(r,s,e)=>{var t=e(1488),n=e(6314)("iterator"),a=e(2803);r.exports=e(5645).getIteratorMethod=function(i){if(i!=null)return i[n]||i["@@iterator"]||a[t(i)]}},6997:(r,s,e)=>{"use strict";var t=e(7722),n=e(5436),a=e(2803),i=e(2110);r.exports=e(2923)(Array,"Array",function(o,c){this._t=i(o),this._i=0,this._k=c},function(){var o=this._t,c=this._k,l=this._i++;return!o||l>=o.length?(this._t=void 0,n(1)):c=="keys"?n(0,l):c=="values"?n(0,o[l]):n(0,[l,o[l]])},"values"),a.Arguments=a.Array,t("keys"),t("values"),t("entries")},5115:(r,s,e)=>{var t=e(2985);t(t.S+t.F,"Object",{assign:e(5345)})},6253:(r,s,e)=>{"use strict";var t=e(1488),n={};n[e(6314)("toStringTag")]="z",n+""!="[object z]"&&e(7234)(Object.prototype,"toString",function(){return"[object "+t(this)+"]"},!0)},851:(r,s,e)=>{"use strict";var t=e(4461),n=e(3816),a=e(741),i=e(1488),o=e(2985),c=e(5286),l=e(4963),f=e(3328),d=e(3531),v=e(8364),x=e(4193).set,b=e(4351)(),w=e(3499),O=e(188),P=e(575),E=e(94),g="Promise",j=n.TypeError,u=n.process,h=u&&u.versions,y=h&&h.v8||"",S=n[g],A=i(u)=="process",R=function(){},B,C,N,L,G=C=w.f,V=!!function(){try{var p=S.resolve(1),m=(p.constructor={})[e(6314)("species")]=function(I){I(R,R)};return(A||typeof PromiseRejectionEvent=="function")&&p.then(R)instanceof m&&y.indexOf("6.6")!==0&&P.indexOf("Chrome/66")===-1}catch(I){}}(),W=function(p){var m;return c(p)&&typeof(m=p.then)=="function"?m:!1},H=function(p,m){if(p._n)return;p._n=!0;var I=p._c;b(function(){for(var T=p._v,D=p._s==1,F=0,X=function(U){var q=D?U.ok:U.fail,J=U.resolve,Q=U.reject,K=U.domain,z,ee,ne;try{q?(D||(p._h==2&&_(p),p._h=1),q===!0?z=T:(K&&K.enter(),z=q(T),K&&(K.exit(),ne=!0)),z===U.promise?Q(j("Promise-chain cycle")):(ee=W(z))?ee.call(z,J,Q):J(z)):Q(T)}catch(oe){K&&!ne&&K.exit(),Q(oe)}};I.length>F;)X(I[F++]);p._c=[],p._n=!1,m&&!p._h&&k(p)})},k=function(p){x.call(n,function(){var m=p._v,I=$(p),T,D,F;if(I&&(T=O(function(){A?u.emit("unhandledRejection",m,p):(D=n.onunhandledrejection)?D({promise:p,reason:m}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",m)}),p._h=A||$(p)?2:1),p._a=void 0,I&&T.e)throw T.v})},$=function(p){return p._h!==1&&(p._a||p._c).length===0},_=function(p){x.call(n,function(){var m;A?u.emit("rejectionHandled",p):(m=n.onrejectionhandled)&&m({promise:p,reason:p._v})})},Y=function(p){var m=this;if(m._d)return;m._d=!0,m=m._w||m,m._v=p,m._s=2,m._a||(m._a=m._c.slice()),H(m,!0)},te=function(p){var m=this,I;if(m._d)return;m._d=!0,m=m._w||m;try{if(m===p)throw j("Promise can't be resolved itself");(I=W(p))?b(function(){var T={_w:m,_d:!1};try{I.call(p,a(te,T,1),a(Y,T,1))}catch(D){Y.call(T,D)}}):(m._v=p,m._s=1,H(m,!1))}catch(T){Y.call({_w:m,_d:!1},T)}};V||(S=function(m){f(this,S,g,"_h"),l(m),B.call(this);try{m(a(te,this,1),a(Y,this,1))}catch(I){Y.call(this,I)}},B=function(m){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},B.prototype=e(4408)(S.prototype,{then:function(m,I){var T=G(v(this,S));return T.ok=typeof m=="function"?m:!0,T.fail=typeof I=="function"&&I,T.domain=A?u.domain:void 0,this._c.push(T),this._a&&this._a.push(T),this._s&&H(this,!1),T.promise},catch:function(p){return this.then(void 0,p)}}),N=function(){var p=new B;this.promise=p,this.resolve=a(te,p,1),this.reject=a(Y,p,1)},w.f=G=function(p){return p===S||p===L?new N(p):C(p)}),o(o.G+o.W+o.F*!V,{Promise:S}),e(2943)(S,g),e(2974)(g),L=e(5645)[g],o(o.S+o.F*!V,g,{reject:function(m){var I=G(this),T=I.reject;return T(m),I.promise}}),o(o.S+o.F*(t||!V),g,{resolve:function(m){return E(t&&this===L?S:this,m)}}),o(o.S+o.F*!(V&&e(7462)(function(p){S.all(p).catch(R)})),g,{all:function(m){var I=this,T=G(I),D=T.resolve,F=T.reject,X=O(function(){var U=[],q=0,J=1;d(m,!1,function(Q){var K=q++,z=!1;U.push(void 0),J++,I.resolve(Q).then(function(ee){if(z)return;z=!0,U[K]=ee,--J||D(U)},F)}),--J||D(U)});return X.e&&F(X.v),T.promise},race:function(m){var I=this,T=G(I),D=T.reject,F=O(function(){d(m,!1,function(X){I.resolve(X).then(T.resolve,D)})});return F.e&&D(F.v),T.promise}})},2773:(r,s,e)=>{"use strict";var t=e(2985),n=e(9315)(!0);t(t.P,"Array",{includes:function(i){return n(this,i,arguments.length>1?arguments[1]:void 0)}}),e(7722)("includes")},1181:(r,s,e)=>{for(var t=e(6997),n=e(7184),a=e(7234),i=e(3816),o=e(7728),c=e(2803),l=e(6314),f=l("iterator"),d=l("toStringTag"),v=c.Array,x={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},b=n(x),w=0;w<b.length;w++){var O=b[w],P=x[O],E=i[O],g=E&&E.prototype,j;if(g&&(g[f]||o(g,f,v),g[d]||o(g,d,O),c[O]=v,P))for(j in t)g[j]||a(g,j,t[j],!0)}},8344:()=>{(function(r){var s="currentScript",e=r.getElementsByTagName("script");s in r||Object.defineProperty(r,s,{get:function(){try{throw new Error}catch(a){var t,n=(/.*at [^\(]*\((.*):.+:.+\)$/ig.exec(a.stack)||[!1])[1];for(t in e)if(e[t].src==n||e[t].readyState=="interactive")return e[t];return null}}})})(document)}},Z={};function M(r){if(Z[r])return Z[r].exports;var s=Z[r]={exports:{}};return re[r](s,s.exports,M),s.exports}return(()=>{M.n=r=>{var s=r&&r.__esModule?()=>r.default:()=>r;return M.d(s,{a:s}),s}})(),(()=>{M.d=(r,s)=>{for(var e in s)M.o(s,e)&&!M.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:s[e]})}})(),(()=>{M.o=(r,s)=>Object.prototype.hasOwnProperty.call(r,s)})(),(()=>{M.r=r=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}})(),(()=>{M.p="/"})(),M(6738)})()}); | ||
(function(Z,M){typeof exports=="object"&&typeof module=="object"?module.exports=M():typeof define=="function"&&define.amd?define([],M):typeof exports=="object"?exports["gd-editor-sdk"]=M():Z["gd-editor-sdk"]=M()})(this,function(){return(()=>{var re={3913:r=>{function s(t,n){for(var a=0;a<n.length;a++){var i=n[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(t,n,a){return n&&s(t.prototype,n),a&&s(t,a),t}r.exports=e},6738:(r,s,e)=>{"use strict";e.r(s),e.d(s,{GdEditorSdk:()=>O,default:()=>P});var t={};if(e.r(t),e.d(t,{j:()=>O}),typeof window!="undefined"){e(8344);var n;(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(e.p=n[1])}const a=null;var i=e(5115),o=e(1181),c=e(6253),l=e(2773),f=e(851),d=e(3913),v=e.n(d),x={};const b=x;var w=function(){v()(E,[{key:"width",get:function(){return this.config.width}},{key:"height",get:function(){return this.config.height}}]);function E(j){this.config=j}var g=E.prototype;return g.addElement=function(u){var h=JSON.parse(JSON.stringify(u)),y=Math.random();return this.postMessage("editor.addElement",h,y)},g.postMessage=function(u,h,y){var S=this,A=function(){S.config.frame.contentWindow.postMessage({action:u,asyncId:y,payload:h},"*")};if(y)return new Promise(function(R){A(),b[y]=R});A()},E}(),O=function(){function E(j){var u=this;if(this.wrapper=null,this.frame=null,this.mask=null,this.container=null,this.cb=function(h){if(!h.origin.includes(".gaoding.com"))return!1;h.data.action==="editor.download"&&(u.config.onUpload&&u.config.onUpload(h.data.blob),u.config.onCompleted&&u.config.onCompleted(h.data.file),u.config.autoClose!==!1&&u.close()),h.data.action==="editor.templetLoaded"&&(u.config.onTempletLoaded&&u.config.onTempletLoaded(new w({width:h.data.payload.width,height:h.data.payload.height,frame:u.frame}))),h.data.asyncId&&b[h.data.asyncId]&&b[h.data.asyncId](h.data.payload)},!j.onCompleted&&!j.onUpload)throw new Error("缺少必填参数 onCompleted");this.config=j,this.autoResize(),window.addEventListener("resize",this.autoResize.bind(this))}var g=E.prototype;return g.autoResize=function(){var u=this.container;u&&(u.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",u.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px")},g.open=function(u){var h=this;if(!this.wrapper){var y=document.createElement("div");y.className="gaoding-iframe",y.style.position="absolute",y.style.top="0px",y.style.right="0px",y.style.bottom="0px",y.style.left="0px",y.style.zIndex="1000",document.documentElement.clientHeight>800&&(y.style.display="flex",y.style.alignItems="center",y.style.justifyContent="center"),this.wrapper=y;var S=this.container=document.createElement("div");S.style.position="relative",S.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",S.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px",S.style.minHeight="604px",S.style.margin="50px auto",S.style.background="#fff",S.style.display="block",S.appendChild(this.createCloseBtn()),this.config.style&&Object.keys(this.config.style).forEach(function(L){S.style[L]=h.config.style[L]});var A=document.createElement("iframe");A.style.display="block",A.style.width="100%",A.style.height="100%",A.setAttribute("frameborder","0"),this.frame=A,S.appendChild(A),y.append(S)}this.createMask();var R=u.ext||{};Object.assign(R,{filterFont:u.filterFont,buttonText:this.config.buttonText});var B=Object.keys(R).reduce(function(L,G){return R[G]!==void 0&&(L+="&"+G+"="+R[G]),L},""),C="";u.filterFont&&(C+="filterFont="+Number(u.filterFont)),C+=""+B;var N="https://www.gaoding.com";this.config.env==="local"?N="http://design.dev.gaoding.com":this.config.env==="dev"?N="https://www.dev.gaoding.com":this.config.env==="stage"&&(N="https://stage.gaoding.com"),this.frame.src=N+"/utm-editors/"+(this.config.appId?this.config.appId:encodeURIComponent(location.hostname))+"?"+C,document.body.appendChild(this.wrapper),window.addEventListener("message",this.cb)},g.close=function(){window.removeEventListener("message",this.cb),this.wrapper&&this.wrapper.parentElement&&this.wrapper.parentElement.removeChild(this.wrapper),this.mask&&this.mask.parentElement&&this.mask.parentElement.removeChild(this.mask),window.removeEventListener("resize",this.autoResize.bind(this)),this.config.onClose&&this.config.onClose()},g.createMask=function(){var u=document.createElement("div");u.style.position="fixed",u.style.top="0px",u.style.left="0px",u.style.bottom="0px",u.style.right="0px",u.style.zIndex=parseFloat(this.wrapper.style.zIndex)-1+"",u.style.backgroundColor="#000",u.style.opacity=".5",this.mask=u,document.body.appendChild(u)},g.createCloseBtn=function(){var u=this,h=document.createElement("div");h.style.fontSize="13px",h.style.width="42px",h.style.height="42px",h.style.textAlign="right",h.style.position="absolute",h.style.right="-42px",h.style.top="0px",h.style.background="#000",h.style.cursor="pointer",h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.backgroundRepeat="no-repeat";var y=document.createElement("img");return y.style.display="block",y.style.width="24px",y.src="https://st-gdx.dancf.com/gaodingx/34555636/design/20190509-142237-249d.png",h.appendChild(y),h.addEventListener("click",function(){return u.close()}),h},E}();window&&(window.GdEditorSdk=O);const P=t.default},4963:r=>{r.exports=function(s){if(typeof s!="function")throw TypeError(s+" is not a function!");return s}},7722:(r,s,e)=>{var t=e(6314)("unscopables"),n=Array.prototype;n[t]==null&&e(7728)(n,t,{}),r.exports=function(a){n[t][a]=!0}},3328:r=>{r.exports=function(s,e,t,n){if(!(s instanceof e)||n!==void 0&&n in s)throw TypeError(t+": incorrect invocation!");return s}},7007:(r,s,e)=>{var t=e(5286);r.exports=function(n){if(!t(n))throw TypeError(n+" is not an object!");return n}},9315:(r,s,e)=>{var t=e(2110),n=e(875),a=e(2337);r.exports=function(i){return function(o,c,l){var f=t(o),d=n(f.length),v=a(l,d),x;if(i&&c!=c){for(;d>v;)if(x=f[v++],x!=x)return!0}else for(;d>v;v++)if((i||v in f)&&f[v]===c)return i||v||0;return!i&&-1}}},1488:(r,s,e)=>{var t=e(2032),n=e(6314)("toStringTag"),a=t(function(){return arguments}())=="Arguments",i=function(o,c){try{return o[c]}catch(l){}};r.exports=function(o){var c,l,f;return o===void 0?"Undefined":o===null?"Null":typeof(l=i(c=Object(o),n))=="string"?l:a?t(c):(f=t(c))=="Object"&&typeof c.callee=="function"?"Arguments":f}},2032:r=>{var s={}.toString;r.exports=function(e){return s.call(e).slice(8,-1)}},5645:r=>{var s=r.exports={version:"2.6.11"};typeof __e=="number"&&(__e=s)},741:(r,s,e)=>{var t=e(4963);r.exports=function(n,a,i){if(t(n),a===void 0)return n;switch(i){case 1:return function(o){return n.call(a,o)};case 2:return function(o,c){return n.call(a,o,c)};case 3:return function(o,c,l){return n.call(a,o,c,l)}}return function(){return n.apply(a,arguments)}}},1355:r=>{r.exports=function(s){if(s==null)throw TypeError("Can't call method on "+s);return s}},7057:(r,s,e)=>{r.exports=!e(4253)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},2457:(r,s,e)=>{var t=e(5286),n=e(3816).document,a=t(n)&&t(n.createElement);r.exports=function(i){return a?n.createElement(i):{}}},4430:r=>{r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},2985:(r,s,e)=>{var t=e(3816),n=e(5645),a=e(7728),i=e(7234),o=e(741),c="prototype",l=function(f,d,v){var x=f&l.F,b=f&l.G,w=f&l.S,O=f&l.P,P=f&l.B,E=b?t:w?t[d]||(t[d]={}):(t[d]||{})[c],g=b?n:n[d]||(n[d]={}),j=g[c]||(g[c]={}),u,h,y,S;b&&(v=d);for(u in v)h=!x&&E&&E[u]!==void 0,y=(h?E:v)[u],S=P&&h?o(y,t):O&&typeof y=="function"?o(Function.call,y):y,E&&i(E,u,y,f&l.U),g[u]!=y&&a(g,u,S),O&&j[u]!=y&&(j[u]=y)};t.core=n,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,r.exports=l},4253:r=>{r.exports=function(s){try{return!!s()}catch(e){return!0}}},3531:(r,s,e)=>{var t=e(741),n=e(8851),a=e(6555),i=e(7007),o=e(875),c=e(9002),l={},f={},d=r.exports=function(v,x,b,w,O){var P=O?function(){return v}:c(v),E=t(b,w,x?2:1),g=0,j,u,h,y;if(typeof P!="function")throw TypeError(v+" is not iterable!");if(a(P)){for(j=o(v.length);j>g;g++)if(y=x?E(i(u=v[g])[0],u[1]):E(v[g]),y===l||y===f)return y}else for(h=P.call(v);!(u=h.next()).done;)if(y=n(h,E,u.value,x),y===l||y===f)return y};d.BREAK=l,d.RETURN=f},18:(r,s,e)=>{r.exports=e(3825)("native-function-to-string",Function.toString)},3816:r=>{var s=r.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=s)},9181:r=>{var s={}.hasOwnProperty;r.exports=function(e,t){return s.call(e,t)}},7728:(r,s,e)=>{var t=e(9275),n=e(681);r.exports=e(7057)?function(a,i,o){return t.f(a,i,n(1,o))}:function(a,i,o){return a[i]=o,a}},639:(r,s,e)=>{var t=e(3816).document;r.exports=t&&t.documentElement},1734:(r,s,e)=>{r.exports=!e(7057)&&!e(4253)(function(){return Object.defineProperty(e(2457)("div"),"a",{get:function(){return 7}}).a!=7})},7242:r=>{r.exports=function(s,e,t){var n=t===void 0;switch(e.length){case 0:return n?s():s.call(t);case 1:return n?s(e[0]):s.call(t,e[0]);case 2:return n?s(e[0],e[1]):s.call(t,e[0],e[1]);case 3:return n?s(e[0],e[1],e[2]):s.call(t,e[0],e[1],e[2]);case 4:return n?s(e[0],e[1],e[2],e[3]):s.call(t,e[0],e[1],e[2],e[3])}return s.apply(t,e)}},9797:(r,s,e)=>{var t=e(2032);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return t(n)=="String"?n.split(""):Object(n)}},6555:(r,s,e)=>{var t=e(2803),n=e(6314)("iterator"),a=Array.prototype;r.exports=function(i){return i!==void 0&&(t.Array===i||a[n]===i)}},5286:r=>{r.exports=function(s){return typeof s=="object"?s!==null:typeof s=="function"}},8851:(r,s,e)=>{var t=e(7007);r.exports=function(n,a,i,o){try{return o?a(t(i)[0],i[1]):a(i)}catch(l){var c=n.return;throw c!==void 0&&t(c.call(n)),l}}},9988:(r,s,e)=>{"use strict";var t=e(2503),n=e(681),a=e(2943),i={};e(7728)(i,e(6314)("iterator"),function(){return this}),r.exports=function(o,c,l){o.prototype=t(i,{next:n(1,l)}),a(o,c+" Iterator")}},2923:(r,s,e)=>{"use strict";var t=e(4461),n=e(2985),a=e(7234),i=e(7728),o=e(2803),c=e(9988),l=e(2943),f=e(468),d=e(6314)("iterator"),v=!([].keys&&"next"in[].keys()),x="@@iterator",b="keys",w="values",O=function(){return this};r.exports=function(P,E,g,j,u,h,y){c(g,E,j);var S=function($){if(!v&&$ in C)return C[$];switch($){case b:return function(){return new g(this,$)};case w:return function(){return new g(this,$)}}return function(){return new g(this,$)}},A=E+" Iterator",R=u==w,B=!1,C=P.prototype,N=C[d]||C[x]||u&&C[u],L=N||S(u),G=u?R?S("entries"):L:void 0,V=E=="Array"&&C.entries||N,W,H,k;if(V&&(k=f(V.call(new P)),k!==Object.prototype&&k.next&&(l(k,A,!0),!t&&typeof k[d]!="function"&&i(k,d,O))),R&&N&&N.name!==w&&(B=!0,L=function(){return N.call(this)}),(!t||y)&&(v||B||!C[d])&&i(C,d,L),o[E]=L,o[A]=O,u)if(W={values:R?L:S(w),keys:h?L:S(b),entries:G},y)for(H in W)H in C||a(C,H,W[H]);else n(n.P+n.F*(v||B),E,W);return W}},7462:(r,s,e)=>{var t=e(6314)("iterator"),n=!1;try{var a=[7][t]();a.return=function(){n=!0},Array.from(a,function(){throw 2})}catch(i){}r.exports=function(i,o){if(!o&&!n)return!1;var c=!1;try{var l=[7],f=l[t]();f.next=function(){return{done:c=!0}},l[t]=function(){return f},i(l)}catch(d){}return c}},5436:r=>{r.exports=function(s,e){return{value:e,done:!!s}}},2803:r=>{r.exports={}},4461:r=>{r.exports=!1},4351:(r,s,e)=>{var t=e(3816),n=e(4193).set,a=t.MutationObserver||t.WebKitMutationObserver,i=t.process,o=t.Promise,c=e(2032)(i)=="process";r.exports=function(){var l,f,d,v=function(){var O,P;for(c&&(O=i.domain)&&O.exit();l;){P=l.fn,l=l.next;try{P()}catch(E){throw l?d():f=void 0,E}}f=void 0,O&&O.enter()};if(c)d=function(){i.nextTick(v)};else if(a&&!(t.navigator&&t.navigator.standalone)){var x=!0,b=document.createTextNode("");new a(v).observe(b,{characterData:!0}),d=function(){b.data=x=!x}}else if(o&&o.resolve){var w=o.resolve(void 0);d=function(){w.then(v)}}else d=function(){n.call(t,v)};return function(O){var P={fn:O,next:void 0};f&&(f.next=P),l||(l=P,d()),f=P}}},3499:(r,s,e)=>{"use strict";var t=e(4963);function n(a){var i,o;this.promise=new a(function(c,l){if(i!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");i=c,o=l}),this.resolve=t(i),this.reject=t(o)}r.exports.f=function(a){return new n(a)}},5345:(r,s,e)=>{"use strict";var t=e(7057),n=e(7184),a=e(4548),i=e(4682),o=e(508),c=e(9797),l=Object.assign;r.exports=!l||e(4253)(function(){var f={},d={},v=Symbol(),x="abcdefghijklmnopqrst";return f[v]=7,x.split("").forEach(function(b){d[b]=b}),l({},f)[v]!=7||Object.keys(l({},d)).join("")!=x})?function(d,v){for(var x=o(d),b=arguments.length,w=1,O=a.f,P=i.f;b>w;)for(var E=c(arguments[w++]),g=O?n(E).concat(O(E)):n(E),j=g.length,u=0,h;j>u;)h=g[u++],(!t||P.call(E,h))&&(x[h]=E[h]);return x}:l},2503:(r,s,e)=>{var t=e(7007),n=e(5588),a=e(4430),i=e(9335)("IE_PROTO"),o=function(){},c="prototype",l=function(){var f=e(2457)("iframe"),d=a.length,v="<",x=">",b;for(f.style.display="none",e(639).appendChild(f),f.src="javascript:",b=f.contentWindow.document,b.open(),b.write(v+"script"+x+"document.F=Object"+v+"/script"+x),b.close(),l=b.F;d--;)delete l[c][a[d]];return l()};r.exports=Object.create||function(d,v){var x;return d!==null?(o[c]=t(d),x=new o,o[c]=null,x[i]=d):x=l(),v===void 0?x:n(x,v)}},9275:(r,s,e)=>{var t=e(7007),n=e(1734),a=e(1689),i=Object.defineProperty;s.f=e(7057)?Object.defineProperty:function(c,l,f){if(t(c),l=a(l,!0),t(f),n)try{return i(c,l,f)}catch(d){}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(c[l]=f.value),c}},5588:(r,s,e)=>{var t=e(9275),n=e(7007),a=e(7184);r.exports=e(7057)?Object.defineProperties:function(o,c){n(o);for(var l=a(c),f=l.length,d=0,v;f>d;)t.f(o,v=l[d++],c[v]);return o}},4548:(r,s)=>{s.f=Object.getOwnPropertySymbols},468:(r,s,e)=>{var t=e(9181),n=e(508),a=e(9335)("IE_PROTO"),i=Object.prototype;r.exports=Object.getPrototypeOf||function(o){return o=n(o),t(o,a)?o[a]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?i:null}},189:(r,s,e)=>{var t=e(9181),n=e(2110),a=e(9315)(!1),i=e(9335)("IE_PROTO");r.exports=function(o,c){var l=n(o),f=0,d=[],v;for(v in l)v!=i&&(t(l,v)&&d.push(v));for(;c.length>f;)t(l,v=c[f++])&&(~a(d,v)||d.push(v));return d}},7184:(r,s,e)=>{var t=e(189),n=e(4430);r.exports=Object.keys||function(i){return t(i,n)}},4682:(r,s)=>{s.f={}.propertyIsEnumerable},188:r=>{r.exports=function(s){try{return{e:!1,v:s()}}catch(e){return{e:!0,v:e}}}},94:(r,s,e)=>{var t=e(7007),n=e(5286),a=e(3499);r.exports=function(i,o){if(t(i),n(o)&&o.constructor===i)return o;var c=a.f(i),l=c.resolve;return l(o),c.promise}},681:r=>{r.exports=function(s,e){return{enumerable:!(s&1),configurable:!(s&2),writable:!(s&4),value:e}}},4408:(r,s,e)=>{var t=e(7234);r.exports=function(n,a,i){for(var o in a)t(n,o,a[o],i);return n}},7234:(r,s,e)=>{var t=e(3816),n=e(7728),a=e(9181),i=e(3953)("src"),o=e(18),c="toString",l=(""+o).split(c);e(5645).inspectSource=function(f){return o.call(f)},(r.exports=function(f,d,v,x){var b=typeof v=="function";if(b&&(a(v,"name")||n(v,"name",d)),f[d]===v)return;b&&(a(v,i)||n(v,i,f[d]?""+f[d]:l.join(String(d)))),f===t?f[d]=v:x?f[d]?f[d]=v:n(f,d,v):(delete f[d],n(f,d,v))})(Function.prototype,c,function(){return typeof this=="function"&&this[i]||o.call(this)})},2974:(r,s,e)=>{"use strict";var t=e(3816),n=e(9275),a=e(7057),i=e(6314)("species");r.exports=function(o){var c=t[o];a&&c&&!c[i]&&n.f(c,i,{configurable:!0,get:function(){return this}})}},2943:(r,s,e)=>{var t=e(9275).f,n=e(9181),a=e(6314)("toStringTag");r.exports=function(i,o,c){i&&!n(i=c?i:i.prototype,a)&&t(i,a,{configurable:!0,value:o})}},9335:(r,s,e)=>{var t=e(3825)("keys"),n=e(3953);r.exports=function(a){return t[a]||(t[a]=n(a))}},3825:(r,s,e)=>{var t=e(5645),n=e(3816),a="__core-js_shared__",i=n[a]||(n[a]={});(r.exports=function(o,c){return i[o]||(i[o]=c!==void 0?c:{})})("versions",[]).push({version:t.version,mode:e(4461)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},8364:(r,s,e)=>{var t=e(7007),n=e(4963),a=e(6314)("species");r.exports=function(i,o){var c=t(i).constructor,l;return c===void 0||(l=t(c)[a])==null?o:n(l)}},4193:(r,s,e)=>{var t=e(741),n=e(7242),a=e(639),i=e(2457),o=e(3816),c=o.process,l=o.setImmediate,f=o.clearImmediate,d=o.MessageChannel,v=o.Dispatch,x=0,b={},w="onreadystatechange",O,P,E,g=function(){var u=+this;if(b.hasOwnProperty(u)){var h=b[u];delete b[u],h()}},j=function(u){g.call(u.data)};(!l||!f)&&(l=function(h){for(var y=[],S=1;arguments.length>S;)y.push(arguments[S++]);return b[++x]=function(){n(typeof h=="function"?h:Function(h),y)},O(x),x},f=function(h){delete b[h]},e(2032)(c)=="process"?O=function(u){c.nextTick(t(g,u,1))}:v&&v.now?O=function(u){v.now(t(g,u,1))}:d?(P=new d,E=P.port2,P.port1.onmessage=j,O=t(E.postMessage,E,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(O=function(u){o.postMessage(u+"","*")},o.addEventListener("message",j,!1)):w in i("script")?O=function(u){a.appendChild(i("script"))[w]=function(){a.removeChild(this),g.call(u)}}:O=function(u){setTimeout(t(g,u,1),0)}),r.exports={set:l,clear:f}},2337:(r,s,e)=>{var t=e(1467),n=Math.max,a=Math.min;r.exports=function(i,o){return i=t(i),i<0?n(i+o,0):a(i,o)}},1467:r=>{var s=Math.ceil,e=Math.floor;r.exports=function(t){return isNaN(t=+t)?0:(t>0?e:s)(t)}},2110:(r,s,e)=>{var t=e(9797),n=e(1355);r.exports=function(a){return t(n(a))}},875:(r,s,e)=>{var t=e(1467),n=Math.min;r.exports=function(a){return a>0?n(t(a),9007199254740991):0}},508:(r,s,e)=>{var t=e(1355);r.exports=function(n){return Object(t(n))}},1689:(r,s,e)=>{var t=e(5286);r.exports=function(n,a){if(!t(n))return n;var i,o;if(a&&typeof(i=n.toString)=="function"&&!t(o=i.call(n)))return o;if(typeof(i=n.valueOf)=="function"&&!t(o=i.call(n)))return o;if(!a&&typeof(i=n.toString)=="function"&&!t(o=i.call(n)))return o;throw TypeError("Can't convert object to primitive value")}},3953:r=>{var s=0,e=Math.random();r.exports=function(t){return"Symbol(".concat(t===void 0?"":t,")_",(++s+e).toString(36))}},575:(r,s,e)=>{var t=e(3816),n=t.navigator;r.exports=n&&n.userAgent||""},6314:(r,s,e)=>{var t=e(3825)("wks"),n=e(3953),a=e(3816).Symbol,i=typeof a=="function",o=r.exports=function(c){return t[c]||(t[c]=i&&a[c]||(i?a:n)("Symbol."+c))};o.store=t},9002:(r,s,e)=>{var t=e(1488),n=e(6314)("iterator"),a=e(2803);r.exports=e(5645).getIteratorMethod=function(i){if(i!=null)return i[n]||i["@@iterator"]||a[t(i)]}},6997:(r,s,e)=>{"use strict";var t=e(7722),n=e(5436),a=e(2803),i=e(2110);r.exports=e(2923)(Array,"Array",function(o,c){this._t=i(o),this._i=0,this._k=c},function(){var o=this._t,c=this._k,l=this._i++;return!o||l>=o.length?(this._t=void 0,n(1)):c=="keys"?n(0,l):c=="values"?n(0,o[l]):n(0,[l,o[l]])},"values"),a.Arguments=a.Array,t("keys"),t("values"),t("entries")},5115:(r,s,e)=>{var t=e(2985);t(t.S+t.F,"Object",{assign:e(5345)})},6253:(r,s,e)=>{"use strict";var t=e(1488),n={};n[e(6314)("toStringTag")]="z",n+""!="[object z]"&&e(7234)(Object.prototype,"toString",function(){return"[object "+t(this)+"]"},!0)},851:(r,s,e)=>{"use strict";var t=e(4461),n=e(3816),a=e(741),i=e(1488),o=e(2985),c=e(5286),l=e(4963),f=e(3328),d=e(3531),v=e(8364),x=e(4193).set,b=e(4351)(),w=e(3499),O=e(188),P=e(575),E=e(94),g="Promise",j=n.TypeError,u=n.process,h=u&&u.versions,y=h&&h.v8||"",S=n[g],A=i(u)=="process",R=function(){},B,C,N,L,G=C=w.f,V=!!function(){try{var p=S.resolve(1),m=(p.constructor={})[e(6314)("species")]=function(I){I(R,R)};return(A||typeof PromiseRejectionEvent=="function")&&p.then(R)instanceof m&&y.indexOf("6.6")!==0&&P.indexOf("Chrome/66")===-1}catch(I){}}(),W=function(p){var m;return c(p)&&typeof(m=p.then)=="function"?m:!1},H=function(p,m){if(p._n)return;p._n=!0;var I=p._c;b(function(){for(var T=p._v,D=p._s==1,F=0,X=function(U){var q=D?U.ok:U.fail,J=U.resolve,Q=U.reject,K=U.domain,z,ee,ne;try{q?(D||(p._h==2&&_(p),p._h=1),q===!0?z=T:(K&&K.enter(),z=q(T),K&&(K.exit(),ne=!0)),z===U.promise?Q(j("Promise-chain cycle")):(ee=W(z))?ee.call(z,J,Q):J(z)):Q(T)}catch(oe){K&&!ne&&K.exit(),Q(oe)}};I.length>F;)X(I[F++]);p._c=[],p._n=!1,m&&!p._h&&k(p)})},k=function(p){x.call(n,function(){var m=p._v,I=$(p),T,D,F;if(I&&(T=O(function(){A?u.emit("unhandledRejection",m,p):(D=n.onunhandledrejection)?D({promise:p,reason:m}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",m)}),p._h=A||$(p)?2:1),p._a=void 0,I&&T.e)throw T.v})},$=function(p){return p._h!==1&&(p._a||p._c).length===0},_=function(p){x.call(n,function(){var m;A?u.emit("rejectionHandled",p):(m=n.onrejectionhandled)&&m({promise:p,reason:p._v})})},Y=function(p){var m=this;if(m._d)return;m._d=!0,m=m._w||m,m._v=p,m._s=2,m._a||(m._a=m._c.slice()),H(m,!0)},te=function(p){var m=this,I;if(m._d)return;m._d=!0,m=m._w||m;try{if(m===p)throw j("Promise can't be resolved itself");(I=W(p))?b(function(){var T={_w:m,_d:!1};try{I.call(p,a(te,T,1),a(Y,T,1))}catch(D){Y.call(T,D)}}):(m._v=p,m._s=1,H(m,!1))}catch(T){Y.call({_w:m,_d:!1},T)}};V||(S=function(m){f(this,S,g,"_h"),l(m),B.call(this);try{m(a(te,this,1),a(Y,this,1))}catch(I){Y.call(this,I)}},B=function(m){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},B.prototype=e(4408)(S.prototype,{then:function(m,I){var T=G(v(this,S));return T.ok=typeof m=="function"?m:!0,T.fail=typeof I=="function"&&I,T.domain=A?u.domain:void 0,this._c.push(T),this._a&&this._a.push(T),this._s&&H(this,!1),T.promise},catch:function(p){return this.then(void 0,p)}}),N=function(){var p=new B;this.promise=p,this.resolve=a(te,p,1),this.reject=a(Y,p,1)},w.f=G=function(p){return p===S||p===L?new N(p):C(p)}),o(o.G+o.W+o.F*!V,{Promise:S}),e(2943)(S,g),e(2974)(g),L=e(5645)[g],o(o.S+o.F*!V,g,{reject:function(m){var I=G(this),T=I.reject;return T(m),I.promise}}),o(o.S+o.F*(t||!V),g,{resolve:function(m){return E(t&&this===L?S:this,m)}}),o(o.S+o.F*!(V&&e(7462)(function(p){S.all(p).catch(R)})),g,{all:function(m){var I=this,T=G(I),D=T.resolve,F=T.reject,X=O(function(){var U=[],q=0,J=1;d(m,!1,function(Q){var K=q++,z=!1;U.push(void 0),J++,I.resolve(Q).then(function(ee){if(z)return;z=!0,U[K]=ee,--J||D(U)},F)}),--J||D(U)});return X.e&&F(X.v),T.promise},race:function(m){var I=this,T=G(I),D=T.reject,F=O(function(){d(m,!1,function(X){I.resolve(X).then(T.resolve,D)})});return F.e&&D(F.v),T.promise}})},2773:(r,s,e)=>{"use strict";var t=e(2985),n=e(9315)(!0);t(t.P,"Array",{includes:function(i){return n(this,i,arguments.length>1?arguments[1]:void 0)}}),e(7722)("includes")},1181:(r,s,e)=>{for(var t=e(6997),n=e(7184),a=e(7234),i=e(3816),o=e(7728),c=e(2803),l=e(6314),f=l("iterator"),d=l("toStringTag"),v=c.Array,x={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},b=n(x),w=0;w<b.length;w++){var O=b[w],P=x[O],E=i[O],g=E&&E.prototype,j;if(g&&(g[f]||o(g,f,v),g[d]||o(g,d,O),c[O]=v,P))for(j in t)g[j]||a(g,j,t[j],!0)}},8344:()=>{(function(r){var s="currentScript",e=r.getElementsByTagName("script");s in r||Object.defineProperty(r,s,{get:function(){try{throw new Error}catch(a){var t,n=(/.*at [^\(]*\((.*):.+:.+\)$/ig.exec(a.stack)||[!1])[1];for(t in e)if(e[t].src==n||e[t].readyState=="interactive")return e[t];return null}}})})(document)}},Z={};function M(r){if(Z[r])return Z[r].exports;var s=Z[r]={exports:{}};return re[r](s,s.exports,M),s.exports}return(()=>{M.n=r=>{var s=r&&r.__esModule?()=>r.default:()=>r;return M.d(s,{a:s}),s}})(),(()=>{M.d=(r,s)=>{for(var e in s)M.o(s,e)&&!M.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:s[e]})}})(),(()=>{M.o=(r,s)=>Object.prototype.hasOwnProperty.call(r,s)})(),(()=>{M.r=r=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}})(),(()=>{M.p="/"})(),M(6738)})()}); |
@@ -377,2 +377,3 @@ // modules are defined as an array | ||
window.removeEventListener('resize', this.autoResize.bind(this)); | ||
this.config.onClose && this.config.onClose(); | ||
}; | ||
@@ -458,3 +459,3 @@ | ||
var protocol = location.protocol === 'https:' ? 'wss' : 'ws'; | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "50038" + '/'); | ||
var ws = new WebSocket(protocol + '://' + hostname + ':' + "52370" + '/'); | ||
@@ -461,0 +462,0 @@ ws.onmessage = function (event) { |
@@ -9,4 +9,5 @@ interface IConfig { | ||
onUpload?: (blob: Blob) => any; | ||
onCompleted(file: any): any; | ||
onTempletLoaded?: (editor: any) => any; | ||
onCompleted(file: any): any; | ||
onClose?: () => any; | ||
/** | ||
@@ -13,0 +14,0 @@ * onUpload 执行后,是否自动关闭弹窗,默认为 true |
@@ -144,2 +144,4 @@ "use strict"; | ||
window.removeEventListener('resize', this.autoResize.bind(this)); | ||
this.config.onClose && | ||
this.config.onClose(); | ||
}; | ||
@@ -146,0 +148,0 @@ GdEditorSdk.prototype.createMask = function () { |
{ | ||
"name": "@gaoding/editor-sdk", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"description": "稿定编辑器对外 SDK", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2794
142034