@innovastudio/contentbox 1.5.64 → 1.5.65
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
|
@@ -13799,7 +13799,7 @@ class EditBox {
|
|
|
13799
13799
|
} else if (s === 'video') {
|
|
13800
13800
|
const chooseVideoBg = currentVideo => {
|
|
13801
13801
|
// Choose random video
|
|
13802
|
-
let videoList = this.builder.media.
|
|
13802
|
+
let videoList = this.builder.media.videos;
|
|
13803
13803
|
let randomIndex;
|
|
13804
13804
|
|
|
13805
13805
|
if (currentVideo) {
|
|
@@ -13810,13 +13810,13 @@ class EditBox {
|
|
|
13810
13810
|
randomIndex = Math.floor(Math.random() * videoList.length);
|
|
13811
13811
|
}
|
|
13812
13812
|
|
|
13813
|
-
return videoList[randomIndex];
|
|
13813
|
+
return this.builder.mediaPath + videoList[randomIndex];
|
|
13814
13814
|
};
|
|
13815
13815
|
|
|
13816
13816
|
let video = chooseVideoBg();
|
|
13817
13817
|
code = `
|
|
13818
13818
|
<video id="{id}" class="is-video-bg" muted loop playsinline autoplay>
|
|
13819
|
-
<source src="${this.builder.media.blank_video}" data-default="${video}">
|
|
13819
|
+
<source src="${this.builder.mediaPath + this.builder.media.blank_video}" data-default="${video}">
|
|
13820
13820
|
</video>
|
|
13821
13821
|
<div class="is-overlay-video" style="opacity:0.05"></div>
|
|
13822
13822
|
<script>
|
|
@@ -109162,7 +109162,7 @@ Important: Do not change the 'div.is-container' element!
|
|
|
109162
109162
|
|
|
109163
109163
|
let newMedia = mediaList[randomIndex];
|
|
109164
109164
|
this.builder.currentMedia = newMedia;
|
|
109165
|
-
return newMedia;
|
|
109165
|
+
return this.builder.mediaPath + newMedia;
|
|
109166
109166
|
}
|
|
109167
109167
|
|
|
109168
109168
|
getTypographyClass(html) {
|
|
@@ -109970,10 +109970,12 @@ class Command {
|
|
|
109970
109970
|
} // Replace {{_IMAGEURL}}
|
|
109971
109971
|
|
|
109972
109972
|
|
|
109973
|
-
|
|
109974
|
-
|
|
109975
|
-
|
|
109976
|
-
|
|
109973
|
+
if (context.includes('{{_IMAGEURL}}')) {
|
|
109974
|
+
const gallery = this.builder.media.images;
|
|
109975
|
+
const imageList = gallery.square;
|
|
109976
|
+
const imageUrl = this.lib.chooseMedia(imageList);
|
|
109977
|
+
context = context.replaceAll('{{_IMAGEURL}}', imageUrl);
|
|
109978
|
+
}
|
|
109977
109979
|
} else if (args.new_section_two_boxes || args.new_section_three_boxes || args.new_section_four_boxes) {
|
|
109978
109980
|
if (args.new_section_two_boxes) {
|
|
109979
109981
|
context = cl.new_section_two_boxes;
|
|
@@ -110000,13 +110002,15 @@ class Command {
|
|
|
110000
110002
|
context += '\n\n' + cl.update_section_article_with_image;
|
|
110001
110003
|
} else if (args.add_article) {
|
|
110002
110004
|
context += '\n\n' + cl.update_section_article_with_image;
|
|
110003
|
-
} else ;
|
|
110004
|
-
|
|
110005
|
+
} else ;
|
|
110005
110006
|
|
|
110006
|
-
|
|
110007
|
-
|
|
110008
|
-
|
|
110009
|
-
|
|
110007
|
+
if (context.includes('{{_IMAGEURL}}')) {
|
|
110008
|
+
//Replace {{_IMAGEURL}}
|
|
110009
|
+
const gallery = this.builder.media.images;
|
|
110010
|
+
const imageList = gallery.square;
|
|
110011
|
+
const imageUrl = this.lib.chooseMedia(imageList);
|
|
110012
|
+
context = context.replaceAll('{{_IMAGEURL}}', imageUrl);
|
|
110013
|
+
}
|
|
110010
110014
|
}
|
|
110011
110015
|
} else {
|
|
110012
110016
|
//if(args.redesign_layout || args.change_text || args.change_style) {
|
|
@@ -110085,13 +110089,15 @@ ${currentHtml}
|
|
|
110085
110089
|
} else if (args.add_article) {
|
|
110086
110090
|
context += '\n' + cl.update_section_article_with_image;
|
|
110087
110091
|
} else ;
|
|
110088
|
-
}
|
|
110089
|
-
|
|
110092
|
+
}
|
|
110090
110093
|
|
|
110091
|
-
|
|
110092
|
-
|
|
110093
|
-
|
|
110094
|
-
|
|
110094
|
+
if (context.includes('{{_IMAGEURL}}')) {
|
|
110095
|
+
//Replace {{_IMAGEURL}}
|
|
110096
|
+
const gallery = this.builder.media.images;
|
|
110097
|
+
const imageList = gallery.square;
|
|
110098
|
+
const imageUrl = this.lib.chooseMedia(imageList);
|
|
110099
|
+
context = context.replaceAll('{{_IMAGEURL}}', imageUrl);
|
|
110100
|
+
}
|
|
110095
110101
|
} // Check elements and add relevant context
|
|
110096
110102
|
|
|
110097
110103
|
|
|
@@ -110151,7 +110157,7 @@ ${currentHtml}
|
|
|
110151
110157
|
// New Section
|
|
110152
110158
|
// html = this.fixIcons(html);
|
|
110153
110159
|
html = this.fixButtons(html);
|
|
110154
|
-
html = this.fixBgImage(html);
|
|
110160
|
+
html = this.fixBgImage(html); // only if box has inline bg image, which is incorrect
|
|
110155
110161
|
|
|
110156
110162
|
if (args.section_background && args.section_background === 'image') {
|
|
110157
110163
|
html = this.setBgImage(html, true); // Change the bg image (also fix incorrect structure)
|
|
@@ -111471,7 +111477,7 @@ ${currentHtml}`;
|
|
|
111471
111477
|
randomIndex = Math.floor(Math.random() * imageList.length);
|
|
111472
111478
|
}
|
|
111473
111479
|
|
|
111474
|
-
return imageList[randomIndex];
|
|
111480
|
+
return this.builder.mediaPath + imageList[randomIndex];
|
|
111475
111481
|
} // Not Used
|
|
111476
111482
|
|
|
111477
111483
|
|
|
@@ -111686,31 +111692,7 @@ ${currentHtml}`;
|
|
|
111686
111692
|
let overlayCode = overlay.querySelector('.is-overlay-content');
|
|
111687
111693
|
if (overlayCode) overlayCode.parentNode.removeChild(overlayCode);
|
|
111688
111694
|
let sectionBox = false;
|
|
111689
|
-
if (box.classList.contains('is-section')) sectionBox = true; //
|
|
111690
|
-
|
|
111691
|
-
let bgImageUrl;
|
|
111692
|
-
let imageList;
|
|
111693
|
-
|
|
111694
|
-
if (sectionBox) {
|
|
111695
|
-
const gallery = this.builder.media.bg_images;
|
|
111696
|
-
imageList = gallery.section_text_left;
|
|
111697
|
-
const container = box.querySelector('.is-container');
|
|
111698
|
-
|
|
111699
|
-
if (container) {
|
|
111700
|
-
if (container.classList.contains('is-content-left')) {
|
|
111701
|
-
imageList = gallery.section_text_left;
|
|
111702
|
-
} else if (container.classList.contains('is-content-right')) {
|
|
111703
|
-
imageList = gallery.section_text_right;
|
|
111704
|
-
} else {
|
|
111705
|
-
imageList = gallery.section_text_center;
|
|
111706
|
-
}
|
|
111707
|
-
}
|
|
111708
|
-
} else {
|
|
111709
|
-
const gallery = this.builder.media.bg_images;
|
|
111710
|
-
imageList = gallery.box;
|
|
111711
|
-
}
|
|
111712
|
-
|
|
111713
|
-
bgImageUrl = this.lib.chooseMedia(imageList); // Check/fix if container misplaced
|
|
111695
|
+
if (box.classList.contains('is-section')) sectionBox = true; // Check/fix if container misplaced
|
|
111714
111696
|
|
|
111715
111697
|
const container = overlay.querySelector('.is-container');
|
|
111716
111698
|
|
|
@@ -111721,6 +111703,30 @@ ${currentHtml}`;
|
|
|
111721
111703
|
}
|
|
111722
111704
|
|
|
111723
111705
|
if (overlayBg) {
|
|
111706
|
+
// Choose random image
|
|
111707
|
+
let bgImageUrl;
|
|
111708
|
+
let imageList;
|
|
111709
|
+
|
|
111710
|
+
if (sectionBox) {
|
|
111711
|
+
const gallery = this.builder.media.bg_images;
|
|
111712
|
+
imageList = gallery.section_text_left;
|
|
111713
|
+
const container = box.querySelector('.is-container');
|
|
111714
|
+
|
|
111715
|
+
if (container) {
|
|
111716
|
+
if (container.classList.contains('is-content-left')) {
|
|
111717
|
+
imageList = gallery.section_text_left;
|
|
111718
|
+
} else if (container.classList.contains('is-content-right')) {
|
|
111719
|
+
imageList = gallery.section_text_right;
|
|
111720
|
+
} else {
|
|
111721
|
+
imageList = gallery.section_text_center;
|
|
111722
|
+
}
|
|
111723
|
+
}
|
|
111724
|
+
} else {
|
|
111725
|
+
const gallery = this.builder.media.bg_images;
|
|
111726
|
+
imageList = gallery.box;
|
|
111727
|
+
}
|
|
111728
|
+
|
|
111729
|
+
bgImageUrl = this.lib.chooseMedia(imageList);
|
|
111724
111730
|
overlayBg.style.backgroundImage = `url('${bgImageUrl}')`;
|
|
111725
111731
|
overlayBg.style.backgroundImage = `url('${bgImageUrl}')`;
|
|
111726
111732
|
overlayBg.style.backgroundPosition = '50% 60%';
|
|
@@ -112013,12 +112019,16 @@ ${currentHtml}`;
|
|
|
112013
112019
|
fixHtml(html) {
|
|
112014
112020
|
// Fix overlay structure when "is-overlay" containing background image in the style attribute
|
|
112015
112021
|
let regex = /<div class="is-overlay"([^>]*)style="([^"]*background-image:[^;"]+;)([^"]*)"([^>]*)>/g;
|
|
112016
|
-
html = html.replace(regex, '<div class="is-overlay"$1$4>\n <div class="is-overlay-bg" style="$2"></div>');
|
|
112022
|
+
html = html.replace(regex, '<div class="is-overlay"$1$4>\n <div class="is-overlay-bg" style="$2"></div>');
|
|
112023
|
+
|
|
112024
|
+
if (html.includes('{{_IMAGEURL}}')) {
|
|
112025
|
+
// Fix {{IMAGEURL}} that failed to replace
|
|
112026
|
+
const gallery = this.builder.media.images;
|
|
112027
|
+
const imageList = gallery.square;
|
|
112028
|
+
const imageUrl = this.lib.chooseMedia(imageList);
|
|
112029
|
+
html = html.replaceAll('{{IMAGEURL}}', imageUrl);
|
|
112030
|
+
} // Fix {{ICONCLASS}} that failed to replace
|
|
112017
112031
|
|
|
112018
|
-
const gallery = this.builder.media.images;
|
|
112019
|
-
const imageList = gallery.square;
|
|
112020
|
-
const imageUrl = this.lib.chooseMedia(imageList);
|
|
112021
|
-
html = html.replaceAll('{{IMAGEURL}}', imageUrl); // Fix {{ICONCLASS}} that failed to replace
|
|
112022
112032
|
|
|
112023
112033
|
html = html.replaceAll('{{ICONCLASS}}', 'ion-checkmark');
|
|
112024
112034
|
html = this.replaceButtonsWithAnchorTags(html);
|
|
@@ -115061,42 +115071,42 @@ class ContentBox {
|
|
|
115061
115071
|
similarityThreshold: 0.65,
|
|
115062
115072
|
// for commandList similarity checking
|
|
115063
115073
|
headlineList: ['We\'re [CompanyName]. Full stack development with a spark of creativity.', 'Transforming your digital experience with [CompanyName]. Achieve your online goals with our customized solutions.', 'Revolutionizing web development with [CompanyName]. Unleash your digital potential with our high-performance solutions.'],
|
|
115074
|
+
mediaPath: 'assets/gallery/',
|
|
115064
115075
|
media: {
|
|
115065
|
-
slider: ['
|
|
115066
|
-
blank_video: '
|
|
115067
|
-
|
|
115068
|
-
videos: ['assets/templates-simple/videos/beach1.mp4', 'assets/templates-simple/videos/beach2.mp4'],
|
|
115076
|
+
slider: ['slide-01.jpg', 'slide-02.jpg'],
|
|
115077
|
+
blank_video: 'blank.mp4',
|
|
115078
|
+
videos: ['beach1.mp4', 'beach2.mp4'],
|
|
115069
115079
|
youtube_videos: ['https://www.youtube.com/embed/P5yHEKqx86U?rel=0'],
|
|
115070
115080
|
maps: ['https://www.youtube.com/embed/P5yHEKqx86U?rel=0'],
|
|
115071
|
-
audios: ['
|
|
115081
|
+
audios: ['example.mp3'],
|
|
115072
115082
|
images: {
|
|
115073
|
-
square: ['
|
|
115083
|
+
square: ['person-01.jpg', 'person-02.jpg', 'person-03.jpg', 'person-04.jpg', 'person-05.jpg', 'person-06.jpg', 'person-08.jpg']
|
|
115074
115084
|
},
|
|
115075
115085
|
bg_images: {
|
|
115076
|
-
box: ['
|
|
115077
|
-
small_box: ['
|
|
115086
|
+
box: ['person-01.jpg', 'person-02.jpg', 'person-03.jpg', 'person-04.jpg', 'person-05.jpg', 'person-06.jpg', 'person-07.jpg', 'person-08.jpg', 'person-09.jpg', 'person-10.jpg', 'building.jpg', 'desk.jpg', 'chair.jpg', 'coffee.jpg', 'product.jpg', 'table.jpg'],
|
|
115087
|
+
small_box: ['person-01.jpg', 'person-03.jpg', 'person-04.jpg', 'person-05.jpg', 'person-10.jpg', 'chair.jpg', 'coffee.jpg', 'product.jpg', 'table.jpg'],
|
|
115078
115088
|
// section: [
|
|
115079
|
-
// '
|
|
115080
|
-
// '
|
|
115081
|
-
// '
|
|
115082
|
-
// '
|
|
115083
|
-
// '
|
|
115084
|
-
// '
|
|
115085
|
-
// '
|
|
115086
|
-
// '
|
|
115087
|
-
// '
|
|
115088
|
-
// '
|
|
115089
|
-
// '
|
|
115090
|
-
// '
|
|
115091
|
-
// '
|
|
115092
|
-
// '
|
|
115093
|
-
// '
|
|
115089
|
+
// 'header-01.jpg',
|
|
115090
|
+
// 'header-02.jpg',
|
|
115091
|
+
// 'header-03.jpg',
|
|
115092
|
+
// 'header-04.jpg',
|
|
115093
|
+
// 'header-05.jpg',
|
|
115094
|
+
// 'header-06.jpg',
|
|
115095
|
+
// 'header-07.jpg',
|
|
115096
|
+
// 'header-08.jpg',
|
|
115097
|
+
// 'header-09.jpg',
|
|
115098
|
+
// 'header-10.jpg',
|
|
115099
|
+
// 'header-11.jpg',
|
|
115100
|
+
// 'header-12.jpg',
|
|
115101
|
+
// 'header-13.jpg',
|
|
115102
|
+
// 'header-14.jpg',
|
|
115103
|
+
// 'header-15.jpg',
|
|
115094
115104
|
// ],
|
|
115095
|
-
section_text_left: ['
|
|
115096
|
-
'
|
|
115105
|
+
section_text_left: ['header-01.jpg', 'header-02.jpg', 'header-03.jpg', 'header-05.jpg', 'header-08.jpg', 'header-10b.jpg', // 'header-13.jpg',
|
|
115106
|
+
'header-14.jpg' // 'header-15b.jpg',
|
|
115097
115107
|
],
|
|
115098
|
-
section_text_center: ['
|
|
115099
|
-
section_text_right: ['
|
|
115108
|
+
section_text_center: ['header-07.jpg', 'header-11.jpg', 'header-12.jpg', 'header-13.jpg'],
|
|
115109
|
+
section_text_right: ['header-04.jpg', 'header-05b.jpg', 'header-06.jpg', 'header-08b.jpg', 'header-09.jpg', 'header-10.jpg', 'header-14b.jpg', 'header-15.jpg']
|
|
115100
115110
|
}
|
|
115101
115111
|
},
|
|
115102
115112
|
shortCommandList: {
|