@innovastudio/contentbox 1.6.47 → 1.6.48
Sign up to get free protection for your applications and to get access to all the features.
@@ -14662,6 +14662,11 @@ class PanelBlock {
|
|
14662
14662
|
</div>
|
14663
14663
|
</div>
|
14664
14664
|
|
14665
|
+
<div class="group moreoptions mt-2">
|
14666
|
+
<button title="${out('Shadow')}" class="btn-shadow" style="width:103px">${out('Shadow')}</button>
|
14667
|
+
<button title="${out('More')}" class="btn-moreoptions" style="width:103px">${out('More')}</button>
|
14668
|
+
</div>
|
14669
|
+
|
14665
14670
|
<div class="breakpoint-list"></div>
|
14666
14671
|
|
14667
14672
|
<div class="group flex mt-4 div-ungroup" style="width: 217px">
|
@@ -14691,6 +14696,9 @@ class PanelBlock {
|
|
14691
14696
|
<div class="group info-breakpoint" style="margin-top:17px;padding:10px 15px 3px;display:none"><div></div></div>
|
14692
14697
|
-->
|
14693
14698
|
|
14699
|
+
<div class="group resetrotation mt-2"">
|
14700
|
+
<button title="${out('Reset Rotation')}" class="btn-resetrotation">${out('Reset Rotation')}</button>
|
14701
|
+
</div>
|
14694
14702
|
</div>
|
14695
14703
|
|
14696
14704
|
|
@@ -14707,6 +14715,14 @@ class PanelBlock {
|
|
14707
14715
|
<span>${out('Remove Content')}</span>
|
14708
14716
|
</button>
|
14709
14717
|
</div>
|
14718
|
+
|
14719
|
+
<div class="label mt-3">${out('Placement')}:</div>
|
14720
|
+
<div class="group mt-2">
|
14721
|
+
<button title="${out('Top')}" data-align="items-start"><svg><use xlink:href="#icon-align-box-top"></use></svg></button>
|
14722
|
+
<button title="${out('Middle')}" data-align="items-center"><svg><use xlink:href="#icon-align-box-middle"></use></svg></button>
|
14723
|
+
<button title="${out('Bottom')}" data-align="items-end"><svg><use xlink:href="#icon-align-box-bottom"></use></svg></button>
|
14724
|
+
<button title="${out('Clear')}" data-align=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
|
14725
|
+
</div>
|
14710
14726
|
|
14711
14727
|
<div class="group editspacing mt-4"">
|
14712
14728
|
<button title="${out('Spacing')}" class="btn-spacing">${out('Spacing')}</button>
|
@@ -15119,6 +15135,10 @@ class PanelBlock {
|
|
15119
15135
|
btnSpacing.addEventListener('click', () => {
|
15120
15136
|
this.builder.controlpanel.objDialogSpacingContainer.open();
|
15121
15137
|
});
|
15138
|
+
const btnMore = panel.querySelector('.btn-moreoptions');
|
15139
|
+
btnMore.addEventListener('click', () => {
|
15140
|
+
this.builder.controlpanel.objDialogBlockOptions.open();
|
15141
|
+
});
|
15122
15142
|
const btnUngroup = panel.querySelector('.btn-ungroup');
|
15123
15143
|
btnUngroup.addEventListener('click', () => {
|
15124
15144
|
this.builder.editor.saveForUndo();
|
@@ -15140,6 +15160,18 @@ class PanelBlock {
|
|
15140
15160
|
this.builder.eb.removeShape();
|
15141
15161
|
this.builder.onChange();
|
15142
15162
|
});
|
15163
|
+
const btnResetRotation = panel.querySelector('.btn-resetrotation');
|
15164
|
+
btnResetRotation.addEventListener('click', () => {
|
15165
|
+
this.builder.editor.saveForUndo();
|
15166
|
+
this.builder.doc.querySelectorAll('.is-block.active').forEach(block => {
|
15167
|
+
block.style.transform = '';
|
15168
|
+
});
|
15169
|
+
this.builder.onChange();
|
15170
|
+
});
|
15171
|
+
const btnShadow = panel.querySelector('.btn-shadow');
|
15172
|
+
btnShadow.addEventListener('click', () => {
|
15173
|
+
this.builder.controlpanel.objDialogShadow.open();
|
15174
|
+
});
|
15143
15175
|
/*
|
15144
15176
|
const btnAddBreakpoint = panel.querySelector('.btn-addbreakpoint');
|
15145
15177
|
btnAddBreakpoint.addEventListener('click', ()=>{
|
@@ -15317,6 +15349,31 @@ class PanelBlock {
|
|
15317
15349
|
}
|
15318
15350
|
|
15319
15351
|
this.builder.onChange();
|
15352
|
+
}); // Flex
|
15353
|
+
|
15354
|
+
const btnJustify = panel.querySelectorAll('[data-align]');
|
15355
|
+
btnJustify.forEach(btn => {
|
15356
|
+
btn.addEventListener('click', () => {
|
15357
|
+
this.builder.editor.saveForUndo();
|
15358
|
+
const val = btn.getAttribute('data-align');
|
15359
|
+
const elms = this.builder.doc.querySelectorAll('.is-block.active');
|
15360
|
+
elms.forEach(target => {
|
15361
|
+
target.classList.remove('flex');
|
15362
|
+
target.classList.remove('items-start');
|
15363
|
+
target.classList.remove('items-center');
|
15364
|
+
target.classList.remove('items-end');
|
15365
|
+
});
|
15366
|
+
|
15367
|
+
if (val !== '') {
|
15368
|
+
elms.forEach(target => {
|
15369
|
+
target.classList.add('flex');
|
15370
|
+
target.classList.add(val);
|
15371
|
+
});
|
15372
|
+
}
|
15373
|
+
|
15374
|
+
this.getState();
|
15375
|
+
this.builder.onChange();
|
15376
|
+
});
|
15320
15377
|
});
|
15321
15378
|
}
|
15322
15379
|
|
@@ -15536,6 +15593,14 @@ class PanelBlock {
|
|
15536
15593
|
btnRemoveShape.style.display = 'none';
|
15537
15594
|
}
|
15538
15595
|
|
15596
|
+
const divResetRotation = panel.querySelector('div.resetrotation');
|
15597
|
+
|
15598
|
+
if (block.style.transform.includes('rotate')) {
|
15599
|
+
divResetRotation.style.display = '';
|
15600
|
+
} else {
|
15601
|
+
divResetRotation.style.display = 'none';
|
15602
|
+
}
|
15603
|
+
|
15539
15604
|
if (block) {
|
15540
15605
|
if (block.closest('.autolayout')) {
|
15541
15606
|
this.divArrange.style.display = 'none';
|
@@ -15638,7 +15703,19 @@ class PanelBlock {
|
|
15638
15703
|
this.divMove.style.display = 'none';
|
15639
15704
|
}
|
15640
15705
|
|
15641
|
-
this.showBlockPos();
|
15706
|
+
this.showBlockPos(); // flex
|
15707
|
+
|
15708
|
+
if (block) {
|
15709
|
+
this.panel.querySelectorAll('[data-align]').forEach(elm => elm.classList.remove('on'));
|
15710
|
+
|
15711
|
+
if (block.classList.contains('items-start')) {
|
15712
|
+
this.panel.querySelector('[data-align=items-start]').classList.add('on');
|
15713
|
+
} else if (block.classList.contains('items-center')) {
|
15714
|
+
this.panel.querySelector('[data-align=items-center]').classList.add('on');
|
15715
|
+
} else if (block.classList.contains('items-end')) {
|
15716
|
+
this.panel.querySelector('[data-align=items-end]').classList.add('on');
|
15717
|
+
}
|
15718
|
+
}
|
15642
15719
|
}
|
15643
15720
|
|
15644
15721
|
showBlockPos() {
|
@@ -22062,6 +22139,423 @@ class SpacingContainer {
|
|
22062
22139
|
|
22063
22140
|
}
|
22064
22141
|
|
22142
|
+
class BlockOptions {
|
22143
|
+
constructor(dialog, builder) {
|
22144
|
+
this.builder = builder;
|
22145
|
+
this.dialog = dialog;
|
22146
|
+
let html = `
|
22147
|
+
<button class="btn-back" tabindex="-1" title="${out('Close')}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>
|
22148
|
+
|
22149
|
+
<div class="submain">
|
22150
|
+
<div class="label" style="font-size:18px">${out('More Options')}</div>
|
22151
|
+
<label class="std">
|
22152
|
+
<span class="label mt-3">${out('Border Radius')}:</span>
|
22153
|
+
<div class="mt-2">
|
22154
|
+
<input type="range" min="0" max="500" value="0" class="inp-block-borderradius is-rangeslider" style="width:180px">
|
22155
|
+
</div>
|
22156
|
+
<div class="mt-3" style="align-items:center;">
|
22157
|
+
<input type="text" class="inp-borderradius" style="width:80px">
|
22158
|
+
<span>px</span>
|
22159
|
+
</div>
|
22160
|
+
</label>
|
22161
|
+
|
22162
|
+
<!--<div class="group mt-5">
|
22163
|
+
<button title="${out('Shadow')}" class="btn-shadow" style="width:221px">${out('Shadow')}</button>
|
22164
|
+
</div>-->
|
22165
|
+
</div>
|
22166
|
+
|
22167
|
+
<button class="accordion-item" aria-expanded="false" aria-controls="blockmore1">
|
22168
|
+
${out('Border')}
|
22169
|
+
<span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>
|
22170
|
+
</button>
|
22171
|
+
<div class="accordion-content" id="blockmore1" aria-hidden="true">
|
22172
|
+
|
22173
|
+
<div class="subpanel">
|
22174
|
+
|
22175
|
+
<div class="label subtitle mt-2">${out('Border')}:</div>
|
22176
|
+
|
22177
|
+
<div class="flex">
|
22178
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22179
|
+
<div>
|
22180
|
+
<span class="label">${out('Width')}:</span>
|
22181
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22182
|
+
</div>
|
22183
|
+
<input type="text" class="inp-borderwidth" style="width:80px">
|
22184
|
+
</label>
|
22185
|
+
<label class="std" style="margin-right:12px;">
|
22186
|
+
<span class="label"> </span>
|
22187
|
+
<select class="inp-borderstyle" style="width:80px">
|
22188
|
+
<option value=""></option>
|
22189
|
+
<option value="solid">${out('Solid')}</option>
|
22190
|
+
<option value="dashed">${out('Dashed')}</option>
|
22191
|
+
<option value="dotted">${out('Dotted')}</option>
|
22192
|
+
</select>
|
22193
|
+
</label>
|
22194
|
+
<label class="std">
|
22195
|
+
<span class="label"> </span>
|
22196
|
+
<div class="group">
|
22197
|
+
<button title="${out('Color')}" class="btn-bordercolor is-btn-color"></button>
|
22198
|
+
</div>
|
22199
|
+
</label>
|
22200
|
+
</div>
|
22201
|
+
|
22202
|
+
<div class="label subtitle">${out('Individual Sides')}:</div>
|
22203
|
+
|
22204
|
+
<div class="flex">
|
22205
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22206
|
+
<div>
|
22207
|
+
<span class="label">${out('Top')}:</span>
|
22208
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22209
|
+
</div>
|
22210
|
+
<input type="text" class="inp-bordertopwidth" style="width:80px">
|
22211
|
+
</label>
|
22212
|
+
<label class="std" style="margin-right:12px;">
|
22213
|
+
<span class="label"> </span>
|
22214
|
+
<select class="inp-bordertopstyle" style="width:80px">
|
22215
|
+
<option value=""></option>
|
22216
|
+
<option value="solid">${out('Solid')}</option>
|
22217
|
+
<option value="dashed">${out('Dashed')}</option>
|
22218
|
+
<option value="dotted">${out('Dotted')}</option>
|
22219
|
+
</select>
|
22220
|
+
</label>
|
22221
|
+
<label class="std">
|
22222
|
+
<span class="label"> </span>
|
22223
|
+
<div class="group">
|
22224
|
+
<button title="${out('Color')}" class="btn-bordertopcolor is-btn-color"></button>
|
22225
|
+
</div>
|
22226
|
+
</label>
|
22227
|
+
</div>
|
22228
|
+
|
22229
|
+
<div class="flex">
|
22230
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22231
|
+
<div>
|
22232
|
+
<span class="label">${out('Bottom')}:</span>
|
22233
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22234
|
+
</div>
|
22235
|
+
<input type="text" class="inp-borderbottomwidth" style="width:80px">
|
22236
|
+
</label>
|
22237
|
+
<label class="std" style="margin-right:12px;">
|
22238
|
+
<span class="label"> </span>
|
22239
|
+
<select class="inp-borderbottomstyle" style="width:80px">
|
22240
|
+
<option value=""></option>
|
22241
|
+
<option value="solid">${out('Solid')}</option>
|
22242
|
+
<option value="dashed">${out('Dashed')}</option>
|
22243
|
+
<option value="dotted">${out('Dotted')}</option>
|
22244
|
+
</select>
|
22245
|
+
</label>
|
22246
|
+
<label class="std">
|
22247
|
+
<span class="label"> </span>
|
22248
|
+
<div class="group">
|
22249
|
+
<button title="${out('Color')}" class="btn-borderbottomcolor is-btn-color"></button>
|
22250
|
+
</div>
|
22251
|
+
</label>
|
22252
|
+
</div>
|
22253
|
+
|
22254
|
+
<div class="flex">
|
22255
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22256
|
+
<div>
|
22257
|
+
<span class="label">${out('Left')}:</span>
|
22258
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22259
|
+
</div>
|
22260
|
+
<input type="text" class="inp-borderleftwidth" style="width:80px">
|
22261
|
+
</label>
|
22262
|
+
<label class="std" style="margin-right:12px;">
|
22263
|
+
<span class="label"> </span>
|
22264
|
+
<select class="inp-borderleftstyle" style="width:80px">
|
22265
|
+
<option value=""></option>
|
22266
|
+
<option value="solid">${out('Solid')}</option>
|
22267
|
+
<option value="dashed">${out('Dashed')}</option>
|
22268
|
+
<option value="dotted">${out('Dotted')}</option>
|
22269
|
+
</select>
|
22270
|
+
</label>
|
22271
|
+
<label class="std">
|
22272
|
+
<span class="label"> </span>
|
22273
|
+
<div class="group">
|
22274
|
+
<button title="${out('Color')}" class="btn-borderleftcolor is-btn-color"></button>
|
22275
|
+
</div>
|
22276
|
+
</label>
|
22277
|
+
</div>
|
22278
|
+
|
22279
|
+
<div class="flex">
|
22280
|
+
<label class="unit" style="width:80px;margin-right:12px;">
|
22281
|
+
<div>
|
22282
|
+
<span class="label">${out('Right')}:</span>
|
22283
|
+
<a class="btn-unit" href="#" role="button">px</a>
|
22284
|
+
</div>
|
22285
|
+
<input type="text" class="inp-borderrightwidth" style="width:80px">
|
22286
|
+
</label>
|
22287
|
+
<label class="std" style="margin-right:12px;">
|
22288
|
+
<span class="label"> </span>
|
22289
|
+
<select class="inp-borderrightstyle" style="width:80px">
|
22290
|
+
<option value=""></option>
|
22291
|
+
<option value="solid">${out('Solid')}</option>
|
22292
|
+
<option value="dashed">${out('Dashed')}</option>
|
22293
|
+
<option value="dotted">${out('Dotted')}</option>
|
22294
|
+
</select>
|
22295
|
+
</label>
|
22296
|
+
<label class="std">
|
22297
|
+
<span class="label"> </span>
|
22298
|
+
<div class="group">
|
22299
|
+
<button title="${out('Color')}" class="btn-borderrightcolor is-btn-color"></button>
|
22300
|
+
</div>
|
22301
|
+
</label>
|
22302
|
+
</div>
|
22303
|
+
|
22304
|
+
</div>
|
22305
|
+
|
22306
|
+
</div>
|
22307
|
+
|
22308
|
+
<div class="panel-pop unit-1" tabIndex="-1" aria-hidden="true">
|
22309
|
+
<button title="px">px</button>
|
22310
|
+
<button title="px">%</button>
|
22311
|
+
<button title="vw">vw</button>
|
22312
|
+
<button title="vw">vh</button>
|
22313
|
+
<button title="em">em</button>
|
22314
|
+
<button title="rem">rem</button>
|
22315
|
+
</div>
|
22316
|
+
`;
|
22317
|
+
dialog.insertAdjacentHTML('beforeend', html);
|
22318
|
+
this.unit = dialog.querySelector('.panel-pop.unit-1');
|
22319
|
+
const btnBack = dialog.querySelector('.btn-back');
|
22320
|
+
btnBack.addEventListener('click', () => {
|
22321
|
+
this.close();
|
22322
|
+
}); // Units
|
22323
|
+
|
22324
|
+
dialog.querySelectorAll('.btn-unit').forEach(btn => btn.addEventListener('click', e => {
|
22325
|
+
this.builder.controlpanel.showPop(this.unit, () => {// btn.focus();
|
22326
|
+
}, btn);
|
22327
|
+
this.unitButton = btn;
|
22328
|
+
e.preventDefault();
|
22329
|
+
})); // Apply Style
|
22330
|
+
|
22331
|
+
let timer;
|
22332
|
+
const divBorder = dialog.querySelector('#blockmore1');
|
22333
|
+
divBorder.querySelectorAll('input').forEach(inp => {
|
22334
|
+
inp.addEventListener('input', () => {
|
22335
|
+
clearTimeout(timer);
|
22336
|
+
timer = setTimeout(() => {
|
22337
|
+
this.applyStyle(inp);
|
22338
|
+
}, 600);
|
22339
|
+
});
|
22340
|
+
});
|
22341
|
+
divBorder.querySelectorAll('select').forEach(inp => inp.addEventListener('change', () => {
|
22342
|
+
this.applyStyle(inp);
|
22343
|
+
}));
|
22344
|
+
this.unit.querySelectorAll('button').forEach(btn => {
|
22345
|
+
btn.addEventListener('click', () => {
|
22346
|
+
this.unitButton.innerText = btn.innerText;
|
22347
|
+
this.builder.controlpanel.hidePop(this.unit);
|
22348
|
+
const inp = this.unitButton.parentNode.parentNode.querySelector('input');
|
22349
|
+
this.applyStyle(inp);
|
22350
|
+
});
|
22351
|
+
}); // Colors
|
22352
|
+
|
22353
|
+
const renderColorPicker = (property, selector) => {
|
22354
|
+
const btnPicker = dialog.querySelector(selector);
|
22355
|
+
btnPicker.addEventListener('click', () => {
|
22356
|
+
this.builder.editor.saveForUndo(true); // checkLater = true
|
22357
|
+
|
22358
|
+
let block = this.blockOverlay();
|
22359
|
+
let bgcolor = btnPicker.style.backgroundColor;
|
22360
|
+
const colorpicker = this.builder.editor.colorpicker();
|
22361
|
+
colorpicker.open(s => {
|
22362
|
+
block.style[property] = s;
|
22363
|
+
btnPicker.style.backgroundColor = s; // preview
|
22364
|
+
|
22365
|
+
this.builder.onChange();
|
22366
|
+
}, bgcolor);
|
22367
|
+
});
|
22368
|
+
};
|
22369
|
+
|
22370
|
+
renderColorPicker('border-color', '.btn-bordercolor');
|
22371
|
+
renderColorPicker('border-top-color', '.btn-bordertopcolor');
|
22372
|
+
renderColorPicker('border-bottom-color', '.btn-borderbottomcolor');
|
22373
|
+
renderColorPicker('border-left-color', '.btn-borderleftcolor');
|
22374
|
+
renderColorPicker('border-right-color', '.btn-borderrightcolor'); // Border Radius
|
22375
|
+
|
22376
|
+
const inpBorderRadius = dialog.querySelector('.inp-borderradius');
|
22377
|
+
const inpBlockBorderRadius = dialog.querySelector('.inp-block-borderradius');
|
22378
|
+
this.inpBorderRadius = inpBorderRadius;
|
22379
|
+
this.inpBlockBorderRadius = inpBlockBorderRadius;
|
22380
|
+
|
22381
|
+
inpBlockBorderRadius.onfocus = () => {
|
22382
|
+
this.builder.editor.saveForUndo(true);
|
22383
|
+
};
|
22384
|
+
|
22385
|
+
inpBlockBorderRadius.oninput = () => {
|
22386
|
+
// val: 0 - 500
|
22387
|
+
let val = inpBlockBorderRadius.value;
|
22388
|
+
inpBorderRadius.value = val;
|
22389
|
+
const blockOverlay = this.blockOverlay();
|
22390
|
+
blockOverlay.style.borderRadius = val + 'px';
|
22391
|
+
};
|
22392
|
+
|
22393
|
+
inpBlockBorderRadius.onchange = () => {
|
22394
|
+
this.builder.onChange();
|
22395
|
+
}; // const btnShadow = dialog.querySelector('.btn-shadow');
|
22396
|
+
// btnShadow.addEventListener('click',()=>{
|
22397
|
+
// this.builder.controlpanel.objDialogShadow.open();
|
22398
|
+
// });
|
22399
|
+
|
22400
|
+
}
|
22401
|
+
|
22402
|
+
applyStyle(inp) {
|
22403
|
+
this.builder.editor.saveForUndo();
|
22404
|
+
let cls = inp.classList;
|
22405
|
+
if (cls.contains('inp-borderwidth')) this.setStyle('border-width', '.inp-borderwidth');
|
22406
|
+
if (cls.contains('inp-bordertopwidth')) this.setStyle('border-top-width', '.inp-bordertopwidth');
|
22407
|
+
if (cls.contains('inp-borderbottomwidth')) this.setStyle('border-bottom-width', '.inp-borderbottomwidth');
|
22408
|
+
if (cls.contains('inp-borderleftwidth')) this.setStyle('border-left-width', '.inp-borderleftwidth');
|
22409
|
+
if (cls.contains('inp-borderrightwidth')) this.setStyle('border-right-width', '.inp-borderrightwidth');
|
22410
|
+
if (cls.contains('inp-borderstyle')) this.setStyleSelect('border-style', '.inp-borderstyle');
|
22411
|
+
if (cls.contains('inp-bordertopstyle')) this.setStyleSelect('border-top-style', '.inp-bordertopstyle');
|
22412
|
+
if (cls.contains('inp-borderbottomstyle')) this.setStyleSelect('border-bottom-style', '.inp-borderbottomstyle');
|
22413
|
+
if (cls.contains('inp-borderleftstyle')) this.setStyleSelect('border-left-style', '.inp-borderleftstyle');
|
22414
|
+
if (cls.contains('inp-borderrightstyle')) this.setStyleSelect('border-right-style', '.inp-borderrightstyle'); // if(cls.contains('inp-shadowxoffset') ||
|
22415
|
+
// cls.contains('inp-shadowyoffset') ||
|
22416
|
+
// cls.contains('inp-shadowblur') ||
|
22417
|
+
// cls.contains('inp-shadowspread') ||
|
22418
|
+
// cls.contains('inp-shadowtype')) {
|
22419
|
+
// this.setBoxShadow();
|
22420
|
+
// }
|
22421
|
+
|
22422
|
+
this.builder.onChange();
|
22423
|
+
|
22424
|
+
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')) {
|
22425
|
+
this.refresh();
|
22426
|
+
}
|
22427
|
+
}
|
22428
|
+
|
22429
|
+
refresh() {
|
22430
|
+
this.getStyle('border-width', '.inp-borderwidth');
|
22431
|
+
this.getStyle('border-top-width', '.inp-bordertopwidth');
|
22432
|
+
this.getStyle('border-bottom-width', '.inp-borderbottomwidth');
|
22433
|
+
this.getStyle('border-left-width', '.inp-borderleftwidth');
|
22434
|
+
this.getStyle('border-right-width', '.inp-borderrightwidth');
|
22435
|
+
this.getStyleSelect('border-style', '.inp-borderstyle');
|
22436
|
+
this.getStyleSelect('border-top-style', '.inp-bordertopstyle');
|
22437
|
+
this.getStyleSelect('border-bottom-style', '.inp-borderbottomstyle');
|
22438
|
+
this.getStyleSelect('border-left-style', '.inp-borderleftstyle');
|
22439
|
+
this.getStyleSelect('border-right-style', '.inp-borderrightstyle'); // this.getBoxShadow();
|
22440
|
+
|
22441
|
+
const block = this.blockOverlay();
|
22442
|
+
const dialog = this.dialog; // Border Color
|
22443
|
+
|
22444
|
+
const btnBorderColor = dialog.querySelector('.btn-bordercolor');
|
22445
|
+
let bordercolor = block.style.borderColor;
|
22446
|
+
if (bordercolor) btnBorderColor.style.backgroundColor = bordercolor;else btnBorderColor.style.backgroundColor = ''; // Border Top Color
|
22447
|
+
|
22448
|
+
const btnBorderTopColor = dialog.querySelector('.btn-bordertopcolor');
|
22449
|
+
let bordertopcolor = block.style.borderTopColor;
|
22450
|
+
if (bordertopcolor) btnBorderTopColor.style.backgroundColor = bordertopcolor;else btnBorderTopColor.style.backgroundColor = ''; // Border Bottom Color
|
22451
|
+
|
22452
|
+
const btnBorderBottomColor = dialog.querySelector('.btn-borderbottomcolor');
|
22453
|
+
let borderbottomcolor = block.style.borderBottomColor;
|
22454
|
+
if (borderbottomcolor) btnBorderBottomColor.style.backgroundColor = borderbottomcolor;else btnBorderBottomColor.style.backgroundColor = ''; // Border Left Color
|
22455
|
+
|
22456
|
+
const btnBorderLeftColor = dialog.querySelector('.btn-borderleftcolor');
|
22457
|
+
let borderleftcolor = block.style.borderLeftColor;
|
22458
|
+
if (borderleftcolor) btnBorderLeftColor.style.backgroundColor = borderleftcolor;else btnBorderLeftColor.style.backgroundColor = ''; // Border Right Color
|
22459
|
+
|
22460
|
+
const btnBorderRightColor = dialog.querySelector('.btn-borderrightcolor');
|
22461
|
+
let borderrightcolor = block.style.borderRightColor;
|
22462
|
+
if (borderrightcolor) btnBorderRightColor.style.backgroundColor = borderrightcolor;else btnBorderRightColor.style.backgroundColor = '';
|
22463
|
+
}
|
22464
|
+
|
22465
|
+
getState() {
|
22466
|
+
this.inpBorderRadius.value = '0';
|
22467
|
+
this.inpBlockBorderRadius.value = '0';
|
22468
|
+
const blockOverlay = this.blockOverlay();
|
22469
|
+
|
22470
|
+
if (blockOverlay.style.borderRadius) {
|
22471
|
+
let val = parseInt(blockOverlay.style.borderRadius);
|
22472
|
+
this.inpBorderRadius.value = val;
|
22473
|
+
this.inpBlockBorderRadius.value = val;
|
22474
|
+
}
|
22475
|
+
|
22476
|
+
this.refresh();
|
22477
|
+
}
|
22478
|
+
|
22479
|
+
open() {
|
22480
|
+
this.dialog.style.display = 'flex';
|
22481
|
+
this.getState();
|
22482
|
+
}
|
22483
|
+
|
22484
|
+
close() {
|
22485
|
+
this.dialog.style.display = '';
|
22486
|
+
}
|
22487
|
+
|
22488
|
+
blockOverlay() {
|
22489
|
+
let block = this.builder.controlpanel.activeBlock;
|
22490
|
+
if (!block) return false;
|
22491
|
+
let blockOverlay = block.querySelector('.is-block-overlay');
|
22492
|
+
|
22493
|
+
if (!blockOverlay) {
|
22494
|
+
block.insertAdjacentHTML('beforeend', '<div class="is-block-overlay"></div>');
|
22495
|
+
blockOverlay = block.querySelector('.is-block-overlay');
|
22496
|
+
}
|
22497
|
+
|
22498
|
+
return blockOverlay;
|
22499
|
+
}
|
22500
|
+
|
22501
|
+
getStyle(property, selector) {
|
22502
|
+
let block = this.blockOverlay();
|
22503
|
+
const current = this.parseStyle(block, property);
|
22504
|
+
const dialog = this.dialog;
|
22505
|
+
const inp = dialog.querySelector(selector);
|
22506
|
+
const btn = inp.parentNode.querySelector('.btn-unit');
|
22507
|
+
inp.value = current.value;
|
22508
|
+
btn.innerText = current.unit ? current.unit : '-';
|
22509
|
+
}
|
22510
|
+
|
22511
|
+
setStyle(property, selector) {
|
22512
|
+
let block = this.blockOverlay();
|
22513
|
+
const dialog = this.dialog;
|
22514
|
+
const inp = dialog.querySelector(selector);
|
22515
|
+
const btn = inp.parentNode.querySelector('.btn-unit');
|
22516
|
+
const value = inp.value;
|
22517
|
+
let unit = btn.innerText;
|
22518
|
+
if (unit === '-') unit = '';
|
22519
|
+
block.style[property] = value ? `${value + unit}` : '';
|
22520
|
+
}
|
22521
|
+
|
22522
|
+
setStyleSelect(property, selector) {
|
22523
|
+
let block = this.blockOverlay();
|
22524
|
+
const dialog = this.dialog;
|
22525
|
+
const inp = dialog.querySelector(selector);
|
22526
|
+
const value = inp.value;
|
22527
|
+
block.style[property] = value;
|
22528
|
+
}
|
22529
|
+
|
22530
|
+
getStyleSelect(property, selector) {
|
22531
|
+
let block = this.blockOverlay();
|
22532
|
+
let value = block.style[property];
|
22533
|
+
const dialog = this.dialog;
|
22534
|
+
const inp = dialog.querySelector(selector);
|
22535
|
+
inp.value = value;
|
22536
|
+
}
|
22537
|
+
|
22538
|
+
parseStyle(element, property) {
|
22539
|
+
const styleValue = element.style[property];
|
22540
|
+
const match = styleValue.match(/^([0-9.]+)(px|vw|vh|em|rem|pt|vmin|vmax|%)$/);
|
22541
|
+
|
22542
|
+
if (match) {
|
22543
|
+
const numericValue = match[1];
|
22544
|
+
const unit = match[2];
|
22545
|
+
return {
|
22546
|
+
value: numericValue,
|
22547
|
+
unit
|
22548
|
+
};
|
22549
|
+
} else {
|
22550
|
+
return {
|
22551
|
+
value: '',
|
22552
|
+
unit: 'px'
|
22553
|
+
};
|
22554
|
+
}
|
22555
|
+
}
|
22556
|
+
|
22557
|
+
}
|
22558
|
+
|
22065
22559
|
class Element$2 {
|
22066
22560
|
constructor(dialog, builder) {
|
22067
22561
|
this.builder = builder;
|
@@ -23680,6 +24174,14 @@ class Shadow {
|
|
23680
24174
|
constructor(dialog, builder) {
|
23681
24175
|
this.builder = builder;
|
23682
24176
|
this.dialog = dialog;
|
24177
|
+
let shadowTemplates = this.builder.shadowTemplates;
|
24178
|
+
let shadowHtml = '';
|
24179
|
+
|
24180
|
+
for (let i = 1; i <= shadowTemplates.length; i++) {
|
24181
|
+
let item = shadowTemplates[i - 1];
|
24182
|
+
shadowHtml += `<button data-shadow="${item}" title="${out('Apply Shadow')}" type="button" style="box-shadow: ${item}">${i}</button>`;
|
24183
|
+
}
|
24184
|
+
|
23683
24185
|
let html = `
|
23684
24186
|
<button class="btn-back" tabindex="-1" title="${out('Close')}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>
|
23685
24187
|
|
@@ -23688,27 +24190,25 @@ class Shadow {
|
|
23688
24190
|
<div class="label" style="font-size:18px">${out('Shadow')}</div>
|
23689
24191
|
|
23690
24192
|
<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
|
-
|
24193
|
+
${shadowHtml}
|
23707
24194
|
</div>
|
23708
24195
|
|
23709
24196
|
<div class="group mt-4">
|
23710
24197
|
<button title="${out('Clear')}" class="btn-clean-shadow"><svg><use xlink:href="#icon-eraser"></use></svg></button>
|
23711
24198
|
</div>
|
24199
|
+
|
24200
|
+
<span class="label mt-3">${out('X')}:</span>
|
24201
|
+
<div class="mt-2">
|
24202
|
+
<input type="range" min="-100" max="100" value="0" class="inp-shadow-x is-rangeslider" style="width:180px">
|
24203
|
+
</div>
|
24204
|
+
|
24205
|
+
<span class="label mt-3">${out('Y')}:</span>
|
24206
|
+
<div class="mt-2">
|
24207
|
+
<input type="range" min="-100" max="100" value="0" class="inp-shadow-y is-rangeslider" style="width:180px">
|
24208
|
+
</div>
|
24209
|
+
|
24210
|
+
<span class="label mt-3">${out('Color')}:</span>
|
24211
|
+
<button title="${out('Color')}" class="btn-color is-btn-color"></button>
|
23712
24212
|
</div>
|
23713
24213
|
`;
|
23714
24214
|
dialog.insertAdjacentHTML('beforeend', html);
|
@@ -23721,28 +24221,176 @@ class Shadow {
|
|
23721
24221
|
btnShadow.forEach(btn => {
|
23722
24222
|
btn.addEventListener('click', () => {
|
23723
24223
|
this.builder.editor.saveForUndo();
|
23724
|
-
|
23725
|
-
|
23726
|
-
|
24224
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24225
|
+
|
24226
|
+
if (elm) {
|
24227
|
+
elm.style.boxShadow = btn.getAttribute('data-shadow');
|
24228
|
+
this.builder.controlpanel.objDialogElement.refresh();
|
24229
|
+
this.getState();
|
24230
|
+
} else {
|
24231
|
+
elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24232
|
+
if (elm) elm.style.boxShadow = btn.getAttribute('data-shadow');
|
24233
|
+
this.getState();
|
24234
|
+
}
|
24235
|
+
|
23727
24236
|
this.builder.onChange();
|
23728
24237
|
});
|
23729
24238
|
});
|
23730
24239
|
const btnCleanShadow = dialog.querySelector('.btn-clean-shadow');
|
23731
24240
|
btnCleanShadow.addEventListener('click', () => {
|
23732
|
-
|
23733
|
-
|
24241
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24242
|
+
|
24243
|
+
if (elm) {
|
24244
|
+
elm.style.boxShadow = '';
|
24245
|
+
} else {
|
24246
|
+
elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24247
|
+
if (elm) elm.style.boxShadow = '';
|
24248
|
+
}
|
24249
|
+
|
23734
24250
|
this.builder.controlpanel.objDialogElement.refresh();
|
24251
|
+
}); // Adjustments
|
24252
|
+
|
24253
|
+
const inpAdjustX = dialog.querySelector('.inp-shadow-x');
|
24254
|
+
this.inpAdjustX = inpAdjustX;
|
24255
|
+
|
24256
|
+
inpAdjustX.onfocus = () => {
|
24257
|
+
this.builder.editor.saveForUndo(true);
|
24258
|
+
};
|
24259
|
+
|
24260
|
+
inpAdjustX.oninput = () => {
|
24261
|
+
// val: 0 - 500
|
24262
|
+
let val = inpAdjustX.value;
|
24263
|
+
this.adjustX(val);
|
24264
|
+
};
|
24265
|
+
|
24266
|
+
inpAdjustX.onchange = () => {
|
24267
|
+
this.builder.onChange();
|
24268
|
+
};
|
24269
|
+
|
24270
|
+
const inpAdjustY = dialog.querySelector('.inp-shadow-y');
|
24271
|
+
this.inpAdjustY = inpAdjustY;
|
24272
|
+
|
24273
|
+
inpAdjustY.onfocus = () => {
|
24274
|
+
this.builder.editor.saveForUndo(true);
|
24275
|
+
};
|
24276
|
+
|
24277
|
+
inpAdjustY.oninput = () => {
|
24278
|
+
// val: 0 - 500
|
24279
|
+
let val = inpAdjustY.value;
|
24280
|
+
this.adjustY(val);
|
24281
|
+
};
|
24282
|
+
|
24283
|
+
inpAdjustY.onchange = () => {
|
24284
|
+
this.builder.onChange();
|
24285
|
+
};
|
24286
|
+
|
24287
|
+
const btnPicker = dialog.querySelector('.btn-color');
|
24288
|
+
this.btnPicker = btnPicker;
|
24289
|
+
btnPicker.addEventListener('click', () => {
|
24290
|
+
this.builder.editor.saveForUndo(true); // checkLater = true
|
24291
|
+
|
24292
|
+
let bgcolor = btnPicker.style.backgroundColor;
|
24293
|
+
const colorpicker = this.builder.editor.colorpicker();
|
24294
|
+
colorpicker.open(s => {
|
24295
|
+
this.adjustColor(s);
|
24296
|
+
btnPicker.style.backgroundColor = s; // preview
|
24297
|
+
|
24298
|
+
this.builder.onChange();
|
24299
|
+
}, bgcolor);
|
23735
24300
|
});
|
23736
24301
|
}
|
23737
24302
|
|
24303
|
+
getState() {
|
24304
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24305
|
+
if (!elm) elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24306
|
+
|
24307
|
+
if (elm) {
|
24308
|
+
let shadow = elm.style.boxShadow.replaceAll(', ', ',');
|
24309
|
+
let shadowParts = shadow.split(' ');
|
24310
|
+
let currentX, currentY;
|
24311
|
+
let color = shadowParts[0];
|
24312
|
+
|
24313
|
+
for (let i = 0; i < shadowParts.length; i++) {
|
24314
|
+
if (shadowParts[i].indexOf('px') !== -1 || shadowParts[i].indexOf('em') !== -1 || shadowParts[i].indexOf('rem') !== -1) {
|
24315
|
+
currentX = shadowParts[i];
|
24316
|
+
break;
|
24317
|
+
}
|
24318
|
+
}
|
24319
|
+
|
24320
|
+
for (let i = 0; i < shadowParts.length; i++) {
|
24321
|
+
if (shadowParts[i].indexOf('px') !== -1 || shadowParts[i].indexOf('em') !== -1 || shadowParts[i].indexOf('vw') !== -1) {
|
24322
|
+
currentY = shadowParts[i + 1];
|
24323
|
+
break;
|
24324
|
+
}
|
24325
|
+
}
|
24326
|
+
|
24327
|
+
this.inpAdjustX.value = parseInt(currentX);
|
24328
|
+
this.inpAdjustY.value = parseInt(currentY);
|
24329
|
+
this.btnPicker.style.backgroundColor = color;
|
24330
|
+
}
|
24331
|
+
}
|
24332
|
+
|
23738
24333
|
open() {
|
23739
24334
|
this.dialog.style.display = 'flex';
|
24335
|
+
this.getState();
|
23740
24336
|
}
|
23741
24337
|
|
23742
24338
|
close() {
|
23743
24339
|
this.dialog.style.display = '';
|
23744
24340
|
}
|
23745
24341
|
|
24342
|
+
adjustX(val) {
|
24343
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24344
|
+
if (!elm) elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24345
|
+
|
24346
|
+
if (elm) {
|
24347
|
+
let shadow = elm.style.boxShadow;
|
24348
|
+
let shadowParts = shadow.split(' ');
|
24349
|
+
|
24350
|
+
for (let i = 0; i < shadowParts.length; i++) {
|
24351
|
+
if (shadowParts[i].indexOf('px') !== -1 || shadowParts[i].indexOf('em') !== -1 || shadowParts[i].indexOf('rem') !== -1) {
|
24352
|
+
shadowParts[i] = val + shadowParts[i].match(/[a-z]+/)[0]; // Updates the X value while keeping the unit intact
|
24353
|
+
|
24354
|
+
break; // Assuming only one value is for X offset
|
24355
|
+
}
|
24356
|
+
}
|
24357
|
+
|
24358
|
+
elm.style.boxShadow = shadowParts.join(' ');
|
24359
|
+
}
|
24360
|
+
}
|
24361
|
+
|
24362
|
+
adjustY(val) {
|
24363
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24364
|
+
if (!elm) elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24365
|
+
|
24366
|
+
if (elm) {
|
24367
|
+
let shadow = elm.style.boxShadow;
|
24368
|
+
let shadowParts = shadow.split(' ');
|
24369
|
+
|
24370
|
+
for (let i = 0; i < shadowParts.length; i++) {
|
24371
|
+
if (shadowParts[i].indexOf('px') !== -1 || shadowParts[i].indexOf('em') !== -1 || shadowParts[i].indexOf('vw') !== -1) {
|
24372
|
+
shadowParts[i + 1] = val + shadowParts[i + 1].match(/[a-z]+/)[0]; // Updates the Y value while keeping the unit intact
|
24373
|
+
|
24374
|
+
break; // Assuming only one value is for Y offset
|
24375
|
+
}
|
24376
|
+
}
|
24377
|
+
|
24378
|
+
elm.style.boxShadow = shadowParts.join(' ');
|
24379
|
+
}
|
24380
|
+
}
|
24381
|
+
|
24382
|
+
adjustColor(val) {
|
24383
|
+
let elm = this.builder.controlpanel.objDialogElement.inspectedElement;
|
24384
|
+
if (!elm) elm = this.builder.controlpanel.objDialogBlockOptions.blockOverlay();
|
24385
|
+
|
24386
|
+
if (elm) {
|
24387
|
+
let shadow = elm.style.boxShadow.replaceAll(', ', ',');
|
24388
|
+
let shadowParts = shadow.split(' ');
|
24389
|
+
shadowParts[0] = val;
|
24390
|
+
elm.style.boxShadow = shadowParts.join(' ');
|
24391
|
+
}
|
24392
|
+
}
|
24393
|
+
|
23746
24394
|
}
|
23747
24395
|
|
23748
24396
|
class ImageAdjust {
|
@@ -24538,8 +25186,9 @@ class ControlPanel {
|
|
24538
25186
|
<div class="panel-dialog element"></div>
|
24539
25187
|
<div class="panel-dialog imageadjust"></div>
|
24540
25188
|
<div class="panel-dialog settings"></div>
|
24541
|
-
<div class="panel-dialog shadow"></div>
|
24542
25189
|
<div class="panel-dialog group"></div>
|
25190
|
+
<div class="panel-dialog blockoptions"></div>
|
25191
|
+
<div class="panel-dialog shadow"></div>
|
24543
25192
|
|
24544
25193
|
<div class="panel-pop more" tabIndex="-1" aria-hidden="true">
|
24545
25194
|
<!--<button class="btn-preferences" title="${out('Preferences')}">${out('Preferences')}</button>-->
|
@@ -24594,6 +25243,7 @@ class ControlPanel {
|
|
24594
25243
|
this.dialogImageAdjust = controlPanel.querySelector('.panel-dialog.imageadjust');
|
24595
25244
|
this.dialogSettings = controlPanel.querySelector('.panel-dialog.settings');
|
24596
25245
|
this.dialogGroup = controlPanel.querySelector('.panel-dialog.group');
|
25246
|
+
this.dialogBlockOptions = controlPanel.querySelector('.panel-dialog.blockoptions');
|
24597
25247
|
this.more = controlPanel.querySelector('.panel-pop.more');
|
24598
25248
|
this.objDialogIcons = new Icons(this.dialogIcons, this.builder);
|
24599
25249
|
this.objDialogSpacingColumn = new SpacingColumn(this.dialogSpacingColumn, this.builder);
|
@@ -24604,6 +25254,7 @@ class ControlPanel {
|
|
24604
25254
|
this.objDialogImageAdjust = new ImageAdjust(this.dialogImageAdjust, this.builder);
|
24605
25255
|
this.objDialogSettings = new Settings(this.dialogSettings, this.builder);
|
24606
25256
|
this.objDialogGroup = new Group(this.dialogGroup, this.builder);
|
25257
|
+
this.objDialogBlockOptions = new BlockOptions(this.dialogBlockOptions, this.builder);
|
24607
25258
|
this.objPanelText = new PanelText(this.panelText, this.builder); // comment/disable if using ContentBuilder's controlpanel
|
24608
25259
|
|
24609
25260
|
this.objPanelImage = new PanelImage(this.panelImage, this.builder);
|
@@ -24791,6 +25442,7 @@ class ControlPanel {
|
|
24791
25442
|
this.objDialogShadow.close();
|
24792
25443
|
this.objDialogImageAdjust.close();
|
24793
25444
|
this.objDialogGroup.close();
|
25445
|
+
this.objDialogBlockOptions.close();
|
24794
25446
|
}
|
24795
25447
|
|
24796
25448
|
closeContentDialogs() {
|
@@ -24801,6 +25453,7 @@ class ControlPanel {
|
|
24801
25453
|
this.objDialogShadow.close();
|
24802
25454
|
this.objDialogImageAdjust.close();
|
24803
25455
|
this.objDialogGroup.close();
|
25456
|
+
this.objDialogBlockOptions.close();
|
24804
25457
|
}
|
24805
25458
|
|
24806
25459
|
toggleDevice() {
|
@@ -24974,7 +25627,17 @@ class ControlPanel {
|
|
24974
25627
|
if (!this.activeBox) this.objDialogSpacingContainer.close();
|
24975
25628
|
if (!this.activeColumn) this.objDialogSpacingColumn.close();
|
24976
25629
|
this.objDialogImageAdjust.close();
|
24977
|
-
if (!this.activeBlock) this.objDialogGroup.close();
|
25630
|
+
if (!this.activeBlock) this.objDialogGroup.close();
|
25631
|
+
if (!this.activeBlock) this.objDialogBlockOptions.close(); // Show/hide panel
|
25632
|
+
|
25633
|
+
if (e.target.classList.contains('is-block')) {
|
25634
|
+
// test: select paragraph on normal section, then select block on canvas section
|
25635
|
+
this.select('block'); // freeform
|
25636
|
+
|
25637
|
+
return;
|
25638
|
+
} else {
|
25639
|
+
this.objDialogBlockOptions.close();
|
25640
|
+
}
|
24978
25641
|
|
24979
25642
|
if (this.activeElement) this.select('element');
|
24980
25643
|
if (!this.activeElement && this.activeBlock) this.select('block'); // freeform
|
@@ -25406,6 +26069,14 @@ class ControlPanel {
|
|
25406
26069
|
if (this.dialogImageAdjust.style.display === 'flex') {
|
25407
26070
|
this.objDialogImageAdjust.getState();
|
25408
26071
|
}
|
26072
|
+
|
26073
|
+
if (this.dialogBlockOptions.style.display === 'flex') {
|
26074
|
+
this.objDialogBlockOptions.getState();
|
26075
|
+
}
|
26076
|
+
|
26077
|
+
if (this.dialogShadow.style.display === 'flex') {
|
26078
|
+
this.objDialogShadow.getState();
|
26079
|
+
}
|
25409
26080
|
}
|
25410
26081
|
|
25411
26082
|
showTooltip() {
|
@@ -73642,7 +74313,8 @@ class Hyperlink {
|
|
73642
74313
|
selection = selectionText;
|
73643
74314
|
const range = selection.getRangeAt(0);
|
73644
74315
|
const fragment = range.extractContents();
|
73645
|
-
const link =
|
74316
|
+
const link = this.builder.doc.createElement('a'); //
|
74317
|
+
|
73646
74318
|
link.setAttribute('href', url);
|
73647
74319
|
link.setAttribute('title', title);
|
73648
74320
|
if (modal.querySelector('.input-newwindow').checked) {
|
@@ -73662,7 +74334,8 @@ class Hyperlink {
|
|
73662
74334
|
} else if (selectionElm) {
|
73663
74335
|
selection = selectionElm;
|
73664
74336
|
selectionElm.innerHTML = `<a class="dummylink" href="dummy">${linktext}</a>`;
|
73665
|
-
let link =
|
74337
|
+
let link = this.builder.doc.querySelector('.dummylink'); //
|
74338
|
+
|
73666
74339
|
link.setAttribute('href', url);
|
73667
74340
|
link.setAttribute('title', title);
|
73668
74341
|
if (modal.querySelector('.input-newwindow').checked) {
|
@@ -108886,6 +109559,37 @@ class Draggable {
|
|
108886
109559
|
}
|
108887
109560
|
}
|
108888
109561
|
updateBlockStyle(target) {
|
109562
|
+
// Block placement should must not 50% outside the container
|
109563
|
+
const container = target.closest('.box-canvas');
|
109564
|
+
let containerHeight = container.offsetHeight;
|
109565
|
+
let containerWidth = container.offsetWidth;
|
109566
|
+
/*
|
109567
|
+
if(target.offsetTop + target.offsetHeight>=containerHeight) {
|
109568
|
+
target.style.top = containerHeight-target.offsetHeight +'px';
|
109569
|
+
}
|
109570
|
+
if(target.offsetTop<=0) {
|
109571
|
+
target.style.top = '0px';
|
109572
|
+
}
|
109573
|
+
if(target.offsetLeft + target.offsetWidth>=åcontainerWidth) {
|
109574
|
+
target.style.left = (containerWidth-target.offsetWidth) +'px';
|
109575
|
+
}
|
109576
|
+
if(target.offsetLeft<=0) {
|
109577
|
+
target.style.left = '0px';
|
109578
|
+
}
|
109579
|
+
*/
|
109580
|
+
if (target.offsetTop + target.offsetHeight <= target.offsetHeight / 2) {
|
109581
|
+
target.style.top = '0px';
|
109582
|
+
}
|
109583
|
+
if (containerHeight - target.offsetTop <= target.offsetHeight / 2) {
|
109584
|
+
target.style.top = containerHeight - target.offsetHeight + 'px';
|
109585
|
+
}
|
109586
|
+
if (target.offsetLeft + target.offsetWidth <= target.offsetWidth / 2) {
|
109587
|
+
target.style.left = '0px';
|
109588
|
+
}
|
109589
|
+
if (containerWidth - target.offsetLeft <= target.offsetWidth / 2) {
|
109590
|
+
target.style.left = containerWidth - target.offsetWidth + 'px';
|
109591
|
+
}
|
109592
|
+
|
108889
109593
|
// Replace with ruler's alignment
|
108890
109594
|
if (this.ruler.rulerTop !== null) target.style.top = this.ruler.rulerTop + 'px';
|
108891
109595
|
if (this.ruler.rulerBottom !== null) target.style.top = this.ruler.rulerBottom - target.offsetHeight + 'px'; //new
|
@@ -114532,6 +115236,18 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
114532
115236
|
});
|
114533
115237
|
var html = result[0].html;
|
114534
115238
|
var noedit = result[0].noedit;
|
115239
|
+
if (result[0].mode === 'canvas') {
|
115240
|
+
html = result[0].html2;
|
115241
|
+
if (!html) {
|
115242
|
+
html = `
|
115243
|
+
<div class="row">
|
115244
|
+
<div class="column pt-0 pb-0 pl-0 pr-0 flex flex-col justify-center">
|
115245
|
+
<img src="${this.opts.snippetPath}images/img-2400x1350.png" alt="">
|
115246
|
+
</div>
|
115247
|
+
</div>
|
115248
|
+
`;
|
115249
|
+
}
|
115250
|
+
}
|
114535
115251
|
var bSnippet;
|
114536
115252
|
if (html.indexOf('"row') === -1) {
|
114537
115253
|
bSnippet = true; // Just snippet (without row/column grid)
|
@@ -145252,6 +145968,7 @@ class ContentBox {
|
|
145252
145968
|
colors: ['#ff8f00', '#ef6c00', '#d84315', '#c62828', '#58362f', '#37474f', '#353535', '#f9a825', '#9e9d24', '#558b2f', '#ad1457', '#6a1b9a', '#4527a0', '#616161', '#00b8c9', '#009666', '#2e7d32', '#0277bd', '#1565c0', '#283593', '#9e9e9e'],
|
145253
145969
|
swatches: ['#ff8f00', '#ef6c00', '#d84315', '#c62828', '#58362f', '#37474f', '#f9a825', '#9e9d24', '#558b2f', '#ad1457', '#6a1b9a', '#4527a0', '#00b8c9', '#009666', '#2e7d32', '#0277bd', '#1565c0', '#283593'],
|
145254
145970
|
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']],
|
145971
|
+
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
145972
|
photoselect: '',
|
145256
145973
|
moduleConfig: [],
|
145257
145974
|
largerImageHandler: '',
|