@innovastudio/contentbuilder 1.4.13 → 1.4.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.
package/package.json
CHANGED
@@ -57467,16 +57467,20 @@ class RowTool {
|
|
57467
57467
|
|
57468
57468
|
<div class="div-row-wrapcolumns" style="display:flex;flex-direction:column;padding-bottom:7px">
|
57469
57469
|
<div style="padding-top:20px;padding-bottom:3px;">${util.out('Wrap Columns (Breakpoint)')}:</div>
|
57470
|
-
<div style="padding-top:3px;display:flex;align-items: center;">
|
57471
|
-
|
57472
|
-
|
57473
|
-
|
57474
|
-
|
57475
|
-
|
57476
|
-
|
57477
|
-
|
57478
|
-
<svg class="is-icon-flex" style="width:
|
57479
|
-
</
|
57470
|
+
<div style="padding-top:3px;padding-bottom:5px;display:flex;align-items: center;">
|
57471
|
+
|
57472
|
+
<label class="flex mr-3" title="${util.out('Tablet (Landscape)')}">
|
57473
|
+
<input type="radio" id="rdoColMdWrap" name="boxWrap" value="md">
|
57474
|
+
<svg class="is-icon-flex" style="margin-left:3px;width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>
|
57475
|
+
</label>
|
57476
|
+
<label class="flex mr-3" title="${util.out('Tablet (Portrait)')}">
|
57477
|
+
<input type="radio" id="rdoColSmWrap" name="boxWrap" value="sm">
|
57478
|
+
<svg class="is-icon-flex" style="margin-left:3px;width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
|
57479
|
+
</label>
|
57480
|
+
<label class="flex" title="${util.out('Mobile')}">
|
57481
|
+
<input type="radio" id="rdoColXsWrap" name="boxWrap" value="xs">
|
57482
|
+
<svg class="is-icon-flex" style="margin-left:3px;width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
|
57483
|
+
</label>
|
57480
57484
|
|
57481
57485
|
</div>
|
57482
57486
|
</div>
|
@@ -57730,32 +57734,25 @@ class RowTool {
|
|
57730
57734
|
this.builder.opts.onChange();
|
57731
57735
|
}); // Breakpoint
|
57732
57736
|
|
57733
|
-
|
57734
|
-
|
57735
|
-
btn.addEventListener('click', () => {
|
57737
|
+
rowSettings.querySelectorAll('input[name="boxWrap"]').forEach(input => {
|
57738
|
+
input.addEventListener('change', () => {
|
57736
57739
|
let row = util.rowSelected();
|
57737
57740
|
if (!row) return;
|
57738
57741
|
this.builder.uo.saveForUndo();
|
57739
|
-
let elms = this.rowSettings.querySelectorAll('.input-breakpoint');
|
57740
|
-
elms.forEach(elm => {
|
57741
|
-
elm.classList.remove('on');
|
57742
|
-
});
|
57743
|
-
btn.classList.add('on');
|
57744
|
-
let target = btn.getAttribute('data-value');
|
57745
57742
|
|
57746
|
-
if (
|
57743
|
+
if (input.value === 'xs') {
|
57747
57744
|
row.classList.remove('sm-wrap');
|
57748
57745
|
row.classList.remove('md-wrap');
|
57749
|
-
} else if (
|
57746
|
+
} else if (input.value === 'sm') {
|
57750
57747
|
row.classList.remove('md-wrap');
|
57751
57748
|
row.classList.add('sm-wrap');
|
57752
|
-
} else if (
|
57753
|
-
row.classList.remove('
|
57749
|
+
} else if (input.value === 'md') {
|
57750
|
+
row.classList.remove('sm-wrap');
|
57754
57751
|
row.classList.add('md-wrap');
|
57755
57752
|
} //Trigger Change event
|
57756
57753
|
|
57757
57754
|
|
57758
|
-
this.builder.onChange();
|
57755
|
+
this.builder.opts.onChange();
|
57759
57756
|
});
|
57760
57757
|
});
|
57761
57758
|
const chkReverseBoxes = this.rowSettings.querySelector('#chkReverseColumns');
|
@@ -57796,7 +57793,7 @@ class RowTool {
|
|
57796
57793
|
this.builder.settings.onChange();
|
57797
57794
|
}); // Responsive Visibility
|
57798
57795
|
|
57799
|
-
btns = this.rowSettings.querySelectorAll('.input-device');
|
57796
|
+
let btns = this.rowSettings.querySelectorAll('.input-device');
|
57800
57797
|
btns.forEach(btn => {
|
57801
57798
|
btn.addEventListener('click', () => {
|
57802
57799
|
let row = util.rowSelected();
|
@@ -57996,7 +57993,31 @@ class RowTool {
|
|
57996
57993
|
// });
|
57997
57994
|
}
|
57998
57995
|
|
57999
|
-
realtimeVisibility(row) {
|
57996
|
+
realtimeVisibility(row, initialOpen) {
|
57997
|
+
if (initialOpen) {
|
57998
|
+
const builderStuff = this.builder.builderStuff;
|
57999
|
+
const modal = builderStuff.querySelector('.is-modal.content-preview.active');
|
58000
|
+
|
58001
|
+
if (modal) {
|
58002
|
+
let elms = this.rowSettings.querySelectorAll('.input-device');
|
58003
|
+
elms.forEach(elm => {
|
58004
|
+
elm.classList.remove('on');
|
58005
|
+
});
|
58006
|
+
|
58007
|
+
if (modal.classList.contains('is-screen-1920')) {
|
58008
|
+
this.rowSettings.querySelector('.input-device[data-value=""]').classList.add('on');
|
58009
|
+
} else if (modal.classList.contains('is-screen-1440')) {
|
58010
|
+
this.rowSettings.querySelector('.input-device[data-value=""]').classList.add('on');
|
58011
|
+
} else if (modal.classList.contains('is-screen-1024')) {
|
58012
|
+
this.rowSettings.querySelector('.input-device[data-value="md"]').classList.add('on');
|
58013
|
+
} else if (modal.classList.contains('is-screen-768')) {
|
58014
|
+
this.rowSettings.querySelector('.input-device[data-value="sm"]').classList.add('on');
|
58015
|
+
} else if (modal.classList.contains('is-screen-375')) {
|
58016
|
+
this.rowSettings.querySelector('.input-device[data-value="xs"]').classList.add('on');
|
58017
|
+
}
|
58018
|
+
}
|
58019
|
+
}
|
58020
|
+
|
58000
58021
|
let divTarget = this.rowSettings.querySelector('.div-target');
|
58001
58022
|
let divVisibility = this.rowSettings.querySelector('.div-visibility');
|
58002
58023
|
let target = this.builder.responsive.readTarget(divTarget);
|
@@ -58007,12 +58028,16 @@ class RowTool {
|
|
58007
58028
|
|
58008
58029
|
if (target === 'xs') {
|
58009
58030
|
valReverse = row.classList.contains('xs-column-reverse');
|
58031
|
+
if (!initialOpen) this.builder.livePreview.resizePreview(375);
|
58010
58032
|
} else if (target === 'sm') {
|
58011
58033
|
valReverse = row.classList.contains('sm-column-reverse');
|
58034
|
+
if (!initialOpen) this.builder.livePreview.resizePreview(768);
|
58012
58035
|
} else if (target === 'md') {
|
58013
58036
|
valReverse = row.classList.contains('md-column-reverse');
|
58037
|
+
if (!initialOpen) this.builder.livePreview.resizePreview(1024);
|
58014
58038
|
} else {
|
58015
58039
|
valReverse = row.classList.contains('desktop-column-reverse');
|
58040
|
+
if (!initialOpen) this.builder.livePreview.resizePreview(1920);
|
58016
58041
|
}
|
58017
58042
|
|
58018
58043
|
const chkReverseColumns = this.rowSettings.querySelector('#chkReverseColumns');
|
@@ -58325,7 +58350,7 @@ class RowTool {
|
|
58325
58350
|
|
58326
58351
|
let actualRow = row.parentNode; // row is actually row overlay
|
58327
58352
|
|
58328
|
-
this.realtimeVisibility(actualRow);
|
58353
|
+
this.realtimeVisibility(actualRow, true);
|
58329
58354
|
const divReverseBoxes = this.rowSettings.querySelector('#divReverseColumns');
|
58330
58355
|
let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
|
58331
58356
|
|
@@ -58339,17 +58364,12 @@ class RowTool {
|
|
58339
58364
|
divReverseBoxes.style.display = 'none';
|
58340
58365
|
}
|
58341
58366
|
|
58342
|
-
let elms = this.rowSettings.querySelectorAll('.input-breakpoint');
|
58343
|
-
elms.forEach(elm => {
|
58344
|
-
elm.classList.remove('on');
|
58345
|
-
});
|
58346
|
-
|
58347
58367
|
if (actualRow.classList.contains('md-wrap')) {
|
58348
|
-
this.rowSettings.querySelector('
|
58368
|
+
this.rowSettings.querySelector('#rdoColMdWrap').checked = true;
|
58349
58369
|
} else if (actualRow.classList.contains('sm-wrap')) {
|
58350
|
-
this.rowSettings.querySelector('
|
58370
|
+
this.rowSettings.querySelector('#rdoColSmWrap').checked = true;
|
58351
58371
|
} else {
|
58352
|
-
this.rowSettings.querySelector('
|
58372
|
+
this.rowSettings.querySelector('#rdoColXsWrap').checked = true;
|
58353
58373
|
} //More
|
58354
58374
|
|
58355
58375
|
|
@@ -60297,6 +60317,12 @@ class ColumnTool {
|
|
60297
60317
|
});
|
60298
60318
|
let btnVisible = this.cellSettings.querySelector('.input-visible');
|
60299
60319
|
let btnHidden = this.cellSettings.querySelector('.input-hidden');
|
60320
|
+
|
60321
|
+
const rowHasHiddenColumns = (row, target) => {
|
60322
|
+
let cols = row.querySelectorAll(`.${target}-hidden`);
|
60323
|
+
return cols.length > 0;
|
60324
|
+
};
|
60325
|
+
|
60300
60326
|
btnVisible.addEventListener('click', () => {
|
60301
60327
|
let cell = this.util.cellSelected();
|
60302
60328
|
if (!cell) return;
|
@@ -60309,12 +60335,13 @@ class ColumnTool {
|
|
60309
60335
|
cell.classList.remove('xs-hidden');
|
60310
60336
|
} else if (target === 'sm') {
|
60311
60337
|
cell.classList.remove('sm-hidden');
|
60312
|
-
cell.parentNode.classList.remove('sm-autofit');
|
60338
|
+
if (!rowHasHiddenColumns(cell.parentNode, 'sm')) cell.parentNode.classList.remove('sm-autofit');
|
60313
60339
|
} else if (target === 'md') {
|
60314
60340
|
cell.classList.remove('md-hidden');
|
60315
|
-
cell.parentNode.classList.remove('md-autofit');
|
60341
|
+
if (!rowHasHiddenColumns(cell.parentNode, 'md')) cell.parentNode.classList.remove('md-autofit');
|
60316
60342
|
} else if (target === '') {
|
60317
60343
|
cell.classList.remove('desktop-hidden');
|
60344
|
+
if (!rowHasHiddenColumns(cell.parentNode, 'desktop')) cell.parentNode.classList.remove('desktop-autofit');
|
60318
60345
|
}
|
60319
60346
|
|
60320
60347
|
btnVisible.classList.add('on');
|
@@ -60340,6 +60367,7 @@ class ColumnTool {
|
|
60340
60367
|
cell.parentNode.classList.add('md-autofit');
|
60341
60368
|
} else if (target === '') {
|
60342
60369
|
cell.classList.add('desktop-hidden');
|
60370
|
+
cell.parentNode.classList.add('desktop-autofit');
|
60343
60371
|
}
|
60344
60372
|
|
60345
60373
|
btnVisible.classList.remove('on');
|
@@ -60537,7 +60565,7 @@ class ColumnTool {
|
|
60537
60565
|
dom.addClass(btn, 'on');
|
60538
60566
|
}
|
60539
60567
|
|
60540
|
-
this.realtimeVisibility(cell); //More
|
60568
|
+
this.realtimeVisibility(cell, true); //More
|
60541
60569
|
|
60542
60570
|
let inpCellId = this.cellSettings.querySelector('.input-cell-id');
|
60543
60571
|
inpCellId.value = '';
|
@@ -60553,12 +60581,46 @@ class ColumnTool {
|
|
60553
60581
|
inpCellClasses.value = classes;
|
60554
60582
|
}
|
60555
60583
|
|
60556
|
-
realtimeVisibility(cell) {
|
60584
|
+
realtimeVisibility(cell, initialOpen) {
|
60585
|
+
if (initialOpen) {
|
60586
|
+
const builderStuff = this.builder.builderStuff;
|
60587
|
+
const modal = builderStuff.querySelector('.is-modal.content-preview.active');
|
60588
|
+
|
60589
|
+
if (modal) {
|
60590
|
+
let elms = this.cellSettings.querySelectorAll('.input-device');
|
60591
|
+
elms.forEach(elm => {
|
60592
|
+
elm.classList.remove('on');
|
60593
|
+
});
|
60594
|
+
|
60595
|
+
if (modal.classList.contains('is-screen-1920')) {
|
60596
|
+
this.cellSettings.querySelector('.input-device[data-value=""]').classList.add('on');
|
60597
|
+
} else if (modal.classList.contains('is-screen-1440')) {
|
60598
|
+
this.cellSettings.querySelector('.input-device[data-value=""]').classList.add('on');
|
60599
|
+
} else if (modal.classList.contains('is-screen-1024')) {
|
60600
|
+
this.cellSettings.querySelector('.input-device[data-value="md"]').classList.add('on');
|
60601
|
+
} else if (modal.classList.contains('is-screen-768')) {
|
60602
|
+
this.cellSettings.querySelector('.input-device[data-value="sm"]').classList.add('on');
|
60603
|
+
} else if (modal.classList.contains('is-screen-375')) {
|
60604
|
+
this.cellSettings.querySelector('.input-device[data-value="xs"]').classList.add('on');
|
60605
|
+
}
|
60606
|
+
}
|
60607
|
+
}
|
60608
|
+
|
60557
60609
|
let divTarget = this.cellSettings.querySelector('.div-target');
|
60558
60610
|
let divVisibility = this.cellSettings.querySelector('.div-visibility');
|
60559
60611
|
let target = this.builder.responsive.readTarget(divTarget);
|
60560
60612
|
let valVisibility = this.builder.responsive.getVisibility(cell, target);
|
60561
|
-
this.builder.responsive.showVisibility(divVisibility, valVisibility);
|
60613
|
+
this.builder.responsive.showVisibility(divVisibility, valVisibility); // Live Preview Sync
|
60614
|
+
|
60615
|
+
if (target === 'xs') {
|
60616
|
+
if (!initialOpen) this.builder.livePreview.resizePreview(375);
|
60617
|
+
} else if (target === 'sm') {
|
60618
|
+
if (!initialOpen) this.builder.livePreview.resizePreview(768);
|
60619
|
+
} else if (target === 'md') {
|
60620
|
+
if (!initialOpen) this.builder.livePreview.resizePreview(1024);
|
60621
|
+
} else {
|
60622
|
+
if (!initialOpen) this.builder.livePreview.resizePreview(1920);
|
60623
|
+
}
|
60562
60624
|
}
|
60563
60625
|
|
60564
60626
|
openImagePicker(currentUrl, callback, btn) {
|
@@ -76708,7 +76770,7 @@ class LivePreview {
|
|
76708
76770
|
z-index:100021 !important
|
76709
76771
|
}
|
76710
76772
|
</style>
|
76711
|
-
<div style="z-index:
|
76773
|
+
<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">
|
76712
76774
|
<div class="is-modal-bar is-draggable" draggable="">
|
76713
76775
|
<span>${util.out('Live Preview')}</span>
|
76714
76776
|
<button class="is-modal-device" tabindex="-1" style="user-select:none;cursor:default">
|
@@ -76741,41 +76803,18 @@ class LivePreview {
|
|
76741
76803
|
this.closePreview();
|
76742
76804
|
});
|
76743
76805
|
const btnModalSize = modal.querySelector('.is-modal-size');
|
76744
|
-
const infoDevice = modal.querySelector('.is-modal-device');
|
76745
76806
|
btnModalSize.addEventListener('click', () => {
|
76746
76807
|
if (modal.classList.contains('is-screen-1920')) {
|
76747
|
-
|
76748
|
-
modal.classList.add('is-screen-1440');
|
76749
|
-
localStorage.setItem('_livepreviewscreen', 'is-screen-1440');
|
76750
|
-
infoDevice.setAttribute('title', util.out('Laptop'));
|
76751
|
-
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-laptop"></use></svg>';
|
76808
|
+
this.resizePreview(1440);
|
76752
76809
|
} else if (modal.classList.contains('is-screen-1440')) {
|
76753
|
-
|
76754
|
-
modal.classList.add('is-screen-1024');
|
76755
|
-
infoDevice.setAttribute('title', util.out('Tablet (Landscape)'));
|
76756
|
-
localStorage.setItem('_livepreviewscreen', 'is-screen-1024');
|
76757
|
-
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>';
|
76810
|
+
this.resizePreview(1024);
|
76758
76811
|
} else if (modal.classList.contains('is-screen-1024')) {
|
76759
|
-
|
76760
|
-
modal.classList.add('is-screen-768');
|
76761
|
-
localStorage.setItem('_livepreviewscreen', 'is-screen-768');
|
76762
|
-
infoDevice.setAttribute('title', util.out('Tablet (Portrait)'));
|
76763
|
-
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>';
|
76812
|
+
this.resizePreview(768);
|
76764
76813
|
} else if (modal.classList.contains('is-screen-768')) {
|
76765
|
-
|
76766
|
-
modal.classList.add('is-screen-375');
|
76767
|
-
localStorage.setItem('_livepreviewscreen', 'is-screen-375');
|
76768
|
-
infoDevice.setAttribute('title', util.out('Mobile'));
|
76769
|
-
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-mobile"></use></svg>';
|
76814
|
+
this.resizePreview(375);
|
76770
76815
|
} else if (modal.classList.contains('is-screen-375')) {
|
76771
|
-
|
76772
|
-
modal.classList.add('is-screen-1920');
|
76773
|
-
localStorage.setItem('_livepreviewscreen', 'is-screen-1920');
|
76774
|
-
infoDevice.setAttribute('title', util.out('Desktop'));
|
76775
|
-
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-desktop"></use></svg>';
|
76816
|
+
this.resizePreview(1920);
|
76776
76817
|
}
|
76777
|
-
|
76778
|
-
this.previewRefresh(true);
|
76779
76818
|
});
|
76780
76819
|
const btnModalRefresh = modal.querySelector('.is-modal-refresh');
|
76781
76820
|
btnModalRefresh.addEventListener('click', () => {
|
@@ -76791,6 +76830,47 @@ class LivePreview {
|
|
76791
76830
|
}
|
76792
76831
|
}
|
76793
76832
|
|
76833
|
+
resizePreview(size) {
|
76834
|
+
let modal = this.modal;
|
76835
|
+
let util = this.util;
|
76836
|
+
modal.classList.remove('is-screen-1440');
|
76837
|
+
modal.classList.remove('is-screen-1920');
|
76838
|
+
modal.classList.remove('is-screen-1024');
|
76839
|
+
modal.classList.remove('is-screen-768');
|
76840
|
+
modal.classList.remove('is-screen-375');
|
76841
|
+
const infoDevice = modal.querySelector('.is-modal-device');
|
76842
|
+
|
76843
|
+
if (size === 1440) {
|
76844
|
+
modal.classList.add('is-screen-1440');
|
76845
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-1440');
|
76846
|
+
infoDevice.setAttribute('title', util.out('Laptop'));
|
76847
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-laptop"></use></svg>';
|
76848
|
+
} else if (size === 1024) {
|
76849
|
+
modal.classList.remove('is-screen-1440');
|
76850
|
+
modal.classList.add('is-screen-1024');
|
76851
|
+
infoDevice.setAttribute('title', util.out('Tablet (Landscape)'));
|
76852
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-1024');
|
76853
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>';
|
76854
|
+
} else if (size === 768) {
|
76855
|
+
modal.classList.add('is-screen-768');
|
76856
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-768');
|
76857
|
+
infoDevice.setAttribute('title', util.out('Tablet (Portrait)'));
|
76858
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>';
|
76859
|
+
} else if (size === 375) {
|
76860
|
+
modal.classList.add('is-screen-375');
|
76861
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-375');
|
76862
|
+
infoDevice.setAttribute('title', util.out('Mobile'));
|
76863
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-mobile"></use></svg>';
|
76864
|
+
} else if (size === 1920) {
|
76865
|
+
modal.classList.add('is-screen-1920');
|
76866
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-1920');
|
76867
|
+
infoDevice.setAttribute('title', util.out('Desktop'));
|
76868
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-desktop"></use></svg>';
|
76869
|
+
}
|
76870
|
+
|
76871
|
+
this.previewRefresh(true);
|
76872
|
+
}
|
76873
|
+
|
76794
76874
|
previewRefresh(disableOnContentLoad) {
|
76795
76875
|
if (this.modal.classList.contains('active')) {
|
76796
76876
|
// let html = this.builder.html();
|