@innovastudio/contentbuilder 1.3.31 → 1.3.33

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.
Files changed (60) hide show
  1. package/package.json +1 -1
  2. package/public/contentbuilder/contentbuilder.css +24 -3
  3. package/public/contentbuilder/contentbuilder.esm.js +81 -63
  4. package/public/contentbuilder/contentbuilder.min.js +9 -9
  5. package/public/contentbuilder/plugins/animation/plugin.js +25 -0
  6. package/public/contentbuilder/themes/colored-blue.css +14 -0
  7. package/public/contentbuilder/themes/colored-blue2.css +14 -0
  8. package/public/contentbuilder/themes/colored-blue3.css +14 -0
  9. package/public/contentbuilder/themes/colored-blue4.css +14 -0
  10. package/public/contentbuilder/themes/colored-blue5.css +14 -0
  11. package/public/contentbuilder/themes/colored-blue6.css +14 -0
  12. package/public/contentbuilder/themes/colored-blue7.css +14 -0
  13. package/public/contentbuilder/themes/colored-blue8.css +14 -0
  14. package/public/contentbuilder/themes/colored-darkblue.css +14 -0
  15. package/public/contentbuilder/themes/colored-gray.css +14 -0
  16. package/public/contentbuilder/themes/colored-green.css +14 -0
  17. package/public/contentbuilder/themes/colored-green2.css +14 -0
  18. package/public/contentbuilder/themes/colored-green3.css +14 -0
  19. package/public/contentbuilder/themes/colored-green4.css +14 -0
  20. package/public/contentbuilder/themes/colored-green5.css +14 -0
  21. package/public/contentbuilder/themes/colored-magenta.css +14 -0
  22. package/public/contentbuilder/themes/colored-orange.css +14 -0
  23. package/public/contentbuilder/themes/colored-orange2.css +14 -0
  24. package/public/contentbuilder/themes/colored-orange3.css +14 -0
  25. package/public/contentbuilder/themes/colored-pink.css +14 -0
  26. package/public/contentbuilder/themes/colored-pink2.css +14 -0
  27. package/public/contentbuilder/themes/colored-pink3.css +14 -0
  28. package/public/contentbuilder/themes/colored-pink4.css +14 -0
  29. package/public/contentbuilder/themes/colored-purple.css +14 -0
  30. package/public/contentbuilder/themes/colored-purple2.css +14 -0
  31. package/public/contentbuilder/themes/colored-red.css +14 -0
  32. package/public/contentbuilder/themes/colored-red2.css +14 -0
  33. package/public/contentbuilder/themes/colored-red3.css +14 -0
  34. package/public/contentbuilder/themes/colored-red4.css +14 -0
  35. package/public/contentbuilder/themes/colored-red5.css +14 -0
  36. package/public/contentbuilder/themes/colored-yellow.css +14 -0
  37. package/public/contentbuilder/themes/colored-yellow2.css +14 -0
  38. package/public/contentbuilder/themes/dark-blue.css +14 -0
  39. package/public/contentbuilder/themes/dark-blue2.css +14 -0
  40. package/public/contentbuilder/themes/dark-blue3.css +14 -0
  41. package/public/contentbuilder/themes/dark-gray.css +14 -0
  42. package/public/contentbuilder/themes/dark-pink.css +14 -0
  43. package/public/contentbuilder/themes/dark-purple.css +14 -0
  44. package/public/contentbuilder/themes/dark-red.css +14 -0
  45. package/public/contentbuilder/themes/dark.css +14 -0
  46. package/public/contentbuilder/themes/light-blue.css +14 -0
  47. package/public/contentbuilder/themes/light-blue2.css +14 -0
  48. package/public/contentbuilder/themes/light-blue3.css +14 -0
  49. package/public/contentbuilder/themes/light-cyan.css +14 -0
  50. package/public/contentbuilder/themes/light-gray.css +14 -0
  51. package/public/contentbuilder/themes/light-gray2.css +14 -0
  52. package/public/contentbuilder/themes/light-gray3.css +14 -0
  53. package/public/contentbuilder/themes/light-green.css +14 -0
  54. package/public/contentbuilder/themes/light-pink.css +14 -0
  55. package/public/contentbuilder/themes/light-pink2.css +14 -0
  56. package/public/contentbuilder/themes/light-purple.css +14 -0
  57. package/public/contentbuilder/themes/light-purple2.css +14 -0
  58. package/public/contentbuilder/themes/light-red.css +14 -0
  59. package/public/contentbuilder/themes/light-yellow.css +14 -0
  60. package/public/contentbuilder/themes/light-yellow2.css +14 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.3.31",
4
+ "version": "1.3.33",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -3091,6 +3091,20 @@ button:focus-visible {
3091
3091
  z-index: 10003;
3092
3092
  outline: none;
3093
3093
  }
3094
+ #_cbhtml .is-side button,
3095
+ .is-ui .is-side button {
3096
+ color: #000;
3097
+ background: #fff;
3098
+ box-shadow: 0px 3px 6px -6px rgba(0, 0, 0, 0.32);
3099
+ }
3100
+ #_cbhtml .is-side button:hover,
3101
+ .is-ui .is-side button:hover {
3102
+ background: #fff;
3103
+ }
3104
+ #_cbhtml .is-side button.on,
3105
+ .is-ui .is-side button.on {
3106
+ background: #f2f2f2;
3107
+ }
3094
3108
  #_cbhtml .is-side.active,
3095
3109
  .is-ui .is-side.active {
3096
3110
  right: 0;
@@ -3250,6 +3264,13 @@ button:focus-visible {
3250
3264
  outline-offset: 0;
3251
3265
  box-shadow: none;
3252
3266
  }
3267
+ #_cbhtml .find-part .monaco-inputbox textarea,
3268
+ #_cbhtml .replace-part .monaco-inputbox textarea,
3269
+ .is-ui .find-part .monaco-inputbox textarea,
3270
+ .is-ui .replace-part .monaco-inputbox textarea {
3271
+ padding: 0 !important;
3272
+ line-height: 1.4 !important;
3273
+ }
3253
3274
  #_cbhtml select,
3254
3275
  .is-ui select {
3255
3276
  font-size: 13px;
@@ -4442,6 +4463,7 @@ button:focus-visible {
4442
4463
 
4443
4464
  .row-active .is-col-tool {
4444
4465
  display: flex;
4466
+ width: auto;
4445
4467
  }
4446
4468
 
4447
4469
  .is-builder[rowoutline] .row-active .is-col-tool {
@@ -4610,11 +4632,10 @@ button:focus-visible {
4610
4632
  display: none;
4611
4633
  position: absolute;
4612
4634
  bottom: -1px;
4613
- left: -20px;
4614
- width: calc(100% + 40px);
4635
+ left: 0px;
4636
+ width: 100%;
4615
4637
  height: 1px;
4616
4638
  border: none;
4617
- border-bottom: 1px solid #ffb784;
4618
4639
  z-index: 1;
4619
4640
  background: transparent;
4620
4641
  transition: none;
@@ -4543,7 +4543,7 @@ class Util {
4543
4543
 
4544
4544
  const cellCount = row.childElementCount - num;
4545
4545
  const rowClass = this.builder.opts.row;
4546
- const colClass = this.builder.opts.cols;
4546
+ let colClass = this.builder.opts.cols;
4547
4547
  const colEqual = this.builder.opts.colequal;
4548
4548
 
4549
4549
  if (colEqual.length > 0) {
@@ -4584,7 +4584,21 @@ class Util {
4584
4584
  let n = 0;
4585
4585
  const cols = dom.elementChildren(row);
4586
4586
  cols.forEach(col => {
4587
- if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-col-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
4587
+ if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-col-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return; // Bootstrap stuff
4588
+
4589
+ col.classList.forEach(item => {
4590
+ if (item.indexOf('col-md-') !== -1) ; else if (item.indexOf('col-sm-') !== -1) {
4591
+ colClass = ['col-sm-1', 'col-sm-2', 'col-sm-3', 'col-sm-4', 'col-sm-5', 'col-sm-6', 'col-sm-7', 'col-sm-8', 'col-sm-9', 'col-sm-10', 'col-sm-11', 'col-sm-12'];
4592
+ } else if (item.indexOf('col-xs-') !== -1) {
4593
+ colClass = ['col-xs-1', 'col-xs-2', 'col-xs-3', 'col-xs-4', 'col-xs-5', 'col-xs-6', 'col-xs-7', 'col-xs-8', 'col-xs-9', 'col-xs-10', 'col-xs-11', 'col-xs-12'];
4594
+ } else if (item.indexOf('col-lg-') !== -1) {
4595
+ colClass = ['col-lg-1', 'col-lg-2', 'col-lg-3', 'col-lg-4', 'col-lg-5', 'col-lg-6', 'col-lg-7', 'col-lg-8', 'col-lg-9', 'col-lg-10', 'col-lg-11', 'col-lg-12'];
4596
+ } else if (item.indexOf('col-xl-') !== -1) {
4597
+ colClass = ['col-xl-1', 'col-xl-2', 'col-xl-3', 'col-xl-4', 'col-xl-5', 'col-xl-6', 'col-xl-7', 'col-xl-8', 'col-xl-9', 'col-xl-10', 'col-xl-11', 'col-xl-12'];
4598
+ } else if (item.indexOf('col-xxl-') !== -1) {
4599
+ colClass = ['col-xxl-1', 'col-xxl-2', 'col-xxl-3', 'col-xxl-4', 'col-xxl-5', 'col-xxl-6', 'col-xxl-7', 'col-xxl-8', 'col-xxl-9', 'col-xxl-10', 'col-xxl-11', 'col-xxl-12'];
4600
+ }
4601
+ });
4588
4602
  n++;
4589
4603
 
4590
4604
  for (var i = 0; i <= colClass.length - 1; i++) {
@@ -4594,7 +4608,10 @@ class Util {
4594
4608
  if (cellCount === 1) dom.addClass(col, colClass[11]);
4595
4609
  if (cellCount === 2) dom.addClass(col, colClass[5]);
4596
4610
  if (cellCount === 3) dom.addClass(col, colClass[3]);
4597
- if (cellCount === 4) dom.addClass(col, colClass[2]);
4611
+
4612
+ if (cellCount === 4) {
4613
+ dom.addClass(col, colClass[2]);
4614
+ }
4598
4615
 
4599
4616
  if (cellCount === 5) {
4600
4617
  // 2, 2, 2, 2, 4
@@ -14950,59 +14967,7 @@ class HtmlUtil {
14950
14967
  });
14951
14968
  }
14952
14969
 
14953
- if (this.builder.cleanHtmlFormatting) {
14954
- // this cleanHtmlFormatting flag only use for output, not during editing
14955
- if (this.builder.useCssClasses) {
14956
- // Clean all uneeded normal classes
14957
- let elmNormals = content.querySelectorAll(`.${this.builder.cssClasses.fontWeight.defaultNormal}`); // Array.prototype.forEach.call(elmNormals, (elm) => {
14958
- // let decor = false;
14959
- // if(elm.closest(`.${this.builder.cssClasses.fontWeight.defaultBold}`)) {
14960
- // decor = true;
14961
- // }
14962
- // if(!decor) {
14963
- // dom.removeClass(elm, this.builder.cssClasses.fontWeight.defaultNormal);
14964
- // }
14965
- // });
14966
- // elmNormals = content.querySelectorAll(`.${this.builder.cssClasses.fontStyle.normal}`);
14967
- // Array.prototype.forEach.call(elmNormals, (elm) => {
14968
- // let decor = false;
14969
- // if(elm.closest(`.${this.builder.cssClasses.fontStyle.italic}`)) {
14970
- // decor = true;
14971
- // }
14972
- // if(!decor) {
14973
- // dom.removeClass(elm, this.builder.cssClasses.fontStyle.normal);
14974
- // }
14975
- // });
14976
- // elmNormals = content.querySelectorAll(`.${this.builder.cssClasses.textDecoration.normal}`);
14977
- // Array.prototype.forEach.call(elmNormals, (elm) => {
14978
- // let decor = false;
14979
- // if(elm.closest('a')) return;
14980
- // if(elm.closest(`.${this.builder.cssClasses.textDecoration.underline},.${this.builder.cssClasses.textDecoration.linethrough}`)) {
14981
- // decor = true;
14982
- // }
14983
- // if(!decor) {
14984
- // dom.removeClass(elm, this.builder.cssClasses.textDecoration.normal);
14985
- // }
14986
- // });
14987
- // elmNormals = content.querySelectorAll(`.${this.builder.cssClasses.textTransform.normal}`);
14988
- // Array.prototype.forEach.call(elmNormals, (elm) => {
14989
- // let decor = false;
14990
- // if(elm.closest(`.${this.builder.cssClasses.textTransform.uppercase},.${this.builder.cssClasses.textTransform.lowercase},.${this.builder.cssClasses.textTransform.capitalize}`)) {
14991
- // decor = true;
14992
- // }
14993
- // if(!decor) {
14994
- // dom.removeClass(elm, this.builder.cssClasses.textTransform.normal);
14995
- // }
14996
- // });
14997
-
14998
- elmNormals = content.querySelectorAll(`.${this.builder.cssClasses.extend.unset}`);
14999
- Array.prototype.forEach.call(elmNormals, elm => {
15000
- dom$h.removeClass(elm, this.builder.cssClasses.extend.unset);
15001
- });
15002
- } // Clean unused spans
15003
- // dom.cleanUnusedSpan(content); // REVIEW
15004
-
15005
- }
14970
+ if (this.builder.cleanHtmlFormatting) ;
15006
14971
 
15007
14972
  const util = this.builder.util;
15008
14973
  const builderStuff = this.builder.builderStuff; //Prepare temporary helpers: #tmp_content & #tmp_buildercontent
@@ -15258,10 +15223,6 @@ class HtmlUtil {
15258
15223
  Array.prototype.forEach.call(emptyclasses, emptyclass => {
15259
15224
  emptyclass.removeAttribute('class');
15260
15225
  });
15261
- let emptystyles = tmp.querySelectorAll('[style=""]');
15262
- Array.prototype.forEach.call(emptystyles, emptystyle => {
15263
- emptystyle.removeAttribute('style');
15264
- });
15265
15226
  dom$h.removeEmptyStyle(tmp);
15266
15227
  elms = tmp.querySelectorAll('[data-keep]');
15267
15228
  dom$h.removeAttributes(elms, 'data-keep'); //Backward compatible: cleanup button <span contenteditable="false"><a contenteditable="true">button</a></span>
@@ -15281,6 +15242,20 @@ class HtmlUtil {
15281
15242
  // Remove dummy DIV after last section
15282
15243
  let elms = tmp.querySelectorAll('.is-dummy');
15283
15244
  dom$h.removeElements(elms);
15245
+ elms = tmp.querySelectorAll('[data-scroll]');
15246
+ dom$h.removeAttributes(elms, 'data-scroll');
15247
+ elms = tmp.querySelectorAll('[data-scroll-once]');
15248
+ dom$h.removeAttributes(elms, 'data-scroll-once');
15249
+ elms = tmp.querySelectorAll(`[data-top-bottom],[data-top],[data-50-top],[data-100-top],
15250
+ [data-center-bottom],[data-center],[data-center-top],[data--400-bottom],[data--300-bottom],
15251
+ [data--200-bottom],[data--150-bottom],[data--100-bottom],[data--50-bottom],
15252
+ [data-bottom],[data-50-bottom],[data-100-bottom],[data-150-bottom],[data-200-bottom],
15253
+ [data-300-bottom],[data-400-bottom],[data-bottom-top]`);
15254
+ Array.prototype.forEach.call(elms, elm => {
15255
+ elm.style.transition = '';
15256
+ elm.style.transform = '';
15257
+ elm.style.opacity = '';
15258
+ });
15284
15259
  elms = tmp.querySelectorAll('.is-animated');
15285
15260
  Array.prototype.forEach.call(elms, elm => {
15286
15261
  dom$h.removeClass(elm, 'animated');
@@ -15301,6 +15276,11 @@ class HtmlUtil {
15301
15276
  dom$h.removeClass(elm, 'slideInRight');
15302
15277
  dom$h.removeClass(elm, 'zoomIn');
15303
15278
  elm.style.animationDelay = '';
15279
+ elm.style.transitionDelay = '';
15280
+ });
15281
+ let emptystyles = tmp.querySelectorAll('[style=""]');
15282
+ Array.prototype.forEach.call(emptystyles, emptystyle => {
15283
+ emptystyle.removeAttribute('style');
15304
15284
  }); //Cleanup utils
15305
15285
 
15306
15286
  elms = tmp.querySelectorAll('.is-appeared');
@@ -15362,6 +15342,10 @@ class HtmlUtil {
15362
15342
  html = html_content + html_footer + html_others;
15363
15343
  }
15364
15344
  } else {
15345
+ let emptystyles = tmp.querySelectorAll('[style=""]');
15346
+ Array.prototype.forEach.call(emptystyles, emptystyle => {
15347
+ emptystyle.removeAttribute('style');
15348
+ });
15365
15349
  html = tmp.innerHTML.trim();
15366
15350
  html = html.replace(/<font/g, '<span').replace(/<\/font/g, '</span');
15367
15351
  }
@@ -15372,7 +15356,11 @@ class HtmlUtil {
15372
15356
  if (elm) builderStuff.removeChild(elm); // return html;
15373
15357
 
15374
15358
  let beautify = JsBeautify.html;
15375
- return beautify(html);
15359
+ html = beautify(html); // https://stackoverflow.com/questions/22962220/remove-multiple-line-breaks-n-in-javascript
15360
+ // html = html.replace(/(\r\n|\r|\n){2}/g, '$1').replace(/(\r\n|\r|\n){3,}/g, '$1\n')
15361
+
15362
+ html = html.replace(/(\r\n|\r|\n){3,}/g, '$1\n');
15363
+ return html;
15376
15364
  }
15377
15365
 
15378
15366
  }
@@ -17720,7 +17708,7 @@ class Grid {
17720
17708
  }
17721
17709
 
17722
17710
  const rowClass = builder.opts.row;
17723
- const colClass = builder.opts.cols;
17711
+ let colClass = builder.opts.cols;
17724
17712
  const colSizes = builder.opts.colsizes;
17725
17713
 
17726
17714
  if (rowClass !== '' && colClass.length > 0 && colSizes.length > 0) {
@@ -17773,6 +17761,21 @@ class Grid {
17773
17761
 
17774
17762
 
17775
17763
  if (rowClass !== '' && colClass.length > 0) {
17764
+ // Bootstrap stuff
17765
+ cell.classList.forEach(item => {
17766
+ if (item.indexOf('col-md-') !== -1) ; else if (item.indexOf('col-sm-') !== -1) {
17767
+ colClass = ['col-sm-1', 'col-sm-2', 'col-sm-3', 'col-sm-4', 'col-sm-5', 'col-sm-6', 'col-sm-7', 'col-sm-8', 'col-sm-9', 'col-sm-10', 'col-sm-11', 'col-sm-12'];
17768
+ } else if (item.indexOf('col-xs-') !== -1) {
17769
+ colClass = ['col-xs-1', 'col-xs-2', 'col-xs-3', 'col-xs-4', 'col-xs-5', 'col-xs-6', 'col-xs-7', 'col-xs-8', 'col-xs-9', 'col-xs-10', 'col-xs-11', 'col-xs-12'];
17770
+ } else if (item.indexOf('col-lg-') !== -1) {
17771
+ colClass = ['col-lg-1', 'col-lg-2', 'col-lg-3', 'col-lg-4', 'col-lg-5', 'col-lg-6', 'col-lg-7', 'col-lg-8', 'col-lg-9', 'col-lg-10', 'col-lg-11', 'col-lg-12'];
17772
+ } else if (item.indexOf('col-xl-') !== -1) {
17773
+ colClass = ['col-xl-1', 'col-xl-2', 'col-xl-3', 'col-xl-4', 'col-xl-5', 'col-xl-6', 'col-xl-7', 'col-xl-8', 'col-xl-9', 'col-xl-10', 'col-xl-11', 'col-xl-12'];
17774
+ } else if (item.indexOf('col-xxl-') !== -1) {
17775
+ colClass = ['col-xxl-1', 'col-xxl-2', 'col-xxl-3', 'col-xxl-4', 'col-xxl-5', 'col-xxl-6', 'col-xxl-7', 'col-xxl-8', 'col-xxl-9', 'col-xxl-10', 'col-xxl-11', 'col-xxl-12'];
17776
+ }
17777
+ });
17778
+
17776
17779
  if (!dom.hasClass(cell, colClass[11])) {
17777
17780
  //if not column full
17778
17781
  if (dom.hasClass(cell, colClass[11])) {
@@ -17879,7 +17882,7 @@ class Grid {
17879
17882
  }
17880
17883
 
17881
17884
  const rowClass = builder.opts.row;
17882
- const colClass = builder.opts.cols;
17885
+ let colClass = builder.opts.cols;
17883
17886
  const colSizes = builder.opts.colsizes;
17884
17887
 
17885
17888
  if (rowClass !== '' && colClass.length > 0 && colSizes.length > 0) {
@@ -17934,6 +17937,21 @@ class Grid {
17934
17937
 
17935
17938
 
17936
17939
  if (rowClass !== '' && colClass.length > 0) {
17940
+ // Bootstrap stuff
17941
+ cell.classList.forEach(item => {
17942
+ if (item.indexOf('col-md-') !== -1) ; else if (item.indexOf('col-sm-') !== -1) {
17943
+ colClass = ['col-sm-1', 'col-sm-2', 'col-sm-3', 'col-sm-4', 'col-sm-5', 'col-sm-6', 'col-sm-7', 'col-sm-8', 'col-sm-9', 'col-sm-10', 'col-sm-11', 'col-sm-12'];
17944
+ } else if (item.indexOf('col-xs-') !== -1) {
17945
+ colClass = ['col-xs-1', 'col-xs-2', 'col-xs-3', 'col-xs-4', 'col-xs-5', 'col-xs-6', 'col-xs-7', 'col-xs-8', 'col-xs-9', 'col-xs-10', 'col-xs-11', 'col-xs-12'];
17946
+ } else if (item.indexOf('col-lg-') !== -1) {
17947
+ colClass = ['col-lg-1', 'col-lg-2', 'col-lg-3', 'col-lg-4', 'col-lg-5', 'col-lg-6', 'col-lg-7', 'col-lg-8', 'col-lg-9', 'col-lg-10', 'col-lg-11', 'col-lg-12'];
17948
+ } else if (item.indexOf('col-xl-') !== -1) {
17949
+ colClass = ['col-xl-1', 'col-xl-2', 'col-xl-3', 'col-xl-4', 'col-xl-5', 'col-xl-6', 'col-xl-7', 'col-xl-8', 'col-xl-9', 'col-xl-10', 'col-xl-11', 'col-xl-12'];
17950
+ } else if (item.indexOf('col-xxl-') !== -1) {
17951
+ colClass = ['col-xxl-1', 'col-xxl-2', 'col-xxl-3', 'col-xxl-4', 'col-xxl-5', 'col-xxl-6', 'col-xxl-7', 'col-xxl-8', 'col-xxl-9', 'col-xxl-10', 'col-xxl-11', 'col-xxl-12'];
17952
+ }
17953
+ });
17954
+
17937
17955
  if (!dom.hasClass(cell, colClass[11])) {
17938
17956
  //if not column full
17939
17957
  if (dom.hasClass(cell, colClass[0])) {