unify Shading; breaking change: Paragraph/Run shading option key type changed to val, and shadow alias removed

This commit is contained in:
Tom Hunkapiller
2021-05-23 04:25:07 +03:00
parent fcc393aca2
commit 496fcb55fa
22 changed files with 70 additions and 162 deletions

View File

@ -1,4 +1,4 @@
import { ShadingType } from "file/table";
import { IShadingAttributesProperties, Shading } from "file/shading";
import { IgnoreIfEmptyXmlComponent, XmlComponent } from "file/xml-components";
import { EmphasisMark, EmphasisMarkType } from "./emphasis-mark";
import {
@ -15,7 +15,6 @@ import {
Italics,
ItalicsComplexScript,
RightToLeft,
Shading,
Size,
SizeComplexScript,
SmallCaps,
@ -57,12 +56,7 @@ export interface IRunStylePropertiesOptions {
readonly highlight?: string;
readonly highlightComplexScript?: boolean | string;
readonly characterSpacing?: number;
readonly shading?: {
readonly type: ShadingType;
readonly fill: string;
readonly color: string;
};
readonly shadow?: IRunStylePropertiesOptions["shading"];
readonly shading?: IShadingAttributesProperties;
readonly emboss?: boolean;
readonly imprint?: boolean;
}
@ -179,9 +173,8 @@ export class RunProperties extends IgnoreIfEmptyXmlComponent {
this.push(new Imprint());
}
const shading = options.shading || options.shadow;
if (shading) {
this.push(new Shading(shading.type, shading.fill, shading.color));
if (options.shading) {
this.push(new Shading(options.shading));
}
}