@innovastudio/contentbox 1.6.85 → 1.6.87

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.6.85",
4
+ "version": "1.6.87",
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.70",
57
+ "@innovastudio/contentbuilder": "^1.5.72",
58
58
  "js-beautify": "^1.14.0",
59
59
  "sortablejs": "^1.15.2"
60
60
  }
@@ -25699,7 +25699,11 @@ class ControlPanel {
25699
25699
  }
25700
25700
 
25701
25701
  open() {
25702
- if (this.builder.disableAutoOpenEditPanel) return;
25702
+ if (this.builder.autoOpenPanel) ; else {
25703
+ // Manual open
25704
+ if (this.builder.disableAutoOpenEditPanel) return;
25705
+ }
25706
+
25703
25707
  this.open_();
25704
25708
  }
25705
25709
 
@@ -25711,9 +25715,12 @@ class ControlPanel {
25711
25715
  }, 300);
25712
25716
  this.repositionTool();
25713
25717
 
25714
- if (document.querySelector('[data-button="togglepanel"]')) {
25715
- // If toggle button exists
25716
- this.builder.disableAutoOpenEditPanel = true;
25718
+ if (this.builder.autoOpenPanel) ; else {
25719
+ // Manual open (only if toggle button exists)
25720
+ if (document.querySelector('[data-button="togglepanel"]')) {
25721
+ // If toggle button exists
25722
+ this.builder.disableAutoOpenEditPanel = true; // Set manual opening
25723
+ }
25717
25724
  } // Sync with external buttons
25718
25725
 
25719
25726
 
@@ -31686,7 +31693,7 @@ class Util$1 {
31686
31693
  this.builder.uo.saveForUndo();
31687
31694
  let element = elm;
31688
31695
  let newelement;
31689
- if (!element.nextElementSibling) {
31696
+ if (!element.nextElementSibling && !element.closest('[data-subblock]')) {
31690
31697
  // active element is div.display > p.
31691
31698
  let activeCol = this.builder.activeCol;
31692
31699
  let current;
@@ -119793,7 +119800,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
119793
119800
  };
119794
119801
 
119795
119802
  // Add document Click event
119796
- document.addEventListener('click', this.doDocumentClick = e => {
119803
+ this.doDocumentClick = e => {
119797
119804
  let target = e.target;
119798
119805
  if (!target) return;
119799
119806
  rteClick(e);
@@ -119924,10 +119931,19 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
119924
119931
  });
119925
119932
  }
119926
119933
  */
119927
- });
119934
+ };
119928
119935
 
119936
+ // document.addEventListener('click', this.doDocumentClick);
119937
+ document.addEventListener('mousedown', this.doDocumentClick);
119938
+ document.addEventListener('touchstart', this.doDocumentClick, {
119939
+ passive: false
119940
+ });
119929
119941
  if (this.iframe) {
119930
- this.doc.addEventListener('click', this.doDocumentClick);
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
+ });
119931
119947
  }
119932
119948
 
119933
119949
  // Drag row will hide content tools
@@ -120671,7 +120687,11 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
120671
120687
  if (!col.getAttribute('data-click')) {
120672
120688
  // ON CLICK
120673
120689
  // Use bind() => https://www.w3schools.com/react/react_events.asp
120674
- col.addEventListener('click', this.handleCellClick.bind(this, col));
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
+ });
120675
120695
 
120676
120696
  // ON KEYPRESS
120677
120697
  col.addEventListener('keydown', this.handleCellKeypress.bind(this));
@@ -121457,13 +121477,18 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
121457
121477
  if (snippetData) snippetData.remove();
121458
121478
  if (this.eb) this.eb.destroy();
121459
121479
  this.doc.body.classList.remove('data-editor');
121460
- document.removeEventListener('click', this.doDocumentClick, false);
121480
+
121481
+ // document.removeEventListener('click', this.doDocumentClick, false);
121482
+ document.removeEventListener('mousedown', this.doDocumentClick);
121483
+ document.removeEventListener('touchstart', this.doDocumentClick);
121461
121484
  document.removeEventListener('keydown', this.doDocumentKeydown, false);
121462
121485
  document.removeEventListener('mousedown', this.doDocumentMousedown, false);
121463
121486
  document.removeEventListener('click', this.doRteClick, false);
121464
121487
  this.doc.removeEventListener('click', this.doHideSnippetHandler, false);
121465
121488
  if (this.iframe) {
121466
- this.doc.removeEventListener('click', this.doDocumentClick, false);
121489
+ // this.doc.removeEventListener('click', this.doDocumentClick, false);
121490
+ this.doc.removeEventListener('mousedown', this.doDocumentClick);
121491
+ this.doc.removeEventListener('touchstart', this.doDocumentClick);
121467
121492
  this.doc.removeEventListener('keydown', this.doDocumentKeydown, false);
121468
121493
  this.doc.removeEventListener('mousedown', this.doDocumentMousedown, false);
121469
121494
  this.doc.removeEventListener('click', this.doRteClick, false);
@@ -159787,7 +159812,7 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
159787
159812
  }
159788
159813
  }); // Add document Click event
159789
159814
 
159790
- this.doc.addEventListener('click', this.doDocumentClick = e => {
159815
+ this.doDocumentClick = e => {
159791
159816
  e = e || window.event;
159792
159817
  var target = e.target || e.srcElement; //--- New UX ---
159793
159818
 
@@ -159989,10 +160014,16 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
159989
160014
  if (!(a || b)) {
159990
160015
  this.sidebar.closeSidebar();
159991
160016
  }
160017
+ }; // this.doc.addEventListener('click', this.doDocumentClick);
160018
+
160019
+
160020
+ this.doc.addEventListener('mousedown', this.doDocumentClick);
160021
+ this.doc.addEventListener('touchstart', this.doDocumentClick, {
160022
+ passive: false
159992
160023
  });
159993
160024
 
159994
160025
  if (this.iframe) {
159995
- document.addEventListener('click', this.doDocumentClick = e => {
160026
+ this.doIframeDocumentClick = e => {
159996
160027
  e = e || window.event;
159997
160028
  var target = e.target || e.srcElement;
159998
160029
  if (!document.body.contains(target)) return; // in case element/target has been deleted (not exists)
@@ -160077,7 +160108,9 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
160077
160108
  if (!(a || b)) {
160078
160109
  this.sidebar.closeSidebar();
160079
160110
  }
160080
- });
160111
+ };
160112
+
160113
+ document.addEventListener('click', this.doIframeDocumentClick);
160081
160114
  }
160082
160115
 
160083
160116
  document.addEventListener('keydown', this.doDocumentKeydown = e => {
@@ -162066,9 +162099,11 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
162066
162099
  if (this.editor) this.editor.destroy();
162067
162100
  const panel = document.querySelector('#_newbox');
162068
162101
  if (panel) panel.parentNode.removeChild(panel);
162069
- document.body.classList.remove('controlpanel');
162070
- if (this.doc) this.doc.removeEventListener('click', this.doDocumentClick, false);
162071
- if (this.iframe) document.removeEventListener('click', this.doDocumentClick, false);
162102
+ document.body.classList.remove('controlpanel'); // if(this.doc) this.doc.removeEventListener('click', this.doDocumentClick, false);
162103
+
162104
+ if (this.doc) this.doc.removeEventListener('mousedown', this.doDocumentClick);
162105
+ if (this.doc) this.doc.removeEventListener('touchstart', this.doDocumentClick);
162106
+ if (this.iframe) document.removeEventListener('click', this.doIframeDocumentClick, false);
162072
162107
  if (this.doc) this.doc.removeEventListener('click', this.doDocumentKeydown, false);
162073
162108
  if (this.iframe) document.removeEventListener('click', this.doDocumentKeydown, false);
162074
162109
  if (this.doc) this.doc.removeEventListener('scroll', this.doAnimWheel, false);