@innovastudio/contentbox 1.4.66 → 1.4.68

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,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
3
  "type": "module",
4
- "version": "1.4.66",
4
+ "version": "1.4.68",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -46,7 +46,7 @@
46
46
  "webpack-dev-server": "^4.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@innovastudio/contentbuilder": "^1.3.75",
49
+ "@innovastudio/contentbuilder": "^1.3.79",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -1032,6 +1032,17 @@ class SideBar {
1032
1032
 
1033
1033
  viewHtml() {
1034
1034
  const builderStuff = this.builderStuff;
1035
+
1036
+ if (localStorage.getItem('_htmlview') !== null) {
1037
+ let htmlView = localStorage.getItem('_htmlview');
1038
+
1039
+ if (htmlView === 'shorten') {
1040
+ this.builder.shortenHTML = true;
1041
+ } else {
1042
+ this.builder.shortenHTML = false;
1043
+ }
1044
+ }
1045
+
1035
1046
  let html;
1036
1047
 
1037
1048
  if (this.builder.shortenHTML) {
@@ -19059,15 +19070,18 @@ class Util {
19059
19070
  dom.removeClass(elm, 'elm-inspected');
19060
19071
  }); // RTE
19061
19072
 
19062
- let rtetool = builderStuff.querySelector('.is-rte-tool');
19063
- if (rtetool) rtetool.style.display = 'none';
19064
- let elementRtetool = builderStuff.querySelector('.is-elementrte-tool');
19065
- if (elementRtetool) elementRtetool.style.display = 'none'; // Click ok on code view should hide these as well
19073
+ if (this.builder.toolbarDisplay === 'auto') {
19074
+ let rtetool = builderStuff.querySelector('.is-rte-tool');
19075
+ if (rtetool) rtetool.style.display = 'none';
19076
+ let elementRtetool = builderStuff.querySelector('.is-elementrte-tool');
19077
+ if (elementRtetool) elementRtetool.style.display = 'none'; // Click ok on code view should hide these as well
19078
+
19079
+ let rtetoolmore = builderStuff.querySelector('.rte-more-options');
19080
+ if (rtetoolmore) rtetoolmore.style.display = '';
19081
+ let elementRtetoolmore = builderStuff.querySelector('.elementrte-more-options');
19082
+ if (elementRtetoolmore) elementRtetoolmore.style.display = '';
19083
+ } // Element
19066
19084
 
19067
- let rtetoolmore = builderStuff.querySelector('.rte-more-options');
19068
- if (rtetoolmore) rtetoolmore.style.display = '';
19069
- let elementRtetoolmore = builderStuff.querySelector('.elementrte-more-options');
19070
- if (elementRtetoolmore) elementRtetoolmore.style.display = ''; // Element
19071
19085
 
19072
19086
  elms = this.builder.doc.querySelectorAll('.elm-active');
19073
19087
  Array.prototype.forEach.call(elms, elm => {
@@ -19388,6 +19402,7 @@ class Util {
19388
19402
 
19389
19403
  localStorage.removeItem('_snippetssidebardisplay'); //snippetsSidebarDisplay
19390
19404
 
19405
+ localStorage.removeItem('_htmlview');
19391
19406
  localStorage.removeItem('_pasteresult'); //DON'T HAVE PROP
19392
19407
  //NOT USED
19393
19408
 
@@ -28412,9 +28427,10 @@ class HtmlUtil {
28412
28427
 
28413
28428
  let range = document.createRange();
28414
28429
  range.setStart(area, 0);
28415
- area.appendChild(range.createContextualFragment(html));
28416
- let builderActive = this.builder.doc.querySelector('.builder-active');
28417
- if (builderActive) this.builder.applyBehaviorOn(builderActive);
28430
+ area.appendChild(range.createContextualFragment(html)); // let builderActive = this.builder.doc.querySelector('.builder-active');
28431
+ // if(builderActive) this.builder.applyBehaviorOn(builderActive);
28432
+
28433
+ this.builder.applyBehaviorOn(area);
28418
28434
  /*else {
28419
28435
  const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
28420
28436
  if(builders.length > 1) {
@@ -28643,8 +28659,13 @@ class HtmlUtil {
28643
28659
  }
28644
28660
 
28645
28661
  let textarea = viewhtml.querySelector('textarea');
28646
- this.builder.cleanHtmlFormatting = true;
28647
- textarea.value = this.readHtml(area, true); // for view=true
28662
+ this.builder.cleanHtmlFormatting = true; // textarea.value = this.readHtml(area, true); // for view=true
28663
+
28664
+ if (this.builder.shortenHTML) {
28665
+ textarea.value = this.readHtml(area, true); // for view=true
28666
+ } else {
28667
+ textarea.value = this.readHtml(area, false); // actual
28668
+ }
28648
28669
 
28649
28670
  this.builder.cleanHtmlFormatting = false;
28650
28671
  }
@@ -79055,6 +79076,18 @@ class Preferences {
79055
79076
  <input class="input-hidecelltool" type="checkbox" /> ${util.out('Hide Column Tool')}&nbsp;
79056
79077
  </label>
79057
79078
 
79079
+
79080
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
79081
+ <input class="input-hidesnippetaddtool" type="checkbox" /> ${util.out('Hide Snippet (+) Tool')}&nbsp;
79082
+ </label>
79083
+
79084
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
79085
+ <input class="input-hideelementtool" type="checkbox" /> ${util.out('Hide element tool')}&nbsp;
79086
+ </label>
79087
+
79088
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
79089
+ <input class="input-hideelementhighlight" type="checkbox" /> ${util.out('Hide element highlight')}&nbsp;
79090
+ </label>
79058
79091
  <label style="display:block;margin-top:5px;margin-bottom:5px;">
79059
79092
  ${util.out('Row Tool Position')}:&nbsp;
79060
79093
  <select class="select-rowtool">
@@ -79074,18 +79107,6 @@ class Preferences {
79074
79107
  </div>
79075
79108
  <div style="width:50%">
79076
79109
 
79077
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
79078
- <input class="input-hidesnippetaddtool" type="checkbox" /> ${util.out('Hide Snippet (+) Tool')}&nbsp;
79079
- </label>
79080
-
79081
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
79082
- <input class="input-hideelementtool" type="checkbox" /> ${util.out('Hide element tool')}&nbsp;
79083
- </label>
79084
-
79085
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
79086
- <input class="input-hideelementhighlight" type="checkbox" /> ${util.out('Hide element highlight')}&nbsp;
79087
- </label>
79088
-
79089
79110
  <label class="option-opensnippets" style="display:block;margin-top:14px;margin-bottom:10px;">
79090
79111
  <input class="input-opensnippets" type="checkbox" /> ${util.out('Open snippets sidebar on start')}&nbsp;
79091
79112
  </label>
@@ -79098,16 +79119,7 @@ class Preferences {
79098
79119
  </select>
79099
79120
  </label>
79100
79121
 
79101
- <label style="display:block;margin-top:5px;margin-bottom:5px;">
79102
- ${util.out('Paste result')}:&nbsp;
79103
- <select class="select-pasteresult">
79104
- <option value="html-without-styles">${util.out('HTML (without styles)')}</option>
79105
- <option value="html">${util.out('HTML (with styles)')}</option>
79106
- <option value="text">${util.out('Text only')}</option>
79107
- </select>
79108
- </label>
79109
-
79110
- <label style="display:none;margin-top:14px;margin-bottom:5px;">
79122
+ <label style="margin-top:14px;margin-bottom:5px;">
79111
79123
  ${util.out('Toolbar visibility')}:&nbsp;
79112
79124
  <select class="select-editingtoolbardisplay">
79113
79125
  <option value="auto">${util.out('Auto')}</option>
@@ -79118,12 +79130,30 @@ class Preferences {
79118
79130
  <label style="${this.builder.isTouchSupport ? 'display:none;' : 'display:block;'}margin-top:5px;margin-bottom:5px;">
79119
79131
  ${util.out('Toolbar position')}:&nbsp;
79120
79132
  <select class="select-editingtoolbar">
79133
+ <option value="topfull">${util.out('Top (Full Width)')}</option>
79121
79134
  <option value="top">${util.out('Top')}</option>
79122
79135
  <option value="left">${util.out('Left')}</option>
79123
79136
  <option value="right">${util.out('Right')}</option>
79124
79137
  </select>
79125
79138
  </label>
79126
79139
 
79140
+ <label style="display:block;margin-top:5px;margin-bottom:5px;">
79141
+ ${util.out('Paste result')}:&nbsp;
79142
+ <select class="select-pasteresult">
79143
+ <option value="html-without-styles">${util.out('HTML (without styles)')}</option>
79144
+ <option value="html">${util.out('HTML (with styles)')}</option>
79145
+ <option value="text">${util.out('Text only')}</option>
79146
+ </select>
79147
+ </label>
79148
+
79149
+ <label style="display:block;margin-top:5px;margin-bottom:5px;">
79150
+ ${util.out('HTML View')}:&nbsp;
79151
+ <select class="select-htmlview">
79152
+ <option value="shorten">${util.out('Shorten HTML')}</option>
79153
+ <option value="actual">${util.out('Actual')}</option>
79154
+ </select>
79155
+ </label>
79156
+
79127
79157
  ${this.builder.themes ? `
79128
79158
  <label style="${this.builder.isTouchSupport ? 'display:none;' : 'display:block;'}margin-top:5px;margin-bottom:5px;">
79129
79159
  ${util.out('Theme')}:&nbsp;
@@ -79182,6 +79212,16 @@ class Preferences {
79182
79212
  this.builder.opts.paste = localStorage.getItem('_pasteresult');
79183
79213
  }
79184
79214
 
79215
+ if (localStorage.getItem('_htmlview') !== null) {
79216
+ let htmlView = localStorage.getItem('_htmlview');
79217
+
79218
+ if (htmlView === 'shorten') {
79219
+ this.builder.opts.shortenHTML = true;
79220
+ } else {
79221
+ this.builder.opts.shortenHTML = false;
79222
+ }
79223
+ }
79224
+
79185
79225
  if (localStorage.getItem('_hidecelltool') !== null) {
79186
79226
  if (localStorage.getItem('_hidecelltool') === '1') {
79187
79227
  this.builder.opts.columnTool = false;
@@ -79247,11 +79287,12 @@ class Preferences {
79247
79287
  }
79248
79288
 
79249
79289
  this.setToolStyle(this.builder.opts.toolStyle); // Always Auto
79250
- // if (localStorage.getItem('_editingtoolbardisplay') !== null) {
79251
- // this.builder.opts.toolbarDisplay = localStorage.getItem('_editingtoolbardisplay');
79252
- // }
79253
79290
 
79254
- this.builder.opts.toolbarDisplay = 'auto'; // this.setToolbarDisplay(this.builder.opts.toolbarDisplay);
79291
+ if (localStorage.getItem('_editingtoolbardisplay') !== null) {
79292
+ this.builder.opts.toolbarDisplay = localStorage.getItem('_editingtoolbardisplay');
79293
+ } // this.builder.opts.toolbarDisplay = 'auto';
79294
+ // this.setToolbarDisplay(this.builder.opts.toolbarDisplay);
79295
+
79255
79296
 
79256
79297
  if (localStorage.getItem('_snippetssidebardisplay') !== null) {
79257
79298
  this.builder.opts.snippetsSidebarDisplay = localStorage.getItem('_snippetssidebardisplay');
@@ -79378,6 +79419,12 @@ class Preferences {
79378
79419
  this.config.querySelector('.select-editingtoolbardisplay').value = this.builder.opts.toolbarDisplay;
79379
79420
  this.config.querySelector('.select-editingtoolbar').value = this.builder.opts.toolbar;
79380
79421
  this.config.querySelector('.select-snippetssidebardisplay').value = this.builder.opts.snippetsSidebarDisplay;
79422
+
79423
+ if (this.builder.opts.shortenHTML) {
79424
+ this.config.querySelector('.select-htmlview').value = 'shorten';
79425
+ } else {
79426
+ this.config.querySelector('.select-htmlview').value = 'actual';
79427
+ }
79381
79428
  }
79382
79429
 
79383
79430
  update() {
@@ -79473,10 +79520,10 @@ class Preferences {
79473
79520
  this.setToolStyle(toolStyle);
79474
79521
  let pasteResult = this.config.querySelector('.select-pasteresult').value;
79475
79522
  this.builder.opts.paste = pasteResult;
79476
- localStorage.setItem('_pasteresult', pasteResult); // let toolbarDisplay = this.config.querySelector('.select-editingtoolbardisplay').value;
79477
- // this.builder.opts.toolbarDisplay = toolbarDisplay;
79478
- // localStorage.setItem('_editingtoolbardisplay', toolbarDisplay);
79479
- // this.setToolbarDisplay(toolbarDisplay);
79523
+ localStorage.setItem('_pasteresult', pasteResult);
79524
+ let toolbarDisplay = this.config.querySelector('.select-editingtoolbardisplay').value;
79525
+ this.builder.opts.toolbarDisplay = toolbarDisplay;
79526
+ localStorage.setItem('_editingtoolbardisplay', toolbarDisplay); // this.setToolbarDisplay(toolbarDisplay);
79480
79527
 
79481
79528
  let snippetsSidebarDisplay = this.config.querySelector('.select-snippetssidebardisplay').value;
79482
79529
  this.builder.opts.snippetsSidebarDisplay = snippetsSidebarDisplay;
@@ -79485,11 +79532,27 @@ class Preferences {
79485
79532
  this.builder.opts.toolbar = toolbar;
79486
79533
  localStorage.setItem('_editingtoolbar', toolbar);
79487
79534
  this.setToolbar(toolbar);
79535
+ let htmlView = this.config.querySelector('.select-htmlview').value;
79536
+
79537
+ if (htmlView === 'shorten') {
79538
+ this.builder.opts.shortenHTML = true;
79539
+ } else {
79540
+ this.builder.opts.shortenHTML = false;
79541
+ }
79542
+
79543
+ localStorage.setItem('_htmlview', htmlView);
79488
79544
 
79489
79545
  if (this.builder.themes) {
79490
79546
  const n = this.builder.themeIndex;
79491
79547
  if (this.builder.themeIndex) localStorage.setItem('_theme', n);
79492
- }
79548
+ } // clear/hide rte pops
79549
+
79550
+
79551
+ const builderStuff = this.builder.builderStuff;
79552
+ let rtepops = builderStuff.querySelectorAll('.is-rte-pop');
79553
+ Array.prototype.forEach.call(rtepops, rtepop => {
79554
+ rtepop.style.display = '';
79555
+ });
79493
79556
  }
79494
79557
 
79495
79558
  setToolbar(toolbar) {
@@ -79497,10 +79560,20 @@ class Preferences {
79497
79560
  const builderStuff = this.builder.builderStuff;
79498
79561
  const contentStuff = this.builder.contentStuff;
79499
79562
 
79500
- if (toolbar === 'top') {
79563
+ if (toolbar === 'topfull') {
79564
+ builderStuff.setAttribute('toolbarfull', '');
79501
79565
  builderStuff.removeAttribute('toolbarleft', '');
79502
79566
  builderStuff.removeAttribute('toolbarright', '');
79503
79567
 
79568
+ if (this.builder.iframe) {
79569
+ contentStuff.removeAttribute('toolbarleft', '');
79570
+ contentStuff.removeAttribute('toolbarright', '');
79571
+ }
79572
+ } else if (toolbar === 'top') {
79573
+ builderStuff.removeAttribute('toolbarleft', '');
79574
+ builderStuff.removeAttribute('toolbarright', '');
79575
+ builderStuff.removeAttribute('toolbarfull', '');
79576
+
79504
79577
  if (this.builder.iframe) {
79505
79578
  contentStuff.removeAttribute('toolbarleft', '');
79506
79579
  contentStuff.removeAttribute('toolbarright', '');
@@ -79508,6 +79581,7 @@ class Preferences {
79508
79581
  } else if (toolbar === 'left') {
79509
79582
  builderStuff.setAttribute('toolbarleft', '');
79510
79583
  builderStuff.removeAttribute('toolbarright', '');
79584
+ builderStuff.removeAttribute('toolbarfull', '');
79511
79585
 
79512
79586
  if (this.builder.iframe) {
79513
79587
  contentStuff.setAttribute('toolbarleft', '');
@@ -79516,6 +79590,7 @@ class Preferences {
79516
79590
  } else if (toolbar === 'right') {
79517
79591
  builderStuff.setAttribute('toolbarright', '');
79518
79592
  builderStuff.removeAttribute('toolbarleft', '');
79593
+ builderStuff.removeAttribute('toolbarfull', '');
79519
79594
 
79520
79595
  if (this.builder.iframe) {
79521
79596
  contentStuff.setAttribute('toolbarright', '');
@@ -80083,6 +80158,41 @@ class Rte {
80083
80158
  let inpZoomSlider;
80084
80159
 
80085
80160
  if (!rteTool) {
80161
+ if (builder.plugins.length > 0) {
80162
+ let allButtons = ['|', 'addsnippet', 'bold', 'italic', 'underline', 'formatting', 'color', 'removeformat', 'align', 'textsettings', 'createlink', 'tags', 'undo', 'redo', 'zoom', 'icon', 'image', 'list', 'font', 'formatpara', 'gridtool', 'html', 'preferences', 'more', 'left', 'center', 'right', 'full'];
80163
+
80164
+ const filterButtons = myArray => {
80165
+ let newArray = myArray;
80166
+ myArray.forEach(item => {
80167
+ item = item.toLowerCase();
80168
+ let result = allButtons.filter(btnName => {
80169
+ return btnName === item;
80170
+ });
80171
+
80172
+ if (result.length === 0) {
80173
+ // a plugin
80174
+ result = builder.plugins.filter(plugin => {
80175
+ // check if plugin registered.
80176
+ return plugin.name === item;
80177
+ });
80178
+
80179
+ if (result.length === 0) {
80180
+ // plugin not registered
80181
+ newArray = newArray.filter(e => e !== item);
80182
+ }
80183
+ }
80184
+ });
80185
+ return newArray;
80186
+ };
80187
+
80188
+ builder.opts.buttons = filterButtons(builder.opts.buttons);
80189
+ builder.opts.buttonsMore = filterButtons(builder.opts.buttonsMore);
80190
+ builder.opts.elementButtons = filterButtons(builder.opts.elementButtons);
80191
+ builder.opts.elementButtonsMore = filterButtons(builder.opts.elementButtonsMore);
80192
+ builder.opts.iconButtons = filterButtons(builder.opts.iconButtons);
80193
+ builder.opts.iconButtonsMore = filterButtons(builder.opts.iconButtonsMore);
80194
+ }
80195
+
80086
80196
  let customtag_button = '';
80087
80197
  var customTagsHtml = '';
80088
80198
 
@@ -82673,7 +82783,48 @@ class Rte {
82673
82783
  dom.addClass(this.elementRteMoreOptions, 'deactive');
82674
82784
  }
82675
82785
  }
82676
- });
82786
+ }); // Backward compatible
82787
+
82788
+ this.builderStuff.insertAdjacentHTML('afterbegin', `
82789
+ <style>
82790
+ #_cbhtml[toolbarfull] .is-rte-tool,
82791
+ #_cbhtml[toolbarfull] .is-elementrte-tool {
82792
+ top: 0;
82793
+ left: 0;
82794
+ width: 100vw;
82795
+ align-items: center;
82796
+ box-shadow: rgba(0, 0, 0, 0.07) -1px 1px 0px 0px;
82797
+ }
82798
+ #_cbhtml[toolbarfull] .is-rte-pop {
82799
+ box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 0px 1px;
82800
+ }
82801
+ </style>
82802
+ `);
82803
+ /*
82804
+ if(this.builder.toolbar === 'topfull') {
82805
+ if(window.getComputedStyle(this.rteTool).getPropertyValue('left') !== '0px') {
82806
+ this.builderStuff.insertAdjacentHTML('afterbegin', `
82807
+ <style>
82808
+ #_cbhtml[toolbarfull] .is-rte-tool,
82809
+ #_cbhtml[toolbarfull] .is-elementrte-tool {
82810
+ top: 0;
82811
+ left: 0;
82812
+ width: 100vw;
82813
+ align-items: center;
82814
+ box-shadow: rgba(0, 0, 0, 0.07) -1px 1px 0px 0px;
82815
+ }
82816
+ #_cbhtml[toolbarfull] .is-rte-pop {
82817
+ box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 0px 1px;
82818
+ }
82819
+ </style>
82820
+ `);
82821
+ }
82822
+ }
82823
+ */
82824
+
82825
+ if (this.builder.toolbarDisplay !== 'auto') {
82826
+ this.showDefaultToolbar(); // first time
82827
+ }
82677
82828
  }
82678
82829
 
82679
82830
  zoomStart() {
@@ -82920,10 +83071,12 @@ class Rte {
82920
83071
  let top;
82921
83072
  let left;
82922
83073
  const btnRteMore = this.rteTool.querySelectorAll('button.rte-more');
83074
+ let btnWidth = 0;
82923
83075
  btnRteMore.forEach(btn => {
82924
83076
  if (btn.getBoundingClientRect().top > 0) {
82925
83077
  top = btn.getBoundingClientRect().top;
82926
83078
  left = btn.getBoundingClientRect().left;
83079
+ btnWidth = btn.offsetWidth;
82927
83080
  }
82928
83081
  });
82929
83082
  const pop = this.rteMoreOptions;
@@ -82950,6 +83103,10 @@ class Rte {
82950
83103
  pop.style.left = parseFloat(this.rteTool.style.left) + this.rteTool.offsetWidth - w + adj + 'px'; //(left -(w/2)+23) + 'px';
82951
83104
 
82952
83105
  pop.style.right = 'auto';
83106
+
83107
+ if (this.builderStuff.hasAttribute('toolbarfull')) {
83108
+ pop.style.left = left - w + btnWidth + 'px';
83109
+ }
82953
83110
  }
82954
83111
  } // showElementRteMore() {
82955
83112
  // const btnElementRteMore = this.elementRteTool.querySelector('button.rte-more');
@@ -83025,6 +83182,10 @@ class Rte {
83025
83182
  pop.style.left = parseFloat(this.elementRteTool.style.left) + this.elementRteTool.offsetWidth - w + adj + 'px'; //(left -(w/2)+23) + 'px';
83026
83183
 
83027
83184
  pop.style.right = 'auto';
83185
+
83186
+ if (this.builderStuff.hasAttribute('toolbarfull')) {
83187
+ pop.style.left = left - w + btnElementRteMore.offsetWidth + 'px';
83188
+ }
83028
83189
  }
83029
83190
  }
83030
83191
 
@@ -83172,6 +83333,60 @@ class Rte {
83172
83333
  dom.cleanClassSize(elm, classname); // dom.cleanUnusedSpan(elm); // will remove empty spans that makes selection changes
83173
83334
  }
83174
83335
 
83336
+ hideAlignButtons() {
83337
+ let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83338
+ let separator1;
83339
+ let separator2;
83340
+ Array.prototype.forEach.call(btns, btn => {
83341
+ btn.style.display = 'none';
83342
+
83343
+ if (btn.previousElementSibling) {
83344
+ if (btn.previousElementSibling.classList.contains('rte-separator')) {
83345
+ separator1 = btn.previousElementSibling;
83346
+ }
83347
+ }
83348
+
83349
+ if (btn.nextElementSibling) {
83350
+ if (btn.nextElementSibling.classList.contains('rte-separator')) {
83351
+ separator2 = btn.nextElementSibling;
83352
+ }
83353
+ }
83354
+ });
83355
+
83356
+ if (separator1 && separator2) {
83357
+ separator2.style.display = 'none';
83358
+ }
83359
+
83360
+ btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83361
+
83362
+ Array.prototype.forEach.call(btns, btn => {
83363
+ btn.style.display = 'none';
83364
+ });
83365
+ }
83366
+
83367
+ showAlignButtons() {
83368
+ let separators = this.elementRteTool.querySelectorAll('.rte-separator');
83369
+ Array.prototype.forEach.call(separators, separator => {
83370
+ separator.style.display = '';
83371
+ });
83372
+ let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83373
+ Array.prototype.forEach.call(btns, btn => {
83374
+ btn.style.display = '';
83375
+ });
83376
+ btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83377
+
83378
+ Array.prototype.forEach.call(btns, btn => {
83379
+ btn.style.display = '';
83380
+ });
83381
+ }
83382
+
83383
+ showDefaultToolbar() {
83384
+ this.elementRteTool.style.display = 'flex';
83385
+ this.rteTool.style.display = 'none';
83386
+ this.hideAlignButtons();
83387
+ this.positionToolbar();
83388
+ }
83389
+
83175
83390
  click(col) {
83176
83391
  const dom = this.dom;
83177
83392
  let elm = this.builder.inspectedElement;
@@ -83213,32 +83428,32 @@ class Rte {
83213
83428
  if ((elm.tagName.toLowerCase() === 'img' || dom.hasClass(elm, 'is-social') || dom.hasClass(elm, 'is-rounded-button-medium') || dom.hasClass(elm, 'cell-active')) && !dom.getSelected()) {
83214
83429
  if (this.elementRteTool.style.display === 'none' || this.elementRteTool.style.display === '') {
83215
83430
  this.elementRteTool.style.display = 'flex';
83216
- this.rteTool.style.display = 'none';
83217
- let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83218
- Array.prototype.forEach.call(btns, btn => {
83219
- btn.style.display = '';
83220
- });
83221
- btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83431
+ this.rteTool.style.display = 'none'; // let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83432
+ // Array.prototype.forEach.call(btns, (btn) => {
83433
+ // btn.style.display = '';
83434
+ // });
83435
+ // btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83436
+ // Array.prototype.forEach.call(btns, (btn) => {
83437
+ // btn.style.display = '';
83438
+ // });
83222
83439
 
83223
- Array.prototype.forEach.call(btns, btn => {
83224
- btn.style.display = '';
83225
- });
83440
+ this.showAlignButtons();
83226
83441
  this.positionToolbar();
83227
83442
  }
83228
83443
  } else if (dom.hasClass(elm, 'spacer') || elm.tagName.toLowerCase() === 'video' || dom.hasClass(elm, 'ovl') || col.getAttribute('data-html')) {
83229
83444
  //|| col===elm
83230
83445
  if (this.elementRteTool.style.display === 'none' || this.elementRteTool.style.display === '') {
83231
83446
  this.elementRteTool.style.display = 'flex';
83232
- this.rteTool.style.display = 'none';
83233
- let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83234
- Array.prototype.forEach.call(btns, btn => {
83235
- btn.style.display = 'none';
83236
- });
83237
- btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83447
+ this.rteTool.style.display = 'none'; // let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83448
+ // Array.prototype.forEach.call(btns, (btn) => {
83449
+ // btn.style.display = 'none';
83450
+ // });
83451
+ // btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83452
+ // Array.prototype.forEach.call(btns, (btn) => {
83453
+ // btn.style.display = 'none';
83454
+ // });
83238
83455
 
83239
- Array.prototype.forEach.call(btns, btn => {
83240
- btn.style.display = 'none';
83241
- });
83456
+ this.hideAlignButtons();
83242
83457
  this.positionToolbar();
83243
83458
  }
83244
83459
  } else if (dom.hasClass(elm, 'icon')) {
@@ -83261,16 +83476,16 @@ class Rte {
83261
83476
  } else {
83262
83477
  if (this.elementRteTool.style.display === 'none' || this.elementRteTool.style.display === '') {
83263
83478
  this.elementRteTool.style.display = 'flex';
83264
- this.rteTool.style.display = 'none';
83265
- let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83266
- Array.prototype.forEach.call(btns, btn => {
83267
- btn.style.display = '';
83268
- });
83269
- btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83479
+ this.rteTool.style.display = 'none'; // let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83480
+ // Array.prototype.forEach.call(btns, (btn) => {
83481
+ // btn.style.display = '';
83482
+ // });
83483
+ // btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83484
+ // Array.prototype.forEach.call(btns, (btn) => {
83485
+ // btn.style.display = '';
83486
+ // });
83270
83487
 
83271
- Array.prototype.forEach.call(btns, btn => {
83272
- btn.style.display = '';
83273
- });
83488
+ this.showAlignButtons();
83274
83489
  this.positionToolbar();
83275
83490
  }
83276
83491
  }
@@ -83278,16 +83493,16 @@ class Rte {
83278
83493
  } else {
83279
83494
  if (this.elementRteTool.style.display === 'none' || this.elementRteTool.style.display === '') {
83280
83495
  this.elementRteTool.style.display = 'flex';
83281
- this.rteTool.style.display = 'none';
83282
- let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83283
- Array.prototype.forEach.call(btns, btn => {
83284
- btn.style.display = 'none';
83285
- });
83286
- btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83496
+ this.rteTool.style.display = 'none'; // let btns = this.elementRteTool.querySelectorAll('button[data-align]');
83497
+ // Array.prototype.forEach.call(btns, (btn) => {
83498
+ // btn.style.display = 'none';
83499
+ // });
83500
+ // btns = this.elementRteMoreOptions.querySelectorAll('button[data-align]'); //new
83501
+ // Array.prototype.forEach.call(btns, (btn) => {
83502
+ // btn.style.display = 'none';
83503
+ // });
83287
83504
 
83288
- Array.prototype.forEach.call(btns, btn => {
83289
- btn.style.display = 'none';
83290
- });
83505
+ this.hideAlignButtons();
83291
83506
  this.positionToolbar();
83292
83507
  }
83293
83508
  }
@@ -88454,6 +88669,7 @@ class ContentBuilder {
88454
88669
  snippetOpen: false,
88455
88670
  toolbar: 'top',
88456
88671
  toolbarDisplay: 'auto',
88672
+ shortenHTML: true,
88457
88673
  snippetsSidebarDisplay: 'auto',
88458
88674
  // snippetDisplay: 'auto', // values: auto, visible (a new alternative). If used, will set the snippetsSidebarDisplay
88459
88675
  // onImageSelectClick: function () { },
@@ -89318,6 +89534,10 @@ class ContentBuilder {
89318
89534
  // Additional (to prevent lost focus)
89319
89535
  util.clearActiveCell();
89320
89536
  util.clearControls();
89537
+
89538
+ if (this.toolbarDisplay !== 'auto') {
89539
+ this.rte.showDefaultToolbar();
89540
+ }
89321
89541
  }
89322
89542
  }
89323
89543
 
@@ -103479,6 +103699,7 @@ class ContentBox {
103479
103699
  useButtonPlugin: this.settings.useButtonPlugin,
103480
103700
  enableDragResize: this.settings.enableDragResize,
103481
103701
  simpleTextSettings: this.settings.simpleTextSettings,
103702
+ shortenHTML: this.settings.shortenHTML,
103482
103703
  zoom: this.settings.zoom,
103483
103704
  onZoomStart: () => {
103484
103705
  const wrapper = this.wrapperEl; // wrapper.style.transition = 'all ease 0.1s';