@innovastudio/contentbuilder 1.5.58 → 1.5.59

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.58",
4
+ "version": "1.5.59",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -1085,7 +1085,7 @@ class Snippets {
1085
1085
 
1086
1086
  if(bSnippet) {
1087
1087
  var quickadd = parent._cb.builderStuff.querySelector('.quickadd');
1088
- var mode = quickadd.getAttribute('data-mode');
1088
+ var mode = quickadd?quickadd.getAttribute('data-mode'):null;
1089
1089
  if(!mode) {
1090
1090
  // in case of using viewSnippets() to open the dialog (mode=null) => change to non snippet.
1091
1091
  html = '<div class="row">' +
@@ -62571,24 +62571,48 @@ class Pickr {
62571
62571
  return requestAnimationFrame(cb);
62572
62572
  }
62573
62573
 
62574
+ /*
62574
62575
  // Apply default color
62575
62576
  that.setColor(opt.default);
62576
62577
  that._rePositioningPicker();
62577
-
62578
- // Initialize color representation
62578
+ // Initialize color representation
62579
62579
  if (opt.defaultRepresentation) {
62580
- that._representation = opt.defaultRepresentation;
62581
- that.setColorRepresentation(that._representation);
62580
+ that._representation = opt.defaultRepresentation;
62581
+ that.setColorRepresentation(that._representation);
62582
62582
  }
62583
-
62584
- // Show pickr if locked
62583
+ // Show pickr if locked
62585
62584
  if (opt.showAlways) {
62586
- that.show();
62585
+ that.show();
62587
62586
  }
62588
-
62589
- // Initialization is done - pickr is usable, fire init event
62587
+ // Initialization is done - pickr is usable, fire init event
62590
62588
  that._initializingActive = false;
62591
62589
  that._emit('init');
62590
+ */
62591
+
62592
+ // Modified: fix performance issue
62593
+ new Promise(resolve => {
62594
+ // Apply default color
62595
+ that.setColor(opt.default);
62596
+ that._rePositioningPicker();
62597
+
62598
+ // Initialize color representation
62599
+ if (opt.defaultRepresentation) {
62600
+ that._representation = opt.defaultRepresentation;
62601
+ that.setColorRepresentation(that._representation);
62602
+ }
62603
+
62604
+ // Show pickr if locked
62605
+ if (opt.showAlways) {
62606
+ that.show();
62607
+ }
62608
+ resolve();
62609
+ }).then(() => {
62610
+ // Once all heavy work is done, perform any finalization here
62611
+
62612
+ // Initialization is done - pickr is usable, fire init event
62613
+ that._initializingActive = false;
62614
+ that._emit('init');
62615
+ });
62592
62616
  });
62593
62617
  }
62594
62618
 
@@ -69078,11 +69102,16 @@ class Rte {
69078
69102
  // iframe.src = builder.opts.snippetData;
69079
69103
  // }
69080
69104
  const ifr = modal.querySelector('iframe');
69081
- var doc = ifr.contentWindow.document;
69082
- if (doc.body.innerHTML === '') {
69083
- doc.open();
69084
- doc.write(snippets.getSnippetsHtml());
69085
- doc.close();
69105
+ // var doc = ifr.contentWindow.document;
69106
+ // if(doc.body.innerHTML==='') {
69107
+ // doc.open();
69108
+ // doc.write(snippets.getSnippetsHtml());
69109
+ // doc.close();
69110
+ // }
69111
+
69112
+ if (!ifr.srcdoc) {
69113
+ // Set the HTML content directly using the srcdoc attribute
69114
+ ifr.srcdoc = snippets.getSnippetsHtml();
69086
69115
  }
69087
69116
  }
69088
69117
  openIcon(e) {