@innovastudio/contentbox 1.5.12 → 1.5.14

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.
@@ -676,7 +676,7 @@ class SideBar {
676
676
  */
677
677
 
678
678
 
679
- html += `<div class="is-pop page-quick-settings arrow-left" style="z-index:10004;position: fixed;" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
679
+ html += `<div class="is-pop page-quick-settings arrow-left" style="z-index:10006;position: fixed;" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
680
680
  <div style="display:flex;flex-flow:wrap;flex-direction: column;width: 190px;margin:12px 12px 14px;">
681
681
  <div class="is-label"><span>${out('Zoom')}</span>:</div>
682
682
  <div style="padding-top:4px">
@@ -4046,15 +4046,15 @@ class EditSection {
4046
4046
  <div class="div-section-wrapboxes" style="display:flex;flex-direction:column;">
4047
4047
  <div style="padding-top:20px;padding-bottom:3px;">${out('Wrap Boxes (Breakpoint)')}:</div>
4048
4048
  <div style="padding-top:3px;display:flex;align-items: center;">
4049
- <button title="${out('Tablet (Landscape)')}" class="input-breakpoint" data-value="md" style="width:40px;height:25px;">
4050
- <svg class="is-icon-flex" style="width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>
4051
- </button>
4052
- <button title="${out('Tablet (Portrait)')}" class="input-breakpoint on" data-value="sm" style="width:40px;height:25px;">
4053
- <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
4054
- </button>
4055
4049
 
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
-
4050
+ <label class="flex mr-5" title="${out('Tablet (Landscape)')}">
4051
+ <input type="radio" id="rdoBoxMdWrap" name="boxWrap" value="md">
4052
+ <svg class="is-icon-flex" style="margin-left:3px;width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>
4053
+ </label>
4054
+ <label class="flex" title="${out('Tablet (Portrait)')}">
4055
+ <input type="radio" id="rdoBoxSmWrap" name="boxWrap" value="sm">
4056
+ <svg class="is-icon-flex" style="margin-left:3px;width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
4057
+ </label>
4058
4058
  </div>
4059
4059
  </div>
4060
4060
 
@@ -4090,6 +4090,10 @@ class EditSection {
4090
4090
  <span>${out('Hidden')}</span>
4091
4091
  </button>
4092
4092
  </div>
4093
+
4094
+ <div id="divReverseBoxes" style="display:none">
4095
+ <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>
4096
+ </div>
4093
4097
  ` + '</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
4098
  '<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
4099
  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>' +
@@ -4474,22 +4478,15 @@ class EditSection {
4474
4478
  }
4475
4479
  }); // Breakpoint
4476
4480
 
4477
- let btns = modalEditSection.querySelectorAll('.input-breakpoint');
4478
- btns.forEach(btn => {
4479
- btn.addEventListener('click', () => {
4481
+ modalEditSection.querySelectorAll('input[name="boxWrap"]').forEach(input => {
4482
+ input.addEventListener('change', () => {
4480
4483
  let section = this.builder.activeSection;
4481
4484
  if (!section) return;
4482
4485
  this.builder.editor.saveForUndo();
4483
- let elms = modalEditSection.querySelectorAll('.input-breakpoint');
4484
- elms.forEach(elm => {
4485
- elm.classList.remove('on');
4486
- });
4487
- btn.classList.add('on');
4488
- let target = btn.getAttribute('data-value');
4489
4486
 
4490
- if (target === 'sm') {
4487
+ if (input.value === 'sm') {
4491
4488
  section.classList.remove('md-wrap');
4492
- } else if (target === 'md') {
4489
+ } else if (input.value === 'md') {
4493
4490
  section.classList.add('md-wrap');
4494
4491
  } //Trigger Change event
4495
4492
 
@@ -4502,18 +4499,42 @@ class EditSection {
4502
4499
  let section = this.builder.activeSection;
4503
4500
  if (!section) return;
4504
4501
  this.builder.editor.saveForUndo();
4502
+ section.classList.remove('box-reverse'); // clear old
4505
4503
 
4506
- if (chkReverseBoxes.checked) {
4507
- section.classList.add('box-reverse');
4508
- } else {
4509
- section.classList.remove('box-reverse');
4504
+ let divTarget = modalEditSection.querySelector('.div-target');
4505
+ let target = this.builder.editor.responsive.readTarget(divTarget);
4506
+
4507
+ if (target === 'xs') {
4508
+ if (chkReverseBoxes.checked) {
4509
+ section.classList.add('xs-box-reverse');
4510
+ } else {
4511
+ section.classList.remove('xs-box-reverse');
4512
+ }
4513
+ } else if (target === 'sm') {
4514
+ if (chkReverseBoxes.checked) {
4515
+ section.classList.add('sm-box-reverse');
4516
+ } else {
4517
+ section.classList.remove('sm-box-reverse');
4518
+ }
4519
+ } else if (target === 'md') {
4520
+ if (chkReverseBoxes.checked) {
4521
+ section.classList.add('md-box-reverse');
4522
+ } else {
4523
+ section.classList.remove('md-box-reverse');
4524
+ }
4525
+ } else if (target === '') {
4526
+ if (chkReverseBoxes.checked) {
4527
+ section.classList.add('desktop-box-reverse');
4528
+ } else {
4529
+ section.classList.remove('desktop-box-reverse');
4530
+ }
4510
4531
  } //Trigger Change event
4511
4532
 
4512
4533
 
4513
4534
  this.builder.settings.onChange();
4514
4535
  }); // Section Visibility
4515
4536
 
4516
- btns = modalEditSection.querySelectorAll('.input-device');
4537
+ let btns = modalEditSection.querySelectorAll('.input-device');
4517
4538
  btns.forEach(btn => {
4518
4539
  btn.addEventListener('click', () => {
4519
4540
  let section = this.builder.activeSection;
@@ -4577,12 +4598,55 @@ class EditSection {
4577
4598
  } // Section Visibility
4578
4599
 
4579
4600
 
4580
- realtimeVisibility(cell) {
4601
+ realtimeVisibility(section, initialOpen) {
4602
+ if (initialOpen) {
4603
+ const builderStuff = this.builder.builderStuff;
4604
+ const modal = builderStuff.querySelector('.is-modal.content-preview.active');
4605
+
4606
+ if (modal) {
4607
+ let elms = this.modalEditSection.querySelectorAll('.input-device');
4608
+ elms.forEach(elm => {
4609
+ elm.classList.remove('on');
4610
+ });
4611
+
4612
+ if (modal.classList.contains('is-screen-1920')) {
4613
+ this.modalEditSection.querySelector('.input-device[data-value=""]').classList.add('on');
4614
+ } else if (modal.classList.contains('is-screen-1440')) {
4615
+ this.modalEditSection.querySelector('.input-device[data-value=""]').classList.add('on');
4616
+ } else if (modal.classList.contains('is-screen-1024')) {
4617
+ this.modalEditSection.querySelector('.input-device[data-value="md"]').classList.add('on');
4618
+ } else if (modal.classList.contains('is-screen-768')) {
4619
+ this.modalEditSection.querySelector('.input-device[data-value="sm"]').classList.add('on');
4620
+ } else if (modal.classList.contains('is-screen-375')) {
4621
+ this.modalEditSection.querySelector('.input-device[data-value="xs"]').classList.add('on');
4622
+ }
4623
+ }
4624
+ }
4625
+
4581
4626
  let divTarget = this.modalEditSection.querySelector('.div-target');
4582
4627
  let divVisibility = this.modalEditSection.querySelector('.div-visibility');
4583
4628
  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);
4629
+ let valVisibility = this.builder.editor.responsive.getVisibility(section, target);
4630
+ this.builder.editor.responsive.showVisibility(divVisibility, valVisibility); // Column reverse
4631
+
4632
+ let valReverse = false;
4633
+
4634
+ if (target === 'xs') {
4635
+ valReverse = section.classList.contains('xs-box-reverse');
4636
+ if (!initialOpen) this.builder.editor.livePreview.resizePreview(375);
4637
+ } else if (target === 'sm') {
4638
+ valReverse = section.classList.contains('sm-box-reverse');
4639
+ if (!initialOpen) this.builder.editor.livePreview.resizePreview(768);
4640
+ } else if (target === 'md') {
4641
+ valReverse = section.classList.contains('md-box-reverse');
4642
+ if (!initialOpen) this.builder.editor.livePreview.resizePreview(1024);
4643
+ } else {
4644
+ valReverse = section.classList.contains('desktop-box-reverse');
4645
+ if (!initialOpen) this.builder.editor.livePreview.resizePreview(1920);
4646
+ }
4647
+
4648
+ const chkReverseBoxes = this.modalEditSection.querySelector('#chkReverseBoxes');
4649
+ chkReverseBoxes.checked = valReverse;
4586
4650
  }
4587
4651
 
4588
4652
  read() {
@@ -4788,24 +4852,20 @@ class EditSection {
4788
4852
  } // Section Visibility
4789
4853
 
4790
4854
 
4791
- this.realtimeVisibility(activeSection);
4792
- btns = modalEditSection.querySelectorAll('.input-breakpoint');
4793
- btns.forEach(btn => {
4794
- dom$m.removeClass(btn, 'on');
4795
- });
4855
+ this.realtimeVisibility(activeSection, true);
4796
4856
 
4797
4857
  if (activeSection.classList.contains('md-wrap')) {
4798
- dom$m.addClass(modalEditSection.querySelector('.input-breakpoint[data-value="md"]'), 'on');
4858
+ modalEditSection.querySelector('#rdoBoxMdWrap').checked = true;
4799
4859
  } else {
4800
- dom$m.addClass(modalEditSection.querySelector('.input-breakpoint[data-value="sm"]'), 'on');
4860
+ modalEditSection.querySelector('#rdoBoxSmWrap').checked = true;
4801
4861
  }
4802
4862
 
4803
- const chkReverseBoxes = modalEditSection.querySelector('#chkReverseBoxes');
4863
+ const divReverseBoxes = modalEditSection.querySelector('#divReverseBoxes');
4804
4864
 
4805
- if (activeSection.classList.contains('box-reverse')) {
4806
- chkReverseBoxes.checked = true;
4865
+ if (activeSection.querySelectorAll('.is-box').length > 1) {
4866
+ divReverseBoxes.style.display = 'flex';
4807
4867
  } else {
4808
- chkReverseBoxes.checked = false;
4868
+ divReverseBoxes.style.display = 'none';
4809
4869
  }
4810
4870
  }
4811
4871
 
@@ -71708,16 +71768,20 @@ class RowTool {
71708
71768
 
71709
71769
  <div class="div-row-wrapcolumns" style="display:flex;flex-direction:column;padding-bottom:7px">
71710
71770
  <div style="padding-top:20px;padding-bottom:3px;">${util.out('Wrap Columns (Breakpoint)')}:</div>
71711
- <div style="padding-top:3px;display:flex;align-items: center;">
71712
- <button title="${util.out('Tablet (Landscape)')}" class="input-breakpoint" data-value="md" style="width:40px;height:25px;">
71713
- <svg class="is-icon-flex" style="width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>
71714
- </button>
71715
- <button title="${util.out('Tablet (Portrait)')}" class="input-breakpoint" data-value="sm" style="width:40px;height:25px;">
71716
- <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
71717
- </button>
71718
- <button title="${util.out('Mobile')}" class="input-breakpoint on" data-value="xs" style="width:40px;height:25px;">
71719
- <svg class="is-icon-flex" style="width:13px;height:13px"><use xlink:href="#icon-device-mobile"></use></svg>
71720
- </button>
71771
+ <div style="padding-top:3px;padding-bottom:5px;display:flex;align-items: center;">
71772
+
71773
+ <label class="flex mr-3" title="${util.out('Tablet (Landscape)')}">
71774
+ <input type="radio" id="rdoColMdWrap" name="boxWrap" value="md">
71775
+ <svg class="is-icon-flex" style="margin-left:3px;width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>
71776
+ </label>
71777
+ <label class="flex mr-3" title="${util.out('Tablet (Portrait)')}">
71778
+ <input type="radio" id="rdoColSmWrap" name="boxWrap" value="sm">
71779
+ <svg class="is-icon-flex" style="margin-left:3px;width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
71780
+ </label>
71781
+ <label class="flex" title="${util.out('Mobile')}">
71782
+ <input type="radio" id="rdoColXsWrap" name="boxWrap" value="xs">
71783
+ <svg class="is-icon-flex" style="margin-left:3px;width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
71784
+ </label>
71721
71785
 
71722
71786
  </div>
71723
71787
  </div>
@@ -71754,8 +71818,9 @@ class RowTool {
71754
71818
  </button>
71755
71819
  </div>
71756
71820
 
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
-
71821
+ <div id="divReverseColumns" style="diplay:none">
71822
+ <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>
71823
+ </div>
71759
71824
  </div>
71760
71825
 
71761
71826
  <div id="divRowMore" class="is-tab-content" data-group="rowsettings" tabindex="-1">
@@ -71970,32 +72035,25 @@ class RowTool {
71970
72035
  this.builder.opts.onChange();
71971
72036
  }); // Breakpoint
71972
72037
 
71973
- let btns = this.rowSettings.querySelectorAll('.input-breakpoint');
71974
- btns.forEach(btn => {
71975
- btn.addEventListener('click', () => {
72038
+ rowSettings.querySelectorAll('input[name="boxWrap"]').forEach(input => {
72039
+ input.addEventListener('change', () => {
71976
72040
  let row = util.rowSelected();
71977
72041
  if (!row) return;
71978
72042
  this.builder.uo.saveForUndo();
71979
- let elms = this.rowSettings.querySelectorAll('.input-breakpoint');
71980
- elms.forEach(elm => {
71981
- elm.classList.remove('on');
71982
- });
71983
- btn.classList.add('on');
71984
- let target = btn.getAttribute('data-value');
71985
72043
 
71986
- if (target === 'xs') {
72044
+ if (input.value === 'xs') {
71987
72045
  row.classList.remove('sm-wrap');
71988
72046
  row.classList.remove('md-wrap');
71989
- } else if (target === 'sm') {
72047
+ } else if (input.value === 'sm') {
71990
72048
  row.classList.remove('md-wrap');
71991
72049
  row.classList.add('sm-wrap');
71992
- } else if (target === 'md') {
71993
- row.classList.remove('smd-wrap');
72050
+ } else if (input.value === 'md') {
72051
+ row.classList.remove('sm-wrap');
71994
72052
  row.classList.add('md-wrap');
71995
72053
  } //Trigger Change event
71996
72054
 
71997
72055
 
71998
- this.builder.onChange();
72056
+ this.builder.opts.onChange();
71999
72057
  });
72000
72058
  });
72001
72059
  const chkReverseBoxes = this.rowSettings.querySelector('#chkReverseColumns');
@@ -72036,7 +72094,7 @@ class RowTool {
72036
72094
  this.builder.settings.onChange();
72037
72095
  }); // Responsive Visibility
72038
72096
 
72039
- btns = this.rowSettings.querySelectorAll('.input-device');
72097
+ let btns = this.rowSettings.querySelectorAll('.input-device');
72040
72098
  btns.forEach(btn => {
72041
72099
  btn.addEventListener('click', () => {
72042
72100
  let row = util.rowSelected();
@@ -72236,7 +72294,31 @@ class RowTool {
72236
72294
  // });
72237
72295
  }
72238
72296
 
72239
- realtimeVisibility(row) {
72297
+ realtimeVisibility(row, initialOpen) {
72298
+ if (initialOpen) {
72299
+ const builderStuff = this.builder.builderStuff;
72300
+ const modal = builderStuff.querySelector('.is-modal.content-preview.active');
72301
+
72302
+ if (modal) {
72303
+ let elms = this.rowSettings.querySelectorAll('.input-device');
72304
+ elms.forEach(elm => {
72305
+ elm.classList.remove('on');
72306
+ });
72307
+
72308
+ if (modal.classList.contains('is-screen-1920')) {
72309
+ this.rowSettings.querySelector('.input-device[data-value=""]').classList.add('on');
72310
+ } else if (modal.classList.contains('is-screen-1440')) {
72311
+ this.rowSettings.querySelector('.input-device[data-value=""]').classList.add('on');
72312
+ } else if (modal.classList.contains('is-screen-1024')) {
72313
+ this.rowSettings.querySelector('.input-device[data-value="md"]').classList.add('on');
72314
+ } else if (modal.classList.contains('is-screen-768')) {
72315
+ this.rowSettings.querySelector('.input-device[data-value="sm"]').classList.add('on');
72316
+ } else if (modal.classList.contains('is-screen-375')) {
72317
+ this.rowSettings.querySelector('.input-device[data-value="xs"]').classList.add('on');
72318
+ }
72319
+ }
72320
+ }
72321
+
72240
72322
  let divTarget = this.rowSettings.querySelector('.div-target');
72241
72323
  let divVisibility = this.rowSettings.querySelector('.div-visibility');
72242
72324
  let target = this.builder.responsive.readTarget(divTarget);
@@ -72247,12 +72329,16 @@ class RowTool {
72247
72329
 
72248
72330
  if (target === 'xs') {
72249
72331
  valReverse = row.classList.contains('xs-column-reverse');
72332
+ if (!initialOpen) this.builder.livePreview.resizePreview(375);
72250
72333
  } else if (target === 'sm') {
72251
72334
  valReverse = row.classList.contains('sm-column-reverse');
72335
+ if (!initialOpen) this.builder.livePreview.resizePreview(768);
72252
72336
  } else if (target === 'md') {
72253
72337
  valReverse = row.classList.contains('md-column-reverse');
72338
+ if (!initialOpen) this.builder.livePreview.resizePreview(1024);
72254
72339
  } else {
72255
72340
  valReverse = row.classList.contains('desktop-column-reverse');
72341
+ if (!initialOpen) this.builder.livePreview.resizePreview(1920);
72256
72342
  }
72257
72343
 
72258
72344
  const chkReverseColumns = this.rowSettings.querySelector('#chkReverseColumns');
@@ -72565,7 +72651,28 @@ class RowTool {
72565
72651
 
72566
72652
  let actualRow = row.parentNode; // row is actually row overlay
72567
72653
 
72568
- this.realtimeVisibility(actualRow); //More
72654
+ this.realtimeVisibility(actualRow, true);
72655
+ const divReverseBoxes = this.rowSettings.querySelector('#divReverseColumns');
72656
+ let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
72657
+
72658
+ if (actualRow.querySelector('.is-row-overlay')) {
72659
+ num = 4; //is-row-tool, is-col-tool, is-rowadd-tool & is-row-overlay
72660
+ }
72661
+
72662
+ if (actualRow.childElementCount - num > 1) {
72663
+ divReverseBoxes.style.display = 'flex';
72664
+ } else {
72665
+ divReverseBoxes.style.display = 'none';
72666
+ }
72667
+
72668
+ if (actualRow.classList.contains('md-wrap')) {
72669
+ this.rowSettings.querySelector('#rdoColMdWrap').checked = true;
72670
+ } else if (actualRow.classList.contains('sm-wrap')) {
72671
+ this.rowSettings.querySelector('#rdoColSmWrap').checked = true;
72672
+ } else {
72673
+ this.rowSettings.querySelector('#rdoColXsWrap').checked = true;
72674
+ } //More
72675
+
72569
72676
 
72570
72677
  let inpRowId = this.rowSettings.querySelector('.input-row-id');
72571
72678
  inpRowId.value = '';
@@ -74511,6 +74618,12 @@ class ColumnTool {
74511
74618
  });
74512
74619
  let btnVisible = this.cellSettings.querySelector('.input-visible');
74513
74620
  let btnHidden = this.cellSettings.querySelector('.input-hidden');
74621
+
74622
+ const rowHasHiddenColumns = (row, target) => {
74623
+ let cols = row.querySelectorAll(`.${target}-hidden`);
74624
+ return cols.length > 0;
74625
+ };
74626
+
74514
74627
  btnVisible.addEventListener('click', () => {
74515
74628
  let cell = this.util.cellSelected();
74516
74629
  if (!cell) return;
@@ -74523,12 +74636,13 @@ class ColumnTool {
74523
74636
  cell.classList.remove('xs-hidden');
74524
74637
  } else if (target === 'sm') {
74525
74638
  cell.classList.remove('sm-hidden');
74526
- cell.parentNode.classList.remove('sm-autofit');
74639
+ if (!rowHasHiddenColumns(cell.parentNode, 'sm')) cell.parentNode.classList.remove('sm-autofit');
74527
74640
  } else if (target === 'md') {
74528
74641
  cell.classList.remove('md-hidden');
74529
- cell.parentNode.classList.remove('md-autofit');
74642
+ if (!rowHasHiddenColumns(cell.parentNode, 'md')) cell.parentNode.classList.remove('md-autofit');
74530
74643
  } else if (target === '') {
74531
74644
  cell.classList.remove('desktop-hidden');
74645
+ if (!rowHasHiddenColumns(cell.parentNode, 'desktop')) cell.parentNode.classList.remove('desktop-autofit');
74532
74646
  }
74533
74647
 
74534
74648
  btnVisible.classList.add('on');
@@ -74554,6 +74668,7 @@ class ColumnTool {
74554
74668
  cell.parentNode.classList.add('md-autofit');
74555
74669
  } else if (target === '') {
74556
74670
  cell.classList.add('desktop-hidden');
74671
+ cell.parentNode.classList.add('desktop-autofit');
74557
74672
  }
74558
74673
 
74559
74674
  btnVisible.classList.remove('on');
@@ -74751,7 +74866,7 @@ class ColumnTool {
74751
74866
  dom.addClass(btn, 'on');
74752
74867
  }
74753
74868
 
74754
- this.realtimeVisibility(cell); //More
74869
+ this.realtimeVisibility(cell, true); //More
74755
74870
 
74756
74871
  let inpCellId = this.cellSettings.querySelector('.input-cell-id');
74757
74872
  inpCellId.value = '';
@@ -74767,12 +74882,46 @@ class ColumnTool {
74767
74882
  inpCellClasses.value = classes;
74768
74883
  }
74769
74884
 
74770
- realtimeVisibility(cell) {
74885
+ realtimeVisibility(cell, initialOpen) {
74886
+ if (initialOpen) {
74887
+ const builderStuff = this.builder.builderStuff;
74888
+ const modal = builderStuff.querySelector('.is-modal.content-preview.active');
74889
+
74890
+ if (modal) {
74891
+ let elms = this.cellSettings.querySelectorAll('.input-device');
74892
+ elms.forEach(elm => {
74893
+ elm.classList.remove('on');
74894
+ });
74895
+
74896
+ if (modal.classList.contains('is-screen-1920')) {
74897
+ this.cellSettings.querySelector('.input-device[data-value=""]').classList.add('on');
74898
+ } else if (modal.classList.contains('is-screen-1440')) {
74899
+ this.cellSettings.querySelector('.input-device[data-value=""]').classList.add('on');
74900
+ } else if (modal.classList.contains('is-screen-1024')) {
74901
+ this.cellSettings.querySelector('.input-device[data-value="md"]').classList.add('on');
74902
+ } else if (modal.classList.contains('is-screen-768')) {
74903
+ this.cellSettings.querySelector('.input-device[data-value="sm"]').classList.add('on');
74904
+ } else if (modal.classList.contains('is-screen-375')) {
74905
+ this.cellSettings.querySelector('.input-device[data-value="xs"]').classList.add('on');
74906
+ }
74907
+ }
74908
+ }
74909
+
74771
74910
  let divTarget = this.cellSettings.querySelector('.div-target');
74772
74911
  let divVisibility = this.cellSettings.querySelector('.div-visibility');
74773
74912
  let target = this.builder.responsive.readTarget(divTarget);
74774
74913
  let valVisibility = this.builder.responsive.getVisibility(cell, target);
74775
- this.builder.responsive.showVisibility(divVisibility, valVisibility);
74914
+ this.builder.responsive.showVisibility(divVisibility, valVisibility); // Live Preview Sync
74915
+
74916
+ if (target === 'xs') {
74917
+ if (!initialOpen) this.builder.livePreview.resizePreview(375);
74918
+ } else if (target === 'sm') {
74919
+ if (!initialOpen) this.builder.livePreview.resizePreview(768);
74920
+ } else if (target === 'md') {
74921
+ if (!initialOpen) this.builder.livePreview.resizePreview(1024);
74922
+ } else {
74923
+ if (!initialOpen) this.builder.livePreview.resizePreview(1920);
74924
+ }
74776
74925
  }
74777
74926
 
74778
74927
  openImagePicker(currentUrl, callback, btn) {
@@ -75868,15 +76017,49 @@ class ElementGeneralStyles {
75868
76017
  }
75869
76018
  }
75870
76019
 
75871
- this.realtimeVisibility(elm);
76020
+ this.realtimeVisibility(elm, true);
75872
76021
  }
75873
76022
 
75874
- realtimeVisibility(row) {
76023
+ realtimeVisibility(row, initialOpen) {
76024
+ if (initialOpen) {
76025
+ const builderStuff = this.builder.builderStuff;
76026
+ const modal = builderStuff.querySelector('.is-modal.content-preview.active');
76027
+
76028
+ if (modal) {
76029
+ let elms = this.panelStuff.querySelectorAll('.input-device');
76030
+ elms.forEach(elm => {
76031
+ elm.classList.remove('on');
76032
+ });
76033
+
76034
+ if (modal.classList.contains('is-screen-1920')) {
76035
+ this.panelStuff.querySelector('.input-device[data-value=""]').classList.add('on');
76036
+ } else if (modal.classList.contains('is-screen-1440')) {
76037
+ this.panelStuff.querySelector('.input-device[data-value=""]').classList.add('on');
76038
+ } else if (modal.classList.contains('is-screen-1024')) {
76039
+ this.panelStuff.querySelector('.input-device[data-value="md"]').classList.add('on');
76040
+ } else if (modal.classList.contains('is-screen-768')) {
76041
+ this.panelStuff.querySelector('.input-device[data-value="sm"]').classList.add('on');
76042
+ } else if (modal.classList.contains('is-screen-375')) {
76043
+ this.panelStuff.querySelector('.input-device[data-value="xs"]').classList.add('on');
76044
+ }
76045
+ }
76046
+ }
76047
+
75875
76048
  let divTarget = this.panelStuff.querySelector('.div-target');
75876
76049
  let divVisibility = this.panelStuff.querySelector('.div-visibility');
75877
76050
  let target = this.builder.responsive.readTarget(divTarget);
75878
76051
  let valVisibility = this.builder.responsive.getVisibility(row, target);
75879
- this.builder.responsive.showVisibility(divVisibility, valVisibility);
76052
+ this.builder.responsive.showVisibility(divVisibility, valVisibility); // Live Preview Sync
76053
+
76054
+ if (target === 'xs') {
76055
+ if (!initialOpen) this.builder.livePreview.resizePreview(375);
76056
+ } else if (target === 'sm') {
76057
+ if (!initialOpen) this.builder.livePreview.resizePreview(768);
76058
+ } else if (target === 'md') {
76059
+ if (!initialOpen) this.builder.livePreview.resizePreview(1024);
76060
+ } else {
76061
+ if (!initialOpen) this.builder.livePreview.resizePreview(1920);
76062
+ }
75880
76063
  }
75881
76064
 
75882
76065
  }
@@ -90922,7 +91105,7 @@ class LivePreview {
90922
91105
  z-index:100021 !important
90923
91106
  }
90924
91107
  </style>
90925
- <div style="z-index:10002;${this.builder.previewStyle}" class="is-modal is-modal-content content-preview is-screen-1920" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
91108
+ <div style="z-index:10004;${this.builder.previewStyle}" class="is-modal is-modal-content content-preview is-screen-1920" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
90926
91109
  <div class="is-modal-bar is-draggable" draggable="">
90927
91110
  <span>${util.out('Live Preview')}</span>
90928
91111
  <button class="is-modal-device" tabindex="-1" style="user-select:none;cursor:default">
@@ -90955,41 +91138,18 @@ class LivePreview {
90955
91138
  this.closePreview();
90956
91139
  });
90957
91140
  const btnModalSize = modal.querySelector('.is-modal-size');
90958
- const infoDevice = modal.querySelector('.is-modal-device');
90959
91141
  btnModalSize.addEventListener('click', () => {
90960
91142
  if (modal.classList.contains('is-screen-1920')) {
90961
- modal.classList.remove('is-screen-1920');
90962
- modal.classList.add('is-screen-1440');
90963
- localStorage.setItem('_livepreviewscreen', 'is-screen-1440');
90964
- infoDevice.setAttribute('title', util.out('Laptop'));
90965
- infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-laptop"></use></svg>';
91143
+ this.resizePreview(1440);
90966
91144
  } else if (modal.classList.contains('is-screen-1440')) {
90967
- modal.classList.remove('is-screen-1440');
90968
- modal.classList.add('is-screen-1024');
90969
- infoDevice.setAttribute('title', util.out('Tablet (Landscape)'));
90970
- localStorage.setItem('_livepreviewscreen', 'is-screen-1024');
90971
- infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>';
91145
+ this.resizePreview(1024);
90972
91146
  } else if (modal.classList.contains('is-screen-1024')) {
90973
- modal.classList.remove('is-screen-1024');
90974
- modal.classList.add('is-screen-768');
90975
- localStorage.setItem('_livepreviewscreen', 'is-screen-768');
90976
- infoDevice.setAttribute('title', util.out('Tablet (Portrait)'));
90977
- infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>';
91147
+ this.resizePreview(768);
90978
91148
  } else if (modal.classList.contains('is-screen-768')) {
90979
- modal.classList.remove('is-screen-768');
90980
- modal.classList.add('is-screen-375');
90981
- localStorage.setItem('_livepreviewscreen', 'is-screen-375');
90982
- infoDevice.setAttribute('title', util.out('Mobile'));
90983
- infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-mobile"></use></svg>';
91149
+ this.resizePreview(375);
90984
91150
  } else if (modal.classList.contains('is-screen-375')) {
90985
- modal.classList.remove('is-screen-375');
90986
- modal.classList.add('is-screen-1920');
90987
- localStorage.setItem('_livepreviewscreen', 'is-screen-1920');
90988
- infoDevice.setAttribute('title', util.out('Desktop'));
90989
- infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-desktop"></use></svg>';
91151
+ this.resizePreview(1920);
90990
91152
  }
90991
-
90992
- this.previewRefresh(true);
90993
91153
  });
90994
91154
  const btnModalRefresh = modal.querySelector('.is-modal-refresh');
90995
91155
  btnModalRefresh.addEventListener('click', () => {
@@ -91005,6 +91165,47 @@ class LivePreview {
91005
91165
  }
91006
91166
  }
91007
91167
 
91168
+ resizePreview(size) {
91169
+ let modal = this.modal;
91170
+ let util = this.util;
91171
+ modal.classList.remove('is-screen-1440');
91172
+ modal.classList.remove('is-screen-1920');
91173
+ modal.classList.remove('is-screen-1024');
91174
+ modal.classList.remove('is-screen-768');
91175
+ modal.classList.remove('is-screen-375');
91176
+ const infoDevice = modal.querySelector('.is-modal-device');
91177
+
91178
+ if (size === 1440) {
91179
+ modal.classList.add('is-screen-1440');
91180
+ localStorage.setItem('_livepreviewscreen', 'is-screen-1440');
91181
+ infoDevice.setAttribute('title', util.out('Laptop'));
91182
+ infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-laptop"></use></svg>';
91183
+ } else if (size === 1024) {
91184
+ modal.classList.remove('is-screen-1440');
91185
+ modal.classList.add('is-screen-1024');
91186
+ infoDevice.setAttribute('title', util.out('Tablet (Landscape)'));
91187
+ localStorage.setItem('_livepreviewscreen', 'is-screen-1024');
91188
+ infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>';
91189
+ } else if (size === 768) {
91190
+ modal.classList.add('is-screen-768');
91191
+ localStorage.setItem('_livepreviewscreen', 'is-screen-768');
91192
+ infoDevice.setAttribute('title', util.out('Tablet (Portrait)'));
91193
+ infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>';
91194
+ } else if (size === 375) {
91195
+ modal.classList.add('is-screen-375');
91196
+ localStorage.setItem('_livepreviewscreen', 'is-screen-375');
91197
+ infoDevice.setAttribute('title', util.out('Mobile'));
91198
+ infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-mobile"></use></svg>';
91199
+ } else if (size === 1920) {
91200
+ modal.classList.add('is-screen-1920');
91201
+ localStorage.setItem('_livepreviewscreen', 'is-screen-1920');
91202
+ infoDevice.setAttribute('title', util.out('Desktop'));
91203
+ infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-desktop"></use></svg>';
91204
+ }
91205
+
91206
+ this.previewRefresh(true);
91207
+ }
91208
+
91008
91209
  previewRefresh(disableOnContentLoad) {
91009
91210
  if (this.modal.classList.contains('active')) {
91010
91211
  // let html = this.builder.html();