@innovastudio/contentbox 1.4.45 → 1.4.46

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/contentbox",
3
3
  "type": "module",
4
- "version": "1.4.45",
4
+ "version": "1.4.46",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -46,7 +46,7 @@
46
46
  "webpack-dev-server": "^4.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@innovastudio/contentbuilder": "^1.3.52",
49
+ "@innovastudio/contentbuilder": "^1.3.53",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -459,6 +459,12 @@ const prepareSvgIcons$1 = builder => {
459
459
  <line x1="15" y1="16" x2="15" y2="20"></line>
460
460
  </symbol>
461
461
 
462
+ <symbol id="icon-reload" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
463
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
464
+ <path d="M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1.002 7.935 1.007 9.425 4.747"></path>
465
+ <path d="M20 4v5h-5"></path>
466
+ </symbol>
467
+
462
468
  </defs>
463
469
  </svg>`;
464
470
  const builderStuff = builder.builderStuff;
@@ -30761,10 +30767,10 @@ const renderQuickAdd = builder => {
30761
30767
  elm = quickadd.querySelector('.add-image');
30762
30768
  dom.addEventListener(elm, 'click', () => {
30763
30769
  const mode = quickadd.getAttribute('data-mode');
30764
- let html = `<img onload="imageLoaded(this)" src="${builder.opts.snippetPath}example.png" alt="" />`;
30770
+ let html = `<img src="${builder.opts.snippetPath}example.png" alt="" />`;
30765
30771
 
30766
30772
  if (builder.opts.snippetSampleImage) {
30767
- html = `<img onload="imageLoaded(this)" src="${builder.opts.snippetSampleImage}" alt="" />`;
30773
+ html = `<img src="${builder.opts.snippetSampleImage}" alt="" />`;
30768
30774
  }
30769
30775
 
30770
30776
  util.addContent(html, mode);
@@ -86594,7 +86600,10 @@ class Resize {
86594
86600
  // setTimeout(()=>{
86595
86601
  // col.click();
86596
86602
  // },30);
86603
+ //Trigger Change event
86604
+
86597
86605
 
86606
+ this.builder.opts.onChange();
86598
86607
  }
86599
86608
  });
86600
86609
  }
@@ -88937,11 +88946,8 @@ class ContentBuilder {
88937
88946
  window.selectImage = this.selectImage.bind(this);
88938
88947
  window.selectVideo = this.selectVideo.bind(this);
88939
88948
  window.selectAsset = this.selectAsset.bind(this);
88940
- window.imageLoaded = this.imageLoaded.bind(this); //this.imageLoaded;
88941
-
88942
88949
  window.assetType = this.assetType.bind(this);
88943
88950
  window.hideModal = this.hideModal.bind(this);
88944
- this.win.imageLoaded = this.imageLoaded.bind(this); //this.imageLoaded;
88945
88951
  } // constructor
88946
88952
  // Convenience constructor, so that the plugin can be called directly using: ContentBuilder.run({ ... });
88947
88953
 
@@ -89929,10 +89935,6 @@ class ContentBuilder {
89929
89935
 
89930
89936
  saveForUndo(checkLater) {
89931
89937
  this.uo.saveForUndo(checkLater);
89932
- }
89933
-
89934
- imageLoaded(obj) {
89935
- obj.removeAttribute('onload');
89936
89938
  } // Module related
89937
89939
 
89938
89940
 
@@ -93597,6 +93599,23 @@ class AnimateScroll {
93597
93599
  .is-modal.page-preview > div > div {
93598
93600
  transition: all 0.1s ease;
93599
93601
  }
93602
+ .is-modal.page-preview .is-modal-refresh,
93603
+ .is-modal.page-preview .is-modal-close {
93604
+ background:transparent !important;
93605
+ width:32px !important;
93606
+ height:32px !important;
93607
+ position:absolute !important;
93608
+ box-shadow:none !important;
93609
+ }
93610
+ .is-modal.page-preview .is-modal-refresh {
93611
+ top:2px;
93612
+ right:34px;
93613
+ }
93614
+ .is-modal.page-preview .is-modal-close {
93615
+ top:2px;
93616
+ right:2px;
93617
+ }
93618
+
93600
93619
  .is-screen-1920 { width: 576px !important; }
93601
93620
  .is-screen-1440 {
93602
93621
  width: 431px !important;
@@ -93627,14 +93646,18 @@ class AnimateScroll {
93627
93646
  .is-screen-375 .preview-screen {
93628
93647
  width: 375px;height: 667px;transform: scale(0.446);
93629
93648
  }
93649
+ .is-screen-375 .is-modal-bar > span {
93650
+ display: none;
93651
+ }
93630
93652
  </style>
93631
-
93632
-
93633
93653
  <div class="is-modal is-modal-content page-preview is-screen-1920" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
93634
93654
  <div class="is-modal-bar is-draggable" draggable="">
93635
- ${out('Live Preview')}
93655
+ <span>${out('Live Preview')}</span>
93656
+ <button class="is-modal-refresh" tabindex="-1" title="${out('Reload')}">
93657
+ <svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#icon-reload"></use></svg>
93658
+ </button>
93636
93659
  <button class="is-modal-close" tabindex="-1" title="${out('Close')}">
93637
- <svg class="is-icon-flex" style="width:23px;height:23px;"><use xlink:href="#ion-ios-close-empty"></use></svg>
93660
+ <svg class="is-icon-flex" style="width:23px;height:23px;"><use xlink:href="#ion-ios-close-empty"></use></svg>
93638
93661
  </button>
93639
93662
  </div>
93640
93663
  <div style="position:relative;position:absolute;top:0;left:0;width:100%;height:100%;border-top:transparent 35px solid;">
@@ -93642,7 +93665,7 @@ class AnimateScroll {
93642
93665
  <iframe src="about:blank" style="box-sizing:border-box;width: 100%;height: 100%;position:absolute;"></iframe>
93643
93666
  </div>
93644
93667
  </div>
93645
- <div style="position:absolute;left:0;bottom:0;">
93668
+ <div style="position:absolute;left:3px;bottom:3px;border-radius:3px;display:flex;overflow:hidden;">
93646
93669
  <button class="is-modal-size" tabindex="-1" title="${out('Screen Sizes')}" style="width:30px;height:30px;">
93647
93670
  <svg class="is-icon-flex" style="width:23px;height:23px;"><use xlink:href="#icon-devices"></use></svg>
93648
93671
  </button>
@@ -93919,12 +93942,13 @@ class AnimateScroll {
93919
93942
  <div class="div-pin-spacing" style="display:none">
93920
93943
  <div style="padding-top:10px;"><span>${out('Pin Spacing')}</span>: </div>
93921
93944
  <div class="flex-wrap" style="padding:5px 0 10px">
93922
- <button title="0" class="cmd-pin-space" data-value="0" style="width:50px">0</button>
93923
- <button title="20" class="cmd-pin-space" data-value="20" style="width:50px">20</button>
93924
- <button title="40" class="cmd-pin-space" data-value="40" style="width:50px">40</button>
93925
- <button title="60" class="cmd-pin-space" data-value="60" style="width:50px">60</button>
93926
- <button title="80" class="cmd-pin-space" data-value="80" style="display:none;width:50px">80</button>
93927
- <button title="100" class="cmd-pin-space" data-value="100" style="display:none;width:50px">100</button>
93945
+ <button title="0" class="cmd-pin-space" data-value="" style="width:100px">${out('No Spacing')}</button>
93946
+ <button title="0" class="cmd-pin-space" data-value="0" style="width:50px">100</button>
93947
+ <button title="20" class="cmd-pin-space" data-value="20" style="width:50px">120</button>
93948
+ <button title="40" class="cmd-pin-space" data-value="40" style="width:50px">140</button>
93949
+ <button title="60" class="cmd-pin-space" data-value="60" style="display:none;width:50px">160</button>
93950
+ <button title="80" class="cmd-pin-space" data-value="80" style="display:none;width:50px">180</button>
93951
+ <button title="100" class="cmd-pin-space" data-value="100" style="display:none;width:50px">1100</button>
93928
93952
  </div>
93929
93953
  </div>
93930
93954
  <div class="flex-wrap" style="margin-top:10px;">
@@ -95770,14 +95794,14 @@ class AnimateScroll {
95770
95794
  this.builder.editor.saveForUndo();
95771
95795
 
95772
95796
  if (chkPinSection.checked) {
95773
- section.classList.add('section-pin');
95774
- section.classList.add('pin-space-20');
95797
+ section.classList.add('section-pin'); // section.classList.add('pin-space-20');
95798
+
95775
95799
  divPinSpacing.style.display = 'block';
95776
95800
  let elms = divPinSpacing.querySelectorAll('.cmd-pin-space');
95777
95801
  elms.forEach(elm => {
95778
95802
  elm.classList.remove('on');
95779
95803
  });
95780
- let btn = divPinSpacing.querySelector('.cmd-pin-space[data-value="20"]');
95804
+ let btn = divPinSpacing.querySelector('.cmd-pin-space[data-value="0"]');
95781
95805
  btn.classList.add('on');
95782
95806
  } else {
95783
95807
  section.classList.remove('section-pin');
@@ -95794,11 +95818,13 @@ class AnimateScroll {
95794
95818
  if (!section) return;
95795
95819
  let val = btn.getAttribute('data-value');
95796
95820
  this.builder.editor.saveForUndo();
95821
+ section.classList.remove('no-spacing');
95797
95822
  section.classList.remove('pin-space-20');
95798
95823
  section.classList.remove('pin-space-40');
95799
95824
  section.classList.remove('pin-space-60');
95800
95825
  section.classList.remove('pin-space-80');
95801
95826
  section.classList.remove('pin-space-100');
95827
+ if (val === '') section.classList.add('no-spacing');
95802
95828
  if (val === '20') section.classList.add('pin-space-20');
95803
95829
  if (val === '40') section.classList.add('pin-space-40');
95804
95830
  if (val === '60') section.classList.add('pin-space-60');
@@ -95921,6 +95947,17 @@ class AnimateScroll {
95921
95947
  // },1000);
95922
95948
  // };
95923
95949
 
95950
+ iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
95951
+ });
95952
+ const btnModalRefresh = modalPagePreview.querySelector('.is-modal-refresh');
95953
+ btnModalRefresh.addEventListener('click', () => {
95954
+ let html = this.builder.html();
95955
+ localStorage.setItem('preview-html', html);
95956
+ let mainCss = this.builder.mainCss();
95957
+ localStorage.setItem('preview-maincss', mainCss);
95958
+ let sectionCss = this.builder.sectionCss();
95959
+ localStorage.setItem('preview-sectioncss', sectionCss);
95960
+ const iframe = modalPagePreview.querySelector('iframe');
95924
95961
  iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
95925
95962
  }); // ---
95926
95963
  //Extend onPageContentClick
@@ -96356,7 +96393,10 @@ class AnimateScroll {
96356
96393
  elm.classList.remove('on');
96357
96394
  });
96358
96395
 
96359
- if (activeSection.classList.contains('pin-space-20')) {
96396
+ if (activeSection.classList.contains('no-spacing')) {
96397
+ let btn = divPinSpacing.querySelector('.cmd-pin-space[data-value=""]');
96398
+ btn.classList.add('on');
96399
+ } else if (activeSection.classList.contains('pin-space-20')) {
96360
96400
  let btn = divPinSpacing.querySelector('.cmd-pin-space[data-value="20"]');
96361
96401
  btn.classList.add('on');
96362
96402
  } else if (activeSection.classList.contains('pin-space-40')) {
@@ -100359,7 +100399,14 @@ class ContentBox {
100359
100399
  builderStuff.style.position = 'fixed';
100360
100400
  setTimeout(() => {
100361
100401
  builderStuff.style.position = '';
100362
- }, 1200);
100402
+
100403
+ if (this.wrapperEl.getBoundingClientRect().left < 0) {
100404
+ builderStuff.style.position = 'fixed';
100405
+ setTimeout(() => {
100406
+ builderStuff.style.position = '';
100407
+ }, 1500);
100408
+ }
100409
+ }, 1500);
100363
100410
  prepareSvgIcons$1(this); // Prepare icons (embed svg definitions for icons)
100364
100411
 
100365
100412
  this.sidebar = new SideBar(this);
@@ -101033,23 +101080,23 @@ class ContentBox {
101033
101080
  // Inside Container
101034
101081
  const box = target.closest('.is-box');
101035
101082
 
101036
- if (!target.closest('.is-tool') && !target.closest('.is-rowadd-tool')) {
101037
- if (box.classList.contains('box-select')) {
101038
- if (this.wrapperEl.classList.contains('is-container-edit')) {
101039
- this.wrapperEl.classList.remove('is-container-edit');
101040
- this.wrapperEl.classList.add('is-clean-edit');
101083
+ if (box) {
101084
+ if (!target.closest('.is-tool') && !target.closest('.is-rowadd-tool')) {
101085
+ if (box.classList.contains('box-select')) {
101086
+ if (this.wrapperEl.classList.contains('is-container-edit')) {
101087
+ this.wrapperEl.classList.remove('is-container-edit');
101088
+ this.wrapperEl.classList.add('is-clean-edit');
101089
+ } else {
101090
+ this.wrapperEl.classList.add('is-container-edit');
101091
+ this.wrapperEl.classList.remove('is-clean-edit');
101092
+ }
101041
101093
  } else {
101042
101094
  this.wrapperEl.classList.add('is-container-edit');
101043
101095
  this.wrapperEl.classList.remove('is-clean-edit');
101044
101096
  }
101045
- } else {
101046
- this.wrapperEl.classList.add('is-container-edit');
101047
- this.wrapperEl.classList.remove('is-clean-edit');
101048
- }
101049
- }
101097
+ } // clear
101098
+
101050
101099
 
101051
- if (box) {
101052
- // clear
101053
101100
  const prevBox = this.doc.querySelector('.box-select');
101054
101101
  if (prevBox) prevBox.classList.remove('box-select'); // select
101055
101102