UNPKG

@creaditor/newsletter-starterkit

Version:

Creaditor Newsletter Editor - Starterkit for creating beautiful email newsletters

21 lines 2.3 kB
/*! For license information please see 7511.creaditor.bundle.js.LICENSE.txt */ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7511],{47511:(e,t,s)=>{s.r(t),s.d(t,{ImagesPreset:()=>d});var i=s(56666),r=s(21293),n=(s(38036),s(68905)),o=s(3959);class d extends r.oi{constructor(){super(),this.index=0}render(){"string"!=typeof this.src&&(this.src="");const e=this.src.split(",");e.length>1&&setTimeout((()=>{const t=this.shadowRoot.querySelector(".background");t.classList.remove("fade-in"),this.index<e.length-1?this.index++:this.index=0,t&&setTimeout((()=>{t.classList.add("fade-in"),setTimeout((()=>{t.classList.remove("fade-in")}),1e3)}),0)}),4500);const t=(0,n.a)(this.getAttribute("style"));return t.backgroundImage=`url(${e[this.index]})`,r.dy`<div style="${(0,o.V)(t)}" class="background"></div>`}}(0,i.Z)(d,"properties",{src:{type:String},index:{type:Number},style:{type:String}}),(0,i.Z)(d,"styles",r.iv` .background { background-position: center center; background-size: cover; width: 100%; height: 100%; } .fade-in { animation: fade-in 1s; } @keyframes fade-in { from { opacity: 0; margin-top: 5px; } to { opacity: 1; } } `),customElements.define("cdtr-images-preset",d)},3959:(e,t,s)=>{s.d(t,{V:()=>d});var i=s(33692),r=s(50875);const n="important",o=" !"+n,d=(0,r.XM)(class extends r.Xe{constructor(e){if(super(e),e.type!==r.pX.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,s)=>{const i=e[s];return null==i?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?s.removeProperty(e):s[e]=null);for(const e in t){const i=t[e];if(null!=i){this.ft.add(e);const t="string"==typeof i&&i.endsWith(o);e.includes("-")||t?s.setProperty(e,t?i.slice(0,-11):i,t?n:""):s[e]=i}}return i.Jb}})}}]);