@innovastudio/contentbox 1.5.12 → 1.5.13

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
3
  "type": "module",
4
- "version": "1.5.12",
4
+ "version": "1.5.13",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -46,7 +46,7 @@
46
46
  "webpack-dev-server": "^4.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@innovastudio/contentbuilder": "^1.4.11",
49
+ "@innovastudio/contentbuilder": "^1.4.13",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -4052,9 +4052,6 @@ class EditSection {
4052
4052
  <button title="${out('Tablet (Portrait)')}" class="input-breakpoint on" data-value="sm" style="width:40px;height:25px;">
4053
4053
  <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
4054
4054
  </button>
4055
-
4056
- <label for="chkReverseBoxes" style="margin:0;margin-left:70px;display:flex"><input id="chkReverseBoxes" type="checkbox" style="margin:0 7px 0 0"/><span>${out('Reverse Boxes')}</span></label>
4057
-
4058
4055
  </div>
4059
4056
  </div>
4060
4057
 
@@ -4090,6 +4087,10 @@ class EditSection {
4090
4087
  <span>${out('Hidden')}</span>
4091
4088
  </button>
4092
4089
  </div>
4090
+
4091
+ <div id="divReverseBoxes" style="display:none">
4092
+ <label for="chkReverseBoxes" style="margin:20px 0 0 0;display:flex"><input id="chkReverseBoxes" type="checkbox" style="margin:0 7px 0 0"/><span>${out('Reverse Boxes')}</span></label>
4093
+ </div>
4093
4094
  ` + '</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>' +
4094
4095
  '<button title="' + out('Clear') + '" class="cmd-section-anim-start" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>';
4095
4096
  html += '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('End') + ':</div>' + '<div style="display:flex;flex-flow:wrap;">' + '<button title="' + out('Slide Left') + '" class="cmd-section-anim-end" data-value="slide-left">' + out('Slide Left') + '</button>' + '<button title="' + out('Slide Right') + '" class="cmd-section-anim-end" data-value="slide-right">' + out('Slide Right') + '</button>' + // '<button title="' + out('Slide Back') + '" class="cmd-section-anim-end" data-value="slide-back">' + out('Slide Back') + '</button>' +
@@ -4496,17 +4497,54 @@ class EditSection {
4496
4497
 
4497
4498
  this.builder.onChange();
4498
4499
  });
4499
- });
4500
+ }); // const chkReverseBoxes = modalEditSection.querySelector('#chkReverseBoxes');
4501
+ // chkReverseBoxes.addEventListener('click', ()=>{
4502
+ // let section = this.builder.activeSection;
4503
+ // if(!section) return;
4504
+ // this.builder.editor.saveForUndo();
4505
+ // if(chkReverseBoxes.checked) {
4506
+ // section.classList.add('box-reverse');
4507
+ // } else {
4508
+ // section.classList.remove('box-reverse');
4509
+ // }
4510
+ // //Trigger Change event
4511
+ // this.builder.settings.onChange();
4512
+ // });
4513
+
4500
4514
  const chkReverseBoxes = modalEditSection.querySelector('#chkReverseBoxes');
4501
4515
  chkReverseBoxes.addEventListener('click', () => {
4502
4516
  let section = this.builder.activeSection;
4503
4517
  if (!section) return;
4504
4518
  this.builder.editor.saveForUndo();
4519
+ section.classList.remove('box-reverse'); // clear old
4505
4520
 
4506
- if (chkReverseBoxes.checked) {
4507
- section.classList.add('box-reverse');
4508
- } else {
4509
- section.classList.remove('box-reverse');
4521
+ let divTarget = modalEditSection.querySelector('.div-target');
4522
+ let target = this.builder.editor.responsive.readTarget(divTarget);
4523
+
4524
+ if (target === 'xs') {
4525
+ if (chkReverseBoxes.checked) {
4526
+ section.classList.add('xs-box-reverse');
4527
+ } else {
4528
+ section.classList.remove('xs-box-reverse');
4529
+ }
4530
+ } else if (target === 'sm') {
4531
+ if (chkReverseBoxes.checked) {
4532
+ section.classList.add('sm-box-reverse');
4533
+ } else {
4534
+ section.classList.remove('sm-box-reverse');
4535
+ }
4536
+ } else if (target === 'md') {
4537
+ if (chkReverseBoxes.checked) {
4538
+ section.classList.add('md-box-reverse');
4539
+ } else {
4540
+ section.classList.remove('md-box-reverse');
4541
+ }
4542
+ } else if (target === '') {
4543
+ if (chkReverseBoxes.checked) {
4544
+ section.classList.add('desktop-box-reverse');
4545
+ } else {
4546
+ section.classList.remove('desktop-box-reverse');
4547
+ }
4510
4548
  } //Trigger Change event
4511
4549
 
4512
4550
 
@@ -4577,12 +4615,27 @@ class EditSection {
4577
4615
  } // Section Visibility
4578
4616
 
4579
4617
 
4580
- realtimeVisibility(cell) {
4618
+ realtimeVisibility(section) {
4581
4619
  let divTarget = this.modalEditSection.querySelector('.div-target');
4582
4620
  let divVisibility = this.modalEditSection.querySelector('.div-visibility');
4583
4621
  let target = this.builder.editor.responsive.readTarget(divTarget);
4584
- let valVisibility = this.builder.editor.responsive.getVisibility(cell, target);
4585
- this.builder.editor.responsive.showVisibility(divVisibility, valVisibility);
4622
+ let valVisibility = this.builder.editor.responsive.getVisibility(section, target);
4623
+ this.builder.editor.responsive.showVisibility(divVisibility, valVisibility); // Column reverse
4624
+
4625
+ let valReverse = false;
4626
+
4627
+ if (target === 'xs') {
4628
+ valReverse = section.classList.contains('xs-box-reverse');
4629
+ } else if (target === 'sm') {
4630
+ valReverse = section.classList.contains('sm-box-reverse');
4631
+ } else if (target === 'md') {
4632
+ valReverse = section.classList.contains('md-box-reverse');
4633
+ } else {
4634
+ valReverse = section.classList.contains('desktop-box-reverse');
4635
+ }
4636
+
4637
+ const chkReverseBoxes = this.modalEditSection.querySelector('#chkReverseBoxes');
4638
+ chkReverseBoxes.checked = valReverse;
4586
4639
  }
4587
4640
 
4588
4641
  read() {
@@ -4800,12 +4853,12 @@ class EditSection {
4800
4853
  dom$m.addClass(modalEditSection.querySelector('.input-breakpoint[data-value="sm"]'), 'on');
4801
4854
  }
4802
4855
 
4803
- const chkReverseBoxes = modalEditSection.querySelector('#chkReverseBoxes');
4856
+ const divReverseBoxes = modalEditSection.querySelector('#divReverseBoxes');
4804
4857
 
4805
- if (activeSection.classList.contains('box-reverse')) {
4806
- chkReverseBoxes.checked = true;
4858
+ if (activeSection.querySelectorAll('.is-box').length > 1) {
4859
+ divReverseBoxes.style.display = 'flex';
4807
4860
  } else {
4808
- chkReverseBoxes.checked = false;
4861
+ divReverseBoxes.style.display = 'none';
4809
4862
  }
4810
4863
  }
4811
4864
 
@@ -71754,8 +71807,9 @@ class RowTool {
71754
71807
  </button>
71755
71808
  </div>
71756
71809
 
71757
- <label for="chkReverseColumns" style="margin:20px 0 0;display:flex"><input id="chkReverseColumns" type="checkbox" style="margin:0 7px 0 0"/><span>${util.out('Reverse Columns')}</span></label>
71758
-
71810
+ <div id="divReverseColumns" style="diplay:none">
71811
+ <label for="chkReverseColumns" style="margin:20px 0 0;display:flex"><input id="chkReverseColumns" type="checkbox" style="margin:0 7px 0 0"/><span>${util.out('Reverse Columns')}</span></label>
71812
+ </div>
71759
71813
  </div>
71760
71814
 
71761
71815
  <div id="divRowMore" class="is-tab-content" data-group="rowsettings" tabindex="-1">
@@ -72565,7 +72619,33 @@ class RowTool {
72565
72619
 
72566
72620
  let actualRow = row.parentNode; // row is actually row overlay
72567
72621
 
72568
- this.realtimeVisibility(actualRow); //More
72622
+ this.realtimeVisibility(actualRow);
72623
+ const divReverseBoxes = this.rowSettings.querySelector('#divReverseColumns');
72624
+ let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
72625
+
72626
+ if (actualRow.querySelector('.is-row-overlay')) {
72627
+ num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
72628
+ }
72629
+
72630
+ if (actualRow.childElementCount - num > 1) {
72631
+ divReverseBoxes.style.display = 'flex';
72632
+ } else {
72633
+ divReverseBoxes.style.display = 'none';
72634
+ }
72635
+
72636
+ let elms = this.rowSettings.querySelectorAll('.input-breakpoint');
72637
+ elms.forEach(elm => {
72638
+ elm.classList.remove('on');
72639
+ });
72640
+
72641
+ if (actualRow.classList.contains('md-wrap')) {
72642
+ this.rowSettings.querySelector('.input-breakpoint[data-value="md"]').classList.add('on');
72643
+ } else if (actualRow.classList.contains('sm-wrap')) {
72644
+ this.rowSettings.querySelector('.input-breakpoint[data-value="sm"]').classList.add('on');
72645
+ } else {
72646
+ this.rowSettings.querySelector('.input-breakpoint[data-value="xs"]').classList.add('on');
72647
+ } //More
72648
+
72569
72649
 
72570
72650
  let inpRowId = this.rowSettings.querySelector('.input-row-id');
72571
72651
  inpRowId.value = '';