@creaditor/newsletter-starterkit 1.0.21 → 1.0.22

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.
@@ -0,0 +1 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1874],{1874:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});const o=e=>{{const{component:t,commands:n,helpers:o}=e;return{select:e=>{let{changeTab:t,tab:n}=e;"design"!==n.text&&t("design")},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:o,changeTab:r,tabs:s}=e;const l=t.closest("col");return[{type:"colorpicker",title:"color",value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;n.execCommand("style",{borderColor:t})}},{type:"slider",title:"width",value:parseFloat(t.props.style.width),unit:"px",min:20,max:parseInt(window.getComputedStyle(l.element).width),onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px"})}},{type:"slider",title:"height",unit:"px",value:parseFloat(t.props.style.borderTopWidth),min:1,max:80,onInput:e=>{const t=e.target.value;n.execCommand("style",{borderTopWidth:t+"px"})}},{type:"slider",title:"radius",unit:"px",value:parseFloat(t.props.style.borderRadius),min:0,max:99,onInput:e=>{const t=e.target.value;n.execCommand("style",{borderRadius:t+"px"})}},{type:"borderpicker",title:"style",value:t.props.style.borderTopStyle,onChange:e=>{const t=e.target.value;n.execCommand("style",{borderTopStyle:t})}}]}}}},r=e=>{let{helpers:t}=e;return{set:(e,n,o)=>"style"===n&&(e[n]=t.deepMerge(e[n],o),!0)}};var s=n(46062),l=n.n(s),a=n(32877),d=n.n(a),i=n(96793),p=n.n(i),A=n(17892),c=n.n(A),u=n(11173),m=n.n(u),h=n(87858),C={};C.setAttributes=c(),C.insert=p().bind(null,"head"),C.domAPI=d(),C.insertStyleElement=m();l()(h.Z,C);const b=h.Z&&h.Z.locals?h.Z.locals:void 0,y=()=>{const e="divider";return{name:e,create:t=>{let{createElement:n,compose:s,helpers:l}=t;const a=document.createElement("div"),d=document.createElement("div");return d.classList.add(b.divider),a.classList.add(b.root),a.append(d),n({name:e,id:s.id,template:a,defaultProps:{style:{width:"300px",borderTopWidth:"5px",borderTopStyle:"solid",borderTopColor:"#000"}},draggable:{group:"element"},droppable:{group:"element"},handleBar:!0,render:()=>{if(s.props.style)for(const e in s.props.style)if(Object.hasOwnProperty.call(s.props.style,e)){const t=s.props.style[e];d.style[e]=t}},validator:r({template:a,helpers:l,divider:d}),schema:s.schema,onSelect:e=>{a.classList.add(e)},onDeselect:e=>{a.classList.remove(e)},elementProps:s,remove:()=>{a.remove()},createEditor:o})}}}},87858:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(40272),r=n.n(o),s=n(82609),l=n.n(s)()(r());l.push([e.id,'.JZOFqNfSonbraS1fq66f{\n min-height: 20px;\n}\n\n.yC6YindOVuQurz7fhjWD{\n margin: auto;\n display: block;\n}\n.yC6YindOVuQurz7fhjWD:after{\n content: "";\n display: block;\n width: 100%;\n height:20px;\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n}\n.yC6YindOVuQurz7fhjWD:before{\n content: "";\n display: block;\n width: 100%;\n height:20px;\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 0;\n transform: translateY(-100%);\n z-index: 1;\n}',"",{version:3,sources:["webpack://./../divider-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB;;AAEA;IACI,YAAY;IACZ,cAAc;AAClB;AACA;IACI,WAAW;IACX,cAAc;IACd,WAAW;IACX,WAAW;IACX,6BAA6B;IAC7B,kBAAkB;IAClB,MAAM;IACN,OAAO;IACP,UAAU;AACd;AACA;IACI,WAAW;IACX,cAAc;IACd,WAAW;IACX,WAAW;IACX,6BAA6B;IAC7B,kBAAkB;IAClB,MAAM;IACN,OAAO;IACP,4BAA4B;IAC5B,UAAU;AACd",sourcesContent:['.root{\n min-height: 20px;\n}\n\n.divider{\n margin: auto;\n display: block;\n}\n.divider:after{\n content: "";\n display: block;\n width: 100%;\n height:20px;\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n}\n.divider:before{\n content: "";\n display: block;\n width: 100%;\n height:20px;\n background-color: transparent;\n position: absolute;\n top: 0;\n left: 0;\n transform: translateY(-100%);\n z-index: 1;\n}'],sourceRoot:""}]),l.locals={root:"JZOFqNfSonbraS1fq66f",divider:"yC6YindOVuQurz7fhjWD"};const a=l}}]);
Binary file
@@ -59,7 +59,7 @@
59
59
  @debounce=${t.onDebounce}
60
60
  @change=${t.onChange}
61
61
  @input=${t.onInput}
62
- style="width:100%;"
62
+ style="width:100%;${t.emoji?"padding-left:40px;":""}"
63
63
  .couchOnEmpty=${!!t.couch}
64
64
  ></cdtr-input>
65
65
  <div style="position:absolute;left:0;top:0;">
Binary file
@@ -1,6 +1,6 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7637],{77637:(e,t,s)=>{s.r(t),s.d(t,{default:()=>_});var r=s(9571),i=s(8427);let n={};function a(e){n.selected=e}function c(e){return n.selected}const o=[{type:"youtube",src:"https://panel.sendmsg.co.il/templateContentImages/images/CreaditorGeneral/youtube.png"},{type:"whatsapp",src:"https://panel.sendmsg.co.il/templateContentImages/images/CreaditorGeneral/whatsapp.png"},{type:"snapchat",src:"https://panel.sendmsg.co.il/templateContentImages/images/CreaditorGeneral/snapchat.png"},{type:"instagram",src:"https://render.creaditor.ai/media/social-icons/instagram-black-square.png"},{type:"telegram",src:"https://render.creaditor.ai/media/social-icons/telegram-blue-square.png"},{type:"facebook",src:"https://render.creaditor.ai/media/social-icons/facebook-black-square.png"},{type:"vimeo",src:"https://render.creaditor.ai/media/social-icons/vimeo-blue-square.png"},{type:"email",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},{type:"phone",src:"https://render.creaditor.ai/media/social-icons/phone-black-circle.png"},{type:"x",src:"https://render.creaditor.ai/media/social-icons/x-black-circle.png"},{type:"linkedin",src:"https://render.creaditor.ai/media/social-icons/linkedin-black-circle.png"},{type:"tiktok",src:"https://render.creaditor.ai/media/social-icons/tiktok-black-circle.png"},{type:"reddit",src:"https://render.creaditor.ai/media/social-icons/reddit-black-circle.png"},{type:"twitch",src:"https://render.creaditor.ai/media/social-icons/twitch-black-circle.png"}];const l=e=>{{const{component:t,commands:s}=e;let r=c();return r||(r=t.props.items.find((e=>!e.link)),r||(r=t.props.items[0])),{select:e=>{let{changeTab:t,tab:s}=e;"link"!==s&&t("link")},tabs:e=>{const t=[{text:"image"},{text:"link"},{text:"design"}];return t.forEach((t=>t.selected=t.selected=t.text===e)),t},layout:e=>{let{tab:n,changeTab:a,tabs:c}=e;const l=[{type:"node",node:()=>i.dy`<img
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7637],{77637:(e,t,s)=>{s.r(t),s.d(t,{default:()=>_});var r=s(9571),i=s(8427);let n={};function a(e){n.selected=e}function o(e){return n.selected}const c=[{type:"youtube",src:"https://panel.sendmsg.co.il/templateContentImages/images/CreaditorGeneral/youtube.png"},{type:"whatsapp",src:"https://panel.sendmsg.co.il/templateContentImages/images/CreaditorGeneral/whatsapp.png"},{type:"snapchat",src:"https://panel.sendmsg.co.il/templateContentImages/images/CreaditorGeneral/snapchat.png"},{type:"instagram",src:"https://render.creaditor.ai/media/social-icons/instagram-black-square.png"},{type:"telegram",src:"https://render.creaditor.ai/media/social-icons/telegram-blue-square.png"},{type:"facebook",src:"https://render.creaditor.ai/media/social-icons/facebook-black-square.png"},{type:"vimeo",src:"https://render.creaditor.ai/media/social-icons/vimeo-blue-square.png"},{type:"email",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},{type:"phone",src:"https://render.creaditor.ai/media/social-icons/phone-black-circle.png"},{type:"x",src:"https://render.creaditor.ai/media/social-icons/x-black-circle.png"},{type:"linkedin",src:"https://render.creaditor.ai/media/social-icons/linkedin-black-circle.png"},{type:"tiktok",src:"https://render.creaditor.ai/media/social-icons/tiktok-black-circle.png"},{type:"reddit",src:"https://render.creaditor.ai/media/social-icons/reddit-black-circle.png"},{type:"twitch",src:"https://render.creaditor.ai/media/social-icons/twitch-black-circle.png"}];const l=e=>{{const{component:t,commands:s}=e,r=()=>{let e=o();if(e||(e=t.props.items.find((e=>!e.link)),!e&&t.props.items.length>0&&(e=t.props.items[0])),e){!t.props.items.find((t=>t.id===e.id))&&t.props.items.length>0&&(e=t.props.items[0])}return e};return{select:e=>{let{changeTab:t,tab:s}=e;"link"!==s&&t("link")},tabs:e=>{e||(e="link");const t=[{text:"image"},{text:"design"},{text:"link",selected:!0}];return t.forEach((t=>t.selected=t.selected=t.text===e)),t},layout:e=>{let{tab:n,changeTab:a,tabs:o}=e;const l=r(),d=[{type:"node",node:()=>i.dy`<img
2
2
  style="padding:10px;display:block;margin:auto"
3
3
  width="52"
4
4
  height="52"
5
- src=${r?.src}
6
- />`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const i=[...t.props.items];if(i.length<2)return;const n=i.findIndex((e=>e.id===r.id));-1!==n&&(i.splice(n,1),s.execCommand("items",i))}},{type:"divider"},{type:"gallery",active:"image"===n.text,src:r?.src,hasPreview:!0,text:"open_gallery",justify:"flex-start",onChange:e=>{let i=e.detail;Array.isArray(i)&&(i=i[0]);const n=t.props,a=JSON.parse(JSON.stringify(n.items)),c=a.findIndex((e=>e.id===r.id));-1!==c&&(a[c].src=i.src,s.execCommand("items",a))}},{type:"linkpicker",href:r.link||r.url,active:()=>"link"===n.text&&!!r,onChange:e=>{const i=e.target.value,n=t.props,a=JSON.parse(JSON.stringify(n.items)),c=a.findIndex((e=>e.id===r.id));if(-1!==c){if(o.find((e=>e.src===a[c].src))){let e=function(e){if("string"!=typeof e)return;const t=document.createElement("a");t.href=e;const s=t.hostname,r=o.find((e=>-1!==s.indexOf(e.type)));return"tel:"===t.protocol?"https://render.creaditor.ai/media/social-icons/phone-black-circle.png":"mailto:"===t.protocol?"https://render.creaditor.ai/media/social-icons/mail-black-circle.png":r?r.src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"}(i.href);e&&(a[c].src=e)}a[c].url=i.href,a[c].link=i,s.execCommand("items",a)}}},{type:"slider",title:"size",active:"design"===n.text,value:parseInt(r?.style?.width),min:10,max:80,onInput:e=>{const r=e.target.value,i=[...t.props.items];i.forEach((e=>{e.style.width=r+"px",e.style.height=r+"px"})),s.execCommand("items",i)}},{type:"divider"},{type:"slider",title:"spacing",active:"design"===n.text,value:parseFloat(t.props.style.gap),min:0,max:80,onInput:e=>{const t=e.target.value;s.execCommand("style",{gap:t+"px"})}}];return l}}}};var d=s(46245);const p=()=>({set:(e,t,s)=>{switch(t){case"style":if("object"==typeof s)return e[t]=(0,d.Z)(e[t],s),!0;case"items":if(e[t]=s,Array.isArray(s)){const e=c(),t=s.find((t=>t.id===e.id));if(t)return a(t),!0}case"src":const r=c();if(r){const i=[...e.items],n=i.findIndex((e=>e.id===r.id));if(-1!==n)return i[n].src=s,e[t]=i,!0}}}});var m=s(46062),h=s.n(m),u=s(32877),f=s.n(u),g=s(96793),y=s.n(g),b=s(17892),k=s.n(b),C=s(11173),x=s.n(C),v=s(12089),w={};w.setAttributes=k(),w.insert=y().bind(null,"head"),w.domAPI=f(),w.insertStyleElement=x();h()(v.Z,w);const A=v.Z&&v.Z.locals?v.Z.locals:void 0;var I=s(51921);const _=()=>{const e="social";return{name:e,create:t=>{let{createElement:s,compose:i,helpers:n}=t;const d=document.createElement("div"),m=document.createElement("div");m.classList.add(A.root);new I.ZP(m,{sort:!0,delay:0,delayOnTouchOnly:!1,touchStartThreshold:0,disabled:!1,store:null,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",preventOnFilter:!0,draggable:".item",dataIdAttr:"data-id",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:1,direction:"horizontal",forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,dragoverBubble:!1,removeCloneOnHide:!0,emptyInsertThreshold:5,setData:function(e,t){e.setData("Text",t.textContent)},onChoose:function(e){e.oldIndex},onUnchoose:function(e){},onStart:function(e){e.oldIndex},onEnd:function(e){const t=JSON.parse(JSON.stringify(i.props.items)),{oldIndex:s,newIndex:r}=e,[n]=t.splice(s,1);t.splice(r,0,n),i.editor.store().execCommand("items",t)},onMove:function(e,t){e.dragged,e.draggedRect,e.related,e.relatedRect,e.willInsertAfter,t.clientY},onChange:function(e){e.newIndex}});d.appendChild(m);return s({name:e,id:i.id,template:d,draggable:{group:"element"},droppable:{group:"element"},render:()=>{for(i.props.items.forEach((e=>{if(!e.src){const t=(e=>{if(!e)return;const t=e.toLowerCase();if(t.startsWith("mailto:"))return"email";if(t.startsWith("tel:"))return"phone";try{const s=(t.startsWith("http")?new URL(e):new URL(`https://${e}`)).hostname.replace("www.",""),r=s.split(".")[0];return o.find((e=>{const t=e.type.toLowerCase();return s.includes(t)||t.includes(r)||r.includes(t)}))?.type}catch(e){return o.find((e=>{const s=e.type.toLowerCase();return t.includes(s)||s.includes(t)}))?.type}})(e.url);t&&(e.src=o.find((e=>e.type===t))?.src)}}));m.firstChild;)m.removeChild(m.firstChild);n.mergeDiff(m,{style:i.props.style});const e=c();i.props.items.forEach((t=>{const s=document.createElement("img");e?.id===t.id&&s.classList.add(A.selected),s.addEventListener("click",(()=>{a(t),Array.from(m.children).forEach((e=>{e.classList.remove(A.selected)})),s.classList.add(A.selected)})),s.classList.add("item"),t.id&&s.setAttribute("data-id",t.id),s.src=t.src,n.mergeDiff(s,{style:t.style}),m.append(s)}));const t=document.createElement("paper-button");t.style.minWidth="0",t.style.padding=0,t.innerHTML="<cdtr-icon icon='add'></cdtr-icon>",m.append(t),t.addEventListener("click",(()=>{setTimeout((()=>{const e=i.props.items[i.props.items.length-1],t={id:(0,r.Z)(),fgColor:"",bgColor:"",style:e.style,url:"",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},s=[...i.props.items];s.push(t),a(t),i.editor.store().execCommand("items",s)}),200)}))},handleBar:!0,defaultProps:{},validator:p(),schema:i.schema,onSelect:e=>{const t=c();if(t){const s=document.querySelector(`[data-id="${t.id}"]`);s?(window.___social_cdtr_item=s,s.classList.add("selected_underlined")):d.classList.add(e)}},onDeselect:e=>{c();window.___social_cdtr_item&&window.___social_cdtr_item.classList.remove("selected_underlined"),d?.classList?.remove(e)},elementProps:i,remove:()=>{d.remove()},createEditor:l})}}}},12089:(e,t,s)=>{s.d(t,{Z:()=>c});var r=s(40272),i=s.n(r),n=s(82609),a=s.n(n)()(i());a.push([e.id,".kfYL5P8k1NoeIcHkTLa_{\n display: flex;\n}\n.qVA_0R0VNI45kslNcUpm{\n border:1px solid var(--primary);\n}","",{version:3,sources:["webpack://./../social-editor-component-newsletter/lib/style.module.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB;AACA;IACI,+BAA+B;AACnC",sourcesContent:[".root{\n display: flex;\n}\n.selected{\n border:1px solid var(--primary);\n}"],sourceRoot:""}]),a.locals={root:"kfYL5P8k1NoeIcHkTLa_",selected:"qVA_0R0VNI45kslNcUpm"};const c=a}}]);
5
+ src=${l?.src}
6
+ />`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const i=r();if(!i)return;const n=[...t.props.items];if(n.length<2)return;const a=n.findIndex((e=>e.id===i.id));-1!==a&&(n.splice(a,1),s.execCommand("items",n))}},{type:"divider"},{type:"gallery",active:"image"===n.text,src:l?.src,hasPreview:!0,text:"open_gallery",justify:"flex-start",onChange:e=>{const i=r();if(!i)return;let n=e.detail;Array.isArray(n)&&(n=n[0]);const a=t.props,o=JSON.parse(JSON.stringify(a.items)),c=o.findIndex((e=>e.id===i.id));-1!==c&&(o[c].src=n.src,s.execCommand("items",o))}},{type:"linkpicker",href:l?.link||l?.url,active:()=>"link"===n.text&&!!l,onChange:e=>{const i=r();if(!i)return;const n=e.target.value,a=t.props,o=JSON.parse(JSON.stringify(a.items)),l=o.findIndex((e=>e.id===i.id));if(-1!==l){if(c.find((e=>e.src===o[l].src))){let e=function(e){if("string"!=typeof e)return;const t=document.createElement("a");t.href=e;const s=t.hostname,r=c.find((e=>-1!==s.indexOf(e.type)));return"tel:"===t.protocol?"https://render.creaditor.ai/media/social-icons/phone-black-circle.png":"mailto:"===t.protocol?"https://render.creaditor.ai/media/social-icons/mail-black-circle.png":r?r.src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"}(n.href);e&&(o[l].src=e)}o[l].url=n.href,o[l].link=n,s.execCommand("items",o)}}},{type:"slider",title:"size",active:"design"===n.text,value:parseInt(l?.style?.width),min:10,max:80,onInput:e=>{const r=e.target.value,i=[...t.props.items];i.forEach((e=>{e.style.width=r+"px",e.style.height=r+"px"})),s.execCommand("items",i)}},{type:"divider"},{type:"slider",title:"spacing",active:"design"===n.text,value:parseFloat(t.props.style.gap),min:0,max:80,onInput:e=>{const t=e.target.value;s.execCommand("style",{gap:t+"px"})}}];return d}}}};var d=s(46245);const p=()=>({set:(e,t,s)=>{switch(t){case"style":if("object"==typeof s)return e[t]=(0,d.Z)(e[t],s),!0;case"items":if(e[t]=s,Array.isArray(s)){const e=o(),t=s.find((t=>t.id===e.id));if(t)return a(t),!0}case"src":const r=o();if(r){const i=[...e.items],n=i.findIndex((e=>e.id===r.id));if(-1!==n)return i[n].src=s,e[t]=i,!0}}}});var m=s(46062),h=s.n(m),u=s(32877),f=s.n(u),g=s(96793),y=s.n(g),b=s(17892),k=s.n(b),C=s(11173),x=s.n(C),v=s(12089),w={};w.setAttributes=k(),w.insert=y().bind(null,"head"),w.domAPI=f(),w.insertStyleElement=x();h()(v.Z,w);const A=v.Z&&v.Z.locals?v.Z.locals:void 0;var I=s(51921);const _=()=>{const e="social";return{name:e,create:t=>{let{createElement:s,compose:i,helpers:n}=t;const d=document.createElement("div"),m=document.createElement("div");m.classList.add(A.root);new I.ZP(m,{sort:!0,delay:0,delayOnTouchOnly:!1,touchStartThreshold:0,disabled:!1,store:null,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",preventOnFilter:!0,draggable:".item",dataIdAttr:"data-id",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:1,direction:"horizontal",forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,dragoverBubble:!1,removeCloneOnHide:!0,emptyInsertThreshold:5,setData:function(e,t){e.setData("Text",t.textContent)},onChoose:function(e){e.oldIndex},onUnchoose:function(e){},onStart:function(e){e.oldIndex},onEnd:function(e){const t=JSON.parse(JSON.stringify(i.props.items)),{oldIndex:s,newIndex:r}=e,[n]=t.splice(s,1);t.splice(r,0,n),i.editor.store().execCommand("items",t)},onMove:function(e,t){e.dragged,e.draggedRect,e.related,e.relatedRect,e.willInsertAfter,t.clientY},onChange:function(e){e.newIndex}});d.appendChild(m);return s({name:e,id:i.id,template:d,draggable:{group:"element"},droppable:{group:"element"},render:()=>{for(i.props.items.forEach((e=>{if(!e.src){const t=(e=>{if(!e)return;const t=e.toLowerCase();if(t.startsWith("mailto:"))return"email";if(t.startsWith("tel:"))return"phone";try{const s=(t.startsWith("http")?new URL(e):new URL(`https://${e}`)).hostname.replace("www.",""),r=s.split(".")[0];return c.find((e=>{const t=e.type.toLowerCase();return s.includes(t)||t.includes(r)||r.includes(t)}))?.type}catch(e){return c.find((e=>{const s=e.type.toLowerCase();return t.includes(s)||s.includes(t)}))?.type}})(e.url);t&&(e.src=c.find((e=>e.type===t))?.src)}}));m.firstChild;)m.removeChild(m.firstChild);n.mergeDiff(m,{style:i.props.style});const e=o();i.props.items.forEach((t=>{const s=document.createElement("img");e?.id===t.id&&s.classList.add(A.selected),s.addEventListener("click",(()=>{a(t),Array.from(m.children).forEach((e=>{e.classList.remove(A.selected)})),s.classList.add(A.selected)})),s.classList.add("item"),t.id&&s.setAttribute("data-id",t.id),s.src=t.src,n.mergeDiff(s,{style:t.style}),m.append(s)}));const t=document.createElement("paper-button");t.style.minWidth="0",t.style.padding=0,t.innerHTML="<cdtr-icon icon='add'></cdtr-icon>",m.append(t),t.addEventListener("click",(()=>{setTimeout((()=>{const e=i.props.items[i.props.items.length-1],t={id:(0,r.Z)(),fgColor:"",bgColor:"",style:e.style,url:"",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},s=[...i.props.items];s.push(t),a(t),i.editor.store().execCommand("items",s)}),200)}))},handleBar:!0,defaultProps:{},validator:p(),schema:i.schema,onSelect:e=>{const t=o();if(t){const s=document.querySelector(`[data-id="${t.id}"]`);s?(window.___social_cdtr_item=s,s.classList.add("selected_underlined")):d.classList.add(e)}},onDeselect:e=>{o();window.___social_cdtr_item&&window.___social_cdtr_item.classList.remove("selected_underlined"),d?.classList?.remove(e)},elementProps:i,remove:()=>{d.remove()},createEditor:l})}}}},12089:(e,t,s)=>{s.d(t,{Z:()=>o});var r=s(40272),i=s.n(r),n=s(82609),a=s.n(n)()(i());a.push([e.id,".kfYL5P8k1NoeIcHkTLa_{\n display: flex;\n}\n.qVA_0R0VNI45kslNcUpm{\n border:1px solid var(--primary);\n}","",{version:3,sources:["webpack://./../social-editor-component-newsletter/lib/style.module.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB;AACA;IACI,+BAA+B;AACnC",sourcesContent:[".root{\n display: flex;\n}\n.selected{\n border:1px solid var(--primary);\n}"],sourceRoot:""}]),a.locals={root:"kfYL5P8k1NoeIcHkTLa_",selected:"qVA_0R0VNI45kslNcUpm"};const o=a}}]);
Binary file