@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Property, NotifyPropertyChanges, INotifyPropertyChanged, Event } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Property, NotifyPropertyChanges, INotifyPropertyChanged, Event } from '@syncfusion/ej2-base';
|
|
2
2
|
import {KeyboardEventArgs} from "./keyboard";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -7,24 +7,24 @@ import {KeyboardEventArgs} from "./keyboard";
|
|
|
7
7
|
export interface KeyboardEventsModel {
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Specifies key combination and it respective action name.
|
|
11
|
-
*
|
|
12
|
-
* @default null
|
|
13
|
-
*/
|
|
14
|
-
keyConfigs?: { [key: string]: string };
|
|
10
|
+
* Specifies key combination and it respective action name.
|
|
11
|
+
*
|
|
12
|
+
* @default null
|
|
13
|
+
*/
|
|
14
|
+
keyConfigs?: { [key: string]: string };
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Specifies on which event keyboardEvents class should listen for key press. For ex., `keyup`, `keydown` or `keypress`
|
|
18
|
-
*
|
|
19
|
-
* @default 'keyup'
|
|
20
|
-
*/
|
|
21
|
-
eventName?: string;
|
|
17
|
+
* Specifies on which event keyboardEvents class should listen for key press. For ex., `keyup`, `keydown` or `keypress`
|
|
18
|
+
*
|
|
19
|
+
* @default 'keyup'
|
|
20
|
+
*/
|
|
21
|
+
eventName?: string;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Specifies the listener when keyboard actions is performed.
|
|
25
|
-
*
|
|
26
|
-
* @event 'keyAction'
|
|
27
|
-
*/
|
|
28
|
-
keyAction?: EmitType<KeyboardEventArgs>;
|
|
24
|
+
* Specifies the listener when keyboard actions is performed.
|
|
25
|
+
*
|
|
26
|
+
* @event 'keyAction'
|
|
27
|
+
*/
|
|
28
|
+
keyAction?: EmitType<KeyboardEventArgs>;
|
|
29
29
|
|
|
30
30
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
-
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;
|
|
18
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
-
};
|
|
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
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;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
20
|
import { Property, NotifyPropertyChanges, Event } from '@syncfusion/ej2-base';
|
|
21
21
|
import { Base } from '@syncfusion/ej2-base';
|
|
22
22
|
var keyCode = {
|
|
@@ -65,7 +65,9 @@ var keyCode = {
|
|
|
65
65
|
'singlequote': 222,
|
|
66
66
|
']': 221,
|
|
67
67
|
'[': 219,
|
|
68
|
-
'=': 187
|
|
68
|
+
'=': 187,
|
|
69
|
+
'<': 188,
|
|
70
|
+
'>': 190
|
|
69
71
|
};
|
|
70
72
|
/**
|
|
71
73
|
* KeyboardEvents class enables you to bind key action desired key combinations for ex., Ctrl+A, Delete, Alt+Space etc.
|
|
@@ -84,7 +86,7 @@ var keyCode = {
|
|
|
84
86
|
* ```
|
|
85
87
|
*
|
|
86
88
|
* @hidden
|
|
87
|
-
|
|
89
|
+
* @deprecated
|
|
88
90
|
*/
|
|
89
91
|
var KeyboardEvents = /** @class */ (function (_super) {
|
|
90
92
|
__extends(KeyboardEvents, _super);
|
|
@@ -19,7 +19,7 @@ export declare class MarkdownEditor {
|
|
|
19
19
|
* @function destroy
|
|
20
20
|
* @returns {void}
|
|
21
21
|
* @hidden
|
|
22
|
-
|
|
22
|
+
* @deprecated
|
|
23
23
|
*/
|
|
24
24
|
destroy(): void;
|
|
25
25
|
private moduleDestroy;
|
|
@@ -37,7 +37,7 @@ export declare class MarkdownEditor {
|
|
|
37
37
|
* @param {RichTextEditorModel} e - specifies the editor model
|
|
38
38
|
* @returns {void}
|
|
39
39
|
* @hidden
|
|
40
|
-
|
|
40
|
+
* @deprecated
|
|
41
41
|
*/
|
|
42
42
|
protected onPropertyChanged(e: {
|
|
43
43
|
[key: string]: RichTextEditorModel;
|
|
@@ -22,7 +22,7 @@ var MarkdownEditor = /** @class */ (function () {
|
|
|
22
22
|
* @function destroy
|
|
23
23
|
* @returns {void}
|
|
24
24
|
* @hidden
|
|
25
|
-
|
|
25
|
+
* @deprecated
|
|
26
26
|
*/
|
|
27
27
|
MarkdownEditor.prototype.destroy = function () {
|
|
28
28
|
if (isNullOrUndefined(this.parent)) {
|
|
@@ -74,7 +74,9 @@ var MarkdownEditor = /** @class */ (function () {
|
|
|
74
74
|
MarkdownEditor.prototype.onToolbarClick = function (args) {
|
|
75
75
|
var item = args.item;
|
|
76
76
|
var textArea = this.parent.contentModule.getEditPanel();
|
|
77
|
-
|
|
77
|
+
if (item.command !== 'Formats') {
|
|
78
|
+
textArea.focus();
|
|
79
|
+
}
|
|
78
80
|
var startOffset = textArea.selectionStart;
|
|
79
81
|
var endOffset = textArea.selectionEnd;
|
|
80
82
|
var text = textArea.value.substring(startOffset, endOffset);
|
|
@@ -147,7 +149,7 @@ var MarkdownEditor = /** @class */ (function () {
|
|
|
147
149
|
* @param {RichTextEditorModel} e - specifies the editor model
|
|
148
150
|
* @returns {void}
|
|
149
151
|
* @hidden
|
|
150
|
-
|
|
152
|
+
* @deprecated
|
|
151
153
|
*/
|
|
152
154
|
MarkdownEditor.prototype.onPropertyChanged = function (e) {
|
|
153
155
|
// On property code change here
|
|
@@ -46,7 +46,7 @@ export declare class PasteCleanup {
|
|
|
46
46
|
* @param {Element []} imgElement - specifies the array elements.
|
|
47
47
|
* @returns {void}
|
|
48
48
|
* @hidden
|
|
49
|
-
|
|
49
|
+
* @deprecated
|
|
50
50
|
*/
|
|
51
51
|
private imageFormatting;
|
|
52
52
|
private radioRender;
|
|
@@ -55,6 +55,7 @@ export declare class PasteCleanup {
|
|
|
55
55
|
private updateCss;
|
|
56
56
|
private setCssClass;
|
|
57
57
|
private destroyDialog;
|
|
58
|
+
private docClick;
|
|
58
59
|
private cleanAppleClass;
|
|
59
60
|
private formatting;
|
|
60
61
|
private cropImageHandler;
|
|
@@ -64,6 +65,8 @@ export declare class PasteCleanup {
|
|
|
64
65
|
private removeTempClass;
|
|
65
66
|
private sanitizeHelper;
|
|
66
67
|
private plainFormatting;
|
|
68
|
+
private removingComments;
|
|
69
|
+
private reframeToBrContent;
|
|
67
70
|
private getTextContent;
|
|
68
71
|
private detachInlineElements;
|
|
69
72
|
private findDetachEmptyElem;
|
|
@@ -73,6 +76,8 @@ export declare class PasteCleanup {
|
|
|
73
76
|
private deniedTags;
|
|
74
77
|
private deniedAttributes;
|
|
75
78
|
private allowedStyle;
|
|
79
|
+
private findLastElement;
|
|
80
|
+
private processPictureElement;
|
|
76
81
|
/**
|
|
77
82
|
* For internal use only - Get the module name.
|
|
78
83
|
*
|
|
@@ -2,7 +2,7 @@ import * as events from '../base/constant';
|
|
|
2
2
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
3
3
|
import { RadioButton } from '@syncfusion/ej2-buttons';
|
|
4
4
|
import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass, removeClass } from '@syncfusion/ej2-base';
|
|
5
|
-
import { getUniqueID, Browser } from '@syncfusion/ej2-base';
|
|
5
|
+
import { getUniqueID, Browser, closest } from '@syncfusion/ej2-base';
|
|
6
6
|
import { CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT } from '../base/classes';
|
|
7
7
|
import { CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT } from '../base/classes';
|
|
8
8
|
import { CLS_RTE_IMAGE, CLS_IMGINLINE, CLS_IMGBREAK } from '../base/classes';
|
|
@@ -46,6 +46,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
46
46
|
this.parent.on(events.pasteClean, this.pasteClean, this);
|
|
47
47
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
48
48
|
this.parent.on(events.destroy, this.destroy, this);
|
|
49
|
+
this.parent.on(events.docClick, this.docClick, this);
|
|
49
50
|
};
|
|
50
51
|
PasteCleanup.prototype.destroy = function () {
|
|
51
52
|
this.removeEventListener();
|
|
@@ -57,6 +58,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
57
58
|
this.parent.off(events.pasteClean, this.pasteClean);
|
|
58
59
|
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
59
60
|
this.parent.off(events.destroy, this.destroy);
|
|
61
|
+
this.parent.off(events.docClick, this.docClick);
|
|
60
62
|
};
|
|
61
63
|
PasteCleanup.prototype.pasteClean = function (e) {
|
|
62
64
|
var _this = this;
|
|
@@ -66,6 +68,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
66
68
|
event: e
|
|
67
69
|
};
|
|
68
70
|
var value = null;
|
|
71
|
+
var isClipboardHTMLDataNull = false;
|
|
69
72
|
var imageproperties;
|
|
70
73
|
if (e.args && !isNOU(e.args.clipboardData)) {
|
|
71
74
|
value = e.args.clipboardData.getData('text/html');
|
|
@@ -104,6 +107,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
104
107
|
var divElement = this.parent.createElement('div');
|
|
105
108
|
divElement.innerHTML = this.splitBreakLine(value);
|
|
106
109
|
value = divElement.innerHTML;
|
|
110
|
+
isClipboardHTMLDataNull = true;
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
else if (value.length > 0) {
|
|
@@ -111,7 +115,8 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
111
115
|
args: e.args,
|
|
112
116
|
text: e.text,
|
|
113
117
|
allowedStylePropertiesArray: this.parent.pasteCleanupSettings.allowedStyleProps,
|
|
114
|
-
callBack: function (a, cropImageData) {
|
|
118
|
+
callBack: function (a, cropImageData, pasteTableSource) {
|
|
119
|
+
args.pasteTableSource = pasteTableSource;
|
|
115
120
|
value = a.trim();
|
|
116
121
|
_this.cropImageData = cropImageData;
|
|
117
122
|
}
|
|
@@ -123,12 +128,24 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
123
128
|
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
124
129
|
var tempDivElem = this.parent.createElement('div');
|
|
125
130
|
tempDivElem.innerHTML = value;
|
|
131
|
+
var unsupportedImg = tempDivElem.querySelectorAll('.e-rte-image-unsupported');
|
|
132
|
+
for (var index = 0; index < unsupportedImg.length; index++) {
|
|
133
|
+
unsupportedImg[index].setAttribute('alt', this.i10n.getConstant('unsupportedImage'));
|
|
134
|
+
unsupportedImg[index].classList.remove('e-rte-image-unsupported');
|
|
135
|
+
}
|
|
136
|
+
value = tempDivElem.innerHTML;
|
|
126
137
|
var isValueNotEmpty = tempDivElem.textContent !== '' || !isNOU(tempDivElem.querySelector('img')) ||
|
|
127
138
|
!isNOU(tempDivElem.querySelector('table'));
|
|
139
|
+
this.parent.notify(events.cleanupResizeElements, {
|
|
140
|
+
value: value,
|
|
141
|
+
callBack: function (currentValue) {
|
|
142
|
+
value = currentValue;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
128
145
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
129
146
|
if (isValueNotEmpty) {
|
|
130
147
|
e.args.preventDefault();
|
|
131
|
-
this.pasteDialog(value, args);
|
|
148
|
+
this.pasteDialog(value, args, isClipboardHTMLDataNull);
|
|
132
149
|
}
|
|
133
150
|
else if (Browser.userAgent.indexOf('Firefox') !== -1 && isNOU(file)) {
|
|
134
151
|
this.fireFoxImageUpload();
|
|
@@ -140,7 +157,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
140
157
|
}
|
|
141
158
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
142
159
|
e.args.preventDefault();
|
|
143
|
-
this.plainFormatting(value, args);
|
|
160
|
+
this.plainFormatting(value, args, isClipboardHTMLDataNull);
|
|
144
161
|
}
|
|
145
162
|
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
146
163
|
e.args.preventDefault();
|
|
@@ -182,13 +199,17 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
182
199
|
PasteCleanup.prototype.splitBreakLine = function (value) {
|
|
183
200
|
var enterSplitText = value.split('\n');
|
|
184
201
|
var contentInnerElem = '';
|
|
202
|
+
var startNode = this.parent.enterKey === 'P' ? '<p>' : (this.parent.enterKey === 'DIV' ? '<div>' : '');
|
|
203
|
+
var endNode = this.parent.enterKey === 'P' ? '</p>' : (this.parent.enterKey === 'DIV' ? '</div>' : '<br>');
|
|
185
204
|
for (var i = 0; i < enterSplitText.length; i++) {
|
|
186
205
|
if (enterSplitText[i].trim() === '') {
|
|
187
206
|
contentInnerElem += getDefaultValue(this.parent);
|
|
188
207
|
}
|
|
189
208
|
else {
|
|
190
209
|
var contentWithSpace = this.makeSpace(enterSplitText[i]);
|
|
191
|
-
contentInnerElem += '<
|
|
210
|
+
contentInnerElem += (i === 0 && this.parent.enterKey !== 'BR' ? '<span>' : startNode) +
|
|
211
|
+
(contentWithSpace.trim() === '' ? '<br>' : contentWithSpace.trim()) +
|
|
212
|
+
(enterSplitText.length - 1 === i && this.parent.enterKey === 'BR' ? '' : (i === 0 && this.parent.enterKey !== 'BR' ? '</span>' : endNode));
|
|
192
213
|
}
|
|
193
214
|
}
|
|
194
215
|
return contentInnerElem;
|
|
@@ -398,7 +419,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
398
419
|
});
|
|
399
420
|
popupObj.close();
|
|
400
421
|
imgElem.style.opacity = '1';
|
|
401
|
-
uploadObj.
|
|
422
|
+
if (!uploadObj.isDestroyed) {
|
|
423
|
+
uploadObj.destroy();
|
|
424
|
+
}
|
|
402
425
|
this.toolbarEnableDisable(false);
|
|
403
426
|
};
|
|
404
427
|
PasteCleanup.prototype.refreshPopup = function (imageElement, popupObj) {
|
|
@@ -443,7 +466,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
443
466
|
* @param {Element []} imgElement - specifies the array elements.
|
|
444
467
|
* @returns {void}
|
|
445
468
|
* @hidden
|
|
446
|
-
|
|
469
|
+
* @deprecated
|
|
447
470
|
*/
|
|
448
471
|
PasteCleanup.prototype.imageFormatting = function (pasteArgs, imgElement) {
|
|
449
472
|
if (!isNOU(imgElement.elements[0].getAttribute('src'))) {
|
|
@@ -457,10 +480,10 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
457
480
|
var range = this.nodeSelectionObj.getRange(currentDocument);
|
|
458
481
|
this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
|
|
459
482
|
if (this.parent.pasteCleanupSettings.prompt) {
|
|
460
|
-
this.pasteDialog(imageValue, pasteArgs);
|
|
483
|
+
this.pasteDialog(imageValue, pasteArgs, false);
|
|
461
484
|
}
|
|
462
485
|
else if (this.parent.pasteCleanupSettings.plainText) {
|
|
463
|
-
this.plainFormatting(imageValue, pasteArgs);
|
|
486
|
+
this.plainFormatting(imageValue, pasteArgs, false);
|
|
464
487
|
}
|
|
465
488
|
else if (this.parent.pasteCleanupSettings.keepFormat) {
|
|
466
489
|
this.formatting(imageValue, false, pasteArgs);
|
|
@@ -484,7 +507,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
484
507
|
var plainTextElement = this.parent.element.querySelector('#plainTextFormat');
|
|
485
508
|
this.plainTextRadioButton.appendTo(plainTextElement);
|
|
486
509
|
};
|
|
487
|
-
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked) {
|
|
510
|
+
PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull) {
|
|
488
511
|
if (keepChecked) {
|
|
489
512
|
this.formatting(value, false, args);
|
|
490
513
|
}
|
|
@@ -492,10 +515,10 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
492
515
|
this.formatting(value, true, args);
|
|
493
516
|
}
|
|
494
517
|
else {
|
|
495
|
-
this.plainFormatting(value, args);
|
|
518
|
+
this.plainFormatting(value, args, isClipboardHTMLDataNull);
|
|
496
519
|
}
|
|
497
520
|
};
|
|
498
|
-
PasteCleanup.prototype.pasteDialog = function (value, args) {
|
|
521
|
+
PasteCleanup.prototype.pasteDialog = function (value, args, isClipboardHTMLDataNull) {
|
|
499
522
|
var _this = this;
|
|
500
523
|
var isHeight = false;
|
|
501
524
|
var preRTEHeight = this.parent.height;
|
|
@@ -512,7 +535,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
512
535
|
var argument = _this.dialogObj;
|
|
513
536
|
_this.dialogRenderObj.close(argument);
|
|
514
537
|
_this.dialogObj.destroy();
|
|
515
|
-
_this.selectFormatting(value, args, keepChecked, cleanChecked);
|
|
538
|
+
_this.selectFormatting(value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull);
|
|
516
539
|
}
|
|
517
540
|
},
|
|
518
541
|
buttonModel: {
|
|
@@ -549,7 +572,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
549
572
|
width: '300px',
|
|
550
573
|
height: '265px',
|
|
551
574
|
cssClass: CLS_RTE_DIALOG_MIN_HEIGHT,
|
|
552
|
-
isModal:
|
|
575
|
+
isModal: Browser.isDevice,
|
|
553
576
|
visible: false
|
|
554
577
|
};
|
|
555
578
|
this.dialogObj = this.dialogRenderObj.render(dialogModel);
|
|
@@ -573,7 +596,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
573
596
|
isHeight = true;
|
|
574
597
|
}
|
|
575
598
|
this.dialogObj.show();
|
|
576
|
-
this.setCssClass({ cssClass: this.parent.
|
|
599
|
+
this.setCssClass({ cssClass: this.parent.getCssClass() });
|
|
577
600
|
};
|
|
578
601
|
PasteCleanup.prototype.updateCss = function (currentObj, e) {
|
|
579
602
|
if (currentObj && e.cssClass) {
|
|
@@ -603,13 +626,22 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
603
626
|
this.updateCss(this.keepRadioButton, e);
|
|
604
627
|
};
|
|
605
628
|
PasteCleanup.prototype.destroyDialog = function (rteDialogWrapper) {
|
|
606
|
-
var rteDialogContainer = this.parent.element.querySelector('.e-
|
|
629
|
+
var rteDialogContainer = this.parent.element.querySelector('.e-rte-dialog-minheight');
|
|
607
630
|
detach(rteDialogContainer);
|
|
608
631
|
var rteDialogWrapperChildLength = rteDialogWrapper.children.length;
|
|
609
632
|
for (var i = 0; i < rteDialogWrapperChildLength; i++) {
|
|
610
633
|
detach(rteDialogWrapper.children[0]);
|
|
611
634
|
}
|
|
612
635
|
};
|
|
636
|
+
PasteCleanup.prototype.docClick = function (e) {
|
|
637
|
+
var target = e.args.target;
|
|
638
|
+
if (target && target.classList && ((this.dialogObj && !closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']')))
|
|
639
|
+
&& (!target.classList.contains('e-toolbar-item'))) {
|
|
640
|
+
if (this.dialogObj) {
|
|
641
|
+
this.dialogObj.hide();
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
};
|
|
613
645
|
PasteCleanup.prototype.cleanAppleClass = function (elem) {
|
|
614
646
|
var appleClassElem = elem.querySelectorAll('br.Apple-interchange-newline');
|
|
615
647
|
for (var i = 0; i < appleClassElem.length; i++) {
|
|
@@ -647,6 +679,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
647
679
|
this.setImageProperties(allImg[i]);
|
|
648
680
|
}
|
|
649
681
|
this.addTempClass(clipBoardElem);
|
|
682
|
+
if (clipBoardElem.querySelectorAll('picture').length > 0) {
|
|
683
|
+
this.processPictureElement(clipBoardElem);
|
|
684
|
+
}
|
|
650
685
|
if (clipBoardElem.textContent !== '' || !isNOU(clipBoardElem.querySelector('img')) ||
|
|
651
686
|
!isNOU(clipBoardElem.querySelector('table'))) {
|
|
652
687
|
var tempWrapperElem = this.parent.createElement('div');
|
|
@@ -678,11 +713,26 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
678
713
|
}
|
|
679
714
|
}
|
|
680
715
|
this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
|
|
681
|
-
clipBoardElem.innerHTML = value;
|
|
682
|
-
clipBoardElem = this.addTableClass(clipBoardElem);
|
|
716
|
+
clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
|
|
717
|
+
clipBoardElem = this.addTableClass(clipBoardElem, args.pasteTableSource);
|
|
683
718
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
684
719
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
685
720
|
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
721
|
+
if (!isNOU(returnArgs.elements) && !isNOU(returnArgs.imgElem) &&
|
|
722
|
+
returnArgs.imgElem.length > 0) {
|
|
723
|
+
var pasteContent = returnArgs.elements;
|
|
724
|
+
var imageContent = returnArgs.imgElem;
|
|
725
|
+
var lastElementChild = _this.findLastElement(pasteContent[pasteContent.length - 1]);
|
|
726
|
+
var isImageAtLast = !isNOU(lastElementChild) ? lastElementChild.nodeName === 'IMG' : false;
|
|
727
|
+
if (isImageAtLast || pasteContent[pasteContent.length - 1] === imageContent[imageContent.length - 1]) {
|
|
728
|
+
_this.parent.notify(events.insertCompleted, {
|
|
729
|
+
args: args.event,
|
|
730
|
+
type: 'Images',
|
|
731
|
+
isNotify: true,
|
|
732
|
+
elements: imageContent[imageContent.length - 1]
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
}
|
|
686
736
|
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
687
737
|
this.removeTempClass();
|
|
688
738
|
this.parent.notify(events.toolbarRefresh, {});
|
|
@@ -737,12 +787,16 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
737
787
|
}
|
|
738
788
|
}
|
|
739
789
|
};
|
|
740
|
-
PasteCleanup.prototype.addTableClass = function (element) {
|
|
790
|
+
PasteCleanup.prototype.addTableClass = function (element, source) {
|
|
791
|
+
source = isNOU(source) ? '' : source;
|
|
741
792
|
var tableElement = element.querySelectorAll('table');
|
|
742
793
|
for (var i = 0; i < tableElement.length; i++) {
|
|
743
|
-
if (!tableElement[i].classList.contains('e-rte-table')) {
|
|
794
|
+
if (!tableElement[i].classList.contains('e-rte-table') && (source === 'html' || source === '')) {
|
|
744
795
|
tableElement[i].classList.add('e-rte-table');
|
|
745
796
|
}
|
|
797
|
+
else if (source && source !== 'html') {
|
|
798
|
+
tableElement[i].classList.add('e-rte-paste-' + source + '-table');
|
|
799
|
+
}
|
|
746
800
|
}
|
|
747
801
|
return element;
|
|
748
802
|
};
|
|
@@ -786,7 +840,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
786
840
|
return value;
|
|
787
841
|
};
|
|
788
842
|
//Plain Formatting
|
|
789
|
-
PasteCleanup.prototype.plainFormatting = function (value, args) {
|
|
843
|
+
PasteCleanup.prototype.plainFormatting = function (value, args, isClipboardHTMLDataNull) {
|
|
790
844
|
var _this = this;
|
|
791
845
|
var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
792
846
|
clipBoardElem.innerHTML = value;
|
|
@@ -824,6 +878,13 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
824
878
|
this.saveSelection.restore();
|
|
825
879
|
clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
|
|
826
880
|
this.addTempClass(clipBoardElem);
|
|
881
|
+
this.removingComments(clipBoardElem);
|
|
882
|
+
if (this.parent.enterKey === 'BR' && !isClipboardHTMLDataNull) {
|
|
883
|
+
clipBoardElem = this.reframeToBrContent(clipBoardElem);
|
|
884
|
+
}
|
|
885
|
+
else if (this.parent.enterKey === 'DIV') {
|
|
886
|
+
clipBoardElem.innerHTML = clipBoardElem.innerHTML.replace(/<p class="pasteContent_RTE">/g, '<div>').replace(/<\/p>/g, '</div>');
|
|
887
|
+
}
|
|
827
888
|
this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
|
|
828
889
|
clipBoardElem.innerHTML = value;
|
|
829
890
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
@@ -838,6 +899,41 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
838
899
|
this.parent.formatter.onSuccess(this.parent, args);
|
|
839
900
|
}
|
|
840
901
|
};
|
|
902
|
+
PasteCleanup.prototype.removingComments = function (elm) {
|
|
903
|
+
var innerElement = elm.innerHTML;
|
|
904
|
+
innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
|
|
905
|
+
elm.innerHTML = innerElement;
|
|
906
|
+
};
|
|
907
|
+
PasteCleanup.prototype.reframeToBrContent = function (clipBoardElem) {
|
|
908
|
+
var newClipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
|
|
909
|
+
while (!isNOU(clipBoardElem.firstChild)) {
|
|
910
|
+
var brElem = this.parent.createElement('br');
|
|
911
|
+
var currentFirstChild = clipBoardElem.firstChild;
|
|
912
|
+
if (currentFirstChild.nodeName === '#text') {
|
|
913
|
+
var isNextSibPresent = !isNOU(currentFirstChild.nextSibling);
|
|
914
|
+
newClipBoardElem.appendChild(currentFirstChild);
|
|
915
|
+
if (isNextSibPresent) {
|
|
916
|
+
newClipBoardElem.appendChild(brElem);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
else {
|
|
920
|
+
var isCurrentNodeBRElm = currentFirstChild.nodeName === 'BR';
|
|
921
|
+
if (isCurrentNodeBRElm) {
|
|
922
|
+
newClipBoardElem.appendChild(currentFirstChild);
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
newClipBoardElem.appendChild(currentFirstChild.childNodes[0]);
|
|
926
|
+
}
|
|
927
|
+
if (!isNOU(currentFirstChild) && !isNOU(currentFirstChild.nextSibling)) {
|
|
928
|
+
newClipBoardElem.appendChild(brElem);
|
|
929
|
+
}
|
|
930
|
+
if (!isCurrentNodeBRElm && !isNOU(currentFirstChild)) {
|
|
931
|
+
detach(currentFirstChild);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
return newClipBoardElem;
|
|
936
|
+
};
|
|
841
937
|
PasteCleanup.prototype.getTextContent = function (clipBoardElem) {
|
|
842
938
|
for (var i = 0; i < this.blockNode.length; i++) {
|
|
843
939
|
var inElem = clipBoardElem.querySelectorAll(this.blockNode[i]);
|
|
@@ -885,14 +981,16 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
885
981
|
for (var i = 0; i < this.inlineNode.length; i++) {
|
|
886
982
|
var inElem = clipBoardElem.querySelectorAll(this.inlineNode[i]);
|
|
887
983
|
for (var j = 0; j < inElem.length; j++) {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
984
|
+
if (!(inElem[j] === clipBoardElem.firstChild && inElem[j].nodeName === 'SPAN')) {
|
|
985
|
+
var parElem = void 0;
|
|
986
|
+
for (var k = 0; k < inElem[j].childNodes.length; k++) {
|
|
987
|
+
parElem = inElem[j].childNodes[k].parentElement;
|
|
988
|
+
inElem[j].childNodes[k].parentElement.parentElement.insertBefore(inElem[j].childNodes[k], inElem[j].childNodes[k].parentElement);
|
|
989
|
+
k--;
|
|
990
|
+
}
|
|
991
|
+
if (!isNOU(parElem)) {
|
|
992
|
+
detach(parElem);
|
|
993
|
+
}
|
|
896
994
|
}
|
|
897
995
|
}
|
|
898
996
|
}
|
|
@@ -1033,6 +1131,36 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
1033
1131
|
}
|
|
1034
1132
|
return clipBoardElem;
|
|
1035
1133
|
};
|
|
1134
|
+
PasteCleanup.prototype.findLastElement = function (element) {
|
|
1135
|
+
if (!isNOU(element) && !isNOU(element.lastElementChild)) {
|
|
1136
|
+
var lastChild = element.lastElementChild;
|
|
1137
|
+
while (lastChild && lastChild.lastElementChild) {
|
|
1138
|
+
lastChild = lastChild.lastElementChild;
|
|
1139
|
+
}
|
|
1140
|
+
return lastChild;
|
|
1141
|
+
}
|
|
1142
|
+
return null;
|
|
1143
|
+
};
|
|
1144
|
+
PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
|
|
1145
|
+
var pictureElems = clipBoardElem.querySelectorAll('picture');
|
|
1146
|
+
for (var i = 0; i < pictureElems.length; i++) {
|
|
1147
|
+
var imgElem = pictureElems[i].querySelector('img');
|
|
1148
|
+
var sourceElems = pictureElems[i].querySelectorAll('source');
|
|
1149
|
+
if (imgElem && imgElem.getAttribute('src')) {
|
|
1150
|
+
var srcValue = imgElem.getAttribute('src');
|
|
1151
|
+
var url = new URL(srcValue);
|
|
1152
|
+
for (var j = 0; j < sourceElems.length; j++) {
|
|
1153
|
+
var srcset = sourceElems[j].getAttribute('srcset');
|
|
1154
|
+
if (srcset) {
|
|
1155
|
+
if (srcset.indexOf('http') === -1) {
|
|
1156
|
+
var fullPath = url.origin + srcset;
|
|
1157
|
+
sourceElems[j].setAttribute('srcset', fullPath);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1036
1164
|
/**
|
|
1037
1165
|
* For internal use only - Get the module name.
|
|
1038
1166
|
*
|