@innovastudio/contentbuilder 1.0.72 → 1.0.78

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
- "version": "1.0.72",
3
+ "version": "1.0.78",
4
4
  "description": "",
5
5
  "main": "public/contentbuilder/contentbuilder.esm.js",
6
6
  "files": [
@@ -10915,8 +10915,8 @@ const renderQuickAdd = builder => {
10915
10915
  const html = `<div class="is-pop quickadd arrow-right" style="z-index:10003;">
10916
10916
  <div class="is-pop-close" style="display:none;z-index:1;width:40px;height:40px;position:absolute;top:0px;right:0px;box-sizing:border-box;padding:0;line-height:40px;font-size: 12px;color:#777;text-align:center;cursor:pointer;"><svg class="is-icon-flex" style="width:40px;height:40px;"><use xlink:href="#ion-ios-close-empty"></use></svg></div>
10917
10917
  <div class="is-pop-tabs">
10918
- <div class="is-pop-tab-item active" data-value="left">${util.out('Add to Left')}</div>
10919
- <div class="is-pop-tab-item" data-value="right">${util.out('Add to Right')}</div>
10918
+ <div class="is-pop-tab-item" data-value="left">${util.out('Add to Left')}</div>
10919
+ <div class="is-pop-tab-item active" data-value="right">${util.out('Add to Right')}</div>
10920
10920
  </div>
10921
10921
  <div style="padding:12px;display:flex;flex-direction:row;flex-flow: wrap;justify-content: center;align-items: center;">
10922
10922
  <button title="${util.out('Paragraph')}" class="add-paragraph"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-align-full"></use></svg></span>${util.out('Paragraph')}</button>
@@ -38850,9 +38850,9 @@ class Image {
38850
38850
  <button title="4x6" data-crop-size="0.6666" style="width: 40px;height: 60px;">4x6</button>
38851
38851
  <button title="${util.out('Free')}" data-crop-size="" style="width: 60px;height: 45px;">${util.out('Free')}</button>
38852
38852
  </div>
38853
- <div class="imageedit-preview" style="min-width:200px;">
38853
+ <div class="imageedit-preview" style="max-width:1000px;width:100%;max-height:550px;">
38854
38854
  </div>
38855
- <div style="margin-top:7px;text-align:right;align-self:flex-end;">
38855
+ <div style="margin-top:15px;text-align:right;align-self:flex-end;">
38856
38856
  <button title="${util.out('Cancel')}" class="input-cancel classic-secondary">${util.out('Cancel')}</button>
38857
38857
  <button title="${util.out('Apply')}" class="input-ok classic-primary">${util.out('Apply')}</button>
38858
38858
  </div>
@@ -39386,6 +39386,7 @@ class Image {
39386
39386
  let preview = modalImageEdit.querySelector('.imageedit-preview');
39387
39387
  const maxW = 800;
39388
39388
  const maxH = 550;
39389
+ preview.style.height = '';
39389
39390
 
39390
39391
  if (img.offsetWidth < maxW && img.offsetHeight < maxH) {
39391
39392
  preview.style.width = img.offsetWidth + 'px';
@@ -39400,7 +39401,7 @@ class Image {
39400
39401
  }
39401
39402
  }
39402
39403
 
39403
- preview.innerHTML = '<img src="" style="max-width:100%"/>';
39404
+ preview.innerHTML = '<img src="" style="max-width:100%;object-fit:contain;height:100%;"/>';
39404
39405
  let imagePreview = modalImageEdit.querySelector('img');
39405
39406
  imagePreview.src = img.src;
39406
39407
  this.cropper = new Cropper(imagePreview, {
@@ -52780,6 +52781,7 @@ class Rte {
52780
52781
  let rteIconOptions;
52781
52782
  let rteCustomTagOptions;
52782
52783
  let rteZoomSlider;
52784
+ let inpZoomSlider;
52783
52785
 
52784
52786
  if (!rteTool) {
52785
52787
  let customtag_button = '';
@@ -52886,7 +52888,13 @@ class Rte {
52886
52888
  html_iconrte = html_iconrte + `<button title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;
52887
52889
  }
52888
52890
  /* /Icon Buttons */
52889
- // <div class="is-draggable" style="width: 5px;height: 45pxpx;background:#fff;cursor: move;"></div>
52891
+
52892
+
52893
+ let html_fontsizes = '';
52894
+
52895
+ for (j = 0; j < builder.opts.defaultFontSizes.length; j++) {
52896
+ html_fontsizes += `<button title="${builder.opts.defaultFontSizes[j]}px" data-value="${builder.opts.defaultFontSizes[j]}">${builder.opts.defaultFontSizes[j]}</button>`;
52897
+ } // <div class="is-draggable" style="width: 5px;height: 45pxpx;background:#fff;cursor: move;"></div>
52890
52898
  // <div style="height:55px;background:#fff;border-top:#f5f5f5 1px solid;">
52891
52899
  // </div>
52892
52900
 
@@ -52961,23 +52969,7 @@ class Rte {
52961
52969
  <div>
52962
52970
  <div class="is-label">${util.out('Font Size')}</div>
52963
52971
  <div class="rte-fontsize-options" style="display: flex;flex-flow: wrap;">
52964
- <button title="14px" data-value="14">14</button>
52965
- <button title="16px" data-value="16">16</button>
52966
- <button title="18px" data-value="18">18</button>
52967
- <button title="21px" data-value="21">21</button>
52968
- <button title="24px" data-value="24">24</button>
52969
- <!--<button title="28px" data-value="28">28</button>-->
52970
- <button title="32px" data-value="32">32</button>
52971
- <!--<button title="38px" data-value="38">38</button>-->
52972
- <button title="48px" data-value="48">48</button>
52973
- <!--<button title="60px" data-value="60">60</button>-->
52974
- <button title="76px" data-value="76">76</button>
52975
- <button title="96px" data-value="96">96</button>
52976
-
52977
- <button title="120px" data-value="120">120</button>
52978
- <!--<button title="160px" data-value="160">160</button>-->
52979
- <button title="200px" data-value="200">200</button>
52980
- <button title="300px" data-value="300">300</button>
52972
+ ${html_fontsizes}
52981
52973
 
52982
52974
  <button title="${util.out('Decrease')}" data-value="-" style="font-size:13px">-</button>
52983
52975
  <button title="${util.out('Increase')}" data-value="+" style="font-size:13px">+</button>
@@ -53016,6 +53008,16 @@ class Rte {
53016
53008
  </div>
53017
53009
  </div>
53018
53010
 
53011
+ <div class="is-modal viewzoom">
53012
+ <div class="is-modal-content" style="max-width:250px;height:150px;display:flex;flex-flow:column;justify-content:center;">
53013
+ <div class="is-modal-bar is-draggable">${util.out('Zoom')}</div>
53014
+
53015
+ <div style="display:flex;flex-wrap:wrap;width:100%;padding-top:32px;">
53016
+ <input type="range" min="50" max="100" value="1" class="inp-zoom-slider is-rangeslider">
53017
+ </div>
53018
+ </div>
53019
+ </div>
53020
+
53019
53021
  <div class="is-modal insertimage">
53020
53022
  <div class="is-modal-content" style="max-width:560px;">
53021
53023
  <div class="is-browse-area">
@@ -53076,7 +53078,8 @@ class Rte {
53076
53078
  rteZoomOptions = builderStuff.querySelector('.rte-zoom-options');
53077
53079
  rteIconOptions = builderStuff.querySelector('.rte-icon-options');
53078
53080
  rteCustomTagOptions = builderStuff.querySelector('.rte-customtag-options');
53079
- rteZoomSlider = builderStuff.querySelector('.rte-zoom-slider'); // Prepare for tooltip
53081
+ rteZoomSlider = builderStuff.querySelector('.rte-zoom-slider');
53082
+ inpZoomSlider = builderStuff.querySelector('.inp-zoom-slider'); // Prepare for tooltip
53080
53083
 
53081
53084
  let elms = rteTool.querySelectorAll('[title]');
53082
53085
  Array.prototype.forEach.call(elms, elm => {
@@ -53138,6 +53141,7 @@ class Rte {
53138
53141
  this.rteIconOptions = rteIconOptions;
53139
53142
  this.rteCustomTagOptions = rteCustomTagOptions;
53140
53143
  this.rteZoomSlider = rteZoomSlider;
53144
+ this.inpZoomSlider = inpZoomSlider;
53141
53145
  this.positionToolbar(); // Formatting
53142
53146
 
53143
53147
  let btnRteFormatting = builderStuff.querySelectorAll('button.rte-formatting');
@@ -53889,6 +53893,91 @@ class Rte {
53889
53893
  this.builder.onZoomEnd(scale);
53890
53894
  }
53891
53895
  }, 300);
53896
+ }; // Zoom Modal
53897
+
53898
+
53899
+ this.inpZoomSlider.onfocus = () => {
53900
+ if (this.builder.onZoomStart) {
53901
+ this.builder.onZoomStart();
53902
+ }
53903
+
53904
+ this.inpZoomSlider.blur();
53905
+ };
53906
+
53907
+ this.inpZoomSlider.oninput = () => {
53908
+ //scale: 0.5 - 1
53909
+ //val: 50 - 100
53910
+ let val = this.inpZoomSlider.value;
53911
+ let scale = val / 100;
53912
+ this.builder.opts.zoom = scale;
53913
+ localStorage.setItem('_zoom', scale); // Save
53914
+ // setZoomOnArea
53915
+
53916
+ this.builder.setZoomOnArea(); // hide tools
53917
+
53918
+ /*
53919
+ let tools = this.builderStuff.querySelectorAll('.is-tool');
53920
+ Array.prototype.forEach.call(tools, (tool) => {
53921
+ tool.style.display = '';
53922
+ });
53923
+ let tool = this.builderStuff.querySelector('.is-column-tool');
53924
+ tool.style.display = 'none';
53925
+ tools = document.querySelectorAll('.is-row-tool');
53926
+ tools.forEach(tool=>{
53927
+ tool.style.display = 'none';
53928
+ });
53929
+ tools = document.querySelectorAll('.is-rowadd-tool');
53930
+ tools.forEach(tool=>{
53931
+ tool.style.opacity = 0;
53932
+ });
53933
+ */
53934
+
53935
+ if (this.builder.onZoom) {
53936
+ let val = this.inpZoomSlider.value;
53937
+ let scale = val / 100;
53938
+ this.builder.onZoom(scale);
53939
+ }
53940
+ };
53941
+
53942
+ this.inpZoomSlider.onchange = () => {
53943
+ setTimeout(() => {
53944
+ // setZoomOnControl
53945
+ if (this.builder.opts.page !== '') {
53946
+ const wrapper = document.querySelector(this.builder.opts.page);
53947
+ this.builder.setZoomOnControl(wrapper);
53948
+ } else {
53949
+ const builders = document.querySelectorAll(this.builder.opts.container);
53950
+ builders.forEach(builder => {
53951
+ this.builder.setZoomOnControl(builder);
53952
+ });
53953
+ } // show & reposition
53954
+
53955
+ /*
53956
+ this.builder.elmTool.repositionElementTool();
53957
+ let col = this.builder.activeCol;
53958
+ let tool = this.builderStuff.querySelector('.is-column-tool');
53959
+ tool.style.display = '';
53960
+ tool.style.top = (col.getBoundingClientRect().top - 29 + window.pageYOffset) + 'px';
53961
+ tool.style.left = (col.getBoundingClientRect().left - 1) + 'px';
53962
+ let tools = document.querySelectorAll('.is-row-tool');
53963
+ tools.forEach(tool=>{
53964
+ tool.style.display = '';
53965
+ });
53966
+ tools = document.querySelectorAll('.is-rowadd-tool');
53967
+ tools.forEach(tool=>{
53968
+ tool.style.opacity = '';
53969
+ });
53970
+ */
53971
+
53972
+
53973
+ if (this.builder.onZoomEnd) {
53974
+ let val = this.inpZoomSlider.value;
53975
+ let scale = val / 100;
53976
+ this.builder.onZoomEnd(scale);
53977
+ }
53978
+
53979
+ this.rteZoomSlider.value = this.inpZoomSlider.value;
53980
+ }, 300);
53892
53981
  }; // Text Settings
53893
53982
 
53894
53983
 
@@ -56905,6 +56994,13 @@ class Rte {
56905
56994
  }
56906
56995
  }
56907
56996
 
56997
+ viewZoom() {
56998
+ if (this.builder.onZoomOpen) this.builder.onZoomOpen();
56999
+ this.inpZoomSlider.value = this.builder.opts.zoom * 100;
57000
+ const modal = this.builderStuff.querySelector('.viewzoom');
57001
+ this.util.showModal(modal, false, null, false);
57002
+ }
57003
+
56908
57004
  }
56909
57005
 
56910
57006
  const dom$4 = new Dom();
@@ -57695,7 +57791,8 @@ class ContentBuilder {
57695
57791
  clearPreferences: false,
57696
57792
  toolbarAddSnippetButton: false,
57697
57793
  animateModal: true,
57698
- fontSizeClassValues: [12, 14, 16, 18, 21, 24, 28, 32, 35, 38, 42, 46, 48, 50, 54, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256, 260, 264, 268, 272, 276, 280, 284, 288, 292, 296, 300, 304, 308, 312, 316, 320, 324, 328, 332, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, 380, 384, 388, 392, 396, 400],
57794
+ defaultFontSizes: [16, 17, 18, 19, 24, 32, 48, 76, 96, 120, 200, 300],
57795
+ fontSizeClassValues: [12, 14, 15, 16, 17, 18, 19, 21, 24, 28, 32, 35, 38, 42, 46, 48, 50, 54, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256, 260, 264, 268, 272, 276, 280, 284, 288, 292, 296, 300, 304, 308, 312, 316, 320, 324, 328, 332, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, 380, 384, 388, 392, 396, 400],
57699
57796
 
57700
57797
  /* If not empty, applying font size will apply class: size-12, size-14, and so on. All responsive, defined in content.css */
57701
57798
  gradientcolors: [['linear-gradient(0deg, rgb(255, 57, 25), rgb(249, 168, 37))'], ['linear-gradient(0deg, rgb(255, 57, 25), rgb(255, 104, 15))'], ['linear-gradient(0deg, #FF5722, #FF9800)'], ['linear-gradient(0deg, #613ca2, rgb(110, 123, 217))'], ['linear-gradient(0deg, rgb(65, 70, 206), rgb(236, 78, 130))'], ['linear-gradient(0deg, rgb(0, 150, 102), rgb(90, 103, 197))'], ['linear-gradient(30deg, rgb(249, 119, 148), rgb(98, 58, 162))'], ['linear-gradient(0deg, rgb(223, 70, 137), rgb(90, 103, 197))'], ['linear-gradient(0deg, rgb(40, 53, 147), rgb(90, 103, 197))'], ['linear-gradient(0deg, rgb(21, 101, 192), rgb(52, 169, 239))'], ['linear-gradient(0deg, rgb(32, 149, 219), rgb(139, 109, 230))'], ['linear-gradient(0deg, rgb(90, 103, 197), rgb(0, 184, 201))'], ['linear-gradient(0deg, rgb(0, 184, 201), rgb(253, 187, 45))'], ['linear-gradient(0deg, rgb(255, 208, 100), rgb(239, 98, 159))'], ['linear-gradient(0deg, rgb(0, 214, 223), rgb(130, 162, 253))'], ['linear-gradient(0deg, rgb(50, 234, 251), rgb(248, 247, 126))'], ['linear-gradient(0deg, rgb(141, 221, 255), rgb(255, 227, 255))'], ['linear-gradient(0deg, rgb(255, 170, 170), rgb(255, 255, 200))'], ['linear-gradient(0deg, rgb(239, 239, 239), rgb(252, 252, 252))']],
@@ -59356,6 +59453,10 @@ class ContentBuilder {
59356
59453
  this.preferences.view();
59357
59454
  }
59358
59455
 
59456
+ viewZoom() {
59457
+ this.rte.viewZoom();
59458
+ }
59459
+
59359
59460
  loadSnippets(snippetFile) {
59360
59461
  if (this.preview) return;
59361
59462
  let snippetPanel = document.querySelector(this.opts.snippetList);