@syncfusion/ej2-richtexteditor 23.2.7-52849 → 24.1.41
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/.eslintrc.json +260 -0
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +40 -40
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +27 -27
- package/CHANGELOG.md +1775 -1751
- package/README.md +76 -76
- package/dist/ej2-richtexteditor.min.js +10 -0
- package/dist/ej2-richtexteditor.umd.min.js +10 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +682 -434
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +791 -543
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +11 -0
- package/dist/global/ej2-richtexteditor.min.js.map +1 -0
- package/dist/global/index.d.ts +14 -0
- package/helpers/e2e/index.js +3 -3
- package/helpers/e2e/rte-helper.js +13 -13
- package/license +9 -9
- package/package.json +74 -74
- package/src/common/config.js +1 -1
- package/src/common/interface.d.ts +7 -7
- package/src/editor-manager/base/classes.d.ts +1 -1
- package/src/editor-manager/base/classes.js +1 -1
- package/src/editor-manager/base/editor-manager.d.ts +3 -3
- package/src/editor-manager/base/editor-manager.js +3 -3
- package/src/editor-manager/base/enum.d.ts +2 -2
- package/src/editor-manager/base/interface.d.ts +9 -9
- package/src/editor-manager/base/types.d.ts +1 -1
- package/src/editor-manager/plugin/alignments.d.ts +2 -2
- package/src/editor-manager/plugin/alignments.js +2 -2
- package/src/editor-manager/plugin/audio.d.ts +3 -3
- package/src/editor-manager/plugin/audio.js +16 -6
- package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +1 -1
- package/src/editor-manager/plugin/clearformat.js +1 -1
- package/src/editor-manager/plugin/dom-node.d.ts +34 -34
- package/src/editor-manager/plugin/dom-node.js +35 -48
- package/src/editor-manager/plugin/format-painter-actions.d.ts +1 -1
- package/src/editor-manager/plugin/format-painter-actions.js +1 -1
- package/src/editor-manager/plugin/formats.d.ts +2 -2
- package/src/editor-manager/plugin/formats.js +2 -2
- package/src/editor-manager/plugin/image.d.ts +3 -3
- package/src/editor-manager/plugin/image.js +33 -6
- package/src/editor-manager/plugin/indents.d.ts +2 -2
- package/src/editor-manager/plugin/indents.js +2 -2
- package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
- package/src/editor-manager/plugin/insert-methods.js +4 -4
- package/src/editor-manager/plugin/insert-text.d.ts +2 -2
- package/src/editor-manager/plugin/insert-text.js +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
- package/src/editor-manager/plugin/inserthtml.d.ts +2 -2
- package/src/editor-manager/plugin/inserthtml.js +7 -4
- package/src/editor-manager/plugin/isformatted.d.ts +8 -8
- package/src/editor-manager/plugin/isformatted.js +8 -8
- package/src/editor-manager/plugin/link.d.ts +2 -2
- package/src/editor-manager/plugin/link.js +2 -2
- package/src/editor-manager/plugin/lists.d.ts +2 -2
- package/src/editor-manager/plugin/lists.js +2 -2
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +5 -2
- package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
- package/src/editor-manager/plugin/nodecutter.js +7 -7
- package/src/editor-manager/plugin/selection-commands.d.ts +1 -1
- package/src/editor-manager/plugin/selection-commands.js +40 -1
- package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
- package/src/editor-manager/plugin/selection-exec.js +2 -2
- package/src/editor-manager/plugin/table.d.ts +2 -2
- package/src/editor-manager/plugin/table.js +2 -2
- package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +2 -2
- package/src/editor-manager/plugin/undo.d.ts +6 -6
- package/src/editor-manager/plugin/undo.js +6 -6
- package/src/editor-manager/plugin/video.d.ts +3 -3
- package/src/editor-manager/plugin/video.js +3 -3
- package/src/markdown-parser/base/interface.d.ts +10 -10
- package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
- package/src/markdown-parser/base/markdown-parser.js +3 -3
- package/src/markdown-parser/base/types.d.ts +1 -1
- package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
- package/src/markdown-parser/plugin/clearformat.js +2 -2
- package/src/markdown-parser/plugin/formats.d.ts +2 -2
- package/src/markdown-parser/plugin/formats.js +2 -2
- package/src/markdown-parser/plugin/insert-text.d.ts +2 -2
- package/src/markdown-parser/plugin/insert-text.js +2 -2
- package/src/markdown-parser/plugin/link.d.ts +2 -2
- package/src/markdown-parser/plugin/link.js +2 -2
- package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
- package/src/markdown-parser/plugin/markdown-selection.js +14 -14
- package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
- package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
- package/src/markdown-parser/plugin/table.d.ts +3 -3
- package/src/markdown-parser/plugin/table.js +3 -3
- package/src/markdown-parser/plugin/undo.d.ts +6 -6
- package/src/markdown-parser/plugin/undo.js +6 -6
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +9 -9
- package/src/rich-text-editor/actions/base-quick-toolbar.js +27 -13
- package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/base-toolbar.js +3 -3
- package/src/rich-text-editor/actions/color-picker.d.ts +2 -2
- package/src/rich-text-editor/actions/color-picker.js +5 -5
- package/src/rich-text-editor/actions/count.d.ts +3 -3
- package/src/rich-text-editor/actions/count.js +3 -3
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
- package/src/rich-text-editor/actions/dropdown-buttons.js +6 -4
- package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
- package/src/rich-text-editor/actions/emoji-picker.js +13 -4
- package/src/rich-text-editor/actions/enter-key.js +2 -1
- package/src/rich-text-editor/actions/file-manager.js +1 -1
- package/src/rich-text-editor/actions/format-painter.js +1 -1
- package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
- package/src/rich-text-editor/actions/full-screen.js +5 -5
- package/src/rich-text-editor/actions/html-editor.d.ts +5 -3
- package/src/rich-text-editor/actions/html-editor.js +32 -6
- package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
- package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
- package/src/rich-text-editor/actions/keyboard.js +20 -20
- package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/markdown-editor.js +2 -2
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +3 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +73 -20
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +9 -9
- package/src/rich-text-editor/actions/quick-toolbar.js +33 -14
- package/src/rich-text-editor/actions/toolbar.d.ts +14 -13
- package/src/rich-text-editor/actions/toolbar.js +31 -23
- package/src/rich-text-editor/actions/xhtml-validation.d.ts +1 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- package/src/rich-text-editor/base/classes.d.ts +126 -121
- package/src/rich-text-editor/base/classes.js +126 -121
- package/src/rich-text-editor/base/constant.d.ts +155 -150
- package/src/rich-text-editor/base/constant.js +155 -150
- package/src/rich-text-editor/base/enum.d.ts +1 -1
- package/src/rich-text-editor/base/enum.js +1 -1
- package/src/rich-text-editor/base/interface.d.ts +59 -49
- package/src/rich-text-editor/base/interface.js +1 -1
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +891 -891
- package/src/rich-text-editor/base/rich-text-editor.d.ts +69 -60
- package/src/rich-text-editor/base/rich-text-editor.js +143 -80
- package/src/rich-text-editor/base/util.d.ts +1 -1
- package/src/rich-text-editor/base/util.js +12 -3
- package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
- package/src/rich-text-editor/formatter/formatter.js +9 -9
- package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/html-formatter.js +15 -15
- package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
- package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
- package/src/rich-text-editor/models/default-locale.js +2 -0
- package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
- package/src/rich-text-editor/models/iframe-settings.js +19 -19
- package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
- package/src/rich-text-editor/models/inline-mode.js +19 -19
- package/src/rich-text-editor/models/items.js +1 -1
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
- package/src/rich-text-editor/models/toolbar-settings.js +19 -19
- package/src/rich-text-editor/renderer/audio-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/audio-module.js +1 -1
- package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/content-renderer.js +6 -6
- package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +12 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +17 -17
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/image-module.js +53 -53
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +44 -24
- package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
- package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
- package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
- package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
- package/src/rich-text-editor/renderer/render.d.ts +2 -2
- package/src/rich-text-editor/renderer/render.js +2 -2
- package/src/rich-text-editor/renderer/table-module.d.ts +3 -1
- package/src/rich-text-editor/renderer/table-module.js +44 -31
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +9 -15
- package/src/rich-text-editor/renderer/toolbar-renderer.js +22 -102
- package/src/rich-text-editor/renderer/video-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/video-module.js +1 -1
- package/src/rich-text-editor/renderer/view-source.d.ts +6 -6
- package/src/rich-text-editor/renderer/view-source.js +9 -7
- package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
- package/src/rich-text-editor/services/renderer-factory.js +3 -3
- package/src/rich-text-editor/services/service-locator.d.ts +3 -3
- package/src/rich-text-editor/services/service-locator.js +3 -3
- package/src/selection/selection.d.ts +22 -22
- package/src/selection/selection.js +22 -22
- package/styles/_all.scss +1 -1
- package/styles/bootstrap-dark.css +194 -52
- package/styles/bootstrap.css +197 -53
- package/styles/bootstrap4.css +194 -52
- package/styles/bootstrap5-dark.css +195 -53
- package/styles/bootstrap5.css +195 -53
- package/styles/fabric-dark.css +194 -52
- package/styles/fabric.css +194 -52
- package/styles/fluent-dark.css +197 -53
- package/styles/fluent.css +197 -53
- package/styles/highcontrast-light.css +194 -52
- package/styles/highcontrast.css +194 -52
- package/styles/material-dark.css +196 -53
- package/styles/material.css +196 -53
- package/styles/material3-dark.css +194 -52
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +194 -52
- package/styles/material3.scss +1 -1
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +277 -277
- package/styles/rich-text-editor/_bootstrap-definition.scss +334 -334
- package/styles/rich-text-editor/_bootstrap4-definition.scss +460 -460
- package/styles/rich-text-editor/_bootstrap5-definition.scss +262 -262
- package/styles/rich-text-editor/_fabric-dark-definition.scss +259 -259
- package/styles/rich-text-editor/_fabric-definition.scss +257 -257
- package/styles/rich-text-editor/_fluent-definition.scss +263 -263
- package/styles/rich-text-editor/_fusionnew-definition.scss +261 -261
- package/styles/rich-text-editor/_highcontrast-definition.scss +257 -257
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +257 -257
- package/styles/rich-text-editor/_layout.scss +2147 -2072
- package/styles/rich-text-editor/_material-dark-definition.scss +262 -262
- package/styles/rich-text-editor/_material-definition.scss +260 -260
- package/styles/rich-text-editor/_material3-definition.scss +262 -262
- package/styles/rich-text-editor/_tailwind-definition.scss +257 -257
- package/styles/rich-text-editor/_theme.scss +837 -837
- package/styles/rich-text-editor/bootstrap-dark.css +194 -52
- package/styles/rich-text-editor/bootstrap.css +197 -53
- package/styles/rich-text-editor/bootstrap4.css +194 -52
- package/styles/rich-text-editor/bootstrap5-dark.css +195 -53
- package/styles/rich-text-editor/bootstrap5.css +195 -53
- package/styles/rich-text-editor/fabric-dark.css +194 -52
- package/styles/rich-text-editor/fabric.css +194 -52
- package/styles/rich-text-editor/fluent-dark.css +197 -53
- package/styles/rich-text-editor/fluent.css +197 -53
- package/styles/rich-text-editor/highcontrast-light.css +194 -52
- package/styles/rich-text-editor/highcontrast.css +194 -52
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap4.scss +349 -349
- package/styles/rich-text-editor/icons/_bootstrap5.scss +348 -348
- package/styles/rich-text-editor/icons/_fabric-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_fabric.scss +349 -349
- package/styles/rich-text-editor/icons/_fluent.scss +348 -348
- package/styles/rich-text-editor/icons/_fusionnew.scss +348 -348
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +349 -349
- package/styles/rich-text-editor/icons/_highcontrast.scss +349 -349
- package/styles/rich-text-editor/icons/_material-dark.scss +349 -349
- package/styles/rich-text-editor/icons/_material.scss +349 -349
- package/styles/rich-text-editor/icons/_material3.scss +348 -348
- package/styles/rich-text-editor/icons/_tailwind.scss +348 -348
- package/styles/rich-text-editor/material-dark.css +196 -53
- package/styles/rich-text-editor/material.css +196 -53
- package/styles/rich-text-editor/material3-dark.css +194 -52
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +194 -52
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +194 -52
- package/styles/rich-text-editor/tailwind.css +194 -52
- package/styles/tailwind-dark.css +194 -52
- package/styles/tailwind.css +194 -52
- package/tslint.json +111 -0
- package/src/global.d.ts +0 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __assign = (this && this.__assign) || function () {
|
|
15
|
-
__assign = Object.assign || function(t) {
|
|
16
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
s = arguments[i];
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
return __assign.apply(this, arguments);
|
|
24
|
-
};
|
|
25
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
26
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
27
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
28
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
29
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
30
|
-
};
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __assign = (this && this.__assign) || function () {
|
|
15
|
+
__assign = Object.assign || function(t) {
|
|
16
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
+
s = arguments[i];
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
return __assign.apply(this, arguments);
|
|
24
|
+
};
|
|
25
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
26
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
27
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
28
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
29
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
30
|
+
};
|
|
31
31
|
import { Component, EventHandler, Complex, Browser, addClass, select, detach } from '@syncfusion/ej2-base';
|
|
32
32
|
import { Property, NotifyPropertyChanges, formatUnit, L10n, closest } from '@syncfusion/ej2-base';
|
|
33
33
|
import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';
|
|
@@ -79,7 +79,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
79
79
|
*
|
|
80
80
|
* @returns {ModuleDeclaration[]} - specifies the declaration.
|
|
81
81
|
* @hidden
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
*/
|
|
84
84
|
RichTextEditor.prototype.requiredModules = function () {
|
|
85
85
|
var modules = [];
|
|
@@ -162,7 +162,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
162
162
|
*
|
|
163
163
|
* @returns {void}
|
|
164
164
|
* @hidden
|
|
165
|
-
|
|
165
|
+
|
|
166
166
|
*/
|
|
167
167
|
RichTextEditor.prototype.setEnable = function () {
|
|
168
168
|
this.updateEnable();
|
|
@@ -260,7 +260,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
260
260
|
*
|
|
261
261
|
* @returns {void}
|
|
262
262
|
* @hidden
|
|
263
|
-
|
|
263
|
+
|
|
264
264
|
*/
|
|
265
265
|
RichTextEditor.prototype.getPersistData = function () {
|
|
266
266
|
return this.addOnPersist(['value']);
|
|
@@ -390,7 +390,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
390
390
|
if (tool.command === 'InsertText') {
|
|
391
391
|
currentInsertContentLength = value.length;
|
|
392
392
|
}
|
|
393
|
-
var currentLength = this.getText().trim().length;
|
|
393
|
+
var currentLength = this.getText().trim().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
394
394
|
var selectionLength = this.getSelection().length;
|
|
395
395
|
var totalLength = (currentLength - selectionLength) + currentInsertContentLength;
|
|
396
396
|
if (!(this.maxLength === -1 || totalLength <= this.maxLength)) {
|
|
@@ -548,7 +548,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
548
548
|
*
|
|
549
549
|
* @returns {void}
|
|
550
550
|
* @private
|
|
551
|
-
|
|
551
|
+
|
|
552
552
|
*/
|
|
553
553
|
RichTextEditor.prototype.render = function () {
|
|
554
554
|
if (this.value && !this.valueTemplate) {
|
|
@@ -565,7 +565,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
565
565
|
if (this.enableXhtml) {
|
|
566
566
|
this.setProperties({ value: this.getXhtml() }, true);
|
|
567
567
|
}
|
|
568
|
-
if (this.toolbarSettings.enable && this.toolbarSettings.type === 'Expand' && !isNOU(this.getToolbar()) &&
|
|
568
|
+
if (this.toolbarSettings.enable && (this.toolbarSettings.type === 'Expand' || this.toolbarSettings.type === 'MultiRow' || this.toolbarSettings.type === 'Scrollable') && !isNOU(this.getToolbar()) &&
|
|
569
569
|
(this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
|
|
570
570
|
this.disableToolbarItem(['Undo', 'Redo']);
|
|
571
571
|
}
|
|
@@ -575,7 +575,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
575
575
|
}
|
|
576
576
|
// eslint-disable-next-line
|
|
577
577
|
(this.enabled && !this.readonly) ? this.eventInitializer() : this.unWireEvents();
|
|
578
|
-
this.notify(events.bindCssClass, { cssClass: this.
|
|
578
|
+
this.notify(events.bindCssClass, { cssClass: this.getCssClass() });
|
|
579
579
|
this.addAudioVideoWrapper();
|
|
580
580
|
this.notify(events.tableclass, {});
|
|
581
581
|
this.renderComplete();
|
|
@@ -585,7 +585,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
585
585
|
*
|
|
586
586
|
* @returns {void}
|
|
587
587
|
* @hidden
|
|
588
|
-
|
|
588
|
+
|
|
589
589
|
*/
|
|
590
590
|
RichTextEditor.prototype.addAudioVideoWrapper = function () {
|
|
591
591
|
var _this = this;
|
|
@@ -647,7 +647,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
647
647
|
*
|
|
648
648
|
* @returns {void}
|
|
649
649
|
* @private
|
|
650
|
-
|
|
650
|
+
|
|
651
651
|
* @hidden
|
|
652
652
|
*/
|
|
653
653
|
RichTextEditor.prototype.eventInitializer = function () {
|
|
@@ -666,7 +666,13 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
666
666
|
range.endContainer;
|
|
667
667
|
var closestLI = closest(endNode, 'LI');
|
|
668
668
|
var isDetached = false;
|
|
669
|
-
|
|
669
|
+
var currentRangeEndOffset = range.endOffset;
|
|
670
|
+
if (currentEndContainer.nodeType === Node.TEXT_NODE) {
|
|
671
|
+
if (currentEndContainer.textContent.charAt(currentRangeEndOffset - 1) === '\uFEFF') {
|
|
672
|
+
currentRangeEndOffset--;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
if (!isNOU(closestLI) && endNode.textContent.trim().length === currentRangeEndOffset &&
|
|
670
676
|
!range.collapsed && isNOU(endNode.nextElementSibling)) {
|
|
671
677
|
for (var i = 0; i < closestLI.childNodes.length; i++) {
|
|
672
678
|
if (closestLI.childNodes[i].nodeName === '#text' && closestLI.childNodes[i].textContent.trim().length === 0) {
|
|
@@ -692,7 +698,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
692
698
|
* @param {KeyboardEvent} e - specifies the event.
|
|
693
699
|
* @returns {void}
|
|
694
700
|
* @private
|
|
695
|
-
|
|
701
|
+
|
|
696
702
|
* @hidden
|
|
697
703
|
*/
|
|
698
704
|
RichTextEditor.prototype.keyDown = function (e) {
|
|
@@ -745,7 +751,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
745
751
|
}
|
|
746
752
|
var notFormatPainterCopy = isNOU(e.action) ? true : (e.action !== 'format-copy' ? true : false);
|
|
747
753
|
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy &&
|
|
748
|
-
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which
|
|
754
|
+
!(e.altKey || e.shiftKey || (e.altKey && e.shiftKey && e.which == 67))) {
|
|
749
755
|
this.formatter.saveData();
|
|
750
756
|
}
|
|
751
757
|
if (e.action !== 'insert-link' &&
|
|
@@ -814,7 +820,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
814
820
|
this.formatter.onKeyHandler(this, e);
|
|
815
821
|
}
|
|
816
822
|
if (this.inputElement && this.inputElement.textContent.length !== 0
|
|
817
|
-
|| this.element.querySelectorAll('.e-toolbar-item.e-active').length > 0) {
|
|
823
|
+
|| this.element.querySelectorAll('.e-toolbar-item.e-active').length > 0 || this.formatter.getUndoRedoStack().length > 0) {
|
|
818
824
|
this.notify(events.toolbarRefresh, { args: e });
|
|
819
825
|
}
|
|
820
826
|
if (!isNOU(this.placeholder)) {
|
|
@@ -828,7 +834,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
828
834
|
* @param {string} value - specifies the value.
|
|
829
835
|
* @returns {void}
|
|
830
836
|
* @hidden
|
|
831
|
-
|
|
837
|
+
|
|
832
838
|
*/
|
|
833
839
|
RichTextEditor.prototype.serializeValue = function (value) {
|
|
834
840
|
if (this.editorMode === 'HTML' && !isNOU(value)) {
|
|
@@ -859,7 +865,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
859
865
|
* @param {string} value - specifies the string value.
|
|
860
866
|
* @returns {void}
|
|
861
867
|
* @hidden
|
|
862
|
-
|
|
868
|
+
|
|
863
869
|
*/
|
|
864
870
|
RichTextEditor.prototype.updateValue = function (value) {
|
|
865
871
|
if (isNOU(value)) {
|
|
@@ -906,26 +912,67 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
906
912
|
return;
|
|
907
913
|
}
|
|
908
914
|
}
|
|
909
|
-
this.notifyMouseUp(e);
|
|
910
915
|
if (e.detail === 3) {
|
|
911
916
|
var range = this.getRange();
|
|
912
917
|
var selection = this.formatter.editorManager.domNode.getSelection();
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
918
|
+
// To handle the triple click node selection improper range due to browser behavior.
|
|
919
|
+
if (selection.rangeCount > 0 && !isNOU(range.startContainer.parentElement) && (!isNOU(range.startContainer.parentElement.nextSibling) &&
|
|
920
|
+
(range.startContainer.parentElement.nextSibling.nodeType !== 3 ||
|
|
921
|
+
/\s+$/.test(range.startContainer.parentElement.nextSibling.textContent)) || range.startOffset === range.endOffset)
|
|
922
|
+
|| range.startContainer.parentElement.tagName.toLocaleLowerCase() === 'li') {
|
|
923
|
+
var newRange = new Range();
|
|
924
|
+
var start = range.startContainer;
|
|
925
|
+
var end = range.endContainer;
|
|
926
|
+
var isInvalid = false;
|
|
927
|
+
var isInsideList = range.commonAncestorContainer.nodeName === 'OL' || range.commonAncestorContainer.nodeName === 'UL'
|
|
928
|
+
|| range.commonAncestorContainer.nodeName === 'LI';
|
|
929
|
+
if (!isInsideList && end.nodeType === 1 && end.nodeName === 'LI') {
|
|
930
|
+
end = closest(end, 'ol, ul').previousElementSibling.lastElementChild;
|
|
931
|
+
}
|
|
932
|
+
else if (isInsideList && end.nodeType === 1 && range.endOffset === 0) {
|
|
933
|
+
if (end.previousElementSibling && end.previousElementSibling.lastElementChild) {
|
|
934
|
+
end = end.previousElementSibling.lastElementChild;
|
|
935
|
+
}
|
|
936
|
+
else {
|
|
937
|
+
end = closest(end.parentElement, 'li');
|
|
938
|
+
if (end && end.nodeName === 'LI') {
|
|
939
|
+
end = end.previousElementSibling;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
else {
|
|
944
|
+
if (!closest(end, 'li') && end.previousElementSibling && end.previousElementSibling.lastChild &&
|
|
945
|
+
end.previousElementSibling.textContent.trim().length > 0) {
|
|
946
|
+
end = end.previousElementSibling.lastChild;
|
|
947
|
+
}
|
|
948
|
+
else if (closest(end, 'li') && end.previousElementSibling && end.previousElementSibling.lastChild) {
|
|
949
|
+
end = closest(end, 'li').parentElement.previousElementSibling.lastChild;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
if (!end || end === this.inputElement) {
|
|
953
|
+
end = start;
|
|
954
|
+
isInvalid = true;
|
|
955
|
+
}
|
|
956
|
+
while (end.nodeName !== '#text' && !isInvalid) {
|
|
957
|
+
if (end.lastElementChild) {
|
|
958
|
+
end = end.lastElementChild;
|
|
959
|
+
}
|
|
960
|
+
else {
|
|
961
|
+
end = end.lastChild;
|
|
962
|
+
}
|
|
920
963
|
}
|
|
964
|
+
newRange.setStart(start, 0);
|
|
965
|
+
newRange.setEnd(end, end.textContent.length);
|
|
966
|
+
this.formatter.editorManager.nodeSelection.setRange(this.contentModule.getDocument(), newRange);
|
|
921
967
|
}
|
|
922
968
|
}
|
|
969
|
+
this.notifyMouseUp(e);
|
|
923
970
|
};
|
|
924
971
|
/**
|
|
925
972
|
* @param {Function} module - specifies the module function.
|
|
926
973
|
* @returns {void}
|
|
927
974
|
* @hidden
|
|
928
|
-
|
|
975
|
+
|
|
929
976
|
*/
|
|
930
977
|
RichTextEditor.prototype.ensureModuleInjected = function (module) {
|
|
931
978
|
return this.getInjectedModules().indexOf(module) >= 0;
|
|
@@ -933,7 +980,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
933
980
|
/**
|
|
934
981
|
* @returns {void}
|
|
935
982
|
* @hidden
|
|
936
|
-
|
|
983
|
+
|
|
937
984
|
*/
|
|
938
985
|
RichTextEditor.prototype.onCopy = function () {
|
|
939
986
|
this.contentModule.getDocument().execCommand('copy', false, null);
|
|
@@ -941,7 +988,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
941
988
|
/**
|
|
942
989
|
* @returns {void}
|
|
943
990
|
* @hidden
|
|
944
|
-
|
|
991
|
+
|
|
945
992
|
*/
|
|
946
993
|
RichTextEditor.prototype.onCut = function () {
|
|
947
994
|
this.contentModule.getDocument().execCommand('cut', false, null);
|
|
@@ -950,7 +997,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
950
997
|
* @param {KeyboardEvent} e - specifies the keyboard event.
|
|
951
998
|
* @returns {void}
|
|
952
999
|
* @hidden
|
|
953
|
-
|
|
1000
|
+
|
|
954
1001
|
*/
|
|
955
1002
|
RichTextEditor.prototype.onPaste = function (e) {
|
|
956
1003
|
var _this = this;
|
|
@@ -963,7 +1010,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
963
1010
|
var currentLength = _this.inputElement.textContent.length;
|
|
964
1011
|
var selectionLength = _this.getSelection().length;
|
|
965
1012
|
var pastedContentLength = (isNOU(e) || isNOU(e.clipboardData))
|
|
966
|
-
? 0 : e.clipboardData.getData('text/plain').length;
|
|
1013
|
+
? 0 : e.clipboardData.getData('text/plain').replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
967
1014
|
var totalLength = (currentLength - selectionLength) + pastedContentLength;
|
|
968
1015
|
if (_this.editorMode === 'Markdown') {
|
|
969
1016
|
var args_1 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
@@ -1013,7 +1060,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1013
1060
|
* @param {MouseEvent} event - specifies the event.
|
|
1014
1061
|
* @returns {void}
|
|
1015
1062
|
* @hidden
|
|
1016
|
-
|
|
1063
|
+
|
|
1017
1064
|
*/
|
|
1018
1065
|
RichTextEditor.prototype.clipboardAction = function (action, event) {
|
|
1019
1066
|
switch (action.toLowerCase()) {
|
|
@@ -1206,7 +1253,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1206
1253
|
*
|
|
1207
1254
|
* @returns {void}
|
|
1208
1255
|
* @private
|
|
1209
|
-
|
|
1256
|
+
|
|
1210
1257
|
*/
|
|
1211
1258
|
RichTextEditor.prototype.getModuleName = function () {
|
|
1212
1259
|
return 'richtexteditor';
|
|
@@ -1218,7 +1265,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1218
1265
|
* @param {RichTextEditorModel} oldProp - specifies the old property.
|
|
1219
1266
|
* @returns {void}
|
|
1220
1267
|
* @hidden
|
|
1221
|
-
|
|
1268
|
+
|
|
1222
1269
|
*/
|
|
1223
1270
|
/* eslint-disable */
|
|
1224
1271
|
RichTextEditor.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
@@ -1373,7 +1420,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1373
1420
|
/**
|
|
1374
1421
|
* @hidden
|
|
1375
1422
|
* @returns {void}
|
|
1376
|
-
|
|
1423
|
+
|
|
1377
1424
|
*/
|
|
1378
1425
|
RichTextEditor.prototype.updateValueData = function () {
|
|
1379
1426
|
if (this.enableHtmlEncode) {
|
|
@@ -1395,7 +1442,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1395
1442
|
RichTextEditor.prototype.updatePanelValue = function () {
|
|
1396
1443
|
var value = this.value;
|
|
1397
1444
|
value = (this.enableHtmlEncode && this.value) ? decode(value) : value;
|
|
1398
|
-
var getTextArea = this.element.querySelector('.
|
|
1445
|
+
var getTextArea = this.element.querySelector('.' + classes.CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
1399
1446
|
if (value) {
|
|
1400
1447
|
if (getTextArea && getTextArea.style.display === 'block') {
|
|
1401
1448
|
getTextArea.value = this.value;
|
|
@@ -1460,7 +1507,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1460
1507
|
*
|
|
1461
1508
|
* @returns {void}
|
|
1462
1509
|
* @hidden
|
|
1463
|
-
|
|
1510
|
+
|
|
1464
1511
|
*/
|
|
1465
1512
|
RichTextEditor.prototype.setPlaceHolder = function () {
|
|
1466
1513
|
if (this.inputElement && this.placeholder && this.iframeSettings.enable !== true) {
|
|
@@ -1538,7 +1585,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1538
1585
|
* @param {boolean} initial - specifies the boolean value
|
|
1539
1586
|
* @returns {void}
|
|
1540
1587
|
* @hidden
|
|
1541
|
-
|
|
1588
|
+
|
|
1542
1589
|
*/
|
|
1543
1590
|
RichTextEditor.prototype.setReadOnly = function (initial) {
|
|
1544
1591
|
this.updateReadOnly();
|
|
@@ -1639,7 +1686,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1639
1686
|
*
|
|
1640
1687
|
* @returns {void}
|
|
1641
1688
|
* @public
|
|
1642
|
-
|
|
1689
|
+
|
|
1643
1690
|
*/
|
|
1644
1691
|
RichTextEditor.prototype.getRange = function () {
|
|
1645
1692
|
return this.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
@@ -1784,7 +1831,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1784
1831
|
*
|
|
1785
1832
|
* @returns {void}
|
|
1786
1833
|
* @hidden
|
|
1787
|
-
|
|
1834
|
+
|
|
1788
1835
|
*/
|
|
1789
1836
|
RichTextEditor.prototype.getInsertImgMaxWidth = function () {
|
|
1790
1837
|
var maxWidth = this.insertImageSettings.maxWidth;
|
|
@@ -1803,7 +1850,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1803
1850
|
*
|
|
1804
1851
|
* @returns {void}
|
|
1805
1852
|
* @hidden
|
|
1806
|
-
|
|
1853
|
+
|
|
1807
1854
|
*/
|
|
1808
1855
|
RichTextEditor.prototype.getInsertVidMaxWidth = function () {
|
|
1809
1856
|
var maxWidth = this.insertVideoSettings.maxWidth;
|
|
@@ -1824,7 +1871,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1824
1871
|
* @param {boolean} isExpand - specifies the bollean value.
|
|
1825
1872
|
* @returns {void}
|
|
1826
1873
|
* @hidden
|
|
1827
|
-
|
|
1874
|
+
|
|
1828
1875
|
*/
|
|
1829
1876
|
RichTextEditor.prototype.setContentHeight = function (target, isExpand) {
|
|
1830
1877
|
var heightValue;
|
|
@@ -1988,7 +2035,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1988
2035
|
/**
|
|
1989
2036
|
* @returns {void}
|
|
1990
2037
|
* @hidden
|
|
1991
|
-
|
|
2038
|
+
|
|
1992
2039
|
*/
|
|
1993
2040
|
RichTextEditor.prototype.getBaseToolbarObject = function () {
|
|
1994
2041
|
var tbObj;
|
|
@@ -2003,7 +2050,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2003
2050
|
/**
|
|
2004
2051
|
* @returns {void}
|
|
2005
2052
|
* @hidden
|
|
2006
|
-
|
|
2053
|
+
|
|
2007
2054
|
*/
|
|
2008
2055
|
RichTextEditor.prototype.getToolbar = function () {
|
|
2009
2056
|
return this.toolbarModule ? this.toolbarModule.getToolbarElement() : null;
|
|
@@ -2011,7 +2058,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2011
2058
|
/**
|
|
2012
2059
|
* @returns {void}
|
|
2013
2060
|
* @hidden
|
|
2014
|
-
|
|
2061
|
+
|
|
2015
2062
|
*/
|
|
2016
2063
|
RichTextEditor.prototype.getToolbarElement = function () {
|
|
2017
2064
|
return this.toolbarModule && this.toolbarModule.getToolbarElement();
|
|
@@ -2021,11 +2068,21 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2021
2068
|
* getID method
|
|
2022
2069
|
*
|
|
2023
2070
|
* @hidden
|
|
2024
|
-
|
|
2071
|
+
|
|
2025
2072
|
*/
|
|
2026
2073
|
RichTextEditor.prototype.getID = function () {
|
|
2027
2074
|
return (this.originalElement.tagName === 'TEXTAREA' ? this.valueContainer.id : this.element.id);
|
|
2028
2075
|
};
|
|
2076
|
+
/**
|
|
2077
|
+
* @returns {void}
|
|
2078
|
+
* getCssClass method
|
|
2079
|
+
*
|
|
2080
|
+
* @hidden
|
|
2081
|
+
|
|
2082
|
+
*/
|
|
2083
|
+
RichTextEditor.prototype.getCssClass = function (isSpace) {
|
|
2084
|
+
return (isNOU(this.cssClass) ? '' : isSpace ? ' ' + this.cssClass : this.cssClass);
|
|
2085
|
+
};
|
|
2029
2086
|
RichTextEditor.prototype.mouseDownHandler = function (e) {
|
|
2030
2087
|
var touch = (e.touches ? e.changedTouches[0] : e);
|
|
2031
2088
|
addClass([this.element], [classes.CLS_FOCUS]);
|
|
@@ -2044,7 +2101,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2044
2101
|
* @param {FocusEvent} e - specifies the event.
|
|
2045
2102
|
* @returns {void}
|
|
2046
2103
|
* @hidden
|
|
2047
|
-
|
|
2104
|
+
|
|
2048
2105
|
*/
|
|
2049
2106
|
// eslint-disable-next-line
|
|
2050
2107
|
RichTextEditor.prototype.preventDefaultResize = function (e) {
|
|
@@ -2137,7 +2194,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2137
2194
|
};
|
|
2138
2195
|
RichTextEditor.prototype.getUpdatedValue = function () {
|
|
2139
2196
|
var value;
|
|
2140
|
-
var getTextArea = this.element.querySelector('.
|
|
2197
|
+
var getTextArea = this.element.querySelector('.' + classes.CLS_RTE_SOURCE_CODE_TXTAREA);
|
|
2141
2198
|
if (this.editorMode === 'HTML') {
|
|
2142
2199
|
value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
|
|
2143
2200
|
this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
|
|
@@ -2168,6 +2225,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2168
2225
|
clearTimeout(this.idleInterval);
|
|
2169
2226
|
this.idleInterval = setTimeout(this.updateValueOnIdle.bind(this), 0);
|
|
2170
2227
|
};
|
|
2228
|
+
RichTextEditor.prototype.cleanupResizeElements = function (args) {
|
|
2229
|
+
var value = this.removeResizeElement(args.value);
|
|
2230
|
+
return value;
|
|
2231
|
+
};
|
|
2171
2232
|
RichTextEditor.prototype.removeResizeElement = function (value) {
|
|
2172
2233
|
var valueElementWrapper = document.createElement("div");
|
|
2173
2234
|
valueElementWrapper.innerHTML = value;
|
|
@@ -2257,7 +2318,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2257
2318
|
*
|
|
2258
2319
|
* @returns {void}
|
|
2259
2320
|
* @hidden
|
|
2260
|
-
|
|
2321
|
+
|
|
2261
2322
|
*/
|
|
2262
2323
|
RichTextEditor.prototype.contentChanged = function () {
|
|
2263
2324
|
if (this.autoSaveOnIdle) {
|
|
@@ -2272,7 +2333,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2272
2333
|
*
|
|
2273
2334
|
* @returns {void}
|
|
2274
2335
|
* @hidden
|
|
2275
|
-
|
|
2336
|
+
|
|
2276
2337
|
*/
|
|
2277
2338
|
RichTextEditor.prototype.invokeChangeEvent = function () {
|
|
2278
2339
|
var currentValue;
|
|
@@ -2294,7 +2355,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2294
2355
|
/**
|
|
2295
2356
|
* @returns {void}
|
|
2296
2357
|
* @hidden
|
|
2297
|
-
|
|
2358
|
+
|
|
2298
2359
|
*/
|
|
2299
2360
|
RichTextEditor.prototype.wireScrollElementsEvents = function () {
|
|
2300
2361
|
this.scrollParentElements = getScrollableParent(this.element);
|
|
@@ -2324,7 +2385,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2324
2385
|
/**
|
|
2325
2386
|
* @returns {void}
|
|
2326
2387
|
* @hidden
|
|
2327
|
-
|
|
2388
|
+
|
|
2328
2389
|
*/
|
|
2329
2390
|
RichTextEditor.prototype.unWireScrollElementsEvents = function () {
|
|
2330
2391
|
this.scrollParentElements = getScrollableParent(this.element);
|
|
@@ -2355,7 +2416,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2355
2416
|
/**
|
|
2356
2417
|
* @returns {void}
|
|
2357
2418
|
* @hidden
|
|
2358
|
-
|
|
2419
|
+
|
|
2359
2420
|
*/
|
|
2360
2421
|
RichTextEditor.prototype.autoResize = function () {
|
|
2361
2422
|
var _this = this;
|
|
@@ -2389,6 +2450,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2389
2450
|
this.on(events.contentChanged, this.contentChanged, this);
|
|
2390
2451
|
this.on(events.resizeInitialized, this.updateResizeFlag, this);
|
|
2391
2452
|
this.on(events.updateTbItemsStatus, this.updateStatus, this);
|
|
2453
|
+
this.on(events.cleanupResizeElements, this.cleanupResizeElements, this);
|
|
2392
2454
|
if (this.readonly && this.enabled) {
|
|
2393
2455
|
return;
|
|
2394
2456
|
}
|
|
@@ -2475,6 +2537,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2475
2537
|
this.off(events.contentChanged, this.contentChanged);
|
|
2476
2538
|
this.off(events.resizeInitialized, this.updateResizeFlag);
|
|
2477
2539
|
this.off(events.updateTbItemsStatus, this.updateStatus);
|
|
2540
|
+
this.off(events.cleanupResizeElements, this.cleanupResizeElements);
|
|
2478
2541
|
if (this.readonly && this.enabled) {
|
|
2479
2542
|
return;
|
|
2480
2543
|
}
|
|
@@ -88,7 +88,7 @@ export declare function updateUndoRedoStatus(baseToolbar: BaseToolbar, undoRedoS
|
|
|
88
88
|
* @param {string} type - specifies the string type.
|
|
89
89
|
* @returns {void}
|
|
90
90
|
* @hidden
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
*/
|
|
93
93
|
export declare function dispatchEvent(element: Element | HTMLDocument, type: string): void;
|
|
94
94
|
/**
|
|
@@ -265,11 +265,11 @@ export function getTBarItemsIndex(items, toolbarItems) {
|
|
|
265
265
|
continue;
|
|
266
266
|
}
|
|
267
267
|
else {
|
|
268
|
-
if (items[i] === 'OrderedList' && toolbarItems[j].subCommand === 'OL') {
|
|
268
|
+
if ((items[i] === 'OrderedList' || items[i] === 'NumberFormatList') && toolbarItems[j].subCommand === 'OL') {
|
|
269
269
|
itemsIndex.push(j);
|
|
270
270
|
break;
|
|
271
271
|
}
|
|
272
|
-
else if (items[i] === 'UnorderedList' && toolbarItems[j].subCommand === 'UL') {
|
|
272
|
+
else if ((items[i] === 'UnorderedList' || items[i] === 'BulletFormatList') && toolbarItems[j].subCommand === 'UL') {
|
|
273
273
|
itemsIndex.push(j);
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
@@ -321,7 +321,7 @@ export function updateUndoRedoStatus(baseToolbar, undoRedoStatus) {
|
|
|
321
321
|
* @param {string} type - specifies the string type.
|
|
322
322
|
* @returns {void}
|
|
323
323
|
* @hidden
|
|
324
|
-
|
|
324
|
+
|
|
325
325
|
*/
|
|
326
326
|
export function dispatchEvent(element, type) {
|
|
327
327
|
var evt = document.createEvent('HTMLEvents');
|
|
@@ -422,6 +422,15 @@ export function updateTextNode(value, rteObj) {
|
|
|
422
422
|
for (var i = 0; i < emptyBlockElem.length; i++) {
|
|
423
423
|
emptyBlockElem[i].innerHTML = '<br>';
|
|
424
424
|
}
|
|
425
|
+
// To handle the Empty block node with \n
|
|
426
|
+
var allPNodes = tempNode.querySelectorAll('p');
|
|
427
|
+
for (var i = 0; i < allPNodes.length; i++) {
|
|
428
|
+
if (allPNodes[i].textContent.trim().length === 0 && allPNodes[i].childNodes.length === 1
|
|
429
|
+
&& allPNodes[i].childNodes[0].nodeName === '#text' &&
|
|
430
|
+
isNOU(allPNodes[i].childNodes[0].textContent.match(/\u00a0/g))) {
|
|
431
|
+
allPNodes[i].innerHTML = '<br>';
|
|
432
|
+
}
|
|
433
|
+
}
|
|
425
434
|
var emptyInlineElem = tempNode.querySelectorAll(CONSTANT.inlineEmptyNodes);
|
|
426
435
|
for (var i = 0; i < emptyInlineElem.length; i++) {
|
|
427
436
|
emptyInlineElem[i].innerHTML = '​';
|
|
@@ -7,7 +7,7 @@ import { IHtmlUndoRedoData } from '../../editor-manager/base/interface';
|
|
|
7
7
|
* Formatter
|
|
8
8
|
*
|
|
9
9
|
* @hidden
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
*/
|
|
12
12
|
export declare class Formatter {
|
|
13
13
|
editorManager: IEditorModel;
|
|
@@ -21,7 +21,7 @@ export declare class Formatter {
|
|
|
21
21
|
* @param {IItemCollectionArgs} value - specifies the collection arguments
|
|
22
22
|
* @returns {void}
|
|
23
23
|
* @hidden
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
*/
|
|
26
26
|
process(self: IRichTextEditor, args: ActionBeginEventArgs, event: MouseEvent | KeyboardEvent, value: IItemCollectionArgs): void;
|
|
27
27
|
private getAncestorNode;
|
|
@@ -32,7 +32,7 @@ export declare class Formatter {
|
|
|
32
32
|
* @param {KeyboardEvent} e - specifies the keyboard event.
|
|
33
33
|
* @returns {void}
|
|
34
34
|
* @hidden
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
*/
|
|
37
37
|
onKeyHandler(self: IRichTextEditor, e: KeyboardEvent): void;
|
|
38
38
|
/**
|
|
@@ -42,7 +42,7 @@ export declare class Formatter {
|
|
|
42
42
|
* @param {IMarkdownFormatterCallBack} events - specifies the event call back
|
|
43
43
|
* @returns {void}
|
|
44
44
|
* @hidden
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
*/
|
|
47
47
|
onSuccess(self: IRichTextEditor, events: IMarkdownFormatterCallBack | IHtmlFormatterCallBack): void;
|
|
48
48
|
/**
|
|
@@ -51,7 +51,7 @@ export declare class Formatter {
|
|
|
51
51
|
* @param {KeyboardEvent} e - specifies the keyboard event.
|
|
52
52
|
* @returns {void}
|
|
53
53
|
* @hidden
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
*/
|
|
56
56
|
saveData(e?: KeyboardEvent | MouseEvent | IUndoCallBack): void;
|
|
57
57
|
/**
|
|
@@ -59,7 +59,7 @@ export declare class Formatter {
|
|
|
59
59
|
*
|
|
60
60
|
* @returns {void}
|
|
61
61
|
* @hidden
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
*/
|
|
64
64
|
getUndoStatus(): {
|
|
65
65
|
[key: string]: boolean;
|
|
@@ -70,7 +70,7 @@ export declare class Formatter {
|
|
|
70
70
|
* @param {IHtmlUndoRedoData} - specifies the redo data.
|
|
71
71
|
* @returns {void}
|
|
72
72
|
* @hidden
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
*/
|
|
75
75
|
getUndoRedoStack(): IHtmlUndoRedoData[] | MarkdownUndoRedoData[];
|
|
76
76
|
/**
|
|
@@ -79,7 +79,7 @@ export declare class Formatter {
|
|
|
79
79
|
* @param {IRichTextEditor} self - specifies the self element.
|
|
80
80
|
* @returns {void}
|
|
81
81
|
* @hidden
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
*/
|
|
84
84
|
enableUndo(self: IRichTextEditor): void;
|
|
85
85
|
}
|