docx 7.4.1 → 7.6.0
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/LICENSE +21 -21
- package/build/export/packer/image-replacer.d.ts +2 -2
- package/build/export/packer/numbering-replacer.d.ts +1 -1
- package/build/export/packer/packer.d.ts +4 -0
- package/build/file/core-properties/properties.d.ts +3 -3
- package/build/file/custom-properties/custom-properties.d.ts +1 -1
- package/build/file/document/body/section-properties/properties/columns.d.ts +1 -1
- package/build/file/drawing/text-wrap/wrap-square.d.ts +1 -1
- package/build/file/file.d.ts +3 -3
- package/build/file/footnotes/footnote/footnote.d.ts +1 -1
- package/build/file/footnotes/footnotes.d.ts +1 -1
- package/build/file/header.d.ts +1 -1
- package/build/file/numbering/abstract-numbering.d.ts +1 -1
- package/build/file/numbering/level.d.ts +2 -2
- package/build/file/numbering/numbering.d.ts +4 -4
- package/build/file/paragraph/formatting/tab-stop.d.ts +7 -2
- package/build/file/paragraph/links/bookmark.d.ts +2 -2
- package/build/file/paragraph/links/hyperlink.d.ts +5 -5
- package/build/file/paragraph/math/brackets/math-angled-brackets.d.ts +1 -1
- package/build/file/paragraph/math/brackets/math-curly-brackets.d.ts +1 -1
- package/build/file/paragraph/math/brackets/math-round-brackets.d.ts +1 -1
- package/build/file/paragraph/math/brackets/math-square-brackets.d.ts +1 -1
- package/build/file/paragraph/math/fraction/math-denominator.d.ts +1 -1
- package/build/file/paragraph/math/fraction/math-fraction.d.ts +2 -2
- package/build/file/paragraph/math/fraction/math-numerator.d.ts +1 -1
- package/build/file/paragraph/math/function/math-function-name.d.ts +1 -1
- package/build/file/paragraph/math/function/math-function.d.ts +2 -2
- package/build/file/paragraph/math/math-component.d.ts +2 -2
- package/build/file/paragraph/math/math.d.ts +1 -1
- package/build/file/paragraph/math/n-ary/index.d.ts +1 -0
- package/build/file/paragraph/math/n-ary/math-base.d.ts +1 -1
- package/build/file/paragraph/math/n-ary/math-integral.d.ts +10 -0
- package/build/file/paragraph/math/n-ary/math-sub-script.d.ts +1 -1
- package/build/file/paragraph/math/n-ary/math-sum.d.ts +3 -3
- package/build/file/paragraph/math/n-ary/math-super-script.d.ts +1 -1
- package/build/file/paragraph/math/radical/math-degree.d.ts +1 -1
- package/build/file/paragraph/math/radical/math-radical.d.ts +2 -2
- package/build/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.d.ts +3 -3
- package/build/file/paragraph/math/script/sub-script/math-sub-script-function.d.ts +2 -2
- package/build/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.d.ts +3 -3
- package/build/file/paragraph/math/script/super-script/math-super-script-function.d.ts +2 -2
- package/build/file/paragraph/paragraph.d.ts +1 -1
- package/build/file/paragraph/properties.d.ts +2 -6
- package/build/file/paragraph/run/comment-run.d.ts +1 -1
- package/build/file/paragraph/run/run.d.ts +1 -1
- package/build/file/styles/sample/default-style.d.ts +1 -102
- package/build/file/styles/styles.d.ts +3 -3
- package/build/file/table/grid.d.ts +1 -1
- package/build/file/table/table-cell/table-cell.d.ts +1 -1
- package/build/file/table/table-row/table-row.d.ts +2 -2
- package/build/file/table/table.d.ts +2 -2
- package/build/file/table-of-contents/table-of-contents-properties.d.ts +1 -1
- package/build/file/xml-components/default-attributes.d.ts +3 -3
- package/build/file/xml-components/imported-xml-component.d.ts +2 -2
- package/build/index.js +1 -1
- package/build/index.js.LICENSE.txt +0 -12
- package/build/util/values.d.ts +17 -17
- package/package.json +15 -8
- package/src/export/packer/image-replacer.ts +2 -2
- package/src/export/packer/next-compiler.spec.ts +2 -2
- package/src/export/packer/next-compiler.ts +8 -8
- package/src/export/packer/numbering-replacer.ts +1 -1
- package/src/export/packer/packer.spec.ts +65 -7
- package/src/export/packer/packer.ts +24 -0
- package/src/file/app-properties/app-properties.ts +1 -1
- package/src/file/border/border.ts +1 -1
- package/src/file/content-types/content-types.ts +1 -1
- package/src/file/content-types/default/default.ts +1 -1
- package/src/file/content-types/override/override.ts +1 -1
- package/src/file/core-properties/properties.ts +5 -5
- package/src/file/custom-properties/custom-properties.ts +4 -2
- package/src/file/custom-properties/custom-property.ts +2 -2
- package/src/file/document/body/body.ts +3 -1
- package/src/file/document/body/section-properties/properties/column.ts +1 -1
- package/src/file/document/body/section-properties/properties/columns.spec.ts +7 -0
- package/src/file/document/body/section-properties/properties/columns.ts +2 -2
- package/src/file/document/body/section-properties/properties/doc-grid.ts +1 -1
- package/src/file/document/body/section-properties/properties/header-footer-reference.ts +1 -1
- package/src/file/document/body/section-properties/properties/line-number.ts +1 -1
- package/src/file/document/body/section-properties/properties/page-borders.ts +1 -1
- package/src/file/document/body/section-properties/properties/page-margin.ts +1 -1
- package/src/file/document/body/section-properties/properties/page-number.ts +1 -1
- package/src/file/document/body/section-properties/properties/page-size.ts +1 -1
- package/src/file/document/body/section-properties/properties/page-text-direction.ts +1 -1
- package/src/file/document/body/section-properties/properties/section-type.ts +1 -1
- package/src/file/document/body/section-properties/section-properties.ts +1 -1
- package/src/file/document/document-background/document-background.ts +1 -1
- package/src/file/document/document.ts +1 -1
- package/src/file/document-wrapper.spec.ts +0 -2
- package/src/file/document-wrapper.ts +1 -1
- package/src/file/drawing/anchor/anchor.spec.ts +2 -3
- package/src/file/drawing/anchor/anchor.ts +1 -1
- package/src/file/drawing/doc-properties/doc-properties.ts +1 -1
- package/src/file/drawing/drawing.spec.ts +2 -3
- package/src/file/drawing/drawing.ts +1 -1
- package/src/file/drawing/effect-extent/effect-extent.ts +1 -1
- package/src/file/drawing/extent/extent.ts +1 -1
- package/src/file/drawing/floating/align.ts +1 -1
- package/src/file/drawing/floating/horizontal-position.ts +1 -1
- package/src/file/drawing/floating/position-offset.ts +1 -1
- package/src/file/drawing/floating/simple-pos.ts +1 -1
- package/src/file/drawing/floating/vertical-position.ts +1 -1
- package/src/file/drawing/graphic-frame/graphic-frame-locks/graphic-frame-locks.ts +1 -1
- package/src/file/drawing/graphic-frame/graphic-frame-properties.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/graphic-data.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts +2 -2
- package/src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/child-non-visual-pic-properties/child-non-visual-pic-properties.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/child-non-visual-pic-properties/pic-locks/pic-locks.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-pic-properties.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-properties/non-visual-properties.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/pic.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/form.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/adjustment-values/adjustment-values.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/preset-geometry.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts +1 -1
- package/src/file/drawing/inline/graphic/graphic.ts +1 -1
- package/src/file/drawing/inline/inline.ts +1 -1
- package/src/file/drawing/text-wrap/wrap-none.ts +1 -1
- package/src/file/drawing/text-wrap/wrap-square.ts +3 -2
- package/src/file/drawing/text-wrap/wrap-tight.ts +1 -1
- package/src/file/drawing/text-wrap/wrap-top-and-bottom.ts +1 -1
- package/src/file/file.spec.ts +55 -2
- package/src/file/file.ts +18 -13
- package/src/file/footer/footer.ts +1 -1
- package/src/file/footer-wrapper.spec.ts +1 -1
- package/src/file/footer-wrapper.ts +1 -1
- package/src/file/footnotes/footnote/footnote.ts +2 -2
- package/src/file/footnotes/footnote/run/continuation-seperator-run.ts +1 -1
- package/src/file/footnotes/footnote/run/continuation-seperator.ts +1 -1
- package/src/file/footnotes/footnote/run/footnote-ref-run.ts +1 -1
- package/src/file/footnotes/footnote/run/footnote-ref.ts +1 -1
- package/src/file/footnotes/footnote/run/reference-run.ts +2 -2
- package/src/file/footnotes/footnote/run/seperator-run.ts +1 -1
- package/src/file/footnotes/footnote/run/seperator.ts +1 -1
- package/src/file/footnotes/footnotes.ts +2 -2
- package/src/file/footnotes-wrapper.spec.ts +0 -2
- package/src/file/footnotes-wrapper.ts +1 -1
- package/src/file/header/header.ts +1 -1
- package/src/file/header-wrapper.spec.ts +1 -1
- package/src/file/header-wrapper.ts +1 -1
- package/src/file/header.ts +11 -3
- package/src/file/media/media.spec.ts +4 -2
- package/src/file/media/media.ts +3 -1
- package/src/file/numbering/abstract-numbering.ts +1 -1
- package/src/file/numbering/level.spec.ts +40 -3
- package/src/file/numbering/level.ts +27 -8
- package/src/file/numbering/multi-level-type.ts +1 -1
- package/src/file/numbering/num.ts +4 -4
- package/src/file/numbering/numbering.spec.ts +2 -1
- package/src/file/numbering/numbering.ts +18 -18
- package/src/file/paragraph/formatting/alignment.ts +1 -1
- package/src/file/paragraph/formatting/border.ts +2 -2
- package/src/file/paragraph/formatting/break.ts +4 -4
- package/src/file/paragraph/formatting/indent.ts +1 -1
- package/src/file/paragraph/formatting/spacing.ts +1 -1
- package/src/file/paragraph/formatting/style.ts +1 -1
- package/src/file/paragraph/formatting/tab-stop.spec.ts +2 -2
- package/src/file/paragraph/formatting/tab-stop.ts +14 -5
- package/src/file/paragraph/formatting/unordered-list.ts +3 -3
- package/src/file/paragraph/frame/frame-properties.ts +1 -1
- package/src/file/paragraph/links/bookmark.ts +4 -4
- package/src/file/paragraph/links/hyperlink.ts +6 -4
- package/src/file/paragraph/links/outline-level.ts +1 -1
- package/src/file/paragraph/links/pageref-field-instruction.ts +1 -1
- package/src/file/paragraph/links/pageref.ts +1 -1
- package/src/file/paragraph/math/brackets/math-angled-brackets.ts +1 -1
- package/src/file/paragraph/math/brackets/math-beginning-character.ts +1 -1
- package/src/file/paragraph/math/brackets/math-bracket-properties.ts +1 -1
- package/src/file/paragraph/math/brackets/math-curly-brackets.ts +1 -1
- package/src/file/paragraph/math/brackets/math-ending-char.ts +1 -1
- package/src/file/paragraph/math/brackets/math-round-brackets.ts +1 -1
- package/src/file/paragraph/math/brackets/math-square-brackets.ts +1 -1
- package/src/file/paragraph/math/fraction/math-denominator.ts +1 -1
- package/src/file/paragraph/math/fraction/math-fraction.ts +3 -3
- package/src/file/paragraph/math/fraction/math-numerator.ts +1 -1
- package/src/file/paragraph/math/function/math-function-name.ts +1 -1
- package/src/file/paragraph/math/function/math-function-properties.ts +1 -1
- package/src/file/paragraph/math/function/math-function.ts +3 -3
- package/src/file/paragraph/math/math-component.ts +2 -1
- package/src/file/paragraph/math/math-run.ts +1 -1
- package/src/file/paragraph/math/math-text.ts +1 -1
- package/src/file/paragraph/math/math.ts +2 -2
- package/src/file/paragraph/math/n-ary/index.ts +1 -0
- package/src/file/paragraph/math/n-ary/math-accent-character.ts +1 -1
- package/src/file/paragraph/math/n-ary/math-base.ts +1 -1
- package/src/file/paragraph/math/n-ary/math-integral.spec.ts +116 -0
- package/src/file/paragraph/math/n-ary/math-integral.ts +31 -0
- package/src/file/paragraph/math/n-ary/math-limit-location.ts +1 -1
- package/src/file/paragraph/math/n-ary/math-n-ary-properties.ts +4 -2
- package/src/file/paragraph/math/n-ary/math-sub-script-hide.ts +1 -1
- package/src/file/paragraph/math/n-ary/math-sub-script.ts +1 -1
- package/src/file/paragraph/math/n-ary/math-sum.ts +4 -4
- package/src/file/paragraph/math/n-ary/math-super-script-hide.ts +1 -1
- package/src/file/paragraph/math/n-ary/math-super-script.ts +1 -1
- package/src/file/paragraph/math/radical/math-degree-hide.ts +1 -1
- package/src/file/paragraph/math/radical/math-degree.ts +1 -1
- package/src/file/paragraph/math/radical/math-radical-properties.ts +1 -1
- package/src/file/paragraph/math/radical/math-radical.ts +3 -3
- package/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function-properties.ts +1 -1
- package/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.ts +4 -4
- package/src/file/paragraph/math/script/sub-script/math-sub-script-function-properties.ts +1 -1
- package/src/file/paragraph/math/script/sub-script/math-sub-script-function.ts +3 -3
- package/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function-properties.ts +1 -1
- package/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.ts +4 -4
- package/src/file/paragraph/math/script/super-script/math-super-script-function-properties.ts +1 -1
- package/src/file/paragraph/math/script/super-script/math-super-script-function.ts +3 -3
- package/src/file/paragraph/paragraph.spec.ts +2 -6
- package/src/file/paragraph/paragraph.ts +2 -2
- package/src/file/paragraph/properties.spec.ts +1 -3
- package/src/file/paragraph/properties.ts +18 -18
- package/src/file/paragraph/run/break.ts +1 -1
- package/src/file/paragraph/run/comment-run.ts +6 -6
- package/src/file/paragraph/run/emphasis-mark.ts +2 -2
- package/src/file/paragraph/run/field.ts +3 -3
- package/src/file/paragraph/run/formatting.ts +4 -4
- package/src/file/paragraph/run/image-run.spec.ts +9 -9
- package/src/file/paragraph/run/image-run.ts +2 -1
- package/src/file/paragraph/run/page-number.ts +3 -3
- package/src/file/paragraph/run/properties.ts +2 -2
- package/src/file/paragraph/run/run-components/symbol.ts +1 -1
- package/src/file/paragraph/run/run-components/text.ts +1 -1
- package/src/file/paragraph/run/run-fonts.ts +5 -5
- package/src/file/paragraph/run/run.spec.ts +1 -3
- package/src/file/paragraph/run/run.ts +2 -2
- package/src/file/paragraph/run/script.ts +3 -3
- package/src/file/paragraph/run/sequential-identifier-instruction.ts +1 -1
- package/src/file/paragraph/run/sequential-identifier.ts +1 -1
- package/src/file/paragraph/run/simple-field.ts +2 -2
- package/src/file/paragraph/run/symbol-run.spec.ts +1 -3
- package/src/file/paragraph/run/symbol-run.ts +1 -1
- package/src/file/paragraph/run/tab.ts +1 -1
- package/src/file/paragraph/run/text-run.ts +1 -1
- package/src/file/paragraph/run/underline.ts +1 -1
- package/src/file/relationships/relationship/relationship.ts +1 -1
- package/src/file/relationships/relationships.ts +1 -1
- package/src/file/settings/compatibility-setting/compatibility-setting.ts +1 -1
- package/src/file/settings/compatibility.ts +1 -1
- package/src/file/settings/settings.ts +1 -1
- package/src/file/shading/shading.ts +1 -1
- package/src/file/styles/defaults/document-defaults.spec.ts +2 -2
- package/src/file/styles/defaults/document-defaults.ts +1 -1
- package/src/file/styles/defaults/paragraph-properties.ts +1 -1
- package/src/file/styles/defaults/run-properties.ts +1 -1
- package/src/file/styles/external-styles-factory.spec.ts +3 -3
- package/src/file/styles/external-styles-factory.ts +1 -0
- package/src/file/styles/latent-styles/exceptions.ts +1 -1
- package/src/file/styles/latent-styles/latent-styles.ts +1 -1
- package/src/file/styles/sample/default-style.ts +6 -6
- package/src/file/styles/style/character-style.ts +1 -1
- package/src/file/styles/style/components.ts +2 -2
- package/src/file/styles/style/default-styles.spec.ts +1 -2
- package/src/file/styles/style/default-styles.ts +14 -14
- package/src/file/styles/style/paragraph-style.ts +1 -1
- package/src/file/styles/style/style.ts +1 -1
- package/src/file/styles/styles.ts +4 -4
- package/src/file/table/grid.spec.ts +1 -2
- package/src/file/table/grid.ts +2 -2
- package/src/file/table/table-cell/table-cell-components.ts +4 -4
- package/src/file/table/table-cell/table-cell-properties.ts +1 -1
- package/src/file/table/table-cell/table-cell.ts +2 -2
- package/src/file/table/table-properties/table-borders.ts +1 -1
- package/src/file/table/table-properties/table-cell-margin.ts +4 -1
- package/src/file/table/table-properties/table-float-properties.ts +1 -1
- package/src/file/table/table-properties/table-layout.ts +1 -1
- package/src/file/table/table-properties/table-overlap.ts +1 -1
- package/src/file/table/table-properties/table-properties.ts +1 -1
- package/src/file/table/table-row/table-row-height.ts +1 -1
- package/src/file/table/table-row/table-row-properties.ts +1 -1
- package/src/file/table/table-row/table-row.ts +3 -3
- package/src/file/table/table-width.ts +1 -1
- package/src/file/table/table.ts +4 -3
- package/src/file/table-of-contents/alias.ts +1 -1
- package/src/file/table-of-contents/field-instruction.ts +1 -1
- package/src/file/table-of-contents/sdt-content.ts +1 -1
- package/src/file/table-of-contents/sdt-properties.ts +1 -1
- package/src/file/table-of-contents/table-of-contents-properties.ts +2 -2
- package/src/file/table-of-contents/table-of-contents.spec.ts +1 -3
- package/src/file/table-of-contents/table-of-contents.ts +1 -1
- package/src/file/track-revision/track-revision-components/deleted-page-number.ts +3 -3
- package/src/file/track-revision/track-revision-components/deleted-text-run.ts +2 -2
- package/src/file/track-revision/track-revision-components/deleted-text.ts +1 -1
- package/src/file/track-revision/track-revision-components/inserted-text-run.ts +1 -1
- package/src/file/vertical-align/vertical-align.ts +1 -1
- package/src/file/xml-components/base.ts +1 -1
- package/src/file/xml-components/default-attributes.ts +5 -4
- package/src/file/xml-components/imported-xml-component.spec.ts +3 -2
- package/src/file/xml-components/imported-xml-component.ts +13 -8
- package/src/file/xml-components/initializable-xml-component.ts +1 -1
- package/src/file/xml-components/simple-elements.ts +5 -5
- package/src/file/xml-components/xml-component.ts +4 -2
- package/src/import-dotx/import-dotx.ts +2 -0
- package/src/index.spec.ts +0 -1
- package/src/tests/utility.ts +1 -1
- package/src/util/convenience-functions.spec.ts +0 -2
- package/src/util/convenience-functions.ts +4 -12
- package/src/util/values.ts +29 -41
|
@@ -10,7 +10,7 @@ class PageTextDirectionAttributes extends XmlAttributeComponent<{ readonly val:
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export class PageTextDirection extends XmlComponent {
|
|
13
|
-
constructor(value: PageTextDirectionType) {
|
|
13
|
+
public constructor(value: PageTextDirectionType) {
|
|
14
14
|
super("w:textDirection");
|
|
15
15
|
|
|
16
16
|
this.root.push(
|
|
@@ -30,7 +30,7 @@ export class SectionTypeAttributes extends XmlAttributeComponent<{
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export class Type extends XmlComponent {
|
|
33
|
-
constructor(value: SectionType) {
|
|
33
|
+
public constructor(value: SectionType) {
|
|
34
34
|
super("w:type");
|
|
35
35
|
this.root.push(new SectionTypeAttributes({ val: value }));
|
|
36
36
|
}
|
|
@@ -63,7 +63,7 @@ export interface IDocumentBackgroundOptions {
|
|
|
63
63
|
// </xsd:complexType>
|
|
64
64
|
|
|
65
65
|
export class DocumentBackground extends XmlComponent {
|
|
66
|
-
constructor(options: IDocumentBackgroundOptions) {
|
|
66
|
+
public constructor(options: IDocumentBackgroundOptions) {
|
|
67
67
|
super("w:background");
|
|
68
68
|
|
|
69
69
|
this.root.push(
|
|
@@ -33,7 +33,7 @@ export interface IDocumentOptions {
|
|
|
33
33
|
export class Document extends XmlComponent {
|
|
34
34
|
private readonly body: Body;
|
|
35
35
|
|
|
36
|
-
constructor(options: IDocumentOptions) {
|
|
36
|
+
public constructor(options: IDocumentOptions) {
|
|
37
37
|
super("w:document");
|
|
38
38
|
this.root.push(
|
|
39
39
|
new DocumentAttributes({
|
|
@@ -7,9 +7,7 @@ describe("DocumentWrapper", () => {
|
|
|
7
7
|
it("should create", () => {
|
|
8
8
|
const file = new DocumentWrapper({ background: {} });
|
|
9
9
|
|
|
10
|
-
// tslint:disable-next-line: no-unused-expression
|
|
11
10
|
expect(file.View).to.be.ok;
|
|
12
|
-
// tslint:disable-next-line: no-unused-expression
|
|
13
11
|
expect(file.Relationships).to.be.ok;
|
|
14
12
|
});
|
|
15
13
|
});
|
|
@@ -13,7 +13,7 @@ export class DocumentWrapper implements IViewWrapper {
|
|
|
13
13
|
private readonly document: Document;
|
|
14
14
|
private readonly relationships: Relationships;
|
|
15
15
|
|
|
16
|
-
constructor(options: IDocumentOptions) {
|
|
16
|
+
public constructor(options: IDocumentOptions) {
|
|
17
17
|
this.document = new Document(options);
|
|
18
18
|
this.relationships = new Relationships();
|
|
19
19
|
}
|
|
@@ -6,8 +6,8 @@ import { IDrawingOptions } from "../drawing";
|
|
|
6
6
|
import { TextWrappingType } from "../text-wrap";
|
|
7
7
|
import { Anchor } from "./anchor";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const createAnchor = (drawingOptions: IDrawingOptions): Anchor =>
|
|
10
|
+
new Anchor(
|
|
11
11
|
{
|
|
12
12
|
fileName: "test.png",
|
|
13
13
|
stream: new Buffer(""),
|
|
@@ -34,7 +34,6 @@ function createAnchor(drawingOptions: IDrawingOptions): Anchor {
|
|
|
34
34
|
},
|
|
35
35
|
drawingOptions,
|
|
36
36
|
);
|
|
37
|
-
}
|
|
38
37
|
|
|
39
38
|
describe("Anchor", () => {
|
|
40
39
|
let anchor: Anchor;
|
|
@@ -37,7 +37,7 @@ import { AnchorAttributes } from "./anchor-attributes";
|
|
|
37
37
|
// <xsd:attribute name="allowOverlap" type="xsd:boolean" use="required"/>
|
|
38
38
|
// </xsd:complexType>
|
|
39
39
|
export class Anchor extends XmlComponent {
|
|
40
|
-
constructor(mediaData: IMediaData, transform: IMediaDataTransformation, drawingOptions: IDrawingOptions) {
|
|
40
|
+
public constructor(mediaData: IMediaData, transform: IMediaDataTransformation, drawingOptions: IDrawingOptions) {
|
|
41
41
|
super("wp:anchor");
|
|
42
42
|
|
|
43
43
|
const floating: IFloating = {
|
|
@@ -6,8 +6,8 @@ import { Drawing, IDrawingOptions } from "./drawing";
|
|
|
6
6
|
|
|
7
7
|
const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhom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|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const createDrawing = (drawingOptions?: IDrawingOptions): Drawing =>
|
|
10
|
+
new Drawing(
|
|
11
11
|
{
|
|
12
12
|
fileName: "test.jpg",
|
|
13
13
|
stream: Buffer.from(imageBase64Data, "base64"),
|
|
@@ -24,7 +24,6 @@ function createDrawing(drawingOptions?: IDrawingOptions): Drawing {
|
|
|
24
24
|
},
|
|
25
25
|
drawingOptions,
|
|
26
26
|
);
|
|
27
|
-
}
|
|
28
27
|
|
|
29
28
|
describe("Drawing", () => {
|
|
30
29
|
let currentBreak: Drawing;
|
|
@@ -25,7 +25,7 @@ export interface IDrawingOptions {
|
|
|
25
25
|
export class Drawing extends XmlComponent {
|
|
26
26
|
private readonly inline: Inline;
|
|
27
27
|
|
|
28
|
-
constructor(imageData: IMediaData, drawingOptions: IDrawingOptions = {}) {
|
|
28
|
+
public constructor(imageData: IMediaData, drawingOptions: IDrawingOptions = {}) {
|
|
29
29
|
super("w:drawing");
|
|
30
30
|
|
|
31
31
|
if (!drawingOptions.floating) {
|
|
@@ -5,7 +5,7 @@ import { ExtentAttributes } from "./extent-attributes";
|
|
|
5
5
|
export class Extent extends XmlComponent {
|
|
6
6
|
private readonly attributes: ExtentAttributes;
|
|
7
7
|
|
|
8
|
-
constructor(x: number, y: number) {
|
|
8
|
+
public constructor(x: number, y: number) {
|
|
9
9
|
super("wp:extent");
|
|
10
10
|
|
|
11
11
|
this.attributes = new ExtentAttributes({
|
|
@@ -3,7 +3,7 @@ import { HorizontalPositionAlign, VerticalPositionAlign } from "@file/shared/ali
|
|
|
3
3
|
import { XmlComponent } from "@file/xml-components";
|
|
4
4
|
|
|
5
5
|
export class Align extends XmlComponent {
|
|
6
|
-
constructor(value: HorizontalPositionAlign | VerticalPositionAlign) {
|
|
6
|
+
public constructor(value: HorizontalPositionAlign | VerticalPositionAlign) {
|
|
7
7
|
super("wp:align");
|
|
8
8
|
this.root.push(value);
|
|
9
9
|
}
|
|
@@ -13,7 +13,7 @@ class HorizontalPositionAttributes extends XmlAttributeComponent<{
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export class HorizontalPosition extends XmlComponent {
|
|
16
|
-
constructor(horizontalPosition: IHorizontalPositionOptions) {
|
|
16
|
+
public constructor(horizontalPosition: IHorizontalPositionOptions) {
|
|
17
17
|
super("wp:positionH");
|
|
18
18
|
|
|
19
19
|
this.root.push(
|
|
@@ -12,7 +12,7 @@ class SimplePosAttributes extends XmlAttributeComponent<{
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export class SimplePos extends XmlComponent {
|
|
15
|
-
constructor() {
|
|
15
|
+
public constructor() {
|
|
16
16
|
super("wp:simplePos");
|
|
17
17
|
|
|
18
18
|
// NOTE: It's not fully supported in Microsoft Word, but this element is needed anyway
|
|
@@ -13,7 +13,7 @@ class VerticalPositionAttributes extends XmlAttributeComponent<{
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export class VerticalPosition extends XmlComponent {
|
|
16
|
-
constructor(verticalPosition: IVerticalPositionOptions) {
|
|
16
|
+
public constructor(verticalPosition: IVerticalPositionOptions) {
|
|
17
17
|
super("wp:positionV");
|
|
18
18
|
|
|
19
19
|
this.root.push(
|
|
@@ -2,7 +2,7 @@ import { XmlComponent } from "@file/xml-components";
|
|
|
2
2
|
import { GraphicFrameLockAttributes } from "./graphic-frame-lock-attributes";
|
|
3
3
|
|
|
4
4
|
export class GraphicFrameLocks extends XmlComponent {
|
|
5
|
-
constructor() {
|
|
5
|
+
public constructor() {
|
|
6
6
|
super("a:graphicFrameLocks");
|
|
7
7
|
|
|
8
8
|
this.root.push(
|
|
@@ -2,7 +2,7 @@ import { XmlComponent } from "@file/xml-components";
|
|
|
2
2
|
import { GraphicFrameLocks } from "./graphic-frame-locks/graphic-frame-locks";
|
|
3
3
|
|
|
4
4
|
export class GraphicFrameProperties extends XmlComponent {
|
|
5
|
-
constructor() {
|
|
5
|
+
public constructor() {
|
|
6
6
|
super("wp:cNvGraphicFramePr");
|
|
7
7
|
|
|
8
8
|
this.root.push(new GraphicFrameLocks());
|
|
@@ -7,7 +7,7 @@ import { Pic } from "./pic";
|
|
|
7
7
|
export class GraphicData extends XmlComponent {
|
|
8
8
|
private readonly pic: Pic;
|
|
9
9
|
|
|
10
|
-
constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
|
10
|
+
public constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
|
11
11
|
super("a:graphicData");
|
|
12
12
|
|
|
13
13
|
this.root.push(
|
|
@@ -6,7 +6,7 @@ import { SourceRectangle } from "./source-rectangle";
|
|
|
6
6
|
import { Stretch } from "./stretch";
|
|
7
7
|
|
|
8
8
|
export class BlipFill extends XmlComponent {
|
|
9
|
-
constructor(mediaData: IMediaData) {
|
|
9
|
+
public constructor(mediaData: IMediaData) {
|
|
10
10
|
super("pic:blipFill");
|
|
11
11
|
|
|
12
12
|
this.root.push(new Blip(mediaData));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { XmlComponent } from "@file/xml-components";
|
|
2
2
|
|
|
3
3
|
class FillRectangle extends XmlComponent {
|
|
4
|
-
constructor() {
|
|
4
|
+
public constructor() {
|
|
5
5
|
super("a:fillRect");
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export class Stretch extends XmlComponent {
|
|
10
|
-
constructor() {
|
|
10
|
+
public constructor() {
|
|
11
11
|
super("a:stretch");
|
|
12
12
|
this.root.push(new FillRectangle());
|
|
13
13
|
}
|
|
@@ -2,7 +2,7 @@ import { XmlComponent } from "@file/xml-components";
|
|
|
2
2
|
import { PicLocks } from "./pic-locks/pic-locks";
|
|
3
3
|
|
|
4
4
|
export class ChildNonVisualProperties extends XmlComponent {
|
|
5
|
-
constructor() {
|
|
5
|
+
public constructor() {
|
|
6
6
|
super("pic:cNvPicPr");
|
|
7
7
|
|
|
8
8
|
this.root.push(new PicLocks());
|
|
@@ -2,7 +2,7 @@ import { XmlComponent } from "@file/xml-components";
|
|
|
2
2
|
import { PicLocksAttributes } from "./pic-locks-attributes";
|
|
3
3
|
|
|
4
4
|
export class PicLocks extends XmlComponent {
|
|
5
|
-
constructor() {
|
|
5
|
+
public constructor() {
|
|
6
6
|
super("a:picLocks");
|
|
7
7
|
this.root.push(
|
|
8
8
|
new PicLocksAttributes({
|
|
@@ -3,7 +3,7 @@ import { ChildNonVisualProperties } from "./child-non-visual-pic-properties/chil
|
|
|
3
3
|
import { NonVisualProperties } from "./non-visual-properties/non-visual-properties";
|
|
4
4
|
|
|
5
5
|
export class NonVisualPicProperties extends XmlComponent {
|
|
6
|
-
constructor() {
|
|
6
|
+
public constructor() {
|
|
7
7
|
super("pic:nvPicPr");
|
|
8
8
|
|
|
9
9
|
this.root.push(new NonVisualProperties());
|
|
@@ -2,7 +2,7 @@ import { XmlComponent } from "@file/xml-components";
|
|
|
2
2
|
import { NonVisualPropertiesAttributes } from "./non-visual-properties-attributes";
|
|
3
3
|
|
|
4
4
|
export class NonVisualProperties extends XmlComponent {
|
|
5
|
-
constructor() {
|
|
5
|
+
public constructor() {
|
|
6
6
|
super("pic:cNvPr");
|
|
7
7
|
|
|
8
8
|
this.root.push(
|
|
@@ -8,7 +8,7 @@ import { PicAttributes } from "./pic-attributes";
|
|
|
8
8
|
import { ShapeProperties } from "./shape-properties/shape-properties";
|
|
9
9
|
|
|
10
10
|
export class Pic extends XmlComponent {
|
|
11
|
-
constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
|
11
|
+
public constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
|
12
12
|
super("pic:pic");
|
|
13
13
|
|
|
14
14
|
this.root.push(
|
package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ExtentsAttributes } from "./extents-attributes";
|
|
|
5
5
|
export class Extents extends XmlComponent {
|
|
6
6
|
private readonly attributes: ExtentsAttributes;
|
|
7
7
|
|
|
8
|
-
constructor(x: number, y: number) {
|
|
8
|
+
public constructor(x: number, y: number) {
|
|
9
9
|
super("a:ext");
|
|
10
10
|
|
|
11
11
|
this.attributes = new ExtentsAttributes({
|
|
@@ -21,7 +21,7 @@ export class FormAttributes extends XmlAttributeComponent<{
|
|
|
21
21
|
export class Form extends XmlComponent {
|
|
22
22
|
private readonly extents: Extents;
|
|
23
23
|
|
|
24
|
-
constructor(options: IMediaDataTransformation) {
|
|
24
|
+
public constructor(options: IMediaDataTransformation) {
|
|
25
25
|
super("a:xfrm");
|
|
26
26
|
|
|
27
27
|
this.root.push(
|
|
@@ -4,7 +4,7 @@ import { AdjustmentValues } from "./adjustment-values/adjustment-values";
|
|
|
4
4
|
import { PresetGeometryAttributes } from "./preset-geometry-attributes";
|
|
5
5
|
|
|
6
6
|
export class PresetGeometry extends XmlComponent {
|
|
7
|
-
constructor() {
|
|
7
|
+
public constructor() {
|
|
8
8
|
super("a:prstGeom");
|
|
9
9
|
|
|
10
10
|
this.root.push(
|
package/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ShapePropertiesAttributes } from "./shape-properties-attributes";
|
|
|
10
10
|
export class ShapeProperties extends XmlComponent {
|
|
11
11
|
private readonly form: Form;
|
|
12
12
|
|
|
13
|
-
constructor(transform: IMediaDataTransformation) {
|
|
13
|
+
public constructor(transform: IMediaDataTransformation) {
|
|
14
14
|
super("pic:spPr");
|
|
15
15
|
|
|
16
16
|
this.root.push(
|
|
@@ -14,7 +14,7 @@ class GraphicAttributes extends XmlAttributeComponent<{
|
|
|
14
14
|
export class Graphic extends XmlComponent {
|
|
15
15
|
private readonly data: GraphicData;
|
|
16
16
|
|
|
17
|
-
constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
|
17
|
+
public constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
|
18
18
|
super("a:graphic");
|
|
19
19
|
this.root.push(
|
|
20
20
|
new GraphicAttributes({
|
|
@@ -26,7 +26,7 @@ export class Inline extends XmlComponent {
|
|
|
26
26
|
private readonly extent: Extent;
|
|
27
27
|
private readonly graphic: Graphic;
|
|
28
28
|
|
|
29
|
-
constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
|
29
|
+
public constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
|
30
30
|
super("wp:inline");
|
|
31
31
|
|
|
32
32
|
this.root.push(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// http://officeopenxml.com/drwPicFloating-textWrap.php
|
|
2
2
|
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import { IDistance } from "../drawing";
|
|
5
5
|
import { IMargins } from "../floating";
|
|
6
|
+
import { ITextWrapping, TextWrappingSide } from "./text-wrapping";
|
|
6
7
|
|
|
7
8
|
interface IWrapSquareAttributes extends IDistance {
|
|
8
9
|
readonly wrapText?: TextWrappingSide;
|
|
@@ -19,7 +20,7 @@ class WrapSquareAttributes extends XmlAttributeComponent<IWrapSquareAttributes>
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export class WrapSquare extends XmlComponent {
|
|
22
|
-
constructor(
|
|
23
|
+
public constructor(
|
|
23
24
|
textWrapping: ITextWrapping,
|
|
24
25
|
margins: IMargins = {
|
|
25
26
|
top: 0,
|
package/src/file/file.spec.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { sectionMarginDefaults, sectionPageSizeDefaults } from "./document";
|
|
|
6
6
|
import { File } from "./file";
|
|
7
7
|
import { Footer, Header } from "./header";
|
|
8
8
|
import { Paragraph } from "./paragraph";
|
|
9
|
+
import { Media } from "./media";
|
|
9
10
|
|
|
10
11
|
const PAGE_SIZE_DEFAULTS = {
|
|
11
12
|
"w:h": sectionPageSizeDefaults.HEIGHT,
|
|
@@ -397,7 +398,6 @@ describe("File", () => {
|
|
|
397
398
|
sections: [],
|
|
398
399
|
});
|
|
399
400
|
|
|
400
|
-
// tslint:disable-next-line: no-unused-expression
|
|
401
401
|
expect(doc.Comments).to.not.be.undefined;
|
|
402
402
|
});
|
|
403
403
|
});
|
|
@@ -409,8 +409,61 @@ describe("File", () => {
|
|
|
409
409
|
sections: [],
|
|
410
410
|
});
|
|
411
411
|
|
|
412
|
-
// tslint:disable-next-line: no-unused-expression
|
|
413
412
|
expect(doc.Numbering).to.not.be.undefined;
|
|
414
413
|
});
|
|
415
414
|
});
|
|
415
|
+
|
|
416
|
+
describe("#getters", () => {
|
|
417
|
+
it("should have defined getters", () => {
|
|
418
|
+
const doc = new File({
|
|
419
|
+
sections: [],
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
expect(doc.CoreProperties).to.not.be.undefined;
|
|
423
|
+
expect(doc.Media).to.not.be.undefined;
|
|
424
|
+
expect(doc.FileRelationships).to.not.be.undefined;
|
|
425
|
+
expect(doc.Headers).to.not.be.undefined;
|
|
426
|
+
expect(doc.Footers).to.not.be.undefined;
|
|
427
|
+
expect(doc.ContentTypes).to.not.be.undefined;
|
|
428
|
+
expect(doc.CustomProperties).to.not.be.undefined;
|
|
429
|
+
expect(doc.AppProperties).to.not.be.undefined;
|
|
430
|
+
expect(doc.FootNotes).to.not.be.undefined;
|
|
431
|
+
expect(doc.Settings).to.not.be.undefined;
|
|
432
|
+
expect(doc.Comments).to.not.be.undefined;
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
describe("#templates", () => {
|
|
437
|
+
// Test will be deprecated when import-dotx and templates are deprecated
|
|
438
|
+
it("should work with template", () => {
|
|
439
|
+
const doc = new File(
|
|
440
|
+
{
|
|
441
|
+
sections: [],
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
template: {
|
|
445
|
+
currentRelationshipId: 1,
|
|
446
|
+
headers: [],
|
|
447
|
+
footers: [],
|
|
448
|
+
styles: "",
|
|
449
|
+
titlePageIsDefined: true,
|
|
450
|
+
media: new Media(),
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
);
|
|
454
|
+
|
|
455
|
+
expect(doc).to.not.be.undefined;
|
|
456
|
+
});
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
describe("#externalStyles", () => {
|
|
460
|
+
it("should work with external styles", () => {
|
|
461
|
+
const doc = new File({
|
|
462
|
+
sections: [],
|
|
463
|
+
externalStyles: "",
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
expect(doc.Styles).to.not.be.undefined;
|
|
467
|
+
});
|
|
468
|
+
});
|
|
416
469
|
});
|