@innovastudio/contentbox 1.5.43 → 1.5.45
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@innovastudio/contentbox",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.5.
|
4
|
+
"version": "1.5.45",
|
5
5
|
"description": "",
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
7
7
|
"files": [
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"webpack-dev-server": "^4.0.0"
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
|
-
"@innovastudio/contentbuilder": "^1.4.
|
49
|
+
"@innovastudio/contentbuilder": "^1.4.33",
|
50
50
|
"js-beautify": "^1.14.0"
|
51
51
|
}
|
52
52
|
}
|
@@ -1396,6 +1396,8 @@ class SideBar {
|
|
1396
1396
|
url: '${item.url}',
|
1397
1397
|
path: '${item.path}',
|
1398
1398
|
pathReplace: '${item.pathReplace}',
|
1399
|
+
${Object.prototype.hasOwnProperty.call(item, 'numbering') ? `numbering: ${item.numbering},` : 'numbering:false,'}
|
1400
|
+
${Object.prototype.hasOwnProperty.call(item, 'showNumberOnHover') ? `showNumberOnHover: ${item.showNumberOnHover},` : 'showNumberOnHover:false,'}
|
1399
1401
|
},`;
|
1400
1402
|
});
|
1401
1403
|
let sTemplates = '';
|
@@ -1404,6 +1406,8 @@ class SideBar {
|
|
1404
1406
|
url: '${item.url}',
|
1405
1407
|
path: '${item.path}',
|
1406
1408
|
pathReplace: '${item.pathReplace}',
|
1409
|
+
${Object.prototype.hasOwnProperty.call(item, 'numbering') ? `numbering: ${item.numbering},` : 'numbering:false,'}
|
1410
|
+
${Object.prototype.hasOwnProperty.call(item, 'showNumberOnHover') ? `showNumberOnHover: ${item.showNumberOnHover},` : 'showNumberOnHover:false,'}
|
1407
1411
|
},`;
|
1408
1412
|
});
|
1409
1413
|
let sDefaultCategory = `{
|
@@ -1684,6 +1688,23 @@ class SideBar {
|
|
1684
1688
|
}
|
1685
1689
|
}
|
1686
1690
|
|
1691
|
+
.is-number {
|
1692
|
+
opacity: 0;
|
1693
|
+
position: absolute;
|
1694
|
+
top: 3px;
|
1695
|
+
right: 3px;
|
1696
|
+
color: #444;
|
1697
|
+
padding: 3px 6px;
|
1698
|
+
background: rgb(255 255 255);
|
1699
|
+
border-radius: 500px;
|
1700
|
+
transition: all 0.3s ease;
|
1701
|
+
}
|
1702
|
+
.is-number.show {
|
1703
|
+
opacity: 1;
|
1704
|
+
}
|
1705
|
+
.is-design-list > button:hover .is-number {
|
1706
|
+
opacity: 1;
|
1707
|
+
}
|
1687
1708
|
|
1688
1709
|
|
1689
1710
|
|
@@ -2069,6 +2090,11 @@ class SideBar {
|
|
2069
2090
|
|
2070
2091
|
template_list.forEach(gallery=>{
|
2071
2092
|
let designs = gallery.designs;
|
2093
|
+
|
2094
|
+
let numbering = gallery.numbering;
|
2095
|
+
let showNumberOnHover = gallery.showNumberOnHover;
|
2096
|
+
let numberCount = 0;
|
2097
|
+
|
2072
2098
|
designs.forEach(item=>{
|
2073
2099
|
let isSelected = false;
|
2074
2100
|
let catSplit = item.category.split(',');
|
@@ -2081,10 +2107,13 @@ class SideBar {
|
|
2081
2107
|
item.id = nIndex; //Give id
|
2082
2108
|
|
2083
2109
|
if (isSelected) {
|
2084
|
-
|
2110
|
+
|
2111
|
+
numberCount++;
|
2112
|
+
|
2085
2113
|
let html = '<button tabindex="0" class="active" data-id="' + item.id + '" data-cat=""' + item.category + '">' +
|
2086
2114
|
'<img class="lzy-img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAaCAYAAAAjZdWPAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z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Lsc0aYOtZdo5QCwezI4wm9J/v0X23mlZXOfBjj8Jzv3WrY5D+CsA9D7aMs2gGfjve8ArD6mePZSeCfEYt8CONWDw8FXTxrPqx/r9Vt4biXeANh8vV7/+/16ffMD1N8AuKD/A/8leAvFY9bLAAAAOGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAACoAIABAAAAAEAAAAtoAMABAAAAAEAAAAaAAAAAHZhQ/wAAABcSURBVFgJ7dLBCcAwEANBx/337IQUsK/FcLD3FQgx9nO+W8NuD9v7z230rVdLOmkQ6HsAjholrXJCWdKAo0ZJq5xQljTgqFHSKieUJQ04apS0ygllSQOOGo2UfgEpPQQwSb0YngAAAABJRU5ErkJggg==" data-src="' + gallery.path + item.thumbnail + '">' +
|
2087
2115
|
'<span class="is-overlay"></span>' +
|
2116
|
+
(numbering? (showNumberOnHover?'<div class="is-number">'+(numberCount+'').padStart(3, '0')+'</div>':'<div class="is-number show">'+(numberCount+'').padStart(3, '0')+'</div>') :'') +
|
2088
2117
|
'</button>';
|
2089
2118
|
|
2090
2119
|
if(item.type === 'glide' || item.type === 'slick') {
|
@@ -2379,6 +2408,8 @@ class SideBar {
|
|
2379
2408
|
templateAdded.path = template.path;
|
2380
2409
|
templateAdded.pathReplace = template.pathReplace;
|
2381
2410
|
templateAdded.designId = designId;
|
2411
|
+
templateAdded.numbering = template.numbering;
|
2412
|
+
templateAdded.showNumberOnHover = template.showNumberOnHover;
|
2382
2413
|
// console.log(templateAdded);
|
2383
2414
|
|
2384
2415
|
renderMegaMenu();
|
@@ -4807,6 +4838,7 @@ class EditSection {
|
|
4807
4838
|
});
|
4808
4839
|
if (dom$m.hasClass(activeSection, 'is-section-100')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="100"]'), 'on');
|
4809
4840
|
if (dom$m.hasClass(activeSection, 'is-section-90')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="90"]'), 'on');
|
4841
|
+
if (dom$m.hasClass(activeSection, 'is-section-85')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="85"]'), 'on');
|
4810
4842
|
if (dom$m.hasClass(activeSection, 'is-section-80')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="80"]'), 'on');
|
4811
4843
|
if (dom$m.hasClass(activeSection, 'is-section-75')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="75"]'), 'on');
|
4812
4844
|
if (dom$m.hasClass(activeSection, 'is-section-70')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="70"]'), 'on');
|
@@ -4816,6 +4848,8 @@ class EditSection {
|
|
4816
4848
|
if (dom$m.hasClass(activeSection, 'is-section-30')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="30"]'), 'on');
|
4817
4849
|
if (dom$m.hasClass(activeSection, 'is-section-25')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="25"]'), 'on');
|
4818
4850
|
if (dom$m.hasClass(activeSection, 'is-section-20')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="20"]'), 'on');
|
4851
|
+
if (dom$m.hasClass(activeSection, 'is-section-15')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="15"]'), 'on');
|
4852
|
+
if (dom$m.hasClass(activeSection, 'is-section-10')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="10"]'), 'on');
|
4819
4853
|
if (dom$m.hasClass(activeSection, 'is-section-auto')) dom$m.addClass(modalEditSection.querySelector('.cmd-section-height[data-value="0"]'), 'on');
|
4820
4854
|
btns = modalEditSection.querySelectorAll('.cmd-section-anim-start');
|
4821
4855
|
btns.forEach(btn => {
|
@@ -5201,6 +5235,8 @@ class EditSection {
|
|
5201
5235
|
const activeSection = this.builder.activeSection;
|
5202
5236
|
activeSection.style.height = '';
|
5203
5237
|
dom$m.removeClass(activeSection, 'is-section-auto');
|
5238
|
+
dom$m.removeClass(activeSection, 'is-section-10');
|
5239
|
+
dom$m.removeClass(activeSection, 'is-section-15');
|
5204
5240
|
dom$m.removeClass(activeSection, 'is-section-20');
|
5205
5241
|
dom$m.removeClass(activeSection, 'is-section-25');
|
5206
5242
|
dom$m.removeClass(activeSection, 'is-section-30');
|
@@ -5210,6 +5246,7 @@ class EditSection {
|
|
5210
5246
|
dom$m.removeClass(activeSection, 'is-section-70');
|
5211
5247
|
dom$m.removeClass(activeSection, 'is-section-75');
|
5212
5248
|
dom$m.removeClass(activeSection, 'is-section-80');
|
5249
|
+
dom$m.removeClass(activeSection, 'is-section-85');
|
5213
5250
|
dom$m.removeClass(activeSection, 'is-section-90');
|
5214
5251
|
dom$m.removeClass(activeSection, 'is-section-100');
|
5215
5252
|
|
@@ -91827,12 +91864,16 @@ class LivePreview {
|
|
91827
91864
|
resizePreview(size) {
|
91828
91865
|
let modal = this.modal;
|
91829
91866
|
let util = this.util;
|
91867
|
+
modal.classList.remove('is-screen-1920');
|
91830
91868
|
modal.classList.remove('is-screen-1440');
|
91831
91869
|
modal.classList.remove('is-screen-1920');
|
91832
91870
|
modal.classList.remove('is-screen-1024');
|
91833
91871
|
modal.classList.remove('is-screen-768');
|
91834
91872
|
modal.classList.remove('is-screen-375');
|
91835
91873
|
const infoDevice = modal.querySelector('.is-modal-device');
|
91874
|
+
const previewScreen = modal.querySelector('.preview-screen');
|
91875
|
+
previewScreen.style.transition = 'none';
|
91876
|
+
previewScreen.style.opacity = '0';
|
91836
91877
|
|
91837
91878
|
if (size === 1440) {
|
91838
91879
|
modal.classList.add('is-screen-1440');
|
@@ -91840,7 +91881,6 @@ class LivePreview {
|
|
91840
91881
|
infoDevice.setAttribute('title', util.out('Laptop'));
|
91841
91882
|
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-laptop"></use></svg>';
|
91842
91883
|
} else if (size === 1024) {
|
91843
|
-
modal.classList.remove('is-screen-1440');
|
91844
91884
|
modal.classList.add('is-screen-1024');
|
91845
91885
|
infoDevice.setAttribute('title', util.out('Tablet (Landscape)'));
|
91846
91886
|
localStorage.setItem('_livepreviewscreen', 'is-screen-1024');
|
@@ -91863,6 +91903,10 @@ class LivePreview {
|
|
91863
91903
|
}
|
91864
91904
|
|
91865
91905
|
this.previewRefresh(true);
|
91906
|
+
setTimeout(() => {
|
91907
|
+
previewScreen.style.opacity = '';
|
91908
|
+
previewScreen.style.transition = '';
|
91909
|
+
}, 100);
|
91866
91910
|
}
|
91867
91911
|
|
91868
91912
|
previewRefresh(disableOnContentLoad, hardReload) {
|
@@ -91881,20 +91925,26 @@ class LivePreview {
|
|
91881
91925
|
let iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
91882
91926
|
|
91883
91927
|
if (iframeDocument) {
|
91884
|
-
if (iframeDocument.body
|
91928
|
+
if (!iframeDocument.body) {
|
91885
91929
|
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
91886
91930
|
} else {
|
91887
|
-
|
91888
|
-
let html = this.builder.html();
|
91889
|
-
let container = iframeDocument.querySelector('.container');
|
91890
|
-
if (!container) container = iframeDocument.querySelector('.is-container');
|
91891
|
-
|
91892
|
-
if (container) {
|
91893
|
-
container.innerHTML = html;
|
91894
|
-
} else {
|
91931
|
+
if (iframeDocument.body.innerHTML === '') {
|
91895
91932
|
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
91933
|
+
} else {
|
91934
|
+
// sync. html
|
91935
|
+
let html = this.builder.html();
|
91936
|
+
let container = iframeDocument.querySelector('.container');
|
91937
|
+
if (!container) container = iframeDocument.querySelector('.is-container');
|
91938
|
+
|
91939
|
+
if (container) {
|
91940
|
+
container.innerHTML = html;
|
91941
|
+
} else {
|
91942
|
+
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
91943
|
+
}
|
91896
91944
|
}
|
91897
91945
|
}
|
91946
|
+
} else {
|
91947
|
+
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
91898
91948
|
}
|
91899
91949
|
}
|
91900
91950
|
} else {
|
@@ -91920,80 +91970,84 @@ class LivePreview {
|
|
91920
91970
|
let iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
91921
91971
|
|
91922
91972
|
if (iframeDocument) {
|
91923
|
-
if (iframeDocument.body
|
91973
|
+
if (!iframeDocument.body) {
|
91924
91974
|
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
91925
91975
|
} else {
|
91926
|
-
|
91927
|
-
|
91928
|
-
|
91929
|
-
|
91930
|
-
|
91931
|
-
|
91932
|
-
|
91933
|
-
|
91934
|
-
|
91935
|
-
|
91936
|
-
let
|
91937
|
-
|
91938
|
-
|
91939
|
-
|
91940
|
-
|
91941
|
-
|
91942
|
-
|
91943
|
-
|
91944
|
-
|
91945
|
-
|
91946
|
-
|
91947
|
-
|
91976
|
+
if (iframeDocument.body.innerHTML === '') {
|
91977
|
+
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
91978
|
+
} else {
|
91979
|
+
// sync. html
|
91980
|
+
let html = localStorage.getItem('preview-html');
|
91981
|
+
let wrapper = iframeDocument.querySelector('.is-wrapper');
|
91982
|
+
wrapper.innerHTML = html; // sync. styles
|
91983
|
+
// let mainCss = localStorage.getItem('preview-maincss');
|
91984
|
+
// let sectionCss = localStorage.getItem('preview-sectioncss');
|
91985
|
+
|
91986
|
+
let elms = iframeDocument.querySelectorAll('link');
|
91987
|
+
let links = this.builder.doc.getElementsByTagName('link');
|
91988
|
+
Array.from(links).map(link => {
|
91989
|
+
let href = link.href.toLowerCase();
|
91990
|
+
|
91991
|
+
if (href.indexOf('/basetype-') !== -1 || href.indexOf('/type-') !== -1) {
|
91992
|
+
// check
|
91993
|
+
let exist = false;
|
91994
|
+
elms.forEach(elm => {
|
91995
|
+
let elmHref = elm.href.toLowerCase();
|
91996
|
+
|
91997
|
+
if (elmHref) {
|
91998
|
+
if (elmHref.indexOf('/basetype-') !== -1 || elmHref.indexOf('/type-') !== -1) {
|
91999
|
+
if (href === elmHref) {
|
92000
|
+
exist = true;
|
92001
|
+
}
|
91948
92002
|
}
|
91949
92003
|
}
|
91950
|
-
}
|
91951
|
-
});
|
92004
|
+
});
|
91952
92005
|
|
91953
|
-
|
91954
|
-
|
91955
|
-
|
91956
|
-
|
92006
|
+
if (!exist) {
|
92007
|
+
// clone is needed, otherwise, parent resource may dissapear when loading on iframe
|
92008
|
+
const clone = link.cloneNode(true);
|
92009
|
+
iframeDocument.head.appendChild(clone); // ADD
|
92010
|
+
}
|
91957
92011
|
}
|
91958
|
-
}
|
91959
|
-
|
91960
|
-
|
91961
|
-
|
91962
|
-
|
91963
|
-
|
91964
|
-
|
91965
|
-
|
91966
|
-
|
91967
|
-
|
91968
|
-
|
91969
|
-
|
91970
|
-
|
91971
|
-
|
91972
|
-
|
92012
|
+
});
|
92013
|
+
elms.forEach(elm => {
|
92014
|
+
let href = elm.href.toLowerCase();
|
92015
|
+
|
92016
|
+
if (href.indexOf('/basetype-') !== -1 || href.indexOf('/type-') !== -1) {
|
92017
|
+
// check
|
92018
|
+
let exist = false;
|
92019
|
+
Array.from(links).map(link => {
|
92020
|
+
let elmHref = link.href.toLowerCase();
|
92021
|
+
|
92022
|
+
if (elmHref) {
|
92023
|
+
if (elmHref.indexOf('/basetype-') !== -1 || elmHref.indexOf('/type-') !== -1) {
|
92024
|
+
if (href === elmHref) {
|
92025
|
+
exist = true;
|
92026
|
+
}
|
91973
92027
|
}
|
91974
92028
|
}
|
91975
|
-
}
|
91976
|
-
});
|
92029
|
+
});
|
91977
92030
|
|
91978
|
-
|
91979
|
-
|
92031
|
+
if (!exist) {
|
92032
|
+
iframeDocument.head.removeChild(elm); // REMOVE
|
92033
|
+
}
|
91980
92034
|
}
|
91981
|
-
}
|
91982
|
-
|
91983
|
-
|
91984
|
-
|
91985
|
-
|
91986
|
-
|
91987
|
-
|
91988
|
-
|
91989
|
-
|
91990
|
-
|
91991
|
-
|
91992
|
-
|
91993
|
-
|
92035
|
+
}); // reload box js
|
92036
|
+
|
92037
|
+
elms = iframeDocument.querySelectorAll('script');
|
92038
|
+
elms.forEach(elm => {
|
92039
|
+
let src = elm.getAttribute('src');
|
92040
|
+
|
92041
|
+
if (src) {
|
92042
|
+
if (src.indexOf('box-flex.js') !== -1 || src.indexOf('box.js') !== -1) {
|
92043
|
+
elm.parentElement.removeChild(elm);
|
92044
|
+
let scriptElm = document.createElement('script');
|
92045
|
+
scriptElm.setAttribute('src', src);
|
92046
|
+
iframeDocument.body.appendChild(scriptElm);
|
92047
|
+
}
|
91994
92048
|
}
|
91995
|
-
}
|
91996
|
-
}
|
92049
|
+
});
|
92050
|
+
}
|
91997
92051
|
}
|
91998
92052
|
} else {
|
91999
92053
|
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|