docx 7.6.0 → 7.8.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.
Files changed (90) hide show
  1. package/README.md +3 -2
  2. package/build/file/core-properties/properties.d.ts +2 -0
  3. package/build/file/document/document.d.ts +1 -1
  4. package/build/file/drawing/doc-properties/doc-properties.d.ts +6 -1
  5. package/build/file/drawing/drawing.d.ts +2 -0
  6. package/build/file/drawing/inline/inline.d.ts +8 -1
  7. package/build/file/index.d.ts +0 -1
  8. package/build/file/numbering/level.d.ts +57 -8
  9. package/build/file/paragraph/formatting/alignment.d.ts +8 -3
  10. package/build/file/paragraph/formatting/spacing.d.ts +1 -0
  11. package/build/file/paragraph/formatting/width.d.ts +0 -0
  12. package/build/file/paragraph/formatting/word-wrap.d.ts +11 -0
  13. package/build/file/paragraph/frame/frame-properties.d.ts +1 -1
  14. package/build/file/paragraph/math/math-component.d.ts +1 -1
  15. package/build/file/paragraph/paragraph.d.ts +1 -1
  16. package/build/file/paragraph/properties.d.ts +2 -0
  17. package/build/file/paragraph/run/image-run.d.ts +2 -0
  18. package/build/file/paragraph/run/properties.d.ts +3 -2
  19. package/build/file/paragraph/run/run-components/text.d.ts +7 -1
  20. package/build/file/paragraph/run/run.d.ts +2 -1
  21. package/build/file/paragraph/run/text-attributes.d.ts +1 -1
  22. package/build/file/paragraph/run/underline.d.ts +2 -1
  23. package/build/file/relationships/relationship/relationship.d.ts +1 -1
  24. package/build/file/settings/compatibility.d.ts +65 -1
  25. package/build/file/settings/settings.d.ts +3 -1
  26. package/build/file/shared/index.d.ts +1 -0
  27. package/build/file/{space-type.d.ts → shared/space-type.d.ts} +0 -0
  28. package/build/file/table/table-properties/index.d.ts +0 -1
  29. package/build/file/table/table-properties/table-float-properties.d.ts +4 -1
  30. package/build/file/xml-components/default-attributes.d.ts +1 -1
  31. package/build/file/xml-components/simple-elements.d.ts +3 -0
  32. package/build/index.js +1 -1
  33. package/package.json +6 -6
  34. package/src/file/core-properties/properties.ts +2 -0
  35. package/src/file/document/document.ts +4 -2
  36. package/src/file/drawing/anchor/anchor.spec.ts +244 -1
  37. package/src/file/drawing/anchor/anchor.ts +1 -1
  38. package/src/file/drawing/doc-properties/doc-properties.ts +27 -6
  39. package/src/file/drawing/drawing.spec.ts +12 -0
  40. package/src/file/drawing/drawing.ts +8 -1
  41. package/src/file/drawing/inline/inline.ts +9 -3
  42. package/src/file/file.ts +3 -2
  43. package/src/file/index.ts +0 -1
  44. package/src/file/numbering/abstract-numbering.spec.ts +1999 -87
  45. package/src/file/numbering/concrete-numbering.spec.ts +21 -5
  46. package/src/file/numbering/level.ts +126 -8
  47. package/src/file/paragraph/formatting/alignment.ts +37 -2
  48. package/src/file/paragraph/formatting/spacing.ts +1 -0
  49. package/src/file/paragraph/formatting/width.ts +0 -0
  50. package/src/file/paragraph/formatting/word-wrap.spec.ts +20 -0
  51. package/src/file/paragraph/formatting/word-wrap.ts +14 -0
  52. package/src/file/paragraph/links/pageref-field-instruction.ts +1 -1
  53. package/src/file/paragraph/paragraph.spec.ts +2 -1
  54. package/src/file/paragraph/properties.spec.ts +19 -0
  55. package/src/file/paragraph/properties.ts +7 -0
  56. package/src/file/paragraph/run/comment-run.spec.ts +43 -0
  57. package/src/file/paragraph/run/image-run.spec.ts +6 -0
  58. package/src/file/paragraph/run/image-run.ts +10 -7
  59. package/src/file/paragraph/run/page-number.ts +1 -1
  60. package/src/file/paragraph/run/properties.ts +26 -3
  61. package/src/file/paragraph/run/run-components/text.spec.ts +22 -0
  62. package/src/file/paragraph/run/run-components/text.ts +24 -4
  63. package/src/file/paragraph/run/run.spec.ts +53 -8
  64. package/src/file/paragraph/run/run.ts +2 -6
  65. package/src/file/paragraph/run/sequential-identifier-instruction.ts +1 -1
  66. package/src/file/paragraph/run/tab.ts +1 -0
  67. package/src/file/paragraph/run/text-attributes.ts +1 -1
  68. package/src/file/paragraph/run/underline.ts +1 -0
  69. package/src/file/settings/compatibility.spec.ts +729 -3
  70. package/src/file/settings/compatibility.ts +390 -5
  71. package/src/file/settings/settings.spec.ts +75 -0
  72. package/src/file/settings/settings.ts +5 -3
  73. package/src/file/shared/index.ts +1 -0
  74. package/src/file/{space-type.ts → shared/space-type.ts} +0 -0
  75. package/src/file/table/table-properties/index.ts +0 -1
  76. package/src/file/table/table-properties/table-float-properties.spec.ts +7 -2
  77. package/src/file/table/table-properties/table-float-properties.ts +16 -4
  78. package/src/file/table-of-contents/field-instruction.ts +1 -1
  79. package/src/file/table-of-contents/sdt-properties.ts +2 -3
  80. package/src/file/track-revision/track-revision-components/deleted-page-number.ts +1 -1
  81. package/src/file/track-revision/track-revision-components/deleted-text.ts +1 -1
  82. package/src/file/xml-components/imported-xml-component.spec.ts +25 -1
  83. package/src/file/xml-components/simple-elements.ts +7 -0
  84. package/build/file/drawing/doc-properties/doc-properties-attributes.d.ts +0 -12
  85. package/build/file/table/table-properties/table-overlap.d.ts +0 -8
  86. package/build/file/table-of-contents/alias.d.ts +0 -4
  87. package/src/file/drawing/doc-properties/doc-properties-attributes.ts +0 -13
  88. package/src/file/table/table-properties/table-overlap.spec.ts +0 -22
  89. package/src/file/table/table-properties/table-overlap.ts +0 -26
  90. package/src/file/table-of-contents/alias.ts +0 -12
@@ -53,6 +53,13 @@ export class NumberValueElement extends XmlComponent {
53
53
  }
54
54
  }
55
55
 
56
+ export class StringEnumValueElement<T extends string> extends XmlComponent {
57
+ public constructor(name: string, val: T) {
58
+ super(name);
59
+ this.root.push(new Attributes({ val }));
60
+ }
61
+ }
62
+
56
63
  // Simple nodes containing text.
57
64
  //
58
65
  // new StringContainer("hello", "world")
@@ -1,12 +0,0 @@
1
- import { XmlAttributeComponent } from "../../../file/xml-components";
2
- export declare class DocPropertiesAttributes extends XmlAttributeComponent<{
3
- readonly id?: number;
4
- readonly name?: string;
5
- readonly descr?: string;
6
- }> {
7
- protected readonly xmlKeys: {
8
- id: string;
9
- name: string;
10
- descr: string;
11
- };
12
- }
@@ -1,8 +0,0 @@
1
- import { XmlComponent } from "../../../file/xml-components";
2
- export declare enum OverlapType {
3
- NEVER = "never",
4
- OVERLAP = "overlap"
5
- }
6
- export declare class TableOverlap extends XmlComponent {
7
- constructor(type: OverlapType);
8
- }
@@ -1,4 +0,0 @@
1
- import { XmlComponent } from "../../file/xml-components";
2
- export declare class Alias extends XmlComponent {
3
- constructor(alias: string);
4
- }
@@ -1,13 +0,0 @@
1
- import { XmlAttributeComponent } from "@file/xml-components";
2
-
3
- export class DocPropertiesAttributes extends XmlAttributeComponent<{
4
- readonly id?: number;
5
- readonly name?: string;
6
- readonly descr?: string;
7
- }> {
8
- protected readonly xmlKeys = {
9
- id: "id",
10
- name: "name",
11
- descr: "descr",
12
- };
13
- }
@@ -1,22 +0,0 @@
1
- import { expect } from "chai";
2
-
3
- import { Formatter } from "@export/formatter";
4
-
5
- import { OverlapType, TableOverlap } from "./table-overlap";
6
-
7
- describe("TableOverlap", () => {
8
- describe("#constructor", () => {
9
- it("sets the width attribute to the value given", () => {
10
- const tableOverlap = new TableOverlap(OverlapType.OVERLAP);
11
- const tree = new Formatter().format(tableOverlap);
12
-
13
- expect(tree).to.deep.equal({
14
- "w:tblOverlap": {
15
- _attr: {
16
- "w:val": "overlap",
17
- },
18
- },
19
- });
20
- });
21
- });
22
- });
@@ -1,26 +0,0 @@
1
- import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
2
-
3
- // <xsd:simpleType name="ST_TblOverlap">
4
- // <xsd:restriction base="xsd:string">
5
- // <xsd:enumeration value="never"/>
6
- // <xsd:enumeration value="overlap"/>
7
- // </xsd:restriction>
8
- // </xsd:simpleType>
9
- export enum OverlapType {
10
- NEVER = "never",
11
- OVERLAP = "overlap",
12
- }
13
-
14
- // <xsd:complexType name="CT_TblOverlap">
15
- // <xsd:attribute name="val" type="ST_TblOverlap" use="required"/>
16
- // </xsd:complexType>
17
- class TableOverlapAttributes extends XmlAttributeComponent<{ readonly val: OverlapType }> {
18
- protected readonly xmlKeys = { val: "w:val" };
19
- }
20
-
21
- export class TableOverlap extends XmlComponent {
22
- public constructor(type: OverlapType) {
23
- super("w:tblOverlap");
24
- this.root.push(new TableOverlapAttributes({ val: type }));
25
- }
26
- }
@@ -1,12 +0,0 @@
1
- import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
2
-
3
- class AliasAttributes extends XmlAttributeComponent<{ readonly alias: string }> {
4
- protected readonly xmlKeys = { alias: "w:val" };
5
- }
6
-
7
- export class Alias extends XmlComponent {
8
- public constructor(alias: string) {
9
- super("w:alias");
10
- this.root.push(new AliasAttributes({ alias }));
11
- }
12
- }