@innovastudio/contentbox 1.4.35 → 1.4.37

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,71 @@ class ContentStuff {
92766
93046
  50% {transform:scale(0.95);}
92767
93047
  100% {transform:scale(1);}
92768
93048
  }
93049
+
93050
+ .is-wrapper.is-edit {
93051
+ padding-left: 61px;
93052
+ }
92769
93053
 
92770
- .box-hover {
92771
- outline: 1px solid #00da89;
92772
- outline-offset: -1px;
93054
+ /* Navbar Fix */
93055
+ .is-wrapper.is-edit .is-section.is-section-navbar,
93056
+ .is-wrapper.is-edit .is-section.is-section-navbar .is-topbar {
93057
+ left: 0;
93058
+ margin-left: 60px;
93059
+ width: calc(100% - 60px);
92773
93060
  }
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;
93061
+ .is-wrapper.is-edit .is-section.is-section-navbar .is-topbar.static {
93062
+ width: 100%;
93063
+ margin-left: unset;
92780
93064
  }
92781
-
92782
- .box-active .is-container {
92783
- border: rgba(0,0,0,0.1) 1px solid;
93065
+
93066
+ /* protected section */
93067
+ .is-section.protected .is-box-tool {
93068
+ display: none !important;
92784
93069
  }
92785
93070
 
92786
- .box-active {
92787
- outline: 1px solid #00da89;
93071
+ /* manual selection during animation edit */
93072
+ .hard-select .is-box-tool {
93073
+ display: none !important;
93074
+ }
93075
+ .hard-select .is-section-tool {
93076
+ display: none !important;
93077
+ }
93078
+ .hard-select .box-select {
93079
+ outline: #00da89 1px solid;
92788
93080
  outline-offset: -1px;
93081
+ z-index: 1;
92789
93082
  }
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;
93083
+ .hard-select .box-select .is-box-tool {
93084
+ display: flex !important;
92796
93085
  }
92797
- .section-active {
92798
- outline: 1px solid #00da89;
92799
- outline-offset: -1px;
93086
+ .hard-select .box-select .is-overlay {
93087
+ z-index: -1;
92800
93088
  }
92801
- .is-section:not(.box-space).section-active .is-overlay {
92802
- top: 1px;
92803
- bottom: 1px;
92804
- left: 1px;
92805
- right: 1px;
93089
+ .hard-select .section-select .is-section-tool {
93090
+ display: block !important;
92806
93091
  }
92807
- /*
92808
- .content-edit .is-section-tool,
92809
- .content-edit .is-box-tool {
93092
+
93093
+ /* drop block as section */
93094
+ .is-wrapper > .sortable-ghost {
93095
+ height: 40px !important;
93096
+ min-height: unset !important;
93097
+ background: rgba(204, 204, 204, 0.15) !important;
93098
+ }
93099
+
93100
+ /* toggle tool */
93101
+ .is-wrapper.is-clean-edit .hard-select .box-select .is-box-tool,
93102
+ .is-wrapper.is-clean-edit .box-select .is-box-tool {
92810
93103
  display: none !important;
92811
93104
  }
92812
- */
92813
- .content-edit .box-hover {
93105
+ .is-wrapper.is-clean-edit .hard-select .section-select .is-section-tool,
93106
+ .is-wrapper.is-clean-edit .section-select .is-section-tool {
93107
+ display: none !important;
93108
+ }
93109
+ .is-wrapper.is-clean-edit .hard-select .box-select,
93110
+ .is-wrapper.is-clean-edit .box-select {
92814
93111
  outline: none !important;
92815
93112
  }
93113
+
92816
93114
  `; // .is-wrapper.is-edit > div {
92817
93115
  // overflow-x: unset;
92818
93116
  // overflow-y: unset;
@@ -93033,6 +93331,10 @@ class AnimateScroll {
93033
93331
  </tr>
93034
93332
  </table>
93035
93333
 
93334
+ <div class="flex-wrap" style="margin-top:20px;">
93335
+ <button title="${out('Disable Smooth Animation')}" class="cmd-disable-smoothanim" data-value="data-center" style="width:320px">${out('Disable Smooth Animation')}</button>
93336
+ </div>
93337
+
93036
93338
  <button title="${out('Clear All')}" class="cmd-clear-simplescroll" style="flex: none;margin-top:30px;margin-bottom:20px;width:320px">
93037
93339
  <svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg>
93038
93340
  <span style="margin-left:7px">${out('Clear All')}</span>
@@ -93486,6 +93788,10 @@ class AnimateScroll {
93486
93788
  <button title="${out('Late')}" class="cmd-leave-start" data-value="data-50-top" style="width:74px">${out('Late')}</button>
93487
93789
  <button title="${out('Very Late')}" class="cmd-leave-start" data-value="data-top" style="width:95px">${out('Very Late')}</button>
93488
93790
  </div>
93791
+
93792
+ <div class="flex-wrap" style="margin-top:30px;">
93793
+ <button title="${out('Disable Smooth Animation')}" class="cmd-disable-smoothanim" data-value="data-center" style="width:320px">${out('Disable Smooth Animation')}</button>
93794
+ </div>
93489
93795
  </div>
93490
93796
 
93491
93797
 
@@ -93576,7 +93882,9 @@ class AnimateScroll {
93576
93882
  const btnClose = modalAnimateScroll.querySelector('.is-side-close');
93577
93883
  btnClose.addEventListener('click', () => {
93578
93884
  this.close();
93579
- }); // Target
93885
+ });
93886
+ this.divAnimScrollSimple = modalAnimateScroll.querySelector('#divAnimScrollSimple');
93887
+ this.divAnimSettings = modalAnimateScroll.querySelector('#divAnimSettings'); // Target
93580
93888
 
93581
93889
  let btns = modalAnimateScroll.querySelectorAll('.cmd-target');
93582
93890
  btns.forEach(btn => {
@@ -94618,30 +94926,38 @@ class AnimateScroll {
94618
94926
 
94619
94927
 
94620
94928
  this.builder.settings.onChange();
94929
+ });
94930
+ const btnDisableSmoothAnim = this.divAnimSettings.querySelector('.cmd-disable-smoothanim');
94931
+ btnDisableSmoothAnim.addEventListener('click', () => {
94932
+ if (btnDisableSmoothAnim.classList.contains('on')) {
94933
+ btnDisableSmoothAnim.classList.remove('on');
94934
+ } else {
94935
+ btnDisableSmoothAnim.classList.add('on');
94936
+ }
94937
+
94938
+ this.apply();
94939
+ });
94940
+ const btnDisableSmoothAnim2 = this.divAnimScrollSimple.querySelector('.cmd-disable-smoothanim');
94941
+ btnDisableSmoothAnim2.addEventListener('click', () => {
94942
+ if (btnDisableSmoothAnim2.classList.contains('on')) {
94943
+ btnDisableSmoothAnim2.classList.remove('on');
94944
+ } else {
94945
+ btnDisableSmoothAnim2.classList.add('on');
94946
+ }
94947
+
94948
+ this.applySimpleScroll();
94621
94949
  }); // ---
94622
- //Extend onContentClick
94950
+ //Extend onPageContentClick
94623
94951
 
94624
- let old = this.builder.settings.onContentClick;
94952
+ let old = this.builder.settings.onPageContentClick;
94625
94953
 
94626
- this.builder.settings.onContentClick = () => {
94954
+ this.builder.settings.onPageContentClick = () => {
94627
94955
  if (old) old.call(this); // call user's defined onRender
94628
94956
 
94629
94957
  if (!this.modalAnimateScroll.classList.contains('active')) return;
94630
94958
  setTimeout(() => {
94631
94959
  this.clickContent();
94632
94960
  }, 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
94961
  };
94646
94962
  }
94647
94963
 
@@ -94666,6 +94982,18 @@ class AnimateScroll {
94666
94982
  } else if (currentTarget.name === 'container') {
94667
94983
  const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=container]');
94668
94984
  btn.classList.add('on');
94985
+ } else if (currentTarget.name === 'bg') {
94986
+ const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=bg]');
94987
+ btn.classList.add('on');
94988
+ } else if (currentTarget.name === 'overlay') {
94989
+ const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=overlay]');
94990
+ btn.classList.add('on');
94991
+ } else if (currentTarget.name === 'box') {
94992
+ const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=box]');
94993
+ btn.classList.add('on');
94994
+ } else if (currentTarget.name === 'section') {
94995
+ const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=section]');
94996
+ btn.classList.add('on');
94669
94997
  }
94670
94998
  } else {
94671
94999
  // no animation on the selected element
@@ -94674,6 +95002,7 @@ class AnimateScroll {
94674
95002
  }
94675
95003
 
94676
95004
  this.read();
95005
+ this.readAnimOnce();
94677
95006
  }
94678
95007
 
94679
95008
  clearSettings() {
@@ -94822,7 +95151,15 @@ class AnimateScroll {
94822
95151
  if (activeElement.classList.contains('delay-1400ms')) btnDelay = this.modalAnimateScroll.querySelector('.cmd-basic-delay[data-value="delay-1400ms"]');
94823
95152
  if (btnDelay) btnDelay.classList.add('on');
94824
95153
  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
95154
+ if (activeElement.classList.contains('once')) btnAnimateOnce.classList.add('on');else btnAnimateOnce.classList.remove('on');
95155
+ const btnDisableSmoothAnim = this.modalAnimateScroll.querySelectorAll('.cmd-disable-smoothanim');
95156
+ btnDisableSmoothAnim.forEach(btn => {
95157
+ if (activeElement.hasAttribute('data-smooth-scrolling')) {
95158
+ btn.classList.add('on');
95159
+ } else {
95160
+ btn.classList.remove('on');
95161
+ }
95162
+ }); // Simple Scroll
94826
95163
 
94827
95164
  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
95165
  const inpSimpleScrollX_Start = this.modalAnimateScroll.querySelector('.inp-simplescroll-x-start');
@@ -95257,6 +95594,15 @@ class AnimateScroll {
95257
95594
  let dataEnd = 'data-top-bottom';
95258
95595
  if (sStart !== '') activeElement.setAttribute(dataStart, sStart);else activeElement.removeAttribute(dataStart);
95259
95596
  if (sEnd !== '') activeElement.setAttribute(dataEnd, sEnd);else activeElement.removeAttribute(dataEnd);
95597
+ const btnDisableSmoothAnim = this.divAnimScrollSimple.querySelector('.cmd-disable-smoothanim');
95598
+
95599
+ if (btnDisableSmoothAnim.classList.contains('on')) {
95600
+ activeElement.setAttribute('data-smooth-scrolling', 'off');
95601
+ activeElement.style.transition = '';
95602
+ } else {
95603
+ activeElement.removeAttribute('data-smooth-scrolling');
95604
+ }
95605
+
95260
95606
  activeElement.style.transform = '';
95261
95607
  activeElement.style.transition = '';
95262
95608
  activeElement.style.opacity = '';
@@ -95435,6 +95781,15 @@ class AnimateScroll {
95435
95781
  activeElement.style.opacity = '';
95436
95782
  }
95437
95783
 
95784
+ const btnDisableSmoothAnim = this.divAnimSettings.querySelector('.cmd-disable-smoothanim');
95785
+
95786
+ if (btnDisableSmoothAnim.classList.contains('on')) {
95787
+ activeElement.setAttribute('data-smooth-scrolling', 'off');
95788
+ activeElement.style.transition = '';
95789
+ } else {
95790
+ activeElement.removeAttribute('data-smooth-scrolling');
95791
+ }
95792
+
95438
95793
  if (this.builder.win.skrollrr) {
95439
95794
  this.builder.win.skrollrr.refresh();
95440
95795
  } //Trigger Change event
@@ -95469,7 +95824,7 @@ class AnimateScroll {
95469
95824
 
95470
95825
  if (reCheck) {
95471
95826
  if (reCheck.name === 'element') activeElement = this.builder.editor.activeElement;
95472
- if (reCheck.name === 'inspectedElement') activeElement = this.builder.editor.inspectedElement;
95827
+ if (reCheck.name === 'inspectedElement') activeElement = this.builder.editor.inspectedElement;else activeElement = this.builder.editor.activeElement;
95473
95828
  } else {
95474
95829
  activeElement = this.builder.editor.activeElement;
95475
95830
  }
@@ -95490,31 +95845,27 @@ class AnimateScroll {
95490
95845
  }
95491
95846
 
95492
95847
  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');
95848
+ let overlay;
95849
+ const box = this.builder.doc.querySelector('.box-select');
95850
+ if (box) overlay = box.querySelector('.is-overlay');
95851
+ if (overlay) activeElement = overlay;
95497
95852
  }
95498
95853
 
95499
95854
  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');
95855
+ let overlayBg;
95856
+ const box = this.builder.doc.querySelector('.box-select');
95857
+ if (box) overlayBg = box.querySelector('.is-overlay-bg');
95858
+ if (overlayBg) activeElement = overlayBg;
95504
95859
  }
95505
95860
 
95506
95861
  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;
95862
+ const box = this.builder.doc.querySelector('.box-select');
95863
+ if (box) activeElement = box;
95511
95864
  }
95512
95865
 
95513
95866
  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;
95867
+ const section = this.builder.doc.querySelector('.section-select');
95868
+ if (section) activeElement = section;
95518
95869
  }
95519
95870
 
95520
95871
  return {
@@ -95526,31 +95877,29 @@ class AnimateScroll {
95526
95877
  readTarget(s) {
95527
95878
  if (!s) {
95528
95879
  // 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;
95880
+ let activeElement = this.builder.editor.inspectedElement; // if(!activeElement) return false;
95535
95881
 
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
95542
-
95543
- css2 = activeElement.getAttribute('data-top-bottom');
95882
+ if (!activeElement) {
95883
+ return this.readTarget('bg');
95544
95884
  }
95545
95885
 
95546
- let hasBasicAnim = false;
95886
+ let css1, css2; // if(divAnimScroll.style.display==='flex'||divAnimScrollSimple.style.display==='flex') {
95887
+ // enter start
95888
+
95889
+ css1 = activeElement.getAttribute('data-bottom-top');
95890
+ if (!css1) css1 = activeElement.getAttribute('data-400-bottom');
95891
+ if (!css1) css1 = activeElement.getAttribute('data-200-bottom');
95892
+ if (!css1) css1 = activeElement.getAttribute('data--50-bottom'); // leave start
95893
+
95894
+ css2 = activeElement.getAttribute('data-top-bottom'); // }
95895
+
95896
+ let hasBasicAnim = false; // if(divAnimDefault.style.display==='flex') {
95897
+ // basic anim
95898
+
95899
+ 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')) {
95900
+ hasBasicAnim = true;
95901
+ } // }
95547
95902
 
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
95903
 
95555
95904
  if (css1 || css2 || hasBasicAnim) {
95556
95905
  return {
@@ -95572,38 +95921,66 @@ class AnimateScroll {
95572
95921
  }
95573
95922
 
95574
95923
  if (s === 'row') {
95575
- activeElement = this.builder.editor.activeCol.parentNode;
95924
+ if (this.builder.editor.activeCol) activeElement = this.builder.editor.activeCol.parentNode;
95576
95925
  }
95577
95926
 
95578
95927
  if (s === 'container') {
95579
- activeElement = this.builder.editor.activeCol.parentNode.parentNode;
95928
+ if (this.builder.editor.activeCol) activeElement = this.builder.editor.activeCol.parentNode.parentNode;
95580
95929
  }
95581
95930
 
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;
95931
+ if (s === 'bg') {
95932
+ let overlayBg;
95933
+ const box = this.builder.doc.querySelector('.box-select');
95934
+ if (box) overlayBg = box.querySelector('.is-overlay-bg');
95935
+ if (overlayBg) activeElement = overlayBg;
95936
+ }
95587
95937
 
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
95938
+ if (s === 'overlay') {
95939
+ let overlay;
95940
+ const box = this.builder.doc.querySelector('.box-select');
95941
+ if (box) overlay = box.querySelector('.is-overlay');
95942
+ if (overlay) activeElement = overlay;
95943
+ }
95594
95944
 
95595
- css2 = activeElement.getAttribute('data-top-bottom');
95945
+ if (s === 'box') {
95946
+ const box = this.builder.doc.querySelector('.box-select');
95947
+ if (box) activeElement = box;
95596
95948
  }
95597
95949
 
95598
- let hasBasicAnim = false;
95950
+ if (s === 'section') {
95951
+ const section = this.builder.doc.querySelector('.section-select');
95952
+ if (section) activeElement = section;
95953
+ }
95599
95954
 
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
- }
95955
+ if (!activeElement) {
95956
+ if (s === 'element') return this.readTarget('column');
95957
+ if (s === 'column') return this.readTarget('row');
95958
+ if (s === 'row') return this.readTarget('container');
95959
+ if (s === 'container') return this.readTarget('bg');
95960
+ if (s === 'bg') return this.readTarget('overlay');
95961
+ if (s === 'overlay') return this.readTarget('box');
95962
+ if (s === 'box') return this.readTarget('section');
95963
+ if (s === 'section') return false;
95605
95964
  }
95606
95965
 
95966
+ let css1, css2; // if(divAnimScroll.style.display==='flex'||divAnimScrollSimple.style.display==='flex') {
95967
+ // enter start
95968
+
95969
+ css1 = activeElement.getAttribute('data-bottom-top');
95970
+ if (!css1) css1 = activeElement.getAttribute('data-400-bottom');
95971
+ if (!css1) css1 = activeElement.getAttribute('data-200-bottom');
95972
+ if (!css1) css1 = activeElement.getAttribute('data--50-bottom'); // leave start
95973
+
95974
+ css2 = activeElement.getAttribute('data-top-bottom'); // }
95975
+
95976
+ let hasBasicAnim = false; // if(divAnimDefault.style.display==='flex') {
95977
+ // basic anim
95978
+
95979
+ 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')) {
95980
+ hasBasicAnim = true;
95981
+ } // }
95982
+
95983
+
95607
95984
  if (css1 || css2 || hasBasicAnim) {
95608
95985
  return {
95609
95986
  'element': activeElement,
@@ -95613,7 +95990,11 @@ class AnimateScroll {
95613
95990
  if (s === 'element') return this.readTarget('column');
95614
95991
  if (s === 'column') return this.readTarget('row');
95615
95992
  if (s === 'row') return this.readTarget('container');
95616
- if (s === 'container') return false;
95993
+ if (s === 'container') return this.readTarget('bg');
95994
+ if (s === 'bg') return this.readTarget('overlay');
95995
+ if (s === 'overlay') return this.readTarget('box');
95996
+ if (s === 'box') return this.readTarget('section');
95997
+ if (s === 'section') return false;
95617
95998
  }
95618
95999
  }
95619
96000
  }
@@ -95674,7 +96055,10 @@ class AnimateScroll {
95674
96055
  }
95675
96056
 
95676
96057
  edit() {
95677
- // Close all opened sidebar
96058
+ this.builder.wrapperEl.classList.add('hard-select');
96059
+ this.builder.activeBox.classList.add('box-select');
96060
+ this.builder.activeSection.classList.add('section-select'); // Close all opened sidebar
96061
+
95678
96062
  this.builder.sidebar.closeSidebar();
95679
96063
  this.modalAnimateScroll.classList.add('active');
95680
96064
  this.clickContent();
@@ -95693,7 +96077,6 @@ class ContentBox {
95693
96077
  const defaults = {
95694
96078
  wrapper: '.is-wrapper',
95695
96079
  previewURL: 'preview.html',
95696
- sectionHoverOutline: false,
95697
96080
  useSidebar: true,
95698
96081
  disableLoadingStatus: false,
95699
96082
  sidebarData: {
@@ -98375,6 +98758,9 @@ class ContentBox {
98375
98758
  snippetPathReplace: this.settings.snippetPathReplace,
98376
98759
  maxColumns: 6,
98377
98760
  maxEmbedImageWidth: this.settings.maxEmbedImageWidth,
98761
+ onSectionAdd: () => {
98762
+ this.pageSetup();
98763
+ },
98378
98764
  slider: this.settings.slider,
98379
98765
  onRender: () => {
98380
98766
  this.settings.onRender();
@@ -98605,7 +98991,8 @@ class ContentBox {
98605
98991
 
98606
98992
  init() {
98607
98993
  // Add special css (remove on destroy)
98608
- dom.appendHtml(this.doc.head, `<style id="_contentbox_lightbox">
98994
+ // This is also for backward compatible if using npm but still using old local assets/css
98995
+ dom.appendHtml(this.doc.head, `<style id="_contentbox_css">
98609
98996
  body {
98610
98997
  background: ${this.settings.backgroundColor};
98611
98998
  }
@@ -98616,6 +99003,113 @@ class ContentBox {
98616
99003
  pointer-events: unset;
98617
99004
  user-select: unset;
98618
99005
  }
99006
+
99007
+ .is-wrapper.is-edit {
99008
+ padding-left: 61px;
99009
+ }
99010
+
99011
+ /* Navbar Fix */
99012
+ .is-wrapper.is-edit .is-section.is-section-navbar,
99013
+ .is-wrapper.is-edit .is-section.is-section-navbar .is-topbar {
99014
+ left: 0;
99015
+ margin-left: 60px;
99016
+ width: calc(100% - 60px);
99017
+ }
99018
+ .is-wrapper.is-edit .is-section.is-section-navbar .is-topbar.static {
99019
+ width: 100%;
99020
+ margin-left: unset;
99021
+ }
99022
+
99023
+ /* protected section */
99024
+ .is-section.protected .is-box-tool {
99025
+ display: none !important;
99026
+ }
99027
+
99028
+ /* manual selection during animation edit */
99029
+ .hard-select .is-box-tool {
99030
+ display: none !important;
99031
+ }
99032
+ .hard-select .is-section-tool {
99033
+ display: none !important;
99034
+ }
99035
+ .hard-select .box-select {
99036
+ outline: #00da89 1px solid;
99037
+ outline-offset: -1px;
99038
+ z-index: 1;
99039
+ }
99040
+ .hard-select .box-select .is-box-tool {
99041
+ display: flex !important;
99042
+ }
99043
+ .hard-select .box-select .is-overlay {
99044
+ z-index: -1;
99045
+ }
99046
+ .hard-select .section-select .is-section-tool {
99047
+ display: block !important;
99048
+ }
99049
+
99050
+ /* drop block as section */
99051
+ .is-wrapper > .sortable-ghost {
99052
+ height: 40px !important;
99053
+ min-height: unset !important;
99054
+ background: rgba(204, 204, 204, 0.15) !important;
99055
+ }
99056
+
99057
+ /* toggle tool */
99058
+ .is-wrapper.is-clean-edit .hard-select .box-select .is-box-tool,
99059
+ .is-wrapper.is-clean-edit .box-select .is-box-tool {
99060
+ display: none !important;
99061
+ }
99062
+ .is-wrapper.is-clean-edit .hard-select .section-select .is-section-tool,
99063
+ .is-wrapper.is-clean-edit .section-select .is-section-tool {
99064
+ display: none !important;
99065
+ }
99066
+ .is-wrapper.is-clean-edit .hard-select .box-select,
99067
+ .is-wrapper.is-clean-edit .box-select {
99068
+ outline: none !important;
99069
+ }
99070
+
99071
+
99072
+ </style>`);
99073
+ dom.appendHtml(document.head, `<style id="_contentboxstuff_css">
99074
+
99075
+ #_cbhtml .is-modal.editbox.is-modal-content {
99076
+ z-index: 10002;
99077
+ position: fixed;
99078
+ overflow: hidden;
99079
+ width: 380px;
99080
+ height: auto;
99081
+ top: calc(50% - 250px);
99082
+ left: calc(50% - 175px);
99083
+ box-sizing: content-box;
99084
+ flex-direction: row;
99085
+ align-items: flex-start;
99086
+ }
99087
+ #_cbhtml .is-modal.editbox.is-modal-content.active {
99088
+ display: flex;
99089
+ }
99090
+ #_cbhtml .is-modal.editbox.is-modal-content .is-modal-overlay {
99091
+ display: none;
99092
+ }
99093
+
99094
+ #_cbhtml .is-modal.editsection.is-modal-content {
99095
+ z-index: 10002;
99096
+ position: fixed;
99097
+ overflow: hidden;
99098
+ width: 313px;
99099
+ height: auto;
99100
+ top: calc(50% - 265px);
99101
+ left: calc(50% - 157px);
99102
+ box-sizing: content-box;
99103
+ flex-direction: row;
99104
+ align-items: flex-start;
99105
+ }
99106
+ #_cbhtml .is-modal.editbox.is-modal-content.active {
99107
+ display: flex;
99108
+ }
99109
+ #_cbhtml .is-modal.editbox.is-modal-content .is-modal-overlay {
99110
+ display: none;
99111
+ }
99112
+
98619
99113
  </style>`); // Add page-overlay (to prevent mouseover during page init.
98620
99114
  // Otherwise the mouseover won't be triggered when the page ready)
98621
99115
 
@@ -98714,7 +99208,128 @@ class ContentBox {
98714
99208
 
98715
99209
  this.doc.addEventListener('click', this.doDocumentClick = e => {
98716
99210
  e = e || window.event;
98717
- var target = e.target || e.srcElement;
99211
+ var target = e.target || e.srcElement; //--- New UX ---
99212
+
99213
+ 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')) {
99214
+ if (target.closest('.is-wrapper') && !target.classList.contains('is-wrapper')) {
99215
+ // Inside Wrapper
99216
+ if (target.closest('.is-container')) {
99217
+ // Inside Container
99218
+ const box = target.closest('.is-box');
99219
+
99220
+ if (!target.closest('.is-tool') && !target.closest('.is-rowadd-tool')) {
99221
+ if (box.classList.contains('box-select')) {
99222
+ if (this.wrapperEl.classList.contains('is-container-edit')) {
99223
+ this.wrapperEl.classList.remove('is-container-edit');
99224
+ this.wrapperEl.classList.add('is-clean-edit');
99225
+ } else {
99226
+ this.wrapperEl.classList.add('is-container-edit');
99227
+ this.wrapperEl.classList.remove('is-clean-edit');
99228
+ }
99229
+ } else {
99230
+ this.wrapperEl.classList.add('is-container-edit');
99231
+ this.wrapperEl.classList.remove('is-clean-edit');
99232
+ }
99233
+ }
99234
+
99235
+ if (box) {
99236
+ // clear
99237
+ const prevBox = this.doc.querySelector('.box-select');
99238
+ if (prevBox) prevBox.classList.remove('box-select'); // select
99239
+
99240
+ box.classList.add('box-select');
99241
+ this.activeBox = box;
99242
+ this.wrapperEl.classList.add('hard-select');
99243
+ }
99244
+
99245
+ const section = target.closest('.is-section');
99246
+
99247
+ if (section) {
99248
+ // clear
99249
+ const prevSection = this.doc.querySelector('.section-select');
99250
+ if (prevSection) prevSection.classList.remove('section-select'); // select
99251
+
99252
+ section.classList.add('section-select');
99253
+ this.activeSection = section;
99254
+ }
99255
+ } else {
99256
+ // Outside Container
99257
+ this.editor.inspectedElement = null;
99258
+ this.editor.activeElement = null;
99259
+ this.editor.activeCol = null;
99260
+ const box = target.closest('.is-box');
99261
+
99262
+ if (box) {
99263
+ if (box.classList.contains('box-select') && !this.wrapperEl.classList.contains('is-clean-edit')) {
99264
+ // toggle
99265
+ const modalEditBox = this.builderStuff.querySelector('.editbox');
99266
+ const modalEditSection = this.builderStuff.querySelector('.editsection');
99267
+
99268
+ if (modalEditBox.style.display !== 'flex' && modalEditSection.style.display !== 'flex' && !this.animateScroll.modalAnimateScroll.classList.contains('active')) {
99269
+ // clear
99270
+ const prevBox = this.doc.querySelector('.box-select');
99271
+ if (prevBox) prevBox.classList.remove('box-select');
99272
+ const prevSection = this.doc.querySelector('.section-select');
99273
+ if (prevSection) prevSection.classList.remove('section-select');
99274
+ this.wrapperEl.classList.remove('hard-select');
99275
+ }
99276
+ } else {
99277
+ // clear
99278
+ const prevBox = this.doc.querySelector('.box-select');
99279
+ if (prevBox) prevBox.classList.remove('box-select');
99280
+ const prevSection = this.doc.querySelector('.section-select');
99281
+ if (prevSection) prevSection.classList.remove('section-select');
99282
+ box.classList.add('box-select');
99283
+ this.activeBox = box;
99284
+ const section = box.closest('.is-section');
99285
+ section.classList.add('section-select');
99286
+ this.activeSection = section;
99287
+ this.wrapperEl.classList.add('hard-select');
99288
+ }
99289
+ }
99290
+
99291
+ this.wrapperEl.classList.remove('is-container-edit');
99292
+ this.wrapperEl.classList.remove('is-clean-edit');
99293
+ }
99294
+
99295
+ const modalEditBox = this.builderStuff.querySelector('.editbox');
99296
+
99297
+ if (modalEditBox.style.display === 'flex') {
99298
+ this.editbox.read();
99299
+ }
99300
+
99301
+ const modalEditSection = this.builderStuff.querySelector('.editsection');
99302
+
99303
+ if (modalEditSection.style.display === 'flex') {
99304
+ this.editsection.read();
99305
+ }
99306
+
99307
+ if (this.settings.onPageContentClick) this.settings.onPageContentClick(e);
99308
+ } else {
99309
+ // Outside Wrapper
99310
+ this.wrapperEl.classList.remove('is-container-edit');
99311
+ this.wrapperEl.classList.remove('is-clean-edit');
99312
+ const modalEditBox = this.builderStuff.querySelector('.editbox');
99313
+ modalEditBox.style.display = '';
99314
+ const modalEditSection = this.builderStuff.querySelector('.editsection');
99315
+ modalEditSection.style.display = '';
99316
+
99317
+ if (modalEditBox.style.display !== 'flex' && modalEditSection.style.display !== 'flex' && !this.animateScroll.modalAnimateScroll.classList.contains('active')) {
99318
+ this.wrapperEl.classList.remove('hard-select'); // Remove previous box-select & section-select
99319
+
99320
+ const prevBox = this.doc.querySelectorAll('.box-select');
99321
+ prevBox.forEach(elm => {
99322
+ elm.classList.remove('box-select');
99323
+ });
99324
+ const prevSection = this.doc.querySelectorAll('.section-select');
99325
+ prevSection.forEach(elm => {
99326
+ elm.classList.remove('section-select');
99327
+ });
99328
+ }
99329
+ }
99330
+ } //---
99331
+
99332
+
98718
99333
  let a = false,
98719
99334
  b = false,
98720
99335
  c = false,
@@ -98746,8 +99361,6 @@ class ContentBox {
98746
99361
  }
98747
99362
 
98748
99363
  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
99364
  const boxTools = this.wrapperEl.querySelectorAll('.is-box-tool');
98752
99365
  boxTools.forEach(tool => {
98753
99366
  tool.style.display = 'none';
@@ -98794,8 +99407,6 @@ class ContentBox {
98794
99407
  }
98795
99408
 
98796
99409
  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
99410
  const boxTools = this.wrapperEl.querySelectorAll('.is-box-tool');
98800
99411
  boxTools.forEach(tool => {
98801
99412
  tool.style.display = 'none';
@@ -98962,6 +99573,8 @@ class ContentBox {
98962
99573
  }
98963
99574
 
98964
99575
  sectionSetup(section) {
99576
+ let tool = section.querySelector('.is-section-tool');
99577
+ if (tool) tool.parentNode.removeChild(tool);
98965
99578
  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
99579
  // Prepare for tooltip
98967
99580
 
@@ -98977,6 +99590,7 @@ class ContentBox {
98977
99590
  });
98978
99591
  const btnSectionEdit = section.querySelector('.is-section-edit');
98979
99592
  btnSectionEdit.addEventListener('click', () => {
99593
+ this.editbox.close();
98980
99594
  this.editsection.edit();
98981
99595
  });
98982
99596
  const btnSectionRemove = section.querySelector('.is-section-remove');
@@ -98984,8 +99598,7 @@ class ContentBox {
98984
99598
  const modal = document.querySelector('.is-modal.delsectionconfirm');
98985
99599
  this.editor.util.showModal(modal);
98986
99600
  });
98987
- } // sectionSetup
98988
-
99601
+ }
98989
99602
 
98990
99603
  boxSetup(box) {
98991
99604
  let tool = box.querySelector('.is-box-tool');
@@ -99008,6 +99621,7 @@ class ContentBox {
99008
99621
 
99009
99622
  const btnBoxEdit = box.querySelector('.is-box-edit');
99010
99623
  if (btnBoxEdit) btnBoxEdit.addEventListener('click', () => {
99624
+ this.editsection.close();
99011
99625
  this.editbox.edit();
99012
99626
  });
99013
99627
  const btnModuleEdit = box.querySelector('.is-module-edit');
@@ -99076,26 +99690,10 @@ class ContentBox {
99076
99690
 
99077
99691
  box.addEventListener('mouseenter', () => {
99078
99692
  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
- }
99693
+ if (this.wrapperEl.classList.contains('hard-select')) return; // New UX
99086
99694
 
99087
99695
  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
- }
99696
+ this.activeSection = box.closest('.is-section');
99099
99697
  });
99100
99698
  } // boxSetup
99101
99699
 
@@ -99161,17 +99759,19 @@ class ContentBox {
99161
99759
  }
99162
99760
 
99163
99761
  doUndoRedo() {
99762
+ /*
99164
99763
  // Clean
99165
99764
  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 = '';
99765
+ [data--100-bottom],[data--150-bottom],[data--200-bottom],[data--300-bottom],[data--400-bottom],
99766
+ [data-bottom-top],[data-400-bottom],[data-300-bottom],[data-200-bottom],[data-150-bottom],
99767
+ [data-100-bottom],[data-50-bottom],[data-bottom],[data-center-bottom],[data-100-top],
99768
+ [data-50-top],[data-top],[data-top-bottom]`);
99769
+ elms.forEach(elm=>{
99770
+ elm.style.transform = '';
99771
+ elm.style.transition = '';
99772
+ elm.style.opacity = '';
99174
99773
  });
99774
+ */
99175
99775
  this.pageSetup(); // To refresh skrollrr anim
99176
99776
 
99177
99777
  if (this.win.skrollrr) {
@@ -99180,30 +99780,33 @@ class ContentBox {
99180
99780
  }
99181
99781
 
99182
99782
  refreshPage() {
99783
+ /*
99183
99784
  // Clean
99184
99785
  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
-
99786
+ [data--100-bottom],[data--150-bottom],[data--200-bottom],[data--300-bottom],[data--400-bottom],
99787
+ [data-bottom-top],[data-400-bottom],[data-300-bottom],[data-200-bottom],[data-150-bottom],
99788
+ [data-100-bottom],[data-50-bottom],[data-bottom],[data-center-bottom],[data-100-top],
99789
+ [data-50-top],[data-top],[data-top-bottom]`);
99790
+ elms.forEach(elm=>{
99791
+ elm.style.transform = '';
99792
+ elm.style.transition = '';
99793
+ elm.style.opacity = '';
99794
+ });
99795
+ //--- Same as undo/redo process ---
99195
99796
  const wrapper = this.wrapperEl;
99196
99797
  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));
99798
+ sections.forEach((section)=>{
99799
+ const html = section.innerHTML;
99800
+ var range = document.createRange();
99801
+ section.innerHTML = '';
99802
+ section.appendChild(range.createContextualFragment(html));
99202
99803
  });
99804
+
99203
99805
  this.editor.uo.cleaning(wrapper);
99204
- this.pageSetup(); //---
99806
+ this.pageSetup();
99807
+ //---
99808
+ */
99205
99809
  // To refresh skrollrr anim
99206
-
99207
99810
  if (this.win.skrollrr) {
99208
99811
  this.win.skrollrr.refresh();
99209
99812
  }
@@ -99996,8 +100599,10 @@ class ContentBox {
99996
100599
  this.builderStuff.innerHTML = '';
99997
100600
  dom.removeClass(document.body, 'sidebar-active'); // Remove special css
99998
100601
 
99999
- const cblightboxStyle = document.querySelector('#_contentbox_lightbox');
100000
- if (cblightboxStyle) cblightboxStyle.parentNode.removeChild(cblightboxStyle); // Render html content
100602
+ const cbContentStyle = this.doc.querySelector('#_contentbox_css');
100603
+ if (cbContentStyle) cbContentStyle.parentNode.removeChild(cbContentStyle);
100604
+ const cbStuffStyle = document.querySelector('#_contentboxstuff_css');
100605
+ if (cbStuffStyle) cbStuffStyle.parentNode.removeChild(cbStuffStyle); // Render html content
100001
100606
 
100002
100607
  let range = document.createRange();
100003
100608
  const wrapper = this.wrapperEl;