@innovastudio/contentbuilder 1.5.77 → 1.5.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.5.77",
4
+ "version": "1.5.79",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -1494,10 +1494,10 @@ const renderQuickAdd = builder => {
1494
1494
  elm = quickadd.querySelector('.add-video');
1495
1495
  dom.addEventListener(elm, 'click', () => {
1496
1496
  const mode = quickadd.getAttribute('data-mode');
1497
- let html = `<video style="width: 100%;" loop="" autoplay="">
1497
+ let html = `<video style="width: 100%;" loop="" playsinline="" muted="" autoplay="">
1498
1498
  <source src="${builder.opts.snippetPath}example.mp4" type="video/mp4"></video>`;
1499
1499
  if (builder.opts.snippetSampleVideo) {
1500
- html = `<video style="width: 100%;" loop="" autoplay="">
1500
+ html = `<video style="width: 100%;" loop="" playsinline="" muted="" autoplay="">
1501
1501
  <source src="${builder.opts.snippetSampleVideo}" type="video/mp4"></video>`;
1502
1502
  }
1503
1503
  util.addContent(html, mode);
@@ -5334,15 +5334,15 @@ class Util {
5334
5334
  } else {
5335
5335
  newelement.click();
5336
5336
  }
5337
- const builderStuff = this.builder.builderStuff;
5338
- let quickadd = builderStuff.querySelector('.quickadd');
5339
- this.hidePop(quickadd);
5340
5337
 
5341
5338
  // LATER: auto scroll
5342
5339
 
5343
5340
  // LATER: If image, then it needs time to load (resulting incorrect position), so hide element tool.
5344
5341
  }
5345
5342
 
5343
+ const builderStuff = this.builder.builderStuff;
5344
+ let quickadd = builderStuff.querySelector('.quickadd');
5345
+ if (quickadd) this.hidePop(quickadd);
5346
5346
  if (this.builder.useCssClasses) {
5347
5347
  let builderActive = this.builder.doc.querySelector('.builder-active');
5348
5348
  if (builderActive) dom.contentReformat(builderActive, this.builder.cssClasses);
@@ -14637,6 +14637,16 @@ class HtmlUtil {
14637
14637
  imgUrl = convertMediaUrl(imgUrl);
14638
14638
  elm.setAttribute('href', `${imgUrl}`);
14639
14639
  }
14640
+ if (elm.tagName.toLowerCase() === 'a') {
14641
+ //lightbox
14642
+ let s = elm.getAttribute('href');
14643
+ let extension = s.split('.').pop().split('?')[0].split('#')[0]; //
14644
+ extension = extension.toLowerCase();
14645
+ if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp' || extension === 'mp4' || extension === 'mp3') {
14646
+ let mediaUrl = convertMediaUrl(s);
14647
+ elm.setAttribute('href', `${mediaUrl}`);
14648
+ }
14649
+ }
14640
14650
  }
14641
14651
  });
14642
14652
  }
@@ -17876,6 +17886,7 @@ const renderSnippetPanel = (builder, snippetOpen) => {
17876
17886
  block.offsetWidth / 2;
17877
17887
  let x = (snippetX - block.offsetWidth / 2 - rectContainer.left) / docContainer.offsetWidth * 100;
17878
17888
  let y = (snippetY - block.offsetHeight / 2 - rectContainer.top) / docContainer.offsetHeight * 100;
17889
+ if (y < 0) y = 15; // if block is not fully loaded, block height may be incorrect (y can be negative). Adjust to 15%.
17879
17890
  block.style.top = y + '%';
17880
17891
  block.style.left = x + '%';
17881
17892
  block.removeAttribute('data-new-dummy');
@@ -46779,7 +46790,7 @@ class ButtonEditor {
46779
46790
  <div class="flex flex-row" style="margin:15px 0 0">
46780
46791
  <div class="flex flex-col" style="margin-right: 40px;">
46781
46792
  <div>
46782
- <span>${util.out('Border Color')}</span>:
46793
+ <span>${util.out('Border Style')}</span>:
46783
46794
  </div>
46784
46795
  <div class="flex flex-row flex-wrap" style="margin-top:5px">
46785
46796
  <button title="${util.out('Transparent')}" data-command="transparent" class="border-color-command" style="margin-right:4px">${util.out('Transparent')}</button>
@@ -46969,7 +46980,7 @@ class ButtonEditor {
46969
46980
 
46970
46981
  <div class="flex flex-col" style="margin:15px 0 0">
46971
46982
  <div>
46972
- <span>${util.out('Border Color')}</span>:
46983
+ <span>${util.out('Border Style')}</span>:
46973
46984
  </div>
46974
46985
  <div class="flex flex-row flex-wrap" style="margin-top:5px">
46975
46986
  <button title="${util.out('Transparent')}" data-command="transparent" class="border-color-hover-command" style="margin-right:4px">${util.out('Transparent')}</button>
@@ -50565,6 +50576,12 @@ class Video {
50565
50576
  } else {
50566
50577
  inpAutoplay.checked = false;
50567
50578
  }
50579
+ const inpMuted = videoModal.querySelector('.input-video-muted');
50580
+ if (video.hasAttribute('muted')) {
50581
+ inpMuted.checked = true;
50582
+ } else {
50583
+ inpMuted.checked = false;
50584
+ }
50568
50585
  util.showModal(videoModal, true, () => {
50569
50586
  btn.removeAttribute('data-focus');
50570
50587
  btn.focus();
@@ -50608,6 +50625,9 @@ class Video {
50608
50625
  <label style="display:block;margin-top:5px;">
50609
50626
  <input class="input-video-autoplay" id="__input_video_autoplay" type="checkbox" /> ${util.out('Autoplay')}&nbsp;
50610
50627
  </label>
50628
+ <label style="display:block;margin-top:5px;">
50629
+ <input class="input-video-muted" id="__input_video_muted" type="checkbox" /> ${util.out('Muted')}&nbsp;
50630
+ </label>
50611
50631
 
50612
50632
  <div style="text-align:right;margin-top:14px;">
50613
50633
  <button title="${util.out('Cancel')}" class="input-cancel classic-secondary">${util.out('Cancel')}</button>
@@ -50686,6 +50706,11 @@ class Video {
50686
50706
  } else {
50687
50707
  video.removeAttribute('autoplay');
50688
50708
  }
50709
+ if (videoModal.querySelector('.input-video-muted').checked) {
50710
+ video.setAttribute('muted', '');
50711
+ } else {
50712
+ video.removeAttribute('muted');
50713
+ }
50689
50714
  if (videoModal.querySelector('.input-url').value !== '') {
50690
50715
  let url = videoModal.querySelector('.input-url').value;
50691
50716
  let source = video.querySelector('source');
@@ -68328,15 +68353,15 @@ class Rte {
68328
68353
  activeCol = this.builder.activeCol;
68329
68354
  spans = activeCol.querySelectorAll('span');
68330
68355
  Array.prototype.forEach.call(spans, span => {
68331
- let attr = span.getAttribute('data-keep');
68356
+ let attr = span.hasAttribute('data-keep');
68332
68357
  if (!attr) {
68333
68358
  span.outerHTML = span.innerHTML;
68334
68359
  }
68335
68360
  });
68336
68361
  Array.prototype.forEach.call(spans, span => {
68337
- let attr = span.getAttribute('data-keep');
68362
+ let attr = span.hasAttribute('data-keep');
68338
68363
  if (attr) {
68339
- dom.removeAttribute(span, 'data-keep');
68364
+ span.removeAttribute('data-keep');
68340
68365
  }
68341
68366
  });
68342
68367
  this.getState();
@@ -97246,18 +97271,21 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
97246
97271
  }
97247
97272
 
97248
97273
  if (this.dom.textSelection()) {
97249
- if (e.keyCode === '38') {
97274
+ if (e.keyCode === 38) {
97250
97275
  // Up arrow
97251
97276
  this.util.saveSelection();
97252
- } else if (e.keyCode === '40') {
97277
+ } else if (e.keyCode === 40) {
97253
97278
  // Down arrow
97254
97279
  this.util.saveSelection();
97255
- } else if (e.keyCode === '37') {
97280
+ } else if (e.keyCode === 37) {
97256
97281
  // Left arrow
97257
97282
  this.util.saveSelection();
97258
- } else if (e.keyCode === '39') {
97283
+ } else if (e.keyCode === 39) {
97259
97284
  // Right arrow
97260
97285
  this.util.saveSelection();
97286
+ } else if (e.keyCode === 13) {
97287
+ // Enter
97288
+ this.util.saveSelection();
97261
97289
  }
97262
97290
  }
97263
97291