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
@@ -137,4 +137,6 @@ export declare class ContentType {
137
137
  static readonly numbering = "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";
138
138
  static readonly styles = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";
139
139
  static readonly settings = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
140
+ static readonly footnotes = "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";
141
+ static readonly endnotes = "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml";
140
142
  }
@@ -191,3 +191,5 @@ ContentType.mainDocument = 'application/vnd.openxmlformats-officedocument.wordpr
191
191
  ContentType.numbering = 'application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml';
192
192
  ContentType.styles = 'application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml';
193
193
  ContentType.settings = 'application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml';
194
+ ContentType.footnotes = 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml';
195
+ ContentType.endnotes = 'application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml';
@@ -1,5 +1,6 @@
1
1
  export declare enum DocumentFormatApi {
2
2
  PlainText = 1,
3
3
  Rtf = 2,
4
+ Html = 3,
4
5
  OpenXml = 4
5
6
  }
@@ -2,5 +2,6 @@ export var DocumentFormatApi;
2
2
  (function (DocumentFormatApi) {
3
3
  DocumentFormatApi[DocumentFormatApi["PlainText"] = 1] = "PlainText";
4
4
  DocumentFormatApi[DocumentFormatApi["Rtf"] = 2] = "Rtf";
5
+ DocumentFormatApi[DocumentFormatApi["Html"] = 3] = "Html";
5
6
  DocumentFormatApi[DocumentFormatApi["OpenXml"] = 4] = "OpenXml";
6
7
  })(DocumentFormatApi || (DocumentFormatApi = {}));
@@ -1,4 +1,3 @@
1
- import { DocumentFormat } from '../../../common/document-format';
2
- import { ModelManipulator } from '../../../common/model/manipulators/model-manipulator';
3
- export declare function exportModelToBase64(modelManipulator: ModelManipulator, format: DocumentFormat, callback: (base64: string) => void): void;
4
- export declare function exportModelToBlob(modelManipulator: ModelManipulator, format: DocumentFormat, callback: (blob: Blob) => void): void;
1
+ import { IExportModelOptions } from '../../../common/formats/i-document-exporter';
2
+ export declare function exportModelToBase64(exportModelOptions: IExportModelOptions, callback: (base64: string) => void): void;
3
+ export declare function exportModelToBlob(exportModelOptions: IExportModelOptions, callback: (blob: Blob) => void): void;
@@ -5,17 +5,20 @@ import { DocxExporter } from '../../formats/docx/export/exporter';
5
5
  import { RtfExporter } from '../../../common/formats/rtf/export/exporter';
6
6
  import { RtfDocumentExporterOptions } from '../../../common/formats/rtf/export/rtf-document-exporter-options';
7
7
  import { TxtExporter } from '../../../common/formats/txt/txt-exporter';
8
- export function exportModelToBase64(modelManipulator, format, callback) {
9
- getExporter(modelManipulator, format).exportToBase64(callback);
8
+ import { HtmlDocumentExporter } from '../../../common/formats/html/export/html-document-exporter';
9
+ export function exportModelToBase64(exportModelOptions, callback) {
10
+ getExporter(exportModelOptions).exportToBase64(callback);
10
11
  }
11
- export function exportModelToBlob(modelManipulator, format, callback) {
12
- getExporter(modelManipulator, format).exportToBlob(callback);
12
+ export function exportModelToBlob(exportModelOptions, callback) {
13
+ getExporter(exportModelOptions).exportToBlob(callback);
13
14
  }
14
- function getExporter(modelManipulator, format) {
15
- switch (format) {
15
+ function getExporter(exportModelOptions) {
16
+ const { modelManipulator } = exportModelOptions.modelManager;
17
+ switch (exportModelOptions.documentFormat) {
16
18
  case DocumentFormat.OpenXml: return new DocxExporter(modelManipulator, new DocxExportOptions());
17
19
  case DocumentFormat.Rtf: return new RtfExporter(modelManipulator, new RtfDocumentExporterOptions());
18
20
  case DocumentFormat.PlainText: return new TxtExporter(modelManipulator, new DocumentExporterOptions());
21
+ case DocumentFormat.Html: return new HtmlDocumentExporter(exportModelOptions, new DocumentExporterOptions());
19
22
  default:
20
23
  console.log('Unsupported format');
21
24
  return null;
@@ -8,6 +8,7 @@ import { RtfImporterOptions } from '../../../common/formats/rtf/import/importer-
8
8
  import { RtfImporter } from '../../../common/formats/rtf/import/rtf-importer';
9
9
  import { TxtImporter } from '../../../common/formats/txt/txt-importer';
10
10
  import { getAfterInsertCallback, getAfterInsertReject } from '../../../common/formats/callback-helpers';
11
+ import { HtmlDocumentImporter } from '../../../common/formats/html/import/html-document-importer';
11
12
  export function createImporter(format, throwInvalidFile = reason => {
12
13
  throw new Error(Errors.InternalException + " " + reason);
13
14
  }) {
@@ -15,6 +16,7 @@ export function createImporter(format, throwInvalidFile = reason => {
15
16
  case DocumentFormat.OpenXml: return new Importer(new ImporterOptions(throwInvalidFile));
16
17
  case DocumentFormat.Rtf: return new RtfImporter(new RtfImporterOptions(throwInvalidFile));
17
18
  case DocumentFormat.PlainText: return new TxtImporter();
19
+ case DocumentFormat.Html: return new HtmlDocumentImporter();
18
20
  default:
19
21
  console.log('Unsupported format');
20
22
  return null;
@@ -18,7 +18,9 @@ export declare enum SubDocumentTypeApi {
18
18
  Main = 0,
19
19
  Header = 1,
20
20
  Footer = 2,
21
- TextBox = 3
21
+ TextBox = 3,
22
+ FootNote = 4,
23
+ EndNote = 5
22
24
  }
23
25
  export declare enum HeaderFooterTypeApi {
24
26
  First = 0,
@@ -55,6 +57,8 @@ export declare class SubDocumentApi {
55
57
  insertSectionBreak(position: number, type: SectionBreakTypeApi): SectionApi;
56
58
  insertPicture(position: number, base64: string, size?: SizeApi, callback?: (interval: IntervalApi) => void): void;
57
59
  insertParagraph(position: number): ParagraphApi;
60
+ insertHtml(position: number, htmlText: string, callback?: (interval: IntervalApi) => void): void;
61
+ getHtml(interval?: IInterval): string;
58
62
  insertRtf(position: number, rtfText: string, callback?: (interval: IntervalApi, isRtfValid: boolean) => void): void;
59
63
  getRtf(interval?: IInterval): string;
60
64
  insertContent(position: number, content: string | File | Blob | ArrayBuffer, documentFormat: DocumentFormatApi, callback?: (interval: IntervalApi, success: boolean) => void): void;
@@ -62,7 +66,7 @@ export declare class SubDocumentApi {
62
66
  getText(interval?: IInterval): string;
63
67
  getCharacterProperties(interval: IInterval): CharacterPropertiesApi;
64
68
  setCharacterProperties(interval: IInterval, characterProperties: ICharacterProperties): void;
65
- private _checkInterval;
66
69
  getParagraphProperties(interval: IInterval): ParagraphPropertiesApi;
67
70
  setParagraphProperties(interval: IInterval, paragraphProperties: IParagraphProperties): void;
71
+ private _checkInterval;
68
72
  }
@@ -15,6 +15,10 @@ import { Constants } from '@devexpress/utils/lib/constants';
15
15
  import { Size } from '@devexpress/utils/lib/geometry/size';
16
16
  import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
17
17
  import { MathUtils } from '@devexpress/utils/lib/utils/math';
18
+ import { isDefined } from '@devexpress/utils/lib/utils/common';
19
+ import { getRtfFromSubDocumentPublic, insertRtfInSubDocumentPublic } from '../../common/formats/rtf/importer-in-subdocument';
20
+ import { insertHtmlInSubDocument } from '../../common/formats/html/import/insert-html';
21
+ import { getHtmlFromSubDocument } from '../../common/formats/html/export/get-html';
18
22
  import { getRestrictedInterval } from './api-utils/api-utils';
19
23
  import { ModelParametersChecker } from './api-utils/model-parameter-checker';
20
24
  import { getCharacterProperties, setCharacterProperties, } from './character-properties';
@@ -30,14 +34,14 @@ import { convertToIntervalApi, IntervalApi } from './interval';
30
34
  import { convertFromParagraphPropertiesApi, convertToParagraphPropertiesApi, ParagraphApi } from './paragraph';
31
35
  import { SectionApi } from './section';
32
36
  import { insertTextThroughApi } from './api-utils/insert-text';
33
- import { isDefined } from '@devexpress/utils/lib/utils/common';
34
- import { getRtfFromSubDocumentPublic, insertRtfInSubDocumentPublic } from '../../common/formats/rtf/importer-in-subdocument';
35
37
  export var SubDocumentTypeApi;
36
38
  (function (SubDocumentTypeApi) {
37
39
  SubDocumentTypeApi[SubDocumentTypeApi["Main"] = 0] = "Main";
38
40
  SubDocumentTypeApi[SubDocumentTypeApi["Header"] = 1] = "Header";
39
41
  SubDocumentTypeApi[SubDocumentTypeApi["Footer"] = 2] = "Footer";
40
42
  SubDocumentTypeApi[SubDocumentTypeApi["TextBox"] = 3] = "TextBox";
43
+ SubDocumentTypeApi[SubDocumentTypeApi["FootNote"] = 4] = "FootNote";
44
+ SubDocumentTypeApi[SubDocumentTypeApi["EndNote"] = 5] = "EndNote";
41
45
  })(SubDocumentTypeApi || (SubDocumentTypeApi = {}));
42
46
  export var HeaderFooterTypeApi;
43
47
  (function (HeaderFooterTypeApi) {
@@ -173,6 +177,23 @@ export class SubDocumentApi {
173
177
  this._processor.endUpdate();
174
178
  return new ParagraphApi(this._processor, this._subDocument.getParagraphByPosition(position));
175
179
  }
180
+ insertHtml(position, htmlText, callback) {
181
+ const positionDescriptor = ApiParametersChecker.numberDescriptor('position', (val) => val);
182
+ const htmlTextDescriptor = ApiParametersChecker.stringDescriptor('htmlText', (s) => s, false);
183
+ const callbackDescriptor = ApiParametersChecker.functionDescriptor('callback', (val) => val);
184
+ position = ApiParametersChecker.check(position, 1, false, [positionDescriptor]);
185
+ position = MathUtils.restrictValue(position, 0, this._subDocument.getDocumentEndPosition() - 1);
186
+ htmlText = ApiParametersChecker.check(htmlText, 2, false, [htmlTextDescriptor]);
187
+ callback = ApiParametersChecker.check(callback, 3, true, [callbackDescriptor]);
188
+ if (!callback)
189
+ callback = () => { };
190
+ const callBackWrap = (interval) => callback(isDefined(interval) ? convertToIntervalApi(interval) : null);
191
+ insertHtmlInSubDocument(this._processor, this._subDocument, position, htmlText, callBackWrap);
192
+ }
193
+ getHtml(interval) {
194
+ const coreInterval = this._checkInterval(interval);
195
+ return getHtmlFromSubDocument(this._processor, this._subDocument, coreInterval);
196
+ }
176
197
  insertRtf(position, rtfText, callback) {
177
198
  position = ApiParametersChecker.check(position, 1, false, [
178
199
  ApiParametersChecker.numberDescriptor('position', (val) => val)
@@ -189,15 +210,7 @@ export class SubDocumentApi {
189
210
  insertRtfInSubDocumentPublic(this._processor, this._subDocument, position, rtfText, (interval, isRtfValid) => callback(isDefined(interval) ? convertToIntervalApi(interval) : null, isRtfValid));
190
211
  }
191
212
  getRtf(interval) {
192
- let coreInterval;
193
- if (interval) {
194
- coreInterval = ApiParametersChecker.check(interval, 1, true, [
195
- ModelParametersChecker.intervalDescriptor("interval", (interval) => getRestrictedInterval(interval, 0, this._subDocument.getDocumentEndPosition()))
196
- ]);
197
- }
198
- else {
199
- coreInterval = this._subDocument.interval;
200
- }
213
+ const coreInterval = this._checkInterval(interval);
201
214
  return getRtfFromSubDocumentPublic(this._processor.modelManager.richOptions, this._subDocument, coreInterval);
202
215
  }
203
216
  insertContent(position, content, documentFormat, callback) {
@@ -222,9 +235,7 @@ export class SubDocumentApi {
222
235
  insertContentInSubDocumentPublic(this._processor, this._subDocument, position, content, coreDocumentFormat, (interval, isRtfValid) => callback(convertToIntervalApi(interval), isRtfValid));
223
236
  }
224
237
  deleteText(interval) {
225
- const coreInterval = ApiParametersChecker.check(interval, 1, false, [
226
- ModelParametersChecker.intervalDescriptor("interval", (interval) => getRestrictedInterval(interval, 0, this._subDocument.getDocumentEndPosition()))
227
- ]);
238
+ const coreInterval = this._checkInterval(interval);
228
239
  if (coreInterval.length) {
229
240
  this._processor.beginUpdate();
230
241
  this._processor.modelManager.modelManipulator.range.removeInterval(new SubDocumentInterval(this._subDocument, coreInterval), true, false);
@@ -232,14 +243,8 @@ export class SubDocumentApi {
232
243
  }
233
244
  }
234
245
  getText(interval) {
235
- if (interval) {
236
- const coreInterval = ApiParametersChecker.check(interval, 1, false, [
237
- ModelParametersChecker.intervalDescriptor("interval", (interval) => getRestrictedInterval(interval, 0, this._subDocument.getDocumentEndPosition()))
238
- ]);
239
- return this._subDocument.getText(coreInterval);
240
- }
241
- else
242
- return this._subDocument.getText(this._subDocument.interval);
246
+ const coreInterval = this._checkInterval(interval);
247
+ return this._subDocument.getText(coreInterval);
243
248
  }
244
249
  getCharacterProperties(interval) {
245
250
  const coreInterval = this._checkInterval(interval);
@@ -249,29 +254,26 @@ export class SubDocumentApi {
249
254
  const coreInterval = this._checkInterval(interval);
250
255
  setCharacterProperties(this._processor, this._subDocument, coreInterval, characterProperties);
251
256
  }
252
- _checkInterval(interval) {
253
- const getResult = (interval) => getRestrictedInterval(interval, 0, this._subDocument.getDocumentEndPosition());
254
- const intervalDescriptor = ModelParametersChecker.intervalDescriptor("interval", getResult);
255
- return ApiParametersChecker.check(interval, 1, false, [intervalDescriptor]);
256
- }
257
257
  getParagraphProperties(interval) {
258
- const coreInterval = ApiParametersChecker.check(interval, 1, false, [
259
- ModelParametersChecker.intervalDescriptor("interval", (interval) => getRestrictedInterval(interval, 0, this._subDocument.getDocumentEndPosition()))
260
- ]);
258
+ const coreInterval = this._checkInterval(interval);
261
259
  const inputPos = new InputPositionBase().setIntervals(new SelectionIntervalsInfo(this._subDocument, [coreInterval]));
262
260
  return convertToParagraphPropertiesApi(inputPos.getMergedParagraphPropertiesFull(), this._processor.modelManager.model.colorProvider);
263
261
  }
264
262
  setParagraphProperties(interval, paragraphProperties) {
265
- const coreInterval = ApiParametersChecker.check(interval, 1, false, [
266
- ModelParametersChecker.intervalDescriptor("interval", (interval) => getRestrictedInterval(interval, 0, this._subDocument.getDocumentEndPosition()))
267
- ]);
263
+ const coreInterval = this._checkInterval(interval);
268
264
  const propertiesCore = convertFromParagraphPropertiesApi(paragraphProperties, 2);
269
- const inputPos = new InputPositionBase()
270
- .setIntervals(new SelectionIntervalsInfo(this._subDocument, [coreInterval]));
265
+ const inputPos = new InputPositionBase().setIntervals(new SelectionIntervalsInfo(this._subDocument, [coreInterval]));
271
266
  this._processor.beginUpdate();
272
267
  new ParagraphPropertiesApplier(this._processor.modelManager, inputPos, propertiesCore, this._subDocument, [coreInterval]).apply();
273
268
  this._processor.endUpdate();
274
269
  }
270
+ _checkInterval(value, parameterIndex = 1) {
271
+ if (!value)
272
+ return this._subDocument.interval;
273
+ const getResult = (interval) => getRestrictedInterval(interval, 0, this._subDocument.getDocumentEndPosition());
274
+ const intervalDescriptor = ModelParametersChecker.intervalDescriptor("interval", getResult);
275
+ return ApiParametersChecker.check(value, parameterIndex, false, [intervalDescriptor]);
276
+ }
275
277
  }
276
278
  function insertSpecialCharacter(position, text, processor, subDocument) {
277
279
  position = ApiParametersChecker.check(position, 1, false, [
@@ -13,7 +13,7 @@ export interface ITableCellBorders {
13
13
  bottom?: TableBorderApi;
14
14
  left?: TableBorderApi;
15
15
  }
16
- export declare class TableBordersBaseApi {
16
+ export declare abstract class TableBordersBaseApi {
17
17
  top: TableBorderApi;
18
18
  right: TableBorderApi;
19
19
  bottom: TableBorderApi;
@@ -6,6 +6,7 @@ export declare enum FileTabCommandId {
6
6
  DownloadDocx = 418,
7
7
  DownloadRtf = 419,
8
8
  DownloadTxt = 420,
9
+ DownloadHtml = 421,
9
10
  PrintDocument = 416
10
11
  }
11
12
  export declare enum HomeTabCommandId {
@@ -7,6 +7,7 @@ export var FileTabCommandId;
7
7
  FileTabCommandId[FileTabCommandId["DownloadDocx"] = 418] = "DownloadDocx";
8
8
  FileTabCommandId[FileTabCommandId["DownloadRtf"] = 419] = "DownloadRtf";
9
9
  FileTabCommandId[FileTabCommandId["DownloadTxt"] = 420] = "DownloadTxt";
10
+ FileTabCommandId[FileTabCommandId["DownloadHtml"] = 421] = "DownloadHtml";
10
11
  FileTabCommandId[FileTabCommandId["PrintDocument"] = 416] = "PrintDocument";
11
12
  })(FileTabCommandId || (FileTabCommandId = {}));
12
13
  export var HomeTabCommandId;
@@ -2,6 +2,8 @@ import { IModelManager } from '../../common/model-manager';
2
2
  import { DocumentModel } from '../../common/model/document-model';
3
3
  import { FieldRequestManager } from '../../common/model/fields/field-request-manager';
4
4
  import { RichOptions } from '../../common/model/options/rich-options';
5
+ import { IRichEditUnitConverter } from '../../common/utils/unit-converter';
6
+ import { DocumentRenderer } from '../../common/canvas/renderes/common/document-renderer';
5
7
  import { DocumentProcessorBase } from '../document-processor/processor';
6
8
  import { DocumentProcessorBaseApi } from '../document-processor/public/processor';
7
9
  export declare class DocumentProcessorClient extends DocumentProcessorBase {
@@ -10,5 +12,5 @@ export declare class DocumentProcessorClient extends DocumentProcessorBase {
10
12
  }
11
13
  export declare class DocumentProcessorApi extends DocumentProcessorBaseApi {
12
14
  protected _processor: DocumentProcessorClient;
13
- constructor(options: RichOptions);
15
+ constructor(options: RichOptions, documentRenderer: DocumentRenderer, uiUnitConverter: IRichEditUnitConverter, sessionGuid: string, clientGuid: string);
14
16
  }
@@ -12,8 +12,8 @@ export class DocumentProcessorClient extends DocumentProcessorBase {
12
12
  }
13
13
  }
14
14
  export class DocumentProcessorApi extends DocumentProcessorBaseApi {
15
- constructor(options) {
15
+ constructor(options, documentRenderer, uiUnitConverter, sessionGuid, clientGuid) {
16
16
  super();
17
- this._processor = new DocumentProcessorClient(options);
17
+ this._processor = new DocumentProcessorClient(options, documentRenderer, uiUnitConverter, sessionGuid, clientGuid);
18
18
  }
19
19
  }
@@ -6,6 +6,7 @@ export declare enum FileTabItemId {
6
6
  DownloadDocx = 418,
7
7
  DownloadRtf = 419,
8
8
  DownloadTxt = 420,
9
+ DownloadHtml = 421,
9
10
  PrintDocument = 416
10
11
  }
11
12
  export declare enum HomeTabItemId {
@@ -7,6 +7,7 @@ export var FileTabItemId;
7
7
  FileTabItemId[FileTabItemId["DownloadDocx"] = 418] = "DownloadDocx";
8
8
  FileTabItemId[FileTabItemId["DownloadRtf"] = 419] = "DownloadRtf";
9
9
  FileTabItemId[FileTabItemId["DownloadTxt"] = 420] = "DownloadTxt";
10
+ FileTabItemId[FileTabItemId["DownloadHtml"] = 421] = "DownloadHtml";
10
11
  FileTabItemId[FileTabItemId["PrintDocument"] = 416] = "PrintDocument";
11
12
  })(FileTabItemId || (FileTabItemId = {}));
12
13
  export var HomeTabItemId;
@@ -27,6 +27,7 @@ import { NusaSettings } from './nusa/settings';
27
27
  import { IPrintingSettings } from './options';
28
28
  import { RibbonItemId } from './ribbon/item-ids';
29
29
  import { Ribbon } from './ribbon/ribbon';
30
+ import '../../common/utils/_license';
30
31
  declare class RichEditPublic {
31
32
  readonly document: RichEditDocument;
32
33
  readonly layout: RichEditLayout;
@@ -126,7 +127,7 @@ export { BookmarkApi as Bookmark } from '../model-api/bookmark';
126
127
  export { BookmarkClientApi as BookmarkBase } from '../api/bookmark';
127
128
  export { PaperSizeApi as PaperSize } from '../model-api/section';
128
129
  export { TableApi as Table } from '../model-api/table/table';
129
- export { TableBordersApi as TableBorders, TableCellBordersApi as TableCellBorders, TableBorderApi as TableBorder, ITableBorders, ITableCellBorders, } from '../model-api/table/table-borders';
130
+ export { TableBordersBaseApi as TableBordersBase, TableBordersApi as TableBorders, TableCellBordersApi as TableCellBorders, TableBorderApi as TableBorder, ITableBorders, ITableCellBorders, } from '../model-api/table/table-borders';
130
131
  export { TableStyleOptionsApi as TableStyleOptions } from '../model-api/table/table-style-options';
131
132
  export { TableWidthTypeApi as TableWidthType, TableContentVerticalAlignmentApi as TableContentVerticalAlignment, TableContentHorizontalAlignmentApi as TableContentHorizontalAlignment, TableRowHeightTypeApi as TableRowHeightType, BorderLineStyleApi as BorderLineStyle, } from '../model-api/table/enums';
132
133
  export { SectionApi as Section } from '../model-api/section';
@@ -14,7 +14,7 @@ import { Base64Utils } from '@devexpress/utils/lib/utils/base64';
14
14
  import { isDefined, isString } from '@devexpress/utils/lib/utils/common';
15
15
  import { FileUtils } from '@devexpress/utils/lib/utils/file';
16
16
  import { KeyUtils } from '@devexpress/utils/lib/utils/key';
17
- import { OpenXmlMimeType, PlainTextMimeType, RtfMimeType } from '@devexpress/utils/lib/utils/mime-type';
17
+ import { HtmlMimeType, OpenXmlMimeType, PlainTextMimeType, RtfMimeType, } from '@devexpress/utils/lib/utils/mime-type';
18
18
  import { EventArgs } from '../document-processor/docvar-args';
19
19
  import { DocumentProcessorBaseApi } from '../document-processor/public/processor';
20
20
  import { FieldNameApi } from '../model-api/field';
@@ -41,6 +41,7 @@ import { ContextMenuRuntime } from './context-menu/menu';
41
41
  import { DocumentProcessorApi } from './document-processor';
42
42
  import { NusaSettings } from './nusa/settings';
43
43
  import { Utils } from './utils';
44
+ import '../../common/utils/_license';
44
45
  class RichEditPublic {
45
46
  constructor(htmlElement, options) {
46
47
  this._native = new ClientRichEdit(htmlElement, options, this);
@@ -86,12 +87,12 @@ class RichEditPublic {
86
87
  }
87
88
  get events() { return this._native.events; }
88
89
  exportToBase64(callback, documentFormat) {
89
- const format = isDefined(documentFormat) ? documentFormat : this._native.core.getExportDocumentFormat();
90
- exportModelToBase64(this._native.core.modelManager.modelManipulator, format, callback);
90
+ const exportModelOptions = this._native.core.getExportModelOptions({ documentFormat: documentFormat });
91
+ exportModelToBase64(exportModelOptions, callback);
91
92
  }
92
93
  exportToBlob(callback, documentFormat) {
93
- const format = isDefined(documentFormat) ? documentFormat : this._native.core.getExportDocumentFormat();
94
- exportModelToBlob(this._native.core.modelManager.modelManipulator, format, callback);
94
+ const exportModelOptions = this._native.core.getExportModelOptions({ documentFormat: documentFormat });
95
+ exportModelToBlob(exportModelOptions, callback);
95
96
  }
96
97
  exportToArrayBuffer(callback, documentFormat) {
97
98
  this.exportToBlob(blob => {
@@ -113,10 +114,14 @@ class RichEditPublic {
113
114
  case DocumentFormat.PlainText:
114
115
  mimeType = PlainTextMimeType;
115
116
  break;
117
+ case DocumentFormat.Html:
118
+ mimeType = HtmlMimeType;
119
+ break;
116
120
  }
117
- const fileName = OpenDocumentCommand.getFileNameWithoutExtension(this.documentName, format);
121
+ const fileName = OpenDocumentCommand.getFileNameWithoutExtension(this.documentName);
118
122
  const extension = Utils.documentFormatToExtension(format);
119
- exportModelToBlob(this._native.core.modelManager.modelManipulator, format, blob => callback(FileUtils.createFile([blob], fileName + extension, { type: mimeType })));
123
+ const exportModelOptions = this._native.core.getExportModelOptions({ documentFormat: format });
124
+ exportModelToBlob(exportModelOptions, blob => callback(FileUtils.createFile([blob], fileName + extension, { type: mimeType })));
120
125
  }
121
126
  exportToPdf(documentName, options) {
122
127
  const core = this._native.core;
@@ -282,7 +287,9 @@ class RichEditPublic {
282
287
  const modelManager = this._native.core.modelManager;
283
288
  const procOptions = modelManager.richOptions.clone();
284
289
  procOptions.spellChecker.isEnabled = false;
285
- const proc = new DocumentProcessorApi(procOptions);
290
+ const { viewManager, uiUnitConverter } = this._native.core;
291
+ const { sguid, cguid } = this._native.core.getGuidParams();
292
+ const proc = new DocumentProcessorApi(procOptions, viewManager.renderer, uiUnitConverter, sguid, cguid);
286
293
  if (options.cloneCurrentModel)
287
294
  proc._importInnerDocument(modelManager.model.clone());
288
295
  else
@@ -334,7 +341,7 @@ export { BookmarkApi as Bookmark } from '../model-api/bookmark';
334
341
  export { BookmarkClientApi as BookmarkBase } from '../api/bookmark';
335
342
  export { PaperSizeApi as PaperSize } from '../model-api/section';
336
343
  export { TableApi as Table } from '../model-api/table/table';
337
- export { TableBordersApi as TableBorders, TableCellBordersApi as TableCellBorders, TableBorderApi as TableBorder, } from '../model-api/table/table-borders';
344
+ export { TableBordersBaseApi as TableBordersBase, TableBordersApi as TableBorders, TableCellBordersApi as TableCellBorders, TableBorderApi as TableBorder, } from '../model-api/table/table-borders';
338
345
  export { TableStyleOptionsApi as TableStyleOptions } from '../model-api/table/table-style-options';
339
346
  export { TableWidthTypeApi as TableWidthType, TableContentVerticalAlignmentApi as TableContentVerticalAlignment, TableContentHorizontalAlignmentApi as TableContentHorizontalAlignment, TableRowHeightTypeApi as TableRowHeightType, BorderLineStyleApi as BorderLineStyle, } from '../model-api/table/enums';
340
347
  export { SectionApi as Section } from '../model-api/section';
@@ -73,7 +73,7 @@ export class CanvasManager extends BatchUpdatableObject {
73
73
  DomUtils.removeClassName(this.viewManager.canvas, CSSCLASS_FOCUSED);
74
74
  }
75
75
  getCanvasWidth() {
76
- return SizeUtils.getClientWidth(this.viewManager.canvas);
76
+ return SizeUtils.getOffsetWidth(this.viewManager.canvas.firstElementChild);
77
77
  }
78
78
  onCanvasMouseWheel(evt) {
79
79
  if (!this.viewManager.layout)
@@ -276,6 +276,7 @@ export class CanvasManager extends BatchUpdatableObject {
276
276
  }
277
277
  initCommonEvents() {
278
278
  this.evtHandlersHolder.addListener(this.viewManager.canvas, "scroll", () => this.viewManager.canvasListener.onCanvasScroll());
279
+ this.evtHandlersHolder.addListener(this.viewManager.canvas, "focus", () => this.viewManager.control.focusManager.captureFocus());
279
280
  }
280
281
  initMouseEvents() {
281
282
  this.evtHandlersHolder.addListener(this.viewManager.canvas, "mousedown", this.onCanvasMouseDown.bind(this));
@@ -1,5 +1,5 @@
1
1
  import { Size } from '@devexpress/utils/lib/geometry/size';
2
2
  import { CacheImageInfo } from '../model/caches/images';
3
3
  export interface IPictureRenderer {
4
- renderPictureBoxContent(size: Size, cacheInfo: CacheImageInfo, tip: string): any;
4
+ renderPictureBoxContent(size: Size, cacheInfo: CacheImageInfo, tip: string, altText: string): any;
5
5
  }
@@ -108,7 +108,7 @@ export declare abstract class DocumentRenderer implements IPictureRenderer {
108
108
  protected static replaceFromContainerByObject(id: number, container: Node, cache: Record<number, Node>, newNode: Node): void;
109
109
  protected static insertToContainerByObject(id: number, container: Node, cache: Record<number, Node>, newNode: Node): void;
110
110
  protected static isPageElementEmpty(pageElement: Node): boolean;
111
- renderPictureBoxContent(size: Size, cacheInfo: existingInfo, tip: string): HTMLImageElement;
111
+ renderPictureBoxContent(size: Size, cacheInfo: existingInfo, tip: string, altText: string): HTMLImageElement;
112
112
  }
113
113
  export declare class DocumentRendererPageCache {
114
114
  page: HTMLElement;
@@ -26,6 +26,8 @@ import { NumberMapUtils } from '@devexpress/utils/lib/utils/map/number';
26
26
  import { MathUtils } from '@devexpress/utils/lib/utils/math';
27
27
  import { CanvasUtils } from '../../utils';
28
28
  import { ScrollState } from '../../../scroll/model-states';
29
+ import { isDefined } from '@devexpress/utils/lib/utils/common';
30
+ import { StringUtils } from '@devexpress/utils/lib/utils/string';
29
31
  export class SimpleViewCanvasSizeManager {
30
32
  constructor(canvasManager, control) {
31
33
  this.size = new Size(0, 0);
@@ -577,7 +579,7 @@ export class DocumentRenderer {
577
579
  return div;
578
580
  }
579
581
  renderPicture(box) {
580
- return this.renderPictureBoxContent(box.createSize(), box.cacheInfo, box.hyperlinkTip);
582
+ return this.renderPictureBoxContent(box.createSize(), box.cacheInfo, box.hyperlinkTip, box.description);
581
583
  }
582
584
  renderFloatingPicture(box, renderLevelCalculator) {
583
585
  const element = DocumentRenderer.renderContainer(RendererClassNames.ANCHORED_PICTURE + " " + ZIndexHelper.getClassName(renderLevelCalculator.getRenderLevel(box.rendererLevel), zIndexCssClassType.AnchoredPicture));
@@ -822,13 +824,15 @@ export class DocumentRenderer {
822
824
  static isPageElementEmpty(pageElement) {
823
825
  return pageElement.childNodes.length == 0;
824
826
  }
825
- renderPictureBoxContent(size, cacheInfo, tip) {
827
+ renderPictureBoxContent(size, cacheInfo, tip, altText) {
826
828
  const tooltip = tip ? CanvasUtils.buildHyperlinkTipString(tip, this.viewManager.stringResources.commonLabels.clickToFollowHyperlink, this.viewManager.fieldOptions) : "";
827
829
  const img = document.createElement('img');
828
830
  img.setAttribute('src', cacheInfo.base64);
829
831
  if (tooltip) {
830
832
  img.setAttribute('title', tooltip);
831
833
  }
834
+ if (isDefined(altText) && !StringUtils.isNullOrEmpty(altText))
835
+ img.alt = altText;
832
836
  img.style.cssText = `height: ${MathUtils.round(size.height, 3)}px; width: ${MathUtils.round(size.width, 3)}px; vertical-align: baseline`;
833
837
  img.setAttribute('class', RendererClassNames.PICTURE);
834
838
  return img;
@@ -25,6 +25,7 @@ import { MisspelledSelectionRenderer } from './selection-renderers/misspelled-se
25
25
  import { RangePermissionRenderer } from './selection-renderers/range-permission-renderer';
26
26
  import { SearchSelectionRenderer } from './selection-renderers/search-selection-renderer';
27
27
  import { SelectionRenderer } from './selection-renderers/selection-renderer';
28
+ import { SizeUtils } from '../../../common/utils/size-utils';
28
29
  export class ViewManager {
29
30
  constructor(control, canvas, eventManager, stringResources, horizontalRuler, inputController, innerClientProperties, readOnlyPropertyHolder, layoutFormatterManagerHolder, internalApi, fieldOptions) {
30
31
  this.cache = [];
@@ -83,7 +84,8 @@ export class ViewManager {
83
84
  }
84
85
  }
85
86
  else if (this.sizes.isChanged(this.canvas)) {
86
- this.sizes.setVisibleAreaSize(this.canvas.offsetWidth, this.canvas.offsetHeight);
87
+ const size = SizeUtils.getOffsetSize(this.canvas);
88
+ this.sizes.setVisibleAreaSize(size.width, size.height);
87
89
  this.scroll.onCanvasSizeChanged();
88
90
  }
89
91
  }
@@ -4,6 +4,7 @@ import { ImageLoadingOptions } from './model/manipulators/picture-manipulator/lo
4
4
  import { EmptyBatchUpdatableObject } from '@devexpress/utils/lib/class/batch-updatable';
5
5
  import { DataTransferUtils } from '@devexpress/utils/lib/utils/data-transfer';
6
6
  import { EvtUtils } from '@devexpress/utils/lib/utils/evt';
7
+ import { HtmlMimeType } from '@devexpress/utils/lib/utils/mime-type';
7
8
  import { RtfImporterOptions } from './formats/rtf/import/importer-options';
8
9
  import { RtfImporter } from './formats/rtf/import/rtf-importer';
9
10
  import { SubDocumentInterval, SubDocumentPosition } from './model/sub-document';
@@ -17,7 +18,7 @@ export class ClipboardContentInserter {
17
18
  insert(evt) {
18
19
  const plainTextItem = DataTransferUtils.getPlainTextItem(evt.clipboardData.items);
19
20
  const rtfItem = DataTransferUtils.getRtfTextItem(evt.clipboardData.items);
20
- const htmlItem = DataTransferUtils.getTransferItemByType(evt.clipboardData.items, 'text/html');
21
+ const htmlItem = DataTransferUtils.getTransferItemByType(evt.clipboardData.items, HtmlMimeType);
21
22
  if (rtfItem) {
22
23
  this.loadingPanelManager = this.control.loadingPanelManager.loadingPanel.showPanelDelayed(400);
23
24
  EvtUtils.preventEvent(evt);
@@ -389,6 +389,7 @@ export declare enum RichEditClientCommand {
389
389
  DownloadDocx = 418,
390
390
  DownloadRtf = 419,
391
391
  DownloadTxt = 420,
392
+ DownloadHtml = 421,
392
393
  PdfExported = 430,
393
394
  ChangeCaseMenu = 431,
394
395
  AlignParagraphMenu = 432,
@@ -416,5 +417,6 @@ export declare enum RichEditClientCommand {
416
417
  ChangeFloatingObjectTextWrapTypeMenu = 454,
417
418
  FloatingObjectBringForwardMenu = 455,
418
419
  FloatingObjectSendBackwardMenu = 456,
419
- NoSpellingSuggestions = 457
420
+ NoSpellingSuggestions = 457,
421
+ GetHtml = 458
420
422
  }
@@ -390,6 +390,7 @@ export var RichEditClientCommand;
390
390
  RichEditClientCommand[RichEditClientCommand["DownloadDocx"] = 418] = "DownloadDocx";
391
391
  RichEditClientCommand[RichEditClientCommand["DownloadRtf"] = 419] = "DownloadRtf";
392
392
  RichEditClientCommand[RichEditClientCommand["DownloadTxt"] = 420] = "DownloadTxt";
393
+ RichEditClientCommand[RichEditClientCommand["DownloadHtml"] = 421] = "DownloadHtml";
393
394
  RichEditClientCommand[RichEditClientCommand["PdfExported"] = 430] = "PdfExported";
394
395
  RichEditClientCommand[RichEditClientCommand["ChangeCaseMenu"] = 431] = "ChangeCaseMenu";
395
396
  RichEditClientCommand[RichEditClientCommand["AlignParagraphMenu"] = 432] = "AlignParagraphMenu";
@@ -418,4 +419,5 @@ export var RichEditClientCommand;
418
419
  RichEditClientCommand[RichEditClientCommand["FloatingObjectBringForwardMenu"] = 455] = "FloatingObjectBringForwardMenu";
419
420
  RichEditClientCommand[RichEditClientCommand["FloatingObjectSendBackwardMenu"] = 456] = "FloatingObjectSendBackwardMenu";
420
421
  RichEditClientCommand[RichEditClientCommand["NoSpellingSuggestions"] = 457] = "NoSpellingSuggestions";
422
+ RichEditClientCommand[RichEditClientCommand["GetHtml"] = 458] = "GetHtml";
421
423
  })(RichEditClientCommand || (RichEditClientCommand = {}));
@@ -1,4 +1,4 @@
1
- import { HtmlBuilder } from '../../html-export';
1
+ import { HtmlBuilder } from '../../formats/html/export/html-builder';
2
2
  import { RendererClassNames } from '../../canvas/renderer-class-names';
3
3
  import { UpdateFieldsOptions } from '../../model/fields/tree-creator';
4
4
  import { ControlOptions } from '../../model/options/control';
@@ -17,6 +17,7 @@ import { SelectionHistoryItem } from '../../model/history/selection/selection-hi
17
17
  import { RichEditClientCommand } from '../client-command';
18
18
  import { CommandBase, CommandSimpleOptions } from '../command-base';
19
19
  import { SimpleCommandState } from '../command-states';
20
+ import { HtmlMimeType, PlainTextMimeType } from '@devexpress/utils/lib/utils/mime-type';
20
21
  export class ClipboardCommand extends CommandBase {
21
22
  constructor(control, queryCommandId) {
22
23
  super(control);
@@ -303,10 +304,10 @@ export class ClipboardHelper {
303
304
  }
304
305
  insertClipboardItems(items) {
305
306
  for (let item of items) {
306
- if (ListUtils.anyOf(item.types, type => type === 'text/html'))
307
- return this.insertClipboardItem(item, 'text/html', html => this.insertHtml(html));
308
- if (ListUtils.anyOf(item.types, type => type === 'text/plain'))
309
- return this.insertClipboardItem(item, 'text/plain', text => this.insertPlainText(text));
307
+ if (ListUtils.anyOf(item.types, type => type === HtmlMimeType))
308
+ return this.insertClipboardItem(item, HtmlMimeType, html => this.insertHtml(html));
309
+ if (ListUtils.anyOf(item.types, type => type === PlainTextMimeType))
310
+ return this.insertClipboardItem(item, PlainTextMimeType, text => this.insertPlainText(text));
310
311
  }
311
312
  return Promise.reject(ClipboardHelper.noDataInClipboardMessage);
312
313
  }
@@ -348,7 +349,8 @@ export class ClipboardHelper {
348
349
  writeToClipboard(clipboardData) {
349
350
  ClipboardHelper.lastWritenTextHash = -1;
350
351
  return new Promise((resolve, reject) => {
351
- const exporter = new TxtExporter(this.createModelManager(clipboardData.model).modelManipulator, new DocumentExporterOptions());
352
+ const modelManager = this.createModelManager(clipboardData.model);
353
+ const exporter = new TxtExporter(modelManager.modelManipulator, new DocumentExporterOptions());
352
354
  exporter.exportToBlob((blob) => __awaiter(this, void 0, void 0, function* () {
353
355
  const text = yield this.readAsText(blob);
354
356
  if (this.useWithBuildInClipboard)
@@ -16,9 +16,11 @@ export declare const mimeTypeIntoDocumentFormat: {
16
16
  4: DocumentFormat;
17
17
  2: DocumentFormat;
18
18
  3: DocumentFormat;
19
+ 14: DocumentFormat;
19
20
  };
20
21
  export declare const documentFormatIntoMimeType: {
21
22
  4: DxMimeType;
22
23
  2: DxMimeType;
23
24
  1: DxMimeType;
25
+ 3: DxMimeType;
24
26
  };