@innovastudio/contentbox 1.4.58 → 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.58",
4
+ "version": "1.4.59",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -11358,6 +11358,8 @@ class EditBox {
11358
11358
  btn.addEventListener('click', () => {
11359
11359
  let activeBox = this.builder.activeBox;
11360
11360
  let boxCentered = activeBox.querySelector('.is-box-centered');
11361
+ if (!boxCentered) boxCentered = activeBox; // for simplified flex section .is-section > .is-container
11362
+
11361
11363
  this.builder.editor.saveForUndo();
11362
11364
  let s = btn.getAttribute('data-value');
11363
11365
 
@@ -13178,6 +13180,7 @@ class EditBox {
13178
13180
  boxTextOpacity(s) {
13179
13181
  let activeBox = this.builder.activeBox;
13180
13182
  let cb = activeBox.querySelector('.is-box-centered');
13183
+ if (!cb) cb = activeBox; // for simplified flex section
13181
13184
 
13182
13185
  if (s === '+') {
13183
13186
  if (dom$j.hasClass(cb, 'is-opacity-20')) {
@@ -97877,7 +97880,7 @@ class Timeline {
97877
97880
  font-weight: 300 !important;
97878
97881
  padding: 0 !important;
97879
97882
  width: 36px !important;
97880
- height: 30px !important;
97883
+ height: 29px !important;
97881
97884
  text-align: center !important;
97882
97885
  letter-spacing: 0px !important;
97883
97886
  }
@@ -98391,7 +98394,7 @@ class Timeline {
98391
98394
  </td>
98392
98395
  </tr>
98393
98396
  </table>
98394
- <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;">
98395
98398
 
98396
98399
  <div class="flex-wrap">
98397
98400
  <div class="flex-wrap" style="margin-right:15px">
@@ -98406,7 +98409,7 @@ class Timeline {
98406
98409
  <option value="section">${out('Section')}</option>
98407
98410
  </select>
98408
98411
  </div>
98409
- <div class="flex-wrap" style="margin-right:30px">
98412
+ <div class="flex-wrap" style="margin-right:20px">
98410
98413
  <button title="${out('Desktop')}" class="input-device on" data-value="" style="width:40px;height:34px;">
98411
98414
  <svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-desktop"></use></svg>
98412
98415
  </button>
@@ -98435,26 +98438,45 @@ class Timeline {
98435
98438
  </div>
98436
98439
  <label for="chkPinOverlap" style="margin:0;display:flex;margin-left:15px">
98437
98440
  <input id="chkPinOverlap" type="checkbox" style="margin:-1px 6px 0 0">
98438
- <span>${out('Overlap')}</span>.
98441
+ <span>${out('Overlap')}</span>
98439
98442
  </label>
98440
98443
  <label for="chkPinDesktopOnly" style="margin:0;display:flex;margin-left:15px">
98441
98444
  <input id="chkPinDesktopOnly" type="checkbox" style="margin:-1px 6px 0 0">
98442
- <span>${out('Widescreen')}</span>.
98445
+ <span>${out('Widescreen')}</span>
98443
98446
  </label>
98444
98447
  </div>
98445
-
98446
98448
  </div>
98447
98449
 
98448
98450
  <div class="flex-wrap" style="">
98449
98451
 
98450
- <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">
98451
98474
  <button title="${out('Disable Easing')}" class="cmd-disable-smoothanim" style="padding-left:15px;padding-right: 15px;">${out('Disable Easing')}</button>
98452
98475
  <button title="${out('Hidden on Start')}" class="cmd-hidden-onstart" style="padding-left:15px;padding-right: 15px;">${out('Hidden on Start')}</button>
98453
98476
  </div>
98454
98477
 
98455
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;">
98456
98479
  <svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg>
98457
- <span style="margin-left:7px">${out('Clear All')}</span>
98458
98480
  </button>
98459
98481
  </div>
98460
98482
 
@@ -98650,6 +98672,8 @@ class Timeline {
98650
98672
  btn.classList.add('on');
98651
98673
  } else {
98652
98674
  section.classList.remove('section-pin');
98675
+ section.classList.remove('pin-space-lg');
98676
+ section.classList.remove('pin-space-xl');
98653
98677
  divPinSpacing.style.display = 'none';
98654
98678
  } //Trigger Change event
98655
98679
 
@@ -98712,6 +98736,19 @@ class Timeline {
98712
98736
  this.builder.onChange();
98713
98737
  });
98714
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
+ });
98715
98752
  const btnDisableSmoothAnim = modalTimeline.querySelector('.cmd-disable-smoothanim');
98716
98753
  btnDisableSmoothAnim.addEventListener('click', () => {
98717
98754
  if (btnDisableSmoothAnim.classList.contains('on')) {
@@ -98954,19 +98991,11 @@ class Timeline {
98954
98991
  this.inpOpacity_2500.value = '';
98955
98992
  this.inpOpacity_2600.value = '';
98956
98993
  this.inpOpacity_2700.value = '';
98957
- this.inpOpacity_2800.value = '';
98958
- const chkPinSection = this.modalTimeline.querySelector('#chkPinSection2');
98959
- chkPinSection.checked = false;
98960
- const divPinSpacing = this.modalTimeline.querySelector('.div-pin-spacing');
98961
- divPinSpacing.style.display = 'none';
98962
- const btnDisableSmoothAnim = this.modalTimeline.querySelector('.cmd-disable-smoothanim');
98963
- btnDisableSmoothAnim.classList.remove('on');
98964
- const btnHiddenOnStart = this.modalTimeline.querySelector('.cmd-hidden-onstart');
98965
- btnHiddenOnStart.classList.remove('on');
98966
- }
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';
98967
98998
 
98968
- read() {
98969
- this.clearSettings();
98970
98999
  const activeSection = this.builder.activeSection;
98971
99000
 
98972
99001
  if (activeSection) {
@@ -99019,10 +99048,39 @@ class Timeline {
99019
99048
  }
99020
99049
  }
99021
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();
99022
99067
  let activeElement;
99023
99068
  let target = this.getTarget();
99024
99069
  activeElement = target.element;
99025
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
+
99026
99084
  const btnDisableSmoothAnim = this.modalTimeline.querySelector('.cmd-disable-smoothanim');
99027
99085
 
99028
99086
  if (activeElement.hasAttribute('data-smooth-scrolling')) {
@@ -99609,6 +99667,13 @@ class Timeline {
99609
99667
  /* /mark device */
99610
99668
 
99611
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
+
99612
99677
  const btnDisableSmoothAnim = this.modalTimeline.querySelector('.cmd-disable-smoothanim');
99613
99678
 
99614
99679
  if (btnDisableSmoothAnim.classList.contains('on')) {
@@ -104645,13 +104710,26 @@ class ContentBox {
104645
104710
  wrapper.style.opacity = '0';
104646
104711
  }
104647
104712
 
104648
- 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) {
104649
104726
  // Wait for the ContentBuilder init complete
104650
104727
  setTimeout(() => {
104651
104728
  this.loadHtml(html);
104652
104729
  }, 100);
104653
104730
  return;
104654
- } // Render html content
104731
+ } // console.log((new this.win.Glide).mount);
104732
+ // Render html content
104655
104733
 
104656
104734
 
104657
104735
  let range = document.createRange();