@innovastudio/contentbuilder 1.3.78 → 1.3.79

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.78",
4
+ "version": "1.3.79",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -2065,7 +2065,7 @@ button:focus-visible {
2065
2065
  }
2066
2066
  #_cbhtml .is-modal.viewconfig div.is-modal-content,
2067
2067
  .is-ui .is-modal.viewconfig div.is-modal-content {
2068
- max-width: 700px;
2068
+ max-width: 750px;
2069
2069
  padding: 5px 25px 25px 25px;
2070
2070
  }
2071
2071
  #_cbhtml .is-modal.viewhtml, #_cbhtml .is-modal.viewhtmlformatted, #_cbhtml .is-modal.viewhtmlnormal,
@@ -5664,6 +5664,7 @@ class Util {
5664
5664
 
5665
5665
  localStorage.removeItem('_snippetssidebardisplay'); //snippetsSidebarDisplay
5666
5666
 
5667
+ localStorage.removeItem('_htmlview');
5667
5668
  localStorage.removeItem('_pasteresult'); //DON'T HAVE PROP
5668
5669
  //NOT USED
5669
5670
 
@@ -14688,9 +14689,10 @@ class HtmlUtil {
14688
14689
 
14689
14690
  let range = document.createRange();
14690
14691
  range.setStart(area, 0);
14691
- area.appendChild(range.createContextualFragment(html));
14692
- let builderActive = this.builder.doc.querySelector('.builder-active');
14693
- if (builderActive) this.builder.applyBehaviorOn(builderActive);
14692
+ area.appendChild(range.createContextualFragment(html)); // let builderActive = this.builder.doc.querySelector('.builder-active');
14693
+ // if(builderActive) this.builder.applyBehaviorOn(builderActive);
14694
+
14695
+ this.builder.applyBehaviorOn(area);
14694
14696
  /*else {
14695
14697
  const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
14696
14698
  if(builders.length > 1) {
@@ -14919,8 +14921,13 @@ class HtmlUtil {
14919
14921
  }
14920
14922
 
14921
14923
  let textarea = viewhtml.querySelector('textarea');
14922
- this.builder.cleanHtmlFormatting = true;
14923
- textarea.value = this.readHtml(area, true); // for view=true
14924
+ this.builder.cleanHtmlFormatting = true; // textarea.value = this.readHtml(area, true); // for view=true
14925
+
14926
+ if (this.builder.shortenHTML) {
14927
+ textarea.value = this.readHtml(area, true); // for view=true
14928
+ } else {
14929
+ textarea.value = this.readHtml(area, false); // actual
14930
+ }
14924
14931
 
14925
14932
  this.builder.cleanHtmlFormatting = false;
14926
14933
  }
@@ -65331,6 +65338,18 @@ class Preferences {
65331
65338
  <input class="input-hidecelltool" type="checkbox" /> ${util.out('Hide Column Tool')}&nbsp;
65332
65339
  </label>
65333
65340
 
65341
+
65342
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
65343
+ <input class="input-hidesnippetaddtool" type="checkbox" /> ${util.out('Hide Snippet (+) Tool')}&nbsp;
65344
+ </label>
65345
+
65346
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
65347
+ <input class="input-hideelementtool" type="checkbox" /> ${util.out('Hide element tool')}&nbsp;
65348
+ </label>
65349
+
65350
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
65351
+ <input class="input-hideelementhighlight" type="checkbox" /> ${util.out('Hide element highlight')}&nbsp;
65352
+ </label>
65334
65353
  <label style="display:block;margin-top:5px;margin-bottom:5px;">
65335
65354
  ${util.out('Row Tool Position')}:&nbsp;
65336
65355
  <select class="select-rowtool">
@@ -65350,18 +65369,6 @@ class Preferences {
65350
65369
  </div>
65351
65370
  <div style="width:50%">
65352
65371
 
65353
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
65354
- <input class="input-hidesnippetaddtool" type="checkbox" /> ${util.out('Hide Snippet (+) Tool')}&nbsp;
65355
- </label>
65356
-
65357
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
65358
- <input class="input-hideelementtool" type="checkbox" /> ${util.out('Hide element tool')}&nbsp;
65359
- </label>
65360
-
65361
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
65362
- <input class="input-hideelementhighlight" type="checkbox" /> ${util.out('Hide element highlight')}&nbsp;
65363
- </label>
65364
-
65365
65372
  <label class="option-opensnippets" style="display:block;margin-top:14px;margin-bottom:10px;">
65366
65373
  <input class="input-opensnippets" type="checkbox" /> ${util.out('Open snippets sidebar on start')}&nbsp;
65367
65374
  </label>
@@ -65374,16 +65381,7 @@ class Preferences {
65374
65381
  </select>
65375
65382
  </label>
65376
65383
 
65377
- <label style="display:block;margin-top:5px;margin-bottom:5px;">
65378
- ${util.out('Paste result')}:&nbsp;
65379
- <select class="select-pasteresult">
65380
- <option value="html-without-styles">${util.out('HTML (without styles)')}</option>
65381
- <option value="html">${util.out('HTML (with styles)')}</option>
65382
- <option value="text">${util.out('Text only')}</option>
65383
- </select>
65384
- </label>
65385
-
65386
- <label style="display:none;margin-top:14px;margin-bottom:5px;">
65384
+ <label style="margin-top:14px;margin-bottom:5px;">
65387
65385
  ${util.out('Toolbar visibility')}:&nbsp;
65388
65386
  <select class="select-editingtoolbardisplay">
65389
65387
  <option value="auto">${util.out('Auto')}</option>
@@ -65401,6 +65399,23 @@ class Preferences {
65401
65399
  </select>
65402
65400
  </label>
65403
65401
 
65402
+ <label style="display:block;margin-top:5px;margin-bottom:5px;">
65403
+ ${util.out('Paste result')}:&nbsp;
65404
+ <select class="select-pasteresult">
65405
+ <option value="html-without-styles">${util.out('HTML (without styles)')}</option>
65406
+ <option value="html">${util.out('HTML (with styles)')}</option>
65407
+ <option value="text">${util.out('Text only')}</option>
65408
+ </select>
65409
+ </label>
65410
+
65411
+ <label style="display:block;margin-top:5px;margin-bottom:5px;">
65412
+ ${util.out('HTML View')}:&nbsp;
65413
+ <select class="select-htmlview">
65414
+ <option value="shorten">${util.out('Shorten HTML')}</option>
65415
+ <option value="actual">${util.out('Actual')}</option>
65416
+ </select>
65417
+ </label>
65418
+
65404
65419
  ${this.builder.themes ? `
65405
65420
  <label style="${this.builder.isTouchSupport ? 'display:none;' : 'display:block;'}margin-top:5px;margin-bottom:5px;">
65406
65421
  ${util.out('Theme')}:&nbsp;
@@ -65459,6 +65474,16 @@ class Preferences {
65459
65474
  this.builder.opts.paste = localStorage.getItem('_pasteresult');
65460
65475
  }
65461
65476
 
65477
+ if (localStorage.getItem('_htmlview') !== null) {
65478
+ let htmlView = localStorage.getItem('_htmlview');
65479
+
65480
+ if (htmlView === 'shorten') {
65481
+ this.builder.opts.shortenHTML = true;
65482
+ } else {
65483
+ this.builder.opts.shortenHTML = false;
65484
+ }
65485
+ }
65486
+
65462
65487
  if (localStorage.getItem('_hidecelltool') !== null) {
65463
65488
  if (localStorage.getItem('_hidecelltool') === '1') {
65464
65489
  this.builder.opts.columnTool = false;
@@ -65524,12 +65549,13 @@ class Preferences {
65524
65549
  }
65525
65550
 
65526
65551
  this.setToolStyle(this.builder.opts.toolStyle); // Always Auto
65527
- // if (localStorage.getItem('_editingtoolbardisplay') !== null) {
65528
- // this.builder.opts.toolbarDisplay = localStorage.getItem('_editingtoolbardisplay');
65529
- // }
65530
- // this.builder.opts.toolbarDisplay = 'auto';
65552
+
65553
+ if (localStorage.getItem('_editingtoolbardisplay') !== null) {
65554
+ this.builder.opts.toolbarDisplay = localStorage.getItem('_editingtoolbardisplay');
65555
+ } // this.builder.opts.toolbarDisplay = 'auto';
65531
65556
  // this.setToolbarDisplay(this.builder.opts.toolbarDisplay);
65532
65557
 
65558
+
65533
65559
  if (localStorage.getItem('_snippetssidebardisplay') !== null) {
65534
65560
  this.builder.opts.snippetsSidebarDisplay = localStorage.getItem('_snippetssidebardisplay');
65535
65561
  }
@@ -65655,6 +65681,12 @@ class Preferences {
65655
65681
  this.config.querySelector('.select-editingtoolbardisplay').value = this.builder.opts.toolbarDisplay;
65656
65682
  this.config.querySelector('.select-editingtoolbar').value = this.builder.opts.toolbar;
65657
65683
  this.config.querySelector('.select-snippetssidebardisplay').value = this.builder.opts.snippetsSidebarDisplay;
65684
+
65685
+ if (this.builder.opts.shortenHTML) {
65686
+ this.config.querySelector('.select-htmlview').value = 'shorten';
65687
+ } else {
65688
+ this.config.querySelector('.select-htmlview').value = 'actual';
65689
+ }
65658
65690
  }
65659
65691
 
65660
65692
  update() {
@@ -65750,10 +65782,10 @@ class Preferences {
65750
65782
  this.setToolStyle(toolStyle);
65751
65783
  let pasteResult = this.config.querySelector('.select-pasteresult').value;
65752
65784
  this.builder.opts.paste = pasteResult;
65753
- localStorage.setItem('_pasteresult', pasteResult); // let toolbarDisplay = this.config.querySelector('.select-editingtoolbardisplay').value;
65754
- // this.builder.opts.toolbarDisplay = toolbarDisplay;
65755
- // localStorage.setItem('_editingtoolbardisplay', toolbarDisplay);
65756
- // this.setToolbarDisplay(toolbarDisplay);
65785
+ localStorage.setItem('_pasteresult', pasteResult);
65786
+ let toolbarDisplay = this.config.querySelector('.select-editingtoolbardisplay').value;
65787
+ this.builder.opts.toolbarDisplay = toolbarDisplay;
65788
+ localStorage.setItem('_editingtoolbardisplay', toolbarDisplay); // this.setToolbarDisplay(toolbarDisplay);
65757
65789
 
65758
65790
  let snippetsSidebarDisplay = this.config.querySelector('.select-snippetssidebardisplay').value;
65759
65791
  this.builder.opts.snippetsSidebarDisplay = snippetsSidebarDisplay;
@@ -65762,6 +65794,15 @@ class Preferences {
65762
65794
  this.builder.opts.toolbar = toolbar;
65763
65795
  localStorage.setItem('_editingtoolbar', toolbar);
65764
65796
  this.setToolbar(toolbar);
65797
+ let htmlView = this.config.querySelector('.select-htmlview').value;
65798
+
65799
+ if (htmlView === 'shorten') {
65800
+ this.builder.opts.shortenHTML = true;
65801
+ } else {
65802
+ this.builder.opts.shortenHTML = false;
65803
+ }
65804
+
65805
+ localStorage.setItem('_htmlview', htmlView);
65765
65806
 
65766
65807
  if (this.builder.themes) {
65767
65808
  const n = this.builder.themeIndex;
@@ -74890,6 +74931,7 @@ class ContentBuilder {
74890
74931
  snippetOpen: false,
74891
74932
  toolbar: 'top',
74892
74933
  toolbarDisplay: 'auto',
74934
+ shortenHTML: true,
74893
74935
  snippetsSidebarDisplay: 'auto',
74894
74936
  // snippetDisplay: 'auto', // values: auto, visible (a new alternative). If used, will set the snippetsSidebarDisplay
74895
74937
  // onImageSelectClick: function () { },