@innovastudio/contentbox 1.0.37 → 1.0.41

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.37",
3
+ "version": "1.0.41",
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.65",
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,15 @@ 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();
1889
+
1890
+ console.log(parent._cb.styleSnippetTabItemColor);
1891
+ console.log('${this.builder.editor.styleSnippetTabItemColor}');
1892
+ setTimeout(()=>{
1893
+ applyParentStyles();
1894
+ },600);
1895
+
1887
1896
  });
1888
1897
  </script>
1889
1898
  </body>
@@ -2304,7 +2313,8 @@ class EditSection {
2304
2313
  activeSection.removeAttribute('data-bottom-top');
2305
2314
  activeSection.removeAttribute('data-300-bottom');
2306
2315
  activeSection.removeAttribute('data-400-bottom');
2307
- activeSection.removeAttribute('data-anim-start'); // activeSection.style.transform = '';
2316
+ activeSection.removeAttribute('data-anim-start');
2317
+ activeSection.style.transform = '';
2308
2318
 
2309
2319
  if (s === 'zoom-in') {
2310
2320
  activeSection.setAttribute('data-bottom-top', 'transform:translateX(0%) translateY(0%) scale(0.7)');
@@ -2338,7 +2348,8 @@ class EditSection {
2338
2348
  const activeSection = this.builder.activeSection;
2339
2349
  activeSection.removeAttribute('data-top-bottom');
2340
2350
  activeSection.removeAttribute('data-center');
2341
- activeSection.removeAttribute('data-anim-end'); // activeSection.style.transform = '';
2351
+ activeSection.removeAttribute('data-anim-end');
2352
+ activeSection.style.transform = '';
2342
2353
 
2343
2354
  if (s === 'zoom-in') {
2344
2355
  activeSection.setAttribute('data-center', 'transform:translateX(0%) translateY(0%) scale(1)');
@@ -49352,6 +49363,10 @@ class Image {
49352
49363
  let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
49353
49364
  let iframe = modalImageSelect.querySelector('iframe');
49354
49365
 
49366
+ if (this.builder.opts.assetRefresh) {
49367
+ iframe.src = this.builder.opts.imageselect;
49368
+ }
49369
+
49355
49370
  if (iframe.src === 'about:blank') {
49356
49371
  iframe.src = this.builder.opts.imageselect;
49357
49372
  }
@@ -49374,6 +49389,10 @@ class Image {
49374
49389
  let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
49375
49390
  let iframe = modalImageSelect.querySelector('iframe');
49376
49391
 
49392
+ if (this.builder.opts.assetRefresh) {
49393
+ iframe.src = this.builder.opts.imageselect;
49394
+ }
49395
+
49377
49396
  if (iframe.src === 'about:blank') {
49378
49397
  iframe.src = this.builder.opts.imageselect;
49379
49398
  }
@@ -51495,6 +51514,10 @@ class Hyperlink {
51495
51514
  } else {
51496
51515
  let modalFileSelect = this.builderStuff.querySelector('.is-modal.fileselect');
51497
51516
 
51517
+ if (this.builder.opts.assetRefresh) {
51518
+ modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51519
+ }
51520
+
51498
51521
  if (modalFileSelect.querySelector('iframe').src === 'about:blank') {
51499
51522
  modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51500
51523
  }
@@ -51587,6 +51610,10 @@ class Hyperlink {
51587
51610
  } else {
51588
51611
  let modalFileSelect = this.builderStuff.querySelector('.is-modal.fileselect');
51589
51612
 
51613
+ if (this.builder.opts.assetRefresh) {
51614
+ modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51615
+ }
51616
+
51590
51617
  if (modalFileSelect.querySelector('iframe').src === 'about:blank') {
51591
51618
  modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
51592
51619
  }
@@ -53016,6 +53043,10 @@ class Video {
53016
53043
  let modalVideoSelect = builderStuff.querySelector('.is-modal.videoselect');
53017
53044
  let iframe = modalVideoSelect.querySelector('iframe');
53018
53045
 
53046
+ if (this.builder.opts.assetRefresh) {
53047
+ iframe.src = this.builder.opts.videoSelect;
53048
+ }
53049
+
53019
53050
  if (iframe.src === 'about:blank') {
53020
53051
  iframe.src = this.builder.opts.videoSelect;
53021
53052
  }
@@ -63701,6 +63732,10 @@ class Rte {
63701
63732
  let modalImageSelect = this.builderStuff.querySelector('.is-modal.imageselect');
63702
63733
  let iframe = modalImageSelect.querySelector('iframe');
63703
63734
 
63735
+ if (this.builder.opts.assetRefresh) {
63736
+ iframe.src = this.builder.opts.imageselect;
63737
+ }
63738
+
63704
63739
  if (iframe.src === 'about:blank') {
63705
63740
  iframe.src = this.builder.opts.imageselect;
63706
63741
  }
@@ -67697,6 +67732,8 @@ class ContentBuilder {
67697
67732
  imageSelect: '',
67698
67733
  fileSelect: '',
67699
67734
  videoSelect: '',
67735
+ assetRefresh: true,
67736
+ // asset manager specified in imageSelect, fileSelect & videoSelect will always refreshed on click/open
67700
67737
  customTags: [],
67701
67738
  buttons: ['bold', 'italic', 'underline', 'formatting', 'color', 'align', 'textsettings', 'createLink', 'tags', '|', 'undo', 'redo', 'zoom', 'more'],
67702
67739
  buttonsMore: ['icon', 'image', '|', 'list', 'font', 'formatPara', '|', 'html', 'preferences'],
@@ -74025,34 +74062,32 @@ class ContentBox {
74025
74062
  }
74026
74063
  }); // Hide tool on scrolling
74027
74064
 
74065
+ /*
74028
74066
  let timeoutId;
74029
- window.addEventListener('scroll', this.doWindowScroll = () => {
74030
- if (this.controlHiddenOnScroll) {
74031
- let builderActive = document.querySelector('.builder-active');
74032
-
74033
- if (builderActive) {
74034
- this.editor.util.clearActiveCell();
74035
- this.editor.util.clearControls();
74036
- this.controlHiddenOnScroll = false;
74037
- }
74038
- }
74039
-
74040
- clearTimeout(timeoutId);
74041
- timeoutId = setTimeout(() => {
74042
- let hover = false;
74043
-
74044
- if (this.activeSection) {
74045
- if (this.activeSection.matches(':hover')) {
74046
- hover = true;
74047
- }
74048
- }
74049
-
74050
- if (!hover) {
74051
- let boxTool = document.querySelector('#divBoxTool');
74052
- boxTool.style.display = 'none';
74067
+ window.addEventListener('scroll', this.doWindowScroll = () =>{
74068
+ if(this.controlHiddenOnScroll) {
74069
+ let builderActive = document.querySelector('.builder-active');
74070
+ if(builderActive) {
74071
+ this.editor.util.clearActiveCell();
74072
+ this.editor.util.clearControls();
74073
+ this.controlHiddenOnScroll = false;
74074
+ }
74053
74075
  }
74054
- }, 30);
74055
- });
74076
+ clearTimeout(timeoutId);
74077
+ timeoutId = setTimeout( ()=> {
74078
+ let hover=false;
74079
+ if(this.activeSection) {
74080
+ if(this.activeSection.matches(':hover')) {
74081
+ hover=true;
74082
+ }
74083
+ }
74084
+ if(!hover) {
74085
+ let boxTool = document.querySelector('#divBoxTool');
74086
+ boxTool.style.display = 'none';
74087
+ }
74088
+ }, 30);
74089
+ });
74090
+ */
74056
74091
  } // init
74057
74092
 
74058
74093
 
@@ -74373,7 +74408,10 @@ class ContentBox {
74373
74408
  btn.style.color = this.editor.styleModalColor;
74374
74409
  });
74375
74410
  const sectionIframe = document.querySelector('#ifrIdeasPanel');
74376
- if (sectionIframe.contentWindow.applyParentStyles) sectionIframe.contentWindow.applyParentStyles();
74411
+
74412
+ if (sectionIframe.contentWindow.applyParentStyles) {
74413
+ sectionIframe.contentWindow.applyParentStyles();
74414
+ }
74377
74415
  }
74378
74416
 
74379
74417
  rePositionTool() {