@innovastudio/contentbuilder 1.5.112 → 1.5.113
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
@@ -51183,6 +51183,12 @@ class Video {
|
|
51183
51183
|
let source = video.querySelector('source');
|
51184
51184
|
let url = '';
|
51185
51185
|
if (source) url = source.getAttribute('src');
|
51186
|
+
|
51187
|
+
// base64 handling: save the value and display "[Image Data]"
|
51188
|
+
if (url.startsWith('data:')) {
|
51189
|
+
this.builder.base64Data = url;
|
51190
|
+
url = '[Image Data]';
|
51191
|
+
}
|
51186
51192
|
videoModal.querySelector('.input-url').value = url;
|
51187
51193
|
const inpShowControls = videoModal.querySelector('.input-video-controls');
|
51188
51194
|
if (video.hasAttribute('controls')) {
|
@@ -51359,6 +51365,12 @@ class Video {
|
|
51359
51365
|
}
|
51360
51366
|
if (videoModal.querySelector('.input-url').value !== '') {
|
51361
51367
|
let url = videoModal.querySelector('.input-url').value;
|
51368
|
+
|
51369
|
+
// base64 handling: Apply base64 data
|
51370
|
+
if (url === '[Image Data]') {
|
51371
|
+
url = this.builder.base64Data;
|
51372
|
+
this.builder.base64Data = '';
|
51373
|
+
}
|
51362
51374
|
let source = video.querySelector('source');
|
51363
51375
|
if (url !== source.getAttribute('src')) {
|
51364
51376
|
if (source) source.setAttribute('src', url);
|
@@ -51376,6 +51388,8 @@ class Video {
|
|
51376
51388
|
});
|
51377
51389
|
let btnCancel = videoModal.querySelector('.input-cancel');
|
51378
51390
|
dom.addEventListener(btnCancel, 'click', () => {
|
51391
|
+
// base64 handling: Clear previously saved base64 data
|
51392
|
+
this.builder.base64Data = '';
|
51379
51393
|
this.builder.hideModal(videoModal);
|
51380
51394
|
});
|
51381
51395
|
}
|
@@ -51460,6 +51474,12 @@ class Audio {
|
|
51460
51474
|
if (source) url = source.getAttribute('src');
|
51461
51475
|
this.renderPanel();
|
51462
51476
|
const audioModal = this.audioModal;
|
51477
|
+
|
51478
|
+
// base64 handling: save the value and display "[Image Data]"
|
51479
|
+
if (url.startsWith('data:')) {
|
51480
|
+
this.builder.base64Data = url;
|
51481
|
+
url = '[Image Data]';
|
51482
|
+
}
|
51463
51483
|
audioModal.querySelector('.input-url').value = url;
|
51464
51484
|
util.showModal(audioModal, true, () => {
|
51465
51485
|
btn.removeAttribute('data-focus');
|
@@ -51488,7 +51508,7 @@ class Audio {
|
|
51488
51508
|
<form class="form-upload-larger" target="frameTargetAudioUpload" method="post" action="${this.builder.opts.audioHandler}" enctype="multipart/form-data" style="position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;width:100%;height:100%;">
|
51489
51509
|
<input id="hidRefAudio" name="hidRefId" type="hidden" value="" />
|
51490
51510
|
<svg style="width:16px;height:16px;"><use xlink:href="#icon-upload"></use></svg>
|
51491
|
-
<input title="${util.out('Select')}" id="fileAudio1" name="fileImage" type="file" accept="audio
|
51511
|
+
<input title="${util.out('Select')}" id="fileAudio1" name="fileImage" type="file" accept="audio/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">
|
51492
51512
|
</form>
|
51493
51513
|
|
51494
51514
|
<iframe tabindex="0" id="frameTargetAudioUpload" name="frameTargetAudioUpload" tabIndex="-1" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>
|
@@ -51581,6 +51601,12 @@ class Audio {
|
|
51581
51601
|
if (audioModal.querySelector('.input-url').value !== '') {
|
51582
51602
|
let url = audioModal.querySelector('.input-url').value;
|
51583
51603
|
|
51604
|
+
// base64 handling: Apply base64 data
|
51605
|
+
if (url === '[Image Data]') {
|
51606
|
+
url = this.builder.base64Data;
|
51607
|
+
this.builder.base64Data = '';
|
51608
|
+
}
|
51609
|
+
|
51584
51610
|
//Render
|
51585
51611
|
let source = audio.querySelector('source');
|
51586
51612
|
if (url !== source.getAttribute('src')) {
|
@@ -51600,6 +51626,8 @@ class Audio {
|
|
51600
51626
|
});
|
51601
51627
|
let btnCancel = audioModal.querySelector('.input-cancel');
|
51602
51628
|
dom.addEventListener(btnCancel, 'click', () => {
|
51629
|
+
// base64 handling: Clear previously saved base64 data
|
51630
|
+
this.builder.base64Data = '';
|
51603
51631
|
this.builder.hideModal(audioModal);
|
51604
51632
|
});
|
51605
51633
|
}
|
@@ -80764,12 +80792,20 @@ class MediaPicker {
|
|
80764
80792
|
const btnImageOk = modalMediaSelect.querySelector('.input-ok');
|
80765
80793
|
dom.addEventListener(btnImageOk, 'click', () => {
|
80766
80794
|
const inpSrc = modalMediaSelect.querySelector('.input-src');
|
80767
|
-
|
80795
|
+
let url = inpSrc.value;
|
80796
|
+
|
80797
|
+
// base64 handling: Apply base64 data
|
80798
|
+
if (url === '[Image Data]') {
|
80799
|
+
url = this.builder.base64Data;
|
80800
|
+
this.builder.base64Data = '';
|
80801
|
+
}
|
80768
80802
|
if (this.builder.mediaSelectedCallback) this.builder.mediaSelectedCallback(url);
|
80769
80803
|
this.builder.hideModal(modalMediaSelect);
|
80770
80804
|
});
|
80771
80805
|
const btnImageCancel = modalMediaSelect.querySelector('.input-cancel');
|
80772
80806
|
dom.addEventListener(btnImageCancel, 'click', () => {
|
80807
|
+
// base64 handling: Clear previously saved base64 data
|
80808
|
+
this.builder.base64Data = '';
|
80773
80809
|
this.builder.hideModal(modalMediaSelect);
|
80774
80810
|
});
|
80775
80811
|
}
|
@@ -96491,7 +96527,14 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
96491
96527
|
Array.prototype.forEach.call(forms, formUpload => {
|
96492
96528
|
if (this.dom.hasClass(formUpload, 'please-wait')) {
|
96493
96529
|
this.dom.removeClass(formUpload, 'please-wait');
|
96494
|
-
if (s)
|
96530
|
+
if (s) {
|
96531
|
+
// base64 handling: save the value and display "[Image Data]"
|
96532
|
+
if (s.startsWith('data:')) {
|
96533
|
+
this.base64Data = s;
|
96534
|
+
s = '[Image Data]';
|
96535
|
+
}
|
96536
|
+
formUpload.parentNode.parentNode.querySelector('input[type="text"]').value = s;
|
96537
|
+
}
|
96495
96538
|
formUpload.parentNode.parentNode.querySelector('input[type="file"]').value = '';
|
96496
96539
|
}
|
96497
96540
|
});
|
@@ -96557,7 +96600,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
96557
96600
|
alert(this.util.out('Please select an mp4 file.'));
|
96558
96601
|
}
|
96559
96602
|
} else if (this.targetAssetType === 'audio') {
|
96560
|
-
if (extension === 'mp3') {
|
96603
|
+
if (extension === 'mp3' || extension === 'wav') {
|
96561
96604
|
ok = true;
|
96562
96605
|
} else {
|
96563
96606
|
alert(this.util.out('Please select an mp3 file.'));
|
@@ -96647,7 +96690,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
96647
96690
|
ok = true;
|
96648
96691
|
} else if (targetAssetType === 'video' && ext === 'mp4') {
|
96649
96692
|
ok = true;
|
96650
|
-
} else if (targetAssetType === 'audio' && ext === 'mp3') {
|
96693
|
+
} else if (targetAssetType === 'audio' && (ext === 'mp3' || ext === 'wav')) {
|
96651
96694
|
ok = true;
|
96652
96695
|
} else if (targetAssetType === 'media' && (s.includes('base64') || ext === 'mp4' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif' || ext === 'webm' || ext === 'webp')) {
|
96653
96696
|
ok = true;
|
@@ -96711,7 +96754,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
96711
96754
|
alert(out('Please select an image file.'));
|
96712
96755
|
}
|
96713
96756
|
} else if (targetAssetType === 'audio') {
|
96714
|
-
if (extension === 'mp3') {
|
96757
|
+
if (extension === 'mp3' || extension === 'wav') {
|
96715
96758
|
ok = true;
|
96716
96759
|
} else {
|
96717
96760
|
alert(out('Please select an mp3 file.'));
|