@innovastudio/contentbox 1.6.168 → 1.6.169

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.168",
4
+ "version": "1.6.169",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "types": "index.d.ts",
@@ -52,14 +52,14 @@
52
52
  "rollup-plugin-terser": "^7.0.2",
53
53
  "sass": "^1.38.1",
54
54
  "sass-loader": "^12.1.0",
55
- "sharp": "^0.30.3",
55
+ "sharp": "^0.34.4",
56
56
  "webpack": "^5.51.1",
57
57
  "webpack-cli": "^4.8.0",
58
58
  "webpack-dev-server": "^4.0.0",
59
59
  "ws": "^8.13.0"
60
60
  },
61
61
  "dependencies": {
62
- "@innovastudio/contentbuilder": "^1.5.166",
62
+ "@innovastudio/contentbuilder": "^1.5.173",
63
63
  "js-beautify": "^1.14.0",
64
64
  "sortablejs": "^1.15.2"
65
65
  }
@@ -10321,12 +10321,17 @@ class Text {
10321
10321
  const anchorNode = selection.anchorNode;
10322
10322
  if (!anchorNode) return false;
10323
10323
  let container = anchorNode.nodeType !== Node.TEXT_NODE && anchorNode.nodeType !== Node.COMMENT_NODE ? anchorNode : anchorNode.parentElement;
10324
+
10325
+ if (container && container.closest('.is-overlay') && this.builder.controlpanel.activeElement) {
10326
+ return this.builder.controlpanel.activeElement; // container => is-overlay when drag & drop bloxk
10327
+ }
10324
10328
  /*
10325
10329
  There is a strange behavior that when clicking an icon i.icon and then clicking its div wrapper,
10326
10330
  the window.getSelection stays on the icon, not the div.
10327
10331
  To fix this, we check icon selection and compare it with the actual clicked element
10328
10332
  */
10329
10333
 
10334
+
10330
10335
  if (container && container.classList.contains('icon') && this.builder.editor.inspectedElement) {
10331
10336
  if (container !== this.builder.editor.inspectedElement) {
10332
10337
  container = this.builder.editor.inspectedElement;
@@ -12327,7 +12332,7 @@ class SettingsUIGenerator$1 {
12327
12332
 
12328
12333
  if (!plugin || !plugin.settings) {
12329
12334
  // console.warn(`Plugin "${pluginName}" has no settings schema`);
12330
- return this.createEmptyForm();
12335
+ if (!plugin.editor) return this.createEmptyForm();
12331
12336
  }
12332
12337
 
12333
12338
  const form = document.createElement('div');
@@ -22747,8 +22752,8 @@ class SpacingContainer {
22747
22752
  <button title="110" data-topspacing="11">110</button>
22748
22753
  <button title="120" data-topspacing="12">120</button>
22749
22754
  <button title="140" data-topspacing="14">140</button>
22750
- <!--<button title="160" data-topspacing="16">160</button>
22751
- <button title="200" data-topspacing="20">200</button>-->
22755
+ <button title="160" data-topspacing="16">160</button>
22756
+ <button title="200" data-topspacing="20">200</button>
22752
22757
  <button title="${out('Clear')}" data-topspacing=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
22753
22758
  </div>
22754
22759
 
@@ -22771,6 +22776,8 @@ class SpacingContainer {
22771
22776
  <button title="110" data-bottomspacing="11">110</button>
22772
22777
  <button title="120" data-bottomspacing="12">120</button>
22773
22778
  <button title="140" data-bottomspacing="14">140</button>
22779
+ <button title="160" data-bottomspacing="16">160</button>
22780
+ <button title="200" data-bottomspacing="20">200</button>
22774
22781
  <button title="${out('Clear')}" data-bottomspacing=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
22775
22782
  </div>
22776
22783
 
@@ -22793,6 +22800,8 @@ class SpacingContainer {
22793
22800
  <button title="110" data-leftspacing="11">110</button>
22794
22801
  <button title="120" data-leftspacing="12">120</button>
22795
22802
  <button title="140" data-leftspacing="14">140</button>
22803
+ <button title="160" data-leftspacing="16">160</button>
22804
+ <button title="200" data-leftspacing="20">200</button>
22796
22805
  <button title="${out('Clear')}" data-leftspacing=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
22797
22806
  </div>
22798
22807
 
@@ -22815,6 +22824,8 @@ class SpacingContainer {
22815
22824
  <button title="110" data-rightspacing="11">110</button>
22816
22825
  <button title="120" data-rightspacing="12">120</button>
22817
22826
  <button title="140" data-rightspacing="14">140</button>
22827
+ <button title="160" data-rightspacing="16">160</button>
22828
+ <button title="200" data-rightspacing="20">200</button>
22818
22829
  <button title="${out('Clear')}" data-rightspacing=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
22819
22830
  </div>
22820
22831
  </div>
@@ -25271,7 +25282,7 @@ class Element$2 {
25271
25282
 
25272
25283
  getDeviceTarget(divTarget) {
25273
25284
  const btn = divTarget.querySelector('button.on');
25274
- return btn.getAttribute('data-device');
25285
+ if (btn) return btn.getAttribute('data-device');else return '';
25275
25286
  }
25276
25287
 
25277
25288
  realtimeVisibility(elm) {
@@ -27117,6 +27128,9 @@ class ControlPanel {
27117
27128
  } else if (element.classList.contains('ovl')) {
27118
27129
  element = element.parentNode.querySelector('iframe');
27119
27130
  this.activeElement = element;
27131
+ } else if (element.classList.contains('embed-responsive')) {
27132
+ element = element.parentNode.querySelector('iframe');
27133
+ this.activeElement = element;
27120
27134
  }
27121
27135
 
27122
27136
  if (element.closest('[data-html]') && !element.closest('[data-subblock]')) {
@@ -27147,7 +27161,7 @@ class ControlPanel {
27147
27161
  } else {
27148
27162
  if (element.querySelector('.icon') && element.childElementCount === 1) ;
27149
27163
 
27150
- if (element.closest('[data-cb-type]')) {
27164
+ if (element.closest('[data-cb-type]') && !element.closest('.is-subblock')) {
27151
27165
  const runtime = this.builder.win.builderRuntime;
27152
27166
 
27153
27167
  if (runtime) {
@@ -32944,13 +32958,24 @@ class Util$1 {
32944
32958
  element.click();
32945
32959
  }
32946
32960
  }
32961
+ let editingInsidePlugin = false;
32962
+ let elm = this.builder.activeElement;
32963
+ const plugin = elm.closest('[data-cb-type]');
32964
+ const subblock = elm.closest('.is-subblock');
32965
+ if (plugin && subblock) {
32966
+ editingInsidePlugin = true;
32967
+ }
32947
32968
  if (mode === 'elm') {
32948
32969
  let elm = this.builder.activeElement; // See elementtool.js line 195-196. // document.querySelector('.elm-active');
32949
32970
  if (!elm) return;
32950
32971
  this.builder.uo.saveForUndo();
32951
32972
  let element = elm;
32952
32973
  let newelement;
32953
- if (!element.nextElementSibling && !element.closest('[data-subblock]')) {
32974
+ const plugin = element.closest('[data-cb-type]');
32975
+ if (plugin) {
32976
+ element.insertAdjacentHTML('afterend', html);
32977
+ newelement = element.nextElementSibling;
32978
+ } else if (!element.nextElementSibling && !element.closest('[data-subblock]')) {
32954
32979
  // active element is div.display > p.
32955
32980
  let activeCol = this.builder.activeCol;
32956
32981
  let current;
@@ -33004,7 +33029,7 @@ class Util$1 {
33004
33029
  this.builder.opts.onRender();
33005
33030
 
33006
33031
  // Reinit after drag drop block
33007
- if (this.builder.win.builderRuntime) this.builder.win.builderRuntime.reinitialize();
33032
+ if (this.builder.win.builderRuntime && !editingInsidePlugin) this.builder.win.builderRuntime.reinitialize();
33008
33033
  setTimeout(() => {
33009
33034
  this.builder.makeSortable(this.builder.doc);
33010
33035
  }, 400);
@@ -42493,17 +42518,32 @@ class HtmlUtil {
42493
42518
  grid = element.querySelector('.grid-sortable');
42494
42519
  }
42495
42520
  element.removeAttribute('id');
42521
+
42522
+ // Clean index in sortable grid
42496
42523
  if (grid) {
42497
42524
  Array.from(grid.children).forEach(elm => {
42498
42525
  elm.removeAttribute('data-index');
42499
42526
  elm.removeAttribute('data-item-id');
42500
42527
  });
42501
42528
  }
42502
- const elms = element.querySelectorAll('[data-scroll], [data-scroll-once]');
42529
+
42530
+ // Clean data-edit-id in editable area
42531
+ let editables = element.querySelectorAll('.edit');
42532
+ editables.forEach(area => {
42533
+ area.removeAttribute('data-edit-id');
42534
+ });
42535
+ let elms = element.querySelectorAll('[data-scroll], [data-scroll-once]');
42503
42536
  elms.forEach(elm => {
42504
42537
  elm.removeAttribute('data-scroll');
42505
42538
  elm.removeAttribute('data-scroll-once');
42506
42539
  });
42540
+ elms = element.querySelectorAll('.elm-active, .icon-active');
42541
+ elms.forEach(elm => {
42542
+ elm.classList.remove('elm-active');
42543
+ elm.classList.remove('icon-active');
42544
+ });
42545
+ const oldEditables = element.querySelectorAll('[contenteditable="true"]');
42546
+ oldEditables.forEach(el => el.removeAttribute('contenteditable'));
42507
42547
  });
42508
42548
  html = '';
42509
42549
  if (multiple) {
@@ -74960,6 +75000,8 @@ class ButtonEditor {
74960
75000
  <span>${util.out('Padding Left/Right')}</span>:
74961
75001
  </div>
74962
75002
  <div class="flex flex-row" style="margin-top:5px">
75003
+ <button title="2" data-command="0" class="paddingx-command" style="margin-right:4px">0</button>
75004
+ <button title="2" data-command="1" class="paddingx-command" style="margin-right:4px">1</button>
74963
75005
  <button title="2" data-command="2" class="paddingx-command" style="margin-right:4px">2</button>
74964
75006
  <button title="3" data-command="3" class="paddingx-command" style="margin-right:4px">3</button>
74965
75007
  <button title="4" data-command="4" class="paddingx-command" style="margin-right:4px">4</button>
@@ -75465,6 +75507,12 @@ class ButtonEditor {
75465
75507
  const val = btn.getAttribute('data-command');
75466
75508
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton || this.builder.activeLink;
75467
75509
  dom.removeClassesByPrefix(activeButton, 'px-');
75510
+ if (val === '0') {
75511
+ dom.addClass(activeButton, 'px-0');
75512
+ }
75513
+ if (val === '1') {
75514
+ dom.addClass(activeButton, 'px-1');
75515
+ }
75468
75516
  if (val === '2') {
75469
75517
  dom.addClass(activeButton, 'px-2');
75470
75518
  }
@@ -76532,6 +76580,144 @@ class ButtonEditor {
76532
76580
  bg: 'rgba(191, 245, 110, 1)',
76533
76581
  hoverBg: 'rgba(183, 236, 103, 1)'
76534
76582
  },
76583
+ // Square buttons
76584
+ {
76585
+ type: 'solid',
76586
+ shape: 'square',
76587
+ text: 'Read More',
76588
+ color: 'rgb(24, 24, 27)',
76589
+ bg: 'transparent',
76590
+ hoverBg: 'transparent',
76591
+ customClasses: 'underline px-0'
76592
+ }, {
76593
+ type: 'outline',
76594
+ shape: 'square',
76595
+ text: 'Read More'
76596
+ }, {
76597
+ type: 'solid',
76598
+ shape: 'square',
76599
+ text: 'Read More',
76600
+ color: 'rgb(24, 24, 27)',
76601
+ bg: 'rgb(240, 240, 241)',
76602
+ hoverBg: 'rgb(236, 236, 238)'
76603
+ }, {
76604
+ type: 'solid',
76605
+ shape: 'square',
76606
+ text: 'Read More',
76607
+ color: 'rgb(250, 250, 250)',
76608
+ bg: 'rgb(24, 24, 27)',
76609
+ hoverBg: 'rgb(63, 63, 70)'
76610
+ }, {
76611
+ type: 'outline',
76612
+ shape: 'square',
76613
+ text: 'Read More',
76614
+ color: 'rgb(250, 250, 250)',
76615
+ bg: 'transparent',
76616
+ hoverBg: 'transparent'
76617
+ }, {
76618
+ type: 'solid',
76619
+ shape: 'square',
76620
+ text: 'Read More',
76621
+ color: '#ffffff',
76622
+ bg: 'rgba(13, 151, 255, 1)',
76623
+ hoverBg: 'rgba(7, 138, 237, 1)'
76624
+ }, {
76625
+ type: 'solid',
76626
+ shape: 'square',
76627
+ text: 'Read More',
76628
+ color: '#ffffff',
76629
+ bg: '#3b82f6',
76630
+ hoverBg: 'rgba(47, 116, 228, 1)'
76631
+ }, {
76632
+ type: 'solid',
76633
+ shape: 'square',
76634
+ text: 'Read More',
76635
+ color: 'rgb(24, 24, 27)',
76636
+ bg: '#fff',
76637
+ hoverBg: 'rgba(248, 248, 250, 1)'
76638
+ },
76639
+ // Colors
76640
+ {
76641
+ type: 'solid',
76642
+ shape: 'square',
76643
+ size: 'medium',
76644
+ text: 'Read More',
76645
+ color: 'rgb(24, 24, 27)',
76646
+ bg: 'rgba(111, 235, 255, 1)',
76647
+ hoverBg: 'rgba(98, 230, 252, 1)'
76648
+ }, {
76649
+ type: 'solid',
76650
+ shape: 'square',
76651
+ size: 'medium',
76652
+ text: 'Read More',
76653
+ color: '#ffffff',
76654
+ bg: 'rgba(19, 166, 27, 1)',
76655
+ hoverBg: 'rgba(17, 155, 25, 1)'
76656
+ }, {
76657
+ type: 'solid',
76658
+ shape: 'square',
76659
+ size: 'medium',
76660
+ text: 'Read More',
76661
+ color: 'rgb(24, 24, 27)',
76662
+ bg: 'rgba(254, 235, 101, 1)',
76663
+ hoverBg: 'rgba(249, 229, 85, 1)'
76664
+ }, {
76665
+ type: 'solid',
76666
+ shape: 'square',
76667
+ size: 'medium',
76668
+ text: 'Read More',
76669
+ color: '#ffffff',
76670
+ bg: 'rgba(251, 45, 45, 1)',
76671
+ hoverBg: 'rgba(239, 38, 36, 1)'
76672
+ }, {
76673
+ type: 'solid',
76674
+ shape: 'square',
76675
+ size: 'medium',
76676
+ text: 'Read More',
76677
+ color: '#ffffff',
76678
+ bg: 'rgba(255, 122, 0, 1)',
76679
+ hoverBg: 'rgba(248, 109, 2, 1)'
76680
+ }, {
76681
+ type: 'solid',
76682
+ shape: 'square',
76683
+ size: 'medium',
76684
+ text: 'Read More',
76685
+ color: '#ffffff',
76686
+ bg: 'rgba(255, 68, 179, 1)',
76687
+ hoverBg: 'rgba(240, 46, 169, 1)'
76688
+ }, {
76689
+ type: 'solid',
76690
+ shape: 'square',
76691
+ size: 'medium',
76692
+ text: 'Read More',
76693
+ color: 'rgb(24, 24, 27)',
76694
+ bg: 'rgba(148, 251, 208, 1)',
76695
+ hoverBg: 'rgba(133, 244, 198, 1)'
76696
+ }, {
76697
+ type: 'solid',
76698
+ shape: 'square',
76699
+ size: 'medium',
76700
+ text: 'Read More',
76701
+ color: '#ffffff',
76702
+ bg: 'rgba(91, 73, 228, 1)',
76703
+ hoverBg: 'rgba(77, 59, 208, 1)'
76704
+ }, {
76705
+ type: 'solid',
76706
+ shape: 'square',
76707
+ size: 'medium',
76708
+ text: 'Read More',
76709
+ color: '#ffffff',
76710
+ bg: 'rgba(142, 67, 237, 1)',
76711
+ hoverBg: 'rgba(122, 52, 212, 1)'
76712
+ }, {
76713
+ type: 'solid',
76714
+ shape: 'square',
76715
+ size: 'medium',
76716
+ text: 'Read More',
76717
+ color: 'rgb(24, 24, 27)',
76718
+ bg: 'rgba(191, 245, 110, 1)',
76719
+ hoverBg: 'rgba(183, 236, 103, 1)'
76720
+ },
76535
76721
  // Rounded buttons - Small
76536
76722
  {
76537
76723
  type: 'solid',
@@ -77115,6 +77301,152 @@ class ButtonEditor {
77115
77301
  color: 'rgb(24, 24, 27)',
77116
77302
  bg: 'rgba(191, 245, 110, 1)',
77117
77303
  hoverBg: 'rgba(183, 236, 103, 1)'
77304
+ },
77305
+ // Square buttons - Large
77306
+ {
77307
+ type: 'solid',
77308
+ shape: 'square',
77309
+ size: 'large',
77310
+ text: 'Read More',
77311
+ color: 'rgb(24, 24, 27)',
77312
+ bg: 'transparent',
77313
+ hoverBg: 'transparent',
77314
+ customClasses: 'underline'
77315
+ }, {
77316
+ type: 'outline',
77317
+ shape: 'square',
77318
+ size: 'large',
77319
+ text: 'Read More'
77320
+ }, {
77321
+ type: 'solid',
77322
+ shape: 'square',
77323
+ size: 'large',
77324
+ text: 'Read More',
77325
+ color: 'rgb(24, 24, 27)',
77326
+ bg: 'rgb(240, 240, 241)',
77327
+ hoverBg: 'rgb(236, 236, 238)'
77328
+ }, {
77329
+ type: 'solid',
77330
+ shape: 'square',
77331
+ size: 'large',
77332
+ text: 'Read More',
77333
+ color: 'rgb(250, 250, 250)',
77334
+ bg: 'rgb(24, 24, 27)',
77335
+ hoverBg: 'rgb(63, 63, 70)'
77336
+ }, {
77337
+ type: 'outline',
77338
+ shape: 'square',
77339
+ size: 'large',
77340
+ text: 'Read More',
77341
+ color: 'rgb(250, 250, 250)',
77342
+ bg: 'transparent',
77343
+ hoverBg: 'transparent'
77344
+ }, {
77345
+ type: 'solid',
77346
+ shape: 'square',
77347
+ size: 'large',
77348
+ text: 'Read More',
77349
+ color: '#ffffff',
77350
+ bg: 'rgba(13, 151, 255, 1)',
77351
+ hoverBg: 'rgba(7, 138, 237, 1)'
77352
+ }, {
77353
+ type: 'solid',
77354
+ shape: 'square',
77355
+ size: 'large',
77356
+ text: 'Read More',
77357
+ color: '#ffffff',
77358
+ bg: '#3b82f6',
77359
+ hoverBg: 'rgba(47, 116, 228, 1)'
77360
+ }, {
77361
+ type: 'solid',
77362
+ shape: 'square',
77363
+ size: 'large',
77364
+ text: 'Read More',
77365
+ color: 'rgb(24, 24, 27)',
77366
+ bg: '#fff',
77367
+ hoverBg: 'rgba(248, 248, 250, 1)'
77368
+ },
77369
+ // Colors
77370
+ {
77371
+ type: 'solid',
77372
+ shape: 'square',
77373
+ size: 'large',
77374
+ text: 'Read More',
77375
+ color: 'rgb(24, 24, 27)',
77376
+ bg: 'rgba(111, 235, 255, 1)',
77377
+ hoverBg: 'rgba(98, 230, 252, 1)'
77378
+ }, {
77379
+ type: 'solid',
77380
+ shape: 'square',
77381
+ size: 'large',
77382
+ text: 'Read More',
77383
+ color: '#ffffff',
77384
+ bg: 'rgba(19, 166, 27, 1)',
77385
+ hoverBg: 'rgba(17, 155, 25, 1)'
77386
+ }, {
77387
+ type: 'solid',
77388
+ shape: 'square',
77389
+ size: 'large',
77390
+ text: 'Read More',
77391
+ color: 'rgb(24, 24, 27)',
77392
+ bg: 'rgba(254, 235, 101, 1)',
77393
+ hoverBg: 'rgba(249, 229, 85, 1)'
77394
+ }, {
77395
+ type: 'solid',
77396
+ shape: 'square',
77397
+ size: 'large',
77398
+ text: 'Read More',
77399
+ color: '#ffffff',
77400
+ bg: 'rgba(251, 45, 45, 1)',
77401
+ hoverBg: 'rgba(239, 38, 36, 1)'
77402
+ }, {
77403
+ type: 'solid',
77404
+ shape: 'square',
77405
+ size: 'large',
77406
+ text: 'Read More',
77407
+ color: '#ffffff',
77408
+ bg: 'rgba(255, 122, 0, 1)',
77409
+ hoverBg: 'rgba(248, 109, 2, 1)'
77410
+ }, {
77411
+ type: 'solid',
77412
+ shape: 'square',
77413
+ size: 'large',
77414
+ text: 'Read More',
77415
+ color: '#ffffff',
77416
+ bg: 'rgba(255, 68, 179, 1)',
77417
+ hoverBg: 'rgba(240, 46, 169, 1)'
77418
+ }, {
77419
+ type: 'solid',
77420
+ shape: 'square',
77421
+ size: 'large',
77422
+ text: 'Read More',
77423
+ color: 'rgb(24, 24, 27)',
77424
+ bg: 'rgba(148, 251, 208, 1)',
77425
+ hoverBg: 'rgba(133, 244, 198, 1)'
77426
+ }, {
77427
+ type: 'solid',
77428
+ shape: 'square',
77429
+ size: 'large',
77430
+ text: 'Read More',
77431
+ color: '#ffffff',
77432
+ bg: 'rgba(91, 73, 228, 1)',
77433
+ hoverBg: 'rgba(77, 59, 208, 1)'
77434
+ }, {
77435
+ type: 'solid',
77436
+ shape: 'square',
77437
+ size: 'large',
77438
+ text: 'Read More',
77439
+ color: '#ffffff',
77440
+ bg: 'rgba(142, 67, 237, 1)',
77441
+ hoverBg: 'rgba(122, 52, 212, 1)'
77442
+ }, {
77443
+ type: 'solid',
77444
+ shape: 'square',
77445
+ size: 'large',
77446
+ text: 'Read More',
77447
+ color: 'rgb(24, 24, 27)',
77448
+ bg: 'rgba(191, 245, 110, 1)',
77449
+ hoverBg: 'rgba(183, 236, 103, 1)'
77118
77450
  }];
77119
77451
  let templates = buttonConfigs.map(config => this.generateButton(config));
77120
77452
  const moreTemplates = [];
@@ -78230,7 +78562,7 @@ class SettingsUIGenerator {
78230
78562
  const plugin = this.runtime.getPlugin(pluginName);
78231
78563
  if (!plugin || !plugin.settings) {
78232
78564
  console.warn(`Plugin "${pluginName}" has no settings schema`);
78233
- return this.createEmptyForm();
78565
+ if (!plugin.editor) return this.createEmptyForm();
78234
78566
  }
78235
78567
  const form = document.createElement('div');
78236
78568
  form.className = 'cb-settings-form';
@@ -80990,8 +81322,10 @@ class Element$1 {
80990
81322
  subblock = true;
80991
81323
  }
80992
81324
  }
80993
- if (elm.closest('[data-cb-type]')) {
81325
+ const plugin = elm.closest('[data-cb-type]');
81326
+ if (plugin) {
80994
81327
  customcode = true;
81328
+ subblock = elm.closest('.is-subblock');
80995
81329
  }
80996
81330
  if (!customcode && !noedit && !_protected || subblock) {
80997
81331
  //previously this is commented: && !noedit && !_protected
@@ -85104,6 +85438,7 @@ class ColumnTool {
85104
85438
  }
85105
85439
  click(col) {
85106
85440
  this.columnTool = col.parentNode.querySelector('.is-col-tool');
85441
+ if (!this.columnTool) return;
85107
85442
  this.columnTool.style.left = col.offsetLeft + 'px';
85108
85443
  this.columnTool.style.top = col.offsetTop + 'px';
85109
85444
  const btnAdd = this.columnTool.querySelector('.cell-add');
@@ -90139,7 +90474,15 @@ class ElementTool {
90139
90474
  if (elm.closest('.is-subblock')) {
90140
90475
  subblock = true;
90141
90476
  }
90142
-
90477
+ const plugin = elm.closest('[data-cb-type]');
90478
+ if (plugin && subblock) {
90479
+ elm.remove();
90480
+ this.elementTool.style.display = 'none';
90481
+ //Trigger Change event
90482
+ this.builder.opts.onChange();
90483
+ if (this.builder.onSelectChange) this.builder.onSelectChange();
90484
+ return;
90485
+ }
90143
90486
  /*
90144
90487
  if(dom.hasClass(elm.parentNode, 'cell-active') || elm.parentNode.hasAttribute('data-subblock')) {
90145
90488
  // Level 1
@@ -90498,7 +90841,7 @@ class ElementTool {
90498
90841
  subblock = true;
90499
90842
  }
90500
90843
  const plugin = elm.closest('[data-cb-type]');
90501
- if ((customcode || noedit || _protected) && !subblock) ; else if (plugin) {
90844
+ if ((customcode || noedit || _protected) && !subblock) ; else if (plugin && !subblock) {
90502
90845
  activeElement = plugin;
90503
90846
  } else {
90504
90847
  const tagName = elm.tagName.toLowerCase();
@@ -125372,7 +125715,21 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
125372
125715
  newCol.children[0].click();
125373
125716
  }, 400);
125374
125717
  } else {
125375
- newCol.children[0].click(); // Focus on first element
125718
+ const spacer = newCol.querySelector('.spacer');
125719
+ setTimeout(() => {
125720
+ try {
125721
+ if (spacer) {
125722
+ if (newCol.parentNode.nextElementSibling) {
125723
+ const elm = newCol.parentNode.nextElementSibling.querySelector('h1,h2,h3,h4,h5,h6,p,img,[data-cb-type]');
125724
+ if (elm) elm.click();else newCol.click();
125725
+ }
125726
+ } else {
125727
+ newCol.children[0].click(); // Focus on first element
125728
+ }
125729
+ } catch (e) {
125730
+ // Do Nothing
125731
+ }
125732
+ }, 400);
125376
125733
  }
125377
125734
  }
125378
125735
  }
@@ -160328,7 +160685,7 @@ class ContentBox {
160328
160685
  'title': 'Sections'
160329
160686
  }, {
160330
160687
  'name': 'snippet',
160331
- 'title': 'Content Blocks'
160688
+ 'title': 'Blocks'
160332
160689
  }, {
160333
160690
  'name': 'typography',
160334
160691
  'title': 'Typography'
@@ -164700,7 +165057,15 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
164700
165057
 
164701
165058
  if (this.UIColor) {
164702
165059
  this.editor.setUIColor(this.UIColor.mode, this.UIColor.css);
164703
- }
165060
+ } // Prepare for tooltip
165061
+
165062
+
165063
+ const sidebar = this.builderStuff.querySelector('.is-sidebar');
165064
+ let elms = sidebar.querySelectorAll('[title]');
165065
+ Array.prototype.forEach.call(elms, elm => {
165066
+ elm.setAttribute('data-title', elm.getAttribute('title'));
165067
+ this.editor.tooltip.set(elm, 5, 3);
165068
+ });
164704
165069
  } // editorSetup
164705
165070
  // Live Preview
164706
165071