Skip to content

Commit 0ab5869

Browse files
authored
fix: alignemnt type (#567)
* fix: alignemnt type * fix
1 parent f8928f0 commit 0ab5869

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

docx-core/src/types/alignment_type.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub enum AlignmentType {
1010
Both,
1111
Center,
1212
Distribute,
13+
Start,
1314
End,
1415
Left,
1516
Right,
@@ -24,6 +25,7 @@ impl fmt::Display for AlignmentType {
2425
AlignmentType::Left => write!(f, "left"),
2526
AlignmentType::Distribute => write!(f, "distribute"),
2627
AlignmentType::Right => write!(f, "right"),
28+
AlignmentType::Start => write!(f, "start"),
2729
AlignmentType::End => write!(f, "end"),
2830
AlignmentType::Both => write!(f, "both"),
2931
AlignmentType::Justified => write!(f, "justified"),
@@ -41,6 +43,7 @@ impl FromStr for AlignmentType {
4143
"distribute" => Ok(AlignmentType::Distribute),
4244
"center" => Ok(AlignmentType::Center),
4345
"both" => Ok(AlignmentType::Both),
46+
"start" => Ok(AlignmentType::Start),
4447
"end" => Ok(AlignmentType::End),
4548
"justified" => Ok(AlignmentType::Justified),
4649
_ => Ok(AlignmentType::Unsupported),

docx-wasm/js/json/paragraph.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ export type ParagraphPropertyJSON = {
3535
runProperty: RunPropertyJSON;
3636
style?: string | null;
3737
numberingProperty?: NumberingPropertyJSON | null;
38-
alignment?: "left" | "center" | "right" | "justified" | "both";
38+
alignment?:
39+
| "left"
40+
| "center"
41+
| "right"
42+
| "justified"
43+
| "both"
44+
| "start"
45+
| "end"
46+
| "unsupported";
3947
indent?: IndentJSON | null;
4048
lineSpacing?: LineSpacingJSON | null;
4149
divId?: string | null;
@@ -91,17 +99,17 @@ export type DeleteJSON = {
9199
export type HyperlinkJSON = {
92100
type: "hyperlink";
93101
data:
94-
| {
95-
type: "external";
96-
rid: string;
97-
children: HyperlinkChildJSON[];
98-
history: number | null;
99-
}
100-
| {
101-
type: "anchor";
102-
anchor: string;
103-
children: HyperlinkChildJSON[];
104-
};
102+
| {
103+
type: "external";
104+
rid: string;
105+
children: HyperlinkChildJSON[];
106+
history: number | null;
107+
}
108+
| {
109+
type: "anchor";
110+
anchor: string;
111+
children: HyperlinkChildJSON[];
112+
};
105113
};
106114

107115
export type DeleteChildJSON =

docx-wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docx-wasm",
3-
"version": "0.0.276-rc34",
3+
"version": "0.0.276-rc35",
44
"main": "dist/node/index.js",
55
"browser": "dist/web/index.js",
66
"author": "bokuweb <bokuweb12@gmail.com>",

0 commit comments

Comments
 (0)