@innovastudio/contentbuilder 1.4.131 → 1.4.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3598,7 +3598,7 @@ class Dom {
|
|
|
3598
3598
|
}
|
|
3599
3599
|
}
|
|
3600
3600
|
let blocks = [];
|
|
3601
|
-
const blockElms = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'pre', 'td', 'th'];
|
|
3601
|
+
const blockElms = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'pre', 'td', 'th', 'li'];
|
|
3602
3602
|
elements.forEach(item => {
|
|
3603
3603
|
const tagName = item.tagName.toLowerCase();
|
|
3604
3604
|
if (blockElms.includes(tagName)) {
|
|
@@ -14477,7 +14477,11 @@ class Draggable$1 {
|
|
|
14477
14477
|
const elms = document.querySelectorAll(this.opts.selector);
|
|
14478
14478
|
Array.prototype.forEach.call(elms, elm => {
|
|
14479
14479
|
elm.setAttribute('draggable', '');
|
|
14480
|
-
|
|
14480
|
+
|
|
14481
|
+
// elm.addEventListener('touchstart', this.dragStart, false);
|
|
14482
|
+
elm.addEventListener('touchstart', this.dragStart, {
|
|
14483
|
+
passive: true
|
|
14484
|
+
});
|
|
14481
14485
|
elm.addEventListener('touchend', this.dragEnd, false);
|
|
14482
14486
|
elm.addEventListener('mousedown', this.dragStart, false);
|
|
14483
14487
|
elm.addEventListener('mouseup', this.dragEnd, false);
|
|
@@ -46984,7 +46988,7 @@ class ButtonEditor {
|
|
|
46984
46988
|
<div class="flex flex-row">
|
|
46985
46989
|
<div class="flex flex-col" style="margin-right: 40px;">
|
|
46986
46990
|
<div>
|
|
46987
|
-
<
|
|
46991
|
+
<span>${util.out('Background Color')}</span>:
|
|
46988
46992
|
</div>
|
|
46989
46993
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
46990
46994
|
<button title="${util.out('Background Color')}" class="bg-color-command" style="width:45px;height:40px;border:rgb(0 0 0 / 6%) 1px solid;margin-right:4px"></button>
|
|
@@ -46993,7 +46997,7 @@ class ButtonEditor {
|
|
|
46993
46997
|
|
|
46994
46998
|
<div class="flex flex-col">
|
|
46995
46999
|
<div>
|
|
46996
|
-
<
|
|
47000
|
+
<span>${util.out('Text Color')}</span>:
|
|
46997
47001
|
</div>
|
|
46998
47002
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
46999
47003
|
<button title="${util.out('Text Color')}" class="text-color-command" style="width:45px;height:40px;border:rgb(0 0 0 / 6%) 1px solid;margin-right:4px"></button>
|
|
@@ -47001,7 +47005,7 @@ class ButtonEditor {
|
|
|
47001
47005
|
</div>
|
|
47002
47006
|
<div class="flex flex-col" style="margin-left: 60px;">
|
|
47003
47007
|
<div>
|
|
47004
|
-
<
|
|
47008
|
+
<span>${util.out('Width')}</span>:
|
|
47005
47009
|
</div>
|
|
47006
47010
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47007
47011
|
<button title="${util.out('Auto')}" data-command="auto" class="width-command" style="margin-right:4px">${util.out('Auto')}</button>
|
|
@@ -47013,7 +47017,7 @@ class ButtonEditor {
|
|
|
47013
47017
|
<div class="flex flex-row" style="margin:15px 0 0">
|
|
47014
47018
|
<div class="flex flex-col" style="margin-right: 40px;">
|
|
47015
47019
|
<div>
|
|
47016
|
-
<
|
|
47020
|
+
<span>${util.out('Border Color')}</span>:
|
|
47017
47021
|
</div>
|
|
47018
47022
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47019
47023
|
<button title="${util.out('Transparent')}" data-command="transparent" class="border-color-command" style="margin-right:4px">${util.out('Transparent')}</button>
|
|
@@ -47023,7 +47027,7 @@ class ButtonEditor {
|
|
|
47023
47027
|
|
|
47024
47028
|
<div class="flex flex-col">
|
|
47025
47029
|
<div>
|
|
47026
|
-
<
|
|
47030
|
+
<span>${util.out('Border Thickness')}</span>:
|
|
47027
47031
|
</div>
|
|
47028
47032
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47029
47033
|
<button title="${util.out('No Border')}" data-command="0" class="border-width-command" style="margin-right:4px">${util.out('No Border')}</button>
|
|
@@ -47036,7 +47040,7 @@ class ButtonEditor {
|
|
|
47036
47040
|
<div class="flex flex-row" style="margin:15px 0 0">
|
|
47037
47041
|
<div class="flex flex-col" style="margin-right: 20px;">
|
|
47038
47042
|
<div>
|
|
47039
|
-
<
|
|
47043
|
+
<span>${util.out('Padding Left/Right')}</span>:
|
|
47040
47044
|
</div>
|
|
47041
47045
|
<div class="flex flex-row" style="margin-top:5px">
|
|
47042
47046
|
<button title="2" data-command="2" class="paddingx-command" style="margin-right:4px">2</button>
|
|
@@ -47055,7 +47059,7 @@ class ButtonEditor {
|
|
|
47055
47059
|
|
|
47056
47060
|
<div class="flex flex-col" style="display:none">
|
|
47057
47061
|
<div>
|
|
47058
|
-
<
|
|
47062
|
+
<span>${util.out('Padding Y')}</span>:
|
|
47059
47063
|
</div>
|
|
47060
47064
|
<div class="flex flex-row" style="margin-top:5px">
|
|
47061
47065
|
<button title="0" data-command="0" class="paddingy-command" style="margin-right:4px">0</button>
|
|
@@ -47071,7 +47075,7 @@ class ButtonEditor {
|
|
|
47071
47075
|
<div class="flex flex-row" style="margin:15px 0 0">
|
|
47072
47076
|
<div class="flex flex-col" style="margin-right: 20px;">
|
|
47073
47077
|
<div>
|
|
47074
|
-
<
|
|
47078
|
+
<span>${util.out('Padding Top')}</span>:
|
|
47075
47079
|
</div>
|
|
47076
47080
|
<div class="flex flex-row" style="margin-top:5px">
|
|
47077
47081
|
<button title="0" data-command="0" class="paddingtop-command" style="margin-right:4px">0</button>
|
|
@@ -47085,7 +47089,7 @@ class ButtonEditor {
|
|
|
47085
47089
|
|
|
47086
47090
|
<div class="flex flex-col">
|
|
47087
47091
|
<div>
|
|
47088
|
-
<
|
|
47092
|
+
<span>${util.out('Padding Bottom')}</span>:
|
|
47089
47093
|
</div>
|
|
47090
47094
|
<div class="flex flex-row" style="margin-top:5px">
|
|
47091
47095
|
<button title="0" data-command="0" class="paddingbottom-command" style="margin-right:4px">0</button>
|
|
@@ -47100,7 +47104,7 @@ class ButtonEditor {
|
|
|
47100
47104
|
|
|
47101
47105
|
<div class="flex flex-col" style="margin:15px 0 0">
|
|
47102
47106
|
<div>
|
|
47103
|
-
<
|
|
47107
|
+
<span>${util.out('Border Radius')}</span>:
|
|
47104
47108
|
</div>
|
|
47105
47109
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47106
47110
|
<button title="${util.out('None')}" data-command="none" class="border-radius-command" style="margin-right:4px">${util.out('None')}</button>
|
|
@@ -47118,7 +47122,7 @@ class ButtonEditor {
|
|
|
47118
47122
|
<div class="flex flex-row" style="margin:15px 0 0">
|
|
47119
47123
|
<div class="flex flex-col" style="margin-right: 20px;">
|
|
47120
47124
|
<div>
|
|
47121
|
-
<
|
|
47125
|
+
<span>${util.out('Margin Left')}</span>:
|
|
47122
47126
|
</div>
|
|
47123
47127
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47124
47128
|
<button title="0" data-command="0" class="ml-command" style="margin-right:4px">0</button>
|
|
@@ -47132,7 +47136,7 @@ class ButtonEditor {
|
|
|
47132
47136
|
|
|
47133
47137
|
<div class="flex flex-col">
|
|
47134
47138
|
<div>
|
|
47135
|
-
<
|
|
47139
|
+
<span>${util.out('Margin Right')}</span>:
|
|
47136
47140
|
</div>
|
|
47137
47141
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47138
47142
|
<button title="0" data-command="0" class="mr-command" style="margin-right:4px">0</button>
|
|
@@ -47148,7 +47152,7 @@ class ButtonEditor {
|
|
|
47148
47152
|
<div class="flex flex-row" style="margin:15px 0 0">
|
|
47149
47153
|
<div class="flex flex-col" style="margin-right: 20px;">
|
|
47150
47154
|
<div>
|
|
47151
|
-
<
|
|
47155
|
+
<span>${util.out('Margin Top')}</span>:
|
|
47152
47156
|
</div>
|
|
47153
47157
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47154
47158
|
<button title="0" data-command="0" class="mt-command" style="margin-right:4px">0</button>
|
|
@@ -47162,7 +47166,7 @@ class ButtonEditor {
|
|
|
47162
47166
|
|
|
47163
47167
|
<div class="flex flex-col">
|
|
47164
47168
|
<div>
|
|
47165
|
-
<
|
|
47169
|
+
<span>${util.out('Margin Bottom')}</span>:
|
|
47166
47170
|
</div>
|
|
47167
47171
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47168
47172
|
<button title="0" data-command="0" class="mb-command" style="margin-right:4px">0</button>
|
|
@@ -47182,7 +47186,7 @@ class ButtonEditor {
|
|
|
47182
47186
|
<div class="flex flex-row">
|
|
47183
47187
|
<div class="flex-col" style="margin-right: 40px;">
|
|
47184
47188
|
<div>
|
|
47185
|
-
<
|
|
47189
|
+
<span>${util.out('Background Color')}</span>:
|
|
47186
47190
|
</div>
|
|
47187
47191
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47188
47192
|
<button title="${util.out('Background Color')}" class="bg-color-hover-command" style="width:45px;height:40px;border:rgb(0 0 0 / 6%) 1px solid;margin-right:4px"></button>
|
|
@@ -47191,7 +47195,7 @@ class ButtonEditor {
|
|
|
47191
47195
|
|
|
47192
47196
|
<div class="flex-col">
|
|
47193
47197
|
<div>
|
|
47194
|
-
<
|
|
47198
|
+
<span>${util.out('Text Color')}</span>:
|
|
47195
47199
|
</div>
|
|
47196
47200
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47197
47201
|
<button title="${util.out('Dark')}" data-command="dark" class="text-color-hover-command" style="margin-right:4px">${util.out('Dark')}</button>
|
|
@@ -47203,7 +47207,7 @@ class ButtonEditor {
|
|
|
47203
47207
|
|
|
47204
47208
|
<div class="flex flex-col" style="margin:15px 0 0">
|
|
47205
47209
|
<div>
|
|
47206
|
-
<
|
|
47210
|
+
<span>${util.out('Border Color')}</span>:
|
|
47207
47211
|
</div>
|
|
47208
47212
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47209
47213
|
<button title="${util.out('Transparent')}" data-command="transparent" class="border-color-hover-command" style="margin-right:4px">${util.out('Transparent')}</button>
|
|
@@ -47217,7 +47221,7 @@ class ButtonEditor {
|
|
|
47217
47221
|
<div class="flex flex-row">
|
|
47218
47222
|
<div class="flex flex-col" style="width:250px;margin-right:40px;">
|
|
47219
47223
|
<div>
|
|
47220
|
-
<
|
|
47224
|
+
<span>${util.out('Font Size')}</span>:
|
|
47221
47225
|
</div>
|
|
47222
47226
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47223
47227
|
<button title="12" data-command="12" class="font-size-command" style="margin-right:4px">12</button>
|
|
@@ -47237,7 +47241,7 @@ class ButtonEditor {
|
|
|
47237
47241
|
|
|
47238
47242
|
<div class="flex flex-col">
|
|
47239
47243
|
<div>
|
|
47240
|
-
<
|
|
47244
|
+
<span>${util.out('Upper/Lower')}</span>:
|
|
47241
47245
|
</div>
|
|
47242
47246
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47243
47247
|
<button title="${util.out('Bold')}" class="textbold-command" style="width:38px;font-family:serif;font-size:14px;text-transform:initial;margin-right:4px">B</button>
|
|
@@ -47250,7 +47254,7 @@ class ButtonEditor {
|
|
|
47250
47254
|
<div class="flex flex-row" style="margin:15px 0 0">
|
|
47251
47255
|
<div class="flex flex-col">
|
|
47252
47256
|
<div>
|
|
47253
|
-
<
|
|
47257
|
+
<span>${util.out('Letter Spacing')}</span>:
|
|
47254
47258
|
</div>
|
|
47255
47259
|
<div class="flex flex-row flex-wrap" style="margin-top:5px">
|
|
47256
47260
|
<button title="0" data-command="normal" class="letter-spacing-command" style="margin-right:4px">0</button>
|
|
@@ -50916,10 +50920,12 @@ class Table {
|
|
|
50916
50920
|
const tableModal = this.tableModal;
|
|
50917
50921
|
if (tableModal.classList.contains('active') && this.builder.activeTable) {
|
|
50918
50922
|
let activeTd = this.builder.activeTd;
|
|
50919
|
-
|
|
50920
|
-
|
|
50921
|
-
|
|
50922
|
-
|
|
50923
|
+
if (activeTd) {
|
|
50924
|
+
tableModal.querySelector('.input-table-bgcolor').style.backgroundColor = activeTd.style.backgroundColor;
|
|
50925
|
+
tableModal.querySelector('.input-table-textcolor').style.backgroundColor = activeTd.style.color;
|
|
50926
|
+
tableModal.querySelector('.input-table-bordercolor').style.backgroundColor = activeTd.style.borderColor;
|
|
50927
|
+
tableModal.querySelector('#selCellBorderWidth').value = parseInt(activeTd.style.borderWidth);
|
|
50928
|
+
}
|
|
50923
50929
|
} else {
|
|
50924
50930
|
tableModal.querySelector('.input-table-bgcolor').style.backgroundColor = '';
|
|
50925
50931
|
tableModal.querySelector('.input-table-textcolor').style.backgroundColor = '';
|
|
@@ -70832,7 +70838,11 @@ class Resizeable {
|
|
|
70832
70838
|
pane.addEventListener('mousedown', onMouseDown);
|
|
70833
70839
|
pane.ownerDocument.addEventListener('mousemove', onMove);
|
|
70834
70840
|
pane.ownerDocument.addEventListener('mouseup', onUp);
|
|
70835
|
-
|
|
70841
|
+
|
|
70842
|
+
// pane.addEventListener('touchstart', onTouchDown);
|
|
70843
|
+
pane.addEventListener('touchstart', onTouchDown, {
|
|
70844
|
+
passive: true
|
|
70845
|
+
});
|
|
70836
70846
|
pane.ownerDocument.addEventListener('touchmove', onTouchMove);
|
|
70837
70847
|
pane.ownerDocument.addEventListener('touchend', onTouchEnd);
|
|
70838
70848
|
const resizing = () => {
|
|
@@ -76938,7 +76948,15 @@ class ContentBuilder {
|
|
|
76938
76948
|
let selectedText = selection.toString().trim();
|
|
76939
76949
|
if (selectedText.length > 0) {
|
|
76940
76950
|
let elm = this.dom.getElm();
|
|
76941
|
-
if (
|
|
76951
|
+
if (this.dom.getStyle(elm, 'display') === 'inline') {
|
|
76952
|
+
elm = elm.closest('li,p,h1,h2,h3,h4,h5,h6,div,pre,td,th,li');
|
|
76953
|
+
if (elm) {
|
|
76954
|
+
if (!this.dom.hasClass(elm.parentNode.parentNode, 'is-builder')) {
|
|
76955
|
+
this.dom.selectElementContents(elm);
|
|
76956
|
+
}
|
|
76957
|
+
}
|
|
76958
|
+
} else {
|
|
76959
|
+
// block
|
|
76942
76960
|
this.dom.selectElementContents(elm);
|
|
76943
76961
|
}
|
|
76944
76962
|
}
|
|
@@ -78442,48 +78460,49 @@ class ContentBuilder {
|
|
|
78442
78460
|
}, 600);
|
|
78443
78461
|
return;
|
|
78444
78462
|
}
|
|
78463
|
+
if (!this.controlPanel) {
|
|
78464
|
+
// Font Family
|
|
78465
|
+
let iframeRte = this.rte.rteFontFamilyOptions.querySelector('iframe');
|
|
78466
|
+
let doc1 = iframeRte.contentWindow.document;
|
|
78445
78467
|
|
|
78446
|
-
|
|
78447
|
-
|
|
78448
|
-
|
|
78449
|
-
|
|
78450
|
-
|
|
78451
|
-
let iframeIcons = this.rte.rteIconOptions.querySelector('iframe');
|
|
78452
|
-
let doc3 = iframeIcons.contentWindow.document;
|
|
78453
|
-
if (doc1.body.innerHTML === '') {
|
|
78454
|
-
doc1.open();
|
|
78455
|
-
if (!this.opts.emailMode) {
|
|
78456
|
-
doc1.write(util.getFontFamilyHTML());
|
|
78457
|
-
} else {
|
|
78458
|
-
doc1.write(util.getFontFamilyEmail());
|
|
78459
|
-
}
|
|
78460
|
-
doc1.close();
|
|
78461
|
-
} else {
|
|
78462
|
-
this.util.refreshFontFamilyStyle1();
|
|
78463
|
-
}
|
|
78464
|
-
const fontModal = this.builderStuff.querySelector('.is-modal.pickfontfamily');
|
|
78465
|
-
if (fontModal) {
|
|
78466
|
-
let iframePanel = fontModal.querySelector('iframe');
|
|
78467
|
-
let doc2 = iframePanel.contentWindow.document;
|
|
78468
|
-
if (doc2.body.innerHTML === '') {
|
|
78469
|
-
doc2.open();
|
|
78468
|
+
// Icons
|
|
78469
|
+
let iframeIcons = this.rte.rteIconOptions.querySelector('iframe');
|
|
78470
|
+
let doc3 = iframeIcons.contentWindow.document;
|
|
78471
|
+
if (doc1.body.innerHTML === '') {
|
|
78472
|
+
doc1.open();
|
|
78470
78473
|
if (!this.opts.emailMode) {
|
|
78471
|
-
|
|
78474
|
+
doc1.write(util.getFontFamilyHTML());
|
|
78475
|
+
} else {
|
|
78476
|
+
doc1.write(util.getFontFamilyEmail());
|
|
78477
|
+
}
|
|
78478
|
+
doc1.close();
|
|
78479
|
+
} else {
|
|
78480
|
+
this.util.refreshFontFamilyStyle1();
|
|
78481
|
+
}
|
|
78482
|
+
const fontModal = this.builderStuff.querySelector('.is-modal.pickfontfamily');
|
|
78483
|
+
if (fontModal) {
|
|
78484
|
+
let iframePanel = fontModal.querySelector('iframe');
|
|
78485
|
+
let doc2 = iframePanel.contentWindow.document;
|
|
78486
|
+
if (doc2.body.innerHTML === '') {
|
|
78487
|
+
doc2.open();
|
|
78488
|
+
if (!this.opts.emailMode) {
|
|
78489
|
+
doc2.write(util.getFontFamilyHTML(true));
|
|
78490
|
+
} else {
|
|
78491
|
+
doc2.write(util.getFontFamilyEmail(true));
|
|
78492
|
+
}
|
|
78493
|
+
doc2.close();
|
|
78472
78494
|
} else {
|
|
78473
|
-
|
|
78495
|
+
this.util.refreshFontFamilyStyle2();
|
|
78474
78496
|
}
|
|
78475
|
-
|
|
78497
|
+
}
|
|
78498
|
+
if (doc3.body.innerHTML === '') {
|
|
78499
|
+
doc3.open();
|
|
78500
|
+
doc3.write(this.rte.getIconsHTML());
|
|
78501
|
+
doc3.close();
|
|
78476
78502
|
} else {
|
|
78477
|
-
this.
|
|
78503
|
+
this.rte.refreshIconsStyle();
|
|
78478
78504
|
}
|
|
78479
78505
|
}
|
|
78480
|
-
if (doc3.body.innerHTML === '') {
|
|
78481
|
-
doc3.open();
|
|
78482
|
-
doc3.write(this.rte.getIconsHTML());
|
|
78483
|
-
doc3.close();
|
|
78484
|
-
} else {
|
|
78485
|
-
this.rte.refreshIconsStyle();
|
|
78486
|
-
}
|
|
78487
78506
|
|
|
78488
78507
|
// Snippets (Modal)
|
|
78489
78508
|
let modalSnippets = this.builderStuff.querySelector('.snippets');
|
|
@@ -78933,27 +78952,24 @@ class ContentBuilder {
|
|
|
78933
78952
|
span.setAttribute('data-keep', '');
|
|
78934
78953
|
});
|
|
78935
78954
|
|
|
78936
|
-
//
|
|
78937
|
-
|
|
78938
|
-
|
|
78939
|
-
|
|
78940
|
-
|
|
78941
|
-
|
|
78942
|
-
|
|
78943
|
-
|
|
78944
|
-
|
|
78945
|
-
|
|
78946
|
-
|
|
78947
|
-
|
|
78948
|
-
|
|
78949
|
-
|
|
78950
|
-
|
|
78951
|
-
|
|
78952
|
-
|
|
78953
|
-
|
|
78954
|
-
// });
|
|
78955
|
-
// this.autoclean=true;
|
|
78956
|
-
|
|
78955
|
+
// Cleanup all elements with unwanted style
|
|
78956
|
+
let elms = col.querySelectorAll('[style]');
|
|
78957
|
+
elms.forEach(elm => {
|
|
78958
|
+
let attr = elm.getAttribute('style');
|
|
78959
|
+
if (attr.includes('font-size')) {
|
|
78960
|
+
elm.setAttribute('data-keep-font-size', '');
|
|
78961
|
+
}
|
|
78962
|
+
if (attr.includes('background-color')) {
|
|
78963
|
+
elm.setAttribute('data-keep-background-color', '');
|
|
78964
|
+
}
|
|
78965
|
+
if (attr.includes('background')) {
|
|
78966
|
+
elm.setAttribute('data-keep-background', '');
|
|
78967
|
+
}
|
|
78968
|
+
if (attr.includes('line-height')) {
|
|
78969
|
+
elm.setAttribute('data-keep-line-height', '');
|
|
78970
|
+
}
|
|
78971
|
+
});
|
|
78972
|
+
this.autoclean = true;
|
|
78957
78973
|
if ((e.ctrlKey || e.metaKey) && e.which === 86) ;
|
|
78958
78974
|
if (this.opts.elementSelection && !this.emailMode) {
|
|
78959
78975
|
if ((e.ctrlKey || e.metaKey) && e.which === 65) {
|
|
@@ -79298,61 +79314,42 @@ class ContentBuilder {
|
|
|
79298
79314
|
}
|
|
79299
79315
|
});
|
|
79300
79316
|
|
|
79301
|
-
//
|
|
79302
|
-
|
|
79303
|
-
|
|
79304
|
-
|
|
79305
|
-
|
|
79306
|
-
|
|
79307
|
-
|
|
79308
|
-
|
|
79309
|
-
|
|
79310
|
-
|
|
79311
|
-
|
|
79312
|
-
|
|
79313
|
-
|
|
79314
|
-
|
|
79315
|
-
|
|
79316
|
-
|
|
79317
|
-
|
|
79318
|
-
|
|
79319
|
-
|
|
79320
|
-
|
|
79321
|
-
|
|
79322
|
-
|
|
79323
|
-
|
|
79324
|
-
|
|
79325
|
-
|
|
79326
|
-
|
|
79327
|
-
|
|
79328
|
-
|
|
79329
|
-
|
|
79330
|
-
|
|
79331
|
-
|
|
79332
|
-
|
|
79333
|
-
|
|
79334
|
-
|
|
79335
|
-
|
|
79336
|
-
|
|
79337
|
-
// elms = col.querySelectorAll('[data-keep-font-size]');
|
|
79338
|
-
// Array.prototype.forEach.call(elms, (elm) => {
|
|
79339
|
-
// elm.removeAttribute('data-keep-font-size');
|
|
79340
|
-
// });
|
|
79341
|
-
// elms = col.querySelectorAll('[data-keep-background-color]');
|
|
79342
|
-
// Array.prototype.forEach.call(elms, (elm) => {
|
|
79343
|
-
// elm.removeAttribute('data-keep-background-color');
|
|
79344
|
-
// });
|
|
79345
|
-
// elms = col.querySelectorAll('[data-keep-background]');
|
|
79346
|
-
// Array.prototype.forEach.call(elms, (elm) => {
|
|
79347
|
-
// elm.removeAttribute('data-keep-background');
|
|
79348
|
-
// });
|
|
79349
|
-
// elms = col.querySelectorAll('[data-keep-line-height]');
|
|
79350
|
-
// Array.prototype.forEach.call(elms, (elm) => {
|
|
79351
|
-
// elm.removeAttribute('data-keep-line-height');
|
|
79352
|
-
// });
|
|
79353
|
-
// }
|
|
79354
|
-
// this.autoclean =false;
|
|
79355
|
-
|
|
79317
|
+
// Cleanup all elements with unwanted style
|
|
79318
|
+
if (this.autoclean) {
|
|
79319
|
+
let elms = col.querySelectorAll('[style]');
|
|
79320
|
+
elms.forEach(elm => {
|
|
79321
|
+
let attr = elm.getAttribute('style');
|
|
79322
|
+
if (attr.includes('font-size')) {
|
|
79323
|
+
let attrkeep = elm.hasAttribute('data-keep-font-size');
|
|
79324
|
+
if (!attrkeep) {
|
|
79325
|
+
elm.style.fontSize = '';
|
|
79326
|
+
}
|
|
79327
|
+
}
|
|
79328
|
+
if (attr.includes('background-color')) {
|
|
79329
|
+
let attrkeep = elm.hasAttribute('data-keep-background-color');
|
|
79330
|
+
if (!attrkeep) {
|
|
79331
|
+
elm.style.backgroundColor = '';
|
|
79332
|
+
}
|
|
79333
|
+
}
|
|
79334
|
+
if (attr.includes('background')) {
|
|
79335
|
+
let attrkeep = elm.hasAttribute('data-keep-background');
|
|
79336
|
+
if (!attrkeep) {
|
|
79337
|
+
elm.style.background = '';
|
|
79338
|
+
}
|
|
79339
|
+
}
|
|
79340
|
+
if (attr.includes('line-height')) {
|
|
79341
|
+
let attrkeep = elm.hasAttribute('data-keep-line-height');
|
|
79342
|
+
if (!attrkeep) {
|
|
79343
|
+
elm.style.lineHeight = '';
|
|
79344
|
+
}
|
|
79345
|
+
}
|
|
79346
|
+
});
|
|
79347
|
+
col.querySelectorAll('[data-keep-font-size]').forEach(elm => elm.removeAttribute('data-keep-font-size'));
|
|
79348
|
+
col.querySelectorAll('[data-keep-background-color]').forEach(elm => elm.removeAttribute('data-keep-background-color'));
|
|
79349
|
+
col.querySelectorAll('[data-keep-background]').forEach(elm => elm.removeAttribute('data-keep-background'));
|
|
79350
|
+
col.querySelectorAll('[data-keep-line-height]').forEach(elm => elm.removeAttribute('data-keep-line-height'));
|
|
79351
|
+
}
|
|
79352
|
+
this.autoclean = false;
|
|
79356
79353
|
var el;
|
|
79357
79354
|
// var curr;
|
|
79358
79355
|
try {
|
|
@@ -79616,25 +79613,31 @@ class ContentBuilder {
|
|
|
79616
79613
|
<span class="size-24">Heading</span>
|
|
79617
79614
|
So, blocks checking below is made to fix it.
|
|
79618
79615
|
*/
|
|
79619
|
-
|
|
79620
|
-
|
|
79621
|
-
if (
|
|
79622
|
-
|
|
79623
|
-
|
|
79624
|
-
|
|
79625
|
-
|
|
79626
|
-
|
|
79627
|
-
|
|
79628
|
-
|
|
79629
|
-
|
|
79630
|
-
|
|
79631
|
-
|
|
79632
|
-
|
|
79633
|
-
|
|
79634
|
-
|
|
79635
|
-
|
|
79636
|
-
|
|
79616
|
+
try {
|
|
79617
|
+
let blockSelection = false;
|
|
79618
|
+
if (selection.toString().trim() !== '') {
|
|
79619
|
+
if (blocks.length === 1) {
|
|
79620
|
+
if (blocks[0].innerText.trim() === selection.toString().trim()) {
|
|
79621
|
+
let range = document.createRange();
|
|
79622
|
+
range.selectNodeContents(blocks[0]);
|
|
79623
|
+
selection.removeAllRanges();
|
|
79624
|
+
selection.addRange(range);
|
|
79625
|
+
blockSelection = true;
|
|
79626
|
+
}
|
|
79627
|
+
}
|
|
79628
|
+
if (!blockSelection) {
|
|
79629
|
+
const container = this.dom.getElm();
|
|
79630
|
+
const sameSelection = container && container.innerText === selection.toString().trim();
|
|
79631
|
+
if (sameSelection || selection.toString().trim() === '') {
|
|
79632
|
+
let range = document.createRange();
|
|
79633
|
+
range.selectNodeContents(container);
|
|
79634
|
+
selection.removeAllRanges();
|
|
79635
|
+
selection.addRange(range);
|
|
79636
|
+
}
|
|
79637
|
+
}
|
|
79637
79638
|
}
|
|
79639
|
+
} catch (e) {
|
|
79640
|
+
// Do Nothing
|
|
79638
79641
|
}
|
|
79639
79642
|
this.doc.execCommand('insertHTML', false, sPastedText);
|
|
79640
79643
|
if (this.activeCol) {
|