@creaditor/web-starterkit 1.0.22 → 1.0.23

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.
Files changed (65) hide show
  1. package/dist/1260.creaditor.bundle.js +55 -41
  2. package/dist/1260.creaditor.bundle.js.gz +0 -0
  3. package/dist/1271.creaditor.bundle.js +469 -364
  4. package/dist/1271.creaditor.bundle.js.gz +0 -0
  5. package/dist/1334.creaditor.bundle.js +1 -1
  6. package/dist/1334.creaditor.bundle.js.gz +0 -0
  7. package/dist/170.creaditor.bundle.js +15 -15
  8. package/dist/170.creaditor.bundle.js.gz +0 -0
  9. package/dist/2590.creaditor.bundle.js +1 -1
  10. package/dist/2590.creaditor.bundle.js.gz +0 -0
  11. package/dist/271.creaditor.bundle.js +6 -6
  12. package/dist/271.creaditor.bundle.js.gz +0 -0
  13. package/dist/3521.creaditor.bundle.js +2 -2
  14. package/dist/3521.creaditor.bundle.js.gz +0 -0
  15. package/dist/3553.creaditor.bundle.js +1 -1
  16. package/dist/3553.creaditor.bundle.js.gz +0 -0
  17. package/dist/3606.creaditor.bundle.js +12 -4
  18. package/dist/3606.creaditor.bundle.js.gz +0 -0
  19. package/dist/3932.creaditor.bundle.js +4 -4
  20. package/dist/3932.creaditor.bundle.js.gz +0 -0
  21. package/dist/4186.creaditor.bundle.js +5 -1
  22. package/dist/4186.creaditor.bundle.js.gz +0 -0
  23. package/dist/453.creaditor.bundle.js +8 -6
  24. package/dist/453.creaditor.bundle.js.gz +0 -0
  25. package/dist/4762.creaditor.bundle.js +1 -1
  26. package/dist/4762.creaditor.bundle.js.gz +0 -0
  27. package/dist/5133.creaditor.bundle.js +3 -3
  28. package/dist/5133.creaditor.bundle.js.gz +0 -0
  29. package/dist/567.creaditor.bundle.js +469 -364
  30. package/dist/567.creaditor.bundle.js.gz +0 -0
  31. package/dist/5849.creaditor.bundle.js +2 -2
  32. package/dist/5849.creaditor.bundle.js.gz +0 -0
  33. package/dist/5909.creaditor.bundle.js +33 -30
  34. package/dist/5909.creaditor.bundle.js.gz +0 -0
  35. package/dist/5926.creaditor.bundle.js +74 -13
  36. package/dist/5926.creaditor.bundle.js.gz +0 -0
  37. package/dist/638.creaditor.bundle.js +1 -1
  38. package/dist/638.creaditor.bundle.js.gz +0 -0
  39. package/dist/7209.creaditor.bundle.js +1 -1
  40. package/dist/7209.creaditor.bundle.js.gz +0 -0
  41. package/dist/752.creaditor.bundle.js +6 -4
  42. package/dist/752.creaditor.bundle.js.gz +0 -0
  43. package/dist/7654.creaditor.bundle.js +37 -14
  44. package/dist/7654.creaditor.bundle.js.gz +0 -0
  45. package/dist/7997.creaditor.bundle.js +1 -1
  46. package/dist/7997.creaditor.bundle.js.gz +0 -0
  47. package/dist/8443.creaditor.bundle.js +1 -1
  48. package/dist/8443.creaditor.bundle.js.gz +0 -0
  49. package/dist/8547.creaditor.bundle.js +125 -108
  50. package/dist/8547.creaditor.bundle.js.gz +0 -0
  51. package/dist/8570.creaditor.bundle.js +3 -3
  52. package/dist/8570.creaditor.bundle.js.gz +0 -0
  53. package/dist/8854.creaditor.bundle.js +4 -4
  54. package/dist/8854.creaditor.bundle.js.gz +0 -0
  55. package/dist/8916.creaditor.bundle.js +3 -1
  56. package/dist/8916.creaditor.bundle.js.gz +0 -0
  57. package/dist/9041.creaditor.bundle.js +1 -1
  58. package/dist/9041.creaditor.bundle.js.gz +0 -0
  59. package/dist/9250.creaditor.bundle.js +1 -1
  60. package/dist/9250.creaditor.bundle.js.gz +0 -0
  61. package/dist/creaditor.bundle.js +192 -181
  62. package/dist/creaditor.bundle.js.gz +0 -0
  63. package/dist/service-worker.js +1 -1
  64. package/dist/service-worker.js.gz +0 -0
  65. package/package.json +1 -1
@@ -1,29 +1,15 @@
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:"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")},onRemoveBackground:()=>{this.background="",this.backgroundVideo="",this.backgroundInstance={},a.Ay.store().execCommand("background",null),a.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&&(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:"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})}_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`
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),a=o(86319),i=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;i.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=a.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.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this);const e=a.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=a.M.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{i.Ay.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,i.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;i.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={},i.Ay.store().execCommand("background","transparent")},onRemoveBackground:()=>{this.background="",this.backgroundVideo="",this.backgroundInstance={},i.Ay.store().execCommand("background",null),i.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&&(i.Ay.store().execCommand("background",JSON.parse(JSON.stringify(o))),i.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;i.Ay.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,o=t.target.direction;"all"===o?(i.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):i.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?(i.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}):(i.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;i.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()}}}}),i.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==a.M.get("config","channel")&&i.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,i.Ay.store().execCommand("background",t)}}connectedCallback(){super.connectedCallback(),this.connectWith(),i.Ay.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),i.Ay.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const o=this.getInnerBlocks();i.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...o]}),this.maxWidth=e}connectWith(){const t=i.Ay.components[i.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,a=window.getComputedStyle(r);this.maxWidth=parseInt(a.width),this.width=parseInt(e.width,10)||this.maxWidth,this.background=e.background||e.backgroundImage||a.backgroundColor,e.backgroundImage&&(this.background=`url(${e.backgroundImage})`),this.padding={topValue:parseInt(a.paddingTop),bottomValue:parseInt(a.paddingBottom),leftValue:parseInt(a.paddingLeft),rightValue:parseInt(a.paddingRight)},this.margin={topValue:parseInt(a.marginTop),bottomValue:parseInt(a.marginBottom)}}}changeTab(t){this.tabName=t.target.value}_toggleModalable(t){this.modalable=t,i.Ay.store().execCommand("modalable",this.modalable),this.tabName=t?"popup":"style",this._rebuildTabs()}_rebuildTabs(){const t=a.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,i.Ay.store().execCommand("modalName",t)}_setPopupTrigger(t){this.popupTrigger=t,i.Ay.store().execCommand("popupTrigger",t)}_setPopupDelay(t){const e=Math.max(0,parseInt(t,10)||0);this.popupDelay=e,i.Ay.store().execCommand("popupDelay",e)}_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=a.M.get("config","channel");return r.qy`
2
2
  <cdtr-editor-tabs .tabs=${this.tabs} @tabChanged=${this.changeTab}>
3
3
  <div slot="content">
4
- <div style="display:flex;justify-content:flex-start;padding:12px 16px 4px;">
5
- <span
6
- @click=${()=>this._onToggleAll()}
7
- @mouseover=${t=>{t.currentTarget.style.color="#333",t.currentTarget.style.textDecoration="underline"}}
8
- @mouseout=${t=>{t.currentTarget.style.color="#555",t.currentTarget.style.textDecoration="none"}}
9
- style="display:inline-flex;align-items:center;gap:3px;font-size:12px;color:#555;cursor:pointer;font-family:inherit;"
10
- >
11
- <lang-text text=${this._sectionsExpanded?"collapse_all":"expand_all"}></lang-text>
12
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
13
- <polyline points="7 8 12 3 17 8"></polyline>
14
- <polyline points="7 16 12 21 17 16"></polyline>
15
- </svg>
16
- </span>
17
- </div>
18
4
  ${"style"===this.tabName?r.qy`
19
- <cdtr-editor-section label="backgroundColor" .open=${!0}>
5
+ <cdtr-editor-section .label=${"backgroundColor"} .open=${!0}>
20
6
  <cdtr-color-swatch-group
21
7
  .columns=${1}
22
8
  .items=${[{title:"backgroundColor",allowGradient:"web"===t,value:this.background||"#ffffff",onChange:t=>this.cmds.onChangebackground(t)}]}
23
9
  ></cdtr-color-swatch-group>
24
10
  </cdtr-editor-section>
25
11
 
26
- <cdtr-editor-section label="backgrounds" .open=${!0}>
12
+ <cdtr-editor-section .label=${"backgrounds"} .open=${!0}>
27
13
  <div style="display:flex;gap:8px;">
28
14
  <paper-button
29
15
  class="gallery"
@@ -33,7 +19,7 @@
33
19
  ></lang-text></paper-button>
34
20
  <paper-button
35
21
  class="backgrounds"
36
- @click=${()=>n.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:a.Ay.components[0]})}
22
+ @click=${()=>n.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:i.Ay.components[0]})}
37
23
  ><lang-text
38
24
  text="backgrounds"
39
25
  ></lang-text></paper-button>
@@ -53,7 +39,7 @@
53
39
  ></paper-button>`:null}
54
40
  </cdtr-editor-section>
55
41
 
56
- <cdtr-editor-section label="add_urlAddress_from_media_site" .open=${!1}>
42
+ <cdtr-editor-section .label=${"add_urlAddress_from_media_site"} .open=${!1}>
57
43
  <cdtr-input
58
44
  .value="${this.backgroundVideo}"
59
45
  @input=${this.cmds.onChangeBackgroundVideo}
@@ -67,7 +53,12 @@
67
53
  ></paper-button>`:null}
68
54
  </cdtr-editor-section>
69
55
 
70
- <cdtr-editor-section label="settings" .open=${!1}>
56
+ <!-- Distinct from the "layout_behavior" section further down:
57
+ this one is strictly about how the background renders in
58
+ email clients. Both used to be labelled "settings", which
59
+ read as a duplicate and gave the two groups the same
60
+ persistence key shape. -->
61
+ <cdtr-editor-section .label=${"email_compatibility"} .open=${!1}>
71
62
  <cdtr-checkbox
72
63
  @change=${t=>this.onChangeBakgroundExpanding(t)}
73
64
  .checked=${this.expand_image_for_outlook}
@@ -84,7 +75,7 @@
84
75
  </h6>
85
76
  </cdtr-editor-section>`:null}
86
77
  ${"style"===this.tabName?r.qy`
87
- <cdtr-editor-section label="width" .open=${!0}>
78
+ <cdtr-editor-section .label=${"width"} .open=${!0}>
88
79
  <cdtr-width-editor
89
80
  text="width"
90
81
  unit="px"
@@ -92,14 +83,14 @@
92
83
  min="500"
93
84
  .value="${this.width}"
94
85
  @input=${this.onChangeWidth}
95
- .sizes=${[{name:i.M.get("lang","recommended")||"recommended",value:600,default:!0},{name:i.M.get("lang","large")||"large",value:1e3}]}
86
+ .sizes=${[{name:a.M.get("lang","recommended")||"recommended",value:600,default:!0},{name:a.M.get("lang","large")||"large",value:1e3}]}
96
87
  ></cdtr-width-editor>
97
88
  <p style="font-size:12px">
98
89
  <lang-text whiteSpace="" text="email_600"></lang-text>
99
90
  </p>
100
91
  </cdtr-editor-section>
101
92
 
102
- <cdtr-editor-section label="padding" .open=${!0}>
93
+ <cdtr-editor-section .label=${"padding"} .open=${!0}>
103
94
  <cdtr-row justify="center">
104
95
  <cdtr-spacing
105
96
  .topValue="${this.padding.topValue}"
@@ -113,7 +104,7 @@
113
104
  </cdtr-row>
114
105
  </cdtr-editor-section>
115
106
 
116
- <cdtr-editor-section label="border_design" .open=${!1}>
107
+ <cdtr-editor-section .label=${"border_design"} .open=${!1}>
117
108
  <cdtr-border-editor
118
109
  .borderStyle=${this.borderStyle}
119
110
  .borderWidth=${this.borderWidth}
@@ -130,7 +121,7 @@
130
121
  ></cdtr-border-editor>
131
122
  </cdtr-editor-section>
132
123
 
133
- <cdtr-editor-section label="settings" .open=${!1}>
124
+ <cdtr-editor-section .label=${"layout_behavior"} .open=${!1}>
134
125
  <cdtr-row alignItems="center" justify="space-between">
135
126
  <cdtr-col>
136
127
  <cdtr-title>
@@ -176,16 +167,16 @@
176
167
  `:null}
177
168
 
178
169
  ${"popup"===this.tabName?r.qy`
179
- <cdtr-editor-section label="modal_name" .open=${!0}>
170
+ <cdtr-editor-section .label=${"modal_name"} .open=${!0}>
180
171
  <cdtr-input
181
172
  style="width:100%"
182
173
  .value=${this.modalName||""}
183
- .placeholder=${i.M.get("lang","modal_name")||""}
174
+ .placeholder=${a.M.get("lang","modal_name")||""}
184
175
  @change=${t=>this._setModalName(t.target.value)}
185
176
  ></cdtr-input>
186
177
  </cdtr-editor-section>
187
178
 
188
- <cdtr-editor-section label="popup_trigger_label" .open=${!0}>
179
+ <cdtr-editor-section .label=${"popup_trigger_label"} .open=${!0}>
189
180
  <select
190
181
  style="width:100%;padding:8px;border:1px solid var(--color-border,#e0e0e0);border-radius:8px;font:inherit;background:#fff;cursor:pointer;"
191
182
  @change=${t=>this._setPopupTrigger(t.target.value)}
@@ -194,7 +185,7 @@
194
185
  value=${t}
195
186
  ?selected=${this.popupTrigger===t}
196
187
  >
197
- ${i.M.get("lang","popup_trigger_"+t)||t}
188
+ ${a.M.get("lang","popup_trigger_"+t)||t}
198
189
  </option>`)}
199
190
  </select>
200
191
  ${"delay"===this.popupTrigger?r.qy`
@@ -295,7 +286,7 @@
295
286
  paper-button.backgrounds:hover {
296
287
  background: #eaeaed;
297
288
  }
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:()=>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`
289
+ `,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}},customElements.define("block-editor",g)},15155(t,e,o){o.d(e,{A:()=>n});var r=o(59929),a=o(57176);class i 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`
299
290
  <div class="${t}">
300
291
  ${(this.items||[]).map((t,e)=>r.qy`
301
292
  <div class="swatch-item" @click=${()=>this.openPicker(e)}>
@@ -319,7 +310,7 @@
319
310
  </div>
320
311
  `)}
321
312
  </div>
322
- `}}a.styles=[i.L,r.AH`
313
+ `}}i.styles=[a.L,r.AH`
323
314
  :host {
324
315
  display: block;
325
316
  direction: var(--direction-locale, ltr);
@@ -367,12 +358,12 @@
367
358
  clip: rect(0,0,0,0);
368
359
  pointer-events: none;
369
360
  }
370
- `],a.properties={items:{type:Array},columns:{type:Number}},customElements.define("cdtr-color-swatch-group",a);const n=t=>r.qy`
361
+ `],i.properties={items:{type:Array},columns:{type:Number}},customElements.define("cdtr-color-swatch-group",i);const n=t=>r.qy`
371
362
  <cdtr-color-swatch-group
372
363
  .items=${t.items}
373
364
  .columns=${t.columns||2}
374
365
  ></cdtr-color-swatch-group>
375
- `},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`
366
+ `},12258(t,e,o){o.d(e,{A:()=>n});var r=o(59929),a=o(40648);class i extends r.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,a.Q)(this.persistKey,this.open)}render(){return r.qy`
376
367
  <div class="section">
377
368
  <div class="header" @click=${this.toggle}>
378
369
  <span class="title"><lang-text text="${this.label}"></lang-text></span>
@@ -386,14 +377,26 @@
386
377
  </div>
387
378
  </div>
388
379
  </div>
389
- `}}a.styles=r.AH`
380
+ `}}i.styles=r.AH`
390
381
  :host {
391
382
  display: block;
392
383
  direction: var(--direction-locale, ltr);
393
384
  --editor-container-inline-padding: 0;
394
385
  }
395
386
  .section {
396
- border-bottom: 1px solid var(--color-border);
387
+ position: relative;
388
+ }
389
+ /* Inset to the content gutter, not full-bleed: an edge-to-edge rule reads
390
+ as a table border. */
391
+ .section::after {
392
+ content: "";
393
+ display: block;
394
+ height: 1px;
395
+ margin: 0 var(--space-4, 16px);
396
+ background: var(--color-border-subtle, rgba(0, 0, 0, 0.06));
397
+ }
398
+ :host(:last-of-type) .section::after {
399
+ display: none;
397
400
  }
398
401
  .header {
399
402
  display: flex;
@@ -402,16 +405,26 @@
402
405
  padding: var(--space-3) var(--space-4);
403
406
  cursor: pointer;
404
407
  user-select: none;
408
+ /* Keeps the group name visible while its controls scroll past. */
409
+ position: sticky;
410
+ top: 0;
411
+ z-index: 1;
412
+ background: var(--color-bg, #fff);
413
+ }
414
+ .header:hover {
415
+ background: var(--color-bg-subtle, #fafbfc);
405
416
  }
406
417
  .title {
418
+ /* Larger and lighter than the labels inside it, not bolder — the labels
419
+ are what you act on. */
407
420
  font-size: var(--text-md);
408
- font-weight: 600;
421
+ font-weight: 500;
409
422
  color: var(--color-text);
410
- letter-spacing: 0.01em;
423
+ letter-spacing: 0;
411
424
  }
412
425
  .chevron {
413
- width: 16px;
414
- height: 16px;
426
+ width: 14px;
427
+ height: 14px;
415
428
  transition: transform var(--duration-normal) var(--ease-default), color var(--duration-fast) var(--ease-default);
416
429
  color: var(--color-text-faint);
417
430
  }
@@ -432,9 +445,10 @@
432
445
  opacity: 1;
433
446
  }
434
447
  .content-inner {
435
- padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
448
+ /* Light on top: the controls inside bring their own leading pad. */
449
+ padding: var(--space-1) var(--space-4) var(--space-3) var(--space-4);
436
450
  }
437
- `,a.properties={label:{type:String,reflect:!0,attribute:"data-label"},open:{type:Boolean,reflect:!0},persistKey:{type:String}},customElements.define("cdtr-editor-section",a);const n=(t,e)=>r.qy`
451
+ `,i.properties={label:{type:String,reflect:!0,attribute:"data-label"},open:{type:Boolean,reflect:!0},persistKey:{type:String}},customElements.define("cdtr-editor-section",i);const n=(t,e)=>r.qy`
438
452
  <cdtr-editor-section
439
453
  .label=${t.label}
440
454
  .open=${!1!==t.open}
Binary file