@innovastudio/contentbuilder 1.5.166 → 1.5.168

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/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.166",
4
+ "version": "1.5.168",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -52,7 +52,7 @@
52
52
  "sass": "^1.42.1",
53
53
  "sass-loader": "^12.1.0",
54
54
  "serve-static": "^1.14.1",
55
- "sharp": "^0.30.3",
55
+ "sharp": "^0.34.4",
56
56
  "style-loader": "^3.3.0",
57
57
  "webpack": "^5.53.0",
58
58
  "webpack-cli": "^4.8.0",
@@ -5544,13 +5544,24 @@ class Util {
5544
5544
  element.click();
5545
5545
  }
5546
5546
  }
5547
+ let editingInsidePlugin = false;
5548
+ let elm = this.builder.activeElement;
5549
+ const plugin = elm.closest('[data-cb-type]');
5550
+ const subblock = elm.closest('.is-subblock');
5551
+ if (plugin && subblock) {
5552
+ editingInsidePlugin = true;
5553
+ }
5547
5554
  if (mode === 'elm') {
5548
5555
  let elm = this.builder.activeElement; // See elementtool.js line 195-196. // document.querySelector('.elm-active');
5549
5556
  if (!elm) return;
5550
5557
  this.builder.uo.saveForUndo();
5551
5558
  let element = elm;
5552
5559
  let newelement;
5553
- if (!element.nextElementSibling && !element.closest('[data-subblock]')) {
5560
+ const plugin = element.closest('[data-cb-type]');
5561
+ if (plugin) {
5562
+ element.insertAdjacentHTML('afterend', html);
5563
+ newelement = element.nextElementSibling;
5564
+ } else if (!element.nextElementSibling && !element.closest('[data-subblock]')) {
5554
5565
  // active element is div.display > p.
5555
5566
  let activeCol = this.builder.activeCol;
5556
5567
  let current;
@@ -5604,7 +5615,7 @@ class Util {
5604
5615
  this.builder.opts.onRender();
5605
5616
 
5606
5617
  // Reinit after drag drop block
5607
- if (this.builder.win.builderRuntime) this.builder.win.builderRuntime.reinitialize();
5618
+ if (this.builder.win.builderRuntime && !editingInsidePlugin) this.builder.win.builderRuntime.reinitialize();
5608
5619
  setTimeout(() => {
5609
5620
  this.builder.makeSortable(this.builder.doc);
5610
5621
  }, 400);
@@ -15099,11 +15110,18 @@ class HtmlUtil {
15099
15110
  elm.removeAttribute('data-item-id');
15100
15111
  });
15101
15112
  }
15102
- const elms = element.querySelectorAll('[data-scroll], [data-scroll-once]');
15113
+ let elms = element.querySelectorAll('[data-scroll], [data-scroll-once]');
15103
15114
  elms.forEach(elm => {
15104
15115
  elm.removeAttribute('data-scroll');
15105
15116
  elm.removeAttribute('data-scroll-once');
15106
15117
  });
15118
+ elms = element.querySelectorAll('.elm-active, .icon-active');
15119
+ elms.forEach(elm => {
15120
+ elm.classList.remove('elm-active');
15121
+ elm.classList.remove('icon-active');
15122
+ });
15123
+ const oldEditables = element.querySelectorAll('[contenteditable="true"]');
15124
+ oldEditables.forEach(el => el.removeAttribute('contenteditable'));
15107
15125
  });
15108
15126
  html = '';
15109
15127
  if (multiple) {
@@ -47560,6 +47578,8 @@ class ButtonEditor {
47560
47578
  <span>${util.out('Padding Left/Right')}</span>:
47561
47579
  </div>
47562
47580
  <div class="flex flex-row" style="margin-top:5px">
47581
+ <button title="2" data-command="0" class="paddingx-command" style="margin-right:4px">0</button>
47582
+ <button title="2" data-command="1" class="paddingx-command" style="margin-right:4px">1</button>
47563
47583
  <button title="2" data-command="2" class="paddingx-command" style="margin-right:4px">2</button>
47564
47584
  <button title="3" data-command="3" class="paddingx-command" style="margin-right:4px">3</button>
47565
47585
  <button title="4" data-command="4" class="paddingx-command" style="margin-right:4px">4</button>
@@ -48065,6 +48085,12 @@ class ButtonEditor {
48065
48085
  const val = btn.getAttribute('data-command');
48066
48086
  const activeButton = this.builder.activeButton || this.builder.activeLinkButton || this.builder.activeLink;
48067
48087
  dom.removeClassesByPrefix(activeButton, 'px-');
48088
+ if (val === '0') {
48089
+ dom.addClass(activeButton, 'px-0');
48090
+ }
48091
+ if (val === '1') {
48092
+ dom.addClass(activeButton, 'px-1');
48093
+ }
48068
48094
  if (val === '2') {
48069
48095
  dom.addClass(activeButton, 'px-2');
48070
48096
  }
@@ -49132,6 +49158,144 @@ class ButtonEditor {
49132
49158
  bg: 'rgba(191, 245, 110, 1)',
49133
49159
  hoverBg: 'rgba(183, 236, 103, 1)'
49134
49160
  },
49161
+ // Square buttons
49162
+ {
49163
+ type: 'solid',
49164
+ shape: 'square',
49165
+ text: 'Read More',
49166
+ color: 'rgb(24, 24, 27)',
49167
+ bg: 'transparent',
49168
+ hoverBg: 'transparent',
49169
+ customClasses: 'underline px-0'
49170
+ }, {
49171
+ type: 'outline',
49172
+ shape: 'square',
49173
+ text: 'Read More'
49174
+ }, {
49175
+ type: 'solid',
49176
+ shape: 'square',
49177
+ text: 'Read More',
49178
+ color: 'rgb(24, 24, 27)',
49179
+ bg: 'rgb(240, 240, 241)',
49180
+ hoverBg: 'rgb(236, 236, 238)'
49181
+ }, {
49182
+ type: 'solid',
49183
+ shape: 'square',
49184
+ text: 'Read More',
49185
+ color: 'rgb(250, 250, 250)',
49186
+ bg: 'rgb(24, 24, 27)',
49187
+ hoverBg: 'rgb(63, 63, 70)'
49188
+ }, {
49189
+ type: 'outline',
49190
+ shape: 'square',
49191
+ text: 'Read More',
49192
+ color: 'rgb(250, 250, 250)',
49193
+ bg: 'transparent',
49194
+ hoverBg: 'transparent'
49195
+ }, {
49196
+ type: 'solid',
49197
+ shape: 'square',
49198
+ text: 'Read More',
49199
+ color: '#ffffff',
49200
+ bg: 'rgba(13, 151, 255, 1)',
49201
+ hoverBg: 'rgba(7, 138, 237, 1)'
49202
+ }, {
49203
+ type: 'solid',
49204
+ shape: 'square',
49205
+ text: 'Read More',
49206
+ color: '#ffffff',
49207
+ bg: '#3b82f6',
49208
+ hoverBg: 'rgba(47, 116, 228, 1)'
49209
+ }, {
49210
+ type: 'solid',
49211
+ shape: 'square',
49212
+ text: 'Read More',
49213
+ color: 'rgb(24, 24, 27)',
49214
+ bg: '#fff',
49215
+ hoverBg: 'rgba(248, 248, 250, 1)'
49216
+ },
49217
+ // Colors
49218
+ {
49219
+ type: 'solid',
49220
+ shape: 'square',
49221
+ size: 'medium',
49222
+ text: 'Read More',
49223
+ color: 'rgb(24, 24, 27)',
49224
+ bg: 'rgba(111, 235, 255, 1)',
49225
+ hoverBg: 'rgba(98, 230, 252, 1)'
49226
+ }, {
49227
+ type: 'solid',
49228
+ shape: 'square',
49229
+ size: 'medium',
49230
+ text: 'Read More',
49231
+ color: '#ffffff',
49232
+ bg: 'rgba(19, 166, 27, 1)',
49233
+ hoverBg: 'rgba(17, 155, 25, 1)'
49234
+ }, {
49235
+ type: 'solid',
49236
+ shape: 'square',
49237
+ size: 'medium',
49238
+ text: 'Read More',
49239
+ color: 'rgb(24, 24, 27)',
49240
+ bg: 'rgba(254, 235, 101, 1)',
49241
+ hoverBg: 'rgba(249, 229, 85, 1)'
49242
+ }, {
49243
+ type: 'solid',
49244
+ shape: 'square',
49245
+ size: 'medium',
49246
+ text: 'Read More',
49247
+ color: '#ffffff',
49248
+ bg: 'rgba(251, 45, 45, 1)',
49249
+ hoverBg: 'rgba(239, 38, 36, 1)'
49250
+ }, {
49251
+ type: 'solid',
49252
+ shape: 'square',
49253
+ size: 'medium',
49254
+ text: 'Read More',
49255
+ color: '#ffffff',
49256
+ bg: 'rgba(255, 122, 0, 1)',
49257
+ hoverBg: 'rgba(248, 109, 2, 1)'
49258
+ }, {
49259
+ type: 'solid',
49260
+ shape: 'square',
49261
+ size: 'medium',
49262
+ text: 'Read More',
49263
+ color: '#ffffff',
49264
+ bg: 'rgba(255, 68, 179, 1)',
49265
+ hoverBg: 'rgba(240, 46, 169, 1)'
49266
+ }, {
49267
+ type: 'solid',
49268
+ shape: 'square',
49269
+ size: 'medium',
49270
+ text: 'Read More',
49271
+ color: 'rgb(24, 24, 27)',
49272
+ bg: 'rgba(148, 251, 208, 1)',
49273
+ hoverBg: 'rgba(133, 244, 198, 1)'
49274
+ }, {
49275
+ type: 'solid',
49276
+ shape: 'square',
49277
+ size: 'medium',
49278
+ text: 'Read More',
49279
+ color: '#ffffff',
49280
+ bg: 'rgba(91, 73, 228, 1)',
49281
+ hoverBg: 'rgba(77, 59, 208, 1)'
49282
+ }, {
49283
+ type: 'solid',
49284
+ shape: 'square',
49285
+ size: 'medium',
49286
+ text: 'Read More',
49287
+ color: '#ffffff',
49288
+ bg: 'rgba(142, 67, 237, 1)',
49289
+ hoverBg: 'rgba(122, 52, 212, 1)'
49290
+ }, {
49291
+ type: 'solid',
49292
+ shape: 'square',
49293
+ size: 'medium',
49294
+ text: 'Read More',
49295
+ color: 'rgb(24, 24, 27)',
49296
+ bg: 'rgba(191, 245, 110, 1)',
49297
+ hoverBg: 'rgba(183, 236, 103, 1)'
49298
+ },
49135
49299
  // Rounded buttons - Small
49136
49300
  {
49137
49301
  type: 'solid',
@@ -49715,6 +49879,152 @@ class ButtonEditor {
49715
49879
  color: 'rgb(24, 24, 27)',
49716
49880
  bg: 'rgba(191, 245, 110, 1)',
49717
49881
  hoverBg: 'rgba(183, 236, 103, 1)'
49882
+ },
49883
+ // Square buttons - Large
49884
+ {
49885
+ type: 'solid',
49886
+ shape: 'square',
49887
+ size: 'large',
49888
+ text: 'Read More',
49889
+ color: 'rgb(24, 24, 27)',
49890
+ bg: 'transparent',
49891
+ hoverBg: 'transparent',
49892
+ customClasses: 'underline'
49893
+ }, {
49894
+ type: 'outline',
49895
+ shape: 'square',
49896
+ size: 'large',
49897
+ text: 'Read More'
49898
+ }, {
49899
+ type: 'solid',
49900
+ shape: 'square',
49901
+ size: 'large',
49902
+ text: 'Read More',
49903
+ color: 'rgb(24, 24, 27)',
49904
+ bg: 'rgb(240, 240, 241)',
49905
+ hoverBg: 'rgb(236, 236, 238)'
49906
+ }, {
49907
+ type: 'solid',
49908
+ shape: 'square',
49909
+ size: 'large',
49910
+ text: 'Read More',
49911
+ color: 'rgb(250, 250, 250)',
49912
+ bg: 'rgb(24, 24, 27)',
49913
+ hoverBg: 'rgb(63, 63, 70)'
49914
+ }, {
49915
+ type: 'outline',
49916
+ shape: 'square',
49917
+ size: 'large',
49918
+ text: 'Read More',
49919
+ color: 'rgb(250, 250, 250)',
49920
+ bg: 'transparent',
49921
+ hoverBg: 'transparent'
49922
+ }, {
49923
+ type: 'solid',
49924
+ shape: 'square',
49925
+ size: 'large',
49926
+ text: 'Read More',
49927
+ color: '#ffffff',
49928
+ bg: 'rgba(13, 151, 255, 1)',
49929
+ hoverBg: 'rgba(7, 138, 237, 1)'
49930
+ }, {
49931
+ type: 'solid',
49932
+ shape: 'square',
49933
+ size: 'large',
49934
+ text: 'Read More',
49935
+ color: '#ffffff',
49936
+ bg: '#3b82f6',
49937
+ hoverBg: 'rgba(47, 116, 228, 1)'
49938
+ }, {
49939
+ type: 'solid',
49940
+ shape: 'square',
49941
+ size: 'large',
49942
+ text: 'Read More',
49943
+ color: 'rgb(24, 24, 27)',
49944
+ bg: '#fff',
49945
+ hoverBg: 'rgba(248, 248, 250, 1)'
49946
+ },
49947
+ // Colors
49948
+ {
49949
+ type: 'solid',
49950
+ shape: 'square',
49951
+ size: 'large',
49952
+ text: 'Read More',
49953
+ color: 'rgb(24, 24, 27)',
49954
+ bg: 'rgba(111, 235, 255, 1)',
49955
+ hoverBg: 'rgba(98, 230, 252, 1)'
49956
+ }, {
49957
+ type: 'solid',
49958
+ shape: 'square',
49959
+ size: 'large',
49960
+ text: 'Read More',
49961
+ color: '#ffffff',
49962
+ bg: 'rgba(19, 166, 27, 1)',
49963
+ hoverBg: 'rgba(17, 155, 25, 1)'
49964
+ }, {
49965
+ type: 'solid',
49966
+ shape: 'square',
49967
+ size: 'large',
49968
+ text: 'Read More',
49969
+ color: 'rgb(24, 24, 27)',
49970
+ bg: 'rgba(254, 235, 101, 1)',
49971
+ hoverBg: 'rgba(249, 229, 85, 1)'
49972
+ }, {
49973
+ type: 'solid',
49974
+ shape: 'square',
49975
+ size: 'large',
49976
+ text: 'Read More',
49977
+ color: '#ffffff',
49978
+ bg: 'rgba(251, 45, 45, 1)',
49979
+ hoverBg: 'rgba(239, 38, 36, 1)'
49980
+ }, {
49981
+ type: 'solid',
49982
+ shape: 'square',
49983
+ size: 'large',
49984
+ text: 'Read More',
49985
+ color: '#ffffff',
49986
+ bg: 'rgba(255, 122, 0, 1)',
49987
+ hoverBg: 'rgba(248, 109, 2, 1)'
49988
+ }, {
49989
+ type: 'solid',
49990
+ shape: 'square',
49991
+ size: 'large',
49992
+ text: 'Read More',
49993
+ color: '#ffffff',
49994
+ bg: 'rgba(255, 68, 179, 1)',
49995
+ hoverBg: 'rgba(240, 46, 169, 1)'
49996
+ }, {
49997
+ type: 'solid',
49998
+ shape: 'square',
49999
+ size: 'large',
50000
+ text: 'Read More',
50001
+ color: 'rgb(24, 24, 27)',
50002
+ bg: 'rgba(148, 251, 208, 1)',
50003
+ hoverBg: 'rgba(133, 244, 198, 1)'
50004
+ }, {
50005
+ type: 'solid',
50006
+ shape: 'square',
50007
+ size: 'large',
50008
+ text: 'Read More',
50009
+ color: '#ffffff',
50010
+ bg: 'rgba(91, 73, 228, 1)',
50011
+ hoverBg: 'rgba(77, 59, 208, 1)'
50012
+ }, {
50013
+ type: 'solid',
50014
+ shape: 'square',
50015
+ size: 'large',
50016
+ text: 'Read More',
50017
+ color: '#ffffff',
50018
+ bg: 'rgba(142, 67, 237, 1)',
50019
+ hoverBg: 'rgba(122, 52, 212, 1)'
50020
+ }, {
50021
+ type: 'solid',
50022
+ shape: 'square',
50023
+ size: 'large',
50024
+ text: 'Read More',
50025
+ color: 'rgb(24, 24, 27)',
50026
+ bg: 'rgba(191, 245, 110, 1)',
50027
+ hoverBg: 'rgba(183, 236, 103, 1)'
49718
50028
  }];
49719
50029
  let templates = buttonConfigs.map(config => this.generateButton(config));
49720
50030
  const moreTemplates = [];
@@ -50830,7 +51140,7 @@ class SettingsUIGenerator {
50830
51140
  const plugin = this.runtime.getPlugin(pluginName);
50831
51141
  if (!plugin || !plugin.settings) {
50832
51142
  console.warn(`Plugin "${pluginName}" has no settings schema`);
50833
- return this.createEmptyForm();
51143
+ if (!plugin.editor) return this.createEmptyForm();
50834
51144
  }
50835
51145
  const form = document.createElement('div');
50836
51146
  form.className = 'cb-settings-form';
@@ -53590,8 +53900,10 @@ class Element$1 {
53590
53900
  subblock = true;
53591
53901
  }
53592
53902
  }
53593
- if (elm.closest('[data-cb-type]')) {
53903
+ const plugin = elm.closest('[data-cb-type]');
53904
+ if (plugin) {
53594
53905
  customcode = true;
53906
+ subblock = elm.closest('.is-subblock');
53595
53907
  }
53596
53908
  if (!customcode && !noedit && !_protected || subblock) {
53597
53909
  //previously this is commented: && !noedit && !_protected
@@ -62739,7 +63051,15 @@ class ElementTool {
62739
63051
  if (elm.closest('.is-subblock')) {
62740
63052
  subblock = true;
62741
63053
  }
62742
-
63054
+ const plugin = elm.closest('[data-cb-type]');
63055
+ if (plugin && subblock) {
63056
+ elm.remove();
63057
+ this.elementTool.style.display = 'none';
63058
+ //Trigger Change event
63059
+ this.builder.opts.onChange();
63060
+ if (this.builder.onSelectChange) this.builder.onSelectChange();
63061
+ return;
63062
+ }
62743
63063
  /*
62744
63064
  if(dom.hasClass(elm.parentNode, 'cell-active') || elm.parentNode.hasAttribute('data-subblock')) {
62745
63065
  // Level 1
@@ -63098,7 +63418,7 @@ class ElementTool {
63098
63418
  subblock = true;
63099
63419
  }
63100
63420
  const plugin = elm.closest('[data-cb-type]');
63101
- if ((customcode || noedit || _protected) && !subblock) ; else if (plugin) {
63421
+ if ((customcode || noedit || _protected) && !subblock) ; else if (plugin && !subblock) {
63102
63422
  activeElement = plugin;
63103
63423
  } else {
63104
63424
  const tagName = elm.tagName.toLowerCase();
@@ -97972,7 +98292,21 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
97972
98292
  newCol.children[0].click();
97973
98293
  }, 400);
97974
98294
  } else {
97975
- newCol.children[0].click(); // Focus on first element
98295
+ const spacer = newCol.querySelector('.spacer');
98296
+ setTimeout(() => {
98297
+ try {
98298
+ if (spacer) {
98299
+ if (newCol.parentNode.nextElementSibling) {
98300
+ const elm = newCol.parentNode.nextElementSibling.querySelector('h1,h2,h3,h4,h5,h6,p,img,iframe');
98301
+ if (elm) elm.click();else newCol.click();
98302
+ }
98303
+ } else {
98304
+ newCol.children[0].click(); // Focus on first element
98305
+ }
98306
+ } catch (e) {
98307
+ // Do Nothing
98308
+ }
98309
+ }, 400);
97976
98310
  }
97977
98311
  }
97978
98312
  }