@syncfusion/ej2-richtexteditor 19.3.57 → 19.4.48
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/.github/PULL_REQUEST_TEMPLATE/Bug.md +41 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +27 -0
- package/CHANGELOG.md +24 -12
- package/README.md +1 -1
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +150 -62
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +149 -61
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/editor-manager/plugin/lists.js +4 -2
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +54 -20
- package/src/editor-manager/plugin/selection-commands.js +10 -5
- package/src/editor-manager/plugin/undo.js +10 -1
- package/src/rich-text-editor/actions/color-picker.d.ts +1 -0
- package/src/rich-text-editor/actions/color-picker.js +2 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +0 -10
- package/src/rich-text-editor/actions/enter-key.js +55 -11
- package/src/rich-text-editor/actions/html-editor.js +3 -2
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- package/src/rich-text-editor/base/interface.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -1
- package/src/rich-text-editor/base/rich-text-editor.js +2 -2
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +5 -4
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -2
- package/styles/rich-text-editor/_fluent-definition.scss +168 -0
- package/styles/rich-text-editor/_layout.scss +1 -1
- package/styles/rich-text-editor/icons/_fluent.scss +303 -0
|
@@ -2965,7 +2965,7 @@ class ToolbarRenderer {
|
|
|
2965
2965
|
* @hidden
|
|
2966
2966
|
* @deprecated
|
|
2967
2967
|
*/
|
|
2968
|
-
renderColorPickerDropDown(args, item, colorPicker) {
|
|
2968
|
+
renderColorPickerDropDown(args, item, colorPicker, defaultColor) {
|
|
2969
2969
|
// eslint-disable-next-line
|
|
2970
2970
|
const proxy = this;
|
|
2971
2971
|
let css = CLS_RTE_ELEMENTS + ' ' + CLS_TB_BTN + ((this.parent.inlineMode) ? (' ' + CLS_INLINE_DROPDOWN) : '');
|
|
@@ -2973,8 +2973,9 @@ class ToolbarRenderer {
|
|
|
2973
2973
|
const content = proxy.parent.createElement('span', { className: CLS_COLOR_CONTENT });
|
|
2974
2974
|
const inlineEle = proxy.parent.createElement('span', { className: args.cssClass });
|
|
2975
2975
|
let range;
|
|
2976
|
+
let initialBackgroundColor = (isNullOrUndefined(defaultColor)) ? proxy.parent.backgroundColor.default : defaultColor;
|
|
2976
2977
|
inlineEle.style.borderBottomColor = (item === 'backgroundcolor') ?
|
|
2977
|
-
|
|
2978
|
+
initialBackgroundColor : proxy.parent.fontColor.default;
|
|
2978
2979
|
content.appendChild(inlineEle);
|
|
2979
2980
|
const dropDown = new DropDownButton({
|
|
2980
2981
|
target: colorPicker.element.parentElement, cssClass: css,
|
|
@@ -3592,11 +3593,6 @@ class DropDownButtons {
|
|
|
3592
3593
|
for (const prop of Object.keys(newProp)) {
|
|
3593
3594
|
switch (prop) {
|
|
3594
3595
|
case 'fontFamily':
|
|
3595
|
-
if (this.parent.inlineMode.enable) {
|
|
3596
|
-
if (!isNullOrUndefined(this.parent.fontFamily.default)) {
|
|
3597
|
-
this.getEditNode().style.fontFamily = this.parent.fontFamily.default;
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
3596
|
if (this.fontNameDropDown) {
|
|
3601
3597
|
for (const fontFamily$$1 of Object.keys(newProp.fontFamily)) {
|
|
3602
3598
|
switch (fontFamily$$1) {
|
|
@@ -3627,11 +3623,6 @@ class DropDownButtons {
|
|
|
3627
3623
|
}
|
|
3628
3624
|
break;
|
|
3629
3625
|
case 'fontSize':
|
|
3630
|
-
if (this.parent.inlineMode) {
|
|
3631
|
-
if (!isNullOrUndefined(this.parent.fontSize.default)) {
|
|
3632
|
-
this.getEditNode().style.fontSize = this.parent.fontSize.default;
|
|
3633
|
-
}
|
|
3634
|
-
}
|
|
3635
3626
|
if (this.fontSizeDropDown) {
|
|
3636
3627
|
for (const fontSize$$1 of Object.keys(newProp.fontSize)) {
|
|
3637
3628
|
switch (fontSize$$1) {
|
|
@@ -4997,7 +4988,7 @@ class ColorPickerInput {
|
|
|
4997
4988
|
target: (targetID)
|
|
4998
4989
|
};
|
|
4999
4990
|
this.backgroundColorPicker = this.toolbarRenderer.renderColorPicker(options, 'backgroundcolor');
|
|
5000
|
-
this.backgroundColorDropDown = this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', this.backgroundColorPicker);
|
|
4991
|
+
this.backgroundColorDropDown = this.toolbarRenderer.renderColorPickerDropDown(options, 'backgroundcolor', this.backgroundColorPicker, this.defaultColorPicker);
|
|
5001
4992
|
break;
|
|
5002
4993
|
}
|
|
5003
4994
|
}
|
|
@@ -5032,6 +5023,7 @@ class ColorPickerInput {
|
|
|
5032
5023
|
if (this.backgroundColorDropDown && !this.backgroundColorDropDown.isDestroyed) {
|
|
5033
5024
|
const innerEle = this.backgroundColorDropDown.element.querySelector('.e-rte-color-content');
|
|
5034
5025
|
if (innerEle) {
|
|
5026
|
+
this.defaultColorPicker = innerEle.children[0].style.borderBottomColor;
|
|
5035
5027
|
detach(innerEle);
|
|
5036
5028
|
}
|
|
5037
5029
|
this.backgroundColorDropDown.destroy();
|
|
@@ -10476,8 +10468,9 @@ class Lists {
|
|
|
10476
10468
|
testCurrentList(range) {
|
|
10477
10469
|
const olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
10478
10470
|
if (!isNullOrUndefined(range.startContainer.textContent.slice(0, range.startOffset))) {
|
|
10471
|
+
const currentContent = range.startContainer.textContent.replace(/\u200B/g, '').slice(0, range.startOffset).trim();
|
|
10479
10472
|
for (let i = 0; i < olListStartRegex.length; i++) {
|
|
10480
|
-
if (olListStartRegex[i].test(
|
|
10473
|
+
if (olListStartRegex[i].test(currentContent) && currentContent.length === 2) {
|
|
10481
10474
|
return true;
|
|
10482
10475
|
}
|
|
10483
10476
|
}
|
|
@@ -10519,7 +10512,8 @@ class Lists {
|
|
|
10519
10512
|
range.startContainer.parentElement.closest('LI');
|
|
10520
10513
|
const endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
|
|
10521
10514
|
range.endContainer.parentElement.closest('LI');
|
|
10522
|
-
if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
10515
|
+
if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
|
|
10516
|
+
startNode.textContent.trim() === '' && startNode.querySelectorAll('IMG').length === 0) {
|
|
10523
10517
|
if (startNode.textContent.charCodeAt(0) === 65279) {
|
|
10524
10518
|
startNode.textContent = '';
|
|
10525
10519
|
}
|
|
@@ -14495,6 +14489,9 @@ class SelectionCommands {
|
|
|
14495
14489
|
}
|
|
14496
14490
|
static removeFormat(nodes, index, formatNode, isCursor, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
|
|
14497
14491
|
let splitNode = null;
|
|
14492
|
+
let startText = range.startContainer.nodeName === '#text' ?
|
|
14493
|
+
range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
|
|
14494
|
+
range.startContainer.textContent;
|
|
14498
14495
|
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
14499
14496
|
&& range.endOffset === range.startContainer.length)) {
|
|
14500
14497
|
const nodeIndex = [];
|
|
@@ -14594,11 +14591,13 @@ class SelectionCommands {
|
|
|
14594
14591
|
for (let num = 0; num < child.length; num++) {
|
|
14595
14592
|
if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
|
|
14596
14593
|
child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
14597
|
-
if (num ===
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14594
|
+
if (child[num].textContent === startText) {
|
|
14595
|
+
if (num === 0) {
|
|
14596
|
+
range.setStartBefore(child[num]);
|
|
14597
|
+
}
|
|
14598
|
+
else if (num === child.length - 1) {
|
|
14599
|
+
range.setEndAfter(child[num]);
|
|
14600
|
+
}
|
|
14602
14601
|
}
|
|
14603
14602
|
}
|
|
14604
14603
|
}
|
|
@@ -15270,7 +15269,16 @@ class UndoRedoManager {
|
|
|
15270
15269
|
* @deprecated
|
|
15271
15270
|
*/
|
|
15272
15271
|
saveData(e) {
|
|
15273
|
-
|
|
15272
|
+
let range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
15273
|
+
let currentContainer = range.startContainer;
|
|
15274
|
+
for (let i = currentContainer.childNodes.length - 1; i >= 0; i--) {
|
|
15275
|
+
if (!isNullOrUndefined(currentContainer.childNodes[i]) && currentContainer.childNodes[i].nodeName === '#text' &&
|
|
15276
|
+
currentContainer.childNodes[i].textContent.length === 0 && currentContainer.childNodes[i].nodeName !== 'IMG' &&
|
|
15277
|
+
currentContainer.childNodes[i].nodeName !== 'BR' && currentContainer.childNodes[i].nodeName && 'HR') {
|
|
15278
|
+
detach(currentContainer.childNodes[i]);
|
|
15279
|
+
}
|
|
15280
|
+
}
|
|
15281
|
+
range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
15274
15282
|
const save = new NodeSelection().save(range, this.parent.currentDocument);
|
|
15275
15283
|
const htmlText = this.parent.editableElement.innerHTML;
|
|
15276
15284
|
const changEle = { text: htmlText, range: save };
|
|
@@ -15420,7 +15428,7 @@ class MsWordPaste {
|
|
|
15420
15428
|
this.parent.observer.on(MS_WORD_CLEANUP_PLUGIN, this.wordCleanup, this);
|
|
15421
15429
|
}
|
|
15422
15430
|
wordCleanup(e) {
|
|
15423
|
-
const wordPasteStyleConfig = e.allowedStylePropertiesArray;
|
|
15431
|
+
const wordPasteStyleConfig = !isNullOrUndefined(e.allowedStylePropertiesArray) ? e.allowedStylePropertiesArray : [];
|
|
15424
15432
|
let listNodes = [];
|
|
15425
15433
|
let tempHTMLContent = e.args.clipboardData.getData('text/HTML');
|
|
15426
15434
|
const rtfData = e.args.clipboardData.getData('text/rtf');
|
|
@@ -15844,8 +15852,10 @@ class MsWordPaste {
|
|
|
15844
15852
|
this.listContents = [];
|
|
15845
15853
|
this.getListContent(listNodes[i]);
|
|
15846
15854
|
let type;
|
|
15855
|
+
let listStyleType;
|
|
15847
15856
|
if (!isNullOrUndefined(this.listContents[0])) {
|
|
15848
15857
|
type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
|
|
15858
|
+
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
15849
15859
|
const tempNode = [];
|
|
15850
15860
|
for (let j = 1; j < this.listContents.length; j++) {
|
|
15851
15861
|
tempNode.push(this.listContents[j]);
|
|
@@ -15862,7 +15872,7 @@ class MsWordPaste {
|
|
|
15862
15872
|
}
|
|
15863
15873
|
}
|
|
15864
15874
|
collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
15865
|
-
listStyle: currentListStyle });
|
|
15875
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType });
|
|
15866
15876
|
}
|
|
15867
15877
|
}
|
|
15868
15878
|
stNode = listNodes.shift();
|
|
@@ -15886,6 +15896,45 @@ class MsWordPaste {
|
|
|
15886
15896
|
}
|
|
15887
15897
|
}
|
|
15888
15898
|
}
|
|
15899
|
+
getlistStyleType(listContent, type) {
|
|
15900
|
+
let currentListClass;
|
|
15901
|
+
if (type === 'ol') {
|
|
15902
|
+
switch (listContent.split('.')[0]) {
|
|
15903
|
+
case "A":
|
|
15904
|
+
currentListClass = "upper-alpha";
|
|
15905
|
+
break;
|
|
15906
|
+
case "a":
|
|
15907
|
+
currentListClass = "lower-alpha";
|
|
15908
|
+
break;
|
|
15909
|
+
case "I":
|
|
15910
|
+
currentListClass = "upper-roman";
|
|
15911
|
+
break;
|
|
15912
|
+
case "i":
|
|
15913
|
+
currentListClass = "lower-roman";
|
|
15914
|
+
break;
|
|
15915
|
+
case "α":
|
|
15916
|
+
currentListClass = "lower-greek";
|
|
15917
|
+
break;
|
|
15918
|
+
default:
|
|
15919
|
+
currentListClass = "decimal";
|
|
15920
|
+
break;
|
|
15921
|
+
}
|
|
15922
|
+
}
|
|
15923
|
+
else {
|
|
15924
|
+
switch (listContent.split('.')[0]) {
|
|
15925
|
+
case "o":
|
|
15926
|
+
currentListClass = "circle";
|
|
15927
|
+
break;
|
|
15928
|
+
case "§":
|
|
15929
|
+
currentListClass = "square";
|
|
15930
|
+
break;
|
|
15931
|
+
default:
|
|
15932
|
+
currentListClass = "disc";
|
|
15933
|
+
break;
|
|
15934
|
+
}
|
|
15935
|
+
}
|
|
15936
|
+
return currentListClass;
|
|
15937
|
+
}
|
|
15889
15938
|
makeConversion(collection) {
|
|
15890
15939
|
const root = createElement('div');
|
|
15891
15940
|
let temp;
|
|
@@ -15902,7 +15951,7 @@ class MsWordPaste {
|
|
|
15902
15951
|
prevList.appendChild(pElement);
|
|
15903
15952
|
temp.appendChild(prevList);
|
|
15904
15953
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15905
|
-
temp.style.
|
|
15954
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15906
15955
|
}
|
|
15907
15956
|
else if (collection[index].nestedLevel === pLevel) {
|
|
15908
15957
|
if (prevList.parentElement.tagName.toLowerCase() === collection[index].listType) {
|
|
@@ -15911,6 +15960,7 @@ class MsWordPaste {
|
|
|
15911
15960
|
}
|
|
15912
15961
|
else {
|
|
15913
15962
|
temp = createElement(collection[index].listType);
|
|
15963
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15914
15964
|
prevList.parentElement.parentElement.appendChild(temp);
|
|
15915
15965
|
prevList = createElement('li');
|
|
15916
15966
|
prevList.appendChild(pElement);
|
|
@@ -15922,14 +15972,15 @@ class MsWordPaste {
|
|
|
15922
15972
|
if (!isNullOrUndefined(prevList)) {
|
|
15923
15973
|
for (let j = 0; j < collection[index].nestedLevel - pLevel; j++) {
|
|
15924
15974
|
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
15925
|
-
prevList = createElement('li'
|
|
15975
|
+
prevList = createElement('li');
|
|
15976
|
+
if (j != collection[index].nestedLevel - pLevel - 1 && collection[index].nestedLevel - pLevel > 1) {
|
|
15977
|
+
prevList.style.listStyleType = "none";
|
|
15978
|
+
}
|
|
15926
15979
|
temp.appendChild(prevList);
|
|
15927
15980
|
}
|
|
15928
15981
|
prevList.appendChild(pElement);
|
|
15929
15982
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15930
|
-
temp.style.
|
|
15931
|
-
temp.childNodes[0].style.listStyle =
|
|
15932
|
-
this.getListStyle(collection[index].listType, collection[index].nestedLevel);
|
|
15983
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15933
15984
|
}
|
|
15934
15985
|
else {
|
|
15935
15986
|
root.appendChild(temp = createElement(collection[index].listType));
|
|
@@ -15937,7 +15988,7 @@ class MsWordPaste {
|
|
|
15937
15988
|
prevList.appendChild(pElement);
|
|
15938
15989
|
temp.appendChild(prevList);
|
|
15939
15990
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15940
|
-
temp.style.
|
|
15991
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15941
15992
|
}
|
|
15942
15993
|
}
|
|
15943
15994
|
else if (collection[index].nestedLevel === 1) {
|
|
@@ -15946,12 +15997,12 @@ class MsWordPaste {
|
|
|
15946
15997
|
}
|
|
15947
15998
|
else {
|
|
15948
15999
|
root.appendChild(temp = createElement(collection[index].listType));
|
|
16000
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15949
16001
|
}
|
|
15950
16002
|
prevList = createElement('li');
|
|
15951
16003
|
prevList.appendChild(pElement);
|
|
15952
16004
|
temp.appendChild(prevList);
|
|
15953
16005
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15954
|
-
temp.style.listStyle = this.getListStyle(collection[index].listType, collection[index].nestedLevel);
|
|
15955
16006
|
}
|
|
15956
16007
|
else {
|
|
15957
16008
|
elem = prevList;
|
|
@@ -15972,7 +16023,7 @@ class MsWordPaste {
|
|
|
15972
16023
|
prevList.appendChild(pElement);
|
|
15973
16024
|
temp.appendChild(prevList);
|
|
15974
16025
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
15975
|
-
temp.style.
|
|
16026
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
15976
16027
|
break;
|
|
15977
16028
|
}
|
|
15978
16029
|
}
|
|
@@ -15981,21 +16032,12 @@ class MsWordPaste {
|
|
|
15981
16032
|
}
|
|
15982
16033
|
prevList.setAttribute('class', collection[index].class);
|
|
15983
16034
|
const currentStyle = prevList.getAttribute('style');
|
|
15984
|
-
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : '')
|
|
16035
|
+
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : ''));
|
|
15985
16036
|
pLevel = collection[index].nestedLevel;
|
|
15986
16037
|
listCount++;
|
|
15987
16038
|
}
|
|
15988
16039
|
return root;
|
|
15989
16040
|
}
|
|
15990
|
-
getListStyle(listType, nestedLevel) {
|
|
15991
|
-
nestedLevel = (nestedLevel > 0) ? nestedLevel - 1 : nestedLevel;
|
|
15992
|
-
if (listType === 'ol') {
|
|
15993
|
-
return (nestedLevel < this.olData.length ? this.olData[nestedLevel] : this.olData[0]);
|
|
15994
|
-
}
|
|
15995
|
-
else {
|
|
15996
|
-
return (nestedLevel < this.ulData.length ? this.ulData[nestedLevel] : this.ulData[0]);
|
|
15997
|
-
}
|
|
15998
|
-
}
|
|
15999
16041
|
getListContent(elem) {
|
|
16000
16042
|
let pushContent = '';
|
|
16001
16043
|
const firstChild = elem.firstElementChild;
|
|
@@ -16939,7 +16981,7 @@ class XhtmlValidation {
|
|
|
16939
16981
|
this.ImageTags();
|
|
16940
16982
|
this.removeTags();
|
|
16941
16983
|
this.RemoveUnsupported();
|
|
16942
|
-
this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText ===
|
|
16984
|
+
this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText === "\n" ?
|
|
16943
16985
|
this.currentElement.innerText.length : this.currentElement.innerText.trim().length);
|
|
16944
16986
|
this.parent.setProperties({ value: this.currentElement.innerHTML }, true);
|
|
16945
16987
|
}
|
|
@@ -17223,7 +17265,7 @@ class HtmlEditor {
|
|
|
17223
17265
|
e.args.action === 'enter' ||
|
|
17224
17266
|
e.args.keyCode === 13) {
|
|
17225
17267
|
this.spaceLink(e.args);
|
|
17226
|
-
if (this.parent.editorMode === 'HTML') {
|
|
17268
|
+
if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
|
|
17227
17269
|
this.parent.notify(enterHandler, { args: e.args });
|
|
17228
17270
|
}
|
|
17229
17271
|
}
|
|
@@ -17303,7 +17345,8 @@ class HtmlEditor {
|
|
|
17303
17345
|
if (this.rangeElement.tagName === 'OL' || this.rangeElement.tagName === 'UL') {
|
|
17304
17346
|
const liElement = this.getRangeLiNode(currentRange.startContainer);
|
|
17305
17347
|
if (liElement.previousElementSibling && liElement.previousElementSibling.childElementCount > 0) {
|
|
17306
|
-
this.oldRangeElement = liElement.previousElementSibling.lastElementChild
|
|
17348
|
+
this.oldRangeElement = liElement.previousElementSibling.lastElementChild.nodeName === 'BR' ?
|
|
17349
|
+
liElement.previousElementSibling : liElement.previousElementSibling.lastElementChild;
|
|
17307
17350
|
if (!isNullOrUndefined(liElement.lastElementChild)) {
|
|
17308
17351
|
this.rangeElement = liElement.lastElementChild;
|
|
17309
17352
|
isLiElement = true;
|
|
@@ -20100,7 +20143,7 @@ class Image {
|
|
|
20100
20143
|
left: elem.offsetLeft
|
|
20101
20144
|
};
|
|
20102
20145
|
}
|
|
20103
|
-
setAspectRatio(img, expectedX, expectedY) {
|
|
20146
|
+
setAspectRatio(img, expectedX, expectedY, e) {
|
|
20104
20147
|
if (isNullOrUndefined(img.width)) {
|
|
20105
20148
|
return;
|
|
20106
20149
|
}
|
|
@@ -20154,7 +20197,7 @@ class Image {
|
|
|
20154
20197
|
img.style.height = (height / width * expectedX) + 'px';
|
|
20155
20198
|
}
|
|
20156
20199
|
else {
|
|
20157
|
-
img.setAttribute('width', expectedX.toString());
|
|
20200
|
+
img.setAttribute('width', this.resizeBtnStat.botRight ? (this.getPointX(e.event) - img.getBoundingClientRect().left).toString() : expectedX.toString());
|
|
20158
20201
|
}
|
|
20159
20202
|
}
|
|
20160
20203
|
else {
|
|
@@ -20194,7 +20237,7 @@ class Image {
|
|
|
20194
20237
|
return;
|
|
20195
20238
|
}
|
|
20196
20239
|
this.imgEle.parentElement.style.cursor = 'pointer';
|
|
20197
|
-
this.setAspectRatio(this.imgEle, parseInt(width, 10), parseInt(height, 10));
|
|
20240
|
+
this.setAspectRatio(this.imgEle, parseInt(width, 10), parseInt(height, 10), args);
|
|
20198
20241
|
this.resizeImgDupPos(this.imgEle);
|
|
20199
20242
|
this.imgResizePos(this.imgEle, this.imgResizeDiv);
|
|
20200
20243
|
this.parent.setContentHeight('', false);
|
|
@@ -20239,7 +20282,8 @@ class Image {
|
|
|
20239
20282
|
}
|
|
20240
20283
|
resizeImgDupPos(e) {
|
|
20241
20284
|
this.imgDupPos = {
|
|
20242
|
-
width: (e.style.width !== ''
|
|
20285
|
+
width: (e.style.width !== '' && (this.parent.insertImageSettings &&
|
|
20286
|
+
!this.parent.insertImageSettings.resizeByPercent)) ? this.imgEle.style.width : e.width + 'px',
|
|
20243
20287
|
height: (e.style.height !== '') ? this.imgEle.style.height : e.height + 'px'
|
|
20244
20288
|
};
|
|
20245
20289
|
}
|
|
@@ -23908,7 +23952,7 @@ __decorate$2([
|
|
|
23908
23952
|
Property(null)
|
|
23909
23953
|
], PasteCleanupSettings.prototype, "deniedAttrs", void 0);
|
|
23910
23954
|
__decorate$2([
|
|
23911
|
-
Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
|
|
23955
|
+
Property(['background', 'background-color', 'border', 'border-bottom', 'border-left', 'border-radius', 'border-right', 'border-style', 'border-top', 'border-width', 'clear', 'color', 'cursor', 'direction', 'display', 'float', 'font', 'font-family', 'font-size', 'font-weight', 'font-style', 'height', 'left', 'line-height', 'list-style-type', 'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'max-height', 'max-width', 'min-height', 'min-width', 'overflow', 'overflow-x', 'overflow-y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'position', 'right', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'top', 'vertical-align', 'visibility', 'white-space', 'width'])
|
|
23912
23956
|
], PasteCleanupSettings.prototype, "allowedStyleProps", void 0);
|
|
23913
23957
|
__decorate$2([
|
|
23914
23958
|
Property(null)
|
|
@@ -24096,9 +24140,20 @@ class EnterKeyAction {
|
|
|
24096
24140
|
}
|
|
24097
24141
|
enterHandler(e) {
|
|
24098
24142
|
this.getRangeNode();
|
|
24143
|
+
let isTableEnter = true;
|
|
24144
|
+
if (!isNullOrUndefined(this.startNode.closest('TABLE')) && !isNullOrUndefined(this.endNode.closest('TABLE'))) {
|
|
24145
|
+
isTableEnter = false;
|
|
24146
|
+
let curElement = this.startNode;
|
|
24147
|
+
let blockElement = curElement;
|
|
24148
|
+
while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
|
|
24149
|
+
blockElement = curElement;
|
|
24150
|
+
curElement = curElement.parentElement;
|
|
24151
|
+
}
|
|
24152
|
+
isTableEnter = blockElement.tagName === 'TD' ? false : true;
|
|
24153
|
+
}
|
|
24099
24154
|
if (e.args.which === 13 && e.args.code === 'Enter') {
|
|
24100
|
-
if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) &&
|
|
24101
|
-
isNullOrUndefined(this.
|
|
24155
|
+
if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isTableEnter &&
|
|
24156
|
+
isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
24102
24157
|
const shiftKey = e.args.shiftKey;
|
|
24103
24158
|
const actionBeginArgs = {
|
|
24104
24159
|
cancel: false,
|
|
@@ -24159,10 +24214,29 @@ class EnterKeyAction {
|
|
|
24159
24214
|
if ((this.parent.enterKey === 'P' && !shiftKey) || (this.parent.enterKey === 'DIV' && !shiftKey) ||
|
|
24160
24215
|
(this.parent.shiftEnterKey === 'P' && shiftKey) ||
|
|
24161
24216
|
(this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
|
|
24162
|
-
|
|
24217
|
+
let nearBlockNode;
|
|
24218
|
+
if (isTableEnter && this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode)) {
|
|
24219
|
+
nearBlockNode = this.startNode;
|
|
24220
|
+
}
|
|
24221
|
+
else {
|
|
24222
|
+
nearBlockNode = this.parent.formatter.editorManager.domNode.blockParentNode(this.startNode);
|
|
24223
|
+
}
|
|
24163
24224
|
let isImageNode = false;
|
|
24164
|
-
|
|
24165
|
-
|
|
24225
|
+
let isFocusedFirst = false;
|
|
24226
|
+
if (this.range.startOffset != 0 && this.range.endOffset != 0 && this.range.startContainer === this.range.endContainer &&
|
|
24227
|
+
!(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
24228
|
+
let startNodeText = this.range.startContainer.textContent;
|
|
24229
|
+
let splitFirstText = startNodeText.substring(0, this.range.startOffset);
|
|
24230
|
+
if (splitFirstText.charCodeAt(this.range.startOffset - 1) != 160 && splitFirstText.trim().length === 0) {
|
|
24231
|
+
isFocusedFirst = true;
|
|
24232
|
+
}
|
|
24233
|
+
}
|
|
24234
|
+
else if (this.range.startOffset === 0 && this.range.endOffset === 0) {
|
|
24235
|
+
isFocusedFirst = true;
|
|
24236
|
+
}
|
|
24237
|
+
if (((this.range.startOffset === 0 && this.range.endOffset === 0) || isFocusedFirst) &&
|
|
24238
|
+
!(!isNullOrUndefined(this.range.startContainer.previousSibling) &&
|
|
24239
|
+
(this.range.startContainer.previousSibling.nodeName === 'IMG' || this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
24166
24240
|
let isNearBlockLengthZero;
|
|
24167
24241
|
let newElem;
|
|
24168
24242
|
if (this.range.startContainer.nodeName === 'IMG') {
|
|
@@ -24171,7 +24245,7 @@ class EnterKeyAction {
|
|
|
24171
24245
|
isNearBlockLengthZero = false;
|
|
24172
24246
|
}
|
|
24173
24247
|
else {
|
|
24174
|
-
if (nearBlockNode.textContent.length !== 0) {
|
|
24248
|
+
if (nearBlockNode.textContent.trim().length !== 0) {
|
|
24175
24249
|
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
|
|
24176
24250
|
isNearBlockLengthZero = false;
|
|
24177
24251
|
}
|
|
@@ -24220,7 +24294,18 @@ class EnterKeyAction {
|
|
|
24220
24294
|
}
|
|
24221
24295
|
if (newElem.textContent.trim().length === 0) {
|
|
24222
24296
|
const brElm = this.parent.createElement('br');
|
|
24223
|
-
this.startNode.
|
|
24297
|
+
if (this.startNode.nodeName === 'A') {
|
|
24298
|
+
let startParentElem = this.startNode.parentElement;
|
|
24299
|
+
this.startNode.parentElement.insertBefore(brElm, this.startNode);
|
|
24300
|
+
detach(this.startNode);
|
|
24301
|
+
this.startNode = startParentElem;
|
|
24302
|
+
}
|
|
24303
|
+
else {
|
|
24304
|
+
this.startNode.appendChild(brElm);
|
|
24305
|
+
}
|
|
24306
|
+
if (newElem.childNodes[0].textContent === '\n') {
|
|
24307
|
+
detach(newElem.childNodes[0]);
|
|
24308
|
+
}
|
|
24224
24309
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.startNode, 0);
|
|
24225
24310
|
}
|
|
24226
24311
|
if (((this.parent.enterKey === 'P' || this.parent.enterKey === 'DIV') && !shiftKey) || ((this.parent.shiftEnterKey === 'DIV' ||
|
|
@@ -24231,7 +24316,8 @@ class EnterKeyAction {
|
|
|
24231
24316
|
}
|
|
24232
24317
|
this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
|
|
24233
24318
|
detach(newElem);
|
|
24234
|
-
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode) ?
|
|
24319
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode) ?
|
|
24320
|
+
insertElm : this.startNode, 0);
|
|
24235
24321
|
}
|
|
24236
24322
|
}
|
|
24237
24323
|
e.args.preventDefault();
|
|
@@ -24261,9 +24347,11 @@ class EnterKeyAction {
|
|
|
24261
24347
|
this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
24262
24348
|
this.range.startOffset === this.range.endOffset &&
|
|
24263
24349
|
this.range.startOffset === isLastNodeLength) {
|
|
24264
|
-
const
|
|
24265
|
-
this.parent.
|
|
24266
|
-
this.parent.formatter.editorManager.
|
|
24350
|
+
const focusBRElem = this.parent.createElement('br');
|
|
24351
|
+
const lineBreakBRElem = this.parent.createElement('br');
|
|
24352
|
+
this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, this.range.startContainer);
|
|
24353
|
+
this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, this.range.startContainer);
|
|
24354
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusBRElem, 0);
|
|
24267
24355
|
}
|
|
24268
24356
|
else if (!isNullOrUndefined(currentParent) && currentParent !== this.parent.inputElement && currentParent.nodeName !== 'BR') {
|
|
24269
24357
|
if (currentParent.textContent.trim().length === 0 || (currentParent.textContent.trim().length === 1 &&
|
|
@@ -25726,7 +25814,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
25726
25814
|
this.setProperties({ value: this.valueTemplate });
|
|
25727
25815
|
}
|
|
25728
25816
|
else {
|
|
25729
|
-
const compiledTemplate = compile(this.valueTemplate)(
|
|
25817
|
+
const compiledTemplate = compile(this.valueTemplate)("", this, 'valueTemplate');
|
|
25730
25818
|
for (let i = 0; i < compiledTemplate.length; i++) {
|
|
25731
25819
|
const item = compiledTemplate[i];
|
|
25732
25820
|
append([item], this.element);
|
|
@@ -26121,7 +26209,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
26121
26209
|
this.isRTE = false;
|
|
26122
26210
|
}
|
|
26123
26211
|
this.notify(docClick, { args: e });
|
|
26124
|
-
if (e.detail > 3) {
|
|
26212
|
+
if (Browser.info.name !== 'msie' && e.detail > 3) {
|
|
26125
26213
|
e.preventDefault();
|
|
26126
26214
|
}
|
|
26127
26215
|
}
|