@syncfusion/ej2-richtexteditor 19.2.62 → 19.3.43
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 +1 -1
- package/CHANGELOG.md +21 -9
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +858 -245
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +864 -243
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/common/types.d.ts +8 -0
- package/src/editor-manager/base/editor-manager.d.ts +1 -1
- package/src/editor-manager/base/editor-manager.js +6 -6
- package/src/editor-manager/base/interface.d.ts +7 -1
- package/src/editor-manager/plugin/clearformat-exec.js +2 -2
- package/src/editor-manager/plugin/clearformat.d.ts +3 -1
- package/src/editor-manager/plugin/clearformat.js +19 -9
- package/src/editor-manager/plugin/dom-node.js +2 -2
- package/src/editor-manager/plugin/formats.d.ts +1 -0
- package/src/editor-manager/plugin/formats.js +87 -7
- package/src/editor-manager/plugin/image.js +55 -47
- package/src/editor-manager/plugin/inserthtml.js +10 -2
- package/src/editor-manager/plugin/isformatted.js +2 -1
- package/src/editor-manager/plugin/lists.d.ts +1 -0
- package/src/editor-manager/plugin/lists.js +87 -8
- package/src/editor-manager/plugin/nodecutter.d.ts +1 -0
- package/src/editor-manager/plugin/nodecutter.js +1 -0
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
- package/src/editor-manager/plugin/selection-commands.js +14 -6
- package/src/editor-manager/plugin/selection-exec.js +2 -2
- package/src/editor-manager/plugin/table.js +19 -9
- package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -4
- package/src/rich-text-editor/actions/enter-key.d.ts +18 -0
- package/src/rich-text-editor/actions/enter-key.js +290 -0
- package/src/rich-text-editor/actions/html-editor.js +30 -20
- package/src/rich-text-editor/actions/paste-clean-up.js +5 -5
- package/src/rich-text-editor/actions/resize.js +4 -4
- package/src/rich-text-editor/base/constant.d.ts +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/interface.d.ts +15 -3
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +27 -1
- package/src/rich-text-editor/base/rich-text-editor.d.ts +34 -5
- package/src/rich-text-editor/base/rich-text-editor.js +58 -56
- package/src/rich-text-editor/base/util.d.ts +7 -1
- package/src/rich-text-editor/base/util.js +45 -11
- package/src/rich-text-editor/formatter/formatter.js +9 -7
- package/src/rich-text-editor/models/items.js +3 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +2 -2
- package/src/rich-text-editor/renderer/image-module.d.ts +6 -0
- package/src/rich-text-editor/renderer/image-module.js +70 -26
- package/src/rich-text-editor/renderer/link-module.js +4 -3
- package/src/rich-text-editor/renderer/popup-renderer.js +1 -2
- package/src/rich-text-editor/renderer/render.js +10 -2
- package/src/rich-text-editor/renderer/table-module.js +13 -5
- package/src/rich-text-editor/renderer/view-source.js +21 -3
- package/styles/bootstrap-dark.css +25 -12
- package/styles/bootstrap.css +25 -12
- package/styles/bootstrap4.css +21 -13
- package/styles/bootstrap5-dark.css +3058 -0
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +3058 -0
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark.css +20 -12
- package/styles/fabric.css +20 -12
- package/styles/highcontrast-light.css +20 -12
- package/styles/highcontrast.css +19 -18
- package/styles/material-dark.css +22 -14
- package/styles/material.css +19 -11
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap-definition.scss +1 -1
- package/styles/rich-text-editor/_bootstrap4-definition.scss +2 -2
- package/styles/rich-text-editor/_bootstrap5-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_bootstrap5-definition.scss +168 -0
- package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -1
- package/styles/rich-text-editor/_fabric-definition.scss +1 -1
- package/styles/rich-text-editor/_highcontrast-definition.scss +2 -2
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -1
- package/styles/rich-text-editor/_layout.scss +64 -7
- package/styles/rich-text-editor/_tailwind-dark-definition.scss +1 -165
- package/styles/rich-text-editor/_tailwind-definition.scss +74 -72
- package/styles/rich-text-editor/_theme.scss +103 -3
- package/styles/rich-text-editor/bootstrap-dark.css +25 -12
- package/styles/rich-text-editor/bootstrap.css +25 -12
- package/styles/rich-text-editor/bootstrap4.css +21 -13
- package/styles/rich-text-editor/bootstrap5-dark.css +3058 -0
- package/styles/rich-text-editor/bootstrap5-dark.scss +4 -0
- package/styles/rich-text-editor/bootstrap5.css +3058 -0
- package/styles/rich-text-editor/bootstrap5.scss +4 -0
- package/styles/rich-text-editor/fabric-dark.css +20 -12
- package/styles/rich-text-editor/fabric.css +20 -12
- package/styles/rich-text-editor/highcontrast-light.css +20 -12
- package/styles/rich-text-editor/highcontrast.css +19 -18
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap4.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap5-dark.scss +1 -0
- package/styles/rich-text-editor/icons/_bootstrap5.scss +303 -0
- package/styles/rich-text-editor/icons/_fabric-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_fabric.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast.scss +1 -1
- package/styles/rich-text-editor/icons/_material-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_material.scss +1 -1
- package/styles/rich-text-editor/icons/_tailwind-dark.scss +1 -304
- package/styles/rich-text-editor/icons/_tailwind.scss +2 -2
- package/styles/rich-text-editor/material-dark.css +22 -14
- package/styles/rich-text-editor/material.css +19 -11
- package/styles/rich-text-editor/tailwind-dark.css +51 -20
- package/styles/rich-text-editor/tailwind.css +49 -18
- package/styles/tailwind-dark.css +51 -20
- package/styles/tailwind.css +49 -18
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as events from '../base/constant';
|
|
2
2
|
import { isNullOrUndefined, closest, attributes, removeClass, addClass, Browser, detach } from '@syncfusion/ej2-base';
|
|
3
|
+
import { isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
|
|
3
4
|
import { HTMLFormatter } from '../formatter/html-formatter';
|
|
4
5
|
import { RenderType } from '../base/enum';
|
|
5
6
|
import * as classes from '../base/classes';
|
|
@@ -9,7 +10,7 @@ import { ContentRender } from '../renderer/content-renderer';
|
|
|
9
10
|
import { ColorPickerInput } from './color-picker';
|
|
10
11
|
import { NodeSelection } from '../../selection/selection';
|
|
11
12
|
import { InsertHtml } from '../../editor-manager/plugin/inserthtml';
|
|
12
|
-
import { getTextNodesUnder, sanitizeHelper } from '../base/util';
|
|
13
|
+
import { getTextNodesUnder, sanitizeHelper, getDefaultValue } from '../base/util';
|
|
13
14
|
import { isIDevice } from '../../common/util';
|
|
14
15
|
import { XhtmlValidation } from './xhtml-validation';
|
|
15
16
|
import { ON_BEGIN } from './../../common/constant';
|
|
@@ -92,33 +93,40 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
92
93
|
HtmlEditor.prototype.onKeyDown = function (e) {
|
|
93
94
|
var _this = this;
|
|
94
95
|
var currentRange;
|
|
96
|
+
var args = e.args;
|
|
95
97
|
if (Browser.info.name === 'chrome') {
|
|
96
98
|
currentRange = this.parent.getRange();
|
|
97
99
|
this.backSpaceCleanup(e, currentRange);
|
|
98
100
|
this.deleteCleanup(e, currentRange);
|
|
99
101
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
this.rangeCollection
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
if (args.keyCode === 9 && this.parent.enableTabKey) {
|
|
103
|
+
if (!isNOU(args.target) && isNullOrUndefined(closest(args.target, '.e-rte-toolbar'))) {
|
|
104
|
+
var range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
|
|
105
|
+
var parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
|
|
106
|
+
if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
|
|
107
|
+
closest(parentNode[0], 'table')) && range.startOffset === 0)) {
|
|
108
|
+
args.preventDefault();
|
|
109
|
+
if (!args.shiftKey) {
|
|
110
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), ' ');
|
|
111
|
+
this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()));
|
|
112
|
+
}
|
|
113
|
+
else if (this.rangeCollection.length > 0 &&
|
|
114
|
+
this.rangeCollection[this.rangeCollection.length - 1].startContainer.textContent.length === 4) {
|
|
115
|
+
var textCont = this.rangeCollection[this.rangeCollection.length - 1].startContainer;
|
|
116
|
+
this.nodeSelectionObj.setSelectionText(this.contentRenderer.getDocument(), textCont, textCont, 0, textCont.textContent.length);
|
|
117
|
+
InsertHtml.Insert(this.contentRenderer.getDocument(), document.createTextNode(''));
|
|
118
|
+
this.rangeCollection.pop();
|
|
119
|
+
}
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
if (e.args.action === 'space' ||
|
|
120
|
-
e.args.action === 'enter'
|
|
124
|
+
e.args.action === 'enter' ||
|
|
125
|
+
e.args.keyCode === 13) {
|
|
121
126
|
this.spaceLink(e.args);
|
|
127
|
+
if (this.parent.editorMode === 'HTML' && !((this.parent.shiftEnterKey === 'BR' && e.args.shiftKey))) {
|
|
128
|
+
this.parent.notify(events.enterHandler, { args: e.args });
|
|
129
|
+
}
|
|
122
130
|
}
|
|
123
131
|
if (e.args.action === 'space') {
|
|
124
132
|
var currentRange_1 = this.parent.getRange();
|
|
@@ -160,10 +168,11 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
160
168
|
this.oldRangeElement = null;
|
|
161
169
|
this.deleteRangeElement = null;
|
|
162
170
|
this.deleteOldRangeElement = null;
|
|
163
|
-
|
|
171
|
+
args.preventDefault();
|
|
164
172
|
}
|
|
165
173
|
};
|
|
166
174
|
HtmlEditor.prototype.isOrderedList = function (editorValue) {
|
|
175
|
+
editorValue = editorValue.replace(/\u200B/g, '');
|
|
167
176
|
var olListStartRegex = [/^[1]+[.]+$/, /^[i]+[.]+$/, /^[a]+[.]+$/];
|
|
168
177
|
if (!isNullOrUndefined(editorValue)) {
|
|
169
178
|
for (var i = 0; i < olListStartRegex.length; i++) {
|
|
@@ -175,6 +184,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
175
184
|
return false;
|
|
176
185
|
};
|
|
177
186
|
HtmlEditor.prototype.isUnOrderedList = function (editorValue) {
|
|
187
|
+
editorValue = editorValue.replace(/\u200B/g, '');
|
|
178
188
|
var ulListStartRegex = [/^[*]$/, /^[-]$/];
|
|
179
189
|
if (!isNullOrUndefined(editorValue)) {
|
|
180
190
|
for (var i = 0; i < ulListStartRegex.length; i++) {
|
|
@@ -360,7 +370,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
360
370
|
var contentInnerElem = '';
|
|
361
371
|
for (var i = 0; i < enterSplitText.length; i++) {
|
|
362
372
|
if (enterSplitText[i].trim() === '') {
|
|
363
|
-
contentInnerElem +=
|
|
373
|
+
contentInnerElem += getDefaultValue(this.parent);
|
|
364
374
|
}
|
|
365
375
|
else {
|
|
366
376
|
var contentWithSpace = '';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as events from '../base/constant';
|
|
2
2
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
3
3
|
import { RadioButton } from '@syncfusion/ej2-buttons';
|
|
4
|
-
import { isNullOrUndefined as isNOU, isNullOrUndefined, detach,
|
|
4
|
+
import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass } from '@syncfusion/ej2-base';
|
|
5
5
|
import { getUniqueID, Browser } 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';
|
|
@@ -11,7 +11,7 @@ import * as EVENTS from './../../common/constant';
|
|
|
11
11
|
import { RenderType } from '../base/enum';
|
|
12
12
|
import { Uploader } from '@syncfusion/ej2-inputs';
|
|
13
13
|
import * as classes from '../base/classes';
|
|
14
|
-
import { sanitizeHelper, convertToBlob } from '../base/util';
|
|
14
|
+
import { sanitizeHelper, convertToBlob, getDefaultValue } from '../base/util';
|
|
15
15
|
/**
|
|
16
16
|
* PasteCleanup module called when pasting content in RichTextEditor
|
|
17
17
|
*/
|
|
@@ -143,7 +143,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
143
143
|
var contentInnerElem = '';
|
|
144
144
|
for (var i = 0; i < enterSplitText.length; i++) {
|
|
145
145
|
if (enterSplitText[i].trim() === '') {
|
|
146
|
-
contentInnerElem +=
|
|
146
|
+
contentInnerElem += getDefaultValue(this.parent);
|
|
147
147
|
}
|
|
148
148
|
else {
|
|
149
149
|
var contentWithSpace = this.makeSpace(enterSplitText[i]);
|
|
@@ -477,7 +477,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
477
477
|
dialog.hide();
|
|
478
478
|
_this.parent.height = isHeight ? preRTEHeight : _this.parent.height;
|
|
479
479
|
isHeight = false;
|
|
480
|
-
var argument =
|
|
480
|
+
var argument = dialog;
|
|
481
481
|
_this.dialogRenderObj.close(argument);
|
|
482
482
|
dialog.destroy();
|
|
483
483
|
_this.selectFormatting(value, args, keepChecked, cleanChecked);
|
|
@@ -495,7 +495,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
495
495
|
dialog.hide();
|
|
496
496
|
_this.parent.height = isHeight ? preRTEHeight : _this.parent.height;
|
|
497
497
|
isHeight = false;
|
|
498
|
-
var args_1 =
|
|
498
|
+
var args_1 = dialog;
|
|
499
499
|
_this.dialogRenderObj.close(args_1);
|
|
500
500
|
dialog.destroy();
|
|
501
501
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventHandler, Browser, isNullOrUndefined,
|
|
1
|
+
import { EventHandler, Browser, isNullOrUndefined, detach } from '@syncfusion/ej2-base';
|
|
2
2
|
import * as events from '../base/constant';
|
|
3
3
|
import * as classes from '../base/classes';
|
|
4
4
|
/**
|
|
@@ -34,7 +34,7 @@ var Resize = /** @class */ (function () {
|
|
|
34
34
|
}
|
|
35
35
|
this.wireResizeEvents();
|
|
36
36
|
this.parent.notify(events.resizeInitialized, {});
|
|
37
|
-
var args =
|
|
37
|
+
var args = { event: e, requestType: 'editor' };
|
|
38
38
|
this.parent.trigger(events.resizeStart, args, function (resizeStartArgs) {
|
|
39
39
|
if (resizeStartArgs.cancel) {
|
|
40
40
|
_this.unwireResizeEvents();
|
|
@@ -43,7 +43,7 @@ var Resize = /** @class */ (function () {
|
|
|
43
43
|
};
|
|
44
44
|
Resize.prototype.performResize = function (e) {
|
|
45
45
|
var _this = this;
|
|
46
|
-
var args =
|
|
46
|
+
var args = { event: e, requestType: 'editor' };
|
|
47
47
|
this.parent.trigger(events.onResize, args, function (resizingArgs) {
|
|
48
48
|
if (resizingArgs.cancel) {
|
|
49
49
|
_this.unwireResizeEvents();
|
|
@@ -67,7 +67,7 @@ var Resize = /** @class */ (function () {
|
|
|
67
67
|
Resize.prototype.stopResize = function (e) {
|
|
68
68
|
this.parent.refreshUI();
|
|
69
69
|
this.unwireResizeEvents();
|
|
70
|
-
var args =
|
|
70
|
+
var args = { event: e, requestType: 'editor' };
|
|
71
71
|
this.parent.trigger(events.resizeStop, args);
|
|
72
72
|
};
|
|
73
73
|
Resize.prototype.getEventType = function (e) {
|
|
@@ -8,7 +8,7 @@ import { ClickEventArgs } from '@syncfusion/ej2-navigations';
|
|
|
8
8
|
import { BaseToolbar } from '../actions/base-toolbar';
|
|
9
9
|
import { BaseQuickToolbar } from '../actions/base-quick-toolbar';
|
|
10
10
|
import { NodeSelection } from '../../selection/selection';
|
|
11
|
-
import { EditorMode } from './../../common/types';
|
|
11
|
+
import { EditorMode, EnterKey, ShiftEnterKey } from './../../common/types';
|
|
12
12
|
import { MarkdownSelection } from './../../markdown-parser/plugin/markdown-selection';
|
|
13
13
|
import { ToolbarSettingsModel, IFrameSettingsModel, ImageSettingsModel, TableSettingsModel } from '../models/models';
|
|
14
14
|
import { QuickToolbarSettingsModel, InlineModeModel, PasteCleanupSettingsModel, FileManagerSettingsModel } from '../models/models';
|
|
@@ -32,6 +32,8 @@ import { PasteCleanup } from '../actions/paste-clean-up';
|
|
|
32
32
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
33
33
|
import { Resize } from '../actions/resize';
|
|
34
34
|
import { FileManager } from '../actions/file-manager';
|
|
35
|
+
import { NodeCutter, DOMNode } from '../../editor-manager';
|
|
36
|
+
import { EnterKeyAction } from '../actions/enter-key';
|
|
35
37
|
/**
|
|
36
38
|
* Specifies Rich Text Editor interfaces.
|
|
37
39
|
*
|
|
@@ -91,6 +93,9 @@ export interface IRichTextEditor extends Component<HTMLElement> {
|
|
|
91
93
|
fullScreenModule?: FullScreen;
|
|
92
94
|
resizeModule?: Resize;
|
|
93
95
|
refreshUI?(): void;
|
|
96
|
+
enterKeyModule?: EnterKeyAction;
|
|
97
|
+
enterKey?: EnterKey;
|
|
98
|
+
shiftEnterKey?: ShiftEnterKey;
|
|
94
99
|
pasteCleanupModule?: PasteCleanup;
|
|
95
100
|
undoRedoModule?: UndoRedoManager;
|
|
96
101
|
quickToolbarModule?: QuickToolbar;
|
|
@@ -363,8 +368,13 @@ export interface ILinkCommandsArgs {
|
|
|
363
368
|
* Provides information about a Table added to the Rich Text Editor.
|
|
364
369
|
*/
|
|
365
370
|
export interface ITableCommandsArgs {
|
|
366
|
-
/**
|
|
371
|
+
/**
|
|
372
|
+
|
|
373
|
+
* This argument deprecated. Use `rows` argument.
|
|
374
|
+
*/
|
|
367
375
|
row?: number;
|
|
376
|
+
/** Defines the number of rows to be inserted in the table */
|
|
377
|
+
rows?: number;
|
|
368
378
|
/** Defines the number of columns to be inserted in the table */
|
|
369
379
|
columns?: number;
|
|
370
380
|
/** Defines the minWidth, maxWidth and width of the table */
|
|
@@ -380,7 +390,7 @@ export interface ITableCommandsArgs {
|
|
|
380
390
|
|
|
381
391
|
*/
|
|
382
392
|
export interface ITableArgs {
|
|
383
|
-
|
|
393
|
+
rows?: number;
|
|
384
394
|
columns?: number;
|
|
385
395
|
width?: {
|
|
386
396
|
minWidth?: string | number;
|
|
@@ -417,6 +427,8 @@ export interface IEditorModel {
|
|
|
417
427
|
undoRedoManager?: UndoRedoManager | UndoRedoCommands;
|
|
418
428
|
nodeSelection?: NodeSelection;
|
|
419
429
|
mdSelectionFormats?: MDSelectionFormats;
|
|
430
|
+
domNode?: DOMNode;
|
|
431
|
+
nodeCutter?: NodeCutter;
|
|
420
432
|
}
|
|
421
433
|
/**
|
|
422
434
|
* Provides information about a ToolbarItems.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ModuleDeclaration, EventHandler, Complex, Browser, EmitType, addClass, select, detach } from '@syncfusion/ej2-base';import { Property, NotifyPropertyChanges, INotifyPropertyChanged, formatUnit, L10n, closest } from '@syncfusion/ej2-base';import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, compile, append, extend, debounce
|
|
1
|
+
import { Component, ModuleDeclaration, EventHandler, Complex, Browser, EmitType, addClass, select, detach } from '@syncfusion/ej2-base';import { Property, NotifyPropertyChanges, INotifyPropertyChanged, formatUnit, L10n, closest } from '@syncfusion/ej2-base';import { setStyleAttribute, Event, removeClass, print as printWindow, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, compile, append, extend, debounce } from '@syncfusion/ej2-base';import { Touch as EJ2Touch, TapEventArgs } from '@syncfusion/ej2-base';import { getScrollableParent, BeforeOpenEventArgs, BeforeCloseEventArgs } from '@syncfusion/ej2-popups';import * as events from '../base/constant';import * as classes from '../base/classes';import { Render } from '../renderer/render';import { ViewSource } from '../renderer/view-source';import { IRenderer, IFormatter, PrintEventArgs, ActionCompleteEventArgs, ActionBeginEventArgs, ImageDropEventArgs } from './interface';import { IExecutionGroup, executeGroup, CommandName, ResizeArgs, StatusArgs, ToolbarStatusEventArgs } from './interface';import { BeforeQuickToolbarOpenArgs, ChangeEventArgs, AfterImageDeleteEventArgs, PasteCleanupArgs } from './interface';import { ILinkCommandsArgs, IImageCommandsArgs, BeforeSanitizeHtmlArgs, ITableCommandsArgs, ExecuteCommandOption } from './interface';import { ServiceLocator } from '../services/service-locator';import { RendererFactory } from '../services/renderer-factory';import { RenderType, ToolbarType, DialogType } from './enum';import { EditorMode, ShiftEnterKey, EnterKey } from './../../common/types';import { Toolbar } from '../actions/toolbar';import { ExecCommandCallBack } from '../actions/execute-command-callback';import { KeyboardEvents, KeyboardEventArgs } from '../actions/keyboard';import { FontFamilyModel, FontSizeModel, FontColorModel, FormatModel, BackgroundColorModel, NumberFormatListModel, BulletFormatListModel } from '../models/models';import { ToolbarSettingsModel, IFrameSettingsModel, ImageSettingsModel, TableSettingsModel } from '../models/models';import { QuickToolbarSettingsModel, InlineModeModel, PasteCleanupSettingsModel, FileManagerSettingsModel } from '../models/models';import { ToolbarSettings, ImageSettings, QuickToolbarSettings, FontFamily, FontSize, Format, NumberFormatList, BulletFormatList } from '../models/toolbar-settings';import { FileManagerSettings } from '../models/toolbar-settings';import { TableSettings, PasteCleanupSettings } from '../models/toolbar-settings';import { FontColor, BackgroundColor } from '../models/toolbar-settings';import { IFrameSettings } from '../models/iframe-settings';import { InlineMode } from '../models/inline-mode';import { Link } from '../renderer/link-module';import { Image } from '../renderer/image-module';import { Table } from '../renderer/table-module';import { Count } from '../actions/count';import { HtmlEditor } from '../actions/html-editor';import { MarkdownEditor } from '../actions/markdown-editor';import { defaultLocale } from '../models/default-locale';import { setAttributes } from '../actions/html-attributes';import { BaseToolbar } from '../actions/base-toolbar';import { QuickToolbar } from '../actions/quick-toolbar';import { FullScreen } from '../actions/full-screen';import { PasteCleanup } from '../actions/paste-clean-up';import { EnterKeyAction } from '../actions/enter-key';import * as CONSTANT from '../../common/constant';import { IHtmlKeyboardEvent } from '../../editor-manager/base/interface';import { dispatchEvent, getEditValue, isIDevice, decode, isEditableValueEmpty, getDefaultValue } from '../base/util';import { DialogRenderer } from '../renderer/dialog-renderer';import { SelectedEventArgs, RemovingEventArgs, UploadingEventArgs, BeforeUploadEventArgs } from '@syncfusion/ej2-inputs';import { Resize } from '../actions/resize';import { FileManager } from '../actions/file-manager';import { EditorManager } from '../../editor-manager';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -331,6 +331,32 @@ export interface RichTextEditorModel extends ComponentModel{
|
|
|
331
331
|
*/
|
|
332
332
|
value?: string;
|
|
333
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Specifies tag to be inserted when enter key is pressed.
|
|
336
|
+
*
|
|
337
|
+
* - `P` - When the enter key is pressed a `p` tag will be inserted and the default value of the Rich Text Editor will be <p><br></p>.
|
|
338
|
+
*
|
|
339
|
+
* - `DIV` - When the enter key is pressed a `div` tag will be inserted instead of the default `P` tag and the default value of the Rich Text Editor will be <div><br></div>.
|
|
340
|
+
*
|
|
341
|
+
* - `BR` - When the enter key is pressed a `br` tag will be inserted instead of the default `P` tag and the default value of the Rich Text Editor will be <br>.
|
|
342
|
+
*
|
|
343
|
+
* @default 'P'
|
|
344
|
+
*/
|
|
345
|
+
enterKey?: EnterKey;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Specifies tags to be inserted when shift+enter key is pressed.
|
|
349
|
+
*
|
|
350
|
+
* - `BR` - When the shift + enter key is pressed a `br` tag will be inserted which is the default behavior.
|
|
351
|
+
*
|
|
352
|
+
* - `P` - When the shift + enter key is pressed a `p` tag will be inserted instead of the default `br` tag.
|
|
353
|
+
*
|
|
354
|
+
* - `DIV` - When the shift + enter key is pressed a `div` tag will be inserted instead of the default `br` tag.
|
|
355
|
+
*
|
|
356
|
+
* @default 'BR'
|
|
357
|
+
*/
|
|
358
|
+
shiftEnterKey?: ShiftEnterKey;
|
|
359
|
+
|
|
334
360
|
/**
|
|
335
361
|
* Specifies the count of undo history which is stored in undoRedoManager.
|
|
336
362
|
*
|
|
@@ -5,12 +5,12 @@ import { RichTextEditorModel } from './rich-text-editor-model';
|
|
|
5
5
|
import { Render } from '../renderer/render';
|
|
6
6
|
import { ViewSource } from '../renderer/view-source';
|
|
7
7
|
import { IRenderer, IFormatter, ActionCompleteEventArgs, ActionBeginEventArgs, ImageDropEventArgs } from './interface';
|
|
8
|
-
import { CommandName, ResizeArgs } from './interface';
|
|
8
|
+
import { CommandName, ResizeArgs, ToolbarStatusEventArgs } from './interface';
|
|
9
9
|
import { BeforeQuickToolbarOpenArgs, ChangeEventArgs, AfterImageDeleteEventArgs, PasteCleanupArgs } from './interface';
|
|
10
10
|
import { ILinkCommandsArgs, IImageCommandsArgs, BeforeSanitizeHtmlArgs, ITableCommandsArgs, ExecuteCommandOption } from './interface';
|
|
11
11
|
import { ServiceLocator } from '../services/service-locator';
|
|
12
12
|
import { DialogType } from './enum';
|
|
13
|
-
import { EditorMode } from './../../common/types';
|
|
13
|
+
import { EditorMode, ShiftEnterKey, EnterKey } from './../../common/types';
|
|
14
14
|
import { Toolbar } from '../actions/toolbar';
|
|
15
15
|
import { KeyboardEvents } from '../actions/keyboard';
|
|
16
16
|
import { FontFamilyModel, FontSizeModel, FontColorModel, FormatModel, BackgroundColorModel, NumberFormatListModel, BulletFormatListModel } from '../models/models';
|
|
@@ -26,6 +26,7 @@ import { BaseToolbar } from '../actions/base-toolbar';
|
|
|
26
26
|
import { QuickToolbar } from '../actions/quick-toolbar';
|
|
27
27
|
import { FullScreen } from '../actions/full-screen';
|
|
28
28
|
import { PasteCleanup } from '../actions/paste-clean-up';
|
|
29
|
+
import { EnterKeyAction } from '../actions/enter-key';
|
|
29
30
|
import { SelectedEventArgs, RemovingEventArgs, UploadingEventArgs, BeforeUploadEventArgs } from '@syncfusion/ej2-inputs';
|
|
30
31
|
import { Resize } from '../actions/resize';
|
|
31
32
|
import { FileManager } from '../actions/file-manager';
|
|
@@ -121,6 +122,11 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
121
122
|
/**
|
|
122
123
|
* @hidden
|
|
123
124
|
|
|
125
|
+
*/
|
|
126
|
+
enterKeyModule: EnterKeyAction;
|
|
127
|
+
/**
|
|
128
|
+
* @hidden
|
|
129
|
+
|
|
124
130
|
*/
|
|
125
131
|
sourceCodeModule: ViewSource;
|
|
126
132
|
/**
|
|
@@ -458,6 +464,30 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
458
464
|
* @default null
|
|
459
465
|
*/
|
|
460
466
|
value: string;
|
|
467
|
+
/**
|
|
468
|
+
* Specifies tag to be inserted when enter key is pressed.
|
|
469
|
+
*
|
|
470
|
+
* - `P` - When the enter key is pressed a `p` tag will be inserted and the default value of the Rich Text Editor will be <p><br></p>.
|
|
471
|
+
*
|
|
472
|
+
* - `DIV` - When the enter key is pressed a `div` tag will be inserted instead of the default `P` tag and the default value of the Rich Text Editor will be <div><br></div>.
|
|
473
|
+
*
|
|
474
|
+
* - `BR` - When the enter key is pressed a `br` tag will be inserted instead of the default `P` tag and the default value of the Rich Text Editor will be <br>.
|
|
475
|
+
*
|
|
476
|
+
* @default 'P'
|
|
477
|
+
*/
|
|
478
|
+
enterKey: EnterKey;
|
|
479
|
+
/**
|
|
480
|
+
* Specifies tags to be inserted when shift+enter key is pressed.
|
|
481
|
+
*
|
|
482
|
+
* - `BR` - When the shift + enter key is pressed a `br` tag will be inserted which is the default behavior.
|
|
483
|
+
*
|
|
484
|
+
* - `P` - When the shift + enter key is pressed a `p` tag will be inserted instead of the default `br` tag.
|
|
485
|
+
*
|
|
486
|
+
* - `DIV` - When the shift + enter key is pressed a `div` tag will be inserted instead of the default `br` tag.
|
|
487
|
+
*
|
|
488
|
+
* @default 'BR'
|
|
489
|
+
*/
|
|
490
|
+
shiftEnterKey: ShiftEnterKey;
|
|
461
491
|
/**
|
|
462
492
|
* Specifies the count of undo history which is stored in undoRedoManager.
|
|
463
493
|
*
|
|
@@ -762,14 +792,14 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
762
792
|
|
|
763
793
|
* @event 'object'
|
|
764
794
|
*/
|
|
765
|
-
|
|
795
|
+
toolbarStatusUpdate: EmitType<Object>;
|
|
766
796
|
/**
|
|
767
797
|
* Triggers when the toolbar items status is updated.
|
|
768
798
|
*
|
|
769
799
|
* @event 'object'
|
|
770
800
|
* @blazorType ToolbarUpdateEventArgs
|
|
771
801
|
*/
|
|
772
|
-
|
|
802
|
+
updatedToolbarStatus: EmitType<ToolbarStatusEventArgs>;
|
|
773
803
|
/**
|
|
774
804
|
* Event triggers when the image is selected or dragged into the insert image dialog.
|
|
775
805
|
*
|
|
@@ -1253,7 +1283,6 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
1253
1283
|
private InjectSheet;
|
|
1254
1284
|
private createScriptElement;
|
|
1255
1285
|
private createStyleElement;
|
|
1256
|
-
private isBlazor;
|
|
1257
1286
|
private setValue;
|
|
1258
1287
|
private updateResizeFlag;
|
|
1259
1288
|
/**
|