@innovastudio/contentbuilder 1.4.118 → 1.4.119

Sign up to get free protection for your applications and to get access to all the features.
@@ -106,8 +106,8 @@ class Util {
106
106
  callback(true);
107
107
  });
108
108
  }
109
- confirm(message, callback, yesno, yestext) {
110
- if (!this.builder.deleteConfirm) {
109
+ confirm(message, callback, yesno, yestext, forceOpen) {
110
+ if (!this.builder.deleteConfirm && !forceOpen) {
111
111
  callback(true);
112
112
  return;
113
113
  }
@@ -468,6 +468,9 @@ class Util {
468
468
  modal.style.display = '';
469
469
  }
470
470
  refreshModuleLayout(col) {
471
+ let savedHeight;
472
+ if (col.style.height) savedHeight = col.style.height;else col.style.height = `${col.offsetHeight}px`;
473
+ col.style.opacity = 0;
471
474
  let html = decodeURIComponent(col.getAttribute('data-html'));
472
475
  html = html.replace(/{id}/g, this.builder.util.makeId());
473
476
  col.innerHTML = '';
@@ -483,6 +486,14 @@ class Util {
483
486
  }
484
487
  i++;
485
488
  });
489
+ setTimeout(() => {
490
+ if (savedHeight) {
491
+ col.style.height = savedHeight;
492
+ } else {
493
+ col.style.height = '';
494
+ }
495
+ col.style.opacity = '';
496
+ }, 100);
486
497
  }
487
498
  removeColClasses(cell) {
488
499
  cell.classList.remove('full');
@@ -1189,8 +1200,12 @@ class Util {
1189
1200
  pop.style.transition = '';
1190
1201
  }, 200);
1191
1202
  });
1192
- this.builder.moveable.updateRect();
1193
- document.querySelector('.moveable-control-box').style.display = 'none';
1203
+ const movControlBox = document.querySelector('.moveable-control-box');
1204
+ const imageResizer = document.querySelector('#divImageResizer');
1205
+ if (movControlBox && !imageResizer.getAttribute('data-resizing')) {
1206
+ // this.builder.moveable.updateRect();
1207
+ movControlBox.style.display = 'none';
1208
+ }
1194
1209
  }
1195
1210
  hideControls() {
1196
1211
  const dom = this.dom;
@@ -1225,15 +1240,14 @@ class Util {
1225
1240
  Array.prototype.forEach.call(elms, elm => {
1226
1241
  dom.removeClass(elm, 'elm-active');
1227
1242
  });
1228
- let elmTool = builderStuff.querySelector('.is-element-tool');
1243
+ let elmTool = this.builder.doc.querySelector('.is-element-tool');
1229
1244
  elmTool.style.display = '';
1230
- let linkTool = builderStuff.querySelector('#divLinkTool');
1245
+ let linkTool = this.builder.doc.querySelector('#divLinkTool');
1231
1246
  linkTool.style.display = '';
1247
+ this.builder.activeIcon = null;
1248
+ this.builder.inspectedElement = null;
1249
+ this.builder.activeElement = null;
1232
1250
  if (all) {
1233
- this.builder.activeIcon = null;
1234
- this.builder.inspectedElement = null;
1235
- this.builder.activeElement = null;
1236
-
1237
1251
  // RTE
1238
1252
  let rtetool = builderStuff.querySelector('.is-rte-tool');
1239
1253
  if (rtetool) rtetool.style.display = 'none';
@@ -1554,6 +1568,7 @@ class Util {
1554
1568
  rows.forEach(row => {
1555
1569
  if (dom.hasClass(row, 'row-add-initial')) return;
1556
1570
  if (dom.hasClass(row, 'dummy-space')) return;
1571
+ if (row.tagName.toLowerCase() === 'link') return;
1557
1572
  empty = false;
1558
1573
  });
1559
1574
  if (empty) {
@@ -10400,7 +10415,8 @@ class HtmlUtil {
10400
10415
  language: 'html',
10401
10416
  theme: this.builder.styleDark || this.builder.styleColoredDark ? 'vs-dark' : ''
10402
10417
  });
10403
- this.builder.codeEditorExternal.onKeyUp(() => {
10418
+ this.builder.codeEditorExternal.onDidChangeModelContent(() => {
10419
+ // this.builder.codeEditorExternal.onKeyUp(()=>{
10404
10420
  const source = document.querySelector('textarea[data-source-active]');
10405
10421
  source.value = this.builder.codeEditorExternal.getModel().getValue();
10406
10422
  });
@@ -10425,6 +10441,18 @@ class HtmlUtil {
10425
10441
  } else {
10426
10442
  viewhtml = builderStuff.querySelector('.viewhtml');
10427
10443
  }
10444
+ let modelContent = viewhtml.querySelector('.is-modal-content');
10445
+ let codeEditor = viewhtml.querySelector('.input-code-editor');
10446
+ codeEditor.style.opacity = 0.01;
10447
+ if (mode === 'full') {
10448
+ modelContent.style.width = this.builder.codeEditorWidth;
10449
+ modelContent.style.maxWidth = this.builder.codeEditorMaxWidth;
10450
+ codeEditor.style.height = this.builder.codeEditorHeight;
10451
+ } else {
10452
+ modelContent.style.width = this.builder.blockCodeEditorWidth;
10453
+ modelContent.style.maxWidth = this.builder.blockCodeEditorMaxWidth;
10454
+ codeEditor.style.height = this.builder.blockCodeEditorHeight;
10455
+ }
10428
10456
  util.showModal(viewhtml, true, () => {
10429
10457
  if (btn) {
10430
10458
  btn.removeAttribute('data-focus');
@@ -10432,8 +10460,6 @@ class HtmlUtil {
10432
10460
  }
10433
10461
  });
10434
10462
  if (btn) btn.setAttribute('data-focus', true);
10435
- let codeEditor = viewhtml.querySelector('.input-code-editor');
10436
- codeEditor.style.opacity = 0.01;
10437
10463
  this._view(mode, area);
10438
10464
  }
10439
10465
  _view(mode, area) {
@@ -10468,7 +10494,8 @@ class HtmlUtil {
10468
10494
  theme: this.builder.styleDark || this.builder.styleColoredDark ? 'vs-dark' : ''
10469
10495
  });
10470
10496
  let textarea = viewhtml.querySelector('textarea');
10471
- this.builder.codeEditor.onKeyUp(() => {
10497
+ this.builder.codeEditor.onDidChangeModelContent(() => {
10498
+ // this.builder.codeEditor.onKeyUp(()=>{
10472
10499
  textarea.value = this.builder.codeEditor.getModel().getValue();
10473
10500
  });
10474
10501
  });
@@ -10566,16 +10593,6 @@ class HtmlUtil {
10566
10593
  this.builder.codeEditorArea = area;
10567
10594
  let codeEditor = viewhtml.querySelector('.input-code-editor');
10568
10595
  codeEditor.style.opacity = '';
10569
- let modelContent = viewhtml.querySelector('.is-modal-content');
10570
- if (mode === 'full') {
10571
- modelContent.style.width = this.builder.codeEditorWidth;
10572
- modelContent.style.maxWidth = this.builder.codeEditorMaxWidth;
10573
- codeEditor.style.height = this.builder.codeEditorHeight;
10574
- } else {
10575
- modelContent.style.width = this.builder.blockCodeEditorWidth;
10576
- modelContent.style.maxWidth = this.builder.blockCodeEditorMaxWidth;
10577
- codeEditor.style.height = this.builder.blockCodeEditorHeight;
10578
- }
10579
10596
  }
10580
10597
  fromViewToActual(html) {
10581
10598
  for (var key in hash$1) {
@@ -11074,6 +11091,8 @@ class HtmlUtil {
11074
11091
  if (!disableStaticSection) {
11075
11092
  html = html_content + html_footer + html_others;
11076
11093
  }
11094
+ html = tmp.innerHTML.trim();
11095
+ html = html.replace(/<font/g, '<span').replace(/<\/font/g, '</span');
11077
11096
  } else {
11078
11097
  let emptystyles = tmp.querySelectorAll('[style=""]');
11079
11098
  Array.prototype.forEach.call(emptystyles, emptystyle => {
@@ -11771,6 +11790,29 @@ const prepareSvgIcons = builder => {
11771
11790
  <path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z"></path>
11772
11791
  </symbol>
11773
11792
 
11793
+ <symbol id="icon-undo" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
11794
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
11795
+ <path d="M9 14l-4 -4l4 -4"></path>
11796
+ <path d="M5 10h11a4 4 0 1 1 0 8h-1"></path>
11797
+ </symbol>
11798
+ <symbol id="icon-redo" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
11799
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
11800
+ <path d="M15 14l4 -4l-4 -4"></path>
11801
+ <path d="M19 10h-11a4 4 0 1 0 0 8h1"></path>
11802
+ </symbol>
11803
+ <symbol id="icon-save" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
11804
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
11805
+ <path d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"></path>
11806
+ <path d="M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
11807
+ <path d="M14 4l0 4l-6 0l0 -4"></path>
11808
+ </symbol>
11809
+ <symbol id="icon-back" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
11810
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
11811
+ <path d="M9 14l-4 -4l4 -4"></path>
11812
+ <path d="M5 10h11a4 4 0 1 1 0 8h-1"></path>
11813
+ </symbol>
11814
+
11815
+
11774
11816
  </defs>
11775
11817
  </svg>`;
11776
11818
  builder.dom.appendHtml(builder.builderStuff, html);
@@ -12243,6 +12285,21 @@ class Snippets {
12243
12285
  width: 100% !important;
12244
12286
  }
12245
12287
  }
12288
+
12289
+
12290
+ * {
12291
+ scrollbar-width: thin;
12292
+ scrollbar-color: rgba(0, 0, 0, 0.2) auto;
12293
+ }
12294
+ *::-webkit-scrollbar {
12295
+ width: 12px;
12296
+ }
12297
+ *::-webkit-scrollbar-track {
12298
+ background: rgba(200, 200, 200, 0.2);
12299
+ }
12300
+ *::-webkit-scrollbar-thumb {
12301
+ background-color:rgba(0, 0, 0, 0.2);
12302
+ }
12246
12303
  </style>
12247
12304
  </head>
12248
12305
 
@@ -12997,31 +13054,13 @@ const renderQuickAdd = builder => {
12997
13054
  </div>
12998
13055
 
12999
13056
  <div class="is-modal snippets" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
13000
- <div class="is-modal-content" style="max-width:1250px;height:90%;padding:0;">
13057
+ <div class="is-modal-content" style="max-width:1500px;width:80vw;height:80vh;padding:0;">
13001
13058
  <iframe tabindex="0" style="width:100%;height:100%;border: none;display: block;" src="about:blank"></iframe>
13002
13059
  </div>
13003
13060
  </div>
13004
13061
  `;
13005
13062
  dom.appendHtml(builderStuff, html);
13006
13063
  quickadd = builderStuff.querySelector('.quickadd');
13007
- document.addEventListener('click', e => {
13008
- e = e || window.event;
13009
- var target = e.target || e.srcElement;
13010
- if (quickadd.style.display === 'flex') {
13011
- let a = dom.parentsHasClass(target, 'quickadd');
13012
- let b = dom.parentsHasClass(target, 'row-add');
13013
- let c = dom.parentsHasClass(target, 'is-rowadd-tool');
13014
- let d = dom.parentsHasClass(target, 'cell-add');
13015
- let f = dom.parentsHasClass(target, 'elm-add');
13016
- let g = dom.parentsHasClass(target, 'row-add-initial');
13017
- if (a || b || c || d || f || g) {
13018
- return;
13019
- } else {
13020
- // quickadd.style.display = '';
13021
- util.hidePop(quickadd);
13022
- }
13023
- }
13024
- });
13025
13064
  let tabs = quickadd.querySelectorAll('.is-pop-tab-item');
13026
13065
  Array.prototype.forEach.call(tabs, tab => {
13027
13066
  dom.addEventListener(tab, 'click', e => {
@@ -14520,30 +14559,9 @@ const renderGridEditor = builder => {
14520
14559
  selector: '.is-draggable'
14521
14560
  });
14522
14561
  const grideditor = document.querySelector('.grideditor');
14523
- document.addEventListener('click', e => {
14524
- e = e || window.event;
14525
- var target = e.target || e.srcElement;
14526
- if (dom.hasClass(grideditor, 'active')) {
14527
- let a = dom.parentsHasClass(target, 'is-builder');
14528
- let b = dom.parentsHasClass(target, 'grideditor');
14529
- let c = dom.parentsHasClass(target, 'is-modal');
14530
- let d = dom.parentsHasClass(target, 'is-pop');
14531
- let f = dom.parentsHasClass(target, 'rte-grideditor') || dom.hasClass(target, 'rte-grideditor');
14532
- if (a || b || c || d || f) {
14533
- grideditor.style.display = '';
14534
- return;
14535
- } else {
14536
- grideditor.style.display = 'none';
14537
- }
14538
- }
14539
- }, false);
14540
14562
  let elm = grideditor.querySelector('.is-modal-close');
14541
14563
  dom.addEventListener(elm, 'click', () => {
14542
- dom.removeClass(grideditor, 'active');
14543
- const builders = builder.doc.querySelectorAll(builder.opts.container);
14544
- Array.prototype.forEach.call(builders, builder => {
14545
- builder.removeAttribute('grideditor');
14546
- });
14564
+ builder._rowTool.hideGridEditor();
14547
14565
  });
14548
14566
  const btnGridOutline = grideditor.querySelector('.grid-outline');
14549
14567
  dom.addEventListener(btnGridOutline, 'click', () => {
@@ -14586,6 +14604,35 @@ const renderGridEditor = builder => {
14586
14604
  } else {
14587
14605
  quickadd.setAttribute('data-mode', 'cell-right');
14588
14606
  }
14607
+
14608
+ //handleQuickAddClickOut
14609
+ const handleQuickAddClickOut = e => {
14610
+ // console.log('handleQuickAddClickOut');
14611
+ let elm = e.target;
14612
+ if (!elm) return;
14613
+ if (!elm.closest('.quickadd') && !elm.closest('.row-add') && !elm.closest('.is-rowadd-tool') && !elm.closest('.cell-add') && !elm.closest('.elm-add') && !elm.closest('.row-add-initial')) {
14614
+ // click outside
14615
+
14616
+ // hide
14617
+ const quickadd = builderStuff.querySelector('.quickadd');
14618
+ util.hidePop(quickadd);
14619
+ // console.log('HIDE');
14620
+
14621
+ // clear events
14622
+ document.removeEventListener('click', handleQuickAddClickOut);
14623
+ if (builder.iframeDocument) {
14624
+ builder.doc.removeEventListener('click', handleQuickAddClickOut);
14625
+ }
14626
+ builder.handleQuickAddClickOut_ = false;
14627
+ }
14628
+ };
14629
+ if (!builder.handleQuickAddClickOut_) {
14630
+ document.addEventListener('click', handleQuickAddClickOut);
14631
+ if (builder.iframeDocument) {
14632
+ builder.doc.addEventListener('click', handleQuickAddClickOut);
14633
+ }
14634
+ builder.handleQuickAddClickOut_ = true;
14635
+ }
14589
14636
  });
14590
14637
  elm = grideditor.querySelector('.cell-prev');
14591
14638
  dom.addEventListener(elm, 'click', () => {
@@ -14649,9 +14696,9 @@ const renderGridEditor = builder => {
14649
14696
 
14650
14697
  util.restoreSelection();
14651
14698
 
14652
- // if(this.builder.activeElement) {
14653
- // dom.addClass(this.builder.activeElement, 'elm-active');
14654
- // this.builder.elmTool.repositionElementTool();
14699
+ // if(builder.activeElement) {
14700
+ // dom.addClass(builder.activeElement, 'elm-active');
14701
+ // builder.elmTool.repositionElementTool();
14655
14702
  // }
14656
14703
 
14657
14704
  btnCellSettings.removeAttribute('data-focus');
@@ -17835,7 +17882,7 @@ class Select {
17835
17882
  }
17836
17883
  }
17837
17884
 
17838
- const renderSnippetPanel = builder => {
17885
+ const renderSnippetPanel = (builder, snippetOpen) => {
17839
17886
  const util = builder.util;
17840
17887
  const builderStuff = builder.builderStuff;
17841
17888
  const dom = builder.dom;
@@ -18099,7 +18146,7 @@ const renderSnippetPanel = builder => {
18099
18146
  util.clearControls();
18100
18147
  });
18101
18148
  const viewportWidth = window.innerWidth;
18102
- if (builder.opts.snippetOpen && viewportWidth >= 960) {
18149
+ if ((builder.opts.snippetOpen || snippetOpen) && viewportWidth >= 960) {
18103
18150
  snippetPanel.style.cssText = 'transition: all ease 0.8s;';
18104
18151
  setTimeout(function () {
18105
18152
  toggleSnippets(builder);
@@ -45411,7 +45458,7 @@ class Image$1 {
45411
45458
  ${this.builder.opts.selectIcon}
45412
45459
  </button>
45413
45460
 
45414
- <div class="image-larger1" style="position:relative;flex:none;box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);">
45461
+ <div class="image-larger1 is-btn classic" style="position:relative;flex:none;box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);">
45415
45462
  <form class="form-upload-larger" target="frameTargetImageUpload" method="post" action="${this.builder.opts.largerImageHandler}" enctype="multipart/form-data" style="border-radius:1px;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;">
45416
45463
  <input id="hidRefId1" name="hidRefId" type="hidden" value="" />
45417
45464
  <svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
@@ -45434,7 +45481,7 @@ class Image$1 {
45434
45481
 
45435
45482
  <button title="${util.out(this.builder.opts.otherSelectCaption)}" class="input-select-other" style="display:none;width:50px">${this.builder.opts.otherSelectIcon}</button>
45436
45483
 
45437
- <div class="image-larger2" style="position:relative;flex:none;box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);">
45484
+ <div class="image-larger2 is-btn classic" style="position:relative;flex:none;box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);">
45438
45485
  <form class="form-upload-larger" target="frameTargetImageUpload" method="post" action="${this.builder.opts.fileHandler ? this.builder.opts.fileHandler : this.builder.opts.largerImageHandler}" enctype="multipart/form-data" style="border-radius:1px;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;">
45439
45486
  <input id="hidRefId2" name="hidRefId" type="hidden" value="" />
45440
45487
  <svg class="is-icon-flex"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
@@ -45471,7 +45518,7 @@ class Image$1 {
45471
45518
 
45472
45519
  <div id="divImageResizerOverlay" class="is-tool">
45473
45520
  </div>
45474
- <div id="divImageResizer" data-x=0 data-y=0 class="is-tool moveable resizable">
45521
+ <div id="divImageResizer" class="keep-selection" style="position:absolute;">
45475
45522
  </div>
45476
45523
  `;
45477
45524
  dom.appendHtml(builderStuff, html);
@@ -45529,24 +45576,26 @@ class Image$1 {
45529
45576
  activeImage = activeImage.parentNode;
45530
45577
  bCircular = true;
45531
45578
  }
45579
+ let zoom = this.builder.opts.zoom;
45580
+ let win = this.builder.win;
45532
45581
  if (!bCircular) {
45533
- activeImage.style.width = `${width / this.builder.opts.zoom}px`;
45582
+ activeImage.style.width = `${width / zoom}px`;
45534
45583
  activeImage.style.height = 'auto';
45535
45584
  } else {
45536
- let pl = parseFloat(window.getComputedStyle(activeImage.parentNode).getPropertyValue('padding-left'));
45537
- let pr = parseFloat(window.getComputedStyle(activeImage.parentNode).getPropertyValue('padding-right'));
45538
- let maxWidth = activeImage.parentNode.offsetWidth * this.builder.opts.zoom - pl - pr;
45585
+ let pl = parseFloat(win.getComputedStyle(activeImage.parentNode).getPropertyValue('padding-left'));
45586
+ let pr = parseFloat(win.getComputedStyle(activeImage.parentNode).getPropertyValue('padding-right'));
45587
+ let maxWidth = activeImage.parentNode.offsetWidth * zoom - pl - pr;
45539
45588
  if (width >= maxWidth) width = maxWidth;
45540
45589
  if (height >= width) {
45541
- activeImage.style.width = `${width / this.builder.opts.zoom}px`;
45542
- activeImage.style.height = `${width / this.builder.opts.zoom}px`;
45543
- activeImage.querySelector('img').style.width = `${width / this.builder.opts.zoom}px`;
45544
- activeImage.querySelector('img').style.height = `${width / this.builder.opts.zoom}px`;
45590
+ activeImage.style.width = `${width / zoom}px`;
45591
+ activeImage.style.height = `${width / zoom}px`;
45592
+ activeImage.querySelector('img').style.width = `${width / zoom}px`;
45593
+ activeImage.querySelector('img').style.height = `${width / zoom}px`;
45545
45594
  } else {
45546
- activeImage.style.width = `${width / this.builder.opts.zoom}px`;
45547
- activeImage.style.height = `${height / this.builder.opts.zoom}px`;
45548
- activeImage.querySelector('img').style.width = `${width / this.builder.opts.zoom}px`;
45549
- activeImage.querySelector('img').style.height = `${height / this.builder.opts.zoom}px`;
45595
+ activeImage.style.width = `${width / zoom}px`;
45596
+ activeImage.style.height = `${height / zoom}px`;
45597
+ activeImage.querySelector('img').style.width = `${width / zoom}px`;
45598
+ activeImage.querySelector('img').style.height = `${height / zoom}px`;
45550
45599
  }
45551
45600
  }
45552
45601
 
@@ -45564,8 +45613,8 @@ class Image$1 {
45564
45613
  }
45565
45614
  */
45566
45615
  newPos = this.builder.util.getElementPosition(activeImage);
45567
- let top = newPos.top;
45568
- let left = newPos.left;
45616
+ let top = newPos.top + window.pageYOffset;
45617
+ let left = newPos.left + window.pageXOffset;
45569
45618
  target.style.top = top + 'px';
45570
45619
  target.style.left = left + 'px';
45571
45620
  target.style.width = activeImage.offsetWidth + 'px';
@@ -45579,9 +45628,11 @@ class Image$1 {
45579
45628
  } else {
45580
45629
  window.getSelection().removeAllRanges();
45581
45630
  }
45631
+ imageResizer.setAttribute('data-resizing', '1'); // important: see util.hidePops()
45582
45632
  }).on('resizeEnd', ({
45583
45633
  target
45584
45634
  }) => {
45635
+ imageResizer.removeAttribute('data-resizing');
45585
45636
  imageResizerOverlay.style.display = '';
45586
45637
  let activeImage = this.builder.activeImage;
45587
45638
  let bCircular = false;
@@ -45608,6 +45659,7 @@ class Image$1 {
45608
45659
  var elementWidth = activeImage.parentNode.offsetWidth - paddingX - borderX;
45609
45660
  //var elementHeight = activeImage.parentNode.offsetHeight - paddingY - borderY;
45610
45661
 
45662
+ let win = this.builder.win;
45611
45663
  let currentWidth;
45612
45664
  if (!bCircular) {
45613
45665
  const parentWidth = elementWidth; //activeImage.parentNode.offsetWidth;
@@ -45615,7 +45667,7 @@ class Image$1 {
45615
45667
  const percentage = currentWidth / parentWidth * 100;
45616
45668
  activeImage.style.width = percentage + '%';
45617
45669
  } else {
45618
- const _screenwidth = window.innerWidth;
45670
+ const _screenwidth = win.innerWidth;
45619
45671
  currentWidth = activeImage.offsetWidth;
45620
45672
  const percentage = currentWidth / _screenwidth * 100;
45621
45673
  activeImage.style.width = percentage + 'vw';
@@ -45931,22 +45983,32 @@ class Image$1 {
45931
45983
  this.builder.openImageSelect(src => {
45932
45984
  this.builder.uo.saveForUndo();
45933
45985
  let img = this.builder.activeImage;
45986
+ // img.setAttribute('src', src);
45987
+ img.addEventListener('load', () => {
45988
+ // this.builder.editor.element.image.repositionImageTool();
45989
+ if (this.builder.activeModule) {
45990
+ this.refreshIfIsModule(this.builder.activeModule);
45991
+ this.builder.activeModule.click();
45992
+ } else {
45993
+ this.repositionImageTool();
45994
+ this.builder.elmTool.repositionElementTool();
45995
+ }
45996
+ });
45934
45997
  img.setAttribute('src', src);
45935
- setTimeout(() => {
45936
- img.click();
45937
- let divImageResizer = document.querySelector('#divImageResizer');
45938
- if (divImageResizer) divImageResizer.click();
45939
- setTimeout(() => {
45940
- img.click();
45941
- let divImageResizer = document.querySelector('#divImageResizer');
45942
- if (divImageResizer) divImageResizer.click();
45943
- }, 600);
45944
- }, 10);
45945
45998
 
45946
- //Trigger Change event
45947
- this.builder.opts.onChange();
45999
+ // setTimeout(()=>{
46000
+ // img.click();
46001
+ // let divImageResizer = document.querySelector('#divImageResizer');
46002
+ // if(divImageResizer) divImageResizer.click();
45948
46003
 
45949
- //Trigger Render event
46004
+ // setTimeout(()=>{
46005
+ // img.click();
46006
+ // let divImageResizer = document.querySelector('#divImageResizer');
46007
+ // if(divImageResizer) divImageResizer.click();
46008
+ // },600);
46009
+ // },10);
46010
+
46011
+ this.builder.opts.onChange();
45950
46012
  this.builder.opts.onRender();
45951
46013
  }, currentSrc);
45952
46014
  });
@@ -46534,18 +46596,36 @@ class Image$1 {
46534
46596
  }
46535
46597
  imageTool.style.top = top + 'px';
46536
46598
  imageTool.style.left = toolLeft + 'px';
46537
- let imageResizer = this.imageResizer;
46538
- imageResizer.style.top = top + 'px';
46539
- imageResizer.style.left = left + 'px';
46540
- imageResizer.style.width = elm.offsetWidth * this.builder.opts.zoom + 'px';
46541
- imageResizer.style.height = elm.offsetHeight * this.builder.opts.zoom + 'px';
46542
- if (!this.builder.hideImageResizer) imageResizer.style.display = 'block';
46543
- this.repositionHandler(elm.offsetWidth, elm.offsetHeight);
46599
+ if (!this.builder.activeImage.hasAttribute('data-noresize')) {
46600
+ let imageResizer = this.imageResizer;
46601
+ imageResizer.style.top = top + 'px';
46602
+ imageResizer.style.left = left + 'px';
46603
+ imageResizer.style.width = elm.offsetWidth * this.builder.opts.zoom + 'px';
46604
+ imageResizer.style.height = elm.offsetHeight * this.builder.opts.zoom + 'px';
46605
+ if (!this.builder.hideImageResizer) imageResizer.style.display = 'block';
46606
+ this.repositionHandler(elm.offsetWidth, elm.offsetHeight);
46544
46607
 
46545
- // moveable
46546
- if (this.builder.moveable) this.builder.moveable.updateRect();
46547
- const movControlBox = document.querySelector('.moveable-control-box');
46548
- if (movControlBox && !this.builder.hideImageResizer) movControlBox.style.display = 'block';
46608
+ // moveable
46609
+ if (this.builder.moveable) this.builder.moveable.updateRect();
46610
+ const movControlBox = document.querySelector('.moveable-control-box');
46611
+ if (movControlBox && !this.builder.hideImageResizer) movControlBox.style.display = 'block';
46612
+ }
46613
+ }
46614
+ }
46615
+ hideImageTool() {
46616
+ let imageTool = this.imageTool;
46617
+ imageTool.style.display = '';
46618
+ let imageResizer = this.imageResizer;
46619
+ imageResizer.style.display = 'none';
46620
+
46621
+ // moveable
46622
+ imageResizer.style.top = '-10px';
46623
+ imageResizer.style.left = '-10px';
46624
+ imageResizer.style.width = '1px';
46625
+ imageResizer.style.height = '1px';
46626
+ if (this.builder.moveable) {
46627
+ this.builder.moveable.updateRect();
46628
+ document.querySelector('.moveable-control-box').style.display = 'none';
46549
46629
  }
46550
46630
  }
46551
46631
  click(e) {
@@ -46642,108 +46722,31 @@ class Image$1 {
46642
46722
  if (this.builder.moveable) this.builder.moveable.updateRect();
46643
46723
  const movControlBox = document.querySelector('.moveable-control-box');
46644
46724
  if (movControlBox && !this.builder.hideImageResizer) movControlBox.style.display = 'block';
46645
-
46646
- /*
46647
- if(elm.getAttribute('data-mov')!=='1'){
46648
- let obj = new Moveable(document.body, {
46649
- target: elm,
46650
- resizable: true,
46651
- throttleResize: 0,
46652
- keepRatio: true,
46653
- }).on('resizeStart', () => {
46654
- const builderStuff = this.builder.builderStuff;
46655
- // hide image tool
46656
- this.imageTool.style.display = '';
46657
- // hide element tool
46658
- let elementTool = builderStuff.querySelector('.is-element-tool');
46659
- elementTool.style.display = '';
46660
- // Hide column tool
46661
- let columnTool = builderStuff.querySelector('.is-column-tool');
46662
- dom.removeClass(columnTool, 'active');
46663
- }).on('resize', ({ target, width, height }) => {
46664
- // target.style.width = `${width}px`;
46665
- // target.style.height = `${height}px`;
46666
- // get active image
46667
- let activeImage = target;
46668
- let bCircular = false;
46669
- if(dom.hasClass(activeImage, 'img-circular')) {
46670
- bCircular = true;
46671
- }
46672
- let pl = parseFloat(window.getComputedStyle(activeImage.parentNode).getPropertyValue('padding-left'));
46673
- let pr = parseFloat(window.getComputedStyle(activeImage.parentNode).getPropertyValue('padding-right'));
46674
- let maxWidth = activeImage.parentNode.offsetWidth - pl - pr;
46675
- if(width>maxWidth) return;
46676
- if(!bCircular) {
46677
- // activeImage.style.width = `${width/this.builder.opts.zoom}px`;
46678
- // activeImage.style.height = 'auto';
46679
- activeImage.style.width = `${width}px`;
46680
- activeImage.style.height = `${height}px`;
46681
- } else {
46682
- if(height>=width) {
46683
- activeImage.style.width = `${width}px`;
46684
- activeImage.style.height =`${width}px`;
46685
- activeImage.querySelector('img').style.width = `${width}px`;
46686
- activeImage.querySelector('img').style.height = `${width}px`;
46687
- } else {
46688
- activeImage.style.width = `${width}px`;
46689
- activeImage.style.height =`${height}px`;
46690
- activeImage.querySelector('img').style.width = `${width}px`;
46691
- activeImage.querySelector('img').style.height = `${height}px`;
46692
- }
46693
- }
46694
-
46695
- // https://stackoverflow.com/questions/29908261/prevent-text-selection-on-mouse-drag
46696
- // prevent text selection
46697
- if (document.selection) {
46698
- document.selection.empty();
46699
- } else {
46700
- window.getSelection().removeAllRanges();
46701
- }
46702
-
46703
- }).on('resizeEnd', ({ target }) => {
46704
- const builderStuff = this.builder.builderStuff;
46705
- let activeImage = target;
46706
- let bCircular = false;
46707
- if(dom.hasClass(activeImage, 'img-circular')) {
46708
- bCircular = true;
46709
- }
46710
- // https://stackoverflow.com/questions/25197184/get-the-height-of-an-element-minus-padding-margin-border-widths
46711
- var cs = getComputedStyle(activeImage.parentNode);
46712
- var paddingX = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);
46713
- //var paddingY = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);
46714
- var borderX = parseFloat(cs.borderLeftWidth) + parseFloat(cs.borderRightWidth);
46715
- //var borderY = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);
46716
- // Element width and height minus padding and border
46717
- var elementWidth = activeImage.parentNode.offsetWidth - paddingX - borderX;
46718
- //var elementHeight = activeImage.parentNode.offsetHeight - paddingY - borderY;
46719
- if(!bCircular) {
46720
- var parentWidth = elementWidth; //activeImage.parentNode.offsetWidth;
46721
- var currentWidth = activeImage.offsetWidth;
46722
- // var currentHeight = activeImage.offsetHeight;
46723
- var percentage = (currentWidth / parentWidth) * 100;
46724
- activeImage.style.width = percentage + '%';
46725
- activeImage.style.height = 'auto';
46726
- // activeImage.style.height = ((percentage*currentHeight)/currentWidth) + '%';//new
46727
- }
46728
- if(this.builder.opts.emailMode) {
46729
- //activeImage.setAttribute('width', percentage + '%');
46730
- activeImage.setAttribute('width', currentWidth);
46731
- }
46732
- target.setAttribute('data-resized', 1);
46733
- setTimeout(()=>{
46734
- target.setAttribute('data-resized', 0);
46735
- },300);
46736
- //Trigger Change event
46737
- this.builder.opts.onChange();
46738
- // Show column tool
46739
- let columnTool = builderStuff.querySelector('.is-column-tool');
46740
- dom.addClass(columnTool, 'active');
46741
-
46742
- });
46743
- elm.setAttribute('data-mov','1');
46744
- this.builder.imgs.push(obj);
46745
- }
46746
- */
46725
+ const handleImageToolClickOut = e => {
46726
+ // console.log('handleImageToolClickOut');
46727
+ let elm = e.target;
46728
+ if (!elm) return;
46729
+ if (!elm.closest('#divImageResizer') && !elm.closest('#divImageTool') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('.sl-wrapper') && !elm.closest('.sl-overlay') && !elm.closest('.sl-close') && !elm.closest('img')) {
46730
+ // click outside
46731
+
46732
+ // hide
46733
+ this.hideImageTool();
46734
+ // console.log('HIDE');
46735
+
46736
+ document.removeEventListener('click', handleImageToolClickOut);
46737
+ if (this.builder.iframeDocument) {
46738
+ this.builder.doc.removeEventListener('click', handleImageToolClickOut);
46739
+ }
46740
+ this.builder.handleImageToolClickOut_ = false;
46741
+ }
46742
+ };
46743
+ if (!this.builder.handleImageToolClickOut_) {
46744
+ document.addEventListener('click', handleImageToolClickOut);
46745
+ if (this.builder.iframeDocument) {
46746
+ this.builder.doc.addEventListener('click', handleImageToolClickOut);
46747
+ }
46748
+ this.builder.handleImageToolClickOut_ = true;
46749
+ }
46747
46750
  } else {
46748
46751
  let imageResizer = this.imageResizer;
46749
46752
  imageResizer.style.display = 'none';
@@ -46763,18 +46766,7 @@ class Image$1 {
46763
46766
  prog = true;
46764
46767
  }
46765
46768
  if (prog) {
46766
- imageTool.style.display = '';
46767
- let imageResizer = this.imageResizer;
46768
- imageResizer.style.display = 'none';
46769
-
46770
- // moveable
46771
- imageResizer.style.top = '-10px';
46772
- imageResizer.style.left = '-10px';
46773
- imageResizer.style.width = '1px';
46774
- imageResizer.style.height = '1px';
46775
- if (this.builder.moveable) this.builder.moveable.updateRect();
46776
- const movControlBox = document.querySelector('.moveable-control-box');
46777
- if (movControlBox) movControlBox.style.display = 'none';
46769
+ this.hideImageTool();
46778
46770
  }
46779
46771
 
46780
46772
  // NOTE:
@@ -46788,36 +46780,11 @@ class Image$1 {
46788
46780
  // },100);
46789
46781
  // }
46790
46782
  } else {
46791
- let imageTool = this.imageTool;
46792
- imageTool.style.display = '';
46793
46783
  this.builder.activeImage = null;
46794
- let imageResizer = this.imageResizer;
46795
- imageResizer.style.display = 'none';
46796
-
46797
- // moveable
46798
- imageResizer.style.top = '-10px';
46799
- imageResizer.style.left = '-10px';
46800
- imageResizer.style.width = '1px';
46801
- imageResizer.style.height = '1px';
46802
- if (this.builder.moveable) this.builder.moveable.updateRect();
46803
- const movControlBox = document.querySelector('.moveable-control-box');
46804
- if (movControlBox) movControlBox.style.display = 'none';
46784
+ this.hideImageTool();
46805
46785
  }
46806
46786
  } else {
46807
- let imageTool = this.imageTool;
46808
- imageTool.style.display = '';
46809
46787
  this.builder.activeImage = null;
46810
- let imageResizer = this.imageResizer;
46811
- imageResizer.style.display = 'none';
46812
-
46813
- // moveable
46814
- imageResizer.style.top = '-10px';
46815
- imageResizer.style.left = '-10px';
46816
- imageResizer.style.width = '1px';
46817
- imageResizer.style.height = '1px';
46818
- if (this.builder.moveable) this.builder.moveable.updateRect();
46819
- const movControlBox = document.querySelector('.moveable-control-box');
46820
- if (movControlBox) movControlBox.style.display = 'none';
46821
46788
  }
46822
46789
  }
46823
46790
 
@@ -48725,7 +48692,7 @@ class Hyperlink {
48725
48692
  <button title="${util.out(this.builder.opts.otherSelectCaption)}" class="input-select-other" style="display:none;width:50px">
48726
48693
  ${this.builder.opts.otherSelectIcon}
48727
48694
  </button>
48728
- <div class="div-anyfile-upload" style="position: relative; flex: 0 0 auto; width: 43px; height: 43px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">
48695
+ <div class="div-anyfile-upload is-btn classic" style="position: relative; flex: 0 0 auto; width: 50px; height: 43px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">
48729
48696
  <form class="form-upload-larger" target="frameTargetAnyfileUpload" method="post" action="${this.builder.opts.fileHandler}" enctype="multipart/form-data" style="overflow:hidden;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:1px;display:flex;align-items: center;justify-content: center;">
48730
48697
  <input class="input-anyfile-customval" name="hidRefId" type="hidden" value="${this.builder.customval}" />
48731
48698
  <svg class="is-icon-flex"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
@@ -49127,8 +49094,6 @@ class Hyperlink {
49127
49094
 
49128
49095
  this.showTool(link);
49129
49096
  e.preventDefault();
49130
- } else {
49131
- this.hideTool();
49132
49097
  }
49133
49098
  }
49134
49099
  showTool(link) {
@@ -49170,6 +49135,33 @@ class Hyperlink {
49170
49135
  const h = linkTool.offsetHeight;
49171
49136
  linkTool.style.top = top - h - 3 + 'px';
49172
49137
  linkTool.style.left = left + link.offsetWidth * this.builder.opts.zoom - w + 'px';
49138
+ const handleLinkButtonClick = e => {
49139
+ // console.log('handleLinkButtonClick');
49140
+ let elm = e.target;
49141
+ if (!elm) return;
49142
+ if (!elm.closest('#divLinkTool') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('a')) {
49143
+ // click outside
49144
+
49145
+ // hide
49146
+ this.hideTool();
49147
+ // console.log('HIDE');
49148
+
49149
+ // Hide Button Editor Modal
49150
+ this.builder.element.hyperlink.buttonEditor.hide();
49151
+ document.removeEventListener('click', handleLinkButtonClick);
49152
+ if (this.builder.iframeDocument) {
49153
+ this.builder.doc.removeEventListener('click', handleLinkButtonClick);
49154
+ }
49155
+ this.builder.handleLinkButtonClick_ = false;
49156
+ }
49157
+ };
49158
+ if (!this.builder.handleLinkButtonClick_) {
49159
+ document.addEventListener('click', handleLinkButtonClick);
49160
+ if (this.builder.iframeDocument) {
49161
+ this.builder.doc.addEventListener('click', handleLinkButtonClick);
49162
+ }
49163
+ this.builder.handleLinkButtonClick_ = true;
49164
+ }
49173
49165
  }
49174
49166
  hideTool() {
49175
49167
  this.linkTool.style.display = '';
@@ -49522,9 +49514,34 @@ class Button {
49522
49514
  if (btn && !customcode && !noedit && !_protected) {
49523
49515
  this.builder.activeButton = btn;
49524
49516
  this.showTool(btn);
49517
+ const handleButtonClick = e => {
49518
+ // console.log('handleButtonClick');
49519
+ let elm = e.target;
49520
+ if (!elm) return;
49521
+ if (!elm.closest('#divButtonTool') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('button')) {
49522
+ // click outside
49523
+
49524
+ // hide
49525
+ this.hideTool();
49526
+ // console.log('HIDE');
49527
+
49528
+ // Hide Button Editor Modal
49529
+ this.builder.element.hyperlink.buttonEditor.hide();
49530
+ document.removeEventListener('click', handleButtonClick);
49531
+ if (this.builder.iframeDocument) {
49532
+ this.builder.doc.removeEventListener('click', handleButtonClick);
49533
+ }
49534
+ this.builder.handleButtonClick_ = false;
49535
+ }
49536
+ };
49537
+ if (!this.builder.handleButtonClick_) {
49538
+ document.addEventListener('click', handleButtonClick);
49539
+ if (this.builder.iframeDocument) {
49540
+ this.builder.doc.addEventListener('click', handleButtonClick);
49541
+ }
49542
+ this.builder.handleButtonClick_ = true;
49543
+ }
49525
49544
  e.preventDefault();
49526
- } else {
49527
- this.hideTool();
49528
49545
  }
49529
49546
  }
49530
49547
  editButton() {
@@ -49731,7 +49748,8 @@ class Module {
49731
49748
  if (!moduleTool) {
49732
49749
  let html = `
49733
49750
  <div class="is-tool is-module-tool">
49734
- <button title="${util.out('Settings')}" data-title="${util.out('Settings')}" style="width:40px;height:40px;"><svg class="is-icon-flex"><use xlink:href="#ion-ios-gear"></use></svg></button>
49751
+ <button class="btn-module-refresh" title="${util.out('Refresh')}" data-title="${util.out('Refresh')}" style="width:40px;height:40px;"><svg class="is-icon-flex"><use xlink:href="#icon-reload"></use></svg></button>
49752
+ <button class="btn-module-settings" title="${util.out('Settings')}" data-title="${util.out('Settings')}" style="width:40px;height:40px;"><svg class="is-icon-flex"><use xlink:href="#ion-ios-gear"></use></svg></button>
49735
49753
  </div>
49736
49754
 
49737
49755
  <input id="hidContentModuleCode" type="hidden" />
@@ -49759,11 +49777,15 @@ class Module {
49759
49777
  }
49760
49778
  moduleModal = builderStuff.querySelector('.is-modal.custommodule');
49761
49779
  this.moduleModal = moduleModal;
49762
- let btn = moduleTool.querySelector('button');
49763
- dom.addEventListener(btn, 'click', async () => {
49764
- // old: 10100
49765
-
49766
- this.edit(btn);
49780
+ const btnModuleSettings = moduleTool.querySelector('.btn-module-settings');
49781
+ btnModuleSettings.addEventListener('click', async () => {
49782
+ this.edit(btnModuleSettings);
49783
+ });
49784
+ const btnModuleRefresh = moduleTool.querySelector('.btn-module-refresh');
49785
+ btnModuleRefresh.addEventListener('click', async () => {
49786
+ let module = this.builder.activeModule;
49787
+ module.click();
49788
+ this.util.refreshModuleLayout(module);
49767
49789
  });
49768
49790
  let btnOk = moduleModal.querySelector('.input-ok');
49769
49791
  dom.addEventListener(btnOk, 'click', () => {
@@ -49811,16 +49833,16 @@ class Module {
49811
49833
  });
49812
49834
  let builderActive = this.builder.doc.querySelector('.builder-active');
49813
49835
  if (builderActive) this.builder.applyBehaviorOn(builderActive);
49814
-
49815
- //Trigger Change event
49816
49836
  this.builder.opts.onChange();
49817
-
49818
- //Trigger Render event
49819
49837
  this.builder.opts.onRender();
49820
- this.util.hideControls();
49821
- this.util.repositionColumnTool(true);
49822
- if (this.builder.onRefreshTool) this.builder.onRefreshTool();
49823
- module.click();
49838
+
49839
+ // this.util.hideControls();
49840
+
49841
+ // this.util.repositionColumnTool(true);
49842
+ // if(this.builder.onRefreshTool) this.builder.onRefreshTool();
49843
+
49844
+ // module.click();
49845
+
49824
49846
  this.builder.hideModal(moduleModal);
49825
49847
  });
49826
49848
  let btnCancel = moduleModal.querySelector('.input-cancel');
@@ -49837,7 +49859,10 @@ class Module {
49837
49859
  const dom = this.dom;
49838
49860
 
49839
49861
  //-------- Set a flag to indicate active module -----------
49840
- dom.removeAttributes(document.querySelectorAll('[data-module-active]'), 'data-module-active');
49862
+ dom.removeAttributes(this.builder.doc.querySelectorAll('[data-module-active]'), 'data-module-active');
49863
+ // this.builder.doc.querySelectorAll('[data-module-active]').forEach(element => {
49864
+ // element.removeAttribute('data-module-active');
49865
+ // });
49841
49866
  module.setAttribute('data-module-active', '1');
49842
49867
  //-------- /Set a flag to indicate active module -----------
49843
49868
 
@@ -49953,26 +49978,27 @@ class Module {
49953
49978
  index++;
49954
49979
  });
49955
49980
  */
49981
+ if (module.getAttribute('data-panel') === 'side' && this.builder.controlPanel) ; else {
49982
+ this.util.showModal(moduleModal, true, () => {
49983
+ if (btn) {
49984
+ btn.removeAttribute('data-focus');
49985
+ btn.focus();
49986
+ }
49987
+ });
49988
+ if (btn) btn.setAttribute('data-focus', true);
49956
49989
 
49957
- this.util.showModal(moduleModal, true, () => {
49958
- if (btn) {
49959
- btn.removeAttribute('data-focus');
49960
- btn.focus();
49961
- }
49962
- });
49963
- if (btn) btn.setAttribute('data-focus', true);
49964
-
49965
- // var d = new Date();
49966
- // moduleModal.querySelector('iframe').src = this.builder.opts.modulePath + modulename + '.html?' + d.getTime(); //always refreshed
49990
+ // var d = new Date();
49991
+ // moduleModal.querySelector('iframe').src = this.builder.opts.modulePath + modulename + '.html?' + d.getTime(); //always refreshed
49967
49992
 
49968
- const iframe = moduleModal.querySelector('iframe');
49969
- let result = await fetch(this.builder.opts.modulePath + modulename + '.html');
49970
- result = await result.text();
49971
- result = result.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
49972
- let doc = iframe.contentWindow.document;
49973
- doc.open();
49974
- doc.write(result);
49975
- doc.close();
49993
+ let iframe = moduleModal.querySelector('iframe');
49994
+ let result = await fetch(this.builder.opts.modulePath + modulename + '.html');
49995
+ result = await result.text();
49996
+ result = result.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
49997
+ let doc = iframe.contentWindow.document;
49998
+ doc.open();
49999
+ doc.write(result);
50000
+ doc.close();
50001
+ }
49976
50002
  }
49977
50003
  click(col) {
49978
50004
  let custommodule = false;
@@ -49982,25 +50008,38 @@ class Module {
49982
50008
  }
49983
50009
  if (custommodule) {
49984
50010
  this.builder.activeModule = col;
49985
- let elm = col;
49986
50011
  this.moduleTool.style.display = 'flex';
49987
- let _toolwidth = this.moduleTool.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
49988
-
49989
- let w = elm.offsetWidth * this.builder.opts.zoom;
49990
- let top = elm.getBoundingClientRect().top + this.builder.win.pageYOffset;
49991
- let left = elm.getBoundingClientRect().left - 2;
49992
- left = left + (w - _toolwidth);
49993
-
49994
- //Adjust left in case an element is outside the screen
49995
- const _screenwidth = window.innerWidth;
49996
- if (_toolwidth + left > _screenwidth) left = elm.getBoundingClientRect().left;
49997
- this.moduleTool.style.top = top + 'px';
49998
- this.moduleTool.style.left = left + 'px';
50012
+ const btn = this.moduleTool.querySelector('.btn-module-settings');
50013
+ if (col.getAttribute('data-panel') === 'side' && this.builder.controlPanel) {
50014
+ btn.style.display = 'none';
50015
+ } else {
50016
+ btn.style.display = '';
50017
+ }
50018
+ this.repositionModuleTool();
49999
50019
  } else {
50000
50020
  this.builder.activeModule = null;
50001
50021
  this.moduleTool.style.display = '';
50002
50022
  }
50003
50023
  }
50024
+ repositionModuleTool() {
50025
+ if (!this.builder.activeModule) return;
50026
+ if (this.moduleTool.style.display !== 'flex') return;
50027
+ let elm = this.builder.activeModule;
50028
+
50029
+ // this.moduleTool.style.display = 'flex';
50030
+ let _toolwidth = this.moduleTool.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
50031
+
50032
+ let w = elm.offsetWidth * this.builder.opts.zoom;
50033
+ let top = elm.getBoundingClientRect().top + this.builder.win.pageYOffset;
50034
+ let left = elm.getBoundingClientRect().left - 2;
50035
+ left = left + (w - _toolwidth);
50036
+
50037
+ //Adjust left in case an element is outside the screen
50038
+ const _screenwidth = window.innerWidth;
50039
+ if (_toolwidth + left > _screenwidth) left = elm.getBoundingClientRect().left;
50040
+ this.moduleTool.style.top = top + 'px';
50041
+ this.moduleTool.style.left = left + 'px';
50042
+ }
50004
50043
  }
50005
50044
 
50006
50045
  class Code {
@@ -50433,21 +50472,6 @@ class Table {
50433
50472
  tableTool = contentStuff.querySelector('.is-table-tool');
50434
50473
  }
50435
50474
  tableModal = builderStuff.querySelector('.is-modal.edittable');
50436
- let btn = tableTool.querySelector('button');
50437
- dom.addEventListener(btn, 'click', () => {
50438
- // old 10317
50439
- if (dom.hasClass(tableModal, 'active')) {
50440
- // dom.removeClass(tableModal, 'active');
50441
- util.hideModal(tableModal);
50442
- } else {
50443
- dom.addClass(tableModal, 'active');
50444
- util.showModal(tableModal);
50445
- }
50446
- });
50447
- let btnClose = tableModal.querySelector('.is-modal-close');
50448
- dom.addEventListener(btnClose, 'click', () => {
50449
- dom.removeClass(tableModal, 'active');
50450
- });
50451
50475
  const btnBgColor = tableModal.querySelector('.input-table-bgcolor');
50452
50476
  btnBgColor.addEventListener('click', e => {
50453
50477
  this.builder.uo.saveForUndo();
@@ -50609,7 +50633,7 @@ class Table {
50609
50633
 
50610
50634
  //Table Layout
50611
50635
 
50612
- btn = tableModal.querySelector('[data-table-cmd="rowabove"]');
50636
+ let btn = tableModal.querySelector('[data-table-cmd="rowabove"]');
50613
50637
  btn.addEventListener('click', () => {
50614
50638
  if (!this.builder.activeTd) return;
50615
50639
 
@@ -50746,47 +50770,99 @@ class Table {
50746
50770
  //Trigger Change event
50747
50771
  this.builder.opts.onChange();
50748
50772
  });
50773
+ btn = tableTool.querySelector('button');
50774
+ dom.addEventListener(btn, 'click', () => {
50775
+ // old 10317
50776
+
50777
+ if (tableModal.classList.contains('active')) {
50778
+ this.hideTableEditor();
50779
+ } else {
50780
+ this.showTableEditor();
50781
+ }
50782
+ });
50783
+ let btnClose = tableModal.querySelector('.is-modal-close');
50784
+ dom.addEventListener(btnClose, 'click', () => {
50785
+ dom.removeClass(tableModal, 'active');
50786
+ });
50749
50787
  }
50750
50788
  this.tableTool = tableTool;
50751
50789
  this.tableModal = tableModal;
50752
50790
  }
50753
- click(e) {
50754
- const dom = this.dom;
50755
- if (dom.parentsHasElement(e.target, 'table')) {
50756
- // only edit table.default
50757
-
50758
- let element = e.target;
50759
- let td;
50760
- let table;
50761
- if (element.tagName.toLowerCase() === 'td') {
50762
- td = element;
50763
- } else {
50764
- while (element.tagName.toLowerCase() !== 'td') {
50765
- element = element.parentNode;
50791
+ showTableEditor() {
50792
+ const tableModal = this.tableModal;
50793
+ this.util.showModal(tableModal);
50794
+ this.realtime();
50795
+ const handleTableClick = e => {
50796
+ // console.log('handleTableClick');
50797
+ let elm = e.target;
50798
+ if (!elm) return;
50799
+ if (!elm.closest('.is-table-tool') && !elm.closest('.is-sidebar') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('table')) {
50800
+ // click outside
50801
+
50802
+ // hide
50803
+ this.hideTableEditor();
50804
+ // console.log('HIDE');
50805
+
50806
+ document.removeEventListener('click', handleTableClick);
50807
+ if (this.builder.iframeDocument) {
50808
+ this.builder.doc.removeEventListener('click', handleTableClick);
50766
50809
  }
50767
- td = element;
50810
+ this.builder.handleTableClick_ = false;
50768
50811
  }
50769
- while (element.tagName.toLowerCase() !== 'table') {
50770
- element = element.parentNode;
50812
+ if (elm.closest('table')) {
50813
+ this.realtime();
50814
+ }
50815
+ };
50816
+ if (!this.builder.handleTableClick_) {
50817
+ document.addEventListener('click', handleTableClick);
50818
+ if (this.builder.iframeDocument) {
50819
+ this.builder.doc.addEventListener('click', handleTableClick);
50771
50820
  }
50772
- table = element;
50821
+ this.builder.handleTableClick_ = true;
50822
+ }
50823
+ }
50824
+ hideTableEditor() {
50825
+ const tableModal = this.tableModal;
50826
+ this.util.hideModal(tableModal);
50827
+ }
50828
+ realtime() {
50829
+ const tableModal = this.tableModal;
50830
+ if (tableModal.classList.contains('active') && this.builder.activeTable) {
50831
+ let activeTd = this.builder.activeTd;
50832
+ tableModal.querySelector('.input-table-bgcolor').style.backgroundColor = activeTd.style.backgroundColor;
50833
+ tableModal.querySelector('.input-table-textcolor').style.backgroundColor = activeTd.style.color;
50834
+ tableModal.querySelector('.input-table-bordercolor').style.backgroundColor = activeTd.style.borderColor;
50835
+ tableModal.querySelector('#selCellBorderWidth').value = parseInt(activeTd.style.borderWidth);
50836
+ } else {
50837
+ tableModal.querySelector('.input-table-bgcolor').style.backgroundColor = '';
50838
+ tableModal.querySelector('.input-table-textcolor').style.backgroundColor = '';
50839
+ tableModal.querySelector('.input-table-bordercolor').style.backgroundColor = '';
50840
+ tableModal.querySelector('#selCellBorderWidth').value = 0;
50841
+ }
50842
+ }
50843
+ click(e) {
50844
+ let elm = e.target;
50845
+ if (!elm) return;
50846
+ const dom = this.dom;
50847
+ const table = elm.closest('table');
50848
+ if (table) {
50849
+ let td = elm.closest('td');
50773
50850
  if (dom.hasClass(table, 'default')) {
50774
50851
  // only edit table.default
50775
50852
 
50776
50853
  this.builder.activeTd = td;
50777
50854
  this.builder.activeTable = table;
50778
- let elm = table;
50779
50855
  this.tableTool.style.display = 'flex';
50780
50856
  let _toolwidth = this.tableTool.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
50781
50857
 
50782
- let w = elm.offsetWidth * this.builder.opts.zoom;
50783
- let top = elm.getBoundingClientRect().top + this.builder.win.pageYOffset;
50784
- let left = elm.getBoundingClientRect().left - 2;
50858
+ let w = table.offsetWidth * this.builder.opts.zoom;
50859
+ let top = table.getBoundingClientRect().top + this.builder.win.pageYOffset;
50860
+ let left = table.getBoundingClientRect().left - 2;
50785
50861
  left = left + (w - _toolwidth);
50786
50862
 
50787
50863
  //Adjust left in case an element is outside the screen
50788
50864
  const _screenwidth = window.innerWidth;
50789
- if (_toolwidth + left > _screenwidth) left = elm.getBoundingClientRect().left;
50865
+ if (_toolwidth + left > _screenwidth) left = table.getBoundingClientRect().left;
50790
50866
  this.tableTool.style.top = top + 'px';
50791
50867
  this.tableTool.style.left = left + 'px';
50792
50868
  } else {
@@ -50799,18 +50875,6 @@ class Table {
50799
50875
  this.builder.activeTable = null;
50800
50876
  this.tableTool.style.display = '';
50801
50877
  }
50802
- if (dom.hasClass(this.tableModal, 'active') && this.builder.activeTable) {
50803
- let activeTd = this.builder.activeTd;
50804
- this.tableModal.querySelector('.input-table-bgcolor').style.backgroundColor = activeTd.style.backgroundColor;
50805
- this.tableModal.querySelector('.input-table-textcolor').style.backgroundColor = activeTd.style.color;
50806
- this.tableModal.querySelector('.input-table-bordercolor').style.backgroundColor = activeTd.style.borderColor;
50807
- this.tableModal.querySelector('#selCellBorderWidth').value = parseInt(activeTd.style.borderWidth);
50808
- } else {
50809
- this.tableModal.querySelector('.input-table-bgcolor').style.backgroundColor = '';
50810
- this.tableModal.querySelector('.input-table-textcolor').style.backgroundColor = '';
50811
- this.tableModal.querySelector('.input-table-bordercolor').style.backgroundColor = '';
50812
- this.tableModal.querySelector('#selCellBorderWidth').value = 0;
50813
- }
50814
50878
  }
50815
50879
  }
50816
50880
 
@@ -50857,7 +50921,7 @@ class Video {
50857
50921
  <button title="${util.out('Select')}" class="input-select" style="flex:none;">
50858
50922
  ${this.builder.opts.selectIcon}
50859
50923
  </button>
50860
- <div class="video-larger1 input-upload" style="position:relative;flex:none;box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);">
50924
+ <div class="video-larger1 input-upload is-btn classic" style="position:relative;flex:none;box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);">
50861
50925
  <form class="form-upload-larger" target="frameTargetVideoUpload" method="post" action="${this.builder.opts.videoHandler}" enctype="multipart/form-data" style="position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;width:100%;height:100%;">
50862
50926
  <input id="hidRefId5" name="hidRefId" type="hidden" value="" />
50863
50927
  <svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
@@ -51097,7 +51161,7 @@ class Audio {
51097
51161
  <button title="${util.out('Select')}" class="input-select" style="flex:none;">
51098
51162
  ${this.builder.opts.selectIcon}
51099
51163
  </button>
51100
- <div class="audio-file-upload input-upload" style="position:relative;flex:none;box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);">
51164
+ <div class="audio-file-upload input-upload is-btn classic" style="position:relative;flex:none;box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);">
51101
51165
  <form class="form-upload-larger" target="frameTargetAudioUpload" method="post" action="${this.builder.opts.audioHandler}" enctype="multipart/form-data" style="position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;width:100%;height:100%;">
51102
51166
  <input id="hidRefAudio" name="hidRefId" type="hidden" value="" />
51103
51167
  <svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
@@ -51248,66 +51312,7 @@ class Audio {
51248
51312
  }
51249
51313
  }
51250
51314
 
51251
- // Currently not used
51252
-
51253
- class Svg {
51254
- constructor(builder) {
51255
- this.builder = builder;
51256
- const util = this.builder.util;
51257
- const builderStuff = this.builder.builderStuff;
51258
- this.util = util;
51259
- this.builderStuff = builderStuff;
51260
- const dom = this.builder.dom;
51261
- this.dom = dom;
51262
- let svgTool = builderStuff.querySelector('#divSvgTool');
51263
- if (!svgTool) {
51264
- let html = `
51265
- <div id="divSvgTool" class="is-tool">
51266
-
51267
- </div>
51268
- `;
51269
- dom.appendHtml(builderStuff, html);
51270
- svgTool = builderStuff.querySelector('#divSvgTool');
51271
- }
51272
- this.svgTool = svgTool;
51273
- }
51274
- click() {//e
51275
- // Do Nothing
51276
- /*
51277
- const elm = e.target;
51278
- if(elm.tagName.toLowerCase() === 'svg' || elm.tagName.toLowerCase() === 'path') {
51279
- this.builder.activeSvg = elm.closest('svg');
51280
- // prevent text selection
51281
- if (document.selection) {
51282
- document.selection.empty();
51283
- } else {
51284
- window.getSelection().removeAllRanges();
51285
- }
51286
-
51287
- this.showTool(this.builder.activeSvg);
51288
- } else {
51289
- this.hideTool();
51290
- }
51291
- */
51292
- }
51293
- /*
51294
- showTool(elm) {
51295
- const top = elm.getBoundingClientRect().top + window.pageYOffset;
51296
- const left = elm.getBoundingClientRect().left;
51297
- this.svgTool.style.display = 'flex';
51298
-
51299
- const w = this.svgTool.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
51300
- const h = this.svgTool.offsetHeight;
51301
- var bBox = elm.getBBox();
51302
- this.svgTool.style.top = (top - h + window.pageYOffset - 3) + 'px';
51303
- this.svgTool.style.left = (left + (bBox.width * this.builder.opts.zoom) - bBox.width) + 'px';
51304
- }
51305
- hideTool() {
51306
- this.svgTool.style.display = '';
51307
- }
51308
- */
51309
- }
51310
-
51315
+ // import Svg from './elementsvg.js';
51311
51316
  // import Moveable from 'moveable';
51312
51317
 
51313
51318
  class Element$1 {
@@ -51329,8 +51334,9 @@ class Element$1 {
51329
51334
  this.table = new Table(builder);
51330
51335
  this.video = new Video(builder);
51331
51336
  this.audio = new Audio(builder);
51332
- this.svg = new Svg(builder);
51337
+ // this.svg = new Svg(builder);
51333
51338
  }
51339
+
51334
51340
  applyBehavior(col) {
51335
51341
  const dom = this.dom;
51336
51342
  let customcode = false;
@@ -51468,13 +51474,11 @@ class Element$1 {
51468
51474
  //previously this is commented: && !noedit && !_protected
51469
51475
 
51470
51476
  // Icon
51471
- const icons = document.querySelectorAll('.icon-active');
51472
- Array.prototype.forEach.call(icons, icon => {
51473
- dom.removeClass(icon, 'icon-active');
51474
- });
51477
+ const icons = this.builder.doc.querySelectorAll('.icon-active');
51478
+ icons.forEach(icon => icon.classList.remove('icon-active'));
51475
51479
  this.builder.activeIcon = null;
51476
51480
  if (elm.tagName.toLowerCase() === 'i' && elm.innerHTML === '') {
51477
- dom.addClass(elm, 'icon-active');
51481
+ elm.classList.add('icon-active');
51478
51482
  dom.selectElementContents(elm);
51479
51483
  this.builder.activeIcon = elm;
51480
51484
 
@@ -51515,7 +51519,7 @@ class Element$1 {
51515
51519
  this.spacer.click(e);
51516
51520
 
51517
51521
  // svg
51518
- this.svg.click(e);
51522
+ // this.svg.click(e);
51519
51523
  } else {
51520
51524
  this.util.hideControls();
51521
51525
 
@@ -51536,49 +51540,6 @@ class Element$1 {
51536
51540
 
51537
51541
  //Module
51538
51542
  this.module.click(col, e);
51539
-
51540
- /*
51541
- // let elms = document.querySelectorAll('[data-resizable]');
51542
- // elms.forEach((elm)=>{
51543
- // if(elm.getAttribute('data-resizable')==='1') {
51544
- // elm.destroy();
51545
- // elm.setAttribute('data-resizable', '');
51546
- // }
51547
- // });
51548
- // let rotate = 0;
51549
- let elmResizable;
51550
- if(elm.hasAttribute('data-resizable')) {
51551
- elmResizable = elm;
51552
- } else {
51553
- elmResizable = dom.getParentByAttribute(elm,'data-resizable');
51554
- }
51555
- if(elmResizable) {
51556
- if(elmResizable.getAttribute('data-resizable')!=='1') {
51557
- new Moveable(document.body, {
51558
- target: elmResizable, //document.querySelector('.resizable'),
51559
- resizable: true,
51560
- // draggable: true,
51561
- // warpable: true,
51562
- // rotatable: true,
51563
- throttleResize: 0,
51564
- keepRatio: true,
51565
- }).on('resize', ({ target, width, height }) => {
51566
- target.style.width = `${width}px`;
51567
- target.style.height = `${height}px`;
51568
- });
51569
-
51570
-
51571
- // .on('rotate', ({ target, delta }) => {
51572
- // rotate += delta;
51573
- // target.style.transform = 'rotate(' + rotate + 'deg)';
51574
- // }).on('drag', ({ target, left, top }) => {
51575
- // target.style.left = left + 'px';
51576
- // target.style.top = top + 'px';
51577
- // });
51578
- elmResizable.setAttribute('data-resizable', '1');
51579
- }
51580
- }
51581
- */
51582
51543
  }
51583
51544
  }
51584
51545
 
@@ -53270,6 +53231,7 @@ class RowTool {
53270
53231
  const util = this.builder.util;
53271
53232
  this.util = util;
53272
53233
  const builderStuff = this.builder.builderStuff;
53234
+ this.builderStuff = builderStuff;
53273
53235
  const dom = this.builder.dom;
53274
53236
  this.dom = dom;
53275
53237
  this.grid = new Grid(builder);
@@ -53451,6 +53413,11 @@ class RowTool {
53451
53413
  // Open Row Settings
53452
53414
  let elm = rowMore.querySelector('.row-settings');
53453
53415
  if (elm) dom.addEventListener(elm, 'click', () => {
53416
+ if (this.builder.controlPanel) {
53417
+ this.builder.controlpanel.select('row', true);
53418
+ util.hidePop(this.rowMore);
53419
+ return;
53420
+ }
53454
53421
  const row = this.rowOverlay();
53455
53422
  if (!row) return;
53456
53423
  this.readRowStyles(row);
@@ -54126,6 +54093,35 @@ class RowTool {
54126
54093
  } else {
54127
54094
  quickadd.setAttribute('data-mode', 'cell-right');
54128
54095
  }
54096
+
54097
+ //handleQuickAddClickOut
54098
+ const handleQuickAddClickOut = e => {
54099
+ // console.log('handleQuickAddClickOut');
54100
+ let elm = e.target;
54101
+ if (!elm) return;
54102
+ if (!elm.closest('.quickadd') && !elm.closest('.row-add') && !elm.closest('.is-rowadd-tool') && !elm.closest('.cell-add') && !elm.closest('.elm-add') && !elm.closest('.row-add-initial')) {
54103
+ // click outside
54104
+
54105
+ // hide
54106
+ const quickadd = builderStuff.querySelector('.quickadd');
54107
+ util.hidePop(quickadd);
54108
+ // console.log('HIDE');
54109
+
54110
+ // clear events
54111
+ document.removeEventListener('click', handleQuickAddClickOut);
54112
+ if (this.builder.iframeDocument) {
54113
+ this.builder.doc.removeEventListener('click', handleQuickAddClickOut);
54114
+ }
54115
+ this.builder.handleQuickAddClickOut_ = false;
54116
+ }
54117
+ };
54118
+ if (!this.builder.handleQuickAddClickOut_) {
54119
+ document.addEventListener('click', handleQuickAddClickOut);
54120
+ if (this.builder.iframeDocument) {
54121
+ this.builder.doc.addEventListener('click', handleQuickAddClickOut);
54122
+ }
54123
+ this.builder.handleQuickAddClickOut_ = true;
54124
+ }
54129
54125
  });
54130
54126
  const btnCellMore = coltool.querySelector('.cell-more');
54131
54127
  if (btnCellMore) dom.addEventListener(btnCellMore, 'click', () => {
@@ -54170,8 +54166,126 @@ class RowTool {
54170
54166
  dom.removeClass(btnCellLocking, 'on');
54171
54167
  // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock-off"></use></svg>';
54172
54168
  }
54173
- });
54174
54169
 
54170
+ // columnMore
54171
+
54172
+ const btnIncrease = columnMore.querySelector('.cell-increase');
54173
+ const btnDecrease = columnMore.querySelector('.cell-decrease');
54174
+ const btnPrev = columnMore.querySelector('.cell-prev');
54175
+ const btnNext = columnMore.querySelector('.cell-next');
54176
+ const btnUp = columnMore.querySelector('.cell-up');
54177
+ const btnDown = columnMore.querySelector('.cell-down');
54178
+ const btnDuplicate = columnMore.querySelector('.cell-duplicate');
54179
+ const btnLock = columnMore.querySelector('.cell-locking');
54180
+ const separator = columnMore.querySelector('.is-separator');
54181
+ let nogrid = cell.closest('[nogrid]'); //dom.parentsHasAttribute(col, 'nogrid');
54182
+ if (nogrid) {
54183
+ btnPrev.style.display = 'none';
54184
+ btnNext.style.display = 'none';
54185
+ btnUp.style.display = 'none';
54186
+ btnDown.style.display = 'none';
54187
+ if (btnIncrease) btnIncrease.style.display = 'none';
54188
+ if (btnDecrease) btnDecrease.style.display = 'none';
54189
+ btnDuplicate.style.display = 'none';
54190
+ btnPrev.setAttribute('disabled', 'disabled');
54191
+ btnNext.setAttribute('disabled', 'disabled');
54192
+ btnUp.setAttribute('disabled', 'disabled');
54193
+ btnDown.setAttribute('disabled', 'disabled');
54194
+ btnIncrease.setAttribute('disabled', 'disabled');
54195
+ btnDecrease.setAttribute('disabled', 'disabled');
54196
+ btnDuplicate.setAttribute('disabled', 'disabled');
54197
+ let btnColHtml = columnMore.querySelector('.cell-html');
54198
+ if (btnColHtml) btnColHtml.style.display = '';
54199
+ if (cell.getAttribute('data-html')) {
54200
+ columnMore.querySelector('.cell-html').style.display = 'none';
54201
+ this.columnTool.querySelector('.cell-more').style.display = 'none';
54202
+ columnMore.querySelector('.cell-html').setAttribute('disabled', 'disabled');
54203
+ this.columnTool.querySelector('.cell-more').setAttribute('disabled', 'disabled');
54204
+ }
54205
+ } else {
54206
+ btnPrev.style.display = '';
54207
+ btnNext.style.display = '';
54208
+ btnUp.style.display = '';
54209
+ btnDown.style.display = '';
54210
+ if (btnIncrease) btnIncrease.style.display = '';
54211
+ if (btnDecrease) btnDecrease.style.display = '';
54212
+ btnDuplicate.style.display = '';
54213
+ btnPrev.removeAttribute('disabled');
54214
+ btnNext.removeAttribute('disabled');
54215
+ btnUp.removeAttribute('disabled');
54216
+ btnDown.removeAttribute('disabled');
54217
+ if (btnIncrease) btnIncrease.removeAttribute('disabled');
54218
+ if (btnDecrease) btnDecrease.removeAttribute('disabled');
54219
+ btnDuplicate.removeAttribute('disabled');
54220
+ let btnColHtml = columnMore.querySelector('.cell-html');
54221
+ if (btnColHtml) {
54222
+ btnColHtml.style.display = '';
54223
+ btnColHtml.removeAttribute('disabled');
54224
+ }
54225
+ let row = cell.parentNode;
54226
+ let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
54227
+ if (row.querySelector('.is-row-overlay')) {
54228
+ num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
54229
+ }
54230
+
54231
+ if (row.childElementCount - num === 1) {
54232
+ //-num => minus is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
54233
+ btnPrev.style.display = 'none';
54234
+ btnNext.style.display = 'none';
54235
+ if (btnIncrease) btnIncrease.style.display = 'none';
54236
+ if (btnDecrease) btnDecrease.style.display = 'none';
54237
+ btnPrev.setAttribute('disabled', 'disabled');
54238
+ btnNext.setAttribute('disabled', 'disabled');
54239
+ if (btnIncrease) btnIncrease.setAttribute('disabled', 'disabled');
54240
+ if (btnDecrease) btnDecrease.setAttribute('disabled', 'disabled');
54241
+ } else {
54242
+ btnPrev.style.display = '';
54243
+ btnNext.style.display = '';
54244
+ if (btnIncrease) btnIncrease.style.display = '';
54245
+ if (btnDecrease) btnDecrease.style.display = '';
54246
+ btnPrev.removeAttribute('disabled');
54247
+ btnNext.removeAttribute('disabled');
54248
+ if (btnIncrease) btnIncrease.removeAttribute('disabled');
54249
+ if (btnDecrease) btnDecrease.removeAttribute('disabled');
54250
+ }
54251
+
54252
+ // let btnColHtml = columnMore.querySelector('.cell-html');
54253
+ let btnColDuplicate = btnDuplicate;
54254
+ if (cell.getAttribute('data-html')) {
54255
+ if (btnColHtml) {
54256
+ btnColHtml.style.display = 'none';
54257
+ btnColHtml.setAttribute('disabled', 'disabled');
54258
+ }
54259
+ if (btnColDuplicate) {
54260
+ btnColDuplicate.style.display = 'none';
54261
+ btnColDuplicate.setAttribute('disabled', 'disabled');
54262
+ }
54263
+ } else {
54264
+ if (btnColHtml) {
54265
+ btnColHtml.style.display = '';
54266
+ btnColHtml.removeAttribute('disabled');
54267
+ }
54268
+ if (btnColDuplicate) {
54269
+ btnColDuplicate.style.display = '';
54270
+ btnColDuplicate.removeAttribute('disabled');
54271
+ }
54272
+ }
54273
+ }
54274
+ if (cell.classList.contains('column-lock')) {
54275
+ btnPrev.style.display = 'none';
54276
+ btnNext.style.display = 'none';
54277
+ btnUp.style.display = 'none';
54278
+ btnDown.style.display = 'none';
54279
+ btnIncrease.style.display = 'none';
54280
+ btnDecrease.style.display = 'none';
54281
+ btnDuplicate.style.display = 'none';
54282
+ separator.style.display = 'none';
54283
+ btnLock.style.display = 'none';
54284
+ } else {
54285
+ separator.style.display = '';
54286
+ btnLock.style.display = '';
54287
+ }
54288
+ });
54175
54289
  const btnCellRemove = coltool.querySelector('.cell-remove');
54176
54290
  if (btnCellRemove) dom.addEventListener(btnCellRemove, 'click', () => {
54177
54291
  const grid = new Grid(this.builder);
@@ -54181,47 +54295,7 @@ class RowTool {
54181
54295
  });
54182
54296
  let btnGridEditor = rowtool.querySelector('.row-grideditor');
54183
54297
  if (btnGridEditor) dom.addEventListener(btnGridEditor, 'click', () => {
54184
- const grideditor = builderStuff.querySelector('.grideditor');
54185
- if (dom.hasClass(grideditor, 'active')) {
54186
- dom.removeClass(grideditor, 'active');
54187
- const builders = document.querySelectorAll(this.builder.opts.container);
54188
- Array.prototype.forEach.call(builders, builder => {
54189
- builder.removeAttribute('grideditor');
54190
- });
54191
- } else {
54192
- // dom.addClass(grideditor, 'active');
54193
- this.util.showModal(grideditor, false, () => {
54194
- btnGridEditor.removeAttribute('data-focus');
54195
- btnGridEditor.focus();
54196
- });
54197
- btnGridEditor.setAttribute('data-focus', true);
54198
- const builders = document.querySelectorAll(this.builder.opts.container);
54199
- Array.prototype.forEach.call(builders, builder => {
54200
- builder.setAttribute('grideditor', '');
54201
- });
54202
-
54203
- // Grid Editor Status
54204
- // On/off outline button
54205
- const btnGridOutline = grideditor.querySelector('.grid-outline');
54206
- const container = this.builder.doc.querySelector(this.builder.opts.container); // get one
54207
- if (container.hasAttribute('gridoutline')) {
54208
- dom.addClass(btnGridOutline, 'on');
54209
- } else {
54210
- dom.removeClass(btnGridOutline, 'on');
54211
- }
54212
- // On/off lock button
54213
- const btnCellLocking = grideditor.querySelector('.cell-locking');
54214
- let cell = util.cellSelected();
54215
- if (cell) {
54216
- if (cell.hasAttribute('data-noedit')) {
54217
- dom.addClass(btnCellLocking, 'on');
54218
- } else {
54219
- dom.removeClass(btnCellLocking, 'on');
54220
- }
54221
- } else {
54222
- dom.removeClass(btnCellLocking, 'on');
54223
- }
54224
- }
54298
+ this.showGridEditor();
54225
54299
  });
54226
54300
  const btnMore = rowtool.querySelector('.row-more');
54227
54301
  if (btnMore) dom.addEventListener(btnMore, 'click', () => {
@@ -54310,6 +54384,92 @@ class RowTool {
54310
54384
  });
54311
54385
  }
54312
54386
  }
54387
+ hideGridEditor() {
54388
+ const grideditor = this.builderStuff.querySelector('.grideditor');
54389
+ grideditor.classList.remove('active');
54390
+ const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
54391
+ builders.forEach(builder => {
54392
+ builder.removeAttribute('grideditor');
54393
+ });
54394
+ }
54395
+ showGridEditor() {
54396
+ const grideditor = this.builderStuff.querySelector('.grideditor');
54397
+ const handleGridToolClickOut = e => {
54398
+ // console.log('handleGridToolClickOut');
54399
+ let elm = e.target;
54400
+ if (!elm) return;
54401
+ if (!elm.closest('.rte-grideditor') && !elm.closest('.grideditor') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('.is-sidebar') && !elm.closest('.is-rte-tool') && !elm.closest('.is-rte-pop') && !elm.closest('.is-elementrte-tool') && !elm.closest('.is-builder') && !elm.closest('.is-pop')) {
54402
+ // click outside
54403
+
54404
+ // hide
54405
+ this.hideGridEditor();
54406
+ // console.log('HIDE');
54407
+
54408
+ // clear events
54409
+ document.removeEventListener('click', handleGridToolClickOut);
54410
+ if (this.builder.iframeDocument) {
54411
+ this.builder.doc.removeEventListener('click', handleGridToolClickOut);
54412
+ }
54413
+ this.builder.handleGridToolClickOut_ = false;
54414
+ }
54415
+ };
54416
+ if (grideditor.classList.contains('active')) {
54417
+ // hide
54418
+ this.hideGridEditor();
54419
+
54420
+ // clear events
54421
+ document.removeEventListener('click', handleGridToolClickOut);
54422
+ if (this.builder.iframeDocument) {
54423
+ this.builder.doc.removeEventListener('click', handleGridToolClickOut);
54424
+ }
54425
+ this.builder.handleGridToolClickOut_ = false;
54426
+ return;
54427
+ }
54428
+
54429
+ // this.util.showModal(grideditor, false, ()=>{
54430
+ // btnGridEditor.removeAttribute('data-focus');
54431
+ // btnGridEditor.focus();
54432
+ // });
54433
+ // btnGridEditor.setAttribute('data-focus', true);
54434
+
54435
+ this.util.showModal(grideditor);
54436
+ const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
54437
+ builders.forEach(builder => {
54438
+ builder.setAttribute('grideditor', '');
54439
+ });
54440
+
54441
+ /*
54442
+ // Grid Editor Status
54443
+ // On/off outline button
54444
+ const btnGridOutline = grideditor.querySelector('.grid-outline');
54445
+ const container = this.builder.doc.querySelector(this.builder.opts.container); // get one
54446
+ if(container.hasAttribute('gridoutline')) {
54447
+ dom.addClass(btnGridOutline, 'on');
54448
+ } else {
54449
+ dom.removeClass(btnGridOutline, 'on');
54450
+ }
54451
+ // On/off lock button
54452
+ const btnCellLocking = grideditor.querySelector('.cell-locking');
54453
+ let cell = util.cellSelected();
54454
+ if(cell) {
54455
+ if(cell.hasAttribute('data-noedit')) {
54456
+ dom.addClass(btnCellLocking, 'on');
54457
+ } else {
54458
+ dom.removeClass(btnCellLocking, 'on');
54459
+ }
54460
+ } else {
54461
+ dom.removeClass(btnCellLocking, 'on');
54462
+ }
54463
+ */
54464
+
54465
+ if (!this.builder.handleGridToolClickOut_) {
54466
+ document.addEventListener('click', handleGridToolClickOut);
54467
+ if (this.builder.iframeDocument) {
54468
+ this.builder.doc.addEventListener('click', handleGridToolClickOut);
54469
+ }
54470
+ this.builder.handleGridToolClickOut_ = true;
54471
+ }
54472
+ }
54313
54473
  readRowStyles(row) {
54314
54474
  this.util.clearActiveElement();
54315
54475
 
@@ -54410,6 +54570,7 @@ class RowAddTool {
54410
54570
  render(row) {
54411
54571
  const dom = this.dom;
54412
54572
  const util = this.builder.util;
54573
+ const builderStuff = this.builder.builderStuff;
54413
54574
  const quickadd = renderQuickAdd(this.builder);
54414
54575
  let rowaddtool = row.querySelector('.is-rowadd-tool');
54415
54576
  if (!rowaddtool) {
@@ -54476,7 +54637,35 @@ class RowAddTool {
54476
54637
  dom.addClass(quickadd, 'center');
54477
54638
  }
54478
54639
  quickadd.setAttribute('data-mode', 'row');
54479
- return false;
54640
+
54641
+ //handleQuickAddClickOut
54642
+ const handleQuickAddClickOut = e => {
54643
+ // console.log('handleQuickAddClickOut');
54644
+ let elm = e.target;
54645
+ if (!elm) return;
54646
+ if (!elm.closest('.quickadd') && !elm.closest('.row-add') && !elm.closest('.is-rowadd-tool') && !elm.closest('.cell-add') && !elm.closest('.elm-add') && !elm.closest('.row-add-initial')) {
54647
+ // click outside
54648
+
54649
+ // hide
54650
+ const quickadd = builderStuff.querySelector('.quickadd');
54651
+ util.hidePop(quickadd);
54652
+ // console.log('HIDE');
54653
+
54654
+ // clear events
54655
+ document.removeEventListener('click', handleQuickAddClickOut);
54656
+ if (this.builder.iframeDocument) {
54657
+ this.builder.doc.removeEventListener('click', handleQuickAddClickOut);
54658
+ }
54659
+ this.builder.handleQuickAddClickOut_ = false;
54660
+ }
54661
+ };
54662
+ if (!this.builder.handleQuickAddClickOut_) {
54663
+ document.addEventListener('click', handleQuickAddClickOut);
54664
+ if (this.builder.iframeDocument) {
54665
+ this.builder.doc.addEventListener('click', handleQuickAddClickOut);
54666
+ }
54667
+ this.builder.handleQuickAddClickOut_ = true;
54668
+ }
54480
54669
  });
54481
54670
  }
54482
54671
  }
@@ -54739,7 +54928,7 @@ class ColumnTool {
54739
54928
  ${this.builder.opts.otherSelectIcon}
54740
54929
  </button>
54741
54930
 
54742
- <div class="image-larger4" style="position: relative; flex: 0 0 auto; width: 40px; height: 38px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">
54931
+ <div class="image-larger4 is-btn classic" style="position: relative; flex: 0 0 auto; width: 40px; height: 38px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">
54743
54932
  <form class="form-upload-larger" target="frameTargetLinkUpload" method="post" action="${this.builder.opts.largerImageHandler}" enctype="multipart/form-data" style="position:absolute;top:0;left:0;width:100%;height:100%;border-radius:1px;display:flex;align-items: center;justify-content: center;">
54744
54933
  <input id="hidRefId4" name="hidRefId" type="hidden" value="">
54745
54934
  <svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
@@ -55115,6 +55304,11 @@ class ColumnTool {
55115
55304
  // Open Column Settings
55116
55305
  elm = columnMore.querySelector('.cell-settings');
55117
55306
  if (elm) dom.addEventListener(elm, 'click', () => {
55307
+ if (this.builder.controlPanel) {
55308
+ this.builder.controlpanel.select('column', true);
55309
+ util.hidePop(this.columnMore);
55310
+ return;
55311
+ }
55118
55312
  let cell = util.cellSelected();
55119
55313
  if (!cell) return;
55120
55314
  this.readCellStyles(cell);
@@ -55514,6 +55708,8 @@ class ColumnTool {
55514
55708
  cell.removeAttribute('data-scale');
55515
55709
  };
55516
55710
  inpImageHorSlider.onchange = () => {
55711
+ if (this.builder.win.adjustBgPos) this.builder.win.adjustBgPos(); // adjustBgPos() from box/flex.js
55712
+
55517
55713
  //Trigger Change event
55518
55714
  this.builder.opts.onChange();
55519
55715
  };
@@ -55593,6 +55789,8 @@ class ColumnTool {
55593
55789
  cell.removeAttribute('data-scale');
55594
55790
  };
55595
55791
  inpImageVertSlider.onchange = () => {
55792
+ if (this.builder.win.adjustBgPos) this.builder.win.adjustBgPos(); // adjustBgPos() from box/flex.js
55793
+
55596
55794
  //Trigger Change event
55597
55795
  this.builder.opts.onChange();
55598
55796
  };
@@ -57135,144 +57333,28 @@ class ColumnTool {
57135
57333
  }
57136
57334
  }
57137
57335
  click(col) {
57138
- const dom = this.dom;
57139
-
57140
- //---- New Col Tool ----
57141
57336
  this.columnTool = col.parentNode.querySelector('.is-col-tool');
57142
57337
  this.columnTool.style.left = col.offsetLeft + 'px';
57143
57338
  this.columnTool.style.top = col.offsetTop + 'px';
57144
- //---- /New Col Tool ----
57145
-
57146
- const btnIncrease = this.columnMore.querySelector('.cell-increase');
57147
- const btnDecrease = this.columnMore.querySelector('.cell-decrease');
57148
- let nogrid = dom.parentsHasAttribute(col, 'nogrid');
57339
+ const btnAdd = this.columnTool.querySelector('.cell-add');
57340
+ const btnRemove = this.columnTool.querySelector('.cell-remove');
57341
+ const btnMore = this.columnTool.querySelector('.cell-more');
57342
+ let nogrid = col.closest('[nogrid]');
57149
57343
  if (nogrid) {
57150
- this.columnMore.querySelector('.cell-prev').style.display = 'none';
57151
- this.columnMore.querySelector('.cell-next').style.display = 'none';
57152
- this.columnMore.querySelector('.cell-up').style.display = 'none';
57153
- this.columnMore.querySelector('.cell-down').style.display = 'none';
57154
- if (btnIncrease) btnIncrease.style.display = 'none';
57155
- if (btnDecrease) btnDecrease.style.display = 'none';
57156
- this.columnMore.querySelector('.cell-duplicate').style.display = 'none';
57157
- this.columnMore.querySelector('.cell-prev').setAttribute('disabled', 'disabled');
57158
- this.columnMore.querySelector('.cell-next').setAttribute('disabled', 'disabled');
57159
- this.columnMore.querySelector('.cell-up').setAttribute('disabled', 'disabled');
57160
- this.columnMore.querySelector('.cell-down').setAttribute('disabled', 'disabled');
57161
- btnIncrease.setAttribute('disabled', 'disabled');
57162
- btnDecrease.setAttribute('disabled', 'disabled');
57163
- this.columnMore.querySelector('.cell-duplicate').setAttribute('disabled', 'disabled');
57164
- let btnColHtml = this.columnMore.querySelector('.cell-html');
57165
- if (btnColHtml) btnColHtml.style.display = '';
57166
- this.columnTool.querySelector('.cell-add').style.display = 'none';
57167
- this.columnTool.querySelector('.cell-remove').style.display = 'none';
57168
- this.columnTool.querySelector('.cell-add').setAttribute('disabled', 'disabled');
57169
- this.columnTool.querySelector('.cell-remove').setAttribute('disabled', 'disabled');
57344
+ btnAdd.style.display = 'none';
57345
+ btnRemove.style.display = 'none';
57346
+ btnAdd.setAttribute('disabled', 'disabled');
57347
+ btnRemove.setAttribute('disabled', 'disabled');
57170
57348
  if (col.getAttribute('data-html')) {
57171
- this.columnMore.querySelector('.cell-html').style.display = 'none';
57172
- this.columnTool.querySelector('.cell-more').style.display = 'none';
57173
- this.columnMore.querySelector('.cell-html').setAttribute('disabled', 'disabled');
57174
- this.columnTool.querySelector('.cell-more').setAttribute('disabled', 'disabled');
57349
+ btnMore.style.display = 'none';
57350
+ btnMore.setAttribute('disabled', 'disabled');
57175
57351
  }
57176
57352
  } else {
57177
- this.columnMore.querySelector('.cell-prev').style.display = '';
57178
- this.columnMore.querySelector('.cell-next').style.display = '';
57179
- this.columnMore.querySelector('.cell-up').style.display = '';
57180
- this.columnMore.querySelector('.cell-down').style.display = '';
57181
- if (btnIncrease) btnIncrease.style.display = '';
57182
- if (btnDecrease) btnDecrease.style.display = '';
57183
- this.columnMore.querySelector('.cell-duplicate').style.display = '';
57184
- this.columnMore.querySelector('.cell-prev').removeAttribute('disabled');
57185
- this.columnMore.querySelector('.cell-next').removeAttribute('disabled');
57186
- this.columnMore.querySelector('.cell-up').removeAttribute('disabled');
57187
- this.columnMore.querySelector('.cell-down').removeAttribute('disabled');
57188
- if (btnIncrease) btnIncrease.removeAttribute('disabled');
57189
- if (btnDecrease) btnDecrease.removeAttribute('disabled');
57190
- this.columnMore.querySelector('.cell-duplicate').removeAttribute('disabled');
57191
- let btnColHtml = this.columnMore.querySelector('.cell-html');
57192
- if (btnColHtml) {
57193
- btnColHtml.style.display = '';
57194
- btnColHtml.removeAttribute('disabled');
57195
- }
57196
- this.columnTool.querySelector('.cell-add').style.display = '';
57197
- this.columnTool.querySelector('.cell-remove').style.display = '';
57198
- this.columnTool.querySelector('.cell-add').removeAttribute('disabled');
57199
- this.columnTool.querySelector('.cell-remove').removeAttribute('disabled');
57200
- let row = col.parentNode;
57201
- let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
57202
- if (row.querySelector('.is-row-overlay')) {
57203
- num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
57204
- }
57205
-
57206
- if (row.childElementCount - num === 1) {
57207
- //-num => minus is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
57208
- this.columnMore.querySelector('.cell-prev').style.display = 'none';
57209
- this.columnMore.querySelector('.cell-next').style.display = 'none';
57210
- if (btnIncrease) btnIncrease.style.display = 'none';
57211
- if (btnDecrease) btnDecrease.style.display = 'none';
57212
- this.columnMore.querySelector('.cell-prev').setAttribute('disabled', 'disabled');
57213
- this.columnMore.querySelector('.cell-next').setAttribute('disabled', 'disabled');
57214
- if (btnIncrease) btnIncrease.setAttribute('disabled', 'disabled');
57215
- if (btnDecrease) btnDecrease.setAttribute('disabled', 'disabled');
57216
- } else {
57217
- this.columnMore.querySelector('.cell-prev').style.display = '';
57218
- this.columnMore.querySelector('.cell-next').style.display = '';
57219
- if (btnIncrease) btnIncrease.style.display = '';
57220
- if (btnDecrease) btnDecrease.style.display = '';
57221
- this.columnMore.querySelector('.cell-prev').removeAttribute('disabled');
57222
- this.columnMore.querySelector('.cell-next').removeAttribute('disabled');
57223
- if (btnIncrease) btnIncrease.removeAttribute('disabled');
57224
- if (btnDecrease) btnDecrease.removeAttribute('disabled');
57225
- }
57226
-
57227
- // let btnColHtml = this.columnMore.querySelector('.cell-html');
57228
- let btnColDuplicate = this.columnMore.querySelector('.cell-duplicate');
57229
- if (col.getAttribute('data-html')) {
57230
- if (btnColHtml) {
57231
- btnColHtml.style.display = 'none';
57232
- btnColHtml.setAttribute('disabled', 'disabled');
57233
- }
57234
- if (btnColDuplicate) {
57235
- btnColDuplicate.style.display = 'none';
57236
- btnColDuplicate.setAttribute('disabled', 'disabled');
57237
- }
57238
- } else {
57239
- if (btnColHtml) {
57240
- btnColHtml.style.display = '';
57241
- btnColHtml.removeAttribute('disabled');
57242
- }
57243
- if (btnColDuplicate) {
57244
- btnColDuplicate.style.display = '';
57245
- btnColDuplicate.removeAttribute('disabled');
57246
- }
57247
- }
57248
-
57249
- //data-protected
57250
- /*
57251
- if(row.hasAttribute('data-protected')){
57252
- row.querySelector('.is-row-tool').style.display = 'none';
57253
- this.columnTool.style.display = 'none'; // if row protected, then all column protected
57254
- } else {
57255
- if(row.querySelectorAll('[data-protected]').length>0){
57256
- row.querySelector('.is-row-tool').style.display = 'none';
57257
- } else {
57258
- row.querySelector('.is-row-tool').style.display = '';
57259
- }
57260
- this.columnTool.style.display = '';
57261
- //check columnTool buttons if need to show or hide
57262
- let _protected = dom.parentsHasAttribute(col, 'data-protected');
57263
- if(_protected){
57264
- this.columnTool.querySelector('.cell-add').style.display = 'none';
57265
- this.columnTool.querySelector('.cell-remove').style.display = 'none';
57266
- this.columnTool.querySelector('.cell-more').style.display = 'none';
57267
- } else {
57268
- this.columnTool.querySelector('.cell-add').style.display = '';
57269
- this.columnTool.querySelector('.cell-remove').style.display = '';
57270
- this.columnTool.querySelector('.cell-more').style.display = '';
57271
- }
57272
- }
57273
- */
57353
+ btnAdd.style.display = '';
57354
+ btnRemove.style.display = '';
57355
+ btnAdd.removeAttribute('disabled');
57356
+ btnRemove.removeAttribute('disabled');
57274
57357
  }
57275
-
57276
57358
  let row = col.parentNode;
57277
57359
 
57278
57360
  //data-protected
@@ -57285,42 +57367,22 @@ class ColumnTool {
57285
57367
  rowaddtool.style.display = 'none';
57286
57368
  }
57287
57369
  } else {
57288
- // if(row.querySelectorAll('[data-protected]').length>0){
57289
- // row.querySelector('.is-row-tool').style.display = 'none';
57290
- // } else {
57291
- // row.querySelector('.is-row-tool').style.display = '';
57292
- // }
57293
-
57294
57370
  this.columnTool.style.display = '';
57295
57371
  //check columnTool buttons if need to show or hide
57296
- let _protected = dom.parentsHasAttribute(col, 'data-protected');
57372
+ let _protected = col.closest('[data-protected]');
57297
57373
  if (_protected) {
57298
- this.columnTool.querySelector('.cell-add').style.display = 'none';
57299
- this.columnTool.querySelector('.cell-remove').style.display = 'none';
57300
- this.columnTool.querySelector('.cell-more').style.display = 'none';
57374
+ btnAdd.style.display = 'none';
57375
+ btnRemove.style.display = 'none';
57376
+ btnMore.style.display = 'none';
57301
57377
  } else {
57302
- this.columnTool.querySelector('.cell-add').style.display = '';
57303
- this.columnTool.querySelector('.cell-remove').style.display = '';
57304
- this.columnTool.querySelector('.cell-more').style.display = '';
57378
+ btnAdd.style.display = '';
57379
+ btnRemove.style.display = '';
57380
+ btnMore.style.display = '';
57305
57381
  }
57306
57382
  }
57307
-
57308
- // Column Lock will hide Add & Remove column
57309
57383
  if (col.classList.contains('column-lock')) {
57310
- this.columnTool.querySelector('.cell-add').style.display = 'none';
57311
- this.columnTool.querySelector('.cell-remove').style.display = 'none';
57312
- this.columnMore.querySelector('.cell-prev').style.display = 'none';
57313
- this.columnMore.querySelector('.cell-next').style.display = 'none';
57314
- this.columnMore.querySelector('.cell-up').style.display = 'none';
57315
- this.columnMore.querySelector('.cell-down').style.display = 'none';
57316
- this.columnMore.querySelector('.cell-increase').style.display = 'none';
57317
- this.columnMore.querySelector('.cell-decrease').style.display = 'none';
57318
- this.columnMore.querySelector('.cell-duplicate').style.display = 'none';
57319
- this.columnMore.querySelector('.is-separator').style.display = 'none';
57320
- this.columnMore.querySelector('.cell-locking').style.display = 'none';
57321
- } else {
57322
- this.columnMore.querySelector('.is-separator').style.display = '';
57323
- this.columnMore.querySelector('.cell-locking').style.display = '';
57384
+ btnAdd.style.display = 'none';
57385
+ btnRemove.style.display = 'none';
57324
57386
  }
57325
57387
  }
57326
57388
  }
@@ -62246,8 +62308,10 @@ class ElementTool {
62246
62308
  this.builderStuff = builderStuff;
62247
62309
  const dom = this.builder.dom;
62248
62310
  this.dom = dom;
62249
- const elementPanel = new ElementPanel(builder);
62250
- this.elementPanel = elementPanel;
62311
+ if (!this.builder.controlPanel) {
62312
+ const elementPanel = new ElementPanel(builder);
62313
+ this.elementPanel = elementPanel;
62314
+ }
62251
62315
  let elementTool = builderStuff.querySelector('.is-element-tool');
62252
62316
  let elementMore = builderStuff.querySelector('.elmmore');
62253
62317
  if (!elementTool) {
@@ -62333,7 +62397,35 @@ class ElementTool {
62333
62397
  dom.addClass(quickadd, 'center');
62334
62398
  }
62335
62399
  quickadd.setAttribute('data-mode', 'elm');
62336
- return false;
62400
+
62401
+ //handleQuickAddClickOut
62402
+ const handleQuickAddClickOut = e => {
62403
+ // console.log('handleQuickAddClickOut');
62404
+ let elm = e.target;
62405
+ if (!elm) return;
62406
+ if (!elm.closest('.quickadd') && !elm.closest('.row-add') && !elm.closest('.is-rowadd-tool') && !elm.closest('.cell-add') && !elm.closest('.elm-add') && !elm.closest('.row-add-initial')) {
62407
+ // click outside
62408
+
62409
+ // hide
62410
+ const quickadd = builderStuff.querySelector('.quickadd');
62411
+ util.hidePop(quickadd);
62412
+ // console.log('HIDE');
62413
+
62414
+ // clear events
62415
+ document.removeEventListener('click', handleQuickAddClickOut);
62416
+ if (this.builder.iframeDocument) {
62417
+ this.builder.doc.removeEventListener('click', handleQuickAddClickOut);
62418
+ }
62419
+ this.builder.handleQuickAddClickOut_ = false;
62420
+ }
62421
+ };
62422
+ if (!this.builder.handleQuickAddClickOut_) {
62423
+ document.addEventListener('click', handleQuickAddClickOut);
62424
+ if (this.builder.iframeDocument) {
62425
+ this.builder.doc.addEventListener('click', handleQuickAddClickOut);
62426
+ }
62427
+ this.builder.handleQuickAddClickOut_ = true;
62428
+ }
62337
62429
  });
62338
62430
  const elmRemove = elementTool.querySelector('.elm-remove');
62339
62431
  dom.addEventListener(elmRemove, 'click', () => {
@@ -62558,15 +62650,21 @@ class ElementTool {
62558
62650
 
62559
62651
  const elmSettings = elementTool.querySelector('.elm-settings');
62560
62652
  if (elmSettings) dom.addEventListener(elmSettings, 'click', () => {
62561
- // elementMore.style.display = '';
62562
62653
  util.hidePop(elementMore);
62563
- this.elementPanel.showPanel();
62654
+ if (this.builder.controlPanel) {
62655
+ this.builder.controlpanel.objDialogElement.open();
62656
+ } else {
62657
+ this.elementPanel.showPanel();
62658
+ }
62564
62659
  });
62565
62660
  const elmSettings2 = elementMore.querySelector('.elm-settings');
62566
62661
  if (elmSettings2) dom.addEventListener(elmSettings2, 'click', () => {
62567
- // elementMore.style.display = '';
62568
62662
  util.hidePop(elementMore);
62569
- this.elementPanel.showPanel();
62663
+ if (this.builder.controlPanel) {
62664
+ this.builder.controlpanel.objDialogElement.open();
62665
+ } else {
62666
+ this.elementPanel.showPanel();
62667
+ }
62570
62668
  });
62571
62669
 
62572
62670
  // document.addEventListener('mousedown', (e) => {
@@ -62757,7 +62855,9 @@ class ElementTool {
62757
62855
  // console.log(this.builder.inspectedElement);
62758
62856
  // console.log(this.builder.activeElement);
62759
62857
 
62760
- this.elementPanel.click(e);
62858
+ if (!this.builder.controlPanel) {
62859
+ this.elementPanel.click(e);
62860
+ }
62761
62861
  }
62762
62862
  refresh() {
62763
62863
  if (this.builder.activeElement) {
@@ -62821,6 +62921,7 @@ class ElementTool {
62821
62921
  pos() {
62822
62922
  let elementTool = this.elementTool;
62823
62923
  let elm = this.builder.activeElement;
62924
+ if (!elm) return;
62824
62925
  if (elm.closest('.is-dock')) return;
62825
62926
  let top, left;
62826
62927
  if (!this.builder.iframe) {
@@ -65147,7 +65248,7 @@ class Rte {
65147
65248
  let scale = val / 100;
65148
65249
  this.builder.onZoomEnd(scale);
65149
65250
  }
65150
- }, 300);
65251
+ }, 350);
65151
65252
  };
65152
65253
 
65153
65254
  // Zoom Modal
@@ -66264,7 +66365,7 @@ class Rte {
66264
66365
  // -----------------------------
66265
66366
 
66266
66367
  // Click anywhere will hide Column tool
66267
- this.builder.doc.addEventListener('click', this.builder.doRteClick = e => {
66368
+ if (!this.builder.controlPanel) this.builder.doc.addEventListener('click', this.builder.doRteClick = e => {
66268
66369
  e = e || window.event;
66269
66370
  var target = e.target || e.srcElement;
66270
66371
  if (!this.builderStuff) return; // in case the builder is destroyed
@@ -66344,7 +66445,7 @@ class Rte {
66344
66445
  if (this.builder.toolbarDisplay !== 'auto') {
66345
66446
  this.showDefaultToolbar(); // first time
66346
66447
  }
66347
- }
66448
+ } //contructor
66348
66449
 
66349
66450
  zoomStart() {
66350
66451
  if (this.builder.onZoomStart) {
@@ -67208,6 +67309,7 @@ class Rte {
67208
67309
  });
67209
67310
  }
67210
67311
  showDefaultToolbar() {
67312
+ if (this.builder.controlPanel) return;
67211
67313
  this.elementRteTool.style.display = 'flex';
67212
67314
  this.rteTool.style.display = 'none';
67213
67315
  this.hideAlignButtons();
@@ -70295,7 +70397,8 @@ class Tabs {
70295
70397
  const content = document.querySelector('#' + id);
70296
70398
  content.style.display = 'flex';
70297
70399
  dom$1.addClass(content, 'active');
70298
- document.querySelector('.is-tabs-more').style.display = 'none';
70400
+ const tabMore = document.querySelector('.is-tabs-more');
70401
+ if (tabMore) tabMore.style.display = 'none';
70299
70402
 
70300
70403
  // Close all dropdown
70301
70404
  closeAllDropdowns();
@@ -70929,7 +71032,7 @@ class Resize {
70929
71032
  let moduleWidth = item.offsetWidth / row.offsetWidth * 100;
70930
71033
  item.style.width = moduleWidth + '%';
70931
71034
  item.style.flex = 'none';
70932
- this.builder.util.refreshModuleLayout(item);
71035
+ if (!item.hasAttribute('data-norefresh')) this.builder.util.refreshModuleLayout(item);
70933
71036
  }
70934
71037
  });
70935
71038
  }
@@ -70997,7 +71100,8 @@ class ContentStuff {
70997
71100
  <button title="${util.out('Settings')}" data-title="${util.out('Settings')}" style="width:40px;height:40px;background:none;"><svg class="is-icon-flex"><use xlink:href="#ion-ios-gear"></use></svg></button>
70998
71101
  </div>
70999
71102
  <div class="is-tool is-module-tool">
71000
- <button title="${util.out('Settings')}" data-title="${util.out('Settings')}" style="width:40px;height:40px;"><svg class="is-icon-flex"><use xlink:href="#ion-ios-gear"></use></svg></button>
71103
+ <button class="btn-module-refresh" title="${util.out('Refresh')}" data-title="${util.out('Refresh')}" style="width:40px;height:40px;"><svg class="is-icon-flex"><use xlink:href="#icon-reload"></use></svg></button>
71104
+ <button class="btn-module-settings" title="${util.out('Settings')}" data-title="${util.out('Settings')}" style="width:40px;height:40px;"><svg class="is-icon-flex"><use xlink:href="#ion-ios-gear"></use></svg></button>
71001
71105
  </div>
71002
71106
  <div id="divSpacerTool" class="is-tool is-spacer-tool">
71003
71107
  <button title="${util.out('Decrease')}" data-value="-"><svg class="is-icon-flex"><use xlink:href="#ion-ios-minus-empty"></use></svg></button>
@@ -71137,6 +71241,11 @@ class ContentStuff {
71137
71241
  <path d="M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"></path>
71138
71242
  <path d="M20.2 20.2l1.8 1.8"></path>
71139
71243
  </symbol>
71244
+ <symbol id="icon-reload" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
71245
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
71246
+ <path d="M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1.002 7.935 1.007 9.425 4.747"></path>
71247
+ <path d="M20 4v5h-5"></path>
71248
+ </symbol>
71140
71249
  </defs>
71141
71250
  </svg>
71142
71251
 
@@ -71870,14 +71979,6 @@ class ContentStuff {
71870
71979
  right: auto;
71871
71980
  left: -40px;
71872
71981
  }
71873
- .is-builder.builder-active > div:not(.row-active) {
71874
- border-right: 120px rgba(0, 0, 0, 0) solid;
71875
- margin-right: -120px;
71876
- }
71877
- .is-builder[leftrowtool].builder-active > div:not(.row-active) {
71878
- border-left: 120px rgba(0, 0, 0, 0) solid;
71879
- margin-left: -120px;
71880
- }
71881
71982
  .is-builder[rowoutline] .row-outline {
71882
71983
  outline: none;
71883
71984
  }
@@ -71950,21 +72051,6 @@ class ContentStuff {
71950
72051
  }
71951
72052
 
71952
72053
 
71953
-
71954
-
71955
-
71956
- .is-builder.builder-active > div:not(.row-active) {
71957
- border-right: 120px rgba(0,0,0,0) solid;
71958
- margin-right: -120px;
71959
- }
71960
- .is-builder[leftrowtool].builder-active > div:not(.row-active) {
71961
- border-left: 120px rgba(0,0,0,0) solid;
71962
- margin-left: -120px;
71963
- }
71964
-
71965
-
71966
-
71967
-
71968
72054
  /* Prevent css framework overide (Materialize) */
71969
72055
  .is-ui [type="checkbox"]:not(:checked), .is-ui [type="checkbox"]:checked {
71970
72056
  position: unset !important;
@@ -72014,6 +72100,20 @@ class ContentStuff {
72014
72100
  }
72015
72101
 
72016
72102
 
72103
+ * {
72104
+ scrollbar-width: thin;
72105
+ scrollbar-color: rgba(0, 0, 0, 0.2) auto;
72106
+ }
72107
+ *::-webkit-scrollbar {
72108
+ width: 12px;
72109
+ }
72110
+ *::-webkit-scrollbar-track {
72111
+ background: rgba(200, 200, 200, 0.2);
72112
+ }
72113
+ *::-webkit-scrollbar-thumb {
72114
+ background-color:rgba(0, 0, 0, 0.2);
72115
+ }
72116
+
72017
72117
  ${this.builder.simpleEditingBreakpoint ? `
72018
72118
 
72019
72119
  @media all and (max-width: ${this.builder.simpleEditingBreakpoint}) {
@@ -74004,7 +74104,7 @@ class Dictation {
74004
74104
  </div>
74005
74105
  </div>
74006
74106
  <textarea class="inp-command"></textarea>
74007
- <div style="display:flex;padding-left:3px;">
74107
+ <div style="display:flex;">
74008
74108
  <button title="${util.out('Settings')}" class="cmd-command-config classic-secondary" style="width:40px;height:43px;flex:none;padding:0;outline-offset:-2px;">
74009
74109
  <svg class="is-icon-flex" style="width:15px;height:15px;flex:none;"><use xlink:href="#icon-settings"></use></svg>
74010
74110
  </button>
@@ -74014,7 +74114,7 @@ class Dictation {
74014
74114
  <button title="${util.out('Command Examples')}" class="cmd-command-list classic-secondary" style="width:40px;height:43px;flex:none;padding:0;outline-offset:-2px;">
74015
74115
  <svg class="is-icon-flex" style="width: 18px; height: 18px;"><use xlink:href="#icon-message-search"></use></svg>
74016
74116
  </button>
74017
- <button title="${util.out('Clear')}" class="cmd-clear-command classic-secondary" style="margin-right:6px;width:40px;height:43px;flex:none;padding:0;outline-offset:-2px;">
74117
+ <button title="${util.out('Clear')}" class="cmd-clear-command classic-secondary" style="width:40px;height:43px;flex:none;padding:0;outline-offset:-2px;">
74018
74118
  <svg class="is-icon-flex" style="width: 18px; height: 18px;"><use xlink:href="#icon-eraser"></use></svg>
74019
74119
  </button>
74020
74120
 
@@ -75008,34 +75108,7 @@ class Similarity {
75008
75108
  }
75009
75109
  }
75010
75110
 
75011
- // Experimental
75012
- // import {out} from './out.js';
75013
- class ControlPanel {
75014
- constructor(builder) {
75015
- this.builder = builder;
75016
- this.builderStuff = this.builder.builderStuff;
75017
- /*
75018
- let controlPanel = builderStuff.querySelector('.is-controlpanel');
75019
- if(!controlPanel) {
75020
- let html = `
75021
- <style>
75022
-
75023
- </style>
75024
- <div class="is-controlpanel">
75025
- </div>
75026
- `;
75027
- // const doc = this.builder.doc;
75028
- // document.body.classList.add('controlpanel');
75029
- builderStuff.insertAdjacentHTML('beforeend', html);
75030
- controlPanel = builderStuff.querySelector('.is-controlpanel');
75031
- } else {
75032
- // Means ContentBox
75033
- }
75034
- this.controlPanel = controlPanel;
75035
- // Add ContentBuilder controls
75036
- */
75037
- }
75038
- }
75111
+ // import ControlPanel from './controlpanel.js';
75039
75112
 
75040
75113
  class ContentBuilder {
75041
75114
  constructor(opts = {}) {
@@ -76096,11 +76169,31 @@ class ContentBuilder {
76096
76169
  this.dom.appendChild(document.body, builderStuff);
76097
76170
  }
76098
76171
  this.builderStuff = builderStuff;
76099
- this.controlpanel = new ControlPanel(this);
76100
76172
  prepareSvgIcons(this); // Prepare icons (embed svg definitions for icons)
76101
76173
 
76102
- this.preferences = new Preferences(this); // this will also call setUIColor() and getUIStyles() for theme
76103
-
76174
+ if (!this.controlPanel) this.preferences = new Preferences(this); // this will also call setUIColor() and getUIStyles() for theme
76175
+ else {
76176
+ if (localStorage.getItem('_theme') != null) {
76177
+ const n = localStorage.getItem('_theme');
76178
+ this.themeIndex = n;
76179
+ if (this.themes) {
76180
+ if (this.themes.length > 0) {
76181
+ const item = this.themes[n];
76182
+ if (item) {
76183
+ this.setUIColor(item[1], item[2]);
76184
+ this.renderIframeLater = true;
76185
+ }
76186
+ }
76187
+ }
76188
+ } else {
76189
+ this.setUIColor('', '');
76190
+ this.renderIframeLater = true;
76191
+ }
76192
+ if (!this.renderIframeLater) {
76193
+ // means setUIColor() not called, so we need to call getUIStyles() manually
76194
+ util.getUIStyles();
76195
+ }
76196
+ }
76104
76197
  renderGridEditor(this); // Render Grid Editor
76105
76198
 
76106
76199
  // Check if preview
@@ -76221,55 +76314,36 @@ class ContentBuilder {
76221
76314
  });
76222
76315
  }
76223
76316
 
76317
+ // if(!this.isContentBox && this.controlPanel) {
76318
+ // this.controlpanel = new ControlPanel(this);
76319
+ // }
76320
+
76224
76321
  // Add document Click event
76225
76322
  document.addEventListener('click', this.doDocumentClick = e => {
76226
- e = e || window.event;
76227
- let target = e.target || e.srcElement;
76323
+ let target = e.target;
76228
76324
  if (!target) return;
76229
76325
  let rowClicked;
76230
- if (target.parentNode) rowClicked = this.dom.hasClass(target.parentNode, 'is-builder');
76231
- let containerClicked = this.dom.hasClass(target, 'is-builder');
76232
- let a = false,
76233
- b = false,
76234
- c = false,
76235
- d = false,
76236
- f = false,
76237
- g = false,
76238
- h = false,
76239
- i = false,
76240
- j = false,
76241
- k = false;
76242
- let m = false,
76243
- n = false,
76244
- o = false,
76245
- p = false;
76326
+ if (target.parentNode && target.parentNode.classList) rowClicked = target.parentNode.classList.contains('is-builder');
76327
+ let containerClicked = target.classList.contains('is-builder');
76328
+ let a = target.closest('.is-builder');
76329
+ let p = target.closest('.is-subblock');
76330
+ let b = target.closest('.is-modal') || target.closest('.keep-selection');
76331
+ let c = target.closest('.is-side') || target.closest('.is-sidebar');
76332
+ let d = target.closest('.is-pop');
76333
+ let f = target.closest('.is-tool');
76334
+ let g = target.closest('.is-rte-tool') || target.closest('.is-elementrte-tool');
76335
+ let h = target.closest('.is-rte-pop');
76336
+ let i = target.closest('.row-add-initial');
76337
+ let j = target.closest('.sl-wrapper') || target.closest('.sl-overlay') || target.closest('.sl-close');
76338
+ let k = target.closest('.is-selectbox') || target.closest('.is-selectbox-options');
76246
76339
  let isSpecialElement = false;
76247
- let element = target;
76248
- while (element) {
76249
- if (!element.tagName) break;
76250
- if (element.tagName === 'BODY' || element.tagName === 'HTML') break;
76251
- if (this.dom.hasClass(element, 'is-builder')) a = true;
76252
- if (this.dom.hasClass(element, 'is-subblock')) p = true;
76253
- if (this.dom.hasClass(element, 'is-modal') || this.dom.hasClass(element, 'keep-selection')) b = true;
76254
- if (this.dom.hasClass(element, 'is-side') || this.dom.hasClass(element, 'is-sidebar')) c = true;
76255
- if (this.dom.hasClass(element, 'is-pop')) d = true;
76256
- if (this.dom.hasClass(element, 'is-tool')) f = true;
76257
- if (this.dom.hasClass(element, 'is-rte-tool') || this.dom.hasClass(element, 'is-elementrte-tool')) g = true;
76258
- if (this.dom.hasClass(element, 'is-rte-pop')) h = true;
76259
- if (this.dom.hasClass(element, 'row-add-initial')) i = true;
76260
- if (this.dom.hasClass(element, 'sl-wrapper') || this.dom.hasClass(element, 'sl-overlay') || this.dom.hasClass(element, 'sl-close')) j = true;
76261
- if (this.dom.hasClass(element, 'is-selectbox') || this.dom.hasClass(element, 'is-selectbox-options')) k = true; // dropdown
76262
-
76263
- if (this.opts.specialElementClasses) {
76264
- for (let i = 0; i < this.opts.specialElementClasses.length; i++) {
76265
- if (this.dom.hasClass(element, this.opts.specialElementClasses[i])) isSpecialElement = true;
76266
- }
76340
+ if (this.opts.specialElementClasses) {
76341
+ for (let i = 0; i < this.opts.specialElementClasses.length; i++) {
76342
+ isSpecialElement = target.closest('.' + this.opts.specialElementClasses[i]);
76267
76343
  }
76268
- if (element.id === 'divImageTool') m = true;
76269
- if (element.id === 'divImageResizer') n = true;
76270
- if (this.preserveSelection) o = true;
76271
- element = element.parentNode;
76272
76344
  }
76345
+ let o;
76346
+ if (this.preserveSelection) o = true;
76273
76347
 
76274
76348
  // dropdown
76275
76349
  if (!k) {
@@ -76278,45 +76352,40 @@ class ContentBuilder {
76278
76352
  dropdown.style.display = 'none';
76279
76353
  });
76280
76354
  }
76281
-
76282
- // let a = this.dom.parentsHasClass(target, 'is-builder'); // builder area
76283
- // let b = this.dom.parentsHasClass(target, 'is-modal'); // modal
76284
- // let c = this.dom.parentsHasClass(target, 'is-side'); // side panel
76285
- // let d = this.dom.parentsHasClass(target, 'is-pop'); // pop
76286
- // let f = this.dom.parentsHasClass(target, 'is-tool'); // tool
76287
- // let g = this.dom.parentsHasClass(target, 'is-rte-tool');
76288
- // let h = this.dom.parentsHasClass(target, 'is-rte-pop');
76289
- // let i = this.dom.parentsHasClass(target, 'row-add-initial');
76290
- // let j = this.dom.hasClass(target, 'sl-overlay') ||
76291
- // this.dom.parentsHasClass(target, 'sl-overlay') ||
76292
- // this.dom.hasClass(target, 'sl-close') ||
76293
- // this.dom.parentsHasClass(target, 'sl-close');
76355
+ const clrPicker = document.querySelector('.clr-picker.clr-open');
76356
+ // if(clrPicker) return;
76294
76357
 
76295
76358
  // Image Resizer
76359
+ let n = target.closest('#divImageResizer');
76360
+ if (n) return;
76361
+
76362
+ /*
76363
+ let m = target.closest('#divImageTool');
76364
+
76296
76365
  let resizeProcess = false;
76297
76366
  let imageResizer = document.querySelector('#divImageResizer');
76298
- if (imageResizer) if (imageResizer.getAttribute('data-resized') === '1') resizeProcess = true;
76299
- if (resizeProcess) return; // to prevent unwanted click/clearActiveCell during image resize end.
76300
-
76301
- if (!(b || j || m || n || target.tagName.toLowerCase() === 'img')) {
76302
- let imageTool = document.querySelector('#divImageTool');
76303
- imageTool.style.display = '';
76304
- // this.activeImage = null; // Commented => Additional (to prevent lost focus)
76305
-
76306
- let imageResizer = document.querySelector('#divImageResizer');
76307
- imageResizer.style.display = 'none';
76308
-
76309
- // moveable
76310
- imageResizer.style.top = '-10px';
76311
- imageResizer.style.left = '-10px';
76312
- imageResizer.style.width = '1px';
76313
- imageResizer.style.height = '1px';
76314
- if (this.moveable) {
76315
- this.moveable.updateRect();
76316
- document.querySelector('.moveable-control-box').style.display = 'none';
76317
- }
76367
+ if(imageResizer) if(imageResizer.getAttribute('data-resized')==='1') resizeProcess = true;
76368
+ if(resizeProcess) return; // to prevent unwanted click/clearActiveCell during image resize end.
76369
+ if(!(b||j||m||n||target.tagName.toLowerCase() === 'img')) {
76370
+ let imageTool = document.querySelector('#divImageTool');
76371
+ imageTool.style.display = '';
76372
+ // this.activeImage = null; // Commented => Additional (to prevent lost focus)
76373
+ let imageResizer = document.querySelector('#divImageResizer');
76374
+ imageResizer.style.display = 'none';
76375
+
76376
+ // moveable
76377
+ imageResizer.style.top = '-10px';
76378
+ imageResizer.style.left = '-10px';
76379
+ imageResizer.style.width = '1px';
76380
+ imageResizer.style.height = '1px';
76381
+ if(this.moveable) {
76382
+ this.moveable.updateRect();
76383
+ document.querySelector('.moveable-control-box').style.display = 'none';
76384
+ }
76318
76385
  }
76319
- if (!(a || p || b || c || d || f || g || h || i || j || o || isSpecialElement) || rowClicked && !i || containerClicked) {
76386
+ */
76387
+
76388
+ if (!(a || p || b || c || d || f || g || h || i || j || o || isSpecialElement || clrPicker) || rowClicked && !i || containerClicked) {
76320
76389
  // Click anywhere but is not inside builder area, modal, popup, tool or rte, then clear row/column (cell) selection
76321
76390
 
76322
76391
  if (!this.dom.getSelected()) {
@@ -76327,28 +76396,40 @@ class ContentBuilder {
76327
76396
 
76328
76397
  util.clearActiveCell();
76329
76398
  util.clearControls();
76330
- if (this.toolbarDisplay !== 'auto') {
76399
+ if (!this.controlPanel) if (this.toolbarDisplay !== 'auto') {
76331
76400
  this.rte.showDefaultToolbar();
76332
76401
  }
76333
76402
  if (this.settings.onSelectionChange) this.settings.onSelectionChange(e);
76403
+
76404
+ // if(this.settings.onPageContentClick) this.settings.onPageContentClick(e);
76334
76405
  }
76335
76406
  }
76407
+
76408
+ /*
76336
76409
  this.element.hyperlink.buttonEditor.hide();
76410
+ */
76337
76411
  }
76338
76412
 
76413
+ /*
76339
76414
  // Button Modal
76340
- if (!this.activeLinkButton && !this.activeButton && !target.closest('.buttoneditor') && !target.closest('.link-button-edit') && !target.closest('.is-modal')) {
76341
- this.element.hyperlink.buttonEditor.hide();
76415
+ if(!this.activeLinkButton && !this.activeButton &&
76416
+ !target.closest('.buttoneditor') && !target.closest('.link-button-edit') &&
76417
+ !target.closest('.is-modal')) {
76418
+ this.element.hyperlink.buttonEditor.hide();
76342
76419
  }
76420
+ */
76343
76421
 
76422
+ /*
76344
76423
  // Backward compatibility (for examples)
76345
- if (!d && !this.dom.parentsHasId(target, '_cbhtml')) {
76346
- const pops = document.querySelectorAll('.is-pop');
76347
- Array.prototype.forEach.call(pops, pop => {
76348
- if (!this.dom.parentsHasId(pop, '_cbhtml')) pop.style.display = '';
76349
- });
76424
+ if(!d && !this.dom.parentsHasId(target, '_cbhtml')) {
76425
+ const pops = document.querySelectorAll('.is-pop');
76426
+ Array.prototype.forEach.call(pops, (pop) => {
76427
+ if(!this.dom.parentsHasId(pop, '_cbhtml')) pop.style.display = '';
76428
+ });
76350
76429
  }
76430
+ */
76351
76431
  });
76432
+
76352
76433
  if (this.iframe) {
76353
76434
  this.doc.addEventListener('click', this.doDocumentClick);
76354
76435
  }
@@ -76651,11 +76732,14 @@ class ContentBuilder {
76651
76732
  // let outlineStyle = localStorage.getItem('_outlinestyle');
76652
76733
  // this.preferences.setOutlineStyle(outlineStyle);
76653
76734
  // }
76654
- this.preferences.initBuilder(builder);
76735
+ if (this.preferences) this.preferences.initBuilder(builder);
76655
76736
 
76656
76737
  // Apply behavior on each row
76657
76738
  const rows = this.dom.elementChildren(builder);
76658
76739
  rows.forEach(row => {
76740
+ // The saveForUndo also saves sortable class when start dragging. If Undo is performed, the classes are returned. Cleanup the classes here.
76741
+ row.classList.remove('sortable-ghost');
76742
+ row.classList.remove('sortable-chosen');
76659
76743
  if (this.dom.hasClass(row, 'row-add-initial')) return;
76660
76744
 
76661
76745
  // Hack. If a row has margin left/right specified, don't need to set hidden border (that is used to make smooth sortable)
@@ -76743,7 +76827,11 @@ class ContentBuilder {
76743
76827
  // col.addEventListener('focus', this.handleCellFocus.bind(this, col));
76744
76828
 
76745
76829
  // ON PASTE
76746
- col.addEventListener('paste', this.handleCellPaste.bind(this));
76830
+ // col.addEventListener('paste', this.handleCellPaste.bind(this));
76831
+ col.addEventListener('paste', e => {
76832
+ const clipboardData = (e.clipboardData || window.clipboardData).getData('text');
76833
+ this.handleCellPaste(clipboardData);
76834
+ });
76747
76835
  col.setAttribute('data-click', true);
76748
76836
  }
76749
76837
  });
@@ -76816,8 +76904,23 @@ class ContentBuilder {
76816
76904
  this.util.checkEmpty(); // for multiple instances check
76817
76905
 
76818
76906
  if (this.sortableOnPage) this.sortableOnPage.destroy(); // enable drop as section (ContentBox)
76819
- },
76820
76907
 
76908
+ if (this.controlPanel) {
76909
+ // && document.body.classList.contains('controlpanel') (already opens)
76910
+ this.controlpanel.getActive();
76911
+ this.controlpanel.select('column');
76912
+ setTimeout(() => {
76913
+ // Hide element tool
76914
+ this.elmTool.hide();
76915
+ }, 600);
76916
+ }
76917
+
76918
+ //Trigger Change event
76919
+ this.opts.onChange();
76920
+
76921
+ //Trigger Render event
76922
+ this.opts.onRender();
76923
+ },
76821
76924
  onAdd: evt => {
76822
76925
  var itemEl = evt.item;
76823
76926
  if (itemEl.getAttribute('data-id')) {
@@ -77291,6 +77394,8 @@ class ContentBuilder {
77291
77394
  ok = true;
77292
77395
  } else if (targetAssetType === 'media' && (ext === 'mp4' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif' || ext === 'webm' || ext === 'webp')) {
77293
77396
  ok = true;
77397
+ } else if (targetAssetType === 'all') {
77398
+ ok = true;
77294
77399
  } else {
77295
77400
  if (targetAssetType === 'image') alert(out('Please select an image file.'));
77296
77401
  if (targetAssetType === 'video') alert(out('Please select an mp4 file.'));
@@ -77771,6 +77876,18 @@ class ContentBuilder {
77771
77876
  }
77772
77877
  addButton(pluginName, html, selector, exec) {
77773
77878
  if (!this.builderStuff) return;
77879
+ if (this.controlPanel && this.controlpanel.controlPanel) {
77880
+ const popMore = this.controlpanel.controlPanel.querySelector('.panel-pop.more');
77881
+ const pluginArea = popMore.querySelector('div.plugins');
77882
+ pluginArea.insertAdjacentHTML('beforeend', html);
77883
+ const btn = popMore.querySelector(selector);
77884
+ btn.addEventListener('click', e => {
77885
+ exec(e);
77886
+ });
77887
+ const label = popMore.querySelector('.label-plugins');
77888
+ label.style.display = ''; //show label
77889
+ }
77890
+
77774
77891
  const rteTool = this.builderStuff.querySelector('.is-rte-tool');
77775
77892
  const rteMoreOptions = this.builderStuff.querySelector('.rte-more-options');
77776
77893
  var bUseMore = false;
@@ -77998,16 +78115,16 @@ class ContentBuilder {
77998
78115
  htmlutil.view('full', area);
77999
78116
  }
78000
78117
  viewPreferences() {
78001
- this.preferences.view();
78118
+ if (this.preferences) this.preferences.view();
78002
78119
  }
78003
78120
  viewConfig() {
78004
78121
  //backward
78005
- this.preferences.view();
78122
+ if (this.preferences) this.preferences.view();
78006
78123
  }
78007
78124
  viewZoom() {
78008
78125
  this.rte.viewZoom();
78009
78126
  }
78010
- loadSnippets(snippetFile) {
78127
+ loadSnippets(snippetFile, snippetOpen) {
78011
78128
  if (this.preview) return;
78012
78129
  if (this.opts.snippetList === '#divSnippetList') {
78013
78130
  let snippetPanel = document.querySelector(this.opts.snippetList);
@@ -78025,7 +78142,7 @@ class ContentBuilder {
78025
78142
  this.opts.snippetPath = window._snippets_path;
78026
78143
  }
78027
78144
  if (this.opts.snippetJSON.snippets.length > 0) {
78028
- renderSnippetPanel(this); // Render Snippet Panel
78145
+ renderSnippetPanel(this, snippetOpen); // Render Snippet Panel
78029
78146
  }
78030
78147
  };
78031
78148
 
@@ -78203,9 +78320,6 @@ class ContentBuilder {
78203
78320
  // Font Family
78204
78321
  let iframeRte = this.rte.rteFontFamilyOptions.querySelector('iframe');
78205
78322
  let doc1 = iframeRte.contentWindow.document;
78206
- const fontModal = this.builderStuff.querySelector('.is-modal.pickfontfamily');
78207
- let iframePanel = fontModal.querySelector('iframe');
78208
- let doc2 = iframePanel.contentWindow.document;
78209
78323
 
78210
78324
  // Icons
78211
78325
  let iframeIcons = this.rte.rteIconOptions.querySelector('iframe');
@@ -78221,16 +78335,21 @@ class ContentBuilder {
78221
78335
  } else {
78222
78336
  this.util.refreshFontFamilyStyle1();
78223
78337
  }
78224
- if (doc2.body.innerHTML === '') {
78225
- doc2.open();
78226
- if (!this.opts.emailMode) {
78227
- doc2.write(util.getFontFamilyHTML(true));
78338
+ const fontModal = this.builderStuff.querySelector('.is-modal.pickfontfamily');
78339
+ if (fontModal) {
78340
+ let iframePanel = fontModal.querySelector('iframe');
78341
+ let doc2 = iframePanel.contentWindow.document;
78342
+ if (doc2.body.innerHTML === '') {
78343
+ doc2.open();
78344
+ if (!this.opts.emailMode) {
78345
+ doc2.write(util.getFontFamilyHTML(true));
78346
+ } else {
78347
+ doc2.write(util.getFontFamilyEmail(true));
78348
+ }
78349
+ doc2.close();
78228
78350
  } else {
78229
- doc2.write(util.getFontFamilyEmail(true));
78351
+ this.util.refreshFontFamilyStyle2();
78230
78352
  }
78231
- doc2.close();
78232
- } else {
78233
- this.util.refreshFontFamilyStyle2();
78234
78353
  }
78235
78354
  if (doc3.body.innerHTML === '') {
78236
78355
  doc3.open();
@@ -78502,43 +78621,76 @@ class ContentBuilder {
78502
78621
  util.clearActiveCell();
78503
78622
  this.activeCol = col;
78504
78623
  let elm = e.target;
78505
- this.dom.addClass(col, 'cell-active');
78506
- let row = col.parentNode; //Since a col can be moved to another row, then re-get the active row
78507
- this.dom.addClass(row, 'row-active');
78624
+ col.classList.add('cell-active');
78625
+ let row = col.parentNode;
78626
+ row.classList.add('row-active');
78508
78627
  const builders = this.doc.querySelectorAll(this.opts.container);
78509
- Array.prototype.forEach.call(builders, builder => {
78510
- this.dom.removeClass(builder, 'builder-active');
78628
+ builders.forEach(builder => {
78629
+ builder.classList.remove('builder-active');
78511
78630
  });
78512
- this.dom.addClass(row.parentNode, 'builder-active');
78513
- this.dom.addClass(this.doc.body, 'content-edit');
78631
+ row.parentNode.classList.add('builder-active');
78632
+ this.doc.body.classList.add('content-edit');
78514
78633
  if (row.childElementCount - 2 === 1) ; else {
78515
- this.dom.addClass(row, 'row-outline');
78634
+ row.classList.add('row-outline');
78516
78635
  }
78517
78636
 
78518
- //this.getState();
78519
-
78520
78637
  // Call onContentClick to indicate click on editable content (eg. for plugin usage)
78521
- // if (!col.hasAttribute('data-html')) {
78522
78638
  if (this.opts.onContentClick) this.opts.onContentClick(e);
78523
- // }
78524
-
78525
78639
  this.element.click(col, e);
78526
78640
  this.colTool.click(col);
78527
78641
  this.elmTool.click(col, e);
78528
- this.rte.click(col, e);
78642
+ if (!this.controlPanel) this.rte.click(col, e);else this.util.saveSelection(); // important (eg. for create/edit link)
78643
+
78644
+ /*
78645
+ // TODO: move to grideditor.js
78529
78646
  // Grid Editor Status
78530
78647
  // On/off lock button
78531
78648
  const grideditor = document.querySelector('.grideditor.active');
78532
- if (grideditor) {
78533
- const btnCellLocking = grideditor.querySelector('.cell-locking');
78534
- if (col.hasAttribute('data-noedit')) {
78535
- this.dom.addClass(btnCellLocking, 'on');
78536
- } else {
78537
- this.dom.removeClass(btnCellLocking, 'on');
78649
+ if(grideditor) {
78650
+ const btnCellLocking = grideditor.querySelector('.cell-locking');
78651
+ if(col.hasAttribute('data-noedit')) {
78652
+ btnCellLocking.classList.add('on');
78653
+ } else {
78654
+ btnCellLocking.classList.remove('on');
78655
+ }
78656
+ }
78657
+ */
78658
+
78659
+ // If column only has spacer, locked or unlocked,
78660
+ // the text should not be able to edit (cursor should not be able to be placed)
78661
+ // So, make the column uneditable (text) if only has a spacer.
78662
+ if (col.childElementCount === 1) {
78663
+ let elm = col.children[0];
78664
+ if (elm) if (this.dom.hasClass(elm, 'spacer')) {
78665
+ col.contentEditable = false;
78538
78666
  }
78539
78667
  }
78540
- let link = this.dom.getParentElement(elm, 'a');
78541
- if (elm.tagName.toLowerCase() === 'a' || link) {
78668
+
78669
+ // Show Lock Indicator
78670
+ this.colTool.showHideLockIndicator(col);
78671
+ if (this.opts.enableDragResize) {
78672
+ if (this.resize) {
78673
+ // console.log(this.resize);
78674
+ this.resize.destroy(); // destroy previous instance
78675
+ }
78676
+
78677
+ // Enable resizable on click
78678
+ if (!col.classList.contains('noresize')) {
78679
+ // Disable on mobile
78680
+ const viewportWidth = this.doc.body.clientWidth;
78681
+ if (viewportWidth > 768) {
78682
+ this.resize = new Resize(col, this);
78683
+ this.resize.enable();
78684
+ }
78685
+ }
78686
+ }
78687
+ if (this.settings.onSelectionChange) this.settings.onSelectionChange(e);
78688
+
78689
+ // if(this.settings.onPageContentClick) this.settings.onPageContentClick(e);
78690
+
78691
+ // Lightbox
78692
+ let link = elm.closest('a');
78693
+ if (link) {
78542
78694
  if (col.hasAttribute('data-noedit') || col.hasAttribute('data-protected')) {
78543
78695
  // Link & Lightbox click allowed only on locked column
78544
78696
 
@@ -78606,25 +78758,6 @@ class ContentBuilder {
78606
78758
  // return false;
78607
78759
  }
78608
78760
 
78609
- // LATER: (builder inside builder)
78610
- // if (jQuery(e.target).parents('.is-builder').length>1) {
78611
- // e.preventDefault();
78612
- // e.stopImmediatePropagation();
78613
- // }
78614
-
78615
- // If column only has spacer, locked or unlocked,
78616
- // the text should not be able to edit (cursor should not be able to be placed)
78617
- // So, make the column uneditable (text) if only has a spacer.
78618
- if (col.childElementCount === 1) {
78619
- let elm = col.children[0];
78620
- if (elm) if (this.dom.hasClass(elm, 'spacer')) {
78621
- col.contentEditable = false;
78622
- }
78623
- }
78624
-
78625
- // Show Lock Indicator
78626
- this.colTool.showHideLockIndicator(col);
78627
-
78628
78761
  // Extra: Check if last row, make sure the Row Add Tool visible
78629
78762
  const tool = row.querySelector('.is-rowadd-tool');
78630
78763
  const tollAddButton = tool.querySelector('button');
@@ -78647,23 +78780,6 @@ class ContentBuilder {
78647
78780
  }
78648
78781
  }
78649
78782
  }
78650
- if (this.opts.enableDragResize) {
78651
- if (this.resize) {
78652
- // console.log(this.resize);
78653
- this.resize.destroy(); // destroy previous instance
78654
- }
78655
-
78656
- // Enable resizable on click
78657
- if (!col.classList.contains('noresize')) {
78658
- // Disable on mobile
78659
- const viewportWidth = this.doc.body.clientWidth;
78660
- if (viewportWidth > 768) {
78661
- this.resize = new Resize(col, this);
78662
- this.resize.enable();
78663
- }
78664
- }
78665
- }
78666
- if (this.settings.onSelectionChange) this.settings.onSelectionChange(e);
78667
78783
  }
78668
78784
  handleCellKeypress(e) {
78669
78785
  if (e.ctrlKey || e.metaKey) {
@@ -78712,10 +78828,7 @@ class ContentBuilder {
78712
78828
  // });
78713
78829
  // this.autoclean=true;
78714
78830
 
78715
- if ((e.ctrlKey || e.metaKey) && e.which === 86) {
78716
- //CTRL-V
78717
- this.handleCellPaste();
78718
- }
78831
+ if ((e.ctrlKey || e.metaKey) && e.which === 86) ;
78719
78832
  if (this.opts.elementSelection && !this.emailMode) {
78720
78833
  if ((e.ctrlKey || e.metaKey) && e.which === 65) {
78721
78834
  //CTRL-A
@@ -79171,7 +79284,7 @@ class ContentBuilder {
79171
79284
  this.opts.onChange();
79172
79285
  }, 2000);
79173
79286
  }
79174
- handleCellPaste() {
79287
+ handleCellPaste(clipboardData) {
79175
79288
  this.uo.saveForUndo();
79176
79289
  const util = this.util;
79177
79290
  util.saveSelection(); //required. Without this, CTRL-A (select element) & CTRL-V won't replace the element, but will paste at the end of the element.
@@ -79230,22 +79343,26 @@ class ContentBuilder {
79230
79343
  }
79231
79344
  if (!bPasteObject) {
79232
79345
  if (this.opts.paste === 'text') {
79346
+ /*
79233
79347
  let elms = contentword.querySelectorAll('p,h1,h2,h3,h4,h5,h6');
79234
- Array.prototype.forEach.call(elms, elm => {
79235
- elm.innerHTML = elm.innerHTML + ' '; //add space (&nbsp;)
79348
+ Array.prototype.forEach.call(elms, (elm) => {
79349
+ elm.innerHTML = elm.innerHTML + ' '; //add space (&nbsp;)
79236
79350
  });
79237
-
79238
- // sPastedText = contentword.innerText;
79351
+ // sPastedText = contentword.innerText;
79239
79352
  sPastedText = contentword.innerHTML;
79240
- sPastedText = sPastedText.replace(/(<([^>]+)>)/ig, '<br>');
79353
+ sPastedText = sPastedText.replace(/(<([^>]+)>)/ig,'<br>');
79241
79354
  sPastedText = sPastedText.replace(/(<br\s*\/?>){3,}/gi, '<br>');
79242
- if (sPastedText.indexOf('<br>') === 0) {
79243
- sPastedText = sPastedText.substring(4);
79355
+ if(sPastedText.indexOf('<br>')===0) {
79356
+ sPastedText = sPastedText.substring(4);
79244
79357
  }
79245
- if (sPastedText.substring(sPastedText.length - 4) === '<br>') {
79246
- sPastedText = sPastedText.substring(0, sPastedText.length - 4);
79358
+ if(sPastedText.substring(sPastedText.length-4)==='<br>'){
79359
+ sPastedText = sPastedText.substring(0, sPastedText.length-4);
79247
79360
  }
79248
79361
  sPastedText = sPastedText.trim();
79362
+ */
79363
+
79364
+ sPastedText = clipboardData;
79365
+ // sPastedText = sPastedText.replace(/(?:\r\n|\r|\n)/g, '<br>');
79249
79366
  } else {
79250
79367
  sPastedText = contentword.innerHTML;
79251
79368
  if (this.opts.paste === 'html') {
@@ -79574,7 +79691,8 @@ class ContentBuilder {
79574
79691
  // </div>
79575
79692
  // `;
79576
79693
  itemEl.outerHTML = this.settings.sectionTemplate.replace('[%CONTENT%]', itemEl.outerHTML);
79577
- if (this.opts.onSectionAdd) this.opts.onSectionAdd();
79694
+ this.activeCol = null;
79695
+ if (this.opts.onBlockSectionAdd) this.opts.onBlockSectionAdd();
79578
79696
 
79579
79697
  // //Trigger Change event
79580
79698
  // this.opts.onChange();
@@ -79708,7 +79826,9 @@ class ContentBuilder {
79708
79826
  }
79709
79827
  // // After snippet has been added, re-apply behavior on builder areas
79710
79828
  // this.applyBehaviorOn(builder);
79711
- if (this.opts.onSectionAdd) this.opts.onSectionAdd();
79829
+
79830
+ this.activeCol = null;
79831
+ if (this.opts.onBlockSectionAdd) this.opts.onBlockSectionAdd();
79712
79832
 
79713
79833
  //Trigger Change event
79714
79834
  this.opts.onChange();
@@ -79727,17 +79847,18 @@ class ContentBuilder {
79727
79847
  }
79728
79848
  }
79729
79849
  hideElementTools() {
79730
- let elmTool = document.querySelector('.is-element-tool');
79731
- let divImageTool = document.querySelector('#divImageTool');
79732
- let divImageResizer = document.querySelector('#divImageResizer');
79733
- if (divImageTool) if (divImageTool.style.display === 'flex') {
79734
- if (this.editor.moveable) this.editor.moveable.updateRect();
79735
- let controlBox = this.doc.querySelector('.moveable-control-box');
79736
- if (controlBox) controlBox.style.display = 'none';
79737
- }
79850
+ let elmTool = this.doc.querySelector('.is-element-tool');
79738
79851
  if (elmTool) elmTool.style.display = '';
79739
- if (divImageTool) divImageTool.style.display = '';
79740
- if (divImageResizer) divImageResizer.style.display = '';
79852
+ let linkTool = this.doc.querySelector('#divLinkTool');
79853
+ if (linkTool) linkTool.style.display = '';
79854
+ this.element.image.hideImageTool();
79855
+ this.doc.querySelectorAll('.icon-active').forEach(elm => elm.classList.remove('icon-active'));
79856
+ this.doc.querySelectorAll('.elm-inspected').forEach(elm => elm.classList.remove('elm-inspected'));
79857
+ this.doc.querySelectorAll('.elm-active').forEach(elm => elm.classList.remove('elm-active'));
79858
+ this.activeImage = null;
79859
+ this.activeIcon = null;
79860
+ this.inspectedElement = null;
79861
+ this.activeElement = null;
79741
79862
  }
79742
79863
  }
79743
79864