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
@@ -1,11 +1,14 @@
|
|
1
|
-
import { MapCreator } from '../../../../utils/map-creator';
|
2
|
-
import { BorderLineStyle } from '../../../../model/borders/enums';
|
3
|
-
import { MaskedParagraphProperties, ParagraphAlignment, ParagraphFirstLineIndent, ParagraphLineSpacingType, ParagraphPropertiesMask } from '../../../../model/paragraph/paragraph-properties';
|
4
|
-
import { TableWidthUnit, TableWidthUnitType } from '../../../../model/tables/secondary-structures/table-units';
|
5
1
|
import { Errors } from '@devexpress/utils/lib/errors';
|
6
2
|
import { AttrUtils } from '@devexpress/utils/lib/utils/attr';
|
7
3
|
import { DomUtils } from '@devexpress/utils/lib/utils/dom';
|
8
4
|
import { MathUtils } from '@devexpress/utils/lib/utils/math';
|
5
|
+
import { ColorUtils } from '@devexpress/utils/lib/utils/color';
|
6
|
+
import { MapCreator } from '../../../../utils/map-creator';
|
7
|
+
import { BorderLineStyle } from '../../../../model/borders/enums';
|
8
|
+
import { MaskedParagraphProperties, ParagraphAlignment, ParagraphFirstLineIndent, ParagraphLineSpacingType, ParagraphPropertiesMask } from '../../../../model/paragraph/paragraph-properties';
|
9
|
+
import { TableWidthUnit, TableWidthUnitType } from '../../../../model/tables/secondary-structures/table-units';
|
10
|
+
import { ShadingInfo } from '../../../../model/shadings/shading-info';
|
11
|
+
import { ColorModelInfo } from '../../../../model/color/color-model-info';
|
9
12
|
import { HtmlImportUtils } from './utils';
|
10
13
|
export class HtmlImporterMaskedParagraphProperties {
|
11
14
|
import(colorProvider, element, isTableCellTag) {
|
@@ -20,6 +23,7 @@ export class HtmlImporterMaskedParagraphProperties {
|
|
20
23
|
this.importLineSpacing();
|
21
24
|
this.importSpacingBefore();
|
22
25
|
this.importSpacingAfter();
|
26
|
+
this.importBackColor();
|
23
27
|
if (!isTableCellTag) {
|
24
28
|
this.importTopBorder(colorProvider, calculatedStyle);
|
25
29
|
this.importRightBorder(colorProvider, calculatedStyle);
|
@@ -74,6 +78,15 @@ export class HtmlImporterMaskedParagraphProperties {
|
|
74
78
|
this.result.setUseValue(ParagraphPropertiesMask.UseSpacingAfter, true);
|
75
79
|
}
|
76
80
|
}
|
81
|
+
importBackColor() {
|
82
|
+
if (this.element.style.backgroundColor !== "") {
|
83
|
+
const backColor = ColorUtils.fromString(this.element.style.backgroundColor);
|
84
|
+
if (backColor) {
|
85
|
+
this.result.shadingInfo = ShadingInfo.createByColor(ColorModelInfo.makeByColor(backColor));
|
86
|
+
this.result.setUseValue(ParagraphPropertiesMask.UseShadingInfoIndex, true);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
77
90
|
importLineSpacing() {
|
78
91
|
this.result.setUseValue(ParagraphPropertiesMask.UseLineSpacing, true);
|
79
92
|
this.result.setUseValue(ParagraphPropertiesMask.UseBeforeAutoSpacing, true);
|
@@ -1,4 +1,18 @@
|
|
1
|
+
import { IPictureRenderer } from "../canvas/picture-renderer";
|
2
|
+
import { DocumentFormat } from "../document-format";
|
3
|
+
import { IModelManager } from "../model-manager";
|
4
|
+
import { IRichEditUnitConverter } from "../utils/unit-converter";
|
1
5
|
export interface IDocumentExporter {
|
2
6
|
exportToBlob(callback: (blob: Blob) => void): any;
|
3
7
|
exportToBase64(callback: (base64: string) => void): any;
|
4
8
|
}
|
9
|
+
export interface IExportModelOptions {
|
10
|
+
modelManager: IModelManager;
|
11
|
+
documentFormat: DocumentFormat;
|
12
|
+
pictureRenderer: IPictureRenderer;
|
13
|
+
uiUnitConverter: IRichEditUnitConverter;
|
14
|
+
sessionGuid: string;
|
15
|
+
clientGuid: string;
|
16
|
+
lastMaxNumPages?: number;
|
17
|
+
pageIndex?: number;
|
18
|
+
}
|
@@ -7,12 +7,12 @@ import { RtfExportHelper } from './helpers/rtf-export-helper';
|
|
7
7
|
import { RtfBuilder } from './rtf-builder';
|
8
8
|
import { RtfDocumentExporterOptions } from './rtf-document-exporter-options';
|
9
9
|
export declare class RtfExporter implements IDocumentExporter {
|
10
|
-
documentModel: DocumentModel;
|
11
10
|
options: RtfDocumentExporterOptions;
|
12
11
|
rtfExportHelper: RtfExportHelper;
|
13
12
|
rtfBuilder: RtfBuilder;
|
14
13
|
contentExporter: RtfContentExporter;
|
15
14
|
private modelManipulator;
|
15
|
+
get documentModel(): DocumentModel;
|
16
16
|
constructor(modelManipulator: ModelManipulator, options: RtfDocumentExporterOptions);
|
17
17
|
exportToBlob(callback: (blob: Blob) => void): void;
|
18
18
|
exportToBase64(callback: (base64: string) => void): void;
|
@@ -12,12 +12,12 @@ import { RtfExportHelper } from './helpers/rtf-export-helper';
|
|
12
12
|
export class RtfExporter {
|
13
13
|
constructor(modelManipulator, options) {
|
14
14
|
this.modelManipulator = modelManipulator;
|
15
|
-
this.documentModel = modelManipulator.model;
|
16
15
|
this.options = options;
|
17
16
|
this.rtfExportHelper = new RtfExportHelper();
|
18
17
|
this.contentExporter = new RtfContentExporter(this.documentModel, options, this.rtfExportHelper);
|
19
18
|
this.rtfBuilder = this.contentExporter.createRtfBuilder();
|
20
19
|
}
|
20
|
+
get documentModel() { return this.modelManipulator.model; }
|
21
21
|
exportToBlob(callback) {
|
22
22
|
this.modelManipulator.picture.loader.ensureAllPicturesLoaded(this.options.ensurePictureLoadedTimeout, (_loaded) => {
|
23
23
|
callback(new Blob([this.exportAsString()], { type: 'application/rtf' }));
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import { FixedInterval } from "@devexpress/utils/lib/intervals/fixed";
|
1
2
|
import { RichOptions } from "../../model/options/rich-options";
|
2
3
|
import { SubDocument } from "../../model/sub-document";
|
3
4
|
import { IProcessor } from "../../processor";
|
4
|
-
import { FixedInterval } from "@devexpress/utils/lib/intervals/fixed";
|
5
5
|
export declare function getRtfFromSubDocumentPublic(richOptions: RichOptions, subDocument: SubDocument, coreInterval: FixedInterval): string;
|
6
6
|
export declare function insertRtfInSubDocumentPublic(processor: IProcessor, subDocument: SubDocument, position: number, rtf: string, callback: (interval: FixedInterval, isRtfValid: boolean) => void): void;
|
@@ -1,7 +1,7 @@
|
|
1
|
+
import { EmptyBatchUpdatableObject } from "@devexpress/utils/lib/class/batch-updatable";
|
1
2
|
import { ClientModelManager } from "../../model-manager";
|
2
3
|
import { RangeCopy } from "../../model/manipulators/range/create-range-copy-operation";
|
3
4
|
import { SubDocumentIntervals } from "../../model/sub-document";
|
4
|
-
import { EmptyBatchUpdatableObject } from "@devexpress/utils/lib/class/batch-updatable";
|
5
5
|
import { RtfExporter } from "./export/exporter";
|
6
6
|
import { RtfDocumentExporterOptions } from "./export/rtf-document-exporter-options";
|
7
7
|
import { RtfImporterOptions } from "./import/importer-options";
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
2
2
|
import { Base64Utils } from '@devexpress/utils/lib/utils/base64';
|
3
|
+
import { PlainTextMimeType } from '@devexpress/utils/lib/utils/mime-type';
|
3
4
|
export class TxtExporter {
|
4
5
|
constructor(modelManipulator, options) {
|
5
6
|
this.modelManipulator = modelManipulator;
|
@@ -23,7 +24,7 @@ export class TxtExporter {
|
|
23
24
|
text += '\r\n';
|
24
25
|
text += this.model.mainSubDocument.getSimpleText(new FixedInterval(p.startLogPosition.value, p.length));
|
25
26
|
});
|
26
|
-
callback(new Blob([text], { type:
|
27
|
+
callback(new Blob([text], { type: PlainTextMimeType }));
|
27
28
|
});
|
28
29
|
}
|
29
30
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { RangeCopy } from './model/manipulators/range/create-range-copy-operation';
|
2
2
|
import { DomEventHandlersHolder } from '@devexpress/utils/lib/class/event-handlers-holder';
|
3
|
-
import { HtmlBuilder } from './html-export';
|
4
3
|
import { IEventManager } from './interfaces/i-event-manager';
|
5
4
|
import { IRichEditControl } from './interfaces/i-rich-edit-core';
|
5
|
+
import { HtmlBuilder } from './formats/html/export/html-builder';
|
6
6
|
export declare const INPUT_CLASS_NAME = "dxreInputTarget";
|
7
7
|
export declare abstract class InputEditorBase<TInpElement extends HTMLElement> {
|
8
8
|
eventManager: IEventManager;
|
@@ -130,6 +130,7 @@ export declare class InputController {
|
|
130
130
|
inputEditor: InputEditorBase<HTMLElement>;
|
131
131
|
private exporter;
|
132
132
|
constructor(control: IRichEditControl, eventManager: IEventManager, parent: HTMLElement);
|
133
|
+
initExporter(): void;
|
133
134
|
dispose(): void;
|
134
135
|
private createInputEditor;
|
135
136
|
getEditableDocument(): HTMLElement | Document;
|
@@ -16,8 +16,9 @@ import { PopupUtils } from '@devexpress/utils/lib/utils/popup';
|
|
16
16
|
import { StringUtils } from '@devexpress/utils/lib/utils/string';
|
17
17
|
import { ClipboardContentInserter } from './clipboard-content-inserter';
|
18
18
|
import { RichEditClientCommand } from './commands/client-command';
|
19
|
-
import { HtmlBuilder, HtmlExporter } from './html-export';
|
20
19
|
import { ReadOnlyMode } from './interfaces/i-rich-edit-core';
|
20
|
+
import { HtmlExporter } from './formats/html/export/html-export';
|
21
|
+
import { HtmlBuilder } from './formats/html/export/html-builder';
|
21
22
|
export const INPUT_CLASS_NAME = "dxreInputTarget";
|
22
23
|
const EMPTY_KEYCODE = 229;
|
23
24
|
const TAB_KEYCODE = 9;
|
@@ -716,7 +717,9 @@ export class InputController {
|
|
716
717
|
constructor(control, eventManager, parent) {
|
717
718
|
this.control = control;
|
718
719
|
this.inputEditor = this.createInputEditor(parent, eventManager);
|
719
|
-
|
720
|
+
}
|
721
|
+
initExporter() {
|
722
|
+
this.exporter = new HtmlExporter(this.control.getExportModelOptions());
|
720
723
|
}
|
721
724
|
dispose() {
|
722
725
|
this.inputEditor.dispose();
|
@@ -36,6 +36,7 @@ import { SelectionModelChangesListener } from '../selection/selection-model-chan
|
|
36
36
|
import { IRulerControl } from '../ui/ruler/ruler';
|
37
37
|
import { SearchManager } from '../ui/search-manager';
|
38
38
|
import { IControlOwner } from './i-control-owner';
|
39
|
+
import { IExportModelOptions } from '../formats/i-document-exporter';
|
39
40
|
export interface IBarListener extends IEventListener {
|
40
41
|
NotifyBarCommandExecuted(commandID: RichEditClientCommand, parameter: any): any;
|
41
42
|
NotifyBarUpdateRequested(): any;
|
@@ -83,6 +84,7 @@ export interface IRichEditControl extends IBatchUpdatableObject, IDisposable, IR
|
|
83
84
|
owner: IControlOwner;
|
84
85
|
selectionModelChangesListener: SelectionModelChangesListener;
|
85
86
|
pdfHelperFrame: PdfHelperFrame;
|
87
|
+
getExportModelOptions(initOptions?: Partial<IExportModelOptions>): IExportModelOptions;
|
86
88
|
isClientMode(): boolean;
|
87
89
|
createFieldRequestManager(): FieldRequestManager;
|
88
90
|
initialize(sessionGuid: string, documentInfo: DocumentInfo, subDocumentsCounter: number, documentModel: DocumentModel): any;
|
@@ -10,7 +10,8 @@ import { LayoutBoxType } from './layout-box';
|
|
10
10
|
export declare class LayoutAnchoredPictureBox extends LayoutAnchoredObjectBox implements ICloneable<LayoutAnchoredPictureBox> {
|
11
11
|
cacheInfo: CacheImageInfo;
|
12
12
|
isLoaded: boolean;
|
13
|
-
|
13
|
+
descrtiption: string;
|
14
|
+
constructor(characterProperties: CharacterProperties, colorInfo: LayoutCharacterPropertiesColorInfo, belongsToSubDocId: number, anchorInfo: AnchorInfo, shape: Shape, objectId: number, rotationInRadians: number, cacheInfo: CacheImageInfo, descrtiption: string);
|
14
15
|
getType(): LayoutBoxType;
|
15
16
|
equals(obj: LayoutAnchoredPictureBox): boolean;
|
16
17
|
clone(): LayoutAnchoredPictureBox;
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { LayoutAnchoredObjectBox } from './layout-anchored-object-box';
|
2
2
|
import { LayoutBoxType } from './layout-box';
|
3
3
|
export class LayoutAnchoredPictureBox extends LayoutAnchoredObjectBox {
|
4
|
-
constructor(characterProperties, colorInfo, belongsToSubDocId, anchorInfo, shape, objectId, rotationInRadians, cacheInfo) {
|
4
|
+
constructor(characterProperties, colorInfo, belongsToSubDocId, anchorInfo, shape, objectId, rotationInRadians, cacheInfo, descrtiption) {
|
5
5
|
super(characterProperties, colorInfo, belongsToSubDocId, anchorInfo, shape, objectId, rotationInRadians);
|
6
6
|
this.cacheInfo = cacheInfo;
|
7
|
+
this.descrtiption = descrtiption;
|
7
8
|
this.isLoaded = this.cacheInfo.isLoaded;
|
8
9
|
}
|
9
10
|
getType() {
|
@@ -13,11 +14,11 @@ export class LayoutAnchoredPictureBox extends LayoutAnchoredObjectBox {
|
|
13
14
|
return super.equals(obj) && this.cacheInfo.equals(obj.cacheInfo) && this.isLoaded == obj.isLoaded;
|
14
15
|
}
|
15
16
|
clone() {
|
16
|
-
const newObject = new LayoutAnchoredPictureBox(this.characterProperties, this.colorInfo, this.belongsToSubDocId, this.anchorInfo, this.shape, this.objectId, this.rotationInRadians, this.cacheInfo);
|
17
|
+
const newObject = new LayoutAnchoredPictureBox(this.characterProperties, this.colorInfo, this.belongsToSubDocId, this.anchorInfo, this.shape, this.objectId, this.rotationInRadians, this.cacheInfo, this.descrtiption);
|
17
18
|
newObject.copyFrom(this);
|
18
19
|
return newObject;
|
19
20
|
}
|
20
21
|
renderGetContent(renderer) {
|
21
|
-
return renderer.renderPictureBoxContent(this.createSize(), this.cacheInfo, this.hyperlinkTip);
|
22
|
+
return renderer.renderPictureBoxContent(this.createSize(), this.cacheInfo, this.hyperlinkTip, this.descrtiption);
|
22
23
|
}
|
23
24
|
}
|
@@ -9,7 +9,8 @@ import { LayoutBox, LayoutBoxType } from './layout-box';
|
|
9
9
|
export declare class LayoutPictureBox extends LayoutBox implements ICloneable<LayoutPictureBox>, ISupportCopyFrom<LayoutPictureBox> {
|
10
10
|
cacheInfo: CacheImageInfo;
|
11
11
|
isLoaded: boolean;
|
12
|
-
|
12
|
+
description: string;
|
13
|
+
constructor(characterProperties: CharacterProperties, colorInfo: LayoutCharacterPropertiesColorInfo, cacheInfo: CacheImageInfo, size: Size, description: string);
|
13
14
|
equals(obj: LayoutPictureBox): boolean;
|
14
15
|
clone(): LayoutPictureBox;
|
15
16
|
getType(): LayoutBoxType;
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import { LayoutBox, LayoutBoxType } from './layout-box';
|
2
2
|
export class LayoutPictureBox extends LayoutBox {
|
3
|
-
constructor(characterProperties, colorInfo, cacheInfo, size) {
|
3
|
+
constructor(characterProperties, colorInfo, cacheInfo, size, description) {
|
4
4
|
super(characterProperties, colorInfo);
|
5
5
|
this.cacheInfo = cacheInfo;
|
6
6
|
this.width = size.width;
|
7
7
|
this.height = size.height;
|
8
|
+
this.description = description;
|
8
9
|
this.isLoaded = this.cacheInfo.isLoaded;
|
9
10
|
}
|
10
11
|
equals(obj) {
|
11
|
-
return super.equals(obj) && this.cacheInfo.equals(obj.cacheInfo) && this.isLoaded == obj.isLoaded;
|
12
|
+
return super.equals(obj) && this.cacheInfo.equals(obj.cacheInfo) && this.isLoaded == obj.isLoaded && this.description === obj.description;
|
12
13
|
}
|
13
14
|
clone() {
|
14
|
-
const newObj = new LayoutPictureBox(this.characterProperties, this.colorInfo, this.cacheInfo, this.createSize());
|
15
|
+
const newObj = new LayoutPictureBox(this.characterProperties, this.colorInfo, this.cacheInfo, this.createSize(), this.description);
|
15
16
|
newObj.copyFrom(this);
|
16
17
|
return newObj;
|
17
18
|
}
|
@@ -33,7 +34,7 @@ export class LayoutPictureBox extends LayoutBox {
|
|
33
34
|
return true;
|
34
35
|
}
|
35
36
|
renderGetContent(renderer) {
|
36
|
-
return renderer.renderPictureBoxContent(this.createSize(), this.cacheInfo, this.hyperlinkTip);
|
37
|
+
return renderer.renderPictureBoxContent(this.createSize(), this.cacheInfo, this.hyperlinkTip, this.description);
|
37
38
|
}
|
38
39
|
isWhitespace() {
|
39
40
|
return false;
|
@@ -58,4 +58,5 @@ export declare class LayoutPage extends Rectangle {
|
|
58
58
|
static getLastValidPageInGroup(pages: LayoutPage[], pageIndex: number, validPageCount: number, checkValid: boolean, tryFindPage: boolean): LayoutPage;
|
59
59
|
getEndPosition(): number;
|
60
60
|
static getPrevPageLastPosition(pages: LayoutPage[], currPageIndex: number): number;
|
61
|
+
removeOtherPageArea(subDocId: number): void;
|
61
62
|
}
|
@@ -43,7 +43,7 @@ export class LayoutPage extends Rectangle {
|
|
43
43
|
this.mainSubDocumentPageAreas = [];
|
44
44
|
this.otherPageAreas = {};
|
45
45
|
this.flags = new Flag();
|
46
|
-
this.anchoredObjectHolder = new PageAnchoredObjectHolder();
|
46
|
+
this.anchoredObjectHolder = new PageAnchoredObjectHolder(this);
|
47
47
|
this.tableAnchoredObjectsHolder = new TableAnchoredObjectsHolder();
|
48
48
|
}
|
49
49
|
setRenderLevelCalculator(anchorObjectsPositionInfo, compatibilityMode) {
|
@@ -78,7 +78,7 @@ export class LayoutPage extends Rectangle {
|
|
78
78
|
obj.index = this.index;
|
79
79
|
obj.layoutPageIndex = this.layoutPageIndex;
|
80
80
|
obj.pageOrdinal = this.pageOrdinal;
|
81
|
-
obj.anchoredObjectHolder = this.anchoredObjectHolder.shallowCopy();
|
81
|
+
obj.anchoredObjectHolder = this.anchoredObjectHolder.shallowCopy(obj);
|
82
82
|
obj.tableAnchoredObjectsHolder = this.tableAnchoredObjectsHolder.shallowCopy();
|
83
83
|
obj.contentIntervals = ListUtils.shallowCopy(this.contentIntervals);
|
84
84
|
obj.startPageSectionIndex = this.startPageSectionIndex;
|
@@ -167,6 +167,9 @@ export class LayoutPage extends Rectangle {
|
|
167
167
|
const prevPage = pages[currPageIndex - 1];
|
168
168
|
return prevPage ? prevPage.getEndPosition() : 0;
|
169
169
|
}
|
170
|
+
removeOtherPageArea(subDocId) {
|
171
|
+
delete this.otherPageAreas[subDocId];
|
172
|
+
}
|
170
173
|
}
|
171
174
|
class ContentIntervalCollector {
|
172
175
|
constructor(mainSubDocumentPageAreas, startPagePos) {
|
@@ -48,6 +48,7 @@ export declare class BoxGenerator {
|
|
48
48
|
private makeDashBox;
|
49
49
|
private makeParagraphAndSectionBox;
|
50
50
|
private isLastParagraphInCell;
|
51
|
+
private skipCurrentRun;
|
51
52
|
private makeInlinePictureBox;
|
52
53
|
private makeAnchoredPictureRun;
|
53
54
|
static createLayoutAnchoredTextBoxFromRun(anchorTextBox: AnchoredTextBoxRun, subDocumentId: number, colorProvider: ColorProvider): LayoutAnchoredTextBox;
|
@@ -290,6 +290,12 @@ export class BoxGenerator {
|
|
290
290
|
case RunType.LayoutDependentRun:
|
291
291
|
this.makeLayoutDependentRun();
|
292
292
|
break;
|
293
|
+
case RunType.FootNoteRun:
|
294
|
+
this.skipCurrentRun();
|
295
|
+
break;
|
296
|
+
case RunType.EndNoteRun:
|
297
|
+
this.skipCurrentRun();
|
298
|
+
break;
|
293
299
|
default: this.makeDefault();
|
294
300
|
}
|
295
301
|
}
|
@@ -322,11 +328,15 @@ export class BoxGenerator {
|
|
322
328
|
return false;
|
323
329
|
return paragraph.getEndPosition() == tableCell.interval.end;
|
324
330
|
}
|
331
|
+
skipCurrentRun() {
|
332
|
+
this.modelIterator.charOffset = this.run.getLength();
|
333
|
+
this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
|
334
|
+
}
|
325
335
|
makeInlinePictureBox() {
|
326
336
|
const inlinePictureRun = this.run;
|
327
337
|
this.modelIterator.charOffset++;
|
328
338
|
const charProps = inlinePictureRun.getCharacterMergedProperties();
|
329
|
-
this.addNewBoxInfo(new LayoutPictureBox(charProps, charProps.getLayoutColorInfo(this.colorProvider), inlinePictureRun.cacheInfo, inlinePictureRun.getActualSize().applyConverter(UnitConverter.twipsToPixelsF)));
|
339
|
+
this.addNewBoxInfo(new LayoutPictureBox(charProps, charProps.getLayoutColorInfo(this.colorProvider), inlinePictureRun.cacheInfo, inlinePictureRun.getActualSize().applyConverter(UnitConverter.twipsToPixelsF), inlinePictureRun.info.nonVisualDrawingProperties.description));
|
330
340
|
this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
|
331
341
|
}
|
332
342
|
makeAnchoredPictureRun() {
|
@@ -335,7 +345,7 @@ export class BoxGenerator {
|
|
335
345
|
if (anchorPictureRun.anchorInfo.hidden)
|
336
346
|
return;
|
337
347
|
const charProps = anchorPictureRun.getCharacterMergedProperties();
|
338
|
-
this.addNewBoxInfo(new LayoutAnchoredPictureBox(charProps, charProps.getLayoutColorInfo(this.colorProvider), this.subDocument.id, anchorPictureRun.anchorInfo.clone(), anchorPictureRun.shape.clone().applyConverter(UnitConverter.twipsToPixelsF), anchorPictureRun.anchoredObjectID, UnitConverter.twipsToRadians(anchorPictureRun.size.rotation), anchorPictureRun.cacheInfo)
|
348
|
+
this.addNewBoxInfo(new LayoutAnchoredPictureBox(charProps, charProps.getLayoutColorInfo(this.colorProvider), this.subDocument.id, anchorPictureRun.anchorInfo.clone(), anchorPictureRun.shape.clone().applyConverter(UnitConverter.twipsToPixelsF), anchorPictureRun.anchoredObjectID, UnitConverter.twipsToRadians(anchorPictureRun.size.rotation), anchorPictureRun.cacheInfo, anchorPictureRun.info.nonVisualDrawingProperties.description)
|
339
349
|
.setPosition(new Point(0, 0))
|
340
350
|
.setSize(anchorPictureRun.getActualSize().applyConverter(UnitConverter.twipsToPixelsF)));
|
341
351
|
this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
|
@@ -3,11 +3,13 @@ import { LayoutAnchoredObjectBox } from '../../layout/main-structures/layout-box
|
|
3
3
|
import { LayoutAnchoredTextBox } from '../../layout/main-structures/layout-boxes/layout-anchored-text-box';
|
4
4
|
import { BaseFormatter } from '../formatter/base-formatter';
|
5
5
|
import { FormatterManager } from '../managers/formatter-manager';
|
6
|
+
import { LayoutPage } from '../../../common/layout/main-structures/layout-page';
|
6
7
|
export declare class PageAnchoredObjectHolder {
|
8
|
+
private _page;
|
7
9
|
objects: Record<number, LayoutAnchoredObjectBox>;
|
8
|
-
constructor();
|
10
|
+
constructor(_page: LayoutPage);
|
9
11
|
getObjectByModelPosition(layout: DocumentLayout, position: number, belongsToSubDocId: number): LayoutAnchoredObjectBox;
|
10
|
-
|
12
|
+
removeOrphanedObjects(activeFormatter: BaseFormatter): void;
|
11
13
|
getObjectsForRenderer(anchorObjectsPositionInfo: AnchorObjectsPositionInfo, objects?: Record<number, LayoutAnchoredObjectBox>): LayoutAnchoredObjectBox[];
|
12
14
|
getObjById(id: number): LayoutAnchoredObjectBox;
|
13
15
|
getUnapprovedObj(): LayoutAnchoredObjectBox;
|
@@ -16,5 +18,5 @@ export declare class PageAnchoredObjectHolder {
|
|
16
18
|
addObject(manager: FormatterManager, obj: LayoutAnchoredObjectBox): void;
|
17
19
|
removeObject(obj: LayoutAnchoredObjectBox): void;
|
18
20
|
private correctPositionDueToOtherBoxes;
|
19
|
-
shallowCopy(): PageAnchoredObjectHolder;
|
21
|
+
shallowCopy(page: LayoutPage): PageAnchoredObjectHolder;
|
20
22
|
}
|
@@ -2,13 +2,14 @@ import { NumberMapUtils } from '@devexpress/utils/lib/utils/map/number';
|
|
2
2
|
import { LayoutBoxType } from '../../layout/main-structures/layout-boxes/layout-box';
|
3
3
|
import { getLayoutAnchoredObjectBoxComparer } from '../../model/manipulators/floating-objects/comparers';
|
4
4
|
export class PageAnchoredObjectHolder {
|
5
|
-
constructor() {
|
5
|
+
constructor(_page) {
|
6
|
+
this._page = _page;
|
6
7
|
this.objects = {};
|
7
8
|
}
|
8
9
|
getObjectByModelPosition(layout, position, belongsToSubDocId) {
|
9
10
|
return NumberMapUtils.elementBy(this.objects, (obj, id) => layout.anchorObjectsPositionInfo.getPosition(id) == position && obj.belongsToSubDocId === belongsToSubDocId);
|
10
11
|
}
|
11
|
-
|
12
|
+
removeOrphanedObjects(activeFormatter) {
|
12
13
|
if (!activeFormatter.subDocument.isMain())
|
13
14
|
return;
|
14
15
|
const belongsToSubDocId = activeFormatter.subDocument.id;
|
@@ -19,6 +20,8 @@ export class PageAnchoredObjectHolder {
|
|
19
20
|
if (layout.anchorObjectsPositionInfo.getPosition(id) >= position &&
|
20
21
|
obj.belongsToSubDocId === belongsToSubDocId) {
|
21
22
|
keysToDelete.push(id);
|
23
|
+
if (obj.getType() === LayoutBoxType.AnchorTextBox)
|
24
|
+
this._page.removeOtherPageArea(obj.internalSubDocId);
|
22
25
|
activeFormatter.layoutRowBoundsCalculator.removeAnchorObjectId(id);
|
23
26
|
}
|
24
27
|
});
|
@@ -56,8 +59,8 @@ export class PageAnchoredObjectHolder {
|
|
56
59
|
}
|
57
60
|
correctPositionDueToOtherBoxes(_obj) {
|
58
61
|
}
|
59
|
-
shallowCopy() {
|
60
|
-
const obj = new PageAnchoredObjectHolder();
|
62
|
+
shallowCopy(page) {
|
63
|
+
const obj = new PageAnchoredObjectHolder(page);
|
61
64
|
obj.objects = NumberMapUtils.shallowCopy(this.objects);
|
62
65
|
return obj;
|
63
66
|
}
|
@@ -222,7 +222,6 @@ export class BaseFormatter {
|
|
222
222
|
if (row.tableCellInfo)
|
223
223
|
row.indexInColumn = index;
|
224
224
|
});
|
225
|
-
this.layoutPosition.page.anchoredObjectHolder.onColumnEnd(this);
|
226
225
|
const lastRow = createdColumn.getLastRow();
|
227
226
|
lastRow.flags.set(LayoutRowStateFlags.ColumnEnd, true);
|
228
227
|
if (this.manager.innerClientProperties.viewsSettings.isSimpleView) {
|
@@ -157,6 +157,7 @@ export class MainFormatter extends BaseFormatter {
|
|
157
157
|
const layout = this.manager.layout;
|
158
158
|
Log.print(LogSource.LayoutFormatter, "processStatePageEnd", () => `SubDocId: ${this.subDocument.id}, LayPos: ${LogObjToStrLayout.layoutPositionShort(this.layoutPosition)}`);
|
159
159
|
const createdPage = this.layoutPosition.page;
|
160
|
+
createdPage.anchoredObjectHolder.removeOrphanedObjects(this);
|
160
161
|
createdPage.isValid = true;
|
161
162
|
MainFormatter.correctPageOffsets(createdPage);
|
162
163
|
this.state = this.lastRowInfo.row.flags.get(LayoutRowStateFlags.DocumentEnd) ?
|
@@ -26,12 +26,16 @@ import { RestartManager } from './restart-manager';
|
|
26
26
|
export interface ILayoutFormatterManagerHolder {
|
27
27
|
layoutFormatterManager: FormatterManager;
|
28
28
|
}
|
29
|
+
export declare type BrowserUtils = {
|
30
|
+
MacOSPlatform: boolean;
|
31
|
+
};
|
29
32
|
export declare class FormatterManager extends BatchUpdatableObject {
|
30
33
|
private formatterProcessID;
|
31
34
|
private unhideProcessID;
|
32
35
|
private _isDocumentOpened;
|
33
36
|
private onLayoutChangedDispatcher;
|
34
37
|
private formatters;
|
38
|
+
private activeSubDocumentHolder;
|
35
39
|
innerClientProperties: InnerClientProperties;
|
36
40
|
model: DocumentModel;
|
37
41
|
layout: DocumentLayout;
|
@@ -51,11 +55,11 @@ export declare class FormatterManager extends BatchUpdatableObject {
|
|
51
55
|
mainFormatter: MainFormatter;
|
52
56
|
bookmarksSettings: BookmarksSettings;
|
53
57
|
documentProtectionSettings: DocumentProtectionSettings;
|
54
|
-
private activeSubDocumentHolder;
|
55
58
|
floatingRestartInfoHolder: FloatingRestartInfoHolder;
|
59
|
+
browserUtils: BrowserUtils;
|
56
60
|
get activeSubDocument(): SubDocument;
|
57
61
|
get isDocumentOpened(): boolean;
|
58
|
-
constructor(measurer: IMeasurer, innerClientProperties: InnerClientProperties, model: DocumentModel, layout: DocumentLayout, activeSubDocumentHolder: IActiveSubDocumentHolder, bookmarksSettings: BookmarksSettings, documentProtectionSettings: DocumentProtectionSettings, controlHeightProvider: IControlHeightProvider, stringResources: StringResources, layoutChangesListeners: ILayoutChangesListener[]);
|
62
|
+
constructor(measurer: IMeasurer, innerClientProperties: InnerClientProperties, model: DocumentModel, layout: DocumentLayout, activeSubDocumentHolder: IActiveSubDocumentHolder, bookmarksSettings: BookmarksSettings, documentProtectionSettings: DocumentProtectionSettings, controlHeightProvider: IControlHeightProvider, stringResources: StringResources, layoutChangesListeners: ILayoutChangesListener[], browserUtils?: BrowserUtils);
|
59
63
|
dispose(): void;
|
60
64
|
onUpdateUnlocked(_occurredEvents: number): void;
|
61
65
|
getLayoutFormatter(subDocumentId: number): BaseFormatter;
|
@@ -16,8 +16,9 @@ import { LayoutDependentRunCache } from '../formatter/utils/layout-dependent-cac
|
|
16
16
|
import { RemoveRedundantHelper } from '../formatter/utils/remove-redundant-helper';
|
17
17
|
import { LayoutInvalidator } from '../invalidator/layout-invalidator';
|
18
18
|
import { RestartManager } from './restart-manager';
|
19
|
+
import { Browser } from '@devexpress/utils/lib/browser';
|
19
20
|
export class FormatterManager extends BatchUpdatableObject {
|
20
|
-
constructor(measurer, innerClientProperties, model, layout, activeSubDocumentHolder, bookmarksSettings, documentProtectionSettings, controlHeightProvider, stringResources, layoutChangesListeners) {
|
21
|
+
constructor(measurer, innerClientProperties, model, layout, activeSubDocumentHolder, bookmarksSettings, documentProtectionSettings, controlHeightProvider, stringResources, layoutChangesListeners, browserUtils) {
|
21
22
|
super();
|
22
23
|
this.formatterProcessID = null;
|
23
24
|
this.unhideProcessID = null;
|
@@ -46,6 +47,7 @@ export class FormatterManager extends BatchUpdatableObject {
|
|
46
47
|
this.layoutDependentRunCache = new LayoutDependentRunCache(this);
|
47
48
|
this.restartManager = new RestartManager(this);
|
48
49
|
this.anchoredObjectsManager = new AnchoredObjectsManager(this);
|
50
|
+
this.browserUtils = browserUtils !== null && browserUtils !== void 0 ? browserUtils : { MacOSPlatform: Browser.MacOSPlatform };
|
49
51
|
}
|
50
52
|
get activeSubDocument() { return this.activeSubDocumentHolder.activeSubDocument; }
|
51
53
|
get isDocumentOpened() { return this._isDocumentOpened; }
|
@@ -9,6 +9,9 @@ import { ParagraphFirstLineIndent } from '../../../model/paragraph/paragraph-pro
|
|
9
9
|
import { BoxWrap } from '../../box/box-wrap';
|
10
10
|
import { RowFormattingInfo } from './row-formatting-info';
|
11
11
|
import { RowHeightCalculator } from './row-height-calculator';
|
12
|
+
import { RichUtils } from '../../../model/rich-utils';
|
13
|
+
import { NumberingHelper } from '../../../model/numbering-lists/numbering-helper';
|
14
|
+
import { NumberingType } from '../../../model/numbering-lists/numbering-list';
|
12
15
|
export class RowSizesManager {
|
13
16
|
constructor(rowFormatter, outerHorizontalRowContentBounds, minY, rowSpacingBeforeApplier, boundsOfAnchoredOblectsOnThisColumn, isFirstRowInParagraph) {
|
14
17
|
this.rowFormatter = rowFormatter;
|
@@ -24,10 +27,23 @@ export class RowSizesManager {
|
|
24
27
|
this.rowFormattingInfo.calculate();
|
25
28
|
}
|
26
29
|
addNumberingListBoxes() {
|
27
|
-
const paragraph = this.rowFormatter
|
28
|
-
const
|
29
|
-
|
30
|
-
|
30
|
+
const { paragraph, result: { paragraphIndex }, numberingListCountersManager, manager: formatterManager } = this.rowFormatter;
|
31
|
+
const counters = numberingListCountersManager.calculateCounters(paragraphIndex);
|
32
|
+
let markText = paragraph.getNumberingListTextCore(counters);
|
33
|
+
let markProperties = paragraph.getNumerationCharacterProperties();
|
34
|
+
if (formatterManager.browserUtils.MacOSPlatform &&
|
35
|
+
markText === RichUtils.specialCharacters.MSWordBulletMark &&
|
36
|
+
markProperties.fontInfo.name === 'Symbol') {
|
37
|
+
const listTemplate = NumberingHelper.getNumberingListTemplate(formatterManager.model, NumberingType.Bullet);
|
38
|
+
const level = listTemplate.levels[paragraph.getListLevelIndex()];
|
39
|
+
const levelFontInfo = level.getCharacterProperties().fontInfo;
|
40
|
+
markProperties = markProperties.clone();
|
41
|
+
markProperties.fontInfo = levelFontInfo.clone();
|
42
|
+
markProperties.fontInfo.measurer = levelFontInfo.measurer;
|
43
|
+
markText = level.getListLevelProperties().displayFormatString;
|
44
|
+
}
|
45
|
+
this.row.numberingListBox = new LayoutNumberingListBox(markProperties, markProperties.getLayoutColorInfo(formatterManager.model.colorProvider), markText, paragraph.getNumberingListSeparatorChar(), formatterManager.model.cache.mergedCharacterPropertiesCache, paragraph.getListLevel().getListLevelProperties().alignment, formatterManager.model.cache.fontInfoCache);
|
46
|
+
LayoutBox.initializeWithMeasurer([new BoxWrap(this.row.numberingListBox, null)], formatterManager.measurer, formatterManager.innerClientProperties.showHiddenSymbols);
|
31
47
|
const boxes = [this.row.numberingListBox.textBox];
|
32
48
|
const separatorBox = this.row.numberingListBox.separatorBox;
|
33
49
|
if (separatorBox)
|
@@ -19,7 +19,8 @@ export class Measurer {
|
|
19
19
|
this.charPropsCache = charPropsCache;
|
20
20
|
}
|
21
21
|
clearCache() {
|
22
|
-
|
22
|
+
var _a;
|
23
|
+
(_a = this.charPropsCache) === null || _a === void 0 ? void 0 : _a.resetSizes();
|
23
24
|
}
|
24
25
|
measure(measureInfos) {
|
25
26
|
this.htmlParts = [];
|
@@ -11,5 +11,6 @@ export declare class Chunk {
|
|
11
11
|
getRunText(run: RunBase): string;
|
12
12
|
getTextInChunk(offsetAtStartChunk: number, length: number): string;
|
13
13
|
splitRun(runIndex: number, offset: number): void;
|
14
|
+
removeRun(runIndex: number): void;
|
14
15
|
clone(subDocument: SubDocument): Chunk;
|
15
16
|
}
|
@@ -1,4 +1,16 @@
|
|
1
1
|
import { ListUtils } from '@devexpress/utils/lib/utils/list';
|
2
|
+
class UndefinedRunError extends Error {
|
3
|
+
constructor() {
|
4
|
+
super();
|
5
|
+
this.message = 'Undefined run';
|
6
|
+
}
|
7
|
+
}
|
8
|
+
class OutOfOffsetError extends Error {
|
9
|
+
constructor() {
|
10
|
+
super();
|
11
|
+
this.message = 'Offset >= run.length';
|
12
|
+
}
|
13
|
+
}
|
2
14
|
export class Chunk {
|
3
15
|
constructor(startLogPosition, textBuffer, isLast) {
|
4
16
|
this.textBuffer = "";
|
@@ -19,13 +31,26 @@ export class Chunk {
|
|
19
31
|
splitRun(runIndex, offset) {
|
20
32
|
var run = this.textRuns[runIndex];
|
21
33
|
if (!run)
|
22
|
-
throw new
|
34
|
+
throw new UndefinedRunError();
|
23
35
|
if (offset >= run.getLength())
|
24
|
-
throw new
|
36
|
+
throw new OutOfOffsetError();
|
25
37
|
var newRun = run.createSimularity(run.startOffset + offset, run.getLength() - offset, run.paragraph, run.characterStyle, run.maskedCharacterProperties);
|
26
38
|
run.setLength(offset);
|
27
39
|
this.textRuns.splice(runIndex + 1, 0, newRun);
|
28
40
|
}
|
41
|
+
removeRun(runIndex) {
|
42
|
+
const run = this.textRuns[runIndex];
|
43
|
+
if (!run)
|
44
|
+
throw new UndefinedRunError();
|
45
|
+
if (runIndex === this.textRuns.length - 1) {
|
46
|
+
this.textBuffer = this.textBuffer.slice(0, run.startOffset);
|
47
|
+
this.textRuns.pop();
|
48
|
+
}
|
49
|
+
else {
|
50
|
+
this.textBuffer = [this.textBuffer.slice(0, run.startOffset), this.textBuffer.slice(run.startOffset + run.getLength())].join('');
|
51
|
+
this.textRuns = [...this.textRuns.slice(0, runIndex), ...this.textRuns.slice(runIndex + 1)];
|
52
|
+
}
|
53
|
+
}
|
29
54
|
clone(subDocument) {
|
30
55
|
const result = new Chunk(subDocument.positionManager.registerPosition(this.startLogPosition.value), this.textBuffer.slice(0), this.isLast);
|
31
56
|
result.textRuns = ListUtils.map(this.textRuns, r => r.cloneToNewSubDocument(subDocument));
|
@@ -36,6 +36,7 @@ import { DocumentLayout } from '../layout/document-layout';
|
|
36
36
|
import { CacheImageInfo } from './caches/images';
|
37
37
|
import { AnchorInfo } from './floating-objects/anchor-info';
|
38
38
|
import { SubDocumentCollection } from './sub-document-collection';
|
39
|
+
import { NotePosition, NoteSeparators } from './footnotes/footnote';
|
39
40
|
export interface IModelOptions extends ICloneable<IModelOptions> {
|
40
41
|
control: ControlOptions;
|
41
42
|
cultureOpts: IFormattersOptions;
|
@@ -50,6 +51,7 @@ export declare class DocumentModel {
|
|
50
51
|
pageBackColor: number;
|
51
52
|
mirrorMargins: boolean;
|
52
53
|
aspxIsDocumentProtectionEnabled: boolean;
|
54
|
+
documentEndNotePosition: NotePosition;
|
53
55
|
sections: Section[];
|
54
56
|
headers: HeaderSubDocumentInfo[];
|
55
57
|
footers: FooterSubDocumentInfo[];
|
@@ -71,6 +73,8 @@ export declare class DocumentModel {
|
|
71
73
|
numberingLists: NumberingList[];
|
72
74
|
abstractNumberingListsIdProvider: AbstractNumberingListIdProvider;
|
73
75
|
numberingListsIdProvider: NumberingListIdProvider;
|
76
|
+
footNoteSeparators: NoteSeparators;
|
77
|
+
endNoteSeparators: NoteSeparators;
|
74
78
|
get subDocuments(): Record<number, SubDocument>;
|
75
79
|
get options(): ControlOptions;
|
76
80
|
get isDocumentProtectionEnabled(): boolean;
|