@creaditor/web-starterkit 1.0.14 → 1.0.16

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.
@@ -1,4 +1,4 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1260],{91260(t,e,o){o.r(e),o.d(e,{BlockEditor:()=>g});var r=o(59929),i=o(86319),a=o(36565),n=o(49937),s=o(83235);const d=JSON.parse('["3g2","3gp","aaf","asf","avchd","avi","drc","flv","m2v","m3u8","m4p","m4v","mkv","mng","mov","mp2","mp4","mpe","mpeg","mpg","mpv","mxf","nsv","ogg","ogv","qt","rm","rmvb","roq","svi","vob","webm","wmv","yuv"]');var l=o(9334),c=o(96374);const p=[{id:"video-background",name:"video",thumb:"https://i.ytimg.com/vi/RhlQvbvMg-0/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLCKBaHlpHj3ghOXWjB2br9kHjPg7w",group:["section-component"],type:"video",preset:{installed:!1,component:"cdtr-background-video",properties:{type:"video",url:"https://www.youtube.com/watch?v=RhlQvbvMg-0",loop:!0,volume:0,controls:0,muted:!0,playing:!0,config:{playerVars:{showinfo:0,controls:0,playsinline:0}},style:{zIndex:0,width:window.innerWidth+500,height:window.innerWidth-560,pointerEvents:"none",transform:"translate(-10%,-0%)"}}}},{id:"images-background",name:"some-images",thumb:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg",group:["section-component"],type:"images",preset:{tags:[],installed:!1,type:"images",component:"cdtr-images-preset",properties:{src:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg,https://images.pexels.com/photos/1408221/pexels-photo-1408221.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",style:{backgroundAttachment:"local",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}}}];o(12258),o(15155);o.e(4217).then(o.bind(o,94217));class g extends r.WF{constructor(t){super(),this.onChangeBakgroundExpanding=t=>{const e=t.target.checked;a.Ay.store().execCommand("expand_image_for_outlook",!e)},this.getInnerBlocks=()=>{const t=[],e=this.component.parent();return e&&"section"===e.type?(e.children.forEach(e=>{const o=i.M.get("components",e);o&&"block"===o.type&&t.push(o)}),t):[this.component]},this.onChangeWidth=this.onChangeWidth.bind(this),this.getInnerBlocks=this.getInnerBlocks.bind(this),this.isBackgroundImage=!1,this.backgroundVideo="",this.galleryOpened=!1,this._sectionsExpanded=!1,this.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this);const e=i.M.get("config","channel");this.tabs=[{text:"background"},{text:"style",selected:!0},..."web"===e?[{text:"animations"}]:[],{text:"settings"}],this.tabName="style",this.maxWidth=0,this.background="",this.padding={topValue:0,bottomValue:0,leftValue:0,rightValue:0},this.margin={topValue:0,bottomValue:0},this.borderStyle="solid",this.borderWidth=0,this.borderColor="#000",this.theme=i.M.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{a.Ay.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,a.Ay.store().execCommand("noResponsive",this.noResponsive)},onChangeBorderStyle:t=>{this.borderStyle=t.target.borderStyle||"",this.borderWidth=t.target.borderWidth||1,this.borderColor=t.target.borderColor||"#000",this.borderRadius=t.target.borderRadius||0;t.target.json;a.Ay.store().execCommand("style",{borderStyle:this.borderStyle,borderColor:this.borderColor,borderTopWidth:t.target.borderTopWidth||"0px",borderBottomWidth:t.target.borderBottomWidth||"0px",borderLeftWidth:t.target.borderLeftWidth||"0px",borderRightWidth:t.target.borderRightWidth||"0px",borderTopRightRadius:parseInt(t.target.borderTopRightRadius||0)+"px",borderTopLeftRadius:parseInt(t.target.borderTopLeftRadius||0)+"px",borderBottomRightRadius:parseInt(t.target.borderBottomRightRadius||0)+"px",borderBottomLeftRadius:parseInt(t.target.borderBottomLeftRadius||0)+"px",borderRadius:null})},onRemoveBackgroundVideo:()=>{this.backgroundVideo="",this.backgroundInstance={},a.Ay.store().execCommand("background","transparent")},onChangeBackgroundVideo:t=>{const e=t.target.value;let o;if((0,s.A)(e)){const t=p.find(t=>"images"===t.type);t.preset.properties.src=e,o=t.preset}else if(function(t){const e=(/(?:\.([^.]+))?$/.exec(t.toLowerCase())??[])[1]??"";return-1!==d.findIndex(t=>t===e)}(e));else if(function(t){if(t&&t.match(/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return!0;return!1}(e)){const t=p.find(t=>"video"===t.type);t.preset.properties.url=e,delete t.preset.properties.videoPath,o=t.preset}o&&(a.Ay.store().execCommand("background",JSON.parse(JSON.stringify(o))),a.Ay.store().execCommand("style",{background:null})),this.backgroundVideo=e},onChangeImage:t=>{const e=t.detail,o=[];Array.isArray(e)?e.forEach(t=>o.push(t.src)):o.push(e.src),this.cmds.onChangeBackgroundVideo({target:{value:o.join(",")}}),this.galleryOpened=!1},onChangeHeight:t=>{const e=t.target.value;a.Ay.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,o=t.target.direction;"all"===o?(a.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):a.Ay.store().execCommand("style",{[(0,l.A)(`margin-${o.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,o=t.target.direction,r=(0,l.A)(`padding-${o.toLowerCase()}`);"all"===o?(a.Ay.store().execCommand("style",{padding:null,"padding-top":null,"padding-bottom":null,"padding-left":null,"padding-right":null,paddingTop:e+"px",paddingBottom:e+"px",paddingLeft:e+"px",paddingRight:e+"px","padding-right":null,"padding-left":null,"padding-top":null,"padding-bottom":null}),this.padding={topValue:e,bottomValue:e,leftValue:e,rightValue:e}):(a.Ay.store().execCommand("style",{[r]:e+"px",[`padding-${o.toLowerCase()}`]:null}),this.props.style={[r]:e+"px"},this[`padding${o.toLowerCase()}`]=e)},onChangebackground(t){const e=t.target.value;this.background=e;a.Ay.components.forEach(t=>{const o=t.find("text");if(o&&!o.closest("card")){let t=o.tiptap.getAttributes("textStyle").color;if(!t){const e=o.element.querySelector("p,h1,h2,h3,h4,h5,h6");e&&(t=window.getComputedStyle(e).color)}if(t){if("transparent"===t)return;if(!t.includes("var(--")&&!e.includes("var(--")&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e&&"rgb(0, 0, 0)"!==e){const r=(0,c.w)(t,e);o.tiptap.chain().selectAll().setColor(r).run()}}}}),a.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==i.M.get("config","channel")&&a.Ay.store().execCommand("background",null)}}}onChangeImageBackgroundProp(t){const e=t.detail,{key:o,value:r}=e;if(this.props.background){const t=JSON.parse(JSON.stringify(this.props.background)),e=t.properties;if(!e.style[o])throw new Error(`${o} is not a valid property`);e.style[o]=r,a.Ay.store().execCommand("background",t)}}connectedCallback(){super.connectedCallback(),this.connectWith(),a.Ay.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),a.Ay.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const o=this.getInnerBlocks();a.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...o]}),this.maxWidth=e}connectWith(){const t=a.Ay.components[a.Ay.components.length-1];if(this.component=t,t&&"block"===t.type){this.props=t.props;let{style:e}=this.props;e||(e={}),t.props||(t.props={}),t.props.style||(t.props.style={}),this.expand_image_for_outlook=!!t.props.expand_image_for_outlook,this.boxShadow=t.props.style.boxShadow,this.borderStyle=t.props.style.borderStyle,this.borderWidth=t.props.style.borderWidth,this.borderTopRightRadius=parseInt(t.props.style.borderTopRightRadius),this.borderTopLeftRadius=parseInt(t.props.style.borderTopLeftRadius),this.borderBottomRightRadius=parseInt(t.props.style.borderBottomRightRadius),this.borderBottomLeftRadius=parseInt(t.props.style.borderBottomLeftRadius),this.borderTopWidth=parseInt(t.props.style.borderTopWidth),this.borderBottomWidth=parseInt(t.props.style.borderBottomWidth),this.borderLeftWidth=parseInt(t.props.style.borderLeftWidth),this.borderRightWidth=parseInt(t.props.style.borderRightWidth),this.borderColor=t.props.style.borderColor;const o=t.props.background;if(this.isBackgroundImage="images"===o?.type,this.noResponsive=!!t.props.noResponsive,this.modalable=!!t.props.modalable,this.modalName=t.props.modalName||"",this.popupTrigger=t.props.popupTrigger||"button",this.popupDelay=null==t.props.popupDelay?3:t.props.popupDelay,this._rebuildTabs(),this.isBackgroundImage){const t=o.properties;this.backgroundAttachment=t.style.backgroundAttachment,this.backgroundPosition=t.style.backgroundPosition,this.backgroundRepeat=t.style.backgroundRepeat,this.backgroundSize=t.style.backgroundSize}this.backgroundInstance=o,this.backgroundVideo=o?.properties?.src||o?.properties?.url||"";const r=t.element,i=window.getComputedStyle(r);this.maxWidth=parseInt(i.width),this.width=parseInt(e.width,10)||this.maxWidth,this.background=e.background||e.backgroundImage||i.backgroundColor,e.backgroundImage&&(this.background=`url(${e.backgroundImage})`),this.padding={topValue:parseInt(i.paddingTop),bottomValue:parseInt(i.paddingBottom),leftValue:parseInt(i.paddingLeft),rightValue:parseInt(i.paddingRight)},this.margin={topValue:parseInt(i.marginTop),bottomValue:parseInt(i.marginBottom)}}}changeTab(t){this.tabName=t.target.value}_toggleModalable(t){this.modalable=t,a.Ay.store().execCommand("modalable",this.modalable),this.tabName=t?"popup":"style",this._rebuildTabs()}_rebuildTabs(){const t=i.M.get("config","channel"),e="web"===t&&this.modalable,o=[{text:"background"},{text:"style"},..."web"===t?[{text:"animations"}]:[],{text:"settings"},...e?[{text:"popup"}]:[]];let r=this.tabName;o.some(t=>t.text===r)||(r=e?"popup":"style"),o.forEach(t=>t.selected=t.text===r),this.tabName=r,this.tabs=o}_setModalName(t){this.modalName=t,a.Ay.store().execCommand("modalName",t)}_setPopupTrigger(t){this.popupTrigger=t,a.Ay.store().execCommand("popupTrigger",t)}_setPopupDelay(t){const e=Math.max(0,parseInt(t,10)||0);this.popupDelay=e,a.Ay.store().execCommand("popupDelay",e)}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.shadowRoot.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded})}render(){const t=i.M.get("config","channel");return r.qy`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1260],{91260(t,e,o){o.r(e),o.d(e,{BlockEditor:()=>g});var r=o(59929),i=o(86319),n=o(36565),a=o(49937),s=o(83235);const d=JSON.parse('["3g2","3gp","aaf","asf","avchd","avi","drc","flv","m2v","m3u8","m4p","m4v","mkv","mng","mov","mp2","mp4","mpe","mpeg","mpg","mpv","mxf","nsv","ogg","ogv","qt","rm","rmvb","roq","svi","vob","webm","wmv","yuv"]');var l=o(9334),c=o(96374);const p=[{id:"video-background",name:"video",thumb:"https://i.ytimg.com/vi/RhlQvbvMg-0/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLCKBaHlpHj3ghOXWjB2br9kHjPg7w",group:["section-component"],type:"video",preset:{installed:!1,component:"cdtr-background-video",properties:{type:"video",url:"https://www.youtube.com/watch?v=RhlQvbvMg-0",loop:!0,volume:0,controls:0,muted:!0,playing:!0,config:{playerVars:{showinfo:0,controls:0,playsinline:0}},style:{zIndex:0,width:window.innerWidth+500,height:window.innerWidth-560,pointerEvents:"none",transform:"translate(-10%,-0%)"}}}},{id:"images-background",name:"some-images",thumb:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg",group:["section-component"],type:"images",preset:{tags:[],installed:!1,type:"images",component:"cdtr-images-preset",properties:{src:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg,https://images.pexels.com/photos/1408221/pexels-photo-1408221.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",style:{backgroundAttachment:"local",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}}}];o(12258),o(15155);o.e(4217).then(o.bind(o,94217));class g extends r.WF{constructor(t){super(),this.onChangeBakgroundExpanding=t=>{const e=t.target.checked;n.Ay.store().execCommand("expand_image_for_outlook",!e)},this.getInnerBlocks=()=>{const t=[],e=this.component.parent();return e&&"section"===e.type?(e.children.forEach(e=>{const o=i.M.get("components",e);o&&"block"===o.type&&t.push(o)}),t):[this.component]},this.onChangeWidth=this.onChangeWidth.bind(this),this.getInnerBlocks=this.getInnerBlocks.bind(this),this.isBackgroundImage=!1,this.backgroundVideo="",this.galleryOpened=!1,this._sectionsExpanded=!1,this.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this);const e=i.M.get("config","channel");this.tabs=[{text:"style",selected:!0},..."web"===e?[{text:"animations"}]:[],{text:"settings"}],this.tabName="style",this.maxWidth=0,this.background="",this.padding={topValue:0,bottomValue:0,leftValue:0,rightValue:0},this.margin={topValue:0,bottomValue:0},this.borderStyle="solid",this.borderWidth=0,this.borderColor="#000",this.theme=i.M.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{n.Ay.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,n.Ay.store().execCommand("noResponsive",this.noResponsive)},onChangeBorderStyle:t=>{this.borderStyle=t.target.borderStyle||"",this.borderWidth=t.target.borderWidth||1,this.borderColor=t.target.borderColor||"#000",this.borderRadius=t.target.borderRadius||0;t.target.json;n.Ay.store().execCommand("style",{borderStyle:this.borderStyle,borderColor:this.borderColor,borderTopWidth:t.target.borderTopWidth||"0px",borderBottomWidth:t.target.borderBottomWidth||"0px",borderLeftWidth:t.target.borderLeftWidth||"0px",borderRightWidth:t.target.borderRightWidth||"0px",borderTopRightRadius:parseInt(t.target.borderTopRightRadius||0)+"px",borderTopLeftRadius:parseInt(t.target.borderTopLeftRadius||0)+"px",borderBottomRightRadius:parseInt(t.target.borderBottomRightRadius||0)+"px",borderBottomLeftRadius:parseInt(t.target.borderBottomLeftRadius||0)+"px",borderRadius:null})},onRemoveBackgroundVideo:()=>{this.backgroundVideo="",this.backgroundInstance={},n.Ay.store().execCommand("background","transparent")},onRemoveBackground:()=>{this.background="",this.backgroundVideo="",this.backgroundInstance={},n.Ay.store().execCommand("background",null),n.Ay.store().execCommand("style",{background:"",backgroundColor:null,backgroundImage:null})},onChangeBackgroundVideo:t=>{const e=t.target.value;let o;if((0,s.A)(e)){const t=p.find(t=>"images"===t.type);t.preset.properties.src=e,o=t.preset}else if(function(t){const e=(/(?:\.([^.]+))?$/.exec(t.toLowerCase())??[])[1]??"";return-1!==d.findIndex(t=>t===e)}(e));else if(function(t){if(t&&t.match(/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return!0;return!1}(e)){const t=p.find(t=>"video"===t.type);t.preset.properties.url=e,delete t.preset.properties.videoPath,o=t.preset}o&&(n.Ay.store().execCommand("background",JSON.parse(JSON.stringify(o))),n.Ay.store().execCommand("style",{background:null})),this.backgroundVideo=e},onChangeImage:t=>{const e=t.detail,o=[];Array.isArray(e)?e.forEach(t=>o.push(t.src)):o.push(e.src),this.cmds.onChangeBackgroundVideo({target:{value:o.join(",")}}),this.galleryOpened=!1},onChangeHeight:t=>{const e=t.target.value;n.Ay.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,o=t.target.direction;"all"===o?(n.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):n.Ay.store().execCommand("style",{[(0,l.A)(`margin-${o.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,o=t.target.direction,r=(0,l.A)(`padding-${o.toLowerCase()}`);"all"===o?(n.Ay.store().execCommand("style",{padding:null,"padding-top":null,"padding-bottom":null,"padding-left":null,"padding-right":null,paddingTop:e+"px",paddingBottom:e+"px",paddingLeft:e+"px",paddingRight:e+"px","padding-right":null,"padding-left":null,"padding-top":null,"padding-bottom":null}),this.padding={topValue:e,bottomValue:e,leftValue:e,rightValue:e}):(n.Ay.store().execCommand("style",{[r]:e+"px",[`padding-${o.toLowerCase()}`]:null}),this.props.style={[r]:e+"px"},this[`padding${o.toLowerCase()}`]=e)},onChangebackground(t){const e=t.target.value;this.background=e;n.Ay.components.forEach(t=>{const o=t.find("text");if(o&&!o.closest("card")){let t=o.tiptap.getAttributes("textStyle").color;if(!t){const e=o.element.querySelector("p,h1,h2,h3,h4,h5,h6");e&&(t=window.getComputedStyle(e).color)}if(t){if("transparent"===t)return;if(!t.includes("var(--")&&!e.includes("var(--")&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e&&"rgb(0, 0, 0)"!==e){const r=(0,c.w)(t,e);o.tiptap.chain().selectAll().setColor(r).run()}}}}),n.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==i.M.get("config","channel")&&n.Ay.store().execCommand("background",null)}}}onChangeImageBackgroundProp(t){const e=t.detail,{key:o,value:r}=e;if(this.props.background){const t=JSON.parse(JSON.stringify(this.props.background)),e=t.properties;if(!e.style[o])throw new Error(`${o} is not a valid property`);e.style[o]=r,n.Ay.store().execCommand("background",t)}}connectedCallback(){super.connectedCallback(),this.connectWith(),n.Ay.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),n.Ay.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const o=this.getInnerBlocks();n.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...o]}),this.maxWidth=e}connectWith(){const t=n.Ay.components[n.Ay.components.length-1];if(this.component=t,t&&"block"===t.type){this.props=t.props;let{style:e}=this.props;e||(e={}),t.props||(t.props={}),t.props.style||(t.props.style={}),this.expand_image_for_outlook=!!t.props.expand_image_for_outlook,this.boxShadow=t.props.style.boxShadow,this.borderStyle=t.props.style.borderStyle,this.borderWidth=t.props.style.borderWidth,this.borderTopRightRadius=parseInt(t.props.style.borderTopRightRadius),this.borderTopLeftRadius=parseInt(t.props.style.borderTopLeftRadius),this.borderBottomRightRadius=parseInt(t.props.style.borderBottomRightRadius),this.borderBottomLeftRadius=parseInt(t.props.style.borderBottomLeftRadius),this.borderTopWidth=parseInt(t.props.style.borderTopWidth),this.borderBottomWidth=parseInt(t.props.style.borderBottomWidth),this.borderLeftWidth=parseInt(t.props.style.borderLeftWidth),this.borderRightWidth=parseInt(t.props.style.borderRightWidth),this.borderColor=t.props.style.borderColor;const o=t.props.background;if(this.isBackgroundImage="images"===o?.type,this.noResponsive=!!t.props.noResponsive,this.modalable=!!t.props.modalable,this.modalName=t.props.modalName||"",this.popupTrigger=t.props.popupTrigger||"button",this.popupDelay=null==t.props.popupDelay?3:t.props.popupDelay,this._rebuildTabs(),this.isBackgroundImage){const t=o.properties;this.backgroundAttachment=t.style.backgroundAttachment,this.backgroundPosition=t.style.backgroundPosition,this.backgroundRepeat=t.style.backgroundRepeat,this.backgroundSize=t.style.backgroundSize}this.backgroundInstance=o,this.backgroundVideo=o?.properties?.src||o?.properties?.url||"";const r=t.element,i=window.getComputedStyle(r);this.maxWidth=parseInt(i.width),this.width=parseInt(e.width,10)||this.maxWidth,this.background=e.background||e.backgroundImage||i.backgroundColor,e.backgroundImage&&(this.background=`url(${e.backgroundImage})`),this.padding={topValue:parseInt(i.paddingTop),bottomValue:parseInt(i.paddingBottom),leftValue:parseInt(i.paddingLeft),rightValue:parseInt(i.paddingRight)},this.margin={topValue:parseInt(i.marginTop),bottomValue:parseInt(i.marginBottom)}}}changeTab(t){this.tabName=t.target.value}_toggleModalable(t){this.modalable=t,n.Ay.store().execCommand("modalable",this.modalable),this.tabName=t?"popup":"style",this._rebuildTabs()}_rebuildTabs(){const t=i.M.get("config","channel"),e="web"===t&&this.modalable,o=[{text:"style"},..."web"===t?[{text:"animations"}]:[],{text:"settings"},...e?[{text:"popup"}]:[]];let r=this.tabName;o.some(t=>t.text===r)||(r=e?"popup":"style"),o.forEach(t=>t.selected=t.text===r),this.tabName=r,this.tabs=o}_setModalName(t){this.modalName=t,n.Ay.store().execCommand("modalName",t)}_setPopupTrigger(t){this.popupTrigger=t,n.Ay.store().execCommand("popupTrigger",t)}_setPopupDelay(t){const e=Math.max(0,parseInt(t,10)||0);this.popupDelay=e,n.Ay.store().execCommand("popupDelay",e)}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.shadowRoot.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded})}_hasBackground(){if(this.backgroundInstance&&this.backgroundInstance.component)return!0;const t=(this.background||"").trim();return!!t&&"transparent"!==t&&"rgba(0, 0, 0, 0)"!==t&&"none"!==t}render(){const t=i.M.get("config","channel");return r.qy`
2
2
  <cdtr-editor-tabs .tabs=${this.tabs} @tabChanged=${this.changeTab}>
3
3
  <div slot="content">
4
4
  <div style="display:flex;justify-content:flex-start;padding:12px 16px 4px;">
@@ -15,7 +15,7 @@
15
15
  </svg>
16
16
  </span>
17
17
  </div>
18
- ${"background"===this.tabName?r.qy`
18
+ ${"style"===this.tabName?r.qy`
19
19
  <cdtr-editor-section label="backgroundColor" .open=${!0}>
20
20
  <cdtr-color-swatch-group
21
21
  .columns=${1}
@@ -33,7 +33,7 @@
33
33
  ></lang-text></paper-button>
34
34
  <paper-button
35
35
  class="backgrounds"
36
- @click=${()=>n.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:a.Ay.components[0]})}
36
+ @click=${()=>a.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:n.Ay.components[0]})}
37
37
  ><lang-text
38
38
  text="backgrounds"
39
39
  ></lang-text></paper-button>
@@ -46,6 +46,11 @@
46
46
  backgroundSize=${this.backgroundSize}
47
47
  @change=${this.onChangeImageBackgroundProp}
48
48
  ></background-editor-plugin>`:null}
49
+ ${this._hasBackground()?r.qy`<paper-button
50
+ style="font-size:12px;padding:0;margin-top:8px;text-align:var(--text-align-locale);direction:var(--direction-locale);justify-content:flex-start;color:red;text-transform:none;"
51
+ @click=${this.cmds.onRemoveBackground}
52
+ ><lang-text text="remove_background"></lang-text
53
+ ></paper-button>`:null}
49
54
  </cdtr-editor-section>
50
55
 
51
56
  <cdtr-editor-section label="add_urlAddress_from_media_site" .open=${!1}>
@@ -79,13 +84,6 @@
79
84
  </h6>
80
85
  </cdtr-editor-section>`:null}
81
86
  ${"style"===this.tabName?r.qy`
82
- <cdtr-editor-section label="backgroundColor" .open=${!0}>
83
- <cdtr-color-swatch-group
84
- .columns=${1}
85
- .items=${[{title:"backgroundColor",allowGradient:"web"===t,value:this.background||"#ffffff",onChange:t=>this.cmds.onChangebackground(t)}]}
86
- ></cdtr-color-swatch-group>
87
- </cdtr-editor-section>
88
-
89
87
  <cdtr-editor-section label="width" .open=${!0}>
90
88
  <cdtr-width-editor
91
89
  text="width"
@@ -297,7 +295,7 @@
297
295
  paper-button.backgrounds:hover {
298
296
  background: #eaeaed;
299
297
  }
300
- `,g.properties={maxWidth:{type:Number},backgroundInstance:{type:Object},padding:{type:Object},margin:{type:Object},tabs:{type:Array},tabName:{type:String},galleryOpened:{type:Boolean},backgroundVideo:{type:String,reflect:!0},isBackgroundImage:{type:Boolean},backgroundAttachment:{type:String},backgroundPosition:{type:String},backgroundRepeat:{type:String},backgroundSize:{type:String},noResponsive:{type:Boolean},modalable:{type:Boolean},modalName:{type:String},popupTrigger:{type:String},popupDelay:{type:Number},borderStyle:{type:String},borderWidth:{type:Number},borderColor:{type:String},borderTopRightRadius:{type:Number},borderTopLeftRadius:{type:Number},borderBottomRightRadius:{type:Number},borderBottomLeftRadius:{type:Number},borderTopWidth:{type:Number},borderBottomWidth:{type:Number},borderLeftWidth:{type:Number},borderRightWidth:{type:Number},_sectionsExpanded:{type:Boolean,state:!0}},customElements.define("block-editor",g)},15155(t,e,o){o.d(e,{A:()=>n});var r=o(59929),i=o(57176);class a extends r.WF{constructor(){super(),this.items=[],this.columns=2}async openPicker(t){const e=this.shadowRoot.querySelector(`#picker-${t}`);if(!e)return;await e.updateComplete;const o=e.shadowRoot?.querySelector("color-playground");if(o)if(await o.updateComplete,"function"==typeof o.openColorpicker)o.openColorpicker();else{(o.shadowRoot?.querySelector('[role="button"]')||o.shadowRoot?.querySelector("div")||o).click()}}render(){const t=1===this.columns?"grid single-col":"grid";return r.qy`
298
+ `,g.properties={maxWidth:{type:Number},backgroundInstance:{type:Object},padding:{type:Object},margin:{type:Object},tabs:{type:Array},tabName:{type:String},galleryOpened:{type:Boolean},backgroundVideo:{type:String,reflect:!0},isBackgroundImage:{type:Boolean},backgroundAttachment:{type:String},backgroundPosition:{type:String},backgroundRepeat:{type:String},backgroundSize:{type:String},noResponsive:{type:Boolean},modalable:{type:Boolean},modalName:{type:String},popupTrigger:{type:String},popupDelay:{type:Number},borderStyle:{type:String},borderWidth:{type:Number},borderColor:{type:String},borderTopRightRadius:{type:Number},borderTopLeftRadius:{type:Number},borderBottomRightRadius:{type:Number},borderBottomLeftRadius:{type:Number},borderTopWidth:{type:Number},borderBottomWidth:{type:Number},borderLeftWidth:{type:Number},borderRightWidth:{type:Number},_sectionsExpanded:{type:Boolean,state:!0}},customElements.define("block-editor",g)},15155(t,e,o){o.d(e,{A:()=>a});var r=o(59929),i=o(57176);class n extends r.WF{constructor(){super(),this.items=[],this.columns=2}async openPicker(t){const e=this.shadowRoot.querySelector(`#picker-${t}`);if(!e)return;await e.updateComplete;const o=e.shadowRoot?.querySelector("color-playground");if(o)if(await o.updateComplete,"function"==typeof o.openColorpicker)o.openColorpicker();else{(o.shadowRoot?.querySelector('[role="button"]')||o.shadowRoot?.querySelector("div")||o).click()}}render(){const t=1===this.columns?"grid single-col":"grid";return r.qy`
301
299
  <div class="${t}">
302
300
  ${(this.items||[]).map((t,e)=>r.qy`
303
301
  <div class="swatch-item" @click=${()=>this.openPicker(e)}>
@@ -321,7 +319,7 @@
321
319
  </div>
322
320
  `)}
323
321
  </div>
324
- `}}a.styles=[i.L,r.AH`
322
+ `}}n.styles=[i.L,r.AH`
325
323
  :host {
326
324
  display: block;
327
325
  direction: var(--direction-locale, ltr);
@@ -369,12 +367,12 @@
369
367
  clip: rect(0,0,0,0);
370
368
  pointer-events: none;
371
369
  }
372
- `],a.properties={items:{type:Array},columns:{type:Number}},customElements.define("cdtr-color-swatch-group",a);const n=t=>r.qy`
370
+ `],n.properties={items:{type:Array},columns:{type:Number}},customElements.define("cdtr-color-swatch-group",n);const a=t=>r.qy`
373
371
  <cdtr-color-swatch-group
374
372
  .items=${t.items}
375
373
  .columns=${t.columns||2}
376
374
  ></cdtr-color-swatch-group>
377
- `},12258(t,e,o){o.d(e,{A:()=>n});var r=o(59929),i=o(40648);class a extends r.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,i.Q)(this.persistKey,this.open)}render(){return r.qy`
375
+ `},12258(t,e,o){o.d(e,{A:()=>a});var r=o(59929),i=o(40648);class n extends r.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,i.Q)(this.persistKey,this.open)}render(){return r.qy`
378
376
  <div class="section">
379
377
  <div class="header" @click=${this.toggle}>
380
378
  <span class="title"><lang-text text="${this.label}"></lang-text></span>
@@ -388,7 +386,7 @@
388
386
  </div>
389
387
  </div>
390
388
  </div>
391
- `}}a.styles=r.AH`
389
+ `}}n.styles=r.AH`
392
390
  :host {
393
391
  display: block;
394
392
  direction: var(--direction-locale, ltr);
@@ -436,7 +434,7 @@
436
434
  .content-inner {
437
435
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
438
436
  }
439
- `,a.properties={label:{type:String},open:{type:Boolean},persistKey:{type:String}},customElements.define("cdtr-editor-section",a);const n=(t,e)=>r.qy`
437
+ `,n.properties={label:{type:String},open:{type:Boolean},persistKey:{type:String}},customElements.define("cdtr-editor-section",n);const a=(t,e)=>r.qy`
440
438
  <cdtr-editor-section
441
439
  .label=${t.label}
442
440
  .open=${!1!==t.open}
@@ -444,4 +442,4 @@
444
442
  >
445
443
  ${e}
446
444
  </cdtr-editor-section>
447
- `},40648(t,e,o){o.d(e,{Q:()=>n,i:()=>a});const r="cdtr:section-open";function i(){try{const t=localStorage.getItem(r);return t?JSON.parse(t):{}}catch(t){return{}}}function a(t){if(!t)return;const e=i();return Object.prototype.hasOwnProperty.call(e,t)?!!e[t]:void 0}function n(t,e){if(!t)return;const o=i();o[t]=!!e,function(t){try{localStorage.setItem(r,JSON.stringify(t))}catch(t){}}(o)}}}]);
445
+ `},40648(t,e,o){o.d(e,{Q:()=>a,i:()=>n});const r="cdtr:section-open";function i(){try{const t=localStorage.getItem(r);return t?JSON.parse(t):{}}catch(t){return{}}}function n(t){if(!t)return;const e=i();return Object.prototype.hasOwnProperty.call(e,t)?!!e[t]:void 0}function a(t,e){if(!t)return;const o=i();o[t]=!!e,function(t){try{localStorage.setItem(r,JSON.stringify(t))}catch(t){}}(o)}}}]);
Binary file
@@ -1,6 +1,6 @@
1
1
  "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,o){o.r(e),o.d(e,{EditorTabs:()=>s});var i=o(59929),n=o(36565);o.e(7937).then(o.bind(o,67937));class s extends i.WF{constructor(){super(),this.onConnected=this.onConnected.bind(this),this.onArrowNavigation=this.onArrowNavigation.bind(this),this.tabs=[]}onClickItem(t){let{target:e}=t;const o=this.value=e.value,i=[...this.tabs],n=i.findIndex(t=>t.text===o);-1!==n&&(i.forEach(t=>{t.selected=!1}),i[n].selected=!0),this.tabs=i;const s=new UIEvent("tabChanged",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(s)}firstUpdated(){super.firstUpdated()}onConnected(t){let{name:e}=t;this.onClickItem({target:{value:e}})}onArrowNavigation(t){const{key:e,currentIcon:o}=t.detail,i=this.tabs.findIndex(t=>t.text===o);if(-1===i)return;let n=i;switch(e){case"ArrowUp":case"ArrowLeft":n=i>0?i-1:this.tabs.length-1;break;case"ArrowDown":case"ArrowRight":n=i<this.tabs.length-1?i+1:0;break;default:return}const s=this.tabs[n];s&&(this.onClickItem({target:{value:s.text}}),this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(`cdtr-editor-tab-item[icon="${s.text}"]`);t&&t.focus()}))}connectedCallback(){super.connectedCallback(),n.Ay.on("editor-tabs",this.onConnected)}disconnectedCallback(){super.disconnectedCallback(),n.Ay.off("editor-tabs",this.onConnected)}renderContent(){switch(this.value){case"animations":return o.e(3553).then(o.bind(o,3553)),i.qy`<cdtr-animations-editor>
2
2
  <cdtr-block-loader></cdtr-block-loader
3
- ></cdtr-animations-editor>`;case"settings":case"setting":return o.e(5340).then(o.bind(o,45340)),i.qy`<cdtr-setting-editor>
3
+ ></cdtr-animations-editor>`;case"settings":case"setting":return o.e(7654).then(o.bind(o,37654)),i.qy`<cdtr-setting-editor>
4
4
  <cdtr-block-loader></cdtr-block-loader
5
5
  ></cdtr-setting-editor>`;default:return i.qy`<slot name="content"></slot>`}}render(){return this.tabs.length>0&&!this.tabs.some(t=>t.selected)&&(this.tabs[0].selected=!0,this.value=this.tabs[0].text),i.qy`
6
6
  <div class="tabs-row" @arrow-navigation=${this.onArrowNavigation}>
Binary file
@@ -0,0 +1,157 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7654],{12258(e,t,o){o.d(t,{A:()=>i});var n=o(59929),s=o(40648);class r extends n.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,s.Q)(this.persistKey,this.open)}render(){return n.qy`
2
+ <div class="section">
3
+ <div class="header" @click=${this.toggle}>
4
+ <span class="title"><lang-text text="${this.label}"></lang-text></span>
5
+ <svg class="chevron ${this.open?"open":""}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
6
+ <polyline points="6 9 12 15 18 9"></polyline>
7
+ </svg>
8
+ </div>
9
+ <div class="content ${this.open?"open":""}">
10
+ <div class="content-inner">
11
+ <slot></slot>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ `}}r.styles=n.AH`
16
+ :host {
17
+ display: block;
18
+ direction: var(--direction-locale, ltr);
19
+ --editor-container-inline-padding: 0;
20
+ }
21
+ .section {
22
+ border-bottom: 1px solid var(--color-border);
23
+ }
24
+ .header {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: space-between;
28
+ padding: var(--space-3) var(--space-4);
29
+ cursor: pointer;
30
+ user-select: none;
31
+ }
32
+ .title {
33
+ font-size: var(--text-md);
34
+ font-weight: 600;
35
+ color: var(--color-text);
36
+ letter-spacing: 0.01em;
37
+ }
38
+ .chevron {
39
+ width: 16px;
40
+ height: 16px;
41
+ transition: transform var(--duration-normal) var(--ease-default), color var(--duration-fast) var(--ease-default);
42
+ color: var(--color-text-faint);
43
+ }
44
+ .header:hover .chevron {
45
+ color: var(--color-text-muted);
46
+ }
47
+ .chevron.open {
48
+ transform: rotate(180deg);
49
+ }
50
+ .content {
51
+ overflow: hidden;
52
+ transition: max-height var(--duration-normal) var(--ease-default), opacity var(--duration-fast) var(--ease-default);
53
+ max-height: 0;
54
+ opacity: 0;
55
+ }
56
+ .content.open {
57
+ max-height: 1200px;
58
+ opacity: 1;
59
+ }
60
+ .content-inner {
61
+ padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
62
+ }
63
+ `,r.properties={label:{type:String},open:{type:Boolean},persistKey:{type:String}},customElements.define("cdtr-editor-section",r);const i=(e,t)=>n.qy`
64
+ <cdtr-editor-section
65
+ .label=${e.label}
66
+ .open=${!1!==e.open}
67
+ .persistKey=${e.persistKey||""}
68
+ >
69
+ ${t}
70
+ </cdtr-editor-section>
71
+ `},40648(e,t,o){o.d(t,{Q:()=>i,i:()=>r});const n="cdtr:section-open";function s(){try{const e=localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return{}}}function r(e){if(!e)return;const t=s();return Object.prototype.hasOwnProperty.call(t,e)?!!t[e]:void 0}function i(e,t){if(!e)return;const o=s();o[e]=!!t,function(e){try{localStorage.setItem(n,JSON.stringify(e))}catch(e){}}(o)}},37654(e,t,o){o.r(t),o.d(t,{SettingEditor:()=>c});var n=o(59929),s=o(36565);o(12258);const r=n.JW`<path d="M4 16H20V5H4V16ZM13 18V20H17V22H7V20H11V18H2.99C2.44 18 2 17.55 2 17V4.01C2 3.45 2.46 3 2.99 3H21.01C21.56 3 22 3.45 22 4.01V17C22 17.55 21.54 18 21.01 18H13Z"/>`,i=n.JW`<path d="M4 6H20V18H4V6ZM2 5C2 4.45 2.45 4 3 4H21C21.55 4 22 4.45 22 5V19C22 19.55 21.55 20 21 20H3C2.45 20 2 19.55 2 19V5ZM17 11C17 11.55 17.45 12 18 12C18.55 12 19 11.55 19 11C19 10.45 18.55 10 18 10C17.45 10 17 10.45 17 11Z"/>`,a=n.JW`<path d="M7 4V20H17V4H7ZM6 2H18C18.55 2 19 2.45 19 3V21C19 21.55 18.55 22 18 22H6C5.45 22 5 21.55 5 21V3C5 2.45 5.45 2 6 2ZM12 17C12.55 17 13 17.45 13 18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18C11 17.45 11.45 17 12 17Z"/>`;class c extends n.WF{constructor(){super(),this.onInspect=this.onInspect.bind(this),this.name="",this.element_ID=" ",this.cmds={onToggleDisplayMode:(e,t)=>{s.Ay.store().execCommand(`show_on_${e}`,t),this[`show_on_${e}`]=t},onChangeElementID(e){s.Ay.store().execCommand("element_ID",e.target.value)},onChangeName(e){s.Ay.store().execCommand("name",e.target.value)}}}onInspect(){if(s.Ay.components.length>0){const e=s.Ay.components[0].props;this.show_on_desktop=!!e.show_on_desktop,this.show_on_tablet=!!e.show_on_tablet,this.show_on_mobile=!!e.show_on_mobile,this.name=e.name||"",this.element_ID=e.element_ID||""}}connectedCallback(){super.connectedCallback(),s.Ay.on("select",this.onInspect),s.Ay.on("update",this.onInspect),this.onInspect()}disconnectedCallback(){super.disconnectedCallback(),s.Ay.off("select",this.onInspect),s.Ay.off("update",this.onInspect)}render(){const e="block"===s.Ay.getSelectedComponent()[0].type;return n.qy`
72
+ ${e?n.qy`<cdtr-editor-section label="display_mode" .open=${!0}>
73
+ <div class="device-toggle-row">
74
+ <div
75
+ class="device-toggle-btn ${this.show_on_desktop?"active":""}"
76
+ @click=${()=>this.cmds.onToggleDisplayMode("desktop",!this.show_on_desktop)}
77
+ >
78
+ <svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${r}</svg>
79
+ <lang-text text="desktop"></lang-text>
80
+ </div>
81
+ <div
82
+ class="device-toggle-btn ${this.show_on_tablet?"active":""}"
83
+ @click=${()=>this.cmds.onToggleDisplayMode("tablet",!this.show_on_tablet)}
84
+ >
85
+ <svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${i}</svg>
86
+ <lang-text text="tablet"></lang-text>
87
+ </div>
88
+ <div
89
+ class="device-toggle-btn ${this.show_on_mobile?"active":""}"
90
+ @click=${()=>this.cmds.onToggleDisplayMode("mobile",!this.show_on_mobile)}
91
+ >
92
+ <svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${a}</svg>
93
+ <lang-text text="mobile"></lang-text>
94
+ </div>
95
+ </div>
96
+ </cdtr-editor-section>`:n.qy``}
97
+ <cdtr-editor-section label="properties" .open=${!0}>
98
+ <cdtr-row mt="1">
99
+ <cdtr-title><lang-text text="name"></lang-text></cdtr-title>
100
+ </cdtr-row>
101
+ <cdtr-row>
102
+ <cdtr-input
103
+ max="30"
104
+ @change=${this.cmds.onChangeName}
105
+ .value=${this.name}
106
+ style="width:100%"
107
+ ></cdtr-input>
108
+ </cdtr-row>
109
+ <cdtr-row mt="1">
110
+ <cdtr-title
111
+ ><lang-text text="ID_with_description"></lang-text
112
+ ></cdtr-title>
113
+ </cdtr-row>
114
+ <cdtr-row>
115
+ <cdtr-input
116
+ max="50"
117
+ @change=${this.cmds.onChangeElementID}
118
+ .value=${this.element_ID}
119
+ style="width:100%"
120
+ ></cdtr-input>
121
+ </cdtr-row>
122
+ </cdtr-editor-section>
123
+ `}}c.properties={name:{},element_ID:{},show_on_desktop:{},show_on_tablet:{},show_on_mobile:{}},c.styles=n.AH`
124
+ :host {
125
+ direction: var(--direction-locale);
126
+ }
127
+ .device-toggle-row {
128
+ display: flex;
129
+ gap: var(--space-2, 8px);
130
+ }
131
+ .device-toggle-btn {
132
+ display: flex;
133
+ align-items: center;
134
+ gap: var(--space-1, 4px);
135
+ padding: var(--space-2, 8px) var(--space-3, 12px);
136
+ border: none;
137
+ border-radius: var(--radius-sm, 6px);
138
+ cursor: pointer;
139
+ color: var(--color-text-faint, #bbb);
140
+ background: var(--color-bg-muted, #f4f4f6);
141
+ transition: background var(--duration-fast, 120ms) var(--ease-default, ease),
142
+ color var(--duration-fast, 120ms) var(--ease-default, ease);
143
+ font-size: var(--text-xs, 12px);
144
+ }
145
+ .device-toggle-btn:hover {
146
+ background: #eaeaed;
147
+ color: var(--color-text-muted, #888);
148
+ }
149
+ .device-toggle-btn svg {
150
+ fill: currentColor;
151
+ flex-shrink: 0;
152
+ }
153
+ .device-toggle-btn.active {
154
+ background: var(--color-primary-soft, rgba(99, 102, 241, 0.08));
155
+ color: var(--color-primary, #6366f1);
156
+ }
157
+ `,customElements.define("cdtr-setting-editor",c)}}]);
Binary file
@@ -1,17 +1,14 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7937],{67937(t,e,n){n.r(e),n.d(e,{EditorTabItem:()=>o});var i=n(59929);class o extends i.WF{constructor(){super()}focus(){const t=this.shadowRoot.querySelector(".tab-btn");t?t.focus():super.focus()}onClickItem(t){this.value=t,this.dispatchEvent(new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}))}handleKeyDown(t){if("Enter"===t.key||" "===t.key)return t.preventDefault(),t.stopPropagation(),void this.onClickItem(this.icon);["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("arrow-navigation",{detail:{key:t.key,currentIcon:this.icon},bubbles:!0,cancelable:!0})))}factory(){let t="fill:currentColor;color:inherit;width:18px;height:18px;";switch(this.icon){case"box-shadow":return n.e(1456).then(n.bind(n,11456)),i.qy`<cdtr-box-shadow-icon iconStyle=${t}></cdtr-box-shadow-icon>`;case"design":case"style":return n.e(9162).then(n.bind(n,59162)),i.qy`<cdtr-design-icon iconStyle=${t}></cdtr-design-icon>`;case"text":case"typography":return n.e(9089).then(n.bind(n,59089)),i.qy`<cdtr-text-icon iconStyle=${t}></cdtr-text-icon>`;case"animations":return n.e(9184).then(n.bind(n,29184)),i.qy`<cdtr-animation-icon iconStyle=${t}></cdtr-animation-icon>`;case"settings":return n.e(4114).then(n.bind(n,84114)),i.qy`<cdtr-setting-icon iconStyle=${t}></cdtr-setting-icon>`;case"qr":return i.qy`<img style="width:16px;height:16px;" alt="qr" width="16" height="16" src="https://img.creaditor.ai/images/qr?link=https%3A%2F%2Fexample.com&size=20" />`;case"link":case"interactions":return n.e(5428).then(n.bind(n,85428)),i.qy`<cdtr-link-icon iconStyle=${t}></cdtr-link-icon>`;case"spacing":return n.e(365).then(n.bind(n,50365)),i.qy`<cdtr-spacing-icon iconStyle=${t}></cdtr-spacing-icon>`;case"background":case"image":case"giphy":return n.e(1452).then(n.bind(n,61452)),i.qy`<cdtr-background-icon iconStyle=${t}></cdtr-background-icon>`;case"video":return n.e(7759).then(n.bind(n,97759)),i.qy`<cdtr-video-icon iconStyle=${t}></cdtr-video-icon>`;case"list-check":return n.e(6459).then(n.bind(n,16459)),i.qy`<cdtr-list-check-icon iconStyle=${t}></cdtr-list-check-icon>`;case"time":return n.e(307).then(n.bind(n,307)),i.qy`<cdtr-time-icon iconStyle=${t}></cdtr-time-icon>`;case"icons":return i.qy`<cdtr-icon icon="emoji" .width=${18} .height=${18} color="currentColor"></cdtr-icon>`;case"business":return i.qy`<cdtr-icon icon="business" .width=${18} .height=${18} color="currentColor"></cdtr-icon>`;case"modal":return i.qy`<cdtr-icon icon="page" .width=${18} .height=${18} color="currentColor"></cdtr-icon>`;case"popup":return i.qy`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM7 6H11V10H7V6ZM7 12H17V14H7V12ZM7 16H17V18H7V16ZM13 7H17V9H13V7Z"></path></svg>`;case"list-settings":return n.e(8676).then(n.bind(n,48676)),i.qy`<cdtr-list-settings-icon iconStyle=${t}></cdtr-list-settings-icon>`;case"automations":return n.e(8305).then(n.bind(n,58305)),i.qy`<cdtr-automation-icon iconStyle=${t}></cdtr-automation-icon>`;case"ai":return i.qy`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 20.25 21" preserveAspectRatio="xMidYMid meet">
2
- <defs><clippath id="ai-clip"><path d="M 0 0.375 L 19.527344 0.375 L 19.527344 19.902344 L 0 19.902344 Z" clip-rule="nonzero"></path></clippath></defs>
3
- <g clip-path="url(#ai-clip)"><path fill="#9747ff" d="M 12.316406 0.679688 C 12.160156 0.382812 11.734375 0.382812 11.574219 0.679688 L 11.132812 1.507812 C 11.09375 1.582031 11.035156 1.640625 10.960938 1.679688 L 10.128906 2.117188 C 9.828125 2.277344 9.828125 2.699219 10.128906 2.855469 L 10.960938 3.296875 C 11.035156 3.335938 11.09375 3.394531 11.132812 3.46875 L 11.574219 4.296875 C 11.734375 4.59375 12.160156 4.59375 12.316406 4.296875 L 12.757812 3.46875 C 12.800781 3.394531 12.859375 3.335938 12.933594 3.296875 L 13.765625 2.855469 C 14.0625 2.699219 14.0625 2.277344 13.765625 2.117188 L 12.933594 1.679688 C 12.859375 1.640625 12.800781 1.582031 12.757812 1.507812 Z M 15.167969 16.96875 L 16.875 17.617188 L 16.226562 15.917969 Z M 16.882812 13.496094 L 5.136719 1.816406 C 4.15625 0.839844 2.558594 0.839844 1.574219 1.816406 L 0.984375 2.40625 C 0 3.382812 0 4.96875 0.984375 5.949219 L 12.730469 17.625 C 12.929688 17.824219 13.273438 18.039062 13.542969 18.140625 L 17.152344 19.507812 C 18.167969 19.890625 19.164062 18.902344 18.777344 17.890625 L 17.402344 14.300781 C 17.300781 14.035156 17.085938 13.695312 16.882812 13.496094 Z M 15.316406 14.296875 L 5.730469 4.769531 L 3.953125 6.535156 L 13.535156 16.066406 Z M 3.949219 3 L 4.542969 3.585938 L 2.765625 5.355469 L 2.171875 4.765625 C 1.84375 4.441406 1.84375 3.910156 2.171875 3.585938 L 2.761719 3 C 3.089844 2.671875 3.621094 2.671875 3.949219 3 Z M 4.550781 12.996094 C 4.390625 12.699219 3.964844 12.699219 3.808594 12.996094 L 3 14.503906 C 2.960938 14.578125 2.902344 14.640625 2.828125 14.679688 L 1.308594 15.480469 C 1.011719 15.636719 1.011719 16.058594 1.308594 16.214844 L 2.828125 17.015625 C 2.902344 17.054688 2.960938 17.117188 3 17.191406 L 3.808594 18.699219 C 3.964844 18.996094 4.390625 18.996094 4.550781 18.699219 L 5.355469 17.191406 C 5.394531 17.117188 5.453125 17.054688 5.527344 17.015625 L 7.046875 16.214844 C 7.34375 16.058594 7.34375 15.636719 7.046875 15.480469 L 5.527344 14.679688 C 5.453125 14.640625 5.394531 14.578125 5.355469 14.503906 Z M 17.355469 5.480469 C 17.199219 5.183594 16.773438 5.183594 16.613281 5.480469 L 16.027344 6.582031 C 15.988281 6.65625 15.929688 6.714844 15.855469 6.753906 L 14.746094 7.335938 C 14.449219 7.496094 14.449219 7.917969 14.746094 8.074219 L 15.855469 8.660156 C 15.929688 8.699219 15.988281 8.757812 16.027344 8.832031 L 16.613281 9.933594 C 16.773438 10.230469 17.199219 10.230469 17.355469 9.933594 L 17.945312 8.832031 C 17.984375 8.757812 18.042969 8.699219 18.117188 8.660156 L 19.226562 8.074219 C 19.523438 7.917969 19.523438 7.496094 19.226562 7.335938 L 18.117188 6.753906 C 18.042969 6.714844 17.984375 6.65625 17.945312 6.582031 Z" fill-opacity="1" fill-rule="evenodd"></path></g>
4
- </svg>`;default:return null}}render(){return i.qy`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7937],{67937(e,t,o){o.r(t),o.d(t,{EditorTabItem:()=>a});var n=o(59929);class a extends n.WF{focus(){const e=this.shadowRoot.querySelector(".tab-btn");e?e.focus():super.focus()}onClickItem(e){this.value=e,this.dispatchEvent(new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}))}handleKeyDown(e){if("Enter"===e.key||" "===e.key)return e.preventDefault(),e.stopPropagation(),void this.onClickItem(this.icon);["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent("arrow-navigation",{detail:{key:e.key,currentIcon:this.icon},bubbles:!0,cancelable:!0})))}render(){return n.qy`
5
2
  <button
6
3
  class="tab-btn ${this.selected?"selected":""}"
7
4
  data-icon="${this.icon}"
8
5
  tabindex="0"
9
- @keydown=${t=>this.handleKeyDown(t)}
6
+ @keydown=${e=>this.handleKeyDown(e)}
10
7
  @click=${()=>this.onClickItem(this.icon)}
11
8
  >
12
9
  <span class="label"><lang-text text="${this.icon}"></lang-text></span>
13
10
  </button>
14
- `}}o.styles=i.AH`
11
+ `}}a.styles=n.AH`
15
12
  :host {
16
13
  display: block;
17
14
  }
@@ -51,4 +48,4 @@
51
48
  color: var(--color-primary, #6366f1);
52
49
  font-weight: 600;
53
50
  }
54
- `,o.properties={icon:{},labelMode:{},selected:{}},customElements.define("cdtr-editor-tab-item",o)}}]);
51
+ `,a.properties={icon:{},selected:{}},customElements.define("cdtr-editor-tab-item",a)}}]);
Binary file