@innovastudio/contentbox 1.6.47 → 1.6.49
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -2
- package/public/contentbox/contentbox.css +55 -36
- package/public/contentbox/contentbox.esm.js +1195 -137
- package/public/contentbox/contentbox.min.js +11 -11
- package/public/contentbox/lang/en.js +4 -1
- package/readme.txt +1 -1
@@ -1159,8 +1159,7 @@ class SideBar {
|
|
1159
1159
|
this.closeSidebar(); // Close all modeless dialogs
|
1160
1160
|
|
1161
1161
|
if (this.builder.editbox) this.builder.editbox.close();
|
1162
|
-
if (this.builder.editsection) this.builder.editsection.close();
|
1163
|
-
this.builder.animateScroll.close(); // Close anim side panel
|
1162
|
+
if (this.builder.editsection) this.builder.editsection.close(); // this.builder.animateScroll.close(); // Close anim side panel
|
1164
1163
|
|
1165
1164
|
if (toggle) return;
|
1166
1165
|
let panelId = btn.getAttribute('data-content');
|
@@ -13095,18 +13094,20 @@ class PanelBox {
|
|
13095
13094
|
</div>
|
13096
13095
|
|
13097
13096
|
<div class="div-boxcanvas">
|
13098
|
-
<div class="breakpoint-list"></div>
|
13099
13097
|
|
13100
13098
|
<div class="adjustboxheight">
|
13101
13099
|
<div class="label mt-3">${out('Height')}:</div>
|
13102
|
-
<div class="group">
|
13100
|
+
<div class="group" style="margin-top:5px">
|
13101
|
+
<button title="${out('Fixed')}" data-boxheight="set" style="width:75px">${out('Fixed')}</button>
|
13103
13102
|
<button title="${out('Decrease')}" data-boxheight="-"><svg><use xlink:href="#icon-minus"></use></svg></button>
|
13104
13103
|
<button title="${out('Increase')}" data-boxheight="+"><svg><use xlink:href="#icon-plus2"></use></svg></button>
|
13105
13104
|
<button title="${out('Clear')}" data-boxheight=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
|
13106
13105
|
</div>
|
13107
13106
|
</div>
|
13108
13107
|
|
13109
|
-
<
|
13108
|
+
<div class="breakpoint-list"></div>
|
13109
|
+
|
13110
|
+
<label class="label checkbox mt-4" style="margin-bottom:15px">
|
13110
13111
|
<input type="checkbox" class="chk-auto-layout" />
|
13111
13112
|
<span>${out('Auto Layout on Mobile')}</span>
|
13112
13113
|
</label>
|
@@ -13539,6 +13540,8 @@ class PanelBox {
|
|
13539
13540
|
newHeight = currentHeight + 50;
|
13540
13541
|
} else if (s === '-') {
|
13541
13542
|
newHeight = currentHeight - 50;
|
13543
|
+
} else if (s === 'set') {
|
13544
|
+
newHeight = currentHeight;
|
13542
13545
|
} else {
|
13543
13546
|
newHeight = '';
|
13544
13547
|
}
|
@@ -13556,7 +13559,14 @@ class PanelBox {
|
|
13556
13559
|
box.removeAttribute('data--h-' + breakpoint);
|
13557
13560
|
} else {
|
13558
13561
|
box.removeAttribute('data--h', newHeight);
|
13559
|
-
}
|
13562
|
+
} // const attributes = box.attributes;
|
13563
|
+
// for (let i = 0; i < attributes.length; i++) {
|
13564
|
+
// const attributeName = attributes[i].name;
|
13565
|
+
// if (attributeName.includes('data--h-')) {
|
13566
|
+
// box.removeAttribute(attributeName);
|
13567
|
+
// }
|
13568
|
+
// }
|
13569
|
+
|
13560
13570
|
|
13561
13571
|
box.style.height = '';
|
13562
13572
|
}
|
@@ -13920,6 +13930,9 @@ class PanelBox {
|
|
13920
13930
|
if (attributeName.includes('data--h-')) {
|
13921
13931
|
let val = attributeName.replace('data--h-', '');
|
13922
13932
|
if (!breakpoints.includes(val)) breakpoints.push(val);
|
13933
|
+
} else if (attributeName === 'data--h') {
|
13934
|
+
let val = 'default';
|
13935
|
+
if (!breakpoints.includes(val)) breakpoints.push(val);
|
13923
13936
|
}
|
13924
13937
|
}
|
13925
13938
|
|
@@ -13933,7 +13946,7 @@ class PanelBox {
|
|
13933
13946
|
for (let i = 0; i < attributes.length; i++) {
|
13934
13947
|
const attributeName = attributes[i].name;
|
13935
13948
|
|
13936
|
-
if (attributeName.includes('data--h
|
13949
|
+
if (attributeName.includes('data--h')) {
|
13937
13950
|
attributesToRemove.push(attributeName);
|
13938
13951
|
}
|
13939
13952
|
}
|
@@ -13952,19 +13965,22 @@ class PanelBox {
|
|
13952
13965
|
if (!activeBox) return;
|
13953
13966
|
const breakpoints = this.getBreakpoints(activeBox);
|
13954
13967
|
breakpoints.forEach(item => {
|
13955
|
-
|
13968
|
+
if (item === 'default') {
|
13969
|
+
s += `<button data-breakpoint="1920" style="width:60px">${out('default')}</button>`;
|
13970
|
+
} else {
|
13971
|
+
s += `<button data-breakpoint="${item}" style="width:60px">${item}px</button>`;
|
13972
|
+
}
|
13956
13973
|
});
|
13957
13974
|
|
13958
13975
|
if (s !== '') {
|
13959
13976
|
this.breakpointList.innerHTML = `
|
13960
13977
|
|
13961
|
-
|
13978
|
+
<!--<div class="label mt-1">${out('Breakpoints')}:</div>-->
|
13962
13979
|
|
13963
13980
|
<div class="flex">
|
13964
13981
|
<div class="mr-2">
|
13965
13982
|
<div class="group breakpoint-buttons" style="width:auto;display:inline-flex;max-width:135px">
|
13966
13983
|
${s}
|
13967
|
-
<button data-breakpoint="1920" style="width:60px">${out('default')}</button>
|
13968
13984
|
</div>
|
13969
13985
|
</div>
|
13970
13986
|
<div>
|
@@ -14662,6 +14678,11 @@ class PanelBlock {
|
|
14662
14678
|
</div>
|
14663
14679
|
</div>
|
14664
14680
|
|
14681
|
+
<div class="group moreoptions mt-2">
|
14682
|
+
<button title="${out('Shadow')}" class="btn-shadow" style="width:103px">${out('Shadow')}</button>
|
14683
|
+
<button title="${out('More')}" class="btn-moreoptions" style="width:103px">${out('More')}</button>
|
14684
|
+
</div>
|
14685
|
+
|
14665
14686
|
<div class="breakpoint-list"></div>
|
14666
14687
|
|
14667
14688
|
<div class="group flex mt-4 div-ungroup" style="width: 217px">
|
@@ -14691,6 +14712,9 @@ class PanelBlock {
|
|
14691
14712
|
<div class="group info-breakpoint" style="margin-top:17px;padding:10px 15px 3px;display:none"><div></div></div>
|
14692
14713
|
-->
|
14693
14714
|
|
14715
|
+
<div class="group resetrotation mt-2"">
|
14716
|
+
<button title="${out('Reset Rotation')}" class="btn-resetrotation">${out('Reset Rotation')}</button>
|
14717
|
+
</div>
|
14694
14718
|
</div>
|
14695
14719
|
|
14696
14720
|
|
@@ -14707,6 +14731,14 @@ class PanelBlock {
|
|
14707
14731
|
<span>${out('Remove Content')}</span>
|
14708
14732
|
</button>
|
14709
14733
|
</div>
|
14734
|
+
|
14735
|
+
<div class="label mt-3">${out('Placement')}:</div>
|
14736
|
+
<div class="group mt-2">
|
14737
|
+
<button title="${out('Top')}" data-align="items-start"><svg><use xlink:href="#icon-align-box-top"></use></svg></button>
|
14738
|
+
<button title="${out('Middle')}" data-align="items-center"><svg><use xlink:href="#icon-align-box-middle"></use></svg></button>
|
14739
|
+
<button title="${out('Bottom')}" data-align="items-end"><svg><use xlink:href="#icon-align-box-bottom"></use></svg></button>
|
14740
|
+
<button title="${out('Clear')}" data-align=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
|
14741
|
+
</div>
|
14710
14742
|
|
14711
14743
|
<div class="group editspacing mt-4"">
|
14712
14744
|
<button title="${out('Spacing')}" class="btn-spacing">${out('Spacing')}</button>
|
@@ -15119,6 +15151,10 @@ class PanelBlock {
|
|
15119
15151
|
btnSpacing.addEventListener('click', () => {
|
15120
15152
|
this.builder.controlpanel.objDialogSpacingContainer.open();
|
15121
15153
|
});
|
15154
|
+
const btnMore = panel.querySelector('.btn-moreoptions');
|
15155
|
+
btnMore.addEventListener('click', () => {
|
15156
|
+
this.builder.controlpanel.objDialogBlockOptions.open();
|
15157
|
+
});
|
15122
15158
|
const btnUngroup = panel.querySelector('.btn-ungroup');
|
15123
15159
|
btnUngroup.addEventListener('click', () => {
|
15124
15160
|
this.builder.editor.saveForUndo();
|
@@ -15140,6 +15176,18 @@ class PanelBlock {
|
|
15140
15176
|
this.builder.eb.removeShape();
|
15141
15177
|
this.builder.onChange();
|
15142
15178
|
});
|
15179
|
+
const btnResetRotation = panel.querySelector('.btn-resetrotation');
|
15180
|
+
btnResetRotation.addEventListener('click', () => {
|
15181
|
+
this.builder.editor.saveForUndo();
|
15182
|
+
this.builder.doc.querySelectorAll('.is-block.active').forEach(block => {
|
15183
|
+
block.style.transform = '';
|
15184
|
+
});
|
15185
|
+
this.builder.onChange();
|
15186
|
+
});
|
15187
|
+
const btnShadow = panel.querySelector('.btn-shadow');
|
15188
|
+
btnShadow.addEventListener('click', () => {
|
15189
|
+
this.builder.controlpanel.objDialogShadow.open();
|
15190
|
+
});
|
15143
15191
|
/*
|
15144
15192
|
const btnAddBreakpoint = panel.querySelector('.btn-addbreakpoint');
|
15145
15193
|
btnAddBreakpoint.addEventListener('click', ()=>{
|
@@ -15317,6 +15365,31 @@ class PanelBlock {
|
|
15317
15365
|
}
|
15318
15366
|
|
15319
15367
|
this.builder.onChange();
|
15368
|
+
}); // Flex
|
15369
|
+
|
15370
|
+
const btnJustify = panel.querySelectorAll('[data-align]');
|
15371
|
+
btnJustify.forEach(btn => {
|
15372
|
+
btn.addEventListener('click', () => {
|
15373
|
+
this.builder.editor.saveForUndo();
|
15374
|
+
const val = btn.getAttribute('data-align');
|
15375
|
+
const elms = this.builder.doc.querySelectorAll('.is-block.active');
|
15376
|
+
elms.forEach(target => {
|
15377
|
+
target.classList.remove('flex');
|
15378
|
+
target.classList.remove('items-start');
|
15379
|
+
target.classList.remove('items-center');
|
15380
|
+
target.classList.remove('items-end');
|
15381
|
+
});
|
15382
|
+
|
15383
|
+
if (val !== '') {
|
15384
|
+
elms.forEach(target => {
|
15385
|
+
target.classList.add('flex');
|
15386
|
+
target.classList.add(val);
|
15387
|
+
});
|
15388
|
+
}
|
15389
|
+
|
15390
|
+
this.getState();
|
15391
|
+
this.builder.onChange();
|
15392
|
+
});
|
15320
15393
|
});
|
15321
15394
|
}
|
15322
15395
|
|
@@ -15503,8 +15576,17 @@ class PanelBlock {
|
|
15503
15576
|
|
15504
15577
|
blockOverlay() {
|
15505
15578
|
let block = this.builder.controlpanel.activeBlock;
|
15506
|
-
if (!block) return false;
|
15507
|
-
|
15579
|
+
if (!block) return false; // let blockOverlay = block.querySelector('.is-block-overlay');
|
15580
|
+
|
15581
|
+
let children = block.children;
|
15582
|
+
let blockOverlay = null;
|
15583
|
+
|
15584
|
+
for (let i = 0; i < children.length; i++) {
|
15585
|
+
if (children[i].classList.contains('is-block-overlay')) {
|
15586
|
+
blockOverlay = children[i];
|
15587
|
+
break;
|
15588
|
+
}
|
15589
|
+
}
|
15508
15590
|
|
15509
15591
|
if (!blockOverlay) {
|
15510
15592
|
block.insertAdjacentHTML('beforeend', '<div class="is-block-overlay"></div>');
|
@@ -15536,6 +15618,14 @@ class PanelBlock {
|
|
15536
15618
|
btnRemoveShape.style.display = 'none';
|
15537
15619
|
}
|
15538
15620
|
|
15621
|
+
const divResetRotation = panel.querySelector('div.resetrotation');
|
15622
|
+
|
15623
|
+
if (block.style.transform.includes('rotate')) {
|
15624
|
+
divResetRotation.style.display = '';
|
15625
|
+
} else {
|
15626
|
+
divResetRotation.style.display = 'none';
|
15627
|
+
}
|
15628
|
+
|
15539
15629
|
if (block) {
|
15540
15630
|
if (block.closest('.autolayout')) {
|
15541
15631
|
this.divArrange.style.display = 'none';
|
@@ -15638,7 +15728,19 @@ class PanelBlock {
|
|
15638
15728
|
this.divMove.style.display = 'none';
|
15639
15729
|
}
|
15640
15730
|
|
15641
|
-
this.showBlockPos();
|
15731
|
+
this.showBlockPos(); // flex
|
15732
|
+
|
15733
|
+
if (block) {
|
15734
|
+
this.panel.querySelectorAll('[data-align]').forEach(elm => elm.classList.remove('on'));
|
15735
|
+
|
15736
|
+
if (block.classList.contains('items-start')) {
|
15737
|
+
this.panel.querySelector('[data-align=items-start]').classList.add('on');
|
15738
|
+
} else if (block.classList.contains('items-center')) {
|
15739
|
+
this.panel.querySelector('[data-align=items-center]').classList.add('on');
|
15740
|
+
} else if (block.classList.contains('items-end')) {
|
15741
|
+
this.panel.querySelector('[data-align=items-end]').classList.add('on');
|
15742
|
+
}
|
15743
|
+
}
|
15642
15744
|
}
|
15643
15745
|
|
15644
15746
|
showBlockPos() {
|
@@ -17454,13 +17556,25 @@ class PanelColumn {
|
|
17454
17556
|
activeColumn.classList.add('xs-hidden');
|
17455
17557
|
} else if (target === 'sm') {
|
17456
17558
|
activeColumn.classList.add('sm-hidden');
|
17457
|
-
activeColumn.parentNode.classList.add('sm-autofit');
|
17559
|
+
activeColumn.parentNode.classList.add('sm-autofit'); // hide all others smaller than tablet portrait
|
17560
|
+
|
17561
|
+
activeColumn.classList.add('xs-hidden');
|
17458
17562
|
} else if (target === 'md') {
|
17459
17563
|
activeColumn.classList.add('md-hidden');
|
17460
|
-
activeColumn.parentNode.classList.add('md-autofit');
|
17564
|
+
activeColumn.parentNode.classList.add('md-autofit'); // hide all others smaller than tablet landscape
|
17565
|
+
|
17566
|
+
activeColumn.classList.add('sm-hidden');
|
17567
|
+
activeColumn.parentNode.classList.add('sm-autofit');
|
17568
|
+
activeColumn.classList.add('xs-hidden');
|
17461
17569
|
} else if (target === '') {
|
17462
17570
|
activeColumn.classList.add('desktop-hidden');
|
17463
|
-
activeColumn.parentNode.classList.add('desktop-autofit');
|
17571
|
+
activeColumn.parentNode.classList.add('desktop-autofit'); // hide all others smaller than desktop
|
17572
|
+
|
17573
|
+
activeColumn.classList.add('md-hidden');
|
17574
|
+
activeColumn.parentNode.classList.add('md-autofit');
|
17575
|
+
activeColumn.classList.add('sm-hidden');
|
17576
|
+
activeColumn.parentNode.classList.add('sm-autofit');
|
17577
|
+
activeColumn.classList.add('xs-hidden');
|
17464
17578
|
}
|
17465
17579
|
}
|
17466
17580
|
|
@@ -17804,6 +17918,23 @@ class PanelRow {
|
|
17804
17918
|
let screenMode = this.builder.screenMode;
|
17805
17919
|
if (screenMode === 'desktop') prefix = 'desktop-items-';else if (screenMode === 'tablet-landscape') prefix = 'md-items-';else if (screenMode === 'tablet') prefix = 'sm-items-';else if (screenMode === 'mobile') prefix = 'xs-items-';
|
17806
17920
|
|
17921
|
+
if (this.builder.doc.body.hasAttribute('data-breakpoint')) {
|
17922
|
+
const breakpoint = this.builder.doc.body.getAttribute('data-breakpoint');
|
17923
|
+
|
17924
|
+
if (breakpoint <= 760) {
|
17925
|
+
prefix = 'xs-items-';
|
17926
|
+
} else if (760 < breakpoint && breakpoint <= 970) {
|
17927
|
+
prefix = 'sm-items-';
|
17928
|
+
} else if (970 < breakpoint && breakpoint <= 1280) {
|
17929
|
+
prefix = 'md-items-';
|
17930
|
+
} else if (1280 < breakpoint && breakpoint <= 1920) {
|
17931
|
+
prefix = 'desktop-items-';
|
17932
|
+
} else {
|
17933
|
+
// 1920<breakpoint
|
17934
|
+
prefix = 'desktop-items-';
|
17935
|
+
}
|
17936
|
+
}
|
17937
|
+
|
17807
17938
|
for (let j = 1; j <= 6; j++) {
|
17808
17939
|
activeRow.classList.remove(prefix + j);
|
17809
17940
|
}
|
@@ -18067,13 +18198,25 @@ class PanelRow {
|
|
18067
18198
|
activeRow.classList.add('xs-hidden');
|
18068
18199
|
} else if (target === 'sm') {
|
18069
18200
|
activeRow.classList.add('sm-hidden');
|
18070
|
-
activeRow.parentNode.classList.add('sm-autofit');
|
18201
|
+
activeRow.parentNode.classList.add('sm-autofit'); // hide all others smaller than tablet portrait
|
18202
|
+
|
18203
|
+
activeRow.classList.add('xs-hidden');
|
18071
18204
|
} else if (target === 'md') {
|
18072
18205
|
activeRow.classList.add('md-hidden');
|
18073
|
-
activeRow.parentNode.classList.add('md-autofit');
|
18206
|
+
activeRow.parentNode.classList.add('md-autofit'); // hide all others smaller than tablet landscape
|
18207
|
+
|
18208
|
+
activeRow.classList.add('sm-hidden');
|
18209
|
+
activeRow.parentNode.classList.add('sm-autofit');
|
18210
|
+
activeRow.classList.add('xs-hidden');
|
18074
18211
|
} else if (target === '') {
|
18075
18212
|
activeRow.classList.add('desktop-hidden');
|
18076
|
-
activeRow.parentNode.classList.add('desktop-autofit');
|
18213
|
+
activeRow.parentNode.classList.add('desktop-autofit'); // hide all others smaller than desktop
|
18214
|
+
|
18215
|
+
activeRow.classList.add('md-hidden');
|
18216
|
+
activeRow.parentNode.classList.add('md-autofit');
|
18217
|
+
activeRow.classList.add('sm-hidden');
|
18218
|
+
activeRow.parentNode.classList.add('sm-autofit');
|
18219
|
+
activeRow.classList.add('xs-hidden');
|
18077
18220
|
}
|
18078
18221
|
}
|
18079
18222
|
|
@@ -22062,6 +22205,431 @@ class SpacingContainer {
|
|
22062
22205
|
|
22063
22206
|
}
|
22064
22207
|
|
22208
|
+
class BlockOptions {
|
22209
|
+
constructor(dialog, builder) {
|
22210
|
+
this.builder = builder;
|
22211
|
+
this.dialog = dialog;
|
22212
|
+
let html = `
|
22213
|
+
<button class="btn-back" tabindex="-1" title="${out('Close')}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>
|
22214
|
+
|
22215
|
+
<div class="submain">
|
22216
|
+
<div class="label" style="font-size:18px">${out('More Options')}</div>
|
22217
|
+
<label class="std">
|
22218
|
+
<span class="label mt-3">${out('Border Radius')}:</span>
|
22219
|
+
<div class="mt-2">
|
22220
|
+
<input type="range" min="0" max="500" value="0" class="inp-block-borderradius is-rangeslider" style="width:180px">
|
22221
|
+
</div>
|
22222
|
+
<div class="mt-3" style="align-items:center;">
|
22223
|
+
<input type="text" class="inp-borderradius" style="width:80px">
|
22224
|
+
<span>px</span>
|
22225
|
+
</div>
|
22226
|
+
</label>
|
22227
|
+
|
22228
|
+
<!--<div class="group mt-5">
|
22229
|
+
<button title="${out('Shadow')}" class="btn-shadow" style="width:221px">${out('Shadow')}</button>
|
22230
|
+
</div>-->
|
22231
|
+
</div>
|
22232
|
+
|
22233
|
+
<button class="accordion-item" aria-expanded="false" aria-controls="blockmore1">
|
22234
|
+
${out('Border')}
|
22235
|
+
<span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>
|
22236
|
+
</button>
|
22237
|
+
<div class="accordion-content" id="blockmore1" aria-hidden="true">
|
22238
|
+
|
22239
|
+
<div class="subpanel">
|
22240
|
+
|
22241
|
+
<div class="label subtitle mt-2">${out('Border')}:</div>
|
22242
|
+
|
22243
|
+
<div class="flex">
|
22244
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22245
|
+
<div>
|
22246
|
+
<span class="label">${out('Width')}:</span>
|
22247
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22248
|
+
</div>
|
22249
|
+
<input type="text" class="inp-borderwidth" style="width:80px">
|
22250
|
+
</label>
|
22251
|
+
<label class="std" style="margin-right:12px;">
|
22252
|
+
<span class="label"> </span>
|
22253
|
+
<select class="inp-borderstyle" style="width:80px">
|
22254
|
+
<option value=""></option>
|
22255
|
+
<option value="solid">${out('Solid')}</option>
|
22256
|
+
<option value="dashed">${out('Dashed')}</option>
|
22257
|
+
<option value="dotted">${out('Dotted')}</option>
|
22258
|
+
</select>
|
22259
|
+
</label>
|
22260
|
+
<label class="std">
|
22261
|
+
<span class="label"> </span>
|
22262
|
+
<div class="group">
|
22263
|
+
<button title="${out('Color')}" class="btn-bordercolor is-btn-color"></button>
|
22264
|
+
</div>
|
22265
|
+
</label>
|
22266
|
+
</div>
|
22267
|
+
|
22268
|
+
<div class="label subtitle">${out('Individual Sides')}:</div>
|
22269
|
+
|
22270
|
+
<div class="flex">
|
22271
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22272
|
+
<div>
|
22273
|
+
<span class="label">${out('Top')}:</span>
|
22274
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22275
|
+
</div>
|
22276
|
+
<input type="text" class="inp-bordertopwidth" style="width:80px">
|
22277
|
+
</label>
|
22278
|
+
<label class="std" style="margin-right:12px;">
|
22279
|
+
<span class="label"> </span>
|
22280
|
+
<select class="inp-bordertopstyle" style="width:80px">
|
22281
|
+
<option value=""></option>
|
22282
|
+
<option value="solid">${out('Solid')}</option>
|
22283
|
+
<option value="dashed">${out('Dashed')}</option>
|
22284
|
+
<option value="dotted">${out('Dotted')}</option>
|
22285
|
+
</select>
|
22286
|
+
</label>
|
22287
|
+
<label class="std">
|
22288
|
+
<span class="label"> </span>
|
22289
|
+
<div class="group">
|
22290
|
+
<button title="${out('Color')}" class="btn-bordertopcolor is-btn-color"></button>
|
22291
|
+
</div>
|
22292
|
+
</label>
|
22293
|
+
</div>
|
22294
|
+
|
22295
|
+
<div class="flex">
|
22296
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22297
|
+
<div>
|
22298
|
+
<span class="label">${out('Bottom')}:</span>
|
22299
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22300
|
+
</div>
|
22301
|
+
<input type="text" class="inp-borderbottomwidth" style="width:80px">
|
22302
|
+
</label>
|
22303
|
+
<label class="std" style="margin-right:12px;">
|
22304
|
+
<span class="label"> </span>
|
22305
|
+
<select class="inp-borderbottomstyle" style="width:80px">
|
22306
|
+
<option value=""></option>
|
22307
|
+
<option value="solid">${out('Solid')}</option>
|
22308
|
+
<option value="dashed">${out('Dashed')}</option>
|
22309
|
+
<option value="dotted">${out('Dotted')}</option>
|
22310
|
+
</select>
|
22311
|
+
</label>
|
22312
|
+
<label class="std">
|
22313
|
+
<span class="label"> </span>
|
22314
|
+
<div class="group">
|
22315
|
+
<button title="${out('Color')}" class="btn-borderbottomcolor is-btn-color"></button>
|
22316
|
+
</div>
|
22317
|
+
</label>
|
22318
|
+
</div>
|
22319
|
+
|
22320
|
+
<div class="flex">
|
22321
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22322
|
+
<div>
|
22323
|
+
<span class="label">${out('Left')}:</span>
|
22324
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22325
|
+
</div>
|
22326
|
+
<input type="text" class="inp-borderleftwidth" style="width:80px">
|
22327
|
+
</label>
|
22328
|
+
<label class="std" style="margin-right:12px;">
|
22329
|
+
<span class="label"> </span>
|
22330
|
+
<select class="inp-borderleftstyle" style="width:80px">
|
22331
|
+
<option value=""></option>
|
22332
|
+
<option value="solid">${out('Solid')}</option>
|
22333
|
+
<option value="dashed">${out('Dashed')}</option>
|
22334
|
+
<option value="dotted">${out('Dotted')}</option>
|
22335
|
+
</select>
|
22336
|
+
</label>
|
22337
|
+
<label class="std">
|
22338
|
+
<span class="label"> </span>
|
22339
|
+
<div class="group">
|
22340
|
+
<button title="${out('Color')}" class="btn-borderleftcolor is-btn-color"></button>
|
22341
|
+
</div>
|
22342
|
+
</label>
|
22343
|
+
</div>
|
22344
|
+
|
22345
|
+
<div class="flex">
|
22346
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22347
|
+
<div>
|
22348
|
+
<span class="label">${out('Right')}:</span>
|
22349
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22350
|
+
</div>
|
22351
|
+
<input type="text" class="inp-borderrightwidth" style="width:80px">
|
22352
|
+
</label>
|
22353
|
+
<label class="std" style="margin-right:12px;">
|
22354
|
+
<span class="label"> </span>
|
22355
|
+
<select class="inp-borderrightstyle" style="width:80px">
|
22356
|
+
<option value=""></option>
|
22357
|
+
<option value="solid">${out('Solid')}</option>
|
22358
|
+
<option value="dashed">${out('Dashed')}</option>
|
22359
|
+
<option value="dotted">${out('Dotted')}</option>
|
22360
|
+
</select>
|
22361
|
+
</label>
|
22362
|
+
<label class="std">
|
22363
|
+
<span class="label"> </span>
|
22364
|
+
<div class="group">
|
22365
|
+
<button title="${out('Color')}" class="btn-borderrightcolor is-btn-color"></button>
|
22366
|
+
</div>
|
22367
|
+
</label>
|
22368
|
+
</div>
|
22369
|
+
|
22370
|
+
</div>
|
22371
|
+
|
22372
|
+
</div>
|
22373
|
+
|
22374
|
+
<div class="panel-pop unit-1" tabIndex="-1" aria-hidden="true">
|
22375
|
+
<button title="px">px</button>
|
22376
|
+
<button title="vw">vw</button>
|
22377
|
+
<button title="vw">vh</button>
|
22378
|
+
<button title="em">em</button>
|
22379
|
+
<button title="rem">rem</button>
|
22380
|
+
</div>
|
22381
|
+
`;
|
22382
|
+
dialog.insertAdjacentHTML('beforeend', html);
|
22383
|
+
this.unit = dialog.querySelector('.panel-pop.unit-1');
|
22384
|
+
const btnBack = dialog.querySelector('.btn-back');
|
22385
|
+
btnBack.addEventListener('click', () => {
|
22386
|
+
this.close();
|
22387
|
+
}); // Units
|
22388
|
+
|
22389
|
+
dialog.querySelectorAll('.btn-unit').forEach(btn => btn.addEventListener('click', e => {
|
22390
|
+
this.builder.controlpanel.showPop(this.unit, () => {// btn.focus();
|
22391
|
+
}, btn);
|
22392
|
+
this.unitButton = btn;
|
22393
|
+
e.preventDefault();
|
22394
|
+
})); // Apply Style
|
22395
|
+
|
22396
|
+
let timer;
|
22397
|
+
const divBorder = dialog.querySelector('#blockmore1');
|
22398
|
+
divBorder.querySelectorAll('input').forEach(inp => {
|
22399
|
+
inp.addEventListener('input', () => {
|
22400
|
+
clearTimeout(timer);
|
22401
|
+
timer = setTimeout(() => {
|
22402
|
+
this.applyStyle(inp);
|
22403
|
+
}, 600);
|
22404
|
+
});
|
22405
|
+
});
|
22406
|
+
divBorder.querySelectorAll('select').forEach(inp => inp.addEventListener('change', () => {
|
22407
|
+
this.applyStyle(inp);
|
22408
|
+
}));
|
22409
|
+
this.unit.querySelectorAll('button').forEach(btn => {
|
22410
|
+
btn.addEventListener('click', () => {
|
22411
|
+
this.unitButton.innerText = btn.innerText;
|
22412
|
+
this.builder.controlpanel.hidePop(this.unit);
|
22413
|
+
const inp = this.unitButton.parentNode.parentNode.querySelector('input');
|
22414
|
+
this.applyStyle(inp);
|
22415
|
+
});
|
22416
|
+
}); // Colors
|
22417
|
+
|
22418
|
+
const renderColorPicker = (property, selector) => {
|
22419
|
+
const btnPicker = dialog.querySelector(selector);
|
22420
|
+
btnPicker.addEventListener('click', () => {
|
22421
|
+
this.builder.editor.saveForUndo(true); // checkLater = true
|
22422
|
+
|
22423
|
+
let block = this.blockOverlay();
|
22424
|
+
let bgcolor = btnPicker.style.backgroundColor;
|
22425
|
+
const colorpicker = this.builder.editor.colorpicker();
|
22426
|
+
colorpicker.open(s => {
|
22427
|
+
block.style[property] = s;
|
22428
|
+
btnPicker.style.backgroundColor = s; // preview
|
22429
|
+
|
22430
|
+
this.builder.onChange();
|
22431
|
+
}, bgcolor);
|
22432
|
+
});
|
22433
|
+
};
|
22434
|
+
|
22435
|
+
renderColorPicker('border-color', '.btn-bordercolor');
|
22436
|
+
renderColorPicker('border-top-color', '.btn-bordertopcolor');
|
22437
|
+
renderColorPicker('border-bottom-color', '.btn-borderbottomcolor');
|
22438
|
+
renderColorPicker('border-left-color', '.btn-borderleftcolor');
|
22439
|
+
renderColorPicker('border-right-color', '.btn-borderrightcolor'); // Border Radius
|
22440
|
+
|
22441
|
+
const inpBorderRadius = dialog.querySelector('.inp-borderradius');
|
22442
|
+
const inpBlockBorderRadius = dialog.querySelector('.inp-block-borderradius');
|
22443
|
+
this.inpBorderRadius = inpBorderRadius;
|
22444
|
+
this.inpBlockBorderRadius = inpBlockBorderRadius;
|
22445
|
+
|
22446
|
+
inpBlockBorderRadius.onfocus = () => {
|
22447
|
+
this.builder.editor.saveForUndo(true);
|
22448
|
+
};
|
22449
|
+
|
22450
|
+
inpBlockBorderRadius.oninput = () => {
|
22451
|
+
// val: 0 - 500
|
22452
|
+
let val = inpBlockBorderRadius.value;
|
22453
|
+
inpBorderRadius.value = val;
|
22454
|
+
const blockOverlay = this.blockOverlay();
|
22455
|
+
blockOverlay.style.borderRadius = val + 'px';
|
22456
|
+
};
|
22457
|
+
|
22458
|
+
inpBlockBorderRadius.onchange = () => {
|
22459
|
+
this.builder.onChange();
|
22460
|
+
}; // const btnShadow = dialog.querySelector('.btn-shadow');
|
22461
|
+
// btnShadow.addEventListener('click',()=>{
|
22462
|
+
// this.builder.controlpanel.objDialogShadow.open();
|
22463
|
+
// });
|
22464
|
+
|
22465
|
+
}
|
22466
|
+
|
22467
|
+
applyStyle(inp) {
|
22468
|
+
this.builder.editor.saveForUndo();
|
22469
|
+
let cls = inp.classList;
|
22470
|
+
if (cls.contains('inp-borderwidth')) this.setStyle('border-width', '.inp-borderwidth');
|
22471
|
+
if (cls.contains('inp-bordertopwidth')) this.setStyle('border-top-width', '.inp-bordertopwidth');
|
22472
|
+
if (cls.contains('inp-borderbottomwidth')) this.setStyle('border-bottom-width', '.inp-borderbottomwidth');
|
22473
|
+
if (cls.contains('inp-borderleftwidth')) this.setStyle('border-left-width', '.inp-borderleftwidth');
|
22474
|
+
if (cls.contains('inp-borderrightwidth')) this.setStyle('border-right-width', '.inp-borderrightwidth');
|
22475
|
+
if (cls.contains('inp-borderstyle')) this.setStyleSelect('border-style', '.inp-borderstyle');
|
22476
|
+
if (cls.contains('inp-bordertopstyle')) this.setStyleSelect('border-top-style', '.inp-bordertopstyle');
|
22477
|
+
if (cls.contains('inp-borderbottomstyle')) this.setStyleSelect('border-bottom-style', '.inp-borderbottomstyle');
|
22478
|
+
if (cls.contains('inp-borderleftstyle')) this.setStyleSelect('border-left-style', '.inp-borderleftstyle');
|
22479
|
+
if (cls.contains('inp-borderrightstyle')) this.setStyleSelect('border-right-style', '.inp-borderrightstyle'); // if(cls.contains('inp-shadowxoffset') ||
|
22480
|
+
// cls.contains('inp-shadowyoffset') ||
|
22481
|
+
// cls.contains('inp-shadowblur') ||
|
22482
|
+
// cls.contains('inp-shadowspread') ||
|
22483
|
+
// cls.contains('inp-shadowtype')) {
|
22484
|
+
// this.setBoxShadow();
|
22485
|
+
// }
|
22486
|
+
|
22487
|
+
this.builder.onChange();
|
22488
|
+
|
22489
|
+
if (cls.contains('inp-borderwidth') || cls.contains('inp-bordertopwidth') || cls.contains('inp-borderbottomwidth') || cls.contains('inp-borderleftwidth') || cls.contains('inp-borderrightwidth') || cls.contains('inp-borderradius')) {
|
22490
|
+
this.refresh();
|
22491
|
+
}
|
22492
|
+
}
|
22493
|
+
|
22494
|
+
refresh() {
|
22495
|
+
this.getStyle('border-width', '.inp-borderwidth');
|
22496
|
+
this.getStyle('border-top-width', '.inp-bordertopwidth');
|
22497
|
+
this.getStyle('border-bottom-width', '.inp-borderbottomwidth');
|
22498
|
+
this.getStyle('border-left-width', '.inp-borderleftwidth');
|
22499
|
+
this.getStyle('border-right-width', '.inp-borderrightwidth');
|
22500
|
+
this.getStyleSelect('border-style', '.inp-borderstyle');
|
22501
|
+
this.getStyleSelect('border-top-style', '.inp-bordertopstyle');
|
22502
|
+
this.getStyleSelect('border-bottom-style', '.inp-borderbottomstyle');
|
22503
|
+
this.getStyleSelect('border-left-style', '.inp-borderleftstyle');
|
22504
|
+
this.getStyleSelect('border-right-style', '.inp-borderrightstyle'); // this.getBoxShadow();
|
22505
|
+
|
22506
|
+
const block = this.blockOverlay();
|
22507
|
+
const dialog = this.dialog; // Border Color
|
22508
|
+
|
22509
|
+
const btnBorderColor = dialog.querySelector('.btn-bordercolor');
|
22510
|
+
let bordercolor = block.style.borderColor;
|
22511
|
+
if (bordercolor) btnBorderColor.style.backgroundColor = bordercolor;else btnBorderColor.style.backgroundColor = ''; // Border Top Color
|
22512
|
+
|
22513
|
+
const btnBorderTopColor = dialog.querySelector('.btn-bordertopcolor');
|
22514
|
+
let bordertopcolor = block.style.borderTopColor;
|
22515
|
+
if (bordertopcolor) btnBorderTopColor.style.backgroundColor = bordertopcolor;else btnBorderTopColor.style.backgroundColor = ''; // Border Bottom Color
|
22516
|
+
|
22517
|
+
const btnBorderBottomColor = dialog.querySelector('.btn-borderbottomcolor');
|
22518
|
+
let borderbottomcolor = block.style.borderBottomColor;
|
22519
|
+
if (borderbottomcolor) btnBorderBottomColor.style.backgroundColor = borderbottomcolor;else btnBorderBottomColor.style.backgroundColor = ''; // Border Left Color
|
22520
|
+
|
22521
|
+
const btnBorderLeftColor = dialog.querySelector('.btn-borderleftcolor');
|
22522
|
+
let borderleftcolor = block.style.borderLeftColor;
|
22523
|
+
if (borderleftcolor) btnBorderLeftColor.style.backgroundColor = borderleftcolor;else btnBorderLeftColor.style.backgroundColor = ''; // Border Right Color
|
22524
|
+
|
22525
|
+
const btnBorderRightColor = dialog.querySelector('.btn-borderrightcolor');
|
22526
|
+
let borderrightcolor = block.style.borderRightColor;
|
22527
|
+
if (borderrightcolor) btnBorderRightColor.style.backgroundColor = borderrightcolor;else btnBorderRightColor.style.backgroundColor = '';
|
22528
|
+
}
|
22529
|
+
|
22530
|
+
getState() {
|
22531
|
+
this.inpBorderRadius.value = '0';
|
22532
|
+
this.inpBlockBorderRadius.value = '0';
|
22533
|
+
const blockOverlay = this.blockOverlay();
|
22534
|
+
|
22535
|
+
if (blockOverlay.style.borderRadius) {
|
22536
|
+
let val = parseInt(blockOverlay.style.borderRadius);
|
22537
|
+
this.inpBorderRadius.value = val;
|
22538
|
+
this.inpBlockBorderRadius.value = val;
|
22539
|
+
}
|
22540
|
+
|
22541
|
+
this.refresh();
|
22542
|
+
}
|
22543
|
+
|
22544
|
+
open() {
|
22545
|
+
this.dialog.style.display = 'flex';
|
22546
|
+
this.getState();
|
22547
|
+
}
|
22548
|
+
|
22549
|
+
close() {
|
22550
|
+
this.dialog.style.display = '';
|
22551
|
+
}
|
22552
|
+
|
22553
|
+
blockOverlay() {
|
22554
|
+
let block = this.builder.controlpanel.activeBlock;
|
22555
|
+
if (!block) return false; // let blockOverlay = block.querySelector('.is-block-overlay');
|
22556
|
+
|
22557
|
+
let children = block.children;
|
22558
|
+
let blockOverlay = null;
|
22559
|
+
|
22560
|
+
for (let i = 0; i < children.length; i++) {
|
22561
|
+
if (children[i].classList.contains('is-block-overlay')) {
|
22562
|
+
blockOverlay = children[i];
|
22563
|
+
break;
|
22564
|
+
}
|
22565
|
+
}
|
22566
|
+
|
22567
|
+
if (!blockOverlay) {
|
22568
|
+
block.insertAdjacentHTML('beforeend', '<div class="is-block-overlay"></div>');
|
22569
|
+
blockOverlay = block.querySelector('.is-block-overlay');
|
22570
|
+
}
|
22571
|
+
|
22572
|
+
return blockOverlay;
|
22573
|
+
}
|
22574
|
+
|
22575
|
+
getStyle(property, selector) {
|
22576
|
+
let block = this.blockOverlay();
|
22577
|
+
const current = this.parseStyle(block, property);
|
22578
|
+
const dialog = this.dialog;
|
22579
|
+
const inp = dialog.querySelector(selector);
|
22580
|
+
const btn = inp.parentNode.querySelector('.btn-unit');
|
22581
|
+
inp.value = current.value;
|
22582
|
+
btn.innerText = current.unit ? current.unit : '-';
|
22583
|
+
}
|
22584
|
+
|
22585
|
+
setStyle(property, selector) {
|
22586
|
+
let block = this.blockOverlay();
|
22587
|
+
const dialog = this.dialog;
|
22588
|
+
const inp = dialog.querySelector(selector);
|
22589
|
+
const btn = inp.parentNode.querySelector('.btn-unit');
|
22590
|
+
const value = inp.value;
|
22591
|
+
let unit = btn.innerText;
|
22592
|
+
if (unit === '-') unit = '';
|
22593
|
+
block.style[property] = value ? `${value + unit}` : '';
|
22594
|
+
}
|
22595
|
+
|
22596
|
+
setStyleSelect(property, selector) {
|
22597
|
+
let block = this.blockOverlay();
|
22598
|
+
const dialog = this.dialog;
|
22599
|
+
const inp = dialog.querySelector(selector);
|
22600
|
+
const value = inp.value;
|
22601
|
+
block.style[property] = value;
|
22602
|
+
}
|
22603
|
+
|
22604
|
+
getStyleSelect(property, selector) {
|
22605
|
+
let block = this.blockOverlay();
|
22606
|
+
let value = block.style[property];
|
22607
|
+
const dialog = this.dialog;
|
22608
|
+
const inp = dialog.querySelector(selector);
|
22609
|
+
inp.value = value;
|
22610
|
+
}
|
22611
|
+
|
22612
|
+
parseStyle(element, property) {
|
22613
|
+
const styleValue = element.style[property];
|
22614
|
+
const match = styleValue.match(/^([0-9.]+)(px|vw|vh|em|rem|pt|vmin|vmax|%)$/);
|
22615
|
+
|
22616
|
+
if (match) {
|
22617
|
+
const numericValue = match[1];
|
22618
|
+
const unit = match[2];
|
22619
|
+
return {
|
22620
|
+
value: numericValue,
|
22621
|
+
unit
|
22622
|
+
};
|
22623
|
+
} else {
|
22624
|
+
return {
|
22625
|
+
value: '',
|
22626
|
+
unit: 'px'
|
22627
|
+
};
|
22628
|
+
}
|
22629
|
+
}
|
22630
|
+
|
22631
|
+
}
|
22632
|
+
|
22065
22633
|
class Element$2 {
|
22066
22634
|
constructor(dialog, builder) {
|
22067
22635
|
this.builder = builder;
|
@@ -23387,38 +23955,45 @@ class Element$2 {
|
|
23387
23955
|
}
|
23388
23956
|
|
23389
23957
|
parseStyle(element, property) {
|
23390
|
-
|
23391
|
-
|
23392
|
-
|
23393
|
-
|
23394
|
-
|
23395
|
-
|
23396
|
-
|
23397
|
-
|
23398
|
-
|
23399
|
-
|
23400
|
-
|
23401
|
-
|
23402
|
-
|
23403
|
-
|
23404
|
-
|
23405
|
-
|
23406
|
-
|
23407
|
-
|
23408
|
-
|
23409
|
-
if (match) {
|
23410
|
-
const numericValue = match[1];
|
23411
|
-
const unit = match[2];
|
23412
|
-
return {
|
23413
|
-
value: numericValue,
|
23414
|
-
unit
|
23415
|
-
};
|
23958
|
+
try {
|
23959
|
+
const styleValue = element.style[property];
|
23960
|
+
const match = styleValue.match(/^([0-9.]+)(px|vw|vh|em|rem|pt|vmin|vmax|%)$/);
|
23961
|
+
|
23962
|
+
if (property === 'line-height') {
|
23963
|
+
// line-height can have no unit, ex: 1, 1.4, etc
|
23964
|
+
if (match) {
|
23965
|
+
const numericValue = match[1];
|
23966
|
+
const unit = match[2];
|
23967
|
+
return {
|
23968
|
+
value: numericValue,
|
23969
|
+
unit
|
23970
|
+
};
|
23971
|
+
} else {
|
23972
|
+
return {
|
23973
|
+
value: styleValue,
|
23974
|
+
unit: ''
|
23975
|
+
};
|
23976
|
+
}
|
23416
23977
|
} else {
|
23417
|
-
|
23418
|
-
|
23419
|
-
unit
|
23420
|
-
|
23978
|
+
if (match) {
|
23979
|
+
const numericValue = match[1];
|
23980
|
+
const unit = match[2];
|
23981
|
+
return {
|
23982
|
+
value: numericValue,
|
23983
|
+
unit
|
23984
|
+
};
|
23985
|
+
} else {
|
23986
|
+
return {
|
23987
|
+
value: '',
|
23988
|
+
unit: 'px'
|
23989
|
+
};
|
23990
|
+
}
|
23421
23991
|
}
|
23992
|
+
} catch (e) {
|
23993
|
+
return {
|
23994
|
+
value: '',
|
23995
|
+
unit: 'px'
|
23996
|
+
};
|
23422
23997
|
}
|
23423
23998
|
}
|
23424
23999
|
|
@@ -23617,13 +24192,25 @@ class Element$2 {
|
|
23617
24192
|
elm.classList.add('xs-hidden');
|
23618
24193
|
} else if (target === 'sm') {
|
23619
24194
|
elm.classList.add('sm-hidden');
|
23620
|
-
elm.parentNode.classList.add('sm-autofit');
|
24195
|
+
elm.parentNode.classList.add('sm-autofit'); // hide all others smaller than tablet portrait
|
24196
|
+
|
24197
|
+
elm.classList.add('xs-hidden');
|
23621
24198
|
} else if (target === 'md') {
|
23622
24199
|
elm.classList.add('md-hidden');
|
23623
|
-
elm.parentNode.classList.add('md-autofit');
|
24200
|
+
elm.parentNode.classList.add('md-autofit'); // hide all others smaller than tablet landscape
|
24201
|
+
|
24202
|
+
elm.classList.add('sm-hidden');
|
24203
|
+
elm.parentNode.classList.add('sm-autofit');
|
24204
|
+
elm.classList.add('xs-hidden');
|
23624
24205
|
} else if (target === '') {
|
23625
24206
|
elm.classList.add('desktop-hidden');
|
23626
|
-
elm.parentNode.classList.add('desktop-autofit');
|
24207
|
+
elm.parentNode.classList.add('desktop-autofit'); // hide all others smaller than desktop
|
24208
|
+
|
24209
|
+
elm.classList.add('md-hidden');
|
24210
|
+
elm.parentNode.classList.add('md-autofit');
|
24211
|
+
elm.classList.add('sm-hidden');
|
24212
|
+
elm.parentNode.classList.add('sm-autofit');
|
24213
|
+
elm.classList.add('xs-hidden');
|
23627
24214
|
}
|
23628
24215
|
}
|
23629
24216
|
|
@@ -23680,6 +24267,14 @@ class Shadow {
|
|
23680
24267
|
constructor(dialog, builder) {
|
23681
24268
|
this.builder = builder;
|
23682
24269
|
this.dialog = dialog;
|
24270
|
+
let shadowTemplates = this.builder.shadowTemplates;
|
24271
|
+
let shadowHtml = '';
|
24272
|
+
|
24273
|
+
for (let i = 1; i <= shadowTemplates.length; i++) {
|
24274
|
+
let item = shadowTemplates[i - 1];
|
24275
|
+
shadowHtml += `<button data-shadow="${item}" title="${out('Apply Shadow')}" type="button" style="box-shadow: ${item}">${i}</button>`;
|
24276
|
+
}
|
24277
|
+
|
23683
24278
|
let html = `
|
23684
24279
|
<button class="btn-back" tabindex="-1" title="${out('Close')}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>
|
23685
24280
|
|
@@ -23688,27 +24283,25 @@ class Shadow {
|
|
23688
24283
|
<div class="label" style="font-size:18px">${out('Shadow')}</div>
|
23689
24284
|
|
23690
24285
|
<div class="div-shadow-list">
|
23691
|
-
|
23692
|
-
<button data-shadow="rgba(0, 0, 0, 0.3) 0px 1px 3px 0px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 3px 0px">1</button>
|
23693
|
-
<button data-shadow="rgba(0, 0, 0, 0.15) 0px 1px 5px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.15) 0px 1px 5px">2</button>
|
23694
|
-
<button data-shadow="rgba(0, 0, 0, 0.16) 0px 3px 6px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px">3</button>
|
23695
|
-
<button data-shadow="rgba(0, 0, 0, 0.22) 0px 10px 10px -5px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.22) 0px 10px 10px -5px">4</button>
|
23696
|
-
<button data-shadow="rgba(0, 0, 0, 0.19) 0px 10px 20px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px">5</button>
|
23697
|
-
<button data-shadow="rgba(0, 0, 0, 0.21) 0px 5px 6px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.21) 0px 5px 6px">6</button>
|
23698
|
-
<button data-shadow="rgba(0, 0, 0, 0.25) 0px 14px 28px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px">7</button>
|
23699
|
-
<button data-shadow="rgba(0, 0, 0, 0.19) 0px 6px 20px 0px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.19) 0px 6px 20px 0px">8</button>
|
23700
|
-
<button data-shadow="rgba(0, 0, 0, 0.08) 4px 17px 20px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.08) 4px 17px 20px">9</button>
|
23701
|
-
<button data-shadow="rgba(0, 0, 0, 0.12) 0px 11px 35px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.12) 0px 11px 35px">10</button>
|
23702
|
-
<button data-shadow="rgba(0, 0, 0, 0.06) 17px 17px 0px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.06) 17px 17px 0px">11</button>
|
23703
|
-
<button data-shadow="rgba(0, 0, 0, 0.1) 0px 0px 40px inset" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 40px inset">12</button>
|
23704
|
-
<button data-shadow="rgba(22, 22, 22, 0.2) 2em 2em 5em" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgba(22, 22, 22, 0.2) 2em 2em 5em">13</button>
|
23705
|
-
<button data-shadow="rgb(0 0 0 / 24%) 30px 30px 45px" title="${out('Apply Shadow')}" type="button" style="box-shadow: rgb(0 0 0 / 24%) 30px 30px 45px">14</button>
|
23706
|
-
|
24286
|
+
${shadowHtml}
|
23707
24287
|
</div>
|
23708
24288
|
|
23709
24289
|
<div class="group mt-4">
|
23710
24290
|
<button title="${out('Clear')}" class="btn-clean-shadow"><svg><use xlink:href="#icon-eraser"></use></svg></button>
|
23711
24291
|
</div>
|
24292
|
+
|
24293
|
+
<span class="label mt-3">${out('X')}:</span>
|
24294
|
+
<div class="mt-2">
|
24295
|
+
<input type="range" min="-100" max="100" value="0" class="inp-shadow-x is-rangeslider" style="width:180px">
|
24296
|
+
</div>
|
24297
|
+
|
24298
|
+
<span class="label mt-3">${out('Y')}:</span>
|
24299
|
+
<div class="mt-2">
|
24300
|
+
<input type="range" min="-100" max="100" value="0" class="inp-shadow-y is-rangeslider" style="width:180px">
|
24301
|
+
</div>
|
24302
|
+
|
24303
|
+
<span class="label mt-3">${out('Color')}:</span>
|
24304
|
+
<button title="${out('Color')}" class="btn-color is-btn-color"></button>
|
23712
24305
|
</div>
|
23713
24306
|
`;
|
23714
24307
|
dialog.insertAdjacentHTML('beforeend', html);
|
@@ -23721,28 +24314,179 @@ class Shadow {
|
|
23721
24314
|
btnShadow.forEach(btn => {
|
23722
24315
|
btn.addEventListener('click', () => {
|
23723
24316
|
this.builder.editor.saveForUndo();
|
23724
|
-
|
23725
|
-
|
23726
|
-
|
24317
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24318
|
+
|
24319
|
+
if (elm) {
|
24320
|
+
elm.style.boxShadow = btn.getAttribute('data-shadow');
|
24321
|
+
this.builder.controlpanel.objDialogElement.refresh();
|
24322
|
+
this.getState();
|
24323
|
+
} else {
|
24324
|
+
elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24325
|
+
if (elm) elm.style.boxShadow = btn.getAttribute('data-shadow');
|
24326
|
+
this.getState();
|
24327
|
+
}
|
24328
|
+
|
23727
24329
|
this.builder.onChange();
|
23728
24330
|
});
|
23729
24331
|
});
|
23730
24332
|
const btnCleanShadow = dialog.querySelector('.btn-clean-shadow');
|
23731
24333
|
btnCleanShadow.addEventListener('click', () => {
|
23732
|
-
|
23733
|
-
elm
|
23734
|
-
|
24334
|
+
this.builder.editor.saveForUndo();
|
24335
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24336
|
+
|
24337
|
+
if (elm) {
|
24338
|
+
elm.style.boxShadow = '';
|
24339
|
+
this.builder.controlpanel.objDialogElement.refresh();
|
24340
|
+
} else {
|
24341
|
+
elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24342
|
+
if (elm) elm.style.boxShadow = '';
|
24343
|
+
this.getState();
|
24344
|
+
}
|
24345
|
+
|
24346
|
+
this.builder.onChange();
|
24347
|
+
}); // Adjustments
|
24348
|
+
|
24349
|
+
const inpAdjustX = dialog.querySelector('.inp-shadow-x');
|
24350
|
+
this.inpAdjustX = inpAdjustX;
|
24351
|
+
|
24352
|
+
inpAdjustX.onfocus = () => {
|
24353
|
+
this.builder.editor.saveForUndo(true);
|
24354
|
+
};
|
24355
|
+
|
24356
|
+
inpAdjustX.oninput = () => {
|
24357
|
+
// val: 0 - 500
|
24358
|
+
let val = inpAdjustX.value;
|
24359
|
+
this.adjustX(val);
|
24360
|
+
};
|
24361
|
+
|
24362
|
+
inpAdjustX.onchange = () => {
|
24363
|
+
this.builder.onChange();
|
24364
|
+
};
|
24365
|
+
|
24366
|
+
const inpAdjustY = dialog.querySelector('.inp-shadow-y');
|
24367
|
+
this.inpAdjustY = inpAdjustY;
|
24368
|
+
|
24369
|
+
inpAdjustY.onfocus = () => {
|
24370
|
+
this.builder.editor.saveForUndo(true);
|
24371
|
+
};
|
24372
|
+
|
24373
|
+
inpAdjustY.oninput = () => {
|
24374
|
+
// val: 0 - 500
|
24375
|
+
let val = inpAdjustY.value;
|
24376
|
+
this.adjustY(val);
|
24377
|
+
};
|
24378
|
+
|
24379
|
+
inpAdjustY.onchange = () => {
|
24380
|
+
this.builder.onChange();
|
24381
|
+
};
|
24382
|
+
|
24383
|
+
const btnPicker = dialog.querySelector('.btn-color');
|
24384
|
+
this.btnPicker = btnPicker;
|
24385
|
+
btnPicker.addEventListener('click', () => {
|
24386
|
+
this.builder.editor.saveForUndo(true); // checkLater = true
|
24387
|
+
|
24388
|
+
let bgcolor = btnPicker.style.backgroundColor;
|
24389
|
+
const colorpicker = this.builder.editor.colorpicker();
|
24390
|
+
colorpicker.open(s => {
|
24391
|
+
this.adjustColor(s);
|
24392
|
+
btnPicker.style.backgroundColor = s; // preview
|
24393
|
+
|
24394
|
+
this.builder.onChange();
|
24395
|
+
}, bgcolor);
|
23735
24396
|
});
|
23736
24397
|
}
|
23737
24398
|
|
24399
|
+
getState() {
|
24400
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24401
|
+
if (!elm) elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24402
|
+
|
24403
|
+
if (elm) {
|
24404
|
+
let shadow = elm.style.boxShadow.replaceAll(', ', ',');
|
24405
|
+
let shadowParts = shadow.split(' ');
|
24406
|
+
let currentX, currentY;
|
24407
|
+
let color = shadowParts[0];
|
24408
|
+
|
24409
|
+
for (let i = 0; i < shadowParts.length; i++) {
|
24410
|
+
if (shadowParts[i].indexOf('px') !== -1 || shadowParts[i].indexOf('em') !== -1 || shadowParts[i].indexOf('rem') !== -1) {
|
24411
|
+
currentX = shadowParts[i];
|
24412
|
+
break;
|
24413
|
+
}
|
24414
|
+
}
|
24415
|
+
|
24416
|
+
for (let i = 0; i < shadowParts.length; i++) {
|
24417
|
+
if (shadowParts[i].indexOf('px') !== -1 || shadowParts[i].indexOf('em') !== -1 || shadowParts[i].indexOf('vw') !== -1) {
|
24418
|
+
currentY = shadowParts[i + 1];
|
24419
|
+
break;
|
24420
|
+
}
|
24421
|
+
}
|
24422
|
+
|
24423
|
+
this.inpAdjustX.value = parseInt(currentX);
|
24424
|
+
this.inpAdjustY.value = parseInt(currentY);
|
24425
|
+
this.btnPicker.style.backgroundColor = color;
|
24426
|
+
}
|
24427
|
+
}
|
24428
|
+
|
23738
24429
|
open() {
|
23739
24430
|
this.dialog.style.display = 'flex';
|
24431
|
+
this.getState();
|
23740
24432
|
}
|
23741
24433
|
|
23742
24434
|
close() {
|
23743
24435
|
this.dialog.style.display = '';
|
23744
24436
|
}
|
23745
24437
|
|
24438
|
+
adjustX(val) {
|
24439
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24440
|
+
if (!elm) elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24441
|
+
|
24442
|
+
if (elm) {
|
24443
|
+
let shadow = elm.style.boxShadow;
|
24444
|
+
let shadowParts = shadow.split(' ');
|
24445
|
+
|
24446
|
+
for (let i = 0; i < shadowParts.length; i++) {
|
24447
|
+
if (shadowParts[i].indexOf('px') !== -1 || shadowParts[i].indexOf('em') !== -1 || shadowParts[i].indexOf('rem') !== -1) {
|
24448
|
+
shadowParts[i] = val + shadowParts[i].match(/[a-z]+/)[0]; // Updates the X value while keeping the unit intact
|
24449
|
+
|
24450
|
+
break; // Assuming only one value is for X offset
|
24451
|
+
}
|
24452
|
+
}
|
24453
|
+
|
24454
|
+
elm.style.boxShadow = shadowParts.join(' ');
|
24455
|
+
}
|
24456
|
+
}
|
24457
|
+
|
24458
|
+
adjustY(val) {
|
24459
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24460
|
+
if (!elm) elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24461
|
+
|
24462
|
+
if (elm) {
|
24463
|
+
let shadow = elm.style.boxShadow;
|
24464
|
+
let shadowParts = shadow.split(' ');
|
24465
|
+
|
24466
|
+
for (let i = 0; i < shadowParts.length; i++) {
|
24467
|
+
if (shadowParts[i].indexOf('px') !== -1 || shadowParts[i].indexOf('em') !== -1 || shadowParts[i].indexOf('vw') !== -1) {
|
24468
|
+
shadowParts[i + 1] = val + shadowParts[i + 1].match(/[a-z]+/)[0]; // Updates the Y value while keeping the unit intact
|
24469
|
+
|
24470
|
+
break; // Assuming only one value is for Y offset
|
24471
|
+
}
|
24472
|
+
}
|
24473
|
+
|
24474
|
+
elm.style.boxShadow = shadowParts.join(' ');
|
24475
|
+
}
|
24476
|
+
}
|
24477
|
+
|
24478
|
+
adjustColor(val) {
|
24479
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24480
|
+
if (!elm) elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24481
|
+
|
24482
|
+
if (elm) {
|
24483
|
+
let shadow = elm.style.boxShadow.replaceAll(', ', ',');
|
24484
|
+
let shadowParts = shadow.split(' ');
|
24485
|
+
shadowParts[0] = val;
|
24486
|
+
elm.style.boxShadow = shadowParts.join(' ');
|
24487
|
+
}
|
24488
|
+
}
|
24489
|
+
|
23746
24490
|
}
|
23747
24491
|
|
23748
24492
|
class ImageAdjust {
|
@@ -24538,8 +25282,9 @@ class ControlPanel {
|
|
24538
25282
|
<div class="panel-dialog element"></div>
|
24539
25283
|
<div class="panel-dialog imageadjust"></div>
|
24540
25284
|
<div class="panel-dialog settings"></div>
|
24541
|
-
<div class="panel-dialog shadow"></div>
|
24542
25285
|
<div class="panel-dialog group"></div>
|
25286
|
+
<div class="panel-dialog blockoptions"></div>
|
25287
|
+
<div class="panel-dialog shadow"></div>
|
24543
25288
|
|
24544
25289
|
<div class="panel-pop more" tabIndex="-1" aria-hidden="true">
|
24545
25290
|
<!--<button class="btn-preferences" title="${out('Preferences')}">${out('Preferences')}</button>-->
|
@@ -24594,6 +25339,7 @@ class ControlPanel {
|
|
24594
25339
|
this.dialogImageAdjust = controlPanel.querySelector('.panel-dialog.imageadjust');
|
24595
25340
|
this.dialogSettings = controlPanel.querySelector('.panel-dialog.settings');
|
24596
25341
|
this.dialogGroup = controlPanel.querySelector('.panel-dialog.group');
|
25342
|
+
this.dialogBlockOptions = controlPanel.querySelector('.panel-dialog.blockoptions');
|
24597
25343
|
this.more = controlPanel.querySelector('.panel-pop.more');
|
24598
25344
|
this.objDialogIcons = new Icons(this.dialogIcons, this.builder);
|
24599
25345
|
this.objDialogSpacingColumn = new SpacingColumn(this.dialogSpacingColumn, this.builder);
|
@@ -24604,6 +25350,7 @@ class ControlPanel {
|
|
24604
25350
|
this.objDialogImageAdjust = new ImageAdjust(this.dialogImageAdjust, this.builder);
|
24605
25351
|
this.objDialogSettings = new Settings(this.dialogSettings, this.builder);
|
24606
25352
|
this.objDialogGroup = new Group(this.dialogGroup, this.builder);
|
25353
|
+
this.objDialogBlockOptions = new BlockOptions(this.dialogBlockOptions, this.builder);
|
24607
25354
|
this.objPanelText = new PanelText(this.panelText, this.builder); // comment/disable if using ContentBuilder's controlpanel
|
24608
25355
|
|
24609
25356
|
this.objPanelImage = new PanelImage(this.panelImage, this.builder);
|
@@ -24791,6 +25538,7 @@ class ControlPanel {
|
|
24791
25538
|
this.objDialogShadow.close();
|
24792
25539
|
this.objDialogImageAdjust.close();
|
24793
25540
|
this.objDialogGroup.close();
|
25541
|
+
this.objDialogBlockOptions.close();
|
24794
25542
|
}
|
24795
25543
|
|
24796
25544
|
closeContentDialogs() {
|
@@ -24801,6 +25549,7 @@ class ControlPanel {
|
|
24801
25549
|
this.objDialogShadow.close();
|
24802
25550
|
this.objDialogImageAdjust.close();
|
24803
25551
|
this.objDialogGroup.close();
|
25552
|
+
this.objDialogBlockOptions.close();
|
24804
25553
|
}
|
24805
25554
|
|
24806
25555
|
toggleDevice() {
|
@@ -24974,7 +25723,17 @@ class ControlPanel {
|
|
24974
25723
|
if (!this.activeBox) this.objDialogSpacingContainer.close();
|
24975
25724
|
if (!this.activeColumn) this.objDialogSpacingColumn.close();
|
24976
25725
|
this.objDialogImageAdjust.close();
|
24977
|
-
if (!this.activeBlock) this.objDialogGroup.close();
|
25726
|
+
if (!this.activeBlock) this.objDialogGroup.close();
|
25727
|
+
if (!this.activeBlock) this.objDialogBlockOptions.close(); // Show/hide panel
|
25728
|
+
|
25729
|
+
if (e.target.classList.contains('is-block')) {
|
25730
|
+
// test: select paragraph on normal section, then select block on canvas section
|
25731
|
+
this.select('block'); // freeform
|
25732
|
+
|
25733
|
+
return;
|
25734
|
+
} else {
|
25735
|
+
this.objDialogBlockOptions.close();
|
25736
|
+
}
|
24978
25737
|
|
24979
25738
|
if (this.activeElement) this.select('element');
|
24980
25739
|
if (!this.activeElement && this.activeBlock) this.select('block'); // freeform
|
@@ -25406,6 +26165,14 @@ class ControlPanel {
|
|
25406
26165
|
if (this.dialogImageAdjust.style.display === 'flex') {
|
25407
26166
|
this.objDialogImageAdjust.getState();
|
25408
26167
|
}
|
26168
|
+
|
26169
|
+
if (this.dialogBlockOptions.style.display === 'flex') {
|
26170
|
+
this.objDialogBlockOptions.getState();
|
26171
|
+
}
|
26172
|
+
|
26173
|
+
if (this.dialogShadow.style.display === 'flex') {
|
26174
|
+
this.objDialogShadow.getState();
|
26175
|
+
}
|
25409
26176
|
}
|
25410
26177
|
|
25411
26178
|
showTooltip() {
|
@@ -73642,7 +74409,8 @@ class Hyperlink {
|
|
73642
74409
|
selection = selectionText;
|
73643
74410
|
const range = selection.getRangeAt(0);
|
73644
74411
|
const fragment = range.extractContents();
|
73645
|
-
const link =
|
74412
|
+
const link = this.builder.doc.createElement('a'); //
|
74413
|
+
|
73646
74414
|
link.setAttribute('href', url);
|
73647
74415
|
link.setAttribute('title', title);
|
73648
74416
|
if (modal.querySelector('.input-newwindow').checked) {
|
@@ -73662,7 +74430,8 @@ class Hyperlink {
|
|
73662
74430
|
} else if (selectionElm) {
|
73663
74431
|
selection = selectionElm;
|
73664
74432
|
selectionElm.innerHTML = `<a class="dummylink" href="dummy">${linktext}</a>`;
|
73665
|
-
let link =
|
74433
|
+
let link = this.builder.doc.querySelector('.dummylink'); //
|
74434
|
+
|
73666
74435
|
link.setAttribute('href', url);
|
73667
74436
|
link.setAttribute('title', title);
|
73668
74437
|
if (modal.querySelector('.input-newwindow').checked) {
|
@@ -107007,10 +107776,14 @@ class Common {
|
|
107007
107776
|
applyPercentage(block) {
|
107008
107777
|
const zoom = this.zoom;
|
107009
107778
|
const rect = this.getRect(block);
|
107010
|
-
|
107779
|
+
let container = block.closest('.box-canvas');
|
107780
|
+
if (block.parentNode.closest(this.selector)) {
|
107781
|
+
// block is in group
|
107782
|
+
container = block.parentNode.closest(this.selector);
|
107783
|
+
}
|
107011
107784
|
const containerRect = this.getRect(container); // if container has top/left
|
107012
107785
|
|
107013
|
-
this.horizontalRulerTop = container.querySelector('.h-ruler-top');
|
107786
|
+
this.horizontalRulerTop = container.querySelector('.h-ruler-top'); // no rulers in group
|
107014
107787
|
this.horizontalRulerBottom = container.querySelector('.h-ruler-bottom');
|
107015
107788
|
this.horizontalRulerMiddle = container.querySelector('.h-ruler-middle');
|
107016
107789
|
this.verticalRulerLeft = container.querySelector('.v-ruler-left');
|
@@ -107022,10 +107795,10 @@ class Common {
|
|
107022
107795
|
let bottomTouched = false;
|
107023
107796
|
let leftTouched = false;
|
107024
107797
|
let rightTouched = false;
|
107025
|
-
if (this.horizontalRulerTop.hasAttribute('data-topTouched')) topTouched = true;
|
107026
|
-
if (this.horizontalRulerBottom.hasAttribute('data-bottomTouched')) bottomTouched = true;
|
107027
|
-
if (this.verticalRulerLeft.hasAttribute('data-leftTouched')) leftTouched = true;
|
107028
|
-
if (this.verticalRulerRight.hasAttribute('data-rightTouched')) rightTouched = true;
|
107798
|
+
if (this.horizontalRulerTop && this.horizontalRulerTop.hasAttribute('data-topTouched')) topTouched = true;
|
107799
|
+
if (this.horizontalRulerBottom && this.horizontalRulerBottom.hasAttribute('data-bottomTouched')) bottomTouched = true;
|
107800
|
+
if (this.verticalRulerLeft && this.verticalRulerLeft.hasAttribute('data-leftTouched')) leftTouched = true;
|
107801
|
+
if (this.verticalRulerRight && this.verticalRulerRight.hasAttribute('data-rightTouched')) rightTouched = true;
|
107029
107802
|
let isChildBlock = false;
|
107030
107803
|
if (block.parentNode.matches(this.selector)) {
|
107031
107804
|
// child block
|
@@ -107104,10 +107877,10 @@ class Common {
|
|
107104
107877
|
|
107105
107878
|
// reset
|
107106
107879
|
setTimeout(() => {
|
107107
|
-
this.horizontalRulerTop.removeAttribute('data-topTouched');
|
107108
|
-
this.horizontalRulerBottom.removeAttribute('data-bottomTouched');
|
107109
|
-
this.verticalRulerLeft.removeAttribute('data-leftTouched');
|
107110
|
-
this.verticalRulerRight.removeAttribute('data-rightTouched');
|
107880
|
+
if (this.horizontalRulerTop) this.horizontalRulerTop.removeAttribute('data-topTouched');
|
107881
|
+
if (this.horizontalRulerBottom) this.horizontalRulerBottom.removeAttribute('data-bottomTouched');
|
107882
|
+
if (this.verticalRulerLeft) this.verticalRulerLeft.removeAttribute('data-leftTouched');
|
107883
|
+
if (this.verticalRulerRight) this.verticalRulerRight.removeAttribute('data-rightTouched');
|
107111
107884
|
}, 10);
|
107112
107885
|
}
|
107113
107886
|
applyPixels(block) {
|
@@ -107605,6 +108378,8 @@ class Ruler {
|
|
107605
108378
|
this.rulerRight = null;
|
107606
108379
|
}
|
107607
108380
|
updateRulers(block) {
|
108381
|
+
if (block.parentNode.closest(this.selector)) return; // block is in group
|
108382
|
+
|
107608
108383
|
const container = block.closest('.box-canvas');
|
107609
108384
|
this.horizontalRulerTop = container.querySelector('.h-ruler-top');
|
107610
108385
|
this.horizontalRulerBottom = container.querySelector('.h-ruler-bottom');
|
@@ -107629,6 +108404,8 @@ class Ruler {
|
|
107629
108404
|
this.rulerRight = null;
|
107630
108405
|
this.elements = container.querySelectorAll(this.selector);
|
107631
108406
|
this.elements.forEach(element => {
|
108407
|
+
if (element.parentNode.closest(this.selector)) return; // block is in group
|
108408
|
+
|
107632
108409
|
if (!this.doc.body.contains(element)) return; // in case element removed (eg. unGroup, block deleted)
|
107633
108410
|
|
107634
108411
|
if (block.contains(element)) return; // In case of group moving
|
@@ -108307,7 +109084,6 @@ class Resizable {
|
|
108307
109084
|
}
|
108308
109085
|
|
108309
109086
|
this.target = event.target.parentNode; // block
|
108310
|
-
|
108311
109087
|
this.clonedTarget = this.doc.querySelector(this.selector + '.cloned');
|
108312
109088
|
event.preventDefault();
|
108313
109089
|
event.stopPropagation();
|
@@ -108326,6 +109102,8 @@ class Resizable {
|
|
108326
109102
|
this.startX = touch.clientX;
|
108327
109103
|
this.startY = touch.clientY;
|
108328
109104
|
}
|
109105
|
+
this.target.style.transition = ''; // prevent anim/delay while dragging (in case a block has animation transition)
|
109106
|
+
if (this.clonedTarget) this.clonedTarget.style.transition = '';
|
108329
109107
|
|
108330
109108
|
//Initial
|
108331
109109
|
this.initialWidth = parseFloat(getComputedStyle(this.target).width);
|
@@ -108812,6 +109590,7 @@ class Draggable {
|
|
108812
109590
|
const y = startY - rect.top + containerRect.top;
|
108813
109591
|
target.setAttribute('data-startx', x);
|
108814
109592
|
target.setAttribute('data-starty', y);
|
109593
|
+
target.style.transition = ''; // prevent anim/delay while dragging (in case a block has animation transition)
|
108815
109594
|
|
108816
109595
|
// reset (from applyPercentage bottomTouched)
|
108817
109596
|
if (target.style.bottom) {
|
@@ -108886,6 +109665,39 @@ class Draggable {
|
|
108886
109665
|
}
|
108887
109666
|
}
|
108888
109667
|
updateBlockStyle(target) {
|
109668
|
+
// Block placement should must not 50% outside the container
|
109669
|
+
const container = target.closest('.box-canvas');
|
109670
|
+
if (!target.parentNode.closest('.is-group')) {
|
109671
|
+
let containerHeight = container.offsetHeight;
|
109672
|
+
let containerWidth = container.offsetWidth;
|
109673
|
+
/*
|
109674
|
+
if(target.offsetTop + target.offsetHeight>=containerHeight) {
|
109675
|
+
target.style.top = containerHeight-target.offsetHeight +'px';
|
109676
|
+
}
|
109677
|
+
if(target.offsetTop<=0) {
|
109678
|
+
target.style.top = '0px';
|
109679
|
+
}
|
109680
|
+
if(target.offsetLeft + target.offsetWidth>=åcontainerWidth) {
|
109681
|
+
target.style.left = (containerWidth-target.offsetWidth) +'px';
|
109682
|
+
}
|
109683
|
+
if(target.offsetLeft<=0) {
|
109684
|
+
target.style.left = '0px';
|
109685
|
+
}
|
109686
|
+
*/
|
109687
|
+
if (target.offsetTop + target.offsetHeight <= target.offsetHeight / 2) {
|
109688
|
+
target.style.top = '0px';
|
109689
|
+
}
|
109690
|
+
if (containerHeight - target.offsetTop <= target.offsetHeight / 2) {
|
109691
|
+
target.style.top = containerHeight - target.offsetHeight + 'px';
|
109692
|
+
}
|
109693
|
+
if (target.offsetLeft + target.offsetWidth <= target.offsetWidth / 2) {
|
109694
|
+
target.style.left = '0px';
|
109695
|
+
}
|
109696
|
+
if (containerWidth - target.offsetLeft <= target.offsetWidth / 2) {
|
109697
|
+
target.style.left = containerWidth - target.offsetWidth + 'px';
|
109698
|
+
}
|
109699
|
+
}
|
109700
|
+
|
108889
109701
|
// Replace with ruler's alignment
|
108890
109702
|
if (this.ruler.rulerTop !== null) target.style.top = this.ruler.rulerTop + 'px';
|
108891
109703
|
if (this.ruler.rulerBottom !== null) target.style.top = this.ruler.rulerBottom - target.offsetHeight + 'px'; //new
|
@@ -113255,6 +114067,9 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
113255
114067
|
let clonedDiv = block.cloneNode(true);
|
113256
114068
|
clonedDiv.style.top = '20%';
|
113257
114069
|
clonedDiv.style.left = '20%';
|
114070
|
+
clonedDiv.style.transform = ''; // clear anim
|
114071
|
+
clonedDiv.style.transition = '';
|
114072
|
+
clonedDiv.style.opacity = '';
|
113258
114073
|
if (builder) {
|
113259
114074
|
const cloneBuilder = clonedDiv.querySelector(this.container);
|
113260
114075
|
cloneBuilder.innerHTML = '';
|
@@ -113264,7 +114079,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
113264
114079
|
this.applyBehaviorOn(cloneBuilder);
|
113265
114080
|
cloneBuilder.click();
|
113266
114081
|
} else {
|
113267
|
-
|
114082
|
+
box.appendChild(clonedDiv);
|
113268
114083
|
}
|
113269
114084
|
block.classList.remove('active');
|
113270
114085
|
this.doc.querySelectorAll('.clone').forEach(elm => elm.parentNode.removeChild(elm));
|
@@ -114532,6 +115347,18 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
114532
115347
|
});
|
114533
115348
|
var html = result[0].html;
|
114534
115349
|
var noedit = result[0].noedit;
|
115350
|
+
if (result[0].mode === 'canvas') {
|
115351
|
+
html = result[0].html2;
|
115352
|
+
if (!html) {
|
115353
|
+
html = `
|
115354
|
+
<div class="row">
|
115355
|
+
<div class="column pt-0 pb-0 pl-0 pr-0 flex flex-col justify-center">
|
115356
|
+
<img src="${this.opts.snippetPath}images/img-2400x1350.png" alt="">
|
115357
|
+
</div>
|
115358
|
+
</div>
|
115359
|
+
`;
|
115360
|
+
}
|
115361
|
+
}
|
114535
115362
|
var bSnippet;
|
114536
115363
|
if (html.indexOf('"row') === -1) {
|
114537
115364
|
bSnippet = true; // Just snippet (without row/column grid)
|
@@ -118313,6 +119140,23 @@ class AnimateScroll {
|
|
118313
119140
|
this.builderStuff = builderStuff;
|
118314
119141
|
let html = `
|
118315
119142
|
<style>
|
119143
|
+
|
119144
|
+
.is-modal.animatescroll {
|
119145
|
+
width: 370px !important;
|
119146
|
+
height: 85vh !important;
|
119147
|
+
top: 10vh !important;
|
119148
|
+
bottom: auto !important;
|
119149
|
+
left: auto !important;
|
119150
|
+
right: 90px !important;
|
119151
|
+
z-index: 10002 !important;
|
119152
|
+
font-size: 12px;
|
119153
|
+
max-height: 1006px;
|
119154
|
+
}
|
119155
|
+
.animatescroll .is-modal-bar {
|
119156
|
+
font-size: 12px !important;
|
119157
|
+
}
|
119158
|
+
|
119159
|
+
|
118316
119160
|
#_cbhtml .is-side.animatescroll,
|
118317
119161
|
.is-ui .is-side.animatescroll {
|
118318
119162
|
width: 370px;
|
@@ -118359,7 +119203,7 @@ class AnimateScroll {
|
|
118359
119203
|
position: absolute;
|
118360
119204
|
top: 0;
|
118361
119205
|
box-sizing: border-box;
|
118362
|
-
border-top: transparent
|
119206
|
+
border-top: transparent 208px solid !important;
|
118363
119207
|
}
|
118364
119208
|
#divEnterAnim, #divLeaveAnim, #divAnimSettings {
|
118365
119209
|
border-top: transparent 55px solid !important;
|
@@ -118447,7 +119291,7 @@ class AnimateScroll {
|
|
118447
119291
|
}
|
118448
119292
|
|
118449
119293
|
.div-anim-settings,.div-wizard-settings{
|
118450
|
-
height:
|
119294
|
+
height: 100%;
|
118451
119295
|
}
|
118452
119296
|
.div-wizard-settings{
|
118453
119297
|
padding: 10px 15px 0 18px !important;
|
@@ -118458,19 +119302,23 @@ class AnimateScroll {
|
|
118458
119302
|
}
|
118459
119303
|
</style>
|
118460
119304
|
|
118461
|
-
<div class="is-
|
118462
|
-
|
118463
|
-
<
|
118464
|
-
|
118465
|
-
|
119305
|
+
<div class="is-modal is-modal-content animatescroll keep-selection" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
119306
|
+
<div class="is-modal-bar is-draggable" draggable="">
|
119307
|
+
<span>${out('Animation')}</span>
|
119308
|
+
<button class="is-modal-close" tabindex="-1" title="${out('Close')}">
|
119309
|
+
<svg class="is-icon-flex" style="width:23px;height:23px;"><use xlink:href="#ion-ios-close-empty"></use></svg>
|
119310
|
+
</button>
|
119311
|
+
</div>
|
119312
|
+
<div style="position:absolute;box-sizing:border-box;top:0;left:0;width:100%;height:100%;border-top:transparent 35px solid;overflow-y:hidden;overflow-x:auto;">
|
118466
119313
|
|
118467
|
-
<button tabindex="-1" title="${out('Edit')}" class="cmd-anim-edit" style="z-index:3;width:25px;height:25px;position:absolute;top:
|
119314
|
+
<button tabindex="-1" title="${out('Edit')}" class="cmd-anim-edit" style="z-index:3;width:25px;height:25px;position:absolute;top:30px;right:13px;box-sizing:border-box;padding:0;line-height:25px;font-size: 12px;text-align:center;cursor:pointer;box-shadow:none;"><svg class="is-icon-flex"><use xlink:href="#icon-pencil"></use></svg></button>
|
118468
119315
|
|
118469
119316
|
<div class="div-anim-settings" style="display:none">
|
118470
119317
|
|
118471
119318
|
<div class="div-anim-apply-to" style="padding:18px 10px 22px 18px;z-index:2;position:relative;">
|
118472
119319
|
<div class="anim-label" style="margin-bottom:5px">${out('Apply To')}:</div>
|
118473
|
-
<div class="flex-wrap">
|
119320
|
+
<div class="flex-wrap" style="height:70px">
|
119321
|
+
<button title="${out('Block')}" class="cmd-target on" data-command="target" data-value="block">${out('Block')}</button>
|
118474
119322
|
<button title="${out('Element')}" class="cmd-target on" data-command="target" data-value="element">${out('Element')}</button>
|
118475
119323
|
<button title="${out('Column')}" class="cmd-target" data-command="target" data-value="column">${out('Column')}</button>
|
118476
119324
|
<button title="${out('Row')}" class="cmd-target" data-command="target" data-value="row">${out('Row')}</button>
|
@@ -119245,7 +120093,7 @@ class AnimateScroll {
|
|
119245
120093
|
</button>
|
119246
120094
|
</div>
|
119247
120095
|
|
119248
|
-
<div class="anim-preset-list" style="height: calc(
|
120096
|
+
<div class="anim-preset-list" style="height: calc(100% - 63px);
|
119249
120097
|
overflow: auto;
|
119250
120098
|
width: 347px;">
|
119251
120099
|
<div style="display:flex;
|
@@ -119299,14 +120147,15 @@ class AnimateScroll {
|
|
119299
120147
|
|
119300
120148
|
</div>
|
119301
120149
|
`;
|
119302
|
-
dom$2.appendHtml(builderStuff, html);
|
119303
|
-
|
120150
|
+
dom$2.appendHtml(builderStuff, html); // const modalAnimateScroll = builderStuff.querySelector('.is-side.animatescroll');
|
120151
|
+
|
120152
|
+
const modalAnimateScroll = builderStuff.querySelector('.is-modal.animatescroll');
|
119304
120153
|
this.modalAnimateScroll = modalAnimateScroll;
|
119305
120154
|
const divEnterAnim = modalAnimateScroll.querySelector('#divEnterAnim');
|
119306
120155
|
this.divEnterAnim = divEnterAnim;
|
119307
120156
|
const divLeaveAnim = modalAnimateScroll.querySelector('#divLeaveAnim');
|
119308
120157
|
this.divLeaveAnim = divLeaveAnim;
|
119309
|
-
const btnClose = modalAnimateScroll.querySelector('.is-
|
120158
|
+
const btnClose = modalAnimateScroll.querySelector('.is-modal-close');
|
119310
120159
|
btnClose.addEventListener('click', () => {
|
119311
120160
|
this.close();
|
119312
120161
|
});
|
@@ -120798,7 +121647,7 @@ class AnimateScroll {
|
|
120798
121647
|
if (activeCol) section = activeCol.closest('.is-section');
|
120799
121648
|
let elms; // elms = section.querySelectorAll('*');
|
120800
121649
|
|
120801
|
-
elms =
|
121650
|
+
elms = section.querySelectorAll('[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],' + '[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],' + '[data-in],[data-in-150],[data-in-300],' + '[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out]' + '[data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],' + '[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],' + '[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],' + '[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],' + '[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]');
|
120802
121651
|
elms.forEach(elm => {
|
120803
121652
|
elm.removeAttribute('data-center');
|
120804
121653
|
elm.removeAttribute('data-center-top');
|
@@ -120833,20 +121682,21 @@ class AnimateScroll {
|
|
120833
121682
|
elm.removeAttribute('data-hidden-onstart');
|
120834
121683
|
elm.style.transform = '';
|
120835
121684
|
elm.style.transition = '';
|
120836
|
-
elm.style.opacity = '';
|
121685
|
+
elm.style.opacity = '';
|
121686
|
+
this.restart(); // console.log(elm)
|
120837
121687
|
});
|
120838
121688
|
elms = section.querySelectorAll('.is-animated');
|
120839
121689
|
elms.forEach(elm => {
|
120840
121690
|
// if(elm.classList.contains('is-overlay-bg')) return;
|
120841
121691
|
this.cleanupBasic(elm);
|
120842
121692
|
this.cleanupDelay(elm);
|
120843
|
-
});
|
120844
|
-
|
120845
|
-
|
120846
|
-
|
120847
|
-
|
120848
|
-
|
120849
|
-
|
121693
|
+
}); // setTimeout(()=>{
|
121694
|
+
// // if (this.builder.win.skrollrr) {
|
121695
|
+
// // this.builder.win.skrollrr.refresh();
|
121696
|
+
// // }
|
121697
|
+
// this.restart();
|
121698
|
+
// },30);
|
121699
|
+
// Refresh
|
120850
121700
|
|
120851
121701
|
this.builder.settings.onRender();
|
120852
121702
|
}
|
@@ -120901,9 +121751,28 @@ class AnimateScroll {
|
|
120901
121751
|
const addPreset = box => {
|
120902
121752
|
let index = start;
|
120903
121753
|
const chkPresetAnimOnce = this.modalAnimateScroll.querySelector('#chkPresetAnimOnce');
|
120904
|
-
const rows = box.querySelectorAll('.is-container > div');
|
120905
|
-
rows.forEach(
|
120906
|
-
|
121754
|
+
const rows = box.querySelectorAll('.is-container > div, .is-block .is-block-overlay');
|
121755
|
+
rows.forEach(elm => {
|
121756
|
+
if (elm.classList.contains('is-block-overlay') && !elm.closest('clone')) {
|
121757
|
+
if (elm.querySelector('.is-container')) return;
|
121758
|
+
elm.style.transition = 'none';
|
121759
|
+
elm.classList.add('is-animated');
|
121760
|
+
|
121761
|
+
if (chkPresetAnimOnce.checked) {
|
121762
|
+
elm.classList.add('once');
|
121763
|
+
} else {
|
121764
|
+
elm.classList.remove('once');
|
121765
|
+
} // elm.classList.add('is-fadeInUp');
|
121766
|
+
// process(elm, index);
|
121767
|
+
|
121768
|
+
|
121769
|
+
elm.classList.add(presetName);
|
121770
|
+
if (index !== 0) elm.classList.add(`delay-${index * delay}ms`);
|
121771
|
+
elm.classList.remove('is-inview');
|
121772
|
+
index++;
|
121773
|
+
}
|
121774
|
+
|
121775
|
+
const cols = this.builder.editor.dom.elementChildren(elm);
|
120907
121776
|
cols.forEach(col => {
|
120908
121777
|
if (col.innerText.trim() === '' && !col.querySelector('img') && !col.querySelector('iframe') && !col.querySelector('video') && !col.querySelector('audio') && !col.querySelector('i')) return;
|
120909
121778
|
col.style.transition = 'none'; // this.cleanupBasic(col);
|
@@ -120923,8 +121792,8 @@ class AnimateScroll {
|
|
120923
121792
|
if (index !== 0) col.classList.add(`delay-${index * delay}ms`);
|
120924
121793
|
col.classList.remove('is-inview');
|
120925
121794
|
index++;
|
120926
|
-
}); //
|
120927
|
-
//
|
121795
|
+
}); // elm.setAttribute('data-bottom-top', 'transform: translateY(125px)');
|
121796
|
+
// elm.setAttribute('data-center', 'transform: translateY(0px)');
|
120928
121797
|
});
|
120929
121798
|
start++;
|
120930
121799
|
};
|
@@ -120976,6 +121845,12 @@ class AnimateScroll {
|
|
120976
121845
|
}
|
120977
121846
|
|
120978
121847
|
restart() {
|
121848
|
+
if (this.builder.controlpanel.activeBlock && this.builder.editor.activeElement) {
|
121849
|
+
// cannot handle editable block
|
121850
|
+
if (this.builder.win.pageReRender) this.builder.win.pageReRender();
|
121851
|
+
return;
|
121852
|
+
}
|
121853
|
+
|
120979
121854
|
this.noRead = true; // Save selection
|
120980
121855
|
|
120981
121856
|
let target = this.getTarget();
|
@@ -120984,6 +121859,7 @@ class AnimateScroll {
|
|
120984
121859
|
if (this.builder.editor.activeElement) this.builder.editor.activeElement.setAttribute('data-save-element', '1');
|
120985
121860
|
if (this.builder.activeBox) this.builder.activeBox.setAttribute('data-save-box', '1');
|
120986
121861
|
if (this.builder.activeSection) this.builder.activeSection.setAttribute('data-save-section', '1');
|
121862
|
+
if (this.builder.controlpanel.activeBlock) this.builder.controlpanel.activeBlock.setAttribute('data-save-block', '1');
|
120987
121863
|
this.builder.markScrollTarget(this.builder.activeSection); //--- Same as undo/redo process ---
|
120988
121864
|
|
120989
121865
|
const wrapper = this.builder.wrapperEl;
|
@@ -121059,6 +121935,14 @@ class AnimateScroll {
|
|
121059
121935
|
this.builder.activeSection = section;
|
121060
121936
|
}
|
121061
121937
|
|
121938
|
+
let block = this.builder.doc.querySelector('[data-save-block]');
|
121939
|
+
|
121940
|
+
if (block) {
|
121941
|
+
block.classList.add('active');
|
121942
|
+
block.removeAttribute('data-save-block');
|
121943
|
+
this.builder.controlpanel.activeBlock = block;
|
121944
|
+
}
|
121945
|
+
|
121062
121946
|
setTimeout(() => {
|
121063
121947
|
this.noRead = false;
|
121064
121948
|
}, 100);
|
@@ -121119,10 +122003,34 @@ class AnimateScroll {
|
|
121119
122003
|
}
|
121120
122004
|
|
121121
122005
|
clickContent() {
|
122006
|
+
// Show hide buttons
|
122007
|
+
let btns = this.modalAnimateScroll.querySelectorAll('.cmd-target');
|
122008
|
+
btns.forEach(btn => btn.style.display = 'none');
|
122009
|
+
let activeElement = this.builder.editor.inspectedElement;
|
122010
|
+
let block = this.getBlock();
|
122011
|
+
btns.forEach(btn => {
|
122012
|
+
if (block) {
|
122013
|
+
let s = btn.getAttribute('data-value');
|
122014
|
+
|
122015
|
+
if (s === 'block' || s === 'box' || s === 'section' || s === 'overlay' || s === 'bg') {
|
122016
|
+
btn.style.display = '';
|
122017
|
+
}
|
122018
|
+
} else if (activeElement) {
|
122019
|
+
let s = btn.getAttribute('data-value');
|
122020
|
+
|
122021
|
+
if (s !== 'block') {
|
122022
|
+
btn.style.display = '';
|
122023
|
+
}
|
122024
|
+
} else {
|
122025
|
+
let s = btn.getAttribute('data-value');
|
122026
|
+
|
122027
|
+
if (s === 'box' || s === 'section' || s === 'overlay' || s === 'bg') {
|
122028
|
+
btn.style.display = '';
|
122029
|
+
}
|
122030
|
+
}
|
122031
|
+
});
|
121122
122032
|
let elms = this.modalAnimateScroll.querySelectorAll('.cmd-target');
|
121123
|
-
elms.forEach(elm =>
|
121124
|
-
elm.classList.remove('on');
|
121125
|
-
}); // Dynamically choose target based on selected element
|
122033
|
+
elms.forEach(elm => elm.classList.remove('on')); // Dynamically choose target based on selected element
|
121126
122034
|
|
121127
122035
|
let currentTarget = this.readTarget();
|
121128
122036
|
|
@@ -121151,11 +122059,23 @@ class AnimateScroll {
|
|
121151
122059
|
} else if (currentTarget.name === 'section') {
|
121152
122060
|
const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=section]');
|
121153
122061
|
btn.classList.add('on');
|
122062
|
+
} else if (currentTarget.name === 'block') {
|
122063
|
+
const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=block]');
|
122064
|
+
btn.classList.add('on');
|
121154
122065
|
}
|
121155
122066
|
} else {
|
121156
|
-
//
|
121157
|
-
|
121158
|
-
|
122067
|
+
// let block = this.getBlock();
|
122068
|
+
if (block) {
|
122069
|
+
const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=block]');
|
122070
|
+
btn.classList.add('on');
|
122071
|
+
} else if (activeElement) {
|
122072
|
+
// no animation on the selected element
|
122073
|
+
const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=element]');
|
122074
|
+
btn.classList.add('on');
|
122075
|
+
} else {
|
122076
|
+
const btn = this.modalAnimateScroll.querySelector('.cmd-target[data-value=box]');
|
122077
|
+
btn.classList.add('on');
|
122078
|
+
}
|
121159
122079
|
}
|
121160
122080
|
|
121161
122081
|
this.read();
|
@@ -122512,17 +123432,41 @@ class AnimateScroll {
|
|
122512
123432
|
if (section) activeElement = section;
|
122513
123433
|
}
|
122514
123434
|
|
123435
|
+
if (target === 'block') {
|
123436
|
+
const block = this.getBlock();
|
123437
|
+
if (block) activeElement = block;
|
123438
|
+
}
|
123439
|
+
|
122515
123440
|
return {
|
122516
123441
|
'element': activeElement ? activeElement : false,
|
122517
123442
|
'name': target ? target : false
|
122518
123443
|
};
|
122519
123444
|
}
|
122520
123445
|
|
123446
|
+
getBlock() {
|
123447
|
+
let block = this.builder.doc.querySelector('.is-block.active');
|
123448
|
+
if (!block) return false;
|
123449
|
+
|
123450
|
+
if (block.classList.contains('editable')) {
|
123451
|
+
return false;
|
123452
|
+
} else {
|
123453
|
+
return block;
|
123454
|
+
}
|
123455
|
+
}
|
123456
|
+
|
122521
123457
|
readTarget(s) {
|
122522
123458
|
if (!s) {
|
122523
123459
|
// element (inspectedElement first)
|
122524
123460
|
let activeElement = this.builder.editor.inspectedElement; // if(!activeElement) return false;
|
122525
123461
|
|
123462
|
+
let block = this.getBlock(); // if(block && !activeElement) {
|
123463
|
+
// return this.readTarget('block');
|
123464
|
+
// }
|
123465
|
+
|
123466
|
+
if (block) {
|
123467
|
+
return this.readTarget('block');
|
123468
|
+
}
|
123469
|
+
|
122526
123470
|
if (!activeElement) {
|
122527
123471
|
return this.readTarget('bg');
|
122528
123472
|
}
|
@@ -122566,6 +123510,10 @@ class AnimateScroll {
|
|
122566
123510
|
} else {
|
122567
123511
|
let activeElement;
|
122568
123512
|
|
123513
|
+
if (s === 'block') {
|
123514
|
+
activeElement = this.getBlock();
|
123515
|
+
}
|
123516
|
+
|
122569
123517
|
if (s === 'element') {
|
122570
123518
|
activeElement = this.builder.editor.activeElement;
|
122571
123519
|
}
|
@@ -122607,6 +123555,7 @@ class AnimateScroll {
|
|
122607
123555
|
}
|
122608
123556
|
|
122609
123557
|
if (!activeElement) {
|
123558
|
+
if (s === 'block') return this.readTarget('box');
|
122610
123559
|
if (s === 'element') return this.readTarget('column');
|
122611
123560
|
if (s === 'column') return this.readTarget('row');
|
122612
123561
|
if (s === 'row') return this.readTarget('container');
|
@@ -122651,6 +123600,7 @@ class AnimateScroll {
|
|
122651
123600
|
'name': s
|
122652
123601
|
};
|
122653
123602
|
} else {
|
123603
|
+
if (s === 'block') return this.readTarget('box');
|
122654
123604
|
if (s === 'element') return this.readTarget('column');
|
122655
123605
|
if (s === 'column') return this.readTarget('row');
|
122656
123606
|
if (s === 'row') return this.readTarget('container');
|
@@ -122745,6 +123695,7 @@ class AnimateScroll {
|
|
122745
123695
|
if (modalEditBox) modalEditBox.style.display = '';
|
122746
123696
|
const modalEditSection = this.builderStuff.querySelector('.editsection');
|
122747
123697
|
if (modalEditSection) modalEditSection.style.display = '';
|
123698
|
+
localStorage.setItem('_animationmodal', '1');
|
122748
123699
|
}
|
122749
123700
|
|
122750
123701
|
close() {
|
@@ -122752,6 +123703,7 @@ class AnimateScroll {
|
|
122752
123703
|
|
122753
123704
|
this.builder.doc.body.classList.remove('selection-only');
|
122754
123705
|
document.body.classList.remove('selection-only');
|
123706
|
+
localStorage.removeItem('_animationmodal');
|
122755
123707
|
}
|
122756
123708
|
|
122757
123709
|
}
|
@@ -123396,6 +124348,7 @@ class Timeline {
|
|
123396
124348
|
<div class="flex-wrap">
|
123397
124349
|
<div class="flex-wrap" style="margin-right:15px;width: 120px;">
|
123398
124350
|
<select class="input-target">
|
124351
|
+
<option value="block">${out('Block')}</option>
|
123399
124352
|
<option value="element">${out('Element')}</option>
|
123400
124353
|
<option value="column">${out('Column')}</option>
|
123401
124354
|
<option value="row">${out('Row')}</option>
|
@@ -123961,9 +124914,40 @@ class Timeline {
|
|
123961
124914
|
}
|
123962
124915
|
|
123963
124916
|
clickContent() {
|
123964
|
-
let inpTarget = this.modalTimeline.querySelector('.input-target');
|
123965
|
-
|
123966
|
-
|
124917
|
+
let inpTarget = this.modalTimeline.querySelector('.input-target'); // inpTarget.value = 'element'; // default
|
124918
|
+
// Show/hide target options
|
124919
|
+
|
124920
|
+
let options = inpTarget.querySelectorAll('option');
|
124921
|
+
options.forEach(opt => opt.style.display = 'none');
|
124922
|
+
let activeElement = this.builder.editor.inspectedElement;
|
124923
|
+
let block = this.getBlock();
|
124924
|
+
options.forEach(opt => {
|
124925
|
+
if (block) {
|
124926
|
+
let s = opt.getAttribute('value');
|
124927
|
+
|
124928
|
+
if (s === 'block' || s === 'box' || s === 'section' || s === 'overlay' || s === 'bg') {
|
124929
|
+
opt.style.display = '';
|
124930
|
+
}
|
124931
|
+
|
124932
|
+
inpTarget.value = 'block'; // default
|
124933
|
+
} else if (activeElement) {
|
124934
|
+
let s = opt.getAttribute('value');
|
124935
|
+
|
124936
|
+
if (s !== 'block') {
|
124937
|
+
opt.style.display = '';
|
124938
|
+
}
|
124939
|
+
|
124940
|
+
inpTarget.value = 'element'; // default
|
124941
|
+
} else {
|
124942
|
+
let s = opt.getAttribute('value');
|
124943
|
+
|
124944
|
+
if (s === 'box' || s === 'section' || s === 'overlay' || s === 'bg') {
|
124945
|
+
opt.style.display = '';
|
124946
|
+
}
|
124947
|
+
|
124948
|
+
inpTarget.value = 'box'; // default
|
124949
|
+
}
|
124950
|
+
}); // Dynamically choose target based on selected element
|
123967
124951
|
|
123968
124952
|
let currentTarget = this.readTarget();
|
123969
124953
|
|
@@ -123984,12 +124968,17 @@ class Timeline {
|
|
123984
124968
|
inpTarget.value = 'box';
|
123985
124969
|
} else if (currentTarget.name === 'section') {
|
123986
124970
|
inpTarget.value = 'section';
|
123987
|
-
}
|
124971
|
+
} else if (currentTarget.name === 'block') {
|
124972
|
+
inpTarget.value = 'block';
|
124973
|
+
} // this.read();
|
123988
124974
|
|
123989
|
-
this.read();
|
123990
|
-
} else {
|
123991
|
-
this.clearSettings();
|
123992
124975
|
}
|
124976
|
+
/*else {
|
124977
|
+
this.clearSettings();
|
124978
|
+
}*/
|
124979
|
+
|
124980
|
+
|
124981
|
+
this.read();
|
123993
124982
|
}
|
123994
124983
|
|
123995
124984
|
clearSettings() {
|
@@ -125184,16 +126173,39 @@ class Timeline {
|
|
125184
126173
|
if (section) activeElement = section;
|
125185
126174
|
}
|
125186
126175
|
|
126176
|
+
if (target === 'block') {
|
126177
|
+
const block = this.getBlock();
|
126178
|
+
if (block) activeElement = block;
|
126179
|
+
}
|
126180
|
+
|
125187
126181
|
return {
|
125188
126182
|
'element': activeElement ? activeElement : false,
|
125189
126183
|
'name': target ? target : false
|
125190
126184
|
};
|
125191
126185
|
}
|
125192
126186
|
|
126187
|
+
getBlock() {
|
126188
|
+
let block = this.builder.doc.querySelector('.is-block.active');
|
126189
|
+
if (!block) return false;
|
126190
|
+
|
126191
|
+
if (block.classList.contains('editable')) {
|
126192
|
+
return false;
|
126193
|
+
} else {
|
126194
|
+
return block;
|
126195
|
+
}
|
126196
|
+
}
|
126197
|
+
|
125193
126198
|
readTarget(s) {
|
125194
126199
|
if (!s) {
|
125195
126200
|
// element (inspectedElement first)
|
125196
126201
|
let activeElement = this.builder.editor.inspectedElement;
|
126202
|
+
let block = this.getBlock(); // if(block && !activeElement) {
|
126203
|
+
// return this.readTarget('block');
|
126204
|
+
// }
|
126205
|
+
|
126206
|
+
if (block) {
|
126207
|
+
return this.readTarget('block');
|
126208
|
+
}
|
125197
126209
|
|
125198
126210
|
if (!activeElement) {
|
125199
126211
|
return this.readTarget('bg');
|
@@ -125230,6 +126242,10 @@ class Timeline {
|
|
125230
126242
|
} else {
|
125231
126243
|
let activeElement;
|
125232
126244
|
|
126245
|
+
if (s === 'block') {
|
126246
|
+
activeElement = this.getBlock();
|
126247
|
+
}
|
126248
|
+
|
125233
126249
|
if (s === 'element') {
|
125234
126250
|
activeElement = this.builder.editor.activeElement;
|
125235
126251
|
}
|
@@ -125271,6 +126287,7 @@ class Timeline {
|
|
125271
126287
|
}
|
125272
126288
|
|
125273
126289
|
if (!activeElement) {
|
126290
|
+
if (s === 'block') return this.readTarget('box');
|
125274
126291
|
if (s === 'element') return this.readTarget('column');
|
125275
126292
|
if (s === 'column') return this.readTarget('row');
|
125276
126293
|
if (s === 'row') return this.readTarget('container');
|
@@ -125307,6 +126324,7 @@ class Timeline {
|
|
125307
126324
|
'name': s
|
125308
126325
|
};
|
125309
126326
|
} else {
|
126327
|
+
if (s === 'block') return this.readTarget('box');
|
125310
126328
|
if (s === 'element') return this.readTarget('column');
|
125311
126329
|
if (s === 'column') return this.readTarget('row');
|
125312
126330
|
if (s === 'row') return this.readTarget('container');
|
@@ -133591,11 +134609,20 @@ class Section {
|
|
133591
134609
|
if (target === 'xs') {
|
133592
134610
|
section.classList.add('xs-hidden');
|
133593
134611
|
} else if (target === 'sm') {
|
133594
|
-
section.classList.add('sm-hidden');
|
134612
|
+
section.classList.add('sm-hidden'); // hide all others smaller than tablet portrait
|
134613
|
+
|
134614
|
+
section.classList.add('xs-hidden');
|
133595
134615
|
} else if (target === 'md') {
|
133596
|
-
section.classList.add('md-hidden');
|
134616
|
+
section.classList.add('md-hidden'); // hide all others smaller than tablet landscape
|
134617
|
+
|
134618
|
+
section.classList.add('sm-hidden');
|
134619
|
+
section.classList.add('xs-hidden');
|
133597
134620
|
} else if (target === '') {
|
133598
|
-
section.classList.add('desktop-hidden');
|
134621
|
+
section.classList.add('desktop-hidden'); // hide all others smaller than desktop
|
134622
|
+
|
134623
|
+
section.classList.add('md-hidden');
|
134624
|
+
section.classList.add('sm-hidden');
|
134625
|
+
section.classList.add('xs-hidden');
|
133599
134626
|
}
|
133600
134627
|
}
|
133601
134628
|
|
@@ -144775,7 +145802,7 @@ class IframePanel {
|
|
144775
145802
|
|
144776
145803
|
if (hasPin) {
|
144777
145804
|
setTimeout(() => {
|
144778
|
-
this.builder.scrollToMarkedTarget(); //
|
145805
|
+
this.builder.scrollToMarkedTarget(false); // false => no need to run pageReRender(), because box/flex.js alwasy run it on resizing
|
144779
145806
|
}, 300);
|
144780
145807
|
} // Sync with external buttons
|
144781
145808
|
|
@@ -144833,7 +145860,7 @@ class IframePanel {
|
|
144833
145860
|
|
144834
145861
|
if (hasPin) {
|
144835
145862
|
setTimeout(() => {
|
144836
|
-
this.builder.scrollToMarkedTarget(); //
|
145863
|
+
this.builder.scrollToMarkedTarget(false); // false => no need to run pageReRender(), because box/flex.js alwasy run it on resizing
|
144837
145864
|
}, 300);
|
144838
145865
|
} // Sync with external buttons
|
144839
145866
|
|
@@ -145252,6 +146279,7 @@ class ContentBox {
|
|
145252
146279
|
colors: ['#ff8f00', '#ef6c00', '#d84315', '#c62828', '#58362f', '#37474f', '#353535', '#f9a825', '#9e9d24', '#558b2f', '#ad1457', '#6a1b9a', '#4527a0', '#616161', '#00b8c9', '#009666', '#2e7d32', '#0277bd', '#1565c0', '#283593', '#9e9e9e'],
|
145253
146280
|
swatches: ['#ff8f00', '#ef6c00', '#d84315', '#c62828', '#58362f', '#37474f', '#f9a825', '#9e9d24', '#558b2f', '#ad1457', '#6a1b9a', '#4527a0', '#00b8c9', '#009666', '#2e7d32', '#0277bd', '#1565c0', '#283593'],
|
145254
146281
|
gradientcolors: [['linear-gradient(0deg, rgb(255, 57, 25), rgb(249, 168, 37))', 'light'], ['linear-gradient(0deg, rgb(255, 57, 25), rgb(255, 104, 15))', 'light'], ['linear-gradient(0deg, #FF5722, #FF9800)', 'light'], ['linear-gradient(0deg, #613ca2, rgb(110, 123, 217))', 'light'], ['linear-gradient(0deg, rgb(65, 70, 206), rgb(236, 78, 130))', 'light'], ['linear-gradient(0deg, rgb(0, 150, 102), rgb(90, 103, 197))', 'light'], ['linear-gradient(30deg, rgb(249, 119, 148), rgb(98, 58, 162))', 'light'], ['linear-gradient(0deg, rgb(223, 70, 137), rgb(90, 103, 197))', 'light'], ['linear-gradient(0deg, rgb(40, 53, 147), rgb(90, 103, 197))', 'light'], ['linear-gradient(0deg, rgb(21, 101, 192), rgb(52, 169, 239))', 'light'], ['linear-gradient(0deg, rgb(32, 149, 219), rgb(139, 109, 230))', 'light'], ['linear-gradient(0deg, rgb(90, 103, 197), rgb(0, 184, 201))', 'light'], ['linear-gradient(0deg, rgb(0, 184, 201), rgb(253, 187, 45))', 'light'], ['linear-gradient(0deg, rgb(255, 208, 100), rgb(239, 98, 159))', 'light'], ['linear-gradient(0deg, rgb(0, 214, 223), rgb(130, 162, 253))', 'light'], ['linear-gradient(0deg, rgb(50, 234, 251), rgb(248, 247, 126))', 'dark'], ['linear-gradient(0deg, rgb(141, 221, 255), rgb(255, 227, 255))', 'dark'], ['linear-gradient(0deg, rgb(255, 170, 170), rgb(255, 255, 200))', 'dark'], ['linear-gradient(0deg, rgb(239, 239, 239), rgb(252, 252, 252))', 'dark']],
|
146282
|
+
shadowTemplates: ['rgba(0,0,0,0.3) 0px 1px 3px 0px', 'rgba(0,0,0,0.15) 0px 1px 5px', 'rgba(0,0,0,0.16) 0px 3px 6px', 'rgba(0,0,0,0.22) 0px 10px 10px -5px', 'rgba(0,0,0,0.19) 0px 10px 20px', 'rgba(0,0,0,0.21) 0px 5px 6px', 'rgba(0,0,0,0.25) 0px 14px 28px', 'rgba(0,0,0,0.19) 0px 6px 20px 0px', 'rgba(0,0,0,0.08) 4px 17px 20px', 'rgba(0,0,0,0.12) 0px 11px 35px', 'rgba(0,0,0,0.06) 17px 17px 0px', 'rgba(0,0,0,0.1) 0px 0px 40px inset', 'rgba(22,22,22,0.2) 2em 2em 5em', 'rgba(0,0,0,0.24) 30px 30px 45px'],
|
145255
146283
|
photoselect: '',
|
145256
146284
|
moduleConfig: [],
|
145257
146285
|
largerImageHandler: '',
|
@@ -149683,6 +150711,15 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
|
|
149683
150711
|
z-index:1;
|
149684
150712
|
}
|
149685
150713
|
|
150714
|
+
/* Group color */
|
150715
|
+
.block-active,
|
150716
|
+
.is-group.active {
|
150717
|
+
background-color: #81ffd538;
|
150718
|
+
}
|
150719
|
+
.block-active .is-block {
|
150720
|
+
outline: #51e1b2a3 2px solid;
|
150721
|
+
outline-offset: 2px;
|
150722
|
+
}
|
149686
150723
|
|
149687
150724
|
i.bi, i.icon { display: inline-flex; }
|
149688
150725
|
|
@@ -150536,6 +151573,23 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
|
|
150536
151573
|
}
|
150537
151574
|
}, 300);
|
150538
151575
|
if (this.eb) this.eb.refresh(); // freeform
|
151576
|
+
|
151577
|
+
if (localStorage.getItem('_animationmodal') != null) {
|
151578
|
+
const box = this.wrapperEl.querySelector('.is-box');
|
151579
|
+
const section = this.wrapperEl.querySelector('.is-section');
|
151580
|
+
|
151581
|
+
if (box) {
|
151582
|
+
box.classList.add('box-select');
|
151583
|
+
this.activeBox = box;
|
151584
|
+
}
|
151585
|
+
|
151586
|
+
if (section) {
|
151587
|
+
section.classList.add('section-select');
|
151588
|
+
this.activeSection = section;
|
151589
|
+
}
|
151590
|
+
|
151591
|
+
this.animateScroll.edit();
|
151592
|
+
}
|
150539
151593
|
} // pageSetup
|
150540
151594
|
|
150541
151595
|
|
@@ -152184,8 +153238,12 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
|
|
152184
153238
|
if (element) element.classList.add('scroll-target');
|
152185
153239
|
}
|
152186
153240
|
|
152187
|
-
scrollToMarkedTarget() {
|
152188
|
-
|
153241
|
+
scrollToMarkedTarget(reRender = true) {
|
153242
|
+
// used by: addIdea, section.js, iframerpanel.js (reRender=false, during resize)
|
153243
|
+
if (this.win.pageReRender && reRender) {
|
153244
|
+
this.win.pageReRender();
|
153245
|
+
}
|
153246
|
+
|
152189
153247
|
let scrollTarget = this.doc.querySelector('.scroll-target');
|
152190
153248
|
|
152191
153249
|
if (scrollTarget) {
|