@innovastudio/contentbox 1.6.168 → 1.6.171

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2395,16 +2395,25 @@ class SideBar {
2395
2395
  const imageObserver = new IntersectionObserver((entries, imgObserver) => {
2396
2396
  entries.forEach((entry) => {
2397
2397
  if (entry.isIntersecting) {
2398
- const lazyImage = entry.target
2399
- // console.log("lazy loading ", lazyImage)
2400
- lazyImage.src = lazyImage.dataset.src
2401
- lazyImage.classList.remove("lzy-img");
2402
- imgObserver.unobserve(lazyImage);
2398
+ try {
2399
+ const lazyImage = entry.target
2400
+ // console.log("lazy loading ", lazyImage)
2401
+ lazyImage.src = lazyImage.dataset.src
2402
+ lazyImage.classList.remove("lzy-img");
2403
+ imgObserver.unobserve(lazyImage);
2404
+ } catch(e) {
2405
+ console.error('Image loading error:', e);
2406
+ imgObserver.unobserve(entry.target);
2407
+ }
2403
2408
  }
2404
2409
  })
2410
+ }, {
2411
+ rootMargin: '50px'
2405
2412
  });
2406
2413
 
2407
- const makeid = () => { //http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript
2414
+ let renderTimeout = null;
2415
+
2416
+ const makeid = () => {
2408
2417
  var text = "";
2409
2418
  var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
2410
2419
  for (var i = 0; i < 2; i++)
@@ -2588,7 +2597,17 @@ class SideBar {
2588
2597
  });
2589
2598
  });
2590
2599
  }
2591
-
2600
+
2601
+ // Setup single event listener for all design buttons (prevents memory leak)
2602
+ const designList = document.querySelector('.is-design-list');
2603
+ designList.addEventListener('click', (e) => {
2604
+ const btn = e.target.closest('button[data-id]');
2605
+ if (btn) {
2606
+ const designid = btn.getAttribute('data-id');
2607
+ addDesign(designid);
2608
+ }
2609
+ });
2610
+
2592
2611
  const showDesigns = (catId, designId) => {
2593
2612
 
2594
2613
  if(template_list.length>0) {
@@ -2597,8 +2616,16 @@ class SideBar {
2597
2616
  }
2598
2617
 
2599
2618
  const designList = document.querySelector('.is-design-list');
2619
+
2620
+ // Unobserve old images to prevent memory leak
2621
+ const oldImages = designList.querySelectorAll('img.lzy-img');
2622
+ oldImages.forEach(img => imageObserver.unobserve(img));
2623
+
2624
+ // Cancel any pending render
2625
+ if (renderTimeout) clearTimeout(renderTimeout);
2626
+
2600
2627
  designList.style.opacity = 0;
2601
- setTimeout(()=>{
2628
+ renderTimeout = setTimeout(()=>{
2602
2629
  designList.innerHTML = '';
2603
2630
  designList.style.opacity = 1;
2604
2631
  designList.scrollTop = 0;
@@ -2637,54 +2664,24 @@ class SideBar {
2637
2664
  if(slider==='glide') {
2638
2665
  if(item.type === 'glide') {
2639
2666
  designList.insertAdjacentHTML('beforeend', html);
2640
- const btn = designList.querySelector('[data-id="' + item.id + '"]');
2641
- btn.addEventListener('click', (e)=>{
2642
- const designid = btn.getAttribute('data-id');
2643
- addDesign(designid);
2644
- });
2645
2667
  }
2646
2668
  } else if(slider==='slick') {
2647
2669
  if(item.type === 'slick') {
2648
2670
  designList.insertAdjacentHTML('beforeend', html);
2649
- const btn = designList.querySelector('[data-id="' + item.id + '"]');
2650
- btn.addEventListener('click', (e)=>{
2651
- const designid = btn.getAttribute('data-id');
2652
- addDesign(designid);
2653
- });
2654
2671
  }
2655
2672
  } else if(slider==='all') {
2656
2673
  designList.insertAdjacentHTML('beforeend', html);
2657
- const btn = designList.querySelector('[data-id="' + item.id + '"]');
2658
- btn.addEventListener('click', (e)=>{
2659
- const designid = btn.getAttribute('data-id');
2660
- addDesign(designid);
2661
- });
2662
2674
  }
2663
2675
  } else if(item.type === 'navbar' ) {
2664
2676
  if(navbar) {
2665
2677
  designList.insertAdjacentHTML('beforeend', html);
2666
- const btn = designList.querySelector('[data-id="' + item.id + '"]');
2667
- btn.addEventListener('click', (e)=>{
2668
- const designid = btn.getAttribute('data-id');
2669
- addDesign(designid);
2670
- });
2671
2678
  }
2672
2679
  } else if(item.type === 'canvas' ) {
2673
2680
  if(canvas) {
2674
2681
  designList.insertAdjacentHTML('beforeend', html);
2675
- const btn = designList.querySelector('[data-id="' + item.id + '"]');
2676
- btn.addEventListener('click', (e)=>{
2677
- const designid = btn.getAttribute('data-id');
2678
- addDesign(designid);
2679
- });
2680
2682
  }
2681
2683
  } else {
2682
2684
  designList.insertAdjacentHTML('beforeend', html);
2683
- const btn = designList.querySelector('[data-id="' + item.id + '"]');
2684
- btn.addEventListener('click', (e)=>{
2685
- const designid = btn.getAttribute('data-id');
2686
- addDesign(designid);
2687
- });
2688
2685
  }
2689
2686
  }`;
2690
2687
  html += `
@@ -8807,6 +8804,7 @@ class Text {
8807
8804
  // Get element block (eg. h1, h2, p, div, ..) that is under the column (column's child)
8808
8805
  let activeColumn = this.builder.controlpanel.activeColumn;
8809
8806
  let elm = this.getElm();
8807
+ if (!activeColumn) activeColumn = elm.parentNode;
8810
8808
  let children = this.elementChildren(activeColumn);
8811
8809
  let elmBlock;
8812
8810
  children.forEach(item => {
@@ -8870,15 +8868,30 @@ class Text {
8870
8868
  activeColumn.querySelectorAll('.grow').forEach(elm => elm.classList.remove('grow'));
8871
8869
  }
8872
8870
 
8871
+ cleanColorClasses(elm) {
8872
+ elm.classList.remove('text-gray-50');
8873
+ elm.classList.remove('text-gray-100');
8874
+ elm.classList.remove('text-gray-200');
8875
+ elm.classList.remove('text-gray-300');
8876
+ elm.classList.remove('text-gray-400');
8877
+ elm.classList.remove('text-gray-500');
8878
+ elm.classList.remove('text-gray-600');
8879
+ elm.classList.remove('text-gray-700');
8880
+ elm.classList.remove('text-gray-800');
8881
+ elm.classList.remove('text-gray-900');
8882
+ }
8883
+
8873
8884
  setTextColor(color) {
8874
8885
  let elm = this.getElm();
8875
8886
  const text = this.getSelectedText();
8876
8887
 
8877
8888
  if (text.trim() === '') {
8878
8889
  elm.style.color = color;
8890
+ this.cleanColorClasses(elm);
8879
8891
  } else {
8880
8892
  if (elm.innerText === text) {
8881
8893
  elm.style.color = color;
8894
+ this.cleanColorClasses(elm);
8882
8895
  } else {
8883
8896
  this.builder.doc.execCommand('ForeColor', false, color); //Cleanup FONTs
8884
8897
 
@@ -8913,48 +8926,55 @@ class Text {
8913
8926
 
8914
8927
  setAction(command, onFinish) {
8915
8928
  let activeColumn = this.builder.controlpanel.activeColumn;
8916
- let spans = activeColumn.querySelectorAll('span');
8917
- Array.prototype.forEach.call(spans, span => {
8918
- span.setAttribute('data-keep', '1');
8919
- if (span.style.cssText) span.setAttribute('data-style', span.style.cssText);
8920
- });
8929
+
8930
+ if (activeColumn) {
8931
+ let spans = activeColumn.querySelectorAll('span');
8932
+ Array.prototype.forEach.call(spans, span => {
8933
+ span.setAttribute('data-keep', '1');
8934
+ if (span.style.cssText) span.setAttribute('data-style', span.style.cssText);
8935
+ });
8936
+ }
8937
+
8921
8938
  setTimeout(() => {
8922
8939
  this.builder.doc.execCommand(command, false, null);
8923
8940
  activeColumn = this.builder.controlpanel.activeColumn;
8924
- spans = activeColumn.querySelectorAll('span');
8925
- Array.prototype.forEach.call(spans, span => {
8926
- let attr = span.getAttribute('data-keep');
8927
8941
 
8928
- if (attr) {
8929
- // span.removeAttribute('data-keep');
8930
- let cssText = span.getAttribute('data-style');
8931
- if (cssText) span.style.cssText = cssText;
8932
- span.removeAttribute('data-style');
8933
- }
8934
- });
8935
- spans = activeColumn.querySelectorAll('span');
8936
- Array.prototype.forEach.call(spans, span => {
8937
- let attr = span.getAttribute('data-keep');
8942
+ if (activeColumn) {
8943
+ let spans = activeColumn.querySelectorAll('span');
8944
+ Array.prototype.forEach.call(spans, span => {
8945
+ let attr = span.getAttribute('data-keep');
8938
8946
 
8939
- if (!attr) {
8940
- span.outerHTML = span.innerHTML;
8941
- }
8942
- });
8943
- spans = activeColumn.querySelectorAll('span');
8944
- Array.prototype.forEach.call(spans, span => {
8945
- let attr = span.getAttribute('data-keep');
8947
+ if (attr) {
8948
+ // span.removeAttribute('data-keep');
8949
+ let cssText = span.getAttribute('data-style');
8950
+ if (cssText) span.style.cssText = cssText;
8951
+ span.removeAttribute('data-style');
8952
+ }
8953
+ });
8954
+ spans = activeColumn.querySelectorAll('span');
8955
+ Array.prototype.forEach.call(spans, span => {
8956
+ let attr = span.getAttribute('data-keep');
8946
8957
 
8947
- if (attr) {
8948
- span.removeAttribute('data-keep');
8949
- }
8950
- }); // clean
8951
- // let elms = activeColumn.querySelectorAll('ul,p');
8952
- // Array.prototype.forEach.call(elms, (elm) => {
8953
- // let text = elm.innerHTML.trim();
8954
- // if(text==='') {
8955
- // elm.parentNode.removeChild(elm);
8956
- // }
8957
- // });
8958
+ if (!attr) {
8959
+ span.outerHTML = span.innerHTML;
8960
+ }
8961
+ });
8962
+ spans = activeColumn.querySelectorAll('span');
8963
+ Array.prototype.forEach.call(spans, span => {
8964
+ let attr = span.getAttribute('data-keep');
8965
+
8966
+ if (attr) {
8967
+ span.removeAttribute('data-keep');
8968
+ }
8969
+ }); // clean
8970
+ // let elms = activeColumn.querySelectorAll('ul,p');
8971
+ // Array.prototype.forEach.call(elms, (elm) => {
8972
+ // let text = elm.innerHTML.trim();
8973
+ // if(text==='') {
8974
+ // elm.parentNode.removeChild(elm);
8975
+ // }
8976
+ // });
8977
+ }
8958
8978
 
8959
8979
  let elm = this.getElm();
8960
8980
  const ul = elm.closest('ul,ol');
@@ -10321,12 +10341,17 @@ class Text {
10321
10341
  const anchorNode = selection.anchorNode;
10322
10342
  if (!anchorNode) return false;
10323
10343
  let container = anchorNode.nodeType !== Node.TEXT_NODE && anchorNode.nodeType !== Node.COMMENT_NODE ? anchorNode : anchorNode.parentElement;
10344
+
10345
+ if (container && container.closest('.is-overlay') && this.builder.controlpanel.activeElement && !container.closest('[data-cb-type]')) {
10346
+ return this.builder.controlpanel.activeElement; // container => is-overlay when drag & drop bloxk
10347
+ }
10324
10348
  /*
10325
10349
  There is a strange behavior that when clicking an icon i.icon and then clicking its div wrapper,
10326
10350
  the window.getSelection stays on the icon, not the div.
10327
10351
  To fix this, we check icon selection and compare it with the actual clicked element
10328
10352
  */
10329
10353
 
10354
+
10330
10355
  if (container && container.classList.contains('icon') && this.builder.editor.inspectedElement) {
10331
10356
  if (container !== this.builder.editor.inspectedElement) {
10332
10357
  container = this.builder.editor.inspectedElement;
@@ -11161,14 +11186,16 @@ class PanelText {
11161
11186
  this.panel.querySelectorAll('[data-justify]').forEach(elm => elm.classList.remove('on'));
11162
11187
  let activeColumn = this.builder.controlpanel.activeColumn;
11163
11188
 
11164
- if (activeColumn.classList.contains('justify-start')) {
11165
- this.panel.querySelector('[data-justify=justify-start]').classList.add('on');
11166
- } else if (activeColumn.classList.contains('justify-center')) {
11167
- this.panel.querySelector('[data-justify=justify-center]').classList.add('on');
11168
- } else if (activeColumn.classList.contains('justify-end')) {
11169
- this.panel.querySelector('[data-justify=justify-end]').classList.add('on');
11170
- } else if (activeColumn.classList.contains('justify-between')) {
11171
- this.panel.querySelector('[data-justify=justify-between]').classList.add('on');
11189
+ if (activeColumn) {
11190
+ if (activeColumn.classList.contains('justify-start')) {
11191
+ this.panel.querySelector('[data-justify=justify-start]').classList.add('on');
11192
+ } else if (activeColumn.classList.contains('justify-center')) {
11193
+ this.panel.querySelector('[data-justify=justify-center]').classList.add('on');
11194
+ } else if (activeColumn.classList.contains('justify-end')) {
11195
+ this.panel.querySelector('[data-justify=justify-end]').classList.add('on');
11196
+ } else if (activeColumn.classList.contains('justify-between')) {
11197
+ this.panel.querySelector('[data-justify=justify-between]').classList.add('on');
11198
+ }
11172
11199
  }
11173
11200
 
11174
11201
  if (!document.body.classList.contains('controlpanel')) return;
@@ -11232,6 +11259,13 @@ class PanelText {
11232
11259
  } catch (e) {// Do Nothing
11233
11260
  }
11234
11261
 
11262
+ if (activeElement.closest('[data-cb-type]')) {
11263
+ btnPlacementText.style.display = 'none';
11264
+ btnPlacementText.setAttribute('aria-expanded', 'false');
11265
+ btnPlacementText.nextElementSibling.style.display = 'none';
11266
+ btnPlacementText.nextElementSibling.setAttribute('aria-hidden', 'true');
11267
+ }
11268
+
11235
11269
  const config = this.builder.cssClasses;
11236
11270
  let elm = this.text.getElm();
11237
11271
  this.panel.querySelector('button[data-format=uppercase]').classList.remove('on');
@@ -12252,9 +12286,14 @@ class PanelSpacer {
12252
12286
  });
12253
12287
  let html = `
12254
12288
  <div class="submain">
12255
- <div class="label mt-0">${out('Height')}:</div>
12289
+ <div class="label mt-2 changedevice" style="width:222px;">
12290
+ <span>${out('Height')}: &nbsp;<span class="val-box-size"></span></span>
12291
+ <button title="${out('Change Device')}" class="btn-device"><svg style="width:13px;height:13px;"><use xlink:href="#icon-devices"></use></svg></button>
12292
+ </div>
12293
+
12256
12294
  <div class="group fontsizes">
12257
12295
  ${spacerHtml}
12296
+ <button title="${out('Clear')}" data-spacer=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
12258
12297
  </div>
12259
12298
  </div>
12260
12299
  `;
@@ -12265,10 +12304,61 @@ class PanelSpacer {
12265
12304
  btn.addEventListener('click', () => {
12266
12305
  const val = btn.getAttribute('data-spacer');
12267
12306
  let spacer = this.builder.controlpanel.activeElement;
12268
- spacerList.forEach(val => spacer.classList.remove(`height-${val}`));
12269
- spacer.classList.add(`height-${val}`);
12270
12307
  btns.forEach(elm => elm.classList.remove('on'));
12271
12308
  btn.classList.add('on');
12309
+ let prefix = '';
12310
+ let screenMode = this.builder.screenMode;
12311
+
12312
+ if (screenMode === 'desktop') {
12313
+ prefix = '';
12314
+ } else if (screenMode === 'tablet-landscape') {
12315
+ prefix = 'md-';
12316
+ } else if (screenMode === 'tablet') {
12317
+ prefix = 'sm-';
12318
+ } else if (screenMode === 'mobile') {
12319
+ prefix = 'xs-';
12320
+ }
12321
+
12322
+ if (this.builder.doc.body.hasAttribute('data-breakpoint')) {
12323
+ const breakpoint = this.builder.doc.body.getAttribute('data-breakpoint');
12324
+
12325
+ if (breakpoint <= 760) {
12326
+ prefix = 'xs-';
12327
+ } else if (760 < breakpoint && breakpoint <= 970) {
12328
+ prefix = 'sm-';
12329
+ } else if (970 < breakpoint && breakpoint <= 1280) {
12330
+ prefix = 'md-';
12331
+ } else if (1280 < breakpoint && breakpoint <= 1920) {
12332
+ prefix = '';
12333
+ } else {
12334
+ // 1920<breakpoint
12335
+ prefix = '';
12336
+ }
12337
+ }
12338
+
12339
+ if (val !== '') {
12340
+ // Clear
12341
+ spacer.classList.forEach(item => {
12342
+ if (prefix === '' && item.startsWith('height-')) {
12343
+ spacer.classList.remove(item);
12344
+ }
12345
+
12346
+ if (prefix === 'md-' && item.startsWith('md-')) spacer.classList.remove(item);
12347
+ if (prefix === 'sm-' && item.startsWith('sm-')) spacer.classList.remove(item);
12348
+ if (prefix === 'xs-' && item.startsWith('xs-')) spacer.classList.remove(item);
12349
+ });
12350
+ spacer.classList.add(prefix + 'height-' + val);
12351
+ } else {
12352
+ // Clear
12353
+ spacer.classList.forEach(item => {
12354
+ if (prefix === 'md-' && item.startsWith('md-')) spacer.classList.remove(item);
12355
+ if (prefix === 'sm-' && item.startsWith('sm-')) spacer.classList.remove(item);
12356
+ if (prefix === 'xs-' && item.startsWith('xs-')) spacer.classList.remove(item);
12357
+ });
12358
+ }
12359
+
12360
+ this.getState();
12361
+ this.builder.editor.hideElementTools();
12272
12362
  });
12273
12363
  });
12274
12364
  }
@@ -12286,16 +12376,65 @@ class PanelSpacer {
12286
12376
  }
12287
12377
 
12288
12378
  getState() {
12379
+ this.getStateTargeted();
12380
+ }
12381
+
12382
+ getStateTargeted() {
12289
12383
  let spacer = this.builder.controlpanel.activeElement;
12290
12384
  const panel = this.panel;
12385
+ let prefix = '';
12386
+ let screenMode = this.builder.screenMode;
12387
+
12388
+ if (screenMode === 'desktop') {
12389
+ prefix = '';
12390
+ } else if (screenMode === 'tablet-landscape') {
12391
+ prefix = 'md-';
12392
+ } else if (screenMode === 'tablet') {
12393
+ prefix = 'sm-';
12394
+ } else if (screenMode === 'mobile') {
12395
+ prefix = 'xs-';
12396
+ }
12397
+
12398
+ if (this.builder.doc.body.hasAttribute('data-breakpoint')) {
12399
+ const breakpoint = parseInt(this.builder.doc.body.getAttribute('data-breakpoint'));
12400
+
12401
+ if (breakpoint <= 760) {
12402
+ prefix = 'xs-';
12403
+ } else if (760 < breakpoint && breakpoint <= 970) {
12404
+ prefix = 'sm-';
12405
+ } else if (970 < breakpoint && breakpoint <= 1280) {
12406
+ prefix = 'md-';
12407
+ } else if (1280 < breakpoint && breakpoint <= 1920) {
12408
+ prefix = '';
12409
+ } else {
12410
+ // 1920<breakpoint
12411
+ prefix = '';
12412
+ }
12413
+ }
12414
+
12291
12415
  const btns = panel.querySelectorAll('[data-spacer]');
12292
- spacer.classList.forEach(item => {
12293
- if (item.indexOf('height-') !== -1) {
12294
- let val = item.replace('height-', '');
12416
+ if (spacer) spacer.classList.forEach(item => {
12417
+ let val;
12418
+ if (prefix === '' && item.startsWith('height-')) val = item.replace('height-', '');
12419
+ if (prefix === 'md-' && item.startsWith('md-')) val = item.replace('md-height-', '');
12420
+ if (prefix === 'sm-' && item.startsWith('sm-')) val = item.replace('sm-height-', '');
12421
+ if (prefix === 'xs-' && item.startsWith('xs-')) val = item.replace('xs-height-', '');
12422
+
12423
+ if (val) {
12424
+ panel.querySelector('.val-box-size').innerHTML = val === 'none' ? '' : val;
12295
12425
  btns.forEach(elm => elm.classList.remove('on'));
12296
12426
  panel.querySelector(`[data-spacer="${val}"]`).classList.add('on');
12297
12427
  }
12298
12428
  });
12429
+
12430
+ if (prefix !== '') {
12431
+ const hasPrefix = Array.from(spacer.classList).some(c => c.startsWith(prefix));
12432
+
12433
+ if (!hasPrefix) {
12434
+ btns.forEach(elm => elm.classList.remove('on'));
12435
+ panel.querySelector('.val-box-size').innerHTML = '';
12436
+ }
12437
+ }
12299
12438
  }
12300
12439
 
12301
12440
  }
@@ -12327,9 +12466,10 @@ class SettingsUIGenerator$1 {
12327
12466
 
12328
12467
  if (!plugin || !plugin.settings) {
12329
12468
  // console.warn(`Plugin "${pluginName}" has no settings schema`);
12330
- return this.createEmptyForm();
12469
+ if (!plugin.editor) return this.createEmptyForm();
12331
12470
  }
12332
12471
 
12472
+ if (!plugin.settings) plugin.settings = {};
12333
12473
  const form = document.createElement('div');
12334
12474
  form.className = 'cb-settings-form'; // Get current values from element
12335
12475
 
@@ -12783,6 +12923,7 @@ class SettingsUIGenerator$1 {
12783
12923
 
12784
12924
  getCurrentValues(element, settings) {
12785
12925
  const values = {};
12926
+ if (!settings) return values;
12786
12927
  Object.keys(settings).forEach(key => {
12787
12928
  if (key.startsWith('_')) return;
12788
12929
  const attrName = 'data-cb-' + key.replace(/([A-Z])/g, '-$1').toLowerCase();
@@ -12909,9 +13050,16 @@ class PanelPlugin {
12909
13050
  if (child.nodeType === 1 && child.tagName !== 'STYLE' && child.tagName !== 'SCRIPT') child.setAttribute('data-index', index);
12910
13051
  });
12911
13052
  } //----
12912
- // Store edited content from clone
13053
+ // Add data-edit-id for editable area
12913
13054
 
12914
13055
 
13056
+ let editables = editableClone.querySelectorAll('.edit');
13057
+ editables.forEach((area, index) => {
13058
+ const id = `content-${Date.now()}-${index}`;
13059
+ area.setAttribute('data-edit-id', id);
13060
+ }); //-----
13061
+ // Store edited content from clone
13062
+
12915
13063
  currentElement.setAttribute('data-cb-original-content', editableClone.innerHTML); // Also performs similar value updates like the applyChanges()
12916
13064
  // currentElement.setAttribute('data-cb-content', editableClone.getAttribute('data-cb-content'));
12917
13065
 
@@ -13812,7 +13960,7 @@ class PanelBox {
13812
13960
  </div>
13813
13961
  </div>
13814
13962
 
13815
- <div class="box-bg-settings">
13963
+ <div class="box-bg-color">
13816
13964
  <div class="flex">
13817
13965
  <div class="mr-8">
13818
13966
  <div class="label mt-3">${out('Background Color')}:</div>
@@ -13827,7 +13975,8 @@ class PanelBox {
13827
13975
  </div>
13828
13976
  </div>
13829
13977
  </div>
13830
-
13978
+ </div>
13979
+ <div class="box-bg-image">
13831
13980
  <div class="label mt-3">${out('Background Image')}:</div>
13832
13981
 
13833
13982
  <div class="asset-preview"></div>
@@ -15279,9 +15428,12 @@ class PanelBox {
15279
15428
  this.divPluginSettings = divPluginSettings;
15280
15429
  const runtime = this.builder.win.builderRuntime; // Reset (can be changed by renderPluginSettings)
15281
15430
 
15282
- const divBgSettings = this.panel.querySelector('.box-bg-settings');
15283
- divBgSettings.style.display = '';
15284
- this.divBgSettings = divBgSettings;
15431
+ const divBgColor = this.panel.querySelector('.box-bg-color');
15432
+ divBgColor.style.display = '';
15433
+ this.divBgColor = divBgColor;
15434
+ const divBgImage = this.panel.querySelector('.box-bg-image');
15435
+ divBgImage.style.display = '';
15436
+ this.divBgImage = divBgImage;
15285
15437
  const divPanelTitle = this.panel.parentNode.querySelector('.part-title');
15286
15438
  divPanelTitle.style.display = '';
15287
15439
  this.divPanelTitle = divPanelTitle;
@@ -15310,20 +15462,84 @@ class PanelBox {
15310
15462
  const pluginName = currentElement.getAttribute('data-cb-type');
15311
15463
  const plugin = runtime.getPlugin(pluginName);
15312
15464
  if (!plugin) return;
15313
- let displayName = out(plugin.displayName || plugin.name);
15465
+ let displayName = out(plugin.displayName || plugin.name); // Hide unused tabs for plugin
15466
+
15467
+ /*
15468
+ contentbox: {
15469
+ title: false,
15470
+ bg: false,
15471
+ text: false,
15472
+ //...
15473
+ },
15474
+ */
15314
15475
 
15315
15476
  if (plugin.contentbox) {
15316
- if (!plugin.contentbox.bg) {
15317
- this.divBgSettings.style.display = 'none';
15477
+ if (plugin.contentbox.bg !== undefined && plugin.contentbox.bg !== null && plugin.contentbox.bg === false) {
15478
+ this.divBgColor.style.display = 'none';
15479
+ this.divBgImage.style.display = 'none';
15480
+ }
15481
+
15482
+ if (plugin.contentbox.bgColor !== undefined && plugin.contentbox.bgColor !== null && plugin.contentbox.bgColor === false) {
15483
+ this.divBgColor.style.display = 'none';
15484
+ }
15485
+
15486
+ if (plugin.contentbox.bgImage !== undefined && plugin.contentbox.bgImage !== null && plugin.contentbox.bgImage === false) {
15487
+ this.divBgImage.style.display = 'none';
15318
15488
  }
15319
15489
 
15320
- if (!plugin.contentbox.text) {
15490
+ if (plugin.contentbox.text !== undefined && plugin.contentbox.text !== null && plugin.contentbox.text === false) {
15321
15491
  this.divDefaultTextColor.style.display = 'none';
15322
15492
  }
15323
15493
 
15324
- if (!plugin.contentbox.title) {
15494
+ if (plugin.contentbox.title !== undefined && plugin.contentbox.title !== null && plugin.contentbox.title === false) {
15325
15495
  this.divPanelTitle.style.display = 'none';
15326
15496
  }
15497
+
15498
+ if (plugin.contentbox.boxTabs !== undefined && plugin.contentbox.boxTabs !== null && plugin.contentbox.boxTabs === false) {
15499
+ const tabs = this.panel.querySelectorAll('.accordion-item');
15500
+ tabs.forEach(tab => {
15501
+ tab.style.display = 'none';
15502
+ tab.setAttribute('aria-expanded', false);
15503
+ });
15504
+ const tabContents = this.panel.querySelectorAll('.accordion-content');
15505
+ tabContents.forEach(tabContent => {
15506
+ tabContent.style.display = 'none';
15507
+ tabContent.setAttribute('aria-hidden', true);
15508
+ });
15509
+ }
15510
+
15511
+ if (plugin.contentbox.boxTabContent !== undefined && plugin.contentbox.boxTabContent !== null && plugin.contentbox.boxTabContent === false) {
15512
+ const tabs = this.panel.querySelectorAll('.accordion-item.btn-accordion-content');
15513
+ tabs.forEach(tab => {
15514
+ tab.style.display = 'none';
15515
+ tab.setAttribute('aria-expanded', false);
15516
+ const tabContent = tab.nextElementSibling;
15517
+ tabContent.style.display = 'none';
15518
+ tabContent.setAttribute('aria-hidden', true);
15519
+ });
15520
+ }
15521
+
15522
+ if (plugin.contentbox.boxTabOnClick !== undefined && plugin.contentbox.boxTabOnClick !== null && plugin.contentbox.boxTabOnClick === false) {
15523
+ const tabs = this.panel.querySelectorAll('.accordion-item.btn-accordion-boxonclick');
15524
+ tabs.forEach(tab => {
15525
+ tab.style.display = 'none';
15526
+ tab.setAttribute('aria-expanded', false);
15527
+ const tabContent = tab.nextElementSibling;
15528
+ tabContent.style.display = 'none';
15529
+ tabContent.setAttribute('aria-hidden', true);
15530
+ });
15531
+ }
15532
+
15533
+ if (plugin.contentbox.boxTabResponsive !== undefined && plugin.contentbox.boxTabResponsive !== null && plugin.contentbox.boxTabResponsive === false) {
15534
+ const tabs = this.panel.querySelectorAll('.accordion-item.btn-accordion-boxresponsive');
15535
+ tabs.forEach(tab => {
15536
+ tab.style.display = 'none';
15537
+ tab.setAttribute('aria-expanded', false);
15538
+ const tabContent = tab.nextElementSibling;
15539
+ tabContent.style.display = 'none';
15540
+ tabContent.setAttribute('aria-hidden', true);
15541
+ });
15542
+ }
15327
15543
  }
15328
15544
 
15329
15545
  const divTitle = document.createElement('h3');
@@ -15349,7 +15565,8 @@ class PanelBox {
15349
15565
  const originalElement = editableClone.cloneNode(false); // Let plugin handle everything - pass the editable clone
15350
15566
 
15351
15567
  const editorUI = plugin.editor.openContentEditor(editableClone, this.builder, async () => {
15352
- this.builder.editor.saveForUndo(); // Add index for sortable grid (for easy reorder)
15568
+ this.builder.editor.saveForUndo(); // Do the same process like reinitialize, needed for newly added item (which requires data-cb-original-content update)
15569
+ // Add index for sortable grid (for easy reorder)
15353
15570
 
15354
15571
  let grid = editableClone.querySelector('.grid-sortable');
15355
15572
 
@@ -15364,9 +15581,16 @@ class PanelBox {
15364
15581
  if (child.nodeType === 1 && child.tagName !== 'STYLE' && child.tagName !== 'SCRIPT') child.setAttribute('data-index', index);
15365
15582
  });
15366
15583
  } //----
15367
- // Store edited content from clone
15584
+ // Add data-edit-id for editable area
15368
15585
 
15369
15586
 
15587
+ let editables = editableClone.querySelectorAll('.edit');
15588
+ editables.forEach((area, index) => {
15589
+ const id = `content-${Date.now()}-${index}`;
15590
+ area.setAttribute('data-edit-id', id);
15591
+ }); //-----
15592
+ // Store edited content from clone
15593
+
15370
15594
  currentElement.setAttribute('data-cb-original-content', editableClone.innerHTML); // Also performs similar value updates like the applyChanges()
15371
15595
  // currentElement.setAttribute('data-cb-content', editableClone.getAttribute('data-cb-content'));
15372
15596
 
@@ -16951,23 +17175,25 @@ class PanelSection {
16951
17175
  </button>
16952
17176
  </div>
16953
17177
 
16954
- <div class="label">${out('Height')}:</div>
16955
- <div class="group sectionheight">
16956
- <button title="10%" data-height="10">10%</button>
16957
- <button title="15%" data-height="15">15%</button>
16958
- <button title="20%" data-height="20">20%</button>
16959
- <button title="25%" data-height="25">25%</button>
16960
- <button title="30%" data-height="30">30%</button>
16961
- <button title="40%" data-height="40">40%</button>
16962
- <button title="50%" data-height="50">50%</button>
16963
- <button title="60%" data-height="60">60%</button>
16964
- <button title="70%" data-height="70">70%</button>
16965
- <button title="75%" data-height="75">75%</button>
16966
- <button title="80%" data-height="80">80%</button>
16967
- <button title="85%" data-height="85">85%</button>
16968
- <button title="90%" data-height="90">90%</button>
16969
- <button title="100%" data-height="100">100%</button>
16970
- <button title="${out('Clear')}" class="btn-clear" data-height="0"><svg><use xlink:href="#icon-eraser"></use></svg></button>
17178
+ <div class="div-section-height">
17179
+ <div class="label">${out('Height')}:</div>
17180
+ <div class="group sectionheight">
17181
+ <button title="10%" data-height="10">10%</button>
17182
+ <button title="15%" data-height="15">15%</button>
17183
+ <button title="20%" data-height="20">20%</button>
17184
+ <button title="25%" data-height="25">25%</button>
17185
+ <button title="30%" data-height="30">30%</button>
17186
+ <button title="40%" data-height="40">40%</button>
17187
+ <button title="50%" data-height="50">50%</button>
17188
+ <button title="60%" data-height="60">60%</button>
17189
+ <button title="70%" data-height="70">70%</button>
17190
+ <button title="75%" data-height="75">75%</button>
17191
+ <button title="80%" data-height="80">80%</button>
17192
+ <button title="85%" data-height="85">85%</button>
17193
+ <button title="90%" data-height="90">90%</button>
17194
+ <button title="100%" data-height="100">100%</button>
17195
+ <button title="${out('Clear')}" class="btn-clear" data-height="0"><svg><use xlink:href="#icon-eraser"></use></svg></button>
17196
+ </div>
16971
17197
  </div>
16972
17198
 
16973
17199
  </div>
@@ -17149,6 +17375,7 @@ class PanelSection {
17149
17375
  this.panel = panel;
17150
17376
  this.btnClearHeight = panel.querySelector('.sectionheight .btn-clear');
17151
17377
  this.btnAccordionSpacing = panel.querySelector('.btn-accordion-spacing');
17378
+ this.divSectionHeight = panel.querySelector('.div-section-height');
17152
17379
  const btnMove = panel.querySelectorAll('[data-move]');
17153
17380
  btnMove.forEach(btn => {
17154
17381
  btn.addEventListener('click', () => {
@@ -17574,6 +17801,44 @@ class PanelSection {
17574
17801
  } else {
17575
17802
  divReverseBoxes.style.display = 'none';
17576
17803
  divBoxesPerLine.style.display = 'none';
17804
+ } // Hide unused tabs and height settings for plugin
17805
+
17806
+
17807
+ const tabs = this.panel.querySelectorAll('.accordion-item');
17808
+ tabs.forEach(tab => {
17809
+ tab.style.display = '';
17810
+ });
17811
+ const tabContents = this.panel.querySelectorAll('.accordion-content');
17812
+ tabContents.forEach(tabContent => {
17813
+ tabContent.style.display = '';
17814
+ });
17815
+ this.divSectionHeight.style.display = '';
17816
+ const singleSectionBox = activeSection.classList.contains('is-box');
17817
+ const pluginElement = activeSection.querySelector('.is-overlay-content [data-cb-type]');
17818
+
17819
+ if (singleSectionBox && pluginElement) {
17820
+ const runtime = this.builder.win.builderRuntime;
17821
+ const pluginName = pluginElement.getAttribute('data-cb-type');
17822
+ const plugin = runtime.getPlugin(pluginName);
17823
+
17824
+ if (plugin.contentbox) {
17825
+ if (plugin.contentbox.sectionHeight !== undefined && plugin.contentbox.sectionHeight !== null && plugin.contentbox.sectionHeight === false) {
17826
+ this.divSectionHeight.style.display = 'none';
17827
+ }
17828
+
17829
+ if (plugin.contentbox.sectionTabs !== undefined && plugin.contentbox.sectionTabs !== null && plugin.contentbox.sectionTabs === false) {
17830
+ const tabs = this.panel.querySelectorAll('.accordion-item');
17831
+ tabs.forEach(tab => {
17832
+ tab.style.display = 'none';
17833
+ tab.setAttribute('aria-expanded', false);
17834
+ });
17835
+ const tabContents = this.panel.querySelectorAll('.accordion-content');
17836
+ tabContents.forEach(tabContent => {
17837
+ tabContent.style.display = 'none';
17838
+ tabContent.setAttribute('aria-hidden', true);
17839
+ });
17840
+ }
17841
+ }
17577
17842
  }
17578
17843
  }
17579
17844
 
@@ -22747,8 +23012,8 @@ class SpacingContainer {
22747
23012
  <button title="110" data-topspacing="11">110</button>
22748
23013
  <button title="120" data-topspacing="12">120</button>
22749
23014
  <button title="140" data-topspacing="14">140</button>
22750
- <!--<button title="160" data-topspacing="16">160</button>
22751
- <button title="200" data-topspacing="20">200</button>-->
23015
+ <button title="160" data-topspacing="16">160</button>
23016
+ <button title="200" data-topspacing="20">200</button>
22752
23017
  <button title="${out('Clear')}" data-topspacing=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
22753
23018
  </div>
22754
23019
 
@@ -22771,6 +23036,8 @@ class SpacingContainer {
22771
23036
  <button title="110" data-bottomspacing="11">110</button>
22772
23037
  <button title="120" data-bottomspacing="12">120</button>
22773
23038
  <button title="140" data-bottomspacing="14">140</button>
23039
+ <button title="160" data-bottomspacing="16">160</button>
23040
+ <button title="200" data-bottomspacing="20">200</button>
22774
23041
  <button title="${out('Clear')}" data-bottomspacing=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
22775
23042
  </div>
22776
23043
 
@@ -22793,6 +23060,8 @@ class SpacingContainer {
22793
23060
  <button title="110" data-leftspacing="11">110</button>
22794
23061
  <button title="120" data-leftspacing="12">120</button>
22795
23062
  <button title="140" data-leftspacing="14">140</button>
23063
+ <button title="160" data-leftspacing="16">160</button>
23064
+ <button title="200" data-leftspacing="20">200</button>
22796
23065
  <button title="${out('Clear')}" data-leftspacing=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
22797
23066
  </div>
22798
23067
 
@@ -22815,6 +23084,8 @@ class SpacingContainer {
22815
23084
  <button title="110" data-rightspacing="11">110</button>
22816
23085
  <button title="120" data-rightspacing="12">120</button>
22817
23086
  <button title="140" data-rightspacing="14">140</button>
23087
+ <button title="160" data-rightspacing="16">160</button>
23088
+ <button title="200" data-rightspacing="20">200</button>
22818
23089
  <button title="${out('Clear')}" data-rightspacing=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
22819
23090
  </div>
22820
23091
  </div>
@@ -25271,7 +25542,7 @@ class Element$2 {
25271
25542
 
25272
25543
  getDeviceTarget(divTarget) {
25273
25544
  const btn = divTarget.querySelector('button.on');
25274
- return btn.getAttribute('data-device');
25545
+ if (btn) return btn.getAttribute('data-device');else return '';
25275
25546
  }
25276
25547
 
25277
25548
  realtimeVisibility(elm) {
@@ -26428,6 +26699,47 @@ class ControlPanel {
26428
26699
  let old = this.builder.onPageContentClick;
26429
26700
 
26430
26701
  this.builder.onPageContentClick = e => {
26702
+ const editArea = e.target.closest('.is-subblock');
26703
+
26704
+ if (editArea) {
26705
+ this.builder.editor.elmTool.click(editArea, e); // Icon
26706
+
26707
+ const icons = this.builder.doc.querySelectorAll('.icon-active');
26708
+ icons.forEach(icon => icon.classList.remove('icon-active'));
26709
+ this.builder.editor.activeIcon = null;
26710
+
26711
+ if (e.target.closest('i') && e.target.innerHTML === '') {
26712
+ e.target.classList.add('icon-active');
26713
+ this.builder.editor.dom.selectElementContents(e.target);
26714
+ this.builder.editor.activeIcon = e.target; // prevent text selection
26715
+
26716
+ if (document.selection) {
26717
+ document.selection.empty();
26718
+ } else {
26719
+ window.getSelection().removeAllRanges();
26720
+ }
26721
+ } // Image (must be placed before //Link)
26722
+
26723
+
26724
+ this.builder.editor.element.image.click(e); // Button
26725
+
26726
+ this.builder.editor.element.button.click(editArea, e); // Link
26727
+
26728
+ this.builder.editor.element.hyperlink.click(editArea, e); // Table
26729
+
26730
+ this.builder.editor.element.table.click(e); // Iframe
26731
+
26732
+ this.builder.editor.element.iframe.click(e); // Video
26733
+
26734
+ this.builder.editor.element.video.click(e); // Audio
26735
+
26736
+ this.builder.editor.element.audio.click(e); // Spacer
26737
+
26738
+ this.builder.editor.element.spacer.click(e); // Svg
26739
+
26740
+ this.builder.editor.element.svg.click(e);
26741
+ }
26742
+
26431
26743
  if (old) old.call(this);
26432
26744
 
26433
26745
  if (this.builder.controlPanel && !document.body.classList.contains('controlpanel')) {
@@ -26810,6 +27122,17 @@ class ControlPanel {
26810
27122
 
26811
27123
  getActive() {
26812
27124
  let activeElement = this.builder.editor.inspectedElement;
27125
+
27126
+ if (activeElement && activeElement.closest('[data-cb-type]') && activeElement.closest('.is-overlay-content')) {
27127
+ this.activeElement = activeElement; // this.activeContainer = activeElement.closest('.is-container');
27128
+ // this.activeColumn = this.activeContainer;
27129
+ // this.activeRow = this.activeContainer;
27130
+
27131
+ this.activeBox = this.builder.activeBox;
27132
+ this.activeSection = this.activeBox.closest('.is-section');
27133
+ return;
27134
+ }
27135
+
26813
27136
  let col = this.builder.editor.activeCol;
26814
27137
  let row, container;
26815
27138
 
@@ -26906,6 +27229,10 @@ class ControlPanel {
26906
27229
  breadcrumbHtml = '';
26907
27230
  }
26908
27231
 
27232
+ if (selection === 'element' && this.activeElement.closest('[data-cb-type]') && this.activeElement.closest('.is-overlay-content')) {
27233
+ breadcrumbHtml = `<div>${section} ${sep} ${box} ${sep}</div>`;
27234
+ }
27235
+
26909
27236
  if (this.activeBlock) {
26910
27237
  // freeform
26911
27238
  if (selection === 'element') {
@@ -27024,10 +27351,10 @@ class ControlPanel {
27024
27351
 
27025
27352
  if (what === 'box') {
27026
27353
  let box = this.activeBox;
27027
- let section = this.activeSection;
27028
- this.builder.editor.util.clearActiveCell();
27029
- this.builder.editor.util.clearPops();
27030
- this.builder.editor.hideElementTools();
27354
+ let section = this.activeSection; // this.builder.editor.util.clearActiveCell();
27355
+ // this.builder.editor.util.clearPops();
27356
+ // this.builder.editor.hideElementTools();
27357
+
27031
27358
  this.closeContentDialogs();
27032
27359
  this.builder.wrapperEl.classList.add('hard-select');
27033
27360
  this.builder.wrapperEl.classList.remove('is-clean-edit'); // Select box
@@ -27117,6 +27444,9 @@ class ControlPanel {
27117
27444
  } else if (element.classList.contains('ovl')) {
27118
27445
  element = element.parentNode.querySelector('iframe');
27119
27446
  this.activeElement = element;
27447
+ } else if (element.classList.contains('embed-responsive')) {
27448
+ element = element.parentNode.querySelector('iframe');
27449
+ this.activeElement = element;
27120
27450
  }
27121
27451
 
27122
27452
  if (element.closest('[data-html]') && !element.closest('[data-subblock]')) {
@@ -27147,7 +27477,7 @@ class ControlPanel {
27147
27477
  } else {
27148
27478
  if (element.querySelector('.icon') && element.childElementCount === 1) ;
27149
27479
 
27150
- if (element.closest('[data-cb-type]')) {
27480
+ if (element.closest('[data-cb-type]') && !element.closest('.is-subblock')) {
27151
27481
  const runtime = this.builder.win.builderRuntime;
27152
27482
 
27153
27483
  if (runtime) {
@@ -32799,7 +33129,7 @@ class Util$1 {
32799
33129
  if (elm && elm.closest('.is-block')) ; else {
32800
33130
  // If no active cell, check if it is from .row-add-initial (empty info)
32801
33131
  row = this.builder.doc.querySelector('.row-active');
32802
- if (!row) return;else {
33132
+ if (row) {
32803
33133
  // Empty content will always use 'row' mode to insert block.
32804
33134
  mode = 'row';
32805
33135
  }
@@ -32944,13 +33274,24 @@ class Util$1 {
32944
33274
  element.click();
32945
33275
  }
32946
33276
  }
33277
+ let editingInsidePlugin = false;
33278
+ let elm = this.builder.activeElement;
33279
+ const plugin = elm.closest('[data-cb-type]');
33280
+ const subblock = elm.closest('.is-subblock');
33281
+ if (plugin && subblock) {
33282
+ editingInsidePlugin = true;
33283
+ }
32947
33284
  if (mode === 'elm') {
32948
33285
  let elm = this.builder.activeElement; // See elementtool.js line 195-196. // document.querySelector('.elm-active');
32949
33286
  if (!elm) return;
32950
33287
  this.builder.uo.saveForUndo();
32951
33288
  let element = elm;
32952
33289
  let newelement;
32953
- if (!element.nextElementSibling && !element.closest('[data-subblock]')) {
33290
+ const plugin = element.closest('[data-cb-type]');
33291
+ if (plugin) {
33292
+ element.insertAdjacentHTML('afterend', html);
33293
+ newelement = element.nextElementSibling;
33294
+ } else if (!element.nextElementSibling && !element.closest('[data-subblock]')) {
32954
33295
  // active element is div.display > p.
32955
33296
  let activeCol = this.builder.activeCol;
32956
33297
  let current;
@@ -32968,7 +33309,7 @@ class Util$1 {
32968
33309
  element.insertAdjacentHTML('afterend', html);
32969
33310
  newelement = element.nextElementSibling;
32970
33311
  }
32971
- let builderActive = this.builder.doc.querySelector('.builder-active');
33312
+ let builderActive = element.closest('.is-container'); // this.builder.doc.querySelector('.builder-active');
32972
33313
  if (builderActive) this.builder.applyBehaviorOn(builderActive);
32973
33314
  if (newelement.tagName.toLowerCase() === 'img') {
32974
33315
  let checkLoad = setInterval(() => {
@@ -33004,7 +33345,7 @@ class Util$1 {
33004
33345
  this.builder.opts.onRender();
33005
33346
 
33006
33347
  // Reinit after drag drop block
33007
- if (this.builder.win.builderRuntime) this.builder.win.builderRuntime.reinitialize();
33348
+ if (this.builder.win.builderRuntime && !editingInsidePlugin) this.builder.win.builderRuntime.reinitialize();
33008
33349
  setTimeout(() => {
33009
33350
  this.builder.makeSortable(this.builder.doc);
33010
33351
  }, 400);
@@ -41066,145 +41407,113 @@ function get_beautify(js_beautify, css_beautify, html_beautify) {
41066
41407
 
41067
41408
  var JsBeautify$1 = js$1.exports;
41068
41409
 
41069
- function _defineProperty$2(obj, key, value) {
41070
- if (key in obj) {
41071
- Object.defineProperty(obj, key, {
41072
- value: value,
41073
- enumerable: true,
41074
- configurable: true,
41075
- writable: true
41076
- });
41077
- } else {
41078
- obj[key] = value;
41079
- }
41080
-
41081
- return obj;
41410
+ function _arrayLikeToArray$1(r, a) {
41411
+ (null == a || a > r.length) && (a = r.length);
41412
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
41413
+ return n;
41082
41414
  }
41083
-
41084
- function ownKeys$2(object, enumerableOnly) {
41085
- var keys = Object.keys(object);
41086
-
41087
- if (Object.getOwnPropertySymbols) {
41088
- var symbols = Object.getOwnPropertySymbols(object);
41089
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
41090
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
41091
- });
41092
- keys.push.apply(keys, symbols);
41093
- }
41094
-
41095
- return keys;
41415
+ function _arrayWithHoles(r) {
41416
+ if (Array.isArray(r)) return r;
41096
41417
  }
41097
-
41098
- function _objectSpread2$2(target) {
41099
- for (var i = 1; i < arguments.length; i++) {
41100
- var source = arguments[i] != null ? arguments[i] : {};
41101
-
41102
- if (i % 2) {
41103
- ownKeys$2(Object(source), true).forEach(function (key) {
41104
- _defineProperty$2(target, key, source[key]);
41105
- });
41106
- } else if (Object.getOwnPropertyDescriptors) {
41107
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
41108
- } else {
41109
- ownKeys$2(Object(source)).forEach(function (key) {
41110
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
41111
- });
41418
+ function _defineProperty$2(e, r, t) {
41419
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
41420
+ value: t,
41421
+ enumerable: true,
41422
+ configurable: true,
41423
+ writable: true
41424
+ }) : e[r] = t, e;
41425
+ }
41426
+ function _iterableToArrayLimit(r, l) {
41427
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
41428
+ if (null != t) {
41429
+ var e,
41430
+ n,
41431
+ i,
41432
+ u,
41433
+ a = [],
41434
+ f = true,
41435
+ o = false;
41436
+ try {
41437
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
41438
+ } catch (r) {
41439
+ o = true, n = r;
41440
+ } finally {
41441
+ try {
41442
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
41443
+ } finally {
41444
+ if (o) throw n;
41445
+ }
41112
41446
  }
41447
+ return a;
41113
41448
  }
41114
-
41115
- return target;
41116
41449
  }
41117
-
41118
- function _objectWithoutPropertiesLoose$2(source, excluded) {
41119
- if (source == null) return {};
41120
- var target = {};
41121
- var sourceKeys = Object.keys(source);
41122
- var key, i;
41123
-
41124
- for (i = 0; i < sourceKeys.length; i++) {
41125
- key = sourceKeys[i];
41126
- if (excluded.indexOf(key) >= 0) continue;
41127
- target[key] = source[key];
41128
- }
41129
-
41130
- return target;
41450
+ function _nonIterableRest() {
41451
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
41131
41452
  }
41132
-
41133
- function _objectWithoutProperties$2(source, excluded) {
41134
- if (source == null) return {};
41135
-
41136
- var target = _objectWithoutPropertiesLoose$2(source, excluded);
41137
-
41138
- var key, i;
41139
-
41453
+ function ownKeys$2(e, r) {
41454
+ var t = Object.keys(e);
41140
41455
  if (Object.getOwnPropertySymbols) {
41141
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
41142
-
41143
- for (i = 0; i < sourceSymbolKeys.length; i++) {
41144
- key = sourceSymbolKeys[i];
41145
- if (excluded.indexOf(key) >= 0) continue;
41146
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
41147
- target[key] = source[key];
41148
- }
41456
+ var o = Object.getOwnPropertySymbols(e);
41457
+ r && (o = o.filter(function (r) {
41458
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
41459
+ })), t.push.apply(t, o);
41149
41460
  }
41150
-
41151
- return target;
41461
+ return t;
41152
41462
  }
41153
-
41154
- function _slicedToArray(arr, i) {
41155
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
41463
+ function _objectSpread2$2(e) {
41464
+ for (var r = 1; r < arguments.length; r++) {
41465
+ var t = null != arguments[r] ? arguments[r] : {};
41466
+ r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) {
41467
+ _defineProperty$2(e, r, t[r]);
41468
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) {
41469
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
41470
+ });
41471
+ }
41472
+ return e;
41156
41473
  }
41157
-
41158
- function _arrayWithHoles(arr) {
41159
- if (Array.isArray(arr)) return arr;
41474
+ function _objectWithoutProperties$2(e, t) {
41475
+ if (null == e) return {};
41476
+ var o,
41477
+ r,
41478
+ i = _objectWithoutPropertiesLoose$2(e, t);
41479
+ if (Object.getOwnPropertySymbols) {
41480
+ var n = Object.getOwnPropertySymbols(e);
41481
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
41482
+ }
41483
+ return i;
41160
41484
  }
41161
-
41162
- function _iterableToArrayLimit(arr, i) {
41163
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
41164
- var _arr = [];
41165
- var _n = true;
41166
- var _d = false;
41167
- var _e = undefined;
41168
-
41169
- try {
41170
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
41171
- _arr.push(_s.value);
41172
-
41173
- if (i && _arr.length === i) break;
41174
- }
41175
- } catch (err) {
41176
- _d = true;
41177
- _e = err;
41178
- } finally {
41179
- try {
41180
- if (!_n && _i["return"] != null) _i["return"]();
41181
- } finally {
41182
- if (_d) throw _e;
41183
- }
41485
+ function _objectWithoutPropertiesLoose$2(r, e) {
41486
+ if (null == r) return {};
41487
+ var t = {};
41488
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
41489
+ if (-1 !== e.indexOf(n)) continue;
41490
+ t[n] = r[n];
41184
41491
  }
41185
-
41186
- return _arr;
41492
+ return t;
41187
41493
  }
41188
-
41189
- function _unsupportedIterableToArray$1(o, minLen) {
41190
- if (!o) return;
41191
- if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
41192
- var n = Object.prototype.toString.call(o).slice(8, -1);
41193
- if (n === "Object" && o.constructor) n = o.constructor.name;
41194
- if (n === "Map" || n === "Set") return Array.from(o);
41195
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
41494
+ function _slicedToArray(r, e) {
41495
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest();
41196
41496
  }
41197
-
41198
- function _arrayLikeToArray$1(arr, len) {
41199
- if (len == null || len > arr.length) len = arr.length;
41200
-
41201
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
41202
-
41203
- return arr2;
41497
+ function _toPrimitive(t, r) {
41498
+ if ("object" != typeof t || !t) return t;
41499
+ var e = t[Symbol.toPrimitive];
41500
+ if (void 0 !== e) {
41501
+ var i = e.call(t, r);
41502
+ if ("object" != typeof i) return i;
41503
+ throw new TypeError("@@toPrimitive must return a primitive value.");
41504
+ }
41505
+ return ("string" === r ? String : Number)(t);
41204
41506
  }
41205
-
41206
- function _nonIterableRest() {
41207
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
41507
+ function _toPropertyKey(t) {
41508
+ var i = _toPrimitive(t, "string");
41509
+ return "symbol" == typeof i ? i : i + "";
41510
+ }
41511
+ function _unsupportedIterableToArray$1(r, a) {
41512
+ if (r) {
41513
+ if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
41514
+ var t = {}.toString.call(r).slice(8, -1);
41515
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
41516
+ }
41208
41517
  }
41209
41518
 
41210
41519
  function _defineProperty$1(obj, key, value) {
@@ -41401,23 +41710,20 @@ var index$2 = {
41401
41710
 
41402
41711
  var config$1 = {
41403
41712
  paths: {
41404
- vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs'
41713
+ vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs'
41405
41714
  }
41406
41715
  };
41407
41716
 
41408
41717
  function curry(fn) {
41409
41718
  return function curried() {
41410
41719
  var _this = this;
41411
-
41412
41720
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
41413
41721
  args[_key] = arguments[_key];
41414
41722
  }
41415
-
41416
41723
  return args.length >= fn.length ? fn.apply(this, args) : function () {
41417
41724
  for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
41418
41725
  nextArgs[_key2] = arguments[_key2];
41419
41726
  }
41420
-
41421
41727
  return curried.apply(_this, [].concat(args, nextArgs));
41422
41728
  };
41423
41729
  };
@@ -41432,11 +41738,9 @@ function isObject$3(value) {
41432
41738
  * @param {Object} config - the configuration object
41433
41739
  * @return {Object} config - the validated configuration object
41434
41740
  */
41435
-
41436
41741
  function validateConfig(config) {
41437
41742
  if (!config) errorHandler('configIsRequired');
41438
41743
  if (!isObject$3(config)) errorHandler('configType');
41439
-
41440
41744
  if (config.urls) {
41441
41745
  informAboutDeprecation();
41442
41746
  return {
@@ -41445,22 +41749,18 @@ function validateConfig(config) {
41445
41749
  }
41446
41750
  };
41447
41751
  }
41448
-
41449
41752
  return config;
41450
41753
  }
41754
+
41451
41755
  /**
41452
41756
  * logs deprecation message
41453
41757
  */
41454
-
41455
-
41456
41758
  function informAboutDeprecation() {
41457
41759
  console.warn(errorMessages.deprecation);
41458
41760
  }
41459
-
41460
41761
  function throwError(errorMessages, type) {
41461
41762
  throw new Error(errorMessages[type] || errorMessages["default"]);
41462
41763
  }
41463
-
41464
41764
  var errorMessages = {
41465
41765
  configIsRequired: 'the configuration object is required',
41466
41766
  configType: 'the configuration object should be an object',
@@ -41476,7 +41776,6 @@ var compose = function compose() {
41476
41776
  for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
41477
41777
  fns[_key] = arguments[_key];
41478
41778
  }
41479
-
41480
41779
  return function (x) {
41481
41780
  return fns.reduceRight(function (y, f) {
41482
41781
  return f(y);
@@ -41496,11 +41795,11 @@ function merge(target, source) {
41496
41795
  }
41497
41796
 
41498
41797
  // The source (has been changed) is https://github.com/facebook/react/issues/5465#issuecomment-157888325
41798
+
41499
41799
  var CANCELATION_MESSAGE = {
41500
41800
  type: 'cancelation',
41501
41801
  msg: 'operation is manually canceled'
41502
41802
  };
41503
-
41504
41803
  function makeCancelable(promise) {
41505
41804
  var hasCanceled_ = false;
41506
41805
  var wrappedPromise = new Promise(function (resolve, reject) {
@@ -41514,29 +41813,28 @@ function makeCancelable(promise) {
41514
41813
  }, wrappedPromise;
41515
41814
  }
41516
41815
 
41517
- /** the local state of the module */
41816
+ var _excluded$2 = ["monaco"];
41518
41817
 
41818
+ /** the local state of the module */
41519
41819
  var _state$create = index$2.create({
41520
- config: config$1,
41521
- isInitialized: false,
41522
- resolve: null,
41523
- reject: null,
41524
- monaco: null
41525
- }),
41526
- _state$create2 = _slicedToArray(_state$create, 2),
41527
- getState = _state$create2[0],
41528
- setState = _state$create2[1];
41820
+ config: config$1,
41821
+ isInitialized: false,
41822
+ resolve: null,
41823
+ reject: null,
41824
+ monaco: null
41825
+ }),
41826
+ _state$create2 = _slicedToArray(_state$create, 2),
41827
+ getState = _state$create2[0],
41828
+ setState = _state$create2[1];
41829
+
41529
41830
  /**
41530
41831
  * set the loader configuration
41531
41832
  * @param {Object} config - the configuration object
41532
41833
  */
41533
-
41534
-
41535
41834
  function config(globalConfig) {
41536
41835
  var _validators$config = validators.config(globalConfig),
41537
- monaco = _validators$config.monaco,
41538
- config = _objectWithoutProperties$2(_validators$config, ["monaco"]);
41539
-
41836
+ monaco = _validators$config.monaco,
41837
+ config = _objectWithoutProperties$2(_validators$config, _excluded$2);
41540
41838
  setState(function (state) {
41541
41839
  return {
41542
41840
  config: merge(state.config, config),
@@ -41544,100 +41842,88 @@ function config(globalConfig) {
41544
41842
  };
41545
41843
  });
41546
41844
  }
41845
+
41547
41846
  /**
41548
41847
  * handles the initialization of the monaco-editor
41549
41848
  * @return {Promise} - returns an instance of monaco (with a cancelable promise)
41550
41849
  */
41551
-
41552
-
41553
41850
  function init() {
41554
41851
  var state = getState(function (_ref) {
41555
41852
  var monaco = _ref.monaco,
41556
- isInitialized = _ref.isInitialized,
41557
- resolve = _ref.resolve;
41853
+ isInitialized = _ref.isInitialized,
41854
+ resolve = _ref.resolve;
41558
41855
  return {
41559
41856
  monaco: monaco,
41560
41857
  isInitialized: isInitialized,
41561
41858
  resolve: resolve
41562
41859
  };
41563
41860
  });
41564
-
41565
41861
  if (!state.isInitialized) {
41566
41862
  setState({
41567
41863
  isInitialized: true
41568
41864
  });
41569
-
41570
41865
  if (state.monaco) {
41571
41866
  state.resolve(state.monaco);
41572
41867
  return makeCancelable(wrapperPromise);
41573
41868
  }
41574
-
41575
41869
  if (window.monaco && window.monaco.editor) {
41576
41870
  storeMonacoInstance(window.monaco);
41577
41871
  state.resolve(window.monaco);
41578
41872
  return makeCancelable(wrapperPromise);
41579
41873
  }
41580
-
41581
41874
  compose(injectScripts, getMonacoLoaderScript)(configureLoader);
41582
41875
  }
41583
-
41584
41876
  return makeCancelable(wrapperPromise);
41585
41877
  }
41878
+
41586
41879
  /**
41587
41880
  * injects provided scripts into the document.body
41588
41881
  * @param {Object} script - an HTML script element
41589
41882
  * @return {Object} - the injected HTML script element
41590
41883
  */
41591
-
41592
-
41593
41884
  function injectScripts(script) {
41594
41885
  return document.body.appendChild(script);
41595
41886
  }
41887
+
41596
41888
  /**
41597
41889
  * creates an HTML script element with/without provided src
41598
41890
  * @param {string} [src] - the source path of the script
41599
41891
  * @return {Object} - the created HTML script element
41600
41892
  */
41601
-
41602
-
41603
41893
  function createScript(src) {
41604
41894
  var script = document.createElement('script');
41605
41895
  return src && (script.src = src), script;
41606
41896
  }
41897
+
41607
41898
  /**
41608
41899
  * creates an HTML script element with the monaco loader src
41609
41900
  * @return {Object} - the created HTML script element
41610
41901
  */
41611
-
41612
-
41613
41902
  function getMonacoLoaderScript(configureLoader) {
41614
41903
  var state = getState(function (_ref2) {
41615
41904
  var config = _ref2.config,
41616
- reject = _ref2.reject;
41905
+ reject = _ref2.reject;
41617
41906
  return {
41618
41907
  config: config,
41619
41908
  reject: reject
41620
41909
  };
41621
41910
  });
41622
41911
  var loaderScript = createScript("".concat(state.config.paths.vs, "/loader.js"));
41623
-
41624
41912
  loaderScript.onload = function () {
41625
41913
  return configureLoader();
41626
41914
  };
41627
-
41628
41915
  loaderScript.onerror = state.reject;
41629
41916
  return loaderScript;
41630
41917
  }
41918
+
41631
41919
  /**
41632
41920
  * configures the monaco loader
41633
41921
  */
41634
-
41635
-
41636
41922
  function configureLoader() {
41637
41923
  var state = getState(function (_ref3) {
41638
41924
  var config = _ref3.config,
41639
- resolve = _ref3.resolve,
41640
- reject = _ref3.reject;
41925
+ resolve = _ref3.resolve,
41926
+ reject = _ref3.reject;
41641
41927
  return {
41642
41928
  config: config,
41643
41929
  resolve: resolve,
@@ -41645,21 +41931,19 @@ function configureLoader() {
41645
41931
  };
41646
41932
  });
41647
41933
  var require = window.require;
41648
-
41649
41934
  require.config(state.config);
41650
-
41651
- require(['vs/editor/editor.main'], function (monaco) {
41935
+ require(['vs/editor/editor.main'], function (_ref4) {
41936
+ var monaco = _ref4.m;
41652
41937
  storeMonacoInstance(monaco);
41653
41938
  state.resolve(monaco);
41654
41939
  }, function (error) {
41655
41940
  state.reject(error);
41656
41941
  });
41657
41942
  }
41943
+
41658
41944
  /**
41659
41945
  * store monaco instance in local state
41660
41946
  */
41661
-
41662
-
41663
41947
  function storeMonacoInstance(monaco) {
41664
41948
  if (!getState().monaco) {
41665
41949
  setState({
@@ -41667,20 +41951,18 @@ function storeMonacoInstance(monaco) {
41667
41951
  });
41668
41952
  }
41669
41953
  }
41954
+
41670
41955
  /**
41671
41956
  * internal helper function
41672
41957
  * extracts stored monaco instance
41673
41958
  * @return {Object|null} - the monaco instance
41674
41959
  */
41675
-
41676
-
41677
41960
  function __getMonacoInstance() {
41678
- return getState(function (_ref4) {
41679
- var monaco = _ref4.monaco;
41961
+ return getState(function (_ref5) {
41962
+ var monaco = _ref5.monaco;
41680
41963
  return monaco;
41681
41964
  });
41682
41965
  }
41683
-
41684
41966
  var wrapperPromise = new Promise(function (resolve, reject) {
41685
41967
  return setState({
41686
41968
  resolve: resolve,
@@ -41828,7 +42110,14 @@ class HtmlUtil {
41828
42110
  const cell = util.cellSelected();
41829
42111
  cell.innerHTML = html;
41830
42112
  let builderActive = this.builder.doc.querySelector('.builder-active');
41831
- if (builderActive) this.builder.applyBehaviorOn(builderActive);
42113
+ if (builderActive) {
42114
+ this.builder.applyBehaviorOn(builderActive);
42115
+
42116
+ // reinit after apply html
42117
+ if (this.builder.win.builderRuntime && builderActive.querySelector('[data-cb-type]')) {
42118
+ this.builder.win.builderRuntime.reinitialize(builderActive);
42119
+ }
42120
+ }
41832
42121
 
41833
42122
  //Trigger Change event
41834
42123
  this.builder.opts.onChange();
@@ -41847,7 +42136,14 @@ class HtmlUtil {
41847
42136
  if (!row) return;
41848
42137
  row.innerHTML = html;
41849
42138
  let builderActive = this.builder.doc.querySelector('.builder-active');
41850
- if (builderActive) this.builder.applyBehaviorOn(builderActive);
42139
+ if (builderActive) {
42140
+ this.builder.applyBehaviorOn(builderActive);
42141
+
42142
+ // reinit after apply html
42143
+ if (this.builder.win.builderRuntime && builderActive.querySelector('[data-cb-type]')) {
42144
+ this.builder.win.builderRuntime.reinitialize(builderActive);
42145
+ }
42146
+ }
41851
42147
 
41852
42148
  //Trigger Change event
41853
42149
  this.builder.opts.onChange();
@@ -41882,6 +42178,12 @@ class HtmlUtil {
41882
42178
  // let builderActive = this.builder.doc.querySelector('.builder-active');
41883
42179
  // if(builderActive) this.builder.applyBehaviorOn(builderActive);
41884
42180
  this.builder.applyBehaviorOn(area);
42181
+
42182
+ // reinit after apply html
42183
+ if (this.builder.win.builderRuntime && area.querySelector('[data-cb-type]')) {
42184
+ this.builder.win.builderRuntime.reinitialize(area);
42185
+ }
42186
+
41885
42187
  /*else {
41886
42188
  const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
41887
42189
  if(builders.length > 1) {
@@ -42479,6 +42781,11 @@ class HtmlUtil {
42479
42781
  element.removeAttribute(name);
42480
42782
  }
42481
42783
  });
42784
+ const areas = element.querySelectorAll('.is-container');
42785
+ Array.from(areas).forEach(area => {
42786
+ area.removeAttribute('data-sort');
42787
+ area.classList.remove('is-builder');
42788
+ });
42482
42789
 
42483
42790
  // Remove runtime-added classes
42484
42791
  const type = element.getAttribute('data-cb-type');
@@ -42493,17 +42800,39 @@ class HtmlUtil {
42493
42800
  grid = element.querySelector('.grid-sortable');
42494
42801
  }
42495
42802
  element.removeAttribute('id');
42803
+
42804
+ // Clean index in sortable grid
42496
42805
  if (grid) {
42497
42806
  Array.from(grid.children).forEach(elm => {
42498
42807
  elm.removeAttribute('data-index');
42499
42808
  elm.removeAttribute('data-item-id');
42500
42809
  });
42501
42810
  }
42502
- const elms = element.querySelectorAll('[data-scroll], [data-scroll-once]');
42811
+ // Cleanup data-item-id
42812
+ let elms = element.querySelectorAll('[data-item-id],[data-slide-id],[contenteditable]');
42813
+ elms.forEach(elm => {
42814
+ elm.removeAttribute('data-item-id');
42815
+ elm.removeAttribute('data-slide-id');
42816
+ elm.removeAttribute('contenteditable');
42817
+ });
42818
+
42819
+ // Clean data-edit-id in editable area
42820
+ let editables = element.querySelectorAll('.edit');
42821
+ editables.forEach(area => {
42822
+ area.removeAttribute('data-edit-id');
42823
+ });
42824
+ elms = element.querySelectorAll('[data-scroll], [data-scroll-once]');
42503
42825
  elms.forEach(elm => {
42504
42826
  elm.removeAttribute('data-scroll');
42505
42827
  elm.removeAttribute('data-scroll-once');
42506
42828
  });
42829
+ elms = element.querySelectorAll('.elm-active, .icon-active');
42830
+ elms.forEach(elm => {
42831
+ elm.classList.remove('elm-active');
42832
+ elm.classList.remove('icon-active');
42833
+ });
42834
+ const oldEditables = element.querySelectorAll('[contenteditable="true"]');
42835
+ oldEditables.forEach(el => el.removeAttribute('contenteditable'));
42507
42836
  });
42508
42837
  html = '';
42509
42838
  if (multiple) {
@@ -74960,6 +75289,8 @@ class ButtonEditor {
74960
75289
  <span>${util.out('Padding Left/Right')}</span>:
74961
75290
  </div>
74962
75291
  <div class="flex flex-row" style="margin-top:5px">
75292
+ <button title="2" data-command="0" class="paddingx-command" style="margin-right:4px">0</button>
75293
+ <button title="2" data-command="1" class="paddingx-command" style="margin-right:4px">1</button>
74963
75294
  <button title="2" data-command="2" class="paddingx-command" style="margin-right:4px">2</button>
74964
75295
  <button title="3" data-command="3" class="paddingx-command" style="margin-right:4px">3</button>
74965
75296
  <button title="4" data-command="4" class="paddingx-command" style="margin-right:4px">4</button>
@@ -75465,6 +75796,12 @@ class ButtonEditor {
75465
75796
  const val = btn.getAttribute('data-command');
75466
75797
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton || this.builder.activeLink;
75467
75798
  dom.removeClassesByPrefix(activeButton, 'px-');
75799
+ if (val === '0') {
75800
+ dom.addClass(activeButton, 'px-0');
75801
+ }
75802
+ if (val === '1') {
75803
+ dom.addClass(activeButton, 'px-1');
75804
+ }
75468
75805
  if (val === '2') {
75469
75806
  dom.addClass(activeButton, 'px-2');
75470
75807
  }
@@ -76532,6 +76869,144 @@ class ButtonEditor {
76532
76869
  bg: 'rgba(191, 245, 110, 1)',
76533
76870
  hoverBg: 'rgba(183, 236, 103, 1)'
76534
76871
  },
76872
+ // Square buttons
76873
+ {
76874
+ type: 'solid',
76875
+ shape: 'square',
76876
+ text: 'Read More',
76877
+ color: 'rgb(24, 24, 27)',
76878
+ bg: 'transparent',
76879
+ hoverBg: 'transparent',
76880
+ customClasses: 'underline px-0'
76881
+ }, {
76882
+ type: 'outline',
76883
+ shape: 'square',
76884
+ text: 'Read More'
76885
+ }, {
76886
+ type: 'solid',
76887
+ shape: 'square',
76888
+ text: 'Read More',
76889
+ color: 'rgb(24, 24, 27)',
76890
+ bg: 'rgb(240, 240, 241)',
76891
+ hoverBg: 'rgb(236, 236, 238)'
76892
+ }, {
76893
+ type: 'solid',
76894
+ shape: 'square',
76895
+ text: 'Read More',
76896
+ color: 'rgb(250, 250, 250)',
76897
+ bg: 'rgb(24, 24, 27)',
76898
+ hoverBg: 'rgb(63, 63, 70)'
76899
+ }, {
76900
+ type: 'outline',
76901
+ shape: 'square',
76902
+ text: 'Read More',
76903
+ color: 'rgb(250, 250, 250)',
76904
+ bg: 'transparent',
76905
+ hoverBg: 'transparent'
76906
+ }, {
76907
+ type: 'solid',
76908
+ shape: 'square',
76909
+ text: 'Read More',
76910
+ color: '#ffffff',
76911
+ bg: 'rgba(13, 151, 255, 1)',
76912
+ hoverBg: 'rgba(7, 138, 237, 1)'
76913
+ }, {
76914
+ type: 'solid',
76915
+ shape: 'square',
76916
+ text: 'Read More',
76917
+ color: '#ffffff',
76918
+ bg: '#3b82f6',
76919
+ hoverBg: 'rgba(47, 116, 228, 1)'
76920
+ }, {
76921
+ type: 'solid',
76922
+ shape: 'square',
76923
+ text: 'Read More',
76924
+ color: 'rgb(24, 24, 27)',
76925
+ bg: '#fff',
76926
+ hoverBg: 'rgba(248, 248, 250, 1)'
76927
+ },
76928
+ // Colors
76929
+ {
76930
+ type: 'solid',
76931
+ shape: 'square',
76932
+ size: 'medium',
76933
+ text: 'Read More',
76934
+ color: 'rgb(24, 24, 27)',
76935
+ bg: 'rgba(111, 235, 255, 1)',
76936
+ hoverBg: 'rgba(98, 230, 252, 1)'
76937
+ }, {
76938
+ type: 'solid',
76939
+ shape: 'square',
76940
+ size: 'medium',
76941
+ text: 'Read More',
76942
+ color: '#ffffff',
76943
+ bg: 'rgba(19, 166, 27, 1)',
76944
+ hoverBg: 'rgba(17, 155, 25, 1)'
76945
+ }, {
76946
+ type: 'solid',
76947
+ shape: 'square',
76948
+ size: 'medium',
76949
+ text: 'Read More',
76950
+ color: 'rgb(24, 24, 27)',
76951
+ bg: 'rgba(254, 235, 101, 1)',
76952
+ hoverBg: 'rgba(249, 229, 85, 1)'
76953
+ }, {
76954
+ type: 'solid',
76955
+ shape: 'square',
76956
+ size: 'medium',
76957
+ text: 'Read More',
76958
+ color: '#ffffff',
76959
+ bg: 'rgba(251, 45, 45, 1)',
76960
+ hoverBg: 'rgba(239, 38, 36, 1)'
76961
+ }, {
76962
+ type: 'solid',
76963
+ shape: 'square',
76964
+ size: 'medium',
76965
+ text: 'Read More',
76966
+ color: '#ffffff',
76967
+ bg: 'rgba(255, 122, 0, 1)',
76968
+ hoverBg: 'rgba(248, 109, 2, 1)'
76969
+ }, {
76970
+ type: 'solid',
76971
+ shape: 'square',
76972
+ size: 'medium',
76973
+ text: 'Read More',
76974
+ color: '#ffffff',
76975
+ bg: 'rgba(255, 68, 179, 1)',
76976
+ hoverBg: 'rgba(240, 46, 169, 1)'
76977
+ }, {
76978
+ type: 'solid',
76979
+ shape: 'square',
76980
+ size: 'medium',
76981
+ text: 'Read More',
76982
+ color: 'rgb(24, 24, 27)',
76983
+ bg: 'rgba(148, 251, 208, 1)',
76984
+ hoverBg: 'rgba(133, 244, 198, 1)'
76985
+ }, {
76986
+ type: 'solid',
76987
+ shape: 'square',
76988
+ size: 'medium',
76989
+ text: 'Read More',
76990
+ color: '#ffffff',
76991
+ bg: 'rgba(91, 73, 228, 1)',
76992
+ hoverBg: 'rgba(77, 59, 208, 1)'
76993
+ }, {
76994
+ type: 'solid',
76995
+ shape: 'square',
76996
+ size: 'medium',
76997
+ text: 'Read More',
76998
+ color: '#ffffff',
76999
+ bg: 'rgba(142, 67, 237, 1)',
77000
+ hoverBg: 'rgba(122, 52, 212, 1)'
77001
+ }, {
77002
+ type: 'solid',
77003
+ shape: 'square',
77004
+ size: 'medium',
77005
+ text: 'Read More',
77006
+ color: 'rgb(24, 24, 27)',
77007
+ bg: 'rgba(191, 245, 110, 1)',
77008
+ hoverBg: 'rgba(183, 236, 103, 1)'
77009
+ },
76535
77010
  // Rounded buttons - Small
76536
77011
  {
76537
77012
  type: 'solid',
@@ -77115,6 +77590,152 @@ class ButtonEditor {
77115
77590
  color: 'rgb(24, 24, 27)',
77116
77591
  bg: 'rgba(191, 245, 110, 1)',
77117
77592
  hoverBg: 'rgba(183, 236, 103, 1)'
77593
+ },
77594
+ // Square buttons - Large
77595
+ {
77596
+ type: 'solid',
77597
+ shape: 'square',
77598
+ size: 'large',
77599
+ text: 'Read More',
77600
+ color: 'rgb(24, 24, 27)',
77601
+ bg: 'transparent',
77602
+ hoverBg: 'transparent',
77603
+ customClasses: 'underline'
77604
+ }, {
77605
+ type: 'outline',
77606
+ shape: 'square',
77607
+ size: 'large',
77608
+ text: 'Read More'
77609
+ }, {
77610
+ type: 'solid',
77611
+ shape: 'square',
77612
+ size: 'large',
77613
+ text: 'Read More',
77614
+ color: 'rgb(24, 24, 27)',
77615
+ bg: 'rgb(240, 240, 241)',
77616
+ hoverBg: 'rgb(236, 236, 238)'
77617
+ }, {
77618
+ type: 'solid',
77619
+ shape: 'square',
77620
+ size: 'large',
77621
+ text: 'Read More',
77622
+ color: 'rgb(250, 250, 250)',
77623
+ bg: 'rgb(24, 24, 27)',
77624
+ hoverBg: 'rgb(63, 63, 70)'
77625
+ }, {
77626
+ type: 'outline',
77627
+ shape: 'square',
77628
+ size: 'large',
77629
+ text: 'Read More',
77630
+ color: 'rgb(250, 250, 250)',
77631
+ bg: 'transparent',
77632
+ hoverBg: 'transparent'
77633
+ }, {
77634
+ type: 'solid',
77635
+ shape: 'square',
77636
+ size: 'large',
77637
+ text: 'Read More',
77638
+ color: '#ffffff',
77639
+ bg: 'rgba(13, 151, 255, 1)',
77640
+ hoverBg: 'rgba(7, 138, 237, 1)'
77641
+ }, {
77642
+ type: 'solid',
77643
+ shape: 'square',
77644
+ size: 'large',
77645
+ text: 'Read More',
77646
+ color: '#ffffff',
77647
+ bg: '#3b82f6',
77648
+ hoverBg: 'rgba(47, 116, 228, 1)'
77649
+ }, {
77650
+ type: 'solid',
77651
+ shape: 'square',
77652
+ size: 'large',
77653
+ text: 'Read More',
77654
+ color: 'rgb(24, 24, 27)',
77655
+ bg: '#fff',
77656
+ hoverBg: 'rgba(248, 248, 250, 1)'
77657
+ },
77658
+ // Colors
77659
+ {
77660
+ type: 'solid',
77661
+ shape: 'square',
77662
+ size: 'large',
77663
+ text: 'Read More',
77664
+ color: 'rgb(24, 24, 27)',
77665
+ bg: 'rgba(111, 235, 255, 1)',
77666
+ hoverBg: 'rgba(98, 230, 252, 1)'
77667
+ }, {
77668
+ type: 'solid',
77669
+ shape: 'square',
77670
+ size: 'large',
77671
+ text: 'Read More',
77672
+ color: '#ffffff',
77673
+ bg: 'rgba(19, 166, 27, 1)',
77674
+ hoverBg: 'rgba(17, 155, 25, 1)'
77675
+ }, {
77676
+ type: 'solid',
77677
+ shape: 'square',
77678
+ size: 'large',
77679
+ text: 'Read More',
77680
+ color: 'rgb(24, 24, 27)',
77681
+ bg: 'rgba(254, 235, 101, 1)',
77682
+ hoverBg: 'rgba(249, 229, 85, 1)'
77683
+ }, {
77684
+ type: 'solid',
77685
+ shape: 'square',
77686
+ size: 'large',
77687
+ text: 'Read More',
77688
+ color: '#ffffff',
77689
+ bg: 'rgba(251, 45, 45, 1)',
77690
+ hoverBg: 'rgba(239, 38, 36, 1)'
77691
+ }, {
77692
+ type: 'solid',
77693
+ shape: 'square',
77694
+ size: 'large',
77695
+ text: 'Read More',
77696
+ color: '#ffffff',
77697
+ bg: 'rgba(255, 122, 0, 1)',
77698
+ hoverBg: 'rgba(248, 109, 2, 1)'
77699
+ }, {
77700
+ type: 'solid',
77701
+ shape: 'square',
77702
+ size: 'large',
77703
+ text: 'Read More',
77704
+ color: '#ffffff',
77705
+ bg: 'rgba(255, 68, 179, 1)',
77706
+ hoverBg: 'rgba(240, 46, 169, 1)'
77707
+ }, {
77708
+ type: 'solid',
77709
+ shape: 'square',
77710
+ size: 'large',
77711
+ text: 'Read More',
77712
+ color: 'rgb(24, 24, 27)',
77713
+ bg: 'rgba(148, 251, 208, 1)',
77714
+ hoverBg: 'rgba(133, 244, 198, 1)'
77715
+ }, {
77716
+ type: 'solid',
77717
+ shape: 'square',
77718
+ size: 'large',
77719
+ text: 'Read More',
77720
+ color: '#ffffff',
77721
+ bg: 'rgba(91, 73, 228, 1)',
77722
+ hoverBg: 'rgba(77, 59, 208, 1)'
77723
+ }, {
77724
+ type: 'solid',
77725
+ shape: 'square',
77726
+ size: 'large',
77727
+ text: 'Read More',
77728
+ color: '#ffffff',
77729
+ bg: 'rgba(142, 67, 237, 1)',
77730
+ hoverBg: 'rgba(122, 52, 212, 1)'
77731
+ }, {
77732
+ type: 'solid',
77733
+ shape: 'square',
77734
+ size: 'large',
77735
+ text: 'Read More',
77736
+ color: 'rgb(24, 24, 27)',
77737
+ bg: 'rgba(191, 245, 110, 1)',
77738
+ hoverBg: 'rgba(183, 236, 103, 1)'
77118
77739
  }];
77119
77740
  let templates = buttonConfigs.map(config => this.generateButton(config));
77120
77741
  const moreTemplates = [];
@@ -78229,9 +78850,10 @@ class SettingsUIGenerator {
78229
78850
  generateForm(pluginName, element, onChange) {
78230
78851
  const plugin = this.runtime.getPlugin(pluginName);
78231
78852
  if (!plugin || !plugin.settings) {
78232
- console.warn(`Plugin "${pluginName}" has no settings schema`);
78233
- return this.createEmptyForm();
78853
+ // console.warn(`Plugin "${pluginName}" has no settings schema`);
78854
+ if (!plugin.editor) return this.createEmptyForm();
78234
78855
  }
78856
+ if (!plugin.settings) plugin.settings = {};
78235
78857
  const form = document.createElement('div');
78236
78858
  form.className = 'cb-settings-form';
78237
78859
 
@@ -78607,6 +79229,7 @@ class SettingsUIGenerator {
78607
79229
  */
78608
79230
  getCurrentValues(element, settings) {
78609
79231
  const values = {};
79232
+ if (!settings) return values;
78610
79233
  Object.keys(settings).forEach(key => {
78611
79234
  if (key.startsWith('_')) return;
78612
79235
  const attrName = 'data-cb-' + key.replace(/([A-Z])/g, '-$1').toLowerCase();
@@ -80990,8 +81613,10 @@ class Element$1 {
80990
81613
  subblock = true;
80991
81614
  }
80992
81615
  }
80993
- if (elm.closest('[data-cb-type]')) {
81616
+ const plugin = elm.closest('[data-cb-type]');
81617
+ if (plugin) {
80994
81618
  customcode = true;
81619
+ subblock = elm.closest('.is-subblock');
80995
81620
  }
80996
81621
  if (!customcode && !noedit && !_protected || subblock) {
80997
81622
  //previously this is commented: && !noedit && !_protected
@@ -85104,6 +85729,7 @@ class ColumnTool {
85104
85729
  }
85105
85730
  click(col) {
85106
85731
  this.columnTool = col.parentNode.querySelector('.is-col-tool');
85732
+ if (!this.columnTool) return;
85107
85733
  this.columnTool.style.left = col.offsetLeft + 'px';
85108
85734
  this.columnTool.style.top = col.offsetTop + 'px';
85109
85735
  const btnAdd = this.columnTool.querySelector('.cell-add');
@@ -90099,6 +90725,40 @@ class ElementTool {
90099
90725
  dom.addClass(quickadd, 'center');
90100
90726
  }
90101
90727
  quickadd.setAttribute('data-mode', 'elm');
90728
+ const plugin = builder.activeElement && builder.activeElement.closest('[data-cb-type]');
90729
+ const btnAddHeadline = quickadd.querySelector('.add-headline');
90730
+ const btnAddQuote = quickadd.querySelector('.add-quote');
90731
+ const btnAddTable = quickadd.querySelector('.add-table');
90732
+ const btnAddCode = quickadd.querySelector('.add-code');
90733
+ const btnAddForm = quickadd.querySelector('.add-form');
90734
+ const btnAddMap = quickadd.querySelector('.add-map');
90735
+ const btnAddYoutube = quickadd.querySelector('.add-youtube');
90736
+ const btnAddVideo = quickadd.querySelector('.add-video');
90737
+ const btnAddMore = quickadd.querySelector('.add-more');
90738
+ const separator = quickadd.querySelector('.pop-separator');
90739
+ if (plugin) {
90740
+ if (btnAddHeadline) btnAddHeadline.style.display = 'none';
90741
+ if (btnAddQuote) btnAddQuote.style.display = 'none';
90742
+ if (btnAddCode) btnAddCode.style.display = 'none';
90743
+ if (btnAddTable) btnAddTable.style.display = 'none';
90744
+ if (btnAddForm) btnAddForm.style.display = 'none';
90745
+ if (btnAddMap) btnAddMap.style.display = 'none';
90746
+ if (btnAddYoutube) btnAddYoutube.style.display = 'none';
90747
+ if (btnAddVideo) btnAddVideo.style.display = 'none';
90748
+ if (btnAddMore) btnAddMore.style.display = 'none';
90749
+ if (separator) separator.style.display = 'none';
90750
+ } else {
90751
+ if (btnAddHeadline) btnAddHeadline.style.display = '';
90752
+ if (btnAddQuote) btnAddQuote.style.display = '';
90753
+ if (btnAddCode) btnAddCode.style.display = '';
90754
+ if (btnAddTable) btnAddTable.style.display = '';
90755
+ if (btnAddForm) btnAddForm.style.display = '';
90756
+ if (btnAddMap) btnAddMap.style.display = '';
90757
+ if (btnAddYoutube) btnAddYoutube.style.display = '';
90758
+ if (btnAddVideo) btnAddVideo.style.display = '';
90759
+ if (btnAddMore) btnAddMore.style.display = '';
90760
+ if (separator) separator.style.display = '';
90761
+ }
90102
90762
 
90103
90763
  //handleQuickAddClickOut
90104
90764
  const handleQuickAddClickOut = e => {
@@ -90139,7 +90799,15 @@ class ElementTool {
90139
90799
  if (elm.closest('.is-subblock')) {
90140
90800
  subblock = true;
90141
90801
  }
90142
-
90802
+ const plugin = elm.closest('[data-cb-type]');
90803
+ if (plugin && subblock) {
90804
+ elm.remove();
90805
+ this.elementTool.style.display = 'none';
90806
+ //Trigger Change event
90807
+ this.builder.opts.onChange();
90808
+ if (this.builder.onSelectChange) this.builder.onSelectChange();
90809
+ return;
90810
+ }
90143
90811
  /*
90144
90812
  if(dom.hasClass(elm.parentNode, 'cell-active') || elm.parentNode.hasAttribute('data-subblock')) {
90145
90813
  // Level 1
@@ -90494,11 +91162,11 @@ class ElementTool {
90494
91162
  }
90495
91163
  let subblock = false;
90496
91164
  //if(dom.parentsHasAttribute(elm, 'data-subblock')) {
90497
- if (dom.parentsHasClass(elm, 'is-subblock')) {
91165
+ if (elm.closest('.is-subblock') && !elm.classList.contains('is-subblock')) {
90498
91166
  subblock = true;
90499
91167
  }
90500
91168
  const plugin = elm.closest('[data-cb-type]');
90501
- if ((customcode || noedit || _protected) && !subblock) ; else if (plugin) {
91169
+ if ((customcode || noedit || _protected) && !subblock) ; else if (plugin && !subblock) {
90502
91170
  activeElement = plugin;
90503
91171
  } else {
90504
91172
  const tagName = elm.tagName.toLowerCase();
@@ -90651,6 +91319,14 @@ class ElementTool {
90651
91319
  let elementTool = this.elementTool;
90652
91320
  let elm = this.builder.activeElement;
90653
91321
  if (!elm) return;
91322
+ const editableArea = elm.closest('[data-edit-actions]');
91323
+ if (editableArea) {
91324
+ const editActions = editableArea.dataset.editActions || '';
91325
+ if (editActions.includes('no-add')) {
91326
+ // Adding elements is disabled
91327
+ return;
91328
+ }
91329
+ }
90654
91330
  if (elm.closest('.is-dock')) return;
90655
91331
  // if(elm.closest('[data-cb-type]')) return;
90656
91332
 
@@ -124841,6 +125517,25 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
124841
125517
  }
124842
125518
  applyBehaviorOn(builder) {
124843
125519
  const util = this.util;
125520
+ if (builder.closest('[data-cb-type]')) {
125521
+ // Fix buttons not wrapped in <div style="white-space: nowrap;">
125522
+ let linkButtons = builder.querySelectorAll('a[role="button"]');
125523
+ Array.prototype.forEach.call(linkButtons, btn => {
125524
+ if (btn.parentNode && btn.parentNode === builder) {
125525
+ btn.outerHTML = `
125526
+ <div style="white-space: nowrap;">
125527
+ ${btn.outerHTML}
125528
+ </div>
125529
+ `;
125530
+ }
125531
+ });
125532
+ linkButtons = builder.querySelectorAll('a[role="button"]');
125533
+ Array.prototype.forEach.call(linkButtons, btn => {
125534
+ btn.parentNode.setAttribute('contenteditable', 'false');
125535
+ btn.setAttribute('contenteditable', 'true');
125536
+ });
125537
+ return;
125538
+ }
124844
125539
 
124845
125540
  // upload
124846
125541
  if (this.opts.onImageUpload) {
@@ -125372,7 +126067,21 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
125372
126067
  newCol.children[0].click();
125373
126068
  }, 400);
125374
126069
  } else {
125375
- newCol.children[0].click(); // Focus on first element
126070
+ const spacer = newCol.querySelector('.spacer');
126071
+ setTimeout(() => {
126072
+ try {
126073
+ if (spacer) {
126074
+ if (newCol.parentNode.nextElementSibling) {
126075
+ const elm = newCol.parentNode.nextElementSibling.querySelector('h1,h2,h3,h4,h5,h6,p,img,[data-cb-type]');
126076
+ if (elm) elm.click();else newCol.click();
126077
+ }
126078
+ } else {
126079
+ newCol.children[0].click(); // Focus on first element
126080
+ }
126081
+ } catch (e) {
126082
+ // Do Nothing
126083
+ }
126084
+ }, 400);
125376
126085
  }
125377
126086
  }
125378
126087
  }
@@ -129865,7 +130574,7 @@ Please obtain a license at: https://innovastudio.com/contentbox`);
129865
130574
  if (lockIndicator) lockIndicator.style.display = '';
129866
130575
  let linkTool = this.doc.querySelector('#divLinkTool');
129867
130576
  if (linkTool) linkTool.style.display = '';
129868
- let spacerTool = this.builderStuff.querySelector('.is-spacer-tool');
130577
+ let spacerTool = this.doc.querySelector('.is-spacer-tool');
129869
130578
  if (spacerTool) spacerTool.style.display = '';
129870
130579
  this.element.image.hideImageTool();
129871
130580
  this.doc.querySelectorAll('.icon-active').forEach(elm => elm.classList.remove('icon-active'));
@@ -130111,6 +130820,10 @@ class ContentStuff {
130111
130820
  overflow-y: unset !important;
130112
130821
  }
130113
130822
 
130823
+ [data-cb-type] .elm-active:not(button) {
130824
+ background: rgba(200, 200, 201, 0.11);
130825
+ }
130826
+
130114
130827
  `; // .is-wrapper.is-edit > div {
130115
130828
  // overflow-x: unset;
130116
130829
  // overflow-y: unset;
@@ -157031,7 +157744,7 @@ class IframePanel {
157031
157744
  .is-content-view {
157032
157745
  transition: all 300ms ease 0s;
157033
157746
  /* overflow: hidden; */
157034
- background: #f5f5f5;
157747
+ background: #fff;
157035
157748
  position: relative;
157036
157749
  ${this.builder.controlPanel ? 'margin-top: 6vh;' : 'margin-top:10vh;'}
157037
157750
  transform-origin: top;
@@ -160328,7 +161041,7 @@ class ContentBox {
160328
161041
  'title': 'Sections'
160329
161042
  }, {
160330
161043
  'name': 'snippet',
160331
- 'title': 'Content Blocks'
161044
+ 'title': 'Blocks'
160332
161045
  }, {
160333
161046
  'name': 'typography',
160334
161047
  'title': 'Typography'
@@ -160451,7 +161164,7 @@ class ContentBox {
160451
161164
  {
160452
161165
  id: 1,
160453
161166
  designId: 2,
160454
- name: 'Header'
161167
+ name: 'Hero'
160455
161168
  }, {
160456
161169
  id: 2,
160457
161170
  designId: 1,
@@ -160506,7 +161219,8 @@ class ContentBox {
160506
161219
  ['#282828','dark','contentbuilder/themes/dark.css'],
160507
161220
  ],
160508
161221
  */
160509
- backgroundColor: '#f1f1f1',
161222
+ backgroundColor: 'transparent',
161223
+ //'#f1f1f1',
160510
161224
  imageselect: '',
160511
161225
  fileselect: '',
160512
161226
  imageSelect: '',
@@ -163854,27 +164568,7 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
163854
164568
  }
163855
164569
 
163856
164570
  dom.addClass(this.wrapperEl, 'is-wrapper');
163857
- dom.addClass(this.wrapperEl, 'is-edit'); //Extend onRender with built-in plugins
163858
-
163859
- let old = this.settings.onRender;
163860
-
163861
- this.settings.onRender = () => {
163862
- old.call(this); // call user's defined onRender
163863
-
163864
- try {
163865
- // Built-in onRender
163866
- //Run parts of box(-flex).js
163867
- this.boxRender(); // //Run built-in plugin inside the builder
163868
- // setTimeout(()=>{
163869
- // if (this.win.skrollr) {
163870
- // let obj = this.win.skrollr.get();
163871
- // if(obj) obj.refresh();
163872
- // }
163873
- // }, 100);
163874
- } catch (e) {// Do Nothing
163875
- }
163876
- }; //Extend onChange
163877
-
164571
+ dom.addClass(this.wrapperEl, 'is-edit'); //Extend onChange
163878
164572
 
163879
164573
  let old2 = this.settings.onChange;
163880
164574
 
@@ -164032,6 +164726,10 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
164032
164726
  this.controlpanel.objPanelText.getStateTargeted();
164033
164727
  }
164034
164728
 
164729
+ if (this.controlpanel.panelSpacer.classList.contains('active')) {
164730
+ this.controlpanel.objPanelSpacer.getStateTargeted();
164731
+ }
164732
+
164035
164733
  if (this.controlpanel.panelBox.classList.contains('active')) {
164036
164734
  this.controlpanel.objPanelBox.getStateTargeted();
164037
164735
  }
@@ -164100,6 +164798,13 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
164100
164798
 
164101
164799
 
164102
164800
  if (this.topSpace) document.body.classList.add('topspace');
164801
+ window.addEventListener('error', e => {
164802
+ if (e.message === 'Script error.' && e.filename === '') {
164803
+ // Prevent global crash from cross-origin Monaco scripts
164804
+ e.preventDefault();
164805
+ e.stopImmediatePropagation(); // console.warn("Suppressed cross-origin Monaco focus error.");
164806
+ }
164807
+ }, true);
164103
164808
  };
164104
164809
 
164105
164810
  if (this.iframeSrc) {
@@ -164700,7 +165405,15 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
164700
165405
 
164701
165406
  if (this.UIColor) {
164702
165407
  this.editor.setUIColor(this.UIColor.mode, this.UIColor.css);
164703
- }
165408
+ } // Prepare for tooltip
165409
+
165410
+
165411
+ const sidebar = this.builderStuff.querySelector('.is-sidebar');
165412
+ let elms = sidebar.querySelectorAll('[title]');
165413
+ Array.prototype.forEach.call(elms, elm => {
165414
+ elm.setAttribute('data-title', elm.getAttribute('title'));
165415
+ this.editor.tooltip.set(elm, 5, 3);
165416
+ });
164704
165417
  } // editorSetup
164705
165418
  // Live Preview
164706
165419
 
@@ -166263,99 +166976,6 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
166263
166976
  } // pageSetup
166264
166977
 
166265
166978
 
166266
- boxRender() {
166267
- if (!this.linksWithClickListeners) {
166268
- this.linksWithClickListeners = new Set();
166269
- }
166270
-
166271
- const links = this.wrapperEl.querySelectorAll('.is-box .is-overlay a'); // eg. slider links
166272
-
166273
- links.forEach(link => {
166274
- let url = link.getAttribute('href');
166275
-
166276
- if (url.indexOf('#') === 0 || link.classList.contains('glightbox')) ; else {
166277
- if (!this.linksWithClickListeners.has(link)) {
166278
- link.addEventListener('click', e => {
166279
- // Will go to the link
166280
- const answer = window.confirm(out('Do you really want to leave?')); // Cancel the navigation and stay on the same page
166281
-
166282
- if (!answer) {
166283
- e.preventDefault();
166284
- }
166285
-
166286
- e.stopImmediatePropagation();
166287
- });
166288
- this.linksWithClickListeners.add(link); // Mark the listener as added
166289
- }
166290
- }
166291
- });
166292
- const navbar = this.doc.querySelector('.is-section-navbar');
166293
-
166294
- if (navbar) {
166295
- const links = navbar.querySelectorAll('a');
166296
- links.forEach(link => {
166297
- if (!this.linksWithClickListeners.has(link)) {
166298
- link.addEventListener('click', e => {
166299
- let url = link.getAttribute('href');
166300
-
166301
- if (url) {
166302
- if (url.indexOf('#') === 0) {
166303
- // Will go to bookmark
166304
- if (url.indexOf('#section') === 0) {
166305
- let num = url.replace('#section', '');
166306
-
166307
- if (!isNaN(parseInt(num))) {
166308
- let sections = this.doc.querySelectorAll('.is-section');
166309
- let gotoSection;
166310
- let x = 0;
166311
- sections.forEach(function (section) {
166312
- if (!dom.hasClass(section, 'is-section-navbar')) {
166313
- if (x === num - 1) {
166314
- gotoSection = section;
166315
- }
166316
-
166317
- x++;
166318
- }
166319
- });
166320
-
166321
- if (gotoSection) {
166322
- this.scrollTo(gotoSection);
166323
- }
166324
-
166325
- e.preventDefault();
166326
- }
166327
- } else {
166328
- try {
166329
- let bookmark = this.doc.querySelector(url);
166330
-
166331
- if (bookmark) {
166332
- this.scrollTo(bookmark);
166333
- e.preventDefault();
166334
- }
166335
- } catch (e) {// Do Nothing
166336
- }
166337
- }
166338
- } else {
166339
- // Prevent to go to the link
166340
- if (e.target.closest('#is-menu-toggle')) return;
166341
- e.preventDefault();
166342
- e.stopImmediatePropagation();
166343
- }
166344
- } else {
166345
- if (link.closest('.is-menu-search')) ; else {
166346
- if (!e.target.getAttribute('href')) return;
166347
- e.preventDefault();
166348
- e.stopImmediatePropagation();
166349
- }
166350
- }
166351
- });
166352
- this.linksWithClickListeners.add(link); // Mark the listener as added
166353
- }
166354
- });
166355
- }
166356
- } // box
166357
-
166358
-
166359
166979
  addSpace() {// Do Nothing
166360
166980
  // Now is not needed.
166361
166981
  // (Replaced by // Zoom Adjustment)
@@ -166394,20 +167014,21 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
166394
167014
  }, 1000);
166395
167015
  }, delay);
166396
167016
  }
166397
-
167017
+ /*
166398
167018
  defineLastBox(section) {
166399
- const boxes = section.querySelectorAll('.is-box');
166400
- boxes.forEach(box => {
166401
- box.classList.remove('last-box');
166402
- });
166403
-
166404
- if (boxes.length === 0) {
166405
- section.classList.add('last-box');
166406
- } else {
166407
- const lastBox = boxes[boxes.length - 1];
166408
- if (lastBox) lastBox.classList.add('last-box');
166409
- }
167019
+ const boxes = section.querySelectorAll('.is-box');
167020
+ boxes.forEach(box=>{
167021
+ box.classList.remove('last-box');
167022
+ });
167023
+ if(boxes.length===0) {
167024
+ section.classList.add('last-box');
167025
+ } else {
167026
+ const lastBox = boxes[boxes.length-1];
167027
+ if(lastBox) lastBox.classList.add('last-box');
167028
+ }
166410
167029
  }
167030
+ */
167031
+
166411
167032
 
166412
167033
  sectionSetup(section) {
166413
167034
  let tool = section.querySelector('.is-section-tool');
@@ -166425,8 +167046,8 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
166425
167046
  <button type="button" class="btn-section-remove" tabindex="-1" data-title="${out('Remove')}" title="${out('Remove')}">
166426
167047
  <svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-3px;"><use xlink:href="#icon-trash2"></use></svg>
166427
167048
  </button>
166428
- </div>`);
166429
- this.defineLastBox(section);
167049
+ </div>`); // this.defineLastBox(section);
167050
+
166430
167051
  let info = section.querySelector('.is-section-info');
166431
167052
  if (info) info.parentNode.removeChild(info);
166432
167053
  const sectionId = section.getAttribute('id');
@@ -166713,6 +167334,70 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
166713
167334
  if (typePanel.classList.contains('active')) this.sidebar.selectType();
166714
167335
  });
166715
167336
  this.makeSortable(box, true);
167337
+ box.addEventListener('click', e => {
167338
+ const elm = e.target;
167339
+ if (elm.closest('.is-container')) return;
167340
+ let link = elm.closest('a');
167341
+
167342
+ if (link) {
167343
+ let url = link.getAttribute('href');
167344
+
167345
+ if (url) {
167346
+ if (url.indexOf('#') === 0 && url.trim() !== '#') {
167347
+ if (url.indexOf('#section') === 0) {
167348
+ let num = url.replace('#section', '');
167349
+
167350
+ if (!isNaN(parseInt(num))) {
167351
+ let sections = this.doc.querySelectorAll('.is-section');
167352
+ let gotoSection;
167353
+ let x = 0;
167354
+ sections.forEach(function (section) {
167355
+ if (!dom.hasClass(section, 'is-section-navbar')) {
167356
+ if (x === num - 1) {
167357
+ gotoSection = section;
167358
+ }
167359
+
167360
+ x++;
167361
+ }
167362
+ });
167363
+
167364
+ if (gotoSection) {
167365
+ this.scrollTo(gotoSection);
167366
+ }
167367
+
167368
+ e.preventDefault();
167369
+ }
167370
+ } else {
167371
+ let bookmark = this.doc.querySelector(url);
167372
+
167373
+ if (bookmark) {
167374
+ this.scrollTo(bookmark);
167375
+ e.preventDefault();
167376
+ }
167377
+ }
167378
+ } else {
167379
+ /*
167380
+ // Will go to the link
167381
+ const answer = window.confirm(
167382
+ out('Do you really want to leave?')
167383
+ );
167384
+ // Cancel the navigation and stay on the same page
167385
+ if (!answer) {
167386
+ e.preventDefault();
167387
+ }
167388
+ e.stopImmediatePropagation();
167389
+ */
167390
+ const answer = window.confirm(out('Do you want to open the link?'));
167391
+
167392
+ if (answer) {
167393
+ window.open(url, '_blank');
167394
+ }
167395
+
167396
+ e.preventDefault();
167397
+ }
167398
+ }
167399
+ }
167400
+ });
166716
167401
  } // boxSetup
166717
167402
  // Make list inside plugin element sortable
166718
167403
 
@@ -166946,7 +167631,7 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
166946
167631
  let newSection;
166947
167632
  let arrSections = [];
166948
167633
 
166949
- if (newArea.indexOf('is-section-navbar') !== -1) {
167634
+ if (newArea.indexOf('is-section-navbar') !== -1 || newArea.indexOf('data-cb-type="nav-menu"') !== -1) {
166950
167635
  // Insert first
166951
167636
  const sectionNavbar = this.wrapperEl.querySelector('.is-section-navbar');
166952
167637
 
@@ -167488,6 +168173,21 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
167488
168173
  sectionTool.style.display = 'block';
167489
168174
  sectionTool.style.transform = 'scale(' + 1 / zoom + ')';
167490
168175
  sectionTool.style.transformOrigin = 'top right';
168176
+ }
168177
+
168178
+ const btnSectionUp = sectionTool.querySelector('.btn-move-section-up');
168179
+ const btnSectionDown = sectionTool.querySelector('.btn-move-section-down');
168180
+ const btnSectionRemove = sectionTool.querySelector('.btn-section-remove');
168181
+
168182
+ if (box.offsetHeight < 160) {
168183
+ btnSectionUp.style.display = 'none';
168184
+ btnSectionDown.style.display = 'none';
168185
+ btnSectionRemove.style.display = 'none';
168186
+ sectionTool.style.top = '17px'; //'calc(50% - 17px)';
168187
+ } else {
168188
+ btnSectionUp.style.display = '';
168189
+ btnSectionDown.style.display = '';
168190
+ btnSectionRemove.style.display = '';
167491
168191
  } //new box tool
167492
168192
 
167493
168193
 
@@ -167558,6 +168258,14 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
167558
168258
  }
167559
168259
  }
167560
168260
  }
168261
+ }
168262
+
168263
+ const content = box.querySelector('.is-container');
168264
+ const plugin = box.querySelector('[data-cb-type]');
168265
+
168266
+ if (!content && plugin) {
168267
+ boxTool.style.zIndex = -10;
168268
+ boxTool.style.visibility = 'hidden';
167561
168269
  } // tools scaling for iframe
167562
168270
 
167563
168271
 
@@ -168156,7 +168864,12 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
168156
168864
  this.cleanupUnused(); // Clean pinned sections
168157
168865
 
168158
168866
  const wrapperEl = this.wrapperEl.cloneNode(true); // Clone the child element
168867
+ // Pause all videos in the clone immediately
168159
168868
 
168869
+ const videos = wrapperEl.querySelectorAll('video');
168870
+ videos.forEach(video => {
168871
+ video.pause(); // video.muted = true;
168872
+ });
168160
168873
  let pinWraps = wrapperEl.querySelectorAll('.pin-wrap');
168161
168874
  pinWraps.forEach(pinWrap => {
168162
168875
  const sectionElm = pinWrap.firstElementChild;
@@ -168173,7 +168886,9 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
168173
168886
  }
168174
168887
  });
168175
168888
  const html = this.editor.readHtml(wrapperEl, bForView, true); // const html = this.editor.readHtml(this.wrapperEl, bForView, true);
168889
+ // Clean up clone immediately
168176
168890
 
168891
+ wrapperEl.remove();
168177
168892
  return html;
168178
168893
  }
168179
168894
 
@@ -168376,6 +169091,11 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
168376
169091
  elms.forEach(elm => {
168377
169092
  elm.parentNode.removeChild(elm);
168378
169093
  });
169094
+ elms = this.doc.querySelectorAll('.scroll-target, .last-box');
169095
+ elms.forEach(elm => {
169096
+ elm.classList.remove('scroll-target');
169097
+ elm.classList.remove('last-box');
169098
+ });
168379
169099
  }
168380
169100
 
168381
169101
  calculateVisibleArea(rect) {