@emailmaker/emailmaker 1.0.60 → 1.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/asset-manifest.json +20 -20
  3. package/emailmaker-esm.js +1 -1
  4. package/emailmaker.js +1 -1
  5. package/iframe/css/sandbox.css +6 -2
  6. package/iframe/{iframe-eblock.1ef394c83ed0138fa7e1.html → iframe-eblock.b34985f1b45339a1dbe1.html} +1 -1
  7. package/iframe/{iframe.1ef394c83ed0138fa7e1.html → iframe.b34985f1b45339a1dbe1.html} +1 -1
  8. package/iframe/js/cssbeautify.js +1 -1
  9. package/iframe/sandbox-eblock.js +1 -1
  10. package/iframe/sandbox.js +1 -1
  11. package/package.json +1 -1
  12. package/plugin.html +1 -1
  13. package/plugin_blocks_test.html +1 -1
  14. package/plugin_default.html +3 -3
  15. package/plugin_idigital.html +1 -1
  16. package/plugin_s.html +1 -1
  17. package/static/js/1399.162f8a92.js +1 -0
  18. package/static/js/{2299.bd334036.chunk.js → 2299.cf90b757.chunk.js} +1 -1
  19. package/static/js/2574.56baa8a0.js +1 -0
  20. package/static/js/4529.eae85391.js +1 -0
  21. package/static/js/5211.d27a1e14.js +1 -0
  22. package/static/js/7291.d2241d85.js +1 -0
  23. package/static/js/{7967.28137472.js → 7967.5136da11.js} +1 -1
  24. package/static/js/8689.aa776e90.chunk.js +1 -0
  25. package/static/js/8879.96cdfd59.js +2 -0
  26. package/static/js/{8879.26995270.js.LICENSE.txt → 8879.96cdfd59.js.LICENSE.txt} +3 -35
  27. package/static/js/{8995.410bef51.js → 8995.54a7ed6e.js} +1 -1
  28. package/static/js/{emailmaker_core.f09929d2.js → emailmaker_core.6e2a56e1.js} +1 -1
  29. package/translations.pot +204 -194
  30. package/static/js/1399.258dd710.js +0 -1
  31. package/static/js/2574.2f48eb7a.js +0 -1
  32. package/static/js/4529.2f2fc56b.js +0 -1
  33. package/static/js/5211.e473201c.js +0 -1
  34. package/static/js/7291.37dee66e.js +0 -1
  35. package/static/js/8689.fa42b226.chunk.js +0 -1
  36. package/static/js/8879.26995270.js +0 -2
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[1399],{83953:(e,t,a)=>{a.d(t,{A:()=>A});var o=a(92810),i=a(66170),r=a(66726),l=a(43005),s=a(71157),n=a(64617),d=a(45934),c=a(23287),u=a(48409),m=a.n(u),_=a(55701),p=a(84568),v=a(93563),h=a(64037),g=a(7760),E=a(32269),f=a(47381),R=a(32411),y=a(85163),C=a(70082);const b=({block:e,isEditableRights:t,rightCol:a,autoSaveBlockResult:u})=>{const{__:b}=(0,c.s9)(),{projectId:A,blockId:I}=(0,n.g)();let O=(0,d.d4)(g.Fv),T=(0,d.d4)(g.Fv),k=(0,d.wA)();const N=(0,s.hN)(),S=(0,R.fn)(),w=(0,d.Pj)(),[j,$]=(0,o.useState)(!1),[G,L]=(0,o.useState)(null),[x,B]=(0,o.useState)(!1),[K,P]=(0,o.useState)(!1),D=(0,f.u)();(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&L(!0)}),[]);const{data:V,refetch:M}=(0,p.fo)(+A,{skip:!+A}),[U]=(0,_.Gr)(),[Y,F]=(0,_.OZ)(),[q,z]=(0,_.pP)(),[X]=(0,p.OD)(),H=`project_${A}`,J=V&&(0,E._q)(V,y.YY).find((e=>e.name===H)),Q=V&&(0,E.HT)(V,y.YY),W=(0,o.useCallback)((a=>{var o,i;if(B(!0),!t&&e.lock&&K)return N.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",message:b("No access to edit the letter."),placement:"bottomRight",data:(0,s.x_)(e)}),void B(!1);if(((null===(o=e.tags)||void 0===o?void 0:o.length)||(null===(i=e.blocktags)||void 0===i?void 0:i.length))>10&&K)return N.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",message:b("Maximum 10 tags available."),placement:"bottomRight",data:(0,s.x_)(e)}),void B(!1);if(""===e.type)return N.error({message:b("Set the type"),description:b("Please set the 'Type' field in the Settings section."),placement:"bottomRight"}),void B(!1);const r=t=>{var o;const i=null===(o=e.tags)||void 0===o?void 0:o.map((e=>{const a=null===Q||void 0===Q?void 0:Q.find((t=>t.name===e));return a?a.id:U({name:e,parent:t}).then((({error:t,data:a})=>{var o,i;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.term_id:a?a.id:void(t&&(N.fromError("TAG_CREATING_ERROR",e,t),B(!1)))}))})),r=(o=null)=>{const i=a=>{w.dispatch(v.kE.endpoints.getTags.initiate({parent:t})),M(),K&&(N.success({id:"BLOCK_EDITING_SUCCESS",message:b("The block was successfully saved.","block"),data:(0,s.x_)(e)}),B(!1)),fetch(((e,t,a,o)=>`https://scr.emcdn.ru/screenshot?delay=1000&width=800&fullPage=true&deviceScaleFactor=0.8&format=jpg&clearCache=true${o?`&cacheControl=true&cache-hash=${m()(o)}`:""}&url=${encodeURIComponent(`https://dev-backend-1.emailmaker.ru/get${e}/${a}?secret_hash=${m()(`${t}${a}${y.KI}`)}&raw=true`)}`)(y.IE,A,a.id,a.modified),{mode:"no-cors"}).then((()=>{}))},r=(0,E._q)(e,y.zh).filter((t=>(o||e.blocktags).includes(t.id))).map((e=>e.name));e.isNew?z.status!==y.eG&&q({source:a,title:null===e.title?b("New block title"):e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===S||void 0===S?void 0:S.getValue())||"",blocktags:o?o.join(","):e.blocktags,tags:r}).then((({data:t,error:a})=>{a?(N.fromError("BLOCK_CREATING_ERROR",{title:e.title,html:(null===S||void 0===S?void 0:S.getValue())||""},a),B(!1)):i(t)})):F.status!==y.eG&&Y({blockId:e.id,source:a,title:e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===S||void 0===S?void 0:S.getValue())||"",blocktags:o||e.blocktags,tags:r}).then((({data:t,error:a})=>{a&&K?(N.fromError("BLOCK_EDITING_ERROR",(0,s.x_)(e),a),B(!1)):i(t)}))};i?Promise.all(i).then((e=>r(e))):r(null)};B(!0),J?r(J.id):U({name:H}).then((async({data:t,error:a})=>{if(a)N.fromError("FOLDER_CREATING_ERROR",H,a),B(!1);else{const{data:a,error:o}=await X({projectId:A,blocktags:t.id});o?(N.fromError("BLOCK_CLONING_ERROR",(0,s.x_)(e),o),B(!1)):a&&r(a.blocktags&&a.blocktags[0])}})).catch((e=>console.error(e)))}),[z.status,q,F.status,Y,e,t,U,X,A,b,K,S,N,Q,M,w,J,H]);(0,o.useEffect)((()=>{K&&(W(),P(!1))}),[K,W]);const Z=(0,o.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),P(!0))}),[]);(0,o.useEffect)((()=>(document.addEventListener("keydown",Z),()=>{document.removeEventListener("keydown",Z)})),[Z]);const ee=(0,o.useCallback)((e=>{const t=e.data.operation,a=e.data.action;t===y.Ru.APPLICATION_ACTION&&"save_email"===a&&P(!0)}),[]);return(0,h.A)(ee),(0,o.useEffect)((()=>{z.isError&&(B(!1),(0,E.p6)(z,N))}),[k,z,N]),(0,o.useEffect)((()=>{const e=setTimeout((()=>{$(!0)}),1e4);return()=>{clearTimeout(e)}}),[]),(0,o.useEffect)((()=>{e.isNew&&!I&&j&&(W(),$(!1))}),[j,e,W,I]),(0,C.jsx)(r.A,{title:b(G?"Save by \u2318S":"Save by Ctrl+S"),placement:a?"right":"bottomRight",children:(0,C.jsx)(l.Ay,{type:"primary",block:a,className:"em-analytics__block-save",icon:(0,C.jsx)(i.A,{}),onClick:()=>{D({event:"click",action:"save_block"}),P(!0)},loading:F.isLoading||X.isLoading||z.isLoading||x||u,children:a||O||T?"":b("Save")})})};b.defaultProps={block:null};const A=b},59287:(e,t,a)=>{a.d(t,{Ay:()=>L,QG:()=>$,Wv:()=>j});var o=a(92810),i=a(66726),r=a(43005),l=a(81e3),s=a(71157),n=a(66170),d=a(64617),c=a(45934),u=a(48409),m=a.n(u),_=a(23287),p=a(86739),v=a(84568),h=a(93563),g=a(64037),E=a(8493),f=a(65983),R=a(32269),y=a(56991),C=a(47381),b=a(32411),A=a(13329),I=a(93982),O=a(90070),T=a(85163),k=a(13522),N=a(28316),S=a(70082);const w="KEYBOARD",j=(e,t,a,o,i=!0,r=.8,l)=>`${window.location.host.indexOf("localhost")>=0?`${window.location.protocol}//${window.location.host}`:"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${l?"":"&fullPage=true"}&deviceScaleFactor=${r}&format=jpg&clearCache=${i}${o?`&cacheControl=true&cache-hash=${m()(o)}`:""}&url=${encodeURIComponent(`https://app.emailmaker.ru/get${e}/${a}?secret_hash=${m()(`${t}${a}${T.KI}`)}&raw=true`)}${l?`&selector=${l}`:""}`,$=(e,t,a=!0,o=.8,i)=>{let r=`https://racs.rest/v3/file/${e}?resource=exportPngApi`;return`${window.location.host.indexOf("localhost")>=0?`${window.location.protocol}//${window.location.host}`:"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${i?"":"&fullPage=true"}&deviceScaleFactor=${o}&format=jpg&clearCache=${a}${t?`&cacheControl=true&cache-hash=${m()(t)}`:""}&url=${encodeURIComponent(`${r}`)}${i?`&selector=${i}`:""}`},G=({email:e,isEditableRights:t,autoSaveEmailResult:a})=>{var u,m;let $=(0,c.wA)(),G=(0,d.Zp)();const{__:L,_x:x}=(0,_.s9)(),{projectId:B,emailId:K}=(0,d.g)(),P=(0,O.p6)(),D=(0,s.hN)(),V=(0,y.rD)(),M=(0,b.fn)(),U=(0,c.Pj)(),Y=(0,c.d4)(f.rY),F=(0,c.d4)(f.UI),[q,z]=(0,o.useState)(!1),[X,H]=(0,o.useState)(null);(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&H(!0)}),[]);const{data:J,refetch:Q}=(0,v.fo)(+B,{skip:!+B}),{data:W,refetch:Z}=(0,h.Jz)({parent:null===(u=J.folder)||void 0===u?void 0:u[0]},{skip:!(null!==(m=J.folder)&&void 0!==m&&m[0])}),[ee]=(0,p.Gr)(),[te]=(0,h.JI)(),[ae,oe]=(0,p.dN)(),[ie,re]=(0,p.Kh)(),[le]=(0,v.OD)(),[se,ne]=(0,o.useState)(!1),[de,ce]=(0,o.useState)(""),ue=`project_${B}`,me=J&&(0,R._q)(J,T.zh).find((e=>e.name===ue)),_e=J&&(0,R.HT)(J,T.zh),pe=(0,I.ml)(k.A.BEFORE_SAVE_EMAIL),ve=(0,C.u)(),he=(0,o.useCallback)((a=>{var o,i;if(!t&&e.lock&&de)return void D.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:(0,s.Gy)(e),message:L("No access to edit the letter."),placement:"bottomRight"});if(((null===e||void 0===e||null===(o=e.tags)||void 0===o?void 0:o.length)||(null===(i=e.emailtags)||void 0===i?void 0:i.length))>10&&de)return void D.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:(0,s.Gy)(e),message:L("Maximum 10 tags available."),placement:"bottomRight"});const r=async t=>{var o;const i=Object.entries(Y).flatMap((([e,t])=>t.map((({value:t,label:a})=>({id:+t,name:a,parent:+e.split("_")[0]})))));let r=[];F.length&&F.forEach((e=>{r.push(...null===e||void 0===e?void 0:e.children.map((e=>({id:e.id,parentId:e.parent}))))}));const l=(null===(o=e.tags)||void 0===o?void 0:o.map((e=>{const a=null===_e||void 0===_e?void 0:_e.find((t=>t.name===e));return a?a.id:ee({name:e,parent:t}).then((({error:t,data:a})=>{var o,i;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.term_id:a?a.id:void(t&&(D.fromError("TAG_CREATING_ERROR",e,t),ne(!1)))}))})))||[],n=(null===i||void 0===i?void 0:i.map((e=>{const t=null===r||void 0===r?void 0:r.find((t=>t.id===e.id));return t?t.id:te({name:e.name,parent:e.parent}).then((({error:t,data:a})=>{var o,i;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.term_id:a?a.id:void(t&&(D.fromError("GROUP_CREATING_ERROR",e,t),ne(!1)))}))})))||[],d=(e,o=null,i=null,r=[])=>{var l,n;const d=(null===(l=e.title)||void 0===l?void 0:l.trim())||(null===(n=e.subject)||void 0===n?void 0:n.trim())||L("Untitled email."),c=a=>{U.dispatch(h.kE.endpoints.getTags.initiate({parent:t})),Q&&Q(),de&&(D.success({id:"EMAIL_SAVING_SUCCESS",message:L("The email was successfully saved."),data:(0,s.Gy)(e)}),ne(!1),W&&Z()),T.EW.isPlugin||fetch(j(T.Tm,B,a.id,a.modified),{mode:"no-cors"}).then((()=>{}))},u=(0,R._q)(e,T.zh).filter((t=>(o||e.emailtags).includes(t.id))).map((e=>e.name));var m,_,p,v,g;if(e.isNew){if(re.status!==T.eG){const t=P.get(T.A9.em_folder);ie({title:d,source:a,project:e.project,subject:e.subject,preheader:e.preheader,description:e.description,utm_parameters:{utm_source:e.utm_parameters.utm_source,utm_medium:e.utm_parameters.utm_medium,utm_campaign:e.utm_parameters.utm_campaign,utm_term:e.utm_parameters.utm_term,utm_content:e.utm_parameters.utm_content},html:(null===M||void 0===M?void 0:M.getValue())||"",parent_email:e.parent_email||T.iU,common_styles:e.common_styles||"",emailtags:o?o.join(","):e.emailtags,tags:u,group:i||e.group,is_template:e.is_template||!1,is_inited:e.is_inited,renderGuid:e.renderGuid,folder:t!==T.y2&&t}).then((({data:t,error:a})=>{a?(de&&D.fromError("EMAIL_CREATING_ERROR",{title:e.title,code:(null===M||void 0===M?void 0:M.getValue())||""},a),ne(!1)):($((0,E.aY)(null)),c(t),P.remove(T.A9.em_folder))}))}}else oe.status!==T.eG&&ae({emailId:e.id,source:a,title:d,project:e.project,preheader:e.preheader,subject:e.subject,utm_parameters:{utm_source:null===(m=e.utm_parameters)||void 0===m?void 0:m.utm_source,utm_medium:null===(_=e.utm_parameters)||void 0===_?void 0:_.utm_medium,utm_campaign:null===(p=e.utm_parameters)||void 0===p?void 0:p.utm_campaign,utm_term:null===(v=e.utm_parameters)||void 0===v?void 0:v.utm_term,utm_content:null===(g=e.utm_parameters)||void 0===g?void 0:g.utm_content},description:e.description,html:(null===M||void 0===M?void 0:M.getValue())||"",common_styles:e.common_styles||"",emailtags:o||e.emailtags,tags:u,group:i||e.group,is_template:e.is_template||!1}).then((({error:t})=>{t?(de&&D.fromError("EMAIL_EDITING_ERROR",(0,s.Gy)(e),t),ne(!1)):c(e)}));ve({event:"save",action:a?"save_email":"auto_save_email",email_id:e.id,project_id:B})},c={...e};pe.fire(c).finally((()=>{l.length||n.length?Promise.all(l).then((e=>{Promise.all(n).then((t=>{d(c,e,t,[])}))})):d(c,null,null,[])}))};ne(!0),me?r(me.id):ee({name:ue}).then((async({data:t,error:a})=>{if(a)D.fromError("FOLDER_CREATING_ERROR",ue,a),ne(!1);else{const{data:a,error:o}=await le({projectId:B,emailtags:t.id});o?(D.fromError("EMAIL_CLONING_ERROR",(0,s.Gy)(e),o),ne(!1)):a&&r(a.emailtags&&a.emailtags[0])}})).catch((e=>console.error(e)))}),[re.status,ie,oe.status,ae,e,t,ee,$,le,B,J,L,x,de,M,_e,pe]);(0,A.D3)(N.Kp,(0,o.useCallback)((e=>he(e||"EXTERNAL")),[he]));const ge=(0,I.ml)(k.A.ON_NEXTBUTTON_CLICK_ID),Ee=(0,I.ml)(k.A.ON_SAVEBUTTON_CLICK_ID);(0,o.useEffect)((()=>{de&&(setTimeout((()=>he(de))),ce(""))}),[de]);const fe=(0,o.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),ce(w))}),[he]);(0,o.useEffect)((()=>(document.addEventListener("keydown",fe),()=>{document.removeEventListener("keydown",fe)})),[fe]);const Re=(0,o.useCallback)((e=>{const t=e.data.operation,a=e.data.action;t===T.Ru.APPLICATION_ACTION&&"save_email"===a&&ce(w)}),[he]);(0,g.A)(Re),(0,o.useEffect)((()=>{e.isNew&&re.isSuccess&&(ne(!0),$(p.GY.util.upsertQueryData("getEmail",re.data.id,{...re.data,lock:e.lock,isAmp:e.isAmp,subject:e.subject,preheader:e.preheader,description:e.description,html:(null===M||void 0===M?void 0:M.getValue())||"",project:e.project,tags:e.tags,utm_parameters:e.utm_parameters,parent_email:e.parent_email,common_styles:e.common_styles,renderGuid:e.renderGuid,is_inited:e.is_inited,isNew:!1})).then((()=>{G(`/projects/${re.data.project}/emails/${re.data.id}`),ne(!1),de&&D.success({id:"EMAIL_SAVING_SUCCESS",message:L("The email was successfully saved."),data:(0,s.Gy)(e)})})))}),[G,$,re,e.isNew,L,x,de,M]);const ye=(0,I._q)(k.A.ON_EMAIL_INIT_ID);(0,o.useEffect)((()=>{let e=0;const t=ye((()=>{e=setTimeout((()=>z(!0)),1e4)}));return()=>{e&&clearTimeout(e),t.dispose()}}),[z,ye]),(0,o.useEffect)((()=>{e.isNew&&!K&&q&&(he(),z(!1))}),[q,e,he,K]);const Ce=oe.isLoading||(null===le||void 0===le?void 0:le.isLoading)||re.isLoading||se||a&&a.isLoading,be=V.saveButtonEnabled&&(0,S.jsx)(i.A,{title:L(X?"Save by \u2318S":"Save by Ctrl+S"),placement:"bottom",children:(0,S.jsx)(r.Ay,{type:V.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:Ce,icon:(0,S.jsx)(n.A,{}),onClick:async()=>{const t={...e,html:M.getValue()};try{!1!==await Ee.fire(t)&&ce("SAVE_BUTTON")}catch(a){D.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",(0,s.Gy)(t),a,!0)}},children:V.saveButtonText||L("Save")})},"save-button"),Ae=V.nextButtonEnabled&&(0,S.jsx)(r.Ay,{type:"primary",block:"false",className:"em-analytics__email-save",icon:V.primaryCommandButtonIcon,loading:Ce,onClick:async()=>{const t={...e,html:M.getValue()};try{!1!==await ge.fire(t)&&ce("NEXT_BUTTON")}catch(a){D.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",(0,s.Gy)(t),a,!0)}},children:V.nextButtonText||L("Continue")},"next-button");return(0,S.jsx)(S.Fragment,{children:V.saveButtonEnabled&&V.nextButtonEnabled?(0,S.jsx)(l.A,{children:[be,Ae]}):[be,Ae]})};G.defaultProps={email:null,isEditableRights:null};const L=G}}]);