react-email-editor
Advanced tools
Comparing version 1.7.7 to 1.7.8
import { EmailEditor } from './EmailEditor'; | ||
export * from './types'; | ||
export { EmailEditor as default }; | ||
export { EmailEditor, EmailEditor as default }; |
@@ -26,3 +26,3 @@ 'use strict'; | ||
var name = "react-email-editor"; | ||
var version = "1.7.7"; | ||
var version = "1.7.8"; | ||
var description = "Unlayer's Email Editor Component for React.js"; | ||
@@ -171,2 +171,5 @@ var main = "dist/index.js"; | ||
}, [editor]); | ||
var removeEventListener = React.useCallback(function (type, callback) { | ||
editor == null ? void 0 : editor.removeEventListener(type, callback); | ||
}, [editor]); | ||
var registerCallback = React.useCallback(function (type, callback) { | ||
@@ -184,2 +187,5 @@ editor == null ? void 0 : editor.registerCallback(type, callback); | ||
}, [editor]); | ||
var exportImage = React.useCallback(function (callback) { | ||
editor == null ? void 0 : editor.exportImage(callback); | ||
}, [editor]); | ||
var setMergeTags = React.useCallback(function (mergeTags) { | ||
@@ -218,5 +224,7 @@ editor == null ? void 0 : editor.setMergeTags(mergeTags); | ||
addEventListener: addEventListener, | ||
loadBlank: loadBlank | ||
loadBlank: loadBlank, | ||
exportImage: exportImage, | ||
removeEventListener: removeEventListener | ||
}; | ||
}, [saveDesign, exportHtml, setMergeTags, editor, loadDesign, registerCallback, addEventListener, loadBlank]); | ||
}, [saveDesign, exportHtml, setMergeTags, editor, loadDesign, registerCallback, addEventListener, loadBlank, exportImage, removeEventListener]); | ||
return React__default.createElement("div", { | ||
@@ -236,3 +244,4 @@ style: { | ||
exports.EmailEditor = EmailEditor; | ||
exports.default = EmailEditor; | ||
//# sourceMappingURL=react-email-editor.cjs.development.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var a=[],l=!1,o=function(){if(l)for(var e;e=a.shift();)e()},c=0;exports.default=n.forwardRef((function(e,i){var u=e.onLoad,s=e.onReady,d=e.scriptUrl,f=e.minHeight,p=void 0===f?500:f,v=e.style,b=void 0===v?{}:v,g=t.useRef(e.editorId||"editor-"+ ++c),m=t.useRef(!1),y=t.useState(null),h=y[0],k=y[1],j=t.useCallback((function(){if(!m.current){m.current=!0;var t=e.options||{};e.projectId&&(t.projectId=e.projectId),e.tools&&(t.tools=e.tools),e.appearance&&(t.appearance=e.appearance),e.locale&&(t.locale=e.locale),k(unlayer.createEditor(r({},t,{id:g.current,displayMode:"email",source:{name:"react-email-editor",version:"1.7.7"}})))}}),[g.current,e.appearance,e.locale,e.options,e.projectId,e.tools]),C=t.useCallback((function(e,t){null==h||h.addEventListener(e,t)}),[h]),E=t.useCallback((function(e,t){null==h||h.registerCallback(e,t)}),[h]),x=t.useCallback((function(e){null==h||h.loadDesign(e)}),[h]),I=t.useCallback((function(e){null==h||h.saveDesign(e)}),[h]),O=t.useCallback((function(e,t){null==h||h.exportHtml(e,t)}),[h]),H=t.useCallback((function(e){null==h||h.setMergeTags(e)}),[h]),L=t.useCallback((function(e){null==h||h.loadBlank(e)}),[h]);return t.useEffect((function(){!function(e,t){if(void 0===t&&(t="https://editor.unlayer.com/embed.js?2"),function(e){a.push(e)}(e),function(e){var t=document.querySelectorAll("script"),n=!1;return t.forEach((function(t){t.src.includes(e)&&(n=!0)})),n}(t))o();else{var n=document.createElement("script");n.setAttribute("src",t),n.onload=function(){l=!0,o()},document.head.appendChild(n)}}(j,d)}),[j,d]),t.useEffect((function(){if(h){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=n[t],a=r[0],l=r[1];/^on/.test(a)&&"onLoad"!==a&&"onReady"!==a&&C(a,l)}u&&u(),s&&h.addEventListener("editor:ready",s)}}),[h,C,u,s,e]),t.useImperativeHandle(i,(function(){return{saveDesign:I,exportHtml:O,setMergeTags:H,editor:h,loadDesign:x,registerCallback:E,addEventListener:C,loadBlank:L}}),[I,O,H,h,x,E,C,L]),n.createElement("div",{style:{flex:1,display:"flex",minHeight:p}},n.createElement("div",{id:g.current,style:r({},b,{flex:1})}))})); | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e;function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var a=[],l=!1,o=function(){if(l)for(var e;e=a.shift();)e()},i=0,c=n.forwardRef((function(e,c){var u=e.onLoad,s=e.onReady,d=e.scriptUrl,f=e.minHeight,p=void 0===f?500:f,v=e.style,b=void 0===v?{}:v,m=t.useRef(e.editorId||"editor-"+ ++i),g=t.useRef(!1),y=t.useState(null),k=y[0],E=y[1],C=t.useCallback((function(){if(!g.current){g.current=!0;var t=e.options||{};e.projectId&&(t.projectId=e.projectId),e.tools&&(t.tools=e.tools),e.appearance&&(t.appearance=e.appearance),e.locale&&(t.locale=e.locale),E(unlayer.createEditor(r({},t,{id:m.current,displayMode:"email",source:{name:"react-email-editor",version:"1.7.8"}})))}}),[m.current,e.appearance,e.locale,e.options,e.projectId,e.tools]),h=t.useCallback((function(e,t){null==k||k.addEventListener(e,t)}),[k]),j=t.useCallback((function(e,t){null==k||k.removeEventListener(e,t)}),[k]),x=t.useCallback((function(e,t){null==k||k.registerCallback(e,t)}),[k]),I=t.useCallback((function(e){null==k||k.loadDesign(e)}),[k]),L=t.useCallback((function(e){null==k||k.saveDesign(e)}),[k]),O=t.useCallback((function(e,t){null==k||k.exportHtml(e,t)}),[k]),H=t.useCallback((function(e){null==k||k.exportImage(e)}),[k]),R=t.useCallback((function(e){null==k||k.setMergeTags(e)}),[k]),D=t.useCallback((function(e){null==k||k.loadBlank(e)}),[k]);return t.useEffect((function(){!function(e,t){if(void 0===t&&(t="https://editor.unlayer.com/embed.js?2"),function(e){a.push(e)}(e),function(e){var t=document.querySelectorAll("script"),n=!1;return t.forEach((function(t){t.src.includes(e)&&(n=!0)})),n}(t))o();else{var n=document.createElement("script");n.setAttribute("src",t),n.onload=function(){l=!0,o()},document.head.appendChild(n)}}(C,d)}),[C,d]),t.useEffect((function(){if(k){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=n[t],a=r[0],l=r[1];/^on/.test(a)&&"onLoad"!==a&&"onReady"!==a&&h(a,l)}u&&u(),s&&k.addEventListener("editor:ready",s)}}),[k,h,u,s,e]),t.useImperativeHandle(c,(function(){return{saveDesign:L,exportHtml:O,setMergeTags:R,editor:k,loadDesign:I,registerCallback:x,addEventListener:h,loadBlank:D,exportImage:H,removeEventListener:j}}),[L,O,R,k,I,x,h,D,H,j]),n.createElement("div",{style:{flex:1,display:"flex",minHeight:p}},n.createElement("div",{id:m.current,style:r({},b,{flex:1})}))}));exports.EmailEditor=c,exports.default=c; | ||
//# sourceMappingURL=react-email-editor.cjs.production.min.js.map |
@@ -19,3 +19,3 @@ import React, { useRef, useState, useCallback, useEffect, useImperativeHandle } from 'react'; | ||
var name = "react-email-editor"; | ||
var version = "1.7.7"; | ||
var version = "1.7.8"; | ||
var description = "Unlayer's Email Editor Component for React.js"; | ||
@@ -164,2 +164,5 @@ var main = "dist/index.js"; | ||
}, [editor]); | ||
var removeEventListener = useCallback(function (type, callback) { | ||
editor == null ? void 0 : editor.removeEventListener(type, callback); | ||
}, [editor]); | ||
var registerCallback = useCallback(function (type, callback) { | ||
@@ -177,2 +180,5 @@ editor == null ? void 0 : editor.registerCallback(type, callback); | ||
}, [editor]); | ||
var exportImage = useCallback(function (callback) { | ||
editor == null ? void 0 : editor.exportImage(callback); | ||
}, [editor]); | ||
var setMergeTags = useCallback(function (mergeTags) { | ||
@@ -211,5 +217,7 @@ editor == null ? void 0 : editor.setMergeTags(mergeTags); | ||
addEventListener: addEventListener, | ||
loadBlank: loadBlank | ||
loadBlank: loadBlank, | ||
exportImage: exportImage, | ||
removeEventListener: removeEventListener | ||
}; | ||
}, [saveDesign, exportHtml, setMergeTags, editor, loadDesign, registerCallback, addEventListener, loadBlank]); | ||
}, [saveDesign, exportHtml, setMergeTags, editor, loadDesign, registerCallback, addEventListener, loadBlank, exportImage, removeEventListener]); | ||
return React.createElement("div", { | ||
@@ -230,2 +238,3 @@ style: { | ||
export default EmailEditor; | ||
export { EmailEditor }; | ||
//# sourceMappingURL=react-email-editor.esm.js.map |
{ | ||
"name": "react-email-editor", | ||
"version": "1.7.7", | ||
"version": "1.7.8", | ||
"description": "Unlayer's Email Editor Component for React.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import { EmailEditor } from './EmailEditor'; | ||
export * from './types'; | ||
export { EmailEditor as default }; | ||
export { EmailEditor, EmailEditor as default }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
75995
1145