react-email-editor
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -113,3 +113,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
_default.prototype.componentDidMount = function componentDidMount() { | ||
loadScript(this.loadEditor); | ||
loadScript(this.loadEditor, this.props.scriptUrl); | ||
}; | ||
@@ -116,0 +116,0 @@ |
@@ -1,6 +0,6 @@ | ||
var scriptUrl = '//editor.unlayer.com/embed.js?2'; | ||
var defaultScriptUrl = '//editor.unlayer.com/embed.js?2'; | ||
var callbacks = []; | ||
var loaded = false; | ||
var isScriptInjected = function isScriptInjected() { | ||
var isScriptInjected = function isScriptInjected(scriptUrl) { | ||
var scripts = document.querySelectorAll('script'); | ||
@@ -33,5 +33,7 @@ var injected = false; | ||
export var loadScript = function loadScript(callback) { | ||
var scriptUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultScriptUrl; | ||
addCallback(callback); | ||
if (!isScriptInjected()) { | ||
if (!isScriptInjected(scriptUrl)) { | ||
var embedScript = document.createElement('script'); | ||
@@ -38,0 +40,0 @@ embedScript.setAttribute('src', scriptUrl); |
@@ -126,3 +126,3 @@ 'use strict'; | ||
_default.prototype.componentDidMount = function componentDidMount() { | ||
(0, _loadScript.loadScript)(this.loadEditor); | ||
(0, _loadScript.loadScript)(this.loadEditor, this.props.scriptUrl); | ||
}; | ||
@@ -129,0 +129,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
var scriptUrl = '//editor.unlayer.com/embed.js?2'; | ||
var defaultScriptUrl = '//editor.unlayer.com/embed.js?2'; | ||
var callbacks = []; | ||
var loaded = false; | ||
var isScriptInjected = function isScriptInjected() { | ||
var isScriptInjected = function isScriptInjected(scriptUrl) { | ||
var scripts = document.querySelectorAll('script'); | ||
@@ -36,5 +36,7 @@ var injected = false; | ||
var loadScript = exports.loadScript = function loadScript(callback) { | ||
var scriptUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultScriptUrl; | ||
addCallback(callback); | ||
if (!isScriptInjected()) { | ||
if (!isScriptInjected(scriptUrl)) { | ||
var embedScript = document.createElement('script'); | ||
@@ -41,0 +43,0 @@ embedScript.setAttribute('src', scriptUrl); |
{ | ||
"name": "react-email-editor", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Unlayer's Email Editor Component for React.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
/*! | ||
* react-email-editor v1.4.0 - https://github.com/unlayer/react-email-editor#readme | ||
* react-email-editor v1.5.0 - https://github.com/unlayer/react-email-editor#readme | ||
* MIT Licensed | ||
@@ -96,3 +96,3 @@ */ | ||
module.exports = {"name":"react-email-editor","version":"1.4.0","description":"Unlayer's Email Editor Component for React.js","main":"lib/index.js","module":"es/index.js","files":["css","es","lib","umd"],"scripts":{"build":"nwb build-react-component","clean":"nwb clean-module && nwb clean-demo","start":"nwb serve-react-demo","test":"nwb test-react","test:coverage":"nwb test-react --coverage","test:watch":"nwb test-react --server","release":"npm run build && npm publish"},"dependencies":{},"peerDependencies":{"react":"15.x || 16.x"},"devDependencies":{"nwb":"^0.22.0","react":"^16.13.1","react-dom":"^16.13.1","react-router-dom":"^5.2.0","styled-components":"^4.2.0"},"author":"","homepage":"https://github.com/unlayer/react-email-editor#readme","license":"MIT","repository":"https://github.com/unlayer/react-email-editor.git","keywords":["react-component"]}; | ||
module.exports = {"name":"react-email-editor","version":"1.5.0","description":"Unlayer's Email Editor Component for React.js","main":"lib/index.js","module":"es/index.js","files":["css","es","lib","umd"],"scripts":{"build":"nwb build-react-component","clean":"nwb clean-module && nwb clean-demo","start":"nwb serve-react-demo","test":"nwb test-react","test:coverage":"nwb test-react --coverage","test:watch":"nwb test-react --server","release":"npm run build && npm publish"},"dependencies":{},"peerDependencies":{"react":"15.x || 16.x"},"devDependencies":{"nwb":"^0.22.0","react":"^16.13.1","react-dom":"^16.13.1","react-router-dom":"^5.2.0","styled-components":"^4.2.0"},"author":"","homepage":"https://github.com/unlayer/react-email-editor#readme","license":"MIT","repository":"https://github.com/unlayer/react-email-editor.git","keywords":["react-component"]}; | ||
@@ -111,7 +111,7 @@ /***/ }), | ||
// CONCATENATED MODULE: ./src/loadScript.js | ||
var scriptUrl = '//editor.unlayer.com/embed.js?2'; | ||
var defaultScriptUrl = '//editor.unlayer.com/embed.js?2'; | ||
var callbacks = []; | ||
var loaded = false; | ||
var isScriptInjected = function isScriptInjected() { | ||
var isScriptInjected = function isScriptInjected(scriptUrl) { | ||
var scripts = document.querySelectorAll('script'); | ||
@@ -144,5 +144,7 @@ var injected = false; | ||
var loadScript = function loadScript(callback) { | ||
var scriptUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultScriptUrl; | ||
addCallback(callback); | ||
if (!isScriptInjected()) { | ||
if (!isScriptInjected(scriptUrl)) { | ||
var embedScript = document.createElement('script'); | ||
@@ -276,3 +278,3 @@ embedScript.setAttribute('src', scriptUrl); | ||
_default.prototype.componentDidMount = function componentDidMount() { | ||
loadScript(this.loadEditor); | ||
loadScript(this.loadEditor, this.props.scriptUrl); | ||
}; | ||
@@ -279,0 +281,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.EmailEditor=t(require("react")):e.EmailEditor=t(e.React)}(window,function(e){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(t,r){t.exports=e},function(e){e.exports={name:"react-email-editor",version:"1.4.0",description:"Unlayer's Email Editor Component for React.js",main:"lib/index.js",module:"es/index.js",files:["css","es","lib","umd"],scripts:{build:"nwb build-react-component",clean:"nwb clean-module && nwb clean-demo",start:"nwb serve-react-demo",test:"nwb test-react","test:coverage":"nwb test-react --coverage","test:watch":"nwb test-react --server",release:"npm run build && npm publish"},dependencies:{},peerDependencies:{react:"15.x || 16.x"},devDependencies:{nwb:"^0.22.0",react:"^16.13.1","react-dom":"^16.13.1","react-router-dom":"^5.2.0","styled-components":"^4.2.0"},author:"",homepage:"https://github.com/unlayer/react-email-editor#readme",license:"MIT",repository:"https://github.com/unlayer/react-email-editor.git",keywords:["react-component"]}},function(e,t,r){"use strict";r.r(t);var o=r(0),n=r.n(o),i="//editor.unlayer.com/embed.js?2",a=[],c=!1,s=function(){if(c)for(var e=void 0;e=a.shift();)e()},d=function(e){if(function(e){a.push(e)}(e),r=!1,document.querySelectorAll("script").forEach(function(e){e.src.includes(i)&&(r=!0)}),r)s();else{var t=document.createElement("script");t.setAttribute("src",i),t.onload=function(){c=!0,s()},document.head.appendChild(t)}var r},p=r(1);r.d(t,"default",function(){return f});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};var u=0,f=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,r));return o.loadEditor=function(){var e=o.props.options||{};o.props.projectId&&(e.projectId=o.props.projectId),o.props.tools&&(e.tools=o.props.tools),o.props.appearance&&(e.appearance=o.props.appearance),o.props.locale&&(e.locale=o.props.locale),o.editor=unlayer.createEditor(l({},e,{id:o.editorId,displayMode:"email",source:{name:p.name,version:p.version}}));var t=Object.entries(o.props),r=Array.isArray(t),n=0;for(t=r?t:t[Symbol.iterator]();;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var a=i,c=a[0],s=a[1];/^on/.test(c)&&"onLoad"!==c&&"onReady"!==c&&o.addEventListener(c,s)}var d=o.props,u=d.onLoad,f=d.onReady;u&&u(),f&&o.editor.addEventListener("editor:ready",f)},o.registerCallback=function(e,t){o.editor.registerCallback(e,t)},o.addEventListener=function(e,t){o.editor.addEventListener(e,t)},o.loadDesign=function(e){o.editor.loadDesign(e)},o.saveDesign=function(e){o.editor.saveDesign(e)},o.exportHtml=function(e){o.editor.exportHtml(e)},o.setMergeTags=function(e){o.editor.setMergeTags(e)},o.editorId=r.editorId||"editor-"+ ++u,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentDidMount=function(){d(this.loadEditor)},t.prototype.render=function(){var e=this.props,t=e.minHeight,r=void 0===t?500:t,o=e.style,i=void 0===o?{}:o;return n.a.createElement("div",{style:{flex:1,display:"flex",minHeight:r}},n.a.createElement("div",{id:this.editorId,style:l({},i,{flex:1})}))},t}(o.Component)},function(e,t,r){e.exports=r(2)}]).default}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.EmailEditor=t(require("react")):e.EmailEditor=t(e.React)}(window,function(e){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(t,r){t.exports=e},function(e){e.exports={name:"react-email-editor",version:"1.5.0",description:"Unlayer's Email Editor Component for React.js",main:"lib/index.js",module:"es/index.js",files:["css","es","lib","umd"],scripts:{build:"nwb build-react-component",clean:"nwb clean-module && nwb clean-demo",start:"nwb serve-react-demo",test:"nwb test-react","test:coverage":"nwb test-react --coverage","test:watch":"nwb test-react --server",release:"npm run build && npm publish"},dependencies:{},peerDependencies:{react:"15.x || 16.x"},devDependencies:{nwb:"^0.22.0",react:"^16.13.1","react-dom":"^16.13.1","react-router-dom":"^5.2.0","styled-components":"^4.2.0"},author:"",homepage:"https://github.com/unlayer/react-email-editor#readme",license:"MIT",repository:"https://github.com/unlayer/react-email-editor.git",keywords:["react-component"]}},function(e,t,r){"use strict";r.r(t);var o=r(0),n=r.n(o),i=[],a=!1,c=function(){if(a)for(var e=void 0;e=i.shift();)e()},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"//editor.unlayer.com/embed.js?2";if(function(e){i.push(e)}(e),function(e){var t=!1;return document.querySelectorAll("script").forEach(function(r){r.src.includes(e)&&(t=!0)}),t}(t))c();else{var r=document.createElement("script");r.setAttribute("src",t),r.onload=function(){a=!0,c()},document.head.appendChild(r)}},d=r(1);r.d(t,"default",function(){return u});var p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};var l=0,u=function(e){function t(r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,r));return o.loadEditor=function(){var e=o.props.options||{};o.props.projectId&&(e.projectId=o.props.projectId),o.props.tools&&(e.tools=o.props.tools),o.props.appearance&&(e.appearance=o.props.appearance),o.props.locale&&(e.locale=o.props.locale),o.editor=unlayer.createEditor(p({},e,{id:o.editorId,displayMode:"email",source:{name:d.name,version:d.version}}));var t=Object.entries(o.props),r=Array.isArray(t),n=0;for(t=r?t:t[Symbol.iterator]();;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var a=i,c=a[0],s=a[1];/^on/.test(c)&&"onLoad"!==c&&"onReady"!==c&&o.addEventListener(c,s)}var l=o.props,u=l.onLoad,f=l.onReady;u&&u(),f&&o.editor.addEventListener("editor:ready",f)},o.registerCallback=function(e,t){o.editor.registerCallback(e,t)},o.addEventListener=function(e,t){o.editor.addEventListener(e,t)},o.loadDesign=function(e){o.editor.loadDesign(e)},o.saveDesign=function(e){o.editor.saveDesign(e)},o.exportHtml=function(e){o.editor.exportHtml(e)},o.setMergeTags=function(e){o.editor.setMergeTags(e)},o.editorId=r.editorId||"editor-"+ ++l,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentDidMount=function(){s(this.loadEditor,this.props.scriptUrl)},t.prototype.render=function(){var e=this.props,t=e.minHeight,r=void 0===t?500:t,o=e.style,i=void 0===o?{}:o;return n.a.createElement("div",{style:{flex:1,display:"flex",minHeight:r}},n.a.createElement("div",{id:this.editorId,style:p({},i,{flex:1})}))},t}(o.Component)},function(e,t,r){e.exports=r(2)}]).default}); | ||
//# sourceMappingURL=react-email-editor.min.js.map |
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
44850
569