docx 7.1.0 → 7.3.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/README.md +3 -2
- package/build/file/core-properties/properties.d.ts +1 -1
- package/build/file/document/body/section-properties/properties/doc-grid.d.ts +11 -1
- package/build/file/document/body/section-properties/properties/doc-grid.spec.d.ts +1 -0
- package/build/file/document/body/section-properties/properties/index.d.ts +1 -0
- package/build/file/document/body/section-properties/properties/page-text-direction.d.ts +8 -0
- package/build/file/document/body/section-properties/properties/page-text-direction.spec.d.ts +1 -0
- package/build/file/document/body/section-properties/section-properties.d.ts +3 -1
- package/build/file/document/document-background/document-background.d.ts +1 -1
- package/build/file/numbering/level.spec.d.ts +1 -0
- package/build/file/paragraph/links/bookmark-attributes.d.ts +2 -2
- package/build/file/paragraph/links/bookmark.d.ts +2 -2
- package/build/file/paragraph/run/properties.d.ts +7 -0
- package/build/index.js +1 -1
- package/package.json +14 -7
- package/src/export/packer/next-compiler.ts +2 -7
- package/src/export/packer/packer.spec.ts +1 -1
- package/src/file/core-properties/properties.spec.ts +1 -1
- package/src/file/core-properties/properties.ts +2 -2
- package/src/file/document/body/section-properties/properties/doc-grid.spec.ts +30 -0
- package/src/file/document/body/section-properties/properties/doc-grid.ts +15 -1
- package/src/file/document/body/section-properties/properties/index.ts +1 -0
- package/src/file/document/body/section-properties/properties/page-text-direction.spec.ts +22 -0
- package/src/file/document/body/section-properties/properties/page-text-direction.ts +22 -0
- package/src/file/document/body/section-properties/section-properties.spec.ts +18 -1
- package/src/file/document/body/section-properties/section-properties.ts +9 -2
- package/src/file/document/document-background/document-background.spec.ts +2 -4
- package/src/file/document/document-background/document-background.ts +2 -2
- package/src/file/document/document.spec.ts +1 -3
- package/src/file/file.ts +1 -1
- package/src/file/numbering/level.spec.ts +25 -0
- package/src/file/numbering/level.ts +6 -0
- package/src/file/paragraph/formatting/unordered-list.spec.ts +7 -7
- package/src/file/paragraph/formatting/unordered-list.ts +7 -0
- package/src/file/paragraph/links/bookmark-attributes.ts +2 -2
- package/src/file/paragraph/links/bookmark.spec.ts +1 -1
- package/src/file/paragraph/links/bookmark.ts +36 -4
- package/src/file/paragraph/paragraph.spec.ts +5 -2
- package/src/file/paragraph/properties.spec.ts +45 -11
- package/src/file/paragraph/properties.ts +1 -1
- package/src/file/paragraph/run/properties.ts +23 -0
- package/src/file/paragraph/run/run.spec.ts +60 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img alt="clippy the assistant"
|
|
2
|
+
<img src="./logo/logo-animate.svg" width="100%" height="300" alt="clippy the assistant">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -85,8 +85,9 @@ Read the contribution guidelines [here](https://docx.js.org/#/contribution-guide
|
|
|
85
85
|
[<img src="https://i.imgur.com/QEZXU5b.png" alt="drawing" height="50"/>](https://www.beekast.com/)
|
|
86
86
|
[<img src="https://i.imgur.com/XVU6aoi.png" alt="drawing" height="50"/>](https://herraizsoto.com/)
|
|
87
87
|
[<img src="https://i.imgur.com/fn1xccG.png" alt="drawing" height="50"/>](http://www.ativer.com.br/)
|
|
88
|
-
[<img src="https://i.imgur.com/cmykN7c.png" alt="drawing"
|
|
88
|
+
[<img src="https://i.imgur.com/cmykN7c.png" alt="drawing"/>](https://www.arity.co/)
|
|
89
89
|
[<img src="https://i.imgur.com/PXo25um.png" alt="drawing" height="50"/>](https://www.circadianrisk.com/)
|
|
90
|
+
[<img src="https://i.imgur.com/AKGhtlh.png" alt="drawing"/>](https://lexense.com/)
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
...and many more!
|
|
@@ -13,7 +13,7 @@ export interface IPropertiesOptions {
|
|
|
13
13
|
readonly keywords?: string;
|
|
14
14
|
readonly description?: string;
|
|
15
15
|
readonly lastModifiedBy?: string;
|
|
16
|
-
readonly revision?:
|
|
16
|
+
readonly revision?: number;
|
|
17
17
|
readonly externalStyles?: string;
|
|
18
18
|
readonly styles?: IStylesOptions;
|
|
19
19
|
readonly numbering?: INumberingOptions;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { XmlAttributeComponent, XmlComponent } from "../../../../../file/xml-components";
|
|
2
|
+
export declare enum DocumentGridType {
|
|
3
|
+
DEFAULT = "default",
|
|
4
|
+
LINES = "lines",
|
|
5
|
+
LINES_AND_CHARS = "linesAndChars",
|
|
6
|
+
SNAP_TO_CHARS = "snapToChars"
|
|
7
|
+
}
|
|
2
8
|
export interface IDocGridAttributesProperties {
|
|
9
|
+
readonly type?: DocumentGridType;
|
|
3
10
|
readonly linePitch?: number;
|
|
11
|
+
readonly charSpace?: number;
|
|
4
12
|
}
|
|
5
13
|
export declare class DocGridAttributes extends XmlAttributeComponent<IDocGridAttributesProperties> {
|
|
6
14
|
protected readonly xmlKeys: {
|
|
15
|
+
type: string;
|
|
7
16
|
linePitch: string;
|
|
17
|
+
charSpace: string;
|
|
8
18
|
};
|
|
9
19
|
}
|
|
10
20
|
export declare class DocumentGrid extends XmlComponent {
|
|
11
|
-
constructor(linePitch: number);
|
|
21
|
+
constructor(linePitch: number, charSpace?: number, type?: DocumentGridType);
|
|
12
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,6 +6,7 @@ export * from "./page-number";
|
|
|
6
6
|
export * from "./page-borders";
|
|
7
7
|
export * from "./page-margin";
|
|
8
8
|
export * from "./page-borders";
|
|
9
|
+
export * from "./page-text-direction";
|
|
9
10
|
export * from "./line-number";
|
|
10
11
|
export * from "./section-type";
|
|
11
12
|
export * from "./header-footer-reference";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XmlComponent } from "../../../../../file/xml-components";
|
|
2
|
+
export declare enum PageTextDirectionType {
|
|
3
|
+
LEFT_TO_RIGHT_TOP_TO_BOTTOM = "lrTb",
|
|
4
|
+
TOP_TO_BOTTOM_RIGHT_TO_LEFT = "tbRl"
|
|
5
|
+
}
|
|
6
|
+
export declare class PageTextDirection extends XmlComponent {
|
|
7
|
+
constructor(value: PageTextDirectionType);
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,7 @@ import { IPageBordersOptions } from "./properties/page-borders";
|
|
|
9
9
|
import { IPageMarginAttributes } from "./properties/page-margin";
|
|
10
10
|
import { IPageNumberTypeAttributes } from "./properties/page-number";
|
|
11
11
|
import { IPageSizeAttributes, PageOrientation } from "./properties/page-size";
|
|
12
|
+
import { PageTextDirectionType } from "./properties/page-text-direction";
|
|
12
13
|
import { SectionType } from "./properties/section-type";
|
|
13
14
|
export interface IHeaderFooterGroup<T> {
|
|
14
15
|
readonly default?: T;
|
|
@@ -21,6 +22,7 @@ export interface ISectionPropertiesOptions {
|
|
|
21
22
|
readonly margin?: IPageMarginAttributes;
|
|
22
23
|
readonly pageNumbers?: IPageNumberTypeAttributes;
|
|
23
24
|
readonly borders?: IPageBordersOptions;
|
|
25
|
+
readonly textDirection?: PageTextDirectionType;
|
|
24
26
|
};
|
|
25
27
|
readonly grid?: IDocGridAttributesProperties;
|
|
26
28
|
readonly headerWrapperGroup?: IHeaderFooterGroup<HeaderWrapper>;
|
|
@@ -46,6 +48,6 @@ export declare const sectionPageSizeDefaults: {
|
|
|
46
48
|
ORIENTATION: PageOrientation;
|
|
47
49
|
};
|
|
48
50
|
export declare class SectionProperties extends XmlComponent {
|
|
49
|
-
constructor({ page: { size: { width, height, orientation, }, margin: { top, right, bottom, left, header, footer, gutter, }, pageNumbers, borders, }, grid: { linePitch }, headerWrapperGroup, footerWrapperGroup, lineNumbers, titlePage, verticalAlign, column, type, }?: ISectionPropertiesOptions);
|
|
51
|
+
constructor({ page: { size: { width, height, orientation, }, margin: { top, right, bottom, left, header, footer, gutter, }, pageNumbers, borders, textDirection, }, grid: { linePitch, charSpace, type: gridType }, headerWrapperGroup, footerWrapperGroup, lineNumbers, titlePage, verticalAlign, column, type, }?: ISectionPropertiesOptions);
|
|
50
52
|
private addHeaderFooterGroup;
|
|
51
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XmlAttributeComponent, XmlComponent } from "../../../file/xml-components";
|
|
2
2
|
export declare class DocumentBackgroundAttributes extends XmlAttributeComponent<{
|
|
3
|
-
readonly color
|
|
3
|
+
readonly color?: string;
|
|
4
4
|
readonly themeColor?: string;
|
|
5
5
|
readonly themeShade?: string;
|
|
6
6
|
readonly themeTint?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XmlAttributeComponent } from "../../../file/xml-components";
|
|
2
2
|
export declare class BookmarkStartAttributes extends XmlAttributeComponent<{
|
|
3
|
-
readonly id:
|
|
3
|
+
readonly id: number;
|
|
4
4
|
readonly name: string;
|
|
5
5
|
}> {
|
|
6
6
|
protected readonly xmlKeys: {
|
|
@@ -9,7 +9,7 @@ export declare class BookmarkStartAttributes extends XmlAttributeComponent<{
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export declare class BookmarkEndAttributes extends XmlAttributeComponent<{
|
|
12
|
-
readonly id:
|
|
12
|
+
readonly id: number;
|
|
13
13
|
}> {
|
|
14
14
|
protected readonly xmlKeys: {
|
|
15
15
|
id: string;
|
|
@@ -10,8 +10,8 @@ export declare class Bookmark {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
export declare class BookmarkStart extends XmlComponent {
|
|
13
|
-
constructor(id: string, linkId:
|
|
13
|
+
constructor(id: string, linkId: number);
|
|
14
14
|
}
|
|
15
15
|
export declare class BookmarkEnd extends XmlComponent {
|
|
16
|
-
constructor(linkId:
|
|
16
|
+
constructor(linkId: number);
|
|
17
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IChangedAttributesProperties } from "../../track-revision/track-revision";
|
|
1
2
|
import { IShadingAttributesProperties } from "../../../file/shading";
|
|
2
3
|
import { IgnoreIfEmptyXmlComponent, XmlComponent } from "../../../file/xml-components";
|
|
3
4
|
import { EmphasisMarkType } from "./emphasis-mark";
|
|
@@ -36,12 +37,18 @@ export interface IRunStylePropertiesOptions {
|
|
|
36
37
|
readonly shading?: IShadingAttributesProperties;
|
|
37
38
|
readonly emboss?: boolean;
|
|
38
39
|
readonly imprint?: boolean;
|
|
40
|
+
readonly revision?: IRunPropertiesChangeOptions;
|
|
39
41
|
}
|
|
40
42
|
export interface IRunPropertiesOptions extends IRunStylePropertiesOptions {
|
|
41
43
|
readonly style?: string;
|
|
42
44
|
}
|
|
45
|
+
export interface IRunPropertiesChangeOptions extends IRunPropertiesOptions, IChangedAttributesProperties {
|
|
46
|
+
}
|
|
43
47
|
export declare class RunProperties extends IgnoreIfEmptyXmlComponent {
|
|
44
48
|
constructor(options?: IRunPropertiesOptions);
|
|
45
49
|
push(item: XmlComponent): void;
|
|
46
50
|
}
|
|
51
|
+
export declare class RunPropertiesChange extends XmlComponent {
|
|
52
|
+
constructor(options: IRunPropertiesChangeOptions);
|
|
53
|
+
}
|
|
47
54
|
export {};
|