UNPKG

@creaditor/newsletter-starterkit

Version:

Creaditor Newsletter Editor - Starterkit for creating beautiful email newsletters

1 lines 3.96 kB
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3585],{83585:(e,t,s)=>{s.r(t),s.d(t,{default:()=>C});const n=e=>{{const{component:t,commands:s,helpers:n}=e,o=t.parent("col");return{select:e=>{let{changeTab:t,tab:s}=e},tabs:e=>{const t=[{text:"design"},{text:"animations"},{text:"settings"}];return t.forEach((t=>t.selected=t.selected=t.text===e)),t},layout:e=>{let{tab:r,changeTab:i,tabs:a}=e;const l=[{type:"input",title:"add_urlAddress_from_media_site",active:()=>"design"===r.text,value:t.props.url||"",onChange:e=>{let t=e.target.value;if(-1!==t.indexOf("youtube.com/shorts/")){const e=t.split("/");e.length>0&&(t=`https://youtu.be/${e[e.length-1]}`)}s.execCommand("url",t)}},{type:"divider",active:()=>"design"===r.text},{type:"fontSize",title:"size",min:10,active:()=>"design"===r.text,max:o?.element?.offsetWidth,value:parseInt(t.props.style.width),device:e=>{if("phone"===e.target.device){const s=t.props?.breakpoints?.sm?.style?.width||t.props.style.width;e.target.value=parseInt(s)}else e.target.value=parseInt(t.props.style.width)},onInput:e=>{const t=e.target.value;"phone"===e.target.device?s.execCommand("breakpoints",(e=>{const s=e.props.breakpoints?.sm||{};return{sm:n.deepMerge(s,{style:{width:t+"px",height:e.props.isCircle?t+"px":"auto"}})}})):s.execCommand("style",(e=>({width:t+"px",height:e.props.isCircle?t+"px":"auto"})))}},{type:"divider"},{type:"divider",active:()=>"design"===r.text}];return l}}}};var o=s(46245);const r=()=>({set:(e,t,s)=>{switch(t){case"url":return e[t]=s,!0;case"style":if("object"==typeof s)return s.width&&(s.height=parseFloat(s.width)/1.8+"px"),e[t]=(0,o.Z)(e[t],s),!0}}});var i=s(46062),a=s.n(i),l=s(32877),c=s.n(l),d=s(96793),p=s.n(d),h=s(17892),u=s.n(h),m=s(11173),A=s.n(m),g=s(34024),v={};v.setAttributes=u(),v.insert=p().bind(null,"head"),v.domAPI=c(),v.insertStyleElement=A();a()(g.Z,v);const y=g.Z&&g.Z.locals?g.Z.locals:void 0;s(23691);const b="video";const C=()=>({name:b,create:e=>{const{createElement:t,compose:s,helpers:o}=e,{arrayToString:i,mergeDiff:a}=o,l=document.createElement("div");l.classList.add(y.root);const c=document.createElement("div");c.classList.add(y.cover);const d=document.createElement("cdtr-media-player");return l.append(d,c),l.addEventListener("click",(()=>{d.playing=!1})),t({name:b,id:s.id,template:l,defaultProps:{style:{height:"auto",width:"400px",height:"300px",playing:!1,loop:!1,light:!1,controls:!0,autoPlay:!1,muted:!1,url:"https://www.youtube.com/watch?v=04Or_U9OexU"}},draggable:{group:"element"},droppable:{group:"element"},render:e=>{d.url=s.props.url,a(d,{style:s.props.style}),d.width=s.props.style.width,d.height=s.props.style.height},atomElement:d,resizeable:()=>l,handleBar:!0,validator:r(),schema:s.schema,onSelect:e=>{d.classList.add(e)},onDeselect:e=>{d.classList.remove(e)},elementProps:s,remove:()=>{l.remove()},createEditor:n})}})},34024:(e,t,s)=>{s.d(t,{Z:()=>a});var n=s(40272),o=s.n(n),r=s(82609),i=s.n(r)()(o());i.push([e.id,".L0bAAMsmDgLWsLmiJqDt {\n position: relative;\n max-width: 100%;\n}\n.wkeXKWFE5PovclYk2Cus {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n opacity: 0.6;\n}\n\n.L0bAAMsmDgLWsLmiJqDt:hover .wkeXKWFE5PovclYk2Cus {\n display: block;\n background-color: var(--primary);\n}\n","",{version:3,sources:["webpack://./../video-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,eAAe;AACjB;AACA;EACE,WAAW;EACX,YAAY;EACZ,OAAO;EACP,MAAM;EACN,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,cAAc;EACd,gCAAgC;AAClC",sourcesContent:[".root {\n position: relative;\n max-width: 100%;\n}\n.cover {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n opacity: 0.6;\n}\n\n.root:hover .cover {\n display: block;\n background-color: var(--primary);\n}\n"],sourceRoot:""}]),i.locals={root:"L0bAAMsmDgLWsLmiJqDt",cover:"wkeXKWFE5PovclYk2Cus"};const a=i}}]);