@syncfusion/ej2-richtexteditor 26.1.38 → 26.1.40
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/dist/ej2-richtexteditor.min.js +2 -2
- 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 +74 -26
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +74 -26
- 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 +9 -9
- package/src/editor-manager/plugin/ms-word-clean-up.js +1 -1
- package/src/editor-manager/plugin/video.js +12 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +1 -1
- package/src/rich-text-editor/actions/enter-key.js +31 -5
- package/src/rich-text-editor/actions/html-editor.js +4 -0
- package/src/rich-text-editor/actions/toolbar.js +2 -1
- package/src/rich-text-editor/base/rich-text-editor.js +0 -9
- package/src/rich-text-editor/renderer/image-module.d.ts +4 -0
- package/src/rich-text-editor/renderer/image-module.js +16 -8
- package/src/rich-text-editor/renderer/table-module.js +1 -1
- package/src/rich-text-editor/renderer/video-module.js +8 -0
- package/styles/fluent2.css +5 -5
- package/styles/material3-dark.css +6 -6
- package/styles/material3.css +6 -6
- package/styles/rich-text-editor/_layout.scss +8 -8
- package/styles/rich-text-editor/_material3-definition.scss +2 -2
- package/styles/rich-text-editor/fluent2.css +5 -5
- package/styles/rich-text-editor/material3-dark.css +6 -6
- package/styles/rich-text-editor/material3.css +6 -6
|
@@ -6924,7 +6924,7 @@ class Toolbar {
|
|
|
6924
6924
|
*/
|
|
6925
6925
|
updateItem(args) {
|
|
6926
6926
|
const item = this.tools[args.updateItem.toLocaleLowerCase()];
|
|
6927
|
-
if (this.parent.locale !== 'en-US') {
|
|
6927
|
+
if ((getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator) !== 'Code View' && getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator) !== 'Preview') || this.parent.locale !== 'en-US') {
|
|
6928
6928
|
item.tooltip = getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator);
|
|
6929
6929
|
}
|
|
6930
6930
|
const trgItem = this.tools[args.targetItem.toLocaleLowerCase()];
|
|
@@ -8039,7 +8039,7 @@ class BaseQuickToolbar {
|
|
|
8039
8039
|
this.checkCollision(showPopupData, 'document', ((this.parent.inlineMode.enable) ? 'inline' : (type === 'text') ? 'text' : ''));
|
|
8040
8040
|
this.popupObj.element.classList.remove('e-popup-open');
|
|
8041
8041
|
removeClass([this.element], [CLS_HIDE]);
|
|
8042
|
-
this.popupObj.show({ name: 'ZoomIn', duration: (Browser.isIE ? 250 : 400) });
|
|
8042
|
+
this.popupObj.show({ name: 'ZoomIn', duration: (Browser.isIE ? 250 : 400) }, target);
|
|
8043
8043
|
if (this.popupObj && this.parent.cssClass) {
|
|
8044
8044
|
removeClass([this.popupObj.element], this.parent.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
8045
8045
|
addClass([this.popupObj.element], this.parent.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
@@ -16860,6 +16860,7 @@ class VideoCommand {
|
|
|
16860
16860
|
clickElement.appendChild(temp.content);
|
|
16861
16861
|
this.vidElement = sourceElement = clickElement.firstElementChild;
|
|
16862
16862
|
this.setStyle(sourceElement, e, this.vidElement);
|
|
16863
|
+
wrapElement.style.display = (e.item.cssClass === CLASS_VIDEO_INLINE) ? 'inline-block' : 'block';
|
|
16863
16864
|
wrapElement.appendChild(clickElement);
|
|
16864
16865
|
}
|
|
16865
16866
|
else {
|
|
@@ -16991,6 +16992,16 @@ class VideoCommand {
|
|
|
16991
16992
|
if (!isNullOrUndefined(e.item.height) && !isNullOrUndefined(e.item.height.maxHeight)) {
|
|
16992
16993
|
videoEle.style.maxHeight = formatUnit(e.item.height.maxHeight);
|
|
16993
16994
|
}
|
|
16995
|
+
if (!isNullOrUndefined(e.item.cssClass)) {
|
|
16996
|
+
if (e.item.cssClass === CLASS_VIDEO_BREAK) {
|
|
16997
|
+
addClass([videoEle], [CLASS_VIDEO_BREAK]);
|
|
16998
|
+
removeClass([videoEle], [CLASS_VIDEO_INLINE]);
|
|
16999
|
+
}
|
|
17000
|
+
else {
|
|
17001
|
+
addClass([videoEle], [CLASS_VIDEO_INLINE]);
|
|
17002
|
+
removeClass([videoEle], [CLASS_VIDEO_BREAK]);
|
|
17003
|
+
}
|
|
17004
|
+
}
|
|
16994
17005
|
}
|
|
16995
17006
|
videoDimension(e) {
|
|
16996
17007
|
const selectNode = !(e.item.selectNode[0].classList.contains(CLASS_VIDEO_CLICK_ELEM)) ? e.item.selectNode[0] :
|
|
@@ -20346,7 +20357,7 @@ class MsWordPaste {
|
|
|
20346
20357
|
if (content && content.indexOf('mso-list:') !== -1) {
|
|
20347
20358
|
let msoListValue;
|
|
20348
20359
|
if (content.match(/mso-list:[^;]+;?/)) {
|
|
20349
|
-
const changedContent = content.replace('\n', '').split(' ').join('');
|
|
20360
|
+
const changedContent = content.replace(new RegExp('\n', 'g'), '').split(' ').join('');
|
|
20350
20361
|
msoListValue = changedContent.match(/mso-list:[^;]+;?/)[0].split(':l');
|
|
20351
20362
|
listFormatOverride = isNullOrUndefined(msoListValue) ? null : parseInt(msoListValue[1].split('level')[0], 10);
|
|
20352
20363
|
}
|
|
@@ -22945,6 +22956,10 @@ class HtmlEditor {
|
|
|
22945
22956
|
}
|
|
22946
22957
|
paraElem[i].innerHTML = resultSplitContent.trim();
|
|
22947
22958
|
}
|
|
22959
|
+
const anchorElement = divElement.childNodes[0];
|
|
22960
|
+
if (!isNullOrUndefined(anchorElement) && !isNullOrUndefined(anchorElement.childNodes[0]) && anchorElement.nodeName === 'SPAN' && anchorElement.childNodes[0].nodeName === 'A') {
|
|
22961
|
+
divElement.innerHTML = divElement.innerHTML.replace('<span>', '').replace('</span>', '');
|
|
22962
|
+
}
|
|
22948
22963
|
if (!isNullOrUndefined(this.parent.pasteCleanupModule)) {
|
|
22949
22964
|
e.callBack(divElement.innerHTML);
|
|
22950
22965
|
}
|
|
@@ -26698,6 +26713,10 @@ class Image$1 {
|
|
|
26698
26713
|
this.rendererFactory = serviceLocator.getService('rendererFactory');
|
|
26699
26714
|
this.dialogRenderObj = serviceLocator.getService('dialogRenderObject');
|
|
26700
26715
|
this.addEventListener();
|
|
26716
|
+
this.drop = this.dragDrop.bind(this);
|
|
26717
|
+
this.drag = this.dragOver.bind(this);
|
|
26718
|
+
this.enter = this.dragEnter.bind(this);
|
|
26719
|
+
this.start = this.dragStart.bind(this);
|
|
26701
26720
|
}
|
|
26702
26721
|
addEventListener() {
|
|
26703
26722
|
if (this.parent.isDestroyed) {
|
|
@@ -26756,10 +26775,14 @@ class Image$1 {
|
|
|
26756
26775
|
this.parent.off(moduleDestroy, this.moduleDestroy);
|
|
26757
26776
|
const dropElement = this.parent.iframeSettings.enable ? this.parent.inputElement.ownerDocument
|
|
26758
26777
|
: this.parent.inputElement;
|
|
26759
|
-
dropElement.removeEventListener('drop', this.
|
|
26760
|
-
dropElement.removeEventListener('dragstart', this.
|
|
26761
|
-
dropElement.removeEventListener('dragenter', this.
|
|
26762
|
-
dropElement.removeEventListener('dragover', this.
|
|
26778
|
+
dropElement.removeEventListener('drop', this.drop, true);
|
|
26779
|
+
dropElement.removeEventListener('dragstart', this.drag, true);
|
|
26780
|
+
dropElement.removeEventListener('dragenter', this.enter, true);
|
|
26781
|
+
dropElement.removeEventListener('dragover', this.start, true);
|
|
26782
|
+
this.drop = null;
|
|
26783
|
+
this.drag = null;
|
|
26784
|
+
this.enter = null;
|
|
26785
|
+
this.start = null;
|
|
26763
26786
|
if (!isNullOrUndefined(this.contentModule)) {
|
|
26764
26787
|
EventHandler.remove(this.contentModule.getEditPanel(), Browser.touchEndEvent, this.imageClick);
|
|
26765
26788
|
this.parent.formatter.editorManager.observer.off(checkUndo, this.undoStack);
|
|
@@ -26813,10 +26836,10 @@ class Image$1 {
|
|
|
26813
26836
|
}
|
|
26814
26837
|
const dropElement = this.parent.iframeSettings.enable ? this.parent.inputElement.ownerDocument :
|
|
26815
26838
|
this.parent.inputElement;
|
|
26816
|
-
dropElement.addEventListener('drop', this.
|
|
26817
|
-
dropElement.addEventListener('dragstart', this.
|
|
26818
|
-
dropElement.addEventListener('dragenter', this.
|
|
26819
|
-
dropElement.addEventListener('dragover', this.
|
|
26839
|
+
dropElement.addEventListener('drop', this.drop, true);
|
|
26840
|
+
dropElement.addEventListener('dragstart', this.drag, true);
|
|
26841
|
+
dropElement.addEventListener('dragenter', this.enter, true);
|
|
26842
|
+
dropElement.addEventListener('dragover', this.start, true);
|
|
26820
26843
|
}
|
|
26821
26844
|
undoStack(args) {
|
|
26822
26845
|
if (args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') {
|
|
@@ -31237,6 +31260,14 @@ class Video {
|
|
|
31237
31260
|
if (!isNullOrUndefined(proxy.uploadUrl) && proxy.uploadUrl.url !== '') {
|
|
31238
31261
|
proxy.uploadUrl.cssClass = (proxy.parent.insertVideoSettings.layoutOption === 'Inline' ?
|
|
31239
31262
|
CLS_VIDEOINLINE : CLS_VIDEOBREAK);
|
|
31263
|
+
proxy.uploadUrl.width = {
|
|
31264
|
+
width: proxy.parent.insertVideoSettings.width, minWidth: proxy.parent.insertVideoSettings.minWidth,
|
|
31265
|
+
maxWidth: proxy.parent.getInsertImgMaxWidth()
|
|
31266
|
+
};
|
|
31267
|
+
proxy.uploadUrl.height = {
|
|
31268
|
+
height: proxy.parent.insertVideoSettings.height, minHeight: proxy.parent.insertVideoSettings.minHeight,
|
|
31269
|
+
maxHeight: proxy.parent.insertVideoSettings.maxHeight
|
|
31270
|
+
};
|
|
31240
31271
|
proxy.dialogObj.hide({ returnValue: false });
|
|
31241
31272
|
proxy.parent.formatter.process(proxy.parent, this.args, this.args.originalEvent, proxy.uploadUrl);
|
|
31242
31273
|
proxy.uploadUrl.url = '';
|
|
@@ -33539,7 +33570,7 @@ class Table {
|
|
|
33539
33570
|
const argument = ((Browser.isDevice || (!isNullOrUndefined(args.args)
|
|
33540
33571
|
&& !isNullOrUndefined(args.args.originalEvent) &&
|
|
33541
33572
|
args.args.originalEvent.action === 'insert-table')
|
|
33542
|
-
|| proxy.parent.inlineMode.enable || !isNullOrUndefined(proxy.parent.quickToolbarSettings.text)) ? args :
|
|
33573
|
+
|| proxy.parent.inlineMode.enable || ((!isNullOrUndefined(proxy.parent.quickToolbarSettings.text)) && !(args instanceof PointerEvent))) ? args :
|
|
33543
33574
|
this);
|
|
33544
33575
|
proxy.tableInsert(proxy.rowTextBox.value, proxy.columnTextBox.value, e, argument);
|
|
33545
33576
|
}
|
|
@@ -34835,8 +34866,17 @@ class EnterKeyAction {
|
|
|
34835
34866
|
}
|
|
34836
34867
|
else {
|
|
34837
34868
|
const lineBreakBRElem = this.parent.createElement('br');
|
|
34838
|
-
this.
|
|
34839
|
-
|
|
34869
|
+
const anchorElement = (!isNullOrUndefined(this.range.startContainer.parentElement) && this.range.startContainer.parentElement.nodeName === 'A'
|
|
34870
|
+
&& this.range.startContainer.parentElement.textContent.length === this.range.startOffset)
|
|
34871
|
+
? this.range.startContainer.parentElement : this.range.startContainer;
|
|
34872
|
+
this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, anchorElement);
|
|
34873
|
+
this.parent.formatter.editorManager.domNode.insertAfter(lineBreakBRElem, anchorElement);
|
|
34874
|
+
const brSibling = anchorElement.nextElementSibling;
|
|
34875
|
+
const brNextSibling = !isNullOrUndefined(brSibling) ? brSibling.nextElementSibling : null;
|
|
34876
|
+
if (!isNullOrUndefined(brSibling) && !isNullOrUndefined(brNextSibling) && !isNullOrUndefined(brNextSibling.nextElementSibling) &&
|
|
34877
|
+
brSibling.nodeName === 'BR' && brNextSibling.nodeName === 'BR' && brNextSibling.nextElementSibling.nodeName === 'BR') {
|
|
34878
|
+
brNextSibling.nextElementSibling.remove();
|
|
34879
|
+
}
|
|
34840
34880
|
}
|
|
34841
34881
|
}
|
|
34842
34882
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusBRElem, 0);
|
|
@@ -34903,6 +34943,13 @@ class EnterKeyAction {
|
|
|
34903
34943
|
isFocusTextNode = false;
|
|
34904
34944
|
}
|
|
34905
34945
|
const brElm = this.parent.createElement('br');
|
|
34946
|
+
let findAnchorLastChild = this.startNode;
|
|
34947
|
+
while (findAnchorLastChild.lastChild) {
|
|
34948
|
+
findAnchorLastChild = findAnchorLastChild.lastChild;
|
|
34949
|
+
}
|
|
34950
|
+
const findAnchorElement = this.startNode.nodeName === 'A' && this.endNode.nodeName === 'A' &&
|
|
34951
|
+
!isNullOrUndefined(this.range.startContainer.parentElement) && this.range.startOffset === this.range.endOffset &&
|
|
34952
|
+
this.range.startContainer.textContent.trim().length === findAnchorLastChild.textContent.trim().length;
|
|
34906
34953
|
if (this.startNode.nodeName === 'BR' && this.endNode.nodeName === 'BR' && this.range.startOffset === 0 && this.range.startOffset === this.range.endOffset) {
|
|
34907
34954
|
this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
|
|
34908
34955
|
isEmptyBrInserted = true;
|
|
@@ -34912,15 +34959,25 @@ class EnterKeyAction {
|
|
|
34912
34959
|
this.range.startContainer.previousSibling.nodeName === 'BR' && this.range.startContainer.textContent.length === 0) {
|
|
34913
34960
|
isEmptyBrInserted = true;
|
|
34914
34961
|
}
|
|
34915
|
-
|
|
34962
|
+
if (findAnchorElement) {
|
|
34963
|
+
this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
|
|
34964
|
+
}
|
|
34965
|
+
else {
|
|
34966
|
+
this.range.insertNode(brElm);
|
|
34967
|
+
}
|
|
34916
34968
|
}
|
|
34917
34969
|
if (isEmptyBrInserted || (!isNullOrUndefined(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNullOrUndefined(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
|
|
34918
34970
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), !isNullOrUndefined(brElm.nextSibling) && isFocusTextNode ? brElm.nextSibling : brElm, 0);
|
|
34919
34971
|
isEmptyBrInserted = false;
|
|
34920
34972
|
}
|
|
34921
34973
|
else {
|
|
34922
|
-
const
|
|
34923
|
-
|
|
34974
|
+
const brElements = this.parent.createElement('br');
|
|
34975
|
+
if (findAnchorElement) {
|
|
34976
|
+
this.parent.formatter.editorManager.domNode.insertAfter(brElements, this.startNode);
|
|
34977
|
+
}
|
|
34978
|
+
else {
|
|
34979
|
+
this.range.insertNode(brElements);
|
|
34980
|
+
}
|
|
34924
34981
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), brElm, 0);
|
|
34925
34982
|
}
|
|
34926
34983
|
}
|
|
@@ -36094,15 +36151,6 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
36094
36151
|
detach(tooltipEle);
|
|
36095
36152
|
}
|
|
36096
36153
|
}
|
|
36097
|
-
if (this.element.offsetParent === null) {
|
|
36098
|
-
if (!isNullOrUndefined(this.toolbarModule)) {
|
|
36099
|
-
this.toolbarModule.destroy();
|
|
36100
|
-
}
|
|
36101
|
-
this.notify(moduleDestroy, {});
|
|
36102
|
-
super.destroy();
|
|
36103
|
-
this.isRendered = false;
|
|
36104
|
-
return;
|
|
36105
|
-
}
|
|
36106
36154
|
this.notify(destroy, {});
|
|
36107
36155
|
this.destroyDependentModules();
|
|
36108
36156
|
this.unWireEvents();
|