Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docx

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docx - npm Package Compare versions

Comparing version 5.4.0 to 5.4.1

build/file/paragraph/math/math-component.d.ts

2

build/file/styles/style/character-style.d.ts

@@ -13,5 +13,5 @@ import { IRunStylePropertiesOptions } from "../../../file/paragraph/run/properties";

}
export declare class CharacterStyle extends Style {
export declare class StyleForCharacter extends Style {
private readonly runProperties;
constructor(options: ICharacterStyleOptions);
}

@@ -1,4 +0,4 @@

import { CharacterStyle, IBaseCharacterStyleOptions } from "./character-style";
import { IBaseParagraphStyleOptions, IParagraphStyleOptions, ParagraphStyle } from "./paragraph-style";
export declare class HeadingStyle extends ParagraphStyle {
import { IBaseCharacterStyleOptions, StyleForCharacter } from "./character-style";
import { IBaseParagraphStyleOptions, IParagraphStyleOptions, StyleForParagraph } from "./paragraph-style";
export declare class HeadingStyle extends StyleForParagraph {
constructor(options: IParagraphStyleOptions);

@@ -27,16 +27,16 @@ }

}
export declare class ListParagraph extends ParagraphStyle {
export declare class ListParagraph extends StyleForParagraph {
constructor(options: IBaseParagraphStyleOptions);
}
export declare class FootnoteText extends ParagraphStyle {
export declare class FootnoteText extends StyleForParagraph {
constructor(options: IBaseParagraphStyleOptions);
}
export declare class FootnoteReferenceStyle extends CharacterStyle {
export declare class FootnoteReferenceStyle extends StyleForCharacter {
constructor(options: IBaseCharacterStyleOptions);
}
export declare class FootnoteTextChar extends CharacterStyle {
export declare class FootnoteTextChar extends StyleForCharacter {
constructor(options: IBaseCharacterStyleOptions);
}
export declare class HyperlinkStyle extends CharacterStyle {
export declare class HyperlinkStyle extends StyleForCharacter {
constructor(options: IBaseCharacterStyleOptions);
}

@@ -18,3 +18,3 @@ import { IParagraphStylePropertiesOptions, IRunStylePropertiesOptions } from "../../../file/paragraph";

}
export declare class ParagraphStyle extends Style {
export declare class StyleForParagraph extends Style {
private readonly paragraphProperties;

@@ -21,0 +21,0 @@ private readonly runProperties;

import { BaseXmlComponent, ImportedXmlComponent, XmlComponent } from "../../file/xml-components";
import { CharacterStyle, ParagraphStyle } from "./style";
import { StyleForCharacter, StyleForParagraph } from "./style";
import { ICharacterStyleOptions } from "./style/character-style";

@@ -10,3 +10,3 @@ import { IParagraphStyleOptions } from "./style/paragraph-style";

readonly characterStyles?: ICharacterStyleOptions[];
readonly importedStyles?: (XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent)[];
readonly importedStyles?: (XmlComponent | StyleForParagraph | StyleForCharacter | ImportedXmlComponent)[];
}

@@ -13,0 +13,0 @@ export declare class Styles extends XmlComponent {

{
"name": "docx",
"version": "5.4.0",
"version": "5.4.1",
"description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -14,2 +14,3 @@ <p align="center">

[![Build Status][travis-image]][travis-url]
[![GitHub Action Workflow Status][github-actions-workflow-image]][github-actions-workflow-url]
[![Dependency Status][daviddm-image]][daviddm-url]

@@ -89,2 +90,3 @@ [![Known Vulnerabilities][snky-image]][snky-url]

[<img src="https://i.imgur.com/fn1xccG.png" alt="drawing" height="50"/>](http://www.ativer.com.br/)
[<img src="https://i.imgur.com/cmykN7c.png" alt="drawing"/>](https://www.arity.co/)

@@ -107,2 +109,4 @@

[travis-url]: https://travis-ci.org/dolanmiu/docx
[github-actions-workflow-image]: https://github.com/dolanmiu/docx/workflows/Default/badge.svg
[github-actions-workflow-url]: https://github.com/dolanmiu/docx/actions
[daviddm-image]: https://david-dm.org/dolanmiu/docx.svg?theme=shields.io

@@ -109,0 +113,0 @@ [daviddm-url]: https://david-dm.org/dolanmiu/docx

@@ -22,1 +22,7 @@ import { MathAngledBrackets, MathCurlyBrackets, MathRoundBrackets, MathSquareBrackets } from "./brackets";

| MathSquareBrackets;
// Needed because of: https://github.com/s-panferov/awesome-typescript-loader/issues/432
/**
* @ignore
*/
export const WORKAROUND4 = "";

@@ -9,3 +9,3 @@ import { expect } from "chai";

import { CharacterStyle } from "./character-style";
import { StyleForCharacter } from "./character-style";

@@ -15,3 +15,3 @@ describe("CharacterStyle", () => {

it("should set the style type to character and use the given style id", () => {
const style = new CharacterStyle({ id: "myStyleId" });
const style = new StyleForCharacter({ id: "myStyleId" });
const tree = new Formatter().format(style);

@@ -36,3 +36,3 @@ expect(tree).to.deep.equal({

it("should set the name of the style, if given", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -61,3 +61,3 @@ name: "Style Name",

it("should add smallCaps", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -90,3 +90,3 @@ run: {

it("should add allCaps", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -119,3 +119,3 @@ run: {

it("should add strike", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -148,3 +148,3 @@ run: {

it("should add double strike", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -177,3 +177,3 @@ run: {

it("should add sub script", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -214,3 +214,3 @@ run: {

it("should add font by name", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -254,3 +254,3 @@ run: {

it("should add font for ascii and eastAsia", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -295,3 +295,3 @@ run: {

it("should add character spacing", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -326,3 +326,3 @@ run: {

it("#basedOn", () => {
const style = new CharacterStyle({ id: "myStyleId", basedOn: "otherId" });
const style = new StyleForCharacter({ id: "myStyleId", basedOn: "otherId" });
const tree = new Formatter().format(style);

@@ -372,3 +372,3 @@ expect(tree).to.deep.equal({

it(`#size ${size} cs ${sizeComplexScript}`, () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -401,3 +401,3 @@ run: { size, sizeComplexScript },

it("should set underline to 'single' if no arguments are given", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -430,3 +430,3 @@ run: {

it("should set the style if given", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -461,3 +461,3 @@ run: {

it("should set the style and color if given", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -495,3 +495,3 @@ run: {

it("should set emphasisMark to 'dot' if no arguments are given", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -524,3 +524,3 @@ run: {

it("should set the style if given", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -556,3 +556,3 @@ run: {

it("#superScript", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -593,3 +593,3 @@ run: {

it("#color", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -639,3 +639,3 @@ run: {

it(`#bold ${bold} cs ${boldComplexScript}`, () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -684,3 +684,3 @@ run: { bold, boldComplexScript },

it(`#italics ${italics} cs ${italicsComplexScript}`, () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -712,3 +712,3 @@ run: { italics, italicsComplexScript },

it("#link", () => {
const style = new CharacterStyle({ id: "myStyleId", link: "MyLink" });
const style = new StyleForCharacter({ id: "myStyleId", link: "MyLink" });
const tree = new Formatter().format(style);

@@ -734,3 +734,3 @@ expect(tree).to.deep.equal({

it("#semiHidden", () => {
const style = new CharacterStyle({ id: "myStyleId", semiHidden: true });
const style = new StyleForCharacter({ id: "myStyleId", semiHidden: true });
const tree = new Formatter().format(style);

@@ -776,3 +776,3 @@ expect(tree).to.deep.equal({

it(`#highlight ${highlight} cs ${highlightComplexScript}`, () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -866,3 +866,3 @@ run: { highlight, highlightComplexScript },

it("#shadow correctly", () => {
const style = new CharacterStyle({
const style = new StyleForCharacter({
id: "myStyleId",

@@ -869,0 +869,0 @@ run: { shadow, shading, shadingComplexScript },

@@ -18,3 +18,3 @@ import { IRunStylePropertiesOptions, RunProperties } from "file/paragraph/run/properties";

export class CharacterStyle extends Style {
export class StyleForCharacter extends Style {
private readonly runProperties: RunProperties;

@@ -21,0 +21,0 @@

import { UnderlineType } from "file/paragraph/run/underline";
import { CharacterStyle, IBaseCharacterStyleOptions } from "./character-style";
import { IBaseParagraphStyleOptions, IParagraphStyleOptions, ParagraphStyle } from "./paragraph-style";
import { IBaseCharacterStyleOptions, StyleForCharacter } from "./character-style";
import { IBaseParagraphStyleOptions, IParagraphStyleOptions, StyleForParagraph } from "./paragraph-style";
export class HeadingStyle extends ParagraphStyle {
export class HeadingStyle extends StyleForParagraph {
constructor(options: IParagraphStyleOptions) {

@@ -87,3 +87,3 @@ super({

export class ListParagraph extends ParagraphStyle {
export class ListParagraph extends StyleForParagraph {
constructor(options: IBaseParagraphStyleOptions) {

@@ -100,3 +100,3 @@ super({

export class FootnoteText extends ParagraphStyle {
export class FootnoteText extends StyleForParagraph {
constructor(options: IBaseParagraphStyleOptions) {

@@ -126,3 +126,3 @@ super({

export class FootnoteReferenceStyle extends CharacterStyle {
export class FootnoteReferenceStyle extends StyleForCharacter {
constructor(options: IBaseCharacterStyleOptions) {

@@ -142,3 +142,3 @@ super({

export class FootnoteTextChar extends CharacterStyle {
export class FootnoteTextChar extends StyleForCharacter {
constructor(options: IBaseCharacterStyleOptions) {

@@ -159,3 +159,3 @@ super({

export class HyperlinkStyle extends CharacterStyle {
export class HyperlinkStyle extends StyleForCharacter {
constructor(options: IBaseCharacterStyleOptions) {

@@ -162,0 +162,0 @@ super({

@@ -9,3 +9,3 @@ import { expect } from "chai";

import { ParagraphStyle } from "./paragraph-style";
import { StyleForParagraph } from "./paragraph-style";

@@ -15,3 +15,3 @@ describe("ParagraphStyle", () => {

it("should set the style type to paragraph and use the given style id", () => {
const style = new ParagraphStyle({ id: "myStyleId" });
const style = new StyleForParagraph({ id: "myStyleId" });
const tree = new Formatter().format(style);

@@ -24,3 +24,3 @@ expect(tree).to.deep.equal({

it("should set the name of the style, if given", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -41,3 +41,3 @@ name: "Style Name",

it("#basedOn", () => {
const style = new ParagraphStyle({ id: "myStyleId", basedOn: "otherId" });
const style = new StyleForParagraph({ id: "myStyleId", basedOn: "otherId" });
const tree = new Formatter().format(style);

@@ -53,3 +53,3 @@ expect(tree).to.deep.equal({

it("#quickFormat", () => {
const style = new ParagraphStyle({ id: "myStyleId", quickFormat: true });
const style = new StyleForParagraph({ id: "myStyleId", quickFormat: true });
const tree = new Formatter().format(style);

@@ -70,3 +70,3 @@ expect(tree).to.deep.equal({

it("#next", () => {
const style = new ParagraphStyle({ id: "myStyleId", next: "otherId" });
const style = new StyleForParagraph({ id: "myStyleId", next: "otherId" });
const tree = new Formatter().format(style);

@@ -84,3 +84,3 @@ expect(tree).to.deep.equal({

it("#indent", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -103,3 +103,3 @@ paragraph: {

it("#spacing", () => {
const style = new ParagraphStyle({ id: "myStyleId", paragraph: { spacing: { before: 50, after: 150 } } });
const style = new StyleForParagraph({ id: "myStyleId", paragraph: { spacing: { before: 50, after: 150 } } });
const tree = new Formatter().format(style);

@@ -117,3 +117,3 @@ expect(tree).to.deep.equal({

it("#center", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -136,3 +136,3 @@ paragraph: {

it("#character spacing", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -155,3 +155,3 @@ run: {

it("#left", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -174,3 +174,3 @@ paragraph: {

it("#right", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -193,3 +193,3 @@ paragraph: {

it("#justified", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -212,3 +212,3 @@ paragraph: {

it("#thematicBreak", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -246,3 +246,3 @@ paragraph: {

it("#contextualSpacing", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -273,3 +273,3 @@ paragraph: {

it("#leftTabStop", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -296,3 +296,3 @@ paragraph: {

it("#maxRightTabStop", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -319,3 +319,3 @@ paragraph: {

it("#keepLines", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -341,3 +341,3 @@ paragraph: {

it("#keepNext", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -363,3 +363,3 @@ paragraph: {

it("#outlineLevel", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -404,3 +404,3 @@ paragraph: {

it(`#size ${size} cs ${sizeComplexScript}`, () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -417,3 +417,3 @@ run: { size, sizeComplexScript },

it("#smallCaps", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -436,3 +436,3 @@ run: {

it("#allCaps", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -455,3 +455,3 @@ run: {

it("#strike", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -474,3 +474,3 @@ run: {

it("#doubleStrike", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -493,3 +493,3 @@ run: {

it("#subScript", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -512,3 +512,3 @@ run: {

it("#superScript", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -531,3 +531,3 @@ run: {

it("#font by name", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -561,3 +561,3 @@ run: {

it("#font for ascii and eastAsia", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -609,3 +609,3 @@ run: {

it(`#bold ${bold} cs ${boldComplexScript}`, () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -639,3 +639,3 @@ run: { bold, boldComplexScript },

it(`#italics ${italics} cs ${italicsComplexScript}`, () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -674,3 +674,3 @@ run: { italics, italicsComplexScript },

it(`#highlight ${highlight} cs ${highlightComplexScript}`, () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -749,3 +749,3 @@ run: { highlight, highlightComplexScript },

it("#shadow correctly", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -763,3 +763,3 @@ run: { shadow, shading, shadingComplexScript },

it("should set underline to 'single' if no arguments are given", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -782,3 +782,3 @@ run: {

it("should set the style if given", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -803,3 +803,3 @@ run: {

it("should set the style and color if given", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -827,3 +827,3 @@ run: {

it("should set emphasisMark to 'dot' if no arguments are given", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -846,3 +846,3 @@ run: {

it("should set the style if given", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -868,3 +868,3 @@ run: {

it("#color", () => {
const style = new ParagraphStyle({
const style = new StyleForParagraph({
id: "myStyleId",

@@ -887,3 +887,3 @@ run: {

it("#link", () => {
const style = new ParagraphStyle({ id: "myStyleId", link: "MyLink" });
const style = new StyleForParagraph({ id: "myStyleId", link: "MyLink" });
const tree = new Formatter().format(style);

@@ -904,3 +904,3 @@ expect(tree).to.deep.equal({

it("#semiHidden", () => {
const style = new ParagraphStyle({ id: "myStyleId", semiHidden: true });
const style = new StyleForParagraph({ id: "myStyleId", semiHidden: true });
const tree = new Formatter().format(style);

@@ -921,3 +921,3 @@ expect(tree).to.deep.equal({

it("#uiPriority", () => {
const style = new ParagraphStyle({ id: "myStyleId", uiPriority: 99 });
const style = new StyleForParagraph({ id: "myStyleId", uiPriority: 99 });
const tree = new Formatter().format(style);

@@ -939,3 +939,3 @@ expect(tree).to.deep.equal({

it("#unhideWhenUsed", () => {
const style = new ParagraphStyle({ id: "myStyleId", unhideWhenUsed: true });
const style = new StyleForParagraph({ id: "myStyleId", unhideWhenUsed: true });
const tree = new Formatter().format(style);

@@ -942,0 +942,0 @@ expect(tree).to.deep.equal({

@@ -24,3 +24,3 @@ import { IParagraphStylePropertiesOptions, IRunStylePropertiesOptions, ParagraphProperties } from "file/paragraph";

export class ParagraphStyle extends Style {
export class StyleForParagraph extends Style {
private readonly paragraphProperties: ParagraphProperties;

@@ -27,0 +27,0 @@ private readonly runProperties: RunProperties;

import { BaseXmlComponent, ImportedXmlComponent, XmlComponent } from "file/xml-components";
import { CharacterStyle, ParagraphStyle } from "./style";
import { StyleForCharacter, StyleForParagraph } from "./style";
import { ICharacterStyleOptions } from "./style/character-style";

@@ -12,3 +12,3 @@ import { IParagraphStyleOptions } from "./style/paragraph-style";

readonly characterStyles?: ICharacterStyleOptions[];
readonly importedStyles?: (XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent)[];
readonly importedStyles?: (XmlComponent | StyleForParagraph | StyleForCharacter | ImportedXmlComponent)[];
}

@@ -32,3 +32,3 @@

for (const style of options.paragraphStyles) {
this.root.push(new ParagraphStyle(style));
this.root.push(new StyleForParagraph(style));
}

@@ -39,3 +39,3 @@ }

for (const style of options.characterStyles) {
this.root.push(new CharacterStyle(style));
this.root.push(new StyleForCharacter(style));
}

@@ -42,0 +42,0 @@ }

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc