react-email-editor
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -26,3 +26,3 @@ 'use strict'; | ||
var name = "react-email-editor"; | ||
var version = "1.7.0"; | ||
var version = "1.7.1"; | ||
var description = "Unlayer's Email Editor Component for React.js"; | ||
@@ -45,5 +45,5 @@ var main = "dist/index.js"; | ||
lint: "tsdx lint", | ||
postinstall: "cd demo && npm install", | ||
prepare: "tsdx build && cd demo && npm run build", | ||
release: "npm run build && npm publish" | ||
prepare: "tsdx build", | ||
release: "npm run build && npm publish", | ||
"netlify-build": "cd demo && npm install && npm run build" | ||
}; | ||
@@ -50,0 +50,0 @@ var peerDependencies = { |
@@ -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=[],o=!1,l=function(){if(o)for(var e;e=a.shift();)e()},c=0,i=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],j=y[1],C=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),j(unlayer.createEditor(r({},t,{id:g.current,displayMode:"email",source:{name:"react-email-editor",version:"1.7.0"}})))}}),[g.current,e.appearance,e.locale,e.options,e.projectId,e.tools]),k=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){null==h||h.exportHtml(e)}),[h]),H=t.useCallback((function(e){null==h||h.setMergeTags(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))l();else{var n=document.createElement("script");n.setAttribute("src",t),n.onload=function(){o=!0,l()},document.head.appendChild(n)}}(C,d)}),[C,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],o=r[1];/^on/.test(a)&&"onLoad"!==a&&"onReady"!==a&&k(a,o)}u&&u(),s&&h.addEventListener("editor:ready",s)}}),[h,k,u,s,e]),t.useImperativeHandle(i,(function(){return{saveDesign:I,exportHtml:O,setMergeTags:H,editor:h,loadDesign:x,registerCallback:E}}),[I,O,H,h,x,E]),n.createElement("div",{style:{flex:1,display:"flex",minHeight:p}},n.createElement("div",{id:g.current,style:r({},b,{flex:1})}))};exports.default=n.forwardRef(i); | ||
"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=[],o=!1,l=function(){if(o)for(var e;e=a.shift();)e()},c=0,i=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],j=y[1],C=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),j(unlayer.createEditor(r({},t,{id:g.current,displayMode:"email",source:{name:"react-email-editor",version:"1.7.1"}})))}}),[g.current,e.appearance,e.locale,e.options,e.projectId,e.tools]),k=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){null==h||h.exportHtml(e)}),[h]),H=t.useCallback((function(e){null==h||h.setMergeTags(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))l();else{var n=document.createElement("script");n.setAttribute("src",t),n.onload=function(){o=!0,l()},document.head.appendChild(n)}}(C,d)}),[C,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],o=r[1];/^on/.test(a)&&"onLoad"!==a&&"onReady"!==a&&k(a,o)}u&&u(),s&&h.addEventListener("editor:ready",s)}}),[h,k,u,s,e]),t.useImperativeHandle(i,(function(){return{saveDesign:I,exportHtml:O,setMergeTags:H,editor:h,loadDesign:x,registerCallback:E}}),[I,O,H,h,x,E]),n.createElement("div",{style:{flex:1,display:"flex",minHeight:p}},n.createElement("div",{id:g.current,style:r({},b,{flex:1})}))};exports.default=n.forwardRef(i); | ||
//# 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.0"; | ||
var version = "1.7.1"; | ||
var description = "Unlayer's Email Editor Component for React.js"; | ||
@@ -38,5 +38,5 @@ var main = "dist/index.js"; | ||
lint: "tsdx lint", | ||
postinstall: "cd demo && npm install", | ||
prepare: "tsdx build && cd demo && npm run build", | ||
release: "npm run build && npm publish" | ||
prepare: "tsdx build", | ||
release: "npm run build && npm publish", | ||
"netlify-build": "cd demo && npm install && npm run build" | ||
}; | ||
@@ -43,0 +43,0 @@ var peerDependencies = { |
@@ -17,2 +17,4 @@ export declare type EditorOptions = { | ||
exportHtml: (callback: Function) => void; | ||
showPreview: (device: string) => void; | ||
hidePreview: () => void; | ||
setMergeTags: (mergeTags: object) => void; | ||
@@ -19,0 +21,0 @@ }; |
{ | ||
"name": "react-email-editor", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "Unlayer's Email Editor Component for React.js", | ||
@@ -21,5 +21,5 @@ "main": "dist/index.js", | ||
"lint": "tsdx lint", | ||
"postinstall": "cd demo && npm install", | ||
"prepare": "tsdx build && cd demo && npm run build", | ||
"release": "npm run build && npm publish" | ||
"prepare": "tsdx build", | ||
"release": "npm run build && npm publish", | ||
"netlify-build": "cd demo && npm install && npm run build" | ||
}, | ||
@@ -26,0 +26,0 @@ "peerDependencies": { |
@@ -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/blob/master/demo/src/index.js)) | ||
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)) | ||
@@ -109,2 +109,2 @@ ## Blog Post | ||
Copyright (c) 2022 Unlayer. [MIT](LICENSE) Licensed. | ||
Copyright (c) 2023 Unlayer. [MIT](LICENSE) Licensed. |
@@ -18,2 +18,4 @@ export type EditorOptions = { | ||
exportHtml: (callback: Function) => void; | ||
showPreview: (device: string) => void; | ||
hidePreview: () => void; | ||
setMergeTags: (mergeTags: object) => void; | ||
@@ -20,0 +22,0 @@ }; |
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
58358
725
0