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.
Files changed (200) hide show
  1. package/bin/gulpfile.js +1 -1
  2. package/bin/index-custom.js +1 -1
  3. package/bin/localization-builder.js +1 -1
  4. package/bin/nspell-index.js +1 -1
  5. package/bin/nspell.webpack.config.js +1 -1
  6. package/bin/webpack-externals.js +3 -1
  7. package/bin/webpack.config.js +1 -1
  8. package/dist/dx.richedit.css +1 -0
  9. package/dist/dx.richedit.d.ts +17 -10
  10. package/dist/dx.richedit.js +52855 -51531
  11. package/dist/dx.richedit.min.js +2 -2
  12. package/index.d.ts +1 -1
  13. package/index.js +1 -1
  14. package/lib/client/bars/ribbon.js +2 -1
  15. package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +2 -1
  16. package/lib/client/client-rich-edit.js +2 -1
  17. package/lib/client/commands/client-command-manager.js +2 -1
  18. package/lib/client/commands/commands.js +3 -0
  19. package/lib/client/commands/download-document-command.d.ts +3 -0
  20. package/lib/client/commands/download-document-command.js +13 -2
  21. package/lib/client/commands/export-document-command.js +4 -4
  22. package/lib/client/commands/mail-merge-command.js +7 -4
  23. package/lib/client/commands/open-document-command.d.ts +2 -1
  24. package/lib/client/commands/open-document-command.js +17 -12
  25. package/lib/client/default-localization.js +2 -1
  26. package/lib/client/dialogs/finish-and-merge-dialog.js +1 -0
  27. package/lib/client/document-processor/processor.d.ts +9 -2
  28. package/lib/client/document-processor/processor.js +18 -6
  29. package/lib/client/formats/docx/export/data.d.ts +4 -0
  30. package/lib/client/formats/docx/export/data.js +12 -0
  31. package/lib/client/formats/docx/export/exporter.d.ts +2 -0
  32. package/lib/client/formats/docx/export/exporter.js +15 -0
  33. package/lib/client/formats/docx/export/exporters/base/sections.js +5 -0
  34. package/lib/client/formats/docx/export/exporters/note-properties.d.ts +18 -0
  35. package/lib/client/formats/docx/export/exporters/note-properties.js +83 -0
  36. package/lib/client/formats/docx/export/exporters/settings.d.ts +2 -0
  37. package/lib/client/formats/docx/export/exporters/settings.js +11 -0
  38. package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.d.ts +15 -1
  39. package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.js +85 -3
  40. package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.d.ts +2 -2
  41. package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.js +2 -2
  42. package/lib/client/formats/docx/export/exporters/sub-document/main-sub-document.d.ts +2 -2
  43. package/lib/client/formats/docx/export/exporters/sub-document/main-sub-document.js +2 -2
  44. package/lib/client/formats/docx/export/exporters/sub-document/note-sub-document-exporter.d.ts +37 -0
  45. package/lib/client/formats/docx/export/exporters/sub-document/note-sub-document-exporter.js +71 -0
  46. package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.d.ts +2 -2
  47. package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.js +2 -2
  48. package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.d.ts +16 -0
  49. package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.js +48 -0
  50. package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.d.ts +5 -0
  51. package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.js +9 -0
  52. package/lib/client/formats/docx/import/destination/notes/endnotes/endnotes-destination.d.ts +5 -0
  53. package/lib/client/formats/docx/import/destination/notes/endnotes/endnotes-destination.js +39 -0
  54. package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-properties-destination.d.ts +18 -0
  55. package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-properties-destination.js +49 -0
  56. package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.d.ts +5 -0
  57. package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.js +9 -0
  58. package/lib/client/formats/docx/import/destination/notes/footnotes/footnotes-destination.d.ts +5 -0
  59. package/lib/client/formats/docx/import/destination/notes/footnotes/footnotes-destination.js +39 -0
  60. package/lib/client/formats/docx/import/destination/notes/note-destination.d.ts +18 -0
  61. package/lib/client/formats/docx/import/destination/notes/note-destination.js +45 -0
  62. package/lib/client/formats/docx/import/destination/notes/note-properties-destination.d.ts +32 -0
  63. package/lib/client/formats/docx/import/destination/notes/note-properties-destination.js +81 -0
  64. package/lib/client/formats/docx/import/destination/notes/note-reference-destination.d.ts +8 -0
  65. package/lib/client/formats/docx/import/destination/notes/note-reference-destination.js +21 -0
  66. package/lib/client/formats/docx/import/destination/notes/note-self-reference-destination.d.ts +5 -0
  67. package/lib/client/formats/docx/import/destination/notes/note-self-reference-destination.js +12 -0
  68. package/lib/client/formats/docx/import/destination/notes/note-separator-destination.d.ts +8 -0
  69. package/lib/client/formats/docx/import/destination/notes/note-separator-destination.js +20 -0
  70. package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-numbering-reference-destination.js +1 -1
  71. package/lib/client/formats/docx/import/destination/runs/run-destination.js +11 -5
  72. package/lib/client/formats/docx/import/destination/section/section-destination.js +5 -2
  73. package/lib/client/formats/docx/import/destination/settings/settings.js +4 -0
  74. package/lib/client/formats/docx/import/importer.d.ts +2 -0
  75. package/lib/client/formats/docx/import/importer.js +26 -0
  76. package/lib/client/formats/docx/import/importers/character-importer.d.ts +3 -0
  77. package/lib/client/formats/docx/import/importers/character-importer.js +12 -1
  78. package/lib/client/formats/docx/import/importers/end-notes-importer.d.ts +3 -4
  79. package/lib/client/formats/docx/import/importers/end-notes-importer.js +8 -3
  80. package/lib/client/formats/docx/import/importers/foot-notes-importer.d.ts +3 -5
  81. package/lib/client/formats/docx/import/importers/foot-notes-importer.js +8 -5
  82. package/lib/client/formats/docx/import/importers/notes-importer.d.ts +8 -0
  83. package/lib/client/formats/docx/import/importers/notes-importer.js +7 -0
  84. package/lib/client/formats/docx/translation-table/translation-tables.d.ts +7 -0
  85. package/lib/client/formats/docx/translation-table/translation-tables.js +27 -0
  86. package/lib/client/formats/docx/utils/constants.d.ts +2 -0
  87. package/lib/client/formats/docx/utils/constants.js +2 -0
  88. package/lib/client/model-api/formats/enum.d.ts +1 -0
  89. package/lib/client/model-api/formats/enum.js +1 -0
  90. package/lib/client/model-api/formats/exporter.d.ts +3 -4
  91. package/lib/client/model-api/formats/exporter.js +9 -6
  92. package/lib/client/model-api/formats/importer.js +2 -0
  93. package/lib/client/model-api/sub-document.d.ts +6 -2
  94. package/lib/client/model-api/sub-document.js +37 -35
  95. package/lib/client/model-api/table/table-borders.d.ts +1 -1
  96. package/lib/client/public/commands/enum.d.ts +1 -0
  97. package/lib/client/public/commands/enum.js +1 -0
  98. package/lib/client/public/document-processor.d.ts +3 -1
  99. package/lib/client/public/document-processor.js +2 -2
  100. package/lib/client/public/ribbon/item-ids.d.ts +1 -0
  101. package/lib/client/public/ribbon/item-ids.js +1 -0
  102. package/lib/client/public/rich-edit.d.ts +2 -1
  103. package/lib/client/public/rich-edit.js +16 -9
  104. package/lib/common/canvas/canvas-manager.js +2 -1
  105. package/lib/common/canvas/picture-renderer.d.ts +1 -1
  106. package/lib/common/canvas/renderes/common/document-renderer.d.ts +1 -1
  107. package/lib/common/canvas/renderes/common/document-renderer.js +6 -2
  108. package/lib/common/canvas/renderes/view-manager.js +3 -1
  109. package/lib/common/clipboard-content-inserter.js +2 -1
  110. package/lib/common/commands/client-command.d.ts +3 -1
  111. package/lib/common/commands/client-command.js +2 -0
  112. package/lib/common/commands/document/print-document-on-client-command.js +1 -1
  113. package/lib/common/commands/text/clipboard-commands.js +7 -5
  114. package/lib/common/document-format.d.ts +2 -0
  115. package/lib/common/document-format.js +2 -0
  116. package/lib/common/formats/document-importer-errors.d.ts +3 -1
  117. package/lib/common/formats/document-importer-errors.js +2 -0
  118. package/lib/common/formats/file-name-helper.d.ts +1 -0
  119. package/lib/common/formats/file-name-helper.js +7 -1
  120. package/lib/common/formats/html/export/get-html.d.ts +4 -0
  121. package/lib/common/formats/html/export/get-html.js +12 -0
  122. package/lib/common/formats/html/export/html-builder.d.ts +16 -0
  123. package/lib/common/formats/html/export/html-builder.js +98 -0
  124. package/lib/common/formats/html/export/html-document-exporter.d.ts +13 -0
  125. package/lib/common/formats/html/export/html-document-exporter.js +29 -0
  126. package/lib/common/formats/html/export/html-export.d.ts +25 -0
  127. package/lib/common/{html-export.js → formats/html/export/html-export.js} +115 -192
  128. package/lib/common/formats/html/import/html-document-importer.d.ts +15 -0
  129. package/lib/common/formats/html/import/html-document-importer.js +84 -0
  130. package/lib/common/formats/html/import/html-importer.d.ts +1 -0
  131. package/lib/common/formats/html/import/html-importer.js +13 -1
  132. package/lib/common/formats/html/import/insert-html.d.ts +4 -0
  133. package/lib/common/formats/html/import/insert-html.js +5 -0
  134. package/lib/common/formats/html/import/utils/paragraph-properties-utils.d.ts +1 -0
  135. package/lib/common/formats/html/import/utils/paragraph-properties-utils.js +17 -4
  136. package/lib/common/formats/i-document-exporter.d.ts +14 -0
  137. package/lib/common/formats/rtf/export/exporter.d.ts +1 -1
  138. package/lib/common/formats/rtf/export/exporter.js +1 -1
  139. package/lib/common/formats/rtf/importer-in-subdocument.d.ts +1 -1
  140. package/lib/common/formats/rtf/importer-in-subdocument.js +1 -1
  141. package/lib/common/formats/txt/txt-exporter.js +2 -1
  142. package/lib/common/input-controller.d.ts +2 -1
  143. package/lib/common/input-controller.js +5 -2
  144. package/lib/common/interfaces/i-rich-edit-core.d.ts +2 -0
  145. package/lib/common/layout/main-structures/layout-boxes/layout-anchored-picture-box.d.ts +2 -1
  146. package/lib/common/layout/main-structures/layout-boxes/layout-anchored-picture-box.js +4 -3
  147. package/lib/common/layout/main-structures/layout-boxes/layout-picture-box.d.ts +2 -1
  148. package/lib/common/layout/main-structures/layout-boxes/layout-picture-box.js +5 -4
  149. package/lib/common/layout/main-structures/layout-page.d.ts +1 -0
  150. package/lib/common/layout/main-structures/layout-page.js +5 -2
  151. package/lib/common/layout-formatter/box/generator/box-infos-generator.d.ts +1 -0
  152. package/lib/common/layout-formatter/box/generator/box-infos-generator.js +12 -2
  153. package/lib/common/layout-formatter/floating/page-anchored-object-holder.d.ts +5 -3
  154. package/lib/common/layout-formatter/floating/page-anchored-object-holder.js +7 -4
  155. package/lib/common/layout-formatter/formatter/base-formatter.js +0 -1
  156. package/lib/common/layout-formatter/formatter/main-formatter.js +1 -0
  157. package/lib/common/layout-formatter/managers/formatter-manager.d.ts +6 -2
  158. package/lib/common/layout-formatter/managers/formatter-manager.js +3 -1
  159. package/lib/common/layout-formatter/row/size-engine/row-sizes-manager.js +20 -4
  160. package/lib/common/measurer/measurer.js +2 -1
  161. package/lib/common/model/chunk.d.ts +1 -0
  162. package/lib/common/model/chunk.js +27 -2
  163. package/lib/common/model/document-model.d.ts +4 -0
  164. package/lib/common/model/document-model.js +4 -1
  165. package/lib/common/model/enums.d.ts +3 -1
  166. package/lib/common/model/enums.js +2 -0
  167. package/lib/common/model/footnotes/footnote.d.ts +46 -0
  168. package/lib/common/model/footnotes/footnote.js +100 -0
  169. package/lib/common/model/json/importers/sub-document/json-sub-document-importer.js +3 -3
  170. package/lib/common/model/json/importers/sub-document/run-importers.d.ts +6 -0
  171. package/lib/common/model/json/importers/sub-document/run-importers.js +9 -0
  172. package/lib/common/model/model-checks/position.d.ts +2 -1
  173. package/lib/common/model/model-checks/position.js +11 -2
  174. package/lib/common/model/numbering-lists/numbering-helper.d.ts +2 -1
  175. package/lib/common/model/numbering-lists/numbering-helper.js +3 -0
  176. package/lib/common/model/paragraph/paragraph-style.d.ts +1 -0
  177. package/lib/common/model/paragraph/paragraph-style.js +6 -2
  178. package/lib/common/model/properties-merger/paragraph-properties-merger.js +1 -1
  179. package/lib/common/model/runs/run-base.d.ts +1 -0
  180. package/lib/common/model/runs/simple-runs.d.ts +8 -2
  181. package/lib/common/model/runs/simple-runs.js +12 -6
  182. package/lib/common/model/section/section-properties.d.ts +3 -0
  183. package/lib/common/model/special-characters.d.ts +3 -0
  184. package/lib/common/model/special-characters.js +3 -0
  185. package/lib/common/model/sub-document-infos.d.ts +18 -0
  186. package/lib/common/model/sub-document-infos.js +39 -0
  187. package/lib/common/model/sub-document.d.ts +2 -0
  188. package/lib/common/model/sub-document.js +18 -16
  189. package/lib/common/mouse-handler/touch-handler/touch-handler-state-base.d.ts +1 -0
  190. package/lib/common/mouse-handler/touch-handler/touch-handler-state-base.js +21 -13
  191. package/lib/common/processor.d.ts +2 -0
  192. package/lib/common/rich-edit-core.d.ts +6 -2
  193. package/lib/common/rich-edit-core.js +20 -1
  194. package/lib/common/selection/selection-intervals-info.js +1 -1
  195. package/lib/common/utils/_license.d.ts +1 -0
  196. package/lib/common/utils/_license.js +2 -0
  197. package/lib/common/utils/size-utils.d.ts +3 -0
  198. package/lib/common/utils/size-utils.js +17 -4
  199. package/package.json +3 -3
  200. 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
  };
@@ -3,5 +3,7 @@ export declare enum DocumentImporterErrors {
3
3
  TxtImportError = 1,
4
4
  RtfFileReaderError = 2,
5
5
  RtfImportError = 3,
6
- OpenXmlImportError = 4
6
+ OpenXmlImportError = 4,
7
+ HtmlFileReaderError = 5,
8
+ HtmlImportError = 6
7
9
  }
@@ -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
+ }