@innovastudio/contentbox 1.2.29 → 1.2.32

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.
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
- "version": "1.2.29",
4
- "type": "module",
3
+ "version": "1.2.32",
5
4
  "description": "",
6
5
  "main": "public/contentbox/contentbox.esm.js",
7
6
  "files": [
@@ -46,7 +45,7 @@
46
45
  "webpack-dev-server": "^4.0.0"
47
46
  },
48
47
  "dependencies": {
49
- "@innovastudio/contentbuilder": "^1.1.23",
48
+ "@innovastudio/contentbuilder": "^1.1.25",
50
49
  "js-beautify": "^1.14.0"
51
50
  }
52
51
  }
@@ -9737,7 +9737,7 @@ class EditBox {
9737
9737
  if (overlayBg.style.filter) {
9738
9738
  if (overlayBg.style.filter.indexOf('grayscale') !== -1) {
9739
9739
  chkImageGrayscale.checked = true;
9740
- overlay.style.filter = 'grayscale(1)'; // change filter from -is-overlay-bg to is-overlay (to prevent conflict with animation)
9740
+ overlay.style.filter = 'grayscale(1)'; // Change filter from -is-overlay-bg to is-overlay (to prevent conflict with animation)
9741
9741
 
9742
9742
  overlayBg.style.filter = overlayBg.style.filter.replace('grayscale(1)', '');
9743
9743
  }
@@ -57933,24 +57933,24 @@ class ButtonEditor {
57933
57933
  </div>
57934
57934
 
57935
57935
  <div class="flex flex-row" style="margin:15px 0 0">
57936
- <div class="flex flex-col" style="display:none;margin-right: 40px;">
57936
+ <div class="flex flex-col" style="margin-right: 40px;">
57937
57937
  <div>
57938
- <label>${util.out('Border Thickness')}</label>:
57938
+ <label>${util.out('Border Color')}</label>:
57939
57939
  </div>
57940
57940
  <div class="flex flex-row flex-wrap" style="margin-top:5px">
57941
- <button title="${util.out('No Border')}" data-command="0" class="border-width-command" style="margin-right:4px">${util.out('No Border')}</button>
57942
- <button title="1px" data-command="1" class="border-width-command" style="text-transform:none;margin-right:4px">1px</button>
57943
- <button title="2px" data-command="2" class="border-width-command" style="text-transform:none;margin-right:4px">2px</button>
57941
+ <button title="${util.out('Transparent')}" data-command="transparent" class="border-color-command" style="margin-right:4px">${util.out('Transparent')}</button>
57942
+ <button title="${util.out('Current')}" data-command="current" class="border-color-command" style="margin-right:4px">${util.out('Current')}</button>
57944
57943
  </div>
57945
57944
  </div>
57946
-
57945
+
57947
57946
  <div class="flex flex-col">
57948
57947
  <div>
57949
- <label>${util.out('Border Color')}</label>:
57948
+ <label>${util.out('Border Thickness')}</label>:
57950
57949
  </div>
57951
57950
  <div class="flex flex-row flex-wrap" style="margin-top:5px">
57952
- <button title="${util.out('Transparent')}" data-command="transparent" class="border-color-command" style="margin-right:4px">${util.out('Transparent')}</button>
57953
- <button title="${util.out('Current')}" data-command="current" class="border-color-command" style="margin-right:4px">${util.out('Current')}</button>
57951
+ <button title="${util.out('No Border')}" data-command="0" class="border-width-command" style="margin-right:4px">${util.out('No Border')}</button>
57952
+ <button title="1px" data-command="1" class="border-width-command" style="text-transform:none;margin-right:4px">1px</button>
57953
+ <button title="2px" data-command="2" class="border-width-command" style="text-transform:none;margin-right:4px">2px</button>
57954
57954
  </div>
57955
57955
  </div>
57956
57956
  </div>
@@ -58147,53 +58147,90 @@ class ButtonEditor {
58147
58147
  let btns; //background color
58148
58148
 
58149
58149
  const btnBgColor = buttonModal.querySelector('.bg-color-command');
58150
- btnBgColor.addEventListener('click', () => {
58150
+ btnBgColor.addEventListener('click', e => {
58151
58151
  this.builder.uo.saveForUndo(true); // checkLater = true
58152
+ // this.builder.simpleColorPicker((colorClass)=>{
58153
+ // const activeButton = this.builder.activeButton||this.builder.activeLinkButton;
58154
+ // dom.removeClassesByPrefix(activeButton, 'bg-');
58155
+ // dom.addClass(activeButton, colorClass);
58156
+ // this.applyDefault(activeButton);
58157
+ // setTimeout(()=>{
58158
+ // const currBg = dom.getStyle(activeButton,'background-color');
58159
+ // btnBgColor.style.backgroundColor = currBg;
58160
+ // },160);
58161
+ // this.builder.opts.onChange();
58162
+ // });
58152
58163
 
58153
- this.builder.simpleColorPicker(colorClass => {
58164
+ const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
58165
+ let elm = e.target;
58166
+ this.builder.colorPicker.open(color => {
58154
58167
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
58168
+ activeButton.style.backgroundColor = color;
58169
+ activeButton.setAttribute('data-bg', color);
58155
58170
  dom$z.removeClassesByPrefix(activeButton, 'bg-');
58156
- dom$z.addClass(activeButton, colorClass);
58157
- this.applyDefault(activeButton);
58158
- setTimeout(() => {
58159
- const currBg = dom$z.getStyle(activeButton, 'background-color');
58160
- btnBgColor.style.backgroundColor = currBg;
58161
- }, 160);
58171
+ elm.style.backgroundColor = color; // preview
58172
+ //Trigger Change event
58173
+
58162
58174
  this.builder.opts.onChange();
58163
- });
58175
+ }, activeButton.style.backgroundColor);
58164
58176
  }); //text color
58165
58177
 
58166
58178
  const btnTextColor = buttonModal.querySelector('.text-color-command');
58167
- btnTextColor.addEventListener('click', () => {
58179
+ btnTextColor.addEventListener('click', e => {
58168
58180
  this.builder.uo.saveForUndo(true); // checkLater = true
58181
+ // this.builder.simpleColorPicker((colorClass)=>{
58182
+ // const activeButton = this.builder.activeButton||this.builder.activeLinkButton;
58183
+ // dom.removeClassesByPrefix(activeButton, 'text-');
58184
+ // dom.addClass(activeButton, colorClass);
58185
+ // this.applyDefault(activeButton);
58186
+ // setTimeout(function(){
58187
+ // const currColor = dom.getStyle(activeButton,'color');
58188
+ // btnTextColor.style.backgroundColor = currColor;
58189
+ // },160);
58190
+ // this.builder.opts.onChange();
58191
+ // }, 'text');
58169
58192
 
58170
- this.builder.simpleColorPicker(colorClass => {
58193
+ const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
58194
+ let elm = e.target;
58195
+ this.builder.colorPicker.open(color => {
58171
58196
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
58197
+ activeButton.style.color = color;
58172
58198
  dom$z.removeClassesByPrefix(activeButton, 'text-');
58173
- dom$z.addClass(activeButton, colorClass);
58174
- this.applyDefault(activeButton);
58175
- setTimeout(function () {
58176
- const currColor = dom$z.getStyle(activeButton, 'color');
58177
- btnTextColor.style.backgroundColor = currColor;
58178
- }, 160);
58199
+ elm.style.backgroundColor = color; // preview
58200
+ //Trigger Change event
58201
+
58179
58202
  this.builder.opts.onChange();
58180
- }, 'text');
58203
+ }, activeButton.style.color);
58181
58204
  }); //hover background color
58182
58205
 
58183
58206
  const btnHoverBgColor = buttonModal.querySelector('.bg-color-hover-command');
58184
- btnHoverBgColor.addEventListener('click', () => {
58207
+ btnHoverBgColor.addEventListener('click', e => {
58185
58208
  this.builder.uo.saveForUndo(true); // checkLater = true
58209
+ // this.builder.simpleColorPicker((colorClass)=>{
58210
+ // const activeButton = this.builder.activeButton||this.builder.activeLinkButton;
58211
+ // dom.removeClassesByPrefix(activeButton, 'hover:bg-');
58212
+ // if(colorClass) dom.addClass(activeButton, 'hover:' + colorClass);
58213
+ // this.applyDefault(activeButton);
58214
+ // this.getVisibleBgColor(colorClass, (color)=>{
58215
+ // btnHoverBgColor.style.backgroundColor = color;
58216
+ // });
58217
+ // this.builder.opts.onChange();
58218
+ // });
58186
58219
 
58187
- this.builder.simpleColorPicker(colorClass => {
58220
+ const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
58221
+ let hoverbgcolor = activeButton.getAttribute('data-hover-bg');
58222
+ let elm = e.target;
58223
+ this.builder.colorPicker.open(color => {
58188
58224
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
58225
+ activeButton.setAttribute('data-hover-bg', color);
58189
58226
  dom$z.removeClassesByPrefix(activeButton, 'hover:bg-');
58190
- if (colorClass) dom$z.addClass(activeButton, 'hover:' + colorClass);
58191
- this.applyDefault(activeButton);
58192
- this.getVisibleBgColor(colorClass, color => {
58193
- btnHoverBgColor.style.backgroundColor = color;
58194
- });
58227
+ activeButton.setAttribute('onmouseover', 'if(this.getAttribute(\'data-hover-bg\'))this.style.backgroundColor=this.getAttribute(\'data-hover-bg\');');
58228
+ activeButton.setAttribute('onmouseout', 'if(this.getAttribute(\'data-bg\'))this.style.backgroundColor=this.getAttribute(\'data-bg\');else this.style.backgroundColor=\'\'');
58229
+ elm.style.backgroundColor = color; // preview
58230
+ //Trigger Change event
58231
+
58195
58232
  this.builder.opts.onChange();
58196
- });
58233
+ }, hoverbgcolor ? hoverbgcolor : '');
58197
58234
  }); //hover text color
58198
58235
 
58199
58236
  const btnHoverTextColor = document.querySelectorAll('.text-color-hover-command');
@@ -58271,8 +58308,8 @@ class ButtonEditor {
58271
58308
  const val = btn.getAttribute('data-command');
58272
58309
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton;
58273
58310
  dom$z.removeClass(activeButton, 'border-0');
58274
- dom$z.removeClass(activeButton, 'border');
58275
58311
  dom$z.removeClass(activeButton, 'border-2');
58312
+ dom$z.removeClass(activeButton, 'border');
58276
58313
  if (val === '0') dom$z.addClass(activeButton, 'border-0');else if (val === '1') dom$z.addClass(activeButton, 'border');else if (val === '2') dom$z.addClass(activeButton, 'border-2');
58277
58314
  this.applyDefault(activeButton); // Button on/off
58278
58315
 
@@ -58605,12 +58642,16 @@ class ButtonEditor {
58605
58642
  if (item.indexOf('hover:bg-') === 0) {
58606
58643
  this.getVisibleBgColor(item.replace('hover:', ''), color => {
58607
58644
  btnHoverBgColor.style.backgroundColor = color;
58645
+ activeButton.setAttribute('data-hover-bg', color); //new inline
58608
58646
  });
58609
58647
  }
58610
58648
 
58611
58649
  if (item.indexOf('bg-') === 0) {
58612
58650
  this.getVisibleBgColor(item, color => {
58613
58651
  btnBgColor.style.backgroundColor = color;
58652
+ activeButton.setAttribute('data-bg', color); //new inline
58653
+
58654
+ activeButton.style.backgroundColor = color; //new inline
58614
58655
  });
58615
58656
  }
58616
58657
 
@@ -58618,6 +58659,7 @@ class ButtonEditor {
58618
58659
  this.getVisibleTextColor(item, color => {
58619
58660
  btnTextColor.style.backgroundColor = color;
58620
58661
  currColor = color;
58662
+ activeButton.style.color = color; //new inline
58621
58663
  });
58622
58664
  }
58623
58665
  });
@@ -58627,8 +58669,12 @@ class ButtonEditor {
58627
58669
  // if no text-[color] found
58628
58670
  currColor = dom$z.getStyle(activeButton, 'color');
58629
58671
  btnTextColor.style.backgroundColor = currColor;
58630
- }
58672
+ } // NEW: inline color
58673
+
58631
58674
 
58675
+ if (activeButton.style.backgroundColor) btnBgColor.style.backgroundColor = activeButton.style.backgroundColor;
58676
+ if (activeButton.getAttribute('data-hover-bg')) btnHoverBgColor.style.backgroundColor = activeButton.getAttribute('data-hover-bg');
58677
+ if (activeButton.style.color) btnTextColor.style.backgroundColor = activeButton.style.color;
58632
58678
  let btn;
58633
58679
  btn = this.buttonModal.querySelector('.text-color-hover-command.on');
58634
58680
  dom$z.removeClass(btn, 'on');
@@ -58709,6 +58755,20 @@ class ButtonEditor {
58709
58755
  dom$z.addClass(btn, 'on');
58710
58756
  }
58711
58757
 
58758
+ btn = this.buttonModal.querySelector('.border-width-command.on');
58759
+ dom$z.removeClass(btn, 'on');
58760
+
58761
+ if (dom$z.hasClass(activeButton, 'border-0')) {
58762
+ btn = this.buttonModal.querySelector('.border-width-command[data-command="0"]');
58763
+ dom$z.addClass(btn, 'on');
58764
+ } else if (dom$z.hasClass(activeButton, 'border-2')) {
58765
+ btn = this.buttonModal.querySelector('.border-width-command[data-command="2"]');
58766
+ dom$z.addClass(btn, 'on');
58767
+ } else if (dom$z.hasClass(activeButton, 'border')) {
58768
+ btn = this.buttonModal.querySelector('.border-width-command[data-command="1"]');
58769
+ dom$z.addClass(btn, 'on');
58770
+ }
58771
+
58712
58772
  if (activeButton.classList) {
58713
58773
  activeButton.classList.forEach(item => {
58714
58774
  if (item.indexOf('size-') === 0) {
@@ -58919,13 +58979,13 @@ class ButtonEditor {
58919
58979
  applyDefault(link) {
58920
58980
  dom$z.addClass(link, 'transition-all');
58921
58981
  dom$z.addClass(link, 'inline-block');
58922
- dom$z.addClass(link, 'cursor-pointer');
58923
- dom$z.addClass(link, 'border-2');
58982
+ dom$z.addClass(link, 'cursor-pointer'); // dom.addClass(link, 'border-2');
58983
+
58924
58984
  dom$z.addClass(link, 'border-solid');
58925
- dom$z.addClass(link, 'leading-relaxed');
58926
- link.removeAttribute('style');
58927
- link.removeAttribute('onmouseover');
58928
- link.removeAttribute('onmouseout');
58985
+ dom$z.addClass(link, 'leading-relaxed'); // link.removeAttribute('style');
58986
+ // link.removeAttribute('onmouseover');
58987
+ // link.removeAttribute('onmouseout');
58988
+
58929
58989
  link.removeAttribute('data-hover-bgcolor');
58930
58990
  link.removeAttribute('data-hover-color');
58931
58991
  link.removeAttribute('data-hover-bordercolor');
@@ -64600,11 +64660,18 @@ class ColumnTool {
64600
64660
  dom$m.addCssClass(cell, classes.end, classes);
64601
64661
  dom$m.addClass(elm, 'on');
64602
64662
  }
64663
+
64664
+ cell.style.justifyContent = '';
64665
+ cell.style.alignItems = '';
64603
64666
  } else {
64604
64667
  dom$m.removeCssClasses(cell, this.builder.cssClasses.display);
64605
64668
  dom$m.removeCssClasses(cell, this.builder.cssClasses.flexDirection);
64606
64669
  dom$m.removeCssClasses(cell, this.builder.cssClasses.justifyContent);
64607
64670
  dom$m.removeCssClasses(cell, this.builder.cssClasses.alignItems);
64671
+ cell.style.display = '';
64672
+ cell.style.flexDirection = '';
64673
+ cell.style.justifyContent = '';
64674
+ cell.style.alignItems = '';
64608
64675
  }
64609
64676
  } else {
64610
64677
  cell.style.display = 'flex';
@@ -84228,6 +84295,15 @@ class ContentBox {
84228
84295
  this.boxSetup(box);
84229
84296
  });
84230
84297
  }
84298
+ }); // Change filter from -is-overlay-bg to is-overlay (to prevent conflict with animation)
84299
+
84300
+ let overlayBgs = document.querySelectorAll('.is-overlay-bg');
84301
+ overlayBgs.forEach(elm => {
84302
+ if (elm.style) if (elm.style.filter) {
84303
+ if (elm.style.filter.indexOf('grayscale') !== -1) {
84304
+ elm.parentNode.style.filter = 'grayscale(1)';
84305
+ }
84306
+ }
84231
84307
  });
84232
84308
  this.editor.applyBehavior(); // Re-apply
84233
84309