@innovastudio/contentbuilder 1.3.54 → 1.3.55

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/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.3.54",
4
+ "version": "1.3.55",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -77338,7 +77338,9 @@ class ContentBuilder {
77338
77338
  }
77339
77339
 
77340
77340
  handleCellKeydown(col, e) {
77341
+ this.oriLen = col.textContent.length; // get character length
77341
77342
  // Cleanup unwanted span
77343
+
77342
77344
  let spans = col.querySelectorAll('span');
77343
77345
  Array.prototype.forEach.call(spans, span => {
77344
77346
  span.setAttribute('data-keep', '');
@@ -77842,13 +77844,27 @@ class ContentBuilder {
77842
77844
  // jQuery('.cell-active').find('.elm-active').removeClass('elm-active');
77843
77845
  // jQuery("#divElementTool").css("display", "none"); //force hide ellement tool
77844
77846
  // Call onChange to indicate content change
77847
+ // this.opts.onChange();
77848
+ // console.log(this.oriLen,col.textContent.length);
77849
+
77845
77850
 
77851
+ if (this.oriLen !== col.textContent.length) {
77852
+ // check if typing produce/reduce a character
77853
+ this.typing();
77854
+ } // Hide element highlight & tool during typing
77846
77855
 
77847
- this.opts.onChange(); // Hide element highlight & tool during typing
77848
77856
 
77849
77857
  this.elmTool.hide();
77850
77858
  }
77851
77859
 
77860
+ typing() {
77861
+ // console.log('typing');
77862
+ if (this.timeoutId) clearTimeout(this.timeoutId);
77863
+ this.timeoutId = setTimeout(() => {
77864
+ this.opts.onChange();
77865
+ }, 2000);
77866
+ }
77867
+
77852
77868
  handleCellPaste() {
77853
77869
  this.uo.saveForUndo();
77854
77870
  const util = this.util;