@innovastudio/contentbox 1.6.49 → 1.6.51
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.6.
|
4
|
+
"version": "1.6.51",
|
5
5
|
"description": "",
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
7
7
|
"files": [
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"ws": "^8.13.0"
|
53
53
|
},
|
54
54
|
"dependencies": {
|
55
|
-
"@innovastudio/contentbuilder": "^1.5.
|
55
|
+
"@innovastudio/contentbuilder": "^1.5.37",
|
56
56
|
"js-beautify": "^1.14.0"
|
57
57
|
}
|
58
58
|
}
|
@@ -13098,7 +13098,7 @@ class PanelBox {
|
|
13098
13098
|
<div class="adjustboxheight">
|
13099
13099
|
<div class="label mt-3">${out('Height')}:</div>
|
13100
13100
|
<div class="group" style="margin-top:5px">
|
13101
|
-
<button title="${out('
|
13101
|
+
<button title="${out('Lock')}" data-boxheight="set" style="width:75px">${out('Lock')}</button>
|
13102
13102
|
<button title="${out('Decrease')}" data-boxheight="-"><svg><use xlink:href="#icon-minus"></use></svg></button>
|
13103
13103
|
<button title="${out('Increase')}" data-boxheight="+"><svg><use xlink:href="#icon-plus2"></use></svg></button>
|
13104
13104
|
<button title="${out('Clear')}" data-boxheight=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
|
@@ -25645,14 +25645,34 @@ class ControlPanel {
|
|
25645
25645
|
let activeImage = this.builder.editor.activeImage;
|
25646
25646
|
let activeModule = this.builder.editor.activeModule;
|
25647
25647
|
|
25648
|
-
if (
|
25649
|
-
|
25650
|
-
|
25651
|
-
|
25652
|
-
|
25653
|
-
}, 1);
|
25648
|
+
if (activeModule) {
|
25649
|
+
const moduleTool = this.builder.doc.querySelector('.is-module-tool');
|
25650
|
+
moduleTool.style.opacity = '0';
|
25651
|
+
const lockInfo = this.builder.doc.querySelector('.is-locked-indicator');
|
25652
|
+
lockInfo.style.opacity = '0';
|
25654
25653
|
setTimeout(() => {
|
25655
25654
|
this.builder.editor.util.refreshModuleLayout(activeModule);
|
25655
|
+
setTimeout(() => {
|
25656
|
+
moduleTool.style.opacity = '';
|
25657
|
+
this.builder.editor.element.module.repositionModuleTool();
|
25658
|
+
lockInfo.style.opacity = '';
|
25659
|
+
this.builder.editor.colTool.showHideLockIndicator(activeModule);
|
25660
|
+
}, 200);
|
25661
|
+
}, 600);
|
25662
|
+
}
|
25663
|
+
|
25664
|
+
if (activeModule && activeImage) {
|
25665
|
+
this.builder.editor.element.image.hideImageTool();
|
25666
|
+
setTimeout(() => {
|
25667
|
+
activeModule.querySelectorAll('img').forEach(img => {
|
25668
|
+
if (img.outerHTML === activeImage.outerHTML) {
|
25669
|
+
setTimeout(() => {
|
25670
|
+
if (img.closest('.glide__slide--active')) {
|
25671
|
+
img.click();
|
25672
|
+
}
|
25673
|
+
}, 100);
|
25674
|
+
}
|
25675
|
+
});
|
25656
25676
|
}, 600);
|
25657
25677
|
} else if (activeImage) {
|
25658
25678
|
// normal image
|
@@ -25669,6 +25689,33 @@ class ControlPanel {
|
|
25669
25689
|
this.builder.editor.element.image.repositionImageTool();
|
25670
25690
|
}, 600);
|
25671
25691
|
}
|
25692
|
+
/*
|
25693
|
+
if(activeImage && activeModule) {
|
25694
|
+
// if image is in module
|
25695
|
+
this.builder.editor.element.image.hideImageTool();
|
25696
|
+
setTimeout(()=>{
|
25697
|
+
this.panelImage.classList.remove('active');
|
25698
|
+
},1);
|
25699
|
+
setTimeout(()=>{
|
25700
|
+
this.builder.editor.util.refreshModuleLayout(activeModule);
|
25701
|
+
},600);
|
25702
|
+
} else if(activeImage) {
|
25703
|
+
// normal image
|
25704
|
+
const imageTool = document.querySelector('#divImageTool');
|
25705
|
+
const imageResizer = document.querySelector('#divImageResizer');
|
25706
|
+
const moveableBox = document.querySelector('.moveable-control-box');
|
25707
|
+
imageTool.style.opacity = '0';
|
25708
|
+
imageResizer.style.opacity = '0';
|
25709
|
+
moveableBox.style.opacity = '0';
|
25710
|
+
setTimeout(()=>{
|
25711
|
+
imageTool.style.opacity = '';
|
25712
|
+
imageResizer.style.opacity = '';
|
25713
|
+
moveableBox.style.opacity = '';
|
25714
|
+
this.builder.editor.element.image.repositionImageTool();
|
25715
|
+
},600);
|
25716
|
+
}
|
25717
|
+
*/
|
25718
|
+
|
25672
25719
|
}
|
25673
25720
|
|
25674
25721
|
getActive() {
|
@@ -26072,7 +26119,7 @@ class ControlPanel {
|
|
26072
26119
|
if (element.closest('[data-subblock]')) {
|
26073
26120
|
let titleHtml = '';
|
26074
26121
|
let module = element.closest('[data-html]');
|
26075
|
-
let desc = module.getAttribute('data-module-desc');
|
26122
|
+
let desc = module ? module.getAttribute('data-module-desc') : '';
|
26076
26123
|
|
26077
26124
|
if (desc) {
|
26078
26125
|
titleHtml = out(desc);
|
@@ -43511,8 +43558,10 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
43511
43558
|
// evt.related.getBoundingClientRect().top>window.innerHeight) {
|
43512
43559
|
// return false;
|
43513
43560
|
// }
|
43514
|
-
},
|
43515
43561
|
|
43562
|
+
const wrapper = builder.doc.querySelector(builder.page);
|
43563
|
+
if (wrapper) wrapper.style.marginLeft = '';
|
43564
|
+
},
|
43516
43565
|
onSort: evt => {
|
43517
43566
|
if (!builder.canvas) return;
|
43518
43567
|
let snippetX = evt.originalEvent.clientX;
|
@@ -43528,6 +43577,12 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
43528
43577
|
block.style.left = x + '%';
|
43529
43578
|
block.removeAttribute('data-new-dummy');
|
43530
43579
|
}
|
43580
|
+
|
43581
|
+
// to prevent flicker caused by snippet panel above wrapper (see contentbuilder.js sectionDropSetup)
|
43582
|
+
if (builder.page && builder.page === '.is-wrapper') {
|
43583
|
+
const wrapper = builder.doc.querySelector(builder.page);
|
43584
|
+
if (wrapper) wrapper.style.marginLeft = '';
|
43585
|
+
}
|
43531
43586
|
},
|
43532
43587
|
onStart: () => {
|
43533
43588
|
// Remove .builder-active during dragging (because this class makes rows have border-right/left 120px)
|
@@ -43576,6 +43631,12 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
43576
43631
|
}
|
43577
43632
|
let dummies = builder.doc.querySelectorAll('.block-dummy');
|
43578
43633
|
dummies.forEach(elm => elm.parentNode.removeChild(elm));
|
43634
|
+
|
43635
|
+
// to prevent flicker caused by snippet panel above wrapper (see contentbuilder.js sectionDropSetup)
|
43636
|
+
if (builder.page && builder.page === '.is-wrapper') {
|
43637
|
+
const wrapper = builder.doc.querySelector(builder.page);
|
43638
|
+
if (wrapper) wrapper.style.marginLeft = '';
|
43639
|
+
}
|
43579
43640
|
}, 10);
|
43580
43641
|
}
|
43581
43642
|
});
|
@@ -112615,7 +112676,7 @@ class ContentBuilder {
|
|
112615
112676
|
deleteConfirm: false,
|
112616
112677
|
disableBootstrapIcons: false,
|
112617
112678
|
sectionTemplate: `
|
112618
|
-
<div class="is-section is-box is-section-100 type-
|
112679
|
+
<div class="is-section is-box is-section-100 type-system-ui">
|
112619
112680
|
<div class="is-overlay"></div>
|
112620
112681
|
<div class="is-boxes">
|
112621
112682
|
<div class="is-box-centered">
|
@@ -118742,6 +118803,11 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
118742
118803
|
if (this.page) {
|
118743
118804
|
if (this.page !== '.is-wrapper') return; // only for ContentBox
|
118744
118805
|
const wrapper = this.doc.querySelector(this.page);
|
118806
|
+
|
118807
|
+
// to prevent flicker caused by snippet panel above wrapper
|
118808
|
+
if (!wrapper.querySelector('.is-section')) {
|
118809
|
+
wrapper.style.marginLeft = '300px';
|
118810
|
+
}
|
118745
118811
|
this.sortableOnPage = new Sortable(wrapper, {
|
118746
118812
|
scroll: true,
|
118747
118813
|
group: 'shared',
|
@@ -118835,6 +118901,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
118835
118901
|
|
118836
118902
|
if (this.opts.emailMode) bSnippet = false;
|
118837
118903
|
|
118904
|
+
// check if is block
|
118905
|
+
let isBlock = false;
|
118906
|
+
if (html.includes('"is-block')) {
|
118907
|
+
isBlock = true;
|
118908
|
+
bSnippet = false;
|
118909
|
+
}
|
118910
|
+
|
118838
118911
|
// Convert snippet into your defined 12 columns grid
|
118839
118912
|
var rowClass = this.opts.row; //row
|
118840
118913
|
var colClass = this.opts.cols; //['col s1', 'col s2', 'col s3', 'col s4', 'col s5', 'col s6', 'col s7', 'col s8', 'col s9', 'col s10', 'col s11', 'col s12']
|
@@ -118892,6 +118965,14 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
118892
118965
|
// </div>
|
118893
118966
|
// `;
|
118894
118967
|
itemEl.outerHTML = this.settings.sectionTemplate.replace('[%CONTENT%]', html);
|
118968
|
+
} else if (isBlock) {
|
118969
|
+
let canvasTemplate = `
|
118970
|
+
<div class="is-section is-box is-section-100 type-system-ui box-canvas autolayout last-box">
|
118971
|
+
<div class="is-overlay"></div>
|
118972
|
+
[%CONTENT%]
|
118973
|
+
</div>
|
118974
|
+
`;
|
118975
|
+
itemEl.outerHTML = canvasTemplate.replace('[%CONTENT%]', html);
|
118895
118976
|
} else {
|
118896
118977
|
// Snippet is wrapped in row/colum (may contain custom code or has [data-html] attribute)
|
118897
118978
|
// Can only be inserted after current row or last row (not on column or element).
|
@@ -145657,6 +145738,7 @@ class IframePanel {
|
|
145657
145738
|
|
145658
145739
|
document.addEventListener('mousemove', this.handleResizeMove);
|
145659
145740
|
document.addEventListener('touchmove', this.handleResizeMove);
|
145741
|
+
this.hideTools();
|
145660
145742
|
}, 100);
|
145661
145743
|
document.addEventListener('mouseup', this.handleResizeEnd);
|
145662
145744
|
document.addEventListener('touchend', this.handleResizeEnd);
|
@@ -145881,7 +145963,37 @@ class IframePanel {
|
|
145881
145963
|
this.repositionTool(); // this.builder.editor.screenMode = this.builder.screenMode; // Passsing screenMode into ContentBuilder
|
145882
145964
|
}
|
145883
145965
|
|
145966
|
+
hideTools() {
|
145967
|
+
let elmTool = this.builder.doc.querySelector('.is-element-tool');
|
145968
|
+
if (elmTool) elmTool.style.display = '';
|
145969
|
+
let moduleTool = this.builder.doc.querySelector('.is-module-tool');
|
145970
|
+
if (moduleTool) moduleTool.style.display = '';
|
145971
|
+
let lockIndicator = this.builder.doc.querySelector('.is-locked-indicator');
|
145972
|
+
if (lockIndicator) lockIndicator.style.display = '';
|
145973
|
+
let linkTool = this.builder.doc.querySelector('#divLinkTool');
|
145974
|
+
if (linkTool) linkTool.style.display = '';
|
145975
|
+
let spacerTool = this.builderStuff.querySelector('.is-spacer-tool');
|
145976
|
+
if (spacerTool) spacerTool.style.display = '';
|
145977
|
+
this.builder.editor.element.image.hideImageTool();
|
145978
|
+
this.builder.doc.querySelectorAll('.icon-active').forEach(elm => elm.classList.remove('icon-active'));
|
145979
|
+
this.builder.doc.querySelectorAll('.elm-inspected').forEach(elm => elm.classList.remove('elm-inspected'));
|
145980
|
+
this.builder.doc.querySelectorAll('.elm-active').forEach(elm => elm.classList.remove('elm-active'));
|
145981
|
+
}
|
145982
|
+
|
145884
145983
|
repositionTool() {
|
145984
|
+
this.hideTools();
|
145985
|
+
let activeImage = this.builder.editor.activeImage;
|
145986
|
+
|
145987
|
+
if (activeImage) {
|
145988
|
+
setTimeout(() => {
|
145989
|
+
if (activeImage.closest('[data-html]')) {
|
145990
|
+
this.builder.editor.util.refreshModuleLayout(activeImage.closest('[data-html]'));
|
145991
|
+
}
|
145992
|
+
}, 600);
|
145993
|
+
}
|
145994
|
+
}
|
145995
|
+
|
145996
|
+
repositionTool_bak() {
|
145885
145997
|
const col = this.builder.editor.activeCol;
|
145886
145998
|
|
145887
145999
|
if (col) {
|
@@ -145927,7 +146039,19 @@ class IframePanel {
|
|
145927
146039
|
}
|
145928
146040
|
}
|
145929
146041
|
}, 600);
|
145930
|
-
}
|
146042
|
+
} // let activeModule = this.builder.editor.activeModule;
|
146043
|
+
// if(activeModule) {
|
146044
|
+
// const moduleTool = this.builder.doc.querySelector('.is-module-tool');
|
146045
|
+
// moduleTool.style.opacity = '0';
|
146046
|
+
// setTimeout(()=>{
|
146047
|
+
// moduleTool.style.opacity = '';
|
146048
|
+
// moduleTool.style.display = 'flex';
|
146049
|
+
// this.builder.editor.element.module.repositionModuleTool();
|
146050
|
+
// },600);
|
146051
|
+
// }
|
146052
|
+
// const lockInfo = this.builder.doc.querySelector('.is-locked-indicator');
|
146053
|
+
// lockInfo.style.display = '';
|
146054
|
+
|
145931
146055
|
}
|
145932
146056
|
|
145933
146057
|
loadIframe() {
|
@@ -146363,7 +146487,7 @@ class ContentBox {
|
|
146363
146487
|
deleteConfirm: false,
|
146364
146488
|
blockRotate: true,
|
146365
146489
|
sectionTemplate: `
|
146366
|
-
<div class="is-section is-box is-section-100 box-autofit type-
|
146490
|
+
<div class="is-section is-box is-section-100 box-autofit type-system-ui">
|
146367
146491
|
<div class="is-overlay"></div>
|
146368
146492
|
<div class="is-container is-content-1000 v2 size-18 leading-14">
|
146369
146493
|
[%CONTENT%]
|
@@ -150125,6 +150249,11 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
|
|
150125
150249
|
.is-wrapper.is-container-edit > div.section-select, .is-wrapper.is-clean-edit > div.section-select {
|
150126
150250
|
overflow-x: unset !important;
|
150127
150251
|
overflow-y: unset !important;
|
150252
|
+
z-index: 2;
|
150253
|
+
}
|
150254
|
+
|
150255
|
+
.is-wrapper.is-edit {
|
150256
|
+
min-height: 100vh;
|
150128
150257
|
}
|
150129
150258
|
|
150130
150259
|
${this.iframe ? '' : `
|