@innovastudio/contentbox 1.0.35 → 1.0.39

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
- "version": "1.0.35",
3
+ "version": "1.0.39",
4
4
  "description": "",
5
5
  "main": "public/contentbox/contentbox.esm.js",
6
6
  "files": [
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@ashthornton/asscroll": "^2.0.4",
42
- "@innovastudio/contentbuilder": "^1.0.63",
42
+ "@innovastudio/contentbuilder": "^1.0.66",
43
43
  "axios": "^0.21.4",
44
44
  "cors": "^2.8.5",
45
45
  "express": "^4.17.1",
@@ -746,7 +746,7 @@ class SideBar {
746
746
  let elms = elementChildren(selection);
747
747
  elms.forEach(elm => {
748
748
  elm.addEventListener('click', () => {
749
- this.builder.boxTypography(elm.getAttribute('data-classname'), elm.getAttribute('data-sectioncss'), elm.getAttribute('data-css'));
749
+ this.boxTypography(elm.getAttribute('data-classname'), elm.getAttribute('data-sectioncss'), elm.getAttribute('data-css'));
750
750
  });
751
751
  });
752
752
  }
@@ -19192,8 +19192,8 @@ class HtmlUtil {
19192
19192
  Array.prototype.forEach.call(emptystyles, emptystyle => {
19193
19193
  emptystyle.removeAttribute('style');
19194
19194
  });
19195
- dom$E.removeEmptyStyle(tmp);
19196
- dom$E.cleanEmptySpans(tmp);
19195
+ dom$E.removeEmptyStyle(tmp); // dom.cleanEmptySpans(tmp);
19196
+
19197
19197
  elms = tmp.querySelectorAll('[data-keep]');
19198
19198
  dom$E.removeAttributes(elms, 'data-keep'); //Cleanup button <span contenteditable="false"><a contenteditable="true">button</a></span>
19199
19199
 
@@ -49352,6 +49352,10 @@ class Image {
49352
49352
  let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
49353
49353
  let iframe = modalImageSelect.querySelector('iframe');
49354
49354
 
49355
+ if (this.builder.opts.assetRefresh) {
49356
+ iframe.src = this.builder.opts.imageselect;
49357
+ }
49358
+
49355
49359
  if (iframe.src === 'about:blank') {
49356
49360
  iframe.src = this.builder.opts.imageselect;
49357
49361
  }
@@ -49374,6 +49378,10 @@ class Image {
49374
49378
  let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
49375
49379
  let iframe = modalImageSelect.querySelector('iframe');
49376
49380
 
49381
+ if (this.builder.opts.assetRefresh) {
49382
+ iframe.src = this.builder.opts.imageselect;
49383
+ }
49384
+
49377
49385
  if (iframe.src === 'about:blank') {
49378
49386
  iframe.src = this.builder.opts.imageselect;
49379
49387
  }
@@ -50061,6 +50069,10 @@ class Image {
50061
50069
  resize = false;
50062
50070
  }
50063
50071
 
50072
+ if (this.builder.opts.maxEmbedImageWidth === -1) {
50073
+ resize = false;
50074
+ }
50075
+
50064
50076
  if (!resize) {
50065
50077
  // NEW: this is to prevent using MegaPixImage (problem with some PNG. PNG doesn't need to resize, so no need to use MegaPixImage)
50066
50078
  let tmpCanvasNoCrop = document.getElementById('myTmpCanvasNoCrop');
@@ -51491,6 +51503,10 @@ class Hyperlink {
51491
51503
  } else {
51492
51504
  let modalFileSelect = this.builderStuff.querySelector('.is-modal.fileselect');
51493
51505
 
51506
+ if (this.builder.opts.assetRefresh) {
51507
+ modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51508
+ }
51509
+
51494
51510
  if (modalFileSelect.querySelector('iframe').src === 'about:blank') {
51495
51511
  modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51496
51512
  }
@@ -51583,6 +51599,10 @@ class Hyperlink {
51583
51599
  } else {
51584
51600
  let modalFileSelect = this.builderStuff.querySelector('.is-modal.fileselect');
51585
51601
 
51602
+ if (this.builder.opts.assetRefresh) {
51603
+ modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51604
+ }
51605
+
51586
51606
  if (modalFileSelect.querySelector('iframe').src === 'about:blank') {
51587
51607
  modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51588
51608
  }
@@ -53012,6 +53032,10 @@ class Video {
53012
53032
  let modalVideoSelect = builderStuff.querySelector('.is-modal.videoselect');
53013
53033
  let iframe = modalVideoSelect.querySelector('iframe');
53014
53034
 
53035
+ if (this.builder.opts.assetRefresh) {
53036
+ iframe.src = this.builder.opts.videoSelect;
53037
+ }
53038
+
53015
53039
  if (iframe.src === 'about:blank') {
53016
53040
  iframe.src = this.builder.opts.videoSelect;
53017
53041
  }
@@ -63697,6 +63721,10 @@ class Rte {
63697
63721
  let modalImageSelect = this.builderStuff.querySelector('.is-modal.imageselect');
63698
63722
  let iframe = modalImageSelect.querySelector('iframe');
63699
63723
 
63724
+ if (this.builder.opts.assetRefresh) {
63725
+ iframe.src = this.builder.opts.imageselect;
63726
+ }
63727
+
63700
63728
  if (iframe.src === 'about:blank') {
63701
63729
  iframe.src = this.builder.opts.imageselect;
63702
63730
  }
@@ -67693,6 +67721,8 @@ class ContentBuilder {
67693
67721
  imageSelect: '',
67694
67722
  fileSelect: '',
67695
67723
  videoSelect: '',
67724
+ assetRefresh: true,
67725
+ // asset manager specified in imageSelect, fileSelect & videoSelect will always refreshed on click/open
67696
67726
  customTags: [],
67697
67727
  buttons: ['bold', 'italic', 'underline', 'formatting', 'color', 'align', 'textsettings', 'createLink', 'tags', '|', 'undo', 'redo', 'zoom', 'more'],
67698
67728
  buttonsMore: ['icon', 'image', '|', 'list', 'font', 'formatPara', '|', 'html', 'preferences'],
@@ -73727,6 +73757,7 @@ class ContentBox {
73727
73757
  if (!builderStuff) {
73728
73758
  builderStuff = document.createElement('div');
73729
73759
  builderStuff.id = '_cbhtml';
73760
+ builderStuff.style.visibility = 'hidden';
73730
73761
  builderStuff.className = 'is-ui';
73731
73762
  document.body.appendChild(builderStuff);
73732
73763
  builderStuff = document.querySelector('#_cbhtml');
@@ -73979,7 +74010,8 @@ class ContentBox {
73979
74010
  if (elm) elm.parentNode.removeChild(elm);
73980
74011
  this.wrapperEl.style.opacity = 1;
73981
74012
  let sidebar = builderStuff.querySelector('.is-sidebar');
73982
- if (sidebar) sidebar.style.opacity = 1; // Remove the page-overlay
74013
+ if (sidebar) sidebar.style.opacity = 1;
74014
+ this.builderStuff.style.visibility = 'visible'; // Remove the page-overlay
73983
74015
 
73984
74016
  pageOverlay = builderStuff.querySelectorAll('.page-overlay');
73985
74017
  pageOverlay.forEach(elm => {