@innovastudio/contentbuilder 1.3.49 → 1.3.51

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.3.49",
4
+ "version": "1.3.51",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -4586,19 +4586,18 @@ class Util {
4586
4586
  cols.forEach(col => {
4587
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
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
- });
4589
+ if (col.className.indexOf('col-md-') !== -1) ; else if (col.className.indexOf('col-sm-') !== -1) {
4590
+ 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'];
4591
+ } else if (col.className.indexOf('col-xs-') !== -1) {
4592
+ 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'];
4593
+ } else if (col.className.indexOf('col-lg-') !== -1) {
4594
+ 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'];
4595
+ } else if (col.className.indexOf('col-xl-') !== -1) {
4596
+ 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'];
4597
+ } else if (col.className.indexOf('col-xxl-') !== -1) {
4598
+ 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'];
4599
+ }
4600
+
4602
4601
  n++;
4603
4602
 
4604
4603
  for (var i = 0; i <= colClass.length - 1; i++) {
@@ -17771,19 +17770,17 @@ class Grid {
17771
17770
 
17772
17771
  if (rowClass !== '' && colClass.length > 0) {
17773
17772
  // Bootstrap stuff
17774
- cell.classList.forEach(item => {
17775
- if (item.indexOf('col-md-') !== -1) ; else if (item.indexOf('col-sm-') !== -1) {
17776
- 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'];
17777
- } else if (item.indexOf('col-xs-') !== -1) {
17778
- 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'];
17779
- } else if (item.indexOf('col-lg-') !== -1) {
17780
- 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'];
17781
- } else if (item.indexOf('col-xl-') !== -1) {
17782
- 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'];
17783
- } else if (item.indexOf('col-xxl-') !== -1) {
17784
- 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'];
17785
- }
17786
- });
17773
+ if (cell.className.indexOf('col-md-') !== -1) ; else if (cell.className.indexOf('col-sm-') !== -1) {
17774
+ 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'];
17775
+ } else if (cell.className.indexOf('col-xs-') !== -1) {
17776
+ 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'];
17777
+ } else if (cell.className.indexOf('col-lg-') !== -1) {
17778
+ 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'];
17779
+ } else if (cell.className.indexOf('col-xl-') !== -1) {
17780
+ 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'];
17781
+ } else if (cell.className.indexOf('col-xxl-') !== -1) {
17782
+ 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'];
17783
+ }
17787
17784
 
17788
17785
  if (!dom.hasClass(cell, colClass[11])) {
17789
17786
  //if not column full
@@ -17947,19 +17944,17 @@ class Grid {
17947
17944
 
17948
17945
  if (rowClass !== '' && colClass.length > 0) {
17949
17946
  // Bootstrap stuff
17950
- cell.classList.forEach(item => {
17951
- if (item.indexOf('col-md-') !== -1) ; else if (item.indexOf('col-sm-') !== -1) {
17952
- 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'];
17953
- } else if (item.indexOf('col-xs-') !== -1) {
17954
- 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'];
17955
- } else if (item.indexOf('col-lg-') !== -1) {
17956
- 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'];
17957
- } else if (item.indexOf('col-xl-') !== -1) {
17958
- 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'];
17959
- } else if (item.indexOf('col-xxl-') !== -1) {
17960
- 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'];
17961
- }
17962
- });
17947
+ if (cell.className.indexOf('col-md-') !== -1) ; else if (cell.className.indexOf('col-sm-') !== -1) {
17948
+ 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'];
17949
+ } else if (cell.className.indexOf('col-xs-') !== -1) {
17950
+ 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'];
17951
+ } else if (cell.className.indexOf('col-lg-') !== -1) {
17952
+ 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'];
17953
+ } else if (cell.className.indexOf('col-xl-') !== -1) {
17954
+ 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'];
17955
+ } else if (cell.className.indexOf('col-xxl-') !== -1) {
17956
+ 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'];
17957
+ }
17963
17958
 
17964
17959
  if (!dom.hasClass(cell, colClass[11])) {
17965
17960
  //if not column full
@@ -67120,6 +67115,7 @@ class Rte {
67120
67115
  let zoomButton = builderStuff.querySelectorAll('button.rte-zoom');
67121
67116
  zoomButton.forEach(btn => {
67122
67117
  dom.addEventListener(btn, 'click', () => {
67118
+ this.rteZoomSlider.value = this.builder.opts.zoom * 100;
67123
67119
  const pop = this.rteZoomOptions;
67124
67120
  const top = btn.getBoundingClientRect().top;
67125
67121
  const left = btn.getBoundingClientRect().left;
@@ -68627,6 +68623,83 @@ class Rte {
68627
68623
  });
68628
68624
  }
68629
68625
 
68626
+ zoomStart() {
68627
+ if (this.builder.onZoomStart) {
68628
+ this.builder.onZoomStart();
68629
+ }
68630
+ }
68631
+
68632
+ zoom(inp) {
68633
+ //scale: 0.5 - 1
68634
+ //val: 50 - 100
68635
+ let val = inp.value;
68636
+ let scale = val / 100;
68637
+ this.builder.opts.zoom = scale;
68638
+ localStorage.setItem('_zoom', scale); // Save
68639
+ // setZoomOnArea
68640
+
68641
+ this.builder.setZoomOnArea(); // hide tools
68642
+
68643
+ let tools = this.builder.doc.querySelectorAll('.is-tool');
68644
+ Array.prototype.forEach.call(tools, tool => {
68645
+ tool.style.display = '';
68646
+ });
68647
+ tools = this.builder.doc.querySelectorAll('.is-row-tool');
68648
+ tools.forEach(tool => {
68649
+ tool.style.display = 'none';
68650
+ });
68651
+ tools = this.builder.doc.querySelectorAll('.is-col-tool');
68652
+ tools.forEach(tool => {
68653
+ tool.style.display = 'none';
68654
+ });
68655
+ tools = this.builder.doc.querySelectorAll('.is-rowadd-tool');
68656
+ tools.forEach(tool => {
68657
+ tool.style.opacity = 0;
68658
+ });
68659
+
68660
+ if (this.builder.onZoom) {
68661
+ let val = inp.value;
68662
+ let scale = val / 100;
68663
+ this.builder.onZoom(scale);
68664
+ }
68665
+ }
68666
+
68667
+ zoomEnd(inp) {
68668
+ setTimeout(() => {
68669
+ // setZoomOnControl
68670
+ if (this.builder.opts.page !== '') {
68671
+ const wrapper = this.builder.doc.querySelector(this.builder.opts.page);
68672
+ this.builder.setZoomOnControl(wrapper);
68673
+ } else {
68674
+ const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
68675
+ builders.forEach(builder => {
68676
+ this.builder.setZoomOnControl(builder);
68677
+ });
68678
+ } // show & reposition
68679
+
68680
+
68681
+ this.builder.elmTool.repositionElementTool();
68682
+ let tools = this.builder.doc.querySelectorAll('.is-row-tool');
68683
+ tools.forEach(tool => {
68684
+ tool.style.display = '';
68685
+ });
68686
+ tools = this.builder.doc.querySelectorAll('.is-rowadd-tool');
68687
+ tools.forEach(tool => {
68688
+ tool.style.opacity = '';
68689
+ });
68690
+ tools = this.builder.doc.querySelectorAll('.is-col-tool');
68691
+ tools.forEach(tool => {
68692
+ tool.style.display = '';
68693
+ });
68694
+
68695
+ if (this.builder.onZoomEnd) {
68696
+ let val = inp.value;
68697
+ let scale = val / 100;
68698
+ this.builder.onZoomEnd(scale);
68699
+ }
68700
+ }, 300);
68701
+ }
68702
+
68630
68703
  insertImage() {
68631
68704
  const dom = this.dom;
68632
68705
  const modalInsertImage = this.builderStuff.querySelector('.insertimage');