@innovastudio/contentbox 1.4.67 → 1.4.68

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/contentbox",
3
3
  "type": "module",
4
- "version": "1.4.67",
4
+ "version": "1.4.68",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -46,7 +46,7 @@
46
46
  "webpack-dev-server": "^4.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@innovastudio/contentbuilder": "^1.3.78",
49
+ "@innovastudio/contentbuilder": "^1.3.79",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -1032,6 +1032,17 @@ class SideBar {
1032
1032
 
1033
1033
  viewHtml() {
1034
1034
  const builderStuff = this.builderStuff;
1035
+
1036
+ if (localStorage.getItem('_htmlview') !== null) {
1037
+ let htmlView = localStorage.getItem('_htmlview');
1038
+
1039
+ if (htmlView === 'shorten') {
1040
+ this.builder.shortenHTML = true;
1041
+ } else {
1042
+ this.builder.shortenHTML = false;
1043
+ }
1044
+ }
1045
+
1035
1046
  let html;
1036
1047
 
1037
1048
  if (this.builder.shortenHTML) {
@@ -19391,6 +19402,7 @@ class Util {
19391
19402
 
19392
19403
  localStorage.removeItem('_snippetssidebardisplay'); //snippetsSidebarDisplay
19393
19404
 
19405
+ localStorage.removeItem('_htmlview');
19394
19406
  localStorage.removeItem('_pasteresult'); //DON'T HAVE PROP
19395
19407
  //NOT USED
19396
19408
 
@@ -28415,9 +28427,10 @@ class HtmlUtil {
28415
28427
 
28416
28428
  let range = document.createRange();
28417
28429
  range.setStart(area, 0);
28418
- area.appendChild(range.createContextualFragment(html));
28419
- let builderActive = this.builder.doc.querySelector('.builder-active');
28420
- if (builderActive) this.builder.applyBehaviorOn(builderActive);
28430
+ area.appendChild(range.createContextualFragment(html)); // let builderActive = this.builder.doc.querySelector('.builder-active');
28431
+ // if(builderActive) this.builder.applyBehaviorOn(builderActive);
28432
+
28433
+ this.builder.applyBehaviorOn(area);
28421
28434
  /*else {
28422
28435
  const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
28423
28436
  if(builders.length > 1) {
@@ -28646,8 +28659,13 @@ class HtmlUtil {
28646
28659
  }
28647
28660
 
28648
28661
  let textarea = viewhtml.querySelector('textarea');
28649
- this.builder.cleanHtmlFormatting = true;
28650
- textarea.value = this.readHtml(area, true); // for view=true
28662
+ this.builder.cleanHtmlFormatting = true; // textarea.value = this.readHtml(area, true); // for view=true
28663
+
28664
+ if (this.builder.shortenHTML) {
28665
+ textarea.value = this.readHtml(area, true); // for view=true
28666
+ } else {
28667
+ textarea.value = this.readHtml(area, false); // actual
28668
+ }
28651
28669
 
28652
28670
  this.builder.cleanHtmlFormatting = false;
28653
28671
  }
@@ -79058,6 +79076,18 @@ class Preferences {
79058
79076
  <input class="input-hidecelltool" type="checkbox" /> ${util.out('Hide Column Tool')}&nbsp;
79059
79077
  </label>
79060
79078
 
79079
+
79080
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
79081
+ <input class="input-hidesnippetaddtool" type="checkbox" /> ${util.out('Hide Snippet (+) Tool')}&nbsp;
79082
+ </label>
79083
+
79084
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
79085
+ <input class="input-hideelementtool" type="checkbox" /> ${util.out('Hide element tool')}&nbsp;
79086
+ </label>
79087
+
79088
+ <label style="display:block;margin-top:14px;margin-bottom:10px;">
79089
+ <input class="input-hideelementhighlight" type="checkbox" /> ${util.out('Hide element highlight')}&nbsp;
79090
+ </label>
79061
79091
  <label style="display:block;margin-top:5px;margin-bottom:5px;">
79062
79092
  ${util.out('Row Tool Position')}:&nbsp;
79063
79093
  <select class="select-rowtool">
@@ -79077,18 +79107,6 @@ class Preferences {
79077
79107
  </div>
79078
79108
  <div style="width:50%">
79079
79109
 
79080
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
79081
- <input class="input-hidesnippetaddtool" type="checkbox" /> ${util.out('Hide Snippet (+) Tool')}&nbsp;
79082
- </label>
79083
-
79084
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
79085
- <input class="input-hideelementtool" type="checkbox" /> ${util.out('Hide element tool')}&nbsp;
79086
- </label>
79087
-
79088
- <label style="display:block;margin-top:14px;margin-bottom:10px;">
79089
- <input class="input-hideelementhighlight" type="checkbox" /> ${util.out('Hide element highlight')}&nbsp;
79090
- </label>
79091
-
79092
79110
  <label class="option-opensnippets" style="display:block;margin-top:14px;margin-bottom:10px;">
79093
79111
  <input class="input-opensnippets" type="checkbox" /> ${util.out('Open snippets sidebar on start')}&nbsp;
79094
79112
  </label>
@@ -79101,16 +79119,7 @@ class Preferences {
79101
79119
  </select>
79102
79120
  </label>
79103
79121
 
79104
- <label style="display:block;margin-top:5px;margin-bottom:5px;">
79105
- ${util.out('Paste result')}:&nbsp;
79106
- <select class="select-pasteresult">
79107
- <option value="html-without-styles">${util.out('HTML (without styles)')}</option>
79108
- <option value="html">${util.out('HTML (with styles)')}</option>
79109
- <option value="text">${util.out('Text only')}</option>
79110
- </select>
79111
- </label>
79112
-
79113
- <label style="display:none;margin-top:14px;margin-bottom:5px;">
79122
+ <label style="margin-top:14px;margin-bottom:5px;">
79114
79123
  ${util.out('Toolbar visibility')}:&nbsp;
79115
79124
  <select class="select-editingtoolbardisplay">
79116
79125
  <option value="auto">${util.out('Auto')}</option>
@@ -79128,6 +79137,23 @@ class Preferences {
79128
79137
  </select>
79129
79138
  </label>
79130
79139
 
79140
+ <label style="display:block;margin-top:5px;margin-bottom:5px;">
79141
+ ${util.out('Paste result')}:&nbsp;
79142
+ <select class="select-pasteresult">
79143
+ <option value="html-without-styles">${util.out('HTML (without styles)')}</option>
79144
+ <option value="html">${util.out('HTML (with styles)')}</option>
79145
+ <option value="text">${util.out('Text only')}</option>
79146
+ </select>
79147
+ </label>
79148
+
79149
+ <label style="display:block;margin-top:5px;margin-bottom:5px;">
79150
+ ${util.out('HTML View')}:&nbsp;
79151
+ <select class="select-htmlview">
79152
+ <option value="shorten">${util.out('Shorten HTML')}</option>
79153
+ <option value="actual">${util.out('Actual')}</option>
79154
+ </select>
79155
+ </label>
79156
+
79131
79157
  ${this.builder.themes ? `
79132
79158
  <label style="${this.builder.isTouchSupport ? 'display:none;' : 'display:block;'}margin-top:5px;margin-bottom:5px;">
79133
79159
  ${util.out('Theme')}:&nbsp;
@@ -79186,6 +79212,16 @@ class Preferences {
79186
79212
  this.builder.opts.paste = localStorage.getItem('_pasteresult');
79187
79213
  }
79188
79214
 
79215
+ if (localStorage.getItem('_htmlview') !== null) {
79216
+ let htmlView = localStorage.getItem('_htmlview');
79217
+
79218
+ if (htmlView === 'shorten') {
79219
+ this.builder.opts.shortenHTML = true;
79220
+ } else {
79221
+ this.builder.opts.shortenHTML = false;
79222
+ }
79223
+ }
79224
+
79189
79225
  if (localStorage.getItem('_hidecelltool') !== null) {
79190
79226
  if (localStorage.getItem('_hidecelltool') === '1') {
79191
79227
  this.builder.opts.columnTool = false;
@@ -79251,12 +79287,13 @@ class Preferences {
79251
79287
  }
79252
79288
 
79253
79289
  this.setToolStyle(this.builder.opts.toolStyle); // Always Auto
79254
- // if (localStorage.getItem('_editingtoolbardisplay') !== null) {
79255
- // this.builder.opts.toolbarDisplay = localStorage.getItem('_editingtoolbardisplay');
79256
- // }
79257
- // this.builder.opts.toolbarDisplay = 'auto';
79290
+
79291
+ if (localStorage.getItem('_editingtoolbardisplay') !== null) {
79292
+ this.builder.opts.toolbarDisplay = localStorage.getItem('_editingtoolbardisplay');
79293
+ } // this.builder.opts.toolbarDisplay = 'auto';
79258
79294
  // this.setToolbarDisplay(this.builder.opts.toolbarDisplay);
79259
79295
 
79296
+
79260
79297
  if (localStorage.getItem('_snippetssidebardisplay') !== null) {
79261
79298
  this.builder.opts.snippetsSidebarDisplay = localStorage.getItem('_snippetssidebardisplay');
79262
79299
  }
@@ -79382,6 +79419,12 @@ class Preferences {
79382
79419
  this.config.querySelector('.select-editingtoolbardisplay').value = this.builder.opts.toolbarDisplay;
79383
79420
  this.config.querySelector('.select-editingtoolbar').value = this.builder.opts.toolbar;
79384
79421
  this.config.querySelector('.select-snippetssidebardisplay').value = this.builder.opts.snippetsSidebarDisplay;
79422
+
79423
+ if (this.builder.opts.shortenHTML) {
79424
+ this.config.querySelector('.select-htmlview').value = 'shorten';
79425
+ } else {
79426
+ this.config.querySelector('.select-htmlview').value = 'actual';
79427
+ }
79385
79428
  }
79386
79429
 
79387
79430
  update() {
@@ -79477,10 +79520,10 @@ class Preferences {
79477
79520
  this.setToolStyle(toolStyle);
79478
79521
  let pasteResult = this.config.querySelector('.select-pasteresult').value;
79479
79522
  this.builder.opts.paste = pasteResult;
79480
- localStorage.setItem('_pasteresult', pasteResult); // let toolbarDisplay = this.config.querySelector('.select-editingtoolbardisplay').value;
79481
- // this.builder.opts.toolbarDisplay = toolbarDisplay;
79482
- // localStorage.setItem('_editingtoolbardisplay', toolbarDisplay);
79483
- // this.setToolbarDisplay(toolbarDisplay);
79523
+ localStorage.setItem('_pasteresult', pasteResult);
79524
+ let toolbarDisplay = this.config.querySelector('.select-editingtoolbardisplay').value;
79525
+ this.builder.opts.toolbarDisplay = toolbarDisplay;
79526
+ localStorage.setItem('_editingtoolbardisplay', toolbarDisplay); // this.setToolbarDisplay(toolbarDisplay);
79484
79527
 
79485
79528
  let snippetsSidebarDisplay = this.config.querySelector('.select-snippetssidebardisplay').value;
79486
79529
  this.builder.opts.snippetsSidebarDisplay = snippetsSidebarDisplay;
@@ -79489,6 +79532,15 @@ class Preferences {
79489
79532
  this.builder.opts.toolbar = toolbar;
79490
79533
  localStorage.setItem('_editingtoolbar', toolbar);
79491
79534
  this.setToolbar(toolbar);
79535
+ let htmlView = this.config.querySelector('.select-htmlview').value;
79536
+
79537
+ if (htmlView === 'shorten') {
79538
+ this.builder.opts.shortenHTML = true;
79539
+ } else {
79540
+ this.builder.opts.shortenHTML = false;
79541
+ }
79542
+
79543
+ localStorage.setItem('_htmlview', htmlView);
79492
79544
 
79493
79545
  if (this.builder.themes) {
79494
79546
  const n = this.builder.themeIndex;
@@ -88617,6 +88669,7 @@ class ContentBuilder {
88617
88669
  snippetOpen: false,
88618
88670
  toolbar: 'top',
88619
88671
  toolbarDisplay: 'auto',
88672
+ shortenHTML: true,
88620
88673
  snippetsSidebarDisplay: 'auto',
88621
88674
  // snippetDisplay: 'auto', // values: auto, visible (a new alternative). If used, will set the snippetsSidebarDisplay
88622
88675
  // onImageSelectClick: function () { },
@@ -103646,6 +103699,7 @@ class ContentBox {
103646
103699
  useButtonPlugin: this.settings.useButtonPlugin,
103647
103700
  enableDragResize: this.settings.enableDragResize,
103648
103701
  simpleTextSettings: this.settings.simpleTextSettings,
103702
+ shortenHTML: this.settings.shortenHTML,
103649
103703
  zoom: this.settings.zoom,
103650
103704
  onZoomStart: () => {
103651
103705
  const wrapper = this.wrapperEl; // wrapper.style.transition = 'all ease 0.1s';