@innovastudio/contentbox 1.6.76 → 1.6.78

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.76",
4
+ "version": "1.6.78",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -52,7 +52,7 @@
52
52
  "ws": "^8.13.0"
53
53
  },
54
54
  "dependencies": {
55
- "@innovastudio/contentbuilder": "^1.5.68",
55
+ "@innovastudio/contentbuilder": "^1.5.69",
56
56
  "js-beautify": "^1.14.0",
57
57
  "sortablejs": "^1.15.2"
58
58
  }
@@ -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
 
@@ -27216,6 +27222,11 @@ class Snippets {
27216
27222
 
27217
27223
  var snippets = data_basic.snippets; //DATA
27218
27224
 
27225
+ ${!this.builder.canvas && !this.builder.isContentBox ? `
27226
+ const canvasFilter = (item) => (item.mode!=='canvas');
27227
+ snippets = snippets.filter(canvasFilter);
27228
+ ` : ''}
27229
+
27219
27230
  if (slider !== null){
27220
27231
  if(slider==='slick') {
27221
27232
  //remove glide
@@ -27445,6 +27456,12 @@ class Snippets {
27445
27456
  if(snippets[i].id + ''=== snippetid) {
27446
27457
 
27447
27458
  var html = snippets[i].html;
27459
+
27460
+ // check if is block
27461
+ if(html.includes('"is-block')) {
27462
+ html = snippets[i].html2;
27463
+ }
27464
+
27448
27465
  var noedit = snippets[i].noedit;
27449
27466
  break;
27450
27467
  }
@@ -75347,9 +75364,10 @@ class Hyperlink {
75347
75364
  linkTool.style.top = top - h - 3 + 'px';
75348
75365
  linkTool.style.left = left + link.offsetWidth * this.builder.opts.zoom - w + 'px';
75349
75366
  const handleLinkButtonClick = e => {
75367
+ const clrPicker = document.querySelector('.pop-picker.active') || document.querySelector('.pickgradientcolor.active');
75350
75368
  let elm = e.target;
75351
75369
  if (!elm) return;
75352
- if (!elm.closest('#divLinkTool') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('a')) {
75370
+ if (!elm.closest('#divLinkTool') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('a') && !clrPicker) {
75353
75371
  // click outside
75354
75372
 
75355
75373
  this.hideTool();
@@ -75475,6 +75493,7 @@ class Button {
75475
75493
  const contentStuff = this.builder.contentStuff;
75476
75494
  const dom = this.builder.dom;
75477
75495
  this.dom = dom;
75496
+ this.builderStuff = builderStuff;
75478
75497
  let buttonTool = builderStuff.querySelector('#divButtonTool');
75479
75498
  if (!buttonTool) {
75480
75499
  let html = `<div id="divButtonTool" class="is-tool">
@@ -75546,9 +75565,10 @@ class Button {
75546
75565
  this.renderTool();
75547
75566
  this.showTool(btn);
75548
75567
  const handleButtonClick = e => {
75568
+ const clrPicker = document.querySelector('.pop-picker.active') || document.querySelector('.pickgradientcolor.active');
75549
75569
  let elm = e.target;
75550
75570
  if (!elm) return;
75551
- if (!elm.closest('#divButtonTool') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('button')) {
75571
+ if (!elm.closest('#divButtonTool') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('button') && !clrPicker) {
75552
75572
  // click outside
75553
75573
 
75554
75574
  // hide
@@ -76750,9 +76770,11 @@ class Table {
76750
76770
  this.realtime();
76751
76771
  const handleTableClick = e => {
76752
76772
  // console.log('handleTableClick');
76773
+
76774
+ const clrPicker = document.querySelector('.pop-picker.active') || document.querySelector('.pickgradientcolor.active');
76753
76775
  let elm = e.target;
76754
76776
  if (!elm) return;
76755
- if (!elm.closest('.is-table-tool') && !elm.closest('.is-sidebar') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('table')) {
76777
+ if (!elm.closest('.is-table-tool') && !elm.closest('.is-sidebar') && !elm.closest('.is-modal') && !elm.closest('.keep-selection') && !elm.closest('table') && !clrPicker) {
76756
76778
  // click outside
76757
76779
 
76758
76780
  // hide