UNPKG

@creaditor/newsletter-starterkit

Version:

Creaditor Newsletter Editor - Starterkit for creating beautiful email newsletters

1 lines 4.72 kB
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[9265],{59265:(e,t,s)=>{s.r(t),s.d(t,{default:()=>f});const n={en:{key:"English",value:"en"},he:{key:"Hebrew",value:"he"},ar:{key:"Arabic",value:"ar"}},o=Object.keys(n).map((e=>n[e])),a=e=>{const{component:t,commands:s,helpers:a,template:r}=e;return{select:e=>{let{changeTab:t,tab:s}=e;"design"!==s.text&&t("design")},tabs:e=>{const t=[{text:"design"}];return t.forEach((t=>t.selected=t.text===e)),t},layout:e=>{let{tab:a,changeTab:r,tabs:l}=e;return[{type:"input",title:"address",value:t.props.address,onChange:e=>{const t=e.target.value;s.execCommand("address",t)}},{type:"divider"},{type:"dropdown",title:"type",active:()=>"design"===a.text,selected:n[t.props.lang]?.value,value:n[t.props.lang]?.value,onChange:e=>{const t=e.target.value;s.execCommand("lang",t)},items:o},{type:"divider"},{type:"slider",title:"size",min:100,max:1e3,active:()=>"design"===a.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;s.execCommand("style",{width:t+"px",height:t/1.8+"px"})}},{type:"divider"},{type:"radius",title:"radius",active:()=>"design"===a.text,min:0,max:parseInt(t.props.style.width)/2,value:parseInt(t.props.style.borderRadius),elementId:t.id,borderTopRightRadius:parseInt(t.props.style.borderTopRightRadius),borderTopLeftRadius:parseInt(t.props.style.borderTopLeftRadius),borderBottomRightRadius:parseInt(t.props.style.borderBottomRightRadius),borderBottomLeftRadius:parseInt(t.props.style.borderBottomLeftRadius),onInput:e=>{s.execCommand("style",{...e.target.json})}}]}}};var r=s(46245);const l=e=>{let{helpers:t,image:s}=e;return{set:(e,t,s)=>{switch(t){case"style":if("object"==typeof s)return e[t]=(0,r.Z)(e[t],s),!0;case"src":case"isFullWidthOnMobile":case"isOpenWithModal":case"isCircle":case"onClick":case"alt":return e[t]=s,!0}}}},i="AIzaSyAAWI9NHgjWXKv6Vu2RqsMnzcHd5gx3vvY";var p=s(46062),d=s.n(p),c=s(32877),u=s.n(c),m=s(96793),h=s.n(m),g=s(17892),y=s.n(g),A=s(11173),v=s.n(A),b=s(73131),C={};C.setAttributes=y(),C.insert=h().bind(null,"head"),C.domAPI=u(),C.insertStyleElement=v();d()(b.Z,C);const I=b.Z&&b.Z.locals?b.Z.locals:void 0,f=()=>{!function(){const e="google-google-map-script";if(document.getElementById(e))return null;let t=document.createElement("script");t.id=e,t.type="text/javascript",t.src=`https://maps.googleapis.com/maps/api/js?key=${i}&callback=initMap`,document.body.appendChild(t)}();return{name:"map",create:e=>{const{createElement:t,compose:s,helpers:n}=e,o=document.createElement("div");o.classList.add(I.root);const r=document.createElement("div");r.classList.add(I.cover);const p=document.createElement("iframe");return p.loading="lazy",p.allowFullscreen="true",p.referrerpolicy="no-referrer-when-downgrade",o.append(p,r),t({name:"map",id:s.id,template:o,atomElement:p,render:()=>{p.width=s.props.style.width,p.height=s.props.style.height;const e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return`https://www.google.com/maps/embed/v1/place?q=${encodeURIComponent(e)}&key=${i}&language=${t}`}(s.props.address,s.props.lang);p.src=e;for(const e in s.props.style)if(Object.hasOwnProperty.call(s.props.style,e)){const t=s.props.style[e];p.style[e]=t}},defaultProps:{style:{height:"200px",width:"200px"},address:"תל אביב"},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>o,handleBar:!0,validator:l({template:o,helpers:n}),schema:s.schema,onSelect:e=>{o.classList.add(e)},onDeselect:e=>{o.classList.remove(e)},elementProps:s,remove:()=>{o.remove()},createEditor:a})}}}},73131:(e,t,s)=>{s.d(t,{Z:()=>l});var n=s(40272),o=s.n(n),a=s(82609),r=s.n(a)()(o());r.push([e.id,".hxLTwa3A42dNIqe5CLb_ {\n position: relative;\n }\n .snf4QoTqvgoLqHzoqsIg {\n display: none;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n background-color: var(--primary);\n opacity: 0.6;\n }\n \n .hxLTwa3A42dNIqe5CLb_:hover .snf4QoTqvgoLqHzoqsIg {\n display: block;\n }\n ","",{version:3,sources:["webpack://./../map-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;IACI,kBAAkB;EACpB;EACA;IACE,aAAa;IACb,WAAW;IACX,YAAY;IACZ,OAAO;IACP,MAAM;IACN,kBAAkB;IAClB,gCAAgC;IAChC,YAAY;EACd;;EAEA;IACE,cAAc;EAChB",sourcesContent:[".root {\n position: relative;\n }\n .cover {\n display: none;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n background-color: var(--primary);\n opacity: 0.6;\n }\n \n .root:hover .cover {\n display: block;\n }\n "],sourceRoot:""}]),r.locals={root:"hxLTwa3A42dNIqe5CLb_",cover:"snf4QoTqvgoLqHzoqsIg"};const l=r}}]);