@syncfusion/ej2-richtexteditor 23.2.7 → 24.1.41-569421
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 +1953 -1749
- 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 +9971 -8025
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +8445 -6498
- 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 +12 -1
- 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 +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 +39 -35
- package/src/editor-manager/plugin/dom-node.js +203 -62
- 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 +41 -18
- package/src/editor-manager/plugin/indents.d.ts +2 -2
- package/src/editor-manager/plugin/indents.js +3 -3
- 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 +85 -22
- 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 +10 -5
- package/src/editor-manager/plugin/lists.d.ts +2 -2
- package/src/editor-manager/plugin/lists.js +161 -72
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +4 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +216 -86
- package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
- package/src/editor-manager/plugin/nodecutter.js +11 -8
- package/src/editor-manager/plugin/selection-commands.d.ts +3 -1
- package/src/editor-manager/plugin/selection-commands.js +249 -5
- 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 +6 -3
- package/src/editor-manager/plugin/table.js +97 -51
- 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/global.d.ts +1 -0
- 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 +13 -12
- package/src/rich-text-editor/actions/base-quick-toolbar.js +70 -23
- package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
- package/src/rich-text-editor/actions/base-toolbar.js +36 -37
- package/src/rich-text-editor/actions/color-picker.d.ts +3 -2
- package/src/rich-text-editor/actions/color-picker.js +15 -5
- 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 +3 -2
- package/src/rich-text-editor/actions/dropdown-buttons.js +13 -7
- package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
- package/src/rich-text-editor/actions/emoji-picker.js +17 -8
- package/src/rich-text-editor/actions/enter-key.js +10 -5
- package/src/rich-text-editor/actions/file-manager.js +1 -1
- package/src/rich-text-editor/actions/format-painter.js +5 -2
- package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
- package/src/rich-text-editor/actions/full-screen.js +8 -7
- package/src/rich-text-editor/actions/html-editor.d.ts +5 -3
- package/src/rich-text-editor/actions/html-editor.js +134 -22
- 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 +6 -1
- package/src/rich-text-editor/actions/paste-clean-up.js +157 -29
- package/src/rich-text-editor/actions/quick-toolbar.d.ts +17 -9
- package/src/rich-text-editor/actions/quick-toolbar.js +68 -21
- 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 +16 -16
- package/src/rich-text-editor/actions/toolbar.js +48 -109
- 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 +125 -125
- package/src/rich-text-editor/base/classes.js +125 -125
- package/src/rich-text-editor/base/constant.d.ts +195 -150
- package/src/rich-text-editor/base/constant.js +364 -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 +96 -52
- 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 +76 -64
- package/src/rich-text-editor/base/rich-text-editor.js +247 -160
- package/src/rich-text-editor/base/util.d.ts +1 -1
- package/src/rich-text-editor/base/util.js +23 -5
- package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
- package/src/rich-text-editor/formatter/formatter.js +24 -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 +31 -25
- 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 +3 -3
- 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 +23 -5
- 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 +24 -4
- 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 +265 -221
- package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
- package/src/rich-text-editor/renderer/link-module.js +54 -25
- 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 +11 -2
- package/src/rich-text-editor/renderer/table-module.js +344 -169
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +12 -15
- package/src/rich-text-editor/renderer/toolbar-renderer.js +115 -110
- package/src/rich-text-editor/renderer/video-module.d.ts +4 -1
- package/src/rich-text-editor/renderer/video-module.js +83 -42
- package/src/rich-text-editor/renderer/view-source.d.ts +7 -6
- package/src/rich-text-editor/renderer/view-source.js +21 -11
- 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 +353 -103
- package/styles/bootstrap.css +357 -112
- package/styles/bootstrap4.css +338 -96
- package/styles/bootstrap5-dark.css +344 -97
- package/styles/bootstrap5.css +344 -97
- package/styles/fabric-dark.css +332 -90
- package/styles/fabric.css +333 -91
- package/styles/fluent-dark.css +360 -98
- package/styles/fluent.css +360 -98
- package/styles/highcontrast-light.css +332 -90
- package/styles/highcontrast.css +336 -91
- package/styles/material-dark.css +339 -92
- package/styles/material.css +339 -92
- package/styles/material3-dark.css +348 -100
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +348 -100
- 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 -2072
- 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 +926 -837
- package/styles/rich-text-editor/bootstrap-dark.css +353 -103
- package/styles/rich-text-editor/bootstrap.css +357 -112
- package/styles/rich-text-editor/bootstrap4.css +338 -96
- package/styles/rich-text-editor/bootstrap5-dark.css +344 -97
- package/styles/rich-text-editor/bootstrap5.css +344 -97
- package/styles/rich-text-editor/fabric-dark.css +332 -90
- package/styles/rich-text-editor/fabric.css +333 -91
- package/styles/rich-text-editor/fluent-dark.css +360 -98
- package/styles/rich-text-editor/fluent.css +360 -98
- package/styles/rich-text-editor/highcontrast-light.css +332 -90
- package/styles/rich-text-editor/highcontrast.css +336 -91
- 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 +339 -92
- package/styles/rich-text-editor/material.css +339 -92
- package/styles/rich-text-editor/material3-dark.css +348 -100
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +348 -100
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +383 -113
- package/styles/rich-text-editor/tailwind.css +383 -113
- package/styles/tailwind-dark.css +383 -113
- package/styles/tailwind.css +383 -113
- 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
package/helpers/e2e/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
define(["require", "exports", "./rte-helper"], function (require, exports, rte_helper_1) {
|
|
2
2
|
"use strict";
|
|
3
|
-
function __export(m) {
|
|
4
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
5
|
-
}
|
|
3
|
+
function __export(m) {
|
|
4
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
5
|
+
}
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
__export(rte_helper_1);
|
|
8
8
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
-
})();
|
|
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
14
|
define(["require", "exports", "@syncfusion/ej2-base/helpers/e2e"], function (require, exports, e2e_1) {
|
|
15
15
|
"use strict";
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
package/license
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license.
|
|
2
|
-
|
|
3
|
-
To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions.
|
|
4
|
-
|
|
5
|
-
Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options.
|
|
6
|
-
|
|
7
|
-
Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions.
|
|
8
|
-
|
|
9
|
-
The Syncfusion license that contains the terms and conditions can be found at
|
|
1
|
+
Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license.
|
|
2
|
+
|
|
3
|
+
To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions.
|
|
4
|
+
|
|
5
|
+
Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options.
|
|
6
|
+
|
|
7
|
+
Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions.
|
|
8
|
+
|
|
9
|
+
The Syncfusion license that contains the terms and conditions can be found at
|
|
10
10
|
https://www.syncfusion.com/content/downloads/syncfusion_license.pdf
|
package/package.json
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@24.1.41",
|
|
4
|
+
"_inBundle": false,
|
|
5
|
+
"_integrity": "sha512-h4DVBcoJwsAW5vm0Y6Ffg3KcNNeCxkj2MwOW+z+Aa8puZZETLQitQl8yt76IFRoxTY/MCdkoTWVILD5mstwkFg==",
|
|
6
|
+
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
|
+
"_phantomChildren": {},
|
|
8
|
+
"_requested": {
|
|
9
|
+
"type": "range",
|
|
10
|
+
"registry": true,
|
|
11
|
+
"raw": "@syncfusion/ej2-richtexteditor@*",
|
|
12
|
+
"name": "@syncfusion/ej2-richtexteditor",
|
|
13
|
+
"escapedName": "@syncfusion%2fej2-richtexteditor",
|
|
14
|
+
"scope": "@syncfusion",
|
|
15
|
+
"rawSpec": "*",
|
|
16
|
+
"saveSpec": null,
|
|
17
|
+
"fetchSpec": "*"
|
|
18
|
+
},
|
|
19
|
+
"_requiredBy": [
|
|
20
|
+
"/",
|
|
21
|
+
"/@syncfusion/ej2",
|
|
22
|
+
"/@syncfusion/ej2-angular-richtexteditor",
|
|
23
|
+
"/@syncfusion/ej2-gantt",
|
|
24
|
+
"/@syncfusion/ej2-inplace-editor",
|
|
25
|
+
"/@syncfusion/ej2-react-richtexteditor",
|
|
26
|
+
"/@syncfusion/ej2-vue-richtexteditor"
|
|
27
|
+
],
|
|
28
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.1.41.tgz",
|
|
29
|
+
"_shasum": "b0643450fa79cf814e9386718d1e011876c3946a",
|
|
30
|
+
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
|
+
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
32
|
+
"author": {
|
|
33
|
+
"name": "Syncfusion Inc."
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/issues"
|
|
37
|
+
},
|
|
38
|
+
"bundleDependencies": false,
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@syncfusion/ej2-base": "24.1.41",
|
|
41
|
+
"@syncfusion/ej2-buttons": "24.1.41",
|
|
42
|
+
"@syncfusion/ej2-filemanager": "24.1.41",
|
|
43
|
+
"@syncfusion/ej2-inputs": "24.1.41",
|
|
44
|
+
"@syncfusion/ej2-navigations": "24.1.41",
|
|
45
|
+
"@syncfusion/ej2-popups": "24.1.41",
|
|
46
|
+
"@syncfusion/ej2-splitbuttons": "24.1.41"
|
|
47
|
+
},
|
|
48
|
+
"deprecated": false,
|
|
49
|
+
"description": "Essential JS 2 RichTextEditor component",
|
|
50
|
+
"devDependencies": {},
|
|
51
|
+
"es2015": "./dist/es6/ej2-richtexteditor.es5.js",
|
|
52
|
+
"homepage": "https://www.syncfusion.com/javascript-ui-controls",
|
|
53
|
+
"keywords": [
|
|
54
|
+
"ej2",
|
|
55
|
+
"syncfusion",
|
|
56
|
+
"HTML5-rich-text-editor",
|
|
57
|
+
"wysiwyg-html-editor",
|
|
58
|
+
"rich-text-editor",
|
|
59
|
+
"markdown-editor",
|
|
60
|
+
"wysiwyg-markdown-editor",
|
|
61
|
+
"editor"
|
|
62
|
+
],
|
|
63
|
+
"license": "SEE LICENSE IN license",
|
|
64
|
+
"main": "./dist/ej2-richtexteditor.umd.min.js",
|
|
65
|
+
"module": "./index.js",
|
|
66
|
+
"name": "@syncfusion/ej2-richtexteditor",
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
70
|
+
},
|
|
71
|
+
"typings": "index.d.ts",
|
|
72
|
+
"version": "24.1.41-569421",
|
|
73
|
+
"sideEffects": false
|
|
74
|
+
}
|
package/src/common/config.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IImageResizeFactor } from "./interface";
|
|
1
2
|
/**
|
|
2
3
|
* Default Markdown formats config for adapter
|
|
3
4
|
*/
|
|
@@ -46,3 +47,9 @@ export declare const listConversionFilters: {
|
|
|
46
47
|
* @hidden
|
|
47
48
|
*/
|
|
48
49
|
export declare const selfClosingTags: string[];
|
|
50
|
+
/**
|
|
51
|
+
* Resize factor for image.
|
|
52
|
+
* @hidden
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
export declare const imageResizeFactor: IImageResizeFactor;
|
package/src/common/config.js
CHANGED
|
@@ -41,7 +41,7 @@ export var htmlKeyConfig = {
|
|
|
41
41
|
'insert-link': 'ctrl+k',
|
|
42
42
|
'insert-image': 'ctrl+shift+i',
|
|
43
43
|
'insert-audio': 'ctrl+shift+a',
|
|
44
|
-
'insert-video': 'ctrl+
|
|
44
|
+
'insert-video': 'ctrl+alt+v',
|
|
45
45
|
'insert-table': 'ctrl+shift+e',
|
|
46
46
|
'undo': 'ctrl+z',
|
|
47
47
|
'redo': 'ctrl+y',
|
|
@@ -128,3 +128,14 @@ export var selfClosingTags = [
|
|
|
128
128
|
'BR',
|
|
129
129
|
'IMG'
|
|
130
130
|
];
|
|
131
|
+
/**
|
|
132
|
+
* Resize factor for image.
|
|
133
|
+
* @hidden
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
export var imageResizeFactor = {
|
|
137
|
+
topLeft: [-1, -1],
|
|
138
|
+
topRight: [1, -1],
|
|
139
|
+
botRight: [1, 1],
|
|
140
|
+
botLeft: [-1, 1]
|
|
141
|
+
};
|
package/src/common/constant.d.ts
CHANGED
package/src/common/constant.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Specifies common models interfaces.
|
|
3
3
|
*
|
|
4
4
|
* @hidden
|
|
5
|
-
|
|
5
|
+
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
import { EditorMode } from './types';
|
|
8
8
|
/**
|
|
9
|
-
|
|
9
|
+
* @deprecated
|
|
10
10
|
*/
|
|
11
11
|
export interface IAdvanceListItem {
|
|
12
12
|
listStyle?: string;
|
|
@@ -14,7 +14,7 @@ export interface IAdvanceListItem {
|
|
|
14
14
|
type?: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
|
|
17
|
+
* @deprecated
|
|
18
18
|
*/
|
|
19
19
|
export interface IMarkdownFormatterCallBack {
|
|
20
20
|
selectedText?: string;
|
|
@@ -24,7 +24,7 @@ export interface IMarkdownFormatterCallBack {
|
|
|
24
24
|
requestType?: string;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
|
|
27
|
+
* @deprecated
|
|
28
28
|
*/
|
|
29
29
|
export interface IHtmlFormatterCallBack {
|
|
30
30
|
selectedNode?: Element;
|
|
@@ -37,7 +37,7 @@ export interface IHtmlFormatterCallBack {
|
|
|
37
37
|
event?: KeyboardEvent | MouseEvent;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
|
|
40
|
+
* @deprecated
|
|
41
41
|
*/
|
|
42
42
|
export interface IMarkdownToolbarStatus {
|
|
43
43
|
OrderedList: boolean;
|
|
@@ -45,14 +45,14 @@ export interface IMarkdownToolbarStatus {
|
|
|
45
45
|
Formats: string;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
|
|
48
|
+
* @deprecated
|
|
49
49
|
*/
|
|
50
50
|
export interface IUndoCallBack {
|
|
51
51
|
callBack?: Function;
|
|
52
52
|
event?: Object;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
|
|
55
|
+
* @deprecated
|
|
56
56
|
*/
|
|
57
57
|
export interface IToolbarStatus {
|
|
58
58
|
bold?: boolean;
|
|
@@ -77,3 +77,15 @@ export interface IToolbarStatus {
|
|
|
77
77
|
numberFormatList?: string | boolean;
|
|
78
78
|
bulletFormatList?: string | boolean;
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated
|
|
82
|
+
* @private
|
|
83
|
+
*
|
|
84
|
+
*
|
|
85
|
+
* */
|
|
86
|
+
export interface IImageResizeFactor {
|
|
87
|
+
topLeft: [number, number];
|
|
88
|
+
topRight: [number, number];
|
|
89
|
+
botLeft: [number, number];
|
|
90
|
+
botRight: [number, number];
|
|
91
|
+
}
|
package/src/common/types.d.ts
CHANGED
|
@@ -18,3 +18,9 @@ export declare type EnterKey = 'P' | 'DIV' | 'BR';
|
|
|
18
18
|
* Defines tag to be used when shift + enter key is pressed.
|
|
19
19
|
*/
|
|
20
20
|
export declare type ShiftEnterKey = 'P' | 'DIV' | 'BR';
|
|
21
|
+
/**
|
|
22
|
+
* Defines the types of action to be used in the Rich Text Editor.
|
|
23
|
+
* @hidden
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
export declare type ContentHeightSource = 'SourceCode' | 'Init' | 'Preview' | 'Maximize' | 'Minimize' | 'WindowResize' | 'Toolbar' | 'Resize' | 'Refresh';
|
package/src/common/util.d.ts
CHANGED
|
@@ -34,3 +34,9 @@ export declare function getDefaultHtmlTbStatus(): IToolbarStatus;
|
|
|
34
34
|
* @hidden
|
|
35
35
|
*/
|
|
36
36
|
export declare function getDefaultMDTbStatus(): IToolbarStatus;
|
|
37
|
+
/**
|
|
38
|
+
* @param {Range} range - specifies the range
|
|
39
|
+
* @returns {void}
|
|
40
|
+
* @hidden
|
|
41
|
+
*/
|
|
42
|
+
export declare function nestedListCleanUp(range: Range): void;
|
package/src/common/util.js
CHANGED
|
@@ -82,33 +82,47 @@ export function updateTextNode(value, enterAction) {
|
|
|
82
82
|
}
|
|
83
83
|
var tableElm = resultElm.querySelectorAll('table');
|
|
84
84
|
for (var i = 0; i < tableElm.length; i++) {
|
|
85
|
-
if (tableElm[i].
|
|
86
|
-
tableElm[i].
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (tdElm[j].style.borderLeft === 'none') {
|
|
91
|
-
tdElm[j].style.removeProperty('border-left');
|
|
92
|
-
}
|
|
93
|
-
if (tdElm[j].style.borderRight === 'none') {
|
|
94
|
-
tdElm[j].style.removeProperty('border-right');
|
|
95
|
-
}
|
|
96
|
-
if (tdElm[j].style.borderBottom === 'none') {
|
|
97
|
-
tdElm[j].style.removeProperty('border-bottom');
|
|
85
|
+
if (tableElm[i].classList.length > 0 && !tableElm[i].classList.contains('e-rte-table')) {
|
|
86
|
+
tableElm[i].classList.add('e-rte-paste-table');
|
|
87
|
+
if (tableElm[i].classList.contains('e-rte-paste-word-table')) {
|
|
88
|
+
tableElm[i].classList.remove('e-rte-paste-word-table');
|
|
89
|
+
continue; // Skiping the removal of the border if the source is from word.
|
|
98
90
|
}
|
|
99
|
-
if (
|
|
100
|
-
|
|
91
|
+
else if (tableElm[i].classList.contains('e-rte-paste-excel-table')) {
|
|
92
|
+
tableElm[i].classList.remove('e-rte-paste-excel-table');
|
|
93
|
+
if (tableElm[i].getAttribute('border') === '0') {
|
|
94
|
+
tableElm[i].removeAttribute('border');
|
|
95
|
+
}
|
|
96
|
+
var tdElm = tableElm[i].querySelectorAll('td');
|
|
97
|
+
for (var j = 0; j < tdElm.length; j++) {
|
|
98
|
+
if (tdElm[j].style.borderLeft === 'none') {
|
|
99
|
+
tdElm[j].style.removeProperty('border-left');
|
|
100
|
+
}
|
|
101
|
+
if (tdElm[j].style.borderRight === 'none') {
|
|
102
|
+
tdElm[j].style.removeProperty('border-right');
|
|
103
|
+
}
|
|
104
|
+
if (tdElm[j].style.borderBottom === 'none') {
|
|
105
|
+
tdElm[j].style.removeProperty('border-bottom');
|
|
106
|
+
}
|
|
107
|
+
if (tdElm[j].style.borderTop === 'none') {
|
|
108
|
+
tdElm[j].style.removeProperty('border-top');
|
|
109
|
+
}
|
|
110
|
+
if (tdElm[j].style.border === 'none') {
|
|
111
|
+
tdElm[j].style.removeProperty('border');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
101
114
|
}
|
|
102
|
-
if (
|
|
103
|
-
|
|
115
|
+
else if (tableElm[i].classList.contains('e-rte-paste-onenote-table')) {
|
|
116
|
+
tableElm[i].classList.remove('e-rte-paste-onenote-table');
|
|
117
|
+
continue;
|
|
104
118
|
}
|
|
105
119
|
}
|
|
106
|
-
if (!tableElm[i].classList.contains('e-rte-table')) {
|
|
107
|
-
tableElm[i].classList.add('e-rte-table');
|
|
108
|
-
}
|
|
109
120
|
}
|
|
110
121
|
var imageElm = resultElm.querySelectorAll('img');
|
|
111
122
|
for (var i = 0; i < imageElm.length; i++) {
|
|
123
|
+
if (imageElm[i].classList.contains('e-rte-image-unsupported')) {
|
|
124
|
+
continue; // Should not add the class if the image is Broken.
|
|
125
|
+
}
|
|
112
126
|
if (!imageElm[i].classList.contains('e-rte-image')) {
|
|
113
127
|
imageElm[i].classList.add('e-rte-image');
|
|
114
128
|
}
|
|
@@ -179,3 +193,30 @@ export function getDefaultMDTbStatus() {
|
|
|
179
193
|
formats: null
|
|
180
194
|
};
|
|
181
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* @param {Range} range - specifies the range
|
|
198
|
+
* @returns {void}
|
|
199
|
+
* @hidden
|
|
200
|
+
*/
|
|
201
|
+
export function nestedListCleanUp(range) {
|
|
202
|
+
if (range.startContainer.parentElement.closest('ol,ul') !== null && range.endContainer.parentElement.closest('ol,ul') !== null) {
|
|
203
|
+
range.extractContents();
|
|
204
|
+
while ((range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty').length > 0 ||
|
|
205
|
+
(range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('ol :empty').length > 0) {
|
|
206
|
+
var emptyLI = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll('li :empty');
|
|
207
|
+
if (emptyLI.length > 0) {
|
|
208
|
+
emptyLI.forEach(function (item) {
|
|
209
|
+
item.remove();
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
var liElem = (range.startContainer.nodeName === "#text" ? range.startContainer.parentElement : range.startContainer).querySelectorAll("li");
|
|
214
|
+
if (liElem.length > 0) {
|
|
215
|
+
liElem.forEach(function (item) {
|
|
216
|
+
if (item.firstChild.nodeName === "OL" || item.firstChild.nodeName === "UL") {
|
|
217
|
+
item.style.listStyleType = "none";
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
@@ -87,3 +87,9 @@ export var CLEAR_TYPE = 'clear-type';
|
|
|
87
87
|
* @hidden
|
|
88
88
|
*/
|
|
89
89
|
export var SELF_CLOSING_TAGS = ['area', 'base', 'br', 'embed', 'hr', 'img', 'input', 'param', 'source', 'track', 'wbr', 'iframe', 'td', 'table'];
|
|
90
|
+
/**
|
|
91
|
+
* Source
|
|
92
|
+
*
|
|
93
|
+
* @hidden
|
|
94
|
+
*/
|
|
95
|
+
export var PASTE_SOURCE = ['word', 'excel', 'onenote'];
|
|
@@ -24,7 +24,7 @@ import { EmojiPickerAction } from '../plugin/emoji-picker-action';
|
|
|
24
24
|
* EditorManager internal component
|
|
25
25
|
*
|
|
26
26
|
* @hidden
|
|
27
|
-
|
|
27
|
+
* @deprecated
|
|
28
28
|
*/
|
|
29
29
|
export declare class EditorManager {
|
|
30
30
|
currentDocument: HTMLDocument;
|
|
@@ -54,7 +54,7 @@ export declare class EditorManager {
|
|
|
54
54
|
* Constructor for creating the component
|
|
55
55
|
*
|
|
56
56
|
* @hidden
|
|
57
|
-
|
|
57
|
+
* @deprecated
|
|
58
58
|
* @param {ICommandModel} options - specifies the command Model
|
|
59
59
|
*/
|
|
60
60
|
constructor(options: ICommandModel);
|
|
@@ -76,7 +76,12 @@ export declare class EditorManager {
|
|
|
76
76
|
* @param {string} selector - specifies the selector values
|
|
77
77
|
* @returns {void}
|
|
78
78
|
* @hidden
|
|
79
|
-
|
|
79
|
+
* @deprecated
|
|
80
80
|
*/
|
|
81
81
|
execCommand<T>(command: ExecCommand, value: T, event?: Event, callBack?: Function, text?: string | Node, exeValue?: T, selector?: string, enterAction?: string): void;
|
|
82
|
+
private editorMouseDown;
|
|
83
|
+
private tripleClickSelection;
|
|
84
|
+
private getParentBlockNode;
|
|
85
|
+
private getLastTextNode;
|
|
86
|
+
private getFirstTextNode;
|
|
82
87
|
}
|
|
@@ -25,14 +25,14 @@ import { EmojiPickerAction } from '../plugin/emoji-picker-action';
|
|
|
25
25
|
* EditorManager internal component
|
|
26
26
|
*
|
|
27
27
|
* @hidden
|
|
28
|
-
|
|
28
|
+
* @deprecated
|
|
29
29
|
*/
|
|
30
30
|
var EditorManager = /** @class */ (function () {
|
|
31
31
|
/**
|
|
32
32
|
* Constructor for creating the component
|
|
33
33
|
*
|
|
34
34
|
* @hidden
|
|
35
|
-
|
|
35
|
+
* @deprecated
|
|
36
36
|
* @param {ICommandModel} options - specifies the command Model
|
|
37
37
|
*/
|
|
38
38
|
function EditorManager(options) {
|
|
@@ -68,6 +68,7 @@ var EditorManager = /** @class */ (function () {
|
|
|
68
68
|
this.observer.on(EVENTS.MODEL_CHANGED, this.onPropertyChanged, this);
|
|
69
69
|
this.observer.on(EVENTS.MS_WORD_CLEANUP, this.onWordPaste, this);
|
|
70
70
|
this.observer.on(EVENTS.ON_BEGIN, this.onBegin, this);
|
|
71
|
+
this.observer.on(EVENTS.MOUSE_DOWN, this.editorMouseDown, this);
|
|
71
72
|
};
|
|
72
73
|
EditorManager.prototype.onWordPaste = function (e) {
|
|
73
74
|
this.observer.notify(EVENTS.MS_WORD_CLEANUP_PLUGIN, e);
|
|
@@ -97,7 +98,7 @@ var EditorManager = /** @class */ (function () {
|
|
|
97
98
|
* @param {string} selector - specifies the selector values
|
|
98
99
|
* @returns {void}
|
|
99
100
|
* @hidden
|
|
100
|
-
|
|
101
|
+
* @deprecated
|
|
101
102
|
*/
|
|
102
103
|
/* eslint-enable */
|
|
103
104
|
EditorManager.prototype.execCommand = function (command, value, event, callBack, text, exeValue, selector, enterAction) {
|
|
@@ -211,6 +212,64 @@ var EditorManager = /** @class */ (function () {
|
|
|
211
212
|
event: event, callBack: callBack });
|
|
212
213
|
}
|
|
213
214
|
};
|
|
215
|
+
EditorManager.prototype.editorMouseDown = function (e) {
|
|
216
|
+
if (e.args.detail === 3) {
|
|
217
|
+
this.tripleClickSelection(e.args);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
EditorManager.prototype.tripleClickSelection = function (e) {
|
|
221
|
+
var range = this.nodeSelection.getRange(this.currentDocument);
|
|
222
|
+
var selection = this.nodeSelection.get(this.currentDocument);
|
|
223
|
+
if (selection.rangeCount > 0 && selection.toString() !== '') {
|
|
224
|
+
var startBlockNode = this.getParentBlockNode(range.startContainer);
|
|
225
|
+
var endBlockNode = this.getParentBlockNode(range.endContainer);
|
|
226
|
+
if (startBlockNode && endBlockNode && startBlockNode === endBlockNode) {
|
|
227
|
+
var newRange = this.currentDocument.createRange();
|
|
228
|
+
var startTextNode = this.getFirstTextNode(startBlockNode);
|
|
229
|
+
var endTextNode = this.getLastTextNode(endBlockNode);
|
|
230
|
+
if (startTextNode && endTextNode) {
|
|
231
|
+
newRange.setStart(startTextNode, 0);
|
|
232
|
+
newRange.setEnd(endTextNode, endTextNode.textContent.length);
|
|
233
|
+
this.nodeSelection.setRange(this.currentDocument, newRange);
|
|
234
|
+
e.preventDefault();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
EditorManager.prototype.getParentBlockNode = function (node) {
|
|
240
|
+
var treeWalker = this.currentDocument.createTreeWalker(this.editableElement, // root
|
|
241
|
+
NodeFilter.SHOW_ELEMENT, // whatToShow
|
|
242
|
+
{
|
|
243
|
+
acceptNode: function (currentNode) {
|
|
244
|
+
// Check if the node is a block element
|
|
245
|
+
var displayStyle = window.getComputedStyle(currentNode).display;
|
|
246
|
+
if (displayStyle.indexOf('inline') < 0) {
|
|
247
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
return NodeFilter.FILTER_SKIP;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
treeWalker.currentNode = node;
|
|
255
|
+
var blockParent = treeWalker.parentNode();
|
|
256
|
+
return blockParent;
|
|
257
|
+
};
|
|
258
|
+
EditorManager.prototype.getLastTextNode = function (node) {
|
|
259
|
+
var treeWalker = this.currentDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT, null);
|
|
260
|
+
var lastTextNode = null;
|
|
261
|
+
var currentNode = treeWalker.nextNode();
|
|
262
|
+
while (currentNode) {
|
|
263
|
+
lastTextNode = currentNode;
|
|
264
|
+
currentNode = treeWalker.nextNode();
|
|
265
|
+
}
|
|
266
|
+
return lastTextNode;
|
|
267
|
+
};
|
|
268
|
+
EditorManager.prototype.getFirstTextNode = function (node) {
|
|
269
|
+
var treeWalker = this.currentDocument.createTreeWalker(node, NodeFilter.SHOW_TEXT, null);
|
|
270
|
+
var firstTextNode = treeWalker.nextNode();
|
|
271
|
+
return firstTextNode;
|
|
272
|
+
};
|
|
214
273
|
return EditorManager;
|
|
215
274
|
}());
|
|
216
275
|
export { EditorManager };
|