@innovastudio/contentbuilder 1.4.34 → 1.4.36

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.
@@ -160,6 +160,14 @@ function showPreviewWindow() {
160
160
  var modal = document.querySelector(".is-modal.previewcontent");
161
161
  _cb.showModal(modal);
162
162
 
163
+ if (!this._cb.doc.querySelector(".is-wrapper") && _cb.previewURL) {
164
+ var html = _cb.html();
165
+ localStorage.setItem('preview-html', html);
166
+
167
+ modal.querySelector('iframe').src = _cb.previewURL;
168
+ return;
169
+ }
170
+
163
171
  //check if builder is inside iframe
164
172
  if(window.frameElement) {
165
173
  var c = getFramedWindow(window.frameElement);
@@ -37,10 +37,13 @@
37
37
  // var scriptPath = _cb.getScriptPath();
38
38
  // modal.querySelector('iframe').src = scriptPath + 'plugins/symbols/symbols.html';
39
39
 
40
+ var html = getSymbolHTML();
41
+ html = html.replace(/<script>/g, `${_cb.nonce?`<script nonce="${_cb.nonce}">`:'<script>'}`);
42
+
40
43
  iframe = modal.querySelector('iframe');
41
44
  doc = iframe.contentWindow.document;
42
45
  doc.open();
43
- doc.write(getSymbolHTML());
46
+ doc.write(html);
44
47
  doc.close();
45
48
 
46
49
  });