@innovastudio/contentbuilder 1.3.78 → 1.3.80

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.80",
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,
@@ -2921,7 +2921,7 @@ button:focus-visible {
2921
2921
  #_cbhtml .is-modal.viewconfig button.input-setcolor,
2922
2922
  .is-ui .is-modal.viewconfig button.input-setcolor {
2923
2923
  width: 27px;
2924
- height: 25px;
2924
+ height: 21px;
2925
2925
  border: transparent 2px solid;
2926
2926
  border-radius: 0px;
2927
2927
  }
@@ -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
  }
@@ -65298,7 +65305,7 @@ class Preferences {
65298
65305
 
65299
65306
  <div style="display:flex;flex-wrap:wrap;width:100%;padding-top:32px;">
65300
65307
  <div style="width:50%">
65301
- <label id="divBuilderMode" style="display:block;margin-top:14px;margin-bottom:5px;">
65308
+ <label id="divBuilderMode" style="display:block;margin-top:10px;margin-bottom:5px;">
65302
65309
  ${util.out('Builder Mode')}:&nbsp;
65303
65310
  <select class="select-buildermode">
65304
65311
  <option value="">${util.out('Default')}</option>
@@ -65307,7 +65314,7 @@ class Preferences {
65307
65314
  </select>
65308
65315
  </label>
65309
65316
 
65310
- <label id="divOutlineMode" style="display:block;margin-top:14px;margin-bottom:5px;">
65317
+ <label id="divOutlineMode" style="display:block;margin-top:10px;margin-bottom:5px;">
65311
65318
  ${util.out('Outline Mode')}:&nbsp;
65312
65319
  <select class="select-outlinemode">
65313
65320
  <option value="">${util.out('Row & column')}</option>
@@ -65315,7 +65322,7 @@ class Preferences {
65315
65322
  </select>
65316
65323
  </label>
65317
65324
 
65318
- <label style="display:block;margin-top:14px;margin-bottom:5px;">
65325
+ <label style="display:block;margin-top:10px;margin-bottom:5px;">
65319
65326
  ${util.out('Outline Style')}:&nbsp;
65320
65327
  <select class="select-outlinestyle">
65321
65328
  <option value="">${util.out('Colored')}</option>
@@ -65323,15 +65330,27 @@ class Preferences {
65323
65330
  </select>
65324
65331
  </label>
65325
65332
 
65326
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
65333
+ <label style="display:block;margin-top:10px;margin-bottom:10px;">
65327
65334
  <input class="input-hiderowcoloutline" type="checkbox" /> ${util.out('Hide Outline')}&nbsp;
65328
65335
  </label>
65329
65336
 
65330
- <label id="divHideCellTool" style="display:block;margin-top:14px;margin-bottom:10px;">
65337
+ <label id="divHideCellTool" style="display:block;margin-top:10px;margin-bottom:10px;">
65331
65338
  <input class="input-hidecelltool" type="checkbox" /> ${util.out('Hide Column Tool')}&nbsp;
65332
65339
  </label>
65333
65340
 
65334
- <label style="display:block;margin-top:5px;margin-bottom:5px;">
65341
+
65342
+ <label style="display:block;margin-top:10px;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:10px;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:10px;margin-bottom:10px;">
65351
+ <input class="input-hideelementhighlight" type="checkbox" /> ${util.out('Hide element highlight')}&nbsp;
65352
+ </label>
65353
+ <label style="display:block;margin-top:10px;margin-bottom:5px;">
65335
65354
  ${util.out('Row Tool Position')}:&nbsp;
65336
65355
  <select class="select-rowtool">
65337
65356
  <option value="right">${util.out('Right')}</option>
@@ -65339,7 +65358,7 @@ class Preferences {
65339
65358
  </select>
65340
65359
  </label>
65341
65360
 
65342
- <label style="display:block;margin-top:5px;margin-bottom:5px;">
65361
+ <label style="display:block;margin-top:10px;margin-bottom:5px;">
65343
65362
  ${util.out('Tool Style')}:&nbsp;
65344
65363
  <select class="select-toolstyle">
65345
65364
  <option value="">${util.out('Colored')}</option>
@@ -65350,23 +65369,11 @@ 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
- <label class="option-opensnippets" style="display:block;margin-top:14px;margin-bottom:10px;">
65372
+ <label class="option-opensnippets" style="display:block;margin-top:10px;margin-bottom:10px;">
65366
65373
  <input class="input-opensnippets" type="checkbox" /> ${util.out('Open snippets sidebar on start')}&nbsp;
65367
65374
  </label>
65368
65375
 
65369
- <label style="display:${builder.opts.snippetList === '#divSnippetList' ? 'block' : 'none'};margin-top:14px;margin-bottom:5px;">
65376
+ <label style="display:${builder.opts.snippetList === '#divSnippetList' ? 'block' : 'none'};margin-top:10px;margin-bottom:5px;">
65370
65377
  ${util.out('Snippets sidebar visibility')}:&nbsp;
65371
65378
  <select class="select-snippetssidebardisplay">
65372
65379
  <option value="auto">${util.out('Auto')}</option>
@@ -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="display:block;margin-top:10px;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>
@@ -65391,7 +65389,7 @@ class Preferences {
65391
65389
  </select>
65392
65390
  </label>
65393
65391
 
65394
- <label style="${this.builder.isTouchSupport ? 'display:none;' : 'display:block;'}margin-top:5px;margin-bottom:5px;">
65392
+ <label style="${this.builder.isTouchSupport ? 'display:none;' : 'display:block;'}margin-top:10px;margin-bottom:5px;">
65395
65393
  ${util.out('Toolbar position')}:&nbsp;
65396
65394
  <select class="select-editingtoolbar">
65397
65395
  <option value="topfull">${util.out('Top (Full Width)')}</option>
@@ -65401,8 +65399,25 @@ class Preferences {
65401
65399
  </select>
65402
65400
  </label>
65403
65401
 
65402
+ <label style="display:block;margin-top:10px;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:10px;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
- <label style="${this.builder.isTouchSupport ? 'display:none;' : 'display:block;'}margin-top:5px;margin-bottom:5px;">
65420
+ <label style="${this.builder.isTouchSupport ? 'display:none;' : 'display:block;'}margin-top:10px;margin-bottom:5px;">
65406
65421
  ${util.out('Theme')}:&nbsp;
65407
65422
  </label>
65408
65423
  ${htmlThemes}
@@ -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 () { },