@innovastudio/contentbox 1.6.30 → 1.6.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.
@@ -1241,7 +1241,9 @@ class SideBar {
1241
1241
  this.builder.editor.saveForUndo();
1242
1242
  var html = builderStuff.querySelector('#inpViewHtml').value;
1243
1243
  html = this.builder.editor.fromViewToActual(html);
1244
- this.builder.loadHtml(html); //Trigger Change event
1244
+ this.builder.loadHtml(html);
1245
+ this.builder.editor.hideElementTools();
1246
+ if (this.builder.onSelectChange) this.builder.onSelectChange(); //Trigger Change event
1245
1247
 
1246
1248
  this.builder.settings.onChange(); //Close sidebar
1247
1249
 
@@ -8953,19 +8955,56 @@ class Text {
8953
8955
  span.removeAttribute('data-keep');
8954
8956
  }
8955
8957
  }); // clean
8958
+ // let elms = activeColumn.querySelectorAll('ul,p');
8959
+ // Array.prototype.forEach.call(elms, (elm) => {
8960
+ // let text = elm.innerHTML.trim();
8961
+ // if(text==='') {
8962
+ // elm.parentNode.removeChild(elm);
8963
+ // }
8964
+ // });
8956
8965
 
8957
- let elms = activeColumn.querySelectorAll('ul,p');
8958
- Array.prototype.forEach.call(elms, elm => {
8959
- let text = elm.innerHTML.trim();
8966
+ let elm = this.getElm();
8967
+ const ul = elm.closest('ul,ol');
8968
+ const p = elm.closest('p,h1,h2,h3,h4,h5,h6');
8969
+
8970
+ if (ul && p) {
8971
+ /*
8972
+ Case:
8973
+ After applying list, the structure will be:
8974
+ <p style="...">
8975
+ <ul>
8976
+ <li>Lorem ipsum</li>
8977
+ </ul>
8978
+ </p>
8979
+ DOM will reformat this into:
8980
+ <p style="..."></p>
8981
+ <ul>
8982
+ <li>Lorem ipsum</li>
8983
+ </ul>
8984
+ <p></p>
8985
+ The list will lost its style
8986
+ */
8987
+ const list = ul.querySelectorAll('li');
8988
+ list.forEach(li => {
8989
+ this.appendAttributes(p, li);
8990
+ });
8991
+ }
8960
8992
 
8961
- if (text === '') {
8962
- elm.parentNode.removeChild(elm);
8963
- }
8964
- });
8965
8993
  onFinish();
8966
8994
  }, 10);
8967
8995
  }
8968
8996
 
8997
+ appendAttributes(sourceElement, destinationElement) {
8998
+ // Append classes
8999
+ destinationElement.classList.add(...sourceElement.classList); // Append styles
9000
+
9001
+ for (let i = 0; i < sourceElement.style.length; i++) {
9002
+ let property = sourceElement.style[i];
9003
+ let value = sourceElement.style.getPropertyValue(property);
9004
+ destinationElement.style.setProperty(property, value);
9005
+ }
9006
+ }
9007
+
8969
9008
  formatText(command) {
8970
9009
  if (command === 'bold') this.execCommandToggle('fontWeight');
8971
9010
  if (command === 'italic') this.execCommandToggle('fontStyle');
@@ -11183,6 +11222,15 @@ class PanelText {
11183
11222
 
11184
11223
  if (elm && elm.closest('.' + config.textTransform.uppercase)) {
11185
11224
  this.panel.querySelector('button[data-format=uppercase]').classList.add('on');
11225
+ }
11226
+
11227
+ this.panel.querySelector('button[data-action=insertUnorderedList]').classList.remove('on');
11228
+ this.panel.querySelector('button[data-action=insertOrderedList]').classList.remove('on');
11229
+
11230
+ if (elm && elm.closest('ul')) {
11231
+ this.panel.querySelector('button[data-action=insertUnorderedList]').classList.add('on');
11232
+ } else if (elm && elm.closest('ol')) {
11233
+ this.panel.querySelector('button[data-action=insertOrderedList]').classList.add('on');
11186
11234
  } // Alignment
11187
11235
 
11188
11236
 
@@ -12476,7 +12524,12 @@ class PanelSvg {
12476
12524
  let currentColor = this.builder.editor.dom.getStyle(svg, 'color');
12477
12525
  const colorpicker = this.builder.editor.colorpicker();
12478
12526
  colorpicker.open(color => {
12479
- svg.style.color = color;
12527
+ if (svg.style.fill) {
12528
+ svg.style.fill = color;
12529
+ } else {
12530
+ svg.style.color = color;
12531
+ }
12532
+
12480
12533
  btnColorPick.style.backgroundColor = color; // preview
12481
12534
 
12482
12535
  this.builder.editor.onChange();
@@ -12556,8 +12609,16 @@ class PanelSvg {
12556
12609
  if (div.classList.contains('text-right')) panel.querySelector('[data-align="right"]').classList.add('on');
12557
12610
  if (div.classList.contains('text-center')) panel.querySelector('[data-align="center"]').classList.add('on');
12558
12611
  if (div.classList.contains('text-justify')) panel.querySelector('[data-align="justify"]').classList.add('on');
12559
- const btnColorPick = panel.querySelector('.btn-color');
12560
- let currentColor = this.builder.editor.dom.getStyle(svg, 'color');
12612
+ const btnColorPick = panel.querySelector('.btn-color'); // let currentColor = this.builder.editor.dom.getStyle(svg, 'color');
12613
+
12614
+ let currentColor;
12615
+
12616
+ if (svg.style.fill) {
12617
+ currentColor = svg.style.fill;
12618
+ } else {
12619
+ currentColor = svg.style.color;
12620
+ }
12621
+
12561
12622
  btnColorPick.style.backgroundColor = currentColor; // panel.querySelectorAll('.fontsizes button').forEach(btn=>btn.classList.remove('on'));
12562
12623
  // let currentSize = svg.getAttribute('width');
12563
12624
  // panel.querySelectorAll('.fontsizes button').forEach(btn=>{
@@ -25193,7 +25254,7 @@ class ControlPanel {
25193
25254
  this.title.innerHTML = titleHtml;
25194
25255
  this.panelIframe.classList.add('active');
25195
25256
  this.objPanelIframe.getState();
25196
- } else if (element.tagName.toLowerCase() === 'i' && element.classList.contains('icon')) {
25257
+ } else if (element.tagName.toLowerCase() === 'i' && (element.classList.contains('icon') || element.classList.contains('bi'))) {
25197
25258
  let titleHtml = out('Icon');
25198
25259
  this.title.innerHTML = titleHtml;
25199
25260
  this.panelIcon.classList.add('active');
@@ -26689,7 +26750,7 @@ const renderQuickAdd = builder => {
26689
26750
  elm = quickadd.querySelector('.add-list');
26690
26751
  dom.addEventListener(elm, 'click', () => {
26691
26752
  const mode = quickadd.getAttribute('data-mode');
26692
- const html = `<ul style="list-style: initial;padding-left: 20px;">
26753
+ const html = `<ul>
26693
26754
  <li>Lorem Ipsum is simply dummy text</li>
26694
26755
  <li>Lorem Ipsum is simply dummy text</li>
26695
26756
  </ul>`;
@@ -27385,7 +27446,10 @@ class Util$1 {
27385
27446
  const dom = this.dom;
27386
27447
  dom.removeClass(modal, 'active');
27387
27448
  modal.style.display = '';
27449
+
27450
+ // document.body.style.overflow = '';
27388
27451
  }
27452
+
27389
27453
  refreshModuleLayout(col) {
27390
27454
  let savedHeight;
27391
27455
  if (col.style.height) savedHeight = col.style.height;else col.style.height = `${col.offsetHeight}px`;
@@ -27741,13 +27805,27 @@ class Util$1 {
27741
27805
  if (!elm) return;
27742
27806
  this.builder.uo.saveForUndo();
27743
27807
  let element = elm;
27744
- // while(!dom.hasClass(element.parentNode, 'cell-active')) {
27745
- // element = element.parentNode;
27746
- // }
27747
- element.insertAdjacentHTML('afterend', html);
27808
+ let newelement;
27809
+ if (!element.nextElementSibling) {
27810
+ // active element is div.display > p.
27811
+ let activeCol = this.builder.activeCol;
27812
+ let current;
27813
+ const elms = dom.elementChildren(activeCol);
27814
+ elms.forEach(child => {
27815
+ if (child.contains(element)) {
27816
+ current = child;
27817
+ }
27818
+ });
27819
+ if (current) {
27820
+ current.insertAdjacentHTML('afterend', html); // add new element after div.display
27821
+ newelement = current.nextElementSibling;
27822
+ }
27823
+ } else {
27824
+ element.insertAdjacentHTML('afterend', html);
27825
+ newelement = element.nextElementSibling;
27826
+ }
27748
27827
  let builderActive = this.builder.doc.querySelector('.builder-active');
27749
27828
  if (builderActive) this.builder.applyBehaviorOn(builderActive);
27750
- let newelement = element.nextElementSibling;
27751
27829
  if (newelement.tagName.toLowerCase() === 'img') {
27752
27830
  let checkLoad = setInterval(() => {
27753
27831
  if (newelement.complete) {
@@ -30376,6 +30454,12 @@ class Dom {
30376
30454
  }
30377
30455
  });
30378
30456
  }
30457
+ countOccurrences(text, word) {
30458
+ // match the word globally and case insensitively
30459
+ const regex = new RegExp(word, 'gi');
30460
+ const matches = text.match(regex);
30461
+ return matches ? matches.length : 0;
30462
+ }
30379
30463
  }
30380
30464
 
30381
30465
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -36836,97 +36920,86 @@ class HtmlUtil {
36836
36920
  col.style.cursor = '';
36837
36921
  });
36838
36922
  });
36839
- let elms = tmp.querySelectorAll('.sortable-chosen');
36840
- dom.removeClasses(elms, 'sortable-chosen');
36841
- elms = tmp.querySelectorAll('.sortable-ghost');
36842
- dom.removeClasses(elms, 'sortable-ghost');
36843
- elms = tmp.querySelectorAll('.elm-active');
36844
- dom.removeClasses(elms, 'elm-active');
36845
- elms = tmp.querySelectorAll('.icon-active');
36846
- dom.removeClasses(elms, 'icon-active');
36847
- elms = tmp.querySelectorAll('.elm-inspected');
36848
- dom.removeClasses(elms, 'elm-inspected');
36849
- elms = tmp.querySelectorAll('.cell-active');
36850
- dom.removeClasses(elms, 'cell-active');
36851
- elms = tmp.querySelectorAll('.row-active');
36852
- dom.removeClasses(elms, 'row-active');
36853
- elms = tmp.querySelectorAll('.row-outline');
36854
- dom.removeClasses(elms, 'row-outline');
36855
- elms = tmp.querySelectorAll('.is-builder');
36856
- dom.removeClasses(elms, 'is-builder');
36857
- elms = tmp.querySelectorAll('.row-outline');
36858
- dom.removeClasses(elms, 'row-outline');
36859
- elms = tmp.querySelectorAll('[data-click]');
36860
- dom.removeAttributes(elms, 'data-click');
36861
- elms = tmp.querySelectorAll('[contenteditable]');
36862
- dom.removeAttributes(elms, 'contenteditable');
36863
- elms = tmp.querySelectorAll('[draggridoutline]');
36864
- dom.removeAttributes(elms, 'draggridoutline');
36865
- elms = tmp.querySelectorAll('[between-blocks-left]');
36866
- dom.removeAttributes(elms, 'between-blocks-left');
36867
- elms = tmp.querySelectorAll('[between-blocks-center]');
36868
- dom.removeAttributes(elms, 'between-blocks-center');
36869
- elms = tmp.querySelectorAll('[hideelementhighlight]');
36870
- dom.removeAttributes(elms, 'hideelementhighlight');
36871
- elms = tmp.querySelectorAll('[data-module-active]');
36872
- dom.removeAttributes(elms, 'data-module-active');
36873
- elms = tmp.querySelectorAll('[draggable]');
36874
- dom.removeAttributes(elms, 'draggable');
36875
- elms = tmp.querySelectorAll('[data-animated]');
36876
- dom.removeAttributes(elms, 'data-animated');
36877
- elms = tmp.querySelectorAll('[data-saveforundo]');
36878
- dom.removeAttributes(elms, 'data-saveforundo');
36879
- elms = tmp.querySelectorAll('[hidesnippetaddtool]');
36880
- dom.removeAttributes(elms, 'hidesnippetaddtool');
36881
- elms = tmp.querySelectorAll('[gray]');
36882
- dom.removeAttributes(elms, 'gray');
36883
- elms = tmp.querySelectorAll('[rowoutline]');
36884
- dom.removeAttributes(elms, 'rowoutline');
36885
- elms = tmp.querySelectorAll('[hidecolumntool]');
36886
- dom.removeAttributes(elms, 'hidecolumntool');
36887
- elms = tmp.querySelectorAll('[grayoutline]');
36888
- dom.removeAttributes(elms, 'grayoutline');
36889
- elms = tmp.querySelectorAll('[hideoutline]');
36890
- dom.removeAttributes(elms, 'hideoutline');
36891
- elms = tmp.querySelectorAll('[leftrowtool]');
36892
- dom.removeAttributes(elms, 'leftrowtool');
36893
- elms = tmp.querySelectorAll('[minimal]');
36894
- dom.removeAttributes(elms, 'minimal');
36895
- elms = tmp.querySelectorAll('[clean]');
36896
- dom.removeAttributes(elms, 'clean');
36897
- elms = tmp.querySelectorAll('[grideditor]');
36898
- dom.removeAttributes(elms, 'grideditor');
36899
- elms = tmp.querySelectorAll('[gridoutline]');
36900
- dom.removeAttributes(elms, 'gridoutline');
36901
- dom.removeElements(tmp.querySelectorAll('.is-row-tool'));
36902
- dom.removeElements(tmp.querySelectorAll('.is-col-tool'));
36903
- dom.removeElements(tmp.querySelectorAll('.is-rowadd-tool'));
36904
- dom.removeElements(tmp.querySelectorAll('.ovl'));
36905
- dom.removeElements(tmp.querySelectorAll('.row-add-initial'));
36923
+ let elms;
36924
+ elms = tmp.querySelectorAll('.sortable-chosen, .sortable-ghost, .elm-active, .icon-active, .elm-inspected, .cell-active, .row-active, .row-outline, .is-builder');
36925
+ elms.forEach(elm => {
36926
+ elm.classList.remove('sortable-chosen');
36927
+ elm.classList.remove('sortable-ghost');
36928
+ elm.classList.remove('elm-active');
36929
+ elm.classList.remove('icon-active');
36930
+ elm.classList.remove('elm-inspected');
36931
+ elm.classList.remove('cell-active');
36932
+ elm.classList.remove('row-active');
36933
+ elm.classList.remove('row-outline');
36934
+ elm.classList.remove('is-builder');
36935
+ });
36936
+ elms = tmp.querySelectorAll('[data-click], [contenteditable], [draggridoutline], [between-blocks-left], [between-blocks-center], [hideelementhighlight], [data-module-active], [draggable]');
36937
+ elms.forEach(elm => {
36938
+ elm.removeAttribute('data-click');
36939
+ elm.removeAttribute('contenteditable');
36940
+ elm.removeAttribute('draggridoutline');
36941
+ elm.removeAttribute('between-blocks-left');
36942
+ elm.removeAttribute('between-blocks-center');
36943
+ elm.removeAttribute('hideelementhighlight');
36944
+ elm.removeAttribute('data-module-active');
36945
+ elm.removeAttribute('draggable');
36946
+ });
36947
+ elms = tmp.querySelectorAll('[data-animated], [data-saveforundo], [hidesnippetaddtool], [gray], [rowoutline], [hidecolumntool], [grayoutline], [hideoutline]');
36948
+ elms.forEach(elm => {
36949
+ elm.removeAttribute('data-animated');
36950
+ elm.removeAttribute('data-saveforundo');
36951
+ elm.removeAttribute('hidesnippetaddtool');
36952
+ elm.removeAttribute('gray');
36953
+ elm.removeAttribute('rowoutline');
36954
+ elm.removeAttribute('hidecolumntool');
36955
+ elm.removeAttribute('grayoutline');
36956
+ elm.removeAttribute('hideoutline');
36957
+ });
36958
+ elms = tmp.querySelectorAll('[leftrowtool], [minimal], [clean], [grideditor], [gridoutline]');
36959
+ elms.forEach(elm => {
36960
+ elm.removeAttribute('leftrowtool');
36961
+ elm.removeAttribute('minimal');
36962
+ elm.removeAttribute('clean');
36963
+ elm.removeAttribute('grideditor');
36964
+ elm.removeAttribute('gridoutline');
36965
+ });
36966
+ elms = tmp.querySelectorAll('.is-row-tool,.is-col-tool,.is-rowadd-tool,.is-canvas-tool,.is-canvasadd-tool');
36967
+ elms.forEach(elm => {
36968
+ if (elm.previousSibling && elm.previousSibling.nodeType === Node.TEXT_NODE) {
36969
+ elm.previousSibling.remove();
36970
+ }
36971
+ if (elm.nextSibling && elm.nextSibling.nodeType === Node.TEXT_NODE) {
36972
+ elm.nextSibling.remove();
36973
+ }
36974
+ elm.remove();
36975
+ });
36976
+ elms = tmp.querySelectorAll('.ovl,.row-add-initial');
36977
+ elms.forEach(elm => {
36978
+ elm.remove();
36979
+ });
36906
36980
 
36907
36981
  //Extra cleaning
36908
36982
  if (this.builder.cleanAOS) {
36909
- elms = tmp.querySelectorAll('.aos-init');
36910
- dom.removeClasses(elms, 'aos-init');
36911
- elms = tmp.querySelectorAll('.aos-animate');
36912
- dom.removeClasses(elms, 'aos-animate');
36913
- }
36914
- elms = tmp.querySelectorAll('.skrollable');
36915
- dom.removeClasses(elms, 'skrollable');
36916
- elms = tmp.querySelectorAll('.skrollable-after');
36917
- dom.removeClasses(elms, 'skrollable-after');
36918
- elms = tmp.querySelectorAll('.skrollable-before');
36919
- dom.removeClasses(elms, 'skrollable-before');
36920
- elms = tmp.querySelectorAll('.skrollable-between');
36921
- dom.removeClasses(elms, 'skrollable-between');
36922
- elms = tmp.querySelectorAll('.is-inview');
36923
- dom.removeClasses(elms, 'is-inview');
36983
+ elms = tmp.querySelectorAll('.aos-init, .aos-animate');
36984
+ elms.forEach(elm => {
36985
+ elm.classList.remove('aos-init');
36986
+ elm.classList.remove('aos-animate');
36987
+ });
36988
+ }
36989
+ elms = tmp.querySelectorAll('.skrollable, .skrollable-after, .skrollable-before, .skrollable-between, .is-inview');
36990
+ elms.forEach(elm => {
36991
+ elm.classList.remove('skrollable');
36992
+ elm.classList.remove('skrollable-after');
36993
+ elm.classList.remove('skrollable-before');
36994
+ elm.classList.remove('skrollable-between');
36995
+ elm.classList.remove('is-inview');
36996
+ });
36924
36997
  let emptyclasses = tmp.querySelectorAll('[class=""]');
36925
- Array.prototype.forEach.call(emptyclasses, emptyclass => {
36998
+ emptyclasses.forEach(emptyclass => {
36926
36999
  emptyclass.removeAttribute('class');
36927
37000
  });
36928
37001
  let unusedOverlays = tmp.querySelectorAll('.is-row-overlay');
36929
- Array.prototype.forEach.call(unusedOverlays, unusedOverlay => {
37002
+ unusedOverlays.forEach(unusedOverlay => {
36930
37003
  if (!unusedOverlay.hasAttribute('style')) unusedOverlay.parentNode.removeChild(unusedOverlay);
36931
37004
  });
36932
37005
  dom.removeEmptyStyle(tmp);
@@ -36935,7 +37008,7 @@ class HtmlUtil {
36935
37008
 
36936
37009
  //Backward compatible: cleanup button <span contenteditable="false"><a contenteditable="true">button</a></span>
36937
37010
  let links = tmp.querySelectorAll('a');
36938
- Array.prototype.forEach.call(links, link => {
37011
+ links.forEach(link => {
36939
37012
  if (link.style.display === 'inline-block') {
36940
37013
  if (link.parentNode.childElementCount === 1 && link.parentNode.tagName.toLowerCase() === 'span') {
36941
37014
  link.parentNode.outerHTML = link.parentNode.innerHTML;
@@ -36953,85 +37026,44 @@ class HtmlUtil {
36953
37026
  //ContentBox
36954
37027
 
36955
37028
  // Remove dummy DIV after last section
36956
- let elms = tmp.querySelectorAll('.is-dummy');
36957
- dom.removeElements(elms);
36958
- elms = tmp.querySelectorAll('[data-scroll]');
36959
- dom.removeAttributes(elms, 'data-scroll');
36960
- elms = tmp.querySelectorAll('[data-scroll-once]');
36961
- dom.removeAttributes(elms, 'data-scroll-once');
37029
+ elms = tmp.querySelectorAll('.is-dummy');
37030
+ elms.forEach(elm => {
37031
+ elm.remove();
37032
+ });
37033
+ elms = tmp.querySelectorAll('[data-scroll], [data-scroll-once]');
37034
+ elms.forEach(elm => {
37035
+ elm.removeAttribute('data-scroll');
37036
+ elm.removeAttribute('data-scroll-once');
37037
+ });
36962
37038
  if (this.builder.shortenOutput) {
36963
- elms = tmp.querySelectorAll('[data-noedit]');
36964
- dom.removeAttributes(elms, 'data-noedit');
36965
- elms = tmp.querySelectorAll('[data-module]');
36966
- dom.removeAttributes(elms, 'data-module');
36967
- elms = tmp.querySelectorAll('[data-module-desc]');
36968
- dom.removeAttributes(elms, 'data-module-desc');
36969
- elms = tmp.querySelectorAll('[data-dialog-width]');
36970
- dom.removeAttributes(elms, 'data-dialog-width');
36971
- elms = tmp.querySelectorAll('[data-dialog-height]');
36972
- dom.removeAttributes(elms, 'data-dialog-height');
36973
- elms = tmp.querySelectorAll('[data-html]');
36974
- dom.removeAttributes(elms, 'data-html');
36975
- elms = tmp.querySelectorAll('[data-settings]');
36976
- dom.removeAttributes(elms, 'data-settings');
36977
- elms = tmp.querySelectorAll('[data-html-1]');
36978
- dom.removeAttributes(elms, 'data-html-1');
36979
- elms = tmp.querySelectorAll('[data-html-2]');
36980
- dom.removeAttributes(elms, 'data-html-2');
36981
- elms = tmp.querySelectorAll('[data-html-3]');
36982
- dom.removeAttributes(elms, 'data-html-3');
36983
- elms = tmp.querySelectorAll('[data-html-4]');
36984
- dom.removeAttributes(elms, 'data-html-4');
36985
- elms = tmp.querySelectorAll('[data-html-5]');
36986
- dom.removeAttributes(elms, 'data-html-5');
36987
- elms = tmp.querySelectorAll('[data-html-6]');
36988
- dom.removeAttributes(elms, 'data-html-6');
36989
- elms = tmp.querySelectorAll('[data-html-7]');
36990
- dom.removeAttributes(elms, 'data-html-7');
36991
- elms = tmp.querySelectorAll('[data-html-8]');
36992
- dom.removeAttributes(elms, 'data-html-8');
36993
- elms = tmp.querySelectorAll('[data-html-9]');
36994
- dom.removeAttributes(elms, 'data-html-9');
36995
- elms = tmp.querySelectorAll('[data-html-10]');
36996
- dom.removeAttributes(elms, 'data-html-10');
36997
- elms = tmp.querySelectorAll('[data-html-12]');
36998
- dom.removeAttributes(elms, 'data-html-12');
36999
- elms = tmp.querySelectorAll('[data-html-13]');
37000
- dom.removeAttributes(elms, 'data-html-13');
37001
- elms = tmp.querySelectorAll('[data-html-14]');
37002
- dom.removeAttributes(elms, 'data-html-14');
37003
- elms = tmp.querySelectorAll('[data-html-15]');
37004
- dom.removeAttributes(elms, 'data-html-15');
37005
- elms = tmp.querySelectorAll('[data-html-16]');
37006
- dom.removeAttributes(elms, 'data-html-16');
37007
- elms = tmp.querySelectorAll('[data-html-17]');
37008
- dom.removeAttributes(elms, 'data-html-17');
37009
- elms = tmp.querySelectorAll('[data-html-18]');
37010
- dom.removeAttributes(elms, 'data-html-18');
37011
- elms = tmp.querySelectorAll('[data-html-19]');
37012
- dom.removeAttributes(elms, 'data-html-19');
37013
- elms = tmp.querySelectorAll('[data-html-20]');
37014
- dom.removeAttributes(elms, 'data-html-20');
37015
- elms = tmp.querySelectorAll('[data-html-21]');
37016
- dom.removeAttributes(elms, 'data-html-21');
37017
- elms = tmp.querySelectorAll('[data-html-21]');
37018
- dom.removeAttributes(elms, 'data-html-21');
37019
- elms = tmp.querySelectorAll('[data-html-22]');
37020
- dom.removeAttributes(elms, 'data-html-22');
37021
- elms = tmp.querySelectorAll('[data-html-23]');
37022
- dom.removeAttributes(elms, 'data-html-23');
37023
- elms = tmp.querySelectorAll('[data-html-24]');
37024
- dom.removeAttributes(elms, 'data-html-24');
37025
- elms = tmp.querySelectorAll('[data-html-25]');
37026
- dom.removeAttributes(elms, 'data-html-25');
37039
+ elms = tmp.querySelectorAll('[data-noedit], [data-module], [data-module-desc], [data-dialog-width], [data-dialog-height], [data-html], [data-settings]');
37040
+ elms.forEach(elm => {
37041
+ elm.removeAttribute('data-noedit');
37042
+ elm.removeAttribute('data-module');
37043
+ elm.removeAttribute('data-module-desc');
37044
+ elm.removeAttribute('data-dialog-width');
37045
+ elm.removeAttribute('data-dialog-height');
37046
+ elm.removeAttribute('data-html');
37047
+ elm.removeAttribute('data-settings');
37048
+ });
37049
+ elms = tmp.querySelectorAll('[data-html-1], [data-html-2], [data-html-3], [data-html-4], [data-html-5], [data-html-6], [data-html-7], [data-html-8], [data-html-9], [data-html-10]');
37050
+ elms.forEach(elm => {
37051
+ elm.removeAttribute('data-html-1');
37052
+ elm.removeAttribute('data-html-2');
37053
+ elm.removeAttribute('data-html-3');
37054
+ elm.removeAttribute('data-html-4');
37055
+ elm.removeAttribute('data-html-5');
37056
+ elm.removeAttribute('data-html-6');
37057
+ elm.removeAttribute('data-html-7');
37058
+ elm.removeAttribute('data-html-8');
37059
+ elm.removeAttribute('data-html-9');
37060
+ elm.removeAttribute('data-html-10');
37061
+ });
37027
37062
  }
37028
37063
 
37029
37064
  // cleaning
37030
37065
 
37031
37066
  elms = tmp.querySelectorAll('[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],' + '[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],' + '[data-in],[data-in-150],[data-in-300],' + '[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out]' + '[data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],' + '[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],' + '[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],' + '[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],' + '[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]');
37032
- // elms = tmp.querySelectorAll('[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],' +
37033
- // '[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],' +
37034
- // '[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out]');
37035
37067
  Array.prototype.forEach.call(elms, elm => {
37036
37068
  elm.style.transition = '';
37037
37069
  elm.style.transform = '';
@@ -37067,34 +37099,24 @@ class HtmlUtil {
37067
37099
  });
37068
37100
 
37069
37101
  //Cleanup utils
37070
- elms = tmp.querySelectorAll('.is-appeared');
37071
- Array.prototype.forEach.call(elms, elm => {
37072
- dom.removeClass(elm, 'is-appeared');
37073
- });
37074
- elms = tmp.querySelectorAll('.box-active');
37075
- Array.prototype.forEach.call(elms, elm => {
37076
- dom.removeClass(elm, 'box-active');
37077
- });
37078
- elms = tmp.querySelectorAll('.section-active');
37079
- Array.prototype.forEach.call(elms, elm => {
37080
- dom.removeClass(elm, 'section-active');
37081
- });
37082
- elms = tmp.querySelectorAll('.section-select');
37083
- Array.prototype.forEach.call(elms, elm => {
37084
- dom.removeClass(elm, 'section-select');
37102
+ elms = tmp.querySelectorAll('.is-appeared, .box-active, .section-active, .section-select, .box-select');
37103
+ elms.forEach(elm => {
37104
+ elm.classList.remove('is-appeared');
37105
+ elm.classList.remove('box-active');
37106
+ elm.classList.remove('section-active');
37107
+ elm.classList.remove('section-select');
37108
+ elm.classList.remove('box-select');
37085
37109
  });
37086
- elms = tmp.querySelectorAll('.box-select');
37087
- Array.prototype.forEach.call(elms, elm => {
37088
- dom.removeClass(elm, 'box-select');
37110
+ elms = tmp.querySelectorAll('.is-section-tool, .is-box-tool, .is-box-info, .is-section-info');
37111
+ elms.forEach(elm => {
37112
+ if (elm.previousSibling && elm.previousSibling.nodeType === Node.TEXT_NODE) {
37113
+ elm.previousSibling.remove();
37114
+ }
37115
+ if (elm.nextSibling && elm.nextSibling.nodeType === Node.TEXT_NODE) {
37116
+ elm.nextSibling.remove();
37117
+ }
37118
+ elm.remove();
37089
37119
  });
37090
- elms = tmp.querySelectorAll('.is-section-tool');
37091
- dom.removeElements(elms);
37092
- elms = tmp.querySelectorAll('.is-box-tool');
37093
- dom.removeElements(elms);
37094
- elms = tmp.querySelectorAll('.is-box-info');
37095
- dom.removeElements(elms);
37096
- elms = tmp.querySelectorAll('.is-section-info');
37097
- dom.removeElements(elms);
37098
37120
 
37099
37121
  // freeform
37100
37122
  elms = tmp.querySelectorAll('.is-block .handle, .is-block .rotate-handle');
@@ -37111,8 +37133,6 @@ class HtmlUtil {
37111
37133
  elm.removeAttribute('data-prev');
37112
37134
  });
37113
37135
  tmp.querySelectorAll('.is-block.clone').forEach(elm => elm.parentNode.removeChild(elm));
37114
- // tmp.querySelectorAll('.is-block.cloned').forEach(elm=>elm.classList.remove('cloned'));
37115
-
37116
37136
  var html_content = '';
37117
37137
  var html_footer = '';
37118
37138
  var html_others = '';
@@ -37166,70 +37186,29 @@ class HtmlUtil {
37166
37186
  emptystyle.removeAttribute('style');
37167
37187
  });
37168
37188
  if (this.builder.shortenOutput) {
37169
- elms = tmp.querySelectorAll('[data-noedit]');
37170
- dom.removeAttributes(elms, 'data-noedit');
37171
- elms = tmp.querySelectorAll('[data-module]');
37172
- dom.removeAttributes(elms, 'data-module');
37173
- elms = tmp.querySelectorAll('[data-module-desc]');
37174
- dom.removeAttributes(elms, 'data-module-desc');
37175
- elms = tmp.querySelectorAll('[data-dialog-width]');
37176
- dom.removeAttributes(elms, 'data-dialog-width');
37177
- elms = tmp.querySelectorAll('[data-dialog-height]');
37178
- dom.removeAttributes(elms, 'data-dialog-height');
37179
- elms = tmp.querySelectorAll('[data-html]');
37180
- dom.removeAttributes(elms, 'data-html');
37181
- elms = tmp.querySelectorAll('[data-settings]');
37182
- dom.removeAttributes(elms, 'data-settings');
37183
- elms = tmp.querySelectorAll('[data-html-1]');
37184
- dom.removeAttributes(elms, 'data-html-1');
37185
- elms = tmp.querySelectorAll('[data-html-2]');
37186
- dom.removeAttributes(elms, 'data-html-2');
37187
- elms = tmp.querySelectorAll('[data-html-3]');
37188
- dom.removeAttributes(elms, 'data-html-3');
37189
- elms = tmp.querySelectorAll('[data-html-4]');
37190
- dom.removeAttributes(elms, 'data-html-4');
37191
- elms = tmp.querySelectorAll('[data-html-5]');
37192
- dom.removeAttributes(elms, 'data-html-5');
37193
- elms = tmp.querySelectorAll('[data-html-6]');
37194
- dom.removeAttributes(elms, 'data-html-6');
37195
- elms = tmp.querySelectorAll('[data-html-7]');
37196
- dom.removeAttributes(elms, 'data-html-7');
37197
- elms = tmp.querySelectorAll('[data-html-8]');
37198
- dom.removeAttributes(elms, 'data-html-8');
37199
- elms = tmp.querySelectorAll('[data-html-9]');
37200
- dom.removeAttributes(elms, 'data-html-9');
37201
- elms = tmp.querySelectorAll('[data-html-10]');
37202
- dom.removeAttributes(elms, 'data-html-10');
37203
- elms = tmp.querySelectorAll('[data-html-12]');
37204
- dom.removeAttributes(elms, 'data-html-12');
37205
- elms = tmp.querySelectorAll('[data-html-13]');
37206
- dom.removeAttributes(elms, 'data-html-13');
37207
- elms = tmp.querySelectorAll('[data-html-14]');
37208
- dom.removeAttributes(elms, 'data-html-14');
37209
- elms = tmp.querySelectorAll('[data-html-15]');
37210
- dom.removeAttributes(elms, 'data-html-15');
37211
- elms = tmp.querySelectorAll('[data-html-16]');
37212
- dom.removeAttributes(elms, 'data-html-16');
37213
- elms = tmp.querySelectorAll('[data-html-17]');
37214
- dom.removeAttributes(elms, 'data-html-17');
37215
- elms = tmp.querySelectorAll('[data-html-18]');
37216
- dom.removeAttributes(elms, 'data-html-18');
37217
- elms = tmp.querySelectorAll('[data-html-19]');
37218
- dom.removeAttributes(elms, 'data-html-19');
37219
- elms = tmp.querySelectorAll('[data-html-20]');
37220
- dom.removeAttributes(elms, 'data-html-20');
37221
- elms = tmp.querySelectorAll('[data-html-21]');
37222
- dom.removeAttributes(elms, 'data-html-21');
37223
- elms = tmp.querySelectorAll('[data-html-21]');
37224
- dom.removeAttributes(elms, 'data-html-21');
37225
- elms = tmp.querySelectorAll('[data-html-22]');
37226
- dom.removeAttributes(elms, 'data-html-22');
37227
- elms = tmp.querySelectorAll('[data-html-23]');
37228
- dom.removeAttributes(elms, 'data-html-23');
37229
- elms = tmp.querySelectorAll('[data-html-24]');
37230
- dom.removeAttributes(elms, 'data-html-24');
37231
- elms = tmp.querySelectorAll('[data-html-25]');
37232
- dom.removeAttributes(elms, 'data-html-25');
37189
+ elms = tmp.querySelectorAll('[data-noedit], [data-module], [data-module-desc], [data-dialog-width], [data-dialog-height], [data-html], [data-settings]');
37190
+ elms.forEach(elm => {
37191
+ elm.removeAttribute('data-noedit');
37192
+ elm.removeAttribute('data-module');
37193
+ elm.removeAttribute('data-module-desc');
37194
+ elm.removeAttribute('data-dialog-width');
37195
+ elm.removeAttribute('data-dialog-height');
37196
+ elm.removeAttribute('data-html');
37197
+ elm.removeAttribute('data-settings');
37198
+ });
37199
+ elms = tmp.querySelectorAll('[data-html-1], [data-html-2], [data-html-3], [data-html-4], [data-html-5], [data-html-6], [data-html-7], [data-html-8], [data-html-9], [data-html-10]');
37200
+ elms.forEach(elm => {
37201
+ elm.removeAttribute('data-html-1');
37202
+ elm.removeAttribute('data-html-2');
37203
+ elm.removeAttribute('data-html-3');
37204
+ elm.removeAttribute('data-html-4');
37205
+ elm.removeAttribute('data-html-5');
37206
+ elm.removeAttribute('data-html-6');
37207
+ elm.removeAttribute('data-html-7');
37208
+ elm.removeAttribute('data-html-8');
37209
+ elm.removeAttribute('data-html-9');
37210
+ elm.removeAttribute('data-html-10');
37211
+ });
37233
37212
  }
37234
37213
 
37235
37214
  // freeform
@@ -37357,6 +37336,8 @@ class UndoRedo {
37357
37336
  dom.removeElements(tmp.querySelectorAll('.is-row-tool'));
37358
37337
  dom.removeElements(tmp.querySelectorAll('.is-rowadd-tool'));
37359
37338
  dom.removeElements(tmp.querySelectorAll('.is-col-tool'));
37339
+ dom.removeElements(tmp.querySelectorAll('.is-canvas-tool'));
37340
+ dom.removeElements(tmp.querySelectorAll('.is-canvasadd-tool'));
37360
37341
  dom.removeElements(tmp.querySelectorAll('.ovl'));
37361
37342
  dom.removeElements(tmp.querySelectorAll('.row-add-initial'));
37362
37343
 
@@ -37536,6 +37517,7 @@ class UndoRedo {
37536
37517
  this.writeHtml(html);
37537
37518
  }
37538
37519
  this.builder.applyBehavior();
37520
+ this.builder.applyBehaviorCanvas();
37539
37521
  this.builder.opts.onChange();
37540
37522
  this.undoList[120] = this.undoList[121];
37541
37523
  this.undoList[121] = this.undoList[122];
@@ -37625,6 +37607,7 @@ class UndoRedo {
37625
37607
  this.writeHtml(html);
37626
37608
  }
37627
37609
  this.builder.applyBehavior();
37610
+ this.builder.applyBehaviorCanvas();
37628
37611
  this.builder.opts.onChange();
37629
37612
  this.undoList[119] = this.undoList[118];
37630
37613
  this.undoList[118] = this.undoList[117];
@@ -38068,6 +38051,24 @@ const prepareSvgIcons = builder => {
38068
38051
  <symbol id="icon-svg" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
38069
38052
  <path d="M21 8h-2a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2v-4h-1" /><path d="M7 8h-3a1 1 0 0 0 -1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-3" /><path d="M10 8l1.5 8h1l1.5 -8" />
38070
38053
  </symbol>
38054
+
38055
+ <symbol id="icon-pagesize" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
38056
+ <path d="M3 5m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z" /><path d="M7 12v-3h3" /><path d="M17 12v3h-3" />
38057
+ </symbol>
38058
+ <symbol id="icon-print" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
38059
+ <path d="M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2" /><path d="M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4" /><path d="M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z" />
38060
+ </symbol>
38061
+
38062
+ <symbol id="icon-plus" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
38063
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
38064
+ <line x1="12" y1="5" x2="12" y2="19"></line>
38065
+ <line x1="5" y1="12" x2="19" y2="12"></line>
38066
+ </symbol>
38067
+ <symbol id="icon-plus2" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
38068
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
38069
+ <path d="M12 5l0 14"></path>
38070
+ <path d="M5 12l14 0"></path>
38071
+ </symbol>
38071
38072
  </svg>`;
38072
38073
  builder.dom.appendHtml(builder.builderStuff, html);
38073
38074
  };
@@ -70596,6 +70597,8 @@ class Image$1 {
70596
70597
  try {
70597
70598
  img.setAttribute('data-filename', input.files[0].name); //needed for saveimage.js |
70598
70599
 
70600
+ // img.crossOrigin = 'anonymous';
70601
+
70599
70602
  this.processImage(input.files[0], img, () => {
70600
70603
  imageProgress.style.display = 'none';
70601
70604
  elm = imageTool.querySelector('#fileEmbedImage');
@@ -87048,7 +87051,15 @@ class ElementTool {
87048
87051
  }
87049
87052
  }
87050
87053
  */
87051
- elm.parentNode.removeChild(elm);
87054
+
87055
+ // elm.parentNode.removeChild(elm);
87056
+ let elmParent = elm.parentNode;
87057
+ elm.remove();
87058
+ let childs = dom.elementChildren(elmParent);
87059
+ if (!elmParent.classList.contains('cell-active') && childs.length === 0) {
87060
+ elmParent.remove(); // remove empty div.display
87061
+ }
87062
+
87052
87063
  this.elementTool.style.display = 'none';
87053
87064
  let cell = this.builder.activeCol;
87054
87065
  if (cell) {
@@ -87367,7 +87378,7 @@ class ElementTool {
87367
87378
  if ((customcode || noedit || _protected) && !subblock) ; else {
87368
87379
  const tagName = elm.tagName.toLowerCase();
87369
87380
  // LATER: label, code, figcaption ?
87370
- if (tagName === 'h1' || tagName === 'h2' || tagName === 'h3' || tagName === 'h4' || tagName === 'h5' || tagName === 'h6' || tagName === 'p' || tagName === 'pre' || tagName === 'blockquote' || tagName === 'li' || tagName === 'img' || tagName === 'iframe') {
87381
+ if (!elm.classList.contains('cell-active') && (tagName === 'h1' || tagName === 'h2' || tagName === 'h3' || tagName === 'h4' || tagName === 'h5' || tagName === 'h6' || tagName === 'p' || tagName === 'div' || tagName === 'pre' || tagName === 'blockquote' || tagName === 'li' || tagName === 'img' || tagName === 'iframe')) {
87371
87382
  activeElement = elm; //set active element
87372
87383
 
87373
87384
  if (tagName === 'img') {
@@ -89845,8 +89856,14 @@ class Rte {
89845
89856
  let rteZoomSlider;
89846
89857
  let inpZoomSlider;
89847
89858
  if (!rteTool) {
89859
+ let zoomMax = 100;
89860
+ if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer && !this.builder.iframe) {
89861
+ // freeform
89862
+ zoomMax = 200;
89863
+ }
89864
+
89848
89865
  // if(builder.plugins.length>0) {
89849
- let allButtons = ['|', 'addsnippet', 'bold', 'italic', 'underline', 'formatting', 'color', 'removeformat', 'align', 'textsettings', 'createlink', 'tags', 'undo', 'redo', 'zoom', 'livepreview', 'icon', 'image', 'list', 'font', 'formatpara', 'gridtool', 'html', 'preferences', 'more', 'left', 'center', 'right', 'full', 'group', 'ungroup', 'duplicate', 'addblock', 'front', 'backward', 'moveup', 'movedown', 'delete', 'blocksettings', 'aiassistant', 'snippets', 'svg'];
89866
+ let allButtons = ['|', 'addsnippet', 'bold', 'italic', 'underline', 'formatting', 'color', 'removeformat', 'align', 'textsettings', 'createlink', 'tags', 'undo', 'redo', 'zoom', 'livepreview', 'icon', 'image', 'list', 'font', 'formatpara', 'gridtool', 'html', 'preferences', 'more', 'left', 'center', 'right', 'full', 'group', 'ungroup', 'duplicate', 'addblock', 'front', 'backward', 'moveup', 'movedown', 'delete', 'blocksettings', 'aiassistant', 'snippets', 'svg', 'pageoptions', 'print'];
89850
89867
  const filterButtons = myArray => {
89851
89868
  let newArray = myArray;
89852
89869
  myArray.forEach(item => {
@@ -89906,7 +89923,7 @@ class Rte {
89906
89923
  var btn = builder.opts.buttonsMore[j].toLowerCase();
89907
89924
  if (btn === 'createlink') html_rtemore += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_rtemore += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'svg' && !this.builder.opts.emailMode) html_rtemore += `<button tabindex="-1" title="${util.out('SVG')}" class="rte-svg"><svg class="is-icon-flex" style="width:19px;height:19px;margin-top:2px;"><use xlink:href="#icon-svg"></use></svg></button>`;else if (btn === 'removeformat') html_rtemore += `<button tabindex="-1" title="${util.out('Clean')}" class="rte-clean"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>`;else if (btn === 'bold') html_rtemore += `<button tabindex="-1" title="${util.out('Bold')}" class="rte-format" data-command="bold"><span style="font-family:serif;font-size:14px;">B</span></button>`;else if (btn === 'italic') html_rtemore += `<button tabindex="-1" title="${util.out('Italic')}" class="rte-format" data-command="italic"><span style="font-family:serif;font-size:16px;font-style:italic;">i</span></button>`;else if (btn === 'underline') html_rtemore += `<button tabindex="-1" title="${util.out('Underline')}" class="rte-format" data-command="underline"><span style="font-family:serif;font-size:14px;text-decoration:underline;">U</span></button>`;
89908
89925
  // else if(btn==='createlink') html_rtemore += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;
89909
- else if (btn === 'align') html_rtemore += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'list') html_rtemore += `<button tabindex="-1" title="${util.out('List')}" class="rte-list"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-list-bullet"></use></svg></button>`;else if (btn === 'color') html_rtemore += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'formatting') html_rtemore += `<button tabindex="-1" title="${util.out('Formatting')}" class="rte-formatting"><span style="font-family:serif;font-size:15px;display:inline-block;">A</span></button>`;else if (btn === 'tags') html_rtemore += customtag_button;else if (btn === 'image') html_rtemore += `<button tabindex="-1" title="${util.out('Image')}" class="rte-image"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-image"></use></svg></button>`;else if (btn === 'gridtool') html_rtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_rtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_rtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_rtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'formatpara') html_rtemore += `<button tabindex="-1" title="${util.out('Paragraph')}" class="rte-paragraph"><span style="font-family:serif;font-size:14px;display:inline-block;margin-top:2px;">H</span></button>`;else if (btn === 'font') html_rtemore += `<button tabindex="-1" title="${util.out('Font')}" class="rte-fontfamily"><span style="font-family:serif;font-size:18px;text-transform:none;display:inline-block;margin-top: -3px;">a</span></button>`;else if (btn === 'textsettings') html_rtemore += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_rtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_rtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_rtemore += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_rtemore += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="margin-top:2px;width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'zoom') html_rtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_rtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89926
+ else if (btn === 'align') html_rtemore += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'list') html_rtemore += `<button tabindex="-1" title="${util.out('List')}" class="rte-list"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-list-bullet"></use></svg></button>`;else if (btn === 'color') html_rtemore += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'formatting') html_rtemore += `<button tabindex="-1" title="${util.out('Formatting')}" class="rte-formatting"><span style="font-family:serif;font-size:15px;display:inline-block;">A</span></button>`;else if (btn === 'tags') html_rtemore += customtag_button;else if (btn === 'image') html_rtemore += `<button tabindex="-1" title="${util.out('Image')}" class="rte-image"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-image"></use></svg></button>`;else if (btn === 'gridtool') html_rtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_rtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_rtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_rtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'formatpara') html_rtemore += `<button tabindex="-1" title="${util.out('Paragraph')}" class="rte-paragraph"><span style="font-family:serif;font-size:14px;display:inline-block;margin-top:2px;">H</span></button>`;else if (btn === 'font') html_rtemore += `<button tabindex="-1" title="${util.out('Font')}" class="rte-fontfamily"><span style="font-family:serif;font-size:18px;text-transform:none;display:inline-block;margin-top: -3px;">a</span></button>`;else if (btn === 'textsettings') html_rtemore += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_rtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_rtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_rtemore += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_rtemore += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'pageoptions') html_rtemore += `<button tabindex="-1" title="${util.out('Page Options')}" class="rte-pageoptions"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;transform:rotate(90deg)"><use xlink:href="#icon-pagesize"></use></svg></button>`;else if (btn === 'print') html_rtemore += `<button tabindex="-1" title="${util.out('Print')}" class="rte-print"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-print"></use></svg></button>`;else if (btn === 'zoom') html_rtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_rtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89910
89927
  html_rtemore += '<div class="rte-separator"></div>';
89911
89928
  } else {
89912
89929
  html_rtemore += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
@@ -89916,7 +89933,7 @@ class Rte {
89916
89933
  let html_rte = '';
89917
89934
  for (j = 0; j < builder.opts.buttons.length; j++) {
89918
89935
  btn = builder.opts.buttons[j].toLowerCase();
89919
- if (btn === 'bold') html_rte += `<button tabindex="-1" title="${util.out('Bold')}" class="rte-format" data-command="bold"><span style="font-family:serif;font-size:14px;">B</span></button>`;else if (btn === 'italic') html_rte += `<button tabindex="-1" title="${util.out('Italic')}" class="rte-format" data-command="italic"><span style="font-family:serif;font-size:16px;font-style:italic;">i</span></button>`;else if (btn === 'underline') html_rte += `<button tabindex="-1" title="${util.out('Underline')}" class="rte-format" data-command="underline"><span style="font-family:serif;font-size:14px;text-decoration:underline;">U</span></button>`;else if (btn === 'createlink') html_rte += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'align') html_rte += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'formatpara') html_rte += `<button tabindex="-1" title="${util.out('Paragraph')}" class="rte-paragraph"><span style="font-family:serif;font-size:14px;display:inline-block;margin-top:2px;">H</span></button>`;else if (btn === 'color') html_rte += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'formatting') html_rte += `<button tabindex="-1" title="${util.out('Formatting')}" class="rte-formatting"><span style="font-family:serif;font-size:15px;display:inline-block;">A</span></button>`;else if (btn === 'list') html_rte += `<button tabindex="-1" title="${util.out('List')}" class="rte-list"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-list-bullet"></use></svg></button>`;else if (btn === 'textsettings') html_rte += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_rte += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'svg' && !this.builder.opts.emailMode) html_rte += `<button tabindex="-1" title="${util.out('SVG')}" class="rte-svg"><svg class="is-icon-flex" style="width:19px;height:19px;margin-top:2px"><use xlink:href="#icon-svg"></use></svg></button>`;else if (btn === 'tags') html_rte += customtag_button;else if (btn === 'removeformat') html_rte += `<button tabindex="-1" title="${util.out('Clean')}" class="rte-format" data-command="clean"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>`;else if (btn === 'font') html_rte += `<button tabindex="-1" title="${util.out('Font')}" class="rte-fontfamily"><span style="font-family:serif;font-size:18px;text-transform:none;display:inline-block;margin-top: -3px;">a</span></button>`;else if (btn === 'image') html_rte += `<button tabindex="-1" title="${util.out('Image')}" class="rte-image"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-image"></use></svg></button>`;else if (btn === 'gridtool') html_rte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;width:17px;height:17px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_rte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_rte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_rte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_rte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_rte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_rte += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_rte += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="margin-top:2px;width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'more' && html_rtemore !== '') html_rte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === 'zoom') html_rte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_rte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89936
+ if (btn === 'bold') html_rte += `<button tabindex="-1" title="${util.out('Bold')}" class="rte-format" data-command="bold"><span style="font-family:serif;font-size:14px;">B</span></button>`;else if (btn === 'italic') html_rte += `<button tabindex="-1" title="${util.out('Italic')}" class="rte-format" data-command="italic"><span style="font-family:serif;font-size:16px;font-style:italic;">i</span></button>`;else if (btn === 'underline') html_rte += `<button tabindex="-1" title="${util.out('Underline')}" class="rte-format" data-command="underline"><span style="font-family:serif;font-size:14px;text-decoration:underline;">U</span></button>`;else if (btn === 'createlink') html_rte += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'align') html_rte += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'formatpara') html_rte += `<button tabindex="-1" title="${util.out('Paragraph')}" class="rte-paragraph"><span style="font-family:serif;font-size:14px;display:inline-block;margin-top:2px;">H</span></button>`;else if (btn === 'color') html_rte += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'formatting') html_rte += `<button tabindex="-1" title="${util.out('Formatting')}" class="rte-formatting"><span style="font-family:serif;font-size:15px;display:inline-block;">A</span></button>`;else if (btn === 'list') html_rte += `<button tabindex="-1" title="${util.out('List')}" class="rte-list"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-list-bullet"></use></svg></button>`;else if (btn === 'textsettings') html_rte += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_rte += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'svg' && !this.builder.opts.emailMode) html_rte += `<button tabindex="-1" title="${util.out('SVG')}" class="rte-svg"><svg class="is-icon-flex" style="width:19px;height:19px;margin-top:2px"><use xlink:href="#icon-svg"></use></svg></button>`;else if (btn === 'tags') html_rte += customtag_button;else if (btn === 'removeformat') html_rte += `<button tabindex="-1" title="${util.out('Clean')}" class="rte-format" data-command="clean"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>`;else if (btn === 'font') html_rte += `<button tabindex="-1" title="${util.out('Font')}" class="rte-fontfamily"><span style="font-family:serif;font-size:18px;text-transform:none;display:inline-block;margin-top: -3px;">a</span></button>`;else if (btn === 'image') html_rte += `<button tabindex="-1" title="${util.out('Image')}" class="rte-image"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-image"></use></svg></button>`;else if (btn === 'gridtool') html_rte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;width:17px;height:17px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_rte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_rte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_rte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_rte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_rte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_rte += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_rte += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'more' && html_rtemore !== '') html_rte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === 'pageoptions') html_rte += `<button tabindex="-1" title="${util.out('Page Options')}" class="rte-pageoptions"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;transform:rotate(90deg)"><use xlink:href="#icon-pagesize"></use></svg></button>`;else if (btn === 'print') html_rte += `<button tabindex="-1" title="${util.out('Print')}" class="rte-print"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-print"></use></svg></button>`;else if (btn === 'zoom') html_rte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_rte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89920
89937
  html_rte += '<div class="rte-separator"></div>';
89921
89938
  } else {
89922
89939
  html_rte += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
@@ -89934,7 +89951,7 @@ class Rte {
89934
89951
  let html_elementrtemore = '';
89935
89952
  for (j = 0; j < builder.opts.elementButtonsMore.length; j++) {
89936
89953
  btn = builder.opts.elementButtonsMore[j].toLowerCase();
89937
- if (btn === 'left') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Left')}" data-align="left"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-left"></use></svg></button>`;else if (btn === 'center') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Center')}" data-align="center"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-center"></use></svg></button>`;else if (btn === 'right') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Right')}" data-align="right"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-right"></use></svg></button>`;else if (btn === 'full') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Full')}" data-align="justify"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'gridtool') html_elementrtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_elementrtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_elementrtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_elementrtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_elementrtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_elementrtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_elementrtemore += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_elementrtemore += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="margin-top:2px;width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'zoom') html_elementrtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_elementrtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89954
+ if (btn === 'left') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Left')}" data-align="left"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-left"></use></svg></button>`;else if (btn === 'center') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Center')}" data-align="center"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-center"></use></svg></button>`;else if (btn === 'right') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Right')}" data-align="right"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-right"></use></svg></button>`;else if (btn === 'full') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Full')}" data-align="justify"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'gridtool') html_elementrtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_elementrtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_elementrtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_elementrtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_elementrtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_elementrtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_elementrtemore += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_elementrtemore += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'pageoptions') html_elementrtemore += `<button tabindex="-1" title="${util.out('Page Options')}" class="rte-pageoptions"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;transform:rotate(90deg)"><use xlink:href="#icon-pagesize"></use></svg></button>`;else if (btn === 'print') html_elementrtemore += `<button tabindex="-1" title="${util.out('Print')}" class="rte-print"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-print"></use></svg></button>`;else if (btn === 'zoom') html_elementrtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_elementrtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89938
89955
  html_elementrtemore += '<div class="rte-separator"></div>';
89939
89956
  } else {
89940
89957
  html_elementrtemore += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
@@ -89944,7 +89961,7 @@ class Rte {
89944
89961
  let html_elementrte = '';
89945
89962
  for (j = 0; j < builder.opts.elementButtons.length; j++) {
89946
89963
  btn = builder.opts.elementButtons[j].toLowerCase();
89947
- if (btn === 'left') html_elementrte += `<button tabindex="-1" title="${util.out('Align Left')}" data-align="left"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-left"></use></svg></button>`;else if (btn === 'center') html_elementrte += `<button tabindex="-1" title="${util.out('Align Center')}" data-align="center"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-center"></use></svg></button>`;else if (btn === 'right') html_elementrte += `<button tabindex="-1" title="${util.out('Align Right')}" data-align="right"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-right"></use></svg></button>`;else if (btn === 'full') html_elementrte += `<button tabindex="-1" title="${util.out('Align Full')}" data-align="justify"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'gridtool') html_elementrte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;width:17px;height:17px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_elementrte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_elementrte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_elementrte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'group') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Group')}" class="rte-group"><svg class="is-icon-flex" style="width:20px;height:20px;margin-top:-1px;"><use xlink:href="#icon-group"></use></svg></button>`;else if (btn === 'ungroup') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Ungroup')}" class="rte-ungroup"><svg class="is-icon-flex" style="width:20px;height:20px;margin-top:-1px;"><use xlink:href="#icon-ungroup"></use></svg></button>`;else if (btn === 'duplicate') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Duplicate')}" class="rte-duplicate"><svg class="is-icon-flex" style="width:20px;height:20px;margin-top:-1px;"><use xlink:href="#icon-duplicate"></use></svg></button>`;else if (btn === 'front') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Bring to Front')}" class="rte-front"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-stack-forward"></use></svg></button>`;else if (btn === 'backward') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Send to Back')}" class="rte-backward"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-stack-backward"></use></svg></button>`;else if (btn === 'moveup') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Move Up')}" class="rte-moveup"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-arrow-up"></use></svg></button>`;else if (btn === 'movedown') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Move Down')}" class="rte-movedown"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-arrow-down"></use></svg></button>`;else if (btn === 'delete') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Delete')}" class="rte-delete"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-trash"></use></svg></button>`;else if (btn === 'blocksettings') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Block Settings')}" class="rte-blocksettings"><svg class="is-icon-flex"><use xlink:href="#icon-settings"></use></svg></button>`;else if (btn === 'undo') html_elementrte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_elementrte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_elementrte += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_elementrte += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="margin-top:2px;width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'more' && html_elementrtemore !== '') html_elementrte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === 'zoom') html_elementrte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_elementrte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89964
+ if (btn === 'left') html_elementrte += `<button tabindex="-1" title="${util.out('Align Left')}" data-align="left"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-left"></use></svg></button>`;else if (btn === 'center') html_elementrte += `<button tabindex="-1" title="${util.out('Align Center')}" data-align="center"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-center"></use></svg></button>`;else if (btn === 'right') html_elementrte += `<button tabindex="-1" title="${util.out('Align Right')}" data-align="right"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-right"></use></svg></button>`;else if (btn === 'full') html_elementrte += `<button tabindex="-1" title="${util.out('Align Full')}" data-align="justify"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'gridtool') html_elementrte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;width:17px;height:17px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_elementrte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_elementrte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_elementrte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'group') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Group')}" class="rte-group"><svg class="is-icon-flex" style="width:20px;height:20px;margin-top:-1px;"><use xlink:href="#icon-group"></use></svg></button>`;else if (btn === 'ungroup') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Ungroup')}" class="rte-ungroup"><svg class="is-icon-flex" style="width:20px;height:20px;margin-top:-1px;"><use xlink:href="#icon-ungroup"></use></svg></button>`;else if (btn === 'duplicate') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Duplicate')}" class="rte-duplicate"><svg class="is-icon-flex" style="width:20px;height:20px;margin-top:-1px;"><use xlink:href="#icon-duplicate"></use></svg></button>`;else if (btn === 'front') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Bring to Front')}" class="rte-front"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-stack-forward"></use></svg></button>`;else if (btn === 'backward') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Send to Back')}" class="rte-backward"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-stack-backward"></use></svg></button>`;else if (btn === 'moveup') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Move Up')}" class="rte-moveup"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-arrow-up"></use></svg></button>`;else if (btn === 'movedown') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Move Down')}" class="rte-movedown"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-arrow-down"></use></svg></button>`;else if (btn === 'delete') html_elementrte += `<button style="display:none" tabindex="-1" title="${util.out('Delete')}" class="rte-delete"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#icon-trash"></use></svg></button>`;else if (btn === 'blocksettings' && this.builder.canvas) html_elementrte += `<button tabindex="-1" title="${util.out('Block Settings')}" class="rte-blocksettings"><svg class="is-icon-flex"><use xlink:href="#icon-settings"></use></svg></button>`;else if (btn === 'undo') html_elementrte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_elementrte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_elementrte += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_elementrte += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'more' && html_elementrtemore !== '') html_elementrte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === 'pageoptions') html_elementrte += `<button tabindex="-1" title="${util.out('Page Options')}" class="rte-pageoptions"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;transform:rotate(90deg)"><use xlink:href="#icon-pagesize"></use></svg></button>`;else if (btn === 'print') html_elementrte += `<button tabindex="-1" title="${util.out('Print')}" class="rte-print"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-print"></use></svg></button>`;else if (btn === 'zoom') html_elementrte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_elementrte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89948
89965
  html_elementrte += '<div class="rte-separator"></div>';
89949
89966
  } else {
89950
89967
  html_elementrte += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
@@ -89964,7 +89981,7 @@ class Rte {
89964
89981
  let html_iconrte = '';
89965
89982
  for (j = 0; j < builder.opts.iconButtonsMore.length; j++) {
89966
89983
  btn = builder.opts.iconButtonsMore[j].toLowerCase();
89967
- if (btn === 'createlink') html_iconrtemore += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_iconrtemore += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'svg' && !this.builder.opts.emailMode) html_iconrtemore += `<button tabindex="-1" title="${util.out('SVG')}" class="rte-svg"><svg class="is-icon-flex" style="width:19px;height:19px;margin-top:2px;"><use xlink:href="#icon-svg"></use></svg></button>`;else if (btn === 'align') html_iconrtemore += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'color') html_iconrtemore += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'gridtool') html_iconrtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_iconrtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_iconrtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_iconrtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'textsettings') html_iconrtemore += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_iconrtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_iconrtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_iconrtemore += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_iconrtemore += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="margin-top:2px;width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'zoom') html_iconrtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_iconrtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89984
+ if (btn === 'createlink') html_iconrtemore += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_iconrtemore += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'svg' && !this.builder.opts.emailMode) html_iconrtemore += `<button tabindex="-1" title="${util.out('SVG')}" class="rte-svg"><svg class="is-icon-flex" style="width:19px;height:19px;margin-top:2px;"><use xlink:href="#icon-svg"></use></svg></button>`;else if (btn === 'align') html_iconrtemore += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'color') html_iconrtemore += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'gridtool') html_iconrtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_iconrtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_iconrtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_iconrtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'textsettings') html_iconrtemore += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_iconrtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_iconrtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_iconrtemore += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_iconrtemore += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'pageoptions') html_iconrtemore += `<button tabindex="-1" title="${util.out('Page Options')}" class="rte-pageoptions"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;transform:rotate(90deg)"><use xlink:href="#icon-pagesize"></use></svg></button>`;else if (btn === 'print') html_iconrtemore += `<button tabindex="-1" title="${util.out('Print')}" class="rte-print"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-print"></use></svg></button>`;else if (btn === 'zoom') html_iconrtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_iconrtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === '|') {
89968
89985
  html_iconrtemore += '<div class="rte-separator"></div>';
89969
89986
  } else {
89970
89987
  html_iconrtemore += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
@@ -89973,7 +89990,7 @@ class Rte {
89973
89990
 
89974
89991
  for (j = 0; j < builder.opts.iconButtons.length; j++) {
89975
89992
  btn = builder.opts.iconButtons[j].toLowerCase();
89976
- if (btn === 'createlink') html_iconrte += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_iconrte += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'svg' && !this.builder.opts.emailMode) html_iconrte += `<button tabindex="-1" title="${util.out('SVG')}" class="rte-svg"><svg class="is-icon-flex" style="width:19px;height:19px;margin-top:2px;"><use xlink:href="#icon-svg"></use></svg></button>`;else if (btn === 'align') html_iconrte += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'color') html_iconrte += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'gridtool') html_iconrte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_iconrte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_iconrte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_iconrte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'textsettings') html_iconrte += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_iconrte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_iconrte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_iconrte += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_iconrte += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="margin-top:2px;width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'zoom') html_iconrte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_iconrte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === 'more' && html_rtemore !== '') html_iconrte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === '|') {
89993
+ if (btn === 'createlink') html_iconrte += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_iconrte += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'svg' && !this.builder.opts.emailMode) html_iconrte += `<button tabindex="-1" title="${util.out('SVG')}" class="rte-svg"><svg class="is-icon-flex" style="width:19px;height:19px;margin-top:2px;"><use xlink:href="#icon-svg"></use></svg></button>`;else if (btn === 'align') html_iconrte += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'color') html_iconrte += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'gridtool') html_iconrte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_iconrte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_iconrte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_iconrte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'textsettings') html_iconrte += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_iconrte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_iconrte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'aiassistant') html_iconrte += `<button tabindex="-1" title="${util.out('AI Assistant')}" class="rte-ai"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-message"></use></svg></button>`;else if (btn === 'snippets') html_iconrte += `<button tabindex="-1" title="${util.out('Snippets')}" class="rte-snippets"><svg class="is-icon-flex" style="width:19px;height:19px;"><use xlink:href="#icon-snippets"></use></svg></button>`;else if (btn === 'pageoptions') html_iconrte += `<button tabindex="-1" title="${util.out('Page Options')}" class="rte-pageoptions"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;transform:rotate(90deg)"><use xlink:href="#icon-pagesize"></use></svg></button>`;else if (btn === 'print') html_iconrte += `<button tabindex="-1" title="${util.out('Print')}" class="rte-print"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-print"></use></svg></button>`;else if (btn === 'zoom') html_iconrte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_iconrte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-device-desktop"></use></svg></button>`;else if (btn === 'more' && html_rtemore !== '') html_iconrte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === '|') {
89977
89994
  html_iconrte += '<div class="rte-separator"></div>';
89978
89995
  } else {
89979
89996
  html_iconrte += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
@@ -90118,7 +90135,7 @@ class Rte {
90118
90135
  <div>
90119
90136
  <div class="is-label">${util.out('Zoom')}</div>
90120
90137
  <div style="padding-top:4px">
90121
- <input type="range" min="50" max="100" value="1" class="rte-zoom-slider is-rangeslider">
90138
+ <input type="range" min="50" max="${zoomMax}" value="1" class="rte-zoom-slider is-rangeslider">
90122
90139
  </div>
90123
90140
  </div>
90124
90141
  </div>
@@ -91067,6 +91084,22 @@ class Rte {
91067
91084
  });
91068
91085
  });
91069
91086
 
91087
+ // Page Options
91088
+ let btnPageOptions = builderStuff.querySelectorAll('button.rte-pageoptions');
91089
+ btnPageOptions.forEach(btn => {
91090
+ btn.addEventListener('click', () => {
91091
+ this.builder.openPageOptions();
91092
+ });
91093
+ });
91094
+
91095
+ // Print
91096
+ let btnPrint = builderStuff.querySelectorAll('button.rte-print');
91097
+ btnPrint.forEach(btn => {
91098
+ btn.addEventListener('click', () => {
91099
+ this.builder.print();
91100
+ });
91101
+ });
91102
+
91070
91103
  // Zoom Settings
91071
91104
  let zoomButton = builderStuff.querySelectorAll('button.rte-zoom');
91072
91105
  zoomButton.forEach(btn => {
@@ -91183,6 +91216,14 @@ class Rte {
91183
91216
  tools.forEach(tool => {
91184
91217
  tool.style.display = 'none';
91185
91218
  });
91219
+ tools = this.builder.doc.querySelectorAll('.is-canvas-tool');
91220
+ tools.forEach(tool => {
91221
+ tool.style.display = 'none';
91222
+ });
91223
+ tools = this.builder.doc.querySelectorAll('.is-canvasadd-tool');
91224
+ tools.forEach(tool => {
91225
+ tool.style.display = 'none';
91226
+ });
91186
91227
  tools = this.builder.doc.querySelectorAll('.is-rowadd-tool');
91187
91228
  tools.forEach(tool => {
91188
91229
  tool.style.opacity = 0;
@@ -91204,6 +91245,14 @@ class Rte {
91204
91245
  tools.forEach(tool => {
91205
91246
  tool.style.display = '';
91206
91247
  });
91248
+ tools = this.builder.doc.querySelectorAll('.is-canvas-tool');
91249
+ tools.forEach(tool => {
91250
+ tool.style.display = '';
91251
+ });
91252
+ tools = this.builder.doc.querySelectorAll('.is-canvasadd-tool');
91253
+ tools.forEach(tool => {
91254
+ tool.style.display = '';
91255
+ });
91207
91256
  }, 350);
91208
91257
  };
91209
91258
  this.rteZoomSlider.value = this.builder.opts.zoom * 100;
@@ -91239,9 +91288,13 @@ class Rte {
91239
91288
  this.rteZoomSlider.onchange = () => {
91240
91289
  setTimeout(() => {
91241
91290
  // setZoomOnControl
91242
- if (this.builder.opts.page !== '') {
91291
+ if (this.builder.isContentBox) {
91243
91292
  const wrapper = this.builder.doc.querySelector(this.builder.opts.page);
91244
91293
  this.builder.setZoomOnControl(wrapper);
91294
+ } else if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer) {
91295
+ // freeform
91296
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
91297
+ this.builder.setZoomOnControl(docContainer);
91245
91298
  } else {
91246
91299
  const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
91247
91300
  builders.forEach(builder => {
@@ -91292,9 +91345,13 @@ class Rte {
91292
91345
  this.inpZoomSlider.onchange = () => {
91293
91346
  setTimeout(() => {
91294
91347
  // setZoomOnControl
91295
- if (this.builder.opts.page !== '') {
91348
+ if (this.builder.isContentBox) {
91296
91349
  const wrapper = this.builder.doc.querySelector(this.builder.opts.page);
91297
91350
  this.builder.setZoomOnControl(wrapper);
91351
+ } else if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer) {
91352
+ // freeform
91353
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
91354
+ this.builder.setZoomOnControl(docContainer);
91298
91355
  } else {
91299
91356
  const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
91300
91357
  builders.forEach(builder => {
@@ -91316,6 +91373,14 @@ class Rte {
91316
91373
  tools.forEach(tool => {
91317
91374
  tool.style.display = '';
91318
91375
  });
91376
+ tools = this.builder.doc.querySelectorAll('.is-canvas-tool');
91377
+ tools.forEach(tool => {
91378
+ tool.style.display = '';
91379
+ });
91380
+ tools = this.builder.doc.querySelectorAll('.is-canvasadd-tool');
91381
+ tools.forEach(tool => {
91382
+ tool.style.display = '';
91383
+ });
91319
91384
  if (this.builder.onZoomEnd) {
91320
91385
  let val = this.rteZoomSlider.value;
91321
91386
  let scale = val / 100;
@@ -92376,6 +92441,14 @@ class Rte {
92376
92441
  tools.forEach(tool => {
92377
92442
  tool.style.display = 'none';
92378
92443
  });
92444
+ tools = this.builder.doc.querySelectorAll('.is-canvas-tool');
92445
+ tools.forEach(tool => {
92446
+ tool.style.display = 'none';
92447
+ });
92448
+ tools = this.builder.doc.querySelectorAll('.is-canvasadd-tool');
92449
+ tools.forEach(tool => {
92450
+ tool.style.display = 'none';
92451
+ });
92379
92452
  tools = this.builder.doc.querySelectorAll('.is-rowadd-tool');
92380
92453
  tools.forEach(tool => {
92381
92454
  tool.style.opacity = 0;
@@ -92389,9 +92462,13 @@ class Rte {
92389
92462
  zoomEnd(inp) {
92390
92463
  setTimeout(() => {
92391
92464
  // setZoomOnControl
92392
- if (this.builder.opts.page !== '') {
92465
+ if (this.builder.isContentBox) {
92393
92466
  const wrapper = this.builder.doc.querySelector(this.builder.opts.page);
92394
92467
  this.builder.setZoomOnControl(wrapper);
92468
+ } else if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer) {
92469
+ // freeform
92470
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
92471
+ this.builder.setZoomOnControl(docContainer);
92395
92472
  } else {
92396
92473
  const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
92397
92474
  builders.forEach(builder => {
@@ -92413,6 +92490,14 @@ class Rte {
92413
92490
  tools.forEach(tool => {
92414
92491
  tool.style.display = '';
92415
92492
  });
92493
+ tools = this.builder.doc.querySelectorAll('.is-canvas-tool');
92494
+ tools.forEach(tool => {
92495
+ tool.style.display = '';
92496
+ });
92497
+ tools = this.builder.doc.querySelectorAll('.is-canvasadd-tool');
92498
+ tools.forEach(tool => {
92499
+ tool.style.display = '';
92500
+ });
92416
92501
  if (this.builder.onZoomEnd) {
92417
92502
  let val = inp.value;
92418
92503
  let scale = val / 100;
@@ -93201,11 +93286,12 @@ class Rte {
93201
93286
  Array.prototype.forEach.call(elms, elm => {
93202
93287
  elm.style.display = 'none';
93203
93288
  });
93204
- elms = this.elementRteTool.querySelectorAll('.rte-blocksettings');
93205
- Array.prototype.forEach.call(elms, elm => {
93206
- elm.style.display = 'none';
93207
- });
93289
+ // elms = this.elementRteTool.querySelectorAll('.rte-blocksettings');
93290
+ // Array.prototype.forEach.call(elms, (elm) => {
93291
+ // elm.style.display = 'none';
93292
+ // });
93208
93293
  }
93294
+
93209
93295
  showAlignButtons() {
93210
93296
  let separators = this.elementRteTool.querySelectorAll('.rte-separator');
93211
93297
  Array.prototype.forEach.call(separators, separator => {
@@ -96600,7 +96686,7 @@ class Rte {
96600
96686
  addIcon(classname) {
96601
96687
  const dom = this.dom;
96602
96688
  this.util.restoreSelection();
96603
- if (this.builder.activeIcon) {
96689
+ if (this.builder.activeIcon && this.builder.doc.contains(this.builder.activeIcon)) {
96604
96690
  this.builder.uo.saveForUndo();
96605
96691
 
96606
96692
  /*
@@ -96632,6 +96718,12 @@ class Rte {
96632
96718
  this.builder.uo.saveForUndo();
96633
96719
  this.util.pasteHtmlAtCaret('<i class="' + classname + ' icon-active"></i>', true);
96634
96720
  this.builder.activeIcon = this.builder.doc.querySelector('.icon-active');
96721
+
96722
+ // this.util.pasteHtmlAtCaret('<i class="icon-active"></i>', true);
96723
+ // const newIcon = this.builder.doc.querySelector('.icon-active');
96724
+ // newIcon.className = classname + ' icon-active';
96725
+ // this.builder.activeIcon = newIcon;
96726
+
96635
96727
  dom.selectElementContents(this.builder.activeIcon);
96636
96728
  this.util.saveSelection();
96637
96729
  }
@@ -97184,7 +97276,39 @@ class SaveImages {
97184
97276
  }
97185
97277
  uploadImages(area) {
97186
97278
  if (!area) return;
97279
+
97187
97280
  //Check all images
97281
+
97282
+ const divs = area.querySelectorAll('.is-overlay-bg,.is-container > div > div,.is-lightbox,.block-click');
97283
+ divs.forEach(div => {
97284
+ let src = '';
97285
+ if (div.style.backgroundImage) {
97286
+ if (div.style.backgroundImage.indexOf('url(') !== -1) {
97287
+ src = div.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
97288
+ }
97289
+ } else if (div.classList.contains('is-lightbox')) {
97290
+ src = div.getAttribute('href');
97291
+ } else if (div.classList.contains('block-click')) {
97292
+ src = div.getAttribute('data-modal-url');
97293
+ }
97294
+ if (src.includes('base64')) {
97295
+ if (this.opts.onBase64Upload) {
97296
+ let ext = 'jpg';
97297
+ if (src.includes('image/png')) {
97298
+ ext = 'png';
97299
+ }
97300
+
97301
+ //Read image (base64 string)
97302
+ let image = src;
97303
+ image = image.replace(/^data:image\/(png|svg\+xml|jpeg);base64,/, '');
97304
+ let filename = this.builder.util.makeId() + '.' + ext; //img.getAttribute('data-filename');
97305
+
97306
+ // console.log(div)
97307
+ this.opts.onBase64Upload(div, image, filename); // target image, base64 string, filename
97308
+ }
97309
+ }
97310
+ });
97311
+
97188
97312
  const images = area.querySelectorAll('img');
97189
97313
  Array.prototype.forEach.call(images, img => {
97190
97314
  let src = img.getAttribute('src');
@@ -105934,16 +106058,30 @@ ${answer}
105934
106058
  }
105935
106059
 
105936
106060
  getContainer() {
105937
- let container, builderActive, docContainer;
106061
+ let container, builderActive;
105938
106062
  builderActive = this.builder.doc.querySelector('.builder-active');
105939
106063
  if (builderActive) container = builderActive;else {
105940
- docContainer = this.builder.doc.querySelector(this.builder.docContainer);
105941
- if (docContainer) {
106064
+ if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer) {
106065
+ // canvas mode
105942
106066
  let activeBlock = this.builder.doc.querySelector('.is-block.cloned');
105943
106067
  if (!activeBlock) activeBlock = this.builder.doc.querySelector('.is-block.active');
105944
- if (activeBlock) container = activeBlock.querySelector(this.builder.container);
105945
- if (!container) container = this.builder.doc.querySelector(this.builder.container);
106068
+ if (activeBlock) {
106069
+ container = activeBlock.querySelector(this.builder.container);
106070
+ if (!container) container = this.builder.doc.querySelector(this.builder.container);
106071
+ } else {
106072
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106073
+ let blockContainer = docContainer.querySelector('.box-select');
106074
+ if (!blockContainer) {
106075
+ blockContainer = docContainer.querySelector(this.builder.blockContainer);
106076
+ }
106077
+ if (blockContainer) {
106078
+ container = blockContainer.querySelector(this.builder.container);
106079
+ } else {
106080
+ container = this.builder.doc.querySelector(this.builder.container);
106081
+ }
106082
+ }
105946
106083
  } else {
106084
+ // standard mode
105947
106085
  container = this.builder.doc.querySelector(this.builder.container);
105948
106086
  }
105949
106087
  }
@@ -105951,56 +106089,92 @@ ${answer}
105951
106089
  }
105952
106090
  renderImage(src) {
105953
106091
  this.builder.saveForUndo();
106092
+ if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer) {
106093
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106094
+ let blockContainer = docContainer.querySelector('.box-select');
106095
+ if (!blockContainer) {
106096
+ blockContainer = docContainer.querySelector(this.builder.blockContainer);
106097
+ }
106098
+ if (!blockContainer) {
106099
+ this.builder.addPage();
106100
+ blockContainer = docContainer.querySelector(this.builder.blockContainer);
106101
+ }
106102
+ let html = `
106103
+ <div class="is-block" style="top:15%;left:30%;width:760px;height:760px;">
106104
+ <div class="is-block-overlay" style="background-image: url(&quot;${src}&quot;);"></div>
106105
+ </div>
106106
+ `;
106107
+ this.builder.addBlock(html, blockContainer);
106108
+ this.builder.settings.onChange();
106109
+ this.builder.settings.onRender();
106110
+ return;
106111
+ }
105954
106112
  let container = this.getContainer();
105955
106113
  if (!container) {
105956
- if (this.builder.canvas) {
105957
- // Canvas Mode
105958
- const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
105959
- if (docContainer) {
105960
- /*
105961
- <div class="is-block block-steady height-auto" style="top: calc(24.4455% - 37.646px);left: calc(50% - 332px);width: 664px;">
105962
- <div class="is-container leading-12 size-17">
105963
- <div class="row"><div class="column"><img src="${src}"></div></div>
106114
+ /*
106115
+ if(this.builder.canvas) {
106116
+ // Canvas Mode
106117
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106118
+ if(docContainer) {
106119
+
106120
+ // <div class="is-block block-steady height-auto" style="top: calc(24.4455% - 37.646px);left: calc(50% - 332px);width: 664px;">
106121
+ // <div class="is-container leading-12 size-17">
106122
+ // <div class="row"><div class="column"><img src="${src}"></div></div>
106123
+ // </div>
106124
+ // </div>
106125
+ let html = `
106126
+ <div class="is-block" style="top:15%;left:30%;width:760px;height:760px;">
106127
+ <div class="is-block-overlay" style="background-image: url(&quot;${src}&quot;);"></div>
105964
106128
  </div>
105965
- </div>
105966
- */
105967
- let html = `
105968
- <div class="is-block" style="top:15%;left:30%;width:760px;height:760px;">
105969
- <div class="is-block-overlay" style="background-image: url(&quot;${src}&quot;);"></div>
105970
- </div>
105971
- `;
105972
- const blockContainer = docContainer.querySelector(this.builder.blockContainer);
105973
- this.builder.addBlock(html, blockContainer);
105974
- }
105975
- } else {
105976
- this.util.showMessage(this.util.out('No text container found.'));
105977
- this.dictation.finish(); // Must be called after finished
105978
- return;
106129
+ `;
106130
+ const blockContainer = docContainer.querySelector(this.builder.blockContainer);
106131
+ this.builder.addBlock(html, blockContainer);
106132
+ }
106133
+ } else {
106134
+ this.util.showMessage(this.util.out('No text container found.'));
106135
+ this.dictation.finish(); // Must be called after finished
106136
+ return;
105979
106137
  }
106138
+ */
106139
+ this.util.showMessage(this.util.out('No text container found.'));
106140
+ this.dictation.finish(); // Must be called after finished
106141
+ return;
105980
106142
  } else {
105981
- if (this.builder.canvas) {
105982
- // Canvas Mode
105983
- const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
105984
- if (docContainer) {
106143
+ /*
106144
+ if(this.builder.canvas) {
106145
+ // Canvas Mode
106146
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106147
+ if(docContainer) {
106148
+
106149
+ let html = `
106150
+ <div class="is-block" style="top:15%;left:30%;width:760px;height:760px;">
106151
+ <div class="is-block-overlay" style="background-image: url(&quot;${src}&quot;);"></div>
106152
+ </div>
106153
+ `;
106154
+ const blockContainer = docContainer.querySelector(this.builder.blockContainer);
106155
+ this.builder.addBlock(html, blockContainer);
106156
+ }
106157
+ } else {
106158
+ // Normal
105985
106159
  let html = `
105986
- <div class="is-block" style="top:15%;left:30%;width:760px;height:760px;">
105987
- <div class="is-block-overlay" style="background-image: url(&quot;${src}&quot;);"></div>
105988
- </div>
105989
- `;
105990
- const blockContainer = docContainer.querySelector(this.builder.blockContainer);
105991
- this.builder.addBlock(html, blockContainer);
105992
- }
105993
- } else {
105994
- // Normal
105995
- let html = `
105996
- <div class="row"><div class="column"><img src="${src}"></div></div>
105997
- `;
105998
- container.insertAdjacentHTML('afterBegin', html);
105999
- setTimeout(() => {
106000
- container.firstElementChild.click();
106001
- }, 300);
106002
- this.builder.applyBehaviorOn(container);
106160
+ <div class="row"><div class="column"><img src="${src}"></div></div>
106161
+ `;
106162
+ container.insertAdjacentHTML('afterBegin', html);
106163
+ setTimeout(()=>{
106164
+ container.firstElementChild.click();
106165
+ }, 300);
106166
+ this.builder.applyBehaviorOn(container);
106003
106167
  }
106168
+ */
106169
+ // Normal
106170
+ let html = `
106171
+ <div class="row"><div class="column"><img src="${src}"></div></div>
106172
+ `;
106173
+ container.insertAdjacentHTML('afterBegin', html);
106174
+ setTimeout(() => {
106175
+ container.firstElementChild.click();
106176
+ }, 300);
106177
+ this.builder.applyBehaviorOn(container);
106004
106178
  }
106005
106179
  this.builder.settings.onChange();
106006
106180
  this.builder.settings.onRender();
@@ -106013,50 +106187,87 @@ ${answer}
106013
106187
  if (elm) {
106014
106188
  html = elm.innerHTML;
106015
106189
  }
106190
+ if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer) {
106191
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106192
+ let blockContainer = docContainer.querySelector('.box-select');
106193
+ if (!blockContainer) {
106194
+ blockContainer = docContainer.querySelector(this.builder.blockContainer);
106195
+ }
106196
+ if (!blockContainer) {
106197
+ this.builder.addPage();
106198
+ blockContainer = docContainer.querySelector(this.builder.blockContainer);
106199
+ }
106200
+ html = `
106201
+ <div class="is-block block-steady height-auto" style="top: calc(24.4455% - 37.646px);left: calc(50% - 332px);width: 664px;">
106202
+ <div class="is-container leading-12 size-17">
106203
+ ${html}
106204
+ </div>
106205
+ </div>
106206
+ `;
106207
+ this.builder.addBlock(html, blockContainer);
106208
+ this.builder.settings.onChange();
106209
+ this.builder.settings.onRender();
106210
+ return;
106211
+ }
106016
106212
  let container = this.getContainer();
106017
106213
  if (!container) {
106018
- if (this.builder.canvas) {
106019
- // Canvas Mode
106020
- const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106021
- if (docContainer) {
106022
- html = `
106023
- <div class="is-block block-steady height-auto" style="top: calc(24.4455% - 37.646px);left: calc(50% - 332px);width: 664px;">
106024
- <div class="is-container leading-12 size-17">
106025
- ${html}
106026
- </div>
106027
- </div>
106028
- `;
106029
- const blockContainer = docContainer.querySelector(this.builder.blockContainer);
106030
- this.builder.addBlock(html, blockContainer);
106031
- }
106032
- } else {
106033
- this.util.showMessage(this.util.out('No text container found.'));
106034
- this.dictation.finish(); // Must be called after finished
106035
- return;
106214
+ /*
106215
+ if(this.builder.canvas) {
106216
+ // Canvas Mode
106217
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106218
+ if(docContainer) {
106219
+
106220
+ html = `
106221
+ <div class="is-block block-steady height-auto" style="top: calc(24.4455% - 37.646px);left: calc(50% - 332px);width: 664px;">
106222
+ <div class="is-container leading-12 size-17">
106223
+ ${html}
106224
+ </div>
106225
+ </div>
106226
+ `;
106227
+ const blockContainer = docContainer.querySelector(this.builder.blockContainer);
106228
+ this.builder.addBlock(html, blockContainer);
106229
+ }
106230
+ } else {
106231
+ this.util.showMessage(this.util.out('No text container found.'));
106232
+ this.dictation.finish(); // Must be called after finished
106233
+ return;
106036
106234
  }
106235
+ */
106236
+ this.util.showMessage(this.util.out('No text container found.'));
106237
+ this.dictation.finish(); // Must be called after finished
106238
+ return;
106037
106239
  } else {
106038
- if (this.builder.canvas) {
106039
- // Canvas Mode
106040
- const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106041
- if (docContainer) {
106042
- html = `
106043
- <div class="is-block block-steady height-auto" style="top: calc(24.4455% - 37.646px);left: calc(50% - 332px);width: 664px;">
106044
- <div class="is-container leading-12 size-17">
106045
- ${html}
106046
- </div>
106047
- </div>
106048
- `;
106049
- const blockContainer = docContainer.querySelector(this.builder.blockContainer);
106050
- this.builder.addBlock(html, blockContainer);
106051
- }
106052
- } else {
106053
- // Normal
106054
- container.insertAdjacentHTML('afterBegin', html);
106055
- setTimeout(() => {
106056
- container.firstElementChild.click();
106057
- }, 300);
106058
- this.builder.applyBehaviorOn(container);
106240
+ /*
106241
+ if(this.builder.canvas) {
106242
+ // Canvas Mode
106243
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
106244
+ if(docContainer) {
106245
+
106246
+ html = `
106247
+ <div class="is-block block-steady height-auto" style="top: calc(24.4455% - 37.646px);left: calc(50% - 332px);width: 664px;">
106248
+ <div class="is-container leading-12 size-17">
106249
+ ${html}
106250
+ </div>
106251
+ </div>
106252
+ `;
106253
+ const blockContainer = docContainer.querySelector(this.builder.blockContainer);
106254
+ this.builder.addBlock(html, blockContainer);
106255
+ }
106256
+ } else {
106257
+ // Normal
106258
+ container.insertAdjacentHTML('afterBegin', html);
106259
+ setTimeout(()=>{
106260
+ container.firstElementChild.click();
106261
+ }, 300);
106262
+ this.builder.applyBehaviorOn(container);
106059
106263
  }
106264
+ */
106265
+ // Normal
106266
+ container.insertAdjacentHTML('afterBegin', html);
106267
+ setTimeout(() => {
106268
+ container.firstElementChild.click();
106269
+ }, 300);
106270
+ this.builder.applyBehaviorOn(container);
106060
106271
  }
106061
106272
  this.builder.settings.onChange();
106062
106273
  this.builder.settings.onRender();
@@ -106973,7 +107184,11 @@ class Common {
106973
107184
  this.matrix3d = new Matrix3D();
106974
107185
  return this.matrix3d.transform2d(block, x1, y1, x2, y2, x3, y3, x4, y4);
106975
107186
  }
107187
+ setZoom(scale) {
107188
+ this.zoom = scale;
107189
+ }
106976
107190
  applyPercentage(block) {
107191
+ const zoom = this.zoom;
106977
107192
  const rect = this.getRect(block);
106978
107193
  const container = block.parentNode;
106979
107194
  let isChildBlock = false;
@@ -106984,11 +107199,11 @@ class Common {
106984
107199
 
106985
107200
  // const containerRect = container.getBoundingClientRect(); // if container has top/left
106986
107201
  const containerRect = this.getRect(container); // if container has top/left
106987
- const left = (rect.left - containerRect.left) / container.offsetWidth * 100;
106988
- const top = (rect.top - containerRect.top) / container.offsetHeight * 100;
107202
+ let left = (rect.left - containerRect.left) / container.offsetWidth * 100;
107203
+ let top = (rect.top - containerRect.top) / container.offsetHeight * 100;
106989
107204
  let isBlockFixed = block.classList.contains('block-steady');
106990
107205
  if (isBlockFixed) {
106991
- let dividerTop = (container.offsetHeight - block.offsetHeight) / (rect.top - containerRect.top);
107206
+ let dividerTop = (container.offsetHeight - block.offsetHeight) / (rect.top - containerRect.top) * zoom;
106992
107207
  if (isNaN(dividerTop)) {
106993
107208
  // there is possibility of 0/0
106994
107209
  dividerTop = 1;
@@ -106997,7 +107212,7 @@ class Common {
106997
107212
  if (isChildBlock) {
106998
107213
  block.style.top = top + '%';
106999
107214
  }
107000
- let dividerLeft = (container.offsetWidth - block.offsetWidth) / (rect.left - containerRect.left);
107215
+ let dividerLeft = (container.offsetWidth - block.offsetWidth) / (rect.left - containerRect.left) * zoom;
107001
107216
  if (isNaN(dividerLeft)) {
107002
107217
  // there is possibility of 0/0
107003
107218
  dividerLeft = 1;
@@ -107018,16 +107233,17 @@ class Common {
107018
107233
  const height = block.offsetHeight / container.offsetHeight * 100;
107019
107234
  block.style.width = width + '%';
107020
107235
  block.style.height = height + '%';
107021
- block.style.top = top + '%';
107022
- block.style.left = left + '%';
107236
+ block.style.top = top / zoom + '%';
107237
+ block.style.left = left / zoom + '%';
107023
107238
  if (block.classList.contains('height-auto')) block.style.height = '';
107024
107239
  }
107025
107240
  }
107026
107241
  applyPixels(block) {
107242
+ const zoom = this.zoom;
107027
107243
  const rect = this.getRect(block);
107028
107244
  const containerRect = this.getRect(block.parentNode); // if container has top/left
107029
- block.style.left = rect.left - containerRect.left + 'px';
107030
- block.style.top = rect.top - containerRect.top + 'px';
107245
+ block.style.left = (rect.left - containerRect.left) / zoom + 'px';
107246
+ block.style.top = (rect.top - containerRect.top) / zoom + 'px';
107031
107247
  block.style.width = block.offsetWidth + 'px';
107032
107248
  }
107033
107249
  updateHeight(block) {
@@ -107463,6 +107679,9 @@ class Ruler {
107463
107679
  this.verticalRulerCenter = this.doc.getElementById('vertical-ruler-center');
107464
107680
  this.setup();
107465
107681
  }
107682
+ setZoom(scale) {
107683
+ this.zoom = scale;
107684
+ }
107466
107685
  setup() {
107467
107686
  this.elements = this.doc.querySelectorAll(this.selector);
107468
107687
  }
@@ -107492,6 +107711,8 @@ class Ruler {
107492
107711
  if (transform.includes('rotate') || transform.includes('matrix3d')) return;
107493
107712
  let parentTransform = block.parentNode.style.transform;
107494
107713
  if (parentTransform.includes('rotate')) return;
107714
+ if (this.zoom * 1 !== 1) return; // disable rulers on zoomed page
107715
+
107495
107716
  this.hideRulers();
107496
107717
  const rect = block.getBoundingClientRect();
107497
107718
  const top = rect.top;
@@ -107853,6 +108074,11 @@ class Resizable {
107853
108074
  win: this.win
107854
108075
  });
107855
108076
  }
108077
+ setZoom(scale) {
108078
+ this.zoom = scale;
108079
+ this.common.setZoom(scale);
108080
+ this.ruler.setZoom(scale);
108081
+ }
107856
108082
  setup() {
107857
108083
  this.elements.forEach(element => {
107858
108084
  element.querySelectorAll('.handle').forEach(elm => elm.parentNode.removeChild(elm));
@@ -108022,35 +108248,38 @@ class Resizable {
108022
108248
  this.ruler.hideRulers();
108023
108249
  }
108024
108250
  resizeTopLeft(deltaX, deltaY) {
108025
- this.target.style.left = this.initialLeft + deltaX + 'px';
108026
- this.target.style.top = this.initialTop + deltaY + 'px';
108251
+ const zoom = this.zoom;
108252
+ this.target.style.left = this.initialLeft / zoom + deltaX + 'px';
108253
+ this.target.style.top = this.initialTop / zoom + deltaY + 'px';
108027
108254
  this.target.style.width = this.initialWidth - deltaX + 'px';
108028
108255
  this.target.style.height = this.initialHeight - deltaY + 'px';
108029
108256
  if (this.clonedTarget) {
108030
- this.clonedTarget.style.left = this.initialLeft + deltaX + 'px';
108031
- this.clonedTarget.style.top = this.initialTop + deltaY + 'px';
108257
+ this.clonedTarget.style.left = this.initialLeft / zoom + deltaX + 'px';
108258
+ this.clonedTarget.style.top = this.initialTop / zoom + deltaY + 'px';
108032
108259
  this.clonedTarget.style.width = this.initialWidth - deltaX + 'px';
108033
108260
  this.clonedTarget.style.height = this.initialHeight - deltaY + 'px';
108034
108261
  }
108035
108262
  }
108036
108263
  resizeTopRight(deltaX, deltaY) {
108264
+ const zoom = this.zoom;
108037
108265
  this.target.style.width = this.initialWidth + deltaX + 'px';
108038
- this.target.style.top = this.initialTop + deltaY + 'px';
108266
+ this.target.style.top = this.initialTop / zoom + deltaY + 'px';
108039
108267
  this.target.style.height = this.initialHeight - deltaY + 'px';
108040
108268
  if (this.clonedTarget) {
108041
108269
  this.clonedTarget.style.width = this.initialWidth + deltaX + 'px';
108042
- this.clonedTarget.style.top = this.initialTop + deltaY + 'px';
108270
+ this.clonedTarget.style.top = this.initialTop / zoom + deltaY + 'px';
108043
108271
  this.clonedTarget.style.height = this.initialHeight - deltaY + 'px';
108044
108272
  }
108045
108273
  }
108046
108274
  resizeBottomLeft(deltaX, deltaY) {
108275
+ const zoom = this.zoom;
108047
108276
  this.target.style.width = this.initialWidth - deltaX + 'px';
108048
108277
  this.target.style.height = this.initialHeight + deltaY + 'px';
108049
- this.target.style.left = this.initialLeft + deltaX + 'px';
108278
+ this.target.style.left = this.initialLeft / zoom + deltaX + 'px';
108050
108279
  if (this.clonedTarget) {
108051
108280
  this.clonedTarget.style.width = this.initialWidth - deltaX + 'px';
108052
108281
  this.clonedTarget.style.height = this.initialHeight + deltaY + 'px';
108053
- this.clonedTarget.style.left = this.initialLeft + deltaX + 'px';
108282
+ this.clonedTarget.style.left = this.initialLeft / zoom + deltaX + 'px';
108054
108283
  }
108055
108284
  }
108056
108285
  resizeBottomRight(deltaX, deltaY) {
@@ -108062,10 +108291,11 @@ class Resizable {
108062
108291
  }
108063
108292
  }
108064
108293
  resizeTop(deltaY) {
108065
- this.target.style.top = this.initialTop + deltaY + 'px';
108294
+ const zoom = this.zoom;
108295
+ this.target.style.top = this.initialTop / zoom + deltaY + 'px';
108066
108296
  this.target.style.height = this.initialHeight - deltaY + 'px';
108067
108297
  if (this.clonedTarget) {
108068
- this.clonedTarget.style.top = this.initialTop + deltaY + 'px';
108298
+ this.clonedTarget.style.top = this.initialTop / zoom + deltaY + 'px';
108069
108299
  this.clonedTarget.style.height = this.initialHeight - deltaY + 'px';
108070
108300
  }
108071
108301
  }
@@ -108076,11 +108306,12 @@ class Resizable {
108076
108306
  }
108077
108307
  }
108078
108308
  resizeLeft(deltaX) {
108309
+ const zoom = this.zoom;
108079
108310
  this.target.style.width = this.initialWidth - deltaX + 'px';
108080
- this.target.style.left = this.initialLeft + deltaX + 'px';
108311
+ this.target.style.left = this.initialLeft / zoom + deltaX + 'px';
108081
108312
  if (this.clonedTarget) {
108082
108313
  this.clonedTarget.style.width = this.initialWidth - deltaX + 'px';
108083
- this.clonedTarget.style.left = this.initialLeft + deltaX + 'px';
108314
+ this.clonedTarget.style.left = this.initialLeft / zoom + deltaX + 'px';
108084
108315
  }
108085
108316
  }
108086
108317
  resizeRight(deltaX) {
@@ -108155,20 +108386,36 @@ class Resizable {
108155
108386
 
108156
108387
  const largeScreenBreakpoint = 1920; //1920
108157
108388
 
108158
- if (breakpoint && breakpoint < largeScreenBreakpoint) {
108159
- target.setAttribute('data--t-' + breakpoint, target.style.top);
108160
- target.setAttribute('data--l-' + breakpoint, target.style.left);
108161
- target.setAttribute('data--b-' + breakpoint, target.style.bottom);
108162
- target.setAttribute('data--r-' + breakpoint, target.style.right);
108163
- if (!target.classList.contains('fluid')) target.setAttribute('data--w-' + breakpoint, target.style.width);
108164
- target.setAttribute('data--h-' + breakpoint, target.style.height);
108165
- } else {
108389
+ let isPrint = false;
108390
+ let elmBox = target.closest('[data-pagesize]');
108391
+ if (elmBox) {
108392
+ if (elmBox.getAttribute('data-pagesize').includes('web')) ; else {
108393
+ isPrint = true;
108394
+ }
108395
+ }
108396
+ if (isPrint) {
108166
108397
  target.setAttribute('data--t', target.style.top);
108167
108398
  target.setAttribute('data--l', target.style.left);
108168
108399
  target.setAttribute('data--b', target.style.bottom);
108169
108400
  target.setAttribute('data--r', target.style.right);
108170
108401
  target.setAttribute('data--w', target.style.width);
108171
108402
  target.setAttribute('data--h', target.style.height);
108403
+ } else {
108404
+ if (breakpoint && breakpoint < largeScreenBreakpoint) {
108405
+ target.setAttribute('data--t-' + breakpoint, target.style.top);
108406
+ target.setAttribute('data--l-' + breakpoint, target.style.left);
108407
+ target.setAttribute('data--b-' + breakpoint, target.style.bottom);
108408
+ target.setAttribute('data--r-' + breakpoint, target.style.right);
108409
+ if (!target.classList.contains('fluid')) target.setAttribute('data--w-' + breakpoint, target.style.width);
108410
+ target.setAttribute('data--h-' + breakpoint, target.style.height);
108411
+ } else {
108412
+ target.setAttribute('data--t', target.style.top);
108413
+ target.setAttribute('data--l', target.style.left);
108414
+ target.setAttribute('data--b', target.style.bottom);
108415
+ target.setAttribute('data--r', target.style.right);
108416
+ target.setAttribute('data--w', target.style.width);
108417
+ target.setAttribute('data--h', target.style.height);
108418
+ }
108172
108419
  }
108173
108420
  target.removeAttribute('data-prev'); // reset
108174
108421
  target.removeAttribute('data-fluid');
@@ -108211,6 +108458,11 @@ class Draggable {
108211
108458
  win: this.win
108212
108459
  });
108213
108460
  }
108461
+ setZoom(scale) {
108462
+ this.zoom = scale;
108463
+ this.common.setZoom(scale);
108464
+ this.ruler.setZoom(scale);
108465
+ }
108214
108466
  setup() {
108215
108467
  this.elements = this.doc.querySelectorAll(this.selector);
108216
108468
  this.elements.forEach(element => {
@@ -108351,8 +108603,9 @@ class Draggable {
108351
108603
  const startY = target.getAttribute('data-starty');
108352
108604
  const newX = x - startX;
108353
108605
  const newY = y - startY;
108354
- target.style.left = newX + 'px';
108355
- target.style.top = newY + 'px';
108606
+ const zoom = this.zoom;
108607
+ target.style.left = newX / zoom + 'px';
108608
+ target.style.top = newY / zoom + 'px';
108356
108609
  }
108357
108610
  }
108358
108611
  handleDragEnd() {
@@ -108402,20 +108655,36 @@ class Draggable {
108402
108655
 
108403
108656
  const largeScreenBreakpoint = 1920; //1920
108404
108657
 
108405
- if (breakpoint && breakpoint < largeScreenBreakpoint) {
108406
- target.setAttribute('data--t-' + breakpoint, target.style.top);
108407
- target.setAttribute('data--l-' + breakpoint, target.style.left);
108408
- target.setAttribute('data--b-' + breakpoint, target.style.bottom);
108409
- target.setAttribute('data--r-' + breakpoint, target.style.right);
108410
- if (!target.classList.contains('fluid')) target.setAttribute('data--w-' + breakpoint, target.style.width);
108411
- target.setAttribute('data--h-' + breakpoint, target.style.height);
108412
- } else {
108658
+ let isPrint = false;
108659
+ let elmBox = target.closest('[data-pagesize]');
108660
+ if (elmBox) {
108661
+ if (elmBox.getAttribute('data-pagesize').includes('web')) ; else {
108662
+ isPrint = true;
108663
+ }
108664
+ }
108665
+ if (isPrint) {
108413
108666
  target.setAttribute('data--t', target.style.top);
108414
108667
  target.setAttribute('data--l', target.style.left);
108415
108668
  target.setAttribute('data--b', target.style.bottom);
108416
108669
  target.setAttribute('data--r', target.style.right);
108417
108670
  target.setAttribute('data--w', target.style.width);
108418
108671
  target.setAttribute('data--h', target.style.height);
108672
+ } else {
108673
+ if (breakpoint && breakpoint < largeScreenBreakpoint) {
108674
+ target.setAttribute('data--t-' + breakpoint, target.style.top);
108675
+ target.setAttribute('data--l-' + breakpoint, target.style.left);
108676
+ target.setAttribute('data--b-' + breakpoint, target.style.bottom);
108677
+ target.setAttribute('data--r-' + breakpoint, target.style.right);
108678
+ if (!target.classList.contains('fluid')) target.setAttribute('data--w-' + breakpoint, target.style.width);
108679
+ target.setAttribute('data--h-' + breakpoint, target.style.height);
108680
+ } else {
108681
+ target.setAttribute('data--t', target.style.top);
108682
+ target.setAttribute('data--l', target.style.left);
108683
+ target.setAttribute('data--b', target.style.bottom);
108684
+ target.setAttribute('data--r', target.style.right);
108685
+ target.setAttribute('data--w', target.style.width);
108686
+ target.setAttribute('data--h', target.style.height);
108687
+ }
108419
108688
  }
108420
108689
  target.removeAttribute('data-prev'); // reset
108421
108690
  target.removeAttribute('data-fluid');
@@ -108832,7 +109101,8 @@ class EditableBlocks {
108832
109101
  // onMultipleSelect: () => {},
108833
109102
  disableOnMobile: 0,
108834
109103
  rotate: true,
108835
- clone: true
109104
+ clone: true,
109105
+ zoom: 1
108836
109106
  // onDelete: () = {}
108837
109107
  };
108838
109108
 
@@ -109097,6 +109367,12 @@ class EditableBlocks {
109097
109367
  win: this.win,
109098
109368
  onDuplicate: this.onDuplicate
109099
109369
  });
109370
+ this.setZoom(this.zoom);
109371
+ }
109372
+ setZoom(scale) {
109373
+ this.common.setZoom(scale);
109374
+ this.draggable.setZoom(scale);
109375
+ this.resizable.setZoom(scale);
109100
109376
  }
109101
109377
  duplicate() {
109102
109378
  this.common.duplicate();
@@ -109192,32 +109468,58 @@ class BlockModal {
109192
109468
  let html = `
109193
109469
  <div class="is-modal is-modal-content editblock" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
109194
109470
  <div class="is-modal-bar is-draggable">
109195
- ${util.out('Block')}
109471
+ <span class="modal-title"></span>
109196
109472
  <button class="is-modal-close" tabindex="-1" title="${util.out('Close')}">&#10005;</button>
109197
109473
  </div>
109198
- <div class="modal-none" style="dsiplay:none">
109199
- <div>${util.out('Please select a block.')}</div>
109474
+ <div class="modal-none" style="display:none;padding-bottom:28px;">
109475
+
109476
+ <div>${util.out('Please select a block or page.')}</div>
109477
+
109200
109478
  </div>
109479
+
109480
+ <div class="modal-page-content" style="display:none;padding-bottom:28px;">
109481
+
109482
+ <div style="padding-bottom: 3px;">${util.out('Background Color')}:</div>
109483
+ <div style="display:flex;">
109484
+ <button title="${util.out('Background Color')}" class="input-page-bgcolor is-btn-color" style="margin-right:15px"></button>
109485
+ <button title="${util.out('Gradient')}" class="btn-page-gradient classic" data-value="+"> ${util.out('Gradient')} </button>
109486
+ </div>
109487
+
109488
+ <div style="padding-top:20px;padding-bottom: 3px;">${util.out('Background Image')}:</div>
109489
+ <div>
109490
+ <div class="asset-page-preview" style="display:none"></div>
109491
+ <div style="display: flex">
109492
+ <button title="${util.out('Image')}" class="btn-page-bgimage">
109493
+ <svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg>
109494
+ <span>${util.out('Image')}</span>
109495
+ </button>
109496
+ <button title="${util.out('Select')}" class="btn-page-asset">${this.builder.opts.selectIcon}</button>
109497
+ <button title="${util.out('Remove')}" class="btn-page-clear"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>
109498
+ <button title="${util.out('Adjust')}" class="btn-page-adjust" style="width:40px"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>
109499
+ </div>
109500
+ </div>
109501
+
109502
+ </div>
109503
+
109201
109504
  <div class="modal-content">
109202
109505
 
109203
109506
  <div style="padding-bottom: 3px;">${util.out('Background Color')}:</div>
109204
109507
  <div style="display:flex;">
109205
109508
  <button title="${util.out('Background Color')}" class="input-block-bgcolor is-btn-color" style="margin-right:15px"></button>
109206
- <button title="${util.out('Gradient')}" class="btn-gradient classic" data-value="+"> ${util.out('Gradient')} </button>
109509
+ <button title="${util.out('Gradient')}" class="btn-block-gradient classic" data-value="+"> ${util.out('Gradient')} </button>
109207
109510
  </div>
109208
109511
 
109209
109512
  <div style="padding-top:20px;padding-bottom: 3px;">${util.out('Background Image')}:</div>
109210
109513
  <div>
109211
- <div class="asset-preview" style="display:none"></div>
109514
+ <div class="asset-block-preview" style="display:none"></div>
109212
109515
  <div style="display: flex">
109213
- <input class="inp-file" type="file" accept="image/*" style="display:none"/>
109214
- <button title="${util.out('Image')}" class="btn-bgimage">
109516
+ <button title="${util.out('Image')}" class="btn-block-bgimage">
109215
109517
  <svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg>
109216
109518
  <span>${util.out('Image')}</span>
109217
109519
  </button>
109218
- <button title="${util.out('Select')}" class="btn-asset">${this.builder.opts.selectIcon}</button>
109219
- <button title="${util.out('Remove')}" class="btn-clear"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>
109220
- <button title="${util.out('Adjust')}" class="btn-adjust" style="width:40px"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>
109520
+ <button title="${util.out('Select')}" class="btn-block-asset">${this.builder.opts.selectIcon}</button>
109521
+ <button title="${util.out('Remove')}" class="btn-block-clear"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>
109522
+ <button title="${util.out('Adjust')}" class="btn-block-adjust" style="width:40px"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>
109221
109523
  </div>
109222
109524
  </div>
109223
109525
 
@@ -109339,9 +109641,49 @@ class BlockModal {
109339
109641
  this.hide();
109340
109642
  });
109341
109643
 
109342
- // Background color
109644
+ // Page Background color
109645
+
109646
+ const btnPageGradient = modal.querySelector('.btn-page-gradient');
109647
+ const btnPageColorPick = modal.querySelector('.input-page-bgcolor');
109648
+ btnPageColorPick.addEventListener('click', () => {
109649
+ this.builder.uo.saveForUndo(true); // checkLater = true
109650
+
109651
+ let page = this.getPage();
109652
+ let bgcolor = btnPageColorPick.style.backgroundColor;
109653
+ this.builder.colorPicker.open(s => {
109654
+ page.style.backgroundColor = s;
109655
+ if (page.style.backgroundImage && page.style.backgroundImage.includes('gradient')) {
109656
+ page.style.backgroundImage = ''; // remove gradient
109657
+ btnPageGradient.style.backgroundImage = ''; // preview
109658
+ }
109343
109659
 
109344
- const btnGradient = modal.querySelector('.btn-gradient');
109660
+ btnPageColorPick.style.backgroundColor = s; // preview
109661
+
109662
+ this.builder.onChange();
109663
+ }, bgcolor, () => {
109664
+ btnPageColorPick.removeAttribute('data-focus');
109665
+ btnPageColorPick.focus();
109666
+ });
109667
+ btnPageColorPick.setAttribute('data-focus', true);
109668
+ });
109669
+ btnPageGradient.addEventListener('click', () => {
109670
+ this.builder.uo.saveForUndo(true); // checkLater = true
109671
+
109672
+ let page = this.getPage();
109673
+ let gradientPicker = this.builder.gradientpicker();
109674
+ gradientPicker.open(page, () => {
109675
+ page.style.backgroundColor = '';
109676
+ btnPageColorPick.style.backgroundColor = ''; // preview
109677
+
109678
+ this.updatePanelImage('');
109679
+ this.builder.onChange();
109680
+ btnPageGradient.style.backgroundImage = page.style.backgroundImage; // preview
109681
+ });
109682
+ });
109683
+
109684
+ // Block Background color
109685
+
109686
+ const btnGradient = modal.querySelector('.btn-block-gradient');
109345
109687
  const btnColorPick = modal.querySelector('.input-block-bgcolor');
109346
109688
  btnColorPick.addEventListener('click', () => {
109347
109689
  this.builder.uo.saveForUndo(true); // checkLater = true
@@ -109379,10 +109721,63 @@ class BlockModal {
109379
109721
  });
109380
109722
  });
109381
109723
 
109382
- // Background Image
109724
+ // Page Background Image
109725
+
109726
+ this.pageImagePreview = modal.querySelector('.asset-page-preview');
109727
+ const btnPageBgImage = modal.querySelector('.btn-page-bgimage');
109728
+ if (btnPageBgImage) dom.addEventListener(btnPageBgImage, 'click', () => {
109729
+ // Background image
109730
+ const page = this.getPage();
109731
+ let src = '';
109732
+ if (page) if (page.style.backgroundImage) {
109733
+ if (page.style.backgroundImage.indexOf('url(') !== -1) {
109734
+ src = page.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
109735
+ }
109736
+ }
109737
+ this.openImagePicker(src, url => {
109738
+ const page = this.getPage();
109739
+ this.builder.uo.saveForUndo();
109740
+ page.style.backgroundImage = `url("${url}")`;
109741
+ page.style.backgroundSize = 'cover';
109742
+ page.style.backgroundRepeat = 'no-repeat';
109743
+ const div = this.pageImagePreview;
109744
+ const btnPageAdjust = modal.querySelector('.btn-page-adjust');
109745
+ const btnPageClear = modal.querySelector('.btn-page-clear');
109746
+ btnPageAdjust.style.display = 'none';
109747
+ btnPageClear.style.display = 'none';
109748
+ if (url !== '') {
109749
+ div.innerHTML = `<img src="${url}">`;
109750
+ btnPageAdjust.style.display = 'flex';
109751
+ btnPageClear.style.display = 'flex';
109752
+ } else {
109753
+ div.innerHTML = '';
109754
+ }
109755
+ this.builder.onChange();
109756
+ }, btnPageBgImage);
109757
+ });
109758
+ const btnPageOpenAsset = modal.querySelector('.btn-page-asset');
109759
+ btnPageOpenAsset.addEventListener('click', () => {
109760
+ this.builder.openAssetSelect('image', src => {
109761
+ this.updatePageImage(src);
109762
+ }, btnPageOpenAsset);
109763
+ });
109383
109764
 
109384
- this.imagePreview = modal.querySelector('.asset-preview');
109385
- const btnBgImage = modal.querySelector('.btn-bgimage');
109765
+ // Show/hide button
109766
+ if (!(this.builder.onImageSelectClick || this.builder.imageSelect)) btnPageOpenAsset.style.display = 'none';
109767
+ const btnPageClear = modal.querySelector('.btn-page-clear');
109768
+ btnPageClear.addEventListener('click', () => {
109769
+ this.updatePageImage('');
109770
+ });
109771
+ const btnPageAdjust = modal.querySelector('.btn-page-adjust');
109772
+ btnPageAdjust.addEventListener('click', () => {
109773
+ let page = this.getPage();
109774
+ this.builder.colTool.openImageAdjust(page, btnPageAdjust);
109775
+ });
109776
+
109777
+ // Block Background Image
109778
+
109779
+ this.imagePreview = modal.querySelector('.asset-block-preview');
109780
+ const btnBgImage = modal.querySelector('.btn-block-bgimage');
109386
109781
  if (btnBgImage) dom.addEventListener(btnBgImage, 'click', () => {
109387
109782
  // Background image
109388
109783
  const blockOverlay = this.blockOverlay();
@@ -109399,8 +109794,8 @@ class BlockModal {
109399
109794
  blockOverlay.style.backgroundSize = 'cover';
109400
109795
  blockOverlay.style.backgroundRepeat = 'no-repeat';
109401
109796
  const div = this.imagePreview;
109402
- const btnAdjust = modal.querySelector('.btn-adjust');
109403
- const btnClear = modal.querySelector('.btn-clear');
109797
+ const btnAdjust = modal.querySelector('.btn-block-adjust');
109798
+ const btnClear = modal.querySelector('.btn-block-clear');
109404
109799
  btnAdjust.style.display = 'none';
109405
109800
  btnClear.style.display = 'none';
109406
109801
  if (url !== '') {
@@ -109413,7 +109808,7 @@ class BlockModal {
109413
109808
  this.builder.onChange();
109414
109809
  }, btnBgImage);
109415
109810
  });
109416
- const btnOpenAsset = modal.querySelector('.btn-asset');
109811
+ const btnOpenAsset = modal.querySelector('.btn-block-asset');
109417
109812
  btnOpenAsset.addEventListener('click', () => {
109418
109813
  this.builder.openAssetSelect('image', src => {
109419
109814
  this.updateImage(src);
@@ -109422,11 +109817,11 @@ class BlockModal {
109422
109817
 
109423
109818
  // Show/hide button
109424
109819
  if (!(this.builder.onImageSelectClick || this.builder.imageSelect)) btnOpenAsset.style.display = 'none';
109425
- const btnClear = modal.querySelector('.btn-clear');
109820
+ const btnClear = modal.querySelector('.btn-block-clear');
109426
109821
  btnClear.addEventListener('click', () => {
109427
109822
  this.updateImage('');
109428
109823
  });
109429
- const btnAdjust = modal.querySelector('.btn-adjust');
109824
+ const btnAdjust = modal.querySelector('.btn-block-adjust');
109430
109825
  btnAdjust.addEventListener('click', () => {
109431
109826
  let blockOverlay = this.blockOverlay();
109432
109827
  this.builder.colTool.openImageAdjust(blockOverlay, btnAdjust);
@@ -109629,6 +110024,7 @@ class BlockModal {
109629
110024
  target.classList.add('locked');
109630
110025
  this.builder.eb.draggable.disableDrag(target);
109631
110026
  this.lock(target);
110027
+ this.realtime();
109632
110028
  });
109633
110029
  } else {
109634
110030
  elms.forEach(target => {
@@ -109657,6 +110053,12 @@ class BlockModal {
109657
110053
  }
109658
110054
  });
109659
110055
  }
110056
+ } // constructor
110057
+
110058
+ getPage() {
110059
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
110060
+ const page = docContainer.querySelector('.box-select');
110061
+ return page;
109660
110062
  }
109661
110063
  lock() {
109662
110064
  // target
@@ -109698,66 +110100,82 @@ class BlockModal {
109698
110100
  }
109699
110101
  realtime() {
109700
110102
  const modal = this.modal;
110103
+ const page = this.getPage();
110104
+ const block = this.blockSelected();
110105
+ if (block) {
110106
+ const btnClearBreakpoints = modal.querySelector('.btn-clear-breakpoint');
110107
+ let hasBreakpoints = false;
110108
+ var attributes = block.attributes;
110109
+ for (var i = 0; i < attributes.length; i++) {
110110
+ let item = attributes[i].name;
110111
+ if (item.includes('data--t-') || item.includes('data--b-' )) {
110112
+ // has breakpoints
110113
+ hasBreakpoints = true;
110114
+ }
110115
+ }
110116
+ if (hasBreakpoints) {
110117
+ btnClearBreakpoints.style.display = '';
110118
+ } else {
110119
+ btnClearBreakpoints.style.display = 'none';
110120
+ }
109701
110121
 
109702
- // Background image
109703
- const blockOverlay = this.blockOverlay();
109704
- let src = '';
109705
- if (blockOverlay) if (blockOverlay.style.backgroundImage) {
109706
- if (blockOverlay.style.backgroundImage.indexOf('url(') !== -1) {
109707
- src = blockOverlay.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
110122
+ // Background image
110123
+ const blockOverlay = this.blockOverlay();
110124
+ let src = '';
110125
+ if (blockOverlay) if (blockOverlay.style.backgroundImage) {
110126
+ if (blockOverlay.style.backgroundImage.indexOf('url(') !== -1) {
110127
+ src = blockOverlay.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
110128
+ }
109708
110129
  }
109709
- }
109710
110130
 
109711
- // Update preview
109712
- this.updatePanelImage(src);
110131
+ // Update preview
110132
+ this.updatePanelImage(src);
109713
110133
 
109714
- // Show/hide grayscale
109715
- const divGrayscale = modal.querySelector('.label.grayscale');
109716
- if (src === '') {
109717
- this.imagePreview.style.display = 'none';
109718
- divGrayscale.style.display = 'none';
109719
- } else {
109720
- this.imagePreview.style.display = '';
109721
- divGrayscale.style.display = '';
109722
- }
110134
+ // Show/hide grayscale
110135
+ const divGrayscale = modal.querySelector('.label.grayscale');
110136
+ if (src === '') {
110137
+ this.imagePreview.style.display = 'none';
110138
+ divGrayscale.style.display = 'none';
110139
+ } else {
110140
+ this.imagePreview.style.display = '';
110141
+ divGrayscale.style.display = '';
110142
+ }
109723
110143
 
109724
- // Grayscale
109725
- const chkGrayscale = modal.querySelector('.chk-grayscale');
109726
- chkGrayscale.checked = false;
109727
- if (blockOverlay) {
109728
- if (blockOverlay.style.filter) {
109729
- if (blockOverlay.style.filter.indexOf('grayscale') !== -1) {
109730
- chkGrayscale.checked = true;
110144
+ // Grayscale
110145
+ const chkGrayscale = modal.querySelector('.chk-grayscale');
110146
+ chkGrayscale.checked = false;
110147
+ if (blockOverlay) {
110148
+ if (blockOverlay.style.filter) {
110149
+ if (blockOverlay.style.filter.indexOf('grayscale') !== -1) {
110150
+ chkGrayscale.checked = true;
110151
+ }
109731
110152
  }
109732
110153
  }
109733
- }
109734
110154
 
109735
- // Background color
109736
- const btnColorPick = modal.querySelector('.input-block-bgcolor');
109737
- if (blockOverlay) {
109738
- let bgcolor = blockOverlay.style.backgroundColor;
109739
- btnColorPick.style.backgroundColor = bgcolor; //preview
109740
- } else {
109741
- btnColorPick.style.backgroundColor = ''; //preview
109742
- }
110155
+ // Background color
110156
+ const btnColorPick = modal.querySelector('.input-block-bgcolor');
110157
+ if (blockOverlay) {
110158
+ let bgcolor = blockOverlay.style.backgroundColor;
110159
+ btnColorPick.style.backgroundColor = bgcolor; //preview
110160
+ } else {
110161
+ btnColorPick.style.backgroundColor = ''; //preview
110162
+ }
109743
110163
 
109744
- // Gradient
109745
- const btnGradient = modal.querySelector('.btn-gradient');
109746
- if (blockOverlay) {
109747
- if (blockOverlay.style.backgroundImage && blockOverlay.style.backgroundImage.includes('gradient')) {
109748
- btnGradient.style.backgroundImage = blockOverlay.style.backgroundImage;
110164
+ // Gradient
110165
+ const btnGradient = modal.querySelector('.btn-block-gradient');
110166
+ if (blockOverlay) {
110167
+ if (blockOverlay.style.backgroundImage && blockOverlay.style.backgroundImage.includes('gradient')) {
110168
+ btnGradient.style.backgroundImage = blockOverlay.style.backgroundImage;
110169
+ } else {
110170
+ btnGradient.style.backgroundImage = '';
110171
+ }
109749
110172
  } else {
109750
110173
  btnGradient.style.backgroundImage = '';
109751
110174
  }
109752
- } else {
109753
- btnGradient.style.backgroundImage = '';
109754
- }
109755
- const btnClearText = modal.querySelector('.btn-clear-text');
109756
- btnClearText.style.display = 'none';
109757
- const divContentColor = modal.querySelector('.div-content-textcolor');
109758
- divContentColor.style.display = 'none';
109759
- const block = this.blockSelected();
109760
- if (block) {
110175
+ const btnClearText = modal.querySelector('.btn-clear-text');
110176
+ btnClearText.style.display = 'none';
110177
+ const divContentColor = modal.querySelector('.div-content-textcolor');
110178
+ divContentColor.style.display = 'none';
109761
110179
  if (block.querySelector('.is-container')) {
109762
110180
  btnClearText.style.display = '';
109763
110181
  divContentColor.style.display = '';
@@ -109875,6 +110293,45 @@ class BlockModal {
109875
110293
  inpHeight.value = '';
109876
110294
  inpHeightUnit.value = '%';
109877
110295
  }
110296
+ } else if (page) {
110297
+ // Background image
110298
+ let src = '';
110299
+ if (page) if (page.style.backgroundImage) {
110300
+ if (page.style.backgroundImage.indexOf('url(') !== -1) {
110301
+ src = page.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
110302
+ }
110303
+ }
110304
+
110305
+ // Update preview
110306
+ this.updatePanelPageImage(src);
110307
+
110308
+ // Show/hide
110309
+ if (src === '') {
110310
+ this.pageImagePreview.style.display = 'none';
110311
+ } else {
110312
+ this.pageImagePreview.style.display = '';
110313
+ }
110314
+
110315
+ // Background color
110316
+ const btnPageColorPick = modal.querySelector('.input-page-bgcolor');
110317
+ if (page) {
110318
+ let bgcolor = page.style.backgroundColor;
110319
+ btnPageColorPick.style.backgroundColor = bgcolor; //preview
110320
+ } else {
110321
+ btnPageColorPick.style.backgroundColor = ''; //preview
110322
+ }
110323
+
110324
+ // Gradient
110325
+ const btnPageGradient = modal.querySelector('.btn-page-gradient');
110326
+ if (page) {
110327
+ if (page.style.backgroundImage && page.style.backgroundImage.includes('gradient')) {
110328
+ btnPageGradient.style.backgroundImage = page.style.backgroundImage;
110329
+ } else {
110330
+ btnPageGradient.style.backgroundImage = '';
110331
+ }
110332
+ } else {
110333
+ btnPageGradient.style.backgroundImage = '';
110334
+ }
109878
110335
  }
109879
110336
  }
109880
110337
  openImagePicker(currentUrl, callback, btn) {
@@ -109896,6 +110353,43 @@ class BlockModal {
109896
110353
  }, false, this.builder.assetPanelFullScreen);
109897
110354
  if (btn) btn.setAttribute('data-focus', true);
109898
110355
  }
110356
+ updatePageImage(src) {
110357
+ this.builder.uo.saveForUndo();
110358
+ let page = this.getPage();
110359
+ page.style.backgroundImage = 'url(\'' + src + '\')';
110360
+
110361
+ // Reset position & filter (grayscale)
110362
+ page.style.filter = '';
110363
+ page.style.backgroundSize = '';
110364
+ page.style.backgroundPosition = '50% 60%';
110365
+ page.removeAttribute('data-bg-xs');
110366
+ page.removeAttribute('data-bg-sm');
110367
+ page.removeAttribute('data-bg-md');
110368
+ page.removeAttribute('data-bg-lg');
110369
+ this.updatePanelPageImage(src);
110370
+ this.builder.onChange();
110371
+ }
110372
+ updatePanelPageImage(src) {
110373
+ const modal = this.modal;
110374
+ let previewHtml;
110375
+ if (!src) previewHtml = '';else previewHtml = `
110376
+ <img src="${src}">
110377
+ `;
110378
+ this.pageImagePreview.innerHTML = previewHtml;
110379
+
110380
+ // Show/hide image-related controls
110381
+ const btnPageClear = modal.querySelector('.btn-page-clear');
110382
+ const btnPageAdjust = modal.querySelector('.btn-page-adjust');
110383
+ if (src === '') {
110384
+ btnPageClear.style.display = 'none';
110385
+ btnPageAdjust.style.display = 'none';
110386
+ } else {
110387
+ btnPageClear.style.display = '';
110388
+ btnPageAdjust.style.display = '';
110389
+ }
110390
+ const btnPageGradient = modal.querySelector('.btn-page-gradient');
110391
+ btnPageGradient.style.backgroundImage = '';
110392
+ }
109899
110393
  updateImage(src) {
109900
110394
  this.builder.uo.saveForUndo();
109901
110395
  let blockOverlay = this.blockOverlay();
@@ -109921,8 +110415,8 @@ class BlockModal {
109921
110415
  this.imagePreview.innerHTML = previewHtml;
109922
110416
 
109923
110417
  // Show/hide image-related controls
109924
- const btnClear = modal.querySelector('.btn-clear');
109925
- const btnAdjust = modal.querySelector('.btn-adjust');
110418
+ const btnClear = modal.querySelector('.btn-block-clear');
110419
+ const btnAdjust = modal.querySelector('.btn-block-adjust');
109926
110420
  if (src === '') {
109927
110421
  btnClear.style.display = 'none';
109928
110422
  btnAdjust.style.display = 'none';
@@ -109930,7 +110424,7 @@ class BlockModal {
109930
110424
  btnClear.style.display = '';
109931
110425
  btnAdjust.style.display = '';
109932
110426
  }
109933
- const btnGradient = modal.querySelector('.btn-gradient');
110427
+ const btnGradient = modal.querySelector('.btn-block-gradient');
109934
110428
  btnGradient.style.backgroundImage = '';
109935
110429
  }
109936
110430
  show() {
@@ -109950,22 +110444,48 @@ class BlockModal {
109950
110444
  }
109951
110445
  this.util.showModal(modal);
109952
110446
  this.realtime();
109953
- this.handleBlockClick = e => {
109954
- const content1 = modal.querySelector('.modal-none');
109955
- const content2 = modal.querySelector('.modal-content');
109956
- const activeBlock = this.builder.doc.querySelector('.is-block.active:not(.multi)');
109957
- if (activeBlock) {
110447
+ this.handleBlockClick = () => {
110448
+ this.showHideControls();
110449
+ };
110450
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
110451
+ docContainer.addEventListener('click', this.handleBlockClick);
110452
+ if (this.builder.iframe) {
110453
+ docContainer.addEventListener('click', this.handleBlockClick);
110454
+ }
110455
+ this.showHideControls();
110456
+ }
110457
+ showHideControls() {
110458
+ const modal = this.modal;
110459
+ const content1 = modal.querySelector('.modal-none');
110460
+ const content2 = modal.querySelector('.modal-content');
110461
+ const content3 = modal.querySelector('.modal-page-content');
110462
+ const activeBlock = this.builder.doc.querySelector('.is-block.active');
110463
+ const page = this.getPage();
110464
+ const modalTitle = modal.querySelector('.modal-title');
110465
+ if (activeBlock) {
110466
+ if (!activeBlock.closest('.multi')) {
109958
110467
  content1.style.display = 'none';
109959
110468
  content2.style.display = '';
109960
- if (!e.target.classList.contains('.is-block')) this.realtime();
110469
+ content3.style.display = 'none';
110470
+ modalTitle.innerHTML = this.util.out('Block');
110471
+ this.realtime();
109961
110472
  } else {
109962
- content1.style.display = '';
110473
+ content1.style.display = 'none';
109963
110474
  content2.style.display = 'none';
110475
+ content3.style.display = '';
110476
+ modalTitle.innerHTML = this.util.out('Page');
110477
+ this.realtime();
109964
110478
  }
109965
- };
109966
- document.addEventListener('click', this.handleBlockClick);
109967
- if (this.builder.iframe) {
109968
- this.builder.doc.addEventListener('click', this.handleBlockClick);
110479
+ } else if (page) {
110480
+ content1.style.display = 'none';
110481
+ content2.style.display = 'none';
110482
+ content3.style.display = '';
110483
+ modalTitle.innerHTML = this.util.out('Page');
110484
+ this.realtime();
110485
+ } else {
110486
+ content1.style.display = '';
110487
+ content2.style.display = 'none';
110488
+ content3.style.display = 'none';
109969
110489
  }
109970
110490
  }
109971
110491
  hide() {
@@ -109978,11 +110498,380 @@ class BlockModal {
109978
110498
  }
109979
110499
  }
109980
110500
 
110501
+ class PageSize {
110502
+ constructor(builder) {
110503
+ this.builder = builder;
110504
+ const util = this.builder.util;
110505
+ this.util = util;
110506
+ const builderStuff = this.builder.builderStuff;
110507
+ this.builderStuff = builderStuff;
110508
+ const dom = this.builder.dom;
110509
+ this.dom = dom;
110510
+ }
110511
+ open() {
110512
+ const builderStuff = this.builderStuff;
110513
+ const util = this.util;
110514
+ const dom = this.dom;
110515
+ let modal = builderStuff.querySelector('.is-modal.pagesize');
110516
+ if (!modal) {
110517
+ const html = `
110518
+ <div class="is-modal pagesize" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
110519
+ <div class="is-modal-content">
110520
+
110521
+ <div class="div-page-sizes">
110522
+ <button title="Web" data-pagesize="100%,100vh,web" data-width="" data-height="" style="flex:none;width:180px;height:112.5px" class="paper-item">Web (full)</button>
110523
+ <button title="Web" data-pagesize="800px,1000px,web" data-width="" data-height="" style="flex:none;width:180px;height:112.5px" class="paper-item">Web (container)</button>
110524
+ <button title="8.27x5.52" data-pagesize="8.27in,5.52in" data-width="8.27in" data-height="5.52in" style="flex:none;width:124.05px;height:82.8px" class="paper-item">8.27x5.52</button>
110525
+ <button title="8.3x5.8" data-pagesize="8.3in,5.8in" data-width="8.3in" data-height="5.8in" style="flex:none;width:124.50000000000001px;height:87px" class="paper-item">A5</button>
110526
+ <button title="9x7" data-pagesize="9in,7in" data-width="9in" data-height="7in" style="flex:none;width:135px;height:105px" class="paper-item">9x7</button>
110527
+ <button title="11.7x8.3" data-pagesize="11.7in,8.3in" data-width="11.7in" data-height="8.3in" style="flex:none;width:175.5px;height:124.50000000000001px" class="paper-item">A4</button>
110528
+ <button title="11x8.5" data-pagesize="11in,8.5in" data-width="11in" data-height="8.5in" style="flex:none;width:165px;height:127.5px" class="paper-item">Letter</button>
110529
+ <button title="12.5x10" data-pagesize="12.5in,10in" data-width="12.5in" data-height="10in" style="flex:none;width:187.5px;height:150px" class="paper-item">12.5x10</button>
110530
+ <button title="14x11" data-pagesize="14in,11in" data-width="14in" data-height="11in" style="flex:none;width:210px;height:165px" class="paper-item">14x11</button>
110531
+ <button title="8.5x8.5" data-pagesize="8.5in,8.5in" data-width="8.5in" data-height="8.5in" style="flex:none;width:127.5px;height:127.5px" class="paper-item">8.5x8.5</button>
110532
+ <button title="10x10" data-pagesize="10in,10in" data-width="10in" data-height="10in" style="flex:none;width:150px;height:150px" class="paper-item on">10x10</button>
110533
+ <button title="12x12" data-pagesize="12in,12in" data-width="12in" data-height="12in" style="flex:none;width:180px;height:180px" class="paper-item">12x12</button>
110534
+ <button title="5.27x8.27" data-pagesize="5.27in,8.27in" data-width="5.27in" data-height="8.27in" style="flex:none;width:79.05px;height:124.05px" class="paper-item">5.27x8.27</button>
110535
+ <button title="5.8x8.3" data-pagesize="5.8in,8.3in" data-width="5.8in" data-height="8.3in" style="flex:none;width:87px;height:124.50000000000001px" class="paper-item">A5</button>
110536
+ <button title="6x9" data-pagesize="6in,9in" data-width="6in" data-height="9in" style="flex:none;width:90px;height:135px" class="paper-item">6x9</button>
110537
+ <button title="6.6x10.25" data-pagesize="6.6in,10.25in" data-width="6.6in" data-height="10.25in" style="flex:none;width:99px;height:153.75px" class="paper-item">6.6x10.25</button>
110538
+ <button title="8.5x11" data-pagesize="8.5in,11in" data-width="8.5in" data-height="11in" style="flex:none;width:127.5px;height:165px" class="paper-item">Letter</button>
110539
+ <button title="8.3x11.7" data-pagesize="8.3in,11.7in" data-width="8.3in" data-height="11.7in" style="flex:none;width:124.50000000000001px;height:175.5px" class="paper-item">A4</button>
110540
+ </div>
110541
+
110542
+ <div class="flex" style="gap:10px;justify-content:center;margin-top:15px;">
110543
+ <div>
110544
+ <label for="inpPageWidth" style="display:block">${util.out('Width')}:</label>
110545
+ <input id="inpPageWidth" class="input-width" type="text">
110546
+ </div>
110547
+ <div>
110548
+ <label for="inpPageWidth" style="display:block">${util.out('Height')}:</label>
110549
+ <input id="inpPageHeight" class="input-height" type="text">
110550
+ </div>
110551
+ </div>
110552
+
110553
+ <div style="text-align:right;margin-top:20px;display:none">
110554
+ <button title="${util.out('Cancel')}" class="input-cancel classic-secondary">${util.out('Cancel')}</button>
110555
+ <button title="${util.out('Ok')}" class="input-ok classic-primary">${util.out('Ok')}</button>
110556
+ </div>
110557
+
110558
+ </div>
110559
+ </div>
110560
+ <div class="is-modal viewprint" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
110561
+ <div class="is-modal-content" style="width:100%;height:100vh;padding:0;">
110562
+ <iframe tabindex="0" style="width:100vw;height:100vh;border: none;display: block;" src="about:blank"></iframe>
110563
+ </div>
110564
+ </div>
110565
+ `;
110566
+ dom.appendHtml(builderStuff, html);
110567
+ modal = builderStuff.querySelector('.pagesize');
110568
+ this.modal = modal;
110569
+ const inpWidth = modal.querySelector('.input-width');
110570
+ const inpHeight = modal.querySelector('.input-height');
110571
+ const current = localStorage.getItem('_pagesize');
110572
+ if (current) {
110573
+ const arrCurrent = current.split(',');
110574
+ inpWidth.value = arrCurrent[0].trim();
110575
+ inpHeight.value = arrCurrent[1].trim();
110576
+ }
110577
+ const btnPageSize = modal.querySelectorAll('[data-pagesize]');
110578
+ btnPageSize.forEach(btn => {
110579
+ btn.addEventListener('click', () => {
110580
+ const elmCss = document.querySelector('#__css_pagesize');
110581
+ if (elmCss) elmCss.remove();
110582
+ const s = btn.getAttribute('data-pagesize');
110583
+ this.setPageSize(s);
110584
+ inpWidth.value = '';
110585
+ inpHeight.value = '';
110586
+ const arr = s.split(',');
110587
+ inpWidth.value = arr[0].trim();
110588
+ inpHeight.value = arr[1].trim();
110589
+ });
110590
+ });
110591
+ let timer;
110592
+ inpWidth.addEventListener('input', () => {
110593
+ clearTimeout(timer);
110594
+ timer = setTimeout(() => {
110595
+ const current = localStorage.getItem('_pagesize');
110596
+ let isWeb = false;
110597
+ const arrCurrent = current.split(',');
110598
+ if (arrCurrent.length === 3) isWeb = true;
110599
+ let s = inpWidth.value + ',' + inpHeight.value + (isWeb ? ',web' : '');
110600
+ this.setPageSize(s);
110601
+ }, 600);
110602
+ });
110603
+ inpHeight.addEventListener('input', () => {
110604
+ clearTimeout(timer);
110605
+ timer = setTimeout(() => {
110606
+ const current = localStorage.getItem('_pagesize');
110607
+ let isWeb = false;
110608
+ const arrCurrent = current.split(',');
110609
+ if (arrCurrent.length === 3) isWeb = true;
110610
+ let s = inpWidth.value + ',' + inpHeight.value + (isWeb ? ',web' : '');
110611
+ this.setPageSize(s);
110612
+ }, 600);
110613
+ });
110614
+ const btnImageOk = modal.querySelector('.input-ok');
110615
+ dom.addEventListener(btnImageOk, 'click', () => {
110616
+ // const inpSrc = modal.querySelector('.input-src');
110617
+ // const url = inpSrc.value;
110618
+
110619
+ this.builder.hideModal(modal);
110620
+ });
110621
+ const btnImageCancel = modal.querySelector('.input-cancel');
110622
+ dom.addEventListener(btnImageCancel, 'click', () => {
110623
+ this.builder.hideModal(modal);
110624
+ });
110625
+ }
110626
+ this.util.showModal(modal, false);
110627
+ }
110628
+ setPageSize(s) {
110629
+ if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer && !this.builder.iframe) {
110630
+ localStorage.setItem('_pagesize', s);
110631
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
110632
+ const elms = docContainer.querySelectorAll('.is-box');
110633
+ elms.forEach(elm => {
110634
+ elm.setAttribute('data-pagesize', s);
110635
+ });
110636
+ const elmCss = document.querySelector('#__css_pagesize');
110637
+ if (elmCss) elmCss.remove();
110638
+ let css = this.getPageCss();
110639
+ document.head.insertAdjacentHTML('beforeend', css);
110640
+
110641
+ // for the tools position
110642
+ const arr = s.split(',');
110643
+ // let w = arr[0].trim();
110644
+ // let h = arr[1].trim();
110645
+ if (arr.length === 3) {
110646
+ // web
110647
+ const docWidth = docContainer.offsetWidth;
110648
+ const viewportWidth = this.builder.win.innerWidth;
110649
+ if (docWidth < viewportWidth - 50) {
110650
+ // web (container)
110651
+ docContainer.classList.remove('page-web');
110652
+ docContainer.classList.add('page-web-container');
110653
+ } else {
110654
+ // web (full)
110655
+ docContainer.classList.remove('page-web-container');
110656
+ docContainer.classList.add('page-web');
110657
+ }
110658
+ } else {
110659
+ // print
110660
+ docContainer.classList.remove('page-web');
110661
+ docContainer.classList.remove('page-web-container');
110662
+ }
110663
+ } else {
110664
+ alert('This function works in Canvas mode only.');
110665
+ }
110666
+ }
110667
+ print() {
110668
+ const builderStuff = this.builderStuff;
110669
+ const dom = this.dom;
110670
+ let modalIframe = builderStuff.querySelector('.viewprint');
110671
+ if (!modalIframe) {
110672
+ let html = `
110673
+ <div class="viewprint" style="display:none">
110674
+ <iframe tabindex="0" style="width:2000px;height:2000px;border: none;display: block;" src="about:blank"></iframe>
110675
+ </div>`;
110676
+ dom.appendHtml(builderStuff, html);
110677
+ modalIframe = builderStuff.querySelector('.viewprint');
110678
+ }
110679
+ if (this.builder.canvas && !this.builder.isContentBox && this.builder.docContainer && !this.builder.iframe) {
110680
+ const ifr = modalIframe.querySelector('iframe');
110681
+ ifr.srcdoc = this.getPrintHtml();
110682
+ } else {
110683
+ alert('This function works in Canvas mode only.');
110684
+ }
110685
+ }
110686
+ getPrintHtml() {
110687
+ let css = this.getPrintCss();
110688
+ let html = this.builder.html();
110689
+ return `
110690
+ <!DOCTYPE HTML>
110691
+ <html>
110692
+ <head>
110693
+ <meta charset="utf-8">
110694
+ <title></title>
110695
+ <meta name="viewport" content="width=device-width, initial-scale=1">
110696
+ <meta name="description" content="">
110697
+
110698
+ <link href="${this.builder.snippetPath}print.css" rel="stylesheet">
110699
+
110700
+ <style>
110701
+
110702
+ /* block.css */
110703
+ /* box-canvas */
110704
+ .is-box {
110705
+ position: relative;
110706
+ flex:none;
110707
+ }
110708
+ .is-block {
110709
+ position: absolute;
110710
+ box-sizing: border-box;
110711
+ padding: 0;
110712
+ }
110713
+ .is-block .is-container {
110714
+ max-width: unset !important;
110715
+ width: 100%;
110716
+ padding: 0;
110717
+ box-sizing: border-box;
110718
+ position: relative;
110719
+ z-index: 1;
110720
+ }
110721
+ .is-box.autolayout .is-block.block-steady.fluid {
110722
+ padding: 0;
110723
+ width: 100% !important;
110724
+ min-width: unset !important;
110725
+ left: auto !important
110726
+ }
110727
+ .is-block-overlay { background-size: cover; background-repeat: no-repeat; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; user-select: none; }
110728
+
110729
+
110730
+ body {
110731
+ background: #eee;
110732
+ }
110733
+ .is-page {
110734
+ position: relative;
110735
+ transform-origin: top;
110736
+ }
110737
+ .is-box {
110738
+ position: relative;
110739
+ flex:none;
110740
+ background: #fff;
110741
+ overflow: hidden;
110742
+ box-shadow: none;
110743
+ }
110744
+ ${css}
110745
+ </style>
110746
+ </head>
110747
+ <body class="print">
110748
+
110749
+ <div class="is-page">${html}</div>
110750
+
110751
+ <script>
110752
+ window.print();
110753
+ </script>
110754
+ </body>
110755
+ </html>
110756
+ `;
110757
+ }
110758
+ getPageCss() {
110759
+ let s;
110760
+ if (localStorage.getItem('_pagesize') === '' || localStorage.getItem('_pagesize')) {
110761
+ s = localStorage.getItem('_pagesize');
110762
+ } else {
110763
+ s = this.pageSize || '';
110764
+ }
110765
+ let w, h;
110766
+ let css;
110767
+ if (s) {
110768
+ const arr = s.split(',');
110769
+ w = arr[0].trim();
110770
+ h = arr[1].trim();
110771
+ if (arr.length === 3) {
110772
+ // web
110773
+ css = `
110774
+ <style id="__css_pagesize">
110775
+ .is-page {
110776
+ ${(w === '100%' || w === '100vw') && (h === '100%' || h === '100vh') ? '' : 'margin-top: 150px;'}
110777
+ }
110778
+ .is-box {
110779
+ width: 100%;
110780
+ max-width: ${w};
110781
+ height: ${h};
110782
+ margin: 0 auto;
110783
+ }
110784
+ </style>
110785
+ `;
110786
+ } else {
110787
+ // print
110788
+ css = `
110789
+ <style id="__css_pagesize">
110790
+ .is-page {
110791
+ margin-top:150px;
110792
+ gap: 45px;
110793
+ }
110794
+ .is-box {
110795
+ width: ${w};
110796
+ height: ${h};
110797
+ }
110798
+ </style>
110799
+ `;
110800
+ }
110801
+ }
110802
+ return css;
110803
+ }
110804
+ getPrintCss() {
110805
+ let s;
110806
+ if (localStorage.getItem('_pagesize') === '' || localStorage.getItem('_pagesize')) {
110807
+ s = localStorage.getItem('_pagesize');
110808
+ } else {
110809
+ s = this.pageSize || '';
110810
+ }
110811
+ let w, h;
110812
+ let css;
110813
+ if (s) {
110814
+ const arr = s.split(',');
110815
+ w = arr[0].trim();
110816
+ h = arr[1].trim();
110817
+ if (arr.length === 3) {
110818
+ // web
110819
+ const docContainer = this.builder.doc.querySelector(this.builder.docContainer);
110820
+ const box = docContainer.querySelector('.is-box');
110821
+ if (!box) return '';
110822
+ const docWidth = box.offsetWidth + 'px';
110823
+ const docHeight = box.offsetHeight + 'px';
110824
+ css = `
110825
+ <style id="__css_pagesize">
110826
+ .is-box {
110827
+ width: 100%;
110828
+ max-width: ${docWidth};
110829
+ height: ${docHeight};
110830
+ margin: 0 auto;
110831
+ }
110832
+ @media print {
110833
+ .is-box {
110834
+ width: ${docWidth};
110835
+ height: ${docHeight};
110836
+ }
110837
+ }
110838
+ @page {
110839
+ size:${docWidth} ${docHeight};;
110840
+ margin: 0;
110841
+ }
110842
+ </style>
110843
+ `;
110844
+ } else {
110845
+ // print
110846
+ css = `
110847
+ <style id="__css_pagesize">
110848
+ .is-box {
110849
+ width: ${w};
110850
+ height: ${h};
110851
+ }
110852
+ @media print {
110853
+ .is-box {
110854
+ width: ${w};
110855
+ height: ${h};
110856
+ }
110857
+ }
110858
+ @page {
110859
+ size:${w} ${h};
110860
+ margin: 0;
110861
+ }
110862
+ </style>
110863
+ `;
110864
+ }
110865
+ }
110866
+ return css;
110867
+ }
110868
+ }
110869
+
109981
110870
  class ContentBuilder {
109982
110871
  constructor(opts = {}) {
109983
110872
  let defaults = {
109984
110873
  page: '',
109985
- container: '.container',
110874
+ container: '.is-container',
109986
110875
  row: '',
109987
110876
  cols: [],
109988
110877
  colequal: [],
@@ -110224,6 +111113,8 @@ class ContentBuilder {
110224
111113
  onUndo: function () {},
110225
111114
  onRedo: function () {},
110226
111115
  onBlockCanvasAdd: function () {},
111116
+ // docContainer: '.is-page',
111117
+ blockContainer: '.is-box',
110227
111118
  /*
110228
111119
  Deprecated:
110229
111120
  snippetSampleImage: '',
@@ -111022,6 +111913,34 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111022
111913
  }
111023
111914
  this.settings = this.opts; // Backward compatible
111024
111915
 
111916
+ // freeform
111917
+ if (this.canvas && !this.isContentBox) {
111918
+ /*
111919
+ blockContainer: '.is-box',
111920
+ imageResizeOnBlock: false,
111921
+ toolbarDisplay: 'always',
111922
+ buttons: ['bold', 'italic', 'underline', 'formatting', 'color', 'align', 'textsettings', 'createLink', 'tags', '|', 'undo', 'redo', 'aiassistant', 'snippets', 'zoom', 'pageoptions', 'print', 'html', 'more'],
111923
+ buttonsMore: ['icon', 'image', '|', 'list', 'font', 'formatPara'],
111924
+ elementButtons: ['front', 'backward', 'moveup', 'movedown', 'group', 'ungroup', 'duplicate', 'delete','left', 'center', 'right', 'full' , 'undo', 'redo', 'aiassistant', 'snippets', 'blocksettings', 'zoom', 'pageoptions', 'print', 'html'],
111925
+ elementButtonsMore: [],
111926
+ iconButtons: ['icon', 'color','textsettings', 'createLink','|', 'undo', 'redo', 'aiassistant', 'snippets', 'zoom', 'pageoptions', 'print', 'html'],
111927
+ iconButtonsMore: [],
111928
+ */
111929
+ this.blockContainer = '.is-box';
111930
+ this.imageResizeOnBlock = false;
111931
+ this.toolbarDisplay = 'always';
111932
+ this.buttons = ['bold', 'italic', 'underline', 'formatting', 'color', 'align', 'textsettings', 'createLink', 'tags', '|', 'undo', 'redo', 'aiassistant', 'snippets', 'zoom', 'pageoptions', 'print', 'html', 'more'];
111933
+ this.buttonsMore = ['icon', 'image', '|', 'list', 'font', 'formatPara'];
111934
+ this.elementButtons = ['front', 'backward', 'moveup', 'movedown', 'group', 'ungroup', 'duplicate', 'delete', 'left', 'center', 'right', 'full', 'undo', 'redo', 'aiassistant', 'snippets', 'blocksettings', 'zoom', 'pageoptions', 'print', 'html'];
111935
+ this.elementButtonsMore = [];
111936
+ this.iconButtons = ['icon', 'color', 'textsettings', 'createLink', '|', 'undo', 'redo', 'aiassistant', 'snippets', 'zoom', 'pageoptions', 'print', 'html'];
111937
+ this.iconButtonsMore = [];
111938
+ if (!this.docContainer && this.container !== '.is-container') {
111939
+ this.docContainer = this.container;
111940
+ this.container = '.is-container';
111941
+ this.opts.container = '.is-container';
111942
+ }
111943
+ }
111025
111944
  if (this.opts.imageSelect !== '') {
111026
111945
  this.opts.imageselect = this.opts.imageSelect;
111027
111946
  } else if (this.opts.imageselect !== '') {
@@ -111160,6 +112079,10 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111160
112079
  this.win = win;
111161
112080
  this.doc = doc;
111162
112081
  this.doc.body.classList.add('data-editor');
112082
+ if (this.canvas && !this.isContentBox && this.docContainer && !this.iframe) {
112083
+ const docContainer = document.querySelector(this.docContainer);
112084
+ docContainer.classList.add('is-page');
112085
+ }
111163
112086
 
111164
112087
  // Disable on mobile
111165
112088
  const viewportWidth = this.doc.body.clientWidth;
@@ -111407,6 +112330,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111407
112330
 
111408
112331
  // freeform
111409
112332
  if (this.canvas && !this.isContentBox) this.blockmodal = new BlockModal(this);
112333
+ if (this.canvas) this.pageoption = new PageSize(this);
111410
112334
 
111411
112335
  // freeform
111412
112336
  if (this.canvas) this.eb = new EditableBlocks({
@@ -111417,6 +112341,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111417
112341
  parentSelector: '.box-canvas',
111418
112342
  rotate: true,
111419
112343
  // disableOnMobile: 760,
112344
+ zoom: this.opts.zoom,
111420
112345
  onBeforeChange: () => {
111421
112346
  this.uo.saveForUndo();
111422
112347
  },
@@ -111424,15 +112349,15 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111424
112349
  this.opts.onChange();
111425
112350
  },
111426
112351
  onEditStart: (event, block) => {
112352
+ let activeBlock = this.doc.querySelector('.is-block.cloned');
112353
+ if (!activeBlock) return;
112354
+ const container = activeBlock.querySelector('.is-container');
112355
+ if (!container) return;
111427
112356
  block.classList.add('editable');
111428
112357
 
111429
112358
  // get element to activate
111430
112359
  let x = event.clientX;
111431
112360
  let y = event.clientY;
111432
- let activeBlock = this.doc.querySelector('.is-block.cloned');
111433
- if (!activeBlock) return;
111434
- const container = activeBlock.querySelector('.is-container');
111435
- if (!container) return;
111436
112361
  const cols = this.getAllColumns(container);
111437
112362
  let clickedElm;
111438
112363
  let clickedCol;
@@ -111545,10 +112470,11 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111545
112470
  Array.prototype.forEach.call(elms, elm => {
111546
112471
  elm.style.display = '';
111547
112472
  });
111548
- elms = this.rte.elementRteTool.querySelectorAll('.rte-blocksettings');
111549
- Array.prototype.forEach.call(elms, elm => {
111550
- elm.style.display = '';
111551
- });
112473
+ // elms = this.rte.elementRteTool.querySelectorAll('.rte-blocksettings');
112474
+ // Array.prototype.forEach.call(elms, (elm) => {
112475
+ // elm.style.display = '';
112476
+ // });
112477
+
111552
112478
  const viewportWidth = this.doc.body.clientWidth;
111553
112479
  if (viewportWidth <= 768) {
111554
112480
  elms = this.rte.elementRteTool.querySelectorAll('.rte-moveup');
@@ -111608,6 +112534,74 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111608
112534
  if (this.onUnselectBlock) this.onUnselectBlock();
111609
112535
  }
111610
112536
  });
112537
+
112538
+ // SHIFT + Right Clidk to Zoom In
112539
+ if (this.canvas && !this.isContentBox && this.docContainer && !this.iframe) {
112540
+ //--- see loadHtml ---
112541
+ const docContainer = document.querySelector(this.docContainer);
112542
+
112543
+ // set page size
112544
+ let s;
112545
+ const elm = docContainer.querySelector('[data-pagesize]');
112546
+ if (elm) {
112547
+ s = elm.getAttribute('data-pagesize');
112548
+ } else {
112549
+ if (localStorage.getItem('_pagesize') === '' || localStorage.getItem('_pagesize')) {
112550
+ s = localStorage.getItem('_pagesize');
112551
+ } else {
112552
+ s = this.pageSize || '';
112553
+ }
112554
+ }
112555
+ this.setPageSize(s);
112556
+ this.applyBehaviorCanvas();
112557
+ const builders = docContainer.querySelectorAll(this.container);
112558
+ builders.forEach(builder => {
112559
+ this.applyBehaviorOn(builder);
112560
+ });
112561
+ this.refresh();
112562
+ if (this.win.Block) {
112563
+ this.win.Block.render();
112564
+ }
112565
+ docContainer.style.opacity = '';
112566
+ //--- /see loadHtml ---
112567
+
112568
+ // docContainer.style.transform = '';
112569
+ // this.opts.zoom = 1;
112570
+ // this.eb.setZoom(1);
112571
+
112572
+ document.addEventListener('contextmenu', this.toggleEnlargePage = e => {
112573
+ if (e.shiftKey && e.button === 2) {
112574
+ e.preventDefault();
112575
+ if (docContainer.style.transform.includes('scale(1)')) {
112576
+ docContainer.style.transform = '';
112577
+ }
112578
+ if (docContainer.classList.contains('expand')) {
112579
+ // back (zoom-out)
112580
+ docContainer.classList.remove('expand');
112581
+ docContainer.style.transform = '';
112582
+ this.opts.zoom = 1;
112583
+ localStorage.setItem('_zoom', 1);
112584
+ this.eb.setZoom(1);
112585
+ this.setZoomOnControl(docContainer);
112586
+ } else {
112587
+ // expand (zoom-in)
112588
+ docContainer.classList.add('expand');
112589
+ const viewportWidth = document.body.clientWidth;
112590
+ const targetWidth = viewportWidth * 0.8;
112591
+ const box = docContainer.querySelector(this.blockContainer);
112592
+ if (box) {
112593
+ let scale = targetWidth / box.offsetWidth;
112594
+ if (scale > 1.4) scale = 1.4;
112595
+ docContainer.style.transform = `scale(${scale})`;
112596
+ this.opts.zoom = scale;
112597
+ localStorage.setItem('_zoom', scale);
112598
+ this.eb.setZoom(scale);
112599
+ this.setZoomOnControl(docContainer);
112600
+ }
112601
+ }
112602
+ }
112603
+ });
112604
+ }
111611
112605
  let previousWidth = this.win.innerWidth;
111612
112606
  let timer;
111613
112607
  const debounce = (func, delay) => {
@@ -111674,7 +112668,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111674
112668
 
111675
112669
  // console.log('resize');
111676
112670
  setTimeout(() => {
111677
- if (this.blockmodal) this.blockmodal.realtime(); // freeform
112671
+ // if(this.blockmodal) this.blockmodal.realtime(); // freeform
111678
112672
  if (this.onPageResizeDebounce) this.onPageResizeDebounce();
111679
112673
  }, 300); // give time for block transition
111680
112674
  }, 200);
@@ -111691,7 +112685,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111691
112685
  const debouncedResizeHandler = debounce(() => {
111692
112686
  // console.log('resize');
111693
112687
  setTimeout(() => {
111694
- if (this.blockmodal) this.blockmodal.realtime();
112688
+ // if(this.blockmodal) this.blockmodal.realtime();
111695
112689
  if (this.onPageResizeDebounce) this.onPageResizeDebounce();
111696
112690
  }, 300); // give time for block transition
111697
112691
  }, 200);
@@ -111988,6 +112982,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
111988
112982
  .is-block.active.editable {
111989
112983
  outline: none;
111990
112984
  cursor: auto;
112985
+ z-index: 10;
111991
112986
  }
111992
112987
  .is-block.active.multi {
111993
112988
  outline: var(--is-outline);
@@ -112397,9 +113392,27 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
112397
113392
  rowaddtool.style.transform = `scale(${1 / this.opts.zoom})`;
112398
113393
  // rowtool.style.transformOrigin = 'top';
112399
113394
  });
112400
- }
112401
113395
 
113396
+ // freeform
113397
+ let tools = area.querySelectorAll('.is-canvas-tool');
113398
+ tools.forEach(tool => {
113399
+ tool.style.transform = `scale(${1 / this.opts.zoom})`;
113400
+ tool.style.transformOrigin = 'top';
113401
+ });
113402
+ tools = area.querySelectorAll('.is-canvasadd-tool');
113403
+ tools.forEach(tool => {
113404
+ tool.style.transform = `scale(${1 / this.opts.zoom})`;
113405
+ tool.style.transformOrigin = 'top';
113406
+ });
113407
+ }
112402
113408
  setZoomOnArea() {
113409
+ if (this.canvas && !this.isContentBox && this.docContainer) {
113410
+ // freeform
113411
+ const docContainer = this.doc.querySelector(this.docContainer);
113412
+ docContainer.style.transform = `scale(${this.opts.zoom})`;
113413
+ if (this.eb) this.eb.setZoom(this.opts.zoom);
113414
+ return;
113415
+ }
112403
113416
  if (this.opts.page !== '') {
112404
113417
  const wrapper = this.doc.querySelector(this.opts.page);
112405
113418
  wrapper.style.transform = `scale(${this.opts.zoom})`;
@@ -112924,9 +113937,11 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
112924
113937
  lang: this.opts.lang
112925
113938
  });
112926
113939
  }
112927
- simpleColorPicker(onPick, mode) {
112928
- return this.colorClassPicker.open(onPick, mode);
112929
- }
113940
+
113941
+ // simpleColorPicker(onPick,mode) {
113942
+ // return this.colorClassPicker.open(onPick,mode);
113943
+ // }
113944
+
112930
113945
  openAIAssistant() {
112931
113946
  this.dictation.openDictation();
112932
113947
  }
@@ -113081,6 +114096,124 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
113081
114096
  if (!this.eb) return;
113082
114097
  this.eb.quitEditable(target);
113083
114098
  }
114099
+ addPage(box) {
114100
+ this.uo.saveForUndo();
114101
+ let s;
114102
+ if (localStorage.getItem('_pagesize') === '' || localStorage.getItem('_pagesize')) {
114103
+ s = localStorage.getItem('_pagesize');
114104
+ } else {
114105
+ s = this.pageSize || '';
114106
+ }
114107
+ const html = `
114108
+ <div class="is-box box-canvas autolayout new-canvas" data-pagesize="${s}">
114109
+ `;
114110
+ const docContainer = this.doc.querySelector(this.docContainer);
114111
+ if (box) {
114112
+ box.insertAdjacentHTML('afterend', html);
114113
+ } else {
114114
+ docContainer.insertAdjacentHTML('beforeend', html);
114115
+ }
114116
+ const newBox = docContainer.querySelector('.new-canvas');
114117
+ newBox.scrollIntoView({
114118
+ behavior: 'smooth',
114119
+ block: 'center'
114120
+ });
114121
+ newBox.classList.remove('new-canvas');
114122
+ this.applyBehaviorCanvas();
114123
+ this.opts.onChange();
114124
+ }
114125
+ setPageSize(s) {
114126
+ this.pageoption.setPageSize(s);
114127
+ }
114128
+ applyBehaviorCanvas() {
114129
+ if (this.canvas && !this.isContentBox && this.docContainer && !this.iframe) {
114130
+ let htmlTool = `
114131
+ <div class="is-tool is-canvas-tool" style="transform: scale(1); transform-origin: center top;">
114132
+ <button type="button" tabindex="-1" class="box-up" title="${this.util.out('Move Up')}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-up"></use></svg></button>
114133
+ <button type="button" tabindex="-1" class="box-down" title="${this.util.out('Move Down')}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-down"></use></svg></button>
114134
+ <!--
114135
+ <button type="button" tabindex="-1" class="box-settings" title="${this.util.out('Settings')}"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
114136
+ -->
114137
+ <button type="button" tabindex="-1" class="box-remove" title="${this.util.out('Remove')}"><svg class="is-icon-flex"><use xlink:href="#icon-trash"></use></svg></button>
114138
+ </div>
114139
+ <div class="is-tool is-canvasadd-tool" style="transform: scale(1); transform-origin: center top;">
114140
+ <button type="button" tabindex="-1" class="box-add" title="${this.util.out('Add')}"><svg class="is-icon-flex"><use xlink:href="#icon-plus2"></use></svg></button>
114141
+ </div>
114142
+ `;
114143
+ const docContainer = this.doc.querySelector(this.docContainer);
114144
+ const boxes = this.dom.elementChildren(docContainer);
114145
+ boxes.forEach(box => {
114146
+ let tool1 = box.querySelector('.is-canvas-tool');
114147
+ let tool2 = box.querySelector('.is-canvasadd-tool');
114148
+ if (tool1) tool1.remove();
114149
+ if (tool2) tool2.remove();
114150
+ if (!box.querySelector('.is-canvas-tool')) {
114151
+ box.addEventListener('click', () => {
114152
+ boxes.forEach(elm => elm.classList.remove('box-select'));
114153
+ box.classList.add('box-select');
114154
+
114155
+ // onSelectPage (see onSelectBlock)
114156
+
114157
+ let elms = this.rte.elementRteTool.querySelectorAll('.rte-blocksettings');
114158
+ Array.prototype.forEach.call(elms, elm => {
114159
+ elm.style.display = '';
114160
+ });
114161
+ });
114162
+ box.insertAdjacentHTML('afterbegin', htmlTool);
114163
+ const btnUp = box.querySelector('.is-canvas-tool .box-up');
114164
+ btnUp.addEventListener('click', e => {
114165
+ const box = e.target.closest('.is-box');
114166
+ this.uo.saveForUndo();
114167
+ let boxPrev = box.previousElementSibling;
114168
+ if (boxPrev) box.parentNode.insertBefore(box, boxPrev);
114169
+ box.scrollIntoView({
114170
+ behavior: 'smooth',
114171
+ block: 'center'
114172
+ });
114173
+ this.opts.onChange();
114174
+ });
114175
+ const btnDown = box.querySelector('.is-canvas-tool .box-down');
114176
+ btnDown.addEventListener('click', e => {
114177
+ const box = e.target.closest('.is-box');
114178
+ this.uo.saveForUndo();
114179
+ let boxNext = box.nextElementSibling;
114180
+ if (boxNext) box.parentNode.insertBefore(boxNext, box);
114181
+ box.scrollIntoView({
114182
+ behavior: 'smooth',
114183
+ block: 'center'
114184
+ });
114185
+ this.opts.onChange();
114186
+ });
114187
+ const btnRemove = box.querySelector('.is-canvas-tool .box-remove');
114188
+ btnRemove.addEventListener('click', e => {
114189
+ const box = e.target.closest('.is-box');
114190
+ this.uo.saveForUndo();
114191
+ box.remove();
114192
+ this.blockmodal.showHideControls();
114193
+ if (!docContainer.querySelector('.is-box')) this.addPage();
114194
+ this.opts.onChange();
114195
+ });
114196
+ const btnAdd = box.querySelector('.is-canvasadd-tool .box-add');
114197
+ btnAdd.addEventListener('click', e => {
114198
+ const box = e.target.closest('.is-box');
114199
+ this.addPage(box);
114200
+ });
114201
+ }
114202
+ });
114203
+ if (localStorage.getItem('_zoom') !== null) {
114204
+ this.opts.zoom = localStorage.getItem('_zoom'); // Get from saved localStorage
114205
+ }
114206
+
114207
+ this.eb.setZoom(this.opts.zoom);
114208
+ this.setZoomOnControl(docContainer);
114209
+ }
114210
+ }
114211
+ openPageOptions() {
114212
+ this.pageoption.open();
114213
+ }
114214
+ print() {
114215
+ this.pageoption.print();
114216
+ }
113084
114217
  destroy() {
113085
114218
  if (this.eb) this.eb.destroy();
113086
114219
  this.doc.body.classList.remove('data-editor');
@@ -113121,6 +114254,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
113121
114254
  builder.appendChild(range.createContextualFragment(html)); // Use createContextualFragment so that embedded javascript code (code block) will be executed
113122
114255
  });
113123
114256
 
114257
+ if (this.canvas && !this.isContentBox) {
114258
+ let html = this.html();
114259
+ let range = this.doc.createRange();
114260
+ const docContainer = this.doc.querySelector(this.docContainer);
114261
+ docContainer.innerHTML = '';
114262
+ docContainer.appendChild(range.createContextualFragment(html));
114263
+ }
113124
114264
  Array.prototype.forEach.call(builders, builder => {
113125
114265
  builder.removeAttribute('data-sort');
113126
114266
  this.dom.removeClass(builder, 'is-builder');
@@ -113238,13 +114378,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
113238
114378
  if (this.targetAssetType === 'all') {
113239
114379
  ok = true;
113240
114380
  } else if (this.targetAssetType === 'media') {
113241
- if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp' || extension === 'mp4') {
114381
+ if (s.includes('base64') || extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp' || extension === 'mp4') {
113242
114382
  ok = true;
113243
114383
  } else {
113244
114384
  alert(this.util.out('Please select an image or video file.'));
113245
114385
  }
113246
114386
  } else if (this.targetAssetType === 'image') {
113247
- if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
114387
+ if (s.includes('base64') || extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
113248
114388
  ok = true;
113249
114389
  } else {
113250
114390
  alert(this.util.out('Please select an image file.'));
@@ -113306,7 +114446,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
113306
114446
  let extension = filename.split('.').pop();
113307
114447
  extension = extension.toLowerCase();
113308
114448
  let ok = false;
113309
- if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
114449
+ if (s.includes('base64') || extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
113310
114450
  ok = true;
113311
114451
  } else {
113312
114452
  alert(out('Please select an image file.'));
@@ -113335,13 +114475,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
113335
114475
  let ext = filename.split('.').pop();
113336
114476
  ext = ext.toLowerCase();
113337
114477
  let ok = false;
113338
- if (targetAssetType === 'image' && (ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif' || ext === 'webm' || ext === 'webp')) {
114478
+ if (targetAssetType === 'image' && (s.includes('base64') || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif' || ext === 'webm' || ext === 'webp')) {
113339
114479
  ok = true;
113340
114480
  } else if (targetAssetType === 'video' && ext === 'mp4') {
113341
114481
  ok = true;
113342
114482
  } else if (targetAssetType === 'audio' && ext === 'mp3') {
113343
114483
  ok = true;
113344
- } else if (targetAssetType === 'media' && (ext === 'mp4' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif' || ext === 'webm' || ext === 'webp')) {
114484
+ } else if (targetAssetType === 'media' && (s.includes('base64') || ext === 'mp4' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif' || ext === 'webm' || ext === 'webp')) {
113345
114485
  ok = true;
113346
114486
  } else if (targetAssetType === 'all') {
113347
114487
  ok = true;
@@ -113379,7 +114519,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
113379
114519
  if (targetAssetType === 'all') {
113380
114520
  ok = true;
113381
114521
  } else if (targetAssetType === 'media') {
113382
- if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp' || extension === 'mp4') {
114522
+ if (s.includes('base64') || extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp' || extension === 'mp4') {
113383
114523
  ok = true;
113384
114524
  } else {
113385
114525
  alert(out('Please select an image or video file.'));
@@ -113391,7 +114531,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
113391
114531
  alert(out('Please select an mp4 file.'));
113392
114532
  }
113393
114533
  } else if (targetAssetType === 'image') {
113394
- if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
114534
+ if (s.includes('base64') || extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
113395
114535
  ok = true;
113396
114536
  } else {
113397
114537
  alert(out('Please select an image file.'));
@@ -114115,6 +115255,20 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
114115
115255
  docContainer.innerHTML = '';
114116
115256
  docContainer.appendChild(range.createContextualFragment(html)); // We use createContextualFragment so that embedded javascript code (code block) will be executed
114117
115257
 
115258
+ // set page size
115259
+ let s;
115260
+ const elm = docContainer.querySelector('[data-pagesize]');
115261
+ if (elm) {
115262
+ s = elm.getAttribute('data-pagesize');
115263
+ } else {
115264
+ if (localStorage.getItem('_pagesize') === '' || localStorage.getItem('_pagesize')) {
115265
+ s = localStorage.getItem('_pagesize');
115266
+ } else {
115267
+ s = this.pageSize || '';
115268
+ }
115269
+ }
115270
+ this.setPageSize(s);
115271
+ this.applyBehaviorCanvas();
114118
115272
  const builders = docContainer.querySelectorAll(this.container);
114119
115273
  builders.forEach(builder => {
114120
115274
  this.applyBehaviorOn(builder);
@@ -114324,7 +115478,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
114324
115478
  url = elm.getAttribute('data-modal-url');
114325
115479
  let extension = url.split('.').pop().split('?')[0].split('#')[0]; //
114326
115480
 
114327
- if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
115481
+ if (url.includes('base64') || extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
114328
115482
  this.lightbox.openImage(url, theme, color);
114329
115483
  } else if (extension === 'mp4') {
114330
115484
  this.lightbox.openVideo(url, 'dark', color);
@@ -114654,7 +115808,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
114654
115808
  let theme = link.getAttribute('data-modal-theme');
114655
115809
  if (!theme) theme = 'light';
114656
115810
  const color = elm.getAttribute('data-modal-color');
114657
- if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
115811
+ if (url.includes('base64') || extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
114658
115812
  this.lightbox.openImage(url, theme, color);
114659
115813
  e.preventDefault();
114660
115814
  return false;
@@ -114765,6 +115919,10 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
114765
115919
  if (this.activeImage) {
114766
115920
  this.util.hideControls(); //deleting an image should also clear the visible image tool (and resizer).
114767
115921
  }
115922
+
115923
+ col.querySelectorAll('.is-social').forEach(elm => {
115924
+ elm.removeAttribute('contentEditable'); // Return back the div.is-social (See: Prevent div.is-social gets deleted)
115925
+ });
114768
115926
  }
114769
115927
 
114770
115928
  this.oriLen = col.textContent.length; // get character length
@@ -115088,6 +116246,12 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
115088
116246
  }
115089
116247
  }
115090
116248
  handleCellKeyup(col, e) {
116249
+ if (e.which === 46 || e.which === 8) {
116250
+ col.querySelectorAll('.is-social').forEach(elm => {
116251
+ elm.contentEditable = false; // Prevent div.is-social gets deleted while deleting its next element
116252
+ });
116253
+ }
116254
+
115091
116255
  if (this.dom.textSelection()) {
115092
116256
  if (e.keyCode === '38') {
115093
116257
  // Up arrow
@@ -115643,6 +116807,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
115643
116807
  });
115644
116808
  var html = result[0].html;
115645
116809
  var noedit = result[0].noedit;
116810
+ const occurrences = this.dom.countOccurrences(html, 'column');
115646
116811
  var bSnippet;
115647
116812
  if (html.indexOf('"row') === -1) {
115648
116813
  bSnippet = true; // Just snippet (without row/column grid)
@@ -115696,8 +116861,20 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
115696
116861
  // Clean snippet from sortable related code
115697
116862
  itemEl.removeAttribute('draggable');
115698
116863
  this.dom.removeClass(itemEl, 'snippet-item');
116864
+ let bw = '';
116865
+ if (this.page && this.page === '.is-wrapper') {
116866
+ bw = '800px';
116867
+ } else {
116868
+ if (occurrences === 2) {
116869
+ bw = '800px';
116870
+ } else if (occurrences >= 3) {
116871
+ bw = '800px';
116872
+ } else {
116873
+ bw = '540px';
116874
+ }
116875
+ }
115699
116876
  const blockTemplate = `
115700
- <div class="is-block block-steady height-auto" data-new-dummy="1" style="top: 20%; left: 20%; width: 800px;">
116877
+ <div class="is-block block-steady height-auto" data-new-dummy="1" style="top: 20%; left: 20%; width: ${bw};">
115701
116878
  <div class="is-container container-new leading-12 size-17">
115702
116879
  [%CONTENT%]
115703
116880
  </div>
@@ -115734,8 +116911,20 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
115734
116911
  var range = document.createRange();
115735
116912
  range.setStart(itemEl, 0);
115736
116913
  itemEl.appendChild(range.createContextualFragment(html));
116914
+ let bw = '';
116915
+ if (this.page && this.page === '.is-wrapper') {
116916
+ bw = '800px';
116917
+ } else {
116918
+ if (occurrences === 2) {
116919
+ bw = '800px';
116920
+ } else if (occurrences >= 3) {
116921
+ bw = '800px';
116922
+ } else {
116923
+ bw = '540px';
116924
+ }
116925
+ }
115737
116926
  const blockTemplate = `
115738
- <div class="is-block block-steady height-auto" data-new-dummy="1" style="top: 20%; left: 20%; width: 800px;">
116927
+ <div class="is-block block-steady height-auto" data-new-dummy="1" style="top: 20%; left: 20%; width: ${bw};">
115739
116928
  <div class="is-container container-new leading-12 size-17">
115740
116929
  [%CONTENT%]
115741
116930
  </div>
@@ -147276,7 +148465,8 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
147276
148465
  }
147277
148466
  .is-block.active.editable {
147278
148467
  outline: none;
147279
- cursor: auto;
148468
+ cursor: auto;
148469
+ z-index: 10;
147280
148470
  }
147281
148471
  .is-block.active.multi {
147282
148472
  outline: var(--is-outline);
@@ -147516,7 +148706,12 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
147516
148706
  transition: none !important;
147517
148707
  z-index:1;
147518
148708
  }
147519
- </style>`);
148709
+
148710
+
148711
+ i.bi, i.icon { display: inline-flex; }
148712
+
148713
+ </style>`); // i.bi, i.icon { display: inline-flex; } => this makes icons more cursor friendly
148714
+
147520
148715
  dom.appendHtml(document.head, `<style id="_contentboxstuff_css">
147521
148716
 
147522
148717
  #_cbhtml .is-modal.editbox.is-modal-content {