@syncfusion/ej2-richtexteditor 20.1.61 → 20.2.39
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/CHANGELOG.md +32 -0
- 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 +468 -191
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +460 -181
- 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/helpers/e2e/index.js +8 -6
- package/helpers/e2e/rte-helper.js +80 -64
- package/package.json +12 -12
- package/src/common/util.js +7 -8
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -0
- package/src/editor-manager/plugin/inserthtml.js +25 -3
- package/src/editor-manager/plugin/lists.js +14 -4
- package/src/markdown-parser/base/constant.d.ts +6 -0
- package/src/markdown-parser/base/constant.js +6 -0
- package/src/markdown-parser/base/markdown-parser.d.ts +2 -0
- package/src/markdown-parser/base/markdown-parser.js +6 -0
- package/src/markdown-parser/base/types.d.ts +1 -1
- package/src/markdown-parser/plugin/insert-text.d.ts +22 -0
- package/src/markdown-parser/plugin/insert-text.js +51 -0
- package/src/rich-text-editor/actions/color-picker.js +20 -4
- package/src/rich-text-editor/actions/full-screen.js +4 -2
- package/src/rich-text-editor/actions/resize.js +4 -3
- package/src/rich-text-editor/actions/toolbar.js +4 -2
- package/src/rich-text-editor/base/classes.d.ts +5 -0
- package/src/rich-text-editor/base/classes.js +5 -0
- package/src/rich-text-editor/base/constant.d.ts +46 -1
- package/src/rich-text-editor/base/constant.js +46 -1
- package/src/rich-text-editor/base/interface.d.ts +2 -0
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -0
- package/src/rich-text-editor/base/rich-text-editor.js +34 -27
- package/src/rich-text-editor/base/util.js +10 -6
- package/src/rich-text-editor/formatter/formatter.js +1 -1
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.d.ts +1 -0
- package/src/rich-text-editor/renderer/image-module.js +58 -44
- package/src/rich-text-editor/renderer/link-module.js +16 -14
- package/src/rich-text-editor/renderer/markdown-renderer.js +2 -1
- package/src/rich-text-editor/renderer/table-module.d.ts +3 -0
- package/src/rich-text-editor/renderer/table-module.js +133 -56
- package/src/rich-text-editor/renderer/toolbar-renderer.js +13 -2
- package/src/rich-text-editor/renderer/view-source.js +1 -1
- package/styles/bootstrap-dark.css +49 -0
- package/styles/bootstrap.css +49 -0
- package/styles/bootstrap4.css +49 -0
- package/styles/bootstrap5-dark.css +49 -0
- package/styles/bootstrap5.css +49 -0
- package/styles/fabric-dark.css +49 -0
- package/styles/fabric.css +49 -0
- package/styles/fluent-dark.css +53 -3
- package/styles/fluent.css +50 -0
- package/styles/highcontrast-light.css +49 -0
- package/styles/highcontrast.css +49 -0
- package/styles/material-dark.css +49 -0
- package/styles/material.css +49 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +17 -16
- package/styles/rich-text-editor/_bootstrap-definition.scss +17 -16
- package/styles/rich-text-editor/_bootstrap4-definition.scss +17 -16
- package/styles/rich-text-editor/_bootstrap5-definition.scss +17 -16
- package/styles/rich-text-editor/_fabric-dark-definition.scss +17 -16
- package/styles/rich-text-editor/_fabric-definition.scss +17 -16
- package/styles/rich-text-editor/_fluent-definition.scss +18 -16
- package/styles/rich-text-editor/_fusionnew-definition.scss +190 -0
- package/styles/rich-text-editor/_highcontrast-definition.scss +17 -16
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +17 -16
- package/styles/rich-text-editor/_layout.scss +59 -0
- package/styles/rich-text-editor/_material-dark-definition.scss +17 -16
- package/styles/rich-text-editor/_material-definition.scss +17 -16
- package/styles/rich-text-editor/_material3-definition.scss +190 -0
- package/styles/rich-text-editor/_tailwind-definition.scss +17 -16
- package/styles/rich-text-editor/bootstrap-dark.css +49 -0
- package/styles/rich-text-editor/bootstrap.css +49 -0
- package/styles/rich-text-editor/bootstrap4.css +49 -0
- package/styles/rich-text-editor/bootstrap5-dark.css +49 -0
- package/styles/rich-text-editor/bootstrap5.css +49 -0
- package/styles/rich-text-editor/fabric-dark.css +49 -0
- package/styles/rich-text-editor/fabric.css +49 -0
- package/styles/rich-text-editor/fluent-dark.css +53 -3
- package/styles/rich-text-editor/fluent.css +50 -0
- package/styles/rich-text-editor/highcontrast-light.css +49 -0
- package/styles/rich-text-editor/highcontrast.css +49 -0
- package/styles/rich-text-editor/icons/_fusionnew.scss +303 -0
- package/styles/rich-text-editor/icons/_material3.scss +303 -0
- package/styles/rich-text-editor/material-dark.css +49 -0
- package/styles/rich-text-editor/material.css +49 -0
- package/styles/rich-text-editor/tailwind-dark.css +49 -0
- package/styles/rich-text-editor/tailwind.css +49 -0
- package/styles/tailwind-dark.css +49 -0
- package/styles/tailwind.css +49 -0
|
@@ -105,7 +105,8 @@ var Toolbar = /** @class */ (function () {
|
|
|
105
105
|
container: ((this.parent.inlineMode.enable) ? 'quick' : 'toolbar'),
|
|
106
106
|
items: this.parent.toolbarSettings.items,
|
|
107
107
|
mode: tBarMode,
|
|
108
|
-
target: ele
|
|
108
|
+
target: ele,
|
|
109
|
+
cssClass: this.parent.cssClass
|
|
109
110
|
});
|
|
110
111
|
if (this.parent.toolbarSettings.type === ToolbarType.Expand) {
|
|
111
112
|
addClass([ele], ['e-rte-tb-mobile']);
|
|
@@ -222,7 +223,8 @@ var Toolbar = /** @class */ (function () {
|
|
|
222
223
|
container: 'toolbar',
|
|
223
224
|
items: this.parent.toolbarSettings.items,
|
|
224
225
|
mode: this.getToolbarMode(),
|
|
225
|
-
target: this.tbElement
|
|
226
|
+
target: this.tbElement,
|
|
227
|
+
cssClass: this.parent.cssClass
|
|
226
228
|
});
|
|
227
229
|
if (!this.parent.inlineMode.enable) {
|
|
228
230
|
if (this.parent.toolbarSettings.enableFloating) {
|
|
@@ -519,11 +519,41 @@ export declare const imageRemoving: string;
|
|
|
519
519
|
/**
|
|
520
520
|
* @hidden
|
|
521
521
|
|
|
522
|
+
*/
|
|
523
|
+
export declare const mediaSelected: string;
|
|
524
|
+
/**
|
|
525
|
+
* @hidden
|
|
526
|
+
|
|
527
|
+
*/
|
|
528
|
+
export declare const mediaUploading: string;
|
|
529
|
+
/**
|
|
530
|
+
* @hidden
|
|
531
|
+
|
|
532
|
+
*/
|
|
533
|
+
export declare const mediaUploadSuccess: string;
|
|
534
|
+
/**
|
|
535
|
+
* @hidden
|
|
536
|
+
|
|
537
|
+
*/
|
|
538
|
+
export declare const mediaUploadFailed: string;
|
|
539
|
+
/**
|
|
540
|
+
* @hidden
|
|
541
|
+
|
|
542
|
+
*/
|
|
543
|
+
export declare const mediaRemoving: string;
|
|
544
|
+
/**
|
|
545
|
+
* @hidden
|
|
546
|
+
|
|
522
547
|
*/
|
|
523
548
|
export declare const afterImageDelete: string;
|
|
524
549
|
/**
|
|
525
550
|
* @hidden
|
|
526
551
|
|
|
552
|
+
*/
|
|
553
|
+
export declare const afterMediaDelete: string;
|
|
554
|
+
/**
|
|
555
|
+
* @hidden
|
|
556
|
+
|
|
527
557
|
*/
|
|
528
558
|
export declare const drop: string;
|
|
529
559
|
/**
|
|
@@ -539,6 +569,11 @@ export declare const beforeImageUpload: string;
|
|
|
539
569
|
/**
|
|
540
570
|
* @hidden
|
|
541
571
|
|
|
572
|
+
*/
|
|
573
|
+
export declare const beforeMediaUpload: string;
|
|
574
|
+
/**
|
|
575
|
+
* @hidden
|
|
576
|
+
|
|
542
577
|
*/
|
|
543
578
|
export declare const resizeInitialized: string;
|
|
544
579
|
/**
|
|
@@ -594,6 +629,11 @@ export declare const closeImageDialog: string;
|
|
|
594
629
|
/**
|
|
595
630
|
* @hidden
|
|
596
631
|
|
|
632
|
+
*/
|
|
633
|
+
export declare const closeAudioDialog: string;
|
|
634
|
+
/**
|
|
635
|
+
* @hidden
|
|
636
|
+
|
|
597
637
|
*/
|
|
598
638
|
export declare const showTableDialog: string;
|
|
599
639
|
/**
|
|
@@ -610,4 +650,9 @@ export declare const bindCssClass: string;
|
|
|
610
650
|
* @hidden
|
|
611
651
|
|
|
612
652
|
*/
|
|
613
|
-
export declare const
|
|
653
|
+
export declare const blockEmptyNodes: string;
|
|
654
|
+
/**
|
|
655
|
+
* @hidden
|
|
656
|
+
|
|
657
|
+
*/
|
|
658
|
+
export declare const inlineEmptyNodes: string;
|
|
@@ -519,11 +519,41 @@ export var imageRemoving = 'imageRemoving';
|
|
|
519
519
|
/**
|
|
520
520
|
* @hidden
|
|
521
521
|
|
|
522
|
+
*/
|
|
523
|
+
export var mediaSelected = 'mediaSelected';
|
|
524
|
+
/**
|
|
525
|
+
* @hidden
|
|
526
|
+
|
|
527
|
+
*/
|
|
528
|
+
export var mediaUploading = 'mediaUploading';
|
|
529
|
+
/**
|
|
530
|
+
* @hidden
|
|
531
|
+
|
|
532
|
+
*/
|
|
533
|
+
export var mediaUploadSuccess = 'mediaUploadSuccess';
|
|
534
|
+
/**
|
|
535
|
+
* @hidden
|
|
536
|
+
|
|
537
|
+
*/
|
|
538
|
+
export var mediaUploadFailed = 'mediaUploadFailed';
|
|
539
|
+
/**
|
|
540
|
+
* @hidden
|
|
541
|
+
|
|
542
|
+
*/
|
|
543
|
+
export var mediaRemoving = 'mediaRemoving';
|
|
544
|
+
/**
|
|
545
|
+
* @hidden
|
|
546
|
+
|
|
522
547
|
*/
|
|
523
548
|
export var afterImageDelete = 'afterImageDelete';
|
|
524
549
|
/**
|
|
525
550
|
* @hidden
|
|
526
551
|
|
|
552
|
+
*/
|
|
553
|
+
export var afterMediaDelete = 'afterMediaaDelete';
|
|
554
|
+
/**
|
|
555
|
+
* @hidden
|
|
556
|
+
|
|
527
557
|
*/
|
|
528
558
|
export var drop = 'drop';
|
|
529
559
|
/**
|
|
@@ -539,6 +569,11 @@ export var beforeImageUpload = 'beforeImageUpload';
|
|
|
539
569
|
/**
|
|
540
570
|
* @hidden
|
|
541
571
|
|
|
572
|
+
*/
|
|
573
|
+
export var beforeMediaUpload = 'beforeMediaUpload';
|
|
574
|
+
/**
|
|
575
|
+
* @hidden
|
|
576
|
+
|
|
542
577
|
*/
|
|
543
578
|
export var resizeInitialized = 'resizeInitialized';
|
|
544
579
|
/**
|
|
@@ -594,6 +629,11 @@ export var closeImageDialog = 'closeImageDialog';
|
|
|
594
629
|
/**
|
|
595
630
|
* @hidden
|
|
596
631
|
|
|
632
|
+
*/
|
|
633
|
+
export var closeAudioDialog = 'closeAudioDialog';
|
|
634
|
+
/**
|
|
635
|
+
* @hidden
|
|
636
|
+
|
|
597
637
|
*/
|
|
598
638
|
export var showTableDialog = 'showTableDialog';
|
|
599
639
|
/**
|
|
@@ -610,4 +650,9 @@ export var bindCssClass = 'closeTableDialog';
|
|
|
610
650
|
* @hidden
|
|
611
651
|
|
|
612
652
|
*/
|
|
613
|
-
export var
|
|
653
|
+
export var blockEmptyNodes = "address:empty, article:empty, aside:empty, blockquote:empty,\n details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,\n h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, li:empty, main:empty, nav:empty,\n noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty";
|
|
654
|
+
/**
|
|
655
|
+
* @hidden
|
|
656
|
+
|
|
657
|
+
*/
|
|
658
|
+
export var inlineEmptyNodes = "a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,\n canvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,\n ins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,\n q:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,\n template:empty, textarea:empty, time:empty, u:empty, tt:empty, var:empty, wbr:empty";
|
|
@@ -148,6 +148,7 @@ export interface IRichTextEditor extends Component<HTMLElement> {
|
|
|
148
148
|
enableXhtml?: boolean;
|
|
149
149
|
enableHtmlSanitizer?: boolean;
|
|
150
150
|
getInsertImgMaxWidth?(): string | number;
|
|
151
|
+
getInsertVidMaxWidth?(): string | number;
|
|
151
152
|
getSelection(): string;
|
|
152
153
|
currentTarget: HTMLElement;
|
|
153
154
|
}
|
|
@@ -256,6 +257,7 @@ export interface IColorPickerModel extends ColorPickerModel {
|
|
|
256
257
|
subCommand?: string;
|
|
257
258
|
target?: string;
|
|
258
259
|
iconCss?: string;
|
|
260
|
+
cssClass?: string;
|
|
259
261
|
}
|
|
260
262
|
/**
|
|
261
263
|
* @hidden
|
|
@@ -70,26 +70,7 @@ import { DialogRenderer } from '../renderer/dialog-renderer';
|
|
|
70
70
|
var RichTextEditor = /** @class */ (function (_super) {
|
|
71
71
|
__extends(RichTextEditor, _super);
|
|
72
72
|
function RichTextEditor(options, element) {
|
|
73
|
-
|
|
74
|
-
_this.defaultResetValue = null;
|
|
75
|
-
_this.isResizeInitialized = false;
|
|
76
|
-
/**
|
|
77
|
-
* @hidden
|
|
78
|
-
|
|
79
|
-
*/
|
|
80
|
-
_this.isFocusOut = false;
|
|
81
|
-
/**
|
|
82
|
-
* @hidden
|
|
83
|
-
|
|
84
|
-
*/
|
|
85
|
-
_this.isRTE = false;
|
|
86
|
-
/**
|
|
87
|
-
* @hidden
|
|
88
|
-
|
|
89
|
-
*/
|
|
90
|
-
_this.isBlur = true;
|
|
91
|
-
_this.needsID = true;
|
|
92
|
-
return _this;
|
|
73
|
+
return _super.call(this, options, element) || this;
|
|
93
74
|
}
|
|
94
75
|
/**
|
|
95
76
|
* To provide the array of modules needed for component rendering
|
|
@@ -170,6 +151,14 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
170
151
|
// eslint-disable-next-line
|
|
171
152
|
(this.enabled) ? this.eventInitializer() : this.unWireEvents();
|
|
172
153
|
};
|
|
154
|
+
RichTextEditor.prototype.initializeValue = function () {
|
|
155
|
+
this.isFocusOut = false;
|
|
156
|
+
this.isRTE = false;
|
|
157
|
+
this.isBlur = true;
|
|
158
|
+
this.needsID = true;
|
|
159
|
+
this.defaultResetValue = null;
|
|
160
|
+
this.isResizeInitialized = false;
|
|
161
|
+
};
|
|
173
162
|
/**
|
|
174
163
|
* For internal use only - Initialize the event handler;
|
|
175
164
|
*
|
|
@@ -178,6 +167,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
178
167
|
* @private
|
|
179
168
|
*/
|
|
180
169
|
RichTextEditor.prototype.preRender = function () {
|
|
170
|
+
this.initializeValue();
|
|
181
171
|
this.onBlurHandler = this.blurHandler.bind(this);
|
|
182
172
|
this.onFocusHandler = this.focusHandler.bind(this);
|
|
183
173
|
this.onResizeHandler = this.resizeHandler.bind(this);
|
|
@@ -234,11 +224,18 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
234
224
|
}
|
|
235
225
|
else {
|
|
236
226
|
this.valueContainer = this.createElement('textarea', {
|
|
237
|
-
id: this.getID() + '-value'
|
|
227
|
+
id: this.getID() + '-value',
|
|
228
|
+
attrs: { 'aria-labelledby': this.getID() }
|
|
238
229
|
});
|
|
239
230
|
}
|
|
240
231
|
this.valueContainer.name = this.getID();
|
|
241
232
|
addClass([this.valueContainer], classes.CLS_RTE_HIDDEN);
|
|
233
|
+
if (!isNOU(this.cssClass)) {
|
|
234
|
+
var currentClassList = this.cssClass.split(' ');
|
|
235
|
+
for (var i = 0; i < currentClassList.length; i++) {
|
|
236
|
+
addClass([this.valueContainer], currentClassList[i]);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
242
239
|
this.element.appendChild(this.valueContainer);
|
|
243
240
|
};
|
|
244
241
|
/**
|
|
@@ -505,13 +502,17 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
505
502
|
var closestLI = closest(endNode, 'LI');
|
|
506
503
|
if (!isNOU(closestLI) && endNode.textContent.length === range.endOffset &&
|
|
507
504
|
!range.collapsed && isNOU(endNode.nextElementSibling)) {
|
|
508
|
-
|
|
509
|
-
|
|
505
|
+
for (var i = 0; i < closestLI.childNodes.length; i++) {
|
|
506
|
+
if (closestLI.childNodes[i].nodeName === "#text" && closestLI.childNodes[i].textContent.trim().length === 0) {
|
|
507
|
+
detach(closestLI.childNodes[i]);
|
|
508
|
+
i--;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
510
511
|
var currentLastElem = closestLI;
|
|
511
|
-
while (currentLastElem.nodeName !== '#text') {
|
|
512
|
+
while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
|
|
512
513
|
currentLastElem = currentLastElem.lastChild;
|
|
513
514
|
}
|
|
514
|
-
this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? currentLastElem : currentStartContainer, currentLastElem, currentStartOffset, currentLastElem.textContent.length);
|
|
515
|
+
this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? (currentLastElem.nodeName === 'BR' && !isNOU(currentLastElem.previousSibling) ? currentLastElem.previousSibling : currentLastElem) : currentStartContainer, currentLastElem, currentStartOffset, (currentLastElem.nodeName === 'BR' ? 0 : currentLastElem.textContent.length));
|
|
515
516
|
}
|
|
516
517
|
};
|
|
517
518
|
/**
|
|
@@ -877,6 +878,12 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
877
878
|
for (var i = 0; i < this.originalElement.classList.length; i++) {
|
|
878
879
|
addClass([this.element], this.originalElement.classList[i]);
|
|
879
880
|
}
|
|
881
|
+
if (!isNOU(this.cssClass)) {
|
|
882
|
+
var currentClassList = this.cssClass.split(' ');
|
|
883
|
+
for (var i = 0; i < currentClassList.length; i++) {
|
|
884
|
+
addClass([this.element], currentClassList[i]);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
880
887
|
removeClass([this.element], classes.CLS_RTE_HIDDEN);
|
|
881
888
|
}
|
|
882
889
|
else {
|
|
@@ -1252,7 +1259,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1252
1259
|
if (this.inputElement && this.placeholder && this.iframeSettings.enable !== true) {
|
|
1253
1260
|
if (this.editorMode !== 'Markdown') {
|
|
1254
1261
|
if (!this.placeHolderWrapper) {
|
|
1255
|
-
this.placeHolderWrapper = this.createElement('span', { className: 'rte-placeholder e-rte-placeholder' });
|
|
1262
|
+
this.placeHolderWrapper = this.createElement('span', { className: 'rte-placeholder e-rte-placeholder' + ' ' + this.cssClass });
|
|
1256
1263
|
if (this.inputElement) {
|
|
1257
1264
|
this.inputElement.parentElement.insertBefore(this.placeHolderWrapper, this.inputElement);
|
|
1258
1265
|
}
|
|
@@ -1502,7 +1509,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
1502
1509
|
this.setProperties({ value: this.valueTemplate });
|
|
1503
1510
|
}
|
|
1504
1511
|
else {
|
|
1505
|
-
var compiledTemplate = compile(this.valueTemplate)(
|
|
1512
|
+
var compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
|
|
1506
1513
|
for (var i = 0; i < compiledTemplate.length; i++) {
|
|
1507
1514
|
var item = compiledTemplate[i];
|
|
1508
1515
|
append([item], this.element);
|
|
@@ -177,7 +177,7 @@ export function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
177
177
|
result = getDropDownValue(formatItems, value, 'subCommand', 'text');
|
|
178
178
|
dropDown.formatDropDown.content = ('<span style="display: inline-flex;' +
|
|
179
179
|
'width:' + e.parent.format.width + '" >' +
|
|
180
|
-
'<span class="e-rte-dropdown-btn-text">'
|
|
180
|
+
'<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
|
|
181
181
|
+ (isNOU(result) ? formatContent : result) +
|
|
182
182
|
'</span></span>');
|
|
183
183
|
dropDown.formatDropDown.dataBind();
|
|
@@ -207,7 +207,7 @@ export function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
207
207
|
e.tbElements[j].title = name_1;
|
|
208
208
|
dropDown.fontNameDropDown.content = ('<span style="display: inline-flex;' +
|
|
209
209
|
'width:' + e.parent.fontFamily.width + '" >' +
|
|
210
|
-
'<span class="e-rte-dropdown-btn-text">'
|
|
210
|
+
'<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
|
|
211
211
|
+ name_1 + '</span></span>');
|
|
212
212
|
dropDown.fontNameDropDown.dataBind();
|
|
213
213
|
break;
|
|
@@ -223,7 +223,7 @@ export function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
223
223
|
result = getDropDownValue(fontSizeItems, (value === '' ? fontSizeContent.replace(/\s/g, '') : value), 'value', 'text');
|
|
224
224
|
dropDown.fontSizeDropDown.content = ('<span style="display: inline-flex;' +
|
|
225
225
|
'width:' + e.parent.fontSize.width + '" >' +
|
|
226
|
-
'<span class="e-rte-dropdown-btn-text">'
|
|
226
|
+
'<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
|
|
227
227
|
+ getFormattedFontSize(result) + '</span></span>');
|
|
228
228
|
dropDown.fontSizeDropDown.dataBind();
|
|
229
229
|
break;
|
|
@@ -414,9 +414,13 @@ export function updateTextNode(value, rteObj) {
|
|
|
414
414
|
var previousParent = void 0;
|
|
415
415
|
var insertElem = void 0;
|
|
416
416
|
while (tempNode.firstChild) {
|
|
417
|
-
var
|
|
418
|
-
for (var i = 0; i <
|
|
419
|
-
|
|
417
|
+
var emptyBlockElem = tempNode.querySelectorAll(CONSTANT.blockEmptyNodes);
|
|
418
|
+
for (var i = 0; i < emptyBlockElem.length; i++) {
|
|
419
|
+
emptyBlockElem[i].innerHTML = '<br>';
|
|
420
|
+
}
|
|
421
|
+
var emptyInlineElem = tempNode.querySelectorAll(CONSTANT.inlineEmptyNodes);
|
|
422
|
+
for (var i = 0; i < emptyInlineElem.length; i++) {
|
|
423
|
+
emptyInlineElem[i].innerHTML = '​';
|
|
420
424
|
}
|
|
421
425
|
if (rteObj.enterKey !== 'BR' && ((tempNode.firstChild.nodeName === '#text' &&
|
|
422
426
|
(tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
|
|
@@ -170,7 +170,7 @@ var Formatter = /** @class */ (function () {
|
|
|
170
170
|
}
|
|
171
171
|
self.trigger(CONSTANT.actionComplete, events, function (callbackArgs) {
|
|
172
172
|
self.setPlaceHolder();
|
|
173
|
-
if (callbackArgs.requestType === 'Images' || callbackArgs.requestType === 'Links' && self.editorMode === 'HTML') {
|
|
173
|
+
if ((callbackArgs.requestType === 'Images' || callbackArgs.requestType === 'Links') && self.editorMode === 'HTML') {
|
|
174
174
|
var args = callbackArgs;
|
|
175
175
|
if (callbackArgs.requestType === 'Links' && callbackArgs.event &&
|
|
176
176
|
callbackArgs.event.type === 'keydown' &&
|
|
@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
import { ContentRender } from '../renderer/content-renderer';
|
|
15
15
|
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
16
16
|
import { getEditValue } from '../base/util';
|
|
17
|
-
var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline {display: inline-block;float: none;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n </style>\n </head>";
|
|
17
|
+
var IFRAMEHEADER = "\n<!DOCTYPE html> \n <html>\n <head>\n <meta charset='utf-8' /> \n <style>\n @charset \"UTF-8\";\n body {\n font-family: \"Roboto\", sans-serif;\n font-size: 14px;\n }\n html, body{height: 100%;margin: 0;}\n body.e-cursor{cursor:default}\n span.e-selected-node\t{background-color: #939393;color: white;}\n span.e-selected-node.e-highlight {background-color: #1d9dd8;}\n body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}\n .e-rte-image {border: 0;cursor: pointer;display:\n block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imginline {display: inline-block;float: none;max-width: calc(100% - (2 * 5px));padding: 1px;vertical-align: bottom;}\n .e-rte-image.e-imgcenter {cursor: pointer;display: block;float: none;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-imgright { float: right; margin: 0 auto;margin-left: 5px;text-align: right;}\n .e-rte-image.e-imgleft {float: left;margin: 0 auto;margin-right: 5px;text-align: left;}\n .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}\n .e-img-caption.e-caption-inline {display: inline-block;float: none;\n margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));\n position: relativetext-align: center;vertical-align: bottom;}\n .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;\n margin: auto;opacity: .9;text-align: center;width: 100%;}\n .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}\n .e-imgleft {float: left;margin: 0 5px 0 0;text-align: left;}\n .e-imgright {float: right;margin: 0 0 0 5px;text-align: right;}\n .e-imgcenter {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}\n .e-imginline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;\n max-width: calc(100% - (2 * 5px));vertical-align: bottom;}\n .e-imgbreak {border: 0;cursor: pointer;\n display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}\n .e-rte-image.e-img-focus:not(.e-resize) {border: solid 2px #4a90e2;}\n img.e-img-focus::selection { background: transparent;color: transparent;}\n span.e-rte-imageboxmark { width: 10px; height: 10px; position: absolute; display: block;\n background: #4a90e2; border: 1px solid #fff; z-index: 1000;}\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-mob-rte span.e-rte-imageboxmark { background: #fff; border: 1px solid #4a90e2;\n border-radius: 15px; height: 20px; width: 20px; }\n .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }\n .e-rte-content .e-content img.e-resize { z-index: 1000; }\n .e-img-caption .e-img-inner { outline: 0; }\n .e-img-caption a:focus-visible { outline: none; }\n .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}\n body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;\n overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}\n p{margin: 0 0 10px;margin-bottom: 10px;}\n li{margin-bottom: 10px;}\n h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}\n h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}\n h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}\n h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}\n h5{font-size: 00.8em;font-weight: 400;margin: 0;}\n h6{font-size: 00.65em;font-weight: 400;margin: 0;}\n blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}\n pre{background-color: inherit;border: 0;border-radius: 0;color: #333;\n font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;\n white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}\n strong, b{font-weight: 700;}\n a{text-decoration: none;user-select: auto;}\n a:hover{text-decoration: underline;};\n p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}\n h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}\n ul:last-child{margin-bottom: 0;}\n table { border-collapse: collapse; empty-cells: show;}\n table td,table th {border: 1px solid #BDBDBD; height: 20px; padding: 2px 5px; vertical-align: middle;}\n table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}\n table th {background-color: #E0E0E0;}\n table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD} \n table .e-cell-select {border: 1px double #4a90e2;}\n span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }\n span.e-table-box.e-rmob {height: 14px;width: 14px;}\n .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;\n bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }\n .e-row-resize { cursor: row-resize; height: 1px;}\n .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}\n .e-table-rhelper.e-column-helper { width: 1px; }\n .e-table-rhelper.e-row-helper {height: 1px;}\n .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block; height: 0;\n position: absolute; right: 4px; top: 4px; width: 20px; }\n .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;\n border-top: 6px solid transparent; content: ''; display: block;\n height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }\n .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }\n .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }\n span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }\n span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }\n .e-table-rhelper { background-color: #4a90e2;}\n .e-rtl { direction: rtl; }\n </style>\n </head>";
|
|
18
18
|
/**
|
|
19
19
|
* Content module is used to render Rich Text Editor content
|
|
20
20
|
*
|