parent
e243b5ce90
commit
8bc4e522aa
|
@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## docx-wasm@0.0.24y (16. March, 2022)
|
||||||
|
|
||||||
|
- Add js interface for `rStyle`.
|
||||||
|
|
||||||
## docx-wasm@0.0.246, docx-rs@0.3.4 (16. March, 2022)
|
## docx-wasm@0.0.246, docx-rs@0.3.4 (16. March, 2022)
|
||||||
|
|
||||||
- Support `rStyle`.
|
- Support `rStyle`.
|
||||||
|
|
|
@ -289,6 +289,10 @@ export class Docx {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (r.property.style) {
|
||||||
|
run = run.style(r.property.style);
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof r.property.size !== "undefined") {
|
if (typeof r.property.size !== "undefined") {
|
||||||
run = run.size(r.property.size);
|
run = run.size(r.property.size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ export type RunFontsJSON = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RunPropertyJSON = {
|
export type RunPropertyJSON = {
|
||||||
|
style?: string | null;
|
||||||
sz?: number | null;
|
sz?: number | null;
|
||||||
szCs?: number | null;
|
szCs?: number | null;
|
||||||
fonts?: RunFontsJSON | null;
|
fonts?: RunFontsJSON | null;
|
||||||
|
|
|
@ -28,6 +28,7 @@ export type RunPropertyIns = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RunProperty = {
|
export type RunProperty = {
|
||||||
|
style?: string;
|
||||||
size?: number;
|
size?: number;
|
||||||
color?: string;
|
color?: string;
|
||||||
highlight?: string;
|
highlight?: string;
|
||||||
|
@ -164,6 +165,11 @@ export class Run {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
style(style: string) {
|
||||||
|
this.property = { ...this.property, style };
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
size(size: number) {
|
size(size: number) {
|
||||||
this.property = { ...this.property, size };
|
this.property = { ...this.property, size };
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docx-wasm",
|
"name": "docx-wasm",
|
||||||
"version": "0.0.246",
|
"version": "0.0.247",
|
||||||
"main": "dist/node/index.js",
|
"main": "dist/node/index.js",
|
||||||
"browser": "dist/web/index.js",
|
"browser": "dist/web/index.js",
|
||||||
"author": "bokuweb <bokuweb12@gmail.com>",
|
"author": "bokuweb <bokuweb12@gmail.com>",
|
||||||
|
|
|
@ -41,6 +41,11 @@ impl Run {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn style(mut self, style: &str) -> Run {
|
||||||
|
self.0.run_property = self.0.run_property.style(style);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn size(mut self, size: usize) -> Run {
|
pub fn size(mut self, size: usize) -> Run {
|
||||||
self.0.run_property = self.0.run_property.size(size);
|
self.0.run_property = self.0.run_property.size(size);
|
||||||
self
|
self
|
||||||
|
|
Loading…
Reference in New Issue