@innovastudio/contentbox 1.0.36 → 1.0.40

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.36",
3
+ "version": "1.0.40",
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",
@@ -311,7 +311,7 @@ class SideBar {
311
311
  this.builderStuff = builderStuff;
312
312
 
313
313
  if (this.builder.useSidebar) {
314
- html += '<div class="is-sidebar active" style="transform: translate3d(0,0,0);display: flex;flex-direction: column;opacity:opacity: 0.0001;">';
314
+ html += '<div class="is-sidebar active" style="transform: translate3d(0,0,0);display: flex;flex-direction: column;opacity: 0.0001;">';
315
315
  var sideIndex = 0;
316
316
  this.builder.sidebarData.buttons.map(button => {
317
317
  if (button.name == 'section') {
@@ -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
  }
@@ -1723,8 +1723,8 @@ class SideBar {
1723
1723
  function applyParentStyles() {
1724
1724
  var cssString = '' +
1725
1725
  'body {' +
1726
- 'background: ${parent._cb.styleSnippetBackground};' +
1727
- 'color: ${parent._cb.styleSnippetColor};' +
1726
+ 'background: ' + parent._cb.styleSnippetBackground + ';' +
1727
+ 'color: ' + parent._cb.styleSnippetColor + ';' +
1728
1728
  'margin: 0;' +
1729
1729
  '}' +
1730
1730
 
@@ -1793,7 +1793,7 @@ class SideBar {
1793
1793
  '}' +
1794
1794
 
1795
1795
  'svg {' +
1796
- 'fill: ${parent._cb.styleSnippetColor};' +
1796
+ 'fill: ' + parent._cb.styleSnippetColor + ';' +
1797
1797
  '}' +
1798
1798
 
1799
1799
  '.dark .is-design-list>div .is-overlay:after {' +
@@ -1806,45 +1806,45 @@ class SideBar {
1806
1806
  '}' +
1807
1807
 
1808
1808
  '.is-category-list>div {' +
1809
- 'background: ${parent._cb.styleSnippetTabsBackground};' +
1809
+ 'background: ' + parent._cb.styleSnippetTabsBackground + ';' +
1810
1810
  '}' +
1811
1811
  '.is-category-list>div:last-child {' +
1812
1812
  'width:100%;' +
1813
1813
  '}' +
1814
1814
 
1815
1815
  '.is-category-list a {' +
1816
- 'background: ${parent._cb.styleSnippetTabItemBackground};' +
1817
- 'color: ${parent._cb.styleSnippetTabItemColor};' +
1816
+ 'background: ' + parent._cb.styleSnippetTabItemBackground + ';' +
1817
+ 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +
1818
1818
  'transition: box-shadow ease 0.3s;' +
1819
1819
  '}' +
1820
1820
 
1821
1821
  '.is-category-list a:hover {' +
1822
- 'background: ${parent._cb.styleSnippetTabItemBackgroundHover};' +
1822
+ 'background: ' + parent._cb.styleSnippetTabItemBackgroundHover + ';' +
1823
1823
  'box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);' +
1824
- 'color: ${parent._cb.styleSnippetTabItemColor};' +
1824
+ 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +
1825
1825
  '}' +
1826
1826
 
1827
1827
  '.is-category-list a.active {' +
1828
- 'background: ${parent._cb.styleSnippetTabItemBackgroundActive};' +
1829
- 'color: ${parent._cb.styleSnippetTabItemColor};' +
1828
+ 'background: ' + parent._cb.styleSnippetTabItemBackgroundActive + ';' +
1829
+ 'color: ' + parent._cb.styleSnippetTabItemColor + ';' +
1830
1830
  'cursor: default;' +
1831
1831
  '}' +
1832
1832
 
1833
1833
  '.is-more-categories {' +
1834
- 'background: ${parent._cb.styleSnippetMoreItemBackground};' +
1834
+ 'background: ' + parent._cb.styleSnippetMoreItemBackground + ';' +
1835
1835
  '}' +
1836
1836
 
1837
1837
  '.is-more-categories a {' +
1838
- 'background: ${parent._cb.styleSnippetMoreItemBackground};' +
1839
- 'color: ${parent._cb.styleSnippetMoreItemColor};' +
1838
+ 'background: ' + parent._cb.styleSnippetMoreItemBackground + ';' +
1839
+ 'color: ' + parent._cb.styleSnippetMoreItemColor + ';' +
1840
1840
  '}' +
1841
1841
 
1842
1842
  '.is-more-categories a:hover {' +
1843
- 'background: ${parent._cb.styleSnippetMoreItemBackgroundHover};' +
1843
+ 'background: ' + parent._cb.styleSnippetMoreItemBackgroundHover + ';' +
1844
1844
  '}' +
1845
1845
 
1846
1846
  '.is-more-categories a.active {' +
1847
- ' background: ${parent._cb.styleSnippetMoreItemBackgroundActive};' +
1847
+ ' background: ' + parent._cb.styleSnippetMoreItemBackgroundActive + ';' +
1848
1848
  '}';
1849
1849
 
1850
1850
  let themestyle = document.querySelector('[data-theme-style]');
@@ -1854,7 +1854,7 @@ class SideBar {
1854
1854
  style.setAttribute('data-theme-style','');
1855
1855
  style.type = "text/css";
1856
1856
  style.innerHTML = cssString;
1857
- document.getElementsByTagName("head")[0].appendChild(style);
1857
+ document.head.appendChild(style);
1858
1858
 
1859
1859
  if(parent._cb.styleDark) {
1860
1860
  document.body.setAttribute('class', 'dark');
@@ -1869,7 +1869,7 @@ class SideBar {
1869
1869
  }
1870
1870
  }
1871
1871
 
1872
- applyParentStyles();
1872
+ // applyParentStyles();
1873
1873
 
1874
1874
 
1875
1875
  /*!
@@ -1884,6 +1884,8 @@ class SideBar {
1884
1884
 
1885
1885
  document.querySelector('.is-category-list').style.opacity = 1;
1886
1886
  document.querySelector('.is-design-list').style.opacity = 1;
1887
+
1888
+ applyParentStyles();
1887
1889
  });
1888
1890
  </script>
1889
1891
  </body>
@@ -2304,7 +2306,8 @@ class EditSection {
2304
2306
  activeSection.removeAttribute('data-bottom-top');
2305
2307
  activeSection.removeAttribute('data-300-bottom');
2306
2308
  activeSection.removeAttribute('data-400-bottom');
2307
- activeSection.removeAttribute('data-anim-start'); // activeSection.style.transform = '';
2309
+ activeSection.removeAttribute('data-anim-start');
2310
+ activeSection.style.transform = '';
2308
2311
 
2309
2312
  if (s === 'zoom-in') {
2310
2313
  activeSection.setAttribute('data-bottom-top', 'transform:translateX(0%) translateY(0%) scale(0.7)');
@@ -2338,7 +2341,8 @@ class EditSection {
2338
2341
  const activeSection = this.builder.activeSection;
2339
2342
  activeSection.removeAttribute('data-top-bottom');
2340
2343
  activeSection.removeAttribute('data-center');
2341
- activeSection.removeAttribute('data-anim-end'); // activeSection.style.transform = '';
2344
+ activeSection.removeAttribute('data-anim-end');
2345
+ activeSection.style.transform = '';
2342
2346
 
2343
2347
  if (s === 'zoom-in') {
2344
2348
  activeSection.setAttribute('data-center', 'transform:translateX(0%) translateY(0%) scale(1)');
@@ -19192,8 +19196,8 @@ class HtmlUtil {
19192
19196
  Array.prototype.forEach.call(emptystyles, emptystyle => {
19193
19197
  emptystyle.removeAttribute('style');
19194
19198
  });
19195
- dom$E.removeEmptyStyle(tmp);
19196
- dom$E.cleanEmptySpans(tmp);
19199
+ dom$E.removeEmptyStyle(tmp); // dom.cleanEmptySpans(tmp);
19200
+
19197
19201
  elms = tmp.querySelectorAll('[data-keep]');
19198
19202
  dom$E.removeAttributes(elms, 'data-keep'); //Cleanup button <span contenteditable="false"><a contenteditable="true">button</a></span>
19199
19203
 
@@ -49352,6 +49356,10 @@ class Image {
49352
49356
  let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
49353
49357
  let iframe = modalImageSelect.querySelector('iframe');
49354
49358
 
49359
+ if (this.builder.opts.assetRefresh) {
49360
+ iframe.src = this.builder.opts.imageselect;
49361
+ }
49362
+
49355
49363
  if (iframe.src === 'about:blank') {
49356
49364
  iframe.src = this.builder.opts.imageselect;
49357
49365
  }
@@ -49374,6 +49382,10 @@ class Image {
49374
49382
  let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
49375
49383
  let iframe = modalImageSelect.querySelector('iframe');
49376
49384
 
49385
+ if (this.builder.opts.assetRefresh) {
49386
+ iframe.src = this.builder.opts.imageselect;
49387
+ }
49388
+
49377
49389
  if (iframe.src === 'about:blank') {
49378
49390
  iframe.src = this.builder.opts.imageselect;
49379
49391
  }
@@ -50061,6 +50073,10 @@ class Image {
50061
50073
  resize = false;
50062
50074
  }
50063
50075
 
50076
+ if (this.builder.opts.maxEmbedImageWidth === -1) {
50077
+ resize = false;
50078
+ }
50079
+
50064
50080
  if (!resize) {
50065
50081
  // NEW: this is to prevent using MegaPixImage (problem with some PNG. PNG doesn't need to resize, so no need to use MegaPixImage)
50066
50082
  let tmpCanvasNoCrop = document.getElementById('myTmpCanvasNoCrop');
@@ -51491,6 +51507,10 @@ class Hyperlink {
51491
51507
  } else {
51492
51508
  let modalFileSelect = this.builderStuff.querySelector('.is-modal.fileselect');
51493
51509
 
51510
+ if (this.builder.opts.assetRefresh) {
51511
+ modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51512
+ }
51513
+
51494
51514
  if (modalFileSelect.querySelector('iframe').src === 'about:blank') {
51495
51515
  modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51496
51516
  }
@@ -51583,6 +51603,10 @@ class Hyperlink {
51583
51603
  } else {
51584
51604
  let modalFileSelect = this.builderStuff.querySelector('.is-modal.fileselect');
51585
51605
 
51606
+ if (this.builder.opts.assetRefresh) {
51607
+ modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51608
+ }
51609
+
51586
51610
  if (modalFileSelect.querySelector('iframe').src === 'about:blank') {
51587
51611
  modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51588
51612
  }
@@ -53012,6 +53036,10 @@ class Video {
53012
53036
  let modalVideoSelect = builderStuff.querySelector('.is-modal.videoselect');
53013
53037
  let iframe = modalVideoSelect.querySelector('iframe');
53014
53038
 
53039
+ if (this.builder.opts.assetRefresh) {
53040
+ iframe.src = this.builder.opts.videoSelect;
53041
+ }
53042
+
53015
53043
  if (iframe.src === 'about:blank') {
53016
53044
  iframe.src = this.builder.opts.videoSelect;
53017
53045
  }
@@ -63697,6 +63725,10 @@ class Rte {
63697
63725
  let modalImageSelect = this.builderStuff.querySelector('.is-modal.imageselect');
63698
63726
  let iframe = modalImageSelect.querySelector('iframe');
63699
63727
 
63728
+ if (this.builder.opts.assetRefresh) {
63729
+ iframe.src = this.builder.opts.imageselect;
63730
+ }
63731
+
63700
63732
  if (iframe.src === 'about:blank') {
63701
63733
  iframe.src = this.builder.opts.imageselect;
63702
63734
  }
@@ -67693,6 +67725,8 @@ class ContentBuilder {
67693
67725
  imageSelect: '',
67694
67726
  fileSelect: '',
67695
67727
  videoSelect: '',
67728
+ assetRefresh: true,
67729
+ // asset manager specified in imageSelect, fileSelect & videoSelect will always refreshed on click/open
67696
67730
  customTags: [],
67697
67731
  buttons: ['bold', 'italic', 'underline', 'formatting', 'color', 'align', 'textsettings', 'createLink', 'tags', '|', 'undo', 'redo', 'zoom', 'more'],
67698
67732
  buttonsMore: ['icon', 'image', '|', 'list', 'font', 'formatPara', '|', 'html', 'preferences'],
@@ -74021,34 +74055,32 @@ class ContentBox {
74021
74055
  }
74022
74056
  }); // Hide tool on scrolling
74023
74057
 
74058
+ /*
74024
74059
  let timeoutId;
74025
- window.addEventListener('scroll', this.doWindowScroll = () => {
74026
- if (this.controlHiddenOnScroll) {
74027
- let builderActive = document.querySelector('.builder-active');
74028
-
74029
- if (builderActive) {
74030
- this.editor.util.clearActiveCell();
74031
- this.editor.util.clearControls();
74032
- this.controlHiddenOnScroll = false;
74033
- }
74034
- }
74035
-
74036
- clearTimeout(timeoutId);
74037
- timeoutId = setTimeout(() => {
74038
- let hover = false;
74039
-
74040
- if (this.activeSection) {
74041
- if (this.activeSection.matches(':hover')) {
74042
- hover = true;
74043
- }
74044
- }
74045
-
74046
- if (!hover) {
74047
- let boxTool = document.querySelector('#divBoxTool');
74048
- boxTool.style.display = 'none';
74060
+ window.addEventListener('scroll', this.doWindowScroll = () =>{
74061
+ if(this.controlHiddenOnScroll) {
74062
+ let builderActive = document.querySelector('.builder-active');
74063
+ if(builderActive) {
74064
+ this.editor.util.clearActiveCell();
74065
+ this.editor.util.clearControls();
74066
+ this.controlHiddenOnScroll = false;
74067
+ }
74049
74068
  }
74050
- }, 30);
74051
- });
74069
+ clearTimeout(timeoutId);
74070
+ timeoutId = setTimeout( ()=> {
74071
+ let hover=false;
74072
+ if(this.activeSection) {
74073
+ if(this.activeSection.matches(':hover')) {
74074
+ hover=true;
74075
+ }
74076
+ }
74077
+ if(!hover) {
74078
+ let boxTool = document.querySelector('#divBoxTool');
74079
+ boxTool.style.display = 'none';
74080
+ }
74081
+ }, 30);
74082
+ });
74083
+ */
74052
74084
  } // init
74053
74085
 
74054
74086
 
@@ -74369,7 +74401,10 @@ class ContentBox {
74369
74401
  btn.style.color = this.editor.styleModalColor;
74370
74402
  });
74371
74403
  const sectionIframe = document.querySelector('#ifrIdeasPanel');
74372
- if (sectionIframe.contentWindow.applyParentStyles) sectionIframe.contentWindow.applyParentStyles();
74404
+
74405
+ if (sectionIframe.contentWindow.applyParentStyles) {
74406
+ sectionIframe.contentWindow.applyParentStyles();
74407
+ }
74373
74408
  }
74374
74409
 
74375
74410
  rePositionTool() {