@innovastudio/contentbox 1.6.86 → 1.6.88

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.86",
4
+ "version": "1.6.88",
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.71",
57
+ "@innovastudio/contentbuilder": "^1.5.74",
58
58
  "js-beautify": "^1.14.0",
59
59
  "sortablejs": "^1.15.2"
60
60
  }
@@ -31693,7 +31693,7 @@ class Util$1 {
31693
31693
  this.builder.uo.saveForUndo();
31694
31694
  let element = elm;
31695
31695
  let newelement;
31696
- if (!element.nextElementSibling) {
31696
+ if (!element.nextElementSibling && !element.closest('[data-subblock]')) {
31697
31697
  // active element is div.display > p.
31698
31698
  let activeCol = this.builder.activeCol;
31699
31699
  let current;
@@ -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
@@ -121473,18 +121471,19 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
121473
121471
  if (snippetData) snippetData.remove();
121474
121472
  if (this.eb) this.eb.destroy();
121475
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);
121476
121477
 
121477
- // document.removeEventListener('click', this.doDocumentClick, false);
121478
- document.removeEventListener('mousedown', this.doDocumentClick);
121479
- document.removeEventListener('touchstart', this.doDocumentClick);
121480
121478
  document.removeEventListener('keydown', this.doDocumentKeydown, false);
121481
121479
  document.removeEventListener('mousedown', this.doDocumentMousedown, false);
121482
121480
  document.removeEventListener('click', this.doRteClick, false);
121483
121481
  this.doc.removeEventListener('click', this.doHideSnippetHandler, false);
121484
121482
  if (this.iframe) {
121485
- // this.doc.removeEventListener('click', this.doDocumentClick, false);
121486
- this.doc.removeEventListener('mousedown', this.doDocumentClick);
121487
- 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
+
121488
121487
  this.doc.removeEventListener('keydown', this.doDocumentKeydown, false);
121489
121488
  this.doc.removeEventListener('mousedown', this.doDocumentMousedown, false);
121490
121489
  this.doc.removeEventListener('click', this.doRteClick, false);
@@ -159815,7 +159814,9 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
159815
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')) {
159816
159815
  if (target.closest('.is-wrapper') && !target.classList.contains('is-wrapper')) {
159817
159816
  // Inside Wrapper
159818
- 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')) {
159819
159820
  // freeform
159820
159821
  // Inside Container
159821
159822
  const box = target.closest('.is-box');
@@ -160010,13 +160011,10 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
160010
160011
  if (!(a || b)) {
160011
160012
  this.sidebar.closeSidebar();
160012
160013
  }
160013
- }; // this.doc.addEventListener('click', this.doDocumentClick);
160014
-
160014
+ };
160015
160015
 
160016
- this.doc.addEventListener('mousedown', this.doDocumentClick);
160017
- this.doc.addEventListener('touchstart', this.doDocumentClick, {
160018
- passive: false
160019
- });
160016
+ this.doc.addEventListener('click', this.doDocumentClick); // this.doc.addEventListener('mousedown', this.doDocumentClick);
160017
+ // this.doc.addEventListener('touchstart', this.doDocumentClick, { passive: false });
160020
160018
 
160021
160019
  if (this.iframe) {
160022
160020
  this.doIframeDocumentClick = e => {
@@ -162095,10 +162093,10 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
162095
162093
  if (this.editor) this.editor.destroy();
162096
162094
  const panel = document.querySelector('#_newbox');
162097
162095
  if (panel) panel.parentNode.removeChild(panel);
162098
- 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);
162099
162099
 
162100
- if (this.doc) this.doc.removeEventListener('mousedown', this.doDocumentClick);
162101
- if (this.doc) this.doc.removeEventListener('touchstart', this.doDocumentClick);
162102
162100
  if (this.iframe) document.removeEventListener('click', this.doIframeDocumentClick, false);
162103
162101
  if (this.doc) this.doc.removeEventListener('click', this.doDocumentKeydown, false);
162104
162102
  if (this.iframe) document.removeEventListener('click', this.doDocumentKeydown, false);