@innovastudio/contentbox 1.5.36 → 1.5.38
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@innovastudio/contentbox",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.5.
|
4
|
+
"version": "1.5.38",
|
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.
|
49
|
+
"@innovastudio/contentbuilder": "^1.4.28",
|
50
50
|
"js-beautify": "^1.14.0"
|
51
51
|
}
|
52
52
|
}
|
@@ -91610,14 +91610,19 @@ class LivePreview {
|
|
91610
91610
|
});
|
91611
91611
|
const btnModalRefresh = modal.querySelector('.is-modal-refresh');
|
91612
91612
|
btnModalRefresh.addEventListener('click', () => {
|
91613
|
-
this.previewRefresh();
|
91613
|
+
this.previewRefresh(false, true);
|
91614
91614
|
}); //Extend onChange
|
91615
91615
|
|
91616
91616
|
let old2 = this.builder.settings.onChange;
|
91617
91617
|
|
91618
91618
|
this.builder.settings.onChange = () => {
|
91619
91619
|
old2.call(this);
|
91620
|
-
|
91620
|
+
|
91621
|
+
if (!this.builder.doc.querySelector('.is-wrapper')) {
|
91622
|
+
// ContentBuilder
|
91623
|
+
this.previewRefresh();
|
91624
|
+
} // For ContentBox, this onChange will trigger ContentBox onChange (which has previewRefresh called)
|
91625
|
+
|
91621
91626
|
};
|
91622
91627
|
}
|
91623
91628
|
}
|
@@ -91663,7 +91668,7 @@ class LivePreview {
|
|
91663
91668
|
this.previewRefresh(true);
|
91664
91669
|
}
|
91665
91670
|
|
91666
|
-
previewRefresh(disableOnContentLoad) {
|
91671
|
+
previewRefresh(disableOnContentLoad, hardReload) {
|
91667
91672
|
if (this.modal.classList.contains('active')) {
|
91668
91673
|
// let html = this.builder.html();
|
91669
91674
|
// localStorage.setItem('preview-html', html);
|
@@ -91703,7 +91708,16 @@ class LivePreview {
|
|
91703
91708
|
}
|
91704
91709
|
} else {
|
91705
91710
|
// ContentBox
|
91706
|
-
if (this.builder.
|
91711
|
+
if (!this.builder.count) this.builder.count = 0;
|
91712
|
+
this.builder.count++;
|
91713
|
+
let oriVal = this.builder.livePreviewAlwaysReload;
|
91714
|
+
|
91715
|
+
if (this.builder.count === this.builder.livePreviewReloadEvery) {
|
91716
|
+
this.builder.livePreviewAlwaysReload = true;
|
91717
|
+
this.builder.count = 0;
|
91718
|
+
}
|
91719
|
+
|
91720
|
+
if (this.builder.livePreviewAlwaysReload || hardReload) {
|
91707
91721
|
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
91708
91722
|
} else {
|
91709
91723
|
let iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
@@ -91788,6 +91802,8 @@ class LivePreview {
|
|
91788
91802
|
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
91789
91803
|
}
|
91790
91804
|
}
|
91805
|
+
|
91806
|
+
this.builder.livePreviewAlwaysReload = oriVal;
|
91791
91807
|
}
|
91792
91808
|
|
91793
91809
|
iframe.onload = () => {
|
@@ -91923,6 +91939,8 @@ class ContentBuilder {
|
|
91923
91939
|
previewStyle: 'top:auto;bottom:50px;left:50px;right:auto;',
|
91924
91940
|
livePreviewOpen: false,
|
91925
91941
|
livePreviewAlwaysReload: false,
|
91942
|
+
livePreviewReloadEvery: 30,
|
91943
|
+
// always reload every 30 onChange triggered (to clearup iframe resource for faster performance)
|
91926
91944
|
scriptPath: '',
|
91927
91945
|
// Deprecated
|
91928
91946
|
// Old way:
|
@@ -104639,6 +104657,7 @@ class ContentBox {
|
|
104639
104657
|
previewStyle: 'top:auto;bottom:30px;left:90px;right:auto;',
|
104640
104658
|
livePreviewOpen: false,
|
104641
104659
|
livePreviewAlwaysReload: false,
|
104660
|
+
livePreviewReloadEvery: 30,
|
104642
104661
|
sectionTemplate: `
|
104643
104662
|
<div class="is-section is-box is-section-100 type-poppins">
|
104644
104663
|
<div class="is-overlay"></div>
|
@@ -107157,6 +107176,7 @@ class ContentBox {
|
|
107157
107176
|
previewStyle: this.settings.previewStyle,
|
107158
107177
|
livePreviewOpen: this.settings.livePreviewOpen,
|
107159
107178
|
livePreviewAlwaysReload: this.settings.livePreviewAlwaysReload,
|
107179
|
+
livePreviewReloadEvery: this.settings.livePreviewReloadEvery,
|
107160
107180
|
iframe: this.settings.iframe,
|
107161
107181
|
imageAdjust: 1,
|
107162
107182
|
// ContentBuilder
|