@syncfusion/ej2-richtexteditor 24.1.41 → 24.1.43-569781
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 +259 -259
- package/CHANGELOG.md +1927 -1775
- package/README.md +76 -76
- package/dist/ej2-richtexteditor.umd.min.js +1 -10
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +2601 -1077
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +2706 -1181
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- 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.d.ts +7 -0
- package/src/common/config.js +11 -0
- package/src/common/constant.d.ts +6 -0
- package/src/common/constant.js +6 -0
- package/src/common/interface.d.ts +19 -7
- package/src/common/types.d.ts +6 -0
- package/src/common/util.d.ts +6 -0
- package/src/common/util.js +61 -20
- package/src/editor-manager/base/classes.d.ts +1 -1
- package/src/editor-manager/base/classes.js +1 -1
- package/src/editor-manager/base/constant.d.ts +6 -0
- package/src/editor-manager/base/constant.js +6 -0
- package/src/editor-manager/base/editor-manager.d.ts +8 -3
- package/src/editor-manager/base/editor-manager.js +62 -3
- package/src/editor-manager/base/enum.d.ts +2 -2
- package/src/editor-manager/base/interface.d.ts +17 -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 +3 -3
- 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 +39 -35
- package/src/editor-manager/plugin/dom-node.js +203 -49
- package/src/editor-manager/plugin/format-painter-actions.d.ts +2 -1
- package/src/editor-manager/plugin/format-painter-actions.js +20 -2
- package/src/editor-manager/plugin/formats.d.ts +3 -2
- package/src/editor-manager/plugin/formats.js +40 -5
- package/src/editor-manager/plugin/image.d.ts +3 -3
- package/src/editor-manager/plugin/image.js +15 -19
- 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 +3 -2
- package/src/editor-manager/plugin/inserthtml.js +64 -7
- 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 +6 -3
- package/src/editor-manager/plugin/lists.d.ts +2 -2
- package/src/editor-manager/plugin/lists.js +123 -67
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +4 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +213 -86
- package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
- package/src/editor-manager/plugin/nodecutter.js +8 -8
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
- package/src/editor-manager/plugin/selection-commands.js +127 -4
- 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 -3
- package/src/editor-manager/plugin/table.js +35 -32
- package/src/editor-manager/plugin/toolbar-status.d.ts +4 -4
- package/src/editor-manager/plugin/toolbar-status.js +22 -12
- package/src/editor-manager/plugin/undo.d.ts +7 -6
- package/src/editor-manager/plugin/undo.js +27 -7
- 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 +12 -12
- package/src/rich-text-editor/actions/base-quick-toolbar.js +57 -20
- package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/base-toolbar.js +35 -37
- package/src/rich-text-editor/actions/color-picker.d.ts +3 -2
- package/src/rich-text-editor/actions/color-picker.js +12 -2
- package/src/rich-text-editor/actions/count.d.ts +3 -3
- package/src/rich-text-editor/actions/count.js +4 -4
- package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
- package/src/rich-text-editor/actions/dropdown-buttons.js +23 -4
- package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
- package/src/rich-text-editor/actions/emoji-picker.js +4 -4
- package/src/rich-text-editor/actions/enter-key.js +4 -3
- package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
- package/src/rich-text-editor/actions/full-screen.js +6 -5
- package/src/rich-text-editor/actions/html-editor.d.ts +5 -5
- package/src/rich-text-editor/actions/html-editor.js +129 -45
- 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 +23 -21
- package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
- package/src/rich-text-editor/actions/markdown-editor.js +5 -3
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +4 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +87 -12
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +16 -9
- package/src/rich-text-editor/actions/quick-toolbar.js +33 -18
- package/src/rich-text-editor/actions/resize.js +2 -1
- package/src/rich-text-editor/actions/toolbar-action.js +1 -1
- package/src/rich-text-editor/actions/toolbar.d.ts +15 -16
- package/src/rich-text-editor/actions/toolbar.js +31 -100
- 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 +121 -126
- package/src/rich-text-editor/base/classes.js +121 -126
- package/src/rich-text-editor/base/constant.d.ts +190 -150
- package/src/rich-text-editor/base/constant.js +359 -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 +87 -53
- 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 +68 -65
- package/src/rich-text-editor/base/rich-text-editor.js +232 -199
- package/src/rich-text-editor/base/util.d.ts +5 -1
- package/src/rich-text-editor/base/util.js +47 -4
- package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
- package/src/rich-text-editor/formatter/formatter.js +23 -12
- 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 +30 -26
- 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 +2 -2
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
- package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
- package/src/rich-text-editor/models/toolbar-settings.js +20 -20
- package/src/rich-text-editor/renderer/audio-module.d.ts +2 -1
- package/src/rich-text-editor/renderer/audio-module.js +14 -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 +4 -2
- package/src/rich-text-editor/renderer/dialog-renderer.js +14 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +19 -18
- package/src/rich-text-editor/renderer/image-module.d.ts +10 -2
- package/src/rich-text-editor/renderer/image-module.js +200 -168
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +11 -2
- 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 +9 -2
- package/src/rich-text-editor/renderer/table-module.js +289 -137
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +13 -9
- package/src/rich-text-editor/renderer/toolbar-renderer.js +103 -24
- package/src/rich-text-editor/renderer/video-module.d.ts +4 -1
- package/src/rich-text-editor/renderer/video-module.js +62 -35
- package/src/rich-text-editor/renderer/view-source.d.ts +7 -6
- package/src/rich-text-editor/renderer/view-source.js +18 -10
- 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 +25 -22
- package/styles/_all.scss +1 -1
- package/styles/bootstrap-dark.css +153 -49
- package/styles/bootstrap.css +158 -57
- package/styles/bootstrap4.css +145 -45
- package/styles/bootstrap5-dark.css +150 -45
- package/styles/bootstrap5.css +150 -45
- package/styles/fabric-dark.css +139 -39
- package/styles/fabric.css +140 -40
- package/styles/fluent-dark.css +147 -41
- package/styles/fluent.css +147 -41
- package/styles/highcontrast-light.css +139 -39
- package/styles/highcontrast.css +143 -40
- package/styles/material-dark.css +143 -39
- package/styles/material.css +143 -39
- package/styles/material3-dark.css +155 -49
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +155 -49
- package/styles/material3.scss +1 -1
- package/styles/rich-text-editor/_all.scss +2 -2
- package/styles/rich-text-editor/_bds-definition.scss +279 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +281 -277
- package/styles/rich-text-editor/_bootstrap-definition.scss +337 -334
- package/styles/rich-text-editor/_bootstrap4-definition.scss +464 -460
- package/styles/rich-text-editor/_bootstrap5-definition.scss +266 -262
- package/styles/rich-text-editor/_fabric-dark-definition.scss +263 -259
- package/styles/rich-text-editor/_fabric-definition.scss +261 -257
- package/styles/rich-text-editor/_fluent-definition.scss +267 -263
- package/styles/rich-text-editor/_fusionnew-definition.scss +265 -261
- package/styles/rich-text-editor/_highcontrast-definition.scss +261 -257
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +261 -257
- package/styles/rich-text-editor/_layout.scss +2249 -2147
- package/styles/rich-text-editor/_material-dark-definition.scss +266 -262
- package/styles/rich-text-editor/_material-definition.scss +264 -260
- package/styles/rich-text-editor/_material3-definition.scss +266 -262
- package/styles/rich-text-editor/_tailwind-definition.scss +261 -257
- package/styles/rich-text-editor/_theme.scss +906 -837
- package/styles/rich-text-editor/bootstrap-dark.css +153 -49
- package/styles/rich-text-editor/bootstrap.css +158 -57
- package/styles/rich-text-editor/bootstrap4.css +145 -45
- package/styles/rich-text-editor/bootstrap5-dark.css +150 -45
- package/styles/rich-text-editor/bootstrap5.css +150 -45
- package/styles/rich-text-editor/fabric-dark.css +139 -39
- package/styles/rich-text-editor/fabric.css +140 -40
- package/styles/rich-text-editor/fluent-dark.css +147 -41
- package/styles/rich-text-editor/fluent.css +147 -41
- package/styles/rich-text-editor/highcontrast-light.css +139 -39
- package/styles/rich-text-editor/highcontrast.css +143 -40
- package/styles/rich-text-editor/icons/_bds.scss +348 -0
- 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 +143 -39
- package/styles/rich-text-editor/material.css +143 -39
- package/styles/rich-text-editor/material3-dark.css +155 -49
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +155 -49
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +194 -66
- package/styles/rich-text-editor/tailwind.css +194 -66
- package/styles/tailwind-dark.css +194 -66
- package/styles/tailwind.css +194 -66
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
- package/dist/ej2-richtexteditor.min.js +0 -10
- package/dist/global/ej2-richtexteditor.min.js +0 -11
- package/dist/global/ej2-richtexteditor.min.js.map +0 -1
- package/dist/global/index.d.ts +0 -14
- package/tslint.json +0 -111
|
@@ -1,34 +1,34 @@
|
|
|
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
|
-
import { Component, EventHandler, Complex, Browser, addClass,
|
|
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
|
+
import { Component, EventHandler, Complex, Browser, addClass, 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';
|
|
34
34
|
import { isNullOrUndefined as isNOU, compile, append, extend, debounce } 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
|
+
* @deprecated
|
|
83
83
|
*/
|
|
84
84
|
RichTextEditor.prototype.requiredModules = function () {
|
|
85
85
|
var modules = [];
|
|
@@ -97,6 +97,14 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
97
97
|
member: 'image',
|
|
98
98
|
args: [this, this.serviceLocator]
|
|
99
99
|
});
|
|
100
|
+
modules.push({
|
|
101
|
+
member: 'audio',
|
|
102
|
+
args: [this, this.serviceLocator]
|
|
103
|
+
});
|
|
104
|
+
modules.push({
|
|
105
|
+
member: 'video',
|
|
106
|
+
args: [this, this.serviceLocator]
|
|
107
|
+
});
|
|
100
108
|
if (this.quickToolbarSettings.enable) {
|
|
101
109
|
modules.push({ member: 'quickToolbar', args: [this, this.serviceLocator] });
|
|
102
110
|
}
|
|
@@ -110,14 +118,6 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
110
118
|
if (this.editorMode === 'HTML') {
|
|
111
119
|
modules.push({ member: 'htmlEditor', args: [this, this.serviceLocator] });
|
|
112
120
|
modules.push({ member: 'pasteCleanup', args: [this, this.serviceLocator] });
|
|
113
|
-
modules.push({
|
|
114
|
-
member: 'audio',
|
|
115
|
-
args: [this, this.serviceLocator]
|
|
116
|
-
});
|
|
117
|
-
modules.push({
|
|
118
|
-
member: 'video',
|
|
119
|
-
args: [this, this.serviceLocator]
|
|
120
|
-
});
|
|
121
121
|
modules.push({
|
|
122
122
|
member: 'formatPainter',
|
|
123
123
|
args: [this]
|
|
@@ -149,7 +149,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
149
149
|
else {
|
|
150
150
|
if (this.getToolbar()) {
|
|
151
151
|
removeClass(this.getToolbar().querySelectorAll('.' + classes.CLS_ACTIVE), classes.CLS_ACTIVE);
|
|
152
|
-
removeClass([this.getToolbar()], [classes.CLS_TB_FLOAT
|
|
152
|
+
removeClass([this.getToolbar().parentElement], [classes.CLS_TB_FLOAT]);
|
|
153
153
|
}
|
|
154
154
|
addClass([this.element], classes.CLS_DISABLED);
|
|
155
155
|
this.element.tabIndex = -1;
|
|
@@ -162,7 +162,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
162
162
|
*
|
|
163
163
|
* @returns {void}
|
|
164
164
|
* @hidden
|
|
165
|
-
|
|
165
|
+
* @deprecated
|
|
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
|
+
* @deprecated
|
|
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().replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
393
|
+
var currentLength = this.getText().trim().replace(/(\r\n|\n|\r|\t)/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,9 +548,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
548
548
|
*
|
|
549
549
|
* @returns {void}
|
|
550
550
|
* @private
|
|
551
|
-
|
|
551
|
+
* @deprecated
|
|
552
552
|
*/
|
|
553
553
|
RichTextEditor.prototype.render = function () {
|
|
554
|
+
this.value = (!(this.editorMode === 'Markdown') && !isNOU(this.value)) ? this.addAnchorAriaLabel(this.value) : this.value;
|
|
554
555
|
if (this.value && !this.valueTemplate) {
|
|
555
556
|
this.setProperties({ value: this.serializeValue(this.value) }, true);
|
|
556
557
|
}
|
|
@@ -569,7 +570,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
569
570
|
(this.toolbarSettings.items.indexOf('Undo') > -1 && this.toolbarSettings.items.indexOf('Redo') > -1)) {
|
|
570
571
|
this.disableToolbarItem(['Undo', 'Redo']);
|
|
571
572
|
}
|
|
572
|
-
this.setContentHeight();
|
|
573
|
+
this.setContentHeight('Init');
|
|
573
574
|
if (this.value !== null) {
|
|
574
575
|
this.valueContainer.defaultValue = this.value;
|
|
575
576
|
}
|
|
@@ -585,7 +586,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
585
586
|
*
|
|
586
587
|
* @returns {void}
|
|
587
588
|
* @hidden
|
|
588
|
-
|
|
589
|
+
* @deprecated
|
|
589
590
|
*/
|
|
590
591
|
RichTextEditor.prototype.addAudioVideoWrapper = function () {
|
|
591
592
|
var _this = this;
|
|
@@ -647,7 +648,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
647
648
|
*
|
|
648
649
|
* @returns {void}
|
|
649
650
|
* @private
|
|
650
|
-
|
|
651
|
+
* @deprecated
|
|
651
652
|
* @hidden
|
|
652
653
|
*/
|
|
653
654
|
RichTextEditor.prototype.eventInitializer = function () {
|
|
@@ -698,7 +699,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
698
699
|
* @param {KeyboardEvent} e - specifies the event.
|
|
699
700
|
* @returns {void}
|
|
700
701
|
* @private
|
|
701
|
-
|
|
702
|
+
* @deprecated
|
|
702
703
|
* @hidden
|
|
703
704
|
*/
|
|
704
705
|
RichTextEditor.prototype.keyDown = function (e) {
|
|
@@ -756,7 +757,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
756
757
|
}
|
|
757
758
|
if (e.action !== 'insert-link' &&
|
|
758
759
|
e.action !== 'format-copy' && e.action !== 'format-paste' &&
|
|
759
|
-
(!e.target || !(e.target.classList.contains('e-mention') && e.code === 'Tab')) &&
|
|
760
|
+
(!e.target || !(e.target.classList.contains('e-mention') && !isNOU(document.querySelector('#' + e.target.id + '_popup.e-popup-open')) && e.code === 'Tab')) &&
|
|
760
761
|
(e.action && e.action !== 'paste' && e.action !== 'space'
|
|
761
762
|
|| e.which === 9 || (e.code === 'Backspace' && e.which === 8))) {
|
|
762
763
|
var FormatPainterEscapeAction = false;
|
|
@@ -764,14 +765,26 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
764
765
|
FormatPainterEscapeAction = this.formatPainterModule.previousAction === 'escape';
|
|
765
766
|
}
|
|
766
767
|
if (!FormatPainterEscapeAction) {
|
|
767
|
-
this.
|
|
768
|
+
if (this.editorMode === 'HTML' && (e.action === 'increase-fontsize' || e.action === 'decrease-fontsize')) {
|
|
769
|
+
this.notify(events.onHandleFontsizeChange, { member: 'onHandleFontsizeChange', args: e });
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
this.formatter.process(this, null, e);
|
|
773
|
+
}
|
|
768
774
|
}
|
|
769
775
|
switch (e.action) {
|
|
770
776
|
case 'toolbar-focus':
|
|
771
777
|
if (this.toolbarSettings.enable && this.getToolbarElement()) {
|
|
772
778
|
var firstActiveItem = this.getToolbarElement().querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
773
|
-
|
|
774
|
-
|
|
779
|
+
var quickToolbarElem = this.getRenderedQuickToolbarElem();
|
|
780
|
+
if (quickToolbarElem) {
|
|
781
|
+
firstActiveItem = quickToolbarElem.querySelector('.e-toolbar-item:not(.e-overlay)[title]');
|
|
782
|
+
}
|
|
783
|
+
if (firstActiveItem) {
|
|
784
|
+
var firstChild = firstActiveItem.firstElementChild;
|
|
785
|
+
firstChild.removeAttribute('tabindex');
|
|
786
|
+
firstChild.focus();
|
|
787
|
+
}
|
|
775
788
|
}
|
|
776
789
|
break;
|
|
777
790
|
case 'escape':
|
|
@@ -790,11 +803,22 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
790
803
|
this.setPlaceHolder();
|
|
791
804
|
}
|
|
792
805
|
}
|
|
806
|
+
this.notify(events.afterKeyDown, { member: 'afterKeyDown', args: e });
|
|
793
807
|
this.autoResize();
|
|
794
808
|
};
|
|
795
809
|
RichTextEditor.prototype.keyUp = function (e) {
|
|
796
810
|
if (this.editorMode === 'HTML') {
|
|
797
811
|
var range = this.getRange();
|
|
812
|
+
if (!isNOU(e) && !isNOU(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
|
|
813
|
+
// To prevent the reformatting the content removed browser behavior.
|
|
814
|
+
var currentRange = this.getRange();
|
|
815
|
+
var selection = this.iframeSettings.enable ? this.contentModule.getPanel().ownerDocument.getSelection() :
|
|
816
|
+
this.contentModule.getDocument().getSelection();
|
|
817
|
+
if (selection.rangeCount > 0) {
|
|
818
|
+
selection.removeAllRanges();
|
|
819
|
+
selection.addRange(currentRange);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
798
822
|
if (Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer.nodeName === '#text' &&
|
|
799
823
|
range.startContainer.parentElement === this.inputElement && this.enterKey !== 'BR') {
|
|
800
824
|
var range_1 = this.getRange();
|
|
@@ -816,7 +840,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
816
840
|
var formatPainterCopy = e.key === 'C' && e.altKey && e.shiftKey;
|
|
817
841
|
var formatPainterPaste = e.key === 'V' && e.altKey && e.shiftKey;
|
|
818
842
|
if ((!formatPainterCopy && !formatPainterPaste) && ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
|
|
819
|
-
&& ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys)) && !this.inlineMode.enable) {
|
|
843
|
+
&& ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys)) || (this.autoSaveOnIdle && Browser.isDevice) && !this.inlineMode.enable) {
|
|
820
844
|
this.formatter.onKeyHandler(this, e);
|
|
821
845
|
}
|
|
822
846
|
if (this.inputElement && this.inputElement.textContent.length !== 0
|
|
@@ -834,7 +858,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
834
858
|
* @param {string} value - specifies the value.
|
|
835
859
|
* @returns {void}
|
|
836
860
|
* @hidden
|
|
837
|
-
|
|
861
|
+
* @deprecated
|
|
838
862
|
*/
|
|
839
863
|
RichTextEditor.prototype.serializeValue = function (value) {
|
|
840
864
|
if (this.editorMode === 'HTML' && !isNOU(value)) {
|
|
@@ -865,7 +889,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
865
889
|
* @param {string} value - specifies the string value.
|
|
866
890
|
* @returns {void}
|
|
867
891
|
* @hidden
|
|
868
|
-
|
|
892
|
+
* @deprecated
|
|
869
893
|
*/
|
|
870
894
|
RichTextEditor.prototype.updateValue = function (value) {
|
|
871
895
|
if (isNOU(value)) {
|
|
@@ -894,11 +918,14 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
894
918
|
clientX: touch.clientX, clientY: touch.clientY }
|
|
895
919
|
});
|
|
896
920
|
if (this.inputElement && ((this.editorMode === 'HTML' && this.inputElement.textContent.length !== 0) ||
|
|
897
|
-
(this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) ||
|
|
898
|
-
|
|
899
|
-
(e.target.
|
|
900
|
-
e.target.
|
|
901
|
-
e.target.
|
|
921
|
+
(this.editorMode === 'Markdown' && this.inputElement.value.length !== 0)) ||
|
|
922
|
+
(e.target && !isNOU(closest(e.target, 'table'))) ||
|
|
923
|
+
(e.target && (e.target.nodeName === 'VIDEO' ||
|
|
924
|
+
e.target.querySelectorAll('.' + classes.CLS_VIDEOWRAP).length > 0) ||
|
|
925
|
+
(e.target && e.target.nodeName !== 'BR' &&
|
|
926
|
+
(e.target.classList.contains(classes.CLS_AUDIOWRAP) ||
|
|
927
|
+
e.target.classList.contains(classes.CLS_CLICKELEM) ||
|
|
928
|
+
e.target.classList.contains(classes.CLS_VID_CLICK_ELEM))))) {
|
|
902
929
|
this.notify(events.toolbarRefresh, { args: e });
|
|
903
930
|
}
|
|
904
931
|
this.triggerEditArea(e);
|
|
@@ -912,67 +939,13 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
912
939
|
return;
|
|
913
940
|
}
|
|
914
941
|
}
|
|
915
|
-
if (e.detail === 3) {
|
|
916
|
-
var range = this.getRange();
|
|
917
|
-
var selection = this.formatter.editorManager.domNode.getSelection();
|
|
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
|
-
}
|
|
963
|
-
}
|
|
964
|
-
newRange.setStart(start, 0);
|
|
965
|
-
newRange.setEnd(end, end.textContent.length);
|
|
966
|
-
this.formatter.editorManager.nodeSelection.setRange(this.contentModule.getDocument(), newRange);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
942
|
this.notifyMouseUp(e);
|
|
970
943
|
};
|
|
971
944
|
/**
|
|
972
945
|
* @param {Function} module - specifies the module function.
|
|
973
946
|
* @returns {void}
|
|
974
947
|
* @hidden
|
|
975
|
-
|
|
948
|
+
* @deprecated
|
|
976
949
|
*/
|
|
977
950
|
RichTextEditor.prototype.ensureModuleInjected = function (module) {
|
|
978
951
|
return this.getInjectedModules().indexOf(module) >= 0;
|
|
@@ -980,7 +953,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
980
953
|
/**
|
|
981
954
|
* @returns {void}
|
|
982
955
|
* @hidden
|
|
983
|
-
|
|
956
|
+
* @deprecated
|
|
984
957
|
*/
|
|
985
958
|
RichTextEditor.prototype.onCopy = function () {
|
|
986
959
|
this.contentModule.getDocument().execCommand('copy', false, null);
|
|
@@ -988,7 +961,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
988
961
|
/**
|
|
989
962
|
* @returns {void}
|
|
990
963
|
* @hidden
|
|
991
|
-
|
|
964
|
+
* @deprecated
|
|
992
965
|
*/
|
|
993
966
|
RichTextEditor.prototype.onCut = function () {
|
|
994
967
|
this.contentModule.getDocument().execCommand('cut', false, null);
|
|
@@ -997,7 +970,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
997
970
|
* @param {KeyboardEvent} e - specifies the keyboard event.
|
|
998
971
|
* @returns {void}
|
|
999
972
|
* @hidden
|
|
1000
|
-
|
|
973
|
+
* @deprecated
|
|
1001
974
|
*/
|
|
1002
975
|
RichTextEditor.prototype.onPaste = function (e) {
|
|
1003
976
|
var _this = this;
|
|
@@ -1007,10 +980,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1007
980
|
requestType: 'Paste'
|
|
1008
981
|
};
|
|
1009
982
|
this.trigger(events.actionBegin, evenArgs, function (pasteArgs) {
|
|
1010
|
-
var currentLength = _this.
|
|
983
|
+
var currentLength = _this.getText().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length;
|
|
1011
984
|
var selectionLength = _this.getSelection().length;
|
|
1012
985
|
var pastedContentLength = (isNOU(e) || isNOU(e.clipboardData))
|
|
1013
|
-
? 0 : e.clipboardData.getData('text/plain').replace(/(\r\n|\n|\r)/gm, '').replace(/\u200B/g, '').length;
|
|
986
|
+
? 0 : e.clipboardData.getData('text/plain').replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, '').length;
|
|
1014
987
|
var totalLength = (currentLength - selectionLength) + pastedContentLength;
|
|
1015
988
|
if (_this.editorMode === 'Markdown') {
|
|
1016
989
|
var args_1 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
@@ -1028,6 +1001,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1028
1001
|
_this.notify(events.pasteClean, { args: e });
|
|
1029
1002
|
}
|
|
1030
1003
|
else {
|
|
1004
|
+
console.warn('[WARNING] :: Module "pasteCleanup" is not available in RichTextEditor component! You either misspelled the module name or forgot to load it.');
|
|
1031
1005
|
var args_2 = { requestType: 'Paste', editorMode: _this.editorMode, event: e };
|
|
1032
1006
|
var value = null;
|
|
1033
1007
|
var htmlValue = false;
|
|
@@ -1060,7 +1034,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1060
1034
|
* @param {MouseEvent} event - specifies the event.
|
|
1061
1035
|
* @returns {void}
|
|
1062
1036
|
* @hidden
|
|
1063
|
-
|
|
1037
|
+
* @deprecated
|
|
1064
1038
|
*/
|
|
1065
1039
|
RichTextEditor.prototype.clipboardAction = function (action, event) {
|
|
1066
1040
|
switch (action.toLowerCase()) {
|
|
@@ -1253,7 +1227,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1253
1227
|
*
|
|
1254
1228
|
* @returns {void}
|
|
1255
1229
|
* @private
|
|
1256
|
-
|
|
1230
|
+
* @deprecated
|
|
1257
1231
|
*/
|
|
1258
1232
|
RichTextEditor.prototype.getModuleName = function () {
|
|
1259
1233
|
return 'richtexteditor';
|
|
@@ -1265,7 +1239,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1265
1239
|
* @param {RichTextEditorModel} oldProp - specifies the old property.
|
|
1266
1240
|
* @returns {void}
|
|
1267
1241
|
* @hidden
|
|
1268
|
-
|
|
1242
|
+
* @deprecated
|
|
1269
1243
|
*/
|
|
1270
1244
|
/* eslint-disable */
|
|
1271
1245
|
RichTextEditor.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
@@ -1322,7 +1296,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1322
1296
|
break;
|
|
1323
1297
|
case 'height':
|
|
1324
1298
|
this.setHeight(newProp[prop]);
|
|
1325
|
-
this.setContentHeight();
|
|
1299
|
+
this.setContentHeight('Init');
|
|
1326
1300
|
this.autoResize();
|
|
1327
1301
|
break;
|
|
1328
1302
|
case 'readonly':
|
|
@@ -1369,11 +1343,11 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1369
1343
|
break;
|
|
1370
1344
|
case 'inlineMode':
|
|
1371
1345
|
this.notify(events.modelChanged, { module: 'quickToolbar', newProp: newProp, oldProp: oldProp });
|
|
1372
|
-
this.setContentHeight();
|
|
1346
|
+
this.setContentHeight('Init');
|
|
1373
1347
|
break;
|
|
1374
1348
|
case 'toolbarSettings':
|
|
1375
1349
|
this.notify(events.modelChanged, { module: 'toolbar', newProp: newProp, oldProp: oldProp });
|
|
1376
|
-
this.setContentHeight();
|
|
1350
|
+
this.setContentHeight('Init');
|
|
1377
1351
|
break;
|
|
1378
1352
|
case 'maxLength':
|
|
1379
1353
|
if (this.showCharCount) {
|
|
@@ -1420,7 +1394,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1420
1394
|
/**
|
|
1421
1395
|
* @hidden
|
|
1422
1396
|
* @returns {void}
|
|
1423
|
-
|
|
1397
|
+
* @deprecated
|
|
1424
1398
|
*/
|
|
1425
1399
|
RichTextEditor.prototype.updateValueData = function () {
|
|
1426
1400
|
if (this.enableHtmlEncode) {
|
|
@@ -1450,7 +1424,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1450
1424
|
if (this.valueContainer) {
|
|
1451
1425
|
this.valueContainer.value = (this.enableHtmlEncode) ? this.value : value;
|
|
1452
1426
|
}
|
|
1453
|
-
if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.
|
|
1427
|
+
if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.trim() !== value.trim()) {
|
|
1454
1428
|
this.inputElement.innerHTML = value;
|
|
1455
1429
|
}
|
|
1456
1430
|
else if (this.editorMode === 'Markdown' && this.inputElement
|
|
@@ -1471,9 +1445,6 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1471
1445
|
}
|
|
1472
1446
|
else {
|
|
1473
1447
|
this.inputElement.innerHTML = '<p><br/></p>';
|
|
1474
|
-
if (value === '' && this.formatter && this.inputElement) {
|
|
1475
|
-
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), this.inputElement.firstElementChild, this.inputElement.firstElementChild.childElementCount);
|
|
1476
|
-
}
|
|
1477
1448
|
}
|
|
1478
1449
|
}
|
|
1479
1450
|
else {
|
|
@@ -1507,7 +1478,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1507
1478
|
*
|
|
1508
1479
|
* @returns {void}
|
|
1509
1480
|
* @hidden
|
|
1510
|
-
|
|
1481
|
+
* @deprecated
|
|
1511
1482
|
*/
|
|
1512
1483
|
RichTextEditor.prototype.setPlaceHolder = function () {
|
|
1513
1484
|
if (this.inputElement && this.placeholder && this.iframeSettings.enable !== true) {
|
|
@@ -1535,7 +1506,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1535
1506
|
this.inputElement.setAttribute('placeholder', this.placeholder);
|
|
1536
1507
|
}
|
|
1537
1508
|
}
|
|
1538
|
-
if (this.placeholder && this.iframeSettings.enable) {
|
|
1509
|
+
if (this.placeholder && this.iframeSettings.enable && this.inputElement) {
|
|
1539
1510
|
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNOU(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
1540
1511
|
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNOU(this.inputElement.firstChild.firstChild) &&
|
|
1541
1512
|
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
@@ -1585,7 +1556,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1585
1556
|
* @param {boolean} initial - specifies the boolean value
|
|
1586
1557
|
* @returns {void}
|
|
1587
1558
|
* @hidden
|
|
1588
|
-
|
|
1559
|
+
* @deprecated
|
|
1589
1560
|
*/
|
|
1590
1561
|
RichTextEditor.prototype.setReadOnly = function (initial) {
|
|
1591
1562
|
this.updateReadOnly();
|
|
@@ -1686,7 +1657,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1686
1657
|
*
|
|
1687
1658
|
* @returns {void}
|
|
1688
1659
|
* @public
|
|
1689
|
-
|
|
1660
|
+
* @deprecated
|
|
1690
1661
|
*/
|
|
1691
1662
|
RichTextEditor.prototype.getRange = function () {
|
|
1692
1663
|
return this.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
|
|
@@ -1722,10 +1693,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1722
1693
|
if (this.iframeSettings.resources) {
|
|
1723
1694
|
var styleSrc = this.iframeSettings.resources.styles;
|
|
1724
1695
|
var scriptSrc = this.iframeSettings.resources.scripts;
|
|
1725
|
-
if (this.iframeSettings.resources.scripts.length > 0) {
|
|
1696
|
+
if (!isNOU(this.iframeSettings.resources.scripts) && this.iframeSettings.resources.scripts.length > 0) {
|
|
1726
1697
|
this.InjectSheet(true, scriptSrc);
|
|
1727
1698
|
}
|
|
1728
|
-
if (this.iframeSettings.resources.styles.length > 0) {
|
|
1699
|
+
if (!isNOU(this.iframeSettings.resources.styles) && this.iframeSettings.resources.styles.length > 0) {
|
|
1729
1700
|
this.InjectSheet(false, styleSrc);
|
|
1730
1701
|
}
|
|
1731
1702
|
}
|
|
@@ -1831,7 +1802,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1831
1802
|
*
|
|
1832
1803
|
* @returns {void}
|
|
1833
1804
|
* @hidden
|
|
1834
|
-
|
|
1805
|
+
* @deprecated
|
|
1835
1806
|
*/
|
|
1836
1807
|
RichTextEditor.prototype.getInsertImgMaxWidth = function () {
|
|
1837
1808
|
var maxWidth = this.insertImageSettings.maxWidth;
|
|
@@ -1839,6 +1810,13 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1839
1810
|
var imgPadding = 12;
|
|
1840
1811
|
var imgResizeBorder = 2;
|
|
1841
1812
|
var editEle = this.contentModule.getEditPanel();
|
|
1813
|
+
if (this.editorMode === "HTML" && !isNOU(this.formatter.editorManager.nodeSelection) && !isNOU(this.formatter.editorManager.nodeSelection.range)) {
|
|
1814
|
+
var currentRange = this.formatter.editorManager.nodeSelection.range;
|
|
1815
|
+
if (currentRange.startContainer.nodeType !== 3 && currentRange.startContainer.closest &&
|
|
1816
|
+
!isNOU(currentRange.startContainer.closest('TD'))) {
|
|
1817
|
+
editEle = currentRange.startContainer;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1842
1820
|
var eleStyle = window.getComputedStyle(editEle);
|
|
1843
1821
|
var editEleMaxWidth = editEle.offsetWidth - (imgPadding + imgResizeBorder +
|
|
1844
1822
|
parseFloat(eleStyle.paddingLeft.split('px')[0]) + parseFloat(eleStyle.paddingRight.split('px')[0]) +
|
|
@@ -1850,7 +1828,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1850
1828
|
*
|
|
1851
1829
|
* @returns {void}
|
|
1852
1830
|
* @hidden
|
|
1853
|
-
|
|
1831
|
+
* @deprecated
|
|
1854
1832
|
*/
|
|
1855
1833
|
RichTextEditor.prototype.getInsertVidMaxWidth = function () {
|
|
1856
1834
|
var maxWidth = this.insertVideoSettings.maxWidth;
|
|
@@ -1871,16 +1849,13 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1871
1849
|
* @param {boolean} isExpand - specifies the bollean value.
|
|
1872
1850
|
* @returns {void}
|
|
1873
1851
|
* @hidden
|
|
1874
|
-
|
|
1852
|
+
* @deprecated
|
|
1875
1853
|
*/
|
|
1876
1854
|
RichTextEditor.prototype.setContentHeight = function (target, isExpand) {
|
|
1877
1855
|
var heightValue;
|
|
1878
|
-
var topValue = 0;
|
|
1879
1856
|
var rteHeightPercent;
|
|
1880
1857
|
var heightPercent = typeof (this.height) === 'string' && this.height.indexOf('%') > -1;
|
|
1881
|
-
var cntEle =
|
|
1882
|
-
this.sourceCodeModule.getPanel().parentElement.style.display === 'block') ? this.sourceCodeModule.getPanel().parentElement :
|
|
1883
|
-
this.contentModule.getPanel();
|
|
1858
|
+
var cntEle = this.contentModule.getPanel();
|
|
1884
1859
|
var rteHeight = this.element.offsetHeight;
|
|
1885
1860
|
if (rteHeight === 0 && this.height !== 'auto' && !this.getToolbar()) {
|
|
1886
1861
|
rteHeight = parseInt(this.height, 10);
|
|
@@ -1892,39 +1867,36 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1892
1867
|
var rzHandle = this.element.querySelector('.' + classes.CLS_RTE_RES_HANDLE);
|
|
1893
1868
|
var rzHeight = this.enableResize ? (!isNOU(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
|
|
1894
1869
|
var expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
|
|
1895
|
-
if (this.
|
|
1896
|
-
|
|
1897
|
-
topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
|
|
1870
|
+
if (target && target !== 'Toolbar' && expandPopHeight && this.element.querySelectorAll('.e-toolbar-extended.e-popup-open').length > 0) {
|
|
1871
|
+
tbHeight = tbHeight - expandPopHeight;
|
|
1898
1872
|
}
|
|
1899
|
-
|
|
1900
|
-
if (
|
|
1901
|
-
heightValue = 'auto';
|
|
1873
|
+
if (this.toolbarSettings.type === ToolbarType.Expand) {
|
|
1874
|
+
if (isExpand) {
|
|
1875
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
|
|
1902
1876
|
}
|
|
1903
1877
|
else {
|
|
1904
|
-
heightValue =
|
|
1878
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - (tbHeight - expandPopHeight + rzHeight) + 'px';
|
|
1905
1879
|
}
|
|
1906
1880
|
}
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1881
|
+
else {
|
|
1882
|
+
heightValue = (this.height === 'auto' && this.element.style.height === 'auto') ? 'auto' : rteHeight - tbHeight + 'px';
|
|
1883
|
+
}
|
|
1884
|
+
var finalHeight = heightPercent && rteHeightPercent ? rteHeightPercent : heightValue;
|
|
1885
|
+
switch (target) {
|
|
1886
|
+
case 'Init':
|
|
1887
|
+
case 'Toolbar':
|
|
1888
|
+
case 'WindowResize':
|
|
1889
|
+
case 'Refresh':
|
|
1890
|
+
if (this.element.querySelectorAll('.e-source-content').length > 0 && this.element.querySelector('.e-source-content').style.display === 'block') {
|
|
1891
|
+
setStyleAttribute(this.element.querySelector('.e-source-content'), { height: finalHeight });
|
|
1911
1892
|
}
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
if (target === 'windowResize' && heightPercent) {
|
|
1915
|
-
//cntEle hide the borderBottom of RichTextEditor. so removed the 2px of cntEle height.
|
|
1916
|
-
heightValue = parseInt(heightValue, 10) - 2 + 'px';
|
|
1893
|
+
else {
|
|
1894
|
+
setStyleAttribute(cntEle, { height: finalHeight });
|
|
1917
1895
|
}
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
var codeElement = select('.' + classes.CLS_RTE_CONTENT, this.element);
|
|
1923
|
-
setStyleAttribute(codeElement, { height: heightValue, marginTop: topValue + 'px' });
|
|
1924
|
-
}
|
|
1925
|
-
if (this.toolbarSettings.enableFloating && this.getToolbar() && !this.inlineMode.enable) {
|
|
1926
|
-
var tbWrapHeight = (isExpand ? (tbHeight + expandPopHeight) : tbHeight) + 'px';
|
|
1927
|
-
setStyleAttribute(this.getToolbar().parentElement, { height: tbWrapHeight });
|
|
1896
|
+
break;
|
|
1897
|
+
case 'Resize':
|
|
1898
|
+
setStyleAttribute(cntEle, { height: finalHeight });
|
|
1899
|
+
break;
|
|
1928
1900
|
}
|
|
1929
1901
|
if (rzHeight === 0) {
|
|
1930
1902
|
this.autoResize();
|
|
@@ -2035,7 +2007,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2035
2007
|
/**
|
|
2036
2008
|
* @returns {void}
|
|
2037
2009
|
* @hidden
|
|
2038
|
-
|
|
2010
|
+
* @deprecated
|
|
2039
2011
|
*/
|
|
2040
2012
|
RichTextEditor.prototype.getBaseToolbarObject = function () {
|
|
2041
2013
|
var tbObj;
|
|
@@ -2050,7 +2022,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2050
2022
|
/**
|
|
2051
2023
|
* @returns {void}
|
|
2052
2024
|
* @hidden
|
|
2053
|
-
|
|
2025
|
+
* @deprecated
|
|
2054
2026
|
*/
|
|
2055
2027
|
RichTextEditor.prototype.getToolbar = function () {
|
|
2056
2028
|
return this.toolbarModule ? this.toolbarModule.getToolbarElement() : null;
|
|
@@ -2058,7 +2030,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2058
2030
|
/**
|
|
2059
2031
|
* @returns {void}
|
|
2060
2032
|
* @hidden
|
|
2061
|
-
|
|
2033
|
+
* @deprecated
|
|
2062
2034
|
*/
|
|
2063
2035
|
RichTextEditor.prototype.getToolbarElement = function () {
|
|
2064
2036
|
return this.toolbarModule && this.toolbarModule.getToolbarElement();
|
|
@@ -2068,7 +2040,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2068
2040
|
* getID method
|
|
2069
2041
|
*
|
|
2070
2042
|
* @hidden
|
|
2071
|
-
|
|
2043
|
+
* @deprecated
|
|
2072
2044
|
*/
|
|
2073
2045
|
RichTextEditor.prototype.getID = function () {
|
|
2074
2046
|
return (this.originalElement.tagName === 'TEXTAREA' ? this.valueContainer.id : this.element.id);
|
|
@@ -2078,7 +2050,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2078
2050
|
* getCssClass method
|
|
2079
2051
|
*
|
|
2080
2052
|
* @hidden
|
|
2081
|
-
|
|
2053
|
+
* @deprecated
|
|
2082
2054
|
*/
|
|
2083
2055
|
RichTextEditor.prototype.getCssClass = function (isSpace) {
|
|
2084
2056
|
return (isNOU(this.cssClass) ? '' : isSpace ? ' ' + this.cssClass : this.cssClass);
|
|
@@ -2088,6 +2060,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2088
2060
|
addClass([this.element], [classes.CLS_FOCUS]);
|
|
2089
2061
|
this.preventDefaultResize(e);
|
|
2090
2062
|
this.notify(events.mouseDown, { args: e });
|
|
2063
|
+
this.formatter.editorManager.observer.notify(events.mouseDown, { args: e });
|
|
2091
2064
|
this.clickPoints = { clientX: touch.clientX, clientY: touch.clientY };
|
|
2092
2065
|
};
|
|
2093
2066
|
RichTextEditor.prototype.preventImgResize = function (e) {
|
|
@@ -2101,7 +2074,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2101
2074
|
* @param {FocusEvent} e - specifies the event.
|
|
2102
2075
|
* @returns {void}
|
|
2103
2076
|
* @hidden
|
|
2104
|
-
|
|
2077
|
+
* @deprecated
|
|
2105
2078
|
*/
|
|
2106
2079
|
// eslint-disable-next-line
|
|
2107
2080
|
RichTextEditor.prototype.preventDefaultResize = function (e) {
|
|
@@ -2126,18 +2099,14 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2126
2099
|
RichTextEditor.prototype.resizeHandler = function () {
|
|
2127
2100
|
var isExpand = false;
|
|
2128
2101
|
if (!document.body.contains(this.element)) {
|
|
2129
|
-
document.defaultView.removeEventListener('resize', this.onResizeHandler, true);
|
|
2102
|
+
document.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
2130
2103
|
return;
|
|
2131
2104
|
}
|
|
2132
2105
|
if (this.toolbarSettings.enable && !this.inlineMode.enable) {
|
|
2133
2106
|
this.toolbarModule.refreshToolbarOverflow();
|
|
2134
2107
|
isExpand = this.toolbarModule.baseToolbar.toolbarObj.element.classList.contains(classes.CLS_EXPAND_OPEN);
|
|
2135
2108
|
}
|
|
2136
|
-
|
|
2137
|
-
// When resize the window,border bottom of cntEle and this.element border visible separatly.so none the cntEle borderBottom.
|
|
2138
|
-
this.contentModule.getPanel().style.borderBottom = 'none';
|
|
2139
|
-
}
|
|
2140
|
-
this.setContentHeight('windowResize', isExpand);
|
|
2109
|
+
this.setContentHeight('WindowResize', isExpand);
|
|
2141
2110
|
this.notify(events.windowResize, null);
|
|
2142
2111
|
};
|
|
2143
2112
|
RichTextEditor.prototype.scrollHandler = function (e) {
|
|
@@ -2227,7 +2196,18 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2227
2196
|
};
|
|
2228
2197
|
RichTextEditor.prototype.cleanupResizeElements = function (args) {
|
|
2229
2198
|
var value = this.removeResizeElement(args.value);
|
|
2230
|
-
|
|
2199
|
+
args.callBack(value);
|
|
2200
|
+
};
|
|
2201
|
+
RichTextEditor.prototype.addAnchorAriaLabel = function (value) {
|
|
2202
|
+
var valueElementWrapper = document.createElement("div");
|
|
2203
|
+
valueElementWrapper.innerHTML = value;
|
|
2204
|
+
var item = valueElementWrapper.querySelectorAll("a");
|
|
2205
|
+
if (item.length > 0) {
|
|
2206
|
+
for (var i = 0; i < item.length; i++) {
|
|
2207
|
+
(item[i].hasAttribute("target") && item[i].getAttribute("target") === '_blank') ? item[i].setAttribute("aria-label", this.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel")) : item[i];
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
return valueElementWrapper.innerHTML;
|
|
2231
2211
|
};
|
|
2232
2212
|
RichTextEditor.prototype.removeResizeElement = function (value) {
|
|
2233
2213
|
var valueElementWrapper = document.createElement("div");
|
|
@@ -2238,6 +2218,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2238
2218
|
detach(item[i]);
|
|
2239
2219
|
}
|
|
2240
2220
|
}
|
|
2221
|
+
this.removeSelectionClassStates(valueElementWrapper);
|
|
2241
2222
|
return valueElementWrapper.innerHTML;
|
|
2242
2223
|
};
|
|
2243
2224
|
RichTextEditor.prototype.updateStatus = function (e) {
|
|
@@ -2261,6 +2242,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2261
2242
|
this.isRTE = false;
|
|
2262
2243
|
}
|
|
2263
2244
|
this.notify(events.docClick, { args: e });
|
|
2245
|
+
var hideQuickToolbarChecker = this.quickToolbarModule && !this.inlineMode.enable && isNOU(this.quickToolbarModule.inlineQTBar);
|
|
2246
|
+
if ((hideQuickToolbarChecker && !isNOU(closest(target, '.' + 'e-toolbar-wrapper'))) || (hideQuickToolbarChecker && (!isNOU(closest(target, '.e-rte-table-resize')) || !isNOU(closest(target, '.e-table-box'))))) {
|
|
2247
|
+
this.quickToolbarModule.hideQuickToolbars();
|
|
2248
|
+
}
|
|
2264
2249
|
if (Browser.info.name !== 'msie' && e.detail > 3) {
|
|
2265
2250
|
e.preventDefault();
|
|
2266
2251
|
}
|
|
@@ -2269,6 +2254,12 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2269
2254
|
var trg = e.relatedTarget;
|
|
2270
2255
|
if (trg) {
|
|
2271
2256
|
var rteElement = closest(trg, '.' + classes.CLS_RTE);
|
|
2257
|
+
if (!rteElement && this.iframeSettings.enable) {
|
|
2258
|
+
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
2259
|
+
if (iframeElement && iframeElement.contentWindow.document.body.contains(trg)) {
|
|
2260
|
+
rteElement = closest(iframeElement, '.' + classes.CLS_RTE);
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2272
2263
|
if (rteElement && rteElement === this.element) {
|
|
2273
2264
|
this.isBlur = false;
|
|
2274
2265
|
if (trg === this.getToolbarElement()) {
|
|
@@ -2285,6 +2276,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2285
2276
|
}
|
|
2286
2277
|
if (this.isBlur && isNOU(trg)) {
|
|
2287
2278
|
removeClass([this.element], [classes.CLS_FOCUS]);
|
|
2279
|
+
this.removeSelectionClassStates(this.inputElement);
|
|
2288
2280
|
this.notify(events.focusChange, {});
|
|
2289
2281
|
var value = this.getUpdatedValue();
|
|
2290
2282
|
this.setProperties({ value: value });
|
|
@@ -2318,7 +2310,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2318
2310
|
*
|
|
2319
2311
|
* @returns {void}
|
|
2320
2312
|
* @hidden
|
|
2321
|
-
|
|
2313
|
+
* @deprecated
|
|
2322
2314
|
*/
|
|
2323
2315
|
RichTextEditor.prototype.contentChanged = function () {
|
|
2324
2316
|
if (this.autoSaveOnIdle) {
|
|
@@ -2333,7 +2325,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2333
2325
|
*
|
|
2334
2326
|
* @returns {void}
|
|
2335
2327
|
* @hidden
|
|
2336
|
-
|
|
2328
|
+
* @deprecated
|
|
2337
2329
|
*/
|
|
2338
2330
|
RichTextEditor.prototype.invokeChangeEvent = function () {
|
|
2339
2331
|
var currentValue;
|
|
@@ -2355,7 +2347,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2355
2347
|
/**
|
|
2356
2348
|
* @returns {void}
|
|
2357
2349
|
* @hidden
|
|
2358
|
-
|
|
2350
|
+
* @deprecated
|
|
2359
2351
|
*/
|
|
2360
2352
|
RichTextEditor.prototype.wireScrollElementsEvents = function () {
|
|
2361
2353
|
this.scrollParentElements = getScrollableParent(this.element);
|
|
@@ -2385,7 +2377,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2385
2377
|
/**
|
|
2386
2378
|
* @returns {void}
|
|
2387
2379
|
* @hidden
|
|
2388
|
-
|
|
2380
|
+
* @deprecated
|
|
2389
2381
|
*/
|
|
2390
2382
|
RichTextEditor.prototype.unWireScrollElementsEvents = function () {
|
|
2391
2383
|
this.scrollParentElements = getScrollableParent(this.element);
|
|
@@ -2403,9 +2395,10 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2403
2395
|
this.triggerEditArea(e.originalEvent);
|
|
2404
2396
|
};
|
|
2405
2397
|
RichTextEditor.prototype.contextHandler = function (e) {
|
|
2406
|
-
var closestElem = closest(e.target, 'a, table, img');
|
|
2398
|
+
var closestElem = closest(e.target, 'a, table, img, video, audio');
|
|
2407
2399
|
if (this.inlineMode.onSelection === false || (!isNOU(closestElem) && this.inputElement.contains(closestElem)
|
|
2408
|
-
&& (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A'
|
|
2400
|
+
&& (closestElem.tagName === 'IMG' || closestElem.tagName === 'TABLE' || closestElem.tagName === 'A' ||
|
|
2401
|
+
closestElem.tagName.toLowerCase() === 'video' || closestElem.tagName.toLowerCase() === 'audio'))) {
|
|
2409
2402
|
e.preventDefault();
|
|
2410
2403
|
}
|
|
2411
2404
|
};
|
|
@@ -2416,7 +2409,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2416
2409
|
/**
|
|
2417
2410
|
* @returns {void}
|
|
2418
2411
|
* @hidden
|
|
2419
|
-
|
|
2412
|
+
* @deprecated
|
|
2420
2413
|
*/
|
|
2421
2414
|
RichTextEditor.prototype.autoResize = function () {
|
|
2422
2415
|
var _this = this;
|
|
@@ -2427,10 +2420,8 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2427
2420
|
}, 0);
|
|
2428
2421
|
}
|
|
2429
2422
|
else if (this.iframeSettings.enable) {
|
|
2430
|
-
var
|
|
2431
|
-
|
|
2432
|
-
_this.setAutoHeight(iframeElement_1);
|
|
2433
|
-
}, 100);
|
|
2423
|
+
var iframeElement = this.element.querySelector('#' + this.getID() + '_rte-view');
|
|
2424
|
+
this.setAutoHeight(iframeElement);
|
|
2434
2425
|
this.inputElement.style.overflow = 'hidden';
|
|
2435
2426
|
}
|
|
2436
2427
|
}
|
|
@@ -2439,10 +2430,21 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2439
2430
|
}
|
|
2440
2431
|
};
|
|
2441
2432
|
RichTextEditor.prototype.setAutoHeight = function (element) {
|
|
2442
|
-
if (!isNOU(element)) {
|
|
2433
|
+
if (!isNOU(element) && !this.iframeSettings.enable) {
|
|
2443
2434
|
element.style.height = this.inputElement.scrollHeight + 'px';
|
|
2444
2435
|
element.style.overflow = 'hidden';
|
|
2445
2436
|
}
|
|
2437
|
+
else if (!isNOU(element) && !isNOU(element.parentElement) && this.iframeSettings.enable) {
|
|
2438
|
+
var newRange = this.getRange();
|
|
2439
|
+
element.style.height = 'auto';
|
|
2440
|
+
var newHeight = element.contentDocument.body.scrollHeight + 'px';
|
|
2441
|
+
element.style.height = newHeight;
|
|
2442
|
+
element.style.overflow = 'hidden';
|
|
2443
|
+
// 16 px added for padding doesn't affect the editor height
|
|
2444
|
+
if (newRange.startContainer.nodeName !== '#text' && newRange.startContainer.nodeName !== 'BODY' && window.innerHeight < newRange.startContainer.getBoundingClientRect().top + element.getBoundingClientRect().top + 16) {
|
|
2445
|
+
newRange.startContainer.scrollIntoView(false);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2446
2448
|
};
|
|
2447
2449
|
RichTextEditor.prototype.wireEvents = function () {
|
|
2448
2450
|
this.element.addEventListener('focusin', this.onFocusHandler, true);
|
|
@@ -2451,6 +2453,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2451
2453
|
this.on(events.resizeInitialized, this.updateResizeFlag, this);
|
|
2452
2454
|
this.on(events.updateTbItemsStatus, this.updateStatus, this);
|
|
2453
2455
|
this.on(events.cleanupResizeElements, this.cleanupResizeElements, this);
|
|
2456
|
+
this.on(events.updateValueOnIdle, this.updateValueOnIdle, this);
|
|
2454
2457
|
if (this.readonly && this.enabled) {
|
|
2455
2458
|
return;
|
|
2456
2459
|
}
|
|
@@ -2459,7 +2462,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2459
2462
|
RichTextEditor.prototype.restrict = function (e) {
|
|
2460
2463
|
if (this.maxLength >= 0) {
|
|
2461
2464
|
var element = this.editorMode === 'Markdown' ? this.contentModule.getText() :
|
|
2462
|
-
(
|
|
2465
|
+
(this.getText().replace(/(\r\n|\n|\r|\t)/gm, '').replace(/\u200B/g, ''));
|
|
2463
2466
|
if (!element) {
|
|
2464
2467
|
return;
|
|
2465
2468
|
}
|
|
@@ -2491,11 +2494,12 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2491
2494
|
}
|
|
2492
2495
|
EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
|
|
2493
2496
|
EventHandler.add(this.inputElement, 'paste', this.onPaste, this);
|
|
2497
|
+
EventHandler.add(this.inputElement, 'content-changed', this.contentChanged, this);
|
|
2494
2498
|
EventHandler.add(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30), this);
|
|
2495
2499
|
EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
|
|
2496
2500
|
this.wireContextEvent();
|
|
2497
2501
|
this.formatter.editorManager.observer.on(CONSTANT.KEY_DOWN_HANDLER, this.editorKeyDown, this);
|
|
2498
|
-
this.element.ownerDocument.defaultView.addEventListener('resize', this.onResizeHandler, true);
|
|
2502
|
+
this.element.ownerDocument.defaultView.addEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
2499
2503
|
if (this.iframeSettings.enable) {
|
|
2500
2504
|
EventHandler.add(this.inputElement, 'focusin', this.focusHandler, this);
|
|
2501
2505
|
EventHandler.add(this.inputElement, 'focusout', this.blurHandler, this);
|
|
@@ -2538,6 +2542,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2538
2542
|
this.off(events.resizeInitialized, this.updateResizeFlag);
|
|
2539
2543
|
this.off(events.updateTbItemsStatus, this.updateStatus);
|
|
2540
2544
|
this.off(events.cleanupResizeElements, this.cleanupResizeElements);
|
|
2545
|
+
this.off(events.updateValueOnIdle, this.updateValueOnIdle);
|
|
2541
2546
|
if (this.readonly && this.enabled) {
|
|
2542
2547
|
return;
|
|
2543
2548
|
}
|
|
@@ -2553,13 +2558,14 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2553
2558
|
}
|
|
2554
2559
|
EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
|
|
2555
2560
|
EventHandler.remove(this.inputElement, 'paste', this.onPaste);
|
|
2561
|
+
EventHandler.remove(this.inputElement, 'content-changed', this.contentChanged);
|
|
2556
2562
|
EventHandler.remove(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30));
|
|
2557
2563
|
EventHandler.remove(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler);
|
|
2558
2564
|
this.unWireContextEvent();
|
|
2559
2565
|
if (this.formatter) {
|
|
2560
2566
|
this.formatter.editorManager.observer.off(CONSTANT.KEY_DOWN_HANDLER, this.editorKeyDown);
|
|
2561
2567
|
}
|
|
2562
|
-
this.element.ownerDocument.defaultView.removeEventListener('resize', this.onResizeHandler, true);
|
|
2568
|
+
this.element.ownerDocument.defaultView.removeEventListener('resize', debounce(this.onResizeHandler, 10), true);
|
|
2563
2569
|
if (this.iframeSettings.enable) {
|
|
2564
2570
|
EventHandler.remove(this.inputElement, 'focusin', this.focusHandler);
|
|
2565
2571
|
EventHandler.remove(this.inputElement, 'focusout', this.blurHandler);
|
|
@@ -2606,6 +2612,33 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2606
2612
|
}
|
|
2607
2613
|
}
|
|
2608
2614
|
};
|
|
2615
|
+
RichTextEditor.prototype.removeSelectionClassStates = function (element) {
|
|
2616
|
+
var classNames = [classes.CLS_IMG_FOCUS, classes.CLS_TABLE_SEL, classes.CLS_VID_FOCUS, classes.CLS_AUD_FOCUS];
|
|
2617
|
+
for (var i = 0; i < classNames.length; i++) {
|
|
2618
|
+
var item = element.querySelectorAll('.' + classNames[i]);
|
|
2619
|
+
removeClass(item, classNames[i]);
|
|
2620
|
+
if (item.length === 0) {
|
|
2621
|
+
continue;
|
|
2622
|
+
}
|
|
2623
|
+
for (var j = 0; j < item.length; j++) {
|
|
2624
|
+
if (item[j].classList.length === 0) {
|
|
2625
|
+
item[j].removeAttribute('class');
|
|
2626
|
+
}
|
|
2627
|
+
if (item[j].nodeName === 'IMG' && item[j].style.outline !== '') {
|
|
2628
|
+
item[j].style.outline = '';
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
};
|
|
2633
|
+
RichTextEditor.prototype.getRenderedQuickToolbarElem = function () {
|
|
2634
|
+
var quickToolbars = this.quickToolbarModule.getQuickToolbarInstance();
|
|
2635
|
+
for (var i = 0; i < quickToolbars.length; i++) {
|
|
2636
|
+
if (quickToolbars[i] && quickToolbars[i].isRendered) {
|
|
2637
|
+
return quickToolbars[i].element;
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
return null;
|
|
2641
|
+
};
|
|
2609
2642
|
__decorate([
|
|
2610
2643
|
Complex({}, ToolbarSettings)
|
|
2611
2644
|
], RichTextEditor.prototype, "toolbarSettings", void 0);
|