@innovastudio/contentbox 1.4.57 → 1.4.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/contentbox",
3
3
  "type": "module",
4
- "version": "1.4.57",
4
+ "version": "1.4.59",
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.62",
49
+ "@innovastudio/contentbuilder": "^1.3.63",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -4620,9 +4620,11 @@ class EditSection {
4620
4620
  }
4621
4621
 
4622
4622
  sectionBottom() {
4623
- const activeSection = this.builder.activeSection;
4624
- let nodes = this.builder.wrapperEl.querySelectorAll('.is-section:not(.is-static)'); // let first = nodes[0];
4623
+ const activeSection = this.builder.activeSection; // let nodes = this.builder.wrapperEl.querySelectorAll('.is-section:not(.is-static)');
4625
4624
 
4625
+ let nodes = Array.from(this.builder.wrapperEl.children).filter(item => {
4626
+ return item.classList.contains('is-section');
4627
+ });
4626
4628
  let last = nodes[nodes.length - 1];
4627
4629
  activeSection.parentNode.insertBefore(activeSection, last.nextElementSibling); //Trigger Render event
4628
4630
 
@@ -11356,6 +11358,8 @@ class EditBox {
11356
11358
  btn.addEventListener('click', () => {
11357
11359
  let activeBox = this.builder.activeBox;
11358
11360
  let boxCentered = activeBox.querySelector('.is-box-centered');
11361
+ if (!boxCentered) boxCentered = activeBox; // for simplified flex section .is-section > .is-container
11362
+
11359
11363
  this.builder.editor.saveForUndo();
11360
11364
  let s = btn.getAttribute('data-value');
11361
11365
 
@@ -13176,6 +13180,7 @@ class EditBox {
13176
13180
  boxTextOpacity(s) {
13177
13181
  let activeBox = this.builder.activeBox;
13178
13182
  let cb = activeBox.querySelector('.is-box-centered');
13183
+ if (!cb) cb = activeBox; // for simplified flex section
13179
13184
 
13180
13185
  if (s === '+') {
13181
13186
  if (dom$j.hasClass(cb, 'is-opacity-20')) {
@@ -30833,7 +30838,7 @@ const renderQuickAdd = builder => {
30833
30838
  elm = quickadd.querySelector('.add-button');
30834
30839
  if (elm) dom.addEventListener(elm, 'click', () => {
30835
30840
  const mode = quickadd.getAttribute('data-mode');
30836
- let html = `<div style="white-space: nowrap;">
30841
+ let html = `<div>
30837
30842
  <a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid border-transparent ml-1 mr-1 mt-2 mb-2 hover:border-transparent rounded bg-gray-200 hover:bg-gray-300 tracking-50 uppercase py-2 size-14 px-6 font-semibold text-gray-600 leading-relaxed">Read More</a>
30838
30843
  </div>`;
30839
30844
 
@@ -30846,7 +30851,7 @@ const renderQuickAdd = builder => {
30846
30851
  elm = quickadd.querySelector('.add-twobutton');
30847
30852
  if (elm) dom.addEventListener(elm, 'click', () => {
30848
30853
  const mode = quickadd.getAttribute('data-mode');
30849
- let html = `<div style="white-space: nowrap;">
30854
+ let html = `<div>
30850
30855
  <a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid border-transparent ml-1 mr-1 mt-2 mb-2 hover:border-transparent rounded bg-gray-200 hover:bg-gray-300 tracking-50 uppercase py-2 size-14 px-6 font-semibold text-gray-600 leading-relaxed">Read More</a>
30851
30856
  <a href="#" role="button" class="transition-all inline-block cursor-pointer no-underline border-2 border-solid ml-1 mr-1 mt-2 mb-2 rounded tracking-50 uppercase py-2 size-14 px-6 border-current hover:border-transparent hover:text-white font-semibold text-indigo-500 hover:bg-indigo-500 leading-relaxed">Get Started</a>
30852
30857
  </div>`;
@@ -97875,7 +97880,7 @@ class Timeline {
97875
97880
  font-weight: 300 !important;
97876
97881
  padding: 0 !important;
97877
97882
  width: 36px !important;
97878
- height: 30px !important;
97883
+ height: 29px !important;
97879
97884
  text-align: center !important;
97880
97885
  letter-spacing: 0px !important;
97881
97886
  }
@@ -98389,7 +98394,7 @@ class Timeline {
98389
98394
  </td>
98390
98395
  </tr>
98391
98396
  </table>
98392
- <div class="flex-wrap" style="padding: 0 15px 15px;box-sizing: border-box;width: 100%;justify-content: space-between;">
98397
+ <div class="flex-wrap" style="padding: 3px 15px 15px;box-sizing: border-box;width: 100%;justify-content: space-between;">
98393
98398
 
98394
98399
  <div class="flex-wrap">
98395
98400
  <div class="flex-wrap" style="margin-right:15px">
@@ -98404,7 +98409,7 @@ class Timeline {
98404
98409
  <option value="section">${out('Section')}</option>
98405
98410
  </select>
98406
98411
  </div>
98407
- <div class="flex-wrap" style="margin-right:30px">
98412
+ <div class="flex-wrap" style="margin-right:20px">
98408
98413
  <button title="${out('Desktop')}" class="input-device on" data-value="" style="width:40px;height:34px;">
98409
98414
  <svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-desktop"></use></svg>
98410
98415
  </button>
@@ -98433,26 +98438,45 @@ class Timeline {
98433
98438
  </div>
98434
98439
  <label for="chkPinOverlap" style="margin:0;display:flex;margin-left:15px">
98435
98440
  <input id="chkPinOverlap" type="checkbox" style="margin:-1px 6px 0 0">
98436
- <span>${out('Overlap')}</span>.
98441
+ <span>${out('Overlap')}</span>
98437
98442
  </label>
98438
98443
  <label for="chkPinDesktopOnly" style="margin:0;display:flex;margin-left:15px">
98439
98444
  <input id="chkPinDesktopOnly" type="checkbox" style="margin:-1px 6px 0 0">
98440
- <span>${out('Widescreen')}</span>.
98445
+ <span>${out('Widescreen')}</span>
98441
98446
  </label>
98442
98447
  </div>
98443
-
98444
98448
  </div>
98445
98449
 
98446
98450
  <div class="flex-wrap" style="">
98447
98451
 
98448
- <div class="flex-wrap" style="margin-right:20px">
98452
+ <div class="flex-wrap" style="flex-direction:column;margin-right:15px">
98453
+ <div style="font-size:10px;margin-top:-10px;margin-bottom:2px"><span>${out('Origin')}</span>:</div>
98454
+ <div>
98455
+ <div class="flex-wrap">
98456
+ <button class="cmd-anim-origin" style="width:25px;height:19px;" data-value="left top" title="${out('Top Left')}" type="button" style=""><svg class="is-icon-flex" style="transform: rotate(315deg);"><use xlink:href="#ion-ios-arrow-thin-up"></use></svg></button>
98457
+ <button class="cmd-anim-origin" style="width:25px;height:19px;" data-value="center top" title="${out('Top Center')}" type="button"><svg class="is-icon-flex" style=""><use xlink:href="#ion-ios-arrow-thin-up"></use></svg></button>
98458
+ <button class="cmd-anim-origin" style="width:25px;height:19px;" data-value="right top" title="${out('Top Right')}" type="button"><svg class="is-icon-flex" style="transform: rotate(45deg);"><use xlink:href="#ion-ios-arrow-thin-up"></use></svg></button>
98459
+ </div>
98460
+ <div class="flex-wrap">
98461
+ <button class="cmd-anim-origin" style="width:25px;height:19px;" data-value="left center" title="${out('Center Left')}" type="button"><svg class="is-icon-flex" style=""><use xlink:href="#ion-ios-arrow-thin-left"></use></svg></button>
98462
+ <button class="cmd-anim-origin on" style="width:25px;height:19px;" data-value="center" title="${out('Center')}" type="button"><svg class="is-icon-flex" style="width:6px;height:6px;"><use xlink:href="#ion-android-contract"></use></svg></button>
98463
+ <button class="cmd-anim-origin" style="width:25px;height:19px;" data-value="right center" title="${out('Center Right')}" type="button"><svg class="is-icon-flex" style=""><use xlink:href="#ion-ios-arrow-thin-right"></use></svg></button>
98464
+ </div>
98465
+ <div class="flex-wrap">
98466
+ <button class="cmd-anim-origin" style="width:25px;height:19px;" data-value="left bottom" title="${out('Bottom Left')}" type="button" style=";"><svg class="is-icon-flex" style="transform: rotate(45deg);"><use xlink:href="#ion-ios-arrow-thin-down"></use></svg></button>
98467
+ <button class="cmd-anim-origin" style="width:25px;height:19px;" data-value="center bottom" title="${out('Bottom Center')}" type="button"><svg class="is-icon-flex" style=""><use xlink:href="#ion-ios-arrow-thin-down"></use></svg></button>
98468
+ <button class="cmd-anim-origin" style="width:25px;height:19px;" data-value="right bottom" title="${out('Bottom Right')}" type="button"><svg class="is-icon-flex" style="transform: rotate(315deg);"><use xlink:href="#ion-ios-arrow-thin-down"></use></svg></button>
98469
+ </div>
98470
+ </div>
98471
+ </div>
98472
+
98473
+ <div class="flex-wrap" style="margin-right:10px">
98449
98474
  <button title="${out('Disable Easing')}" class="cmd-disable-smoothanim" style="padding-left:15px;padding-right: 15px;">${out('Disable Easing')}</button>
98450
98475
  <button title="${out('Hidden on Start')}" class="cmd-hidden-onstart" style="padding-left:15px;padding-right: 15px;">${out('Hidden on Start')}</button>
98451
98476
  </div>
98452
98477
 
98453
98478
  <button title="${out('Clear All')}" class="cmd-clear-timeline" style="height:34px;flex: none;width: auto;padding: 0px !important;box-shadow: none !important;background: transparent !important;">
98454
98479
  <svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg>
98455
- <span style="margin-left:7px">${out('Clear All')}</span>
98456
98480
  </button>
98457
98481
  </div>
98458
98482
 
@@ -98648,6 +98672,8 @@ class Timeline {
98648
98672
  btn.classList.add('on');
98649
98673
  } else {
98650
98674
  section.classList.remove('section-pin');
98675
+ section.classList.remove('pin-space-lg');
98676
+ section.classList.remove('pin-space-xl');
98651
98677
  divPinSpacing.style.display = 'none';
98652
98678
  } //Trigger Change event
98653
98679
 
@@ -98710,6 +98736,19 @@ class Timeline {
98710
98736
  this.builder.onChange();
98711
98737
  });
98712
98738
  });
98739
+ const btnAnimOrigins = modalTimeline.querySelectorAll('.cmd-anim-origin');
98740
+ btnAnimOrigins.forEach(btn => {
98741
+ btn.addEventListener('click', () => {
98742
+ let elms = modalTimeline.querySelectorAll('.cmd-anim-origin');
98743
+ elms.forEach(elm => {
98744
+ elm.classList.remove('on');
98745
+ });
98746
+ btn.classList.add('on');
98747
+ this.applyTimeline(); //Trigger Change event
98748
+
98749
+ this.builder.onChange();
98750
+ });
98751
+ });
98713
98752
  const btnDisableSmoothAnim = modalTimeline.querySelector('.cmd-disable-smoothanim');
98714
98753
  btnDisableSmoothAnim.addEventListener('click', () => {
98715
98754
  if (btnDisableSmoothAnim.classList.contains('on')) {
@@ -98952,19 +98991,11 @@ class Timeline {
98952
98991
  this.inpOpacity_2500.value = '';
98953
98992
  this.inpOpacity_2600.value = '';
98954
98993
  this.inpOpacity_2700.value = '';
98955
- this.inpOpacity_2800.value = '';
98956
- const chkPinSection = this.modalTimeline.querySelector('#chkPinSection2');
98957
- chkPinSection.checked = false;
98958
- const divPinSpacing = this.modalTimeline.querySelector('.div-pin-spacing');
98959
- divPinSpacing.style.display = 'none';
98960
- const btnDisableSmoothAnim = this.modalTimeline.querySelector('.cmd-disable-smoothanim');
98961
- btnDisableSmoothAnim.classList.remove('on');
98962
- const btnHiddenOnStart = this.modalTimeline.querySelector('.cmd-hidden-onstart');
98963
- btnHiddenOnStart.classList.remove('on');
98964
- }
98994
+ this.inpOpacity_2800.value = ''; // const chkPinSection = this.modalTimeline.querySelector('#chkPinSection2');
98995
+ // chkPinSection.checked = false;
98996
+ // const divPinSpacing = this.modalTimeline.querySelector('.div-pin-spacing');
98997
+ // divPinSpacing.style.display = 'none';
98965
98998
 
98966
- read() {
98967
- this.clearSettings();
98968
98999
  const activeSection = this.builder.activeSection;
98969
99000
 
98970
99001
  if (activeSection) {
@@ -99017,10 +99048,39 @@ class Timeline {
99017
99048
  }
99018
99049
  }
99019
99050
 
99051
+ const btnAnimOrigins = this.modalTimeline.querySelectorAll('.cmd-anim-origin');
99052
+ btnAnimOrigins.forEach(btn => {
99053
+ if (btn.getAttribute('data-value') === 'center') {
99054
+ btn.classList.add('on');
99055
+ } else {
99056
+ btn.classList.remove('on');
99057
+ }
99058
+ });
99059
+ const btnDisableSmoothAnim = this.modalTimeline.querySelector('.cmd-disable-smoothanim');
99060
+ btnDisableSmoothAnim.classList.remove('on');
99061
+ const btnHiddenOnStart = this.modalTimeline.querySelector('.cmd-hidden-onstart');
99062
+ btnHiddenOnStart.classList.remove('on');
99063
+ }
99064
+
99065
+ read() {
99066
+ this.clearSettings();
99020
99067
  let activeElement;
99021
99068
  let target = this.getTarget();
99022
99069
  activeElement = target.element;
99023
99070
  if (!activeElement) return;
99071
+
99072
+ if (activeElement.style.transformOrigin) {
99073
+ let origin = activeElement.style.transformOrigin;
99074
+ const btnAnimOrigins = this.modalTimeline.querySelectorAll('.cmd-anim-origin');
99075
+ btnAnimOrigins.forEach(btn => {
99076
+ if (origin === btn.getAttribute('data-value')) {
99077
+ btn.classList.add('on');
99078
+ } else {
99079
+ btn.classList.remove('on');
99080
+ }
99081
+ });
99082
+ }
99083
+
99024
99084
  const btnDisableSmoothAnim = this.modalTimeline.querySelector('.cmd-disable-smoothanim');
99025
99085
 
99026
99086
  if (activeElement.hasAttribute('data-smooth-scrolling')) {
@@ -99607,6 +99667,13 @@ class Timeline {
99607
99667
  /* /mark device */
99608
99668
 
99609
99669
 
99670
+ const btnAnimOrigin = this.modalTimeline.querySelector('.cmd-anim-origin.on');
99671
+
99672
+ if (btnAnimOrigin) {
99673
+ let origin = btnAnimOrigin.getAttribute('data-value');
99674
+ activeElement.style.transformOrigin = origin;
99675
+ }
99676
+
99610
99677
  const btnDisableSmoothAnim = this.modalTimeline.querySelector('.cmd-disable-smoothanim');
99611
99678
 
99612
99679
  if (btnDisableSmoothAnim.classList.contains('on')) {
@@ -100232,6 +100299,7 @@ class ContentBox {
100232
100299
  zoom: 0.6,
100233
100300
  shortenHTML: true,
100234
100301
  advancedTimeline: false,
100302
+ livePreviewOpen: false,
100235
100303
  contentStyleWithSample: false,
100236
100304
  contentSizes: [300, 320, 340, 360, 380, 400, 420, 440, 460, 480, 500, 520, 540, 560, 580, 600, 620, 640, 660, 680, 700, 720, 740, 760, 780, 800, 820, 840, 860, 880, 900, 920, 940, 960, 970, 980, 1000, 1020, 1040, 1050, 1060, 1080, 1100, 1120, 1140, 1160, 1180, 1200, 1220, 1240, 1260, 1280, 1300, 1320, 1340, 1360, 1380, 1400, 1420, 1440, 1460, 1480, 1500, 1520, 1540, 1560, 1580, 1600, 1620, 1640, 1660, 1680, 1700, 1720, 1740, 1760, 1780, 1800, 1820, 1840, 1860, 1880, 1900, 1920, 1940, 1960, 1980, 2000, 2020, 2040, 2060, 2080, 2100, 2120, 2140, 2160, 2180, 2200, 2220, 2240, 2260, 2280, 2300, 2320, 2340, 2360, 2380, 2400, 2420, 2440, 2460, 2480, 2500, 2520, 2540, 2560, 2580, 2600, 2620, 2640, 2660, 2680, 2700],
100237
100305
  contentStyles: {
@@ -103205,6 +103273,10 @@ class ContentBox {
103205
103273
 
103206
103274
  if (localStorage.getItem('_livepreview') != null) {
103207
103275
  this.openPreview();
103276
+ } else {
103277
+ if (this.settings.livePreviewOpen) {
103278
+ this.openPreview();
103279
+ }
103208
103280
  }
103209
103281
 
103210
103282
  if (localStorage.getItem('_disableanimation') != null) {
@@ -104638,13 +104710,26 @@ class ContentBox {
104638
104710
  wrapper.style.opacity = '0';
104639
104711
  }
104640
104712
 
104641
- if (!this.editor) {
104713
+ let waitSlider = false;
104714
+
104715
+ if (this.settings.slider === 'glide' || this.settings.slider === 'all') {
104716
+ if (typeof this.win.Glide !== 'undefined') {
104717
+ if (new this.win.Glide().mount) ; else {
104718
+ waitSlider = true; // console.log('not ready');
104719
+ }
104720
+ } else {
104721
+ waitSlider = true; // console.log('not loaded');
104722
+ }
104723
+ }
104724
+
104725
+ if (!this.editor || waitSlider) {
104642
104726
  // Wait for the ContentBuilder init complete
104643
104727
  setTimeout(() => {
104644
104728
  this.loadHtml(html);
104645
104729
  }, 100);
104646
104730
  return;
104647
- } // Render html content
104731
+ } // console.log((new this.win.Glide).mount);
104732
+ // Render html content
104648
104733
 
104649
104734
 
104650
104735
  let range = document.createRange();
@@ -104790,7 +104875,8 @@ class ContentBox {
104790
104875
  let html = this.html(); // this.builderStuff.parentNode.removeChild(this.builderStuff);
104791
104876
 
104792
104877
  this.builderStuff.innerHTML = '';
104793
- dom.removeClass(document.body, 'sidebar-active'); // Remove special css
104878
+ dom.removeClass(document.body, 'sidebar-active');
104879
+ document.body.removeAttribute('data-skrollrr-off'); // Remove special css
104794
104880
 
104795
104881
  const cbContentStyle = this.doc.querySelector('#_contentbox_css');
104796
104882
  if (cbContentStyle) cbContentStyle.parentNode.removeChild(cbContentStyle);