@innovastudio/contentbox 1.6.87 → 1.6.89

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
3
  "type": "module",
4
- "version": "1.6.87",
4
+ "version": "1.6.89",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "types": "index.d.ts",
@@ -54,7 +54,7 @@
54
54
  "ws": "^8.13.0"
55
55
  },
56
56
  "dependencies": {
57
- "@innovastudio/contentbuilder": "^1.5.72",
57
+ "@innovastudio/contentbuilder": "^1.5.75",
58
58
  "js-beautify": "^1.14.0",
59
59
  "sortablejs": "^1.15.2"
60
60
  }
@@ -119873,11 +119873,12 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
119873
119873
 
119874
119874
  if (!this.dom.getSelected()) {
119875
119875
  let inputFocused = document.activeElement.tagName.toLowerCase() === 'input';
119876
+ let insideEditable = this.doc.activeElement && this.doc.activeElement.closest('[contenteditable]');
119876
119877
 
119877
119878
  // if(!document.querySelector('.is-modal.active')) { // Additional (to prevent lost focus)
119878
119879
  let openedModal = document.querySelector('.is-modal.active:not(.is-modal-content)');
119879
119880
  if (target.closest('#glightbox-body')) openedModal = true;
119880
- if (!openedModal && !inputFocused) {
119881
+ if (!openedModal && !inputFocused && !insideEditable) {
119881
119882
  // Additional (to prevent lost focus)
119882
119883
 
119883
119884
  util.clearActiveCell();
@@ -119933,17 +119934,14 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
119933
119934
  */
119934
119935
  };
119935
119936
 
119936
- // document.addEventListener('click', this.doDocumentClick);
119937
- document.addEventListener('mousedown', this.doDocumentClick);
119938
- document.addEventListener('touchstart', this.doDocumentClick, {
119939
- passive: false
119940
- });
119937
+ document.addEventListener('click', this.doDocumentClick);
119938
+ // document.addEventListener('mousedown', this.doDocumentClick);
119939
+ // document.addEventListener('touchstart', this.doDocumentClick, { passive: false });
119940
+
119941
119941
  if (this.iframe) {
119942
- // this.doc.addEventListener('click', this.doDocumentClick);
119943
- this.doc.addEventListener('mousedown', this.doDocumentClick);
119944
- this.doc.addEventListener('touchstart', this.doDocumentClick, {
119945
- passive: false
119946
- });
119942
+ this.doc.addEventListener('click', this.doDocumentClick);
119943
+ // this.doc.addEventListener('mousedown', this.doDocumentClick);
119944
+ // this.doc.addEventListener('touchstart', this.doDocumentClick, { passive: false });
119947
119945
  }
119948
119946
 
119949
119947
  // Drag row will hide content tools
@@ -120687,11 +120685,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
120687
120685
  if (!col.getAttribute('data-click')) {
120688
120686
  // ON CLICK
120689
120687
  // Use bind() => https://www.w3schools.com/react/react_events.asp
120690
- // col.addEventListener('click', this.handleCellClick.bind(this, col));
120691
- col.addEventListener('mousedown', this.handleCellClick.bind(this, col));
120692
- col.addEventListener('touchstart', this.handleCellClick.bind(this, col), {
120693
- passive: false
120694
- });
120688
+ col.addEventListener('click', this.handleCellClick.bind(this, col));
120695
120689
 
120696
120690
  // ON KEYPRESS
120697
120691
  col.addEventListener('keydown', this.handleCellKeypress.bind(this));
@@ -121477,18 +121471,19 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
121477
121471
  if (snippetData) snippetData.remove();
121478
121472
  if (this.eb) this.eb.destroy();
121479
121473
  this.doc.body.classList.remove('data-editor');
121474
+ document.removeEventListener('click', this.doDocumentClick, false);
121475
+ // document.removeEventListener('mousedown', this.doDocumentClick);
121476
+ // document.removeEventListener('touchstart', this.doDocumentClick);
121480
121477
 
121481
- // document.removeEventListener('click', this.doDocumentClick, false);
121482
- document.removeEventListener('mousedown', this.doDocumentClick);
121483
- document.removeEventListener('touchstart', this.doDocumentClick);
121484
121478
  document.removeEventListener('keydown', this.doDocumentKeydown, false);
121485
121479
  document.removeEventListener('mousedown', this.doDocumentMousedown, false);
121486
121480
  document.removeEventListener('click', this.doRteClick, false);
121487
121481
  this.doc.removeEventListener('click', this.doHideSnippetHandler, false);
121488
121482
  if (this.iframe) {
121489
- // this.doc.removeEventListener('click', this.doDocumentClick, false);
121490
- this.doc.removeEventListener('mousedown', this.doDocumentClick);
121491
- this.doc.removeEventListener('touchstart', this.doDocumentClick);
121483
+ this.doc.removeEventListener('click', this.doDocumentClick, false);
121484
+ // this.doc.removeEventListener('mousedown', this.doDocumentClick);
121485
+ // this.doc.removeEventListener('touchstart', this.doDocumentClick);
121486
+
121492
121487
  this.doc.removeEventListener('keydown', this.doDocumentKeydown, false);
121493
121488
  this.doc.removeEventListener('mousedown', this.doDocumentMousedown, false);
121494
121489
  this.doc.removeEventListener('click', this.doRteClick, false);
@@ -159819,7 +159814,9 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
159819
159814
  if (!target.closest('#_cbhtml') && !target.closest('.is-box-tool') && !target.closest('.is-box-info') && !target.closest('.is-section-tool') && !target.closest('.is-side') && !target.closest('.keep-selection') && !target.closest('.is-modal') && !target.closest('.is-sidebar')) {
159820
159815
  if (target.closest('.is-wrapper') && !target.classList.contains('is-wrapper')) {
159821
159816
  // Inside Wrapper
159822
- if (target.closest('.is-container') || target.closest('.is-block')) {
159817
+ let insideEditable = this.doc.activeElement && this.doc.activeElement.closest('[contenteditable]');
159818
+
159819
+ if (target.closest('.is-container') || insideEditable || target.closest('.is-block')) {
159823
159820
  // freeform
159824
159821
  // Inside Container
159825
159822
  const box = target.closest('.is-box');
@@ -160014,13 +160011,10 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
160014
160011
  if (!(a || b)) {
160015
160012
  this.sidebar.closeSidebar();
160016
160013
  }
160017
- }; // this.doc.addEventListener('click', this.doDocumentClick);
160014
+ };
160018
160015
 
160019
-
160020
- this.doc.addEventListener('mousedown', this.doDocumentClick);
160021
- this.doc.addEventListener('touchstart', this.doDocumentClick, {
160022
- passive: false
160023
- });
160016
+ this.doc.addEventListener('click', this.doDocumentClick); // this.doc.addEventListener('mousedown', this.doDocumentClick);
160017
+ // this.doc.addEventListener('touchstart', this.doDocumentClick, { passive: false });
160024
160018
 
160025
160019
  if (this.iframe) {
160026
160020
  this.doIframeDocumentClick = e => {
@@ -162099,10 +162093,10 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
162099
162093
  if (this.editor) this.editor.destroy();
162100
162094
  const panel = document.querySelector('#_newbox');
162101
162095
  if (panel) panel.parentNode.removeChild(panel);
162102
- document.body.classList.remove('controlpanel'); // if(this.doc) this.doc.removeEventListener('click', this.doDocumentClick, false);
162096
+ document.body.classList.remove('controlpanel');
162097
+ if (this.doc) this.doc.removeEventListener('click', this.doDocumentClick, false); // if(this.doc) this.doc.removeEventListener('mousedown', this.doDocumentClick);
162098
+ // if(this.doc) this.doc.removeEventListener('touchstart', this.doDocumentClick);
162103
162099
 
162104
- if (this.doc) this.doc.removeEventListener('mousedown', this.doDocumentClick);
162105
- if (this.doc) this.doc.removeEventListener('touchstart', this.doDocumentClick);
162106
162100
  if (this.iframe) document.removeEventListener('click', this.doIframeDocumentClick, false);
162107
162101
  if (this.doc) this.doc.removeEventListener('click', this.doDocumentKeydown, false);
162108
162102
  if (this.iframe) document.removeEventListener('click', this.doDocumentKeydown, false);