devexpress-richedit 24.1.4-build-24186-1015 → 24.1.5-build-24204-0102
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/bin/gulpfile.js +1 -1
- package/bin/index-custom.js +1 -1
- package/bin/localization-builder.js +1 -1
- package/bin/nspell-index.js +1 -1
- package/bin/nspell.webpack.config.js +1 -1
- package/bin/webpack-externals.js +1 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.d.ts +1 -1
- package/dist/dx.richedit.js +106 -77
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/client-rich-edit.js +2 -2
- package/lib/common/formats/html/import/html-importer.d.ts +9 -4
- package/lib/common/formats/html/import/html-importer.js +27 -15
- package/lib/common/formats/html/import/importers/a.d.ts +1 -1
- package/lib/common/formats/html/import/importers/a.js +1 -1
- package/lib/common/formats/html/import/importers/b.d.ts +1 -1
- package/lib/common/formats/html/import/importers/b.js +1 -1
- package/lib/common/formats/html/import/importers/base.d.ts +2 -1
- package/lib/common/formats/html/import/importers/base.js +1 -0
- package/lib/common/formats/html/import/importers/br.d.ts +1 -1
- package/lib/common/formats/html/import/importers/br.js +1 -1
- package/lib/common/formats/html/import/importers/center.d.ts +1 -1
- package/lib/common/formats/html/import/importers/center.js +1 -1
- package/lib/common/formats/html/import/importers/cite.d.ts +1 -1
- package/lib/common/formats/html/import/importers/cite.js +1 -1
- package/lib/common/formats/html/import/importers/div.d.ts +1 -1
- package/lib/common/formats/html/import/importers/div.js +3 -3
- package/lib/common/formats/html/import/importers/em.d.ts +1 -1
- package/lib/common/formats/html/import/importers/em.js +1 -1
- package/lib/common/formats/html/import/importers/font.d.ts +1 -1
- package/lib/common/formats/html/import/importers/font.js +1 -1
- package/lib/common/formats/html/import/importers/i.d.ts +1 -1
- package/lib/common/formats/html/import/importers/i.js +1 -1
- package/lib/common/formats/html/import/importers/img.d.ts +1 -1
- package/lib/common/formats/html/import/importers/img.js +1 -1
- package/lib/common/formats/html/import/importers/li.d.ts +2 -1
- package/lib/common/formats/html/import/importers/li.js +13 -10
- package/lib/common/formats/html/import/importers/list-base.d.ts +1 -1
- package/lib/common/formats/html/import/importers/list-base.js +2 -1
- package/lib/common/formats/html/import/importers/p.d.ts +3 -3
- package/lib/common/formats/html/import/importers/p.js +19 -16
- package/lib/common/formats/html/import/importers/pre.d.ts +1 -1
- package/lib/common/formats/html/import/importers/pre.js +1 -1
- package/lib/common/formats/html/import/importers/span.d.ts +1 -1
- package/lib/common/formats/html/import/importers/span.js +1 -1
- package/lib/common/formats/html/import/importers/table.d.ts +1 -1
- package/lib/common/formats/html/import/importers/table.js +2 -2
- package/lib/common/formats/html/import/importers/tbody.d.ts +1 -1
- package/lib/common/formats/html/import/importers/tbody.js +1 -1
- package/lib/common/formats/html/import/importers/td.d.ts +1 -1
- package/lib/common/formats/html/import/importers/td.js +2 -2
- package/lib/common/formats/html/import/importers/text-node.d.ts +1 -1
- package/lib/common/formats/html/import/importers/text-node.js +2 -2
- package/lib/common/formats/html/import/importers/tr.d.ts +1 -1
- package/lib/common/formats/html/import/importers/tr.js +1 -1
- package/lib/common/formats/html/import/importers/tt.d.ts +1 -1
- package/lib/common/formats/html/import/importers/tt.js +1 -1
- package/lib/common/formats/html/import/importers/undefined.d.ts +1 -1
- package/lib/common/formats/html/import/importers/undefined.js +2 -2
- package/lib/common/formats/html/import/utils/paragraph-list-properties-utils.js +13 -4
- package/lib/common/input-controller.d.ts +8 -8
- package/lib/common/input-controller.js +5 -5
- package/lib/common/rich-utils/html-utils.d.ts +1 -1
- package/package.json +3 -3
@@ -22,11 +22,11 @@ export class HtmlTableTagImporter extends HtmlTagImporterBase {
|
|
22
22
|
const lastTableInfo = ListUtils.last(this.importer.importedTablesInfo);
|
23
23
|
if (lastTableInfo && ListUtils.last(ListUtils.last(lastTableInfo.rows).cells).endPosition == this.importer.currPosition ||
|
24
24
|
!this.importer.prevRunIsParagraph)
|
25
|
-
this.importer.addParagraphRun(
|
25
|
+
this.importer.addParagraphRun(this.element);
|
26
26
|
ListUtils.last(this.importer.levelInfo).allowInsertRuns = false;
|
27
27
|
this.element.innerHTML = this.element.innerHTML.replace(/<td([^>]*mso-cell-special:\s*placeholder[^>]*)>[\s\S]*?<\/td>/gi, "<td$1></td>");
|
28
28
|
}
|
29
|
-
|
29
|
+
isImportChildren() {
|
30
30
|
return true;
|
31
31
|
}
|
32
32
|
importAfter() {
|
@@ -7,7 +7,7 @@ export declare class HtmlTdTagImporter extends HtmlTagImporterBase {
|
|
7
7
|
private rowImporter;
|
8
8
|
elementTag(): string;
|
9
9
|
importBefore(): void;
|
10
|
-
|
10
|
+
isImportChildren(): boolean;
|
11
11
|
importAfter(): void;
|
12
12
|
static addVerticalMergedCells(importer: HtmlImporter, tableImporter: HtmlTableTagImporter, rowImporter: HtmlTrTagImporter): void;
|
13
13
|
private setBackgroungColor;
|
@@ -26,7 +26,7 @@ export class HtmlTdTagImporter extends HtmlTagImporterBase {
|
|
26
26
|
HtmlTdTagImporter.addVerticalMergedCells(this.importer, this.getClosestImporterByTagName(HtmlTableTagImporter.tagName), this.rowImporter);
|
27
27
|
this.startPosition = this.importer.currPosition;
|
28
28
|
}
|
29
|
-
|
29
|
+
isImportChildren() {
|
30
30
|
return true;
|
31
31
|
}
|
32
32
|
importAfter() {
|
@@ -44,7 +44,7 @@ export class HtmlTdTagImporter extends HtmlTagImporterBase {
|
|
44
44
|
const lastImportedRun = this.importer.getLastImportedRun();
|
45
45
|
if (!lastImportedRun || !this.importer.prevRunIsParagraph ||
|
46
46
|
this.importer.currPosition - lastImportedRun.runLength < this.startPosition) {
|
47
|
-
this.importer.addParagraphRun(
|
47
|
+
this.importer.addParagraphRun(this.element, null, true);
|
48
48
|
}
|
49
49
|
this.rowImporter.cells.push(new ImportedTableCellInfo(preferredWidth, this.startPosition, this.importer.currPosition, columnSpan, rowSpan, props, true));
|
50
50
|
}
|
@@ -26,7 +26,7 @@ export class HtmlTextNodeImporter extends HtmlTagImporterBase {
|
|
26
26
|
this.addRun(new ImportedTextRunInfo(this.importer.modelManager.model, this.importer.measurer, lines[i], this.importer.htmlImporterMaskedCharacterProperties.getBundleFrom(this.element, new FixedInterval(this.importer.currPosition, lines[i].length))));
|
27
27
|
}
|
28
28
|
if (i < lines.length - 1)
|
29
|
-
this.importer.addParagraphRun(
|
29
|
+
this.importer.addParagraphRun(this.element.parentElement || this.element.parentNode);
|
30
30
|
}
|
31
31
|
}
|
32
32
|
else {
|
@@ -34,7 +34,7 @@ export class HtmlTextNodeImporter extends HtmlTagImporterBase {
|
|
34
34
|
}
|
35
35
|
}
|
36
36
|
}
|
37
|
-
|
37
|
+
isImportChildren() {
|
38
38
|
return false;
|
39
39
|
}
|
40
40
|
importAfter() {
|
@@ -11,7 +11,7 @@ export declare class HtmlTrTagImporter extends HtmlTagImporterBase {
|
|
11
11
|
private rowElement;
|
12
12
|
elementTag(): string;
|
13
13
|
importBefore(): void;
|
14
|
-
|
14
|
+
isImportChildren(): boolean;
|
15
15
|
importAfter(): void;
|
16
16
|
private static importGridBefore;
|
17
17
|
private static importGridAfter;
|
@@ -17,7 +17,7 @@ export class HtmlTrTagImporter extends HtmlTagImporterBase {
|
|
17
17
|
this.rowElement = this.element;
|
18
18
|
this.gridBeforeInfo = HtmlTrTagImporter.importGridBefore(this.rowElement);
|
19
19
|
}
|
20
|
-
|
20
|
+
isImportChildren() {
|
21
21
|
return true;
|
22
22
|
}
|
23
23
|
importAfter() {
|
@@ -8,8 +8,8 @@ export class HtmlUndefinedTagImporter extends HtmlTagImporterBase {
|
|
8
8
|
importBefore() {
|
9
9
|
Log.print(LogSource.HtmlImporter, "HtmlUndefinedTagImporter.importBefore undefined tag", this.element);
|
10
10
|
}
|
11
|
-
|
12
|
-
return !!this.importer.
|
11
|
+
isImportChildren() {
|
12
|
+
return !!this.importer.currElementChildren.length;
|
13
13
|
}
|
14
14
|
importAfter() {
|
15
15
|
}
|
@@ -51,13 +51,14 @@ export class ParagraphListPropertiesUtils {
|
|
51
51
|
return ListUtils.accumulate(lists, 0, (acc, list, index) => acc + (list == mainParentListElement ? index : 0));
|
52
52
|
}
|
53
53
|
importListLevelIndex() {
|
54
|
+
var _a;
|
54
55
|
if (this.msoListAttr && this.msoListAttr.length)
|
55
56
|
return parseInt(this.msoListAttr[0].replace(/mso-list:\s*\w*\s*level/gi, '')) - 1;
|
56
57
|
let listLevelIndex = 0;
|
57
|
-
let parentListItemElement =
|
58
|
+
let parentListItemElement = ParagraphListPropertiesUtils.getParentListElement((_a = this.parentListElement) === null || _a === void 0 ? void 0 : _a.parentElement);
|
58
59
|
while (parentListItemElement) {
|
59
60
|
listLevelIndex++;
|
60
|
-
parentListItemElement =
|
61
|
+
parentListItemElement = ParagraphListPropertiesUtils.getParentListElement(parentListItemElement === null || parentListItemElement === void 0 ? void 0 : parentListItemElement.parentElement);
|
61
62
|
}
|
62
63
|
return listLevelIndex;
|
63
64
|
}
|
@@ -129,8 +130,16 @@ export class ParagraphListPropertiesUtils {
|
|
129
130
|
static getListText(listTextElement) {
|
130
131
|
return listTextElement ? StringUtils.trim((listTextElement.nodeValue || DomUtils.getInnerText(listTextElement)).split(" ")[0]) : "";
|
131
132
|
}
|
132
|
-
static getParentListElement(
|
133
|
-
|
133
|
+
static getParentListElement(element) {
|
134
|
+
const targetElementTags = ['UL', 'OL'];
|
135
|
+
const exceptionElementTags = ['BODY', 'DIV', 'P'];
|
136
|
+
while (element = element === null || element === void 0 ? void 0 : element.parentElement) {
|
137
|
+
if (exceptionElementTags.includes(element.tagName))
|
138
|
+
return null;
|
139
|
+
if (targetElementTags.includes(element.tagName))
|
140
|
+
return element;
|
141
|
+
}
|
142
|
+
return null;
|
134
143
|
}
|
135
144
|
static removeSomeHtml(element, listTextElement, listText) {
|
136
145
|
if (element.childNodes.length == 1)
|
@@ -51,10 +51,10 @@ export declare abstract class InputEditorBase<TInpElement extends HTMLElement> {
|
|
51
51
|
getEditableTextOwner(): HTMLElement;
|
52
52
|
setPosition(left: number, top: number): void;
|
53
53
|
clearInputElement(): void;
|
54
|
-
setEditableDocumentContent(_content: string |
|
54
|
+
setEditableDocumentContent(_content: string | NodeListOf<ChildNode>): void;
|
55
55
|
setEditableDocumentCursorPosition(_cursorPosition: number): void;
|
56
56
|
selectEditableDocumentContent(): void;
|
57
|
-
getEditableDocumentContent(): string |
|
57
|
+
getEditableDocumentContent(): string | NodeListOf<ChildNode>;
|
58
58
|
abstract getEditableDocument(): HTMLElement | Document;
|
59
59
|
getNormalizedEvent(evt: Event): any;
|
60
60
|
recreateIfNeeded(): void;
|
@@ -85,11 +85,11 @@ export declare class DivInputEditor extends InputEditorBase<HTMLElement> {
|
|
85
85
|
captureFocus(): void;
|
86
86
|
getEditableDocument(): HTMLElement | Document;
|
87
87
|
clearInputElement(): void;
|
88
|
-
setEditableDocumentContent(content: string |
|
88
|
+
setEditableDocumentContent(content: string | NodeListOf<ChildNode>): void;
|
89
89
|
setEditableDocumentCursorPosition(cursorPosition: number): void;
|
90
90
|
getEditableDocumentText(): string;
|
91
91
|
getEditableDocumentFullText(): string;
|
92
|
-
getEditableDocumentContent(): string |
|
92
|
+
getEditableDocumentContent(): string | NodeListOf<ChildNode>;
|
93
93
|
getEditableDocumentCursorPosition(): number;
|
94
94
|
selectEditableDocumentContent(): void;
|
95
95
|
}
|
@@ -108,8 +108,8 @@ export declare class IFrameInputEditor extends InputEditorBase<HTMLIFrameElement
|
|
108
108
|
captureFocus(): void;
|
109
109
|
setPosition(left: number, top: number): void;
|
110
110
|
clearInputElement(): void;
|
111
|
-
setEditableDocumentContent(content: string |
|
112
|
-
getEditableDocumentContent(): string |
|
111
|
+
setEditableDocumentContent(content: string | NodeListOf<ChildNode>): void;
|
112
|
+
getEditableDocumentContent(): string | NodeListOf<ChildNode>;
|
113
113
|
selectEditableDocumentContent(): void;
|
114
114
|
getEditableDocument(): HTMLElement | Document;
|
115
115
|
getEditableTextOwner(): HTMLElement;
|
@@ -139,8 +139,8 @@ export declare class InputController {
|
|
139
139
|
setPosition(left: number, top: number): void;
|
140
140
|
renderSelectionToEditableDocument(): void;
|
141
141
|
static getCopyPasteHtmlContentForEditable(html: string | HtmlBuilder, guidLabel: string): HTMLElement;
|
142
|
-
setEditableDocumentContent(content: string |
|
142
|
+
setEditableDocumentContent(content: string | NodeListOf<ChildNode>): void;
|
143
143
|
setEditableDocumentCursorPosition(cursorPosition: number): void;
|
144
|
-
getEditableDocumentContent(): string |
|
144
|
+
getEditableDocumentContent(): string | NodeListOf<ChildNode>;
|
145
145
|
selectEditableDocumentContent(): void;
|
146
146
|
}
|
@@ -422,7 +422,7 @@ export class DivInputEditor extends InputEditorBase {
|
|
422
422
|
return super.getEditableDocumentText().replace(/\s/g, " ");
|
423
423
|
}
|
424
424
|
getEditableDocumentContent() {
|
425
|
-
const htmlItems = this.inputElement.cloneNode(true).
|
425
|
+
const htmlItems = this.inputElement.cloneNode(true).childNodes;
|
426
426
|
if (htmlItems.length)
|
427
427
|
return htmlItems;
|
428
428
|
return this.inputElement.innerText;
|
@@ -564,9 +564,9 @@ export class IFrameInputEditor extends InputEditorBase {
|
|
564
564
|
}
|
565
565
|
}
|
566
566
|
getEditableDocumentContent() {
|
567
|
-
const
|
568
|
-
if (
|
569
|
-
return
|
567
|
+
const items = this.editableDocument.body.cloneNode(true).childNodes;
|
568
|
+
if (items.length)
|
569
|
+
return items;
|
570
570
|
return this.editableDocument.body.innerText;
|
571
571
|
}
|
572
572
|
selectEditableDocumentContent() {
|
@@ -761,7 +761,7 @@ export class InputController {
|
|
761
761
|
else {
|
762
762
|
const _fragment = document.createDocumentFragment();
|
763
763
|
_fragment.appendChild(result);
|
764
|
-
this.setEditableDocumentContent(_fragment.
|
764
|
+
this.setEditableDocumentContent(_fragment.childNodes);
|
765
765
|
}
|
766
766
|
this.selectEditableDocumentContent();
|
767
767
|
}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { InputController } from "../input-controller";
|
2
|
-
export declare function getHTMLElementsFromHtml(inputController: InputController, html: string |
|
2
|
+
export declare function getHTMLElementsFromHtml(inputController: InputController, html: string | NodeListOf<ChildNode>): HTMLElement[];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "devexpress-richedit",
|
3
|
-
"version": "24.1.
|
3
|
+
"version": "24.1.5-build-24204-0102",
|
4
4
|
"homepage": "https://www.devexpress.com/",
|
5
5
|
"bugs": "https://www.devexpress.com/support/",
|
6
6
|
"author": "Developer Express Inc.",
|
@@ -14,8 +14,8 @@
|
|
14
14
|
"build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
|
15
15
|
},
|
16
16
|
"peerDependencies": {
|
17
|
-
"devextreme": "24.1.
|
18
|
-
"devextreme-dist": "24.1.
|
17
|
+
"devextreme": "24.1.5-build-24202-1936",
|
18
|
+
"devextreme-dist": "24.1.5-build-24202-1936"
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
21
|
"jszip": "~3.10.1",
|