@innovastudio/contentbox 1.6.77 → 1.6.78

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.77",
4
+ "version": "1.6.78",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -1,3 +1,5 @@
1
+ /* @import url("../icons/bootstrap-icons.min.css"); */
2
+ @import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");
1
3
  /* IFRAME */
2
4
  .is-content-view.desktop-lg {
3
5
  width: 1920px;
@@ -9025,7 +9025,7 @@ class Text {
9025
9025
  const config = this.builder.cssClasses;
9026
9026
  let activeElement = this.builder.controlpanel.activeElement;
9027
9027
 
9028
- if (activeElement.tagName.toLowerCase() === 'div' && (activeElement.classList.contains('text-left') || activeElement.classList.contains('text-center') || activeElement.classList.contains('text-right') || activeElement.classList.contains('text-justify'))) {
9028
+ if (activeElement.tagName.toLowerCase() === 'div' && (activeElement.classList.contains(config.textAlign.left) || activeElement.classList.contains(config.textAlign.center) || activeElement.classList.contains(config.textAlign.right) || activeElement.classList.contains(config.textAlign.justify))) {
9029
9029
  // div with icon or svg inside
9030
9030
  let elm = activeElement;
9031
9031
  elm.classList.remove(config.textAlign.left);
@@ -11275,13 +11275,14 @@ class PanelText {
11275
11275
  const blocks = this.text.getSelectedBlocks(true);
11276
11276
 
11277
11277
  if (blocks.length === 1) {
11278
+ const config = this.builder.cssClasses;
11278
11279
  this.panel.querySelectorAll('[data-align]').forEach(elm => elm.classList.remove('on'));
11279
11280
 
11280
- if (activeElement.classList.contains('text-left')) {
11281
+ if (activeElement.classList.contains(config.textAlign.left)) {
11281
11282
  this.panel.querySelector('button[data-align=left]').classList.add('on');
11282
- } else if (activeElement.classList.contains('text-center')) {
11283
+ } else if (activeElement.classList.contains(config.textAlign.center)) {
11283
11284
  this.panel.querySelector('button[data-align=center]').classList.add('on');
11284
- } else if (activeElement.classList.contains('text-right')) {
11285
+ } else if (activeElement.classList.contains(config.textAlign.right)) {
11285
11286
  this.panel.querySelector('button[data-align=right]').classList.add('on');
11286
11287
  }
11287
11288
  }
@@ -25662,7 +25663,7 @@ class ControlPanel {
25662
25663
  }
25663
25664
  }
25664
25665
 
25665
- open_() {
25666
+ open_(what) {
25666
25667
  const viewportWidth = document.documentElement.clientWidth;
25667
25668
 
25668
25669
  if (viewportWidth <= 1322) {
@@ -25683,8 +25684,13 @@ class ControlPanel {
25683
25684
  }, 300);
25684
25685
  this.getActive(); // Show/hide panel
25685
25686
 
25686
- if (this.activeElement) this.select('element');else if (this.activeBlock) this.select('block'); // freeform
25687
- else if (!this.activeElement && !this.activeColumn && !this.activeRow && this.activeBox) this.select('box');else this.select('');
25687
+ if (what) {
25688
+ this.select(what);
25689
+ } else {
25690
+ if (this.activeElement) this.select('element');else if (this.activeBlock) this.select('block'); // freeform
25691
+ else if (!this.activeElement && !this.activeColumn && !this.activeRow && this.activeBox) this.select('box');else this.select('');
25692
+ }
25693
+
25688
25694
  this.repositionTool(); // Sync with external buttons
25689
25695
 
25690
25696
  let btns = document.querySelectorAll('[data-state="togglepanel"]');
@@ -26099,7 +26105,7 @@ class ControlPanel {
26099
26105
 
26100
26106
  if (what === 'element' || what === 'column' || what === 'row' || what === 'box' || what === 'section') {
26101
26107
  if (document.body.classList.contains('controlpanel')) ; else {
26102
- this.open_(); // Force open
26108
+ this.open_(what); // Force open
26103
26109
  }
26104
26110
  }
26105
26111