@creaditor/newsletter-starterkit 1.0.15 → 1.0.17

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 (37) hide show
  1. package/dist/1290.creaditor.bundle.js +1 -0
  2. package/dist/1290.creaditor.bundle.js.gz +0 -0
  3. package/dist/1867.creaditor.bundle.js +1 -1
  4. package/dist/1867.creaditor.bundle.js.gz +0 -0
  5. package/dist/3622.creaditor.bundle.js +5 -5
  6. package/dist/3622.creaditor.bundle.js.gz +0 -0
  7. package/dist/5279.creaditor.bundle.js +1023 -0
  8. package/dist/5279.creaditor.bundle.js.gz +0 -0
  9. package/dist/5674.creaditor.bundle.js +29 -0
  10. package/dist/5674.creaditor.bundle.js.gz +0 -0
  11. package/dist/5936.creaditor.bundle.js +986 -0
  12. package/dist/5936.creaditor.bundle.js.gz +0 -0
  13. package/dist/6085.creaditor.bundle.js +1 -0
  14. package/dist/6085.creaditor.bundle.js.gz +0 -0
  15. package/dist/6652.creaditor.bundle.js +1 -1
  16. package/dist/6652.creaditor.bundle.js.gz +0 -0
  17. package/dist/6737.creaditor.bundle.js +26 -16
  18. package/dist/6737.creaditor.bundle.js.gz +0 -0
  19. package/dist/7911.creaditor.bundle.js +2 -2
  20. package/dist/7911.creaditor.bundle.js.gz +0 -0
  21. package/dist/7946.creaditor.bundle.js +1 -1
  22. package/dist/7946.creaditor.bundle.js.gz +0 -0
  23. package/dist/7988.creaditor.bundle.js +1 -1
  24. package/dist/7988.creaditor.bundle.js.gz +0 -0
  25. package/dist/901.creaditor.bundle.js +1 -1
  26. package/dist/901.creaditor.bundle.js.gz +0 -0
  27. package/dist/9530.creaditor.bundle.js +33 -36
  28. package/dist/9530.creaditor.bundle.js.gz +0 -0
  29. package/dist/9766.creaditor.bundle.js +24 -16
  30. package/dist/9766.creaditor.bundle.js.gz +0 -0
  31. package/dist/9800.creaditor.bundle.js +1 -1
  32. package/dist/9800.creaditor.bundle.js.gz +0 -0
  33. package/dist/creaditor.bundle.js +397 -263
  34. package/dist/creaditor.bundle.js.gz +0 -0
  35. package/dist/service-worker.js +1 -1
  36. package/dist/service-worker.js.gz +0 -0
  37. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[9766],{29766:(t,e,o)=>{o.r(e),o.d(e,{BlockEditor:()=>p});var r=o(56666),i=o(21293),d=o(70235),n=(o(67237),o(45607)),a=o(58860),s=o(1670),c=o(98766);var l=o(50939),g=o(35210),h=o(11961);o(7592);o.e(4807).then(o.bind(o,54807));class p extends i.oi{constructor(t){super(),(0,r.Z)(this,"onChangeBakgroundExpanding",(t=>{const e=t.target.checked;n.Z.store().execCommand("expand_image_for_outlook",!e)})),(0,r.Z)(this,"getInnerBlocks",(()=>{const t=[],e=this.component.parent("section");return e&&(t.push(e),e.children.forEach((e=>{const o=d.h.get("components",e);o&&"block"===o.type&&t.push(o)}))),t})),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),this.tabs=[{text:"background"},{text:"design",selected:!0},{text:"settings"}],this.tabName="design",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=d.h.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{n.Z.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,n.Z.store().execCommand("noResponsive",this.noResponsive)},onChangeBorderStyle:t=>{this.borderStyle=t.target.borderStyle||"solid",this.borderWidth=t.target.borderWidth||1,this.borderColor=t.target.borderColor||"#000",n.Z.store().execCommand("style",{borderStyle:t.target.borderStyle,borderWidth:t.target.borderWidth,borderColor:t.target.borderColor})},onRemoveBackgroundVideo:()=>{this.backgroundVideo="",this.backgroundInstance={},n.Z.store().execCommand("background","transparent")},onChangeBackgroundVideo:t=>{const e=t.target.value;let o;if((0,s.Z)(e)){const t=h.x.find((t=>"images"===t.type));t.preset.properties.src=e,o=t.preset}else if((0,c.Z)(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=h.x.find((t=>"video"===t.type));t.preset.properties.url=e,delete t.preset.properties.videoPath,o=t.preset}o&&(n.Z.store().execCommand("background",o),n.Z.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.Z.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,o=t.target.direction;"all"===o?(n.Z.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):n.Z.store().execCommand("style",{[(0,l.Z)(`margin-${o.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,o=t.target.direction,r=(0,l.Z)(`padding-${o.toLowerCase()}`);"all"===o?(n.Z.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.Z.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.Z.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&&!t.includes("var(--")&&!e.includes("var(--")){const r=(0,g.R)(t,e);o.tiptap.chain().selectAll().setColor(r).run()}}})),n.Z.store().execCommand("style",{background:e,backgroundColor:null});"web"!==d.h.get("config","channel")&&n.Z.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.Z.store().execCommand("background",t)}}connectedCallback(){super.connectedCallback(),this.connectWith(),n.Z.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),n.Z.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const o=this.getInnerBlocks();n.Z.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...o]}),this.maxWidth=e}connectWith(){const t=n.Z.components[n.Z.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.borderColor=t.props.style.borderColor;const o=t.props.background;if(this.isBackgroundImage="images"===o?.type,this.noResponsive=!!t.props.noResponsive,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||i.background,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}render(){const t=d.h.get("config","channel");return i.dy`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[9766],{29766:(t,e,r)=>{r.r(e),r.d(e,{BlockEditor:()=>g});var o=r(56666),d=r(21293),i=r(70235),a=(r(67237),r(45607)),n=r(58860),s=r(1670),c=r(98766);var h=r(50939),l=r(35210),p=r(11961);r(7592);r.e(4807).then(r.bind(r,54807));class g extends d.oi{constructor(t){super(),(0,o.Z)(this,"onChangeBakgroundExpanding",(t=>{const e=t.target.checked;a.Z.store().execCommand("expand_image_for_outlook",!e)})),(0,o.Z)(this,"getInnerBlocks",(()=>{const t=[],e=this.component.parent("section");return e&&e.children.forEach((e=>{const r=i.h.get("components",e);r&&"block"===r.type&&t.push(r)})),t})),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),this.tabs=[{text:"background"},{text:"design",selected:!0},{text:"settings"}],this.tabName="design",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.h.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{a.Z.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,a.Z.store().execCommand("noResponsive",this.noResponsive)},onChangeBorderStyle:t=>{this.borderStyle=t.target.borderStyle||"solid",this.borderWidth=t.target.borderWidth||1,this.borderColor=t.target.borderColor||"#000",this.borderRadius=t.target.borderRadius||0;t.target.json;a.Z.store().execCommand("style",{borderStyle:t.target.borderStyle,borderColor:t.target.borderColor,borderTopWidth:t.target.borderTopWidth+"px",borderBottomWidth:t.target.borderBottomWidth+"px",borderLeftWidth:t.target.borderLeftWidth+"px",borderRightWidth:t.target.borderRightWidth+"px",borderTopRightRadius:parseInt(t.target.borderTopRightRadius)+"px",borderTopLeftRadius:parseInt(t.target.borderTopLeftRadius)+"px",borderBottomRightRadius:parseInt(t.target.borderBottomRightRadius)+"px",borderBottomLeftRadius:parseInt(t.target.borderBottomLeftRadius)+"px",borderRadius:null})},onRemoveBackgroundVideo:()=>{this.backgroundVideo="",this.backgroundInstance={},a.Z.store().execCommand("background","transparent")},onChangeBackgroundVideo:t=>{const e=t.target.value;let r;if((0,s.Z)(e)){const t=p.x.find((t=>"images"===t.type));t.preset.properties.src=e,r=t.preset}else if((0,c.Z)(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.x.find((t=>"video"===t.type));t.preset.properties.url=e,delete t.preset.properties.videoPath,r=t.preset}r&&(a.Z.store().execCommand("background",r),a.Z.store().execCommand("style",{background:null})),this.backgroundVideo=e},onChangeImage:t=>{const e=t.detail,r=[];Array.isArray(e)?e.forEach((t=>r.push(t.src))):r.push(e.src),this.cmds.onChangeBackgroundVideo({target:{value:r.join(",")}}),this.galleryOpened=!1},onChangeHeight:t=>{const e=t.target.value;a.Z.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,r=t.target.direction;"all"===r?(a.Z.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):a.Z.store().execCommand("style",{[(0,h.Z)(`margin-${r.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,r=t.target.direction,o=(0,h.Z)(`padding-${r.toLowerCase()}`);"all"===r?(a.Z.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.Z.store().execCommand("style",{[o]:e+"px",[`padding-${r.toLowerCase()}`]:null}),this.props.style={[o]:e+"px"},this[`padding${r.toLowerCase()}`]=e)},onChangebackground(t){const e=t.target.value;this.background=e;a.Z.components.forEach((t=>{const r=t.find("text");if(r&&!r.closest("card")){let t=r.tiptap.getAttributes("textStyle").color;if(!t){const e=r.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 o=(0,l.R)(t,e);r.tiptap.chain().selectAll().setColor(o).run()}}}})),a.Z.store().execCommand("style",{background:e,backgroundColor:null});"web"!==i.h.get("config","channel")&&a.Z.store().execCommand("background",null)}}}onChangeImageBackgroundProp(t){const e=t.detail,{key:r,value:o}=e;if(this.props.background){const t=JSON.parse(JSON.stringify(this.props.background)),e=t.properties;if(!e.style[r])throw new Error(`${r} is not a valid property`);e.style[r]=o,a.Z.store().execCommand("background",t)}}connectedCallback(){super.connectedCallback(),this.connectWith(),a.Z.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),a.Z.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const r=this.getInnerBlocks();a.Z.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...r]}),this.maxWidth=e}connectWith(){const t=a.Z.components[a.Z.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 r=t.props.background;if(this.isBackgroundImage="images"===r?.type,this.noResponsive=!!t.props.noResponsive,this.isBackgroundImage){const t=r.properties;this.backgroundAttachment=t.style.backgroundAttachment,this.backgroundPosition=t.style.backgroundPosition,this.backgroundRepeat=t.style.backgroundRepeat,this.backgroundSize=t.style.backgroundSize}this.backgroundInstance=r,this.backgroundVideo=r?.properties?.src||r?.properties?.url||"";const o=t.element,d=window.getComputedStyle(o);this.maxWidth=parseInt(d.width),this.width=parseInt(e.width,10)||this.maxWidth,this.background=e.background||e.backgroundImage||d.backgroundColor,e.backgroundImage&&(this.background=`url(${e.backgroundImage})`),this.padding={topValue:parseInt(d.paddingTop),bottomValue:parseInt(d.paddingBottom),leftValue:parseInt(d.paddingLeft),rightValue:parseInt(d.paddingRight)},this.margin={topValue:parseInt(d.marginTop),bottomValue:parseInt(d.marginBottom)}}}changeTab(t){this.tabName=t.target.value}render(){const t=i.h.get("config","channel");return d.dy`
2
2
  <cdtr-editor-tabs .tabs=${this.tabs} @tabChanged=${this.changeTab}>
3
3
  <div slot="content">
4
- ${"background"===this.tabName?i.dy` <cdtr-editor-container>
4
+ ${"background"===this.tabName?d.dy` <cdtr-editor-container>
5
5
  <cdtr-row justify="space-between">
6
6
  <cdtr-col sm="5"
7
7
  ><paper-button
@@ -16,14 +16,14 @@
16
16
  <paper-button
17
17
  class="backgrounds"
18
18
  raised
19
- @click=${()=>a.Z.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:n.Z.components[0]})}
19
+ @click=${()=>n.Z.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:a.Z.components[0]})}
20
20
  ><lang-text
21
21
  text="backgrounds"
22
22
  ></lang-text></paper-button
23
23
  ></cdtr-col>
24
24
  </cdtr-row>
25
25
  </cdtr-editor-container>
26
- ${this.isBackgroundImage&&"web"===t?i.dy`<cdtr-editor-container>
26
+ ${this.isBackgroundImage&&"web"===t?d.dy`<cdtr-editor-container>
27
27
  <background-editor-plugin
28
28
  backgroundAttachment=${this.backgroundAttachment}
29
29
  backgroundPosition=${this.backgroundPosition}
@@ -47,7 +47,7 @@
47
47
  style="width:100%;direction:ltr;text-align:left;"
48
48
  placeholder="https://"
49
49
  ></cdtr-input>
50
- ${"object"==typeof this.backgroundInstance&&this.backgroundInstance?.component?i.dy`<paper-button
50
+ ${"object"==typeof this.backgroundInstance&&this.backgroundInstance?.component?d.dy`<paper-button
51
51
  style=" font-size: 13px;
52
52
  padding: 0;
53
53
  text-align: var(--text-align-locale);
@@ -87,7 +87,7 @@
87
87
  </h6>
88
88
  </cdtr-editor-container>
89
89
  <cdtr-divider></cdtr-divider>`:null}
90
- ${"design"===this.tabName?i.dy`
90
+ ${"design"===this.tabName?d.dy`
91
91
  <cdtr-editor-container>
92
92
  <cdtr-colorpicker-editor
93
93
  .hasAlpha=${!1}
@@ -104,7 +104,7 @@
104
104
  min="500"
105
105
  .value="${this.width}"
106
106
  @input=${this.onChangeWidth}
107
- .sizes=${[{name:d.h.get("lang","recommended")||"recommended",value:600,default:!0},{name:d.h.get("lang","large")||"large",value:1e3}]}
107
+ .sizes=${[{name:i.h.get("lang","recommended")||"recommended",value:600,default:!0},{name:i.h.get("lang","large")||"large",value:1e3}]}
108
108
  ></cdtr-width-editor>
109
109
  <p style="font-size:12px">
110
110
  <lang-text whiteSpace="" text="email_600"></lang-text>
@@ -160,13 +160,21 @@
160
160
  .borderStyle=${this.borderStyle}
161
161
  .borderWidth=${this.borderWidth}
162
162
  .borderColor=${this.borderColor}
163
+ .borderTopWidth=${this.borderTopWidth}
164
+ .borderBottomWidth=${this.borderBottomWidth}
165
+ .borderLeftWidth=${this.borderLeftWidth}
166
+ .borderRightWidth=${this.borderRightWidth}
167
+ .borderTopRightRadius=${this.borderTopRightRadius}
168
+ .borderTopLeftRadius=${this.borderTopLeftRadius}
169
+ .borderBottomRightRadius=${this.borderBottomRightRadius}
170
+ .borderBottomLeftRadius=${this.borderBottomLeftRadius}
163
171
  @change=${this.cmds.onChangeBorderStyle}
164
172
  ></cdtr-border-editor>
165
173
  </cdtr-editor-container>
166
174
  `:null}
167
175
 
168
- <!-- ${"typography"===this.tabName?i.dy` <cdtr-text-editor-plugin></cdtr-text-editor-plugin> `:null} -->
169
- <!-- ${"spacing"===this.tabName?i.dy`
176
+ <!-- ${"typography"===this.tabName?d.dy` <cdtr-text-editor-plugin></cdtr-text-editor-plugin> `:null} -->
177
+ <!-- ${"spacing"===this.tabName?d.dy`
170
178
  <cdtr-editor-container>
171
179
  <cdtr-row justify="center">
172
180
  <cdtr-col sm="12"
@@ -214,7 +222,7 @@
214
222
  .opened=${this.galleryOpened}
215
223
  @file=${this.cmds.onChangeImage}
216
224
  ></cdtr-gallery>
217
- `}}(0,r.Z)(p,"styles",i.iv`
225
+ `}}(0,o.Z)(g,"styles",d.iv`
218
226
  paper-button.gallery {
219
227
  background: var(--primary);
220
228
  color: var(--primary-text);
@@ -223,23 +231,23 @@
223
231
  background: BLACK;
224
232
  color: #fff;
225
233
  }
226
- `),(0,r.Z)(p,"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},borderStyle:{type:String},borderWidth:{type:Number},borderColor:{type:String}}),customElements.define("block-editor",p)},7592:(t,e,o)=>{o.d(e,{Z:()=>n});var r=o(56666),i=o(21293);class d extends i.oi{constructor(){super(),this.onInput=this.onInput.bind(this),this.isLocked=!0,this.borderTopRightRadius=0,this.borderTopLeftRadius=0,this.borderBottomRightRadius=0,this.borderBottomLeftRadius=0}connectedCallback(){super.connectedCallback()}onInput(t,e){t.preventDefault();const o=t.target.value,r=o+"px";this.isLocked?(this.borderTopRightRadius=o,this.borderTopLeftRadius=o,this.borderBottomRightRadius=o,this.borderBottomLeftRadius=o,this.json={borderTopRightRadius:r,borderTopLeftRadius:r,borderBottomRightRadius:r,borderBottomLeftRadius:r,borderRadius:null}):(this.json={borderTopRightRadius:parseInt(this.borderTopRightRadius||0)+"px",borderTopLeftRadius:parseInt(this.borderTopLeftRadius||0)+"px",borderBottomRightRadius:parseInt(this.borderBottomRightRadius||0)+"px",borderBottomLeftRadius:parseInt(this.borderBottomLeftRadius||0)+"px",borderRadius:null},this.json[e]=r),this.value=o,this.radiusKey=e;const i=new UIEvent("input",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(i)}resolveIcon(t){let e;switch(t){case"borderTopRightRadius":e="arrowTopRight";break;case"borderTopLeftRadius":e="arrowTopLeft";break;case"borderBottomRightRadius":e="arrowBottomRight";break;case"borderBottomLeftRadius":e="arrowBottomLeft"}return i.dy`<cdtr-icon
234
+ `),(0,o.Z)(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},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)},7592:(t,e,r)=>{r.d(e,{Z:()=>a});var o=r(56666),d=r(21293);class i extends d.oi{constructor(){super(),this.onInput=this.onInput.bind(this),this.isLocked=!0,this.borderTopRightRadius=0,this.borderTopLeftRadius=0,this.borderBottomRightRadius=0,this.borderBottomLeftRadius=0}connectedCallback(){super.connectedCallback()}onInput(t,e){t.preventDefault();const r=t.target.value,o=r;this.isLocked?(this.borderTopRightRadius=r,this.borderTopLeftRadius=r,this.borderBottomRightRadius=r,this.borderBottomLeftRadius=r,this.json={borderTopRightRadius:o,borderTopLeftRadius:o,borderBottomRightRadius:o,borderBottomLeftRadius:o,borderRadius:null}):(this.borderTopRightRadius=parseInt(this.borderTopRightRadius||0),this.borderTopLeftRadius=parseInt(this.borderTopLeftRadius||0),this.borderBottomRightRadius=parseInt(this.borderBottomRightRadius||0),this.borderBottomLeftRadius=parseInt(this.borderBottomLeftRadius||0),this.json={borderTopRightRadius:parseInt(this.borderTopRightRadius||0),borderTopLeftRadius:parseInt(this.borderTopLeftRadius||0),borderBottomRightRadius:parseInt(this.borderBottomRightRadius||0),borderBottomLeftRadius:parseInt(this.borderBottomLeftRadius||0),borderRadius:null},this.json[e]=o),this.value=r,this.radiusKey=e;const d=new UIEvent("input",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(d)}resolveIcon(t){let e;switch(t){case"borderTopRightRadius":e="arrowTopRight";break;case"borderTopLeftRadius":e="arrowTopLeft";break;case"borderBottomRightRadius":e="arrowBottomRight";break;case"borderBottomLeftRadius":e="arrowBottomLeft"}return d.dy`<cdtr-icon
227
235
  width="15"
228
236
  height="15"
229
237
  icon="${e}"
230
- ></cdtr-icon>`}onChangeLock(){this.isLocked=!this.isLocked}render(){this.elementId&&this.elementId!==this.lastElementId&&(this.lastElementId=this.elementId,this.isLocked=this.borderTopRightRadius===this.borderTopLeftRadius&&this.borderBottomRightRadius===this.borderBottomLeftRadius&&this.borderTopRightRadius===this.borderBottomLeftRadius);this.onChange;const t=this.onInput;return i.dy`<cdtr-row
238
+ ></cdtr-icon>`}onChangeLock(){this.isLocked=!this.isLocked}render(){this.elementId&&this.elementId!==this.lastElementId&&(this.lastElementId=this.elementId,this.isLocked=this.borderTopRightRadius===this.borderTopLeftRadius&&this.borderBottomRightRadius===this.borderBottomLeftRadius&&this.borderTopRightRadius===this.borderBottomLeftRadius);this.onChange;const t=this.onInput;return d.dy`<cdtr-row
231
239
  alignItems="center"
232
240
  spacing="3px"
233
241
  style="position:relative;"
234
242
  >
235
- ${["borderTopRightRadius","borderTopLeftRadius","borderBottomRightRadius","borderBottomLeftRadius"].map((e=>i.dy`<cdtr-col>
243
+ ${["borderTopRightRadius","borderTopLeftRadius","borderBottomRightRadius","borderBottomLeftRadius"].map((e=>d.dy`<cdtr-col>
236
244
  ${this.resolveIcon(e)}
237
245
  <cdtr-number-input
238
246
  .type=${"number"}
239
247
  .max=${300}
240
248
  .min=${0}
241
249
  value="${parseFloat(this[e])}"
242
- @input=${o=>t(o,e)}
250
+ @input=${r=>t(r,e)}
243
251
  style="width:100%"
244
252
  ></cdtr-number-input
245
253
  ></cdtr-col>`))}
@@ -251,7 +259,7 @@
251
259
  .icon="${this.isLocked?"lock":"unlock"}"
252
260
  ></cdtr-icon>
253
261
  </cdtr-button>
254
- </cdtr-row>`}}(0,r.Z)(d,"properties",{value:{type:Number},json:{type:Object},onChange:{type:Function},borderTopRightRadius:{type:Number},borderTopLeftRadius:{type:Number},borderBottomRightRadius:{type:Number},borderBottomLeftRadius:{type:Number},isLocked:{type:Boolean},elementId:{type:String},radiusKey:{type:String}}),customElements.define("cdtr-radius-editor",d);const n=t=>i.dy` <cdtr-editor-container>
262
+ </cdtr-row>`}}(0,o.Z)(i,"properties",{value:{type:Number},json:{type:Object},onChange:{type:Function},borderTopRightRadius:{type:Number},borderTopLeftRadius:{type:Number},borderBottomRightRadius:{type:Number},borderBottomLeftRadius:{type:Number},isLocked:{type:Boolean},elementId:{type:String},radiusKey:{type:String}}),customElements.define("cdtr-radius-editor",i);const a=t=>d.dy` <cdtr-editor-container>
255
263
  <cdtr-row>
256
264
  <cdtr-title><lang-text text="${t.title}"></lang-text></cdtr-title>
257
265
  </cdtr-row>
@@ -264,4 +272,4 @@
264
272
  .borderBottomRightRadius=${t.borderBottomRightRadius||t.value||0}
265
273
  .borderBottomLeftRadius=${t.borderBottomLeftRadius||t.value||0}
266
274
  ></cdtr-radius-editor>
267
- </cdtr-editor-container>`},98766:(t,e,o)=>{o.d(e,{Z:()=>i});const r=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"]');function i(t){const e=/(?:\.([^.]+))?$/.exec(t.toLowerCase())[1];return-1!==r.findIndex((t=>t===e))}}}]);
275
+ </cdtr-editor-container>`},98766:(t,e,r)=>{r.d(e,{Z:()=>d});const o=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"]');function d(t){const e=/(?:\.([^.]+))?$/.exec(t.toLowerCase())[1];return-1!==o.findIndex((t=>t===e))}}}]);
Binary file
@@ -1 +1 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[9800],{29800:(e,t,n)=>{n.r(t),n.d(t,{default:()=>S});var o=n(35210);const i=e=>{{const{component:t,commands:n,helpers:i}=e;return{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=[{text:"design",selected:!0},{text:"link"},{text:"icons"},{text:"settings"}];return t.forEach((t=>t.selected=t.selected=t.text===e)),t},layout:e=>{let{tab:i,changeTab:r,tabs:s}=e;return[{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"design"===i.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;n.execCommand("text",t)}},{type:"divider",active:()=>"design"===i.text},{type:"divider",active:()=>"design"===i.text},{type:"typography",active:()=>"design"===i.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;n.execCommand("style",{fontWeight:e});break;case"italic":const o="italic"===t.props.style.fontStyle?"normal":"italic";n.execCommand("style",{fontStyle:o});break;case"underline":const i="underline"===t.props.style.textDecoration?"none":"underline";n.execCommand("style",{textDecoration:i})}}},{type:"divider",active:()=>"design"===i.text},{type:"fontFamily",active:()=>"design"===i.text,value:t.props.style.fontFamily,onChange:e=>{const t=e.target.value;n.execCommand("style",{fontFamily:t})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"design"===i.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;n.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"width",min:10,max:500,active:()=>"design"===i.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px",minWidth:null})}},{type:"divider",active:()=>"design"===i.text},{type:"colorpicker",alpha:!1,title:"button_background",active:()=>"design"===i.text,value:t.props.style.background,onChange:e=>{const i=e.target.value,r=(0,o.R)(t.props.style.color,i);n.execCommand("style",{color:r}),n.execCommand("style",{background:i})}},{type:"divider",active:()=>"design"===i.text},{type:"colorpicker",title:"font_color",alpha:!1,active:()=>"design"===i.text,value:t.props.style.color,onChange:e=>{const t=e.target.value;n.execCommand("style",{color:t})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"design"===i.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;n.execCommand("style",{borderRadius:t+"px"})}},{type:"divider",active:()=>"design"===i.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===i.text,onChange:e=>{const t={link:e.target.value};n.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",checked:!!t.props.hasIcon,active:()=>"icons"===i.text,onChange:e=>{const t=e.target.checked;n.execCommand("hasIcon",t),n.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===i.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;n.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===i.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;n.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===i.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;n.execCommand("iconUrl",t.src)}}]}}}},r=e=>{let{helpers:t,editor:n,getFocused:o}=e;return{set:(e,i,r)=>{switch(i){case"style":return e[i]=t.deepMerge(e[i],r),!0;case"text":return e.text=r,o()||n.chain().setContent(r).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":return e[i]=r,!0;case"onClick":if(r.link)return e[i]=r,!0}}}};var s=n(46062),a=n.n(s),c=n(32877),l=n.n(c),d=n(96793),p=n.n(d),u=n(17892),m=n.n(u),A=n(11173),g=n.n(A),h=n(96186),x={};x.setAttributes=m(),x.insert=p().bind(null,"head"),x.domAPI=l(),x.insertStyleElement=g();a()(h.Z,x);const y=h.Z&&h.Z.locals?h.Z.locals:void 0;var C=n(88573),v=n(42626);const b=C.NB.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,C.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var f=n(64652),E=n(39615);const k=C.hj.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const S=()=>{const e="button";return{name:e,create:t=>{const{createElement:n,compose:o,helpers:s}=t,{arrayToString:a,mergeDiff:c}=s;let l=!1;const d=document.createElement("div"),p=document.createElement("div"),{editor:u}=function(e){let{content:t,element:n}=e;return{element:n,editor:new C.ML({element:n,extensions:[v.Z,b,E.Z,f.ZP,k],content:t})}}({content:o.props.text,element:p});d.appendChild(p);return u.view.dom.setAttribute("dir","auto"),u.on("update",(e=>{let{editor:t}=e;const n=t.getText();o.editor.store().updateComponent(o,"text",n)})),u.on("focus",(e=>{let{event:t,editor:n}=e;l=!0})),u.on("blur",(e=>{let{event:t,editor:n}=e;l=!1})),d.className=y.button,n({name:e,id:o.id,template:d,commands:{insertContent:e=>{u.commands.insertContent(e),u.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial"},text:"button"},render:()=>{try{o.props.style.display="",o.props.style.direction=""}catch(e){console.error(e)}c(d,{style:o.props.style}),d.style.height="auto";const e=o.props.hasIcon,t=o.props.iconUrl,n=o.props.iconDirection,i=o.props.iconSize,r="icon_in_button";let s=d.querySelector(`.${r}`)||document.createElement("img");e&&t?(s.className=r,s.src=t,s.style.width=(i||16)+"px",s.style.height=(i||16)+"px",s.style.marginRight="8px",s.style.marginLeft="8px","left"===n?d.insertBefore(s,d.firstChild):d.appendChild(s)):s.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>d,handleBar:!0,validator:r({template:d,helpers:s,editor:u,getFocused:function(){return l}}),schema:o.schema,onSelect:e=>{d.classList.add(e)},onDeselect:e=>{d.classList.remove(e)},elementProps:o,destroy:()=>{u.destroy()},remove:()=>{d.remove()},createEditor:i})}}}},96186:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(40272),i=n.n(o),r=n(82609),s=n.n(r)()(i());s.push([e.id,".vjErS0oxa7pSGS7JqfxF {\n cursor: text !important;\n}\n.vjErS0oxa7pSGS7JqfxF {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.vjErS0oxa7pSGS7JqfxF p {\n margin: 0;\n line-height: 1;\n}\n.eicX5x7SmY60CCQnENoO {\n width: 100%;\n}\n.WAp1CoJW6d3eiztdh2uT {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.EcbMG0N6j40eXKTfBpGy {\n left: -8px;\n cursor: w-resize;\n}\n.mtf6071V9prUmvmTszKr {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.vjErS0oxa7pSGS7JqfxF .WAp1CoJW6d3eiztdh2uT {\n display: none;\n}\n.vjErS0oxa7pSGS7JqfxF.sTe_74tbJp9DHRljPoY5 .WAp1CoJW6d3eiztdh2uT {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),s.locals={button:"vjErS0oxa7pSGS7JqfxF",contentEditable:"eicX5x7SmY60CCQnENoO",margin:"WAp1CoJW6d3eiztdh2uT",marginLeft:"EcbMG0N6j40eXKTfBpGy",marginRight:"mtf6071V9prUmvmTszKr",selected:"sTe_74tbJp9DHRljPoY5"};const a=s}}]);
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[9800],{29800:(e,t,n)=>{n.r(t),n.d(t,{default:()=>S});var o=n(35210);const i=e=>{{const{component:t,commands:n,helpers:i}=e;return{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=[{text:"design",selected:!0},{text:"link"},{text:"icons"},{text:"settings"}];return t.forEach((t=>t.selected=t.selected=t.text===e)),t},layout:e=>{let{tab:i,changeTab:r,tabs:a}=e;return[{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"design"===i.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;n.execCommand("text",t)}},{type:"divider",active:()=>"design"===i.text},{type:"divider",active:()=>"design"===i.text},{type:"typography",active:()=>"design"===i.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;n.execCommand("style",{fontWeight:e});break;case"italic":const o="italic"===t.props.style.fontStyle?"normal":"italic";n.execCommand("style",{fontStyle:o});break;case"underline":const i="underline"===t.props.style.textDecoration?"none":"underline";n.execCommand("style",{textDecoration:i})}}},{type:"divider",active:()=>"design"===i.text},{type:"fontFamily",active:()=>"design"===i.text,value:t.props.style.fontFamily,onChange:e=>{const t=e.target.value;n.execCommand("style",{fontFamily:t})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"design"===i.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;n.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"width",min:10,max:500,active:()=>"design"===i.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px",minWidth:null})}},{type:"divider",active:()=>"design"===i.text},{type:"colorpicker",alpha:!1,title:"button_background",active:()=>"design"===i.text,value:t.props.style.background,onChange:e=>{const i=e.target.value,r=(0,o.R)(t.props.style.color,i);n.execCommand("style",{color:r}),n.execCommand("style",{background:i,backgroundColor:null})}},{type:"divider",active:()=>"design"===i.text},{type:"colorpicker",title:"font_color",alpha:!1,active:()=>"design"===i.text,value:t.props.style.color,onChange:e=>{const t=e.target.value;n.execCommand("style",{color:t})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"design"===i.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;n.execCommand("style",{borderRadius:t+"px"})}},{type:"divider",active:()=>"design"===i.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===i.text,onChange:e=>{const t={link:e.target.value};n.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",checked:!!t.props.hasIcon,active:()=>"icons"===i.text,onChange:e=>{const t=e.target.checked;n.execCommand("hasIcon",t),n.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===i.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;n.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===i.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;n.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===i.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;n.execCommand("iconUrl",t.src)}},{type:"divider",active:()=>"design"===i.text},{type:"borderpicker",title:"border",active:()=>"design"===i.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;n.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"design"===i.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;n.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"design"===i.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;n.execCommand("style",{borderColor:t})}},{type:"divider",active:()=>"design"===i.text},{type:"spacingPicker",active:()=>"design"===i.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,o=e.target.bottomValue,i=e.target.leftValue,r=e.target.rightValue;n.execCommand("style",{paddingTop:t+"px",paddingBottom:o+"px",paddingLeft:i+"px",paddingRight:r+"px",padding:null})}}]}}}},r=e=>{let{helpers:t,editor:n,getFocused:o}=e;return{set:(e,i,r)=>{switch(i){case"style":return e[i]=t.deepMerge(e[i],r),!0;case"text":return e.text=r,o()||n.chain().setContent(r).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":return e[i]=r,!0;case"onClick":if(r.link)return e[i]=r,!0}}}};var a=n(46062),s=n.n(a),l=n(32877),c=n.n(l),d=n(96793),p=n.n(d),u=n(17892),m=n.n(u),g=n(11173),A=n.n(g),x=n(96186),h={};h.setAttributes=m(),h.insert=p().bind(null,"head"),h.domAPI=c(),h.insertStyleElement=A();s()(x.Z,h);const y=x.Z&&x.Z.locals?x.Z.locals:void 0;var C=n(88573),v=n(42626);const b=C.NB.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,C.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var f=n(64652),E=n(39615);const k=C.hj.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const S=()=>{const e="button";return{name:e,create:t=>{const{createElement:n,compose:o,helpers:a}=t,{arrayToString:s,mergeDiff:l}=a;let c=!1;const d=document.createElement("div"),p=document.createElement("div"),{editor:u}=function(e){let{content:t,element:n}=e;return{element:n,editor:new C.ML({element:n,extensions:[v.Z,b,E.Z,f.ZP,k],content:t})}}({content:o.props.text,element:p});d.appendChild(p);return u.view.dom.setAttribute("dir","auto"),u.on("update",(e=>{let{editor:t}=e;const n=t.getText();o.editor.store().updateComponent(o,"text",n)})),u.on("focus",(e=>{let{event:t,editor:n}=e;c=!0})),u.on("blur",(e=>{let{event:t,editor:n}=e;c=!1})),d.className=y.button,n({name:e,id:o.id,template:d,commands:{insertContent:e=>{u.commands.insertContent(e),u.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{o.props.style.display="",o.props.style.direction=""}catch(e){console.error(e)}l(d,{style:o.props.style}),d.style.height="auto";const e=o.props.hasIcon,t=o.props.iconUrl,n=o.props.iconDirection,i=o.props.iconSize,r="icon_in_button";let a=d.querySelector(`.${r}`)||document.createElement("img");e&&t?(a.className=r,a.src=t,a.style.width=(i||16)+"px",a.style.height=(i||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===n?d.insertBefore(a,d.firstChild):d.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>d,handleBar:!0,validator:r({template:d,helpers:a,editor:u,getFocused:function(){return c}}),schema:o.schema,onSelect:e=>{d.classList.add(e)},onDeselect:e=>{d.classList.remove(e)},elementProps:o,destroy:()=>{u.destroy()},remove:()=>{d.remove()},createEditor:i})}}}},96186:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(40272),i=n.n(o),r=n(82609),a=n.n(r)()(i());a.push([e.id,".vjErS0oxa7pSGS7JqfxF {\n cursor: text !important;\n}\n.vjErS0oxa7pSGS7JqfxF {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.vjErS0oxa7pSGS7JqfxF p {\n margin: 0;\n line-height: 1;\n}\n.eicX5x7SmY60CCQnENoO {\n width: 100%;\n}\n.WAp1CoJW6d3eiztdh2uT {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.EcbMG0N6j40eXKTfBpGy {\n left: -8px;\n cursor: w-resize;\n}\n.mtf6071V9prUmvmTszKr {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.vjErS0oxa7pSGS7JqfxF .WAp1CoJW6d3eiztdh2uT {\n display: none;\n}\n.vjErS0oxa7pSGS7JqfxF.sTe_74tbJp9DHRljPoY5 .WAp1CoJW6d3eiztdh2uT {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),a.locals={button:"vjErS0oxa7pSGS7JqfxF",contentEditable:"eicX5x7SmY60CCQnENoO",margin:"WAp1CoJW6d3eiztdh2uT",marginLeft:"EcbMG0N6j40eXKTfBpGy",marginRight:"mtf6071V9prUmvmTszKr",selected:"sTe_74tbJp9DHRljPoY5"};const s=a}}]);
Binary file