@innovastudio/contentbox 1.4.35 → 1.4.36

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.
@@ -651,7 +651,10 @@ class SideBar {
651
651
  } // Close all opened sidebar
652
652
 
653
653
 
654
- this.closeSidebar();
654
+ this.closeSidebar(); // Close all modeless dialogs
655
+
656
+ this.builder.editbox.close();
657
+ this.builder.editsection.close();
655
658
  this.builder.animateScroll.close(); // Close anim side panel
656
659
 
657
660
  if (toggle) return;
@@ -3824,7 +3827,17 @@ class EditSection {
3824
3827
  this.builder = builder;
3825
3828
  const builderStuff = this.builder.builderStuff;
3826
3829
  this.builderStuff = builderStuff;
3827
- let html = '<div class="is-modal delsectionconfirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div style="max-width: 450px;">' + '<div style="margin: 20px 0 30px;text-align:center;font-size: 14px;">' + out('Are you sure you want to delete this section?') + '</div>' + '<button title="' + out('Delete') + '" class="input-ok classic">' + out('Delete') + '</button>' + '</div>' + '</div>' + '' + '<div class="is-modal editsection" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div class="is-modal-content" style="max-width:313px;padding:0;">' + '<div class="is-modal-bar is-draggable">' + out('Section Settings') + '</div>' + '<div class="is-tabs clearfix" style="padding-top:37px;" data-group="sectionsettings">' + '<a id="tabSectionGeneral" title="' + out('General') + '" href="" data-content="divSectionGeneral" class="active">' + out('General') + '</a>' + '<a id="tabSectionAnimation" title="' + out('Animation') + '" href="" data-content="divSectionAnimation">' + out('Animation') + '</a>' + '<a id="tabSectionScrollButton" title="' + out('Scroll') + '" href="" data-content="divSectionScrollButton">' + out('Scroll') + '</a>' + '</div>';
3830
+ let html = '<div class="is-modal delsectionconfirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div style="max-width: 450px;">' + '<div style="margin: 20px 0 30px;text-align:center;font-size: 14px;">' + out('Are you sure you want to delete this section?') + '</div>' + '<button title="' + out('Delete') + '" class="input-ok classic">' + out('Delete') + '</button>' + '</div>' + '</div>' + '' + (`
3831
+ <div class="is-modal is-modal-content editsection" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
3832
+ <div class="is-modal-bar is-draggable" draggable="">
3833
+ ${out('Section Settings')}
3834
+ <button class="is-modal-close" tabindex="-1" title="${out('Close')}">
3835
+ <svg class="is-icon-flex" style="width:23px;height:23px;"><use xlink:href="#ion-ios-close-empty"></use></svg>
3836
+ </button>
3837
+ </div>
3838
+ <div style="padding:0;width:100%;">
3839
+
3840
+ ` ) + '<div class="is-tabs clearfix" style="padding-top:37px;" data-group="sectionsettings">' + '<a id="tabSectionGeneral" title="' + out('General') + '" href="" data-content="divSectionGeneral" class="active">' + out('General') + '</a>' + '<a id="tabSectionAnimation" title="' + out('Animation') + '" href="" data-content="divSectionAnimation">' + out('Animation') + '</a>' + '<a id="tabSectionScrollButton" title="' + out('Scroll') + '" href="" data-content="divSectionScrollButton">' + out('Scroll') + '</a>' + '</div>';
3828
3841
  html += '<div id="divSectionGeneral" class="is-tab-content active" data-group="sectionsettings" style="display:flex;padding-top:0">' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Move Section') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Move Up') + '" class="cmd-section-up" style="">&#8593;</button>' + '<button title="' + out('Move Down') + '" class="cmd-section-down">&#8595;</button>' + '<button title="' + out('Move to Top') + '" class="cmd-section-top"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">&#8676;</span></button>' + '<button title="' + out('Move to Bottom') + '" class="cmd-section-bottom"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">&#8677;</span></button>' + '<button title="' + out('Duplicate') + '" class="cmd-section-duplicate" style="margin-left:20px;"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-copy-outline"></use></svg></button>' + '</div>' + '</div>';
3829
3842
  html += '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Height') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Auto') + '" class="cmd-section-height" data-value="0">' + out('Auto') + '</button>' + '<button title="20%" class="cmd-section-height" data-value="20">20%</button>' + '<button title="25%" class="cmd-section-height" data-value="25">25%</button>' + '<button title="30%" class="cmd-section-height" data-value="30">30%</button>' + '<button title="40%" class="cmd-section-height" data-value="40">40%</button>' + '<button title="50%" class="cmd-section-height" data-value="50">50%</button>' + '</div>' + '<div style="display:flex">' + '<button title="60%" class="cmd-section-height" data-value="60" style="border-left:none;border-top:none;">60%</button>' + '<button title="70%" class="cmd-section-height" data-value="70" style="border-left:none;border-top:none;">70%</button>' + '<button title="75%" class="cmd-section-height" data-value="75" style="border-left:none;border-top:none;">75%</button>' + '<button title="80%" class="cmd-section-height" data-value="80" style="border-left:none;border-top:none;">80%</button>' + '<button title="90%" class="cmd-section-height" data-value="90" style="border-left:none;border-top:none;">90%</button>' + '<button title="100%" class="cmd-section-height" data-value="100" style="border-left:none;border-top:none;">100%</button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Spacing') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('xxs') + '" class="cmd-box-spacing" data-value="xxs">' + out('xxs') + '</button>' + '<button title="' + out('xs') + '" class="cmd-box-spacing" data-value="default">' + out('xs') + '</button>' + '<button title="' + out('sm') + '" class="cmd-box-spacing" data-value="sm">' + out('sm') + '</button>' + '<button title="' + out('m') + '" class="cmd-box-spacing" data-value="m">' + out('m') + '</button>' + '<button title="' + out('lg') + '" class="cmd-box-spacing" data-value="lg">' + out('lg') + '</button>' + '<button title="' + out('Clear') + '" class="cmd-box-spacing" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>';
3830
3843
  html += '<div class="div-section-spacesettings" style="display:flex;flex-direction:column;">' + '<div class="div-multi-boxes">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Between Boxes') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('space') + '" class="cmd-betweenbox-spacing" data-value="space">' + out('space') + '</button>' + '<button title="' + out('no space') + '" class="cmd-betweenbox-spacing" data-value="no-space">' + out('no space') + '</button>' + '</div>' + '</div>' + '<div style="display:none;padding-top:20px;padding-bottom: 3px;">' + out('Stack') + ':</div>' + '<div style="display:none">' + '<button title="' + out('top') + '" class="cmd-section-stack" data-value="top">' + out('top') + '</button>' + '<button title="' + out('middle') + '" class="cmd-section-stack" data-value="middle">' + out('middle') + '</button>' + '<button title="' + out('bottom') + '" class="cmd-section-stack" data-value="bottom">' + out('bottom') + '</button>' + '<button title="' + out('Clear') + '" class="cmd-section-stack" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Background Color') + ':</div>' + '<div style="display:flex;">' + '<button title="' + out('Background Color') + '" class="input-section-bgcolor is-btn-color" style="margin-right:15px"></button>' + '<button title="' + out('Gradient') + '" class="input-section-gradient classic" data-value="+">' + out('Gradient') + '</button>' + '</div>' + '</div>' + '</div>' + '<div id="divSectionAnimation" class="is-tab-content" data-group="sectionsettings" style="display:none;padding-top:0">' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Start') + ':</div>' + '<div style="display:flex;flex-flow:wrap;">' + '<button title="' + out('Slide Left') + '" class="cmd-section-anim-start" data-value="slide-left">' + out('Slide Left') + '</button>' + '<button title="' + out('Slide Right') + '" class="cmd-section-anim-start" data-value="slide-right">' + out('Slide Right') + '</button>' + '<button title="' + out('Zoom In') + '" class="cmd-section-anim-start" data-value="zoom-in">' + out('Zoom In') + '</button>' + // '<button title="' + out('Zoom Out') + '" class="cmd-section-anim-start" data-value="zoom-out">' + out('Zoom Out') + '</button>' +
@@ -3834,6 +3847,10 @@ class EditSection {
3834
3847
  dom$k.appendHtml(builderStuff, html);
3835
3848
  let modalEditSection = builderStuff.querySelector('.is-modal.editsection');
3836
3849
  this.modalEditSection = modalEditSection;
3850
+ const btnClose = modalEditSection.querySelector('.is-modal-close');
3851
+ if (btnClose) btnClose.addEventListener('click', () => {
3852
+ this.close();
3853
+ });
3837
3854
  new Tabs$1(modalEditSection);
3838
3855
  const tabs = modalEditSection.querySelectorAll('.is-tabs a');
3839
3856
  tabs.forEach(tab => {
@@ -4130,21 +4147,9 @@ class EditSection {
4130
4147
  });
4131
4148
  }
4132
4149
 
4133
- edit() {
4134
- this.builder.hideTools();
4135
- this.builder.sidebar.closeSidebar();
4150
+ read() {
4136
4151
  const activeSection = this.builder.activeSection;
4137
- const modalEditSection = this.modalEditSection; // const elms = this.builder.doc.querySelectorAll('.section-active');
4138
- // elms.forEach(elm=>{
4139
- // dom.removeClass(elm, 'section-active');
4140
- // });
4141
-
4142
- dom$k.addClass(activeSection, 'section-active');
4143
- this.builder.showModal(modalEditSection, false, () => {
4144
- dom$k.removeClass(activeSection, 'section-active');
4145
- this.builder.showTools();
4146
- });
4147
- modalEditSection.focus(); // Clean old unused is-bg-light/dark
4152
+ const modalEditSection = this.modalEditSection; // Clean old unused is-bg-light/dark
4148
4153
 
4149
4154
  let elms = this.builder.activeSection.querySelectorAll('.is-bg-light');
4150
4155
  elms.forEach(elm => {
@@ -4322,8 +4327,32 @@ class EditSection {
4322
4327
  btnSectionBgColor.style.backgroundColor = bgcolor; //preview
4323
4328
  } else {
4324
4329
  btnSectionBgColor.style.backgroundColor = '';
4325
- } // this.builder.scrollTo(activeSection);
4330
+ }
4331
+ }
4332
+
4333
+ close() {
4334
+ const modalEditSection = this.modalEditSection;
4335
+ modalEditSection.style.display = '';
4336
+ }
4337
+
4338
+ edit() {
4339
+ this.builder.wrapperEl.classList.add('hard-select');
4340
+ this.builder.activeBox.classList.add('box-select');
4341
+ this.builder.activeSection.classList.add('section-select');
4342
+ const modalEditSection = this.modalEditSection;
4343
+ modalEditSection.style.display = 'flex'; // const elms = this.builder.doc.querySelectorAll('.section-active');
4344
+ // elms.forEach(elm=>{
4345
+ // dom.removeClass(elm, 'section-active');
4346
+ // });
4347
+
4348
+ modalEditSection.focus();
4349
+ this.read(); // Animate
4326
4350
 
4351
+ const activeSection = this.builder.activeSection;
4352
+ activeSection.classList.add('section-active');
4353
+ setTimeout(() => {
4354
+ activeSection.classList.remove('section-active');
4355
+ }, 1000); // this.builder.scrollTo(activeSection);
4327
4356
  }
4328
4357
 
4329
4358
  sectionUp() {
@@ -4439,7 +4468,19 @@ class EditSection {
4439
4468
 
4440
4469
  this.builder.settings.onRender();
4441
4470
  this.builder.hideModal(this.modalEditSection);
4442
- this.builder.scrollTo(section, 600);
4471
+ this.builder.scrollTo(section, 600); // Change
4472
+
4473
+ activeSection.classList.remove('section-select');
4474
+ activeSection.classList.remove('box-select');
4475
+ const prevBox = activeSection.querySelector('.box-select');
4476
+ if (prevBox) prevBox.classList.remove('box-select');
4477
+ this.builder.activeSection = section;
4478
+
4479
+ if (section.classList.contains('box-select')) {
4480
+ this.builder.activeBox = section;
4481
+ } else {
4482
+ this.builder.activeBox = section.querySelector('.box-select');
4483
+ }
4443
4484
  }
4444
4485
 
4445
4486
  sectionAnimStart(s) {
@@ -10209,7 +10250,17 @@ class EditBox {
10209
10250
  </form>
10210
10251
  `;
10211
10252
  html += '<iframe id="target-upload-cover" name="target-upload-cover" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>';
10212
- html += '<div class="is-modal editcustomcode" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div style="max-width:900px;height:570px;padding:0;box-sizing:border-box;position:relative;">' + '<div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">' + out('Custom Code (Javascript Allowed)') + '</div>' + '<textarea id="txtBoxCustomCode" class="inptxt" style="background: #fff;position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-bottom:60px solid transparent;border-top:40px solid transparent;box-sizing:border-box;"></textarea>' + '<input id="hidBoxCustomCode" type="hidden" />' + '<button class="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">' + out('Ok') + '</button>' + '</div>' + '</div>' + '<div class="is-modal editbox" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div class="is-modal-content" style="max-width:380px;min-height:300px;padding:0">' + '<div class="is-modal-bar is-draggable">' + out('Box Settings') + '</div>' + '<div class="is-tabs clearfix" style="padding-top:37px;" data-group="boxsettings">' + '<a id="tabBoxGeneral" href="" data-content="divBoxGeneral" class="active">' + out('General') + '</a>' + '<a id="tabBoxContentContainer" href="" data-content="divBoxContentContainer">' + out('Content') + '</a>' + '<a id="tabBoxContentText" href="" data-content="divBoxContentText">' + out('Text') + '</a>' + '<a id="tabBoxImage" href="" data-content="divBoxImage">' + out('Image') + '</a>' + '<a id="tabBoxAnimate" href="" data-content="divBoxAnimate">' + out('Animate') + '</a>' + '<a id="tabBoxClick" href="" data-content="divBoxClick">' + out('On Click') + '</a>' + '</div>' + '<div id="divBoxGeneral" class="is-tab-content active" data-group="boxsettings" style="display:flex;padding-top:0">' + '<div style="display:flex">' + '<div id="divBoxSize" style="margin-right: 50px;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Box Size') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Decrease') + '" class="cmd-box-smaller" style="width:40px;">-</button>' + '<button title="' + out('Increase') + '" class="cmd-box-larger" style="width:40px;border-left:none">+</button>' + '<br style="clear:both">' + '</div>' + '</div>' + '<div id="divBoxMove">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Move') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Left') + '" class="cmd-box-left" style="width:40px;">←</button>' + '<button title="' + out('Right') + '" class="cmd-box-right" style="width:40px;border-left:none">→</button>' + '<br style="clear:both">' + '</div>' + '</div>' + '</div>';
10253
+ html += '<div class="is-modal editcustomcode" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div style="max-width:900px;height:570px;padding:0;box-sizing:border-box;position:relative;">' + '<div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">' + out('Custom Code (Javascript Allowed)') + '</div>' + '<textarea id="txtBoxCustomCode" class="inptxt" style="background: #fff;position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-bottom:60px solid transparent;border-top:40px solid transparent;box-sizing:border-box;"></textarea>' + '<input id="hidBoxCustomCode" type="hidden" />' + '<button class="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">' + out('Ok') + '</button>' + '</div>' + '</div>' + (`
10254
+ <div class="is-modal is-modal-content editbox" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
10255
+ <div class="is-modal-bar is-draggable" draggable="">
10256
+ ${out('Box Settings')}
10257
+ <button class="is-modal-close" tabindex="-1" title="${out('Close')}">
10258
+ <svg class="is-icon-flex" style="width:23px;height:23px;"><use xlink:href="#ion-ios-close-empty"></use></svg>
10259
+ </button>
10260
+ </div>
10261
+ <div style="padding:0;width:100%;">
10262
+
10263
+ ` ) + '<div style="padding:0;width:100%;">' + '<div class="is-tabs clearfix" style="padding-top:37px;" data-group="boxsettings">' + '<a id="tabBoxGeneral" href="" data-content="divBoxGeneral" class="active">' + out('General') + '</a>' + '<a id="tabBoxContentContainer" href="" data-content="divBoxContentContainer">' + out('Content') + '</a>' + '<a id="tabBoxContentText" href="" data-content="divBoxContentText">' + out('Text') + '</a>' + '<a id="tabBoxImage" href="" data-content="divBoxImage">' + out('Image') + '</a>' + '<a id="tabBoxAnimate" href="" data-content="divBoxAnimate">' + out('Animate') + '</a>' + '<a id="tabBoxClick" href="" data-content="divBoxClick">' + out('On Click') + '</a>' + '</div>' + '<div id="divBoxGeneral" class="is-tab-content active" data-group="boxsettings" style="display:flex;padding-top:0">' + '<div style="display:flex">' + '<div id="divBoxSize" style="margin-right: 50px;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Box Size') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Decrease') + '" class="cmd-box-smaller" style="width:40px;">-</button>' + '<button title="' + out('Increase') + '" class="cmd-box-larger" style="width:40px;border-left:none">+</button>' + '<br style="clear:both">' + '</div>' + '</div>' + '<div id="divBoxMove">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Move') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Left') + '" class="cmd-box-left" style="width:40px;">←</button>' + '<button title="' + out('Right') + '" class="cmd-box-right" style="width:40px;border-left:none">→</button>' + '<br style="clear:both">' + '</div>' + '</div>' + '</div>';
10213
10264
  html += '<div id="divContentSize">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Content Size') + ': &nbsp;<span class="val-box-size" style="font-size:12px"></span></div>' + '<div style="display: flex;flex-direction: row;flex-wrap: wrap;">' + '<input class="inp-box-size" type="text" style="display:none;width:80px;height:35px;text-align:center;font-size:12px;" />' + '<button class="cmd-box-size" data-value="500" style="width:40px;border-left:none">500</button>' + '<button class="cmd-box-size" data-value="600" style="width:40px;border-left:none">600</button>' + '<button class="cmd-box-size" data-value="700" style="width:40px;border-left:none">700</button>' + '<button class="cmd-box-size" data-value="800" style="width:40px;border-top:none">800</button>' + '<button class="cmd-box-size" data-value="900" style="width:40px;border-top:none">900</button>' + '<button class="cmd-box-size" data-value="1000" style="width:40px;border-top:none;border-left:none">1000</button>' + '<button class="cmd-box-size" data-value="1100" style="width:40px;border-top:none;border-left:none">1100</button>' + '<button class="cmd-box-size" data-value="1200" style="width:40px;border-top:none;border-left:none">1200</button>' + '<button class="cmd-box-size" data-value="1300" style="width:40px;border-top:none;border-left:none">1300</button>' + '<button class="cmd-box-size" data-value="1400" style="width:40px;border-top:none;border-left:none">1400</button>' + '<button class="cmd-box-size" data-value="1500" style="width:40px;border-top:none;border-left:none">1500</button>' + '<button class="cmd-box-size" data-value="1600" style="width:40px;border-top:none;border-left:none">1600</button>' + '<button class="cmd-box-size" data-value="1800" style="width:40px;border-top:none;border-left:none">1800</button>' + '<button title="' + out('Clear') + '" class="cmd-box-size" data-value=""><svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button>' + '<button title="' + out('Decrease') + '" class="cmd-box-size" data-value="-" style="width:40px;border-top:none;border-left:none">-</button>' + '<button title="' + out('Increase') + '"class="cmd-box-size" data-value="+" style="width:40px;border-top:none;border-left:none">+</button>' + '<br style="clear:both">' + '</div>' + '</div>';
10214
10265
  html += '<div id="divBoxBackgroundColor">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Background Color') + ':</div>' + '<div style="display:flex;">' + '<button title="' + out('Background Color') + '" class="input-box-bgcolor is-btn-color" style="margin-right:15px"></button>' + '<button title="' + out('Gradient') + '" class="input-box-gradient classic" data-value="+">' + out('Gradient') + '</button>' + '</div>' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Background Image') + ':</div>' + '<div style="height:auto">' + '<div style="display:flex;align-items:flex-end;">' + '<div class="box-bgimage-preview"></div>' + '<label class="label-box-bgimage-grayscale label-checkbox" for="chkBoxBgImageGrayscale" style="margin:0;margin-left:8px;margin-bottom:5px;"><input id="chkBoxBgImageGrayscale" class="chk-box-bgimage-grayscale" type="checkbox" /> ' + out('Grayscale') + '</label>' + '</div>' + '<div style="display:flex;align-items: flex-end;">' + '<button title="' + out('Image') + '" class="input-box-bgimage">' + '<svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg>' + '<span>' + out('Image') + '</span>' + '</button>' + '<button title="' + out('Select') + '" class="input-select">' + '<svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg>' + '</button>' + '<button title="' + out('Remove') + '" class="input-box-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>' + '<button title="' + out('Adjust') + '" class="input-box-bgimageadjust"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>' + '</div>' + '</div>' + '</div>' + '<div id="divBoxPickPhoto" class="is-settings" style="padding-top:20px">' + '<button class="cmd-box-pickphoto" data-value="" style="width:100%"><svg class="is-icon-flex" style=""><use xlink:href="#ion-image"></use></svg></button>' + '</div>' + '<div style="display:flex;justify-content:flex-end;">' + '<button title="' + out('Add Text') + '" class="cmd-box-addtext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#ion-android-add"></use></svg> <span>' + out('Text') + '</span></button>' + '<button title="' + out('Remove Text') + '" class="cmd-box-removetext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:9px;height:9px;"><use xlink:href="#icon-clean"></use></svg> <span>' + out('Text') + '</span></button>' + '<button title="' + out('Add Code') + '" class="cmd-box-addcode" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#ion-android-add"></use></svg> <span>' + out('Code') + '</span></button>' + '<button title="' + out('Remove Code') + '" class="cmd-box-removecode" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:9px;height:9px;"><use xlink:href="#icon-clean"></use></svg> <span>' + out('Code') + '</span></button>' + '</div>' + '<p id="divNoBoxSettings" style="text-align: center;display:none;">' + out('This box has no available settings.') + '</p>' + '</div>';
10215
10266
  html += '<div id="divBoxClick" class="is-tab-content" data-group="boxsettings" style="padding-top:0">' + '<label for="inpBoxLinkSource" style="display:block;padding-top:20px;">' + out('Open') + ':</label>' + '<div class="image-src" style="display:flex">' + '<input id="inpBoxLinkSource" class="input-src" type="text" style="height:38px">' + '<button title="' + out('Select') + '" class="input-select" style="flex:none;width:40px;height:38px;background:transparent;"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>' + '<div class="image-larger5" style="position: relative; flex: 0 0 auto; width: 40px; height: 38px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">' + '<form class="form-upload-larger" target="frameTargetBoxLinkUpload" method="post" action="' + this.builder.largerImageHandler + '" enctype="multipart/form-data" style="position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;">' + '<input id="hidRefId5_box" name="hidRefId" type="hidden" value="">' + '<svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>' + '<input onclick="blur()" title="' + out('Select') + '" id="fileImage5" name="fileImage" type="file" accept="image/*,video/mp4" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">' + '</form>' + '<iframe id="frameTargetBoxLinkUpload" tabindex="-1" name="frameTargetBoxLinkUpload" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>' + '</div>' + '</div>' + '<div style="padding-top:20px">' + '<button class="cmd-box-testclick">' + out('Test') + '</button>' + '</div>' + '</div>';
@@ -10297,7 +10348,11 @@ class EditBox {
10297
10348
  const divBoxClick = modalEditBox.querySelector('#divBoxClick');
10298
10349
  this.divBoxClick = divBoxClick;
10299
10350
  const divBoxGeneral = modalEditBox.querySelector('#divBoxGeneral');
10300
- this.divBoxGeneral = divBoxGeneral; // ------ Box Cover Upload -------
10351
+ this.divBoxGeneral = divBoxGeneral;
10352
+ const btnClose = modalEditBox.querySelector('.is-modal-close');
10353
+ if (btnClose) btnClose.addEventListener('click', () => {
10354
+ this.close();
10355
+ }); // ------ Box Cover Upload -------
10301
10356
 
10302
10357
  let fileCover = builderStuff.querySelector('.input-file-cover-central');
10303
10358
 
@@ -10305,6 +10360,10 @@ class EditBox {
10305
10360
  fileCover = this.builder.contentStuff.querySelector('.input-file-cover-central');
10306
10361
  }
10307
10362
 
10363
+ let btnCoverCentral = builderStuff.querySelector('.is-cover-upload-central');
10364
+ if (btnCoverCentral) btnCoverCentral.addEventListener('mouseleave', () => {
10365
+ btnCoverCentral.style.left = 0;
10366
+ });
10308
10367
  if (fileCover) fileCover.addEventListener('click', () => {
10309
10368
  this.targetBox = this.builder.activeBox;
10310
10369
  });
@@ -11967,10 +12026,7 @@ class EditBox {
11967
12026
  });
11968
12027
  }
11969
12028
 
11970
- edit() {
11971
- this.builder.hideTools();
11972
- this.targetBox = null;
11973
- this.builder.sidebar.closeSidebar();
12029
+ read() {
11974
12030
  const builderStuff = this.builderStuff;
11975
12031
  const modalEditBox = builderStuff.querySelector('.is-modal.editbox');
11976
12032
  const activeBox = this.builder.activeBox;
@@ -12267,33 +12323,6 @@ class EditBox {
12267
12323
  // });
12268
12324
 
12269
12325
 
12270
- dom$j.addClass(activeBox, 'box-active');
12271
- this.builder.showModal(modalEditBox, false, () => {
12272
- dom$j.removeClass(activeBox, 'box-active');
12273
- this.builder.showTools();
12274
- });
12275
- /*
12276
- // Experimental
12277
- modalEditBox.style.display = 'flex';
12278
- document.body.classList.add('side-open');
12279
- let panel = modalEditBox.querySelector('.is-modal-content');
12280
- setTimeout(()=>{
12281
- this.builder.showModal(modalEditBox, false, ()=>{
12282
- dom.removeClass(activeBox, 'box-active');
12283
-
12284
- this.builder.showTools();
12285
- document.body.classList.remove('side-open');
12286
- this.builder.wrapperEl.style.transition = 'none';
12287
- setTimeout(()=>{
12288
- modalEditBox.style.display = '';
12289
- this.builder.wrapperEl.style.transition = '';
12290
- }, 200);
12291
- });
12292
- }, 10);
12293
- */
12294
-
12295
- modalEditBox.focus();
12296
-
12297
12326
  if (container) {
12298
12327
  modalEditBox.querySelector('.val-box-size').innerHTML = '';
12299
12328
  container.classList.forEach(item => {
@@ -12579,6 +12608,49 @@ class EditBox {
12579
12608
  if (modalEditBox.querySelector('#divBoxContentContainer').style.display === 'flex' && modalEditBox.querySelector('#tabBoxContentContainer').style.display === 'none') {
12580
12609
  modalEditBox.querySelector('#tabBoxGeneral').click();
12581
12610
  }
12611
+ }
12612
+
12613
+ close() {
12614
+ const modalEditBox = this.modalEditBox;
12615
+ modalEditBox.style.display = '';
12616
+ }
12617
+
12618
+ edit() {
12619
+ this.builder.wrapperEl.classList.add('hard-select');
12620
+ this.builder.activeBox.classList.add('box-select');
12621
+ this.builder.activeSection.classList.add('section-select');
12622
+ const modalEditBox = this.modalEditBox;
12623
+ this.targetBox = null;
12624
+ this.builder.sidebar.closeSidebar();
12625
+ this.read(); // Animate
12626
+
12627
+ const activeBox = this.builder.activeBox;
12628
+ activeBox.classList.add('box-active');
12629
+ setTimeout(() => {
12630
+ activeBox.classList.remove('box-active');
12631
+ }, 1000);
12632
+ modalEditBox.style.display = 'flex';
12633
+ /*
12634
+ // Experimental
12635
+ modalEditBox.style.display = 'flex';
12636
+ document.body.classList.add('side-open');
12637
+ let panel = modalEditBox.querySelector('.is-modal-content');
12638
+ setTimeout(()=>{
12639
+ this.builder.showModal(modalEditBox, false, ()=>{
12640
+ dom.removeClass(activeBox, 'box-active');
12641
+
12642
+ this.builder.showTools();
12643
+ document.body.classList.remove('side-open');
12644
+ this.builder.wrapperEl.style.transition = 'none';
12645
+ setTimeout(()=>{
12646
+ modalEditBox.style.display = '';
12647
+ this.builder.wrapperEl.style.transition = '';
12648
+ }, 200);
12649
+ });
12650
+ }, 10);
12651
+ */
12652
+
12653
+ modalEditBox.focus();
12582
12654
  } //edit
12583
12655
 
12584
12656
 
@@ -28672,6 +28744,14 @@ class HtmlUtil {
28672
28744
  Array.prototype.forEach.call(elms, elm => {
28673
28745
  dom$h.removeClass(elm, 'section-active');
28674
28746
  });
28747
+ elms = tmp.querySelectorAll('.section-select');
28748
+ Array.prototype.forEach.call(elms, elm => {
28749
+ dom$h.removeClass(elm, 'section-select');
28750
+ });
28751
+ elms = tmp.querySelectorAll('.box-select');
28752
+ Array.prototype.forEach.call(elms, elm => {
28753
+ dom$h.removeClass(elm, 'box-select');
28754
+ });
28675
28755
  elms = tmp.querySelectorAll('.is-section-tool');
28676
28756
  dom$h.removeElements(elms);
28677
28757
  elms = tmp.querySelectorAll('.is-box-tool');
@@ -35385,12 +35465,17 @@ const renderSnippetPanel = builder => {
35385
35465
  if (oldCss) oldCss.parentNode.removeChild(oldCss);
35386
35466
  builder.builderStuff.insertAdjacentHTML('afterbegin', newCss);
35387
35467
  }
35468
+
35469
+ builder.sectionDropSetup();
35388
35470
  },
35389
- onMove: () => {
35471
+ onMove: evt => {
35390
35472
  let emptyinfo = builder.doc.querySelector('.row-add-initial'); // if there is empty info, remove it during snippet drag drop
35391
35473
  // if(emptyinfo) emptyinfo.parentNode.removeChild(emptyinfo);
35392
35474
 
35393
35475
  if (emptyinfo) emptyinfo.style.display = 'none';
35476
+ if (builder.sortableOnPage) if (evt.related.getBoundingClientRect().top < 0 || evt.related.getBoundingClientRect().top > window.innerHeight) {
35477
+ return false;
35478
+ }
35394
35479
  },
35395
35480
  onStart: () => {
35396
35481
  // Remove .builder-active during dragging (because this class makes rows have border-right/left 120px)
@@ -35419,6 +35504,8 @@ const renderSnippetPanel = builder => {
35419
35504
  if (activeBuilderArea) {
35420
35505
  dom.addClass(activeBuilderArea, 'builder-active');
35421
35506
  }
35507
+
35508
+ if (builder.sortableOnPage) builder.sortableOnPage.destroy();
35422
35509
  }
35423
35510
  });
35424
35511
 
@@ -91461,6 +91548,199 @@ class ContentBuilder {
91461
91548
  // return currentScript.replace(currentScriptFile, '');
91462
91549
  }
91463
91550
 
91551
+ sectionDropSetup() {
91552
+ if (this.page) {
91553
+ if (this.page !== '.is-wrapper') return; // only for ContentBox
91554
+
91555
+ const wrapper = this.doc.querySelector(this.page);
91556
+ this.sortableOnPage = new Sortable(wrapper, {
91557
+ scroll: true,
91558
+ group: 'shared',
91559
+ direction: 'vertical',
91560
+ animation: 150,
91561
+ sort: true,
91562
+ // draggable: '.dummy',
91563
+ swapThreshold: 0.1,
91564
+ invertSwap: true,
91565
+ onAdd: evt => {
91566
+ var itemEl = evt.item;
91567
+
91568
+ if (itemEl.querySelector('.is-col-tool')) {
91569
+ let rowTool = itemEl.querySelector('.is-row-tool');
91570
+ let colTool = itemEl.querySelector('.is-col-tool');
91571
+ let rowAddTool = itemEl.querySelector('.is-rowadd-tool');
91572
+ itemEl.removeChild(rowTool);
91573
+ itemEl.removeChild(colTool);
91574
+ itemEl.removeChild(rowAddTool);
91575
+ let elms = itemEl.querySelectorAll('[data-click]');
91576
+ elms.forEach(elm => {
91577
+ elm.removeAttribute('data-click');
91578
+ });
91579
+ itemEl.removeAttribute('draggable');
91580
+ itemEl.classList.remove('row-active');
91581
+ itemEl.classList.remove('row-outline');
91582
+ elms = itemEl.querySelectorAll('.cell-active');
91583
+ elms.forEach(elm => {
91584
+ elm.classList.remove('cell-active');
91585
+ });
91586
+ elms = itemEl.querySelectorAll('*');
91587
+ elms.forEach(elm => {
91588
+ elm.style.cursor = '';
91589
+ });
91590
+ itemEl.outerHTML = `
91591
+ <div class="is-section is-box is-section-100 type-poppins">
91592
+ <div class="is-overlay"></div>
91593
+ <div class="is-boxes">
91594
+ <div class="is-box-centered">
91595
+ <div class="is-container is-content-900 v2 size-18 leading-14">
91596
+ ${itemEl.outerHTML}
91597
+ </div>
91598
+ </div>
91599
+ </div>
91600
+ </div>
91601
+ `;
91602
+ if (this.opts.onSectionAdd) this.opts.onSectionAdd(); // //Trigger Change event
91603
+ // this.opts.onChange();
91604
+ // //Trigger Render event
91605
+ // this.opts.onRender();
91606
+
91607
+ return;
91608
+ }
91609
+
91610
+ if (itemEl.getAttribute('data-id')) {
91611
+ // If has data-id attribute, the dropped item is from snippet panel (snippetpanel.js)
91612
+ let snippetid = itemEl.getAttribute('data-id'); // snippetJSON is snippet's JSON (from assets/minimalist-blocks/content.js) that store all snippets' html
91613
+
91614
+ const result = this.opts.snippetJSON.snippets.filter(item => {
91615
+ if (item.id + '' === snippetid) return item;else return false;
91616
+ });
91617
+ var html = result[0].html;
91618
+ var noedit = result[0].noedit;
91619
+ var bSnippet;
91620
+
91621
+ if (html.indexOf('"row') === -1) {
91622
+ bSnippet = true; // Just snippet (without row/column grid)
91623
+ } else {
91624
+ bSnippet = false; // Snippet is wrapped in row/colum
91625
+ }
91626
+
91627
+ if (this.opts.emailMode) bSnippet = false; // Convert snippet into your defined 12 columns grid
91628
+
91629
+ var rowClass = this.opts.row; //row
91630
+
91631
+ var colClass = this.opts.cols; //['col s1', 'col s2', 'col s3', 'col s4', 'col s5', 'col s6', 'col s7', 'col s8', 'col s9', 'col s10', 'col s11', 'col s12']
91632
+
91633
+ if (rowClass !== '' && colClass.length === 12) {
91634
+ // html = html.replace(new RegExp('row clearfix', 'g'), rowClass);
91635
+ html = html.replace(new RegExp('row clearfix', 'g'), 'row'); // backward
91636
+
91637
+ html = html.replace(new RegExp('"row', 'g'), '"' + rowClass);
91638
+ html = html.replace(new RegExp('column full', 'g'), colClass[11]);
91639
+ html = html.replace(new RegExp('column half', 'g'), colClass[5]);
91640
+ html = html.replace(new RegExp('column third', 'g'), colClass[3]);
91641
+ html = html.replace(new RegExp('column fourth', 'g'), colClass[2]);
91642
+ html = html.replace(new RegExp('column fifth', 'g'), colClass[1]);
91643
+ html = html.replace(new RegExp('column sixth', 'g'), colClass[1]);
91644
+ html = html.replace(new RegExp('column two-third', 'g'), colClass[7]);
91645
+ html = html.replace(new RegExp('column two-fourth', 'g'), colClass[8]);
91646
+ html = html.replace(new RegExp('column two-fifth', 'g'), colClass[9]);
91647
+ html = html.replace(new RegExp('column two-sixth', 'g'), colClass[9]);
91648
+ }
91649
+
91650
+ html = html.replace(/{id}/g, this.util.makeId());
91651
+
91652
+ if (this.opts.onAdd) {
91653
+ html = this.opts.onAdd(html);
91654
+ }
91655
+
91656
+ if (this.opts.snippetPathReplace.length > 0) {
91657
+ // try {
91658
+ if (this.opts.snippetPathReplace[0] !== '') {
91659
+ var regex = new RegExp(this.opts.snippetPathReplace[0], 'g');
91660
+ html = html.replace(regex, this.opts.snippetPathReplace[1]);
91661
+ var string1 = this.opts.snippetPathReplace[0].replace(/\//g, '%2F');
91662
+ var string2 = this.opts.snippetPathReplace[1].replace(/\//g, '%2F');
91663
+ var regex2 = new RegExp(string1, 'g');
91664
+ html = html.replace(regex2, string2);
91665
+ } // } catch (e) { 1; }
91666
+
91667
+ }
91668
+
91669
+ if (bSnippet) {
91670
+ // Just snippet (without row/column grid), ex. buttons, line, social, video, map.
91671
+ // Can be inserted after current row, column (cell), element, or last row.
91672
+ html = `<div class="${this.opts.row}"><div class="${this.opts.cols[this.opts.cols.length - 1]}"${noedit ? ' data-noedit' : ''}>${html}</div></div>`; // Clean snippet from sortable related code
91673
+
91674
+ itemEl.removeAttribute('draggable');
91675
+ this.dom.removeClass(itemEl, 'snippet-item'); // itemEl.outerHTML = html;
91676
+
91677
+ itemEl.outerHTML = `
91678
+ <div class="is-section is-box is-section-100 type-poppins">
91679
+ <div class="is-overlay"></div>
91680
+ <div class="is-boxes">
91681
+ <div class="is-box-centered">
91682
+ <div class="is-container is-content-900 v2 size-18 leading-14">${html}</div>
91683
+ </div>
91684
+ </div>
91685
+ </div>
91686
+ `;
91687
+ } else {
91688
+ // Snippet is wrapped in row/colum (may contain custom code or has [data-html] attribute)
91689
+ // Can only be inserted after current row or last row (not on column or element).
91690
+ let snippet = this.dom.createElement('div');
91691
+ snippet.innerHTML = html;
91692
+ let blocks = snippet.querySelectorAll('[data-html]');
91693
+ Array.prototype.forEach.call(blocks, block => {
91694
+ // Render custom code block
91695
+ html = decodeURIComponent(block.getAttribute('data-html'));
91696
+ html = html.replace(/{id}/g, this.util.makeId());
91697
+
91698
+ for (var i = 1; i <= 20; i++) {
91699
+ html = html.replace('[%HTML' + i + '%]', block.getAttribute('data-html-' + i) === undefined ? '' : decodeURIComponent(block.getAttribute('data-html-' + i))); //render editable area
91700
+ }
91701
+
91702
+ block.innerHTML = html;
91703
+ });
91704
+ html = snippet.innerHTML; // Clean snippet from sortable related code
91705
+
91706
+ itemEl.removeAttribute('draggable');
91707
+ this.dom.removeClass(itemEl, 'snippet-item');
91708
+ itemEl.innerHTML = ''; // Use createContextualFragment() to make embedded script executable
91709
+ // https://ghinda.net/article/script-tags/
91710
+
91711
+ var range = document.createRange();
91712
+ range.setStart(itemEl, 0);
91713
+ itemEl.appendChild(range.createContextualFragment(html)); // itemEl.outerHTML = itemEl.innerHTML;
91714
+
91715
+ itemEl.outerHTML = `
91716
+ <div class="is-section is-box is-section-100 type-poppins">
91717
+ <div class="is-overlay"></div>
91718
+ <div class="is-boxes">
91719
+ <div class="is-box-centered">
91720
+ <div class="is-container is-content-900 v2 size-18 leading-14">${itemEl.innerHTML}</div>
91721
+ </div>
91722
+ </div>
91723
+ </div>
91724
+ `;
91725
+ } // // After snippet has been added, re-apply behavior on builder areas
91726
+ // this.applyBehaviorOn(builder);
91727
+
91728
+
91729
+ if (this.opts.onSectionAdd) this.opts.onSectionAdd(); //Trigger Change event
91730
+
91731
+ this.opts.onChange(); //Trigger Render event
91732
+
91733
+ this.opts.onRender(); // // Hide element tool
91734
+ // this.elmTool.hide();
91735
+ } // this.sortableOnPage.option('draggable', '.dummy');
91736
+
91737
+
91738
+ this.sortableOnPage.destroy();
91739
+ }
91740
+ });
91741
+ }
91742
+ }
91743
+
91464
91744
  }
91465
91745
 
91466
91746
  var pace = {exports: {}};
@@ -92766,53 +93046,68 @@ class ContentStuff {
92766
93046
  50% {transform:scale(0.95);}
92767
93047
  100% {transform:scale(1);}
92768
93048
  }
93049
+
92769
93050
 
92770
- .box-hover {
92771
- outline: 1px solid #00da89;
92772
- outline-offset: -1px;
93051
+ /* Navbar Fix */
93052
+ .is-wrapper.is-edit .is-section.is-section-navbar,
93053
+ .is-wrapper.is-edit .is-section.is-section-navbar .is-topbar {
93054
+ left: 0;
93055
+ margin-left: 60px;
93056
+ width: calc(100% - 60px);
92773
93057
  }
92774
- .is-section:not(.box-space) .box-hover .is-overlay,
92775
- .is-section:not(.box-space).box-hover .is-overlay {
92776
- top: 1px;
92777
- bottom: 1px;
92778
- left: 1px;
92779
- right: 1px;
93058
+ .is-wrapper.is-edit .is-section.is-section-navbar .is-topbar.static {
93059
+ width: 100%;
93060
+ margin-left: unset;
92780
93061
  }
92781
-
92782
- .box-active .is-container {
92783
- border: rgba(0,0,0,0.1) 1px solid;
93062
+
93063
+ /* protected section */
93064
+ .is-section.protected .is-box-tool {
93065
+ display: none !important;
92784
93066
  }
92785
93067
 
92786
- .box-active {
92787
- outline: 1px solid #00da89;
93068
+ /* manual selection during animation edit */
93069
+ .hard-select .is-box-tool {
93070
+ display: none !important;
93071
+ }
93072
+ .hard-select .is-section-tool {
93073
+ display: none !important;
93074
+ }
93075
+ .hard-select .box-select {
93076
+ outline: #00da89 1px solid;
92788
93077
  outline-offset: -1px;
93078
+ z-index: 1;
92789
93079
  }
92790
- .is-section:not(.box-space) .box-active .is-overlay,
92791
- .is-section:not(.box-space).box-active .is-overlay {
92792
- top: 1px;
92793
- bottom: 1px;
92794
- left: 1px;
92795
- right: 1px;
93080
+ .hard-select .box-select .is-box-tool {
93081
+ display: flex !important;
92796
93082
  }
92797
- .section-active {
92798
- outline: 1px solid #00da89;
92799
- outline-offset: -1px;
93083
+ .hard-select .box-select .is-overlay {
93084
+ z-index: -1;
92800
93085
  }
92801
- .is-section:not(.box-space).section-active .is-overlay {
92802
- top: 1px;
92803
- bottom: 1px;
92804
- left: 1px;
92805
- right: 1px;
93086
+ .hard-select .section-select .is-section-tool {
93087
+ display: block !important;
92806
93088
  }
92807
- /*
92808
- .content-edit .is-section-tool,
92809
- .content-edit .is-box-tool {
93089
+
93090
+ /* drop block as section */
93091
+ .is-wrapper > .sortable-ghost {
93092
+ height: 40px !important;
93093
+ min-height: unset !important;
93094
+ background: rgba(204, 204, 204, 0.15) !important;
93095
+ }
93096
+
93097
+ /* toggle tool */
93098
+ .is-wrapper.is-clean-edit .hard-select .box-select .is-box-tool,
93099
+ .is-wrapper.is-clean-edit .box-select .is-box-tool {
92810
93100
  display: none !important;
92811
93101
  }
92812
- */
92813
- .content-edit .box-hover {
93102
+ .is-wrapper.is-clean-edit .hard-select .section-select .is-section-tool,
93103
+ .is-wrapper.is-clean-edit .section-select .is-section-tool {
93104
+ display: none !important;
93105
+ }
93106
+ .is-wrapper.is-clean-edit .hard-select .box-select,
93107
+ .is-wrapper.is-clean-edit .box-select {
92814
93108
  outline: none !important;
92815
93109
  }
93110
+
92816
93111
  `; // .is-wrapper.is-edit > div {
92817
93112
  // overflow-x: unset;
92818
93113
  // overflow-y: unset;
@@ -93033,6 +93328,10 @@ class AnimateScroll {
93033
93328
  </tr>
93034
93329
  </table>
93035
93330
 
93331
+ <div class="flex-wrap" style="margin-top:20px;">
93332
+ <button title="${out('Disable Smooth Animation')}" class="cmd-disable-smoothanim" data-value="data-center" style="width:320px">${out('Disable Smooth Animation')}</button>
93333
+ </div>
93334
+
93036
93335
  <button title="${out('Clear All')}" class="cmd-clear-simplescroll" style="flex: none;margin-top:30px;margin-bottom:20px;width:320px">
93037
93336
  <svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg>
93038
93337
  <span style="margin-left:7px">${out('Clear All')}</span>
@@ -93486,6 +93785,10 @@ class AnimateScroll {
93486
93785
  <button title="${out('Late')}" class="cmd-leave-start" data-value="data-50-top" style="width:74px">${out('Late')}</button>
93487
93786
  <button title="${out('Very Late')}" class="cmd-leave-start" data-value="data-top" style="width:95px">${out('Very Late')}</button>
93488
93787
  </div>
93788
+
93789
+ <div class="flex-wrap" style="margin-top:30px;">
93790
+ <button title="${out('Disable Smooth Animation')}" class="cmd-disable-smoothanim" data-value="data-center" style="width:320px">${out('Disable Smooth Animation')}</button>
93791
+ </div>
93489
93792
  </div>
93490
93793
 
93491
93794
 
@@ -93576,7 +93879,9 @@ class AnimateScroll {
93576
93879
  const btnClose = modalAnimateScroll.querySelector('.is-side-close');
93577
93880
  btnClose.addEventListener('click', () => {
93578
93881
  this.close();
93579
- }); // Target
93882
+ });
93883
+ this.divAnimScrollSimple = modalAnimateScroll.querySelector('#divAnimScrollSimple');
93884
+ this.divAnimSettings = modalAnimateScroll.querySelector('#divAnimSettings'); // Target
93580
93885
 
93581
93886
  let btns = modalAnimateScroll.querySelectorAll('.cmd-target');
93582
93887
  btns.forEach(btn => {
@@ -94618,30 +94923,38 @@ class AnimateScroll {
94618
94923
 
94619
94924
 
94620
94925
  this.builder.settings.onChange();
94926
+ });
94927
+ const btnDisableSmoothAnim = this.divAnimSettings.querySelector('.cmd-disable-smoothanim');
94928
+ btnDisableSmoothAnim.addEventListener('click', () => {
94929
+ if (btnDisableSmoothAnim.classList.contains('on')) {
94930
+ btnDisableSmoothAnim.classList.remove('on');
94931
+ } else {
94932
+ btnDisableSmoothAnim.classList.add('on');
94933
+ }
94934
+
94935
+ this.apply();
94936
+ });
94937
+ const btnDisableSmoothAnim2 = this.divAnimScrollSimple.querySelector('.cmd-disable-smoothanim');
94938
+ btnDisableSmoothAnim2.addEventListener('click', () => {
94939
+ if (btnDisableSmoothAnim2.classList.contains('on')) {
94940
+ btnDisableSmoothAnim2.classList.remove('on');
94941
+ } else {
94942
+ btnDisableSmoothAnim2.classList.add('on');
94943
+ }
94944
+
94945
+ this.applySimpleScroll();
94621
94946
  }); // ---
94622
- //Extend onContentClick
94947
+ //Extend onPageContentClick
94623
94948
 
94624
- let old = this.builder.settings.onContentClick;
94949
+ let old = this.builder.settings.onPageContentClick;
94625
94950
 
94626
- this.builder.settings.onContentClick = () => {
94951
+ this.builder.settings.onPageContentClick = () => {
94627
94952
  if (old) old.call(this); // call user's defined onRender
94628
94953
 
94629
94954
  if (!this.modalAnimateScroll.classList.contains('active')) return;
94630
94955
  setTimeout(() => {
94631
94956
  this.clickContent();
94632
94957
  }, 30);
94633
- }; //Extend onSectionChange
94634
-
94635
-
94636
- let old2 = this.builder.settings.onSectionChange;
94637
-
94638
- this.builder.settings.onSectionChange = () => {
94639
- if (old2) old2.call(this); // call user's defined onRender
94640
-
94641
- if (!this.modalAnimateScroll.classList.contains('active')) return;
94642
- setTimeout(() => {
94643
- this.readAnimOnce();
94644
- }, 30);
94645
94958
  };
94646
94959
  }
94647
94960
 
@@ -94666,6 +94979,18 @@ class AnimateScroll {
94666
94979
  } else if (currentTarget.name === 'container') {
94667
94980
  const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=container]');
94668
94981
  btn.classList.add('on');
94982
+ } else if (currentTarget.name === 'bg') {
94983
+ const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=bg]');
94984
+ btn.classList.add('on');
94985
+ } else if (currentTarget.name === 'overlay') {
94986
+ const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=overlay]');
94987
+ btn.classList.add('on');
94988
+ } else if (currentTarget.name === 'box') {
94989
+ const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=box]');
94990
+ btn.classList.add('on');
94991
+ } else if (currentTarget.name === 'section') {
94992
+ const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=section]');
94993
+ btn.classList.add('on');
94669
94994
  }
94670
94995
  } else {
94671
94996
  // no animation on the selected element
@@ -94674,6 +94999,7 @@ class AnimateScroll {
94674
94999
  }
94675
95000
 
94676
95001
  this.read();
95002
+ this.readAnimOnce();
94677
95003
  }
94678
95004
 
94679
95005
  clearSettings() {
@@ -94822,7 +95148,15 @@ class AnimateScroll {
94822
95148
  if (activeElement.classList.contains('delay-1400ms')) btnDelay = this.modalAnimateScroll.querySelector('.cmd-basic-delay[data-value="delay-1400ms"]');
94823
95149
  if (btnDelay) btnDelay.classList.add('on');
94824
95150
  const btnAnimateOnce = this.modalAnimateScroll.querySelector('.cmd-basic-once');
94825
- if (activeElement.classList.contains('once')) btnAnimateOnce.classList.add('on');else btnAnimateOnce.classList.remove('on'); // Simple Scroll
95151
+ if (activeElement.classList.contains('once')) btnAnimateOnce.classList.add('on');else btnAnimateOnce.classList.remove('on');
95152
+ const btnDisableSmoothAnim = this.modalAnimateScroll.querySelectorAll('.cmd-disable-smoothanim');
95153
+ btnDisableSmoothAnim.forEach(btn => {
95154
+ if (activeElement.hasAttribute('data-smooth-scrolling')) {
95155
+ btn.classList.add('on');
95156
+ } else {
95157
+ btn.classList.remove('on');
95158
+ }
95159
+ }); // Simple Scroll
94826
95160
 
94827
95161
  if (activeElement.hasAttribute('data-bottom-top') && activeElement.hasAttribute('data-top-bottom') && !(activeElement.hasAttribute('data-center-bottom') || activeElement.hasAttribute('data-100-top') || activeElement.hasAttribute('data-50-top') || activeElement.hasAttribute('data-top'))) {
94828
95162
  const inpSimpleScrollX_Start = this.modalAnimateScroll.querySelector('.inp-simplescroll-x-start');
@@ -95257,6 +95591,15 @@ class AnimateScroll {
95257
95591
  let dataEnd = 'data-top-bottom';
95258
95592
  if (sStart !== '') activeElement.setAttribute(dataStart, sStart);else activeElement.removeAttribute(dataStart);
95259
95593
  if (sEnd !== '') activeElement.setAttribute(dataEnd, sEnd);else activeElement.removeAttribute(dataEnd);
95594
+ const btnDisableSmoothAnim = this.divAnimScrollSimple.querySelector('.cmd-disable-smoothanim');
95595
+
95596
+ if (btnDisableSmoothAnim.classList.contains('on')) {
95597
+ activeElement.setAttribute('data-smooth-scrolling', 'off');
95598
+ activeElement.style.transition = '';
95599
+ } else {
95600
+ activeElement.removeAttribute('data-smooth-scrolling');
95601
+ }
95602
+
95260
95603
  activeElement.style.transform = '';
95261
95604
  activeElement.style.transition = '';
95262
95605
  activeElement.style.opacity = '';
@@ -95435,6 +95778,15 @@ class AnimateScroll {
95435
95778
  activeElement.style.opacity = '';
95436
95779
  }
95437
95780
 
95781
+ const btnDisableSmoothAnim = this.divAnimSettings.querySelector('.cmd-disable-smoothanim');
95782
+
95783
+ if (btnDisableSmoothAnim.classList.contains('on')) {
95784
+ activeElement.setAttribute('data-smooth-scrolling', 'off');
95785
+ activeElement.style.transition = '';
95786
+ } else {
95787
+ activeElement.removeAttribute('data-smooth-scrolling');
95788
+ }
95789
+
95438
95790
  if (this.builder.win.skrollrr) {
95439
95791
  this.builder.win.skrollrr.refresh();
95440
95792
  } //Trigger Change event
@@ -95469,7 +95821,7 @@ class AnimateScroll {
95469
95821
 
95470
95822
  if (reCheck) {
95471
95823
  if (reCheck.name === 'element') activeElement = this.builder.editor.activeElement;
95472
- if (reCheck.name === 'inspectedElement') activeElement = this.builder.editor.inspectedElement;
95824
+ if (reCheck.name === 'inspectedElement') activeElement = this.builder.editor.inspectedElement;else activeElement = this.builder.editor.activeElement;
95473
95825
  } else {
95474
95826
  activeElement = this.builder.editor.activeElement;
95475
95827
  }
@@ -95490,31 +95842,27 @@ class AnimateScroll {
95490
95842
  }
95491
95843
 
95492
95844
  if (target === 'overlay') {
95493
- let activeBox = this.builder.activeBox;
95494
- let activeCol = this.builder.editor.activeCol;
95495
- if (activeCol) activeBox = activeCol.closest('.is-box');
95496
- if (activeBox) activeElement = activeBox.querySelector('.is-overlay');
95845
+ let overlay;
95846
+ const box = this.builder.doc.querySelector('.box-select');
95847
+ if (box) overlay = box.querySelector('.is-overlay');
95848
+ if (overlay) activeElement = overlay;
95497
95849
  }
95498
95850
 
95499
95851
  if (target === 'bg') {
95500
- let activeBox = this.builder.activeBox;
95501
- let activeCol = this.builder.editor.activeCol;
95502
- if (activeCol) activeBox = activeCol.closest('.is-box');
95503
- if (activeBox) activeElement = activeBox.querySelector('.is-overlay-bg');
95852
+ let overlayBg;
95853
+ const box = this.builder.doc.querySelector('.box-select');
95854
+ if (box) overlayBg = box.querySelector('.is-overlay-bg');
95855
+ if (overlayBg) activeElement = overlayBg;
95504
95856
  }
95505
95857
 
95506
95858
  if (target === 'box') {
95507
- let activeBox = this.builder.activeBox;
95508
- let activeCol = this.builder.editor.activeCol;
95509
- if (activeCol) activeBox = activeCol.closest('.is-box');
95510
- if (activeBox) activeElement = activeBox;
95859
+ const box = this.builder.doc.querySelector('.box-select');
95860
+ if (box) activeElement = box;
95511
95861
  }
95512
95862
 
95513
95863
  if (target === 'section') {
95514
- let activeSection = this.builder.activeSection;
95515
- let activeCol = this.builder.editor.activeCol;
95516
- if (activeCol) activeSection = activeCol.closest('.is-section');
95517
- if (activeSection) activeElement = activeSection;
95864
+ const section = this.builder.doc.querySelector('.section-select');
95865
+ if (section) activeElement = section;
95518
95866
  }
95519
95867
 
95520
95868
  return {
@@ -95526,31 +95874,29 @@ class AnimateScroll {
95526
95874
  readTarget(s) {
95527
95875
  if (!s) {
95528
95876
  // element (inspectedElement first)
95529
- let activeElement = this.builder.editor.inspectedElement;
95530
- if (!activeElement) return false;
95531
- const divAnimDefault = this.modalAnimateScroll.querySelector('#divAnimDefault');
95532
- const divAnimScroll = this.modalAnimateScroll.querySelector('#divAnimScroll');
95533
- const divAnimScrollSimple = this.modalAnimateScroll.querySelector('#divAnimScrollSimple');
95534
- let css1, css2;
95535
-
95536
- if (divAnimScroll.style.display === 'flex' || divAnimScrollSimple.style.display === 'flex') {
95537
- // enter start
95538
- css1 = activeElement.getAttribute('data-bottom-top');
95539
- if (!css1) css1 = activeElement.getAttribute('data-400-bottom');
95540
- if (!css1) css1 = activeElement.getAttribute('data-200-bottom');
95541
- if (!css1) css1 = activeElement.getAttribute('data--50-bottom'); // leave start
95877
+ let activeElement = this.builder.editor.inspectedElement; // if(!activeElement) return false;
95542
95878
 
95543
- css2 = activeElement.getAttribute('data-top-bottom');
95879
+ if (!activeElement) {
95880
+ return this.readTarget('bg');
95544
95881
  }
95545
95882
 
95546
- let hasBasicAnim = false;
95883
+ let css1, css2; // if(divAnimScroll.style.display==='flex'||divAnimScrollSimple.style.display==='flex') {
95884
+ // enter start
95885
+
95886
+ css1 = activeElement.getAttribute('data-bottom-top');
95887
+ if (!css1) css1 = activeElement.getAttribute('data-400-bottom');
95888
+ if (!css1) css1 = activeElement.getAttribute('data-200-bottom');
95889
+ if (!css1) css1 = activeElement.getAttribute('data--50-bottom'); // leave start
95890
+
95891
+ css2 = activeElement.getAttribute('data-top-bottom'); // }
95892
+
95893
+ let hasBasicAnim = false; // if(divAnimDefault.style.display==='flex') {
95894
+ // basic anim
95895
+
95896
+ if (activeElement.classList.contains('is-fadeIn') || activeElement.classList.contains('is-fadeInUp') || activeElement.classList.contains('is-fadeInDown') || activeElement.classList.contains('is-fadeInLeft') || activeElement.classList.contains('is-fadeInRight') || activeElement.classList.contains('is-zoomIn') || activeElement.classList.contains('is-zoomOut') || activeElement.classList.contains('is-slideInUp') || activeElement.classList.contains('is-slideInDown') || activeElement.classList.contains('is-slideInLeft') || activeElement.classList.contains('is-slideInRight') || activeElement.classList.contains('is-flipInX') || activeElement.classList.contains('is-flipInY') || activeElement.classList.contains('is-pulse') || activeElement.classList.contains('is-bounceIn')) {
95897
+ hasBasicAnim = true;
95898
+ } // }
95547
95899
 
95548
- if (divAnimDefault.style.display === 'flex') {
95549
- // basic anim
95550
- if (activeElement.classList.contains('is-fadeIn') || activeElement.classList.contains('is-fadeInUp') || activeElement.classList.contains('is-fadeInDown') || activeElement.classList.contains('is-fadeInLeft') || activeElement.classList.contains('is-fadeInRight') || activeElement.classList.contains('is-zoomIn') || activeElement.classList.contains('is-zoomOut') || activeElement.classList.contains('is-slideInUp') || activeElement.classList.contains('is-slideInDown') || activeElement.classList.contains('is-slideInLeft') || activeElement.classList.contains('is-slideInRight') || activeElement.classList.contains('is-flipInX') || activeElement.classList.contains('is-flipInY') || activeElement.classList.contains('is-pulse') || activeElement.classList.contains('is-bounceIn')) {
95551
- hasBasicAnim = true;
95552
- }
95553
- }
95554
95900
 
95555
95901
  if (css1 || css2 || hasBasicAnim) {
95556
95902
  return {
@@ -95572,38 +95918,66 @@ class AnimateScroll {
95572
95918
  }
95573
95919
 
95574
95920
  if (s === 'row') {
95575
- activeElement = this.builder.editor.activeCol.parentNode;
95921
+ if (this.builder.editor.activeCol) activeElement = this.builder.editor.activeCol.parentNode;
95576
95922
  }
95577
95923
 
95578
95924
  if (s === 'container') {
95579
- activeElement = this.builder.editor.activeCol.parentNode.parentNode;
95925
+ if (this.builder.editor.activeCol) activeElement = this.builder.editor.activeCol.parentNode.parentNode;
95580
95926
  }
95581
95927
 
95582
- if (!activeElement) return false;
95583
- const divAnimDefault = this.modalAnimateScroll.querySelector('#divAnimDefault');
95584
- const divAnimScroll = this.modalAnimateScroll.querySelector('#divAnimScroll');
95585
- const divAnimScrollSimple = this.modalAnimateScroll.querySelector('#divAnimScrollSimple');
95586
- let css1, css2;
95928
+ if (s === 'bg') {
95929
+ let overlayBg;
95930
+ const box = this.builder.doc.querySelector('.box-select');
95931
+ if (box) overlayBg = box.querySelector('.is-overlay-bg');
95932
+ if (overlayBg) activeElement = overlayBg;
95933
+ }
95587
95934
 
95588
- if (divAnimScroll.style.display === 'flex' || divAnimScrollSimple.style.display === 'flex') {
95589
- // enter start
95590
- css1 = activeElement.getAttribute('data-bottom-top');
95591
- if (!css1) css1 = activeElement.getAttribute('data-400-bottom');
95592
- if (!css1) css1 = activeElement.getAttribute('data-200-bottom');
95593
- if (!css1) css1 = activeElement.getAttribute('data--50-bottom'); // leave start
95935
+ if (s === 'overlay') {
95936
+ let overlay;
95937
+ const box = this.builder.doc.querySelector('.box-select');
95938
+ if (box) overlay = box.querySelector('.is-overlay');
95939
+ if (overlay) activeElement = overlay;
95940
+ }
95594
95941
 
95595
- css2 = activeElement.getAttribute('data-top-bottom');
95942
+ if (s === 'box') {
95943
+ const box = this.builder.doc.querySelector('.box-select');
95944
+ if (box) activeElement = box;
95596
95945
  }
95597
95946
 
95598
- let hasBasicAnim = false;
95947
+ if (s === 'section') {
95948
+ const section = this.builder.doc.querySelector('.section-select');
95949
+ if (section) activeElement = section;
95950
+ }
95599
95951
 
95600
- if (divAnimDefault.style.display === 'flex') {
95601
- // basic anim
95602
- if (activeElement.classList.contains('is-fadeIn') || activeElement.classList.contains('is-fadeInUp') || activeElement.classList.contains('is-fadeInDown') || activeElement.classList.contains('is-fadeInLeft') || activeElement.classList.contains('is-fadeInRight') || activeElement.classList.contains('is-zoomIn') || activeElement.classList.contains('is-zoomOut') || activeElement.classList.contains('is-slideInUp') || activeElement.classList.contains('is-slideInDown') || activeElement.classList.contains('is-slideInLeft') || activeElement.classList.contains('is-slideInRight') || activeElement.classList.contains('is-flipInX') || activeElement.classList.contains('is-flipInY') || activeElement.classList.contains('is-pulse') || activeElement.classList.contains('is-bounceIn')) {
95603
- hasBasicAnim = true;
95604
- }
95952
+ if (!activeElement) {
95953
+ if (s === 'element') return this.readTarget('column');
95954
+ if (s === 'column') return this.readTarget('row');
95955
+ if (s === 'row') return this.readTarget('container');
95956
+ if (s === 'container') return this.readTarget('bg');
95957
+ if (s === 'bg') return this.readTarget('overlay');
95958
+ if (s === 'overlay') return this.readTarget('box');
95959
+ if (s === 'box') return this.readTarget('section');
95960
+ if (s === 'section') return false;
95605
95961
  }
95606
95962
 
95963
+ let css1, css2; // if(divAnimScroll.style.display==='flex'||divAnimScrollSimple.style.display==='flex') {
95964
+ // enter start
95965
+
95966
+ css1 = activeElement.getAttribute('data-bottom-top');
95967
+ if (!css1) css1 = activeElement.getAttribute('data-400-bottom');
95968
+ if (!css1) css1 = activeElement.getAttribute('data-200-bottom');
95969
+ if (!css1) css1 = activeElement.getAttribute('data--50-bottom'); // leave start
95970
+
95971
+ css2 = activeElement.getAttribute('data-top-bottom'); // }
95972
+
95973
+ let hasBasicAnim = false; // if(divAnimDefault.style.display==='flex') {
95974
+ // basic anim
95975
+
95976
+ if (activeElement.classList.contains('is-fadeIn') || activeElement.classList.contains('is-fadeInUp') || activeElement.classList.contains('is-fadeInDown') || activeElement.classList.contains('is-fadeInLeft') || activeElement.classList.contains('is-fadeInRight') || activeElement.classList.contains('is-zoomIn') || activeElement.classList.contains('is-zoomOut') || activeElement.classList.contains('is-slideInUp') || activeElement.classList.contains('is-slideInDown') || activeElement.classList.contains('is-slideInLeft') || activeElement.classList.contains('is-slideInRight') || activeElement.classList.contains('is-flipInX') || activeElement.classList.contains('is-flipInY') || activeElement.classList.contains('is-pulse') || activeElement.classList.contains('is-bounceIn')) {
95977
+ hasBasicAnim = true;
95978
+ } // }
95979
+
95980
+
95607
95981
  if (css1 || css2 || hasBasicAnim) {
95608
95982
  return {
95609
95983
  'element': activeElement,
@@ -95613,7 +95987,11 @@ class AnimateScroll {
95613
95987
  if (s === 'element') return this.readTarget('column');
95614
95988
  if (s === 'column') return this.readTarget('row');
95615
95989
  if (s === 'row') return this.readTarget('container');
95616
- if (s === 'container') return false;
95990
+ if (s === 'container') return this.readTarget('bg');
95991
+ if (s === 'bg') return this.readTarget('overlay');
95992
+ if (s === 'overlay') return this.readTarget('box');
95993
+ if (s === 'box') return this.readTarget('section');
95994
+ if (s === 'section') return false;
95617
95995
  }
95618
95996
  }
95619
95997
  }
@@ -95674,7 +96052,10 @@ class AnimateScroll {
95674
96052
  }
95675
96053
 
95676
96054
  edit() {
95677
- // Close all opened sidebar
96055
+ this.builder.wrapperEl.classList.add('hard-select');
96056
+ this.builder.activeBox.classList.add('box-select');
96057
+ this.builder.activeSection.classList.add('section-select'); // Close all opened sidebar
96058
+
95678
96059
  this.builder.sidebar.closeSidebar();
95679
96060
  this.modalAnimateScroll.classList.add('active');
95680
96061
  this.clickContent();
@@ -95693,7 +96074,6 @@ class ContentBox {
95693
96074
  const defaults = {
95694
96075
  wrapper: '.is-wrapper',
95695
96076
  previewURL: 'preview.html',
95696
- sectionHoverOutline: false,
95697
96077
  useSidebar: true,
95698
96078
  disableLoadingStatus: false,
95699
96079
  sidebarData: {
@@ -98375,6 +98755,9 @@ class ContentBox {
98375
98755
  snippetPathReplace: this.settings.snippetPathReplace,
98376
98756
  maxColumns: 6,
98377
98757
  maxEmbedImageWidth: this.settings.maxEmbedImageWidth,
98758
+ onSectionAdd: () => {
98759
+ this.pageSetup();
98760
+ },
98378
98761
  slider: this.settings.slider,
98379
98762
  onRender: () => {
98380
98763
  this.settings.onRender();
@@ -98605,7 +98988,8 @@ class ContentBox {
98605
98988
 
98606
98989
  init() {
98607
98990
  // Add special css (remove on destroy)
98608
- dom.appendHtml(this.doc.head, `<style id="_contentbox_lightbox">
98991
+ // This is also for backward compatible if using npm but still using old local assets/css
98992
+ dom.appendHtml(this.doc.head, `<style id="_contentbox_css">
98609
98993
  body {
98610
98994
  background: ${this.settings.backgroundColor};
98611
98995
  }
@@ -98616,6 +99000,109 @@ class ContentBox {
98616
99000
  pointer-events: unset;
98617
99001
  user-select: unset;
98618
99002
  }
99003
+
99004
+ /* Navbar Fix */
99005
+ .is-wrapper.is-edit .is-section.is-section-navbar,
99006
+ .is-wrapper.is-edit .is-section.is-section-navbar .is-topbar {
99007
+ left: 0;
99008
+ margin-left: 60px;
99009
+ width: calc(100% - 60px);
99010
+ }
99011
+ .is-wrapper.is-edit .is-section.is-section-navbar .is-topbar.static {
99012
+ width: 100%;
99013
+ margin-left: unset;
99014
+ }
99015
+
99016
+ /* protected section */
99017
+ .is-section.protected .is-box-tool {
99018
+ display: none !important;
99019
+ }
99020
+
99021
+ /* manual selection during animation edit */
99022
+ .hard-select .is-box-tool {
99023
+ display: none !important;
99024
+ }
99025
+ .hard-select .is-section-tool {
99026
+ display: none !important;
99027
+ }
99028
+ .hard-select .box-select {
99029
+ outline: #00da89 1px solid;
99030
+ outline-offset: -1px;
99031
+ z-index: 1;
99032
+ }
99033
+ .hard-select .box-select .is-box-tool {
99034
+ display: flex !important;
99035
+ }
99036
+ .hard-select .box-select .is-overlay {
99037
+ z-index: -1;
99038
+ }
99039
+ .hard-select .section-select .is-section-tool {
99040
+ display: block !important;
99041
+ }
99042
+
99043
+ /* drop block as section */
99044
+ .is-wrapper > .sortable-ghost {
99045
+ height: 40px !important;
99046
+ min-height: unset !important;
99047
+ background: rgba(204, 204, 204, 0.15) !important;
99048
+ }
99049
+
99050
+ /* toggle tool */
99051
+ .is-wrapper.is-clean-edit .hard-select .box-select .is-box-tool,
99052
+ .is-wrapper.is-clean-edit .box-select .is-box-tool {
99053
+ display: none !important;
99054
+ }
99055
+ .is-wrapper.is-clean-edit .hard-select .section-select .is-section-tool,
99056
+ .is-wrapper.is-clean-edit .section-select .is-section-tool {
99057
+ display: none !important;
99058
+ }
99059
+ .is-wrapper.is-clean-edit .hard-select .box-select,
99060
+ .is-wrapper.is-clean-edit .box-select {
99061
+ outline: none !important;
99062
+ }
99063
+
99064
+
99065
+ </style>`);
99066
+ dom.appendHtml(document.head, `<style id="_contentboxstuff_css">
99067
+
99068
+ #_cbhtml .is-modal.editbox.is-modal-content {
99069
+ z-index: 10002;
99070
+ position: fixed;
99071
+ overflow: hidden;
99072
+ width: 380px;
99073
+ height: auto;
99074
+ top: calc(50% - 250px);
99075
+ left: calc(50% - 175px);
99076
+ box-sizing: content-box;
99077
+ flex-direction: row;
99078
+ align-items: flex-start;
99079
+ }
99080
+ #_cbhtml .is-modal.editbox.is-modal-content.active {
99081
+ display: flex;
99082
+ }
99083
+ #_cbhtml .is-modal.editbox.is-modal-content .is-modal-overlay {
99084
+ display: none;
99085
+ }
99086
+
99087
+ #_cbhtml .is-modal.editsection.is-modal-content {
99088
+ z-index: 10002;
99089
+ position: fixed;
99090
+ overflow: hidden;
99091
+ width: 313px;
99092
+ height: auto;
99093
+ top: calc(50% - 265px);
99094
+ left: calc(50% - 157px);
99095
+ box-sizing: content-box;
99096
+ flex-direction: row;
99097
+ align-items: flex-start;
99098
+ }
99099
+ #_cbhtml .is-modal.editbox.is-modal-content.active {
99100
+ display: flex;
99101
+ }
99102
+ #_cbhtml .is-modal.editbox.is-modal-content .is-modal-overlay {
99103
+ display: none;
99104
+ }
99105
+
98619
99106
  </style>`); // Add page-overlay (to prevent mouseover during page init.
98620
99107
  // Otherwise the mouseover won't be triggered when the page ready)
98621
99108
 
@@ -98714,7 +99201,128 @@ class ContentBox {
98714
99201
 
98715
99202
  this.doc.addEventListener('click', this.doDocumentClick = e => {
98716
99203
  e = e || window.event;
98717
- var target = e.target || e.srcElement;
99204
+ var target = e.target || e.srcElement; //--- New UX ---
99205
+
99206
+ if (!target.closest('#_cbhtml') && !target.closest('.is-box-tool') && !target.closest('.is-section-tool') && !target.closest('.is-side') && !target.closest('.is-modal') && !target.closest('.is-sidebar')) {
99207
+ if (target.closest('.is-wrapper') && !target.classList.contains('is-wrapper')) {
99208
+ // Inside Wrapper
99209
+ if (target.closest('.is-container')) {
99210
+ // Inside Container
99211
+ const box = target.closest('.is-box');
99212
+
99213
+ if (!target.closest('.is-tool') && !target.closest('.is-rowadd-tool')) {
99214
+ if (box.classList.contains('box-select')) {
99215
+ if (this.wrapperEl.classList.contains('is-container-edit')) {
99216
+ this.wrapperEl.classList.remove('is-container-edit');
99217
+ this.wrapperEl.classList.add('is-clean-edit');
99218
+ } else {
99219
+ this.wrapperEl.classList.add('is-container-edit');
99220
+ this.wrapperEl.classList.remove('is-clean-edit');
99221
+ }
99222
+ } else {
99223
+ this.wrapperEl.classList.add('is-container-edit');
99224
+ this.wrapperEl.classList.remove('is-clean-edit');
99225
+ }
99226
+ }
99227
+
99228
+ if (box) {
99229
+ // clear
99230
+ const prevBox = this.doc.querySelector('.box-select');
99231
+ if (prevBox) prevBox.classList.remove('box-select'); // select
99232
+
99233
+ box.classList.add('box-select');
99234
+ this.activeBox = box;
99235
+ this.wrapperEl.classList.add('hard-select');
99236
+ }
99237
+
99238
+ const section = target.closest('.is-section');
99239
+
99240
+ if (section) {
99241
+ // clear
99242
+ const prevSection = this.doc.querySelector('.section-select');
99243
+ if (prevSection) prevSection.classList.remove('section-select'); // select
99244
+
99245
+ section.classList.add('section-select');
99246
+ this.activeSection = section;
99247
+ }
99248
+ } else {
99249
+ // Outside Container
99250
+ this.editor.inspectedElement = null;
99251
+ this.editor.activeElement = null;
99252
+ this.editor.activeCol = null;
99253
+ const box = target.closest('.is-box');
99254
+
99255
+ if (box) {
99256
+ if (box.classList.contains('box-select') && !this.wrapperEl.classList.contains('is-clean-edit')) {
99257
+ // toggle
99258
+ const modalEditBox = this.builderStuff.querySelector('.editbox');
99259
+ const modalEditSection = this.builderStuff.querySelector('.editsection');
99260
+
99261
+ if (modalEditBox.style.display !== 'flex' && modalEditSection.style.display !== 'flex' && !this.animateScroll.modalAnimateScroll.classList.contains('active')) {
99262
+ // clear
99263
+ const prevBox = this.doc.querySelector('.box-select');
99264
+ if (prevBox) prevBox.classList.remove('box-select');
99265
+ const prevSection = this.doc.querySelector('.section-select');
99266
+ if (prevSection) prevSection.classList.remove('section-select');
99267
+ this.wrapperEl.classList.remove('hard-select');
99268
+ }
99269
+ } else {
99270
+ // clear
99271
+ const prevBox = this.doc.querySelector('.box-select');
99272
+ if (prevBox) prevBox.classList.remove('box-select');
99273
+ const prevSection = this.doc.querySelector('.section-select');
99274
+ if (prevSection) prevSection.classList.remove('section-select');
99275
+ box.classList.add('box-select');
99276
+ this.activeBox = box;
99277
+ const section = box.closest('.is-section');
99278
+ section.classList.add('section-select');
99279
+ this.activeSection = section;
99280
+ this.wrapperEl.classList.add('hard-select');
99281
+ }
99282
+ }
99283
+
99284
+ this.wrapperEl.classList.remove('is-container-edit');
99285
+ this.wrapperEl.classList.remove('is-clean-edit');
99286
+ }
99287
+
99288
+ const modalEditBox = this.builderStuff.querySelector('.editbox');
99289
+
99290
+ if (modalEditBox.style.display === 'flex') {
99291
+ this.editbox.read();
99292
+ }
99293
+
99294
+ const modalEditSection = this.builderStuff.querySelector('.editsection');
99295
+
99296
+ if (modalEditSection.style.display === 'flex') {
99297
+ this.editsection.read();
99298
+ }
99299
+
99300
+ if (this.settings.onPageContentClick) this.settings.onPageContentClick(e);
99301
+ } else {
99302
+ // Outside Wrapper
99303
+ this.wrapperEl.classList.remove('is-container-edit');
99304
+ this.wrapperEl.classList.remove('is-clean-edit');
99305
+ const modalEditBox = this.builderStuff.querySelector('.editbox');
99306
+ modalEditBox.style.display = '';
99307
+ const modalEditSection = this.builderStuff.querySelector('.editsection');
99308
+ modalEditSection.style.display = '';
99309
+
99310
+ if (modalEditBox.style.display !== 'flex' && modalEditSection.style.display !== 'flex' && !this.animateScroll.modalAnimateScroll.classList.contains('active')) {
99311
+ this.wrapperEl.classList.remove('hard-select'); // Remove previous box-select & section-select
99312
+
99313
+ const prevBox = this.doc.querySelectorAll('.box-select');
99314
+ prevBox.forEach(elm => {
99315
+ elm.classList.remove('box-select');
99316
+ });
99317
+ const prevSection = this.doc.querySelectorAll('.section-select');
99318
+ prevSection.forEach(elm => {
99319
+ elm.classList.remove('section-select');
99320
+ });
99321
+ }
99322
+ }
99323
+ } //---
99324
+
99325
+
98718
99326
  let a = false,
98719
99327
  b = false,
98720
99328
  c = false,
@@ -98746,8 +99354,6 @@ class ContentBox {
98746
99354
  }
98747
99355
 
98748
99356
  if (!(a || b || f || g || h || i || j)) {
98749
- const boxHover = this.doc.querySelector('.box-hover');
98750
- if (boxHover) dom.removeClass(boxHover, 'box-hover');
98751
99357
  const boxTools = this.wrapperEl.querySelectorAll('.is-box-tool');
98752
99358
  boxTools.forEach(tool => {
98753
99359
  tool.style.display = 'none';
@@ -98794,8 +99400,6 @@ class ContentBox {
98794
99400
  }
98795
99401
 
98796
99402
  if (!(a || b || f || g || h || i || j)) {
98797
- const boxHover = this.doc.querySelector('.box-hover');
98798
- if (boxHover) dom.removeClass(boxHover, 'box-hover');
98799
99403
  const boxTools = this.wrapperEl.querySelectorAll('.is-box-tool');
98800
99404
  boxTools.forEach(tool => {
98801
99405
  tool.style.display = 'none';
@@ -98962,6 +99566,8 @@ class ContentBox {
98962
99566
  }
98963
99567
 
98964
99568
  sectionSetup(section) {
99569
+ let tool = section.querySelector('.is-section-tool');
99570
+ if (tool) tool.parentNode.removeChild(tool);
98965
99571
  dom.appendHtml(section, '<div class="is-section-tool">' + '<button type="button" class="is-section-edit" tabindex="-1" data-title="' + out('Section Settings') + '" title="' + out('Section Settings') + '"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>' + '<button type="button" class="is-section-remove" tabindex="-1" data-title="' + out('Remove') + '" title="' + out('Remove') + '">&#10005;</button>' + '</div>'); // this.editor.setTooltip(section);
98966
99572
  // Prepare for tooltip
98967
99573
 
@@ -98977,6 +99583,7 @@ class ContentBox {
98977
99583
  });
98978
99584
  const btnSectionEdit = section.querySelector('.is-section-edit');
98979
99585
  btnSectionEdit.addEventListener('click', () => {
99586
+ this.editbox.close();
98980
99587
  this.editsection.edit();
98981
99588
  });
98982
99589
  const btnSectionRemove = section.querySelector('.is-section-remove');
@@ -98984,8 +99591,7 @@ class ContentBox {
98984
99591
  const modal = document.querySelector('.is-modal.delsectionconfirm');
98985
99592
  this.editor.util.showModal(modal);
98986
99593
  });
98987
- } // sectionSetup
98988
-
99594
+ }
98989
99595
 
98990
99596
  boxSetup(box) {
98991
99597
  let tool = box.querySelector('.is-box-tool');
@@ -99008,6 +99614,7 @@ class ContentBox {
99008
99614
 
99009
99615
  const btnBoxEdit = box.querySelector('.is-box-edit');
99010
99616
  if (btnBoxEdit) btnBoxEdit.addEventListener('click', () => {
99617
+ this.editsection.close();
99011
99618
  this.editbox.edit();
99012
99619
  });
99013
99620
  const btnModuleEdit = box.querySelector('.is-module-edit');
@@ -99076,26 +99683,10 @@ class ContentBox {
99076
99683
 
99077
99684
  box.addEventListener('mouseenter', () => {
99078
99685
  this.positionTool(box);
99079
- let activeSection;
99080
-
99081
- if (dom.hasClass(box, 'is-section')) {
99082
- activeSection = box;
99083
- } else {
99084
- activeSection = dom.parentsHasClass(box, 'is-section');
99085
- }
99686
+ if (this.wrapperEl.classList.contains('hard-select')) return; // New UX
99086
99687
 
99087
99688
  this.activeBox = box;
99088
- this.activeSection = activeSection;
99089
- const elms = this.doc.querySelectorAll('.box-hover');
99090
- elms.forEach(elm => {
99091
- dom.removeClass(elm, 'box-hover');
99092
- });
99093
- if (this.sectionHoverOutline) dom.addClass(this.activeBox, 'box-hover');
99094
-
99095
- if (this.activeSection !== this.prevSection) {
99096
- this.prevSection = this.activeSection;
99097
- if (this.settings.onSectionChange) this.settings.onSectionChange();
99098
- }
99689
+ this.activeSection = box.closest('.is-section');
99099
99690
  });
99100
99691
  } // boxSetup
99101
99692
 
@@ -99161,17 +99752,19 @@ class ContentBox {
99161
99752
  }
99162
99753
 
99163
99754
  doUndoRedo() {
99755
+ /*
99164
99756
  // Clean
99165
99757
  const elms = this.wrapperEl.querySelectorAll(`[data-center],[data-center-top],[data--50-bottom],
99166
- [data--100-bottom],[data--150-bottom],[data--200-bottom],[data--300-bottom],[data--400-bottom],
99167
- [data-bottom-top],[data-400-bottom],[data-300-bottom],[data-200-bottom],[data-150-bottom],
99168
- [data-100-bottom],[data-50-bottom],[data-bottom],[data-center-bottom],[data-100-top],
99169
- [data-50-top],[data-top],[data-top-bottom]`);
99170
- elms.forEach(elm => {
99171
- elm.style.transform = '';
99172
- elm.style.transition = '';
99173
- elm.style.opacity = '';
99758
+ [data--100-bottom],[data--150-bottom],[data--200-bottom],[data--300-bottom],[data--400-bottom],
99759
+ [data-bottom-top],[data-400-bottom],[data-300-bottom],[data-200-bottom],[data-150-bottom],
99760
+ [data-100-bottom],[data-50-bottom],[data-bottom],[data-center-bottom],[data-100-top],
99761
+ [data-50-top],[data-top],[data-top-bottom]`);
99762
+ elms.forEach(elm=>{
99763
+ elm.style.transform = '';
99764
+ elm.style.transition = '';
99765
+ elm.style.opacity = '';
99174
99766
  });
99767
+ */
99175
99768
  this.pageSetup(); // To refresh skrollrr anim
99176
99769
 
99177
99770
  if (this.win.skrollrr) {
@@ -99180,30 +99773,33 @@ class ContentBox {
99180
99773
  }
99181
99774
 
99182
99775
  refreshPage() {
99776
+ /*
99183
99777
  // Clean
99184
99778
  const elms = this.wrapperEl.querySelectorAll(`[data-center],[data-center-top],[data--50-bottom],
99185
- [data--100-bottom],[data--150-bottom],[data--200-bottom],[data--300-bottom],[data--400-bottom],
99186
- [data-bottom-top],[data-400-bottom],[data-300-bottom],[data-200-bottom],[data-150-bottom],
99187
- [data-100-bottom],[data-50-bottom],[data-bottom],[data-center-bottom],[data-100-top],
99188
- [data-50-top],[data-top],[data-top-bottom]`);
99189
- elms.forEach(elm => {
99190
- elm.style.transform = '';
99191
- elm.style.transition = '';
99192
- elm.style.opacity = '';
99193
- }); //--- Same as undo/redo process ---
99194
-
99779
+ [data--100-bottom],[data--150-bottom],[data--200-bottom],[data--300-bottom],[data--400-bottom],
99780
+ [data-bottom-top],[data-400-bottom],[data-300-bottom],[data-200-bottom],[data-150-bottom],
99781
+ [data-100-bottom],[data-50-bottom],[data-bottom],[data-center-bottom],[data-100-top],
99782
+ [data-50-top],[data-top],[data-top-bottom]`);
99783
+ elms.forEach(elm=>{
99784
+ elm.style.transform = '';
99785
+ elm.style.transition = '';
99786
+ elm.style.opacity = '';
99787
+ });
99788
+ //--- Same as undo/redo process ---
99195
99789
  const wrapper = this.wrapperEl;
99196
99790
  const sections = wrapper.querySelectorAll('.is-section');
99197
- sections.forEach(section => {
99198
- const html = section.innerHTML;
99199
- var range = document.createRange();
99200
- section.innerHTML = '';
99201
- section.appendChild(range.createContextualFragment(html));
99791
+ sections.forEach((section)=>{
99792
+ const html = section.innerHTML;
99793
+ var range = document.createRange();
99794
+ section.innerHTML = '';
99795
+ section.appendChild(range.createContextualFragment(html));
99202
99796
  });
99797
+
99203
99798
  this.editor.uo.cleaning(wrapper);
99204
- this.pageSetup(); //---
99799
+ this.pageSetup();
99800
+ //---
99801
+ */
99205
99802
  // To refresh skrollrr anim
99206
-
99207
99803
  if (this.win.skrollrr) {
99208
99804
  this.win.skrollrr.refresh();
99209
99805
  }
@@ -99996,8 +100592,10 @@ class ContentBox {
99996
100592
  this.builderStuff.innerHTML = '';
99997
100593
  dom.removeClass(document.body, 'sidebar-active'); // Remove special css
99998
100594
 
99999
- const cblightboxStyle = document.querySelector('#_contentbox_lightbox');
100000
- if (cblightboxStyle) cblightboxStyle.parentNode.removeChild(cblightboxStyle); // Render html content
100595
+ const cbContentStyle = this.doc.querySelector('#_contentbox_css');
100596
+ if (cbContentStyle) cbContentStyle.parentNode.removeChild(cbContentStyle);
100597
+ const cbStuffStyle = document.querySelector('#_contentboxstuff_css');
100598
+ if (cbStuffStyle) cbStuffStyle.parentNode.removeChild(cbStuffStyle); // Render html content
100001
100599
 
100002
100600
  let range = document.createRange();
100003
100601
  const wrapper = this.wrapperEl;