2022-06-26 23:26:42 +01:00
|
|
|
import { IRunStylePropertiesOptions, RunProperties } from "@file/paragraph/run/properties";
|
2019-10-04 01:20:41 +01:00
|
|
|
|
2021-05-25 04:27:10 +03:00
|
|
|
import { IStyleOptions, Style } from "./style";
|
2018-11-13 11:04:03 -02:00
|
|
|
|
2021-05-25 04:27:10 +03:00
|
|
|
export interface IBaseCharacterStyleOptions extends IStyleOptions {
|
2020-07-11 17:01:32 +08:00
|
|
|
readonly run?: IRunStylePropertiesOptions;
|
2019-10-04 01:20:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ICharacterStyleOptions extends IBaseCharacterStyleOptions {
|
|
|
|
readonly id: string;
|
|
|
|
}
|
|
|
|
|
2020-11-06 00:27:57 +00:00
|
|
|
export class StyleForCharacter extends Style {
|
2018-11-13 11:04:03 -02:00
|
|
|
private readonly runProperties: RunProperties;
|
|
|
|
|
2022-08-31 07:52:27 +01:00
|
|
|
public constructor(options: ICharacterStyleOptions) {
|
2021-05-25 04:27:10 +03:00
|
|
|
super(
|
|
|
|
{ type: "character", styleId: options.id },
|
|
|
|
{
|
|
|
|
uiPriority: 99,
|
|
|
|
unhideWhenUsed: true,
|
|
|
|
...options,
|
|
|
|
},
|
|
|
|
);
|
2020-07-11 17:01:32 +08:00
|
|
|
|
|
|
|
this.runProperties = new RunProperties(options.run);
|
2018-11-13 11:04:03 -02:00
|
|
|
this.root.push(this.runProperties);
|
2019-08-05 13:42:45 +03:00
|
|
|
}
|
2018-11-13 11:04:03 -02:00
|
|
|
}
|