@emailmaker/emailmaker 1.2.3 → 1.3.2
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.
- package/CHANGELOG.md +81 -0
- package/emailmaker-core.b63d7b8b.js +859 -0
- package/emailmaker-esm.js +11 -11
- package/{emailmaker-po.8c2b05d7.js → emailmaker-po.b63d7b8b.js} +1 -1
- package/emailmaker.js +12 -12
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox.css +19 -0
- package/iframe/{iframe-eblock.8c2b05d7.html → iframe-eblock.b63d7b8b.html} +2 -2
- package/iframe/{iframe.8c2b05d7.html → iframe.b63d7b8b.html} +2 -2
- package/iframe/js/elMarkupHelper.C4wWAApZ.js +278 -0
- package/iframe/js/iframe-eblock.body.b63d7b8b.js +9 -0
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.b63d7b8b.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/iframe/js/sanitize-html/sanitize-html.js +46 -21756
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{abcacabc.js → 1922419a.js} +1 -1
- package/static/core/{9ff19e12.js → 253d6f68.js} +2 -2
- package/static/core/{dfbe3ba4.js → 32a14159.js} +1 -1
- package/static/core/{bbb11e65.js → 3a876cdd.js} +1 -1
- package/static/core/{aab84cf4.js → 40574d12.js} +1 -1
- package/static/core/{6535dd13.js → 4f63baad.js} +1 -1
- package/static/core/{60b75c99.js → 4fef179c.js} +1 -1
- package/static/core/{ed4586a5.js → 5e13bbc1.js} +3 -3
- package/static/core/{e13d6875.js → 6319e32c.js} +1 -1
- package/static/core/{c2daae71.js → 66a5de32.js} +1 -1
- package/static/core/{1687225b.js → 69842511.js} +1 -1
- package/static/core/{b99f4f42.js → 7a9faff8.js} +11 -11
- package/static/core/{1912a30e.js → 85accd9c.js} +1 -1
- package/static/core/{ee6a6899.js → 86e5503b.js} +2 -2
- package/static/core/{c7b2d60e.js → 89fb48c9.js} +1 -1
- package/static/core/{48e93de9.js → 8fdd9471.js} +1 -1
- package/static/core/{b6999cba.js → 9f6b8cdd.js} +1 -1
- package/static/core/{b712bb05.js → 9f7f5230.js} +1 -1
- package/static/core/{c6cd3dc2.js → a6518f19.js} +1 -1
- package/static/core/{b752ed52.js → a9d62c49.js} +1 -1
- package/static/core/{42ec1ce9.js → aea50cd5.js} +1 -1
- package/static/core/bb58b8a1.js +28 -0
- package/static/core/c266ad76.js +1 -0
- package/static/core/cd715a88.js +7 -0
- package/static/core/{9e7c400d.js → d0d2525d.js} +1 -1
- package/static/core/d402573d.js +1 -0
- package/static/core/{286097e2.js → e2694475.js} +2 -2
- package/static/core/e6f6edff.js +1 -0
- package/static/core/e8edbf21.js +2 -0
- package/static/core/{d2a90b69.js → f85176c7.js} +1 -1
- package/static/core/{492992bb.js → fa6f5198.js} +1 -1
- package/static/esm/{ea997fe3.js → 74f083c2.js} +1 -1
- package/static/umd-runtime/{runtime.BqNyFZPj.js → runtime.9w1dxMVc.js} +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.8c2b05d7.js +0 -859
- package/iframe/js/elMarkupHelper.DnlKn-Lc.js +0 -277
- package/iframe/js/iframe-eblock.body.8c2b05d7.js +0 -9
- package/iframe/js/iframe.body.8c2b05d7.js +0 -129
- package/iframe/js/sanitize-html/sanitize-html.min.js +0 -16923
- package/static/core/316f71b7.js +0 -2
- package/static/core/466f98bb.js +0 -28
- package/static/core/6e548251.js +0 -1
- package/static/core/844fbb88.js +0 -1
- package/static/core/97aabe39.js +0 -7
- package/static/core/e88db487.js +0 -1
package/static/core/316f71b7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){try{if(typeof document<"u"){var o=".blocks-app .block-page-header__dropdown-menu{top:10px}.blocks-app .anticon.anticon-edit.block-page-header__icon-edit{color:#8c8c8c;margin-left:6px;font-size:16px}.blocks-app .ant-typography-edit:hover .anticon.anticon-edit.block-page-header__icon-edit{color:var(--em-colorPrimaryHover)}.blocks-app .ant-page-header.block-page-header{margin-bottom:20px;padding-left:0;padding-right:0}@media (width<=1450px){.blocks-app .ant-page-header.block-page-header{padding-left:12px;padding-right:12px}}.blocks-app .block-page-header .ant-page-header-heading-left{flex-grow:1;overflow:visible}.blocks-app .block-page-header .ant-page-header-back{align-self:flex-start;margin-left:12px;margin-right:0;padding-top:12px}.blocks-app .block-page-header .ant-page-header-heading-title{white-space:pre-wrap;flex-grow:1;font-weight:500;overflow:visible}.blocks-app .block-page-header .ant-typography{margin-bottom:0;padding:4px 12px}.blocks-app .block-page-header .ant-typography-edit-content{margin-top:0;padding:0;left:auto}.blocks-app .block-page-header .ant-input{font-size:inherit;font-weight:inherit}.blocks-app .block-page-header .ant-page-header-heading-extra>*{margin-left:8px}.blocks-app .block-page-header .ant-btn.block-page-header__btn_extra,.blocks-app header .ant-btn.block-page-header__btn_extra{width:32px;padding:0}.blocks-app .block-page__row{margin-bottom:60px}@media (width>=1700px){.blocks-app .block-page__row{margin-right:-60px}}",e=window.__emailmaker_styles__||(window.__emailmaker_styles__={sheets:{},order:[]}),n=o;if(!e.sheets[n]){var t=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(t=new CSSStyleSheet,t.replaceSync(o))}catch{t=null}if(t){if(!e.host||!e.host.isConnected||!e.host.sheet){var a=document.createElement("style");a.setAttribute("data-emailmaker","true"),document.head.appendChild(a),e.host=a}for(var l=e.host.sheet,i=0;i<t.cssRules.length;i++)try{l.insertRule(t.cssRules[i].cssText,l.cssRules.length)}catch{}(e.texts||(e.texts=[])).push(o),(e.listeners||[]).forEach(function(p){try{p(o)}catch{}})}else{var a=document.createElement("style");a.setAttribute("data-emailmaker","true"),a.appendChild(document.createTextNode(o)),document.head.appendChild(a)}e.sheets[n]=!0,e.order.push(n)}}}catch(p){console.error("vite-plugin-css-injected-by-js",p)}})();
|
|
2
|
-
__emailmaker__.define("static/core/316f71b7.js",["require","exports","module","static/core/5dc34752.js","static/core/422c8b42.js","static/core/c804e4dd.js","static/core/b0620c65.js","static/core/844fbb88.js","react","react/jsx-runtime","__delivery__/libs","classnames"],function(k,te,le){const J=k("./5dc34752.js"),V=k("./422c8b42.js"),e=k("./c804e4dd.js"),A=k("./b0620c65.js"),oe=k("./844fbb88.js");let l=k("react");l=J.__toESM(l);let o=k("react/jsx-runtime"),i=k("__delivery__/libs"),Y=k("classnames");Y=J.__toESM(Y);var q=({block:t,autoSaveBlockResult:p})=>{const{__:c,_x:u}=e.useI18n();e.useDispatch();const I=e.useEmailAttributesWriter(),a=e.useAppNavigate(),_=e.useCurrentUser(),{modal:y}=i.ui_kit$App.useApp(),m=e.useNotification(),{confirm:$}=y,{token:F}=(0,i.ui_kit$useToken)(),G=e.useAppConfig(),K=e.useContainer(),C=()=>{e.leaveBlock(K)},b=e.useSelector(e.selectCodeModeDirection),O=t.hasOwnProperty("type")?e.BLOCK:e.EMAIL,x=e.useSelector(e.selectElementSettings$1),z=e.useSelector(e.selectElementSettings),S=O==="email"?x:z,E=e.useSelector(e.selectIsCodeMode),Q=()=>(S?.type===e.ELEMENT_TYPES.TEXT||S?.type===e.ELEMENT_TYPES.LINK||S.type===e.ELEMENT_TYPES.BUTTON)&&E&&b!=="bottom",d=e.useProjectData(),{owner:w,admin:h}=e.useMyRoles(),W=e.useStore(),N=(s,g)=>W.dispatch(e.blocksApi.endpoints.deleteBlock.initiate(s.id)).then(f=>{f.error&&m.fromError("BLOCK_REMOVING_ERROR",e.getBlockDesc(s),f.error),C(),g(`/projects/${s.project}/blocks`),m.success({id:"BLOCK_REMOVING_SUCCESS",title:c("The block “")+f.data.title+u("” was successfully removed.","block"),data:e.getBlockDesc(s)})}),B=(s,g)=>{$({mask:{closable:!0},centered:!0,title:u("Are you sure you want to delete the “","block")+s.title+c("” block?"),icon:(0,o.jsx)(e.EmIcons,{icon:"DeleteOutlined",component:i.icons$DeleteOutlined,size:22,style:{color:i.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:c("Yes"),cancelText:c("No"),onOk:()=>N(s,g)})},T=()=>{C(),a(`/projects/${d.id}/blocks`)},L=s=>{I({title:s})},[H,P]=e.useAddBlockMutation(),X=e.useContentReader(),D=()=>{t.isNew?t.isNew?m.warning({id:"COPY_NOT_SAVED",payload:t,title:c("To create a copy, you need to save the block.")}):H({title:e.generateCopyTitle(t.title),blocktags:t.blocktags,project:d.id,subject:t.subject,description:t.description,html:X(),type:t.type?t.type:"Other"}).then(s=>{if(s.error){m.error({id:"BLOCK_CLONING_ERROR",data:e.getBlockDesc(t),innerException:s.error,title:s.error.data.code,description:s.error.data.message});return}a(`/projects/${d.id}/blocks/${s.data.id}`),m.success({id:"BLOCK_CLONING_SUCCESS",data:e.getBlockDesc(t),title:c("The copy of block “")+t.title+u("” was successfully created.","block")})}):e.getEmitter(K,V.events.ON_BLOCK_CLONE_ID).fire(t)},M=()=>{t.isNew?(C(),a(`/projects/${d.id}/blocks`),m.success({id:"BLOCK_REMOVING_SUCCESS",title:c("The draft of the block has been deleted."),data:e.getBlockDesc(t)})):B(t,a)};let v=[];v.push({label:c("Clone"),icon:(0,o.jsx)(e.EmIcons,{icon:"CopyOutlined",component:i.icons$CopyOutlined,size:16}),key:"Clone",className:"em-analytics__block-clone",disabled:P.isLoading,onClick:D}),(w||h||_.id?.toString()===t.author?.toString())&&v.push({label:(0,o.jsx)(e.SwitchLockBtn,{element:t},"Lock"),icon:t.lock?(0,o.jsx)(e.EmIcons,{icon:"UnlockOutlined",component:i.icons$UnlockOutlined,style:{fontSize:"16px"}}):(0,o.jsx)(e.EmIcons,{icon:"LockOutlined",component:i.icons$LockOutlined,style:{fontSize:"16px"}}),disabled:t.isNew},{label:c("Remove"),icon:(0,o.jsx)(e.EmIcons,{icon:"DeleteOutlined",component:i.icons$DeleteOutlined,size:16}),key:"Remove",className:"em-analytics__block-remove",onClick:M,style:{color:"#ff4d4f"}}),e.useSetTitle(t.title===null?c("New block title"):t.title);const R=(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(i.ui_kit$Space,{size:10,children:[G.headerArrowBackVisible&&(0,o.jsx)(i.ui_kit$Tooltip,{title:c("Back"),placement:"left",children:(0,o.jsx)(i.ui_kit$Button,{type:"text",icon:(0,o.jsx)(e.EmIcons,{icon:"ArrowLeftOutlined",component:i.icons$ArrowLeftOutlined}),onClick:T,shape:"circle"})}),(0,o.jsx)(i.ui_kit$Paragraph,{className:"ant-page-header-heading-title",editable:{triggerType:["text","icon"],icon:(0,o.jsx)(e.EmIcons,{icon:"EditOutlined",component:i.icons$EditOutlined,className:"email-page-header__icon-edit"}),onChange:L},children:t.title===null?c("New block title"):t.title})]})}),n=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(A.EmailPreviewMenu,{emailElement:t}),t.lock?(0,o.jsx)(e.EmIcons,{icon:"LockOutlined",component:i.icons$LockOutlined,className:(0,Y.default)("lock-icon",{"lock-icon__disabled":!(w||h||_.id?.toString()===t.author?.toString())}),style:{color:F.colorPrimary,fontSize:"16px"}},"Lock"):null,(0,o.jsx)(i.ui_kit$Dropdown,{arrow:"true",menu:{items:v},children:(0,o.jsx)(i.ui_kit$Button,{className:"block-page-header__btn block-page-header__btn_extra",onClick:()=>{},children:(0,o.jsx)(e.EmIcons,{icon:"EllipsisOutlined",component:i.icons$EllipsisOutlined})})},"Actions"),(0,o.jsx)(oe.SaveBlockBtn,{className:"em-analytics__block-save",block:t,isEditableRights:w||h||_.id?.toString()===t.author?.toString(),autoSaveBlockResult:p,ownsDocument:!0},"Save")]}),r=G.commandButtonsEnabled?n:(0,o.jsx)(A.EmailPreviewMenu,{emailElement:t});return(0,o.jsx)(e.Header,{leftBlock:R,rightBlock:r,className:"header_blocks",isHeaderCodeMenuOpen:Q()})};q.propTypes={};function ee(t=document){const p=t.getElementById("email_iframe_slot");return{slot:p,area:p?.closest("[data-scroll-area]")??null}}function ne(t){if(t)return t.renderGuid??(t.id!=null?String(t.id):void 0)}function se(t,p={}){const c=e.useStore(),u=p.key??ne(t),I=p.recovery===!0,a=(0,l.useMemo)(()=>{if(u===void 0)return;const m=e.getEmailDocuments(V.getContainer(c));return I?t?.id!=null?m.open(String(t.id),{email:t}):m.openDraft(t):m.openBlock(u,t)},[u,c,I]),_=t?.modified,y=t?.lock;return(0,l.useEffect)(()=>{e.writeSourceReport(a,e.fromServerFacts({modified:_,lock:y}))},[a,_,y]),a}var{Content:re}=i.ui_kit$Layout,ie=({session:t})=>{const{__:p}=e.useI18n(),c=e.useSendPostMessage(),{blockId:u,projectId:I}=e.useRouteParams(),a=e.useDispatch();e.useAppNavigate();const _=e.useCookieManager();e.useSelector(e.selectMonacoFocusing),e.useSelector(e.selectIsPanelHistoryCollapsed),e.useAppConfig();const y=_.get(e.APP_COOKIES.em_new_block),{isSuccess:m,data:$}=e.useGetBlockQuery(+y,{skip:!!t||!y}),[F,G]=(0,l.useState)(!1),{isLoading:K,isSuccess:C,isError:b,error:O,data:x}=e.useGetBlockQuery(u,{skip:!!t||!u});(0,l.useEffect)(()=>{b&&O&&e.reportEntityLoadError("block",u,O)},[b,O,u]);const z=y?m:C,S=C&&x?.id?x:m&&$,E=t?t.block:S,Q=se(t?void 0:S||void 0,{key:!t&&S?.id!=null?e.blockSessionKey(S.id):void 0}),d=t?t.document:Q,w=e.useDocumentAttributes(d),h=(0,l.useMemo)(()=>d?e.resolveOpenEmail({attributes:w,readContent:()=>d.getContent(),docId:d.get().docId,hasSession:!0,serverId:d.get().serverId,show:void 0}):E,[w,d,E]),W=e.useStore(),N=e.getEmailDocuments(V.getContainer(W)).history();e.usePublishDocumentSession(d,N);const B=e.useUserUndo({document:d,history:N}),T=(0,l.useCallback)(()=>{B.undo()},[B]),L=(0,l.useCallback)(()=>{B.redo()},[B]),H=(0,l.useRef)();(0,l.useEffect)(()=>{H.current!==E?.id&&(B.clear(),H.current=E?.id)},[E,B]);const P=(0,l.useCallback)(n=>{(window.navigator.appVersion.indexOf("Mac")&&n.metaKey||n.ctrlKey)&&(n.code==="KeyZ"?(n.preventDefault(),n.shiftKey?L():T()):n.code==="KeyY"&&!n.shiftKey&&(n.preventDefault(),L()))},[T,L]);(0,l.useEffect)(()=>(document.body.classList.add("editor"),()=>{a(e.resetPanes()),a(e.closeModal$1()),a(e.resetElementHistorySlice()),a(e.setActiveSettingsTab(e.BUILD))}),[a]);const X=n=>{const r=n.data.operation,s=n.data.action,g=document.getElementById("iframe-scroll-top"),f=document.getElementById("iframe-scroll-bottom");if(r===e.EVENT_TYPES.APPLICATION_ACTION&&(s==="undo"?T():s==="redo"&&L()),r===e.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const{slot:Z}=ee(),U=document.body.getBoundingClientRect().height,j=Z?.getClientRects()[0];if(!j||!g||!f)return;j.top<0&&(g.style.display="block"),j.top+j.height>U&&(f.style.display="block")}r===e.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&g&&f&&(g.style.display="none",f.style.display="none")};e.useListenPostMessage(X);const D=(0,l.useCallback)(n=>{n.target?.closest?.(".file-manager, .ant-modal.file-manager")||(n.preventDefault(),n.target&&c({operation:e.EVENT_TYPES.SANDBOX_DRAG_CANCEL}))},[c]),M=(0,l.useCallback)(()=>{},[]),v=(0,l.useCallback)(n=>{if(n.preventDefault(),n.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const r=document.getElementById("iframe-scroll-top"),s=document.getElementById("iframe-scroll-bottom"),{slot:g,area:f}=ee();if(!g||!r||!s)return;const{height:Z,top:U}=g.getBoundingClientRect(),j=document.body.getBoundingClientRect().height;U>1?r.style.display==="block"&&(r.style.display="none"):r.style.display==="none"&&(r.style.display="block"),Z-j+U<1?s.style.display==="block"&&(s.style.display="none"):s.style.display==="none"&&(s.style.display="block"),n.target===r&&f?.scrollBy(0,-20),n.target===s&&f?.scrollBy(0,20)},[]),R=(0,l.useCallback)(()=>{const n=document.getElementById("iframe-scroll-top"),r=document.getElementById("iframe-scroll-bottom");n&&r&&(n.style.display="none",r.style.display="none")},[]);return(0,l.useEffect)(()=>(window.addEventListener("dragstart",M),window.addEventListener("drop",D),window.addEventListener("dragend",R),window.addEventListener("dragover",v),window.addEventListener("keydown",P),()=>{window.removeEventListener("dragstart",M),window.removeEventListener("drop",D),window.removeEventListener("dragover",v),window.removeEventListener("dragend",R),window.removeEventListener("keydown",P)}),[P,M,D,R,v]),(0,o.jsx)(e.DocumentSessionProvider,{document:d,history:N,children:(0,o.jsxs)(i.ui_kit$Layout,{className:"block-page",children:[E&&(0,o.jsx)(q,{block:h}),K&&(0,o.jsx)(i.ui_kit$PageLoader,{}),b&&O&&!1,t?E&&(0,o.jsx)(A.EmailPane_default,{emailElement:h,kind:"block",isSuccess:!0}):(!u&&(y?F&&$:!0)||C&&x)&&(0,o.jsx)(A.EmailPane_default,{emailElement:h,kind:"block",isSuccess:z})]})})},ce=()=>{const{document:t,email:p}=e.useOpenEmail(),c=(0,l.useMemo)(()=>({document:t,block:p}),[t,p]);return(0,o.jsx)(ie,{session:c})};te.default=ce});
|