feat: transfer comments property to File CoreProperties like numbering.
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { Comments } from './../paragraph/run/comment-run';
|
||||
import { StringContainer, XmlComponent } from "file/xml-components";
|
||||
import { ICustomPropertyOptions } from "../custom-properties";
|
||||
import { IDocumentBackgroundOptions } from "../document";
|
||||
@ -21,6 +22,7 @@ export interface IPropertiesOptions {
|
||||
readonly externalStyles?: string;
|
||||
readonly styles?: IStylesOptions;
|
||||
readonly numbering?: INumberingOptions;
|
||||
readonly comments?: Comments;
|
||||
readonly footnotes?: {
|
||||
readonly [key: string]: {
|
||||
readonly children: Paragraph[];
|
||||
|
@ -71,6 +71,10 @@ export class File {
|
||||
},
|
||||
);
|
||||
|
||||
if (options.comments) {
|
||||
this.comments = options.comments;
|
||||
}
|
||||
|
||||
this.fileRelationships = new Relationships();
|
||||
this.customProperties = new CustomProperties(options.customProperties ?? []);
|
||||
this.appProperties = new AppProperties();
|
||||
@ -136,9 +140,6 @@ export class File {
|
||||
this.footnotesWrapper.View.createFootNote(parseFloat(key), options.footnotes[key].children);
|
||||
}
|
||||
}
|
||||
if (fileProperties.template && fileProperties.template.comments) {
|
||||
this.comments = fileProperties.template.comments;
|
||||
}
|
||||
}
|
||||
|
||||
private addSection({ headers = {}, footers = {}, children, properties }: ISectionOptions): void {
|
||||
|
@ -10,7 +10,7 @@ interface ICommentOptions {
|
||||
}
|
||||
|
||||
class CommentAttributes extends XmlAttributeComponent<ICommentOptions> {
|
||||
protected readonly xmlKeys = { id: "w:id", initias: "w:initials", author: "w:author", date: "w:date" };
|
||||
protected readonly xmlKeys = { id: "w:id", initials: "w:initials", author: "w:author", date: "w:date" };
|
||||
}
|
||||
|
||||
const COMMENT_ATTRIBUTES_MAP = {
|
||||
|
Reference in New Issue
Block a user