@innovastudio/contentbox 1.5.36 → 1.5.37

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.36",
4
+ "version": "1.5.37",
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.26",
49
+ "@innovastudio/contentbuilder": "^1.4.27",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -91617,7 +91617,12 @@ class LivePreview {
91617
91617
 
91618
91618
  this.builder.settings.onChange = () => {
91619
91619
  old2.call(this);
91620
- this.previewRefresh();
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
  }
@@ -91703,6 +91708,15 @@ class LivePreview {
91703
91708
  }
91704
91709
  } else {
91705
91710
  // ContentBox
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
+
91706
91720
  if (this.builder.livePreviewAlwaysReload) {
91707
91721
  iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
91708
91722
  } else {
@@ -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