@syncfusion/ej2-richtexteditor 24.1.43 → 24.1.46
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 +22 -0
- package/README.md +1 -1
- 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 +26 -9
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +26 -9
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/editor-manager/plugin/link.js +3 -0
- package/src/editor-manager/plugin/nodecutter.js +1 -1
- package/src/editor-manager/plugin/selection-commands.js +1 -2
- package/src/editor-manager/plugin/toolbar-status.js +3 -1
- package/src/rich-text-editor/actions/html-editor.js +2 -2
- package/src/rich-text-editor/actions/paste-clean-up.js +1 -1
- package/src/rich-text-editor/actions/toolbar.js +1 -1
- package/src/rich-text-editor/base/interface.d.ts +1 -0
- package/src/rich-text-editor/base/rich-text-editor.d.ts +1 -0
- package/src/rich-text-editor/base/rich-text-editor.js +14 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.js +1 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 24.1.
|
|
3
|
+
* version : 24.1.46
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-richtexteditor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-richtexteditor@24.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@24.1.45",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-639ZpTHnu5BdfPiBTllfJndDTien1yXWHPyQDGWulZXC92dAMtipXgiuEcsVLtVVJv0FbVgg5X9zX4T8PBq/4Q==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
26
26
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
27
27
|
],
|
|
28
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.1.
|
|
29
|
-
"_shasum": "
|
|
28
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-24.1.45.tgz",
|
|
29
|
+
"_shasum": "1fe5762cdca0998b044c81caa60c22dd0e47df75",
|
|
30
30
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
31
31
|
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
32
32
|
"author": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bundleDependencies": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@syncfusion/ej2-base": "~24.1.
|
|
41
|
-
"@syncfusion/ej2-buttons": "~24.1.
|
|
42
|
-
"@syncfusion/ej2-filemanager": "~24.1.
|
|
43
|
-
"@syncfusion/ej2-inputs": "~24.1.
|
|
44
|
-
"@syncfusion/ej2-navigations": "~24.1.
|
|
45
|
-
"@syncfusion/ej2-popups": "~24.1.
|
|
46
|
-
"@syncfusion/ej2-splitbuttons": "~24.1.
|
|
40
|
+
"@syncfusion/ej2-base": "~24.1.46",
|
|
41
|
+
"@syncfusion/ej2-buttons": "~24.1.46",
|
|
42
|
+
"@syncfusion/ej2-filemanager": "~24.1.45",
|
|
43
|
+
"@syncfusion/ej2-inputs": "~24.1.45",
|
|
44
|
+
"@syncfusion/ej2-navigations": "~24.1.46",
|
|
45
|
+
"@syncfusion/ej2-popups": "~24.1.46",
|
|
46
|
+
"@syncfusion/ej2-splitbuttons": "~24.1.46"
|
|
47
47
|
},
|
|
48
48
|
"deprecated": false,
|
|
49
49
|
"description": "Essential JS 2 RichTextEditor component",
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
70
70
|
},
|
|
71
71
|
"typings": "index.d.ts",
|
|
72
|
-
"version": "24.1.
|
|
72
|
+
"version": "24.1.46",
|
|
73
73
|
"sideEffects": false
|
|
74
74
|
}
|
|
@@ -230,6 +230,9 @@ var LinkCommand = /** @class */ (function () {
|
|
|
230
230
|
if (!isNOU(e.item.target)) {
|
|
231
231
|
anchorEle.setAttribute('target', e.item.target);
|
|
232
232
|
}
|
|
233
|
+
if (!isNOU(e.item.ariaLabel)) {
|
|
234
|
+
anchorEle.setAttribute('aria-label', e.item.ariaLabel);
|
|
235
|
+
}
|
|
233
236
|
return anchorEle;
|
|
234
237
|
};
|
|
235
238
|
LinkCommand.prototype.getSelectionNodes = function (nodeCollection) {
|
|
@@ -171,7 +171,7 @@ var NodeCutter = /** @class */ (function () {
|
|
|
171
171
|
if ((indexes.indexOf(range.startOffset) >= 0)
|
|
172
172
|
|| ((indexes.indexOf(range.startOffset - 1) >= 0) && (range.startOffset !== 1
|
|
173
173
|
|| (range.startOffset === 1 && new RegExp('\\s').test(str[0])))
|
|
174
|
-
|| (((indexes[indexes.length - 1] - 1) === range.startOffset) && !new RegExp('\\s').test(str[0])))) {
|
|
174
|
+
|| (((indexes[indexes.length - 1] - 1) === range.startOffset) && range.endOffset !== (str.length - 1) && !new RegExp('\\s').test(str[0])))) {
|
|
175
175
|
cursorRange = range;
|
|
176
176
|
this.position = 1;
|
|
177
177
|
}
|
|
@@ -185,8 +185,7 @@ var SelectionCommands = /** @class */ (function () {
|
|
|
185
185
|
cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
|
|
186
186
|
cursorNodes[0].innerHTML = '';
|
|
187
187
|
}
|
|
188
|
-
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
|
|
189
|
-
cursorNodes[0].nextSibling.nodeName === 'BR')) {
|
|
188
|
+
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNOU(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
|
|
190
189
|
detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
|
|
191
190
|
}
|
|
192
191
|
cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
|
|
@@ -2,6 +2,7 @@ import { IsFormatted } from './isformatted';
|
|
|
2
2
|
import * as CONSTANT from './../base/constant';
|
|
3
3
|
import { NodeSelection } from './../../selection/index';
|
|
4
4
|
import { getDefaultHtmlTbStatus } from './../../common/util';
|
|
5
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
5
6
|
/**
|
|
6
7
|
* Update Toolbar Status
|
|
7
8
|
*
|
|
@@ -250,7 +251,8 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
250
251
|
// eslint-disable-next-line
|
|
251
252
|
var pattern = new RegExp(name, 'i');
|
|
252
253
|
if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
|
|
253
|
-
(value.split(',')[0] && value.split(',')[0].
|
|
254
|
+
(value.split(',')[0] && !isNullOrUndefined(value.split(',')[0].trim().match(pattern)) &&
|
|
255
|
+
value.split(',')[0].trim() === value.split(',')[0].trim().match(pattern)[0])) {
|
|
254
256
|
index = pos;
|
|
255
257
|
}
|
|
256
258
|
}) && (index !== null)))) {
|
|
@@ -233,7 +233,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
233
233
|
else {
|
|
234
234
|
this.parent.notify(events.enterHandler, { args: e.args });
|
|
235
235
|
var newRange = this.parent.getRange();
|
|
236
|
-
if (!isNOU(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text') {
|
|
236
|
+
if (!isNOU(newRange.startContainer) && newRange.startContainer === this.parent.inputElement.lastChild && newRange.startContainer.nodeName !== '#text' && this.parent.height !== 'auto') {
|
|
237
237
|
newRange.startContainer.scrollIntoView({ block: "end", inline: "nearest" });
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -554,7 +554,7 @@ var HtmlEditor = /** @class */ (function () {
|
|
|
554
554
|
for (var j = 0; j < splitTextContent.length; j++) {
|
|
555
555
|
if (splitTextContent[j].match(httpRegex) || splitTextContent[j].match(wwwRegex)) {
|
|
556
556
|
resultSplitContent += '<a class="e-rte-anchor" href="' + splitTextContent[j] +
|
|
557
|
-
'" title="' + splitTextContent[j] + '"target="_blank">' + splitTextContent[j] + ' </a>';
|
|
557
|
+
'" title="' + splitTextContent[j] + '" target="_blank"' + ' aria-label="' + this.parent.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel") + '">' + splitTextContent[j] + ' </a>';
|
|
558
558
|
}
|
|
559
559
|
else {
|
|
560
560
|
resultSplitContent += splitTextContent[j] + ' ';
|
|
@@ -690,7 +690,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
|
|
693
|
-
clipBoardElem.innerHTML = value;
|
|
693
|
+
clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
|
|
694
694
|
clipBoardElem = this.addTableClass(clipBoardElem);
|
|
695
695
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
696
696
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
@@ -64,7 +64,7 @@ var Toolbar = /** @class */ (function () {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
|
-
if (
|
|
67
|
+
if (!this.parent.inlineMode.enable) {
|
|
68
68
|
this.tbWrapper = this.parent.createElement('div', {
|
|
69
69
|
id: this.parent.getID() + '_toolbar_wrapper',
|
|
70
70
|
innerHTML: this.tbElement.outerHTML,
|
|
@@ -1543,6 +1543,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
|
|
|
1543
1543
|
private updateValueOnIdle;
|
|
1544
1544
|
private updateIntervalValue;
|
|
1545
1545
|
private cleanupResizeElements;
|
|
1546
|
+
addAnchorAriaLabel(value: string): string;
|
|
1546
1547
|
private removeResizeElement;
|
|
1547
1548
|
private updateStatus;
|
|
1548
1549
|
private onDocumentClick;
|
|
@@ -551,6 +551,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
551
551
|
|
|
552
552
|
*/
|
|
553
553
|
RichTextEditor.prototype.render = function () {
|
|
554
|
+
this.value = (!(this.editorMode === 'Markdown') && !isNOU(this.value)) ? this.addAnchorAriaLabel(this.value) : this.value;
|
|
554
555
|
if (this.value && !this.valueTemplate) {
|
|
555
556
|
this.setProperties({ value: this.serializeValue(this.value) }, true);
|
|
556
557
|
}
|
|
@@ -2229,6 +2230,17 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2229
2230
|
var value = this.removeResizeElement(args.value);
|
|
2230
2231
|
args.callBack(value);
|
|
2231
2232
|
};
|
|
2233
|
+
RichTextEditor.prototype.addAnchorAriaLabel = function (value) {
|
|
2234
|
+
var valueElementWrapper = document.createElement("div");
|
|
2235
|
+
valueElementWrapper.innerHTML = value;
|
|
2236
|
+
var item = valueElementWrapper.querySelectorAll("a");
|
|
2237
|
+
if (item.length > 0) {
|
|
2238
|
+
for (var i = 0; i < item.length; i++) {
|
|
2239
|
+
(item[i].hasAttribute("target") && item[i].getAttribute("target") === '_blank') ? item[i].setAttribute("aria-label", this.serviceLocator.getService('rteLocale').getConstant("linkAriaLabel")) : item[i];
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
return valueElementWrapper.innerHTML;
|
|
2243
|
+
};
|
|
2232
2244
|
RichTextEditor.prototype.removeResizeElement = function (value) {
|
|
2233
2245
|
var valueElementWrapper = document.createElement("div");
|
|
2234
2246
|
valueElementWrapper.innerHTML = value;
|
|
@@ -2491,6 +2503,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2491
2503
|
}
|
|
2492
2504
|
EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
|
|
2493
2505
|
EventHandler.add(this.inputElement, 'paste', this.onPaste, this);
|
|
2506
|
+
EventHandler.add(this.inputElement, 'content-changed', this.contentChanged, this);
|
|
2494
2507
|
EventHandler.add(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30), this);
|
|
2495
2508
|
EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
|
|
2496
2509
|
this.wireContextEvent();
|
|
@@ -2553,6 +2566,7 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2553
2566
|
}
|
|
2554
2567
|
EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
|
|
2555
2568
|
EventHandler.remove(this.inputElement, 'paste', this.onPaste);
|
|
2569
|
+
EventHandler.remove(this.inputElement, 'content-changed', this.contentChanged);
|
|
2556
2570
|
EventHandler.remove(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30));
|
|
2557
2571
|
EventHandler.remove(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler);
|
|
2558
2572
|
this.unWireContextEvent();
|
|
@@ -243,7 +243,7 @@ var ToolbarRenderer = /** @class */ (function () {
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
//Formats preselect
|
|
246
|
-
if (args.items[0].command === 'Formats') {
|
|
246
|
+
if (args.items[0].command === 'Formats' || args.items[0].command === 'Font') {
|
|
247
247
|
for (var index = 0; index < args.element.childNodes.length; index++) {
|
|
248
248
|
var divNode = _this.parent.createElement('div');
|
|
249
249
|
divNode.innerHTML = dropDown.content.trim();
|