@innovastudio/contentbox 1.2.34 → 1.2.37

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.2.34",
3
+ "version": "1.2.37",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
@@ -46,7 +46,7 @@
46
46
  "webpack-dev-server": "^4.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@innovastudio/contentbuilder": "^1.1.26",
49
+ "@innovastudio/contentbuilder": "^1.1.28",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -9006,7 +9006,8 @@ class EditBox {
9006
9006
  dom$K.removeClass(activeBox, 'is-slideInLeft');
9007
9007
  dom$K.removeClass(activeBox, 'is-slideInRight');
9008
9008
  dom$K.removeClass(activeBox, 'is-zoomIn');
9009
- dom$K.removeClass(activeBox, 'animated');
9009
+ dom$K.removeClass(activeBox, 'animated'); //clean old
9010
+
9010
9011
  dom$K.removeClass(activeBox, 'pulse');
9011
9012
  dom$K.removeClass(activeBox, 'bounceIn');
9012
9013
  dom$K.removeClass(activeBox, 'fadeIn');
@@ -9021,17 +9022,29 @@ class EditBox {
9021
9022
  dom$K.removeClass(activeBox, 'slideInLeft');
9022
9023
  dom$K.removeClass(activeBox, 'slideInRight');
9023
9024
  dom$K.removeClass(activeBox, 'zoomIn');
9025
+ activeBox.removeAttribute('data-scroll');
9026
+ dom$K.removeClass(activeBox, 'is-inview');
9024
9027
 
9025
9028
  if (selBoxAnimate.value !== '') {
9026
9029
  dom$K.addClass(activeBox, 'is-animated');
9027
9030
  dom$K.addClass(activeBox, selBoxAnimate.value);
9028
- dom$K.addClass(activeBox, 'animated');
9029
- dom$K.addClass(activeBox, selBoxAnimate.value.substr(3));
9030
- dom$K.removeClass(activeBox, 'box-active'); //need this to make animation work
9031
- } //Trigger Change event
9031
+ activeBox.style.transition = 'none';
9032
+ activeBox.style.opacity = 0;
9033
+ setTimeout(() => {
9034
+ activeBox.style.transition = '';
9035
+ activeBox.style.opacity = '';
9036
+ activeBox.setAttribute('data-scroll', ''); //Trigger Change event
9032
9037
 
9038
+ this.builder.settings.onChange(); //Trigger Render event
9033
9039
 
9034
- this.builder.settings.onChange();
9040
+ this.builder.settings.onRender(); // a must!!
9041
+ }, 30);
9042
+ } else {
9043
+ //Trigger Change event
9044
+ this.builder.settings.onChange(); //Trigger Render event
9045
+
9046
+ this.builder.settings.onRender();
9047
+ }
9035
9048
  });
9036
9049
  const btnBoxAnimateTest = modalEditBox.querySelector('.cmd-box-animate-test');
9037
9050
  btnBoxAnimateTest.addEventListener('click', () => {
@@ -9051,28 +9064,39 @@ class EditBox {
9051
9064
  dom$K.removeClass(activeBox, 'slideInLeft');
9052
9065
  dom$K.removeClass(activeBox, 'slideInRight');
9053
9066
  dom$K.removeClass(activeBox, 'zoomIn');
9054
- setTimeout(function () {
9055
- dom$K.addClass(activeBox, 'animated');
9056
- dom$K.addClass(activeBox, selBoxAnimate.value.substr(3));
9057
- dom$K.removeClass(activeBox, 'box-active'); //need this to make animation work
9058
- }, 50); //Trigger Change event
9067
+ activeBox.removeAttribute('data-scroll');
9068
+ dom$K.removeClass(activeBox, 'is-inview');
9059
9069
 
9060
- this.builder.settings.onChange();
9070
+ if (selBoxAnimate.value !== '') {
9071
+ dom$K.addClass(activeBox, 'is-animated');
9072
+ dom$K.addClass(activeBox, selBoxAnimate.value);
9073
+ activeBox.style.transition = 'none';
9074
+ activeBox.style.opacity = 0;
9075
+ setTimeout(() => {
9076
+ activeBox.style.transition = '';
9077
+ activeBox.style.opacity = '';
9078
+ activeBox.setAttribute('data-scroll', '');
9079
+ this.builder.settings.onChange();
9080
+ this.builder.settings.onRender(); // a must!!
9081
+ }, 30);
9082
+ } else {
9083
+ this.builder.settings.onChange();
9084
+ this.builder.settings.onRender();
9085
+ }
9061
9086
  });
9062
9087
  const chkAnimateOnce = modalEditBox.querySelector('#chkAnimOnce');
9063
9088
  chkAnimateOnce.addEventListener('click', () => {
9064
9089
  const activeBox = this.builder.activeBox;
9065
9090
  this.builder.editor.saveForUndo();
9066
- activeBox.setAttribute('data-animated', '');
9067
9091
 
9068
9092
  if (chkAnimateOnce.checked) {
9069
9093
  dom$K.addClass(activeBox, 'once');
9070
9094
  } else {
9071
9095
  dom$K.removeClass(activeBox, 'once');
9072
- } //Trigger Change event
9073
-
9096
+ }
9074
9097
 
9075
9098
  this.builder.settings.onChange();
9099
+ this.builder.settings.onRender();
9076
9100
  });
9077
9101
  const selBoxAnimateDelay = modalEditBox.querySelector('.cmd-box-animatedelay');
9078
9102
  selBoxAnimateDelay.addEventListener('change', () => {
@@ -83659,8 +83683,12 @@ class ContentBox {
83659
83683
  maxColumns: 6,
83660
83684
  maxEmbedImageWidth: this.settings.maxEmbedImageWidth,
83661
83685
  slider: this.settings.slider,
83662
- onRender: this.settings.onRender,
83663
- onChange: this.settings.onChange,
83686
+ onRender: () => {
83687
+ this.settings.onRender();
83688
+ },
83689
+ onChange: () => {
83690
+ this.settings.onChange();
83691
+ },
83664
83692
  onRefreshTool: () => {
83665
83693
  setTimeout(() => {
83666
83694
  this.quickPosTool();