@innovastudio/contentbuilder 1.5.12 → 1.5.13

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.12",
4
+ "version": "1.5.13",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -71846,13 +71846,13 @@ class SaveImages {
71846
71846
  const divs = area.querySelectorAll('.is-overlay-bg,.is-container > div > div,.is-lightbox,.block-click');
71847
71847
  divs.forEach(div => {
71848
71848
  let src = '';
71849
- if (div.style.backgroundImage) {
71849
+ if (div.style.backgroundImage && div.style.backgroundImage.includes('base64')) {
71850
71850
  if (div.style.backgroundImage.indexOf('url(') !== -1) {
71851
71851
  src = div.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
71852
71852
  }
71853
- } else if (div.classList.contains('is-lightbox')) {
71853
+ } else if (div.classList.contains('is-lightbox') && div.getAttribute('href').includes('base64')) {
71854
71854
  src = div.getAttribute('href');
71855
- } else if (div.classList.contains('block-click')) {
71855
+ } else if (div.classList.contains('block-click') && div.style.backgroundImage && !div.style.backgroundImage.includes('base64')) {
71856
71856
  src = div.getAttribute('data-modal-url');
71857
71857
  }
71858
71858
  if (src.includes('base64')) {
@@ -88999,7 +88999,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
88999
88999
 
89000
89000
  this.selectAsset(s);
89001
89001
  }
89002
- selectAsset(s) {
89002
+ selectAsset(s, f) {
89003
89003
  let extension = s.split('.').pop().split('?')[0].split('#')[0]; //
89004
89004
  extension = extension.toLowerCase();
89005
89005
  let ok = false;
@@ -89031,6 +89031,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
89031
89031
  }
89032
89032
  }
89033
89033
  if (ok) {
89034
+ if (f) this.targetInput.setAttribute('data-filename', f);else this.targetInput.removeAttribute('data-filename');
89034
89035
  this.targetInput.value = s;
89035
89036
 
89036
89037
  // if(this.targetCallback) this.targetCallback();
@@ -89080,7 +89081,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
89080
89081
  alert(out('Please select an image file.'));
89081
89082
  }
89082
89083
  if (ok) {
89083
- if (callback) callback(s);
89084
+ // if(callback) callback(s);
89085
+ if (callback) {
89086
+ // if s is base64 and there is data-filename attribute set
89087
+ let f;
89088
+ if (inpUrl.hasAttribute('data-filename')) f = inpUrl.getAttribute('data-filename');
89089
+ callback(s, f);
89090
+ }
89084
89091
  }
89085
89092
  desc.set.call(this, s);
89086
89093
  }
@@ -89120,7 +89127,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
89120
89127
  if (targetAssetType === 'media') alert(out('Please select an image or video file.'));
89121
89128
  }
89122
89129
  if (ok) {
89123
- if (callback) callback(s);
89130
+ // if(callback) callback(s);
89131
+ if (callback) {
89132
+ // if s is base64 and there is data-filename attribute set
89133
+ let f;
89134
+ if (inpUrl.hasAttribute('data-filename')) f = inpUrl.getAttribute('data-filename');
89135
+ callback(s, f);
89136
+ }
89124
89137
  }
89125
89138
  desc.set.call(this, s);
89126
89139
  }
@@ -89172,7 +89185,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
89172
89185
  }
89173
89186
  }
89174
89187
  if (ok) {
89175
- if (callback) callback(s);
89188
+ // if(callback) callback(s);
89189
+ if (callback) {
89190
+ // if s is base64 and there is data-filename attribute set
89191
+ let f;
89192
+ if (inpUrl.hasAttribute('data-filename')) f = inpUrl.getAttribute('data-filename');
89193
+ callback(s, f);
89194
+ }
89176
89195
  }
89177
89196
  desc.set.call(this, s);
89178
89197
  }