@innovastudio/contentbox 1.5.25 → 1.5.27
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
|
@@ -492,7 +492,7 @@ class Select$1 {
|
|
|
492
492
|
dropDown.dispatchEvent(new Event('change'));
|
|
493
493
|
toggler.focus();
|
|
494
494
|
let elms = menu.children;
|
|
495
|
-
Array.from(elms).
|
|
495
|
+
Array.from(elms).forEach(elm => {
|
|
496
496
|
elm.classList.remove('selected');
|
|
497
497
|
});
|
|
498
498
|
let optionselected = menu.querySelector('[data-value="' + val + '"]');
|
|
@@ -582,28 +582,28 @@ class SideBar {
|
|
|
582
582
|
html += '<div class="is-sidebar is-area active" style="transform: translate3d(0,0,0);display: flex;flex-direction: column;opacity: 0.0001;">';
|
|
583
583
|
var sideIndex = 0;
|
|
584
584
|
this.builder.sidebarData.buttons.map(button => {
|
|
585
|
-
if (button.name
|
|
586
|
-
html += '<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSections" data-command="section" data-title="' + button.title + '" title="' + button.title + '">' + // '<svg class="svg-icon"><use xlink:href="#ion-android-add"></use></svg>' +
|
|
585
|
+
if (button.name === 'section') {
|
|
586
|
+
html += '<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSections" data-command="section" data-title="' + out(button.title) + '" title="' + out(button.title) + '">' + // '<svg class="svg-icon"><use xlink:href="#ion-android-add"></use></svg>' +
|
|
587
587
|
'<svg class="svg-icon"><use xlink:href="#icon-plus"></use></svg>' + '</button>';
|
|
588
|
-
} else if (button.name
|
|
589
|
-
html += '<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSnippets" data-title="' + button.title + '" title="' + button.title + '">' + // '<svg class="svg-icon"><use xlink:href="#icon-align-center"></use></svg>' +
|
|
588
|
+
} else if (button.name === 'snippet') {
|
|
589
|
+
html += '<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSnippets" data-title="' + out(button.title) + '" title="' + out(button.title) + '">' + // '<svg class="svg-icon"><use xlink:href="#icon-align-center"></use></svg>' +
|
|
590
590
|
'<svg class="svg-icon"><use xlink:href="#icon-box-multiple"></use></svg>' + '</button>';
|
|
591
|
-
} else if (button.name
|
|
591
|
+
} else if (button.name === 'typography') {
|
|
592
592
|
if (this.builder.enableContentStyle) {
|
|
593
|
-
html += '<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarTypography" data-command="typography" data-title="' + button.title + '" title="' + button.title + '">' + // '<span style="">a</span>' +
|
|
593
|
+
html += '<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarTypography" data-command="typography" data-title="' + out(button.title) + '" title="' + out(button.title) + '">' + // '<span style="">a</span>' +
|
|
594
594
|
'<svg class="svg-icon"><use xlink:href="#icon-typography"></use></svg>' + '</button>';
|
|
595
595
|
}
|
|
596
|
-
} else if (button.name
|
|
596
|
+
} else if (button.name === 'code') {
|
|
597
597
|
if (this.builder.htmlSyntaxHighlighting) {
|
|
598
|
-
html += '<button class="is-sidebar-button" tabindex="-1" data-command="code" data-title="' + button.title + '" title="' + button.title + '">' + '<svg class="svg-icon" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg>' + '</button>';
|
|
598
|
+
html += '<button class="is-sidebar-button" tabindex="-1" data-command="code" data-title="' + out(button.title) + '" title="' + out(button.title) + '">' + '<svg class="svg-icon" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg>' + '</button>';
|
|
599
599
|
} else {
|
|
600
|
-
html += '<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSource" data-command="code" data-title="' + button.title + '" title="' + button.title + '">' + '<svg class="svg-icon" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg>' + '</button>';
|
|
600
|
+
html += '<button class="is-sidebar-button" tabindex="-1" data-content="divSidebarSource" data-command="code" data-title="' + out(button.title) + '" title="' + out(button.title) + '">' + '<svg class="svg-icon" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg>' + '</button>';
|
|
601
601
|
}
|
|
602
602
|
} else {
|
|
603
603
|
//custom buttons
|
|
604
604
|
if (button.src) {
|
|
605
605
|
var panelId = dom$n.uniqueId();
|
|
606
|
-
html += `<button class="is-sidebar-button" tabindex="-1" data-content="${panelId}" data-title="${button.title}" title="${button.title}" data-src="${button.src}" data-refresh="${button.refresh ? 1 : 0}">${button.html}</button>`;
|
|
606
|
+
html += `<button class="is-sidebar-button" tabindex="-1" data-content="${panelId}" data-title="${out(button.title)}" title="${out(button.title)}" data-src="${button.src}" data-refresh="${button.refresh ? 1 : 0}">${button.html}</button>`;
|
|
607
607
|
|
|
608
608
|
if (!builderStuff.querySelector(`#${panelId}`)) {
|
|
609
609
|
let customPanelHtml = `<div id="${panelId}" class="is-sidebar-content is-area-2nd" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" style="max-width:${button.maxwidth ? button.maxwidth : '500px'};">
|
|
@@ -615,7 +615,7 @@ class SideBar {
|
|
|
615
615
|
dom$n.appendHtml(builderStuff, customPanelHtml);
|
|
616
616
|
}
|
|
617
617
|
} else {
|
|
618
|
-
html += '<button class="is-sidebar-button" tabindex="-1" data-content="' + button.content.substr(1) + '" data-title="' + button.title + '" title="' + button.title + '" data-refresh="' + (button.refresh ? 1 : 0) + '">' + button.html + '</button>';
|
|
618
|
+
html += '<button class="is-sidebar-button" tabindex="-1" data-content="' + button.content.substr(1) + '" data-title="' + out(button.title) + '" title="' + out(button.title) + '" data-refresh="' + (button.refresh ? 1 : 0) + '">' + button.html + '</button>';
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
|
|
@@ -798,11 +798,11 @@ class SideBar {
|
|
|
798
798
|
let cmd = btn.getAttribute('data-command');
|
|
799
799
|
|
|
800
800
|
if (cmd) {
|
|
801
|
-
if (cmd
|
|
801
|
+
if (cmd === 'section') {
|
|
802
802
|
this.viewIdeas();
|
|
803
803
|
}
|
|
804
804
|
|
|
805
|
-
if (cmd
|
|
805
|
+
if (cmd === 'code') {
|
|
806
806
|
if (this.builder.htmlSyntaxHighlighting) {
|
|
807
807
|
this.viewHtml();
|
|
808
808
|
} else {
|
|
@@ -810,7 +810,7 @@ class SideBar {
|
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
-
if (cmd
|
|
813
|
+
if (cmd === 'typography') {
|
|
814
814
|
btn.setAttribute('data-applyto', 'page');
|
|
815
815
|
builderStuff.querySelector('.typo-target-default').style.display = 'flex';
|
|
816
816
|
builderStuff.querySelector('.typo-target-box').style.display = 'none';
|
|
@@ -1127,7 +1127,7 @@ class SideBar {
|
|
|
1127
1127
|
let styles = jsonStyles.data.styles;
|
|
1128
1128
|
let html = '';
|
|
1129
1129
|
|
|
1130
|
-
if (catid
|
|
1130
|
+
if (parseInt(catid) === -1) {
|
|
1131
1131
|
//show all
|
|
1132
1132
|
for (let i = 0; i < styles.length; i++) {
|
|
1133
1133
|
html += '<div data-css="' + styles[i].css + '" data-sectioncss="' + styles[i].sectioncss + '" data-classname="' + styles[i].classname + '">' + '<div>[' + (i + 1) + '] ' + styles[i].caption + '</div>' + '<img src="' + contentStylePath + styles[i].img + '" /><span class="is-overlay"></span></div></div>';
|
|
@@ -1135,7 +1135,7 @@ class SideBar {
|
|
|
1135
1135
|
} else {
|
|
1136
1136
|
//show based on category
|
|
1137
1137
|
for (let i = 0; i < styles.length; i++) {
|
|
1138
|
-
if (catid
|
|
1138
|
+
if (parseInt(catid) === styles[i].category) {
|
|
1139
1139
|
html += '<div data-css="' + styles[i].css + '" data-sectioncss="' + styles[i].sectioncss + '" data-classname="' + styles[i].classname + '">' + '<div>[' + (i + 1) + '] ' + styles[i].caption + '</div>' + '<img src="' + contentStylePath + styles[i].img + '" /><span class="is-overlay"></span></div></div>';
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
@@ -1905,7 +1905,7 @@ class SideBar {
|
|
|
1905
1905
|
let snippetPathReplace = gallery.pathReplace;
|
|
1906
1906
|
|
|
1907
1907
|
//To Tailwind
|
|
1908
|
-
if (framework
|
|
1908
|
+
if (framework === 'tailwind') {
|
|
1909
1909
|
html = html.replace(new RegExp(' container', 'g'), ' container');
|
|
1910
1910
|
|
|
1911
1911
|
//html = html.replace(new RegExp('row clearfix', 'g'), 'flex flex-col md:flex-row');
|
|
@@ -1924,7 +1924,7 @@ class SideBar {
|
|
|
1924
1924
|
}
|
|
1925
1925
|
|
|
1926
1926
|
//To Bootstrap
|
|
1927
|
-
if (framework
|
|
1927
|
+
if (framework === 'bootstrap') {
|
|
1928
1928
|
html = html.replace(new RegExp(' container', 'g'), ' container-fluid');
|
|
1929
1929
|
html = html.replace(new RegExp('row clearfix', 'g'), 'row');
|
|
1930
1930
|
html = html.replace(new RegExp('column full', 'g'), 'col-md-12');
|
|
@@ -1941,7 +1941,7 @@ class SideBar {
|
|
|
1941
1941
|
}`;
|
|
1942
1942
|
html += `
|
|
1943
1943
|
//To Foundation
|
|
1944
|
-
if (framework
|
|
1944
|
+
if (framework === 'foundation') {
|
|
1945
1945
|
//html = html.replace(new RegExp(' container', 'g'), ' container');
|
|
1946
1946
|
html = html.replace(new RegExp('row clearfix', 'g'), 'row');
|
|
1947
1947
|
html = html.replace(new RegExp('column full', 'g'), 'large-12 columns');
|
|
@@ -1958,7 +1958,7 @@ class SideBar {
|
|
|
1958
1958
|
}
|
|
1959
1959
|
|
|
1960
1960
|
//To UIKit
|
|
1961
|
-
if (framework
|
|
1961
|
+
if (framework === 'uikit') {
|
|
1962
1962
|
html = html.replace(new RegExp(' container', 'g'), ' uk-container uk-container-center');
|
|
1963
1963
|
|
|
1964
1964
|
// html = html.replace(new RegExp('row clearfix', 'g'), 'uk-grid');
|
|
@@ -1979,7 +1979,7 @@ class SideBar {
|
|
|
1979
1979
|
}
|
|
1980
1980
|
|
|
1981
1981
|
//To Material
|
|
1982
|
-
if (framework
|
|
1982
|
+
if (framework === 'material') {
|
|
1983
1983
|
html = html.replace(new RegExp(' container', 'g'), '');
|
|
1984
1984
|
|
|
1985
1985
|
// html = html.replace(new RegExp('row clearfix', 'g'), 'mdl-grid');
|
|
@@ -3443,7 +3443,7 @@ class SideBar {
|
|
|
3443
3443
|
var contentClass = result[0].contentClass;
|
|
3444
3444
|
|
|
3445
3445
|
//To Tailwind
|
|
3446
|
-
if (framework
|
|
3446
|
+
if (framework === 'tailwind') {
|
|
3447
3447
|
html = html.replace(new RegExp(' container', 'g'), ' container');
|
|
3448
3448
|
html = html.replace(new RegExp('row clearfix', 'g'), 'flex flex-col md:flex-row');
|
|
3449
3449
|
html = html.replace(new RegExp('column full', 'g'), 'w-full px-4');
|
|
@@ -3458,7 +3458,7 @@ class SideBar {
|
|
|
3458
3458
|
}
|
|
3459
3459
|
|
|
3460
3460
|
//To Bootstrap
|
|
3461
|
-
if (framework
|
|
3461
|
+
if (framework === 'bootstrap') {
|
|
3462
3462
|
html = html.replace(new RegExp(' container', 'g'), ' container-fluid');
|
|
3463
3463
|
html = html.replace(new RegExp('row clearfix', 'g'), 'row');
|
|
3464
3464
|
html = html.replace(new RegExp('column full', 'g'), 'col-md-12');
|
|
@@ -3475,7 +3475,7 @@ class SideBar {
|
|
|
3475
3475
|
}
|
|
3476
3476
|
|
|
3477
3477
|
//To Foundation
|
|
3478
|
-
if (framework
|
|
3478
|
+
if (framework === 'foundation') {
|
|
3479
3479
|
//html = html.replace(new RegExp(' container', 'g'), ' container');
|
|
3480
3480
|
html = html.replace(new RegExp('row clearfix', 'g'), 'row');
|
|
3481
3481
|
html = html.replace(new RegExp('column full', 'g'), 'large-12 columns');
|
|
@@ -3492,7 +3492,7 @@ class SideBar {
|
|
|
3492
3492
|
}
|
|
3493
3493
|
|
|
3494
3494
|
//To UIKit
|
|
3495
|
-
if (framework
|
|
3495
|
+
if (framework === 'uikit') {
|
|
3496
3496
|
html = html.replace(new RegExp(' container', 'g'), ' uk-container uk-container-center');
|
|
3497
3497
|
html = html.replace(new RegExp('row clearfix', 'g'), 'uk-grid');
|
|
3498
3498
|
html = html.replace(new RegExp('column full', 'g'), 'uk-width-1-1');
|
|
@@ -3509,7 +3509,7 @@ class SideBar {
|
|
|
3509
3509
|
}
|
|
3510
3510
|
|
|
3511
3511
|
//To Material
|
|
3512
|
-
if (framework
|
|
3512
|
+
if (framework === 'material') {
|
|
3513
3513
|
html = html.replace(new RegExp(' container', 'g'), '');
|
|
3514
3514
|
html = html.replace(new RegExp('row clearfix', 'g'), 'mdl-grid');
|
|
3515
3515
|
html = html.replace(new RegExp('column full', 'g'), 'mdl-cell mdl-cell--12-col');
|
|
@@ -4293,7 +4293,7 @@ class EditSection {
|
|
|
4293
4293
|
let val = btn.getAttribute('data-value');
|
|
4294
4294
|
const activeSection = this.builder.activeSection;
|
|
4295
4295
|
|
|
4296
|
-
if (val
|
|
4296
|
+
if (val === 'space') {
|
|
4297
4297
|
dom$m.removeClass(activeSection, 'space-around');
|
|
4298
4298
|
} else {
|
|
4299
4299
|
dom$m.addClass(activeSection, 'space-around');
|
|
@@ -4318,11 +4318,11 @@ class EditSection {
|
|
|
4318
4318
|
dom$m.removeClass(activeSection, 'stack-middle');
|
|
4319
4319
|
dom$m.removeClass(activeSection, 'stack-bottom');
|
|
4320
4320
|
|
|
4321
|
-
if (val
|
|
4321
|
+
if (val === 'top') {
|
|
4322
4322
|
dom$m.addClass(activeSection, 'stack-top');
|
|
4323
|
-
} else if (val
|
|
4323
|
+
} else if (val === 'middle') {
|
|
4324
4324
|
dom$m.addClass(activeSection, 'stack-middle');
|
|
4325
|
-
} else if (val
|
|
4325
|
+
} else if (val === 'bottom') {
|
|
4326
4326
|
dom$m.addClass(activeSection, 'stack-bottom');
|
|
4327
4327
|
}
|
|
4328
4328
|
|
|
@@ -4688,8 +4688,7 @@ class EditSection {
|
|
|
4688
4688
|
let divVisibility = this.modalEditSection.querySelector('.div-visibility');
|
|
4689
4689
|
let target = this.builder.editor.responsive.readTarget(divTarget);
|
|
4690
4690
|
let valVisibility = this.builder.editor.responsive.getVisibility(section, target);
|
|
4691
|
-
this.builder.editor.responsive.showVisibility(divVisibility, valVisibility);
|
|
4692
|
-
|
|
4691
|
+
this.builder.editor.responsive.showVisibility(divVisibility, valVisibility);
|
|
4693
4692
|
let btns = this.modalEditSection.querySelectorAll('.input-boxesperline');
|
|
4694
4693
|
btns.forEach(btn => {
|
|
4695
4694
|
btn.classList.remove('on');
|
|
@@ -4915,12 +4914,15 @@ class EditSection {
|
|
|
4915
4914
|
|
|
4916
4915
|
|
|
4917
4916
|
this.realtimeVisibility(activeSection, true);
|
|
4917
|
+
const divBoxesPerLine = modalEditSection.querySelector('.div-boxesperline');
|
|
4918
4918
|
const divReverseBoxes = modalEditSection.querySelector('#divReverseBoxes');
|
|
4919
4919
|
|
|
4920
4920
|
if (activeSection.querySelectorAll('.is-box').length > 1) {
|
|
4921
4921
|
divReverseBoxes.style.display = 'flex';
|
|
4922
|
+
divBoxesPerLine.style.display = 'flex';
|
|
4922
4923
|
} else {
|
|
4923
4924
|
divReverseBoxes.style.display = 'none';
|
|
4925
|
+
divBoxesPerLine.style.display = 'none';
|
|
4924
4926
|
}
|
|
4925
4927
|
}
|
|
4926
4928
|
|
|
@@ -5224,7 +5226,7 @@ class EditSection {
|
|
|
5224
5226
|
const activeSection = this.builder.activeSection;
|
|
5225
5227
|
const divSectionSpaceSettings = this.modalEditSection.querySelector('.div-section-spacesettings');
|
|
5226
5228
|
|
|
5227
|
-
if (s
|
|
5229
|
+
if (s === '') {
|
|
5228
5230
|
dom$m.removeClass(activeSection, 'box-space');
|
|
5229
5231
|
dom$m.removeClass(activeSection, 'box-space-xxs');
|
|
5230
5232
|
dom$m.removeClass(activeSection, 'box-space-sm');
|
|
@@ -5241,22 +5243,22 @@ class EditSection {
|
|
|
5241
5243
|
dom$m.removeClass(activeSection, 'box-space-m');
|
|
5242
5244
|
dom$m.removeClass(activeSection, 'box-space-lg');
|
|
5243
5245
|
dom$m.addClass(activeSection, 'box-space-sm');
|
|
5244
|
-
} else if (s
|
|
5246
|
+
} else if (s === 'xxs') {
|
|
5245
5247
|
dom$m.removeClass(activeSection, 'box-space-m');
|
|
5246
5248
|
dom$m.removeClass(activeSection, 'box-space-sm');
|
|
5247
5249
|
dom$m.removeClass(activeSection, 'box-space-lg');
|
|
5248
5250
|
dom$m.addClass(activeSection, 'box-space-xxs');
|
|
5249
|
-
} else if (s
|
|
5251
|
+
} else if (s === 'm') {
|
|
5250
5252
|
dom$m.removeClass(activeSection, 'box-space-xxs');
|
|
5251
5253
|
dom$m.removeClass(activeSection, 'box-space-sm');
|
|
5252
5254
|
dom$m.removeClass(activeSection, 'box-space-lg');
|
|
5253
5255
|
dom$m.addClass(activeSection, 'box-space-m');
|
|
5254
|
-
} else if (s
|
|
5256
|
+
} else if (s === 'lg') {
|
|
5255
5257
|
dom$m.removeClass(activeSection, 'box-space-xxs');
|
|
5256
5258
|
dom$m.removeClass(activeSection, 'box-space-sm');
|
|
5257
5259
|
dom$m.removeClass(activeSection, 'box-space-m');
|
|
5258
5260
|
dom$m.addClass(activeSection, 'box-space-lg');
|
|
5259
|
-
} else if (s
|
|
5261
|
+
} else if (s === 'default') {
|
|
5260
5262
|
dom$m.removeClass(activeSection, 'box-space-xxs');
|
|
5261
5263
|
dom$m.removeClass(activeSection, 'box-space-sm');
|
|
5262
5264
|
dom$m.removeClass(activeSection, 'box-space-m');
|
|
@@ -108210,7 +108212,7 @@ class ContentBox {
|
|
|
108210
108212
|
|
|
108211
108213
|
let exist = false;
|
|
108212
108214
|
|
|
108213
|
-
let links = parent._cb.doc.getElementsByTagName('link');
|
|
108215
|
+
let links = window.parent._cb.doc.getElementsByTagName('link');
|
|
108214
108216
|
|
|
108215
108217
|
for (let i = 0; i < links.length; i++) {
|
|
108216
108218
|
let src = links[i].href.toLowerCase();
|
|
@@ -109164,7 +109166,7 @@ class ContentBox {
|
|
|
109164
109166
|
// make absolute
|
|
109165
109167
|
const link = links[i].cloneNode();
|
|
109166
109168
|
let imgUrl = link.href;
|
|
109167
|
-
let urlBase = location.href.substring(0, location.href.lastIndexOf('/'));
|
|
109169
|
+
let urlBase = window.location.href.substring(0, window.location.href.lastIndexOf('/'));
|
|
109168
109170
|
imgUrl = imgUrl.replace(urlBase, '[%PATH%]');
|
|
109169
109171
|
link.href = imgUrl;
|
|
109170
109172
|
arrLinks.push(link.outerHTML);
|
|
@@ -109206,7 +109208,7 @@ class ContentBox {
|
|
|
109206
109208
|
// make absolute
|
|
109207
109209
|
const link = links[i].cloneNode();
|
|
109208
109210
|
let imgUrl = link.href;
|
|
109209
|
-
let urlBase = location.href.substring(0, location.href.lastIndexOf('/'));
|
|
109211
|
+
let urlBase = window.location.href.substring(0, window.location.href.lastIndexOf('/'));
|
|
109210
109212
|
imgUrl = imgUrl.replace(urlBase, '[%PATH%]');
|
|
109211
109213
|
link.href = imgUrl;
|
|
109212
109214
|
arrLinks.push(link.outerHTML);
|
|
@@ -109276,7 +109278,7 @@ class ContentBox {
|
|
|
109276
109278
|
output = output.replaceAll('[%PATH%]', options.path);
|
|
109277
109279
|
} else {
|
|
109278
109280
|
let urlBase;
|
|
109279
|
-
urlBase = location.href.substring(0, location.href.lastIndexOf('/'));
|
|
109281
|
+
urlBase = window.location.href.substring(0, window.location.href.lastIndexOf('/'));
|
|
109280
109282
|
output = output.replaceAll('[%PATH%]', urlBase);
|
|
109281
109283
|
} // Beautify
|
|
109282
109284
|
|