@syncfusion/ej2-richtexteditor 22.2.12 → 23.1.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 +67 -1
- package/dist/ej2-richtexteditor.min.js +3 -3
- package/dist/ej2-richtexteditor.umd.min.js +3 -3
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +457 -285
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +457 -281
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +3 -3
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +13 -13
- package/src/editor-manager/plugin/dom-node.js +6 -5
- package/src/editor-manager/plugin/inserthtml.js +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +2 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +79 -12
- package/src/editor-manager/plugin/selection-exec.js +1 -1
- package/src/editor-manager/plugin/table.js +1 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +2 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +10 -6
- package/src/rich-text-editor/actions/emoji-picker.js +29 -14
- package/src/rich-text-editor/actions/enter-key.js +9 -2
- package/src/rich-text-editor/actions/format-painter.js +12 -6
- package/src/rich-text-editor/actions/full-screen.js +3 -0
- package/src/rich-text-editor/actions/html-editor.js +14 -1
- package/src/rich-text-editor/actions/markdown-editor.js +3 -0
- package/src/rich-text-editor/actions/paste-clean-up.d.ts +2 -0
- package/src/rich-text-editor/actions/paste-clean-up.js +63 -32
- package/src/rich-text-editor/actions/quick-toolbar.js +35 -2
- package/src/rich-text-editor/actions/toolbar.js +4 -1
- package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
- 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 +5 -0
- package/src/rich-text-editor/base/constant.js +5 -0
- package/src/rich-text-editor/base/enum.d.ts +4 -0
- package/src/rich-text-editor/base/interface.d.ts +10 -22
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +1 -39
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -39
- package/src/rich-text-editor/base/rich-text-editor.js +14 -10
- package/src/rich-text-editor/base/util.js +5 -1
- package/src/rich-text-editor/models/items.js +34 -22
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +4 -5
- package/src/rich-text-editor/models/toolbar-settings.d.ts +4 -5
- package/src/rich-text-editor/models/toolbar-settings.js +1 -1
- package/src/rich-text-editor/renderer/audio-module.js +5 -33
- package/src/rich-text-editor/renderer/dialog-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +19 -65
- package/src/rich-text-editor/renderer/link-module.js +6 -0
- package/src/rich-text-editor/renderer/render.js +4 -0
- package/src/rich-text-editor/renderer/table-module.js +50 -24
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +5 -1
- package/src/rich-text-editor/renderer/toolbar-renderer.js +28 -2
- package/src/rich-text-editor/renderer/video-module.js +5 -33
- package/src/rich-text-editor/renderer/view-source.js +4 -0
- package/styles/bootstrap-dark.css +4 -4
- package/styles/bootstrap.css +4 -4
- package/styles/bootstrap4.css +4 -4
- package/styles/bootstrap5-dark.css +4 -4
- package/styles/bootstrap5.css +4 -4
- package/styles/fabric-dark.css +4 -4
- package/styles/fabric.css +4 -4
- package/styles/fluent-dark.css +4 -4
- package/styles/fluent.css +4 -4
- package/styles/highcontrast-light.css +4 -4
- package/styles/highcontrast.css +4 -4
- package/styles/material-dark.css +4 -5
- package/styles/material.css +4 -5
- package/styles/material3-dark.css +4 -5
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +4 -5
- package/styles/material3.scss +1 -1
- package/styles/rich-text-editor/_layout.scss +2 -2
- package/styles/rich-text-editor/bootstrap-dark.css +4 -4
- package/styles/rich-text-editor/bootstrap-dark.scss +1 -1
- package/styles/rich-text-editor/bootstrap.css +4 -4
- package/styles/rich-text-editor/bootstrap.scss +1 -1
- package/styles/rich-text-editor/bootstrap4.css +4 -4
- package/styles/rich-text-editor/bootstrap4.scss +1 -1
- package/styles/rich-text-editor/bootstrap5-dark.css +4 -4
- package/styles/rich-text-editor/bootstrap5-dark.scss +1 -1
- package/styles/rich-text-editor/bootstrap5.css +4 -4
- package/styles/rich-text-editor/bootstrap5.scss +1 -1
- package/styles/rich-text-editor/fabric-dark.css +4 -4
- package/styles/rich-text-editor/fabric-dark.scss +1 -1
- package/styles/rich-text-editor/fabric.css +4 -4
- package/styles/rich-text-editor/fabric.scss +1 -1
- package/styles/rich-text-editor/fluent-dark.css +4 -4
- package/styles/rich-text-editor/fluent-dark.scss +1 -1
- package/styles/rich-text-editor/fluent.css +4 -4
- package/styles/rich-text-editor/fluent.scss +1 -1
- package/styles/rich-text-editor/highcontrast-light.css +4 -4
- package/styles/rich-text-editor/highcontrast-light.scss +1 -1
- package/styles/rich-text-editor/highcontrast.css +4 -4
- package/styles/rich-text-editor/highcontrast.scss +1 -1
- package/styles/rich-text-editor/material-dark.css +4 -5
- package/styles/rich-text-editor/material-dark.scss +1 -1
- package/styles/rich-text-editor/material.css +4 -5
- package/styles/rich-text-editor/material.scss +1 -1
- package/styles/rich-text-editor/material3-dark.css +4 -5
- package/styles/rich-text-editor/material3-dark.scss +1 -1
- package/styles/rich-text-editor/material3.css +4 -5
- package/styles/rich-text-editor/material3.scss +1 -1
- package/styles/rich-text-editor/tailwind-dark.css +4 -5
- package/styles/rich-text-editor/tailwind-dark.scss +1 -1
- package/styles/rich-text-editor/tailwind.css +4 -5
- package/styles/rich-text-editor/tailwind.scss +1 -1
- package/styles/tailwind-dark.css +4 -5
- package/styles/tailwind.css +4 -5
|
@@ -30,6 +30,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
30
30
|
'header', 'article', 'nav', 'footer', 'section', 'aside', 'main', 'figure', 'figcaption'];
|
|
31
31
|
this.isNotFromHtml = false;
|
|
32
32
|
this.containsHtml = false;
|
|
33
|
+
this.cropImageData = [];
|
|
33
34
|
this.parent = parent;
|
|
34
35
|
this.locator = serviceLocator;
|
|
35
36
|
this.renderFactory = this.locator.getService('rendererFactory');
|
|
@@ -110,8 +111,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
110
111
|
args: e.args,
|
|
111
112
|
text: e.text,
|
|
112
113
|
allowedStylePropertiesArray: this.parent.pasteCleanupSettings.allowedStyleProps,
|
|
113
|
-
callBack: function (a) {
|
|
114
|
+
callBack: function (a, cropImageData) {
|
|
114
115
|
value = a.trim();
|
|
116
|
+
_this.cropImageData = cropImageData;
|
|
115
117
|
}
|
|
116
118
|
});
|
|
117
119
|
}
|
|
@@ -160,7 +162,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
160
162
|
currentFocusNode = currentFocusNode.childNodes[_this.nodeSelectionObj.getRange(_this.contentRenderer.getDocument()).startOffset];
|
|
161
163
|
}
|
|
162
164
|
if (currentFocusNode.previousSibling.nodeName === 'IMG') {
|
|
163
|
-
currentFocusNode.previousSibling.
|
|
165
|
+
if (!isNOU(currentFocusNode.previousSibling.getAttribute('src'))) {
|
|
166
|
+
currentFocusNode.previousSibling.classList.add('pasteContent_Img');
|
|
167
|
+
}
|
|
164
168
|
currentFocusNode.previousSibling.classList.add(CLS_RTE_IMAGE);
|
|
165
169
|
if (_this.parent.insertImageSettings.display === 'inline') {
|
|
166
170
|
currentFocusNode.previousSibling.classList.add(CLS_IMGINLINE);
|
|
@@ -192,6 +196,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
192
196
|
PasteCleanup.prototype.makeSpace = function (enterSplitText) {
|
|
193
197
|
var contentWithSpace = '';
|
|
194
198
|
var spaceBetweenContent = true;
|
|
199
|
+
enterSplitText = enterSplitText.replace(/\t/g, ' ');
|
|
195
200
|
var spaceSplit = enterSplitText.split(' ');
|
|
196
201
|
for (var j = 0; j < spaceSplit.length; j++) {
|
|
197
202
|
if (spaceSplit[j].trim() === '') {
|
|
@@ -211,7 +216,8 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
211
216
|
var imgName = [];
|
|
212
217
|
var uploadImg = [];
|
|
213
218
|
for (var i = 0; i < allImgElm.length; i++) {
|
|
214
|
-
if (allImgElm[i].getAttribute('src')
|
|
219
|
+
if (!isNOU(allImgElm[i].getAttribute('src')) &&
|
|
220
|
+
allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
|
|
215
221
|
base64Src.push(allImgElm[i].getAttribute('src'));
|
|
216
222
|
imgName.push(getUniqueID('rte_image'));
|
|
217
223
|
uploadImg.push(allImgElm[i]);
|
|
@@ -293,7 +299,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
293
299
|
_this.refreshPopup(imgElem, _this.popupObj);
|
|
294
300
|
}, timeOut);
|
|
295
301
|
var rawFile;
|
|
296
|
-
var beforeUploadArgs;
|
|
297
302
|
this.uploadObj = new Uploader({
|
|
298
303
|
asyncSettings: {
|
|
299
304
|
saveUrl: this.parent.insertImageSettings.saveUrl,
|
|
@@ -325,28 +330,8 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
325
330
|
}
|
|
326
331
|
},
|
|
327
332
|
beforeUpload: function (args) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
beforeUploadArgs.filesData = rawFile;
|
|
331
|
-
args.cancel = true;
|
|
332
|
-
_this.parent.trigger(events.imageUploading, beforeUploadArgs, function (beforeUploadArgs) {
|
|
333
|
-
if (beforeUploadArgs.cancel) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
_this.toolbarEnableDisable(true);
|
|
337
|
-
/* eslint-disable */
|
|
338
|
-
_this.uploadObj.currentRequestHeader = beforeUploadArgs.currentRequest ?
|
|
339
|
-
beforeUploadArgs.currentRequest : _this.uploadObj.currentRequestHeader;
|
|
340
|
-
_this.uploadObj.customFormDatas = beforeUploadArgs.customFormData && beforeUploadArgs.customFormData.length > 0 ?
|
|
341
|
-
beforeUploadArgs.customFormData : _this.uploadObj.customFormDatas;
|
|
342
|
-
_this.uploadObj.uploadFiles(rawFile, null);
|
|
343
|
-
/* eslint-enable */
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
_this.parent.trigger(events.beforeImageUpload, args);
|
|
348
|
-
_this.toolbarEnableDisable(true);
|
|
349
|
-
}
|
|
333
|
+
_this.parent.trigger(events.beforeImageUpload, args);
|
|
334
|
+
_this.toolbarEnableDisable(true);
|
|
350
335
|
},
|
|
351
336
|
// eslint-disable-next-line
|
|
352
337
|
failure: function (e) {
|
|
@@ -364,9 +349,6 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
364
349
|
},
|
|
365
350
|
selected: function (e) {
|
|
366
351
|
e.cancel = true;
|
|
367
|
-
if (_this.parent.isServerRendered) {
|
|
368
|
-
rawFile = e.filesData;
|
|
369
|
-
}
|
|
370
352
|
},
|
|
371
353
|
removing: function () {
|
|
372
354
|
_this.parent.inputElement.contentEditable = 'true';
|
|
@@ -388,8 +370,8 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
388
370
|
statusCode: '1'
|
|
389
371
|
}];
|
|
390
372
|
this.uploadObj.createFileList(fileData);
|
|
391
|
-
/* eslint-enable */
|
|
392
373
|
rawFile = fileData;
|
|
374
|
+
/* eslint-enable */
|
|
393
375
|
this.uploadObj.upload(fileData);
|
|
394
376
|
this.popupObj.element.getElementsByClassName('e-file-select-wrap')[0].style.display = 'none';
|
|
395
377
|
detach(this.popupObj.element.querySelector('.e-rte-dialog-upload .e-file-select-wrap'));
|
|
@@ -464,7 +446,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
464
446
|
|
|
465
447
|
*/
|
|
466
448
|
PasteCleanup.prototype.imageFormatting = function (pasteArgs, imgElement) {
|
|
467
|
-
imgElement.elements[0].
|
|
449
|
+
if (!isNOU(imgElement.elements[0].getAttribute('src'))) {
|
|
450
|
+
imgElement.elements[0].classList.add('pasteContent_Img');
|
|
451
|
+
}
|
|
468
452
|
var imageElement = this.parent.createElement('span');
|
|
469
453
|
imageElement.appendChild(imgElement.elements[0]);
|
|
470
454
|
var imageValue = imageElement.innerHTML;
|
|
@@ -657,7 +641,9 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
657
641
|
clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
|
|
658
642
|
var allImg = clipBoardElem.querySelectorAll('img');
|
|
659
643
|
for (var i = 0; i < allImg.length; i++) {
|
|
660
|
-
allImg[i].
|
|
644
|
+
if (!isNOU(allImg[i].getAttribute('src'))) {
|
|
645
|
+
allImg[i].classList.add('pasteContent_Img');
|
|
646
|
+
}
|
|
661
647
|
this.setImageProperties(allImg[i]);
|
|
662
648
|
}
|
|
663
649
|
this.addTempClass(clipBoardElem);
|
|
@@ -700,6 +686,51 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
700
686
|
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
701
687
|
this.removeTempClass();
|
|
702
688
|
this.parent.notify(events.toolbarRefresh, {});
|
|
689
|
+
this.cropImageHandler(this.parent.inputElement);
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
PasteCleanup.prototype.cropImageHandler = function (element) {
|
|
693
|
+
var _this = this;
|
|
694
|
+
var allImgElm = element.querySelectorAll('.e-img-cropped');
|
|
695
|
+
if (allImgElm.length > 0) {
|
|
696
|
+
var _loop_1 = function (i) {
|
|
697
|
+
if (allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
|
|
698
|
+
var image_1 = new Image();
|
|
699
|
+
image_1.src = allImgElm[i].getAttribute('src');
|
|
700
|
+
var canvas_1 = document.createElement('canvas');
|
|
701
|
+
var ctx_1 = canvas_1.getContext('2d');
|
|
702
|
+
image_1.onload = function () {
|
|
703
|
+
var wGoalWidth = _this.cropImageData[i].goalWidth / image_1.naturalWidth;
|
|
704
|
+
var hGoalHeight = _this.cropImageData[i].goalHeight / image_1.naturalHeight;
|
|
705
|
+
var cropLength = _this.cropImageData[i].cropLength / wGoalWidth;
|
|
706
|
+
var cropTop = _this.cropImageData[i].cropTop / hGoalHeight;
|
|
707
|
+
var cropWidth = (_this.cropImageData[i].goalWidth -
|
|
708
|
+
_this.cropImageData[i].cropLength -
|
|
709
|
+
_this.cropImageData[i].cropR) / wGoalWidth;
|
|
710
|
+
var cropHeight = (_this.cropImageData[i].goalHeight -
|
|
711
|
+
_this.cropImageData[i].cropTop -
|
|
712
|
+
_this.cropImageData[i].cropB) / hGoalHeight;
|
|
713
|
+
canvas_1.width = cropWidth;
|
|
714
|
+
canvas_1.height = cropHeight;
|
|
715
|
+
// Draw the cropped portion of the image onto the canvas
|
|
716
|
+
ctx_1.drawImage(image_1, cropLength, cropTop, cropWidth, cropHeight, 0, 0, cropWidth, cropHeight);
|
|
717
|
+
// Convert the cropped canvas to a base64 encoded image
|
|
718
|
+
var croppedBase64 = canvas_1.toDataURL('image/png');
|
|
719
|
+
// Call the provided callback with the cropped base64 data
|
|
720
|
+
allImgElm[i].setAttribute('src', croppedBase64);
|
|
721
|
+
allImgElm[i].classList.remove('e-img-cropped');
|
|
722
|
+
_this.imgUploading(_this.parent.inputElement);
|
|
723
|
+
if (_this.parent.iframeSettings.enable) {
|
|
724
|
+
_this.parent.updateValue();
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
for (var i = 0; i < allImgElm.length; i++) {
|
|
730
|
+
_loop_1(i);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
703
734
|
this.imgUploading(this.parent.inputElement);
|
|
704
735
|
if (this.parent.iframeSettings.enable) {
|
|
705
736
|
this.parent.updateValue();
|
|
@@ -92,8 +92,10 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
92
92
|
}
|
|
93
93
|
this.linkQTBar = this.createQTBar('Link', 'Scrollable', this.parent.quickToolbarSettings.link, RenderType.LinkToolbar);
|
|
94
94
|
this.renderFactory.addRenderer(RenderType.LinkToolbar, this.linkQTBar);
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
if (!isNOU(this.parent.quickToolbarSettings.text) && !this.parent.inlineMode.enable) {
|
|
96
|
+
this.textQTBar = this.createQTBar('Text', 'MultiRow', this.parent.quickToolbarSettings.text, RenderType.TextToolbar);
|
|
97
|
+
this.renderFactory.addRenderer(RenderType.TextToolbar, this.textQTBar);
|
|
98
|
+
}
|
|
97
99
|
this.imageQTBar = this.createQTBar('Image', 'MultiRow', this.parent.quickToolbarSettings.image, RenderType.ImageToolbar);
|
|
98
100
|
this.renderFactory.addRenderer(RenderType.ImageToolbar, this.imageQTBar);
|
|
99
101
|
this.audioQTBar = this.createQTBar('Audio', 'MultiRow', this.parent.quickToolbarSettings.audio, RenderType.AudioToolbar);
|
|
@@ -235,6 +237,24 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
235
237
|
}
|
|
236
238
|
}
|
|
237
239
|
}
|
|
240
|
+
if (!isNOU(this.textQTBar) && !isNOU(this.parent.quickToolbarSettings.text) && !this.parent.inlineMode.enable) {
|
|
241
|
+
var args = e.args.touches ?
|
|
242
|
+
e.args.changedTouches[0] : e.args;
|
|
243
|
+
var target = e.args.target;
|
|
244
|
+
this.hideQuickToolbars();
|
|
245
|
+
var parentLeft = this.parent.element.getBoundingClientRect().left;
|
|
246
|
+
this.offsetX = this.parent.iframeSettings.enable ? this.parent.element.ownerDocument.documentElement.scrollLeft
|
|
247
|
+
+ parentLeft + args.clientX : args.pageX;
|
|
248
|
+
this.offsetY = pageYOffset(args, this.parent.element, this.parent.iframeSettings.enable);
|
|
249
|
+
var range = this.parent.getRange();
|
|
250
|
+
if ((range.endContainer.parentElement.tagName === range.startContainer.parentElement.tagName && (range.startContainer.parentElement.tagName === 'A' && range.endContainer.parentElement.tagName === 'A')) ||
|
|
251
|
+
(target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
|
|
252
|
+
(this.parent.getRange().startOffset === this.parent.getRange().endOffset)) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
this.target = target;
|
|
256
|
+
this.textQTBar.showPopup(this.offsetX, this.offsetY, target, 'text');
|
|
257
|
+
}
|
|
238
258
|
};
|
|
239
259
|
QuickToolbar.prototype.keyDownHandler = function () {
|
|
240
260
|
if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
|
|
@@ -247,6 +267,11 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
247
267
|
&& !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
|
|
248
268
|
this.hideInlineQTBar();
|
|
249
269
|
}
|
|
270
|
+
if (!isNOU(this.parent.quickToolbarSettings.text)) {
|
|
271
|
+
if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close') && document.body.contains(this.textQTBar.element)) {
|
|
272
|
+
this.textQTBar.hidePopup();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
250
275
|
};
|
|
251
276
|
QuickToolbar.prototype.keyUpHandler = function (e) {
|
|
252
277
|
if (this.parent.inlineMode.enable && !Browser.isDevice) {
|
|
@@ -299,6 +324,9 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
299
324
|
|
|
300
325
|
*/
|
|
301
326
|
QuickToolbar.prototype.destroy = function () {
|
|
327
|
+
if (isNOU(this.parent)) {
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
302
330
|
if (this.linkQTBar) {
|
|
303
331
|
EventHandler.remove(this.linkQTBar.element, 'mousedown', this.onMouseDown);
|
|
304
332
|
EventHandler.remove(this.linkQTBar.element, 'keyup', this.keyUpQT);
|
|
@@ -405,6 +433,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
405
433
|
this.parent.on(events.keyDown, this.onKeyDown, this);
|
|
406
434
|
this.parent.on(events.rtlMode, this.setRtl, this);
|
|
407
435
|
this.parent.on(events.bindCssClass, this.setCssClass, this);
|
|
436
|
+
this.parent.on(events.hidePopup, this.hideQuickToolbars, this);
|
|
408
437
|
};
|
|
409
438
|
QuickToolbar.prototype.onKeyDown = function (e) {
|
|
410
439
|
var args = e.args;
|
|
@@ -458,6 +487,9 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
458
487
|
if (this.linkQTBar) {
|
|
459
488
|
this.linkQTBar.quickTBarObj.toolbarObj.setProperties({ enableRtl: args.enableRtl });
|
|
460
489
|
}
|
|
490
|
+
if (this.textQTBar) {
|
|
491
|
+
this.textQTBar.quickTBarObj.toolbarObj.setProperties({ enableRtl: args.enableRtl });
|
|
492
|
+
}
|
|
461
493
|
};
|
|
462
494
|
/**
|
|
463
495
|
* removeEventListener
|
|
@@ -486,6 +518,7 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
486
518
|
this.parent.off(events.keyDown, this.onKeyDown);
|
|
487
519
|
this.parent.off(events.rtlMode, this.setRtl);
|
|
488
520
|
this.parent.off(events.bindCssClass, this.setCssClass);
|
|
521
|
+
this.parent.off(events.hidePopup, this.hideQuickToolbars);
|
|
489
522
|
};
|
|
490
523
|
/**
|
|
491
524
|
* Called internally if any of the property value changed.
|
|
@@ -23,7 +23,7 @@ var Toolbar = /** @class */ (function () {
|
|
|
23
23
|
this.renderFactory = this.locator.getService('rendererFactory');
|
|
24
24
|
model.updateDropDownLocale(this.parent);
|
|
25
25
|
updateDropDownFontFormatLocale(this.parent);
|
|
26
|
-
this.renderFactory.addRenderer(RenderType.Toolbar, new ToolbarRenderer(this.parent));
|
|
26
|
+
this.renderFactory.addRenderer(RenderType.Toolbar, new ToolbarRenderer(this.parent, this.locator));
|
|
27
27
|
this.toolbarRenderer = this.renderFactory.getRenderer(RenderType.Toolbar);
|
|
28
28
|
this.baseToolbar = new BaseToolbar(this.parent, this.locator);
|
|
29
29
|
this.addEventListener();
|
|
@@ -497,6 +497,9 @@ var Toolbar = /** @class */ (function () {
|
|
|
497
497
|
|
|
498
498
|
*/
|
|
499
499
|
Toolbar.prototype.destroy = function () {
|
|
500
|
+
if (isNOU(this.parent)) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
500
503
|
if (this.isToolbarDestroyed()) {
|
|
501
504
|
this.destroyToolbar();
|
|
502
505
|
if (this.keyBoardModule) {
|
|
@@ -41,7 +41,7 @@ var XhtmlValidation = /** @class */ (function () {
|
|
|
41
41
|
*/
|
|
42
42
|
XhtmlValidation.prototype.selfEncloseValidation = function (currentValue, valueLength) {
|
|
43
43
|
if (valueLength === 0 && currentValue.indexOf('table') < 0 && currentValue.indexOf('img') < 0 &&
|
|
44
|
-
currentValue
|
|
44
|
+
currentValue.includes(' ')) {
|
|
45
45
|
var arrayValue = currentValue.split(' ');
|
|
46
46
|
arrayValue[arrayValue.length - 1] = '​' + arrayValue[arrayValue.length - 1];
|
|
47
47
|
currentValue = arrayValue.join('');
|
|
@@ -734,6 +734,11 @@ export var maximizeMinimizeClick = 'maximizeMinimizeClick';
|
|
|
734
734
|
/**
|
|
735
735
|
* @hidden
|
|
736
736
|
|
|
737
|
+
*/
|
|
738
|
+
export var hidePopup = 'hidePopup';
|
|
739
|
+
/**
|
|
740
|
+
* @hidden
|
|
741
|
+
|
|
737
742
|
*/
|
|
738
743
|
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";
|
|
739
744
|
/**
|
|
@@ -60,3 +60,7 @@ export declare enum DialogType {
|
|
|
60
60
|
* Defines types to be used to configure the toolbar items.
|
|
61
61
|
*/
|
|
62
62
|
export declare type ToolbarItems = 'alignments' | 'justifyLeft' | 'justifyCenter' | 'justifyRight' | 'justifyFull' | 'fontName' | 'fontSize' | 'fontColor' | 'backgroundColor' | 'bold' | 'italic' | 'underline' | 'strikeThrough' | 'clearFormat' | 'clearAll' | 'cut' | 'copy' | 'paste' | 'unorderedList' | 'orderedList' | 'indent' | 'outdent' | 'undo' | 'redo' | 'superScript' | 'subScript' | 'createLink' | 'openLink' | 'editLink' | 'image' | 'createTable' | 'removeTable' | 'replace' | 'align' | 'caption' | 'remove' | 'openImageLink' | 'editImageLink' | 'removeImageLink' | 'insertLink' | 'display' | 'altText' | 'dimension' | 'fullScreen' | 'maximize' | 'minimize' | 'lowerCase' | 'upperCase' | 'print' | 'formats' | 'sourceCode' | 'preview' | 'viewSide' | 'insertCode' | 'tableHeader' | 'tableRemove' | 'tableRows' | 'tableColumns' | 'tableCellBackground' | 'tableCellHorizontalAlign' | 'tableCellVerticalAlign' | 'tableEditProperties' | 'styles' | 'removeLink' | 'merge';
|
|
63
|
+
/**
|
|
64
|
+
* Defines types to be used to configure the toolbarSettings items.
|
|
65
|
+
*/
|
|
66
|
+
export declare type ToolbarConfigItems = 'Alignments' | 'JustifyLeft' | 'JustifyCenter' | 'JustifyRight' | 'JustifyFull' | 'FontName' | 'FontSize' | 'FontColor' | 'BackgroundColor' | 'Bold' | 'Italic' | 'Underline' | 'StrikeThrough' | 'ClearFormat' | 'ClearAll' | 'Cut' | 'Copy' | 'Paste' | 'UnorderedList' | 'OrderedList' | 'Indent' | 'Outdent' | 'Undo' | 'Redo' | 'SuperScript' | 'SubScript' | 'CreateLink' | 'Image' | 'CreateTable' | 'InsertLink' | 'FullScreen' | 'LowerCase' | 'UpperCase' | 'Print' | 'Formats' | 'FormatPainter' | 'EmojiPicker' | 'UnderLine' | 'ZoomOut' | 'ZoomIn' | 'SourceCode' | 'Preview' | 'ViewSide' | 'InsertCode' | 'Audio' | 'Video' | 'NumberFormatList' | 'BulletFormatList' | 'FileManager' | '|' | '-';
|
|
@@ -249,7 +249,9 @@ export interface NotifyArgs {
|
|
|
249
249
|
range?: Range;
|
|
250
250
|
/** Defines the action. */
|
|
251
251
|
action?: string;
|
|
252
|
-
callBack?(args?: string | IImageCommandsArgs
|
|
252
|
+
callBack?(args?: string | IImageCommandsArgs, cropImageData?: {
|
|
253
|
+
[key: string]: string | boolean | number;
|
|
254
|
+
}[]): void;
|
|
253
255
|
file?: Blob;
|
|
254
256
|
insertElement?: Element;
|
|
255
257
|
touchData?: ITouchData;
|
|
@@ -792,6 +794,13 @@ export interface IShowQuickTBarOptions {
|
|
|
792
794
|
popHeight: number;
|
|
793
795
|
bodyRightSpace: number;
|
|
794
796
|
}
|
|
797
|
+
/**
|
|
798
|
+
|
|
799
|
+
*/
|
|
800
|
+
export interface IPositionChanged {
|
|
801
|
+
x: boolean;
|
|
802
|
+
y: boolean;
|
|
803
|
+
}
|
|
795
804
|
/**
|
|
796
805
|
|
|
797
806
|
*/
|
|
@@ -802,13 +811,6 @@ export interface IQuickToolbarOptions {
|
|
|
802
811
|
toolbarItems: (string | IToolbarItems)[];
|
|
803
812
|
cssClass: string;
|
|
804
813
|
}
|
|
805
|
-
/**
|
|
806
|
-
|
|
807
|
-
*/
|
|
808
|
-
export interface IPositionChanged {
|
|
809
|
-
x: Boolean;
|
|
810
|
-
y: Boolean;
|
|
811
|
-
}
|
|
812
814
|
/**
|
|
813
815
|
* Provides information about a BeforeQuickToolbarOpen event.
|
|
814
816
|
*/
|
|
@@ -1120,8 +1122,6 @@ export interface ImageSuccessEventArgs {
|
|
|
1120
1122
|
e?: object;
|
|
1121
1123
|
/**
|
|
1122
1124
|
* Returns the details about upload file.
|
|
1123
|
-
*
|
|
1124
|
-
* @blazorType Syncfusion.EJ2.Blazor.Inputs.FileInfo
|
|
1125
1125
|
*/
|
|
1126
1126
|
file: FileInfo;
|
|
1127
1127
|
/**
|
|
@@ -1134,8 +1134,6 @@ export interface ImageSuccessEventArgs {
|
|
|
1134
1134
|
operation: string;
|
|
1135
1135
|
/**
|
|
1136
1136
|
* Returns the upload event operation.
|
|
1137
|
-
*
|
|
1138
|
-
* @blazorType ResponseEventArgs
|
|
1139
1137
|
*/
|
|
1140
1138
|
response?: ResponseEventArgs;
|
|
1141
1139
|
/**
|
|
@@ -1157,8 +1155,6 @@ export interface ImageFailedEventArgs {
|
|
|
1157
1155
|
e?: object;
|
|
1158
1156
|
/**
|
|
1159
1157
|
* Returns the details about upload file.
|
|
1160
|
-
*
|
|
1161
|
-
* @blazorType Syncfusion.EJ2.Blazor.Inputs.FileInfo
|
|
1162
1158
|
*/
|
|
1163
1159
|
file: FileInfo;
|
|
1164
1160
|
/**
|
|
@@ -1171,8 +1167,6 @@ export interface ImageFailedEventArgs {
|
|
|
1171
1167
|
operation: string;
|
|
1172
1168
|
/**
|
|
1173
1169
|
* Returns the upload event operation.
|
|
1174
|
-
*
|
|
1175
|
-
* @blazorType ResponseEventArgs
|
|
1176
1170
|
*/
|
|
1177
1171
|
response?: ResponseEventArgs;
|
|
1178
1172
|
/**
|
|
@@ -1258,8 +1252,6 @@ export interface ToolbarClickEventArgs {
|
|
|
1258
1252
|
cancel: boolean;
|
|
1259
1253
|
/**
|
|
1260
1254
|
* Defines the current Toolbar Item Object.
|
|
1261
|
-
*
|
|
1262
|
-
* @blazorType Syncfusion.EJ2.Blazor.Navigations.ItemModel
|
|
1263
1255
|
*/
|
|
1264
1256
|
item: ItemModel;
|
|
1265
1257
|
/**
|
|
@@ -1326,16 +1318,12 @@ export interface ImageUploadingEventArgs {
|
|
|
1326
1318
|
cancel: boolean;
|
|
1327
1319
|
/**
|
|
1328
1320
|
* Defines the additional data in key and value pair format that will be submitted to the upload action.
|
|
1329
|
-
*
|
|
1330
|
-
* @blazorType object
|
|
1331
1321
|
*/
|
|
1332
1322
|
customFormData: {
|
|
1333
1323
|
[key: string]: Object;
|
|
1334
1324
|
}[];
|
|
1335
1325
|
/**
|
|
1336
1326
|
* Returns the XMLHttpRequest instance that is associated with upload action.
|
|
1337
|
-
*
|
|
1338
|
-
* @blazorType object
|
|
1339
1327
|
*/
|
|
1340
1328
|
currentRequest?: {
|
|
1341
1329
|
[key: string]: string;
|