@syncfusion/ej2-richtexteditor 27.1.50 → 27.1.52
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/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 +780 -210
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +171 -92
- 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 +10 -10
- package/src/common/editor-styles.d.ts +1 -0
- package/src/common/editor-styles.js +1 -0
- package/src/common/interface.d.ts +10 -0
- package/src/editor-manager/plugin/alignments.js +1 -1
- package/src/editor-manager/plugin/indents.js +1 -1
- package/src/editor-manager/plugin/inserthtml.js +37 -9
- package/src/editor-manager/plugin/lists.js +4 -3
- package/src/editor-manager/plugin/ms-word-clean-up.js +14 -2
- package/src/editor-manager/plugin/table.js +3 -0
- package/src/rich-text-editor/actions/base-toolbar.js +1 -1
- package/src/rich-text-editor/actions/dropdown-buttons.js +0 -6
- package/src/rich-text-editor/actions/enter-key.js +8 -2
- package/src/rich-text-editor/actions/html-editor.js +3 -2
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +8 -8
- package/src/rich-text-editor/base/rich-text-editor.d.ts +8 -8
- package/src/rich-text-editor/base/rich-text-editor.js +8 -4
- package/src/rich-text-editor/renderer/content-renderer.d.ts +1 -1
- package/src/rich-text-editor/renderer/content-renderer.js +9 -2
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +21 -8
- package/src/rich-text-editor/renderer/image-module.d.ts +2 -0
- package/src/rich-text-editor/renderer/image-module.js +21 -12
- package/src/rich-text-editor/renderer/link-module.js +1 -1
- package/dist/ej2-richtexteditor.min.js +0 -10
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 27.1.
|
|
3
|
+
* version : 27.1.52
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@27.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@27.1.51",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-inlHC5480ej5x2prpYyHklgio/xK2ySwJ9fde81c7VZodSANYCWTzGEM4zpNXwqGq883rUcsceZWyx77wbfPJQ==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
26
26
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
27
27
|
],
|
|
28
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.51.tgz",
|
|
29
|
+
"_shasum": "485be34e965c6976c8a1d3509ea9c399b6ab3612",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@syncfusion/ej2-base": "~27.1.
|
|
41
|
-
"@syncfusion/ej2-buttons": "~27.1.
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~27.1.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~27.1.
|
|
40
|
+
"@syncfusion/ej2-base": "~27.1.52",
|
|
41
|
+
"@syncfusion/ej2-buttons": "~27.1.51",
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~27.1.52",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~27.1.52",
|
|
44
44
|
"@syncfusion/ej2-inputs": "~27.1.50",
|
|
45
|
-
"@syncfusion/ej2-navigations": "~27.1.
|
|
45
|
+
"@syncfusion/ej2-navigations": "~27.1.52",
|
|
46
46
|
"@syncfusion/ej2-popups": "~27.1.50",
|
|
47
47
|
"@syncfusion/ej2-splitbuttons": "~27.1.50"
|
|
48
48
|
},
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
81
81
|
},
|
|
82
82
|
"typings": "index.d.ts",
|
|
83
|
-
"version": "27.1.
|
|
83
|
+
"version": "27.1.52",
|
|
84
84
|
"sideEffects": false
|
|
85
85
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IFRAME_EDITOR_STYLES: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var IFRAME_EDITOR_STYLES = "\n@charset \"UTF-8\";\n\nhtml {\n height: auto;\n}\n\nhtml, body {\n margin: 0;\n}\n\nbody {\n color: #333;\n word-wrap: break-word;\n}\n\n.e-content {\n background: unset;\n box-sizing: border-box;\n min-height: 100px;\n outline: 0 solid transparent;\n padding: 16px;\n position: relative;\n overflow-x: auto;\n font-weight: normal;\n line-height: 1.5;\n font-size: 14px;\n text-align: inherit;\n font-family: \"Roboto\", \"Segoe UI\", \"GeezaPro\", \"DejaVu Serif\", \"sans-serif\", \"-apple-system\", \"BlinkMacSystemFont\";\n}\n\n.e-content p {\n margin: 0 0 10px;\n margin-bottom: 10px;\n}\n\n.e-content h1 {\n font-size: 2.857em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h2 {\n font-size: 2.285em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h3 {\n font-size: 2em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h4 {\n font-size: 1.714em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h5 {\n font-size: 1.428em;\n font-weight: 600;\n line-height: 1.2;\n margin: 10px 0;\n}\n\n.e-content h6 {\n font-size: 1.142em;\n font-weight: 600;\n line-height: 1.5;\n margin: 10px 0;\n}\n\n.e-content blockquote {\n margin: 10px 0;\n padding-left: 12px;\n border-left: 2px solid #5c5c5c;\n}\n\n.e-rtl.e-content blockquote {\n padding-left: 0;\n padding-right: 12px;\n}\n\n.e-content pre {\n border: 0;\n border-radius: 0;\n color: #333;\n font-size: inherit;\n line-height: inherit;\n margin: 0 0 10px;\n overflow: visible;\n padding: 0;\n white-space: pre-wrap;\n word-break: inherit;\n word-wrap: break-word;\n}\n\n.e-content code {\n background: #9d9d9d26;\n color: #ed484c;\n}\n\n.e-content strong,\n.e-content b {\n font-weight: bold;\n}\n\n.e-content a {\n text-decoration: none;\n user-select: auto;\n}\n\n.e-content a:hover {\n text-decoration: underline;\n}\n\n.e-content li {\n margin-bottom: 10px;\n}\n\n.e-content li ol,\n.e-content li ul {\n margin-block-start: 10px;\n}\n\n.e-content ul {\n list-style-type: disc;\n}\n\n.e-content ul ul,\n.e-content ol ul {\n list-style-type: circle;\n}\n\n.e-content ul ul ul,\n.e-content ol ul ul,\n.e-content ul ol ul,\n.e-content ol ol ul {\n list-style-type: square;\n}\n\n.e-rte-image,\n.e-rte-video {\n border: 0;\n cursor: pointer;\n display: block;\n float: none;\n height: auto;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-content p:last-child,\n.e-content pre:last-child,\n.e-content blockquote:last-child {\n margin-bottom: 0;\n}\n\n.e-content h3 + h4,\n.e-content h4 + h5,\n.e-content h5 + h6 {\n margin-top: 0.6em;\n}\n\n.e-content ul:last-child {\n margin-bottom: 0;\n}\n\n.e-content table {\n margin-bottom: 10px;\n border-collapse: collapse;\n empty-cells: show;\n}\n\n.e-content table.e-cell-select {\n position: relative;\n}\n\n.e-content table.e-cell-select::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4a90e2;\n pointer-events: none;\n}\n\ntable .e-cell-select {\n border: 1px double #4a90e2 !important;\n}\n\n.e-content table.e-rte-table th {\n background-color: #E0E0E0;\n}\n\n.e-rte-table td,\n.e-rte-table th {\n border: 1px solid #BDBDBD;\n height: 20px;\n min-width: 20px;\n padding: 2px 5px;\n box-sizing: border-box;\n}\n\n.e-rte-table td.e-cell-select.e-multi-cells-select,\n.e-rte-table th.e-cell-select.e-multi-cells-select {\n position: relative;\n}\n\n.e-rte-table td.e-cell-select.e-multi-cells-select::after,\n.e-rte-table th.e-cell-select.e-multi-cells-select::after {\n background-color: rgba(13, 110, 253, 0.08);\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n bottom: 0;\n pointer-events: none;\n right: 0;\n}\n\ntable td.e-multi-cells-select ::selection,\ntable th.e-multi-cells-select ::selection {\n background-color: transparent;\n}\n\ntd.e-multi-cells-select,\nth.e-multi-cells-select {\n user-select: none !important;\n}\n\n.e-rte-table.e-dashed-border td,\n.e-rte-table.e-dashed-border th {\n border-style: dashed;\n}\n\n.e-rte-table .e-alternate-border tbody tr:nth-child(2n) {\n background-color: #F5F5F5;\n}\n\n.e-rte-audio {\n border: 0;\n cursor: pointer;\n display: block;\n float: none;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-rte-image.e-imginline,\n.e-rte-audio.e-audio-inline,\n.e-rte-video.e-video-inline {\n display: inline-block;\n float: none;\n margin-left: 5px;\n margin-right: 5px;\n max-width: calc(100% - (2 * 5px));\n padding: 1px;\n vertical-align: bottom;\n}\n\n.e-rte-image.e-imgcenter,\n.e-rte-video.e-video-center {\n cursor: pointer;\n display: block;\n float: none;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-rte-image.e-imgright,\n.e-rte-video.e-video-right {\n float: right;\n margin: 0 auto;\n margin-left: 5px;\n text-align: right;\n}\n\n.e-rte-image.e-imgleft,\n.e-rte-video.e-video-left {\n float: left;\n margin: 0 auto;\n margin-right: 5px;\n text-align: left;\n}\n\n.e-img-caption {\n display: inline-block;\n float: none;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-img-caption.e-caption-inline {\n display: inline-block;\n float: none;\n margin: 5px auto;\n margin-left: 5px;\n margin-right: 5px;\n max-width: calc(100% - (2 * 5px));\n position: relative;\n text-align: center;\n vertical-align: bottom;\n}\n\n.e-rte-img-caption.e-imgcenter {\n display: contents;\n margin-left: auto;\n margin-right: auto;\n}\n\n.e-rte-img-caption.e-imgright {\n display: contents;\n margin-left: auto;\n margin-right: 0;\n}\n\n.e-rte-img-caption.e-imgleft {\n display: contents;\n margin-left: 0;\n margin-right: auto;\n}\n\n.e-img-caption.e-rte-img-caption.e-imgbreak {\n display: contents;\n}\n\n.e-img-inner {\n box-sizing: border-box;\n display: block;\n font-size: 16px;\n font-weight: initial;\n margin: auto;\n opacity: .9;\n text-align: center;\n width: 100%;\n}\n\n.e-img-wrap {\n display: inline-block;\n margin: auto;\n padding: 0;\n text-align: center;\n width: 100%;\n}\n\n.e-imgleft,\n.e-video-left {\n float: left;\n margin: 0 5px 0 0;\n text-align: left;\n}\n\n.e-imgright,\n.e-video-right {\n float: right;\n margin: 0 0 0 5px;\n text-align: right;\n}\n\n.e-imgcenter,\n.e-video-center {\n cursor: pointer;\n display: block;\n float: none;\n height: auto;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-control img:not(.e-resize) {\n border: 2px solid transparent;\n z-index: 1000\n}\n\n.e-imginline,\n.e-audio-inline,\n.e-video-inline {\n display: inline-block;\n float: none;\n margin-left: 5px;\n margin-right: 5px;\n max-width: calc(100% - (2 * 5px));\n vertical-align: bottom;\n}\n\n.e-imgbreak,\n.e-audio-break,\n.e-video-break {\n border: 0;\n cursor: pointer;\n display: block;\n float: none;\n height: auto;\n margin: 5px auto;\n max-width: 100%;\n position: relative;\n}\n\n.e-rte-image.e-img-focus:not(.e-resize),\n.e-audio-focus:not(.e-resize),\n.e-video-focus:not(.e-resize) {\n border: solid 2px #4a90e2;\n}\n\nimg.e-img-focus::selection,\naudio.e-audio-focus::selection,\n.e-video-focus::selection {\n background: transparent;\n color: transparent;\n}\n\nspan.e-rte-imageboxmark,\nspan.e-rte-videoboxmark {\n width: 10px;\n height: 10px;\n position: absolute;\n display: block;\n background: #4a90e2;\n border: 1px solid #fff;\n z-index: 1000;\n}\n\n.e-mob-rte.e-mob-span span.e-rte-imageboxmark,\n.e-mob-rte.e-mob-span span.e-rte-videoboxmark {\n background: #4a90e2;\n border: 1px solid #fff;\n}\n\n.e-mob-rte span.e-rte-imageboxmark,\n.e-mob-rte span.e-rte-videoboxmark {\n background: #fff;\n border: 1px solid #4a90e2;\n border-radius: 15px;\n height: 20px;\n width: 20px;\n}\n\n.e-mob-rte.e-mob-span span.e-rte-imageboxmark,\n.e-mob-rte.e-mob-span span.e-rte-videoboxmark {\n background: #4a90e2;\n border: 1px solid #fff;\n}\n\n.e-content img.e-resize,\n.e-content video.e-resize {\n z-index: 1000;\n}\n\n.e-img-caption .e-img-inner {\n outline: 0;\n}\n\n.e-rte-img-caption.e-imgleft .e-img-inner {\n float: left;\n text-align: left;\n}\n\n.e-rte-img-caption.e-imgright .e-img-inner {\n float: right;\n text-align: right;\n}\n\n.e-rte-img-caption.e-imgleft .e-img-wrap,\n.e-rte-img-caption.e-imgright .e-img-wrap {\n display: contents;\n}\n\n.e-img-caption a:focus-visible {\n outline: none;\n}\n\n.e-rte-img-caption .e-rte-image.e-imgright {\n margin-left: auto;\n margin-right: 0;\n}\n\n.e-rte-img-caption .e-rte-image.e-imgleft {\n margin: 0;\n}\n\nspan.e-table-box {\n cursor: nwse-resize;\n display: block;\n height: 10px;\n position: absolute;\n width: 10px;\n background-color: #ffffff;\n border: 1px solid #BDBDBD;\n}\n\nspan.e-table-box.e-rmob {\n height: 14px;\n width: 14px;\n background-color: #BDBDBD;\n border: 1px solid #BDBDBD;\n}\n\n.e-row-resize,\n.e-column-resize {\n background-color: transparent;\n background-repeat: repeat;\n bottom: 0;\n cursor: col-resize;\n height: 1px;\n overflow: visible;\n position: absolute;\n width: 1px;\n}\n\n.e-row-resize {\n cursor: row-resize;\n height: 1px;\n}\n\n.e-table-rhelper {\n cursor: col-resize;\n opacity: .87;\n position: absolute;\n}\n\n.e-table-rhelper.e-column-helper {\n width: 1px;\n}\n\n.e-table-rhelper.e-row-helper {\n height: 1px;\n}\n\n.e-reicon::before {\n border-bottom: 6px solid transparent;\n border-right: 6px solid;\n border-top: 6px solid transparent;\n content: '';\n display: block;\n height: 0;\n position: absolute;\n right: 4px;\n top: 4px;\n width: 20px;\n}\n\n.e-reicon::after {\n border-bottom: 6px solid transparent;\n border-left: 6px solid;\n border-top: 6px solid transparent;\n content: '';\n display: block;\n height: 0;\n left: 4px;\n position: absolute;\n top: 4px;\n width: 20px;\n z-index: 3;\n}\n\n.e-row-helper.e-reicon::after {\n top: 10px;\n transform: rotate(90deg);\n}\n\n.e-row-helper.e-reicon::before {\n left: 4px;\n top: -20px;\n transform: rotate(90deg);\n}\n\n\n.e-table-rhelper {\n background-color: #4a90e2;\n}\n\n.e-rtl {\n direction: rtl;\n}\n\n.e-rte-placeholder::before {\n content: attr(placeholder);\n opacity: 0.54;\n overflow: hidden;\n padding-top: 16px;\n position: absolute;\n text-align: start;\n top: 0;\n z-index: 1;\n}\n\n.e-resize-enabled,\n.e-count-enabled {\n padding-bottom: 0px;\n}\n";
|
|
@@ -105,3 +105,13 @@ export interface ImageOrTableCursor {
|
|
|
105
105
|
end: boolean;
|
|
106
106
|
endName: string;
|
|
107
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* The `ImageDimension` is used to specify the width and height of the editor image.
|
|
110
|
+
*
|
|
111
|
+
* @private
|
|
112
|
+
* @hidden
|
|
113
|
+
*/
|
|
114
|
+
export interface ImageDimension {
|
|
115
|
+
width: number;
|
|
116
|
+
height: number;
|
|
117
|
+
}
|
|
@@ -91,7 +91,7 @@ var Alignments = /** @class */ (function () {
|
|
|
91
91
|
selector: e.selector
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
this.parent.editableElement.focus();
|
|
94
|
+
this.parent.editableElement.focus({ preventScroll: true });
|
|
95
95
|
save = this.parent.domNode.saveMarker(save);
|
|
96
96
|
if (isIDevice()) {
|
|
97
97
|
setEditFrameFocus(this.parent.editableElement, e.selector);
|
|
@@ -254,7 +254,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
254
254
|
fragment.appendChild(node.firstChild);
|
|
255
255
|
}
|
|
256
256
|
if (isSingleNode) {
|
|
257
|
-
|
|
257
|
+
range.deleteContents();
|
|
258
|
+
this.removeEmptyElements(editNode, true);
|
|
259
|
+
range.insertNode(fragment);
|
|
258
260
|
}
|
|
259
261
|
else {
|
|
260
262
|
var startContainerParent = editNode === range.startContainer ?
|
|
@@ -266,6 +268,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
266
268
|
range.setEnd(startContainerParent, startIndex);
|
|
267
269
|
if (!isNOU(lasNode) && lasNode !== editNode) {
|
|
268
270
|
detach(lasNode);
|
|
271
|
+
this.removeEmptyElements(editNode, true);
|
|
269
272
|
}
|
|
270
273
|
// eslint-disable-next-line
|
|
271
274
|
!isNOU(sibNode) ? (sibNode.parentNode === editNode ? sibNode.appendChild(fragment) : sibNode.parentNode.appendChild(fragment)) : range.insertNode(fragment);
|
|
@@ -282,6 +285,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
282
285
|
var rangeElement = closest(nearestAnchor, 'span');
|
|
283
286
|
rangeElement.appendChild(tempSpan);
|
|
284
287
|
}
|
|
288
|
+
else if (nodes[0].nodeName === '#text' && nodes[0].nodeValue.includes('\u200B') && !isNOU(nodes[0].parentElement) && !isNOU(nodes[0].parentElement.previousElementSibling) && nodes[0].parentElement.previousElementSibling.classList.contains('e-mention-chip')) {
|
|
289
|
+
range.startContainer.parentElement.insertAdjacentElement('afterend', tempSpan);
|
|
290
|
+
}
|
|
285
291
|
else {
|
|
286
292
|
range.insertNode(tempSpan);
|
|
287
293
|
}
|
|
@@ -367,6 +373,24 @@ var InsertHtml = /** @class */ (function () {
|
|
|
367
373
|
if (lastSelectionNode.nodeName === '#text') {
|
|
368
374
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
369
375
|
}
|
|
376
|
+
else if (lastSelectionNode.nodeName === 'HR') {
|
|
377
|
+
var nextSiblingNode = lastSelectionNode.nextSibling ? lastSelectionNode.nextSibling : null;
|
|
378
|
+
var siblingTag = enterAction === 'DIV' ? createElement('div') : createElement('p');
|
|
379
|
+
siblingTag.appendChild(createElement('br'));
|
|
380
|
+
if (!isNOU(nextSiblingNode) && nextSiblingNode.nodeName === 'HR') {
|
|
381
|
+
lastSelectionNode.parentNode.insertBefore(siblingTag, nextSiblingNode);
|
|
382
|
+
lastSelectionNode = siblingTag;
|
|
383
|
+
}
|
|
384
|
+
else if (!isNOU(nextSiblingNode)) {
|
|
385
|
+
lastSelectionNode = nextSiblingNode;
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
lastSelectionNode.parentNode.appendChild(siblingTag);
|
|
389
|
+
lastSelectionNode.parentNode.insertBefore(lastSelectionNode, siblingTag);
|
|
390
|
+
lastSelectionNode = siblingTag;
|
|
391
|
+
}
|
|
392
|
+
nodeSelection.setSelectionText(docElement, lastSelectionNode, lastSelectionNode, 0, 0);
|
|
393
|
+
}
|
|
370
394
|
else {
|
|
371
395
|
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
|
|
372
396
|
}
|
|
@@ -435,10 +459,10 @@ var InsertHtml = /** @class */ (function () {
|
|
|
435
459
|
blockNode = range.endContainer;
|
|
436
460
|
range.setEnd(blockNode, range.endContainer.textContent.length);
|
|
437
461
|
}
|
|
438
|
-
if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
|
|
462
|
+
if (blockNode && blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
|
|
439
463
|
blockNode = range.startContainer;
|
|
440
464
|
}
|
|
441
|
-
if (blockNode.closest('LI') && editNode.contains(blockNode.closest('LI')) && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
|
|
465
|
+
if (blockNode && blockNode.closest('LI') && editNode.contains(blockNode.closest('LI')) && blockNode.nodeName !== 'TD' && blockNode.nodeName !== 'TH' && blockNode.nodeName !== 'TR' && node && node.firstElementChild &&
|
|
442
466
|
((node).firstElementChild.tagName === 'OL' || node.firstElementChild.tagName === 'UL')) {
|
|
443
467
|
var liNode = void 0;
|
|
444
468
|
while (node.firstElementChild.lastElementChild && node.firstElementChild.lastElementChild.tagName === 'LI') {
|
|
@@ -449,7 +473,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
449
473
|
node.firstElementChild.insertAdjacentElement('afterend', liNode);
|
|
450
474
|
}
|
|
451
475
|
}
|
|
452
|
-
if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
|
|
476
|
+
if (blockNode && blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH' || blockNode.nodeName === 'TR') {
|
|
453
477
|
var tempSpan = createElement('span', { className: 'tempSpan' });
|
|
454
478
|
range.insertNode(tempSpan);
|
|
455
479
|
tempSpan.parentNode.replaceChild(node, tempSpan);
|
|
@@ -532,17 +556,20 @@ var InsertHtml = /** @class */ (function () {
|
|
|
532
556
|
innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
|
|
533
557
|
elm.innerHTML = innerElement;
|
|
534
558
|
};
|
|
535
|
-
InsertHtml.findDetachEmptyElem = function (element) {
|
|
559
|
+
InsertHtml.findDetachEmptyElem = function (element, ignoreBlockNodes) {
|
|
560
|
+
if (ignoreBlockNodes === void 0) { ignoreBlockNodes = false; }
|
|
536
561
|
var removableElement;
|
|
537
562
|
if (!isNOU(element.parentElement)) {
|
|
538
563
|
var hasNbsp = element.parentElement.textContent.length > 0 && element.parentElement.textContent.match(/\u00a0/g)
|
|
539
564
|
&& element.parentElement.textContent.match(/\u00a0/g).length > 0;
|
|
540
565
|
if (!hasNbsp && element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true' &&
|
|
541
566
|
isNOU(element.parentElement.querySelector('img')) && element.parentElement.nodeName !== 'TD' && element.parentElement.nodeName !== 'TH') {
|
|
542
|
-
removableElement =
|
|
567
|
+
removableElement = ignoreBlockNodes && CONSTANT.BLOCK_TAGS.indexOf(element.parentElement.tagName.toLowerCase()) !== -1 ?
|
|
568
|
+
element : this.findDetachEmptyElem(element.parentElement, ignoreBlockNodes);
|
|
543
569
|
}
|
|
544
570
|
else {
|
|
545
|
-
removableElement = element
|
|
571
|
+
removableElement = ignoreBlockNodes && CONSTANT.BLOCK_TAGS.indexOf(element.tagName.toLowerCase()) !== -1 ? null :
|
|
572
|
+
element;
|
|
546
573
|
}
|
|
547
574
|
}
|
|
548
575
|
else {
|
|
@@ -550,7 +577,8 @@ var InsertHtml = /** @class */ (function () {
|
|
|
550
577
|
}
|
|
551
578
|
return removableElement;
|
|
552
579
|
};
|
|
553
|
-
InsertHtml.removeEmptyElements = function (element) {
|
|
580
|
+
InsertHtml.removeEmptyElements = function (element, ignoreBlockNodes) {
|
|
581
|
+
if (ignoreBlockNodes === void 0) { ignoreBlockNodes = false; }
|
|
554
582
|
var emptyElements = element.querySelectorAll(':empty');
|
|
555
583
|
var nonSvgEmptyElements = Array.from(emptyElements).filter(function (element) {
|
|
556
584
|
// Check if the element is an SVG element or an ancestor of an SVG element
|
|
@@ -563,7 +591,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
563
591
|
nonSvgEmptyElements[i].style.borderBottom === '' ? true : false;
|
|
564
592
|
}
|
|
565
593
|
if (CONSTANT.SELF_CLOSING_TAGS.indexOf(nonSvgEmptyElements[i].tagName.toLowerCase()) < 0 && lineWithDiv) {
|
|
566
|
-
var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i]);
|
|
594
|
+
var detachableElement = this.findDetachEmptyElem(nonSvgEmptyElements[i], ignoreBlockNodes);
|
|
567
595
|
if (!isNOU(detachableElement)) {
|
|
568
596
|
detach(detachableElement);
|
|
569
597
|
}
|
|
@@ -374,7 +374,7 @@ var Lists = /** @class */ (function () {
|
|
|
374
374
|
}
|
|
375
375
|
if (isNested) {
|
|
376
376
|
this.cleanNode();
|
|
377
|
-
this.parent.editableElement.focus();
|
|
377
|
+
this.parent.editableElement.focus({ preventScroll: true });
|
|
378
378
|
}
|
|
379
379
|
if (!(e.event.action && e.event.action === 'indent')) {
|
|
380
380
|
this.saveSelection = this.domNode.saveMarker(this.saveSelection);
|
|
@@ -688,7 +688,7 @@ var Lists = /** @class */ (function () {
|
|
|
688
688
|
span.parentNode.replaceChild(fragment, span);
|
|
689
689
|
});
|
|
690
690
|
}
|
|
691
|
-
this.parent.editableElement.focus();
|
|
691
|
+
this.parent.editableElement.focus({ preventScroll: true });
|
|
692
692
|
if (isIDevice()) {
|
|
693
693
|
setEditFrameFocus(this.parent.editableElement, selector);
|
|
694
694
|
}
|
|
@@ -927,7 +927,8 @@ var Lists = /** @class */ (function () {
|
|
|
927
927
|
parentNode.removeAttribute('style');
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
|
-
var
|
|
930
|
+
var wrapperTag = isNullOrUndefined(e.enterAction) ? CONSTANT.DEFAULT_TAG : e.enterAction;
|
|
931
|
+
var wrapper = '<' + wrapperTag + wrapperclass + this.domNode.attributes(element) + '></' + wrapperTag + '>';
|
|
931
932
|
if (e.enterAction !== 'BR') {
|
|
932
933
|
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
933
934
|
}
|
|
@@ -516,15 +516,22 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
516
516
|
var styleProperty = resultElem[j].getAttribute('style');
|
|
517
517
|
if (!isNOU(styleProperty) && styleProperty.trim() !== '') {
|
|
518
518
|
var valueSplit = values[i].split(';');
|
|
519
|
+
for (var q = 0; q < valueSplit.length; q++) {
|
|
520
|
+
if (valueSplit[q].split(':')[0] === 'border' && valueSplit[q].split(':')[1] === 'none') {
|
|
521
|
+
valueSplit.splice(q, 1);
|
|
522
|
+
q--;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
519
525
|
if (!fromClass) {
|
|
520
526
|
for (var k = 0; k < valueSplit.length; k++) {
|
|
521
|
-
|
|
527
|
+
var propertyName = valueSplit[k].split(':')[0];
|
|
528
|
+
if (styleProperty.includes(propertyName + ':')) {
|
|
522
529
|
valueSplit.splice(k, 1);
|
|
523
530
|
k--;
|
|
524
531
|
}
|
|
525
532
|
}
|
|
526
533
|
}
|
|
527
|
-
var changedValue =
|
|
534
|
+
var changedValue = valueSplit.join(';') + ';' + styleProperty;
|
|
528
535
|
resultElem[j].setAttribute('style', changedValue);
|
|
529
536
|
}
|
|
530
537
|
else {
|
|
@@ -703,6 +710,11 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
703
710
|
startAttr = parseInt(startString, 10);
|
|
704
711
|
}
|
|
705
712
|
}
|
|
713
|
+
else if (listStyleType === 'decimal-leading-zero') {
|
|
714
|
+
if (!isNaN(parseInt(startString, 10))) {
|
|
715
|
+
startAttr = parseInt(startString, 10);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
706
718
|
else if (listStyleType === 'upper-alpha') {
|
|
707
719
|
startAttr = (startString.split('.')[0].charCodeAt(0) - 64);
|
|
708
720
|
}
|
|
@@ -228,6 +228,9 @@ var TableCommand = /** @class */ (function () {
|
|
|
228
228
|
for (var i = 0; i < thTdElm.length; i++) {
|
|
229
229
|
thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + '%';
|
|
230
230
|
}
|
|
231
|
+
if (isNOU(currentTabElm.style.width) || currentTabElm.style.width === '') {
|
|
232
|
+
currentTabElm.style.width = currentTabElm.offsetWidth + 'px';
|
|
233
|
+
}
|
|
231
234
|
for (var i = 0; i < allRows.length; i++) {
|
|
232
235
|
curCell = allRows[i].querySelectorAll(':scope > td, :scope > th')[colIndex];
|
|
233
236
|
var colTemplate = curCell.cloneNode(true);
|
|
@@ -176,7 +176,7 @@ var BaseToolbar = /** @class */ (function () {
|
|
|
176
176
|
var tooltipText = items[num].tooltipText;
|
|
177
177
|
var shortCutKey = void 0;
|
|
178
178
|
var isMacDev = window.navigator.platform.toLocaleLowerCase().includes('mac');
|
|
179
|
-
if (windowKeys["" + tooltipText]) {
|
|
179
|
+
if (windowKeys["" + tooltipText] && (!isNullOrUndefined(items[num].id) || !isNullOrUndefined(items[num].cssClass))) {
|
|
180
180
|
shortCutKey = isMacDev ? windowKeys["" + tooltipText].replace('Ctrl+', '⌘').replace('Shift+', '⇧').replace('Alt+', '⌥') : windowKeys["" + tooltipText];
|
|
181
181
|
}
|
|
182
182
|
else {
|
|
@@ -121,9 +121,6 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
121
121
|
cssClass: classes.CLS_DROPDOWN_POPUP + ' ' + classes.CLS_DROPDOWN_ITEMS + ' ' + classes.CLS_FONT_NAME_TB_BTN,
|
|
122
122
|
itemName: 'FontName', items: fontItem, element: targetElement
|
|
123
123
|
});
|
|
124
|
-
if (!isNullOrUndefined(_this.parent.fontFamily.default)) {
|
|
125
|
-
_this.getEditNode().style.fontFamily = _this.parent.fontFamily.default;
|
|
126
|
-
}
|
|
127
124
|
break;
|
|
128
125
|
}
|
|
129
126
|
case 'fontsize': {
|
|
@@ -147,9 +144,6 @@ var DropDownButtons = /** @class */ (function () {
|
|
|
147
144
|
cssClass: classes.CLS_DROPDOWN_POPUP + ' ' + classes.CLS_DROPDOWN_ITEMS + ' ' + classes.CLS_FONT_SIZE_TB_BTN,
|
|
148
145
|
itemName: 'FontSize', items: fontsize, element: targetElement
|
|
149
146
|
});
|
|
150
|
-
if (!isNullOrUndefined(_this.parent.fontSize.default)) {
|
|
151
|
-
_this.getEditNode().style.fontSize = _this.parent.fontSize.default;
|
|
152
|
-
}
|
|
153
147
|
break;
|
|
154
148
|
}
|
|
155
149
|
case 'alignments':
|
|
@@ -160,7 +160,12 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
160
160
|
else {
|
|
161
161
|
var nearBlockNode = void 0;
|
|
162
162
|
if (isTableEnter && _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
|
|
163
|
-
|
|
163
|
+
if (_this.range.startContainer.nodeName === '#text' && !isNOU(_this.range.startContainer.previousSibling) && _this.range.startContainer.previousSibling.nodeName === 'HR') {
|
|
164
|
+
nearBlockNode = _this.range.startContainer.nextSibling;
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
nearBlockNode = _this.startNode;
|
|
168
|
+
}
|
|
164
169
|
}
|
|
165
170
|
else {
|
|
166
171
|
nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
|
|
@@ -208,7 +213,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
208
213
|
}
|
|
209
214
|
else {
|
|
210
215
|
if ((nearBlockNode.textContent.trim().length !== 0 ||
|
|
211
|
-
nearBlockNode.childNodes[0].nodeName === 'IMG' ||
|
|
216
|
+
(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG') ||
|
|
212
217
|
(nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
|
|
213
218
|
if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0)) {
|
|
214
219
|
newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
|
|
@@ -463,6 +468,7 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
463
468
|
e.args.preventDefault();
|
|
464
469
|
}
|
|
465
470
|
_this.triggerActionComplete(e, shiftKey_1);
|
|
471
|
+
_this.parent.inputElement.dispatchEvent(new Event('input'));
|
|
466
472
|
}
|
|
467
473
|
});
|
|
468
474
|
}
|
|
@@ -650,12 +650,13 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
650
650
|
this.isImageDelete = false;
|
|
651
651
|
}
|
|
652
652
|
var brNode = this.deleteRangeElement.querySelector('BR');
|
|
653
|
+
var brLastChildNode = this.deleteRangeElement.lastChild;
|
|
653
654
|
if (brNode && brNode.classList.contains('e-rte-image-remove-focus')) {
|
|
654
655
|
removeClass([brNode], ['e-rte-image-focus']);
|
|
655
656
|
return;
|
|
656
657
|
}
|
|
657
|
-
else if (brNode) {
|
|
658
|
-
detach(
|
|
658
|
+
else if (brNode && brLastChildNode && brLastChildNode.nodeName === 'BR') {
|
|
659
|
+
detach(brLastChildNode);
|
|
659
660
|
e.args.preventDefault();
|
|
660
661
|
}
|
|
661
662
|
if (!isNullOrUndefined(this.deleteRangeElement) && (this.deleteOldRangeElement.tagName !== 'OL' && this.deleteOldRangeElement.tagName !== 'UL')
|
|
@@ -115,12 +115,12 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
115
115
|
if (e.args && !isNOU(e.args.clipboardData)) {
|
|
116
116
|
value = e.args.clipboardData.getData('text/html');
|
|
117
117
|
}
|
|
118
|
-
this.parent.trigger(events.beforePasteCleanup, { value: value });
|
|
119
118
|
if (e.args && value !== null && this.parent.editorMode === 'HTML') {
|
|
120
119
|
var file = void 0;
|
|
121
120
|
if (value.length === 0) {
|
|
122
121
|
var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i);
|
|
123
122
|
value = e.args.clipboardData.getData('text/plain');
|
|
123
|
+
this.parent.trigger(events.beforePasteCleanup, { value: value });
|
|
124
124
|
this.isNotFromHtml = value !== '' ? true : false;
|
|
125
125
|
value = value.replace(/</g, '<');
|
|
126
126
|
value = value.replace(/>/g, '>');
|
|
@@ -153,6 +153,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
else if (value.length > 0) {
|
|
156
|
+
this.parent.trigger(events.beforePasteCleanup, { value: value });
|
|
156
157
|
this.parent.formatter.editorManager.observer.notify(EVENTS.MS_WORD_CLEANUP, {
|
|
157
158
|
args: e.args,
|
|
158
159
|
text: e.text,
|
|
@@ -588,14 +588,14 @@ export interface RichTextEditorModel extends ComponentModel{
|
|
|
588
588
|
* default: 'Paragraph',
|
|
589
589
|
* width: '65px',
|
|
590
590
|
* types: [
|
|
591
|
-
* { text: 'Paragraph' },
|
|
592
|
-
* { text: '
|
|
593
|
-
* { text: 'Heading
|
|
594
|
-
* { text: 'Heading
|
|
595
|
-
* { text: 'Heading
|
|
596
|
-
* { text: 'Heading
|
|
597
|
-
* { text: 'Heading
|
|
598
|
-
* { text: '
|
|
591
|
+
* { text: 'Paragraph', value: 'P'},
|
|
592
|
+
* { text: 'Heading 1', value: 'H1' },
|
|
593
|
+
* { text: 'Heading 2', value: 'H2' },
|
|
594
|
+
* { text: 'Heading 3', value: 'H3' },
|
|
595
|
+
* { text: 'Heading 4', value: 'H4' },
|
|
596
|
+
* { text: 'Heading 5', value: 'H5' },
|
|
597
|
+
* { text: 'Heading 6', value: 'H6' },
|
|
598
|
+
* { text: 'Preformatted', value: 'Pre' },
|
|
599
599
|
* ]
|
|
600
600
|
* }
|
|
601
601
|
*/
|
|
@@ -757,14 +757,14 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
757
757
|
* default: 'Paragraph',
|
|
758
758
|
* width: '65px',
|
|
759
759
|
* types: [
|
|
760
|
-
* { text: 'Paragraph' },
|
|
761
|
-
* { text: '
|
|
762
|
-
* { text: 'Heading
|
|
763
|
-
* { text: 'Heading
|
|
764
|
-
* { text: 'Heading
|
|
765
|
-
* { text: 'Heading
|
|
766
|
-
* { text: 'Heading
|
|
767
|
-
* { text: '
|
|
760
|
+
* { text: 'Paragraph', value: 'P'},
|
|
761
|
+
* { text: 'Heading 1', value: 'H1' },
|
|
762
|
+
* { text: 'Heading 2', value: 'H2' },
|
|
763
|
+
* { text: 'Heading 3', value: 'H3' },
|
|
764
|
+
* { text: 'Heading 4', value: 'H4' },
|
|
765
|
+
* { text: 'Heading 5', value: 'H5' },
|
|
766
|
+
* { text: 'Heading 6', value: 'H6' },
|
|
767
|
+
* { text: 'Preformatted', value: 'Pre' },
|
|
768
768
|
* ]
|
|
769
769
|
* }
|
|
770
770
|
*/
|
|
@@ -2428,7 +2428,6 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2428
2428
|
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
2429
2429
|
if (iframeElement) {
|
|
2430
2430
|
this.setAutoHeight(iframeElement);
|
|
2431
|
-
this.inputElement.style.overflow = 'hidden';
|
|
2432
2431
|
}
|
|
2433
2432
|
}
|
|
2434
2433
|
}
|
|
@@ -2453,9 +2452,14 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2453
2452
|
};
|
|
2454
2453
|
RichTextEditor.prototype.setAutoHeight = function (element) {
|
|
2455
2454
|
if (!isNOU(element)) {
|
|
2456
|
-
element.
|
|
2457
|
-
|
|
2458
|
-
|
|
2455
|
+
if (element.nodeName === 'TEXTAREA') {
|
|
2456
|
+
element.style.height = 'auto';
|
|
2457
|
+
element.style.height = (this.inputElement.scrollHeight + 16) + 'px';
|
|
2458
|
+
element.style.overflow = 'hidden';
|
|
2459
|
+
}
|
|
2460
|
+
else if (element.nodeName === 'IFRAME') {
|
|
2461
|
+
element.style.height = this.inputElement.parentElement.offsetHeight + 'px';
|
|
2462
|
+
}
|
|
2459
2463
|
}
|
|
2460
2464
|
};
|
|
2461
2465
|
RichTextEditor.prototype.wireEvents = function () {
|
|
@@ -8,7 +8,7 @@ import { IRenderer, IRichTextEditor } from '../base/interface';
|
|
|
8
8
|
export declare class ContentRender implements IRenderer {
|
|
9
9
|
protected contentPanel: Element;
|
|
10
10
|
protected parent: IRichTextEditor;
|
|
11
|
-
protected editableElement:
|
|
11
|
+
protected editableElement: HTMLElement;
|
|
12
12
|
/**
|
|
13
13
|
* Constructor for content renderer module
|
|
14
14
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getEditValue } from '../base/util';
|
|
2
|
+
import { isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
2
3
|
/**
|
|
3
4
|
* Content module is used to render Rich Text Editor content
|
|
4
5
|
*
|
|
@@ -30,9 +31,15 @@ var ContentRender = /** @class */ (function () {
|
|
|
30
31
|
id: this.parent.getID() + '_rte-edit-view',
|
|
31
32
|
attrs: {
|
|
32
33
|
'contenteditable': 'true'
|
|
33
|
-
}
|
|
34
|
-
innerHTML: rteContent
|
|
34
|
+
}
|
|
35
35
|
});
|
|
36
|
+
if (!isNOU(this.parent.fontFamily.default)) {
|
|
37
|
+
this.editableElement.style.fontFamily = this.parent.fontFamily.default;
|
|
38
|
+
}
|
|
39
|
+
if (!isNOU(this.parent.fontSize.default)) {
|
|
40
|
+
this.editableElement.style.fontSize = this.parent.fontSize.default;
|
|
41
|
+
}
|
|
42
|
+
this.editableElement.innerHTML = rteContent;
|
|
36
43
|
div.appendChild(this.editableElement);
|
|
37
44
|
this.setPanel(div);
|
|
38
45
|
rteObj.rootContainer.appendChild(div);
|