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
@@ -11,6 +11,7 @@ import { TranslationTables } from '../../translation-table/translation-tables';
|
|
11
11
|
import { WordProcessingMLValue } from '../../translation-table/word-processing-mlvalue';
|
12
12
|
import { DocxConstants, DocxNsType } from '../../utils/constants';
|
13
13
|
import { ExporterBaseWithRootElement } from './base';
|
14
|
+
import { NotePropertiesExporter } from './note-properties';
|
14
15
|
export class SettingsExporter extends ExporterBaseWithRootElement {
|
15
16
|
get filePath() { return 'word/settings.xml'; }
|
16
17
|
get rootElement() { return new WordProcessingMLValue('settings', 'docPr').openXmlValue; }
|
@@ -25,6 +26,8 @@ export class SettingsExporter extends ExporterBaseWithRootElement {
|
|
25
26
|
this.writer.writeWpIntValue('defaultTabStop', this.data.model.defaultTabWidth);
|
26
27
|
this.writer.writeWpBoolValue('autoHyphenation', false);
|
27
28
|
this.writer.writeWpBoolValue('evenAndOddHeaders', this.data.model.differentOddAndEvenPages);
|
29
|
+
this.exportFootNoteProperties();
|
30
|
+
this.exportEndNoteProperties();
|
28
31
|
this.exportCompatSettings();
|
29
32
|
this.exportDocumentVariables();
|
30
33
|
this.exportColorSchemeMapping();
|
@@ -115,4 +118,12 @@ export class SettingsExporter extends ExporterBaseWithRootElement {
|
|
115
118
|
if (properties.passwordPrefix)
|
116
119
|
this.writer.writeWpStringAttr('salt', Base64Utils.fromArrayBuffer(properties.passwordPrefix));
|
117
120
|
}
|
121
|
+
exportFootNoteProperties() {
|
122
|
+
const footNoteProperties = this.data.model.sections[0].sectionProperties.footNote;
|
123
|
+
new NotePropertiesExporter(this.data).exportDocumentLevelFootNoteProperties(footNoteProperties);
|
124
|
+
}
|
125
|
+
exportEndNoteProperties() {
|
126
|
+
const endNoteProperties = this.data.model.sections[0].sectionProperties.endNote;
|
127
|
+
new NotePropertiesExporter(this.data).exportDocumentLevelEndNoteProperties(endNoteProperties);
|
128
|
+
}
|
118
129
|
}
|
@@ -30,10 +30,11 @@ export declare abstract class BaseSubDocumentExporter extends ExporterBaseWithRo
|
|
30
30
|
private paragraph;
|
31
31
|
private firstIteration;
|
32
32
|
private readonly predefinedGroupNames;
|
33
|
-
constructor(data: Data,
|
33
|
+
constructor(data: Data, filePath: string);
|
34
34
|
protected fillWriter(): void;
|
35
35
|
protected abstract createRelationExporter(): RelationCollectionExporter;
|
36
36
|
protected abstract fillWriterCore(): any;
|
37
|
+
protected abstract isMainContent(): boolean;
|
37
38
|
protected init(): void;
|
38
39
|
protected endParagraph(pos: number, section: Section, allowInitNextParagraph: boolean): void;
|
39
40
|
getCurrentParagraphRun(): RunBase | null;
|
@@ -54,9 +55,22 @@ export declare abstract class BaseSubDocumentExporter extends ExporterBaseWithRo
|
|
54
55
|
private anchoredTextRunHandler;
|
55
56
|
private inlinePictureRunHandler;
|
56
57
|
private layoutDependentRunHandler;
|
58
|
+
private footNoteRunHandler;
|
59
|
+
private exportFootNoteReference;
|
60
|
+
private endNoteRunHandler;
|
61
|
+
private exportEndNoteReference;
|
62
|
+
private tryExportNoteCustomMarkReference;
|
63
|
+
private exportNoteReference;
|
64
|
+
private noteSeparatorRunHandler;
|
65
|
+
private noteContinuationSeparatorRun;
|
66
|
+
private exportNoteSeparator;
|
57
67
|
private exportBookmark;
|
58
68
|
private exportRangePermission;
|
59
69
|
private getGroupName;
|
60
70
|
private exportFieldChar;
|
61
71
|
private writeHideByParent;
|
62
72
|
}
|
73
|
+
export declare abstract class SingleSubDocumentExoprter extends BaseSubDocumentExporter {
|
74
|
+
constructor(data: Data, subDocument: SubDocument, filePath: string);
|
75
|
+
protected isMainContent(): boolean;
|
76
|
+
}
|
@@ -3,6 +3,7 @@ import { CrossExistingIterator } from '../../../../../../common/formats/utils/cr
|
|
3
3
|
import { Field } from '../../../../../../common/model/fields/field';
|
4
4
|
import { ModelIterator } from '../../../../../../common/model/model-iterator';
|
5
5
|
import { RunType } from '../../../../../../common/model/runs/run-type';
|
6
|
+
import { SubDocument } from '../../../../../../common/model/sub-document';
|
6
7
|
import { Stack } from '@devexpress/utils/lib/class/stack';
|
7
8
|
import { BoundaryInterval } from '@devexpress/utils/lib/intervals/boundary';
|
8
9
|
import { Comparers } from '@devexpress/utils/lib/utils/comparers';
|
@@ -13,8 +14,9 @@ import { AnchoredDrawingPictureObject, AnchoredDrawingTextObject, InlineDrawingO
|
|
13
14
|
import { ExporterBaseWithRootElement } from '../base';
|
14
15
|
import { DrawingExporter } from '../base/drawing';
|
15
16
|
import { TableExporter } from '../base/table/table';
|
17
|
+
import { isDefined } from '@devexpress/utils/lib/utils/common';
|
16
18
|
export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
17
|
-
constructor(data,
|
19
|
+
constructor(data, filePath) {
|
18
20
|
super(data);
|
19
21
|
this.fieldCodeDepth = 0;
|
20
22
|
this.paragraph = null;
|
@@ -27,7 +29,6 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
27
29
|
.add("Contributors", "contributors")
|
28
30
|
.add("Administrators", "administrators")
|
29
31
|
.get();
|
30
|
-
this.subDocument = subDocument;
|
31
32
|
this._filePath = filePath;
|
32
33
|
this.hyperlinkRelationsTable = {};
|
33
34
|
this.fieldsStack = new Stack();
|
@@ -43,6 +44,10 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
43
44
|
[RunType.InlinePictureRun]: this.inlinePictureRunHandler,
|
44
45
|
[RunType.InlineTextBoxRun]: null,
|
45
46
|
[RunType.LayoutDependentRun]: this.layoutDependentRunHandler,
|
47
|
+
[RunType.FootNoteRun]: this.footNoteRunHandler,
|
48
|
+
[RunType.EndNoteRun]: this.endNoteRunHandler,
|
49
|
+
[RunType.NoteSeparatorRun]: this.noteSeparatorRunHandler,
|
50
|
+
[RunType.NoteContinuationSeparatorRun]: this.noteContinuationSeparatorRun,
|
46
51
|
};
|
47
52
|
this.tableExporter = new TableExporter(this.data);
|
48
53
|
}
|
@@ -54,7 +59,7 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
54
59
|
this.registerNamespaces();
|
55
60
|
this.data.pushRelationExporter(this.createRelationExporter());
|
56
61
|
this.fillWriterCore();
|
57
|
-
if (!this.
|
62
|
+
if (!this.isMainContent())
|
58
63
|
this.data.popRelationExporter();
|
59
64
|
this.data.subDocumentExporterStack.pop();
|
60
65
|
}
|
@@ -160,6 +165,7 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
160
165
|
textRunHandler(runText) {
|
161
166
|
this.writer.writeWpStartElement('r');
|
162
167
|
this.data.charPropsExporter.exportRunProperties(this.run);
|
168
|
+
this.tryExportNoteCustomMarkReference();
|
163
169
|
this.data.textExporter.exportTextRunCore(runText);
|
164
170
|
this.writer.endElement();
|
165
171
|
}
|
@@ -186,6 +192,7 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
186
192
|
anchoredPictureRunHandler() {
|
187
193
|
this.writer.writeWpStartElement('r');
|
188
194
|
this.data.charPropsExporter.exportRunProperties(this.run);
|
195
|
+
this.tryExportNoteCustomMarkReference();
|
189
196
|
const picRun = this.run;
|
190
197
|
if (this.shouldExportPicture(picRun.cacheInfo))
|
191
198
|
new DrawingExporter(this.data).writeFloatingObjectDrawing(new AnchoredDrawingPictureObject(picRun), picRun.cacheInfo.currId);
|
@@ -194,6 +201,7 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
194
201
|
anchoredTextRunHandler() {
|
195
202
|
this.writer.writeWpStartElement('r');
|
196
203
|
this.data.charPropsExporter.exportRunProperties(this.run);
|
204
|
+
this.tryExportNoteCustomMarkReference();
|
197
205
|
const textBoxRun = this.run;
|
198
206
|
new DrawingExporter(this.data).writeFloatingObjectTextBoxContent2010(new AnchoredDrawingTextObject(textBoxRun), this.data.model.subDocuments[textBoxRun.subDocId]);
|
199
207
|
this.writer.endElement();
|
@@ -201,6 +209,7 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
201
209
|
inlinePictureRunHandler() {
|
202
210
|
this.writer.writeWpStartElement('r');
|
203
211
|
this.data.charPropsExporter.exportRunProperties(this.run);
|
212
|
+
this.tryExportNoteCustomMarkReference();
|
204
213
|
const picRun = this.run;
|
205
214
|
if (this.shouldExportPicture(picRun.cacheInfo))
|
206
215
|
new DrawingExporter(this.data).writeFloatingObjectDrawing(new InlineDrawingObject(picRun), picRun.cacheInfo.currId);
|
@@ -208,6 +217,70 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
208
217
|
}
|
209
218
|
layoutDependentRunHandler() {
|
210
219
|
}
|
220
|
+
footNoteRunHandler() {
|
221
|
+
this.writer.writeWpStartElement('r');
|
222
|
+
this.data.charPropsExporter.exportRunProperties(this.run);
|
223
|
+
const subDocId = this.run.noteDocumentId;
|
224
|
+
if (isDefined(subDocId) && subDocId > SubDocument.MAIN_SUBDOCUMENT_ID)
|
225
|
+
this.exportFootNoteReference(subDocId, false);
|
226
|
+
else {
|
227
|
+
this.writer.writeWpStartElement('footnoteRef');
|
228
|
+
this.writer.endElement();
|
229
|
+
}
|
230
|
+
this.writer.endElement();
|
231
|
+
}
|
232
|
+
exportFootNoteReference(subDocId, isCustomMark) {
|
233
|
+
const note = this.data.model.subDocuments[subDocId];
|
234
|
+
const id = this.data.addFootNote(note);
|
235
|
+
this.exportNoteReference('footnoteReference', id, isCustomMark);
|
236
|
+
}
|
237
|
+
endNoteRunHandler() {
|
238
|
+
this.writer.writeWpStartElement('r');
|
239
|
+
this.data.charPropsExporter.exportRunProperties(this.run);
|
240
|
+
const subDocId = this.run.noteDocumentId;
|
241
|
+
if (isDefined(subDocId) && subDocId > SubDocument.MAIN_SUBDOCUMENT_ID)
|
242
|
+
this.exportEndNoteReference(subDocId, false);
|
243
|
+
else {
|
244
|
+
this.writer.writeWpStartElement('endnoteRef');
|
245
|
+
this.writer.endElement();
|
246
|
+
}
|
247
|
+
this.writer.endElement();
|
248
|
+
}
|
249
|
+
exportEndNoteReference(subDocId, isCustomMark) {
|
250
|
+
const note = this.data.model.subDocuments[subDocId];
|
251
|
+
const id = this.data.addEndNote(note);
|
252
|
+
this.exportNoteReference('endnoteReference', id, isCustomMark);
|
253
|
+
}
|
254
|
+
tryExportNoteCustomMarkReference() {
|
255
|
+
const subDocId = this.run.noteDocumentId;
|
256
|
+
if (!isDefined(subDocId))
|
257
|
+
return;
|
258
|
+
const note = this.data.model.subDocuments[subDocId];
|
259
|
+
if (note.isFootNote())
|
260
|
+
this.exportFootNoteReference(subDocId, true);
|
261
|
+
else
|
262
|
+
this.exportEndNoteReference(subDocId, true);
|
263
|
+
}
|
264
|
+
exportNoteReference(rootElement, id, isCustomMark) {
|
265
|
+
this.writer.writeWpStartElement(rootElement);
|
266
|
+
if (isCustomMark)
|
267
|
+
this.writer.writeWpBoolAttr('customMarkFollows', true);
|
268
|
+
this.writer.writeWpIntAttr('id', id);
|
269
|
+
this.writer.endElement();
|
270
|
+
}
|
271
|
+
noteSeparatorRunHandler() {
|
272
|
+
this.exportNoteSeparator('separator');
|
273
|
+
}
|
274
|
+
noteContinuationSeparatorRun() {
|
275
|
+
this.exportNoteSeparator('continuationSeparator');
|
276
|
+
}
|
277
|
+
exportNoteSeparator(separator) {
|
278
|
+
this.writer.writeWpStartElement('r');
|
279
|
+
this.data.charPropsExporter.exportRunProperties(this.run);
|
280
|
+
this.writer.writeWpStartElement(separator);
|
281
|
+
this.writer.endElement();
|
282
|
+
this.writer.endElement();
|
283
|
+
}
|
211
284
|
exportBookmark(bookmarksIterator) {
|
212
285
|
for (const state of bookmarksIterator.addedObjects) {
|
213
286
|
this.writer.writeWpStartElement('bookmarkStart');
|
@@ -259,3 +332,12 @@ export class BaseSubDocumentExporter extends ExporterBaseWithRootElement {
|
|
259
332
|
writeHideByParent() {
|
260
333
|
}
|
261
334
|
}
|
335
|
+
export class SingleSubDocumentExoprter extends BaseSubDocumentExporter {
|
336
|
+
constructor(data, subDocument, filePath) {
|
337
|
+
super(data, filePath);
|
338
|
+
this.subDocument = subDocument;
|
339
|
+
}
|
340
|
+
isMainContent() {
|
341
|
+
return this.subDocument.isMain();
|
342
|
+
}
|
343
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { SubDocument } from '../../../../../../common/model/sub-document';
|
2
2
|
import { Data } from '../../data';
|
3
3
|
import { RelationCollectionExporter } from '../relations/relation-collection';
|
4
|
-
import {
|
5
|
-
export declare class HeaderFooterSubDocumentExporter extends
|
4
|
+
import { SingleSubDocumentExoprter } from './base-sub-document';
|
5
|
+
export declare class HeaderFooterSubDocumentExporter extends SingleSubDocumentExoprter {
|
6
6
|
private relsFilePath;
|
7
7
|
get rootElement(): string;
|
8
8
|
constructor(data: Data, subDocument: SubDocument, filePath: string, relsFilePath: string);
|
package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
2
2
|
import { RelationCollectionExporter } from '../relations/relation-collection';
|
3
|
-
import {
|
4
|
-
export class HeaderFooterSubDocumentExporter extends
|
3
|
+
import { SingleSubDocumentExoprter } from './base-sub-document';
|
4
|
+
export class HeaderFooterSubDocumentExporter extends SingleSubDocumentExoprter {
|
5
5
|
constructor(data, subDocument, filePath, relsFilePath) {
|
6
6
|
super(data, subDocument, filePath);
|
7
7
|
this.relsFilePath = relsFilePath;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { RelationCollectionExporter } from '../relations/relation-collection';
|
2
|
-
import {
|
3
|
-
export declare class MainSubDocumentExporter extends
|
2
|
+
import { SingleSubDocumentExoprter as SingleSubDocumentExporter } from './base-sub-document';
|
3
|
+
export declare class MainSubDocumentExporter extends SingleSubDocumentExporter {
|
4
4
|
protected createRelationExporter(): RelationCollectionExporter;
|
5
5
|
get rootElement(): string;
|
6
6
|
protected fillWriterCore(): void;
|
@@ -4,8 +4,8 @@ import { ThemeColorIndexConstants } from '../../../../../../common/model/color/e
|
|
4
4
|
import { ListUtils } from '@devexpress/utils/lib/utils/list';
|
5
5
|
import { SectionExporter } from '../base/sections';
|
6
6
|
import { DocumentRelationsExporter } from '../relations/document-relations';
|
7
|
-
import {
|
8
|
-
export class MainSubDocumentExporter extends
|
7
|
+
import { SingleSubDocumentExoprter as SingleSubDocumentExporter } from './base-sub-document';
|
8
|
+
export class MainSubDocumentExporter extends SingleSubDocumentExporter {
|
9
9
|
createRelationExporter() { return new DocumentRelationsExporter(this.data); }
|
10
10
|
get rootElement() { return 'document'; }
|
11
11
|
fillWriterCore() {
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { SubDocument } from "../../../../../../common/model/sub-document";
|
2
|
+
import { Data } from "../../data";
|
3
|
+
import { RelationCollectionExporter } from "../relations/relation-collection";
|
4
|
+
import { BaseSubDocumentExporter } from "./base-sub-document";
|
5
|
+
declare abstract class NoteExporter extends BaseSubDocumentExporter {
|
6
|
+
private relsFilePath;
|
7
|
+
private fileName;
|
8
|
+
abstract get childElement(): string;
|
9
|
+
abstract get noteToIdMap(): Map<SubDocument, number>;
|
10
|
+
abstract get contentType(): string;
|
11
|
+
constructor(data: Data, fileName: string);
|
12
|
+
protected createRelationExporter(): RelationCollectionExporter;
|
13
|
+
protected isMainContent(): boolean;
|
14
|
+
protected fillWriterCore(): void;
|
15
|
+
private exportNotes;
|
16
|
+
private exportNoteContent;
|
17
|
+
private pushSubDocument;
|
18
|
+
private popSubDocument;
|
19
|
+
protected abstract addRels(fileName: string): any;
|
20
|
+
}
|
21
|
+
export declare class FootNoteExporter extends NoteExporter {
|
22
|
+
constructor(data: Data);
|
23
|
+
get rootElement(): string;
|
24
|
+
get childElement(): string;
|
25
|
+
get contentType(): string;
|
26
|
+
get noteToIdMap(): Map<SubDocument, number>;
|
27
|
+
protected addRels(fileName: string): void;
|
28
|
+
}
|
29
|
+
export declare class EndNoteExporter extends NoteExporter {
|
30
|
+
constructor(data: Data);
|
31
|
+
get rootElement(): string;
|
32
|
+
get childElement(): string;
|
33
|
+
get contentType(): string;
|
34
|
+
get noteToIdMap(): Map<SubDocument, number>;
|
35
|
+
protected addRels(fileName: string): void;
|
36
|
+
}
|
37
|
+
export {};
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import { FixedInterval } from "@devexpress/utils/lib/intervals/fixed";
|
2
|
+
import { RelationCollectionExporter } from "../relations/relation-collection";
|
3
|
+
import { BaseSubDocumentExporter } from "./base-sub-document";
|
4
|
+
import { NoteType } from "../../../../../../common/model/footnotes/footnote";
|
5
|
+
import { TranslationTables } from "../../../translation-table/translation-tables";
|
6
|
+
import { ContentType } from "../../../utils/constants";
|
7
|
+
class NoteExporter extends BaseSubDocumentExporter {
|
8
|
+
constructor(data, fileName) {
|
9
|
+
super(data, `word/${fileName}`);
|
10
|
+
this.relsFilePath = `word/_rels/${fileName}.rels`;
|
11
|
+
this.fileName = fileName;
|
12
|
+
}
|
13
|
+
createRelationExporter() { return new RelationCollectionExporter(this.data, this.relsFilePath); }
|
14
|
+
isMainContent() {
|
15
|
+
return false;
|
16
|
+
}
|
17
|
+
fillWriterCore() {
|
18
|
+
this.exportNotes();
|
19
|
+
this.addRels(this.fileName);
|
20
|
+
this.data.contentTypesExporter.registerContentTypeOverride(`/word/${this.fileName}`, this.contentType);
|
21
|
+
}
|
22
|
+
exportNotes() {
|
23
|
+
for (const [note, id] of this.noteToIdMap.entries()) {
|
24
|
+
this.pushSubDocument(note);
|
25
|
+
this.writer.writeWpStartElement(this.childElement);
|
26
|
+
const type = note.info.noteType;
|
27
|
+
if (type !== NoteType.Normal)
|
28
|
+
this.writer.writeWpStringAttr('type', TranslationTables.noteTypeTable.exportMap[type].mlValue.openXmlValue);
|
29
|
+
this.writer.writeWpIntAttr('id', id);
|
30
|
+
this.exportNoteContent();
|
31
|
+
this.writer.endElement();
|
32
|
+
this.popSubDocument();
|
33
|
+
}
|
34
|
+
}
|
35
|
+
exportNoteContent() {
|
36
|
+
this.init();
|
37
|
+
this.exportSection(this.data.model.sections[0], new FixedInterval(0, this.subDocument.getDocumentEndPosition()));
|
38
|
+
}
|
39
|
+
pushSubDocument(subDocument) {
|
40
|
+
this.subDocument = subDocument;
|
41
|
+
}
|
42
|
+
popSubDocument() {
|
43
|
+
const subDocument = this.subDocument;
|
44
|
+
this.subDocument = null;
|
45
|
+
return subDocument;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
export class FootNoteExporter extends NoteExporter {
|
49
|
+
constructor(data) {
|
50
|
+
super(data, 'footnotes.xml');
|
51
|
+
}
|
52
|
+
get rootElement() { return 'footnotes'; }
|
53
|
+
get childElement() { return 'footnote'; }
|
54
|
+
get contentType() { return ContentType.footnotes; }
|
55
|
+
get noteToIdMap() { return this.data.footNotes; }
|
56
|
+
addRels(fileName) {
|
57
|
+
this.data.mainSubDocumentRelations.footNoteRelationsTable['RelFootnotes'] = fileName;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
export class EndNoteExporter extends NoteExporter {
|
61
|
+
constructor(data) {
|
62
|
+
super(data, 'endnotes.xml');
|
63
|
+
}
|
64
|
+
get rootElement() { return 'endnotes'; }
|
65
|
+
get childElement() { return 'endnote'; }
|
66
|
+
get contentType() { return ContentType.endnotes; }
|
67
|
+
get noteToIdMap() { return this.data.endNotes; }
|
68
|
+
addRels(fileName) {
|
69
|
+
this.data.mainSubDocumentRelations.endNoteRelationsTable['RelEndnotes'] = fileName;
|
70
|
+
}
|
71
|
+
}
|
package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { SubDocument } from '../../../../../../common/model/sub-document';
|
2
2
|
import { Data } from '../../data';
|
3
3
|
import { RelationCollectionExporter } from '../relations/relation-collection';
|
4
|
-
import {
|
5
|
-
export declare class TextBoxSubDocumentExporter extends
|
4
|
+
import { SingleSubDocumentExoprter } from './base-sub-document';
|
5
|
+
export declare class TextBoxSubDocumentExporter extends SingleSubDocumentExoprter {
|
6
6
|
get rootElement(): string;
|
7
7
|
constructor(data: Data, subDocument: SubDocument);
|
8
8
|
exportTextBoxContent(): void;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Errors } from '@devexpress/utils/lib/errors';
|
2
2
|
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
3
|
-
import {
|
4
|
-
export class TextBoxSubDocumentExporter extends
|
3
|
+
import { SingleSubDocumentExoprter } from './base-sub-document';
|
4
|
+
export class TextBoxSubDocumentExporter extends SingleSubDocumentExoprter {
|
5
5
|
get rootElement() { throw new Error(Errors.NotImplemented); }
|
6
6
|
constructor(data, subDocument) {
|
7
7
|
super(data, subDocument, '');
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { XmlReader } from "../../../../../../../client/formats/docx/zip/xml-reader";
|
2
|
+
import { NoteProperties } from "../../../../../../../common/model/footnotes/footnote";
|
3
|
+
import { Data } from "../../../data";
|
4
|
+
import { ElementHandlerTable } from "../../destination";
|
5
|
+
import { NotePropertiesDestination } from "../note-properties-destination";
|
6
|
+
export declare class SectionLevelEndNotePropertiesDestination extends NotePropertiesDestination {
|
7
|
+
constructor(data: Data);
|
8
|
+
protected setProperties(notes: NoteProperties): void;
|
9
|
+
}
|
10
|
+
export declare class DocumentLevelEndNotePropertiesDestination extends NotePropertiesDestination {
|
11
|
+
static handlerTable: ElementHandlerTable;
|
12
|
+
constructor(data: Data);
|
13
|
+
protected get elementHandlerTable(): ElementHandlerTable;
|
14
|
+
protected setProperties(notes: NoteProperties): void;
|
15
|
+
processElementClose(reader: XmlReader): Promise<void>;
|
16
|
+
}
|
package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.js
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
import { __awaiter } from "tslib";
|
2
|
+
import { NotePosition } from "../../../../../../../common/model/footnotes/footnote";
|
3
|
+
import { NumberingFormat } from "../../../../../../../common/model/numbering-lists/list-level-properties";
|
4
|
+
import { MapCreator } from "../../../../../../../common/utils/map-creator";
|
5
|
+
import { StringUtils } from "@devexpress/utils/lib/utils/string";
|
6
|
+
import { LeafElementDestination } from "../../destination";
|
7
|
+
import { NotePropertiesDestination } from "../note-properties-destination";
|
8
|
+
export class SectionLevelEndNotePropertiesDestination extends NotePropertiesDestination {
|
9
|
+
constructor(data) {
|
10
|
+
super(data, NotePosition.BottomOfPage, NumberingFormat.Decimal);
|
11
|
+
}
|
12
|
+
setProperties(notes) {
|
13
|
+
this.data.sectionImporter.properties.endNote = notes;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
export class DocumentLevelEndNotePropertiesDestination extends NotePropertiesDestination {
|
17
|
+
constructor(data) {
|
18
|
+
super(data, NotePosition.BottomOfPage, NumberingFormat.Decimal);
|
19
|
+
}
|
20
|
+
get elementHandlerTable() {
|
21
|
+
return DocumentLevelEndNotePropertiesDestination.handlerTable;
|
22
|
+
}
|
23
|
+
setProperties(notes) {
|
24
|
+
this.data.documentModel.sections[0].sectionProperties.endNote = notes;
|
25
|
+
}
|
26
|
+
processElementClose(reader) {
|
27
|
+
const _super = Object.create(null, {
|
28
|
+
processElementClose: { get: () => super.processElementClose }
|
29
|
+
});
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
31
|
+
_super.processElementClose.call(this, reader);
|
32
|
+
this.data.documentModel.documentEndNotePosition = this.notes.position;
|
33
|
+
});
|
34
|
+
}
|
35
|
+
}
|
36
|
+
DocumentLevelEndNotePropertiesDestination.handlerTable = new MapCreator()
|
37
|
+
.append(NotePropertiesDestination.handlerTable)
|
38
|
+
.add('endnote', (data) => new EndNoteSeparatorDestination(data))
|
39
|
+
.get();
|
40
|
+
class EndNoteSeparatorDestination extends LeafElementDestination {
|
41
|
+
processElementOpen(reader) {
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
43
|
+
const id = reader.getAttributeNS("id", this.data.constants.wordProcessingNamespaceConst);
|
44
|
+
if (!StringUtils.isNullOrEmpty(id))
|
45
|
+
this.data.endNotesImporter.separatorIds.push(id);
|
46
|
+
});
|
47
|
+
}
|
48
|
+
}
|
package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.js
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
import { NoteReferenceDestination } from "../note-reference-destination";
|
2
|
+
export class EndNoteReferenceDestination extends NoteReferenceDestination {
|
3
|
+
get notes() {
|
4
|
+
return this.data.endNotesImporter.notes;
|
5
|
+
}
|
6
|
+
insertNoteRun(subDocId) {
|
7
|
+
this.data.endNotesImporter.insertRun(subDocId);
|
8
|
+
}
|
9
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { MapCreator } from "../../../../../../../common/utils/map-creator";
|
2
|
+
import { ElementDestination } from "../../destination";
|
3
|
+
import { SubDocumentInfoType } from "../../../../../../../common/model/enums";
|
4
|
+
import { NoteType } from "../../../../../../../common/model/footnotes/footnote";
|
5
|
+
import { StringUtils } from "@devexpress/utils/lib/utils/string";
|
6
|
+
import { NoteDestination } from "../note-destination";
|
7
|
+
export class EndNotesDestination extends ElementDestination {
|
8
|
+
get elementHandlerTable() {
|
9
|
+
return EndNotesDestination.handlerTable;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
EndNotesDestination.handlerTable = new MapCreator()
|
13
|
+
.add('endnote', (data) => new EndNoteDestination(data))
|
14
|
+
.get();
|
15
|
+
class EndNoteDestination extends NoteDestination {
|
16
|
+
get SubDocumentType() {
|
17
|
+
return SubDocumentInfoType.EndNote;
|
18
|
+
}
|
19
|
+
addNote(id, subDocId, type) {
|
20
|
+
if (!this.canAddEndNote(id, type))
|
21
|
+
return false;
|
22
|
+
if (type == NoteType.Normal)
|
23
|
+
this.data.endNotesImporter.notes[id] = subDocId;
|
24
|
+
else
|
25
|
+
this.documentModel.endNoteSeparators.setSeparator(subDocId, type);
|
26
|
+
return true;
|
27
|
+
}
|
28
|
+
canAddEndNote(id, type) {
|
29
|
+
if (StringUtils.isNullOrEmpty(id))
|
30
|
+
return false;
|
31
|
+
if (type == NoteType.Normal)
|
32
|
+
return !(id in this.data.endNotesImporter.notes);
|
33
|
+
else {
|
34
|
+
if (this.documentModel.endNoteSeparators.getSeparator(type) != null)
|
35
|
+
return false;
|
36
|
+
return this.data.endNotesImporter.separatorIds.includes(id);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Data } from "../../../data";
|
2
|
+
import { ElementHandlerTable, LeafElementDestination } from "../../destination";
|
3
|
+
import { NoteProperties } from "../../../../../../../common/model/footnotes/footnote";
|
4
|
+
import { XmlReader } from "../../../../zip/xml-reader";
|
5
|
+
import { NotePropertiesDestination } from "../note-properties-destination";
|
6
|
+
export declare class SectionLevelFootNotePropertiesDestination extends NotePropertiesDestination {
|
7
|
+
constructor(data: Data);
|
8
|
+
protected setProperties(notes: NoteProperties): void;
|
9
|
+
}
|
10
|
+
export declare class DocumentLevelFootNotePropertiesDestination extends NotePropertiesDestination {
|
11
|
+
static handlerTable: ElementHandlerTable;
|
12
|
+
constructor(data: Data);
|
13
|
+
protected get elementHandlerTable(): ElementHandlerTable;
|
14
|
+
protected setProperties(notes: NoteProperties): void;
|
15
|
+
}
|
16
|
+
export declare class SectionFootNoteColumnsCountDestination extends LeafElementDestination {
|
17
|
+
processElementOpen(reader: XmlReader): Promise<void>;
|
18
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { __awaiter } from "tslib";
|
2
|
+
import { MapCreator } from "../../../../../../../common/utils/map-creator";
|
3
|
+
import { LeafElementDestination } from "../../destination";
|
4
|
+
import { NoteProperties, NotePosition } from "../../../../../../../common/model/footnotes/footnote";
|
5
|
+
import { NumberingFormat } from "../../../../../../../common/model/numbering-lists/list-level-properties";
|
6
|
+
import { StringUtils } from "@devexpress/utils/lib/utils/string";
|
7
|
+
import { NotePropertiesDestination } from "../note-properties-destination";
|
8
|
+
export class SectionLevelFootNotePropertiesDestination extends NotePropertiesDestination {
|
9
|
+
constructor(data) {
|
10
|
+
super(data, NotePosition.BottomOfPage, NumberingFormat.Decimal);
|
11
|
+
}
|
12
|
+
setProperties(notes) {
|
13
|
+
this.data.sectionImporter.properties.footNote = notes;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
export class DocumentLevelFootNotePropertiesDestination extends NotePropertiesDestination {
|
17
|
+
constructor(data) {
|
18
|
+
super(data, NotePosition.BottomOfPage, NumberingFormat.Decimal);
|
19
|
+
}
|
20
|
+
get elementHandlerTable() {
|
21
|
+
return DocumentLevelFootNotePropertiesDestination.handlerTable;
|
22
|
+
}
|
23
|
+
setProperties(notes) {
|
24
|
+
this.data.documentModel.sections[0].sectionProperties.footNote = notes;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
DocumentLevelFootNotePropertiesDestination.handlerTable = new MapCreator()
|
28
|
+
.append(NotePropertiesDestination.handlerTable)
|
29
|
+
.add('footnote', (data) => new FootNoteSeparatorDestination(data))
|
30
|
+
.get();
|
31
|
+
class FootNoteSeparatorDestination extends LeafElementDestination {
|
32
|
+
processElementOpen(reader) {
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
34
|
+
const id = reader.getAttributeNS("id", this.data.constants.wordProcessingNamespaceConst);
|
35
|
+
if (!StringUtils.isNullOrEmpty(id))
|
36
|
+
this.data.footNotesImporter.separatorIds.push(id);
|
37
|
+
});
|
38
|
+
}
|
39
|
+
}
|
40
|
+
export class SectionFootNoteColumnsCountDestination extends LeafElementDestination {
|
41
|
+
processElementOpen(reader) {
|
42
|
+
var _a;
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
44
|
+
const noteProps = (_a = this.data.sectionImporter.properties.footNote) !== null && _a !== void 0 ? _a : new NoteProperties();
|
45
|
+
noteProps.columnCount = this.data.readerHelper.getWpSTIntegerValue(reader, "val", 1);
|
46
|
+
this.data.sectionImporter.properties.footNote = noteProps;
|
47
|
+
});
|
48
|
+
}
|
49
|
+
}
|
package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.js
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
import { NoteReferenceDestination } from "../note-reference-destination";
|
2
|
+
export class FootNoteReferenceDestination extends NoteReferenceDestination {
|
3
|
+
get notes() {
|
4
|
+
return this.data.footNotesImporter.notes;
|
5
|
+
}
|
6
|
+
insertNoteRun(subDocId) {
|
7
|
+
this.data.footNotesImporter.insertRun(subDocId);
|
8
|
+
}
|
9
|
+
}
|