Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gaoding/editor-sdk

Package Overview
Dependencies
Maintainers
22
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gaoding/editor-sdk - npm Package Compare versions

Comparing version 0.2.5-beta.2 to 0.2.5

4

dist/gd-editor-sdk.js

@@ -471,4 +471,4 @@ module.exports =

if (!config.onUpload) {
throw new Error('缺少必填参数 onUpload');
if (!config.onCompleted && !config.onUpload) {
throw new Error('缺少必填参数 onCompleted');
}

@@ -475,0 +475,0 @@

@@ -1,1 +0,1 @@

(function(t,n){"object"===typeof exports&&"object"===typeof module?module.exports=n():"function"===typeof define&&define.amd?define([],n):"object"===typeof exports?exports["gd-editor-sdk"]=n():t["gd-editor-sdk"]=n()})(this,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=26)}([function(t,n){var e=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n,e){var r=e(4),o=e(0),i=e(30),u=e(32),c=e(13),f="prototype",s=function(t,n,e){var a,l,p,d=t&s.F,h=t&s.G,y=t&s.S,v=t&s.P,m=t&s.B,x=t&s.W,g=h?o:o[n]||(o[n]={}),b=g[f],w=h?r:y?r[n]:(r[n]||{})[f];for(a in h&&(e=n),e)l=!d&&w&&void 0!==w[a],l&&c(g,a)||(p=l?w[a]:e[a],g[a]=h&&"function"!=typeof w[a]?e[a]:m&&l?i(p,r):x&&w[a]==p?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n[f]=t[f],n}(p):v&&"function"==typeof p?i(Function.call,p):p,v&&((g.virtual||(g.virtual={}))[a]=p,t&s.R&&b&&!b[a]&&u(b,a,p)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},function(t,n,e){t.exports=!e(1)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var e=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)},function(t,n,e){var r=e(61),o=e(66);t.exports=e(11)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},function(t,n,e){t.exports=!e(20)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,e){t.exports=e(56)},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,n,e){var r=e(44),o=e(53);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n,e){var r=e(17),o=e(7);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(45);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){var r=e(7);t.exports=function(t){return Object(r(t))}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n,e){var r=e(8),o=e(2),i="__core-js_shared__",u=o[i]||(o[i]={});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(70)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){t.exports=e(28)},function(t,n,e){t.exports=e(41)},function(t,n,e){t.exports=e(27)},function(t,n,e){"use strict";e.r(n),e.d(n,"GdEditorSdk",function(){return s});var r=e(24),o=e.n(r),i=e(25),u=e.n(i),c=e(12),f=e.n(c),s=(e(59),function(){function t(t){var n=this;if(this.wrapper=null,this.frame=null,this.mask=null,this.container=null,this.cb=function(t){if(!t.origin.includes(".gaoding.com"))return!1;"editor.download"===t.data.action&&(n.config.onUpload&&n.config.onUpload(t.data.blob),n.config.onCompleted&&n.config.onCompleted(t.data.file),!1!==n.config.autoClose&&n.close())},!t.onUpload)throw new Error("缺少必填参数 onUpload");this.config=t,this.autoResize(),window.addEventListener("resize",this.autoResize.bind(this))}var n=t.prototype;return n.autoResize=function(){var t=this.container;t&&(t.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",t.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px")},n.open=function(t){var n=this;if(window.addEventListener("message",this.cb),!this.wrapper){var e=document.createElement("div");e.className="gaoding-iframe",e.style.position="absolute",e.style.top="0px",e.style.right="0px",e.style.bottom="0px",e.style.left="0px",e.style.zIndex="1000",document.documentElement.clientHeight>800&&(e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center"),this.wrapper=e;var r=this.container=document.createElement("div");r.style.position="relative",r.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",r.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px",r.style.minHeight="604px",r.style.margin="50px auto",r.style.background="#fff",r.style.display="block",r.appendChild(this.createCloseBtn()),this.config.style&&f()(this.config.style).forEach(function(t){r.style[t]=n.config.style[t]});var o=document.createElement("iframe");o.style.display="block",o.style.width="100%",o.style.height="100%",o.setAttribute("frameborder","0"),this.frame=o,r.appendChild(o),e.append(r)}this.createMask();var i=t.ext||{};u()(i,{filterFont:t.filterFont,buttonText:this.config.buttonText});var c=f()(i).reduce(function(t,n){return void 0!==i[n]&&(t+="&"+n+"="+i[n]),t},""),s="";t.filterFont&&(s+="filterFont="+Number(t.filterFont)),s+=""+c;var a="https://www.gaoding.com";"local"===this.config.env?a="http://design.dev.gaoding.com":"dev"===this.config.env?a="https://www.dev.gaoding.com":"stage"===this.config.env&&(a="https://stage.gaoding.com"),this.frame.src=a+"/utm-editors/"+(this.config.appId?this.config.appId:encodeURIComponent(location.hostname))+"?"+s,document.body.appendChild(this.wrapper)},n.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))},n.createMask=function(){var t=document.createElement("div");t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.bottom="0px",t.style.right="0px",t.style.zIndex=o()(this.wrapper.style.zIndex)-1+"",t.style.backgroundColor="#000",t.style.opacity=".5",this.mask=t,document.body.appendChild(t)},n.createCloseBtn=function(){var t=this,n=document.createElement("div");n.style.fontSize="13px",n.style.width="42px",n.style.height="42px",n.style.textAlign="right",n.style.position="absolute",n.style.right="-42px",n.style.top="0px",n.style.background="#000",n.style.cursor="pointer",n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="center",n.style.backgroundRepeat="no-repeat";var e=document.createElement("img");return e.style.display="block",e.style.width="24px",e.src="https://st-gdx.dancf.com/gaodingx/34555636/design/20190509-142237-249d.png",n.appendChild(e),n.addEventListener("click",function(){return t.close()}),n},t}());window&&(window.GdEditorSdk=s)},function(t,n,e){e(29),t.exports=e(0).parseFloat},function(t,n,e){var r=e(3),o=e(39);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},function(t,n,e){var r=e(31);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(33),o=e(38);t.exports=e(6)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(34),o=e(35),i=e(37),u=Object.defineProperty;n.f=e(6)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(c){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(5);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n,e){t.exports=!e(6)&&!e(1)(function(){return 7!=Object.defineProperty(e(36)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(5),o=e(4).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,e){var r=e(5);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(4).parseFloat,o=e(40).trim;t.exports=1/r(e(14)+"-0")!==-1/0?function(t){var n=o(String(t),3),e=r(n);return 0===e&&"-"==n.charAt(0)?-0:e}:r},function(t,n,e){var r=e(3),o=e(7),i=e(1),u=e(14),c="["+u+"]",f="​…",s=RegExp("^"+c+c+"*"),a=RegExp(c+c+"*$"),l=function(t,n,e){var o={},c=i(function(){return!!u[t]()||f[t]()!=f}),s=o[t]=c?n(p):u[t];e&&(o[e]=s),r(r.P+r.F*c,"String",o)},p=l.trim=function(t,n){return t=String(o(t)),1&n&&(t=t.replace(s,"")),2&n&&(t=t.replace(a,"")),t};t.exports=l},function(t,n,e){e(42),t.exports=e(0).Object.assign},function(t,n,e){var r=e(3);r(r.S+r.F,"Object",{assign:e(43)})},function(t,n,e){"use strict";var r=e(15),o=e(54),i=e(55),u=e(19),c=e(17),f=Object.assign;t.exports=!f||e(1)(function(){var t={},n={},e=Symbol(),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach(function(t){n[t]=t}),7!=f({},t)[e]||Object.keys(f({},n)).join("")!=r})?function(t,n){var e=u(t),f=arguments.length,s=1,a=o.f,l=i.f;while(f>s){var p,d=c(arguments[s++]),h=a?r(d).concat(a(d)):r(d),y=h.length,v=0;while(y>v)l.call(d,p=h[v++])&&(e[p]=d[p])}return e}:f},function(t,n,e){var r=e(13),o=e(16),i=e(46)(!1),u=e(49)("IE_PROTO");t.exports=function(t,n){var e,c=o(t),f=0,s=[];for(e in c)e!=u&&r(c,e)&&s.push(e);while(n.length>f)r(c,e=n[f++])&&(~i(s,e)||s.push(e));return s}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){var r=e(16),o=e(47),i=e(48);t.exports=function(t){return function(n,e,u){var c,f=r(n),s=o(f.length),a=i(u,s);if(t&&e!=e){while(s>a)if(c=f[a++],c!=c)return!0}else for(;s>a;a++)if((t||a in f)&&f[a]===e)return t||a||0;return!t&&-1}}},function(t,n,e){var r=e(18),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(18),o=Math.max,i=Math.min;t.exports=function(t,n){return t=r(t),t<0?o(t+n,0):i(t,n)}},function(t,n,e){var r=e(50)("keys"),o=e(52);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n,e){var r=e(0),o=e(4),i="__core-js_shared__",u=o[i]||(o[i]={});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(51)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!0},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){e(57),t.exports=e(0).Object.keys},function(t,n,e){var r=e(19),o=e(15);e(58)("keys",function(){return function(t){return o(r(t))}})},function(t,n,e){var r=e(3),o=e(0),i=e(1);t.exports=function(t,n){var e=(o.Object||{})[t]||Object[t],u={};u[t]=n(e),r(r.S+r.F*i(function(){e(1)}),"Object",u)}},function(t,n,e){"use strict";var r=e(60),o=e(73)(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),e(80)("includes")},function(t,n,e){var r=e(2),o=e(8),i=e(9),u=e(67),c=e(71),f="prototype",s=function(t,n,e){var a,l,p,d,h=t&s.F,y=t&s.G,v=t&s.S,m=t&s.P,x=t&s.B,g=y?r:v?r[n]||(r[n]={}):(r[n]||{})[f],b=y?o:o[n]||(o[n]={}),w=b[f]||(b[f]={});for(a in y&&(e=n),e)l=!h&&g&&void 0!==g[a],p=(l?g:e)[a],d=x&&l?c(p,r):m&&"function"==typeof p?c(Function.call,p):p,g&&u(g,a,p,t&s.U),b[a]!=p&&i(b,a,d),m&&w[a]!=p&&(w[a]=p)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,n,e){var r=e(62),o=e(63),i=e(65),u=Object.defineProperty;n.f=e(11)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(c){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(10);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n,e){t.exports=!e(11)&&!e(20)(function(){return 7!=Object.defineProperty(e(64)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(10),o=e(2).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,e){var r=e(10);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(2),o=e(9),i=e(68),u=e(21)("src"),c=e(69),f="toString",s=(""+c).split(f);e(8).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,e,c){var f="function"==typeof e;f&&(i(e,"name")||o(e,"name",n)),t[n]!==e&&(f&&(i(e,u)||o(e,u,t[n]?""+t[n]:s.join(String(n)))),t===r?t[n]=e:c?t[n]?t[n]=e:o(t,n,e):(delete t[n],o(t,n,e)))})(Function.prototype,f,function(){return"function"==typeof this&&this[u]||c.call(this)})},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){t.exports=e(22)("native-function-to-string",Function.toString)},function(t,n){t.exports=!1},function(t,n,e){var r=e(72);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(74),o=e(78),i=e(79);t.exports=function(t){return function(n,e,u){var c,f=r(n),s=o(f.length),a=i(u,s);if(t&&e!=e){while(s>a)if(c=f[a++],c!=c)return!0}else for(;s>a;a++)if((t||a in f)&&f[a]===e)return t||a||0;return!t&&-1}}},function(t,n,e){var r=e(75),o=e(77);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(76);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){var r=e(23),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(23),o=Math.max,i=Math.min;t.exports=function(t,n){return t=r(t),t<0?o(t+n,0):i(t,n)}},function(t,n,e){var r=e(81)("unscopables"),o=Array.prototype;void 0==o[r]&&e(9)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,n,e){var r=e(22)("wks"),o=e(21),i=e(2).Symbol,u="function"==typeof i,c=t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))};c.store=r}])});
(function(t,n){"object"===typeof exports&&"object"===typeof module?module.exports=n():"function"===typeof define&&define.amd?define([],n):"object"===typeof exports?exports["gd-editor-sdk"]=n():t["gd-editor-sdk"]=n()})(this,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=26)}([function(t,n){var e=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n,e){var r=e(4),o=e(0),i=e(30),u=e(32),c=e(13),f="prototype",s=function(t,n,e){var a,l,p,d=t&s.F,h=t&s.G,y=t&s.S,v=t&s.P,m=t&s.B,x=t&s.W,g=h?o:o[n]||(o[n]={}),b=g[f],w=h?r:y?r[n]:(r[n]||{})[f];for(a in h&&(e=n),e)l=!d&&w&&void 0!==w[a],l&&c(g,a)||(p=l?w[a]:e[a],g[a]=h&&"function"!=typeof w[a]?e[a]:m&&l?i(p,r):x&&w[a]==p?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n[f]=t[f],n}(p):v&&"function"==typeof p?i(Function.call,p):p,v&&((g.virtual||(g.virtual={}))[a]=p,t&s.R&&b&&!b[a]&&u(b,a,p)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},function(t,n,e){t.exports=!e(1)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var e=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=e)},function(t,n,e){var r=e(61),o=e(66);t.exports=e(11)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},function(t,n,e){t.exports=!e(20)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,e){t.exports=e(56)},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,n,e){var r=e(44),o=e(53);t.exports=Object.keys||function(t){return r(t,o)}},function(t,n,e){var r=e(17),o=e(7);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(45);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){var r=e(7);t.exports=function(t){return Object(r(t))}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n,e){var r=e(8),o=e(2),i="__core-js_shared__",u=o[i]||(o[i]={});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(70)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){t.exports=e(28)},function(t,n,e){t.exports=e(41)},function(t,n,e){t.exports=e(27)},function(t,n,e){"use strict";e.r(n),e.d(n,"GdEditorSdk",function(){return s});var r=e(24),o=e.n(r),i=e(25),u=e.n(i),c=e(12),f=e.n(c),s=(e(59),function(){function t(t){var n=this;if(this.wrapper=null,this.frame=null,this.mask=null,this.container=null,this.cb=function(t){if(!t.origin.includes(".gaoding.com"))return!1;"editor.download"===t.data.action&&(n.config.onUpload&&n.config.onUpload(t.data.blob),n.config.onCompleted&&n.config.onCompleted(t.data.file),!1!==n.config.autoClose&&n.close())},!t.onCompleted&&!t.onUpload)throw new Error("缺少必填参数 onCompleted");this.config=t,this.autoResize(),window.addEventListener("resize",this.autoResize.bind(this))}var n=t.prototype;return n.autoResize=function(){var t=this.container;t&&(t.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",t.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px")},n.open=function(t){var n=this;if(window.addEventListener("message",this.cb),!this.wrapper){var e=document.createElement("div");e.className="gaoding-iframe",e.style.position="absolute",e.style.top="0px",e.style.right="0px",e.style.bottom="0px",e.style.left="0px",e.style.zIndex="1000",document.documentElement.clientHeight>800&&(e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center"),this.wrapper=e;var r=this.container=document.createElement("div");r.style.position="relative",r.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",r.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px",r.style.minHeight="604px",r.style.margin="50px auto",r.style.background="#fff",r.style.display="block",r.appendChild(this.createCloseBtn()),this.config.style&&f()(this.config.style).forEach(function(t){r.style[t]=n.config.style[t]});var o=document.createElement("iframe");o.style.display="block",o.style.width="100%",o.style.height="100%",o.setAttribute("frameborder","0"),this.frame=o,r.appendChild(o),e.append(r)}this.createMask();var i=t.ext||{};u()(i,{filterFont:t.filterFont,buttonText:this.config.buttonText});var c=f()(i).reduce(function(t,n){return void 0!==i[n]&&(t+="&"+n+"="+i[n]),t},""),s="";t.filterFont&&(s+="filterFont="+Number(t.filterFont)),s+=""+c;var a="https://www.gaoding.com";"local"===this.config.env?a="http://design.dev.gaoding.com":"dev"===this.config.env?a="https://www.dev.gaoding.com":"stage"===this.config.env&&(a="https://stage.gaoding.com"),this.frame.src=a+"/utm-editors/"+(this.config.appId?this.config.appId:encodeURIComponent(location.hostname))+"?"+s,document.body.appendChild(this.wrapper)},n.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))},n.createMask=function(){var t=document.createElement("div");t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.bottom="0px",t.style.right="0px",t.style.zIndex=o()(this.wrapper.style.zIndex)-1+"",t.style.backgroundColor="#000",t.style.opacity=".5",this.mask=t,document.body.appendChild(t)},n.createCloseBtn=function(){var t=this,n=document.createElement("div");n.style.fontSize="13px",n.style.width="42px",n.style.height="42px",n.style.textAlign="right",n.style.position="absolute",n.style.right="-42px",n.style.top="0px",n.style.background="#000",n.style.cursor="pointer",n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="center",n.style.backgroundRepeat="no-repeat";var e=document.createElement("img");return e.style.display="block",e.style.width="24px",e.src="https://st-gdx.dancf.com/gaodingx/34555636/design/20190509-142237-249d.png",n.appendChild(e),n.addEventListener("click",function(){return t.close()}),n},t}());window&&(window.GdEditorSdk=s)},function(t,n,e){e(29),t.exports=e(0).parseFloat},function(t,n,e){var r=e(3),o=e(39);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},function(t,n,e){var r=e(31);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(33),o=e(38);t.exports=e(6)?function(t,n,e){return r.f(t,n,o(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(34),o=e(35),i=e(37),u=Object.defineProperty;n.f=e(6)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(c){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(5);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n,e){t.exports=!e(6)&&!e(1)(function(){return 7!=Object.defineProperty(e(36)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(5),o=e(4).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,e){var r=e(5);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(4).parseFloat,o=e(40).trim;t.exports=1/r(e(14)+"-0")!==-1/0?function(t){var n=o(String(t),3),e=r(n);return 0===e&&"-"==n.charAt(0)?-0:e}:r},function(t,n,e){var r=e(3),o=e(7),i=e(1),u=e(14),c="["+u+"]",f="​…",s=RegExp("^"+c+c+"*"),a=RegExp(c+c+"*$"),l=function(t,n,e){var o={},c=i(function(){return!!u[t]()||f[t]()!=f}),s=o[t]=c?n(p):u[t];e&&(o[e]=s),r(r.P+r.F*c,"String",o)},p=l.trim=function(t,n){return t=String(o(t)),1&n&&(t=t.replace(s,"")),2&n&&(t=t.replace(a,"")),t};t.exports=l},function(t,n,e){e(42),t.exports=e(0).Object.assign},function(t,n,e){var r=e(3);r(r.S+r.F,"Object",{assign:e(43)})},function(t,n,e){"use strict";var r=e(15),o=e(54),i=e(55),u=e(19),c=e(17),f=Object.assign;t.exports=!f||e(1)(function(){var t={},n={},e=Symbol(),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach(function(t){n[t]=t}),7!=f({},t)[e]||Object.keys(f({},n)).join("")!=r})?function(t,n){var e=u(t),f=arguments.length,s=1,a=o.f,l=i.f;while(f>s){var p,d=c(arguments[s++]),h=a?r(d).concat(a(d)):r(d),y=h.length,v=0;while(y>v)l.call(d,p=h[v++])&&(e[p]=d[p])}return e}:f},function(t,n,e){var r=e(13),o=e(16),i=e(46)(!1),u=e(49)("IE_PROTO");t.exports=function(t,n){var e,c=o(t),f=0,s=[];for(e in c)e!=u&&r(c,e)&&s.push(e);while(n.length>f)r(c,e=n[f++])&&(~i(s,e)||s.push(e));return s}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){var r=e(16),o=e(47),i=e(48);t.exports=function(t){return function(n,e,u){var c,f=r(n),s=o(f.length),a=i(u,s);if(t&&e!=e){while(s>a)if(c=f[a++],c!=c)return!0}else for(;s>a;a++)if((t||a in f)&&f[a]===e)return t||a||0;return!t&&-1}}},function(t,n,e){var r=e(18),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(18),o=Math.max,i=Math.min;t.exports=function(t,n){return t=r(t),t<0?o(t+n,0):i(t,n)}},function(t,n,e){var r=e(50)("keys"),o=e(52);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,n,e){var r=e(0),o=e(4),i="__core-js_shared__",u=o[i]||(o[i]={});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(51)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!0},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){e(57),t.exports=e(0).Object.keys},function(t,n,e){var r=e(19),o=e(15);e(58)("keys",function(){return function(t){return o(r(t))}})},function(t,n,e){var r=e(3),o=e(0),i=e(1);t.exports=function(t,n){var e=(o.Object||{})[t]||Object[t],u={};u[t]=n(e),r(r.S+r.F*i(function(){e(1)}),"Object",u)}},function(t,n,e){"use strict";var r=e(60),o=e(73)(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),e(80)("includes")},function(t,n,e){var r=e(2),o=e(8),i=e(9),u=e(67),c=e(71),f="prototype",s=function(t,n,e){var a,l,p,d,h=t&s.F,y=t&s.G,v=t&s.S,m=t&s.P,x=t&s.B,g=y?r:v?r[n]||(r[n]={}):(r[n]||{})[f],b=y?o:o[n]||(o[n]={}),w=b[f]||(b[f]={});for(a in y&&(e=n),e)l=!h&&g&&void 0!==g[a],p=(l?g:e)[a],d=x&&l?c(p,r):m&&"function"==typeof p?c(Function.call,p):p,g&&u(g,a,p,t&s.U),b[a]!=p&&i(b,a,d),m&&w[a]!=p&&(w[a]=p)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,n,e){var r=e(62),o=e(63),i=e(65),u=Object.defineProperty;n.f=e(11)?Object.defineProperty:function(t,n,e){if(r(t),n=i(n,!0),r(e),o)try{return u(t,n,e)}catch(c){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(10);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n,e){t.exports=!e(11)&&!e(20)(function(){return 7!=Object.defineProperty(e(64)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(10),o=e(2).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,e){var r=e(10);t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(2),o=e(9),i=e(68),u=e(21)("src"),c=e(69),f="toString",s=(""+c).split(f);e(8).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,e,c){var f="function"==typeof e;f&&(i(e,"name")||o(e,"name",n)),t[n]!==e&&(f&&(i(e,u)||o(e,u,t[n]?""+t[n]:s.join(String(n)))),t===r?t[n]=e:c?t[n]?t[n]=e:o(t,n,e):(delete t[n],o(t,n,e)))})(Function.prototype,f,function(){return"function"==typeof this&&this[u]||c.call(this)})},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){t.exports=e(22)("native-function-to-string",Function.toString)},function(t,n){t.exports=!1},function(t,n,e){var r=e(72);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(74),o=e(78),i=e(79);t.exports=function(t){return function(n,e,u){var c,f=r(n),s=o(f.length),a=i(u,s);if(t&&e!=e){while(s>a)if(c=f[a++],c!=c)return!0}else for(;s>a;a++)if((t||a in f)&&f[a]===e)return t||a||0;return!t&&-1}}},function(t,n,e){var r=e(75),o=e(77);t.exports=function(t){return r(o(t))}},function(t,n,e){var r=e(76);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){var r=e(23),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,n,e){var r=e(23),o=Math.max,i=Math.min;t.exports=function(t,n){return t=r(t),t<0?o(t+n,0):i(t,n)}},function(t,n,e){var r=e(81)("unscopables"),o=Array.prototype;void 0==o[r]&&e(9)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,n,e){var r=e(22)("wks"),o=e(21),i=e(2).Symbol,u="function"==typeof i,c=t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))};c.store=r}])});

@@ -8,3 +8,3 @@ interface IConfig {

*/
onUpload(blob: Blob): any;
onUpload?: (blob: Blob) => any;
onCompleted(file: any): any;

@@ -11,0 +11,0 @@ /**

@@ -20,4 +20,4 @@ "use strict";

};
if (!config.onUpload) {
throw new Error('缺少必填参数 onUpload');
if (!config.onCompleted && !config.onUpload) {
throw new Error('缺少必填参数 onCompleted');
}

@@ -24,0 +24,0 @@ this.config = config;

{
"name": "@gaoding/editor-sdk",
"version": "0.2.5-beta.2",
"version": "0.2.5",
"description": "稿定编辑器对外 SDK",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -47,3 +47,3 @@ # 稿定编辑器 SDK 接入说明

appId: '由SDK方提供',
// onUpload 执行后,是否自动关闭弹窗,默认为 true
// onCompleted 执行后,是否自动关闭弹窗,默认为 true
autoClose: true,

@@ -83,4 +83,3 @@ // 完成按钮文案默认“完成”

// 指定编辑器底图
// ps: 使用场景为图片编辑器,需开放 CORS 跨域能力
image: 'https://st-gdx.dancf.com/materials/115030/shots/20190830-155521-WWU47.png'
url: 'https://st-gdx.dancf.com/materials/115030/shots/20190830-155521-WWU47.png'
}

@@ -87,0 +86,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc