@syncfusion/ej2-richtexteditor 19.3.57 → 19.4.38
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 +4 -26
- 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 +64 -23
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +63 -22
- 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/ms-word-clean-up.js +1 -1
- package/src/editor-manager/plugin/undo.js +10 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +0 -10
- package/src/rich-text-editor/actions/enter-key.js +50 -8
- package/src/rich-text-editor/actions/html-editor.js +1 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- package/src/rich-text-editor/base/rich-text-editor.js +1 -1
- 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
|
@@ -3592,11 +3592,6 @@ class DropDownButtons {
|
|
|
3592
3592
|
for (const prop of Object.keys(newProp)) {
|
|
3593
3593
|
switch (prop) {
|
|
3594
3594
|
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
3595
|
if (this.fontNameDropDown) {
|
|
3601
3596
|
for (const fontFamily$$1 of Object.keys(newProp.fontFamily)) {
|
|
3602
3597
|
switch (fontFamily$$1) {
|
|
@@ -3627,11 +3622,6 @@ class DropDownButtons {
|
|
|
3627
3622
|
}
|
|
3628
3623
|
break;
|
|
3629
3624
|
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
3625
|
if (this.fontSizeDropDown) {
|
|
3636
3626
|
for (const fontSize$$1 of Object.keys(newProp.fontSize)) {
|
|
3637
3627
|
switch (fontSize$$1) {
|
|
@@ -15270,7 +15260,16 @@ class UndoRedoManager {
|
|
|
15270
15260
|
* @deprecated
|
|
15271
15261
|
*/
|
|
15272
15262
|
saveData(e) {
|
|
15273
|
-
|
|
15263
|
+
let range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
15264
|
+
let currentContainer = range.startContainer;
|
|
15265
|
+
for (let i = currentContainer.childNodes.length - 1; i >= 0; i--) {
|
|
15266
|
+
if (!isNullOrUndefined(currentContainer.childNodes[i]) && currentContainer.childNodes[i].nodeName === '#text' &&
|
|
15267
|
+
currentContainer.childNodes[i].textContent.length === 0 && currentContainer.childNodes[i].nodeName !== 'IMG' &&
|
|
15268
|
+
currentContainer.childNodes[i].nodeName !== 'BR' && currentContainer.childNodes[i].nodeName && 'HR') {
|
|
15269
|
+
detach(currentContainer.childNodes[i]);
|
|
15270
|
+
}
|
|
15271
|
+
}
|
|
15272
|
+
range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
15274
15273
|
const save = new NodeSelection().save(range, this.parent.currentDocument);
|
|
15275
15274
|
const htmlText = this.parent.editableElement.innerHTML;
|
|
15276
15275
|
const changEle = { text: htmlText, range: save };
|
|
@@ -15420,7 +15419,7 @@ class MsWordPaste {
|
|
|
15420
15419
|
this.parent.observer.on(MS_WORD_CLEANUP_PLUGIN, this.wordCleanup, this);
|
|
15421
15420
|
}
|
|
15422
15421
|
wordCleanup(e) {
|
|
15423
|
-
const wordPasteStyleConfig = e.allowedStylePropertiesArray;
|
|
15422
|
+
const wordPasteStyleConfig = !isNullOrUndefined(e.allowedStylePropertiesArray) ? e.allowedStylePropertiesArray : [];
|
|
15424
15423
|
let listNodes = [];
|
|
15425
15424
|
let tempHTMLContent = e.args.clipboardData.getData('text/HTML');
|
|
15426
15425
|
const rtfData = e.args.clipboardData.getData('text/rtf');
|
|
@@ -16939,7 +16938,7 @@ class XhtmlValidation {
|
|
|
16939
16938
|
this.ImageTags();
|
|
16940
16939
|
this.removeTags();
|
|
16941
16940
|
this.RemoveUnsupported();
|
|
16942
|
-
this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText ===
|
|
16941
|
+
this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText === "\n" ?
|
|
16943
16942
|
this.currentElement.innerText.length : this.currentElement.innerText.trim().length);
|
|
16944
16943
|
this.parent.setProperties({ value: this.currentElement.innerHTML }, true);
|
|
16945
16944
|
}
|
|
@@ -17223,7 +17222,7 @@ class HtmlEditor {
|
|
|
17223
17222
|
e.args.action === 'enter' ||
|
|
17224
17223
|
e.args.keyCode === 13) {
|
|
17225
17224
|
this.spaceLink(e.args);
|
|
17226
|
-
if (this.parent.editorMode === 'HTML') {
|
|
17225
|
+
if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
|
|
17227
17226
|
this.parent.notify(enterHandler, { args: e.args });
|
|
17228
17227
|
}
|
|
17229
17228
|
}
|
|
@@ -24096,9 +24095,20 @@ class EnterKeyAction {
|
|
|
24096
24095
|
}
|
|
24097
24096
|
enterHandler(e) {
|
|
24098
24097
|
this.getRangeNode();
|
|
24098
|
+
let isTableEnter = true;
|
|
24099
|
+
if (!isNullOrUndefined(this.startNode.closest('TABLE')) && !isNullOrUndefined(this.endNode.closest('TABLE'))) {
|
|
24100
|
+
isTableEnter = false;
|
|
24101
|
+
let curElement = this.startNode;
|
|
24102
|
+
let blockElement = curElement;
|
|
24103
|
+
while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
|
|
24104
|
+
blockElement = curElement;
|
|
24105
|
+
curElement = curElement.parentElement;
|
|
24106
|
+
}
|
|
24107
|
+
isTableEnter = blockElement.tagName === 'TD' ? false : true;
|
|
24108
|
+
}
|
|
24099
24109
|
if (e.args.which === 13 && e.args.code === 'Enter') {
|
|
24100
|
-
if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) &&
|
|
24101
|
-
isNullOrUndefined(this.
|
|
24110
|
+
if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isTableEnter &&
|
|
24111
|
+
isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
24102
24112
|
const shiftKey = e.args.shiftKey;
|
|
24103
24113
|
const actionBeginArgs = {
|
|
24104
24114
|
cancel: false,
|
|
@@ -24159,10 +24169,29 @@ class EnterKeyAction {
|
|
|
24159
24169
|
if ((this.parent.enterKey === 'P' && !shiftKey) || (this.parent.enterKey === 'DIV' && !shiftKey) ||
|
|
24160
24170
|
(this.parent.shiftEnterKey === 'P' && shiftKey) ||
|
|
24161
24171
|
(this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
|
|
24162
|
-
|
|
24172
|
+
let nearBlockNode;
|
|
24173
|
+
if (isTableEnter && this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode)) {
|
|
24174
|
+
nearBlockNode = this.startNode;
|
|
24175
|
+
}
|
|
24176
|
+
else {
|
|
24177
|
+
nearBlockNode = this.parent.formatter.editorManager.domNode.blockParentNode(this.startNode);
|
|
24178
|
+
}
|
|
24163
24179
|
let isImageNode = false;
|
|
24164
|
-
|
|
24165
|
-
|
|
24180
|
+
let isFocusedFirst = false;
|
|
24181
|
+
if (this.range.startOffset != 0 && this.range.endOffset != 0 && this.range.startContainer === this.range.endContainer &&
|
|
24182
|
+
!(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
|
|
24183
|
+
let startNodeText = this.range.startContainer.textContent;
|
|
24184
|
+
let splitFirstText = startNodeText.substring(0, this.range.startOffset);
|
|
24185
|
+
if (splitFirstText.charCodeAt(this.range.startOffset - 1) != 160 && splitFirstText.trim().length === 0) {
|
|
24186
|
+
isFocusedFirst = true;
|
|
24187
|
+
}
|
|
24188
|
+
}
|
|
24189
|
+
else if (this.range.startOffset === 0 && this.range.endOffset === 0) {
|
|
24190
|
+
isFocusedFirst = true;
|
|
24191
|
+
}
|
|
24192
|
+
if (((this.range.startOffset === 0 && this.range.endOffset === 0) || isFocusedFirst) &&
|
|
24193
|
+
!(!isNullOrUndefined(this.range.startContainer.previousSibling) &&
|
|
24194
|
+
(this.range.startContainer.previousSibling.nodeName === 'IMG' || this.range.startContainer.previousSibling.nodeName === 'BR'))) {
|
|
24166
24195
|
let isNearBlockLengthZero;
|
|
24167
24196
|
let newElem;
|
|
24168
24197
|
if (this.range.startContainer.nodeName === 'IMG') {
|
|
@@ -24171,7 +24200,7 @@ class EnterKeyAction {
|
|
|
24171
24200
|
isNearBlockLengthZero = false;
|
|
24172
24201
|
}
|
|
24173
24202
|
else {
|
|
24174
|
-
if (nearBlockNode.textContent.length !== 0) {
|
|
24203
|
+
if (nearBlockNode.textContent.trim().length !== 0) {
|
|
24175
24204
|
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
|
|
24176
24205
|
isNearBlockLengthZero = false;
|
|
24177
24206
|
}
|
|
@@ -24220,7 +24249,18 @@ class EnterKeyAction {
|
|
|
24220
24249
|
}
|
|
24221
24250
|
if (newElem.textContent.trim().length === 0) {
|
|
24222
24251
|
const brElm = this.parent.createElement('br');
|
|
24223
|
-
this.startNode.
|
|
24252
|
+
if (this.startNode.nodeName === 'A') {
|
|
24253
|
+
let startParentElem = this.startNode.parentElement;
|
|
24254
|
+
this.startNode.parentElement.insertBefore(brElm, this.startNode);
|
|
24255
|
+
detach(this.startNode);
|
|
24256
|
+
this.startNode = startParentElem;
|
|
24257
|
+
}
|
|
24258
|
+
else {
|
|
24259
|
+
this.startNode.appendChild(brElm);
|
|
24260
|
+
}
|
|
24261
|
+
if (newElem.childNodes[0].textContent === '\n') {
|
|
24262
|
+
detach(newElem.childNodes[0]);
|
|
24263
|
+
}
|
|
24224
24264
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.startNode, 0);
|
|
24225
24265
|
}
|
|
24226
24266
|
if (((this.parent.enterKey === 'P' || this.parent.enterKey === 'DIV') && !shiftKey) || ((this.parent.shiftEnterKey === 'DIV' ||
|
|
@@ -24231,7 +24271,8 @@ class EnterKeyAction {
|
|
|
24231
24271
|
}
|
|
24232
24272
|
this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
|
|
24233
24273
|
detach(newElem);
|
|
24234
|
-
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode) ?
|
|
24274
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode) ?
|
|
24275
|
+
insertElm : this.startNode, 0);
|
|
24235
24276
|
}
|
|
24236
24277
|
}
|
|
24237
24278
|
e.args.preventDefault();
|
|
@@ -25726,7 +25767,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
25726
25767
|
this.setProperties({ value: this.valueTemplate });
|
|
25727
25768
|
}
|
|
25728
25769
|
else {
|
|
25729
|
-
const compiledTemplate = compile(this.valueTemplate)(
|
|
25770
|
+
const compiledTemplate = compile(this.valueTemplate)("", this, 'valueTemplate');
|
|
25730
25771
|
for (let i = 0; i < compiledTemplate.length; i++) {
|
|
25731
25772
|
const item = compiledTemplate[i];
|
|
25732
25773
|
append([item], this.element);
|