@syncfusion/ej2-richtexteditor 20.4.51 → 20.4.53
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 +34 -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 +149 -50
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +147 -48
- 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 +10 -10
- package/src/common/util.d.ts +1 -1
- package/src/common/util.js +14 -6
- package/src/editor-manager/base/editor-manager.js +1 -1
- package/src/editor-manager/plugin/inserthtml-exec.js +1 -1
- package/src/editor-manager/plugin/inserthtml.d.ts +1 -1
- package/src/editor-manager/plugin/inserthtml.js +14 -8
- package/src/editor-manager/plugin/ms-word-clean-up.js +58 -17
- package/src/editor-manager/plugin/toolbar-status.js +6 -2
- package/src/rich-text-editor/actions/enter-key.js +22 -3
- package/src/rich-text-editor/actions/paste-clean-up.js +2 -2
- package/src/rich-text-editor/actions/quick-toolbar.js +8 -1
- package/src/rich-text-editor/actions/toolbar.js +5 -0
- package/src/rich-text-editor/base/rich-text-editor.js +10 -3
- package/src/rich-text-editor/renderer/table-module.js +6 -4
- package/GitLeaksReport.json +0 -1
- package/gitleaks-ci/gitleaks +0 -0
- package/gitleaks-ci.tar.gz +0 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.4.
|
|
3
|
+
* version : 20.4.53
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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@20.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-richtexteditor@20.4.52",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-Mg2VkXybrYH8X66JfToNaI+wM7pqjImBAkkKYRLG1Cix+N24h0/dlXUJR3/OusAtfmYwseTA/cF6y1Jp0CD3Aw==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-richtexteditor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"/@syncfusion/ej2-react-richtexteditor",
|
|
27
27
|
"/@syncfusion/ej2-vue-richtexteditor"
|
|
28
28
|
],
|
|
29
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.4.
|
|
30
|
-
"_shasum": "
|
|
29
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.4.52.tgz",
|
|
30
|
+
"_shasum": "ad7fd58a9318984a86fe76d55bf24343fddec291",
|
|
31
31
|
"_spec": "@syncfusion/ej2-richtexteditor@*",
|
|
32
32
|
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
|
33
33
|
"author": {
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"bundleDependencies": false,
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@syncfusion/ej2-base": "~20.4.51",
|
|
42
|
-
"@syncfusion/ej2-buttons": "~20.4.
|
|
43
|
-
"@syncfusion/ej2-filemanager": "~20.4.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~20.4.
|
|
45
|
-
"@syncfusion/ej2-navigations": "~20.4.
|
|
46
|
-
"@syncfusion/ej2-popups": "~20.4.
|
|
42
|
+
"@syncfusion/ej2-buttons": "~20.4.53",
|
|
43
|
+
"@syncfusion/ej2-filemanager": "~20.4.53",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~20.4.52",
|
|
45
|
+
"@syncfusion/ej2-navigations": "~20.4.53",
|
|
46
|
+
"@syncfusion/ej2-popups": "~20.4.53",
|
|
47
47
|
"@syncfusion/ej2-splitbuttons": "~20.4.50"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
71
71
|
},
|
|
72
72
|
"typings": "index.d.ts",
|
|
73
|
-
"version": "20.4.
|
|
73
|
+
"version": "20.4.53",
|
|
74
74
|
"sideEffects": false
|
|
75
75
|
}
|
package/src/common/util.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare function setEditFrameFocus(editableElement: Element, selector: st
|
|
|
16
16
|
* @returns {void}
|
|
17
17
|
* @hidden
|
|
18
18
|
*/
|
|
19
|
-
export declare function updateTextNode(value: string): string;
|
|
19
|
+
export declare function updateTextNode(value: string, enterAction?: string): string;
|
|
20
20
|
/**
|
|
21
21
|
* @param {Node} startChildNodes - specifies the node
|
|
22
22
|
* @returns {void}
|
package/src/common/util.js
CHANGED
|
@@ -37,7 +37,7 @@ export function setEditFrameFocus(editableElement, selector) {
|
|
|
37
37
|
* @returns {void}
|
|
38
38
|
* @hidden
|
|
39
39
|
*/
|
|
40
|
-
export function updateTextNode(value) {
|
|
40
|
+
export function updateTextNode(value, enterAction) {
|
|
41
41
|
var tempNode = document.createElement('div');
|
|
42
42
|
tempNode.innerHTML = value;
|
|
43
43
|
tempNode.setAttribute('class', 'tempDiv');
|
|
@@ -52,15 +52,23 @@ export function updateTextNode(value) {
|
|
|
52
52
|
(tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
|
|
53
53
|
inlineNode.indexOf(tempNode.firstChild.nodeName.toLocaleLowerCase()) >= 0) {
|
|
54
54
|
if (!isPreviousInlineElem) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
if (enterAction === 'BR') {
|
|
56
|
+
resultElm.appendChild(tempNode.firstChild);
|
|
57
|
+
previousParent = resultElm;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
paraElm = createElement('p');
|
|
61
|
+
resultElm.appendChild(paraElm);
|
|
62
|
+
paraElm.appendChild(tempNode.firstChild);
|
|
63
|
+
previousParent = paraElm;
|
|
64
|
+
isPreviousInlineElem = true;
|
|
65
|
+
}
|
|
58
66
|
}
|
|
59
67
|
else {
|
|
60
68
|
previousParent.appendChild(tempNode.firstChild);
|
|
69
|
+
previousParent = paraElm;
|
|
70
|
+
isPreviousInlineElem = true;
|
|
61
71
|
}
|
|
62
|
-
previousParent = paraElm;
|
|
63
|
-
isPreviousInlineElem = true;
|
|
64
72
|
}
|
|
65
73
|
else if (tempNode.firstChild.nodeName === '#text' && (tempNode.firstChild.textContent === '\n' ||
|
|
66
74
|
(tempNode.firstChild.textContent.indexOf('\n') >= 0 && tempNode.firstChild.textContent.trim() === ''))) {
|
|
@@ -188,7 +188,7 @@ var EditorManager = /** @class */ (function () {
|
|
|
188
188
|
this.observer.notify(CONSTANT.SELECTION_TYPE, { subCommand: value, event: event, callBack: callBack, value: text, selector: selector, enterAction: enterAction });
|
|
189
189
|
break;
|
|
190
190
|
case 'inserthtml':
|
|
191
|
-
this.observer.notify(CONSTANT.INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
191
|
+
this.observer.notify(CONSTANT.INSERTHTML_TYPE, { subCommand: value, callBack: callBack, value: text, enterAction: enterAction });
|
|
192
192
|
break;
|
|
193
193
|
case 'inserttext':
|
|
194
194
|
this.observer.notify(CONSTANT.INSERT_TEXT_TYPE, { subCommand: value, callBack: callBack, value: text });
|
|
@@ -22,7 +22,7 @@ var InsertHtmlExec = /** @class */ (function () {
|
|
|
22
22
|
this.parent.observer.on(CONSTANT.INSERTHTML_TYPE, this.applyHtml, this);
|
|
23
23
|
};
|
|
24
24
|
InsertHtmlExec.prototype.applyHtml = function (e) {
|
|
25
|
-
InsertHtml.Insert(this.parent.currentDocument, e.value, this.parent.editableElement, true);
|
|
25
|
+
InsertHtml.Insert(this.parent.currentDocument, e.value, this.parent.editableElement, true, e.enterAction);
|
|
26
26
|
if (e.subCommand === 'pasteCleanup') {
|
|
27
27
|
var pastedElements = this.parent.editableElement.querySelectorAll('.pasteContent_RTE');
|
|
28
28
|
var allPastedElements = [].slice.call(pastedElements);
|
|
@@ -13,7 +13,7 @@ export declare class InsertHtml {
|
|
|
13
13
|
*/
|
|
14
14
|
static inlineNode: string[];
|
|
15
15
|
static contentsDeleted: boolean;
|
|
16
|
-
static Insert(docElement: Document, insertNode: Node | string, editNode?: Element, isExternal?: boolean): void;
|
|
16
|
+
static Insert(docElement: Document, insertNode: Node | string, editNode?: Element, isExternal?: boolean, enterAction?: string): void;
|
|
17
17
|
private static pasteInsertHTML;
|
|
18
18
|
private static placeCursorEnd;
|
|
19
19
|
private static getNodeCollection;
|
|
@@ -13,7 +13,7 @@ import { updateTextNode } from './../../common/util';
|
|
|
13
13
|
var InsertHtml = /** @class */ (function () {
|
|
14
14
|
function InsertHtml() {
|
|
15
15
|
}
|
|
16
|
-
InsertHtml.Insert = function (docElement, insertNode, editNode, isExternal) {
|
|
16
|
+
InsertHtml.Insert = function (docElement, insertNode, editNode, isExternal, enterAction) {
|
|
17
17
|
var node;
|
|
18
18
|
if (typeof insertNode === 'string') {
|
|
19
19
|
var divNode = document.createElement('div');
|
|
@@ -35,7 +35,8 @@ var InsertHtml = /** @class */ (function () {
|
|
|
35
35
|
var nodeCutter = new NodeCutter();
|
|
36
36
|
var range = nodeSelection.getRange(docElement);
|
|
37
37
|
if (range.startContainer === editNode && range.startContainer === range.endContainer && range.startOffset === 0 &&
|
|
38
|
-
range.startOffset === range.endOffset && editNode.textContent.length === 0 &&
|
|
38
|
+
range.startOffset === range.endOffset && editNode.textContent.length === 0 &&
|
|
39
|
+
(editNode.children[0].tagName === 'P' || (editNode.children[0].tagName === 'BR'))) {
|
|
39
40
|
nodeSelection.setSelectionText(docElement, range.startContainer.children[0], range.startContainer.children[0], 0, 0);
|
|
40
41
|
range = nodeSelection.getRange(docElement);
|
|
41
42
|
}
|
|
@@ -52,7 +53,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
52
53
|
var closestParentNode = (node.nodeName.toLowerCase() === 'table') ? this.closestEle(nodes[0].parentNode, editNode) : nodes[0];
|
|
53
54
|
if (isExternal || (!isNOU(node) && !isNOU(node.classList) &&
|
|
54
55
|
node.classList.contains('pasteContent'))) {
|
|
55
|
-
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode);
|
|
56
|
+
this.pasteInsertHTML(nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction);
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
59
|
if (editNode !== range.startContainer && ((!isCollapsed && !(closestParentNode.nodeType === Node.ELEMENT_NODE &&
|
|
@@ -166,7 +167,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
169
|
};
|
|
169
|
-
InsertHtml.pasteInsertHTML = function (nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode) {
|
|
170
|
+
InsertHtml.pasteInsertHTML = function (nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction) {
|
|
170
171
|
var isCursor = range.startOffset === range.endOffset &&
|
|
171
172
|
range.startContainer === range.endContainer;
|
|
172
173
|
if (isCursor && range.startContainer === editNode && editNode.textContent === '') {
|
|
@@ -276,7 +277,12 @@ var InsertHtml = /** @class */ (function () {
|
|
|
276
277
|
var firstParaElm = createElement('p');
|
|
277
278
|
node.parentElement.insertBefore(firstParaElm, node);
|
|
278
279
|
}
|
|
279
|
-
node.previousElementSibling.
|
|
280
|
+
if (node.previousElementSibling.nodeName === 'BR') {
|
|
281
|
+
node.parentElement.insertBefore(node.firstChild, node);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
node.previousElementSibling.appendChild(node.firstChild);
|
|
285
|
+
}
|
|
280
286
|
}
|
|
281
287
|
else {
|
|
282
288
|
lastSelectionNode = node.firstChild;
|
|
@@ -308,7 +314,7 @@ var InsertHtml = /** @class */ (function () {
|
|
|
308
314
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
309
315
|
}
|
|
310
316
|
else {
|
|
311
|
-
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
317
|
+
this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
|
|
312
318
|
}
|
|
313
319
|
};
|
|
314
320
|
InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
@@ -423,9 +429,9 @@ var InsertHtml = /** @class */ (function () {
|
|
|
423
429
|
}
|
|
424
430
|
}
|
|
425
431
|
};
|
|
426
|
-
InsertHtml.cursorPos = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
|
|
432
|
+
InsertHtml.cursorPos = function (lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction) {
|
|
427
433
|
lastSelectionNode.classList.add('lastNode');
|
|
428
|
-
editNode.innerHTML = updateTextNode(editNode.innerHTML);
|
|
434
|
+
editNode.innerHTML = updateTextNode(editNode.innerHTML, enterAction);
|
|
429
435
|
lastSelectionNode = editNode.querySelector('.lastNode');
|
|
430
436
|
if (!isNOU(lastSelectionNode)) {
|
|
431
437
|
this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
|
|
@@ -120,7 +120,10 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
120
120
|
this.checkVShape(elm);
|
|
121
121
|
var imgElem = elm.querySelectorAll('img');
|
|
122
122
|
for (var i = 0; i < imgElem.length; i++) {
|
|
123
|
-
if (!isNOU(imgElem[i].getAttribute('v:shapes')) &&
|
|
123
|
+
if (!isNOU(imgElem[i].getAttribute('v:shapes')) &&
|
|
124
|
+
imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 &&
|
|
125
|
+
imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
|
|
126
|
+
imgElem[i].getAttribute('v:shapes').indexOf('Image') < 0) {
|
|
124
127
|
detach(imgElem[i]);
|
|
125
128
|
}
|
|
126
129
|
}
|
|
@@ -371,6 +374,29 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
371
374
|
}
|
|
372
375
|
fromClass = false;
|
|
373
376
|
}
|
|
377
|
+
var listClass = ['MsoListParagraphCxSpFirst', 'MsoListParagraphCxSpMiddle', 'MsoListParagraphCxSpLast'];
|
|
378
|
+
for (var i = 0; i < listClass.length; i++) {
|
|
379
|
+
if (keys.indexOf('li.' + listClass[i]) > -1) {
|
|
380
|
+
var olULElems = elm.querySelectorAll('ol.' + listClass[i] + ', ul.' + listClass[i]);
|
|
381
|
+
for (var j = 0; j < olULElems.length; j++) {
|
|
382
|
+
var styleProperty = olULElems[j].getAttribute('style');
|
|
383
|
+
if (!isNOU(styleProperty) && styleProperty.trim() !== '' && olULElems[j].style.marginLeft !== '') {
|
|
384
|
+
var valueSplit = values[keys.indexOf('li.' + listClass[i])].split(';');
|
|
385
|
+
for (var k = 0; k < valueSplit.length; k++) {
|
|
386
|
+
if ('margin-left'.indexOf(valueSplit[k].split(':')[0]) >= 0) {
|
|
387
|
+
if (!isNOU(valueSplit[k].split(':')[1]) &&
|
|
388
|
+
valueSplit[k].split(':')[1].indexOf('in') >= 0 &&
|
|
389
|
+
olULElems[j].style.marginLeft.indexOf('in') >= 0) {
|
|
390
|
+
var classStyle = parseFloat(valueSplit[k].split(':')[1].split('in')[0]);
|
|
391
|
+
var inlineStyle = parseFloat(olULElems[j].style.marginLeft.split('in')[0]);
|
|
392
|
+
olULElems[j].style.marginLeft = (inlineStyle - classStyle) + 'in';
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
374
400
|
}
|
|
375
401
|
};
|
|
376
402
|
MsWordPaste.prototype.filterStyles = function (elm, wordPasteStyleConfig) {
|
|
@@ -492,12 +518,13 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
492
518
|
var type = void 0;
|
|
493
519
|
var listStyleType = void 0;
|
|
494
520
|
var startAttr = void 0;
|
|
521
|
+
var styleMarginLeft = void 0;
|
|
495
522
|
if (!isNOU(this.listContents[0])) {
|
|
496
523
|
type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
|
|
497
524
|
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
498
|
-
if (type === 'ol' && listNodes[i - 1] === null) {
|
|
525
|
+
if (type === 'ol' && (i === 0 || listNodes[i - 1] === null)) {
|
|
499
526
|
var startString = this.listContents[0].split('.')[0];
|
|
500
|
-
var listTypes = ['A', 'a', 'I', 'i', 'α', '1'];
|
|
527
|
+
var listTypes = ['A', 'a', 'I', 'i', 'α', '1', '1-']; // Add '1-' for rare list type.
|
|
501
528
|
if (listTypes.indexOf(startString) === -1) {
|
|
502
529
|
if (listStyleType === 'decimal') {
|
|
503
530
|
// Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
|
|
@@ -505,9 +532,15 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
505
532
|
startAttr = parseInt(startString);
|
|
506
533
|
}
|
|
507
534
|
}
|
|
508
|
-
else if (listStyleType === 'upper-alpha'
|
|
509
|
-
startAttr =
|
|
535
|
+
else if (listStyleType === 'upper-alpha') {
|
|
536
|
+
startAttr = (startString.split('.')[0].charCodeAt(0) - 64);
|
|
510
537
|
}
|
|
538
|
+
else if (listStyleType === 'lower-alpha') {
|
|
539
|
+
startAttr = (startString.split('.')[0].charCodeAt(0) - 96);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
if (listNodes[i].style.marginLeft !== '') {
|
|
543
|
+
styleMarginLeft = listNodes[i].style.marginLeft;
|
|
511
544
|
}
|
|
512
545
|
}
|
|
513
546
|
var tempNode = [];
|
|
@@ -526,7 +559,7 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
526
559
|
}
|
|
527
560
|
}
|
|
528
561
|
collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
529
|
-
listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr });
|
|
562
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr, styleMarginLeft: styleMarginLeft });
|
|
530
563
|
}
|
|
531
564
|
}
|
|
532
565
|
stNode = listNodes.shift();
|
|
@@ -552,23 +585,30 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
552
585
|
};
|
|
553
586
|
MsWordPaste.prototype.getlistStyleType = function (listContent, type) {
|
|
554
587
|
var currentListClass;
|
|
588
|
+
var upperRomanNumber = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX',
|
|
589
|
+
'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX'];
|
|
590
|
+
var lowerRomanNumber = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix',
|
|
591
|
+
'x', 'xi', 'xii', 'xiii', 'xiv', 'xv', 'xvi', 'xvii', 'xviii', 'xix', 'xx'];
|
|
592
|
+
var lowerGreekNumber = ['α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ',
|
|
593
|
+
'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'];
|
|
555
594
|
if (type === 'ol') {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
break;
|
|
560
|
-
case 'a':
|
|
561
|
-
currentListClass = 'lower-alpha';
|
|
562
|
-
break;
|
|
563
|
-
case 'I':
|
|
595
|
+
var charCode = listContent.split('.')[0].charCodeAt(0);
|
|
596
|
+
switch (true) {
|
|
597
|
+
case upperRomanNumber.indexOf(listContent.split('.')[0]) > -1:
|
|
564
598
|
currentListClass = 'upper-roman';
|
|
565
599
|
break;
|
|
566
|
-
case '
|
|
600
|
+
case lowerRomanNumber.indexOf(listContent.split('.')[0]) > -1:
|
|
567
601
|
currentListClass = 'lower-roman';
|
|
568
602
|
break;
|
|
569
|
-
case '
|
|
603
|
+
case lowerGreekNumber.indexOf(listContent.split('.')[0]) > -1:
|
|
570
604
|
currentListClass = 'lower-greek';
|
|
571
605
|
break;
|
|
606
|
+
case (charCode > 64 && charCode < 91):
|
|
607
|
+
currentListClass = 'upper-alpha';
|
|
608
|
+
break;
|
|
609
|
+
case (charCode > 96 && charCode < 123):
|
|
610
|
+
currentListClass = 'lower-alpha';
|
|
611
|
+
break;
|
|
572
612
|
default:
|
|
573
613
|
currentListClass = 'decimal';
|
|
574
614
|
break;
|
|
@@ -600,11 +640,12 @@ var MsWordPaste = /** @class */ (function () {
|
|
|
600
640
|
var pElement = createElement('p');
|
|
601
641
|
pElement.innerHTML = collection[index].content.join(' ');
|
|
602
642
|
if ((collection[index].nestedLevel === 1) && listCount === 0 && collection[index].content) {
|
|
603
|
-
root.appendChild(temp = createElement(collection[index].listType));
|
|
643
|
+
root.appendChild(temp = createElement(collection[index].listType, { className: collection[index].class }));
|
|
604
644
|
prevList = createElement('li');
|
|
605
645
|
prevList.appendChild(pElement);
|
|
606
646
|
temp.appendChild(prevList);
|
|
607
647
|
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
648
|
+
temp.style.marginLeft = collection[index].styleMarginLeft;
|
|
608
649
|
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
609
650
|
}
|
|
610
651
|
else if (collection[index].nestedLevel === pLevel) {
|
|
@@ -156,7 +156,7 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
156
156
|
formatCollection.fontname = this.isFontName(docElement, node, fontName);
|
|
157
157
|
}
|
|
158
158
|
if (!formatCollection.fontsize) {
|
|
159
|
-
formatCollection.fontsize = this.isFontSize(node, fontSize);
|
|
159
|
+
formatCollection.fontsize = this.isFontSize(docElement, node, fontSize);
|
|
160
160
|
}
|
|
161
161
|
if (!formatCollection.backgroundcolor) {
|
|
162
162
|
formatCollection.backgroundcolor = this.isBackgroundColor(node);
|
|
@@ -216,8 +216,12 @@ var ToolbarStatus = /** @class */ (function () {
|
|
|
216
216
|
return null;
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
|
-
ToolbarStatus.isFontSize = function (node, fontSize) {
|
|
219
|
+
ToolbarStatus.isFontSize = function (docElement, node, fontSize) {
|
|
220
220
|
var size = node.style && node.style.fontSize;
|
|
221
|
+
if ((size === null || size === undefined || size === '') && node.nodeType !== 3 &&
|
|
222
|
+
node.parentElement.classList.contains('e-content')) {
|
|
223
|
+
size = this.getComputedStyle(docElement, node, 'font-size');
|
|
224
|
+
}
|
|
221
225
|
if ((size !== null && size !== '' && size !== undefined)
|
|
222
226
|
&& (fontSize === null || fontSize === undefined || (fontSize.indexOf(size) > -1))) {
|
|
223
227
|
return size;
|
|
@@ -123,7 +123,16 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
123
123
|
_this.parent.tableModule.removeResizeElement();
|
|
124
124
|
}
|
|
125
125
|
if (!(_this.parent.inputElement.childNodes.length === 1 && _this.parent.inputElement.childNodes[0].nodeName === 'TABLE')) {
|
|
126
|
-
|
|
126
|
+
if (isNOU(_this.range.startContainer.childNodes[_this.range.startOffset])) {
|
|
127
|
+
var currentLastElem = _this.range.startContainer.childNodes[_this.range.startOffset - 1];
|
|
128
|
+
while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
|
|
129
|
+
currentLastElem = currentLastElem.lastChild;
|
|
130
|
+
}
|
|
131
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), currentLastElem, (currentLastElem.nodeName === 'BR' ? 0 : currentLastElem.textContent.length));
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
_this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.range.startContainer.childNodes[_this.range.startOffset], 0);
|
|
135
|
+
}
|
|
127
136
|
}
|
|
128
137
|
_this.getRangeNode();
|
|
129
138
|
}
|
|
@@ -340,15 +349,19 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
340
349
|
_this.removeBRElement(currentParent);
|
|
341
350
|
var isEmptyBrInserted = false;
|
|
342
351
|
var currentParentLastChild = currentParent.lastChild;
|
|
343
|
-
while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR'
|
|
352
|
+
while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text' || currentParentLastChild.nodeName === 'BR'
|
|
353
|
+
|| currentParentLastChild.nodeName === 'IMG')) {
|
|
344
354
|
currentParentLastChild = currentParentLastChild.lastChild;
|
|
345
355
|
}
|
|
346
356
|
var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
|
|
347
357
|
_this.range.startContainer.textContent.length : currentParent.textContent.length;
|
|
358
|
+
var isImageElement = (_this.range.startContainer.nodeName === 'IMG' || (_this.range.startContainer.childNodes.length > 0
|
|
359
|
+
&& _this.range.startContainer.childNodes[_this.range.startOffset].nodeName === 'IMG'));
|
|
348
360
|
if (currentParent !== _this.parent.inputElement &&
|
|
349
361
|
_this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
|
|
350
362
|
_this.range.startOffset === _this.range.endOffset &&
|
|
351
|
-
_this.range.startOffset === isLastNodeLength
|
|
363
|
+
(_this.range.startOffset === isLastNodeLength ||
|
|
364
|
+
(currentParent.textContent.trim().length === 0 && isImageElement))) {
|
|
352
365
|
var focusBRElem = _this.parent.createElement('br');
|
|
353
366
|
if (_this.range.startOffset === 0 && _this.range.startContainer.nodeName === 'TABLE') {
|
|
354
367
|
_this.range.startContainer.parentElement.insertBefore(focusBRElem, _this.range.startContainer);
|
|
@@ -357,6 +370,12 @@ var EnterKeyAction = /** @class */ (function () {
|
|
|
357
370
|
if (currentParentLastChild.nodeName === 'BR' && currentParent.textContent.length === 0) {
|
|
358
371
|
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, currentParentLastChild);
|
|
359
372
|
}
|
|
373
|
+
else if (_this.range.startOffset === 0 && _this.range.endOffset === 0 && isImageElement) {
|
|
374
|
+
var imageElement = _this.range.startContainer.nodeName === 'IMG' ? _this.range.startContainer :
|
|
375
|
+
_this.range.startContainer.childNodes[_this.range.startOffset];
|
|
376
|
+
currentParent.insertBefore(focusBRElem, imageElement);
|
|
377
|
+
focusBRElem = imageElement;
|
|
378
|
+
}
|
|
360
379
|
else {
|
|
361
380
|
var lineBreakBRElem = _this.parent.createElement('br');
|
|
362
381
|
_this.parent.formatter.editorManager.domNode.insertAfter(focusBRElem, _this.range.startContainer);
|
|
@@ -651,7 +651,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
651
651
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
652
652
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
653
653
|
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
654
|
-
}, clipBoardElem);
|
|
654
|
+
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
655
655
|
this.removeTempClass();
|
|
656
656
|
this.parent.notify(events.toolbarRefresh, {});
|
|
657
657
|
this.imgUploading(this.parent.inputElement);
|
|
@@ -721,7 +721,7 @@ var PasteCleanup = /** @class */ (function () {
|
|
|
721
721
|
this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
|
|
722
722
|
extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
|
|
723
723
|
_this.parent.formatter.onSuccess(_this.parent, args);
|
|
724
|
-
}, clipBoardElem);
|
|
724
|
+
}, clipBoardElem, null, null, this.parent.enterKey);
|
|
725
725
|
this.removeTempClass();
|
|
726
726
|
}
|
|
727
727
|
else {
|
|
@@ -250,10 +250,17 @@ var QuickToolbar = /** @class */ (function () {
|
|
|
250
250
|
};
|
|
251
251
|
QuickToolbar.prototype.keyUpHandler = function (e) {
|
|
252
252
|
if (this.parent.inlineMode.enable && !Browser.isDevice) {
|
|
253
|
+
var args = e.args;
|
|
253
254
|
if (this.parent.inlineMode.onSelection) {
|
|
255
|
+
if (this.parent.getSelection().length > 0) {
|
|
256
|
+
if ((args.ctrlKey && args.keyCode === 65) || (args.shiftKey && (args.keyCode === 33 || args.keyCode === 34 ||
|
|
257
|
+
args.keyCode === 35 || args.keyCode === 36 || args.keyCode === 37 || args.keyCode === 38 ||
|
|
258
|
+
args.keyCode === 39 || args.keyCode === 40))) {
|
|
259
|
+
this.showInlineQTBar(this.offsetX, this.offsetY, args.target);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
254
262
|
return;
|
|
255
263
|
}
|
|
256
|
-
var args = e.args;
|
|
257
264
|
this.deBounce(this.offsetX, this.offsetY, args.target);
|
|
258
265
|
}
|
|
259
266
|
};
|
|
@@ -557,6 +557,11 @@ var Toolbar = /** @class */ (function () {
|
|
|
557
557
|
Toolbar.prototype.toolbarClickHandler = function (e) {
|
|
558
558
|
var trg = closest(e.originalEvent.target, '.e-hor-nav');
|
|
559
559
|
if (trg && this.parent.toolbarSettings.type === ToolbarType.Expand && !isNOU(trg)) {
|
|
560
|
+
var extendedTbar = this.tbElement.querySelector('.e-toolbar-extended');
|
|
561
|
+
if (!isNOU(extendedTbar)) {
|
|
562
|
+
setStyleAttribute(extendedTbar, { maxHeight: '', display: 'block' });
|
|
563
|
+
setStyleAttribute(extendedTbar, { maxHeight: extendedTbar.offsetHeight + 'px', display: '' });
|
|
564
|
+
}
|
|
560
565
|
if (!trg.classList.contains('e-nav-active')) {
|
|
561
566
|
removeClass([this.tbElement], [classes.CLS_EXPAND_OPEN]);
|
|
562
567
|
this.parent.setContentHeight('toolbar', false);
|
|
@@ -628,15 +628,16 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
628
628
|
var currentEndContainer = range.endContainer;
|
|
629
629
|
var currentStartOffset = range.startOffset;
|
|
630
630
|
var isSameContainer = currentStartContainer === currentEndContainer ? true : false;
|
|
631
|
-
var currentEndOffset = currentEndContainer.textContent.length;
|
|
632
631
|
var endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
|
|
633
632
|
range.endContainer;
|
|
634
633
|
var closestLI = closest(endNode, 'LI');
|
|
634
|
+
var isDetached = false;
|
|
635
635
|
if (!isNOU(closestLI) && endNode.textContent.length === range.endOffset &&
|
|
636
636
|
!range.collapsed && isNOU(endNode.nextElementSibling)) {
|
|
637
637
|
for (var i = 0; i < closestLI.childNodes.length; i++) {
|
|
638
638
|
if (closestLI.childNodes[i].nodeName === '#text' && closestLI.childNodes[i].textContent.trim().length === 0) {
|
|
639
639
|
detach(closestLI.childNodes[i]);
|
|
640
|
+
isDetached = true;
|
|
640
641
|
i--;
|
|
641
642
|
}
|
|
642
643
|
}
|
|
@@ -644,7 +645,11 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
644
645
|
while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
|
|
645
646
|
currentLastElem = currentLastElem.lastChild;
|
|
646
647
|
}
|
|
647
|
-
|
|
648
|
+
if (isDetached) {
|
|
649
|
+
var currentLast = currentLastElem.nodeName === 'BR' && !isNOU(currentLastElem.previousSibling) ?
|
|
650
|
+
currentLastElem.previousSibling : currentLastElem;
|
|
651
|
+
this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? currentLast : currentStartContainer, currentLast, currentStartOffset, (currentLast.nodeName === 'BR' ? 0 : currentLast.textContent.length));
|
|
652
|
+
}
|
|
648
653
|
}
|
|
649
654
|
};
|
|
650
655
|
/**
|
|
@@ -2004,7 +2009,9 @@ var RichTextEditor = /** @class */ (function (_super) {
|
|
|
2004
2009
|
this.notify(events.windowResize, null);
|
|
2005
2010
|
};
|
|
2006
2011
|
RichTextEditor.prototype.scrollHandler = function (e) {
|
|
2007
|
-
this.
|
|
2012
|
+
if (this.element) {
|
|
2013
|
+
this.notify(events.scroll, { args: e });
|
|
2014
|
+
}
|
|
2008
2015
|
};
|
|
2009
2016
|
RichTextEditor.prototype.contentScrollHandler = function (e) {
|
|
2010
2017
|
this.notify(events.contentscroll, { args: e });
|
|
@@ -916,12 +916,14 @@ var Table = /** @class */ (function () {
|
|
|
916
916
|
if ((totalwid - actualwid) > 20 && actualwid > 20) {
|
|
917
917
|
var leftColumnWidth = totalwid - actualwid;
|
|
918
918
|
var rightColWidth = actualwid;
|
|
919
|
-
|
|
920
|
-
_this.curTable.rows[i].cells[
|
|
919
|
+
var index = _this.curTable.rows[i].cells[i].hasAttribute('colspan') ?
|
|
920
|
+
parseInt(_this.curTable.rows[i].cells[i].getAttribute('colspan'), 10) - 1 : _this.colIndex;
|
|
921
|
+
if (!isNOU(_this.curTable.rows[i].cells[index - 1])) {
|
|
922
|
+
_this.curTable.rows[i].cells[index - 1].style.width =
|
|
921
923
|
_this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
|
|
922
924
|
}
|
|
923
|
-
if (!isNOU(_this.curTable.rows[i].cells[
|
|
924
|
-
_this.curTable.rows[i].cells[
|
|
925
|
+
if (!isNOU(_this.curTable.rows[i].cells[index])) {
|
|
926
|
+
_this.curTable.rows[i].cells[index].style.width =
|
|
925
927
|
_this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
|
|
926
928
|
}
|
|
927
929
|
}
|
package/GitLeaksReport.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[]
|
package/gitleaks-ci/gitleaks
DELETED
|
Binary file
|
package/gitleaks-ci.tar.gz
DELETED
|
Binary file
|