react-email-editor
Advanced tools
Comparing version 1.7.10 to 1.7.11
@@ -26,3 +26,3 @@ 'use strict'; | ||
var name = "react-email-editor"; | ||
var version = "1.7.10"; | ||
var version = "1.7.11"; | ||
var description = "Unlayer's Email Editor Component for React.js"; | ||
@@ -141,3 +141,6 @@ var main = "dist/index.js"; | ||
window.__unlayer_lastEditorId = window.__unlayer_lastEditorId || 0; | ||
var win = typeof window === 'undefined' ? { | ||
__unlayer_lastEditorId: 0 | ||
} : window; | ||
win.__unlayer_lastEditorId = win.__unlayer_lastEditorId || 0; | ||
var EmailEditor = /*#__PURE__*/React__default.forwardRef(function (props, ref) { | ||
@@ -159,3 +162,3 @@ var _props$appearance, _props$options, _props$options2, _props$locale, _props$options3, _props$projectId, _props$options4, _props$tools, _props$options5; | ||
var editorId = React.useMemo(function () { | ||
return props.editorId || "editor-" + ++window.__unlayer_lastEditorId; | ||
return props.editorId || "editor-" + ++win.__unlayer_lastEditorId; | ||
}, [props.editorId]); | ||
@@ -162,0 +165,0 @@ var options = _extends({}, props.options || {}, { |
@@ -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 o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}var r=[],i=!1,l=function(){if(i)for(var e;e=r.shift();)e()};window.__unlayer_lastEditorId=window.__unlayer_lastEditorId||0;var a=n.forwardRef((function(e,a){var d,u,c,s,f,p,v,y,E,m=e.onLoad,h=e.onReady,j=e.scriptUrl,_=e.minHeight,b=void 0===_?500:_,I=e.style,w=void 0===I?{}:I,O=t.useState(null),g=O[0],x=O[1],M=t.useState(!1),L=M[0],S=M[1],H=t.useMemo((function(){return e.editorId||"editor-"+ ++window.__unlayer_lastEditorId}),[e.editorId]),R=o({},e.options||{},{appearance:null!=(d=e.appearance)?d:null==(u=e.options)?void 0:u.appearance,displayMode:(null==e?void 0:e.displayMode)||(null==(c=e.options)?void 0:c.displayMode)||"email",locale:null!=(s=e.locale)?s:null==(f=e.options)?void 0:f.locale,projectId:null!=(p=e.projectId)?p:null==(v=e.options)?void 0:v.projectId,tools:null!=(y=e.tools)?y:null==(E=e.options)?void 0:E.tools,id:H,source:{name:"react-email-editor",version:"1.7.10"}});t.useImperativeHandle(a,(function(){return{editor:g}}),[g]),t.useEffect((function(){return function(){null==g||g.destroy()}}),[]),t.useEffect((function(){S(!1),function(e,t){if(void 0===t&&(t="https://editor.unlayer.com/embed.js?2"),r.push((function(){return S(!0)})),function(e){var t=document.querySelectorAll("script"),n=!1;return t.forEach((function(t){t.src.includes(e)&&(n=!0)})),n}(t))l();else{var n=document.createElement("script");n.setAttribute("src",t),n.onload=function(){i=!0,l()},document.head.appendChild(n)}}(0,j)}),[j]),t.useEffect((function(){L&&(null==g||g.destroy(),x(unlayer.createEditor(R)))}),[JSON.stringify(R),L]);var k=Object.keys(e).filter((function(e){return/^on/.test(e)}));return t.useEffect((function(){g&&(null==m||m(g),k.forEach((function(t){/^on/.test(t)&&"onLoad"!==t&&"onReady"!==t&&"function"==typeof e[t]&&g.addEventListener(t,e[t])})),h&&g.addEventListener("editor:ready",(function(){h(g)})))}),[g,Object.keys(k).join(",")]),n.createElement("div",{style:{flex:1,display:"flex",minHeight:b}},n.createElement("div",{id:H,style:o({},w,{flex:1})}))}));exports.EmailEditor=a,exports.default=a; | ||
"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 o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}var r=[],i=!1,l=function(){if(i)for(var e;e=r.shift();)e()},d="undefined"==typeof window?{__unlayer_lastEditorId:0}:window;d.__unlayer_lastEditorId=d.__unlayer_lastEditorId||0;var a=n.forwardRef((function(e,a){var u,s,c,f,p,y,v,E,m,_=e.onLoad,h=e.onReady,j=e.scriptUrl,b=e.minHeight,I=void 0===b?500:b,O=e.style,g=void 0===O?{}:O,w=t.useState(null),x=w[0],M=w[1],L=t.useState(!1),S=L[0],H=L[1],R=t.useMemo((function(){return e.editorId||"editor-"+ ++d.__unlayer_lastEditorId}),[e.editorId]),k=o({},e.options||{},{appearance:null!=(u=e.appearance)?u:null==(s=e.options)?void 0:s.appearance,displayMode:(null==e?void 0:e.displayMode)||(null==(c=e.options)?void 0:c.displayMode)||"email",locale:null!=(f=e.locale)?f:null==(p=e.options)?void 0:p.locale,projectId:null!=(y=e.projectId)?y:null==(v=e.options)?void 0:v.projectId,tools:null!=(E=e.tools)?E:null==(m=e.options)?void 0:m.tools,id:R,source:{name:"react-email-editor",version:"1.7.11"}});t.useImperativeHandle(a,(function(){return{editor:x}}),[x]),t.useEffect((function(){return function(){null==x||x.destroy()}}),[]),t.useEffect((function(){H(!1),function(e,t){if(void 0===t&&(t="https://editor.unlayer.com/embed.js?2"),r.push((function(){return H(!0)})),function(e){var t=document.querySelectorAll("script"),n=!1;return t.forEach((function(t){t.src.includes(e)&&(n=!0)})),n}(t))l();else{var n=document.createElement("script");n.setAttribute("src",t),n.onload=function(){i=!0,l()},document.head.appendChild(n)}}(0,j)}),[j]),t.useEffect((function(){S&&(null==x||x.destroy(),M(unlayer.createEditor(k)))}),[JSON.stringify(k),S]);var q=Object.keys(e).filter((function(e){return/^on/.test(e)}));return t.useEffect((function(){x&&(null==_||_(x),q.forEach((function(t){/^on/.test(t)&&"onLoad"!==t&&"onReady"!==t&&"function"==typeof e[t]&&x.addEventListener(t,e[t])})),h&&x.addEventListener("editor:ready",(function(){h(x)})))}),[x,Object.keys(q).join(",")]),n.createElement("div",{style:{flex:1,display:"flex",minHeight:I}},n.createElement("div",{id:R,style:o({},g,{flex:1})}))}));exports.EmailEditor=a,exports.default=a; | ||
//# sourceMappingURL=react-email-editor.cjs.production.min.js.map |
@@ -19,3 +19,3 @@ import React, { useState, useMemo, useImperativeHandle, useEffect } from 'react'; | ||
var name = "react-email-editor"; | ||
var version = "1.7.10"; | ||
var version = "1.7.11"; | ||
var description = "Unlayer's Email Editor Component for React.js"; | ||
@@ -134,3 +134,6 @@ var main = "dist/index.js"; | ||
window.__unlayer_lastEditorId = window.__unlayer_lastEditorId || 0; | ||
var win = typeof window === 'undefined' ? { | ||
__unlayer_lastEditorId: 0 | ||
} : window; | ||
win.__unlayer_lastEditorId = win.__unlayer_lastEditorId || 0; | ||
var EmailEditor = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
@@ -152,3 +155,3 @@ var _props$appearance, _props$options, _props$options2, _props$locale, _props$options3, _props$projectId, _props$options4, _props$tools, _props$options5; | ||
var editorId = useMemo(function () { | ||
return props.editorId || "editor-" + ++window.__unlayer_lastEditorId; | ||
return props.editorId || "editor-" + ++win.__unlayer_lastEditorId; | ||
}, [props.editorId]); | ||
@@ -155,0 +158,0 @@ var options = _extends({}, props.options || {}, { |
@@ -5,3 +5,3 @@ /// <reference types="unlayer-types/embed" /> | ||
import { Editor as EditorClass } from 'embed/Editor'; | ||
import { AppearanceConfig, DisplayMode, ToolsConfig } from 'state/types/index'; | ||
import { AppearanceConfig, DisplayMode, ToolsConfig } from 'state/types/types'; | ||
export declare type Unlayer = typeof Embed; | ||
@@ -8,0 +8,0 @@ export declare type UnlayerOptions = Parameters<Unlayer['createEditor']>[0]; |
{ | ||
"name": "react-email-editor", | ||
"version": "1.7.10", | ||
"version": "1.7.11", | ||
"description": "Unlayer's Email Editor Component for React.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -12,3 +12,3 @@ # React Email Editor | ||
Check out the live demo here: http://react-email-editor-demo.netlify.com/ ([Source Code](https://github.com/unlayer/react-email-editor/tree/master/demo/src)) | ||
Check out the live demo here: https://react-email-editor-demo.netlify.app/ ([Source Code](https://github.com/unlayer/react-email-editor/tree/master/demo/src)) | ||
@@ -15,0 +15,0 @@ ## Blog Post |
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
49790
498