@syncfusion/ej2-richtexteditor 25.1.40 → 25.1.42
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 +28 -0
- 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 +159 -72
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +159 -73
- 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 +19 -9
- package/src/editor-manager/plugin/inserthtml.js +8 -2
- package/src/editor-manager/plugin/lists.d.ts +1 -0
- package/src/editor-manager/plugin/lists.js +97 -51
- package/src/editor-manager/plugin/nodecutter.js +2 -2
- package/src/rich-text-editor/actions/emoji-picker.js +1 -1
- package/src/rich-text-editor/actions/enter-key.js +9 -0
- package/src/rich-text-editor/actions/html-editor.js +8 -2
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -2
- package/src/rich-text-editor/base/enum.d.ts +4 -4
- package/src/rich-text-editor/base/enum.js +9 -9
- package/src/rich-text-editor/base/interface.d.ts +3 -3
- package/src/rich-text-editor/base/rich-text-editor.js +7 -0
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +3 -3
- package/src/rich-text-editor/renderer/link-module.js +3 -0
- package/src/rich-text-editor/renderer/table-module.js +3 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +2 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.js +7 -1
- package/styles/bootstrap-dark.css +4 -0
- package/styles/bootstrap.css +4 -0
- package/styles/bootstrap4.css +4 -0
- package/styles/bootstrap5-dark.css +4 -0
- package/styles/bootstrap5.css +4 -0
- package/styles/fabric-dark.css +4 -0
- package/styles/fabric.css +4 -0
- package/styles/fluent-dark.css +4 -0
- package/styles/fluent.css +4 -0
- package/styles/highcontrast-light.css +4 -0
- package/styles/highcontrast.css +4 -0
- package/styles/material-dark.css +4 -0
- package/styles/material.css +4 -0
- package/styles/material3-dark.css +4 -0
- package/styles/material3.css +4 -0
- package/styles/rich-text-editor/_layout.scss +4 -0
- package/styles/rich-text-editor/bootstrap-dark.css +4 -0
- package/styles/rich-text-editor/bootstrap.css +4 -0
- package/styles/rich-text-editor/bootstrap4.css +4 -0
- package/styles/rich-text-editor/bootstrap5-dark.css +4 -0
- package/styles/rich-text-editor/bootstrap5.css +4 -0
- package/styles/rich-text-editor/fabric-dark.css +4 -0
- package/styles/rich-text-editor/fabric.css +4 -0
- package/styles/rich-text-editor/fluent-dark.css +4 -0
- package/styles/rich-text-editor/fluent.css +4 -0
- package/styles/rich-text-editor/highcontrast-light.css +4 -0
- package/styles/rich-text-editor/highcontrast.css +4 -0
- package/styles/rich-text-editor/material-dark.css +4 -0
- package/styles/rich-text-editor/material.css +4 -0
- package/styles/rich-text-editor/material3-dark.css +4 -0
- package/styles/rich-text-editor/material3.css +4 -0
- package/styles/rich-text-editor/tailwind-dark.css +4 -0
- package/styles/rich-text-editor/tailwind.css +4 -0
- package/styles/tailwind-dark.css +4 -0
- package/styles/tailwind.css +4 -0
|
@@ -1651,15 +1651,15 @@ var DialogType;
|
|
|
1651
1651
|
/**
|
|
1652
1652
|
* Defines types to be used as inserted image.
|
|
1653
1653
|
*/
|
|
1654
|
-
var
|
|
1655
|
-
(function (
|
|
1656
|
-
/** Defines
|
|
1657
|
-
|
|
1658
|
-
/** Defines
|
|
1659
|
-
|
|
1660
|
-
/** Defines
|
|
1661
|
-
|
|
1662
|
-
})(
|
|
1654
|
+
var ImageInputSource;
|
|
1655
|
+
(function (ImageInputSource) {
|
|
1656
|
+
/** Defines ImageInputSource as Uploaded */
|
|
1657
|
+
ImageInputSource["Uploaded"] = "Uploaded";
|
|
1658
|
+
/** Defines ImageInputSource as Dropped */
|
|
1659
|
+
ImageInputSource["Dropped"] = "Dropped";
|
|
1660
|
+
/** Defines ImageInputSource as Pasted */
|
|
1661
|
+
ImageInputSource["Pasted"] = "Pasted";
|
|
1662
|
+
})(ImageInputSource || (ImageInputSource = {}));
|
|
1663
1663
|
|
|
1664
1664
|
/* eslint-disable */
|
|
1665
1665
|
/**
|
|
@@ -5091,6 +5091,7 @@ class ToolbarRenderer {
|
|
|
5091
5091
|
openDelay: 400,
|
|
5092
5092
|
opensOn: 'Hover',
|
|
5093
5093
|
beforeRender: this.tooltipBeforeRender.bind(this),
|
|
5094
|
+
beforeOpen: this.tooltipBeforeOpen.bind(this),
|
|
5094
5095
|
cssClass: this.parent.getCssClass(),
|
|
5095
5096
|
windowCollision: true,
|
|
5096
5097
|
position: 'BottomCenter'
|
|
@@ -5212,7 +5213,7 @@ class ToolbarRenderer {
|
|
|
5212
5213
|
if ((divNode.textContent.trim() !== ''
|
|
5213
5214
|
&& args.element.childNodes[index].textContent.trim() === divNode.textContent.trim()) ||
|
|
5214
5215
|
((args.items[0].command === 'Formats' && !isNullOrUndefined(toolbarStatus.formats) && this.parent.format.types[index].value.toLowerCase() === toolbarStatus.formats.toLowerCase() && args.element.childNodes[index].classList.contains(this.parent.format.types[index].cssClass))
|
|
5215
|
-
|| (args.items[0].command === 'Font' && !isNullOrUndefined(toolbarStatus.fontname) && this.parent.fontFamily.items[index].value.toLowerCase() === toolbarStatus.fontname.toLowerCase() && args.element.childNodes[index].classList.contains(this.parent.fontFamily.items[index].cssClass)))) {
|
|
5216
|
+
|| (args.items[0].subCommand === 'FontName' && args.items[0].command === 'Font' && !isNullOrUndefined(toolbarStatus.fontname) && !isNullOrUndefined(this.parent.fontFamily.items[index]) && this.parent.fontFamily.items[index].value.toLowerCase() === toolbarStatus.fontname.toLowerCase() && args.element.childNodes[index].classList.contains(this.parent.fontFamily.items[index].cssClass)))) {
|
|
5216
5217
|
if (!args.element.childNodes[index].classList.contains('e-active')) {
|
|
5217
5218
|
addClass([args.element.childNodes[index]], 'e-active');
|
|
5218
5219
|
}
|
|
@@ -5595,6 +5596,11 @@ class ToolbarRenderer {
|
|
|
5595
5596
|
colorPicker.appendTo(document.getElementById(args.target));
|
|
5596
5597
|
return colorPicker;
|
|
5597
5598
|
}
|
|
5599
|
+
tooltipBeforeOpen(args) {
|
|
5600
|
+
if (args.element) {
|
|
5601
|
+
args.element.setAttribute('data-rte-id', this.parent.getID());
|
|
5602
|
+
}
|
|
5603
|
+
}
|
|
5598
5604
|
/**
|
|
5599
5605
|
* The function is used to render Rich Text Editor toolbar
|
|
5600
5606
|
*
|
|
@@ -13347,58 +13353,36 @@ class Lists {
|
|
|
13347
13353
|
let listsNodes = this.domNode.blockNodes(true);
|
|
13348
13354
|
if (e.enterAction === 'BR') {
|
|
13349
13355
|
this.setSelectionBRConfig();
|
|
13350
|
-
const
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13356
|
+
const selectedNodes = this.parent.domNode.blockNodes();
|
|
13357
|
+
if (selectedNodes.length > 1) {
|
|
13358
|
+
let i = 0;
|
|
13359
|
+
let currentAlignmentNode = selectedNodes[0];
|
|
13360
|
+
while (!isNullOrUndefined(currentAlignmentNode)) {
|
|
13361
|
+
if (currentAlignmentNode.nodeName === 'BR') {
|
|
13362
|
+
const nextNode = currentAlignmentNode.nextSibling;
|
|
13363
|
+
detach(currentAlignmentNode);
|
|
13364
|
+
currentAlignmentNode = nextNode;
|
|
13365
|
+
}
|
|
13366
|
+
if (!isNullOrUndefined(currentAlignmentNode)) {
|
|
13367
|
+
selectedNodes[i] = currentAlignmentNode.nodeName === 'LI' || this.parent.domNode.isBlockNode(currentAlignmentNode) ?
|
|
13368
|
+
currentAlignmentNode : this.gatherElementsAround(currentAlignmentNode);
|
|
13369
|
+
const currentSelectNode = selectedNodes[i].nodeName === 'LI' ? selectedNodes[i].parentElement : selectedNodes[i];
|
|
13370
|
+
const currentElementCheckNode = currentAlignmentNode.nodeName === '#text' ? currentAlignmentNode.parentElement : currentAlignmentNode;
|
|
13371
|
+
currentAlignmentNode = !isNullOrUndefined(currentElementCheckNode.querySelector('.e-editor-select-end')) ||
|
|
13372
|
+
!isNullOrUndefined(closest(currentAlignmentNode, '.e-editor-select-end')) ?
|
|
13373
|
+
null : currentSelectNode.nextSibling;
|
|
13374
|
+
if (currentAlignmentNode === null && !isNullOrUndefined(currentSelectNode.nextSibling) && currentSelectNode.nextSibling.nodeName === 'BR') {
|
|
13375
|
+
detach(currentSelectNode.nextSibling);
|
|
13376
|
+
}
|
|
13377
|
+
}
|
|
13378
|
+
i++;
|
|
13365
13379
|
}
|
|
13366
13380
|
}
|
|
13367
|
-
|
|
13368
|
-
if (!this.parent.domNode.isBlockNode(
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
previousNode = currentNode;
|
|
13373
|
-
currentNode = currentNode.parentElement;
|
|
13374
|
-
}
|
|
13375
|
-
let tempElem;
|
|
13376
|
-
if (this.parent.domNode.isBlockNode(previousNode.parentElement) &&
|
|
13377
|
-
previousNode.parentElement === this.parent.editableElement) {
|
|
13378
|
-
tempElem = createElement('p');
|
|
13379
|
-
previousNode.parentElement.insertBefore(tempElem, previousNode);
|
|
13380
|
-
tempElem.appendChild(previousNode);
|
|
13381
|
-
}
|
|
13382
|
-
else {
|
|
13383
|
-
tempElem = previousNode;
|
|
13384
|
-
}
|
|
13385
|
-
let preNode = tempElem.previousSibling;
|
|
13386
|
-
while (!isNullOrUndefined(preNode) && preNode.nodeName !== 'BR' &&
|
|
13387
|
-
!this.parent.domNode.isBlockNode(preNode)) {
|
|
13388
|
-
tempElem.firstChild.parentElement.insertBefore(preNode, tempElem.firstChild);
|
|
13389
|
-
preNode = tempElem.previousSibling;
|
|
13390
|
-
}
|
|
13391
|
-
if (!isNullOrUndefined(preNode) && preNode.nodeName === 'BR') {
|
|
13392
|
-
detach(preNode);
|
|
13393
|
-
}
|
|
13394
|
-
let postNode = tempElem.nextSibling;
|
|
13395
|
-
while (!isNullOrUndefined(postNode) && postNode.nodeName !== 'BR' &&
|
|
13396
|
-
!this.parent.domNode.isBlockNode(postNode)) {
|
|
13397
|
-
tempElem.appendChild(postNode);
|
|
13398
|
-
postNode = tempElem.nextSibling;
|
|
13399
|
-
}
|
|
13400
|
-
if (!isNullOrUndefined(postNode) && postNode.nodeName === 'BR') {
|
|
13401
|
-
detach(postNode);
|
|
13381
|
+
else {
|
|
13382
|
+
if (!this.parent.domNode.isBlockNode(selectedNodes[0])) {
|
|
13383
|
+
selectedNodes[0] = this.gatherElementsAround(selectedNodes[0]);
|
|
13384
|
+
if (!isNullOrUndefined(selectedNodes[0].nextSibling) && (selectedNodes[0].nextSibling.nodeName === 'BR')) {
|
|
13385
|
+
detach(selectedNodes[0].nextSibling);
|
|
13402
13386
|
}
|
|
13403
13387
|
}
|
|
13404
13388
|
}
|
|
@@ -13500,6 +13484,16 @@ class Lists {
|
|
|
13500
13484
|
}
|
|
13501
13485
|
}
|
|
13502
13486
|
this.cleanNode();
|
|
13487
|
+
if (e.enterAction === 'BR') {
|
|
13488
|
+
const spansToRemove = document.querySelectorAll('span#removeSpan');
|
|
13489
|
+
spansToRemove.forEach((span) => {
|
|
13490
|
+
const fragment = document.createDocumentFragment();
|
|
13491
|
+
while (span.firstChild) {
|
|
13492
|
+
fragment.appendChild(span.firstChild);
|
|
13493
|
+
}
|
|
13494
|
+
span.parentNode.replaceChild(fragment, span);
|
|
13495
|
+
});
|
|
13496
|
+
}
|
|
13503
13497
|
this.parent.editableElement.focus();
|
|
13504
13498
|
if (isIDevice$1()) {
|
|
13505
13499
|
setEditFrameFocus(this.parent.editableElement, selector);
|
|
@@ -13697,6 +13691,12 @@ class Lists {
|
|
|
13697
13691
|
if (e.enterAction !== 'BR') {
|
|
13698
13692
|
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapper));
|
|
13699
13693
|
}
|
|
13694
|
+
else {
|
|
13695
|
+
const wrapperSpan = '<span class=e-rte-wrap-inner id=removeSpan></span>';
|
|
13696
|
+
const br = document.createElement('br');
|
|
13697
|
+
this.domNode.wrapInner(element, this.domNode.parseHTMLFragment(wrapperSpan));
|
|
13698
|
+
element.appendChild(br);
|
|
13699
|
+
}
|
|
13700
13700
|
}
|
|
13701
13701
|
else if (this.domNode.contents(element)[0].nodeType === 3) {
|
|
13702
13702
|
const replace = this.domNode.createTagString(DEFAULT_TAG, parentNode, this.parent.domNode.encode(this.domNode.contents(element)[0].textContent));
|
|
@@ -13709,8 +13709,18 @@ class Lists {
|
|
|
13709
13709
|
}
|
|
13710
13710
|
else {
|
|
13711
13711
|
const childNode = element.firstChild;
|
|
13712
|
+
if (childNode) {
|
|
13713
|
+
const attributes$$1 = element.parentElement.attributes;
|
|
13714
|
+
if (attributes$$1.length > 0) {
|
|
13715
|
+
for (let d = 0; d < attributes$$1.length; d++) {
|
|
13716
|
+
const e = attributes$$1[d];
|
|
13717
|
+
const existingValue = childNode.getAttribute(e.nodeName);
|
|
13718
|
+
const parentValue = (element.parentElement).getAttribute(e.nodeName);
|
|
13719
|
+
childNode.setAttribute(e.nodeName, existingValue ? parentValue + ' ' + existingValue : parentValue);
|
|
13720
|
+
}
|
|
13721
|
+
}
|
|
13722
|
+
}
|
|
13712
13723
|
className = childNode.getAttribute('class');
|
|
13713
|
-
attributes(childNode, this.domNode.rawAttributes(parentNode));
|
|
13714
13724
|
if (className && childNode.getAttribute('class')) {
|
|
13715
13725
|
attributes(childNode, { 'class': className + ' ' + childNode.getAttribute('class') });
|
|
13716
13726
|
}
|
|
@@ -13751,6 +13761,48 @@ class Lists {
|
|
|
13751
13761
|
closeTag(type) {
|
|
13752
13762
|
return this.domNode.parseHTMLFragment('<span class="e-rte-list-close-' + type.toLowerCase() + '"></span>');
|
|
13753
13763
|
}
|
|
13764
|
+
gatherElementsAround(node) {
|
|
13765
|
+
const pWrap = document.createElement('p');
|
|
13766
|
+
// Insert the new div before the current node
|
|
13767
|
+
let currentNode = node.previousSibling;
|
|
13768
|
+
const classNode = node.parentNode;
|
|
13769
|
+
if (classNode.className === 'e-editor-select-start') {
|
|
13770
|
+
node.parentNode.parentNode.insertBefore(pWrap, node.parentNode);
|
|
13771
|
+
}
|
|
13772
|
+
else if (node.parentNode) {
|
|
13773
|
+
node.parentNode.insertBefore(pWrap, node);
|
|
13774
|
+
}
|
|
13775
|
+
// Gather text and inline elements before the currentNode
|
|
13776
|
+
let i = 0;
|
|
13777
|
+
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
13778
|
+
!this.parent.domNode.isBlockNode(currentNode)) {
|
|
13779
|
+
const prevSibling = currentNode.previousSibling;
|
|
13780
|
+
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
13781
|
+
if (i === 0) {
|
|
13782
|
+
pWrap.appendChild(currentNode);
|
|
13783
|
+
}
|
|
13784
|
+
else {
|
|
13785
|
+
pWrap.insertBefore(currentNode, pWrap.firstChild);
|
|
13786
|
+
}
|
|
13787
|
+
}
|
|
13788
|
+
currentNode = prevSibling;
|
|
13789
|
+
i++;
|
|
13790
|
+
}
|
|
13791
|
+
// Add the current node to the new p
|
|
13792
|
+
pWrap.appendChild(node);
|
|
13793
|
+
// Gather text and inline elements after the currentNode
|
|
13794
|
+
currentNode = pWrap.nextSibling ? pWrap.nextSibling : pWrap.parentElement.nextSibling;
|
|
13795
|
+
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
13796
|
+
!this.parent.domNode.isBlockNode(currentNode)) {
|
|
13797
|
+
const nextSibling = currentNode.nextSibling ?
|
|
13798
|
+
currentNode.nextSibling : currentNode.parentElement.nextSibling;
|
|
13799
|
+
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
13800
|
+
pWrap.appendChild(currentNode);
|
|
13801
|
+
}
|
|
13802
|
+
currentNode = nextSibling;
|
|
13803
|
+
}
|
|
13804
|
+
return pWrap;
|
|
13805
|
+
}
|
|
13754
13806
|
}
|
|
13755
13807
|
|
|
13756
13808
|
/**
|
|
@@ -13875,7 +13927,7 @@ class NodeCutter {
|
|
|
13875
13927
|
fragment = this.spliceEmptyNode(fragment, false);
|
|
13876
13928
|
if (fragment && fragment.childNodes.length > 0) {
|
|
13877
13929
|
const isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG' && !(fragment.querySelectorAll('img').length > 0)
|
|
13878
|
-
&& this.isRteElm(fragment) && fragment.textContent === '') ? true : false;
|
|
13930
|
+
&& this.isRteElm(fragment) && fragment.textContent.trim() === '') ? true : false;
|
|
13879
13931
|
if (!isEmpty) {
|
|
13880
13932
|
if (node) {
|
|
13881
13933
|
InsertMethods.AppendBefore(fragment, node);
|
|
@@ -13896,7 +13948,7 @@ class NodeCutter {
|
|
|
13896
13948
|
fragment = this.spliceEmptyNode(fragment, true);
|
|
13897
13949
|
if (fragment && fragment.childNodes.length > 0) {
|
|
13898
13950
|
const isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG'
|
|
13899
|
-
&& this.isRteElm(fragment) && fragment.textContent === '') ? true : false;
|
|
13951
|
+
&& this.isRteElm(fragment) && fragment.textContent.trim() === '') ? true : false;
|
|
13900
13952
|
if (!isEmpty) {
|
|
13901
13953
|
if (node) {
|
|
13902
13954
|
InsertMethods.AppendBefore(fragment, node, true);
|
|
@@ -14498,7 +14550,7 @@ class InsertHtml {
|
|
|
14498
14550
|
range.startContainer === range.endContainer;
|
|
14499
14551
|
const isCollapsed = range.collapsed;
|
|
14500
14552
|
const nodes = this.getNodeCollection(range, nodeSelection, node);
|
|
14501
|
-
const closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
14553
|
+
const closestParentNode = (node.nodeName.toLowerCase() === 'table') ? (!isNullOrUndefined(nodes[0]) ? this.closestEle(nodes[0].parentNode, editNode) : range.startContainer) : nodes[0];
|
|
14502
14554
|
if (closestParentNode && closestParentNode.nodeName === 'LI' && node.nodeName.toLowerCase() === 'table') {
|
|
14503
14555
|
this.insertTableInList(range, node, closestParentNode, nodes[0], nodeCutter);
|
|
14504
14556
|
return;
|
|
@@ -14543,7 +14595,7 @@ class InsertHtml {
|
|
|
14543
14595
|
nodes[index].parentNode.removeChild(nodes[index]);
|
|
14544
14596
|
}
|
|
14545
14597
|
}
|
|
14546
|
-
if (sibNode) {
|
|
14598
|
+
if (!isNullOrUndefined(sibNode) && !isNullOrUndefined(sibNode.parentNode)) {
|
|
14547
14599
|
InsertMethods.AppendBefore(node, sibNode, true);
|
|
14548
14600
|
}
|
|
14549
14601
|
else {
|
|
@@ -14794,6 +14846,12 @@ class InsertHtml {
|
|
|
14794
14846
|
node.parentNode.replaceChild(fragment, node);
|
|
14795
14847
|
}
|
|
14796
14848
|
}
|
|
14849
|
+
if (lastSelectionNode.nodeName === 'TABLE') {
|
|
14850
|
+
const pTag = createElement('p');
|
|
14851
|
+
pTag.appendChild(createElement('br'));
|
|
14852
|
+
lastSelectionNode.parentElement.insertBefore(pTag, lastSelectionNode.nextSibling);
|
|
14853
|
+
lastSelectionNode = pTag;
|
|
14854
|
+
}
|
|
14797
14855
|
if (lastSelectionNode.nodeName === '#text') {
|
|
14798
14856
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
14799
14857
|
}
|
|
@@ -21256,6 +21314,7 @@ const IFRAMEHEADER = `
|
|
|
21256
21314
|
overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}
|
|
21257
21315
|
p{margin: 0 0 10px;margin-bottom: 10px;}
|
|
21258
21316
|
li{margin-bottom: 10px;}
|
|
21317
|
+
table{margin-bottom: 10px;}
|
|
21259
21318
|
h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}
|
|
21260
21319
|
h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}
|
|
21261
21320
|
h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}
|
|
@@ -21738,8 +21797,14 @@ class HtmlEditor {
|
|
|
21738
21797
|
range.insertNode(tempSpan);
|
|
21739
21798
|
}
|
|
21740
21799
|
let currentChild = this.parent.inputElement.firstChild;
|
|
21741
|
-
while (!isNullOrUndefined(currentChild)
|
|
21742
|
-
currentChild.
|
|
21800
|
+
while (!isNullOrUndefined(currentChild)) {
|
|
21801
|
+
if (currentChild.nodeName === '#text') {
|
|
21802
|
+
currentChild = currentChild.nextElementSibling;
|
|
21803
|
+
continue;
|
|
21804
|
+
}
|
|
21805
|
+
if (currentChild.textContent.replace(regEx, '').trim().length > 0) {
|
|
21806
|
+
currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
|
|
21807
|
+
}
|
|
21743
21808
|
currentChild = currentChild.nextElementSibling;
|
|
21744
21809
|
}
|
|
21745
21810
|
let tempSpanToRemove = this.parent.inputElement.querySelector('.tempSpan');
|
|
@@ -22882,7 +22947,7 @@ class PasteCleanup {
|
|
|
22882
22947
|
popupClose(popupObj, uploadObj, imgElem, e) {
|
|
22883
22948
|
this.parent.inputElement.contentEditable = 'true';
|
|
22884
22949
|
e.element = imgElem;
|
|
22885
|
-
e.
|
|
22950
|
+
e.detectImageSource = ImageInputSource.Pasted;
|
|
22886
22951
|
this.parent.trigger(imageUploadSuccess, e, (e) => {
|
|
22887
22952
|
if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {
|
|
22888
22953
|
const url = this.parent.insertImageSettings.path + e.file.name;
|
|
@@ -25142,7 +25207,7 @@ class EmojiPicker {
|
|
|
25142
25207
|
const popupHeight = 330;
|
|
25143
25208
|
let popupTop = cursorTop;
|
|
25144
25209
|
const popupLeft = cursorLeft + rect.width;
|
|
25145
|
-
if (rteEle.getBoundingClientRect().top < 0) {
|
|
25210
|
+
if (rteEle.getBoundingClientRect().top < 0 && !this.parent.inlineMode.enable) {
|
|
25146
25211
|
popupTop = popupTop + rteContent.getBoundingClientRect().top - toolbarHeight;
|
|
25147
25212
|
}
|
|
25148
25213
|
if (rect.top < popupHeight) {
|
|
@@ -25809,7 +25874,10 @@ class Link {
|
|
|
25809
25874
|
this.selection.restore();
|
|
25810
25875
|
}
|
|
25811
25876
|
else {
|
|
25877
|
+
const x = window.scrollX;
|
|
25878
|
+
const y = window.scrollY;
|
|
25812
25879
|
this.selfLink.parent.contentModule.getEditPanel().focus();
|
|
25880
|
+
window.scrollTo(x, y);
|
|
25813
25881
|
}
|
|
25814
25882
|
}
|
|
25815
25883
|
onDocumentClick(e) {
|
|
@@ -27634,7 +27702,7 @@ class Image$1 {
|
|
|
27634
27702
|
}
|
|
27635
27703
|
},
|
|
27636
27704
|
success: (e) => {
|
|
27637
|
-
e.
|
|
27705
|
+
e.detectImageSource = ImageInputSource.Uploaded;
|
|
27638
27706
|
this.parent.trigger(imageUploadSuccess, e, (e) => {
|
|
27639
27707
|
if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {
|
|
27640
27708
|
const url = this.parent.insertImageSettings.path + e.file.name;
|
|
@@ -28074,7 +28142,7 @@ class Image$1 {
|
|
|
28074
28142
|
imageElement.style.opacity = '1';
|
|
28075
28143
|
imageElement.classList.add(CLS_IMG_FOCUS);
|
|
28076
28144
|
e.element = imageElement;
|
|
28077
|
-
e.
|
|
28145
|
+
e.detectImageSource = ImageInputSource.Dropped;
|
|
28078
28146
|
this.parent.trigger(imageUploadSuccess, e, (e) => {
|
|
28079
28147
|
if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {
|
|
28080
28148
|
const url = this.parent.insertImageSettings.path + e.file.name;
|
|
@@ -31341,8 +31409,11 @@ class Table {
|
|
|
31341
31409
|
if (proxy.editdlgObj) {
|
|
31342
31410
|
proxy.editdlgObj.hide();
|
|
31343
31411
|
}
|
|
31412
|
+
const x = window.scrollX;
|
|
31413
|
+
const y = window.scrollY;
|
|
31344
31414
|
proxy.parent.formatter.process(proxy.parent, selectionObj.args, selectionObj.args.originalEvent, value);
|
|
31345
31415
|
proxy.contentModule.getEditPanel().focus();
|
|
31416
|
+
window.scrollTo(x, y);
|
|
31346
31417
|
proxy.parent.on(mouseDown, proxy.cellSelect, proxy);
|
|
31347
31418
|
}
|
|
31348
31419
|
cellSelect(e) {
|
|
@@ -33575,6 +33646,7 @@ class EnterKeyAction {
|
|
|
33575
33646
|
else {
|
|
33576
33647
|
currentParent = this.startNode;
|
|
33577
33648
|
}
|
|
33649
|
+
const currentParentStyle = window.getComputedStyle(currentParent);
|
|
33578
33650
|
this.removeBRElement(currentParent);
|
|
33579
33651
|
let currentParentLastChild = currentParent.lastChild;
|
|
33580
33652
|
while (!isNullOrUndefined(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR'
|
|
@@ -33638,6 +33710,14 @@ class EnterKeyAction {
|
|
|
33638
33710
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33639
33711
|
|
|
33640
33712
|
}
|
|
33713
|
+
else if (currentParent !== this.parent.inputElement &&
|
|
33714
|
+
(currentParentStyle.display === 'inline' || currentParentStyle.display === 'inline-block')) {
|
|
33715
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33716
|
+
newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, true).cloneNode(true);
|
|
33717
|
+
currentParent.parentElement.insertBefore(outerBRElem, currentParent);
|
|
33718
|
+
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), currentParent, 0);
|
|
33719
|
+
this.insertFocusContent();
|
|
33720
|
+
}
|
|
33641
33721
|
else {
|
|
33642
33722
|
this.insertBRElement();
|
|
33643
33723
|
}
|
|
@@ -34771,6 +34851,13 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
34771
34851
|
clearInterval(this.timeInterval);
|
|
34772
34852
|
this.timeInterval = null;
|
|
34773
34853
|
}
|
|
34854
|
+
const tooltipElements = document.querySelectorAll('[data-rte-id="' + this.getID() + '"]');
|
|
34855
|
+
for (let i = 0; i < tooltipElements.length; i++) {
|
|
34856
|
+
const tooltipEle = tooltipElements[i];
|
|
34857
|
+
if (this.getID() === tooltipEle.getAttribute('data-rte-id')) {
|
|
34858
|
+
detach(tooltipEle);
|
|
34859
|
+
}
|
|
34860
|
+
}
|
|
34774
34861
|
if (this.element.offsetParent === null) {
|
|
34775
34862
|
if (!isNullOrUndefined(this.toolbarModule)) {
|
|
34776
34863
|
this.toolbarModule.destroy();
|
|
@@ -36622,5 +36709,5 @@ RichTextEditor = __decorate$1([
|
|
|
36622
36709
|
* Rich Text Editor component exported items
|
|
36623
36710
|
*/
|
|
36624
36711
|
|
|
36625
|
-
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image$1 as Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType,
|
|
36712
|
+
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image$1 as Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, ImageInputSource, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, emojiPicker, destroyTooltip, hidePopup, cleanupResizeElements, afterKeyDown, updateValueOnIdle, documentClickClosedBy, showColorPicker, closeTooltip, blockEmptyNodes, inlineEmptyNodes, supportedUnits, conversionFactors, onHandleFontsizeChange, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_TEXT_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_TEXT_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_AUDIOBREAK, CLS_CLICKELEM, CLS_VID_CLICK_ELEM, CLS_AUDIOWRAP, CLS_VIDEOWRAP, CLS_VIDEOBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_AUDIOINLINE, CLS_VIDEOINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_AUD_FOCUS, CLS_VID_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, CLS_RTE_SOURCE_CODE_TXTAREA, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, AUDIO, VIDEO, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, PASTE_SOURCE, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_VIDEO_RIGHT, CLASS_VIDEO_LEFT, CLASS_VIDEO_CENTER, CLASS_IMAGE_BREAK, CLASS_AUDIO_BREAK, CLASS_VIDEO_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, CLASS_AUDIO_INLINE, CLASS_CLICK_ELEM, CLASS_VIDEO_CLICK_ELEM, CLASS_AUDIO, CLASS_VIDEO, CLASS_AUDIO_WRAP, CLASS_VIDEO_WRAP, CLASS_EMBED_VIDEO_WRAP, CLASS_AUDIO_FOCUS, CLASS_VIDEO_FOCUS, CLASS_VIDEO_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, AudioCommand, VideoCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, FormatPainterActions, EmojiPickerAction, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, imageResizeFactor, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION, FORMAT_PAINTER_ACTIONS, EMOJI_PICKER_ACTIONS, MOUSE_DOWN };
|
|
36626
36713
|
//# sourceMappingURL=ej2-richtexteditor.es2015.js.map
|