From 0ab5869343539d70348a7d921027527dd89c71a6 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Mon, 7 Nov 2022 10:53:11 +0900 Subject: [PATCH] fix: alignemnt type (#567) * fix: alignemnt type * fix --- docx-core/src/types/alignment_type.rs | 3 +++ docx-wasm/js/json/paragraph.ts | 32 +++++++++++++++++---------- docx-wasm/package.json | 2 +- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/docx-core/src/types/alignment_type.rs b/docx-core/src/types/alignment_type.rs index 3330a41..f5e5835 100644 --- a/docx-core/src/types/alignment_type.rs +++ b/docx-core/src/types/alignment_type.rs @@ -10,6 +10,7 @@ pub enum AlignmentType { Both, Center, Distribute, + Start, End, Left, Right, @@ -24,6 +25,7 @@ impl fmt::Display for AlignmentType { AlignmentType::Left => write!(f, "left"), AlignmentType::Distribute => write!(f, "distribute"), AlignmentType::Right => write!(f, "right"), + AlignmentType::Start => write!(f, "start"), AlignmentType::End => write!(f, "end"), AlignmentType::Both => write!(f, "both"), AlignmentType::Justified => write!(f, "justified"), @@ -41,6 +43,7 @@ impl FromStr for AlignmentType { "distribute" => Ok(AlignmentType::Distribute), "center" => Ok(AlignmentType::Center), "both" => Ok(AlignmentType::Both), + "start" => Ok(AlignmentType::Start), "end" => Ok(AlignmentType::End), "justified" => Ok(AlignmentType::Justified), _ => Ok(AlignmentType::Unsupported), diff --git a/docx-wasm/js/json/paragraph.ts b/docx-wasm/js/json/paragraph.ts index 096ca07..c3bd0a7 100644 --- a/docx-wasm/js/json/paragraph.ts +++ b/docx-wasm/js/json/paragraph.ts @@ -35,7 +35,15 @@ export type ParagraphPropertyJSON = { runProperty: RunPropertyJSON; style?: string | null; numberingProperty?: NumberingPropertyJSON | null; - alignment?: "left" | "center" | "right" | "justified" | "both"; + alignment?: + | "left" + | "center" + | "right" + | "justified" + | "both" + | "start" + | "end" + | "unsupported"; indent?: IndentJSON | null; lineSpacing?: LineSpacingJSON | null; divId?: string | null; @@ -91,17 +99,17 @@ export type DeleteJSON = { export type HyperlinkJSON = { type: "hyperlink"; data: - | { - type: "external"; - rid: string; - children: HyperlinkChildJSON[]; - history: number | null; - } - | { - type: "anchor"; - anchor: string; - children: HyperlinkChildJSON[]; - }; + | { + type: "external"; + rid: string; + children: HyperlinkChildJSON[]; + history: number | null; + } + | { + type: "anchor"; + anchor: string; + children: HyperlinkChildJSON[]; + }; }; export type DeleteChildJSON = diff --git a/docx-wasm/package.json b/docx-wasm/package.json index 4f2abed..348a9fd 100644 --- a/docx-wasm/package.json +++ b/docx-wasm/package.json @@ -1,6 +1,6 @@ { "name": "docx-wasm", - "version": "0.0.276-rc34", + "version": "0.0.276-rc35", "main": "dist/node/index.js", "browser": "dist/web/index.js", "author": "bokuweb ",