devexpress-richedit 24.1.1-alpha-24085-0102 → 24.1.2-beta
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 +3 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.css +1 -0
- package/dist/dx.richedit.d.ts +17 -10
- package/dist/dx.richedit.js +52855 -51531
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/bars/ribbon.js +2 -1
- package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +2 -1
- package/lib/client/client-rich-edit.js +2 -1
- package/lib/client/commands/client-command-manager.js +2 -1
- package/lib/client/commands/commands.js +3 -0
- package/lib/client/commands/download-document-command.d.ts +3 -0
- package/lib/client/commands/download-document-command.js +13 -2
- package/lib/client/commands/export-document-command.js +4 -4
- package/lib/client/commands/mail-merge-command.js +7 -4
- package/lib/client/commands/open-document-command.d.ts +2 -1
- package/lib/client/commands/open-document-command.js +17 -12
- package/lib/client/default-localization.js +2 -1
- package/lib/client/dialogs/finish-and-merge-dialog.js +1 -0
- package/lib/client/document-processor/processor.d.ts +9 -2
- package/lib/client/document-processor/processor.js +18 -6
- package/lib/client/formats/docx/export/data.d.ts +4 -0
- package/lib/client/formats/docx/export/data.js +12 -0
- package/lib/client/formats/docx/export/exporter.d.ts +2 -0
- package/lib/client/formats/docx/export/exporter.js +15 -0
- package/lib/client/formats/docx/export/exporters/base/sections.js +5 -0
- package/lib/client/formats/docx/export/exporters/note-properties.d.ts +18 -0
- package/lib/client/formats/docx/export/exporters/note-properties.js +83 -0
- package/lib/client/formats/docx/export/exporters/settings.d.ts +2 -0
- package/lib/client/formats/docx/export/exporters/settings.js +11 -0
- package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.d.ts +15 -1
- package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.js +85 -3
- package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.d.ts +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.js +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/main-sub-document.d.ts +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/main-sub-document.js +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/note-sub-document-exporter.d.ts +37 -0
- package/lib/client/formats/docx/export/exporters/sub-document/note-sub-document-exporter.js +71 -0
- package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.d.ts +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.js +2 -2
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.d.ts +16 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.js +48 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.js +9 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnotes-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnotes-destination.js +39 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-properties-destination.d.ts +18 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-properties-destination.js +49 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.js +9 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnotes-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnotes-destination.js +39 -0
- package/lib/client/formats/docx/import/destination/notes/note-destination.d.ts +18 -0
- package/lib/client/formats/docx/import/destination/notes/note-destination.js +45 -0
- package/lib/client/formats/docx/import/destination/notes/note-properties-destination.d.ts +32 -0
- package/lib/client/formats/docx/import/destination/notes/note-properties-destination.js +81 -0
- package/lib/client/formats/docx/import/destination/notes/note-reference-destination.d.ts +8 -0
- package/lib/client/formats/docx/import/destination/notes/note-reference-destination.js +21 -0
- package/lib/client/formats/docx/import/destination/notes/note-self-reference-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/note-self-reference-destination.js +12 -0
- package/lib/client/formats/docx/import/destination/notes/note-separator-destination.d.ts +8 -0
- package/lib/client/formats/docx/import/destination/notes/note-separator-destination.js +20 -0
- package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-numbering-reference-destination.js +1 -1
- package/lib/client/formats/docx/import/destination/runs/run-destination.js +11 -5
- package/lib/client/formats/docx/import/destination/section/section-destination.js +5 -2
- package/lib/client/formats/docx/import/destination/settings/settings.js +4 -0
- package/lib/client/formats/docx/import/importer.d.ts +2 -0
- package/lib/client/formats/docx/import/importer.js +26 -0
- package/lib/client/formats/docx/import/importers/character-importer.d.ts +3 -0
- package/lib/client/formats/docx/import/importers/character-importer.js +12 -1
- package/lib/client/formats/docx/import/importers/end-notes-importer.d.ts +3 -4
- package/lib/client/formats/docx/import/importers/end-notes-importer.js +8 -3
- package/lib/client/formats/docx/import/importers/foot-notes-importer.d.ts +3 -5
- package/lib/client/formats/docx/import/importers/foot-notes-importer.js +8 -5
- package/lib/client/formats/docx/import/importers/notes-importer.d.ts +8 -0
- package/lib/client/formats/docx/import/importers/notes-importer.js +7 -0
- package/lib/client/formats/docx/translation-table/translation-tables.d.ts +7 -0
- package/lib/client/formats/docx/translation-table/translation-tables.js +27 -0
- package/lib/client/formats/docx/utils/constants.d.ts +2 -0
- package/lib/client/formats/docx/utils/constants.js +2 -0
- package/lib/client/model-api/formats/enum.d.ts +1 -0
- package/lib/client/model-api/formats/enum.js +1 -0
- package/lib/client/model-api/formats/exporter.d.ts +3 -4
- package/lib/client/model-api/formats/exporter.js +9 -6
- package/lib/client/model-api/formats/importer.js +2 -0
- package/lib/client/model-api/sub-document.d.ts +6 -2
- package/lib/client/model-api/sub-document.js +37 -35
- package/lib/client/model-api/table/table-borders.d.ts +1 -1
- package/lib/client/public/commands/enum.d.ts +1 -0
- package/lib/client/public/commands/enum.js +1 -0
- package/lib/client/public/document-processor.d.ts +3 -1
- package/lib/client/public/document-processor.js +2 -2
- package/lib/client/public/ribbon/item-ids.d.ts +1 -0
- package/lib/client/public/ribbon/item-ids.js +1 -0
- package/lib/client/public/rich-edit.d.ts +2 -1
- package/lib/client/public/rich-edit.js +16 -9
- package/lib/common/canvas/canvas-manager.js +2 -1
- package/lib/common/canvas/picture-renderer.d.ts +1 -1
- package/lib/common/canvas/renderes/common/document-renderer.d.ts +1 -1
- package/lib/common/canvas/renderes/common/document-renderer.js +6 -2
- package/lib/common/canvas/renderes/view-manager.js +3 -1
- package/lib/common/clipboard-content-inserter.js +2 -1
- package/lib/common/commands/client-command.d.ts +3 -1
- package/lib/common/commands/client-command.js +2 -0
- package/lib/common/commands/document/print-document-on-client-command.js +1 -1
- package/lib/common/commands/text/clipboard-commands.js +7 -5
- package/lib/common/document-format.d.ts +2 -0
- package/lib/common/document-format.js +2 -0
- package/lib/common/formats/document-importer-errors.d.ts +3 -1
- package/lib/common/formats/document-importer-errors.js +2 -0
- package/lib/common/formats/file-name-helper.d.ts +1 -0
- package/lib/common/formats/file-name-helper.js +7 -1
- package/lib/common/formats/html/export/get-html.d.ts +4 -0
- package/lib/common/formats/html/export/get-html.js +12 -0
- package/lib/common/formats/html/export/html-builder.d.ts +16 -0
- package/lib/common/formats/html/export/html-builder.js +98 -0
- package/lib/common/formats/html/export/html-document-exporter.d.ts +13 -0
- package/lib/common/formats/html/export/html-document-exporter.js +29 -0
- package/lib/common/formats/html/export/html-export.d.ts +25 -0
- package/lib/common/{html-export.js → formats/html/export/html-export.js} +115 -192
- package/lib/common/formats/html/import/html-document-importer.d.ts +15 -0
- package/lib/common/formats/html/import/html-document-importer.js +84 -0
- package/lib/common/formats/html/import/html-importer.d.ts +1 -0
- package/lib/common/formats/html/import/html-importer.js +13 -1
- package/lib/common/formats/html/import/insert-html.d.ts +4 -0
- package/lib/common/formats/html/import/insert-html.js +5 -0
- package/lib/common/formats/html/import/utils/paragraph-properties-utils.d.ts +1 -0
- package/lib/common/formats/html/import/utils/paragraph-properties-utils.js +17 -4
- package/lib/common/formats/i-document-exporter.d.ts +14 -0
- package/lib/common/formats/rtf/export/exporter.d.ts +1 -1
- package/lib/common/formats/rtf/export/exporter.js +1 -1
- package/lib/common/formats/rtf/importer-in-subdocument.d.ts +1 -1
- package/lib/common/formats/rtf/importer-in-subdocument.js +1 -1
- package/lib/common/formats/txt/txt-exporter.js +2 -1
- package/lib/common/input-controller.d.ts +2 -1
- package/lib/common/input-controller.js +5 -2
- package/lib/common/interfaces/i-rich-edit-core.d.ts +2 -0
- package/lib/common/layout/main-structures/layout-boxes/layout-anchored-picture-box.d.ts +2 -1
- package/lib/common/layout/main-structures/layout-boxes/layout-anchored-picture-box.js +4 -3
- package/lib/common/layout/main-structures/layout-boxes/layout-picture-box.d.ts +2 -1
- package/lib/common/layout/main-structures/layout-boxes/layout-picture-box.js +5 -4
- package/lib/common/layout/main-structures/layout-page.d.ts +1 -0
- package/lib/common/layout/main-structures/layout-page.js +5 -2
- package/lib/common/layout-formatter/box/generator/box-infos-generator.d.ts +1 -0
- package/lib/common/layout-formatter/box/generator/box-infos-generator.js +12 -2
- package/lib/common/layout-formatter/floating/page-anchored-object-holder.d.ts +5 -3
- package/lib/common/layout-formatter/floating/page-anchored-object-holder.js +7 -4
- package/lib/common/layout-formatter/formatter/base-formatter.js +0 -1
- package/lib/common/layout-formatter/formatter/main-formatter.js +1 -0
- package/lib/common/layout-formatter/managers/formatter-manager.d.ts +6 -2
- package/lib/common/layout-formatter/managers/formatter-manager.js +3 -1
- package/lib/common/layout-formatter/row/size-engine/row-sizes-manager.js +20 -4
- package/lib/common/measurer/measurer.js +2 -1
- package/lib/common/model/chunk.d.ts +1 -0
- package/lib/common/model/chunk.js +27 -2
- package/lib/common/model/document-model.d.ts +4 -0
- package/lib/common/model/document-model.js +4 -1
- package/lib/common/model/enums.d.ts +3 -1
- package/lib/common/model/enums.js +2 -0
- package/lib/common/model/footnotes/footnote.d.ts +46 -0
- package/lib/common/model/footnotes/footnote.js +100 -0
- package/lib/common/model/json/importers/sub-document/json-sub-document-importer.js +3 -3
- package/lib/common/model/json/importers/sub-document/run-importers.d.ts +6 -0
- package/lib/common/model/json/importers/sub-document/run-importers.js +9 -0
- package/lib/common/model/model-checks/position.d.ts +2 -1
- package/lib/common/model/model-checks/position.js +11 -2
- package/lib/common/model/numbering-lists/numbering-helper.d.ts +2 -1
- package/lib/common/model/numbering-lists/numbering-helper.js +3 -0
- package/lib/common/model/paragraph/paragraph-style.d.ts +1 -0
- package/lib/common/model/paragraph/paragraph-style.js +6 -2
- package/lib/common/model/properties-merger/paragraph-properties-merger.js +1 -1
- package/lib/common/model/runs/run-base.d.ts +1 -0
- package/lib/common/model/runs/simple-runs.d.ts +8 -2
- package/lib/common/model/runs/simple-runs.js +12 -6
- package/lib/common/model/section/section-properties.d.ts +3 -0
- package/lib/common/model/special-characters.d.ts +3 -0
- package/lib/common/model/special-characters.js +3 -0
- package/lib/common/model/sub-document-infos.d.ts +18 -0
- package/lib/common/model/sub-document-infos.js +39 -0
- package/lib/common/model/sub-document.d.ts +2 -0
- package/lib/common/model/sub-document.js +18 -16
- package/lib/common/mouse-handler/touch-handler/touch-handler-state-base.d.ts +1 -0
- package/lib/common/mouse-handler/touch-handler/touch-handler-state-base.js +21 -13
- package/lib/common/processor.d.ts +2 -0
- package/lib/common/rich-edit-core.d.ts +6 -2
- package/lib/common/rich-edit-core.js +20 -1
- package/lib/common/selection/selection-intervals-info.js +1 -1
- package/lib/common/utils/_license.d.ts +1 -0
- package/lib/common/utils/_license.js +2 -0
- package/lib/common/utils/size-utils.d.ts +3 -0
- package/lib/common/utils/size-utils.js +17 -4
- package/package.json +3 -3
- package/lib/common/html-export.d.ts +0 -32
@@ -17,9 +17,11 @@ export const mimeTypeIntoDocumentFormat = {
|
|
17
17
|
[DxMimeType.Docm]: DocumentFormat.OpenXml,
|
18
18
|
[DxMimeType.Rtf]: DocumentFormat.Rtf,
|
19
19
|
[DxMimeType.PlainText]: DocumentFormat.PlainText,
|
20
|
+
[DxMimeType.Html]: DocumentFormat.Html,
|
20
21
|
};
|
21
22
|
export const documentFormatIntoMimeType = {
|
22
23
|
[DocumentFormat.OpenXml]: DxMimeType.OpenXml,
|
23
24
|
[DocumentFormat.Rtf]: DxMimeType.Rtf,
|
24
25
|
[DocumentFormat.PlainText]: DxMimeType.PlainText,
|
26
|
+
[DocumentFormat.Html]: DxMimeType.Html,
|
25
27
|
};
|
@@ -5,4 +5,6 @@ export var DocumentImporterErrors;
|
|
5
5
|
DocumentImporterErrors[DocumentImporterErrors["RtfFileReaderError"] = 2] = "RtfFileReaderError";
|
6
6
|
DocumentImporterErrors[DocumentImporterErrors["RtfImportError"] = 3] = "RtfImportError";
|
7
7
|
DocumentImporterErrors[DocumentImporterErrors["OpenXmlImportError"] = 4] = "OpenXmlImportError";
|
8
|
+
DocumentImporterErrors[DocumentImporterErrors["HtmlFileReaderError"] = 5] = "HtmlFileReaderError";
|
9
|
+
DocumentImporterErrors[DocumentImporterErrors["HtmlImportError"] = 6] = "HtmlImportError";
|
8
10
|
})(DocumentImporterErrors || (DocumentImporterErrors = {}));
|
@@ -11,6 +11,7 @@ export declare class FileNameHelper {
|
|
11
11
|
checkExtension(): void;
|
12
12
|
static normalizeVirtualFolderPath(folderPath: string, isNormalizePath: boolean): string;
|
13
13
|
static convertToDocumentFormat(fileName: string): DocumentFormat;
|
14
|
+
static convertToDocumentExtension(fileName: string): string;
|
14
15
|
static convertExtensionToDocumentFormat(extension: string): DocumentFormat;
|
15
16
|
static convertToString(docFormat: DocumentFormat): string;
|
16
17
|
private static testFormat;
|
@@ -49,6 +49,12 @@ export class FileNameHelper {
|
|
49
49
|
return DocumentFormat.WordML;
|
50
50
|
return DocumentFormat.Undefined;
|
51
51
|
}
|
52
|
+
static convertToDocumentExtension(fileName) {
|
53
|
+
const position = fileName.lastIndexOf('.');
|
54
|
+
const extension = fileName.slice(position);
|
55
|
+
const format = FileNameHelper.convertExtensionToDocumentFormat(extension);
|
56
|
+
return format !== DocumentFormat.Undefined ? extension : '';
|
57
|
+
}
|
52
58
|
static convertExtensionToDocumentFormat(extension) {
|
53
59
|
switch (extension.toLowerCase()) {
|
54
60
|
case "doc":
|
@@ -58,7 +64,7 @@ export class FileNameHelper {
|
|
58
64
|
case "html":
|
59
65
|
case ".html":
|
60
66
|
case "htm":
|
61
|
-
case "htm": return DocumentFormat.Html;
|
67
|
+
case ".htm": return DocumentFormat.Html;
|
62
68
|
case "mht":
|
63
69
|
case ".mht": return DocumentFormat.Mht;
|
64
70
|
case "odt":
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { FixedInterval } from "@devexpress/utils/lib/intervals/fixed";
|
2
|
+
import { SubDocument } from "../../../model/sub-document";
|
3
|
+
import { IProcessor } from "../../../processor";
|
4
|
+
export declare function getHtmlFromSubDocument(processor: IProcessor, subDocument: SubDocument, coreInterval: FixedInterval): string;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { EmptyBatchUpdatableObject } from "@devexpress/utils/lib/class/batch-updatable";
|
2
|
+
import { ClientModelManager } from "../../../model-manager";
|
3
|
+
import { RangeCopy } from "../../../model/manipulators/range/create-range-copy-operation";
|
4
|
+
import { SubDocumentIntervals } from "../../../model/sub-document";
|
5
|
+
import { HtmlDocumentExporter } from "./html-document-exporter";
|
6
|
+
import { DocumentExporterOptions } from "../../options";
|
7
|
+
export function getHtmlFromSubDocument(processor, subDocument, coreInterval) {
|
8
|
+
const rangeCopy = RangeCopy.create(new SubDocumentIntervals(subDocument, [coreInterval]));
|
9
|
+
const modelManager = new ClientModelManager(rangeCopy.model, processor.modelManager.richOptions, new EmptyBatchUpdatableObject());
|
10
|
+
const exportModelOptions = processor.getExportModelOptions({ modelManager: modelManager });
|
11
|
+
return new HtmlDocumentExporter(exportModelOptions, new DocumentExporterOptions()).exportAsString();
|
12
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export declare class HtmlBuilder {
|
2
|
+
getHtmlString(needDefaultMarkup?: boolean): string;
|
3
|
+
private _currentElement;
|
4
|
+
childElements: Array<Element | string>;
|
5
|
+
callbacks: Array<(target: HtmlBuilder) => void>;
|
6
|
+
isEmpty(): boolean;
|
7
|
+
clear(): this;
|
8
|
+
startChild(tagName: string, namespaceUri?: string): this;
|
9
|
+
configure<T extends Element = HTMLElement>(config: (element: T) => void): this;
|
10
|
+
addCallback(callback: (target: HtmlBuilder) => void): void;
|
11
|
+
assignFrom(builder: HtmlBuilder | string): this;
|
12
|
+
addElement(element: Element | string): this;
|
13
|
+
addBreak(cssText?: string): this;
|
14
|
+
endChild(tagName: string): this;
|
15
|
+
private addDefaultMarkup;
|
16
|
+
}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
export class HtmlBuilder {
|
2
|
+
constructor() {
|
3
|
+
this.childElements = [];
|
4
|
+
this.callbacks = [];
|
5
|
+
}
|
6
|
+
getHtmlString(needDefaultMarkup = false) {
|
7
|
+
const content = this.childElements.map(x => {
|
8
|
+
if (typeof x === 'string')
|
9
|
+
return x;
|
10
|
+
return x.outerHTML;
|
11
|
+
}).join('');
|
12
|
+
return needDefaultMarkup ? this.addDefaultMarkup(content) : content;
|
13
|
+
}
|
14
|
+
isEmpty() {
|
15
|
+
return this.callbacks.length === 0 && this.childElements.length === 0;
|
16
|
+
}
|
17
|
+
clear() {
|
18
|
+
this._currentElement = null;
|
19
|
+
this.callbacks = [];
|
20
|
+
this.childElements = [];
|
21
|
+
return this;
|
22
|
+
}
|
23
|
+
startChild(tagName, namespaceUri) {
|
24
|
+
const element = (namespaceUri) ? document.createElementNS(namespaceUri, tagName) : document.createElement(tagName);
|
25
|
+
if (this._currentElement)
|
26
|
+
this._currentElement.appendChild(element);
|
27
|
+
else {
|
28
|
+
this.childElements.push(element);
|
29
|
+
}
|
30
|
+
this._currentElement = element;
|
31
|
+
return this;
|
32
|
+
}
|
33
|
+
configure(config) {
|
34
|
+
config(this._currentElement);
|
35
|
+
return this;
|
36
|
+
}
|
37
|
+
addCallback(callback) {
|
38
|
+
this.callbacks.push(callback);
|
39
|
+
}
|
40
|
+
assignFrom(builder) {
|
41
|
+
if (!builder)
|
42
|
+
return this;
|
43
|
+
if (typeof builder === "string") {
|
44
|
+
this.addElement(builder);
|
45
|
+
return this;
|
46
|
+
}
|
47
|
+
builder.callbacks.forEach((callback) => {
|
48
|
+
callback(this);
|
49
|
+
});
|
50
|
+
builder.childElements.forEach((el) => {
|
51
|
+
this.addElement(el);
|
52
|
+
});
|
53
|
+
builder.clear();
|
54
|
+
return this;
|
55
|
+
}
|
56
|
+
addElement(element) {
|
57
|
+
if (!element)
|
58
|
+
return this;
|
59
|
+
if (!this._currentElement) {
|
60
|
+
this.childElements.push(element);
|
61
|
+
return this;
|
62
|
+
}
|
63
|
+
if (typeof element === 'string')
|
64
|
+
this._currentElement.innerHTML += element;
|
65
|
+
else if (this._currentElement)
|
66
|
+
this._currentElement.appendChild(element);
|
67
|
+
else
|
68
|
+
this._currentElement = element;
|
69
|
+
return this;
|
70
|
+
}
|
71
|
+
addBreak(cssText) {
|
72
|
+
this.startChild('br');
|
73
|
+
if (cssText)
|
74
|
+
this.configure((el) => el.style.cssText = cssText);
|
75
|
+
this.endChild('br');
|
76
|
+
return this;
|
77
|
+
}
|
78
|
+
endChild(tagName) {
|
79
|
+
let currentElement = this._currentElement;
|
80
|
+
while (currentElement.tagName.toLowerCase() !== tagName.toLowerCase()) {
|
81
|
+
currentElement = currentElement.parentElement;
|
82
|
+
}
|
83
|
+
this._currentElement = currentElement.parentElement;
|
84
|
+
return this;
|
85
|
+
}
|
86
|
+
addDefaultMarkup(content) {
|
87
|
+
return '<!DOCTYPE html>' +
|
88
|
+
'<html lang="en">' +
|
89
|
+
'<head>' +
|
90
|
+
'<meta charset="UTF-8">' +
|
91
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1.0">' +
|
92
|
+
'</head>' +
|
93
|
+
'<body>' +
|
94
|
+
content +
|
95
|
+
'</body>' +
|
96
|
+
'</html>';
|
97
|
+
}
|
98
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { IDocumentExporter, IExportModelOptions } from "../../i-document-exporter";
|
2
|
+
import { DocumentExporterOptions } from "../../options";
|
3
|
+
export declare class HtmlDocumentExporter implements IDocumentExporter {
|
4
|
+
private options;
|
5
|
+
private exportModelOptions;
|
6
|
+
private sessionGuid;
|
7
|
+
private clientGuid;
|
8
|
+
private get modelManipulator();
|
9
|
+
constructor(exportModelOptions: IExportModelOptions, options: DocumentExporterOptions);
|
10
|
+
exportToBlob(callback: (blob: Blob) => void): void;
|
11
|
+
exportToBase64(callback: (base64: string) => void): void;
|
12
|
+
exportAsString(): string;
|
13
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { FixedInterval } from "@devexpress/utils/lib/intervals/fixed";
|
2
|
+
import { HtmlMimeType } from "@devexpress/utils/lib/utils/mime-type";
|
3
|
+
import { RichUtils } from "../../../model/rich-utils";
|
4
|
+
import { HtmlExporter } from "./html-export";
|
5
|
+
export class HtmlDocumentExporter {
|
6
|
+
constructor(exportModelOptions, options) {
|
7
|
+
this.exportModelOptions = exportModelOptions;
|
8
|
+
this.options = options;
|
9
|
+
}
|
10
|
+
get modelManipulator() { return this.exportModelOptions.modelManager.modelManipulator; }
|
11
|
+
exportToBlob(callback) {
|
12
|
+
this.modelManipulator.picture.loader.ensureAllPicturesLoaded(this.options.ensurePictureLoadedTimeout, (_loaded) => {
|
13
|
+
callback(new Blob([this.exportAsString()], { type: HtmlMimeType }));
|
14
|
+
});
|
15
|
+
}
|
16
|
+
exportToBase64(callback) {
|
17
|
+
this.modelManipulator.picture.loader.ensureAllPicturesLoaded(this.options.ensurePictureLoadedTimeout, (_loaded) => {
|
18
|
+
callback(btoa(this.exportAsString()));
|
19
|
+
});
|
20
|
+
}
|
21
|
+
exportAsString() {
|
22
|
+
const model = this.modelManipulator.model;
|
23
|
+
const subDocument = model.mainSubDocument;
|
24
|
+
const interval = new FixedInterval(0, model.mainSubDocument.getDocumentEndPosition());
|
25
|
+
const guidLabel = RichUtils.getCopyPasteGuidLabel({ sguid: this.sessionGuid, cguid: this.clientGuid });
|
26
|
+
const exporter = new HtmlExporter(this.exportModelOptions);
|
27
|
+
return exporter.getHtmlElementsByInterval(model, subDocument, interval, guidLabel).getHtmlString(true);
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
2
|
+
import { DocumentModel } from '../../../model/document-model';
|
3
|
+
import { RangeCopy } from '../../../model/manipulators/range/create-range-copy-operation';
|
4
|
+
import { SubDocument } from '../../../model/sub-document';
|
5
|
+
import { HtmlBuilder } from './html-builder';
|
6
|
+
import { IExportModelOptions } from '../../i-document-exporter';
|
7
|
+
export declare class HtmlExporter {
|
8
|
+
rangeCopy: RangeCopy;
|
9
|
+
private exportModelOptions;
|
10
|
+
private get modelManager();
|
11
|
+
private get colorProvider();
|
12
|
+
private get unitConverter();
|
13
|
+
private get documentRenderer();
|
14
|
+
private get lastMaxNumPages();
|
15
|
+
private get pageIndex();
|
16
|
+
constructor(exportModelOptions: IExportModelOptions);
|
17
|
+
getHtmlElementsByInterval(model: DocumentModel, subDocument: SubDocument, interval: FixedInterval, guidLabel: string): HtmlBuilder;
|
18
|
+
private addParentTableRecursively;
|
19
|
+
private getHtmlText;
|
20
|
+
private getBorderCssString;
|
21
|
+
private getTableWidthUnitCssString;
|
22
|
+
private getTableStyle;
|
23
|
+
private getCellStyle;
|
24
|
+
private getTextBoxStyleString;
|
25
|
+
}
|