From a9fc40dad41293ebb1c7a691ffdeb61d1c09d0b6 Mon Sep 17 00:00:00 2001 From: Forman Date: Fri, 9 Aug 2019 11:56:22 +0300 Subject: [PATCH 01/57] Add total number of pages in a section --- demo/demo45.ts | 49 ++++++++++++++++++++++ src/file/paragraph/run/page-number.spec.ts | 11 ++++- src/file/paragraph/run/page-number.ts | 8 ++++ src/file/paragraph/run/run.spec.ts | 15 +++++++ src/file/paragraph/run/run.ts | 10 ++++- 5 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 demo/demo45.ts diff --git a/demo/demo45.ts b/demo/demo45.ts new file mode 100644 index 0000000000..7ccc44e22a --- /dev/null +++ b/demo/demo45.ts @@ -0,0 +1,49 @@ +// Multiple sections with total number of pages in each section +// Import from 'docx' rather than '../build' if you install from npm +import * as fs from "fs"; +import { Document, Packer, PageNumberFormat, TextRun } from "../build"; + +const doc = new Document(); + + +const header = doc.createHeader(); +header.createParagraph("Header on another page"); +const footer = doc.createFooter(); +footer.createParagraph("Foo Bar corp. ") + .center() + .addRun(new TextRun("Page Number: ").pageNumber()) + .addRun(new TextRun(" to ").numberOfTotalPagesSection()); + +doc.addSection({ + headers: { + default: header, + }, + footers: { + default: footer, + }, + pageNumberStart: 1, + pageNumberFormatType: PageNumberFormat.DECIMAL, +}); + +doc.createParagraph("Section 1").pageBreak(); +doc.createParagraph("Section 1").pageBreak(); + +doc.addSection({ + headers: { + default: header, + }, + footers: { + default: footer, + }, + pageNumberStart: 1, + pageNumberFormatType: PageNumberFormat.DECIMAL, +}); + +doc.createParagraph("Section 2").pageBreak(); +doc.createParagraph("Section 2").pageBreak(); + +const packer = new Packer(); + +packer.toBuffer(doc).then((buffer) => { + fs.writeFileSync("My Document.docx", buffer); +}); diff --git a/src/file/paragraph/run/page-number.spec.ts b/src/file/paragraph/run/page-number.spec.ts index 4a9bc39a3e..aa01aa8d71 100644 --- a/src/file/paragraph/run/page-number.spec.ts +++ b/src/file/paragraph/run/page-number.spec.ts @@ -2,7 +2,7 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; -import { NumberOfPages, Page } from "./page-number"; +import { NumberOfPages, NumberOfPagesSection, Page } from "./page-number"; describe("Page", () => { describe("#constructor()", () => { @@ -21,3 +21,12 @@ describe("NumberOfPages", () => { }); }); }); + +describe("NumberOfPagesSection", () => { + describe("#constructor()", () => { + it("uses the font name for both ascii and hAnsi", () => { + const tree = new Formatter().format(new NumberOfPagesSection()); + expect(tree).to.deep.equal({ "w:instrText": [{ _attr: { "xml:space": "preserve" } }, "SECTIONPAGES"] }); + }); + }); +}); diff --git a/src/file/paragraph/run/page-number.ts b/src/file/paragraph/run/page-number.ts index 2fdc44e32b..ab5284f3c9 100644 --- a/src/file/paragraph/run/page-number.ts +++ b/src/file/paragraph/run/page-number.ts @@ -20,3 +20,11 @@ export class NumberOfPages extends XmlComponent { this.root.push("NUMPAGES"); } } + +export class NumberOfPagesSection extends XmlComponent { + constructor() { + super("w:instrText"); + this.root.push(new TextAttributes({ space: SpaceType.PRESERVE })); + this.root.push("SECTIONPAGES"); + } +} diff --git a/src/file/paragraph/run/run.spec.ts b/src/file/paragraph/run/run.spec.ts index ae6526a229..174ef86da0 100644 --- a/src/file/paragraph/run/run.spec.ts +++ b/src/file/paragraph/run/run.spec.ts @@ -204,6 +204,21 @@ describe("Run", () => { }); }); + describe("#numberOfTotalPagesSection", () => { + it("should set the run to the RTL mode", () => { + run.numberOfTotalPagesSection(); + const tree = new Formatter().format(run); + expect(tree).to.deep.equal({ + "w:r": [ + { "w:fldChar": { _attr: { "w:fldCharType": "begin" } } }, + { "w:instrText": [{ _attr: { "xml:space": "preserve" } }, "SECTIONPAGES"] }, + { "w:fldChar": { _attr: { "w:fldCharType": "separate" } } }, + { "w:fldChar": { _attr: { "w:fldCharType": "end" } } }, + ], + }); + }); + }); + describe("#pageNumber", () => { it("should set the run to the RTL mode", () => { run.pageNumber(); diff --git a/src/file/paragraph/run/run.ts b/src/file/paragraph/run/run.ts index 32777cd31d..432a6c79e0 100644 --- a/src/file/paragraph/run/run.ts +++ b/src/file/paragraph/run/run.ts @@ -14,7 +14,7 @@ import { SizeComplexScript, Strike, } from "./formatting"; -import { NumberOfPages, Page } from "./page-number"; +import { NumberOfPages, NumberOfPagesSection, Page } from "./page-number"; import { RunProperties } from "./properties"; import { RunFonts } from "./run-fonts"; import { SubScript, SuperScript } from "./script"; @@ -92,6 +92,14 @@ export class Run extends XmlComponent { return this; } + public numberOfTotalPagesSection(): Run { + this.root.push(new Begin()); + this.root.push(new NumberOfPagesSection()); + this.root.push(new Separate()); + this.root.push(new End()); + return this; + } + public smallCaps(): Run { this.properties.push(new SmallCaps()); return this; From 49e85275c3f2a8f453c3173fd95ae7fac8749bc8 Mon Sep 17 00:00:00 2001 From: Forman Date: Tue, 13 Aug 2019 10:53:29 +0300 Subject: [PATCH 02/57] Fix tests --- src/file/paragraph/run/run.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/file/paragraph/run/run.spec.ts b/src/file/paragraph/run/run.spec.ts index 87a947932a..c16eb82b03 100644 --- a/src/file/paragraph/run/run.spec.ts +++ b/src/file/paragraph/run/run.spec.ts @@ -286,6 +286,7 @@ describe("Run", () => { describe("#numberOfTotalPagesSection", () => { it("should set the run to the RTL mode", () => { + const run = new Run({}); run.numberOfTotalPagesSection(); const tree = new Formatter().format(run); expect(tree).to.deep.equal({ From 2abff6991ff758dbc350f3cb5fc526bcaad1874f Mon Sep 17 00:00:00 2001 From: Forman Date: Wed, 14 Aug 2019 14:13:28 +0300 Subject: [PATCH 03/57] Rename demo --- demo/{demo45.ts => 47-number-of-total-pages-section.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename demo/{demo45.ts => 47-number-of-total-pages-section.ts} (100%) diff --git a/demo/demo45.ts b/demo/47-number-of-total-pages-section.ts similarity index 100% rename from demo/demo45.ts rename to demo/47-number-of-total-pages-section.ts From 2502fe7f39462261dc80a5292820052e28bd70aa Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 14 Aug 2019 15:50:12 +0100 Subject: [PATCH 04/57] Increase thresholds --- .nycrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.nycrc b/.nycrc index e02a0d16f8..d5f12ccbc3 100644 --- a/.nycrc +++ b/.nycrc @@ -1,9 +1,9 @@ { "check-coverage": true, - "lines": 87.54, - "functions": 83.61, - "branches": 72.57, - "statements": 87.32, + "lines": 92.35, + "functions": 88.28, + "branches": 84.64, + "statements": 92.16, "include": [ "src/**/*.ts" ], From 5ecdb48d43124b45dc6bbb79e68df701d060fc5a Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 15 Aug 2019 00:48:36 +0100 Subject: [PATCH 05/57] Stop unnecessary casting --- src/export/packer/packer.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/export/packer/packer.ts b/src/export/packer/packer.ts index 24c29491ce..1b5a219190 100644 --- a/src/export/packer/packer.ts +++ b/src/export/packer/packer.ts @@ -4,33 +4,33 @@ import { Compiler } from "./next-compiler"; export class Packer { public static async toBuffer(file: File, prettify?: boolean): Promise { const zip = this.compiler.compile(file, prettify); - const zipData = (await zip.generateAsync({ + const zipData = await zip.generateAsync({ type: "nodebuffer", mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", compression: "DEFLATE", - })) as Buffer; + }); return zipData; } public static async toBase64String(file: File, prettify?: boolean): Promise { const zip = this.compiler.compile(file, prettify); - const zipData = (await zip.generateAsync({ + const zipData = await zip.generateAsync({ type: "base64", mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", compression: "DEFLATE", - })) as string; + }); return zipData; } public static async toBlob(file: File, prettify?: boolean): Promise { const zip = this.compiler.compile(file, prettify); - const zipData = (await zip.generateAsync({ + const zipData = await zip.generateAsync({ type: "blob", mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", compression: "DEFLATE", - })) as Blob; + }); return zipData; } From 535f2d75b0bf04936b4f434013ebf7f76cb46a07 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 20 Aug 2019 22:23:14 +0100 Subject: [PATCH 06/57] Fix embed links in documentation --- docs/usage/headers-and-footers.md | 2 +- docs/usage/images.md | 12 +++++------ docs/usage/page-numbers.md | 4 ++-- docs/usage/paragraph.md | 2 +- docs/usage/styling-with-xml.md | 2 +- docs/usage/table-of-contents.md | 4 ++-- docs/usage/tables.md | 36 +++++++++++++++---------------- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/usage/headers-and-footers.md b/docs/usage/headers-and-footers.md index f93cae332c..bdde55613b 100644 --- a/docs/usage/headers-and-footers.md +++ b/docs/usage/headers-and-footers.md @@ -25,7 +25,7 @@ doc.Header.createImage([BUFFER_OF_YOUR_IMAGE]); doc.Footer.createImage([BUFFER_OF_YOUR_IMAGE]); ``` -Refer to [`demo8.ts`](https://github.com/dolanmiu/docx/blob/master/demo/demo8.ts) for more information. +Refer to [`8-header-footer`](https://github.com/dolanmiu/docx/blob/master/demo/8-header-footer.ts) for more information. ## Multiple Headers and Footers diff --git a/docs/usage/images.md b/docs/usage/images.md index 693b2d4781..851c476e60 100644 --- a/docs/usage/images.md +++ b/docs/usage/images.md @@ -227,22 +227,22 @@ Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 200, 200, { Importing Images from file system path -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo5.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/5-images.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo5.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/5-images.ts_ ### Add images to header and footer Example showing how to add image to headers and footers -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo9.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/9-images-in-header-and-footer.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo9.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/9-images-in-header-and-footer.ts_ ### Floating images Example showing how to float images on top of text and optimally give a `margin` -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo38.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/38-text-wrapping.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo38.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/38-text-wrapping.ts_ diff --git a/docs/usage/page-numbers.md b/docs/usage/page-numbers.md index 5ff66ae50c..45348385bb 100644 --- a/docs/usage/page-numbers.md +++ b/docs/usage/page-numbers.md @@ -61,6 +61,6 @@ doc.Header.createParagraph().addRun(new TextRun("Page ").pageNumber()).addRun(ne Adding page numbers to Header and Footer -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo39.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/39-page-numbers.ts ':include') -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo39.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/39-page-numbers.ts_ diff --git a/docs/usage/paragraph.md b/docs/usage/paragraph.md index a398c82e40..c770e8c00f 100644 --- a/docs/usage/paragraph.md +++ b/docs/usage/paragraph.md @@ -265,7 +265,7 @@ const paragraph = new Paragraph({ ![Page Break Before in Word](https://user-images.githubusercontent.com/34742290/40176503-df3a8398-59db-11e8-8b9c-d719f13aa8b4.png) -Example: https://github.com/dolanmiu/docx/blob/master/demo/demo15.ts +Example: https://github.com/dolanmiu/docx/blob/master/demo/15-page-break-before.ts ## Page break control diff --git a/docs/usage/styling-with-xml.md b/docs/usage/styling-with-xml.md index ee5a2b1db4..463599e4e4 100644 --- a/docs/usage/styling-with-xml.md +++ b/docs/usage/styling-with-xml.md @@ -44,4 +44,4 @@ doc.add(paragraph); doc.createParagraph("Some normal text"); ``` -Example: https://github.com/dolanmiu/docx/blob/master/demo/demo13.ts +Example: https://github.com/dolanmiu/docx/blob/master/demo/13-xml-styles.ts diff --git a/docs/usage/table-of-contents.md b/docs/usage/table-of-contents.md index 53e8e7df57..538249bbf9 100644 --- a/docs/usage/table-of-contents.md +++ b/docs/usage/table-of-contents.md @@ -71,6 +71,6 @@ doc.add(new Paragraph("My Spectacular Style #1").style("MySpectacularStyle").pag ### Complete example -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo28.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/28-table-of-contents.ts ':include') -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo28.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/28-table-of-contents.ts_ diff --git a/docs/usage/tables.md b/docs/usage/tables.md index 70556ae028..580ea95de3 100644 --- a/docs/usage/tables.md +++ b/docs/usage/tables.md @@ -247,60 +247,60 @@ table.getRow(0).setTableHeader(); ## Examples -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo4.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/4-basic-table.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo4.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/4-basic-table.ts_ ### Custom borders Example showing how to add colourful borders to tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo20.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/20-table-cell-borders.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo20.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/20-table-cell-borders.ts_ ### Adding images Example showing how to add images to tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo24.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/24-images-to-table-cell.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo24.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/24-images-to-table-cell.ts_ -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo36.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/36-image-to-table-cell.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo36.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/36-image-to-table-cell.ts_ ### Alignment of text in a cell Example showing how align text in a table cell -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo31.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/31-tables.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo31.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts_ ### Merging rows Example showing merging of `rows` -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo32.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/32-merge-table-cells.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo32.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/32-merge-table-cells.ts_ -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo41.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/41-merge-table-cells-2.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo41.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/41-merge-table-cells-2.ts_ ### Merging columns Example showing merging of `columns` -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo43.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/43-images-to-table-cell-2.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo43.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/43-images-to-table-cell-2.ts_ ### Floating tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/demo34.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/34-floating-tables.ts ":include") -_Source: https://github.com/dolanmiu/docx/blob/master/demo/demo34.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/34-floating-tables.ts_ From 7827d158d7526a35ee95939d16f94ba2364e0603 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 21 Aug 2019 00:05:46 +0100 Subject: [PATCH 07/57] Updated documentation --- docs/usage/headers-and-footers.md | 78 ++++++++++++++----------------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/docs/usage/headers-and-footers.md b/docs/usage/headers-and-footers.md index bdde55613b..59ada77511 100644 --- a/docs/usage/headers-and-footers.md +++ b/docs/usage/headers-and-footers.md @@ -2,52 +2,46 @@ !> Headers and Footers requires an understanding of [Sections](usage/sections.md). +Every Section has a sections which you can define its Headers and Footers: + +```ts +doc.addSection({ + headers: { + default: new Header({ // The standard default header + children: [], + }), + first: new Header({ // The first header + children: [], + }), + even: new Header({ // The header on every other page + children: [], + }), + }, + footers: { + default: new Footer({ // The standard default footer + children: [], + }), + first: new Footer({ // The first footer + children: [], + }), + even: new Footer({ // The footer on every other page + children: [], + }), + }, + children: [], +}); +``` + +If you want more head + ## Example -Creating Headers and footers is simple. Access the `Header` and `Footer` by doing so like this: +Example showing basic header and footer -```ts -doc.Header; -doc.Footer; -``` +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/8-header-footer.ts ":include") -You can call the same methods as you would with a `File`: - -```ts -doc.Header.createParagraph("Header text"); -doc.Footer.createParagraph("Footer text"); -``` - -Even add images: - -```ts -doc.Header.createImage([BUFFER_OF_YOUR_IMAGE]); -doc.Footer.createImage([BUFFER_OF_YOUR_IMAGE]); -``` - -Refer to [`8-header-footer`](https://github.com/dolanmiu/docx/blob/master/demo/8-header-footer.ts) for more information. +_Source: https://github.com/dolanmiu/docx/blob/master/demo/8-header-footer.ts_ ## Multiple Headers and Footers -Also all the supported section properties are implemented according to: http://officeopenxml.com/WPsection.php - -### Example - -```ts - const header = this.document.createHeader(); - const footer = this.document.createFooter(); - - // Add new section with another header and footer - doc.addSection({ - headers: { - default: header - }, - footers: { - default: footer - }, - pageNumberStart: 1, - pageNumberFormatType: docx.PageNumberFormat.DECIMAL, - }); -``` - - +More headers and footers can be accomplished by creating more `Section`. New headers and footers can be set per `Section` From cb52a1ef42003d3c8857d2ebf756afa8536ea825 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 21 Aug 2019 00:51:26 +0100 Subject: [PATCH 08/57] Formatting --- docs/usage/headers-and-footers.md | 2 +- docs/usage/table-of-contents.md | 46 +++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/usage/headers-and-footers.md b/docs/usage/headers-and-footers.md index 59ada77511..8d71e51c68 100644 --- a/docs/usage/headers-and-footers.md +++ b/docs/usage/headers-and-footers.md @@ -38,7 +38,7 @@ If you want more head Example showing basic header and footer -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/8-header-footer.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/8-header-footer.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/8-header-footer.ts_ diff --git a/docs/usage/table-of-contents.md b/docs/usage/table-of-contents.md index 538249bbf9..00dc329ad9 100644 --- a/docs/usage/table-of-contents.md +++ b/docs/usage/table-of-contents.md @@ -2,9 +2,9 @@ You can generate table of contents with `docx`. More information can be found [here](http://officeopenxml.com/WPtableOfContents.php). ->Tables of Contents are fields and, by design, it's content is only generated or updated by Word. We can't do it programatically. ->This is why, when you open a the file, Word you will prompt the message "This document contains fields that may refer to other files. Do you want to update the fields in this document?". ->You have say yes to Word generate the content of all table of contents. +> Tables of Contents are fields and, by design, it's content is only generated or updated by Word. We can't do it programatically. +> This is why, when you open a the file, Word you will prompt the message "This document contains fields that may refer to other files. Do you want to update the fields in this document?". +> You have say yes to Word generate the content of all table of contents. The complete documentation can be found [here](https://www.ecma-international.org/publications/standards/Ecma-376.htm) (at Part 1, Page 1251). @@ -16,7 +16,7 @@ All you need to do is create a `TableOfContents` object and assign it to the doc const toc = new TableOfContents("Summary", { hyperlink: true, headingStyleRange: "1-5", - stylesWithLevels: [new StyleLevel("MySpectacularStyle", 1)] + stylesWithLevels: [new StyleLevel("MySpectacularStyle", 1)], }); doc.addTableOfContents(toc); @@ -26,24 +26,24 @@ doc.addTableOfContents(toc); Here is the list of all options that you can use to generate your tables of contents: -| Option | Type | TOC Field Switch | Description | -| --- | --- | --- | --- | -|captionLabel|string|`\a`|Includes captioned items, but omits caption labels and numbers. The identifier designated by `text` in this switch's field-argument corresponds to the caption label. Use ``\c`` to build a table of captions with labels and numbers.| -|entriesFromBookmark|string|`\b`|Includes entries only from the portion of the document marked by the bookmark named by `text` in this switch's field-argument.| -|captionLabelIncludingNumbers|string|`\c`|Includes figures, tables, charts, and other items that are numbered by a SEQ field (§17.16.5.56). The sequence identifier designated by `text` in this switch's field-argument, which corresponds to the caption label, shall match the identifier in the corresponding SEQ field.| -|sequenceAndPageNumbersSeparator|string|`\d`|When used with `\s`, the `text` in this switch's field-argument defines the separator between sequence and page numbers. The default separator is a hyphen (-).| -|tcFieldIdentifier|string|`\f`|Includes only those TC fields whose identifier exactly matches the `text` in this switch's field-argument (which is typically a letter).| -|hyperlink|boolean|`\h`|Makes the table of contents entries hyperlinks.| -|tcFieldLevelRange|string|`\l`|Includes TC fields that assign entries to one of the levels specified by `text` in this switch's field-argument as a range having the form startLevel-endLevel, where startLevel and endLevel are integers, and startLevel has a value equal-to or less-than endLevel. TC fields that assign entries to lower levels are skipped.| -|pageNumbersEntryLevelsRange|string|`\n`|Without field-argument, omits page numbers from the table of contents. Page numbers are omitted from all levels unless a range of entry levels is specified by `text` in this switch's field-argument. A range is specified as for `\l`.| -|headingStyleRange|string|`\o`|Uses paragraphs formatted with all or the specified range of builtin heading styles. Headings in a style range are specified by `text` in this switch's field-argument using the notation specified as for `\l`, where each integer corresponds to the style with a style ID of HeadingX (e.g. 1 corresponds to Heading1). If no heading range is specified, all heading levels used in the document are listed.| -|entryAndPageNumberSeparator|string|`\p`|`text` in this switch's field-argument specifies a sequence of characters that separate an entry and its page number. The default is a tab with leader dots.| -|seqFieldIdentifierForPrefix|string|`\s`|For entries numbered with a SEQ field (§17.16.5.56), adds a prefix to the page number. The prefix depends on the type of entry. `text` in this switch's field-argument shall match the identifier in the SEQ field.| -|stylesWithLevels|StyleLevel[]|`\t`| Uses paragraphs formatted with styles other than the built-in heading styles. `text` in this switch's field-argument specifies those styles as a set of comma-separated doublets, with each doublet being a comma-separated set of style name and table of content level. `\t` can be combined with `\o`.| -|useAppliedParagraphOutlineLevel|boolean|`\u`|Uses the applied paragraph outline level.| -|preserveTabInEntries|boolean|`\w`|Preserves tab entries within table entries.| -|preserveNewLineInEntries|boolean|`\x`|Preserves newline characters within table entries.| -|hideTabAndPageNumbersInWebView|boolean|`\z`|Hides tab leader and page numbers in web page view (§17.18.102).| +| Option | Type | TOC Field Switch | Description | +| ------------------------------- | ------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| captionLabel | string | `\a` | Includes captioned items, but omits caption labels and numbers. The identifier designated by `text` in this switch's field-argument corresponds to the caption label. Use `\c` to build a table of captions with labels and numbers. | +| entriesFromBookmark | string | `\b` | Includes entries only from the portion of the document marked by the bookmark named by `text` in this switch's field-argument. | +| captionLabelIncludingNumbers | string | `\c` | Includes figures, tables, charts, and other items that are numbered by a SEQ field (§17.16.5.56). The sequence identifier designated by `text` in this switch's field-argument, which corresponds to the caption label, shall match the identifier in the corresponding SEQ field. | +| sequenceAndPageNumbersSeparator | string | `\d` | When used with `\s`, the `text` in this switch's field-argument defines the separator between sequence and page numbers. The default separator is a hyphen (-). | +| tcFieldIdentifier | string | `\f` | Includes only those TC fields whose identifier exactly matches the `text` in this switch's field-argument (which is typically a letter). | +| hyperlink | boolean | `\h` | Makes the table of contents entries hyperlinks. | +| tcFieldLevelRange | string | `\l` | Includes TC fields that assign entries to one of the levels specified by `text` in this switch's field-argument as a range having the form startLevel-endLevel, where startLevel and endLevel are integers, and startLevel has a value equal-to or less-than endLevel. TC fields that assign entries to lower levels are skipped. | +| pageNumbersEntryLevelsRange | string | `\n` | Without field-argument, omits page numbers from the table of contents. Page numbers are omitted from all levels unless a range of entry levels is specified by `text` in this switch's field-argument. A range is specified as for `\l`. | +| headingStyleRange | string | `\o` | Uses paragraphs formatted with all or the specified range of builtin heading styles. Headings in a style range are specified by `text` in this switch's field-argument using the notation specified as for `\l`, where each integer corresponds to the style with a style ID of HeadingX (e.g. 1 corresponds to Heading1). If no heading range is specified, all heading levels used in the document are listed. | +| entryAndPageNumberSeparator | string | `\p` | `text` in this switch's field-argument specifies a sequence of characters that separate an entry and its page number. The default is a tab with leader dots. | +| seqFieldIdentifierForPrefix | string | `\s` | For entries numbered with a SEQ field (§17.16.5.56), adds a prefix to the page number. The prefix depends on the type of entry. `text` in this switch's field-argument shall match the identifier in the SEQ field. | +| stylesWithLevels | StyleLevel[] | `\t` | Uses paragraphs formatted with styles other than the built-in heading styles. `text` in this switch's field-argument specifies those styles as a set of comma-separated doublets, with each doublet being a comma-separated set of style name and table of content level. `\t` can be combined with `\o`. | +| useAppliedParagraphOutlineLevel | boolean | `\u` | Uses the applied paragraph outline level. | +| preserveTabInEntries | boolean | `\w` | Preserves tab entries within table entries. | +| preserveNewLineInEntries | boolean | `\x` | Preserves newline characters within table entries. | +| hideTabAndPageNumbersInWebView | boolean | `\z` | Hides tab leader and page numbers in web page view (§17.18.102). | ## Examples @@ -53,7 +53,7 @@ Here is the list of all options that you can use to generate your tables of cont const toc = new TableOfContents("Summary", { hyperlink: true, headingStyleRange: "1-5", - stylesWithLevels: [new StyleLevel("MySpectacularStyle", 1)] + stylesWithLevels: [new StyleLevel("MySpectacularStyle", 1)], }); doc.addTableOfContents(toc); From 4ac55a787eac9b6a92d8ee7c5859032772c5ea20 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 21 Aug 2019 00:53:49 +0100 Subject: [PATCH 09/57] Fix includes --- docs/usage/images.md | 6 +++--- docs/usage/tables.md | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/usage/images.md b/docs/usage/images.md index 851c476e60..4893348cc0 100644 --- a/docs/usage/images.md +++ b/docs/usage/images.md @@ -227,7 +227,7 @@ Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 200, 200, { Importing Images from file system path -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/5-images.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/5-images.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/5-images.ts_ @@ -235,7 +235,7 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/5-images.ts_ Example showing how to add image to headers and footers -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/9-images-in-header-and-footer.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/9-images-in-header-and-footer.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/9-images-in-header-and-footer.ts_ @@ -243,6 +243,6 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/9-images-in-header-an Example showing how to float images on top of text and optimally give a `margin` -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/38-text-wrapping.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/38-text-wrapping.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/38-text-wrapping.ts_ diff --git a/docs/usage/tables.md b/docs/usage/tables.md index 580ea95de3..bf6c16d7ea 100644 --- a/docs/usage/tables.md +++ b/docs/usage/tables.md @@ -247,7 +247,7 @@ table.getRow(0).setTableHeader(); ## Examples -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/4-basic-table.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/4-basic-table.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/4-basic-table.ts_ @@ -255,7 +255,7 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/4-basic-table.ts_ Example showing how to add colourful borders to tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/20-table-cell-borders.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/20-table-cell-borders.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/20-table-cell-borders.ts_ @@ -263,11 +263,11 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/20-table-cell-borders Example showing how to add images to tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/24-images-to-table-cell.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/24-images-to-table-cell.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/24-images-to-table-cell.ts_ -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/36-image-to-table-cell.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/36-image-to-table-cell.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/36-image-to-table-cell.ts_ @@ -275,7 +275,7 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/36-image-to-table-cel Example showing how align text in a table cell -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/31-tables.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/31-tables.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts_ @@ -283,11 +283,11 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts_ Example showing merging of `rows` -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/32-merge-table-cells.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/32-merge-table-cells.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/32-merge-table-cells.ts_ -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/41-merge-table-cells-2.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/41-merge-table-cells-2.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/41-merge-table-cells-2.ts_ @@ -295,12 +295,12 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/41-merge-table-cells- Example showing merging of `columns` -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/43-images-to-table-cell-2.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/43-images-to-table-cell-2.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/43-images-to-table-cell-2.ts_ ### Floating tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/34-floating-tables.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/34-floating-tables.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/34-floating-tables.ts_ From 60a599a5507dd7892cf7c9310094c67a7f8b0cd8 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 22 Aug 2019 00:28:42 +0100 Subject: [PATCH 10/57] Improve bullet points documentation --- docs/usage/bullet-points.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/usage/bullet-points.md b/docs/usage/bullet-points.md index dde800ec4d..045ec61d1a 100644 --- a/docs/usage/bullet-points.md +++ b/docs/usage/bullet-points.md @@ -5,17 +5,16 @@ To make a bullet point, simply make a paragraph into a bullet point: ```ts -const text = new docx.TextRun("Bullet points"); -const paragraph = new docx.Paragraph(text).bullet(); - -const text2 = new docx.TextRun("Are awesome"); -const paragraph2 = new docx.Paragraph(text2).bullet(); - -doc.add(paragraph); -doc.add(paragraph2); +const text = new TextRun("Bullet points"); +const paragraph = new Paragraph({ + text: "Bullet points", + bullet: { + level: 0, // How deep you want the bullet to me + }, +}); ``` ### This will produce: -* Bullet points -* Are awesome +- Bullet points +- Are awesome From bd6ae2c0dcad44e26da32b7d141875c5e96f0a41 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 22 Aug 2019 22:49:57 +0100 Subject: [PATCH 11/57] Remove unnecessary documentation --- docs/usage/numbering.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/usage/numbering.md b/docs/usage/numbering.md index 1f61c53dca..6a8142003a 100644 --- a/docs/usage/numbering.md +++ b/docs/usage/numbering.md @@ -86,11 +86,3 @@ topLevelP.setNumbering(concrete, 0); subP.setNumbering(concrete, 1); subSubP.setNumbering(concrete, 2); ``` - -Finally, you need to let your exporter know about your numbering -styles when you're ready to render the document: - -```ts -const packer = new Packer(doc, undefined, undefined, numbering); -packer.pack(myOutput); -``` From cb7486824764ac25ae5617e1a7028dd957376f02 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Thu, 29 Aug 2019 20:10:53 +0900 Subject: [PATCH 12/57] fix: try to remove unnecessary paragraph --- .nycrc | 6 +++--- src/file/document/body/body.spec.ts | 3 --- src/file/document/body/body.ts | 13 +------------ src/file/file.spec.ts | 24 ++++++++++++------------ 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/.nycrc b/.nycrc index d5f12ccbc3..1e3c3b1e22 100644 --- a/.nycrc +++ b/.nycrc @@ -1,9 +1,9 @@ { "check-coverage": true, - "lines": 92.35, - "functions": 88.28, + "lines": 92.34, + "functions": 88.27, "branches": 84.64, - "statements": 92.16, + "statements": 92.15, "include": [ "src/**/*.ts" ], diff --git a/src/file/document/body/body.spec.ts b/src/file/document/body/body.spec.ts index a5bc222fb4..b63a95dcd1 100644 --- a/src/file/document/body/body.spec.ts +++ b/src/file/document/body/body.spec.ts @@ -22,9 +22,6 @@ describe("Body", () => { expect(tree).to.deep.equal({ "w:body": [ - { - "w:p": {}, - }, { "w:sectPr": [ { "w:pgSz": { _attr: { "w:w": 10000, "w:h": 10000, "w:orient": "portrait" } } }, diff --git a/src/file/document/body/body.ts b/src/file/document/body/body.ts index e91b72d59a..c79edfc132 100644 --- a/src/file/document/body/body.ts +++ b/src/file/document/body/body.ts @@ -1,5 +1,5 @@ import { IXmlableObject, XmlComponent } from "file/xml-components"; -import { Paragraph, ParagraphProperties, TableOfContents } from "../.."; +import { TableOfContents } from "../.."; import { SectionProperties, SectionPropertiesOptions } from "./section-properties/section-properties"; export class Body extends XmlComponent { @@ -18,9 +18,6 @@ export class Body extends XmlComponent { * @param options new section options */ public addSection(options: SectionPropertiesOptions): void { - const currentSection = this.sections.pop() as SectionProperties; - this.root.push(this.createSectionParagraph(currentSection)); - this.sections.push(new SectionProperties(options)); } @@ -39,12 +36,4 @@ export class Body extends XmlComponent { public getTablesOfContents(): TableOfContents[] { return this.root.filter((child) => child instanceof TableOfContents) as TableOfContents[]; } - - private createSectionParagraph(section: SectionProperties): Paragraph { - const paragraph = new Paragraph({}); - const properties = new ParagraphProperties({}); - properties.addChildElement(section); - paragraph.addChildElement(properties); - return paragraph; - } } diff --git a/src/file/file.spec.ts b/src/file/file.spec.ts index dae4af33fb..e8c081d1ec 100644 --- a/src/file/file.spec.ts +++ b/src/file/file.spec.ts @@ -20,8 +20,8 @@ describe("File", () => { const tree = new Formatter().format(doc.Document.Body); - expect(tree["w:body"][1]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); - expect(tree["w:body"][1]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][0]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][0]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("default"); }); it("should create with correct headers and footers", () => { @@ -39,8 +39,8 @@ describe("File", () => { const tree = new Formatter().format(doc.Document.Body); - expect(tree["w:body"][1]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); - expect(tree["w:body"][1]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][0]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][0]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("default"); }); it("should create with first headers and footers", () => { @@ -58,8 +58,8 @@ describe("File", () => { const tree = new Formatter().format(doc.Document.Body); - expect(tree["w:body"][1]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first"); - expect(tree["w:body"][1]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("first"); + expect(tree["w:body"][0]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first"); + expect(tree["w:body"][0]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("first"); }); it("should create with correct headers", () => { @@ -81,13 +81,13 @@ describe("File", () => { const tree = new Formatter().format(doc.Document.Body); - expect(tree["w:body"][1]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); - expect(tree["w:body"][1]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first"); - expect(tree["w:body"][1]["w:sectPr"][6]["w:headerReference"]._attr["w:type"]).to.equal("even"); + expect(tree["w:body"][0]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][0]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first"); + expect(tree["w:body"][0]["w:sectPr"][6]["w:headerReference"]._attr["w:type"]).to.equal("even"); - expect(tree["w:body"][1]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("default"); - expect(tree["w:body"][1]["w:sectPr"][8]["w:footerReference"]._attr["w:type"]).to.equal("first"); - expect(tree["w:body"][1]["w:sectPr"][9]["w:footerReference"]._attr["w:type"]).to.equal("even"); + expect(tree["w:body"][0]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][0]["w:sectPr"][8]["w:footerReference"]._attr["w:type"]).to.equal("first"); + expect(tree["w:body"][0]["w:sectPr"][9]["w:footerReference"]._attr["w:type"]).to.equal("even"); }); }); From 99718784f13ccb68a68227e40fda8c034072f17b Mon Sep 17 00:00:00 2001 From: Steve Wainstead Date: Fri, 30 Aug 2019 09:29:45 -0400 Subject: [PATCH 13/57] Fix: probable copy/paste error Fix the argument to "left:" which should likely be 2160 --- demo/3-numbering-and-bullet-points.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/3-numbering-and-bullet-points.ts b/demo/3-numbering-and-bullet-points.ts index 94d5665568..e87e6616d2 100644 --- a/demo/3-numbering-and-bullet-points.ts +++ b/demo/3-numbering-and-bullet-points.ts @@ -10,7 +10,7 @@ const numbering = new Numbering(); const abstractNum = numbering.createAbstractNumbering(); abstractNum.createLevel(0, "upperRoman", "%1", "start").indent({ left: 720, hanging: 260 }); abstractNum.createLevel(1, "decimal", "%2.", "start").indent({ left: 1440, hanging: 980 }); -abstractNum.createLevel(2, "lowerLetter", "%3)", "start").indent({ left: 14402160, hanging: 1700 }); +abstractNum.createLevel(2, "lowerLetter", "%3)", "start").indent({ left: 2160, hanging: 1700 }); const concrete = numbering.createConcreteNumbering(abstractNum); From 418adca9f376bb49e2824239cb70da1c669f4ca6 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 13 Sep 2019 00:51:20 +0100 Subject: [PATCH 14/57] Declarative tables --- demo/11-declaritive-styles-2.ts | 38 ++- demo/20-table-cell-borders.ts | 99 ++++++- demo/24-images-to-table-cell.ts | 77 +++++- demo/31-tables.ts | 52 ++-- demo/32-merge-table-cells.ts | 182 +++++++----- demo/34-floating-tables.ts | 27 +- demo/36-image-to-table-cell.ts | 55 +++- demo/4-basic-table.ts | 28 +- demo/41-merge-table-cells-2.ts | 148 +++++++--- demo/43-images-to-table-cell-2.ts | 71 ++++- src/file/file.spec.ts | 13 +- src/file/footer-wrapper.spec.ts | 13 +- src/file/header-wrapper.spec.ts | 13 +- src/file/table/grid.ts | 6 +- src/file/table/table-cell/table-cell.ts | 122 +++++---- src/file/table/table-column.spec.ts | 53 ++-- src/file/table/table-column.ts | 16 +- src/file/table/table-row/table-row.spec.ts | 75 +++-- src/file/table/table-row/table-row.ts | 73 ++--- src/file/table/table.spec.ts | 304 +++++++++------------ src/file/table/table.ts | 49 +--- 21 files changed, 978 insertions(+), 536 deletions(-) diff --git a/demo/11-declaritive-styles-2.ts b/demo/11-declaritive-styles-2.ts index bb6428d518..c6780c440f 100644 --- a/demo/11-declaritive-styles-2.ts +++ b/demo/11-declaritive-styles-2.ts @@ -1,7 +1,7 @@ // Setting styles with JavaScript configuration // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { AlignmentType, Document, Footer, HeadingLevel, Media, Packer, Paragraph, Table } from "../build"; +import { AlignmentType, Document, Footer, HeadingLevel, Media, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; const doc = new Document(); @@ -81,13 +81,37 @@ doc.Styles.createParagraphStyle("ListParagraph", "List Paragraph") const image = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); const table = new Table({ - rows: 4, - columns: 4, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Test cell 1.")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Test cell 2.")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Test cell 3.")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Test cell 4.")], + }), + ], + }), + ], }); -table - .getRow(0) - .getCell(0) - .add(new Paragraph("Pole No.")); const image1 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); const image2 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); diff --git a/demo/20-table-cell-borders.ts b/demo/20-table-cell-borders.ts index 13809a6164..028d9fdb04 100644 --- a/demo/20-table-cell-borders.ts +++ b/demo/20-table-cell-borders.ts @@ -1,23 +1,102 @@ // Add custom borders to table cell // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { BorderStyle, Document, Packer, Paragraph, Table } from "../build"; +import { BorderStyle, Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; const doc = new Document(); const table = new Table({ - rows: 4, - columns: 4, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [new Paragraph("Hello")], + borders: { + top: { + style: BorderStyle.DASH_DOT_STROKED, + size: 3, + color: "red", + }, + bottom: { + style: BorderStyle.DOUBLE, + size: 3, + color: "blue", + }, + left: { + style: BorderStyle.DASH_DOT_STROKED, + size: 3, + color: "green", + }, + right: { + style: BorderStyle.DASH_DOT_STROKED, + size: 3, + color: "#ff8000", + }, + }, + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], }); doc.addSection({ children: [table] }); -table - .getCell(2, 2) - .add(new Paragraph("Hello")) - .Borders.addTopBorder(BorderStyle.DASH_DOT_STROKED, 3, "red") - .addBottomBorder(BorderStyle.DOUBLE, 3, "blue") - .addStartBorder(BorderStyle.DOT_DOT_DASH, 3, "green") - .addEndBorder(BorderStyle.DOT_DOT_DASH, 3, "#ff8000"); Packer.toBuffer(doc).then((buffer) => { fs.writeFileSync("My Document.docx", buffer); diff --git a/demo/24-images-to-table-cell.ts b/demo/24-images-to-table-cell.ts index 114be5491e..e37d1aa812 100644 --- a/demo/24-images-to-table-cell.ts +++ b/demo/24-images-to-table-cell.ts @@ -1,24 +1,85 @@ // Add image to table cell // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Media, Packer, Paragraph, Table } from "../build"; +import { Document, Media, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; const doc = new Document(); +const image = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg")); + const table = new Table({ - rows: 4, - columns: 4, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [new Paragraph(image)], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [new Paragraph("Hello")], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], }); doc.addSection({ children: [table], }); -table.getCell(2, 2).add(new Paragraph("Hello")); - -const image = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg")); -table.getCell(1, 1).add(new Paragraph(image)); - Packer.toBuffer(doc).then((buffer) => { fs.writeFileSync("My Document.docx", buffer); }); diff --git a/demo/31-tables.ts b/demo/31-tables.ts index 050403bb99..7daec1506d 100644 --- a/demo/31-tables.ts +++ b/demo/31-tables.ts @@ -1,28 +1,48 @@ // Example of how you would create a table and add data to it // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph, Table, VerticalAlign } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign } from "../build"; const doc = new Document(); const table = new Table({ - rows: 2, - columns: 2, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph({}), new Paragraph({})], + verticalAlign: VerticalAlign.CENTER, + }), + new TableCell({ + children: [new Paragraph({}), new Paragraph({})], + verticalAlign: VerticalAlign.CENTER, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [ + new Paragraph({ + text: + "Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah", + heading: HeadingLevel.HEADING_1, + }), + ], + }), + new TableCell({ + children: [ + new Paragraph({ + text: "This text should be in the middle of the cell", + }), + ], + verticalAlign: VerticalAlign.CENTER, + }), + ], + }), + ], }); -table - .getCell(1, 1) - .add(new Paragraph("This text should be in the middle of the cell")) - .setVerticalAlign(VerticalAlign.CENTER); - -table.getCell(1, 0).add( - new Paragraph({ - text: - "Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah", - heading: HeadingLevel.HEADING_1, - }), -); - doc.addSection({ children: [table], }); diff --git a/demo/32-merge-table-cells.ts b/demo/32-merge-table-cells.ts index cd850067e5..55a9181281 100644 --- a/demo/32-merge-table-cells.ts +++ b/demo/32-merge-table-cells.ts @@ -1,40 +1,118 @@ // Example of how you would merge cells together // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph, ShadingType, Table, WidthType } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, ShadingType, Table, TableCell, TableRow, WidthType } from "../build"; const doc = new Document(); const table = new Table({ - rows: 2, - columns: 2, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Hello")], + columnSpan: 2, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], }); -table.getCell(0, 0).add(new Paragraph("Hello")); -table.getRow(0).mergeCells(0, 1); - const table2 = new Table({ - rows: 2, - columns: 3, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("World")], + margins: { + top: 1000, + bottom: 1000, + left: 1000, + right: 1000, + }, + columnSpan: 3, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], width: 100, widthUnitType: WidthType.AUTO, columnWidths: [1000, 1000, 1000], }); -table2 - .getCell(0, 0) - .add(new Paragraph("World")) - .setMargins({ - top: 1000, - bottom: 1000, - left: 1000, - right: 1000, - }); -table.getRow(0).mergeCells(0, 2); - const table3 = new Table({ - rows: 2, - columns: 4, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Foo")], + }), + new TableCell({ + children: [new Paragraph("v")], + columnSpan: 3, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Bar1")], + shading: { + fill: "b79c2f", + val: ShadingType.REVERSE_DIAGONAL_STRIPE, + color: "auto", + }, + }), + new TableCell({ + children: [new Paragraph("Bar2")], + shading: { + fill: "42c5f4", + val: ShadingType.PERCENT_95, + color: "auto", + }, + }), + new TableCell({ + children: [new Paragraph("Bar3")], + shading: { + fill: "880aa8", + val: ShadingType.PERCENT_10, + color: "e2df0b", + }, + }), + new TableCell({ + children: [new Paragraph("Bar4")], + shading: { + fill: "FF0000", + val: ShadingType.CLEAR, + color: "auto", + }, + }), + ], + }), + ], width: 7000, widthUnitType: WidthType.DXA, margins: { @@ -45,47 +123,29 @@ const table3 = new Table({ }, }); -table3.getCell(0, 0).add(new Paragraph("Foo")); -table3.getCell(0, 1).add(new Paragraph("v")); - -table3 - .getCell(1, 0) - .add(new Paragraph("Bar1")) - .setShading({ - fill: "b79c2f", - val: ShadingType.REVERSE_DIAGONAL_STRIPE, - color: "auto", - }); -table3 - .getCell(1, 1) - .add(new Paragraph("Bar2")) - .setShading({ - fill: "42c5f4", - val: ShadingType.PERCENT_95, - color: "auto", - }); -table3 - .getCell(1, 2) - .add(new Paragraph("Bar3")) - .setShading({ - fill: "880aa8", - val: ShadingType.PERCENT_10, - color: "e2df0b", - }); -table3 - .getCell(1, 3) - .add(new Paragraph("Bar4")) - .setShading({ - fill: "FF0000", - val: ShadingType.CLEAR, - color: "auto", - }); - -table3.getRow(0).mergeCells(0, 3); - const table4 = new Table({ - rows: 2, - columns: 2, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], width: 100, widthUnitType: WidthType.PERCENTAGE, }); diff --git a/demo/34-floating-tables.ts b/demo/34-floating-tables.ts index c5b8a18cf8..4a20ae2eee 100644 --- a/demo/34-floating-tables.ts +++ b/demo/34-floating-tables.ts @@ -9,15 +9,35 @@ import { RelativeVerticalPosition, Table, TableAnchorType, + TableCell, TableLayoutType, + TableRow, WidthType, } from "../build"; const doc = new Document(); const table = new Table({ - rows: 2, - columns: 2, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Hello")], + columnSpan: 2, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], float: { horizontalAnchor: TableAnchorType.MARGIN, verticalAnchor: TableAnchorType.MARGIN, @@ -29,9 +49,6 @@ const table = new Table({ layout: TableLayoutType.FIXED, }); -table.getCell(0, 0).add(new Paragraph("Hello")); -table.getRow(0).mergeCells(0, 1); - doc.addSection({ children: [table], }); diff --git a/demo/36-image-to-table-cell.ts b/demo/36-image-to-table-cell.ts index 1c7897c558..a0d87230a2 100644 --- a/demo/36-image-to-table-cell.ts +++ b/demo/36-image-to-table-cell.ts @@ -1,16 +1,61 @@ -// Add image to table cell +// Add image to table cell in a header and body // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Header, Media, Packer, Paragraph, Table } from "../build"; +import { Document, Header, Media, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; const doc = new Document(); const image = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg")); const table = new Table({ - rows: 2, - columns: 2, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [new Paragraph(image)], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], }); -table.getCell(1, 1).add(new Paragraph(image)); // Adding same table in the body and in the header doc.addSection({ diff --git a/demo/4-basic-table.ts b/demo/4-basic-table.ts index 78367caab9..593fe821a5 100644 --- a/demo/4-basic-table.ts +++ b/demo/4-basic-table.ts @@ -1,17 +1,35 @@ // Example of how you would create a table and add data to it // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, Paragraph, Table } from "../build"; +import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; const doc = new Document(); const table = new Table({ - rows: 4, - columns: 4, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("Hello")], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [new Paragraph("World")], + }), + ], + }), + ], }); -table.getCell(2, 2).add(new Paragraph("Hello")); - doc.addSection({ children: [table], }); diff --git a/demo/41-merge-table-cells-2.ts b/demo/41-merge-table-cells-2.ts index 1801eb4a6e..50141a1a7a 100644 --- a/demo/41-merge-table-cells-2.ts +++ b/demo/41-merge-table-cells-2.ts @@ -1,50 +1,122 @@ // Multiple cells merging in the same table // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, Paragraph, Table } from "../build"; +import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; const doc = new Document(); const table = new Table({ - rows: 13, - columns: 6, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("0,0")], + }), + new TableCell({ + children: [new Paragraph("0,1")], + columnSpan: 2, + }), + new TableCell({ + children: [new Paragraph("0,3")], + }), + new TableCell({ + children: [new Paragraph("0,4")], + columnSpan: 2, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("1,0")], + columnSpan: 2, + }), + new TableCell({ + children: [new Paragraph("1,2")], + columnSpan: 2, + }), + new TableCell({ + children: [new Paragraph("1,4")], + columnSpan: 2, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("2,0")], + }), + new TableCell({ + children: [new Paragraph("2,1")], + columnSpan: 2, + }), + new TableCell({ + children: [new Paragraph("2,3")], + }), + new TableCell({ + children: [new Paragraph("2,4")], + columnSpan: 2, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("3,0")], + }), + new TableCell({ + children: [new Paragraph("3,1")], + }), + new TableCell({ + children: [new Paragraph("3,2")], + }), + new TableCell({ + children: [new Paragraph("3,3")], + }), + new TableCell({ + children: [new Paragraph("3,4")], + }), + new TableCell({ + children: [new Paragraph("3,5")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("4,0")], + columnSpan: 5, + }), + new TableCell({ + children: [new Paragraph("4,5")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], }); -let row = 0; -table.getCell(row, 0).add(new Paragraph("0,0")); -table.getCell(row, 1).add(new Paragraph("0,1")); -table.getCell(row, 3).add(new Paragraph("0,3")); -table.getCell(row, 4).add(new Paragraph("0,4")); -table.getRow(row).mergeCells(4, 5); -table.getRow(row).mergeCells(1, 2); -row = 1; -table.getCell(row, 0).add(new Paragraph("1,0")); -table.getCell(row, 2).add(new Paragraph("1,2")); -table.getCell(row, 4).add(new Paragraph("1,4")); -table.getRow(row).mergeCells(4, 5); -table.getRow(row).mergeCells(2, 3); -table.getRow(row).mergeCells(0, 1); - -row = 2; -table.getCell(row, 0).add(new Paragraph("2,0")); -table.getCell(row, 1).add(new Paragraph("2,1")); -table.getCell(row, 2).add(new Paragraph("2,2")); -table.getCell(row, 3).add(new Paragraph("2,3")); -table.getCell(row, 4).add(new Paragraph("2,4")); -table.getRow(row).mergeCells(4, 5); -table.getRow(row).mergeCells(1, 2); -row = 3; -table.getCell(row, 0).add(new Paragraph("3,0")); -table.getCell(row, 1).add(new Paragraph("3,1")); -table.getCell(row, 2).add(new Paragraph("3,2")); -table.getCell(row, 3).add(new Paragraph("3,3")); -table.getCell(row, 4).add(new Paragraph("3,4")); -table.getCell(row, 5).add(new Paragraph("3,5")); -row = 4; -table.getCell(row, 0).add(new Paragraph("4,0")); -table.getCell(row, 5).add(new Paragraph("4,5")); -table.getRow(row).mergeCells(0, 4); - doc.addSection({ children: [table], }); diff --git a/demo/43-images-to-table-cell-2.ts b/demo/43-images-to-table-cell-2.ts index 90d6322bb7..1840c9382c 100644 --- a/demo/43-images-to-table-cell-2.ts +++ b/demo/43-images-to-table-cell-2.ts @@ -1,16 +1,79 @@ // Add image to table cell // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, Paragraph, Table } from "../build"; +import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; const doc = new Document(); const table = new Table({ - rows: 4, - columns: 4, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [new Paragraph("Hello")], + }), + new TableCell({ + children: [], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], }); -table.getCell(2, 2).add(new Paragraph("Hello")); table.getColumn(3).mergeCells(1, 2); doc.addSection({ diff --git a/src/file/file.spec.ts b/src/file/file.spec.ts index e8c081d1ec..59b42e009c 100644 --- a/src/file/file.spec.ts +++ b/src/file/file.spec.ts @@ -6,7 +6,7 @@ import { Formatter } from "export/formatter"; import { File } from "./file"; import { Footer, Header } from "./header"; import { Paragraph } from "./paragraph"; -import { Table } from "./table"; +import { Table, TableCell, TableRow } from "./table"; import { TableOfContents } from "./table-of-contents"; describe("File", () => { @@ -108,8 +108,15 @@ describe("File", () => { file.addSection({ children: [ new Table({ - rows: 1, - columns: 1, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], }), ], }); diff --git a/src/file/footer-wrapper.spec.ts b/src/file/footer-wrapper.spec.ts index 3f6fb01b82..899bd22e70 100644 --- a/src/file/footer-wrapper.spec.ts +++ b/src/file/footer-wrapper.spec.ts @@ -4,7 +4,7 @@ import * as sinon from "sinon"; import { FooterWrapper } from "./footer-wrapper"; import { Media } from "./media"; import { Paragraph } from "./paragraph"; -import { Table } from "./table"; +import { Table, TableCell, TableRow } from "./table"; describe("FooterWrapper", () => { describe("#add", () => { @@ -21,8 +21,15 @@ describe("FooterWrapper", () => { const spy = sinon.spy(file.Footer, "add"); file.add( new Table({ - rows: 1, - columns: 1, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], }), ); diff --git a/src/file/header-wrapper.spec.ts b/src/file/header-wrapper.spec.ts index d07473f03a..7c3073a094 100644 --- a/src/file/header-wrapper.spec.ts +++ b/src/file/header-wrapper.spec.ts @@ -4,7 +4,7 @@ import * as sinon from "sinon"; import { HeaderWrapper } from "./header-wrapper"; import { Media } from "./media"; import { Paragraph } from "./paragraph"; -import { Table } from "./table"; +import { Table, TableCell, TableRow } from "./table"; describe("HeaderWrapper", () => { describe("#add", () => { @@ -21,8 +21,15 @@ describe("HeaderWrapper", () => { const spy = sinon.spy(wrapper.Header, "add"); wrapper.add( new Table({ - rows: 1, - columns: 1, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], }), ); diff --git a/src/file/table/grid.ts b/src/file/table/grid.ts index b91f6ac9d4..5ce6486fcc 100644 --- a/src/file/table/grid.ts +++ b/src/file/table/grid.ts @@ -2,9 +2,11 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; export class TableGrid extends XmlComponent { - constructor(cols: number[]) { + constructor(widths: number[]) { super("w:tblGrid"); - cols.forEach((col) => this.root.push(new GridCol(col))); + for (const width of widths) { + this.root.push(new GridCol(width)); + } } } diff --git a/src/file/table/table-cell/table-cell.ts b/src/file/table/table-cell/table-cell.ts index 1c546ab934..05416b34d5 100644 --- a/src/file/table/table-cell/table-cell.ts +++ b/src/file/table/table-cell/table-cell.ts @@ -1,77 +1,107 @@ // http://officeopenxml.com/WPtableGrid.php import { Paragraph } from "file/paragraph"; +import { BorderStyle } from "file/styles"; import { IXmlableObject, XmlComponent } from "file/xml-components"; import { ITableShadingAttributesProperties } from "../shading"; import { Table } from "../table"; import { ITableCellMarginOptions } from "./cell-margin/table-cell-margins"; -import { TableCellBorders, VerticalAlign, VMergeType } from "./table-cell-components"; +import { VerticalAlign, VMergeType } from "./table-cell-components"; import { TableCellProperties } from "./table-cell-properties"; export interface ITableCellOptions { readonly shading?: ITableShadingAttributesProperties; + readonly margins?: ITableCellMarginOptions; + readonly verticalAlign?: VerticalAlign; + readonly verticalMerge?: VMergeType; + readonly columnSpan?: number; + readonly borders?: { + readonly top?: { + readonly style: BorderStyle; + readonly size: number; + readonly color: string; + }; + readonly bottom?: { + readonly style: BorderStyle; + readonly size: number; + readonly color: string; + }; + readonly left?: { + readonly style: BorderStyle; + readonly size: number; + readonly color: string; + }; + readonly right?: { + readonly style: BorderStyle; + readonly size: number; + readonly color: string; + }; + }; + readonly children: Array; } export class TableCell extends XmlComponent { private readonly properties: TableCellProperties; - constructor() { + constructor(readonly options: ITableCellOptions) { super("w:tc"); this.properties = new TableCellProperties(); this.root.push(this.properties); - } - public add(item: Paragraph | Table): TableCell { - this.root.push(item); + for (const child of options.children) { + this.root.push(child); + } - return this; + if (options.verticalAlign) { + this.properties.setVerticalAlign(options.verticalAlign); + } + + if (options.verticalMerge) { + this.properties.addVerticalMerge(options.verticalMerge); + } + + if (options.margins) { + this.properties.addMargins(options.margins); + } + + if (options.shading) { + this.properties.setShading(options.shading); + } + + if (options.columnSpan) { + this.properties.addGridSpan(options.columnSpan); + } + + if (options.borders) { + if (options.borders.top) { + this.properties.Borders.addTopBorder(options.borders.top.style, options.borders.top.size, options.borders.top.color); + } + if (options.borders.bottom) { + this.properties.Borders.addBottomBorder( + options.borders.bottom.style, + options.borders.bottom.size, + options.borders.bottom.color, + ); + } + if (options.borders.left) { + this.properties.Borders.addLeftBorder(options.borders.left.style, options.borders.left.size, options.borders.left.color); + } + if (options.borders.right) { + this.properties.Borders.addRightBorder( + options.borders.right.style, + options.borders.right.size, + options.borders.right.color, + ); + } + } } public prepForXml(): IXmlableObject | undefined { // Cells must end with a paragraph if (!(this.root[this.root.length - 1] instanceof Paragraph)) { - const para = new Paragraph({}); - this.add(para); + this.root.push(new Paragraph({})); } return super.prepForXml(); } - - public setVerticalAlign(type: VerticalAlign): TableCell { - this.properties.setVerticalAlign(type); - - return this; - } - - public addGridSpan(cellSpan: number): TableCell { - this.properties.addGridSpan(cellSpan); - - return this; - } - - public addVerticalMerge(type: VMergeType): TableCell { - this.properties.addVerticalMerge(type); - - return this; - } - - public setMargins(margins: ITableCellMarginOptions): TableCell { - this.properties.addMargins(margins); - - return this; - } - - public setShading(attrs: ITableShadingAttributesProperties): TableCell { - this.properties.setShading(attrs); - - return this; - } - - public get Borders(): TableCellBorders { - return this.properties.Borders; - } - - public get Properties(): TableCellProperties { - return this.properties; - } } diff --git a/src/file/table/table-column.spec.ts b/src/file/table/table-column.spec.ts index aa031423a3..50e9cb8aa4 100644 --- a/src/file/table/table-column.spec.ts +++ b/src/file/table/table-column.spec.ts @@ -1,16 +1,25 @@ import { expect } from "chai"; -import { Formatter } from "export/formatter"; +// import { Formatter } from "export/formatter"; +// import { EMPTY_OBJECT } from "file/xml-components"; import { TableCell } from "./table-cell"; import { TableColumn } from "./table-column"; -import { EMPTY_OBJECT } from "file/xml-components"; - describe("TableColumn", () => { let cells: TableCell[]; beforeEach(() => { - cells = [new TableCell(), new TableCell(), new TableCell()]; + cells = [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ]; }); describe("#getCell", () => { @@ -32,25 +41,25 @@ describe("TableColumn", () => { }); }); - describe("#mergeCells", () => { - it("should add vMerge to correct cells", () => { - const tableColumn = new TableColumn(cells); - tableColumn.mergeCells(0, 2); + // describe("#mergeCells", () => { + // it("should add vMerge to correct cells", () => { + // const tableColumn = new TableColumn(cells); + // tableColumn.mergeCells(0, 2); - const tree = new Formatter().format(cells[0]); - expect(tree).to.deep.equal({ - "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "restart" } } }] }, { "w:p": EMPTY_OBJECT }], - }); + // const tree = new Formatter().format(cells[0]); + // expect(tree).to.deep.equal({ + // "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "restart" } } }] }, { "w:p": EMPTY_OBJECT }], + // }); - const tree2 = new Formatter().format(cells[1]); - expect(tree2).to.deep.equal({ - "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "continue" } } }] }, { "w:p": EMPTY_OBJECT }], - }); + // const tree2 = new Formatter().format(cells[1]); + // expect(tree2).to.deep.equal({ + // "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "continue" } } }] }, { "w:p": EMPTY_OBJECT }], + // }); - const tree3 = new Formatter().format(cells[2]); - expect(tree3).to.deep.equal({ - "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "continue" } } }] }, { "w:p": EMPTY_OBJECT }], - }); - }); - }); + // const tree3 = new Formatter().format(cells[2]); + // expect(tree3).to.deep.equal({ + // "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "continue" } } }] }, { "w:p": EMPTY_OBJECT }], + // }); + // }); + // }); }); diff --git a/src/file/table/table-column.ts b/src/file/table/table-column.ts index 5752bde472..fc8c2cc240 100644 --- a/src/file/table/table-column.ts +++ b/src/file/table/table-column.ts @@ -1,4 +1,4 @@ -import { TableCell, VMergeType } from "./table-cell"; +import { TableCell } from "./table-cell"; export class TableColumn { constructor(private readonly cells: TableCell[]) {} @@ -13,13 +13,13 @@ export class TableColumn { return cell; } - public mergeCells(startIndex: number, endIndex: number): TableCell { - this.cells[startIndex].addVerticalMerge(VMergeType.RESTART); + // public mergeCells(startIndex: number, endIndex: number): TableCell { + // this.cells[startIndex].addVerticalMerge(VMergeType.RESTART); - for (let i = startIndex + 1; i <= endIndex; i++) { - this.cells[i].addVerticalMerge(VMergeType.CONTINUE); - } + // for (let i = startIndex + 1; i <= endIndex; i++) { + // this.cells[i].addVerticalMerge(VMergeType.CONTINUE); + // } - return this.cells[startIndex]; - } + // return this.cells[startIndex]; + // } } diff --git a/src/file/table/table-row/table-row.spec.ts b/src/file/table/table-row/table-row.spec.ts index 3e9a479949..3c732c6217 100644 --- a/src/file/table/table-row/table-row.spec.ts +++ b/src/file/table/table-row/table-row.spec.ts @@ -10,7 +10,9 @@ import { TableRow } from "./table-row"; describe("TableRow", () => { describe("#constructor", () => { it("should create with no cells", () => { - const tableRow = new TableRow([]); + const tableRow = new TableRow({ + children: [], + }); const tree = new Formatter().format(tableRow); expect(tree).to.deep.equal({ "w:tr": EMPTY_OBJECT, @@ -18,7 +20,13 @@ describe("TableRow", () => { }); it("should create with one cell", () => { - const tableRow = new TableRow([new TableCell()]); + const tableRow = new TableRow({ + children: [ + new TableCell({ + children: [], + }), + ], + }); const tree = new Formatter().format(tableRow); expect(tree).to.deep.equal({ "w:tr": [ @@ -32,46 +40,15 @@ describe("TableRow", () => { ], }); }); - }); - describe("#getCell", () => { - it("should get the cell", () => { - const cell = new TableCell(); - const tableRow = new TableRow([cell]); - - expect(tableRow.getCell(0)).to.equal(cell); - }); - - it("should throw an error if index is out of bounds", () => { - const cell = new TableCell(); - const tableRow = new TableRow([cell]); - - expect(() => tableRow.getCell(1)).to.throw(); - }); - }); - - describe("#addGridSpan", () => { - it("should merge the cell", () => { - const tableRow = new TableRow([new TableCell(), new TableCell()]); - - tableRow.addGridSpan(0, 2); - expect(() => tableRow.getCell(1)).to.throw(); - }); - }); - - describe("#mergeCells", () => { - it("should merge the cell", () => { - const tableRow = new TableRow([new TableCell(), new TableCell()]); - - tableRow.mergeCells(0, 1); - expect(() => tableRow.getCell(1)).to.throw(); - }); - }); - - describe("#setHeight", () => { it("should set row height", () => { - const tableRow = new TableRow([]); - tableRow.setHeight(100, HeightRule.EXACT); + const tableRow = new TableRow({ + children: [], + height: { + height: 100, + rule: HeightRule.EXACT, + }, + }); const tree = new Formatter().format(tableRow); expect(tree).to.deep.equal({ "w:tr": [ @@ -91,4 +68,22 @@ describe("TableRow", () => { }); }); }); + + // describe("#mergeCells", () => { + // it("should merge the cell", () => { + // const tableRow = new TableRow({ + // children: [ + // new TableCell({ + // children: [], + // }), + // new TableCell({ + // children: [], + // }), + // ], + // }); + + // tableRow.mergeCells(0, 1); + // expect(() => tableRow.getCell(1)).to.throw(); + // }); + // }); }); diff --git a/src/file/table/table-row/table-row.ts b/src/file/table/table-row/table-row.ts index f811392348..df47bf70bf 100644 --- a/src/file/table/table-row/table-row.ts +++ b/src/file/table/table-row/table-row.ts @@ -3,56 +3,57 @@ import { XmlComponent } from "file/xml-components"; import { TableCell } from "../table-cell"; import { TableRowProperties } from "./table-row-properties"; +export interface ITableRowOptions { + readonly cantSplit?: boolean; + readonly tableHeader?: boolean; + readonly height?: { + readonly height: number; + readonly rule: HeightRule; + }; + readonly children: TableCell[]; +} + export class TableRow extends XmlComponent { private readonly properties: TableRowProperties; - constructor(private readonly cells: TableCell[]) { + constructor(private readonly options: ITableRowOptions) { super("w:tr"); this.properties = new TableRowProperties(); this.root.push(this.properties); - cells.forEach((c) => this.root.push(c)); - } - public getCell(index: number): TableCell { - const cell = this.cells[index]; - - if (!cell) { - throw Error("Index out of bounds when trying to get cell on row"); + for (const child of options.children) { + this.root.push(child); } - return cell; + if (options.cantSplit) { + this.properties.setCantSplit(); + } + + if (options.tableHeader) { + this.properties.setTableHeader(); + } + + if (options.height) { + this.properties.setHeight(options.height.height, options.height.rule); + } } - public addGridSpan(index: number, cellSpan: number): TableCell { - const remainCell = this.cells[index]; - remainCell.addGridSpan(cellSpan); - this.cells.splice(index + 1, cellSpan - 1); - this.root.splice(index + 2, cellSpan - 1); - - return remainCell; + public get CellCount(): number { + return this.options.children.length; } - public mergeCells(startIndex: number, endIndex: number): TableCell { - const cellSpan = endIndex - startIndex + 1; + // public mergeCells(startIndex: number, endIndex: number): TableCell { + // const cellSpan = endIndex - startIndex + 1; - return this.addGridSpan(startIndex, cellSpan); - } + // return this.addGridSpan(startIndex, cellSpan); + // } - public setCantSplit(): TableRow { - this.properties.setCantSplit(); + // private addGridSpan(index: number, cellSpan: number): TableCell { + // const remainCell = this.options.children[index]; + // remainCell.addGridSpan(cellSpan); + // this.options.children.splice(index + 1, cellSpan - 1); + // this.root.splice(index + 2, cellSpan - 1); - return this; - } - - public setTableHeader(): TableRow { - this.properties.setTableHeader(); - - return this; - } - - public setHeight(height: number, rule: HeightRule): TableRow { - this.properties.setHeight(height, rule); - - return this; - } + // return remainCell; + // } } diff --git a/src/file/table/table.spec.ts b/src/file/table/table.spec.ts index 7c93c5fc8e..efbf2ebb24 100644 --- a/src/file/table/table.spec.ts +++ b/src/file/table/table.spec.ts @@ -9,7 +9,9 @@ import { Table } from "./table"; import { RelativeHorizontalPosition, RelativeVerticalPosition, TableAnchorType } from "./table-properties"; import { EMPTY_OBJECT } from "file/xml-components"; +import { TableCell } from "./table-cell"; import { TableLayoutType } from "./table-properties/table-layout"; +import { TableRow } from "./table-row"; const DEFAULT_TABLE_PROPERTIES = { "w:tblCellMar": [ @@ -118,8 +120,38 @@ describe("Table", () => { describe("#constructor", () => { it("creates a table with the correct number of rows and columns", () => { const table = new Table({ - rows: 3, - columns: 2, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], }); const tree = new Formatter().format(table); const cell = { "w:tc": [{ "w:p": EMPTY_OBJECT }] }; @@ -138,8 +170,15 @@ describe("Table", () => { it("sets the table to fixed width layout", () => { const table = new Table({ - rows: 1, - columns: 1, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], layout: TableLayoutType.FIXED, }); const tree = new Formatter().format(table); @@ -153,128 +192,19 @@ describe("Table", () => { }); }); - describe("#getRow and Row#getCell", () => { - const table = new Table({ - rows: 2, - columns: 2, - }); - - it("should return the correct row", () => { - table - .getRow(0) - .getCell(0) - .add(new Paragraph("A1")); - table - .getRow(0) - .getCell(1) - .add(new Paragraph("B1")); - table - .getRow(1) - .getCell(0) - .add(new Paragraph("A2")); - table - .getRow(1) - .getCell(1) - .add(new Paragraph("B2")); - const tree = new Formatter().format(table); - const cell = (c) => ({ - "w:tc": [ - { - "w:p": [{ "w:r": [{ "w:t": [{ _attr: { "xml:space": "preserve" } }, c] }] }], - }, - ], - }); - expect(tree).to.deep.equal({ - "w:tbl": [ - { "w:tblPr": [DEFAULT_TABLE_PROPERTIES, BORDERS, WIDTHS] }, - { - "w:tblGrid": [{ "w:gridCol": { _attr: { "w:w": 100 } } }, { "w:gridCol": { _attr: { "w:w": 100 } } }], - }, - { "w:tr": [cell("A1"), cell("B1")] }, - { "w:tr": [cell("A2"), cell("B2")] }, - ], - }); - }); - - it("throws an exception if index is out of bounds", () => { - expect(() => table.getCell(9, 9)).to.throw(); - }); - }); - - describe("#getColumn", () => { - const table = new Table({ - rows: 2, - columns: 2, - }); - - it("should get correct cell", () => { - const column = table.getColumn(0); - - expect(column.getCell(0)).to.equal(table.getCell(0, 0)); - expect(column.getCell(1)).to.equal(table.getCell(1, 0)); - }); - }); - - describe("#getCell", () => { - it("should returns the correct cell", () => { - const table = new Table({ - rows: 2, - columns: 2, - }); - table.getCell(0, 0).add(new Paragraph("A1")); - table.getCell(0, 1).add(new Paragraph("B1")); - table.getCell(1, 0).add(new Paragraph("A2")); - table.getCell(1, 1).add(new Paragraph("B2")); - const tree = new Formatter().format(table); - const cell = (c) => ({ - "w:tc": [ - { - "w:p": [{ "w:r": [{ "w:t": [{ _attr: { "xml:space": "preserve" } }, c] }] }], - }, - ], - }); - expect(tree).to.deep.equal({ - "w:tbl": [ - { "w:tblPr": [DEFAULT_TABLE_PROPERTIES, BORDERS, WIDTHS] }, - { - "w:tblGrid": [{ "w:gridCol": { _attr: { "w:w": 100 } } }, { "w:gridCol": { _attr: { "w:w": 100 } } }], - }, - { "w:tr": [cell("A1"), cell("B1")] }, - { "w:tr": [cell("A2"), cell("B2")] }, - ], - }); - }); - }); - - // describe("#setWidth", () => { - // it("should set the preferred width on the table", () => { - // const table = new Table({rows: 1,columns: 1,}).setWidth(1000, WidthType.PERCENTAGE); - // const tree = new Formatter().format(table); - // expect(tree) - // .to.have.property("w:tbl") - // .which.is.an("array") - // .with.has.length.at.least(1); - // expect(tree["w:tbl"][0]).to.deep.equal({ - // "w:tblPr": [DEFAULT_TABLE_PROPERTIES, { "w:tblW": { _attr: { "w:type": "pct", "w:w": "1000%" } } }], - // }); - // }); - - // it("sets the preferred width on the table with a default of AUTO", () => { - // const table = new Table({rows: 1,columns: 1,}).setWidth(1000); - // const tree = new Formatter().format(table); - - // expect(tree["w:tbl"][0]).to.deep.equal({ - // "w:tblPr": [DEFAULT_TABLE_PROPERTIES, { "w:tblW": { _attr: { "w:type": "auto", "w:w": 1000 } } }], - // }); - // }); - // }); - describe("Cell", () => { describe("#prepForXml", () => { it("inserts a paragraph at the end of the cell if it is empty", () => { const table = new Table({ - rows: 1, - columns: 1, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], }); const tree = new Formatter().format(table); expect(tree) @@ -290,64 +220,92 @@ describe("Table", () => { }); }); - it("inserts a paragraph at the end of the cell even if it has a child table", () => { - const parentTable = new Table({ - rows: 1, - columns: 1, - }); - parentTable.getCell(0, 0).add( - new Table({ - rows: 1, - columns: 1, - }), - ); - const tree = new Formatter().format(parentTable); - expect(tree) - .to.have.property("w:tbl") - .which.is.an("array"); - const row = tree["w:tbl"].find((x) => x["w:tr"]); - expect(row).not.to.be.undefined; - expect(row["w:tr"]) - .to.be.an("array") - .which.has.length.at.least(1); - const cell = row["w:tr"].find((x) => x["w:tc"]); - expect(cell).not.to.be.undefined; - expect(cell["w:tc"][cell["w:tc"].length - 1]).to.deep.equal({ - "w:p": EMPTY_OBJECT, - }); - }); + // it("inserts a paragraph at the end of the cell even if it has a child table", () => { + // const table = new Table({ + // rows: [ + // new TableRow({ + // children: [ + // new TableCell({ + // children: [new Paragraph("hello")], + // }), + // ], + // }), + // ], + // }); + // table.getCell(0, 0).add( + // new Table({ + // rows: [ + // new TableRow({ + // children: [ + // new TableCell({ + // children: [new Paragraph("hello")], + // }), + // ], + // }), + // ], + // }), + // ); + // const tree = new Formatter().format(table); + // expect(tree) + // .to.have.property("w:tbl") + // .which.is.an("array"); + // const row = tree["w:tbl"].find((x) => x["w:tr"]); + // expect(row).not.to.be.undefined; + // expect(row["w:tr"]) + // .to.be.an("array") + // .which.has.length.at.least(1); + // const cell = row["w:tr"].find((x) => x["w:tc"]); + // expect(cell).not.to.be.undefined; + // expect(cell["w:tc"][cell["w:tc"].length - 1]).to.deep.equal({ + // "w:p": EMPTY_OBJECT, + // }); + // }); - it("does not insert a paragraph if it already ends with one", () => { - const parentTable = new Table({ - rows: 1, - columns: 1, - }); - parentTable.getCell(0, 0).add(new Paragraph("Hello")); - const tree = new Formatter().format(parentTable); - expect(tree) - .to.have.property("w:tbl") - .which.is.an("array"); - const row = tree["w:tbl"].find((x) => x["w:tr"]); - expect(row).not.to.be.undefined; - expect(row["w:tr"]) - .to.be.an("array") - .which.has.length.at.least(1); - expect(row["w:tr"].find((x) => x["w:tc"])).to.deep.equal({ - "w:tc": [ - { - "w:p": [{ "w:r": [{ "w:t": [{ _attr: { "xml:space": "preserve" } }, "Hello"] }] }], - }, - ], - }); - }); + // it("does not insert a paragraph if it already ends with one", () => { + // const table = new Table({ + // rows: [ + // new TableRow({ + // children: [ + // new TableCell({ + // children: [new Paragraph("hello")], + // }), + // ], + // }), + // ], + // }); + // table.getCell(0, 0).add(new Paragraph("Hello")); + // const tree = new Formatter().format(table); + // expect(tree) + // .to.have.property("w:tbl") + // .which.is.an("array"); + // const row = tree["w:tbl"].find((x) => x["w:tr"]); + // expect(row).not.to.be.undefined; + // expect(row["w:tr"]) + // .to.be.an("array") + // .which.has.length.at.least(1); + // expect(row["w:tr"].find((x) => x["w:tc"])).to.deep.equal({ + // "w:tc": [ + // { + // "w:p": [{ "w:r": [{ "w:t": [{ _attr: { "xml:space": "preserve" } }, "Hello"] }] }], + // }, + // ], + // }); + // }); }); }); describe("#float", () => { it("sets the table float properties", () => { const table = new Table({ - rows: 1, - columns: 1, + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], float: { horizontalAnchor: TableAnchorType.MARGIN, verticalAnchor: TableAnchorType.PAGE, diff --git a/src/file/table/table.ts b/src/file/table/table.ts index c56bc4d62c..ea8e64d72c 100644 --- a/src/file/table/table.ts +++ b/src/file/table/table.ts @@ -1,12 +1,11 @@ // http://officeopenxml.com/WPtableGrid.php import { XmlComponent } from "file/xml-components"; - import { TableGrid } from "./grid"; -import { TableCell, WidthType } from "./table-cell"; -import { TableColumn } from "./table-column"; +import { WidthType } from "./table-cell"; import { ITableFloatOptions, TableProperties } from "./table-properties"; import { TableLayoutType } from "./table-properties/table-layout"; import { TableRow } from "./table-row"; + /* 0-width columns don't get rendered correctly, so we need to give them some value. A reasonable default would be @@ -18,8 +17,7 @@ import { TableRow } from "./table-row"; algorithm will expand columns to fit its content */ export interface ITableOptions { - readonly rows: number; - readonly columns: number; + readonly rows: TableRow[]; readonly width?: number; readonly widthUnitType?: WidthType; readonly columnWidths?: number[]; @@ -36,14 +34,12 @@ export interface ITableOptions { export class Table extends XmlComponent { private readonly properties: TableProperties; - private readonly rows: TableRow[]; constructor({ rows, - columns, width = 100, widthUnitType = WidthType.AUTO, - columnWidths = Array(columns).fill(100), + columnWidths = Array(Math.max(...rows.map((row) => row.CellCount))).fill(100), margins: { marginUnitType, top, bottom, right, left } = { marginUnitType: WidthType.AUTO, top: 0, bottom: 0, right: 0, left: 0 }, float, layout, @@ -57,21 +53,12 @@ export class Table extends XmlComponent { this.properties.CellMargin.addTopMargin(top || 0, marginUnitType); this.properties.CellMargin.addLeftMargin(left || 0, marginUnitType); this.properties.CellMargin.addRightMargin(right || 0, marginUnitType); - const grid = new TableGrid(columnWidths); - this.root.push(grid); + this.root.push(new TableGrid(columnWidths)); - this.rows = Array(rows) - .fill(0) - .map(() => { - const cells = Array(columns) - .fill(0) - .map(() => new TableCell()); - const row = new TableRow(cells); - return row; - }); - - this.rows.forEach((x) => this.root.push(x)); + for (const row of rows) { + this.root.push(row); + } if (float) { this.properties.setTableFloatProperties(float); @@ -81,24 +68,4 @@ export class Table extends XmlComponent { this.properties.setLayout(layout); } } - - public getRow(index: number): TableRow { - const row = this.rows[index]; - - if (!row) { - throw Error("Index out of bounds when trying to get row on table"); - } - - return row; - } - - public getColumn(index: number): TableColumn { - // This is a convinence method for people who like to work with columns - const cells = this.rows.map((row) => row.getCell(index)); - return new TableColumn(cells); - } - - public getCell(row: number, col: number): TableCell { - return this.getRow(row).getCell(col); - } } From d2f82052b4e4af147ed70bfe6bb2b94085dddc7f Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Thu, 19 Sep 2019 22:49:09 +0100 Subject: [PATCH 15/57] Improve documentation --- docs/usage/tables.md | 147 ++++++++++++++++++++++++++----------------- 1 file changed, 90 insertions(+), 57 deletions(-) diff --git a/docs/usage/tables.md b/docs/usage/tables.md index bf6c16d7ea..81dbc7e818 100644 --- a/docs/usage/tables.md +++ b/docs/usage/tables.md @@ -1,95 +1,128 @@ # Tables -You can create tables with `docx`. More information can be found [here](http://officeopenxml.com/WPtable.php). +!> Paragraphs requires an understanding of [Sections](usage/sections.md). -## Create Table +## Intro -To create a table, simply create one with `new Table()`, then add it to the document: `doc.add()`. - -```ts -const table = doc.add(new Table({ - rows: [NUMBER OF ROWS], - columns: [NUMBER OF COLUMNS] -}); -``` - -Alternatively, you can create a table object directly, and then add it in the `document` - -```ts -const table = new Table(4, 4); -doc.add(table); -``` - -The snippet below creates a table of 2 rows and 4 columns. +Create a simple table like so: ```ts const table = new Table({ - rows: 2, - columns: 4, + rows: [Array of `TableRow`s] }); -doc.add(table); ``` -## Rows and Columns - -You can get a row or a column from a table like so, where `index` is a number: - -### Get Row +Then add the table in the `section` ```ts -const row = doc.getRow(index); +doc.addSection({ + children: [table], +}); ``` -With this, you can merge a row by using the `mergeCells()` method, where `startIndex` is the row number you want to merge from, and `endIndex` is where you want it to merge to: +## Table Row + +A table consists of multiple `table rows`. Table rows have a list of `children` which accepts a list of `table cells` explained below. You can create a simple `table row` like so: ```ts -row.mergeCells(startIndex, endIndex); +const tableRow = new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], +}); ``` -You can get a cell from a `row` by using the `getCell()` method, where `index` is the row index: +Or preferably, add the tableRow directly into the `table` without declaring a variable: ```ts -row.getCell(index); +const table = new Table({ + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], +}); ``` -### Get Column +### Options -```ts -const column = doc.getColumn(index); -``` +Here is a list of options you can add to the `table row`: -Again, you can merge a row by using the `mergeCells()` method, where `startIndex` is the row number you want to merge from, and `endIndex` is where you want it to merge to: - -```ts -column.mergeCells(startIndex, endIndex); -``` - -You can get a cell from a `column` by using the `getCell()` method, where `index` is the column index: - -```ts -column.getCell(index); -``` +| Property | Type | Notes | +| ----------- | ------------------------------------- | -------- | +| children | `Array` | Required | +| cantSplit | `boolean` | Optional | +| tableHeader | `boolean` | Optional | +| height | `{ value: number, rule: HeightRule }` | Optional | ## Cells -To access the cell, use the `getCell()` method. +Cells need to be added in the `table row`, you can create a table cell like: ```ts -const cell = table.getCell([ROW INDEX], [COLUMN INDEX]); +const tableCell = new TableCell({ + children: [new Paragraph("hello")], +}); ``` -You can also get a cell from a `column` or a `row` with `getCell()`, mentioned previously. - -For example: +Or preferably, add the tableRow directly into the `table row` without declaring a variable: ```ts -const cell = table.getCell(0, 2); - -const cell = row.getCell(0); - -const cell = column.getCell(2); +const tableRow = new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], +}); ``` +| Property | Type | Notes | +| ----------- | ------------------------------------- | -------- | +| children | `Array` | Required | +| cantSplit | `boolean` | Optional | +| tableHeader | `boolean` | Optional | +| height | `{ value: number, rule: HeightRule }` | Optional | + +### Options + + readonly shading?: ITableShadingAttributesProperties; + readonly margins?: ITableCellMarginOptions; + readonly verticalAlign?: VerticalAlign; + readonly verticalMerge?: VMergeType; + readonly columnSpan?: number; + readonly borders?: { + readonly top?: { + readonly style: BorderStyle; + readonly size: number; + readonly color: string; + }; + readonly bottom?: { + readonly style: BorderStyle; + readonly size: number; + readonly color: string; + }; + readonly left?: { + readonly style: BorderStyle; + readonly size: number; + readonly color: string; + }; + readonly right?: { + readonly style: BorderStyle; + readonly size: number; + readonly color: string; + }; + }; + readonly children: Array; + + + ### Add paragraph to a cell Once you have got the cell, you can add data to it with the `add()` method. From a9d4ebc89873e706c7448929b1b5882652db10ac Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sun, 22 Sep 2019 02:39:38 +0100 Subject: [PATCH 16/57] Add declarative column merge --- demo/32-merge-table-cells.ts | 2 +- demo/41-merge-table-cells-2.ts | 137 +++++++++++++++++++++++- demo/43-images-to-table-cell-2.ts | 3 +- src/file/table/table-cell/table-cell.ts | 31 ++++++ src/file/table/table-column.spec.ts | 65 ----------- src/file/table/table-column.ts | 25 ----- src/file/table/table-row/table-row.ts | 17 +-- src/file/table/table.ts | 7 ++ 8 files changed, 179 insertions(+), 108 deletions(-) delete mode 100644 src/file/table/table-column.spec.ts delete mode 100644 src/file/table/table-column.ts diff --git a/demo/32-merge-table-cells.ts b/demo/32-merge-table-cells.ts index 55a9181281..873f3b50db 100644 --- a/demo/32-merge-table-cells.ts +++ b/demo/32-merge-table-cells.ts @@ -1,4 +1,4 @@ -// Example of how you would merge cells together +// Example of how you would merge cells together - Rows and Columns // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; import { Document, HeadingLevel, Packer, Paragraph, ShadingType, Table, TableCell, TableRow, WidthType } from "../build"; diff --git a/demo/41-merge-table-cells-2.ts b/demo/41-merge-table-cells-2.ts index 50141a1a7a..3ef8615590 100644 --- a/demo/41-merge-table-cells-2.ts +++ b/demo/41-merge-table-cells-2.ts @@ -117,8 +117,143 @@ const table = new Table({ ], }); +const table2 = new Table({ + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("0,0")], + }), + new TableCell({ + children: [new Paragraph("0,1")], + rowSpan: 2, + }), + new TableCell({ + children: [new Paragraph("0,2")], + }), + new TableCell({ + children: [new Paragraph("0,3")], + }), + new TableCell({ + children: [new Paragraph("0,4")], + }), + new TableCell({ + children: [new Paragraph("0,5")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("1,0")], + }), + new TableCell({ + children: [new Paragraph("1,2")], + }), + new TableCell({ + children: [new Paragraph("1,3")], + }), + new TableCell({ + children: [new Paragraph("1,4")], + }), + new TableCell({ + children: [new Paragraph("1,5")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("2,0")], + }), + new TableCell({ + children: [new Paragraph("2,1")], + }), + new TableCell({ + children: [new Paragraph("2,2")], + }), + new TableCell({ + children: [new Paragraph("2,3")], + }), + new TableCell({ + children: [new Paragraph("2,4")], + }), + new TableCell({ + children: [new Paragraph("2,5")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("3,0")], + }), + new TableCell({ + children: [new Paragraph("3,1")], + }), + new TableCell({ + children: [new Paragraph("3,2")], + }), + new TableCell({ + children: [new Paragraph("3,3")], + }), + new TableCell({ + children: [new Paragraph("3,4")], + }), + new TableCell({ + children: [new Paragraph("3,5")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("4,0")], + }), + new TableCell({ + children: [new Paragraph("4,1")], + }), + new TableCell({ + children: [new Paragraph("4,2")], + }), + new TableCell({ + children: [new Paragraph("4,3")], + }), + new TableCell({ + children: [new Paragraph("4,4")], + }), + new TableCell({ + children: [new Paragraph("4,5")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + new TableCell({ + children: [], + }), + ], + }), + ], +}); + doc.addSection({ - children: [table], + children: [table, new Paragraph(""), table2], }); Packer.toBuffer(doc).then((buffer) => { diff --git a/demo/43-images-to-table-cell-2.ts b/demo/43-images-to-table-cell-2.ts index 1840c9382c..ab950d284c 100644 --- a/demo/43-images-to-table-cell-2.ts +++ b/demo/43-images-to-table-cell-2.ts @@ -36,6 +36,7 @@ const table = new Table({ }), new TableCell({ children: [], + rowSpan: 2, }), ], }), @@ -74,8 +75,6 @@ const table = new Table({ ], }); -table.getColumn(3).mergeCells(1, 2); - doc.addSection({ children: [table], }); diff --git a/src/file/table/table-cell/table-cell.ts b/src/file/table/table-cell/table-cell.ts index 05416b34d5..a93652e5d6 100644 --- a/src/file/table/table-cell/table-cell.ts +++ b/src/file/table/table-cell/table-cell.ts @@ -5,6 +5,7 @@ import { IXmlableObject, XmlComponent } from "file/xml-components"; import { ITableShadingAttributesProperties } from "../shading"; import { Table } from "../table"; +import { TableRow } from "../table-row"; import { ITableCellMarginOptions } from "./cell-margin/table-cell-margins"; import { VerticalAlign, VMergeType } from "./table-cell-components"; import { TableCellProperties } from "./table-cell-properties"; @@ -15,6 +16,7 @@ export interface ITableCellOptions { readonly verticalAlign?: VerticalAlign; readonly verticalMerge?: VMergeType; readonly columnSpan?: number; + readonly rowSpan?: number; readonly borders?: { readonly top?: { readonly style: BorderStyle; @@ -40,8 +42,15 @@ export interface ITableCellOptions { readonly children: Array; } +interface ITableCellMetaData { + readonly column: TableCell[]; + readonly row: TableRow; +} + export class TableCell extends XmlComponent { private readonly properties: TableCellProperties; + // tslint:disable-next-line: readonly-keyword + private metaData: ITableCellMetaData; constructor(readonly options: ITableCellOptions) { super("w:tc"); @@ -98,10 +107,32 @@ export class TableCell extends XmlComponent { } public prepForXml(): IXmlableObject | undefined { + // Row Span has to be added in this method and not the constructor because it needs to know information about the column which happens after Table Cell construction + // Row Span of 1 will crash word as it will add RESTART and not a corresponding CONTINUE + if (this.options.rowSpan && this.options.rowSpan > 1) { + this.properties.addVerticalMerge(VMergeType.RESTART); + + const currentIndex = this.metaData.column.indexOf(this); + for (let i = currentIndex + 1; i <= currentIndex + this.options.rowSpan - 1; i++) { + this.metaData.column[i].metaData.row.Children.splice( + i, + 0, + new TableCell({ + children: [], + }), + ); + this.metaData.column[i].properties.addVerticalMerge(VMergeType.CONTINUE); + } + } + // Cells must end with a paragraph if (!(this.root[this.root.length - 1] instanceof Paragraph)) { this.root.push(new Paragraph({})); } return super.prepForXml(); } + + public set MetaData(metaData: ITableCellMetaData) { + this.metaData = metaData; + } } diff --git a/src/file/table/table-column.spec.ts b/src/file/table/table-column.spec.ts deleted file mode 100644 index 50e9cb8aa4..0000000000 --- a/src/file/table/table-column.spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { expect } from "chai"; - -// import { Formatter } from "export/formatter"; -// import { EMPTY_OBJECT } from "file/xml-components"; - -import { TableCell } from "./table-cell"; -import { TableColumn } from "./table-column"; - -describe("TableColumn", () => { - let cells: TableCell[]; - beforeEach(() => { - cells = [ - new TableCell({ - children: [], - }), - new TableCell({ - children: [], - }), - new TableCell({ - children: [], - }), - ]; - }); - - describe("#getCell", () => { - it("should get the correct cell", () => { - const tableColumn = new TableColumn(cells); - const cell = tableColumn.getCell(0); - - expect(cell).to.deep.equal(cells[0]); - - const cell2 = tableColumn.getCell(1); - - expect(cell2).to.deep.equal(cells[1]); - }); - - it("should throw an error if index is out of bounds", () => { - const tableColumn = new TableColumn(cells); - - expect(() => tableColumn.getCell(9)).to.throw(); - }); - }); - - // describe("#mergeCells", () => { - // it("should add vMerge to correct cells", () => { - // const tableColumn = new TableColumn(cells); - // tableColumn.mergeCells(0, 2); - - // const tree = new Formatter().format(cells[0]); - // expect(tree).to.deep.equal({ - // "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "restart" } } }] }, { "w:p": EMPTY_OBJECT }], - // }); - - // const tree2 = new Formatter().format(cells[1]); - // expect(tree2).to.deep.equal({ - // "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "continue" } } }] }, { "w:p": EMPTY_OBJECT }], - // }); - - // const tree3 = new Formatter().format(cells[2]); - // expect(tree3).to.deep.equal({ - // "w:tc": [{ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "continue" } } }] }, { "w:p": EMPTY_OBJECT }], - // }); - // }); - // }); -}); diff --git a/src/file/table/table-column.ts b/src/file/table/table-column.ts deleted file mode 100644 index fc8c2cc240..0000000000 --- a/src/file/table/table-column.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { TableCell } from "./table-cell"; - -export class TableColumn { - constructor(private readonly cells: TableCell[]) {} - - public getCell(index: number): TableCell { - const cell = this.cells[index]; - - if (!cell) { - throw Error("Index out of bounds when trying to get cell on column"); - } - - return cell; - } - - // public mergeCells(startIndex: number, endIndex: number): TableCell { - // this.cells[startIndex].addVerticalMerge(VMergeType.RESTART); - - // for (let i = startIndex + 1; i <= endIndex; i++) { - // this.cells[i].addVerticalMerge(VMergeType.CONTINUE); - // } - - // return this.cells[startIndex]; - // } -} diff --git a/src/file/table/table-row/table-row.ts b/src/file/table/table-row/table-row.ts index df47bf70bf..07cd811fb9 100644 --- a/src/file/table/table-row/table-row.ts +++ b/src/file/table/table-row/table-row.ts @@ -42,18 +42,7 @@ export class TableRow extends XmlComponent { return this.options.children.length; } - // public mergeCells(startIndex: number, endIndex: number): TableCell { - // const cellSpan = endIndex - startIndex + 1; - - // return this.addGridSpan(startIndex, cellSpan); - // } - - // private addGridSpan(index: number, cellSpan: number): TableCell { - // const remainCell = this.options.children[index]; - // remainCell.addGridSpan(cellSpan); - // this.options.children.splice(index + 1, cellSpan - 1); - // this.root.splice(index + 2, cellSpan - 1); - - // return remainCell; - // } + public get Children(): TableCell[] { + return this.options.children; + } } diff --git a/src/file/table/table.ts b/src/file/table/table.ts index ea8e64d72c..5459400aeb 100644 --- a/src/file/table/table.ts +++ b/src/file/table/table.ts @@ -57,6 +57,13 @@ export class Table extends XmlComponent { this.root.push(new TableGrid(columnWidths)); for (const row of rows) { + row.Children.forEach((cell, i) => { + cell.MetaData = { + column: rows.map((r) => r.Children[i]), + row: row, + }; + }); + this.root.push(row); } From c11af71ed7f5b401c812b462bdbae5179155c869 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sun, 22 Sep 2019 19:09:34 +0100 Subject: [PATCH 17/57] Add test such that it only should call prep once --- src/export/formatter.spec.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/export/formatter.spec.ts b/src/export/formatter.spec.ts index bd6c9b7160..7ee05fa5d1 100644 --- a/src/export/formatter.spec.ts +++ b/src/export/formatter.spec.ts @@ -1,7 +1,8 @@ import { assert, expect } from "chai"; +import * as sinon from "sinon"; import { Formatter } from "export/formatter"; -import * as file from "file"; +import { Paragraph, TextRun } from "file"; import { CoreProperties } from "file/core-properties"; import { Attributes } from "file/xml-components"; @@ -14,22 +15,22 @@ describe("Formatter", () => { describe("#format()", () => { it("should format simple paragraph", () => { - const paragraph = new file.Paragraph(""); + const paragraph = new Paragraph(""); const newJson = formatter.format(paragraph); assert.isDefined(newJson["w:p"]); }); it("should remove xmlKeys", () => { - const paragraph = new file.Paragraph(""); + const paragraph = new Paragraph(""); const newJson = formatter.format(paragraph); const stringifiedJson = JSON.stringify(newJson); assert(stringifiedJson.indexOf("xmlKeys") < 0); }); it("should format simple paragraph with bold text", () => { - const paragraph = new file.Paragraph(""); + const paragraph = new Paragraph(""); paragraph.addRun( - new file.TextRun({ + new TextRun({ text: "test", bold: true, }), @@ -63,7 +64,7 @@ describe("Formatter", () => { }); it("should should change 'p' tag into 'w:p' tag", () => { - const paragraph = new file.Paragraph(""); + const paragraph = new Paragraph(""); const newJson = formatter.format(paragraph); assert.isDefined(newJson["w:p"]); }); @@ -76,5 +77,13 @@ describe("Formatter", () => { const newJson = formatter.format(properties); assert.isDefined(newJson["cp:coreProperties"]); }); + + it("should call the prep method only once", () => { + const paragraph = new Paragraph(""); + const spy = sinon.spy(paragraph, "prepForXml"); + + formatter.format(paragraph); + expect(spy.calledOnce).to.equal(true); + }); }); }); From cc36ea75429c9cb8083f74b1c9baee2f7ddf0a74 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sun, 22 Sep 2019 20:45:24 +0100 Subject: [PATCH 18/57] Optimise formatting to not over-format the same files --- src/export/packer/next-compiler.spec.ts | 20 +++++++++++++++++++- src/export/packer/next-compiler.ts | 12 +++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/export/packer/next-compiler.spec.ts b/src/export/packer/next-compiler.spec.ts index ac271c02d9..7c48569793 100644 --- a/src/export/packer/next-compiler.spec.ts +++ b/src/export/packer/next-compiler.spec.ts @@ -1,7 +1,8 @@ /* tslint:disable:typedef space-before-function-paren */ import { expect } from "chai"; +import * as sinon from "sinon"; -import { File, Footer, Header } from "file"; +import { File, Footer, Header, Paragraph } from "file"; import { Compiler } from "./next-compiler"; @@ -72,5 +73,22 @@ describe("Compiler", () => { expect(fileNames).to.include("word/footer2.xml"); expect(fileNames).to.include("word/_rels/footer2.xml.rels"); }); + + it("should call the format method X times equalling X files to be formatted", () => { + // This test is required because before, there was a case where Document was formatted twice, which was inefficient + // This also caused issues such as running prepForXml multiple times as format() was ran multiple times. + const paragraph = new Paragraph(""); + const doc = new File(); + + doc.addSection({ + properties: {}, + children: [paragraph], + }); + // tslint:disable-next-line: no-string-literal + const spy = sinon.spy(compiler["formatter"], "format"); + + compiler.compile(file); + expect(spy.callCount).to.equal(10); + }); }); }); diff --git a/src/export/packer/next-compiler.ts b/src/export/packer/next-compiler.ts index 426d32174f..6a3e752098 100644 --- a/src/export/packer/next-compiler.ts +++ b/src/export/packer/next-compiler.ts @@ -68,13 +68,13 @@ export class Compiler { file.verifyUpdateFields(); const documentRelationshipCount = file.DocumentRelationships.RelationshipCount + 1; + const documentXmlData = xml(this.formatter.format(file.Document), prettify); + const documentMediaDatas = this.imageReplacer.getMediaData(documentXmlData, file.Media); + return { Relationships: { data: (() => { - const xmlData = xml(this.formatter.format(file.Document), prettify); - const mediaDatas = this.imageReplacer.getMediaData(xmlData, file.Media); - - mediaDatas.forEach((mediaData, i) => { + documentMediaDatas.forEach((mediaData, i) => { file.DocumentRelationships.createRelationship( documentRelationshipCount + i, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", @@ -88,9 +88,7 @@ export class Compiler { }, Document: { data: (() => { - const tempXmlData = xml(this.formatter.format(file.Document), prettify); - const mediaDatas = this.imageReplacer.getMediaData(tempXmlData, file.Media); - const xmlData = this.imageReplacer.replace(tempXmlData, mediaDatas, documentRelationshipCount); + const xmlData = this.imageReplacer.replace(documentXmlData, documentMediaDatas, documentRelationshipCount); return xmlData; })(), From 7aa4134e2b698d39271319799b5c39b633f06000 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Wed, 25 Sep 2019 00:57:24 +0100 Subject: [PATCH 19/57] Refactor row merging to table level --- ...s.ts => 32-merge-and-shade-table-cells.ts} | 56 ++++++++++++++++++- demo/41-merge-table-cells-2.ts | 2 +- src/file/table/table-cell/table-cell.ts | 34 ++--------- src/file/table/table-row/table-row.ts | 5 ++ src/file/table/table.ts | 31 +++++++--- 5 files changed, 86 insertions(+), 42 deletions(-) rename demo/{32-merge-table-cells.ts => 32-merge-and-shade-table-cells.ts} (74%) diff --git a/demo/32-merge-table-cells.ts b/demo/32-merge-and-shade-table-cells.ts similarity index 74% rename from demo/32-merge-table-cells.ts rename to demo/32-merge-and-shade-table-cells.ts index 873f3b50db..1112931079 100644 --- a/demo/32-merge-table-cells.ts +++ b/demo/32-merge-and-shade-table-cells.ts @@ -1,4 +1,4 @@ -// Example of how you would merge cells together - Rows and Columns +// Example of how you would merge cells together (Rows and Columns) and apply shading // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; import { Document, HeadingLevel, Packer, Paragraph, ShadingType, Table, TableCell, TableRow, WidthType } from "../build"; @@ -125,13 +125,61 @@ const table3 = new Table({ const table4 = new Table({ rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("0,0")], + columnSpan: 2, + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("1,0")], + }), + new TableCell({ + children: [new Paragraph("1,1")], + }), + ], + }), + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("2,0")], + columnSpan: 2, + }), + ], + }), + ], + width: 100, + widthUnitType: WidthType.PERCENTAGE, +}); + +const table5 = new Table({ + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("0,0")], + }), + new TableCell({ + children: [new Paragraph("0,1")], + rowSpan: 2, + }), + new TableCell({ + children: [new Paragraph("0,2")], + }), + ], + }), new TableRow({ children: [ new TableCell({ children: [], }), new TableCell({ - children: [], + children: [new Paragraph("1,2")], + rowSpan: 2, }), ], }), @@ -163,8 +211,10 @@ doc.addSection({ heading: HeadingLevel.HEADING_2, }), table3, - new Paragraph("hi"), + new Paragraph("Merging columns"), table4, + new Paragraph("More Merging columns"), + table5, ], }); diff --git a/demo/41-merge-table-cells-2.ts b/demo/41-merge-table-cells-2.ts index 3ef8615590..94e7bffe1d 100644 --- a/demo/41-merge-table-cells-2.ts +++ b/demo/41-merge-table-cells-2.ts @@ -1,4 +1,4 @@ -// Multiple cells merging in the same table +// Multiple cells merging in the same table - Rows and Columns // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; diff --git a/src/file/table/table-cell/table-cell.ts b/src/file/table/table-cell/table-cell.ts index a93652e5d6..616065a0c1 100644 --- a/src/file/table/table-cell/table-cell.ts +++ b/src/file/table/table-cell/table-cell.ts @@ -5,7 +5,6 @@ import { IXmlableObject, XmlComponent } from "file/xml-components"; import { ITableShadingAttributesProperties } from "../shading"; import { Table } from "../table"; -import { TableRow } from "../table-row"; import { ITableCellMarginOptions } from "./cell-margin/table-cell-margins"; import { VerticalAlign, VMergeType } from "./table-cell-components"; import { TableCellProperties } from "./table-cell-properties"; @@ -42,15 +41,8 @@ export interface ITableCellOptions { readonly children: Array; } -interface ITableCellMetaData { - readonly column: TableCell[]; - readonly row: TableRow; -} - export class TableCell extends XmlComponent { private readonly properties: TableCellProperties; - // tslint:disable-next-line: readonly-keyword - private metaData: ITableCellMetaData; constructor(readonly options: ITableCellOptions) { super("w:tc"); @@ -82,6 +74,10 @@ export class TableCell extends XmlComponent { this.properties.addGridSpan(options.columnSpan); } + if (options.rowSpan && options.rowSpan > 1) { + this.properties.addVerticalMerge(VMergeType.RESTART); + } + if (options.borders) { if (options.borders.top) { this.properties.Borders.addTopBorder(options.borders.top.style, options.borders.top.size, options.borders.top.color); @@ -107,32 +103,10 @@ export class TableCell extends XmlComponent { } public prepForXml(): IXmlableObject | undefined { - // Row Span has to be added in this method and not the constructor because it needs to know information about the column which happens after Table Cell construction - // Row Span of 1 will crash word as it will add RESTART and not a corresponding CONTINUE - if (this.options.rowSpan && this.options.rowSpan > 1) { - this.properties.addVerticalMerge(VMergeType.RESTART); - - const currentIndex = this.metaData.column.indexOf(this); - for (let i = currentIndex + 1; i <= currentIndex + this.options.rowSpan - 1; i++) { - this.metaData.column[i].metaData.row.Children.splice( - i, - 0, - new TableCell({ - children: [], - }), - ); - this.metaData.column[i].properties.addVerticalMerge(VMergeType.CONTINUE); - } - } - // Cells must end with a paragraph if (!(this.root[this.root.length - 1] instanceof Paragraph)) { this.root.push(new Paragraph({})); } return super.prepForXml(); } - - public set MetaData(metaData: ITableCellMetaData) { - this.metaData = metaData; - } } diff --git a/src/file/table/table-row/table-row.ts b/src/file/table/table-row/table-row.ts index 07cd811fb9..466b7eb320 100644 --- a/src/file/table/table-row/table-row.ts +++ b/src/file/table/table-row/table-row.ts @@ -45,4 +45,9 @@ export class TableRow extends XmlComponent { public get Children(): TableCell[] { return this.options.children; } + + public addCellToIndex(cell: TableCell, index: number): void { + // Offset because properties is also in root. + this.root.splice(index + 1, 0, cell); + } } diff --git a/src/file/table/table.ts b/src/file/table/table.ts index 5459400aeb..64e276f73d 100644 --- a/src/file/table/table.ts +++ b/src/file/table/table.ts @@ -1,7 +1,7 @@ // http://officeopenxml.com/WPtableGrid.php import { XmlComponent } from "file/xml-components"; import { TableGrid } from "./grid"; -import { WidthType } from "./table-cell"; +import { TableCell, VMergeType, WidthType } from "./table-cell"; import { ITableFloatOptions, TableProperties } from "./table-properties"; import { TableLayoutType } from "./table-properties/table-layout"; import { TableRow } from "./table-row"; @@ -57,16 +57,31 @@ export class Table extends XmlComponent { this.root.push(new TableGrid(columnWidths)); for (const row of rows) { - row.Children.forEach((cell, i) => { - cell.MetaData = { - column: rows.map((r) => r.Children[i]), - row: row, - }; - }); - this.root.push(row); } + for (const row of rows) { + row.Children.forEach((cell, cellIndex) => { + const column = rows.map((r) => r.Children[cellIndex]); + // Row Span has to be added in this method and not the constructor because it needs to know information about the column which happens after Table Cell construction + // Row Span of 1 will crash word as it will add RESTART and not a corresponding CONTINUE + if (cell.options.rowSpan && cell.options.rowSpan > 1) { + const thisCellsColumnIndex = column.indexOf(cell); + const endColumnIndex = thisCellsColumnIndex + (cell.options.rowSpan - 1); + + for (let i = thisCellsColumnIndex + 1; i <= endColumnIndex; i++) { + rows[i].addCellToIndex( + new TableCell({ + children: [], + verticalMerge: VMergeType.CONTINUE, + }), + i, + ); + } + } + }); + } + if (float) { this.properties.setTableFloatProperties(float); } From b2de74a0e6c1392b842368d4cff88c8b5112ec41 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Wed, 25 Sep 2019 01:09:53 +0100 Subject: [PATCH 20/57] Fix tests --- src/file/table/table.spec.ts | 45 +++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/src/file/table/table.spec.ts b/src/file/table/table.spec.ts index efbf2ebb24..b88bda964a 100644 --- a/src/file/table/table.spec.ts +++ b/src/file/table/table.spec.ts @@ -8,7 +8,6 @@ import { Table } from "./table"; // import { WidthType } from "./table-cell"; import { RelativeHorizontalPosition, RelativeVerticalPosition, TableAnchorType } from "./table-properties"; -import { EMPTY_OBJECT } from "file/xml-components"; import { TableCell } from "./table-cell"; import { TableLayoutType } from "./table-properties/table-layout"; import { TableRow } from "./table-row"; @@ -154,7 +153,28 @@ describe("Table", () => { ], }); const tree = new Formatter().format(table); - const cell = { "w:tc": [{ "w:p": EMPTY_OBJECT }] }; + const cell = { + "w:tc": [ + { + "w:p": [ + { + "w:r": [ + { + "w:t": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "hello", + ], + }, + ], + }, + ], + }, + ], + }; expect(tree).to.deep.equal({ "w:tbl": [ { "w:tblPr": [DEFAULT_TABLE_PROPERTIES, BORDERS, WIDTHS] }, @@ -216,7 +236,26 @@ describe("Table", () => { .to.be.an("array") .which.has.length.at.least(1); expect(row["w:tr"].find((x) => x["w:tc"])).to.deep.equal({ - "w:tc": [{ "w:p": EMPTY_OBJECT }], + "w:tc": [ + { + "w:p": [ + { + "w:r": [ + { + "w:t": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "hello", + ], + }, + ], + }, + ], + }, + ], }); }); From 2842619196fc8811f01ddf8a276c12f9de17e409 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Wed, 25 Sep 2019 01:59:30 +0100 Subject: [PATCH 21/57] Update table documentation --- docs/usage/tables.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/usage/tables.md b/docs/usage/tables.md index 81dbc7e818..e3230c7293 100644 --- a/docs/usage/tables.md +++ b/docs/usage/tables.md @@ -128,7 +128,9 @@ const tableRow = new TableRow({ Once you have got the cell, you can add data to it with the `add()` method. ```ts -cell.add(new Paragraph("Hello")); +new TableCell({ + children: [new Paragraph("Hello")], +}), ``` ### Set width of a cell @@ -312,9 +314,9 @@ Example showing how align text in a table cell _Source: https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts_ -### Merging rows +### Shading -Example showing merging of `rows` +Example showing merging of columns and rows and shading [Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/32-merge-table-cells.ts ':include') @@ -326,7 +328,7 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/41-merge-table-cells- ### Merging columns -Example showing merging of `columns` +Example showing merging of columns and rows [Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/43-images-to-table-cell-2.ts ':include') From bd888219fcaf25e532e44c158dcdf5a5fa1e16eb Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 26 Sep 2019 02:03:17 +0100 Subject: [PATCH 22/57] Amend table documentation --- docs/usage/tables.md | 340 ++++++++++-------- .../table/table-cell/table-cell-components.ts | 10 +- .../table-cell/table-cell-properties.spec.ts | 4 +- .../table/table-cell/table-cell-properties.ts | 15 +- src/file/table/table-cell/table-cell.ts | 6 +- src/file/table/table.ts | 21 +- 6 files changed, 229 insertions(+), 167 deletions(-) diff --git a/docs/usage/tables.md b/docs/usage/tables.md index e3230c7293..ece0f6930d 100644 --- a/docs/usage/tables.md +++ b/docs/usage/tables.md @@ -4,6 +4,10 @@ ## Intro +* `Tables` contain a list of `Rows` +* `Rows` contain a list of `TableCells` +* `TableCells` contain a list of `Parahraphs` and/or `Tables`. You can add `Tables` as tables can be nested inside each other + Create a simple table like so: ```ts @@ -20,6 +24,46 @@ doc.addSection({ }); ``` +## Table + +### Set Width + +```ts +const table = new Table({ + ..., + width: { + size: [TABLE_WIDTH], + type: WidthType, + } +}); +``` + +For example: + +```ts + +const table = new Table({ + ..., + width: { + size: 4535, + type: WidthType.DXA, + } +}); +``` + +### Pagination + +#### Prevent row pagination + +To prevent breaking contents of a row across multiple pages, call `cantSplit`: + +```ts +const table = new Table({ + rows: [], + cantSplit: true, +}); +``` + ## Table Row A table consists of multiple `table rows`. Table rows have a list of `children` which accepts a list of `table cells` explained below. You can create a simple `table row` like so: @@ -61,7 +105,18 @@ Here is a list of options you can add to the `table row`: | tableHeader | `boolean` | Optional | | height | `{ value: number, rule: HeightRule }` | Optional | -## Cells +### Repeat row + +If a table is paginated on multiple pages, it is possible to repeat a row at the top of each new page by setting `tableHeader` to `true`: + +```ts +const row = new TableRow({ + ..., + tableHeader: true, +}); +``` + +## Table Cells Cells need to be added in the `table row`, you can create a table cell like: @@ -83,206 +138,197 @@ const tableRow = new TableRow({ }); ``` -| Property | Type | Notes | -| ----------- | ------------------------------------- | -------- | -| children | `Array` | Required | -| cantSplit | `boolean` | Optional | -| tableHeader | `boolean` | Optional | -| height | `{ value: number, rule: HeightRule }` | Optional | - ### Options - readonly shading?: ITableShadingAttributesProperties; - readonly margins?: ITableCellMarginOptions; - readonly verticalAlign?: VerticalAlign; - readonly verticalMerge?: VMergeType; - readonly columnSpan?: number; - readonly borders?: { - readonly top?: { - readonly style: BorderStyle; - readonly size: number; - readonly color: string; - }; - readonly bottom?: { - readonly style: BorderStyle; - readonly size: number; - readonly color: string; - }; - readonly left?: { - readonly style: BorderStyle; - readonly size: number; - readonly color: string; - }; - readonly right?: { - readonly style: BorderStyle; - readonly size: number; - readonly color: string; - }; - }; - readonly children: Array; +| Property | Type | Notes | +| ------------- | ----------------------------------- | ----------------------------------------------------------- | +| children | `Array` | Required. You can nest tables by adding a table into a cell | +| shading | `ITableShadingAttributesProperties` | Optional | +| margins | `ITableCellMarginOptions` | Optional | +| verticalAlign | `VerticalAlign` | Optional | +| columnSpan | `number` | Optional | +| rowSpan | `number` | Optional | +| borders | `BorderOptions` | Optional | +| width | `{ size: number type: WidthType }` | Optional | +#### Border Options +| Property | Type | Notes | +| -------- | ----------------------------------------------------- | -------- | +| top | `{ style: BorderStyle, size: number, color: string }` | Optional | +| bottom | `{ style: BorderStyle, size: number, color: string }` | Optional | +| left | `{ style: BorderStyle, size: number, color: string }` | Optional | +| right | `{ style: BorderStyle, size: number, color: string }` | Optional | + +##### Example + +```ts +const cell = new TableCell({ + ..., + borders: { + top: { + style: BorderStyle.DASH_DOT_STROKED, + size: 1, + color: "red", + }, + bottom: { + style: BorderStyle.THICK_THIN_MEDIUM_GAP, + size: 5, + color: "889900", + }, + }, +}); +``` + +##### Google DOCS + +Google DOCS does not support start and end borders, instead they use left and right borders. So to set left and right borders for Google DOCS you should use: + +```ts +const cell = new TableCell({ + ..., + borders: { + top: { + style: BorderStyle.DOT_DOT_DASH, + size: 3, + color: "green", + }, + bottom: { + style: BorderStyle.DOT_DOT_DASH, + size: 3, + color: "ff8000", + }, + }, +}); +``` ### Add paragraph to a cell -Once you have got the cell, you can add data to it with the `add()` method. +Once you have got the cell, you can add data to it: ```ts -new TableCell({ +const cell = new TableCell({ children: [new Paragraph("Hello")], -}), +}); ``` ### Set width of a cell You can specify the width of a cell using: -`cell.Properties.setWidth(width, format)` +```ts +const cell = new TableCell({ + ..., + width: { + size: number, + type: WidthType, + }, +}); +``` -format can be: +`WidthType` values can be: -- WidthType.AUTO -- WidthType.DXA: value is in twentieths of a point -- WidthType.NIL: is considered as zero -- WidthType.PCT: percent of table width +| Property | Notes | +| -------- | --------------------------------- | +| AUTO | | +| DXA | value is in twentieths of a point | +| NIL | is considered as zero | +| PCT | percent of table width | -### Example +#### Example ```ts cell.Properties.setWidth(100, WidthType.DXA); ``` -```ts -cell.Properties.setWidth("50%", WidthType.PCT); -``` +### Nested Tables -## Borders - -BorderStyle can be imported from `docx`. Size determines the thickness. HTML color can be a hex code or alias such as `red`. +To have a table within a table, simply add it in the `children` block of a `table cell`: ```ts -cell.Borders.addTopBorder([BorderStyle], [SIZE], [HTML COLOR]); +const cell = new TableCell({ + children: [new Table(...)], +}); ``` -```ts -cell.Borders.addBottomBorder([BorderStyle], [SIZE], [HTML COLOR]); -``` - -```ts -cell.Borders.addStartBorder([[BorderStyle]], [SIZE], [HTML COLOR]); -``` - -```ts -cell.Borders.addEndBorder([BorderStyle], [SIZE], [HTML COLOR]); -``` - -### Example - -```ts -import { BorderStyle } from "docx"; - -cell.Borders.addStartBorder(BorderStyle.DOT_DOT_DASH, 3, "green"); -cell.Borders.addEndBorder(BorderStyle.DOT_DOT_DASH, 3, "#ff8000"); -``` - -### Google DOCS - -Google DOCS does not support start and end borders, instead they use left and right borders. So to set left and right borders for Google DOCS you should use: - -```ts -import { BorderStyle } from "docx"; - -cell.Borders.addLeftBorder(BorderStyle.DOT_DOT_DASH, 3, "green"); -cell.Borders.addRightBorder(BorderStyle.DOT_DOT_DASH, 3, "#ff8000"); -``` - -## Set Width - -```ts -import { WidthType } from "docx"; - -table.setWidth([WIDTH], [OPTIONAL WidthType. Defaults to DXA]); -``` - -For example: - -```ts -table.setWidth(4535, WidthType.DXA); -``` - -## Vertical Align +### Vertical Align Sets the vertical alignment of the contents of the cell ```ts -import { VerticalAlign } from "docx"; - -cell.setVerticalAlign([VerticalAlign TYPE]); +const cell = new TableCell({ + ..., + verticalAlign: VerticalAlign, +}); ``` +`VerticalAlign` values can be: + +| Property | Notes | +| -------- | ------------------------------------------ | +| BOTTOM | Align the contents on the bottom | +| CENTER | Align the contents on the center | +| TOP | Align the contents on the top. The default | + For example, to center align a cell: ```ts -cell.setVerticalAlign(VerticalAlign.CENTER); +const cell = new TableCell({ + verticalAlign: VerticalAlign.CENTER, +}); ``` -## Rows +## Merging cells together -To get a row, use the `getRow` method on a `table`. There are a handful of methods which you can apply to a row which will be explained below. +### Row Merge + +When cell rows are merged, it counts as multiple rows, so be sure to remove excess cells. It is similar to how HTML's `rowspan` works. +https://www.w3schools.com/tags/att_td_rowspan.asp ```ts -table.getRow([ROW INDEX]); -``` - -## Merge cells together - -### Merging on a row - -First obtain the row, and call `mergeCells()`. The first argument is where the merge should start. The second argument is where the merge should end. - -```ts -table.getRow(0).mergeCells([FROM INDEX], [TO INDEX]); +const cell = new TableCell({ + ..., + rowSpan: [NUMBER_OF_CELLS_TO_MERGE], +}); ``` #### Example -This will merge 3 cells together starting from index `0`: +The example will merge three rows together. ```ts -table.getRow(0).mergeCells(0, 2); +const cell = new TableCell({ + ..., + rowSpan: 3, +}); ``` -### Merging on a column +### Column Merge -It has not been implemented yet, but it will follow a similar structure as merging a row. - -## Nested Tables - -To have a table within a table +When cell columns are merged, it counts as multiple columns, so be sure to remove excess cells. It is similar to how HTML's `colspan` works. +https://www.w3schools.com/tags/att_td_colspan.asp ```ts -cell.add(new Table(1, 1)); +const cell = new TableCell({ + ..., + columnSpan: [NUMBER_OF_CELLS_TO_MERGE], +}); ``` -## Pagination +#### Example -###Prevent row pagination -To prevent breaking contents of a row across multiple pages, call `cantSplit()`: +The example will merge three columns together. ```ts -table.getRow(0).setCantSplit(); -``` - -###Repeat row -If a table is paginated on multiple pages, it is possible to repeat a row at the top of each new page calling `setTableHeader()`: - -```ts -table.getRow(0).setTableHeader(); +const cell = new TableCell({ + ..., + columnSpan: 3, +}); ``` ## Examples -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/4-basic-table.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/4-basic-table.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/4-basic-table.ts_ @@ -290,7 +336,7 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/4-basic-table.ts_ Example showing how to add colourful borders to tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/20-table-cell-borders.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/20-table-cell-borders.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/20-table-cell-borders.ts_ @@ -298,11 +344,11 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/20-table-cell-borders Example showing how to add images to tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/24-images-to-table-cell.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/24-images-to-table-cell.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/24-images-to-table-cell.ts_ -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/36-image-to-table-cell.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/36-image-to-table-cell.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/36-image-to-table-cell.ts_ @@ -310,19 +356,19 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/36-image-to-table-cel Example showing how align text in a table cell -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/31-tables.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/31-tables.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts_ -### Shading +### Shading Example showing merging of columns and rows and shading -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/32-merge-table-cells.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/32-merge-table-cells.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/32-merge-table-cells.ts_ -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/41-merge-table-cells-2.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/41-merge-table-cells-2.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/41-merge-table-cells-2.ts_ @@ -330,12 +376,12 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/41-merge-table-cells- Example showing merging of columns and rows -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/43-images-to-table-cell-2.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/43-images-to-table-cell-2.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/43-images-to-table-cell-2.ts_ ### Floating tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/34-floating-tables.ts ':include') +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/34-floating-tables.ts ":include") _Source: https://github.com/dolanmiu/docx/blob/master/demo/34-floating-tables.ts_ diff --git a/src/file/table/table-cell/table-cell-components.ts b/src/file/table/table-cell/table-cell-components.ts index 518b8a67b2..e16c2f6885 100644 --- a/src/file/table/table-cell/table-cell-components.ts +++ b/src/file/table/table-cell/table-cell-components.ts @@ -103,7 +103,7 @@ export class GridSpan extends XmlComponent { /** * Vertical merge types. */ -export enum VMergeType { +export enum VerticalMergeType { /** * Cell that is merged with upper one. */ @@ -114,19 +114,19 @@ export enum VMergeType { RESTART = "restart", } -class VMergeAttributes extends XmlAttributeComponent<{ readonly val: VMergeType }> { +class VerticalMergeAttributes extends XmlAttributeComponent<{ readonly val: VerticalMergeType }> { protected readonly xmlKeys = { val: "w:val" }; } /** * Vertical merge element. Should be used in a table cell. */ -export class VMerge extends XmlComponent { - constructor(value: VMergeType) { +export class VerticalMerge extends XmlComponent { + constructor(value: VerticalMergeType) { super("w:vMerge"); this.root.push( - new VMergeAttributes({ + new VerticalMergeAttributes({ val: value, }), ); diff --git a/src/file/table/table-cell/table-cell-properties.spec.ts b/src/file/table/table-cell/table-cell-properties.spec.ts index 65bfd92fe6..9835aa9623 100644 --- a/src/file/table/table-cell/table-cell-properties.spec.ts +++ b/src/file/table/table-cell/table-cell-properties.spec.ts @@ -3,7 +3,7 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; import { BorderStyle } from "file/styles"; -import { VerticalAlign, VMergeType, WidthType } from "./table-cell-components"; +import { VerticalAlign, VerticalMergeType, WidthType } from "./table-cell-components"; import { TableCellProperties } from "./table-cell-properties"; describe("TableCellProperties", () => { @@ -30,7 +30,7 @@ describe("TableCellProperties", () => { describe("#addVerticalMerge", () => { it("adds vertical merge", () => { const properties = new TableCellProperties(); - properties.addVerticalMerge(VMergeType.CONTINUE); + properties.addVerticalMerge(VerticalMergeType.CONTINUE); const tree = new Formatter().format(properties); expect(tree).to.deep.equal({ "w:tcPr": [{ "w:vMerge": { _attr: { "w:val": "continue" } } }] }); }); diff --git a/src/file/table/table-cell/table-cell-properties.ts b/src/file/table/table-cell/table-cell-properties.ts index 5a2544b9cd..aed56aaeda 100644 --- a/src/file/table/table-cell/table-cell-properties.ts +++ b/src/file/table/table-cell/table-cell-properties.ts @@ -2,7 +2,16 @@ import { IgnoreIfEmptyXmlComponent } from "file/xml-components"; import { ITableShadingAttributesProperties, TableShading } from "../shading"; import { ITableCellMarginOptions, TableCellMargin } from "./cell-margin/table-cell-margins"; -import { GridSpan, TableCellBorders, TableCellWidth, VAlign, VerticalAlign, VMerge, VMergeType, WidthType } from "./table-cell-components"; +import { + GridSpan, + TableCellBorders, + TableCellWidth, + VAlign, + VerticalAlign, + VerticalMerge, + VerticalMergeType, + WidthType, +} from "./table-cell-components"; export class TableCellProperties extends IgnoreIfEmptyXmlComponent { private readonly cellBorder: TableCellBorders; @@ -23,8 +32,8 @@ export class TableCellProperties extends IgnoreIfEmptyXmlComponent { return this; } - public addVerticalMerge(type: VMergeType): TableCellProperties { - this.root.push(new VMerge(type)); + public addVerticalMerge(type: VerticalMergeType): TableCellProperties { + this.root.push(new VerticalMerge(type)); return this; } diff --git a/src/file/table/table-cell/table-cell.ts b/src/file/table/table-cell/table-cell.ts index 616065a0c1..5c34d17903 100644 --- a/src/file/table/table-cell/table-cell.ts +++ b/src/file/table/table-cell/table-cell.ts @@ -6,14 +6,14 @@ import { IXmlableObject, XmlComponent } from "file/xml-components"; import { ITableShadingAttributesProperties } from "../shading"; import { Table } from "../table"; import { ITableCellMarginOptions } from "./cell-margin/table-cell-margins"; -import { VerticalAlign, VMergeType } from "./table-cell-components"; +import { VerticalAlign, VerticalMergeType } from "./table-cell-components"; import { TableCellProperties } from "./table-cell-properties"; export interface ITableCellOptions { readonly shading?: ITableShadingAttributesProperties; readonly margins?: ITableCellMarginOptions; readonly verticalAlign?: VerticalAlign; - readonly verticalMerge?: VMergeType; + readonly verticalMerge?: VerticalMergeType; readonly columnSpan?: number; readonly rowSpan?: number; readonly borders?: { @@ -75,7 +75,7 @@ export class TableCell extends XmlComponent { } if (options.rowSpan && options.rowSpan > 1) { - this.properties.addVerticalMerge(VMergeType.RESTART); + this.properties.addVerticalMerge(VerticalMergeType.RESTART); } if (options.borders) { diff --git a/src/file/table/table.ts b/src/file/table/table.ts index 64e276f73d..08bd47eda2 100644 --- a/src/file/table/table.ts +++ b/src/file/table/table.ts @@ -1,7 +1,7 @@ // http://officeopenxml.com/WPtableGrid.php import { XmlComponent } from "file/xml-components"; import { TableGrid } from "./grid"; -import { TableCell, VMergeType, WidthType } from "./table-cell"; +import { TableCell, VerticalMergeType, WidthType } from "./table-cell"; import { ITableFloatOptions, TableProperties } from "./table-properties"; import { TableLayoutType } from "./table-properties/table-layout"; import { TableRow } from "./table-row"; @@ -18,8 +18,10 @@ import { TableRow } from "./table-row"; */ export interface ITableOptions { readonly rows: TableRow[]; - readonly width?: number; - readonly widthUnitType?: WidthType; + readonly width?: { + readonly size: number; + readonly type?: WidthType; + }; readonly columnWidths?: number[]; readonly margins?: { readonly marginUnitType?: WidthType; @@ -37,8 +39,7 @@ export class Table extends XmlComponent { constructor({ rows, - width = 100, - widthUnitType = WidthType.AUTO, + width, columnWidths = Array(Math.max(...rows.map((row) => row.CellCount))).fill(100), margins: { marginUnitType, top, bottom, right, left } = { marginUnitType: WidthType.AUTO, top: 0, bottom: 0, right: 0, left: 0 }, float, @@ -48,7 +49,13 @@ export class Table extends XmlComponent { this.properties = new TableProperties(); this.root.push(this.properties); this.properties.setBorder(); - this.properties.setWidth(width, widthUnitType); + + if (width) { + this.properties.setWidth(width.size, width.type); + } else { + this.properties.setWidth(100); + } + this.properties.CellMargin.addBottomMargin(bottom || 0, marginUnitType); this.properties.CellMargin.addTopMargin(top || 0, marginUnitType); this.properties.CellMargin.addLeftMargin(left || 0, marginUnitType); @@ -73,7 +80,7 @@ export class Table extends XmlComponent { rows[i].addCellToIndex( new TableCell({ children: [], - verticalMerge: VMergeType.CONTINUE, + verticalMerge: VerticalMergeType.CONTINUE, }), i, ); From 44b95f2f1567fd320860c1ef0d70c116cc0b737a Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 26 Sep 2019 02:14:52 +0100 Subject: [PATCH 23/57] Add shading test --- .../table-properties/table-properties.spec.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/file/table/table-properties/table-properties.spec.ts b/src/file/table/table-properties/table-properties.spec.ts index dbd1c6b371..960d117b7c 100644 --- a/src/file/table/table-properties/table-properties.spec.ts +++ b/src/file/table/table-properties/table-properties.spec.ts @@ -2,6 +2,7 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; +import { ShadingType } from "../shading"; import { WidthType } from "../table-cell"; import { TableLayoutType } from "./table-layout"; import { TableProperties } from "./table-properties"; @@ -66,4 +67,29 @@ describe("TableProperties", () => { }); }); }); + + describe("#setShading", () => { + it("sets the shading of the table", () => { + const tp = new TableProperties(); + tp.setShading({ + fill: "b79c2f", + val: ShadingType.REVERSE_DIAGONAL_STRIPE, + color: "auto", + }); + const tree = new Formatter().format(tp); + expect(tree).to.deep.equal({ + "w:tblPr": [ + { + "w:shd": { + _attr: { + "w:color": "auto", + "w:fill": "b79c2f", + "w:val": "reverseDiagStripe", + }, + }, + }, + ], + }); + }); + }); }); From c5eb3d567083b1571452615c057e17145a611c5f Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 26 Sep 2019 02:24:43 +0100 Subject: [PATCH 24/57] Add addMargin test --- .../table-cell/table-cell-properties.spec.ts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/file/table/table-cell/table-cell-properties.spec.ts b/src/file/table/table-cell/table-cell-properties.spec.ts index 9835aa9623..c3452e757c 100644 --- a/src/file/table/table-cell/table-cell-properties.spec.ts +++ b/src/file/table/table-cell/table-cell-properties.spec.ts @@ -73,6 +73,54 @@ describe("TableCellProperties", () => { }); }); + describe("#addMargins", () => { + it("sets shading", () => { + const properties = new TableCellProperties(); + properties.addMargins({}); + const tree = new Formatter().format(properties); + expect(tree).to.deep.equal({ + "w:tcPr": [ + { + "w:tcMar": [ + { + "w:top": { + _attr: { + "w:type": "dxa", + "w:w": 0, + }, + }, + }, + { + "w:bottom": { + _attr: { + "w:type": "dxa", + "w:w": 0, + }, + }, + }, + { + "w:end": { + _attr: { + "w:type": "dxa", + "w:w": 0, + }, + }, + }, + { + "w:start": { + _attr: { + "w:type": "dxa", + "w:w": 0, + }, + }, + }, + ], + }, + ], + }); + }); + }); + describe("#Borders", () => { it("should return the TableCellBorders if Border has borders", () => { const properties = new TableCellProperties(); From 172c333357072449cc6cc3a0d75a21dde3158c50 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 29 Sep 2019 04:17:21 +0100 Subject: [PATCH 25/57] Add tests and clean up code --- .../footer-reference/footer-reference.spec.ts | 42 +++ .../header-reference/header-reference.spec.ts | 42 +++ .../section-properties.spec.ts | 1 + src/file/footer-wrapper.spec.ts | 9 - src/file/footer-wrapper.ts | 7 +- src/file/footer/footer.spec.ts | 47 +++ src/file/header-wrapper.spec.ts | 11 - src/file/header-wrapper.ts | 7 +- src/file/header/header.spec.ts | 58 +++ src/file/media/image.ts | 13 - src/file/media/index.ts | 1 - src/file/media/media.spec.ts | 10 + src/file/paragraph/formatting/border.spec.ts | 93 ++++- src/file/paragraph/image.spec.ts | 39 -- src/file/paragraph/image.ts | 18 - src/file/paragraph/index.ts | 1 - src/file/paragraph/paragraph.ts | 8 - src/file/table/table-cell/table-cell.spec.ts | 333 +++++++++++++++++- .../table-cell-margin.spec.ts | 36 +- src/file/table/table-row/table-row.spec.ts | 128 ++++++- src/file/table/table.spec.ts | 41 ++- 21 files changed, 797 insertions(+), 148 deletions(-) create mode 100644 src/file/document/body/section-properties/footer-reference/footer-reference.spec.ts create mode 100644 src/file/document/body/section-properties/header-reference/header-reference.spec.ts create mode 100644 src/file/footer/footer.spec.ts create mode 100644 src/file/header/header.spec.ts delete mode 100644 src/file/media/image.ts delete mode 100644 src/file/paragraph/image.spec.ts delete mode 100644 src/file/paragraph/image.ts diff --git a/src/file/document/body/section-properties/footer-reference/footer-reference.spec.ts b/src/file/document/body/section-properties/footer-reference/footer-reference.spec.ts new file mode 100644 index 0000000000..50570b4b77 --- /dev/null +++ b/src/file/document/body/section-properties/footer-reference/footer-reference.spec.ts @@ -0,0 +1,42 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; +import { FooterReference } from "./footer-reference"; +import { FooterReferenceType } from "./footer-reference-attributes"; + +describe("footerReference", () => { + it("should create", () => { + const footer = new FooterReference({ + footerType: FooterReferenceType.DEFAULT, + footerId: 1, + }); + + const tree = new Formatter().format(footer); + + expect(tree).to.deep.equal({ + "w:footerReference": { + _attr: { + "r:id": "rId1", + "w:type": "default", + }, + }, + }); + }); + + it("should create without a footer type", () => { + const footer = new FooterReference({ + footerId: 1, + }); + + const tree = new Formatter().format(footer); + + expect(tree).to.deep.equal({ + "w:footerReference": { + _attr: { + "r:id": "rId1", + "w:type": "default", + }, + }, + }); + }); +}); diff --git a/src/file/document/body/section-properties/header-reference/header-reference.spec.ts b/src/file/document/body/section-properties/header-reference/header-reference.spec.ts new file mode 100644 index 0000000000..2d6b39e553 --- /dev/null +++ b/src/file/document/body/section-properties/header-reference/header-reference.spec.ts @@ -0,0 +1,42 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; +import { HeaderReference } from "./header-reference"; +import { HeaderReferenceType } from "./header-reference-attributes"; + +describe("HeaderReference", () => { + it("should create", () => { + const footer = new HeaderReference({ + headerType: HeaderReferenceType.DEFAULT, + headerId: 1, + }); + + const tree = new Formatter().format(footer); + + expect(tree).to.deep.equal({ + "w:headerReference": { + _attr: { + "r:id": "rId1", + "w:type": "default", + }, + }, + }); + }); + + it("should create without a header type", () => { + const footer = new HeaderReference({ + headerId: 1, + }); + + const tree = new Formatter().format(footer); + + expect(tree).to.deep.equal({ + "w:headerReference": { + _attr: { + "r:id": "rId1", + "w:type": "default", + }, + }, + }); + }); +}); diff --git a/src/file/document/body/section-properties/section-properties.spec.ts b/src/file/document/body/section-properties/section-properties.spec.ts index 31828ff5f4..abdbf9e1ed 100644 --- a/src/file/document/body/section-properties/section-properties.spec.ts +++ b/src/file/document/body/section-properties/section-properties.spec.ts @@ -38,6 +38,7 @@ describe("SectionProperties", () => { }, pageNumberStart: 10, pageNumberFormatType: PageNumberFormat.CARDINAL_TEXT, + titlePage: true, }); const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); diff --git a/src/file/footer-wrapper.spec.ts b/src/file/footer-wrapper.spec.ts index 899bd22e70..4f3e95acdb 100644 --- a/src/file/footer-wrapper.spec.ts +++ b/src/file/footer-wrapper.spec.ts @@ -35,15 +35,6 @@ describe("FooterWrapper", () => { expect(spy.called).to.equal(true); }); - - it("should call the underlying footer's addImage", () => { - const file = new FooterWrapper(new Media(), 1); - const spy = sinon.spy(file.Footer, "add"); - // tslint:disable-next-line:no-any - file.addImage({} as any); - - expect(spy.called).to.equal(true); - }); }); describe("#addChildElement", () => { diff --git a/src/file/footer-wrapper.ts b/src/file/footer-wrapper.ts index 01087e9861..8390887ba4 100644 --- a/src/file/footer-wrapper.ts +++ b/src/file/footer-wrapper.ts @@ -2,7 +2,7 @@ import { XmlComponent } from "file/xml-components"; import { FooterReferenceType } from "./document"; import { Footer } from "./footer/footer"; -import { Image, Media } from "./media"; +import { Media } from "./media"; import { Paragraph } from "./paragraph"; import { Relationships } from "./relationships"; import { Table } from "./table"; @@ -25,11 +25,6 @@ export class FooterWrapper { this.footer.add(item); } - public addImage(image: Image): FooterWrapper { - this.footer.add(image.Paragraph); - return this; - } - public addChildElement(childElement: XmlComponent): void { this.footer.addChildElement(childElement); } diff --git a/src/file/footer/footer.spec.ts b/src/file/footer/footer.spec.ts new file mode 100644 index 0000000000..4f970a119a --- /dev/null +++ b/src/file/footer/footer.spec.ts @@ -0,0 +1,47 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; + +import { Paragraph } from "../paragraph"; +import { Footer } from "./footer"; + +describe("Footer", () => { + it("should create", () => { + const footer = new Footer(1); + + const tree = new Formatter().format(footer); + + expect(tree).to.deep.equal({ + "w:ftr": { + _attr: { + "xmlns:m": "http://schemas.openxmlformats.org/officeDocument/2006/math", + "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", + "xmlns:o": "urn:schemas-microsoft-com:office:office", + "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", + "xmlns:v": "urn:schemas-microsoft-com:vml", + "xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main", + "xmlns:w10": "urn:schemas-microsoft-com:office:word", + "xmlns:w14": "http://schemas.microsoft.com/office/word/2010/wordml", + "xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml", + "xmlns:wne": "http://schemas.microsoft.com/office/word/2006/wordml", + "xmlns:wp": "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", + "xmlns:wp14": "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing", + "xmlns:wpc": "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", + "xmlns:wpg": "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup", + "xmlns:wpi": "http://schemas.microsoft.com/office/word/2010/wordprocessingInk", + "xmlns:wps": "http://schemas.microsoft.com/office/word/2010/wordprocessingShape", + }, + }, + }); + }); + + it("should create with initContent", () => { + const header = new Footer(1, new Paragraph({})); + + const tree = new Formatter().format(header); + + expect(tree).to.deep.equal({ + "w:ftr": {}, + }); + }); +}); diff --git a/src/file/header-wrapper.spec.ts b/src/file/header-wrapper.spec.ts index 7c3073a094..00ee776a95 100644 --- a/src/file/header-wrapper.spec.ts +++ b/src/file/header-wrapper.spec.ts @@ -37,17 +37,6 @@ describe("HeaderWrapper", () => { }); }); - describe("#addImage", () => { - it("should call the underlying header's addImage", () => { - const file = new HeaderWrapper(new Media(), 1); - const spy = sinon.spy(file.Header, "add"); - // tslint:disable-next-line:no-any - file.addImage({} as any); - - expect(spy.called).to.equal(true); - }); - }); - describe("#addChildElement", () => { it("should call the underlying header's addChildElement", () => { const file = new HeaderWrapper(new Media(), 1); diff --git a/src/file/header-wrapper.ts b/src/file/header-wrapper.ts index d698505e4a..407399a8fe 100644 --- a/src/file/header-wrapper.ts +++ b/src/file/header-wrapper.ts @@ -2,7 +2,7 @@ import { XmlComponent } from "file/xml-components"; import { HeaderReferenceType } from "./document"; import { Header } from "./header/header"; -import { Image, Media } from "./media"; +import { Media } from "./media"; import { Paragraph } from "./paragraph"; import { Relationships } from "./relationships"; import { Table } from "./table"; @@ -27,11 +27,6 @@ export class HeaderWrapper { return this; } - public addImage(image: Image): HeaderWrapper { - this.header.add(image.Paragraph); - return this; - } - public addChildElement(childElement: XmlComponent | string): void { this.header.addChildElement(childElement); } diff --git a/src/file/header/header.spec.ts b/src/file/header/header.spec.ts new file mode 100644 index 0000000000..651c21b545 --- /dev/null +++ b/src/file/header/header.spec.ts @@ -0,0 +1,58 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; + +import { Paragraph } from "../paragraph"; +import { Header } from "./header"; + +describe("Header", () => { + it("should create", () => { + const header = new Header(1); + + const tree = new Formatter().format(header); + + expect(tree).to.deep.equal({ + "w:hdr": { + _attr: { + "xmlns:cx": "http://schemas.microsoft.com/office/drawing/2014/chartex", + "xmlns:cx1": "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex", + "xmlns:cx2": "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex", + "xmlns:cx3": "http://schemas.microsoft.com/office/drawing/2016/5/9/chartex", + "xmlns:cx4": "http://schemas.microsoft.com/office/drawing/2016/5/10/chartex", + "xmlns:cx5": "http://schemas.microsoft.com/office/drawing/2016/5/11/chartex", + "xmlns:cx6": "http://schemas.microsoft.com/office/drawing/2016/5/12/chartex", + "xmlns:cx7": "http://schemas.microsoft.com/office/drawing/2016/5/13/chartex", + "xmlns:cx8": "http://schemas.microsoft.com/office/drawing/2016/5/14/chartex", + "xmlns:m": "http://schemas.openxmlformats.org/officeDocument/2006/math", + "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", + "xmlns:o": "urn:schemas-microsoft-com:office:office", + "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", + "xmlns:v": "urn:schemas-microsoft-com:vml", + "xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main", + "xmlns:w10": "urn:schemas-microsoft-com:office:word", + "xmlns:w14": "http://schemas.microsoft.com/office/word/2010/wordml", + "xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml", + "xmlns:w16cid": "http://schemas.microsoft.com/office/word/2016/wordml/cid", + "xmlns:w16se": "http://schemas.microsoft.com/office/word/2015/wordml/symex", + "xmlns:wne": "http://schemas.microsoft.com/office/word/2006/wordml", + "xmlns:wp": "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", + "xmlns:wp14": "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing", + "xmlns:wpc": "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas", + "xmlns:wpg": "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup", + "xmlns:wpi": "http://schemas.microsoft.com/office/word/2010/wordprocessingInk", + "xmlns:wps": "http://schemas.microsoft.com/office/word/2010/wordprocessingShape", + }, + }, + }); + }); + + it("should create with initContent", () => { + const header = new Header(1, new Paragraph({})); + + const tree = new Formatter().format(header); + + expect(tree).to.deep.equal({ + "w:hdr": {}, + }); + }); +}); diff --git a/src/file/media/image.ts b/src/file/media/image.ts deleted file mode 100644 index 8255fe7398..0000000000 --- a/src/file/media/image.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ImageParagraph, PictureRun } from "../paragraph"; - -export class Image { - constructor(private readonly paragraph: ImageParagraph) {} - - public get Paragraph(): ImageParagraph { - return this.paragraph; - } - - public get Run(): PictureRun { - return this.paragraph.Run; - } -} diff --git a/src/file/media/index.ts b/src/file/media/index.ts index 2ccc436e68..3575274e26 100644 --- a/src/file/media/index.ts +++ b/src/file/media/index.ts @@ -1,3 +1,2 @@ export * from "./media"; export * from "./data"; -export * from "./image"; diff --git a/src/file/media/media.spec.ts b/src/file/media/media.spec.ts index b7ce0c106c..e566213ee5 100644 --- a/src/file/media/media.spec.ts +++ b/src/file/media/media.spec.ts @@ -80,6 +80,16 @@ describe("Media", () => { const image = new Media().addMedia(""); expect(image.stream).to.be.an.instanceof(Uint8Array); }); + + it("should use data as is if its not a string", () => { + // tslint:disable-next-line + ((process as any).atob as any) = () => "atob result"; + // tslint:disable-next-line:no-any + (Media as any).generateId = () => "test"; + + const image = new Media().addMedia(new Buffer("")); + expect(image.stream).to.be.an.instanceof(Uint8Array); + }); }); describe("#getMedia", () => { diff --git a/src/file/paragraph/formatting/border.spec.ts b/src/file/paragraph/formatting/border.spec.ts index f07a297479..6e89ffcfc8 100644 --- a/src/file/paragraph/formatting/border.spec.ts +++ b/src/file/paragraph/formatting/border.spec.ts @@ -1,11 +1,87 @@ -import { assert, expect } from "chai"; +import { expect } from "chai"; import { Formatter } from "export/formatter"; -import { ThematicBreak } from "./border"; +import { Border, ThematicBreak } from "./border"; describe("Border", () => { - // TODO: Need tests here + describe("#constructor", () => { + it("should create", () => { + const border = new Border({ + top: { + color: "red", + space: 1, + value: "test", + size: 2, + }, + bottom: { + color: "red", + space: 3, + value: "test", + size: 4, + }, + left: { + color: "red", + space: 5, + value: "test", + size: 6, + }, + right: { + color: "red", + space: 7, + value: "test", + size: 8, + }, + }); + + const tree = new Formatter().format(border); + + expect(tree).to.deep.equal({ + "w:pBdr": [ + { + "w:top": { + _attr: { + "w:color": "red", + "w:space": 1, + "w:sz": 2, + "w:val": "test", + }, + }, + }, + { + "w:bottom": { + _attr: { + "w:color": "red", + "w:space": 3, + "w:sz": 4, + "w:val": "test", + }, + }, + }, + { + "w:left": { + _attr: { + "w:color": "red", + "w:space": 5, + "w:sz": 6, + "w:val": "test", + }, + }, + }, + { + "w:right": { + _attr: { + "w:color": "red", + "w:space": 7, + "w:sz": 8, + "w:val": "test", + }, + }, + }, + ], + }); + }); + }); }); describe("ThematicBreak", () => { @@ -16,17 +92,6 @@ describe("ThematicBreak", () => { }); describe("#constructor()", () => { - it("should create valid JSON", () => { - const stringifiedJson = JSON.stringify(thematicBreak); - - try { - JSON.parse(stringifiedJson); - } catch (e) { - assert.isTrue(false); - } - assert.isTrue(true); - }); - it("should create a Thematic Break with correct border properties", () => { const tree = new Formatter().format(thematicBreak); expect(tree).to.deep.equal({ diff --git a/src/file/paragraph/image.spec.ts b/src/file/paragraph/image.spec.ts deleted file mode 100644 index 715c1c93ab..0000000000 --- a/src/file/paragraph/image.spec.ts +++ /dev/null @@ -1,39 +0,0 @@ -// tslint:disable:object-literal-key-quotes -import { assert } from "chai"; - -import { ImageParagraph } from "./image"; - -describe("Image", () => { - let image: ImageParagraph; - - beforeEach(() => { - image = new ImageParagraph({ - stream: new Buffer(""), - path: "", - fileName: "test.png", - dimensions: { - pixels: { - x: 10, - y: 10, - }, - emus: { - x: 10, - y: 10, - }, - }, - }); - }); - - describe("#constructor()", () => { - it("should create valid JSON", () => { - const stringifiedJson = JSON.stringify(image); - - try { - JSON.parse(stringifiedJson); - } catch (e) { - assert.isTrue(false); - } - assert.isTrue(true); - }); - }); -}); diff --git a/src/file/paragraph/image.ts b/src/file/paragraph/image.ts deleted file mode 100644 index 4fa3d97b9f..0000000000 --- a/src/file/paragraph/image.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { IDrawingOptions } from "../drawing"; -import { IMediaData } from "../media"; -import { Paragraph } from "./paragraph"; -import { PictureRun } from "./run"; - -export class ImageParagraph extends Paragraph { - private readonly pictureRun: PictureRun; - - constructor(imageData: IMediaData, drawingOptions?: IDrawingOptions) { - super({}); - this.pictureRun = new PictureRun(imageData, drawingOptions); - this.root.push(this.pictureRun); - } - - public get Run(): PictureRun { - return this.pictureRun; - } -} diff --git a/src/file/paragraph/index.ts b/src/file/paragraph/index.ts index 222cb1bf4f..68a1b0b800 100644 --- a/src/file/paragraph/index.ts +++ b/src/file/paragraph/index.ts @@ -3,4 +3,3 @@ export * from "./paragraph"; export * from "./properties"; export * from "./run"; export * from "./links"; -export * from "./image"; diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index 3f39ba68bc..24c3e1717d 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -1,6 +1,5 @@ // http://officeopenxml.com/WPparagraph.php import { FootnoteReferenceRun } from "file/footnotes/footnote/run/reference-run"; -import { Image } from "file/media"; import { Num } from "file/numbering/num"; import { XmlComponent } from "file/xml-components"; @@ -190,13 +189,6 @@ export class Paragraph extends XmlComponent { return this; } - public addImage(image: Image): PictureRun { - const run = image.Run; - this.addRun(run); - - return run; - } - public pageBreak(): Paragraph { this.root.push(new PageBreak()); return this; diff --git a/src/file/table/table-cell/table-cell.spec.ts b/src/file/table/table-cell/table-cell.spec.ts index 8ac54ed85a..4dd86ffc9c 100644 --- a/src/file/table/table-cell/table-cell.spec.ts +++ b/src/file/table/table-cell/table-cell.spec.ts @@ -3,7 +3,9 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; import { BorderStyle } from "file/styles"; -import { TableCellBorders, TableCellWidth, WidthType } from "./table-cell-components"; +import { ShadingType } from "../shading"; +import { TableCell } from "./table-cell"; +import { TableCellBorders, TableCellWidth, VerticalAlign, VerticalMergeType, WidthType } from "./table-cell-components"; describe("TableCellBorders", () => { describe("#prepForXml", () => { @@ -222,3 +224,332 @@ describe("TableCellWidth", () => { }); }); }); + +describe("TableCell", () => { + describe("#constructor", () => { + it("should create", () => { + const cell = new TableCell({ + children: [], + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:p": {}, + }, + ], + }); + }); + + it("should create with vertical align", () => { + const cell = new TableCell({ + children: [], + verticalAlign: VerticalAlign.CENTER, + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:tcPr": [ + { + "w:vAlign": { + _attr: { + "w:val": "center", + }, + }, + }, + ], + }, + { + "w:p": {}, + }, + ], + }); + }); + + it("should create with vertical merge", () => { + const cell = new TableCell({ + children: [], + verticalMerge: VerticalMergeType.RESTART, + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:tcPr": [ + { + "w:vMerge": { + _attr: { + "w:val": "restart", + }, + }, + }, + ], + }, + { + "w:p": {}, + }, + ], + }); + }); + + it("should create with margins", () => { + const cell = new TableCell({ + children: [], + margins: { + top: 1, + left: 1, + bottom: 1, + right: 1, + }, + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:tcPr": [ + { + "w:tcMar": [ + { + "w:top": { + _attr: { + "w:type": "dxa", + "w:w": 1, + }, + }, + }, + { + "w:bottom": { + _attr: { + "w:type": "dxa", + "w:w": 1, + }, + }, + }, + { + "w:end": { + _attr: { + "w:type": "dxa", + "w:w": 1, + }, + }, + }, + { + "w:start": { + _attr: { + "w:type": "dxa", + "w:w": 1, + }, + }, + }, + ], + }, + ], + }, + { + "w:p": {}, + }, + ], + }); + }); + + it("should create with shading", () => { + const cell = new TableCell({ + children: [], + shading: { + fill: "red", + color: "blue", + val: ShadingType.PERCENT_10, + }, + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:tcPr": [ + { + "w:shd": { + _attr: { + "w:color": "blue", + "w:fill": "red", + "w:val": "pct10", + }, + }, + }, + ], + }, + { + "w:p": {}, + }, + ], + }); + }); + + it("should create with column span", () => { + const cell = new TableCell({ + children: [], + columnSpan: 2, + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:tcPr": [ + { + "w:gridSpan": { + _attr: { + "w:val": 2, + }, + }, + }, + ], + }, + { + "w:p": {}, + }, + ], + }); + }); + + describe("rowSpan", () => { + it("should not create with row span if its less than 1", () => { + const cell = new TableCell({ + children: [], + rowSpan: 0, + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:p": {}, + }, + ], + }); + }); + + it("should create with row span if its greater than 1", () => { + const cell = new TableCell({ + children: [], + rowSpan: 2, + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:tcPr": [ + { + "w:vMerge": { + _attr: { + "w:val": "restart", + }, + }, + }, + ], + }, + { + "w:p": {}, + }, + ], + }); + }); + + it("should create with borders", () => { + const cell = new TableCell({ + children: [], + borders: { + top: { + style: BorderStyle.DASH_DOT_STROKED, + size: 3, + color: "red", + }, + bottom: { + style: BorderStyle.DOUBLE, + size: 3, + color: "blue", + }, + left: { + style: BorderStyle.DASH_DOT_STROKED, + size: 3, + color: "green", + }, + right: { + style: BorderStyle.DASH_DOT_STROKED, + size: 3, + color: "#ff8000", + }, + }, + }); + + const tree = new Formatter().format(cell); + + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:tcPr": [ + { + "w:tcBorders": [ + { + "w:top": { + _attr: { + "w:color": "red", + "w:sz": 3, + "w:val": "dashDotStroked", + }, + }, + }, + { + "w:bottom": { + _attr: { + "w:color": "blue", + "w:sz": 3, + "w:val": "double", + }, + }, + }, + { + "w:left": { + _attr: { + "w:color": "green", + "w:sz": 3, + "w:val": "dashDotStroked", + }, + }, + }, + { + "w:right": { + _attr: { + "w:color": "#ff8000", + "w:sz": 3, + "w:val": "dashDotStroked", + }, + }, + }, + ], + }, + ], + }, + { + "w:p": {}, + }, + ], + }); + }); + }); + }); +}); diff --git a/src/file/table/table-properties/table-cell-margin.spec.ts b/src/file/table/table-properties/table-cell-margin.spec.ts index 7f0d13d218..2a89db7a4a 100644 --- a/src/file/table/table-properties/table-cell-margin.spec.ts +++ b/src/file/table/table-properties/table-cell-margin.spec.ts @@ -14,38 +14,66 @@ describe("TableCellMargin", () => { }); describe("#addTopMargin", () => { - it("adds a table cell top margin", () => { + it("should add a table cell top margin", () => { const cellMargin = new TableCellMargin(); cellMargin.addTopMargin(1234, WidthType.DXA); const tree = new Formatter().format(cellMargin); expect(tree).to.deep.equal({ "w:tblCellMar": [{ "w:top": { _attr: { "w:type": "dxa", "w:w": 1234 } } }] }); }); + + it("should add a table cell top margin using default width type", () => { + const cellMargin = new TableCellMargin(); + cellMargin.addTopMargin(1234); + const tree = new Formatter().format(cellMargin); + expect(tree).to.deep.equal({ "w:tblCellMar": [{ "w:top": { _attr: { "w:type": "dxa", "w:w": 1234 } } }] }); + }); }); describe("#addLeftMargin", () => { - it("adds a table cell left margin", () => { + it("should add a table cell left margin", () => { const cellMargin = new TableCellMargin(); cellMargin.addLeftMargin(1234, WidthType.DXA); const tree = new Formatter().format(cellMargin); expect(tree).to.deep.equal({ "w:tblCellMar": [{ "w:left": { _attr: { "w:type": "dxa", "w:w": 1234 } } }] }); }); + + it("should add a table cell left margin using default width type", () => { + const cellMargin = new TableCellMargin(); + cellMargin.addLeftMargin(1234); + const tree = new Formatter().format(cellMargin); + expect(tree).to.deep.equal({ "w:tblCellMar": [{ "w:left": { _attr: { "w:type": "dxa", "w:w": 1234 } } }] }); + }); }); describe("#addBottomMargin", () => { - it("adds a table cell bottom margin", () => { + it("should add a table cell bottom margin", () => { const cellMargin = new TableCellMargin(); cellMargin.addBottomMargin(1234, WidthType.DXA); const tree = new Formatter().format(cellMargin); expect(tree).to.deep.equal({ "w:tblCellMar": [{ "w:bottom": { _attr: { "w:type": "dxa", "w:w": 1234 } } }] }); }); + + it("should add a table cell bottom margin using default width type", () => { + const cellMargin = new TableCellMargin(); + cellMargin.addBottomMargin(1234); + const tree = new Formatter().format(cellMargin); + expect(tree).to.deep.equal({ "w:tblCellMar": [{ "w:bottom": { _attr: { "w:type": "dxa", "w:w": 1234 } } }] }); + }); }); describe("#addRightMargin", () => { - it("adds a table cell right margin", () => { + it("should add a table cell right margin", () => { const cellMargin = new TableCellMargin(); cellMargin.addRightMargin(1234, WidthType.DXA); const tree = new Formatter().format(cellMargin); expect(tree).to.deep.equal({ "w:tblCellMar": [{ "w:right": { _attr: { "w:type": "dxa", "w:w": 1234 } } }] }); }); + + it("should add a table cell right margin using default width type", () => { + const cellMargin = new TableCellMargin(); + cellMargin.addRightMargin(1234); + const tree = new Formatter().format(cellMargin); + expect(tree).to.deep.equal({ "w:tblCellMar": [{ "w:right": { _attr: { "w:type": "dxa", "w:w": 1234 } } }] }); + }); }); }); diff --git a/src/file/table/table-row/table-row.spec.ts b/src/file/table/table-row/table-row.spec.ts index 3c732c6217..e013153cd8 100644 --- a/src/file/table/table-row/table-row.spec.ts +++ b/src/file/table/table-row/table-row.spec.ts @@ -2,6 +2,7 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; +import { Paragraph } from "file/paragraph"; import { HeightRule } from "file/table/table-row/table-row-height"; import { EMPTY_OBJECT } from "file/xml-components"; import { TableCell } from "../table-cell"; @@ -41,6 +42,52 @@ describe("TableRow", () => { }); }); + it("should create with cant split", () => { + const tableRow = new TableRow({ + children: [], + cantSplit: true, + }); + const tree = new Formatter().format(tableRow); + expect(tree).to.deep.equal({ + "w:tr": [ + { + "w:trPr": [ + { + "w:cantSplit": { + _attr: { + "w:val": true, + }, + }, + }, + ], + }, + ], + }); + }); + + it("should create with table header", () => { + const tableRow = new TableRow({ + children: [], + tableHeader: true, + }); + const tree = new Formatter().format(tableRow); + expect(tree).to.deep.equal({ + "w:tr": [ + { + "w:trPr": [ + { + "w:tblHeader": { + _attr: { + "w:val": true, + }, + }, + }, + ], + }, + ], + }); + }); + it("should set row height", () => { const tableRow = new TableRow({ children: [], @@ -69,21 +116,70 @@ describe("TableRow", () => { }); }); - // describe("#mergeCells", () => { - // it("should merge the cell", () => { - // const tableRow = new TableRow({ - // children: [ - // new TableCell({ - // children: [], - // }), - // new TableCell({ - // children: [], - // }), - // ], - // }); + describe("#addCellToIndex", () => { + it("should add cell to correct index with no initial properties", () => { + const tableRow = new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("test")], + }), + ], + tableHeader: true, + }); - // tableRow.mergeCells(0, 1); - // expect(() => tableRow.getCell(1)).to.throw(); - // }); - // }); + tableRow.addCellToIndex( + new TableCell({ + children: [], + }), + 0, + ); + + const tree = new Formatter().format(tableRow); + + expect(tree).to.deep.equal({ + "w:tr": [ + { + "w:trPr": [ + { + "w:tblHeader": { + _attr: { + "w:val": true, + }, + }, + }, + ], + }, + { + "w:tc": [ + { + "w:p": {}, + }, + ], + }, + { + "w:tc": [ + { + "w:p": [ + { + "w:r": [ + { + "w:t": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "test", + ], + }, + ], + }, + ], + }, + ], + }, + ], + }); + }); + }); }); diff --git a/src/file/table/table.spec.ts b/src/file/table/table.spec.ts index b88bda964a..d2aec26051 100644 --- a/src/file/table/table.spec.ts +++ b/src/file/table/table.spec.ts @@ -8,7 +8,7 @@ import { Table } from "./table"; // import { WidthType } from "./table-cell"; import { RelativeHorizontalPosition, RelativeVerticalPosition, TableAnchorType } from "./table-properties"; -import { TableCell } from "./table-cell"; +import { TableCell, WidthType } from "./table-cell"; import { TableLayoutType } from "./table-properties/table-layout"; import { TableRow } from "./table-row"; @@ -210,6 +210,45 @@ describe("Table", () => { "w:tblPr": [DEFAULT_TABLE_PROPERTIES, BORDERS, WIDTHS, { "w:tblLayout": { _attr: { "w:type": "fixed" } } }], }); }); + + it("should set the table to provided width", () => { + const table = new Table({ + rows: [ + new TableRow({ + children: [ + new TableCell({ + children: [new Paragraph("hello")], + }), + ], + }), + ], + width: { + size: 100, + type: WidthType.PERCENTAGE, + }, + layout: TableLayoutType.FIXED, + }); + const tree = new Formatter().format(table); + expect(tree) + .to.have.property("w:tbl") + .which.is.an("array") + .with.has.length.at.least(1); + expect(tree["w:tbl"][0]).to.deep.equal({ + "w:tblPr": [ + DEFAULT_TABLE_PROPERTIES, + BORDERS, + { + "w:tblW": { + _attr: { + "w:type": "pct", + "w:w": "100%", + }, + }, + }, + { "w:tblLayout": { _attr: { "w:type": "fixed" } } }, + ], + }); + }); }); describe("Cell", () => { From 59be3812137ff8cd6d855e8deab7cdca19208bae Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 29 Sep 2019 04:25:40 +0100 Subject: [PATCH 26/57] Update travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3c015ad296..3bf1b47690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ script: - npm run ts-node -- ./demo/29-numbered-lists.ts - npm run ts-node -- ./demo/30-template-document.ts - npm run ts-node -- ./demo/31-tables.ts - - npm run ts-node -- ./demo/32-merge-table-cells.ts + - npm run ts-node -- ./demo/32-merge-and-shade-table-cells.ts # - npm run e2e "My Document.docx" // Need to fix - npm run ts-node -- ./demo/33-sequential-captions.ts - npm run ts-node -- ./demo/34-floating-tables.ts From b43ed12c8476e34cc56e33f097d85515405332ae Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 29 Sep 2019 04:38:07 +0100 Subject: [PATCH 27/57] Fix tests --- demo/32-merge-and-shade-table-cells.ts | 24 ++++++++++++++++-------- demo/34-floating-tables.ts | 6 ++++-- demo/44-multiple-columns.ts | 4 ++-- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/demo/32-merge-and-shade-table-cells.ts b/demo/32-merge-and-shade-table-cells.ts index 1112931079..77d6815d1e 100644 --- a/demo/32-merge-and-shade-table-cells.ts +++ b/demo/32-merge-and-shade-table-cells.ts @@ -58,8 +58,10 @@ const table2 = new Table({ ], }), ], - width: 100, - widthUnitType: WidthType.AUTO, + width: { + size: 100, + type: WidthType.AUTO, + }, columnWidths: [1000, 1000, 1000], }); @@ -113,8 +115,10 @@ const table3 = new Table({ ], }), ], - width: 7000, - widthUnitType: WidthType.DXA, + width: { + size: 7000, + type: WidthType.DXA, + }, margins: { top: 400, bottom: 400, @@ -152,8 +156,10 @@ const table4 = new Table({ ], }), ], - width: 100, - widthUnitType: WidthType.PERCENTAGE, + width: { + size: 100, + type: WidthType.PERCENTAGE, + }, }); const table5 = new Table({ @@ -194,8 +200,10 @@ const table5 = new Table({ ], }), ], - width: 100, - widthUnitType: WidthType.PERCENTAGE, + width: { + size: 100, + type: WidthType.PERCENTAGE, + }, }); doc.addSection({ diff --git a/demo/34-floating-tables.ts b/demo/34-floating-tables.ts index 4a20ae2eee..dadf80f9da 100644 --- a/demo/34-floating-tables.ts +++ b/demo/34-floating-tables.ts @@ -44,8 +44,10 @@ const table = new Table({ relativeHorizontalPosition: RelativeHorizontalPosition.RIGHT, relativeVerticalPosition: RelativeVerticalPosition.BOTTOM, }, - width: 4535, - widthUnitType: WidthType.DXA, + width: { + size: 4535, + type: WidthType.DXA, + }, layout: TableLayoutType.FIXED, }); diff --git a/demo/44-multiple-columns.ts b/demo/44-multiple-columns.ts index 3fdf328461..3985486620 100644 --- a/demo/44-multiple-columns.ts +++ b/demo/44-multiple-columns.ts @@ -8,7 +8,7 @@ const doc = new Document(); doc.addSection({ properties: { column: { - width: 708, + space: 708, count: 2, }, }, @@ -23,7 +23,7 @@ doc.addSection({ doc.addSection({ properties: { column: { - width: 708, + space: 708, count: 3, }, }, From 38f2638ea0c616e168e3d853bfe1f349a057f093 Mon Sep 17 00:00:00 2001 From: Dolan Date: Sun, 29 Sep 2019 04:45:30 +0100 Subject: [PATCH 28/57] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ea3be1ab15..10ca32c5c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docx", - "version": "5.0.0-rc5", + "version": "5.0.0-rc6", "description": "Generate .docx documents with JavaScript (formerly Office-Clippy)", "main": "build/index.js", "scripts": { From d2dded860d207ed08eb90bcc4372939f054c3198 Mon Sep 17 00:00:00 2001 From: Dolan Date: Mon, 30 Sep 2019 20:58:18 +0100 Subject: [PATCH 29/57] Fix example links --- docs/usage/tables.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/usage/tables.md b/docs/usage/tables.md index ece0f6930d..a8e41de58a 100644 --- a/docs/usage/tables.md +++ b/docs/usage/tables.md @@ -328,7 +328,7 @@ const cell = new TableCell({ ## Examples -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/4-basic-table.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/4-basic-table.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/4-basic-table.ts_ @@ -336,7 +336,7 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/4-basic-table.ts_ Example showing how to add colourful borders to tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/20-table-cell-borders.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/20-table-cell-borders.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/20-table-cell-borders.ts_ @@ -344,11 +344,11 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/20-table-cell-borders Example showing how to add images to tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/24-images-to-table-cell.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/24-images-to-table-cell.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/24-images-to-table-cell.ts_ -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/36-image-to-table-cell.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/36-image-to-table-cell.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/36-image-to-table-cell.ts_ @@ -356,7 +356,7 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/36-image-to-table-cel Example showing how align text in a table cell -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/31-tables.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/31-tables.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts_ @@ -364,11 +364,11 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts_ Example showing merging of columns and rows and shading -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/32-merge-table-cells.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/32-merge-and-shade-table-cells.ts ':include') -_Source: https://github.com/dolanmiu/docx/blob/master/demo/32-merge-table-cells.ts_ +_Source: https://github.com/dolanmiu/docx/blob/master/demo/32-merge-and-shade-table-cells.ts_ -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/41-merge-table-cells-2.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/41-merge-table-cells-2.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/41-merge-table-cells-2.ts_ @@ -376,12 +376,12 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/41-merge-table-cells- Example showing merging of columns and rows -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/43-images-to-table-cell-2.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/43-images-to-table-cell-2.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/43-images-to-table-cell-2.ts_ ### Floating tables -[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/34-floating-tables.ts ":include") +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/34-floating-tables.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/34-floating-tables.ts_ From 04b6d8e54ab50aee935be19884a9bf99ef3124e6 Mon Sep 17 00:00:00 2001 From: Dolan Date: Mon, 30 Sep 2019 22:56:21 +0100 Subject: [PATCH 30/57] Declarative hyperlinks, bookmarks, tab stops and page breaks --- demo/10-my-cv.ts | 6 +- demo/14-page-numbers.ts | 6 +- demo/2-declaritive-styles.ts | 18 +++-- demo/21-bookmarks.ts | 12 ++- demo/35-hyperlinks.ts | 8 +- docs/usage/paragraph.md | 9 ++- docs/usage/tab-stops.md | 78 ++++++++++++++----- docs/usage/table-of-contents.md | 24 ------ src/export/formatter.spec.ts | 55 ++++++++++--- src/file/footnotes/footnotes.ts | 6 +- src/file/numbering/level.ts | 8 +- src/file/numbering/numbering.spec.ts | 3 +- .../paragraph/formatting/tab-stop.spec.ts | 27 +------ src/file/paragraph/formatting/tab-stop.ts | 10 +-- src/file/paragraph/paragraph.spec.ts | 13 ++-- src/file/paragraph/paragraph.ts | 43 +++------- src/file/paragraph/run/run.ts | 8 ++ src/file/styles/style/paragraph-style.spec.ts | 6 +- src/file/styles/style/paragraph-style.ts | 6 +- .../table-of-contents/table-of-contents.ts | 26 ++++--- 20 files changed, 207 insertions(+), 165 deletions(-) diff --git a/demo/10-my-cv.ts b/demo/10-my-cv.ts index 6c60be4f48..75c5d9e8bd 100644 --- a/demo/10-my-cv.ts +++ b/demo/10-my-cv.ts @@ -1,7 +1,7 @@ // Generate a CV // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, TextRun } from "../build"; +import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, TabStopPosition, TextRun } from "../build"; // tslint:disable:no-shadowed-variable @@ -227,7 +227,9 @@ class DocumentCreator { public createInstitutionHeader(institutionName: string, dateText: string): Paragraph { return new Paragraph({ tabStop: { - maxRight: {}, + right: { + position: TabStopPosition.MAX, + }, }, children: [ new TextRun({ diff --git a/demo/14-page-numbers.ts b/demo/14-page-numbers.ts index fc9a20169d..ae34300b5c 100644 --- a/demo/14-page-numbers.ts +++ b/demo/14-page-numbers.ts @@ -1,7 +1,7 @@ // Page numbers // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { AlignmentType, Document, Header, Packer, Paragraph, TextRun } from "../build"; +import { AlignmentType, Document, Header, Packer, PageBreak, Paragraph, TextRun } from "../build"; const doc = new Document(); @@ -26,8 +26,8 @@ doc.addSection({ }, children: [ new Paragraph({ - text: "First Page", - }).pageBreak(), + children: [new TextRun("First Page"), new PageBreak()], + }), new Paragraph("Second Page"), ], }); diff --git a/demo/2-declaritive-styles.ts b/demo/2-declaritive-styles.ts index a854b04546..a514e7eef6 100644 --- a/demo/2-declaritive-styles.ts +++ b/demo/2-declaritive-styles.ts @@ -82,14 +82,16 @@ doc.addSection({ level: 0, }, }), - new Paragraph({}).addRun( - new TextRun({ - text: "Some monospaced content", - font: { - name: "Monospace", - }, - }), - ), + new Paragraph({ + children: [ + new TextRun({ + text: "Some monospaced content", + font: { + name: "Monospace", + }, + }), + ], + }), new Paragraph({ text: "An aside, in light gray italics and indented", style: "aside", diff --git a/demo/21-bookmarks.ts b/demo/21-bookmarks.ts index 7a8e7b523b..ae7427aaf4 100644 --- a/demo/21-bookmarks.ts +++ b/demo/21-bookmarks.ts @@ -2,6 +2,7 @@ // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; import { Document, HeadingLevel, Packer, Paragraph } from "../build"; +import { PageBreak } from "../build/file/paragraph"; const LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mi velit, convallis convallis scelerisque nec, faucibus nec leo. Phasellus at posuere mauris, tempus dignissim velit. Integer et tortor dolor. Duis auctor efficitur mattis. Vivamus ut metus accumsan tellus auctor sollicitudin venenatis et nibh. Cras quis massa ac metus fringilla venenatis. Proin rutrum mauris purus, ut suscipit magna consectetur id. Integer consectetur sollicitudin ante, vitae faucibus neque efficitur in. Praesent ultricies nibh lectus. Mauris pharetra id odio eget iaculis. Duis dictum, risus id pellentesque rutrum, lorem quam malesuada massa, quis ullamcorper turpis urna a diam. Cras vulputate metus vel massa porta ullamcorper. Etiam porta condimentum nulla nec tristique. Sed nulla urna, pharetra non tortor sed, sollicitudin molestie diam. Maecenas enim leo, feugiat eget vehicula id, sollicitudin vitae ante."; @@ -22,11 +23,16 @@ doc.addSection({ children: [ new Paragraph({ heading: HeadingLevel.HEADING_1, - }).addBookmark(bookmark), + children: [bookmark], + }), new Paragraph("\n"), new Paragraph(LOREM_IPSUM), - new Paragraph({}).pageBreak(), - new Paragraph({}).addHyperLink(hyperlink), + new Paragraph({ + children: [new PageBreak()], + }), + new Paragraph({ + children: [hyperlink], + }), ], }); diff --git a/demo/35-hyperlinks.ts b/demo/35-hyperlinks.ts index c547d93b36..6392299b84 100644 --- a/demo/35-hyperlinks.ts +++ b/demo/35-hyperlinks.ts @@ -4,12 +4,14 @@ import * as fs from "fs"; import { Document, Packer, Paragraph } from "../build"; const doc = new Document(); -const paragraph = new Paragraph({}); const link = doc.createHyperlink("http://www.example.com", "Hyperlink"); -paragraph.addHyperLink(link); doc.addSection({ - children: [paragraph], + children: [ + new Paragraph({ + children: [link], + }), + ], }); Packer.toBuffer(doc).then((buffer) => { diff --git a/docs/usage/paragraph.md b/docs/usage/paragraph.md index c770e8c00f..f428bd7374 100644 --- a/docs/usage/paragraph.md +++ b/docs/usage/paragraph.md @@ -244,10 +244,15 @@ The above example will create a heading with a page break directly under it. ## Page Break -To move to a new page (insert a page break), simply add `.pageBreak()` on a paragraph: +To move to a new page (insert a page break): ```ts -const paragraph = new docx.Paragraph("Amazing Heading").pageBreak(); +const paragraph = new docx.Paragraph({ + children: [ + new TextRun("Amazing Heading"), + new PageBreak(), + ] +}); ``` The above example will create a heading and start a new page immediately afterwards. diff --git a/docs/usage/tab-stops.md b/docs/usage/tab-stops.md index e172c7f9b0..e266c0b310 100644 --- a/docs/usage/tab-stops.md +++ b/docs/usage/tab-stops.md @@ -2,7 +2,7 @@ > Tab stops are useful, if you are unclear of what they are, [here is a link explaining](https://en.wikipedia.org/wiki/Tab_stop). It enables side by side text which is nicely laid out without the need for tables, or constantly pressing space bar. -!> **Note**: At the moment, the unit of measurement for a tab stop is counter intuitive for a human. It is using OpenXMLs own measuring system. For example, 2268 roughly translates to 3cm. Therefore in the future, I may consider changing it to percentages or even cm. +!> **Note**: The unit of measurement for a tab stop is in [DXA](https://stackoverflow.com/questions/14360183/default-wordml-unit-measurement-pixel-or-point-or-inches) ![Word 2013 Tabs](http://www.teachucomp.com/wp-content/uploads/blog-4-22-2015-UsingTabStopsInWord-1024x577.png "Word 2013 Tab Stops") @@ -11,44 +11,86 @@ Simply call the relevant methods on the paragraph listed below. Then just add a ## Example ```ts -const paragraph = new docx.Paragraph().maxRightTabStop(); -const leftText = new docx.TextRun("Hey everyone").bold(); -const rightText = new docx.TextRun("11th November 2015").tab(); -paragraph.addRun(leftText); -paragraph.addRun(rightText); +const paragraph = new Paragraph({ + children: [new TextRun("Hey everyone").bold(), new TextRun("11th November 1999").tab()], + tabStop: { + right: { + position: TabStopPosition.MAX, + }, + }, +}); ``` -The example above will create a left aligned text, and a right aligned text on the same line. The laymans approach to this problem would be to either use text boxes or tables. YUK! + +The example above will create a left aligned text, and a right aligned text on the same line. The laymans approach to this problem would be to either use text boxes or tables. Not ideal! ```ts -const paragraph = new docx.Paragraph(); -paragraph.maxRightTabStop(); -paragraph.leftTabStop(1000); -const text = new docx.TextRun("Second tab stop here I come!").tab().tab(); -paragraph.addRun(text); +const paragraph = new Paragraph({ + children: [new TextRun("Second tab stop here I come!").tab().tab()], + tabStop: { + right: { + position: TabStopPosition.MAX, + }, + left: { + position: 1000, + }, + }, +}); ``` The above shows the use of two tab stops, and how to select/use it. ## Left Tab Stop + ```ts -paragraph.leftTabStop(2268); +const paragraph = new Paragraph({ + tabStop: { + left: { + position: 2268, + }, + }, +}); ``` + 2268 is the distance from the left side. ## Center Tab Stop + ```ts -paragraph.centerTabStop(2268); +const paragraph = new Paragraph({ + tabStop: { + center: { + position: 2268, + }, + }, +}); ``` -2268 is the distance from the left side. + +2268 is the distance from the center. ## Right Tab Stop + ```ts -paragraph.rightTabStop(2268); +const paragraph = new Paragraph({ + tabStop: { + right: { + position: 2268, + }, + }, +}); ``` -2268 is the distance from the left side. + +2268 is the distance fro0oum the left side. ## Max Right Tab Stop + ```ts -paragraph.maxRightTabStop(); +const paragraph = new Paragraph({ + tabStop: { + right: { + position: TabStopPosition.MAX, + }, + }, +}); ``` + This will create a tab stop on the very edge of the right hand side. Handy for right aligning and left aligning text on the same line. diff --git a/docs/usage/table-of-contents.md b/docs/usage/table-of-contents.md index 00dc329ad9..ea5ff2afd5 100644 --- a/docs/usage/table-of-contents.md +++ b/docs/usage/table-of-contents.md @@ -47,30 +47,6 @@ Here is the list of all options that you can use to generate your tables of cont ## Examples -```ts -// Let's define the options for generate a TOC for heading 1-5 and MySpectacularStyle, -// making the entries be hyperlinks for the paragraph -const toc = new TableOfContents("Summary", { - hyperlink: true, - headingStyleRange: "1-5", - stylesWithLevels: [new StyleLevel("MySpectacularStyle", 1)], -}); - -doc.addTableOfContents(toc); - -doc.add(new Paragraph("Header #1").heading1().pageBreakBefore()); -doc.add(new Paragraph("I'm a little text, very nicely written.'")); - -doc.add(new Paragraph("Header #2").heading1().pageBreakBefore()); -doc.add(new Paragraph("I'm another text very nicely written.'")); -doc.add(new Paragraph("Header #2.1").heading2()); -doc.add(new Paragraph("I'm another text very nicely written.'")); - -doc.add(new Paragraph("My Spectacular Style #1").style("MySpectacularStyle").pageBreakBefore()); -``` - -### Complete example - [Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/28-table-of-contents.ts ':include') _Source: https://github.com/dolanmiu/docx/blob/master/demo/28-table-of-contents.ts_ diff --git a/src/export/formatter.spec.ts b/src/export/formatter.spec.ts index 7ee05fa5d1..da772db2b1 100644 --- a/src/export/formatter.spec.ts +++ b/src/export/formatter.spec.ts @@ -28,15 +28,52 @@ describe("Formatter", () => { }); it("should format simple paragraph with bold text", () => { - const paragraph = new Paragraph(""); - paragraph.addRun( - new TextRun({ - text: "test", - bold: true, - }), - ); - const newJson = formatter.format(paragraph); - assert.isDefined(newJson["w:p"][1]["w:r"][0]["w:rPr"][0]["w:b"]._attr["w:val"]); + const paragraph = new Paragraph({ + children: [ + new TextRun({ + text: "test", + bold: true, + }), + ], + }); + + const tree = formatter.format(paragraph); + expect(tree).to.deep.equal({ + "w:p": [ + { + "w:r": [ + { + "w:rPr": [ + { + "w:b": { + _attr: { + "w:val": true, + }, + }, + }, + { + "w:bCs": { + _attr: { + "w:val": true, + }, + }, + }, + ], + }, + { + "w:t": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "test", + ], + }, + ], + }, + ], + }); }); it("should format attributes (rsidSect)", () => { diff --git a/src/file/footnotes/footnotes.ts b/src/file/footnotes/footnotes.ts index 2fea5fe380..91ba1d199d 100644 --- a/src/file/footnotes/footnotes.ts +++ b/src/file/footnotes/footnotes.ts @@ -44,7 +44,8 @@ export class FootNotes extends XmlComponent { line: 240, lineRule: "auto", }, - }).addRun(new SeperatorRun()), + children: [new SeperatorRun()], + }), ); this.root.push(begin); @@ -56,7 +57,8 @@ export class FootNotes extends XmlComponent { line: 240, lineRule: "auto", }, - }).addRun(new ContinuationSeperatorRun()), + children: [new ContinuationSeperatorRun()], + }), ); this.root.push(spacing); } diff --git a/src/file/numbering/level.ts b/src/file/numbering/level.ts index 8a266fa47f..26d0849fc4 100644 --- a/src/file/numbering/level.ts +++ b/src/file/numbering/level.ts @@ -8,8 +8,9 @@ import { KeepLines, KeepNext, LeftTabStop, - MaxRightTabStop, + RightTabStop, Spacing, + TabStopPosition, ThematicBreak, } from "../paragraph/formatting"; import { ParagraphProperties } from "../paragraph/properties"; @@ -235,9 +236,8 @@ export class LevelBase extends XmlComponent { return this; } - public maxRightTabStop(): Level { - this.addParagraphProperty(new MaxRightTabStop()); - return this; + public rightTabStop(position: number): Level { + return this.addParagraphProperty(new RightTabStop(position)); } public leftTabStop(position: number): Level { diff --git a/src/file/numbering/numbering.spec.ts b/src/file/numbering/numbering.spec.ts index f38261b071..cbf7203a06 100644 --- a/src/file/numbering/numbering.spec.ts +++ b/src/file/numbering/numbering.spec.ts @@ -8,6 +8,7 @@ import { Num } from "./num"; import { Numbering } from "./numbering"; import { EMPTY_OBJECT } from "file/xml-components"; +import { TabStopPosition } from "../paragraph"; describe("Numbering", () => { let numbering: Numbering; @@ -202,7 +203,7 @@ describe("AbstractNumbering", () => { it("#maxRightTabStop", () => { const abstractNumbering = new AbstractNumbering(1); - const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").maxRightTabStop(); + const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").rightTabStop(TabStopPosition.MAX); const tree = new Formatter().format(level); expect(tree["w:lvl"]).to.include({ "w:pPr": [ diff --git a/src/file/paragraph/formatting/tab-stop.spec.ts b/src/file/paragraph/formatting/tab-stop.spec.ts index ac5e563fa5..558289ba8e 100644 --- a/src/file/paragraph/formatting/tab-stop.spec.ts +++ b/src/file/paragraph/formatting/tab-stop.spec.ts @@ -2,7 +2,7 @@ import { assert } from "chai"; import { Utility } from "tests/utility"; -import { LeaderType, LeftTabStop, MaxRightTabStop, RightTabStop } from "./tab-stop"; +import { LeaderType, LeftTabStop, RightTabStop } from "./tab-stop"; describe("LeftTabStop", () => { let tabStop: LeftTabStop; @@ -52,28 +52,3 @@ describe("RightTabStop", () => { }); }); }); - -describe("MaxRightTabStop", () => { - let tabStop: MaxRightTabStop; - - beforeEach(() => { - tabStop = new MaxRightTabStop(); - }); - - describe("#constructor()", () => { - it("should create a Tab Stop with correct attributes", () => { - const newJson = Utility.jsonify(tabStop); - - const attributes = { - val: "right", - pos: 9026, - }; - assert.equal(JSON.stringify(newJson.root[0].root[0].root), JSON.stringify(attributes)); - }); - - it("should create a Tab Stop with w:tab", () => { - const newJson = Utility.jsonify(tabStop); - assert.equal(newJson.root[0].rootKey, "w:tab"); - }); - }); -}); diff --git a/src/file/paragraph/formatting/tab-stop.ts b/src/file/paragraph/formatting/tab-stop.ts index 2706c6f43d..e934b80c06 100644 --- a/src/file/paragraph/formatting/tab-stop.ts +++ b/src/file/paragraph/formatting/tab-stop.ts @@ -28,6 +28,10 @@ export enum LeaderType { UNDERSCORE = "underscore", } +export enum TabStopPosition { + MAX = 9026, +} + export class TabAttributes extends XmlAttributeComponent<{ readonly val: TabValue; readonly pos: string | number; @@ -49,12 +53,6 @@ export class TabStopItem extends XmlComponent { } } -export class MaxRightTabStop extends TabStop { - constructor(leader?: LeaderType) { - super(new TabStopItem(TabValue.RIGHT, 9026, leader)); - } -} - export class LeftTabStop extends TabStop { constructor(position: number, leader?: LeaderType) { super(new TabStopItem(TabValue.LEFT, position, leader)); diff --git a/src/file/paragraph/paragraph.spec.ts b/src/file/paragraph/paragraph.spec.ts index 91ee616a4e..0536e44505 100644 --- a/src/file/paragraph/paragraph.spec.ts +++ b/src/file/paragraph/paragraph.spec.ts @@ -4,7 +4,7 @@ import { Formatter } from "export/formatter"; import { EMPTY_OBJECT } from "file/xml-components"; import { Numbering } from "../numbering"; -import { AlignmentType, HeadingLevel, LeaderType } from "./formatting"; +import { AlignmentType, HeadingLevel, LeaderType, PageBreak, TabStopPosition } from "./formatting"; import { Paragraph } from "./paragraph"; describe("Paragraph", () => { @@ -254,10 +254,12 @@ describe("Paragraph", () => { }); describe("#maxRightTabStop()", () => { - it("should add maxRightTabStop to JSON", () => { + it("should add right tab stop to JSON", () => { const paragraph = new Paragraph({ tabStop: { - maxRight: {}, + right: { + position: TabStopPosition.MAX, + }, }, }); const tree = new Formatter().format(paragraph); @@ -492,8 +494,9 @@ describe("Paragraph", () => { describe("#pageBreak()", () => { it("should add page break to JSON", () => { - const paragraph = new Paragraph({}); - paragraph.pageBreak(); + const paragraph = new Paragraph({ + children: [new PageBreak()], + }); const tree = new Formatter().format(paragraph); expect(tree).to.deep.equal({ "w:p": [ diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index 24c3e1717d..494a4fc831 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -11,14 +11,14 @@ import { KeepLines, KeepNext } from "./formatting/keep"; import { PageBreak, PageBreakBefore } from "./formatting/page-break"; import { ContextualSpacing, ISpacingProperties, Spacing } from "./formatting/spacing"; import { HeadingLevel, Style } from "./formatting/style"; -import { CenterTabStop, LeaderType, LeftTabStop, MaxRightTabStop, RightTabStop } from "./formatting/tab-stop"; +import { CenterTabStop, LeaderType, LeftTabStop, RightTabStop, TabStopPosition } from "./formatting/tab-stop"; import { NumberProperties } from "./formatting/unordered-list"; import { Bookmark, Hyperlink, OutlineLevel } from "./links"; import { ParagraphProperties } from "./properties"; import { PictureRun, Run, SequentialIdentifier, TextRun } from "./run"; interface ITabStopOptions { - readonly position: number; + readonly position: number | TabStopPosition; readonly leader?: LeaderType; } @@ -39,9 +39,6 @@ export interface IParagraphOptions { readonly tabStop?: { readonly left?: ITabStopOptions; readonly right?: ITabStopOptions; - readonly maxRight?: { - readonly leader?: LeaderType; - }; readonly center?: ITabStopOptions; }; readonly style?: string; @@ -53,7 +50,7 @@ export interface IParagraphOptions { readonly level: number; readonly custom?: boolean; }; - readonly children?: Array; + readonly children?: Array; } export class Paragraph extends XmlComponent { @@ -139,10 +136,6 @@ export class Paragraph extends XmlComponent { this.properties.push(new RightTabStop(options.tabStop.right.position, options.tabStop.right.leader)); } - if (options.tabStop.maxRight) { - this.properties.push(new MaxRightTabStop(options.tabStop.maxRight.leader)); - } - if (options.tabStop.center) { this.properties.push(new CenterTabStop(options.tabStop.center.position, options.tabStop.center.leader)); } @@ -166,34 +159,18 @@ export class Paragraph extends XmlComponent { if (options.children) { for (const child of options.children) { + if (child instanceof Bookmark) { + this.root.push(child.start); + this.root.push(child.text); + this.root.push(child.end); + continue; + } + this.root.push(child); } } } - public addRun(run: Run): Paragraph { - this.root.push(run); - return this; - } - - public addHyperLink(hyperlink: Hyperlink): Paragraph { - this.root.push(hyperlink); - return this; - } - - public addBookmark(bookmark: Bookmark): Paragraph { - // Bookmarks by spec have three components, a start, text, and end - this.root.push(bookmark.start); - this.root.push(bookmark.text); - this.root.push(bookmark.end); - return this; - } - - public pageBreak(): Paragraph { - this.root.push(new PageBreak()); - return this; - } - public referenceFootnote(id: number): Paragraph { this.root.push(new FootnoteReferenceRun(id)); return this; diff --git a/src/file/paragraph/run/run.ts b/src/file/paragraph/run/run.ts index c147fe5e67..e586f8807d 100644 --- a/src/file/paragraph/run/run.ts +++ b/src/file/paragraph/run/run.ts @@ -2,6 +2,7 @@ import { ShadingType } from "file/table"; import { XmlComponent } from "file/xml-components"; +import { FieldInstruction } from "file/table-of-contents/field-instruction"; import { Break } from "./break"; import { Caps, SmallCaps } from "./caps"; import { Begin, End, Separate } from "./field"; @@ -56,6 +57,7 @@ export interface IRunOptions { readonly fill: string; readonly color: string; }; + readonly children?: Array; } export class Run extends XmlComponent { @@ -134,6 +136,12 @@ export class Run extends XmlComponent { this.properties.push(new Shading(options.shading.type, options.shading.fill, options.shading.color)); this.properties.push(new ShadowComplexScript(options.shading.type, options.shading.fill, options.shading.color)); } + + if (options.children) { + for (const child of options.children) { + this.root.push(child); + } + } } public break(): Run { diff --git a/src/file/styles/style/paragraph-style.spec.ts b/src/file/styles/style/paragraph-style.spec.ts index 91f109e11e..d3a77b9a15 100644 --- a/src/file/styles/style/paragraph-style.spec.ts +++ b/src/file/styles/style/paragraph-style.spec.ts @@ -1,11 +1,11 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; +import { TabStopPosition } from "file/paragraph"; +import { EMPTY_OBJECT } from "file/xml-components"; import { ParagraphStyle } from "./paragraph-style"; -import { EMPTY_OBJECT } from "file/xml-components"; - describe("ParagraphStyle", () => { describe("#constructor", () => { it("should set the style type to paragraph and use the given style id", () => { @@ -198,7 +198,7 @@ describe("ParagraphStyle", () => { }); it("#maxRightTabStop", () => { - const style = new ParagraphStyle("myStyleId").maxRightTabStop(); + const style = new ParagraphStyle("myStyleId").rightTabStop(TabStopPosition.MAX); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ diff --git a/src/file/styles/style/paragraph-style.ts b/src/file/styles/style/paragraph-style.ts index e79c6abe17..360e2924de 100644 --- a/src/file/styles/style/paragraph-style.ts +++ b/src/file/styles/style/paragraph-style.ts @@ -6,12 +6,12 @@ import { KeepLines, KeepNext, LeftTabStop, - MaxRightTabStop, OutlineLevel, ParagraphProperties, Spacing, ThematicBreak, } from "file/paragraph"; +import { RightTabStop } from "file/paragraph/formatting"; import * as formatting from "file/paragraph/run/formatting"; import { RunProperties } from "file/paragraph/run/properties"; import { XmlComponent } from "file/xml-components"; @@ -144,8 +144,8 @@ export class ParagraphStyle extends Style { return this.addParagraphProperty(new ThematicBreak()); } - public maxRightTabStop(): ParagraphStyle { - return this.addParagraphProperty(new MaxRightTabStop()); + public rightTabStop(position: number): ParagraphStyle { + return this.addParagraphProperty(new RightTabStop(position)); } public leftTabStop(position: number): ParagraphStyle { diff --git a/src/file/table-of-contents/table-of-contents.ts b/src/file/table-of-contents/table-of-contents.ts index 57acbb3ace..e3d874e4a3 100644 --- a/src/file/table-of-contents/table-of-contents.ts +++ b/src/file/table-of-contents/table-of-contents.ts @@ -16,18 +16,24 @@ export class TableOfContents extends XmlComponent { const content = new StructuredDocumentTagContent(); - const beginParagraph = new Paragraph({}); - const beginRun = new Run({}); - beginRun.addChildElement(new Begin(true)); - beginRun.addChildElement(new FieldInstruction(properties)); - beginRun.addChildElement(new Separate()); - beginParagraph.addRun(beginRun); + const beginParagraph = new Paragraph({ + children: [ + new Run({ + children: [new Begin(true), new FieldInstruction(properties), new Separate()], + }), + ], + }); + content.addChildElement(beginParagraph); - const endParagraph = new Paragraph({}); - const endRun = new Run({}); - endRun.addChildElement(new End()); - endParagraph.addRun(endRun); + const endParagraph = new Paragraph({ + children: [ + new Run({ + children: [new End()], + }), + ], + }); + content.addChildElement(endParagraph); this.root.push(content); From dfb910defbc46de25e93617568d24b7849749fd4 Mon Sep 17 00:00:00 2001 From: James Montalvo Date: Tue, 1 Oct 2019 12:29:07 -0500 Subject: [PATCH 31/57] Add SymbolRun to allow adding symbols inline --- docs/usage/paragraph.md | 10 ++- docs/usage/symbols.md | 53 +++++++++++++ src/file/paragraph/paragraph.ts | 4 +- src/file/paragraph/run/index.ts | 1 + .../run/run-components/symbol.spec.ts | 28 +++++++ .../paragraph/run/run-components/symbol.ts | 20 +++++ src/file/paragraph/run/symbol-run.spec.ts | 76 +++++++++++++++++++ src/file/paragraph/run/symbol-run.ts | 20 +++++ 8 files changed, 207 insertions(+), 5 deletions(-) create mode 100644 docs/usage/symbols.md create mode 100644 src/file/paragraph/run/run-components/symbol.spec.ts create mode 100644 src/file/paragraph/run/run-components/symbol.ts create mode 100644 src/file/paragraph/run/symbol-run.spec.ts create mode 100644 src/file/paragraph/run/symbol-run.ts diff --git a/docs/usage/paragraph.md b/docs/usage/paragraph.md index c770e8c00f..2bf22e7022 100644 --- a/docs/usage/paragraph.md +++ b/docs/usage/paragraph.md @@ -2,7 +2,7 @@ > Everything (text, images, graphs etc) in OpenXML is organised in paragraphs. -!> Paragraphs requires an understanding of [Sections](usage/sections.md). +!> Paragraphs requires an understanding of [Sections](sections.md). You can create `Paragraphs` in the following ways: @@ -16,11 +16,15 @@ const paragraph = new Paragraph("Short hand Hello World"); ### Children Method -This method is useful for adding different `text` with different styles or adding `images` inline. +This method is useful for adding different [text](text.md) with different styles, [symbols](symbols.md), or adding [images](images.md) inline. ```ts const paragraph = new Paragraph({ - children: [new TextRun("Lorem Ipsum Foo Bar"), new TextRun("Hello World")], + children: [ + new TextRun("Lorem Ipsum Foo Bar"), + new TextRun("Hello World"), + new SymbolRun("F071"), + ], }); ``` diff --git a/docs/usage/symbols.md b/docs/usage/symbols.md new file mode 100644 index 0000000000..8b283e9da7 --- /dev/null +++ b/docs/usage/symbols.md @@ -0,0 +1,53 @@ +# Symbol Runs + +!> SymbolRuns require an understanding of [Paragraphs](paragraph.md). + +You can add multiple `symbol runs` in `Paragraphs` along with [text runs](text.md) using the Paragraph's `children` property. + +```ts +import { Paragraph, TextRun, SymbolRun } from "docx"; + +const paragraph = new Paragraph({ + children: [ + new TextRun("This is a checkbox: "), + new SymbolRun("F071") + ], +}); +``` + +## Specifying symbol font + +By default symbol runs will use the `Wingdings` font. To switch fonts, pass an object instead of a string to the `SymbolRun` constructor and specify `char` and `symbolfont` properties: + +```ts +const symbol = new SymbolRun({ + char: "F071", + symbolfont: "Arial", +}); +``` + +## Example symbols + +Symbols are specified by their hexidecimal code. Ref http://officeopenxml.com/WPtextSpecialContent-symbol.php. Below are some examples. + +- `F071`: empty checkbox +- `F043`: thumbs up +- `F04A`: smile +- `F04C`: frown +- `F022`: scissors +- `F0F0`: right arrow +- `F0FE`: checked box + +## Typographical Emphasis + +Symbol runs can have their display modified just like text runs. For example, they can be bolded and italicized: + +```ts +const symbol = new SymbolRun({ + char: "F071", + bold: true, + italics: true, +}); +``` + +See the [text run](text.md) documentation for more info. diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index 24c3e1717d..150036707f 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -15,7 +15,7 @@ import { CenterTabStop, LeaderType, LeftTabStop, MaxRightTabStop, RightTabStop } import { NumberProperties } from "./formatting/unordered-list"; import { Bookmark, Hyperlink, OutlineLevel } from "./links"; import { ParagraphProperties } from "./properties"; -import { PictureRun, Run, SequentialIdentifier, TextRun } from "./run"; +import { PictureRun, Run, SequentialIdentifier, SymbolRun, TextRun } from "./run"; interface ITabStopOptions { readonly position: number; @@ -53,7 +53,7 @@ export interface IParagraphOptions { readonly level: number; readonly custom?: boolean; }; - readonly children?: Array; + readonly children?: Array; } export class Paragraph extends XmlComponent { diff --git a/src/file/paragraph/run/index.ts b/src/file/paragraph/run/index.ts index a30a1d6037..df56d26d17 100644 --- a/src/file/paragraph/run/index.ts +++ b/src/file/paragraph/run/index.ts @@ -1,4 +1,5 @@ export * from "./run"; export * from "./text-run"; +export * from "./symbol-run"; export * from "./picture-run"; export * from "./sequential-identifier"; diff --git a/src/file/paragraph/run/run-components/symbol.spec.ts b/src/file/paragraph/run/run-components/symbol.spec.ts new file mode 100644 index 0000000000..559790577e --- /dev/null +++ b/src/file/paragraph/run/run-components/symbol.spec.ts @@ -0,0 +1,28 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; + +import { Symbol } from "./symbol"; + +describe("Symbol", () => { + describe("#constructor", () => { + // Note: if no character is given, the output is a MS Windows logo + it("creates an empty symbol run if no character is given", () => { + const s = new Symbol(); + const f = new Formatter().format(s); + expect(f).to.deep.equal({ "w:sym": { _attr: { "w:char": "", "w:font": "Wingdings" } } }); + }); + + it("creates the provided symbol with default font", () => { + const s = new Symbol("F071"); + const f = new Formatter().format(s); + expect(f).to.deep.equal({ "w:sym": { _attr: { "w:char": "F071", "w:font": "Wingdings" } } }); + }); + + it("creates the provided symbol with the provided font", () => { + const s = new Symbol("F071", "Arial"); + const f = new Formatter().format(s); + expect(f).to.deep.equal({ "w:sym": { _attr: { "w:char": "F071", "w:font": "Arial" } } }); + }); + }); +}); diff --git a/src/file/paragraph/run/run-components/symbol.ts b/src/file/paragraph/run/run-components/symbol.ts new file mode 100644 index 0000000000..dff2e7c39b --- /dev/null +++ b/src/file/paragraph/run/run-components/symbol.ts @@ -0,0 +1,20 @@ +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; + +interface ISymbolAttributesProperties { + readonly char: string; + readonly symbolfont?: string; +} + +class SymbolAttributes extends XmlAttributeComponent { + protected readonly xmlKeys = { + char: "w:char", + symbolfont: "w:font", + }; +} + +export class Symbol extends XmlComponent { + constructor(char: string = "", symbolfont: string = "Wingdings") { + super("w:sym"); + this.root.push(new SymbolAttributes({ char: char, symbolfont: symbolfont })); + } +} diff --git a/src/file/paragraph/run/symbol-run.spec.ts b/src/file/paragraph/run/symbol-run.spec.ts new file mode 100644 index 0000000000..f3faee8bb0 --- /dev/null +++ b/src/file/paragraph/run/symbol-run.spec.ts @@ -0,0 +1,76 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; + +import { UnderlineType } from "./underline"; + +import { SymbolRun } from "./symbol-run"; + +describe("SymbolRun", () => { + let run: SymbolRun; + + describe("#constructor()", () => { + it("should create symbol run from text input", () => { + run = new SymbolRun("F071"); + const f = new Formatter().format(run); + expect(f).to.deep.equal({ + "w:r": [{ "w:sym": { _attr: { "w:char": "F071", "w:font": "Wingdings" } } }], + }); + }); + + it("should create symbol run from object input with just 'char' specified", () => { + run = new SymbolRun({ char: "F071" }); + const f = new Formatter().format(run); + expect(f).to.deep.equal({ + "w:r": [{ "w:sym": { _attr: { "w:char": "F071", "w:font": "Wingdings" } } }], + }); + }); + + it("should create symbol run from object input with just 'char' specified", () => { + run = new SymbolRun({ char: "F071", symbolfont: "Arial" }); + const f = new Formatter().format(run); + expect(f).to.deep.equal({ + "w:r": [{ "w:sym": { _attr: { "w:char": "F071", "w:font": "Arial" } } }], + }); + }); + + it("should add other standard run properties", () => { + run = new SymbolRun({ + char: "F071", + symbolfont: "Arial", + italics: true, + bold: true, + underline: { + color: "red", + type: UnderlineType.DOUBLE, + }, + color: "green", + size: 40, + highlight: "yellow", + }); + + const f = new Formatter().format(run); + expect(f).to.deep.equal({ + "w:r": [ + { + "w:rPr": [ + { "w:b": { _attr: { "w:val": true } } }, + { "w:bCs": { _attr: { "w:val": true } } }, + { "w:i": { _attr: { "w:val": true } } }, + { "w:iCs": { _attr: { "w:val": true } } }, + { "w:u": { _attr: { "w:val": "double", "w:color": "red" } } }, + { "w:color": { _attr: { "w:val": "green" } } }, + { "w:sz": { _attr: { "w:val": 40 } } }, + { "w:szCs": { _attr: { "w:val": 40 } } }, + { "w:highlight": { _attr: { "w:val": "yellow" } } }, + { "w:highlightCs": { _attr: { "w:val": "yellow" } } }, + ], + }, + { + "w:sym": { _attr: { "w:char": "F071", "w:font": "Arial" } }, + }, + ], + }); + }); + }); +}); diff --git a/src/file/paragraph/run/symbol-run.ts b/src/file/paragraph/run/symbol-run.ts new file mode 100644 index 0000000000..7291d11521 --- /dev/null +++ b/src/file/paragraph/run/symbol-run.ts @@ -0,0 +1,20 @@ +import { IRunOptions, Run } from "./run"; +import { Symbol } from "./run-components/symbol"; + +export interface ISymbolRunOptions extends IRunOptions { + readonly char: string; + readonly symbolfont?: string; +} + +export class SymbolRun extends Run { + constructor(options: ISymbolRunOptions | string) { + if (typeof options === "string") { + super({}); + this.root.push(new Symbol(options)); + return; + } + + super(options); + this.root.push(new Symbol(options.char, options.symbolfont)); + } +} From ad62f5459bb39bbc59c1af83d9bcefda091ab4a4 Mon Sep 17 00:00:00 2001 From: James Montalvo Date: Tue, 1 Oct 2019 15:23:01 -0500 Subject: [PATCH 32/57] Export RunFonts to be able to pass to Level.addRunProperty() --- src/file/paragraph/run/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/file/paragraph/run/index.ts b/src/file/paragraph/run/index.ts index a30a1d6037..3d4d1dc1bb 100644 --- a/src/file/paragraph/run/index.ts +++ b/src/file/paragraph/run/index.ts @@ -1,4 +1,5 @@ export * from "./run"; export * from "./text-run"; export * from "./picture-run"; +export * from "./run-fonts"; export * from "./sequential-identifier"; From d2a0baa221aa20799fc65931aea2507df6a38675 Mon Sep 17 00:00:00 2001 From: Max Lay Date: Wed, 2 Oct 2019 14:49:55 +1300 Subject: [PATCH 33/57] Fix table of contents \t flag --- src/file/table-of-contents/field-instruction.ts | 2 +- src/file/table-of-contents/table-of-contents.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file/table-of-contents/field-instruction.ts b/src/file/table-of-contents/field-instruction.ts index f8da8f97ba..e67f35987e 100644 --- a/src/file/table-of-contents/field-instruction.ts +++ b/src/file/table-of-contents/field-instruction.ts @@ -52,7 +52,7 @@ export class FieldInstruction extends XmlComponent { instruction = `${instruction} \\s "${this.properties.seqFieldIdentifierForPrefix}"`; } if (this.properties.stylesWithLevels && this.properties.stylesWithLevels.length) { - const styles = this.properties.stylesWithLevels.map((sl) => `${sl.styleName};${sl.level}`).join(";"); + const styles = this.properties.stylesWithLevels.map((sl) => `${sl.styleName},${sl.level}`).join(","); instruction = `${instruction} \\t "${styles}"`; } if (this.properties.useAppliedParagraphOutlineLevel) { diff --git a/src/file/table-of-contents/table-of-contents.spec.ts b/src/file/table-of-contents/table-of-contents.spec.ts index 223a5a2679..f5cf06cf84 100644 --- a/src/file/table-of-contents/table-of-contents.spec.ts +++ b/src/file/table-of-contents/table-of-contents.spec.ts @@ -146,7 +146,7 @@ const COMPLETE_TOC = { "xml:space": "preserve", }, }, - 'TOC \\a "A" \\b "B" \\c "C" \\d "D" \\f "F" \\h \\l "L" \\n "N" \\o "O" \\p "P" \\s "S" \\t "SL;1;SL;2" \\u \\w \\x \\z', + 'TOC \\a "A" \\b "B" \\c "C" \\d "D" \\f "F" \\h \\l "L" \\n "N" \\o "O" \\p "P" \\s "S" \\t "SL,1,SL,2" \\u \\w \\x \\z', ], }, { From 591b2f4e0470b715767c1dff2846db0ea35ec97a Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 4 Oct 2019 01:20:41 +0100 Subject: [PATCH 34/57] Declarative styles --- demo/2-declaritive-styles.ts | 111 ++++--- src/file/core-properties/properties.ts | 2 + src/file/file.ts | 9 +- src/file/numbering/level.ts | 4 +- src/file/numbering/numbering.spec.ts | 5 +- src/file/paragraph/run/index.ts | 1 + src/file/paragraph/run/underline.spec.ts | 2 +- src/file/paragraph/run/underline.ts | 2 +- src/file/styles/external-styles-factory.ts | 10 +- src/file/styles/factory.ts | 103 +++---- src/file/styles/style/character-style.spec.ts | 127 ++++++-- src/file/styles/style/character-style.ts | 147 ++++++--- src/file/styles/style/components.spec.ts | 4 +- src/file/styles/style/components.ts | 5 +- src/file/styles/style/default-styles.spec.ts | 60 ++-- src/file/styles/style/default-styles.ts | 172 +++++++---- src/file/styles/style/paragraph-style.spec.ts | 234 ++++++++++++--- src/file/styles/style/paragraph-style.ts | 284 ++++++++++-------- src/file/styles/styles.spec.ts | 62 ++-- src/file/styles/styles.ts | 60 ++-- 20 files changed, 920 insertions(+), 484 deletions(-) diff --git a/demo/2-declaritive-styles.ts b/demo/2-declaritive-styles.ts index a514e7eef6..04502264a3 100644 --- a/demo/2-declaritive-styles.ts +++ b/demo/2-declaritive-styles.ts @@ -1,48 +1,89 @@ // Example on how to customise the look at feel using Styles // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, Styles, TextRun, UnderlineType } from "../build"; const doc = new Document({ creator: "Clippy", title: "Sample Document", description: "A brief example of using docx", + styles: new Styles({ + paragraphStyles: [ + { + id: "Heading1", + name: "Heading 1", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + size: 28, + bold: true, + italics: true, + }, + paragraph: { + spacing: { + after: 120, + }, + }, + }, + { + id: "Heading2", + name: "Heading 2", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + size: 26, + bold: true, + underline: { + type: UnderlineType.DOUBLE, + color: "FF0000", + }, + }, + paragraph: { + spacing: { + before: 240, + after: 120, + }, + }, + }, + { + id: "aside", + name: "Aside", + basedOn: "Normal", + next: "Normal", + run: { + color: "999999", + italics: true, + }, + paragraph: { + indent: { + left: 720, + }, + spacing: { + line: 276, + }, + }, + }, + { + id: "wellSpaced", + name: "Well Spaced", + basedOn: "Normal", + quickFormat: true, + paragraph: { + spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, + }, + }, + { + id: "ListParagraph", + name: "List Paragraph", + basedOn: "Normal", + quickFormat: true, + }, + ], + }), }); -doc.Styles.createParagraphStyle("Heading1", "Heading 1") - .basedOn("Normal") - .next("Normal") - .quickFormat() - .size(28) - .bold() - .italics() - .spacing({ after: 120 }); - -doc.Styles.createParagraphStyle("Heading2", "Heading 2") - .basedOn("Normal") - .next("Normal") - .quickFormat() - .size(26) - .bold() - .underline("double", "FF0000") - .spacing({ before: 240, after: 120 }); - -doc.Styles.createParagraphStyle("aside", "Aside") - .basedOn("Normal") - .next("Normal") - .color("999999") - .italics() - .indent({ left: 720 }) - .spacing({ line: 276 }); - -doc.Styles.createParagraphStyle("wellSpaced", "Well Spaced") - .basedOn("Normal") - .spacing({ line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }); - -doc.Styles.createParagraphStyle("ListParagraph", "List Paragraph") - .quickFormat() - .basedOn("Normal"); - const numberedAbstract = doc.Numbering.createAbstractNumbering(); numberedAbstract.createLevel(0, "lowerLetter", "%1)", "left"); diff --git a/src/file/core-properties/properties.ts b/src/file/core-properties/properties.ts index d271299d9c..7d3e447523 100644 --- a/src/file/core-properties/properties.ts +++ b/src/file/core-properties/properties.ts @@ -1,5 +1,6 @@ import { XmlComponent } from "file/xml-components"; import { DocumentAttributes } from "../document/document-attributes"; +import { Styles } from "../styles"; import { Created, Creator, Description, Keywords, LastModifiedBy, Modified, Revision, Subject, Title } from "./components"; export interface IPropertiesOptions { @@ -11,6 +12,7 @@ export interface IPropertiesOptions { readonly lastModifiedBy?: string; readonly revision?: string; readonly externalStyles?: string; + readonly styles?: Styles; } export class CoreProperties extends XmlComponent { diff --git a/src/file/file.ts b/src/file/file.ts index c0adf21e30..f68760328d 100644 --- a/src/file/file.ts +++ b/src/file/file.ts @@ -46,8 +46,6 @@ export interface ISectionOptions { export class File { // tslint:disable-next-line:readonly-keyword private currentRelationshipId: number = 1; - // tslint:disable-next-line:readonly-keyword - private styles: Styles; private readonly document: Document; private readonly headers: IDocumentHeader[] = []; @@ -61,6 +59,7 @@ export class File { private readonly settings: Settings; private readonly contentTypes: ContentTypes; private readonly appProperties: AppProperties; + private readonly styles: Styles; constructor( options: IPropertiesOptions = { @@ -97,6 +96,8 @@ export class File { } else if (options.externalStyles) { const stylesFactory = new ExternalStylesFactory(); this.styles = stylesFactory.newInstance(options.externalStyles); + } else if (options.styles) { + this.styles = options.styles; } else { const stylesFactory = new DefaultStylesFactory(); this.styles = stylesFactory.newInstance(); @@ -277,10 +278,6 @@ export class File { return this.styles; } - public set Styles(styles: Styles) { - this.styles = styles; - } - public get CoreProperties(): CoreProperties { return this.coreProperties; } diff --git a/src/file/numbering/level.ts b/src/file/numbering/level.ts index 26d0849fc4..b0fa183f53 100644 --- a/src/file/numbering/level.ts +++ b/src/file/numbering/level.ts @@ -10,12 +10,12 @@ import { LeftTabStop, RightTabStop, Spacing, - TabStopPosition, ThematicBreak, } from "../paragraph/formatting"; import { ParagraphProperties } from "../paragraph/properties"; import * as formatting from "../paragraph/run/formatting"; import { RunProperties } from "../paragraph/run/properties"; +import { UnderlineType } from "../paragraph/run/underline"; interface ILevelAttributesProperties { readonly ilvl?: number; @@ -185,7 +185,7 @@ export class LevelBase extends XmlComponent { return this; } - public underline(underlineType?: string, color?: string): Level { + public underline(underlineType?: UnderlineType, color?: string): Level { this.addRunProperty(new formatting.Underline(underlineType, color)); return this; } diff --git a/src/file/numbering/numbering.spec.ts b/src/file/numbering/numbering.spec.ts index cbf7203a06..d5f2f9e168 100644 --- a/src/file/numbering/numbering.spec.ts +++ b/src/file/numbering/numbering.spec.ts @@ -9,6 +9,7 @@ import { Numbering } from "./numbering"; import { EMPTY_OBJECT } from "file/xml-components"; import { TabStopPosition } from "../paragraph"; +import { UnderlineType } from "../paragraph/run/underline"; describe("Numbering", () => { let numbering: Numbering; @@ -356,7 +357,7 @@ describe("AbstractNumbering", () => { it("should set the style if given", () => { const abstractNumbering = new AbstractNumbering(1); - const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").underline("double"); + const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").underline(UnderlineType.DOUBLE); const tree = new Formatter().format(level); expect(tree["w:lvl"]).to.include({ "w:rPr": [{ "w:u": { _attr: { "w:val": "double" } } }], @@ -365,7 +366,7 @@ describe("AbstractNumbering", () => { it("should set the style and color if given", () => { const abstractNumbering = new AbstractNumbering(1); - const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").underline("double", "005599"); + const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").underline(UnderlineType.DOUBLE, "005599"); const tree = new Formatter().format(level); expect(tree["w:lvl"]).to.include({ "w:rPr": [{ "w:u": { _attr: { "w:val": "double", "w:color": "005599" } } }], diff --git a/src/file/paragraph/run/index.ts b/src/file/paragraph/run/index.ts index 81914b7b15..353e794c06 100644 --- a/src/file/paragraph/run/index.ts +++ b/src/file/paragraph/run/index.ts @@ -4,3 +4,4 @@ export * from "./symbol-run"; export * from "./picture-run"; export * from "./run-fonts"; export * from "./sequential-identifier"; +export * from "./underline"; diff --git a/src/file/paragraph/run/underline.spec.ts b/src/file/paragraph/run/underline.spec.ts index b593b816dd..77f7819e7b 100644 --- a/src/file/paragraph/run/underline.spec.ts +++ b/src/file/paragraph/run/underline.spec.ts @@ -27,7 +27,7 @@ describe("Underline", () => { }); it("should use the given style type and color", () => { - const underline = new u.Underline("double", "FF00CC"); + const underline = new u.Underline(u.UnderlineType.DOUBLE, "FF00CC"); const tree = new Formatter().format(underline); expect(tree).to.deep.equal({ "w:u": { _attr: { "w:val": "double", "w:color": "FF00CC" } }, diff --git a/src/file/paragraph/run/underline.ts b/src/file/paragraph/run/underline.ts index 7d4a1c98d1..9cdb7b25a1 100644 --- a/src/file/paragraph/run/underline.ts +++ b/src/file/paragraph/run/underline.ts @@ -33,7 +33,7 @@ export abstract class BaseUnderline extends XmlComponent { } export class Underline extends BaseUnderline { - constructor(underlineType: string = "single", color?: string) { + constructor(underlineType: UnderlineType = UnderlineType.SINGLE, color?: string) { super(underlineType, color); } } diff --git a/src/file/styles/external-styles-factory.ts b/src/file/styles/external-styles-factory.ts index cbfa4a3c90..839041d690 100644 --- a/src/file/styles/external-styles-factory.ts +++ b/src/file/styles/external-styles-factory.ts @@ -38,11 +38,13 @@ export class ExternalStylesFactory { throw new Error("can not find styles element"); } - const importedStyle = new Styles(new ImportedRootElementAttributes(stylesXmlElement.attributes)); const stylesElements = stylesXmlElement.elements || []; - for (const childElm of stylesElements) { - importedStyle.push(convertToXmlComponent(childElm) as ImportedXmlComponent); - } + + const importedStyle = new Styles({ + initialStyles: new ImportedRootElementAttributes(stylesXmlElement.attributes), + importedStyles: stylesElements.map((childElm) => convertToXmlComponent(childElm) as ImportedXmlComponent), + }); + return importedStyle; } } diff --git a/src/file/styles/factory.ts b/src/file/styles/factory.ts index 800d2ca9ce..d43f46b732 100644 --- a/src/file/styles/factory.ts +++ b/src/file/styles/factory.ts @@ -1,7 +1,7 @@ import { DocumentAttributes } from "../document/document-attributes"; -import { Color, Italics, Size } from "../paragraph/run/formatting"; -import { Styles } from "./"; +import { Styles } from "./styles"; +import { DocumentDefaults } from "./defaults"; import { FootnoteReferenceStyle, FootnoteText, @@ -27,57 +27,58 @@ export class DefaultStylesFactory { w15: "http://schemas.microsoft.com/office/word/2012/wordml", Ignorable: "w14 w15", }); - const styles = new Styles(documentAttributes); + const styles = new Styles({ + initialStyles: documentAttributes, + importedStyles: [ + new DocumentDefaults(), + new TitleStyle({ + run: { + size: 56, + }, + }), + new Heading1Style({ + run: { + color: "2E74B5", + size: 32, + }, + }), + new Heading2Style({ + run: { + color: "2E74B5", + size: 26, + }, + }), + new Heading3Style({ + run: { + color: "1F4D78", + size: 24, + }, + }), + new Heading4Style({ + run: { + color: "2E74B5", + italics: true, + }, + }), + new Heading5Style({ + run: { + color: "2E74B5", + }, + }), + new Heading6Style({ + run: { + color: "1F4D78", + }, + }), + new ListParagraph({}), + new HyperlinkStyle({}), + new FootnoteReferenceStyle({}), + new FootnoteText({}), + new FootnoteTextChar({}), + ], + }); styles.createDocumentDefaults(); - const titleStyle = new TitleStyle(); - titleStyle.addRunProperty(new Size(56)); - styles.push(titleStyle); - - const heading1Style = new Heading1Style(); - heading1Style.addRunProperty(new Color("2E74B5")); - heading1Style.addRunProperty(new Size(32)); - styles.push(heading1Style); - - const heading2Style = new Heading2Style(); - heading2Style.addRunProperty(new Color("2E74B5")); - heading2Style.addRunProperty(new Size(26)); - styles.push(heading2Style); - - const heading3Style = new Heading3Style(); - heading3Style.addRunProperty(new Color("1F4D78")); - heading3Style.addRunProperty(new Size(24)); - styles.push(heading3Style); - - const heading4Style = new Heading4Style(); - heading4Style.addRunProperty(new Color("2E74B5")); - heading4Style.addRunProperty(new Italics()); - styles.push(heading4Style); - - const heading5Style = new Heading5Style(); - heading5Style.addRunProperty(new Color("2E74B5")); - styles.push(heading5Style); - - const heading6Style = new Heading6Style(); - heading6Style.addRunProperty(new Color("1F4D78")); - styles.push(heading6Style); - - const listParagraph = new ListParagraph(); - // listParagraph.addParagraphProperty(); - styles.push(listParagraph); - - const hyperLinkStyle = new HyperlinkStyle(); - styles.push(hyperLinkStyle); - - const footnoteReferenceStyle = new FootnoteReferenceStyle(); - styles.push(footnoteReferenceStyle); - - const footnoteTextStyle = new FootnoteText(); - styles.push(footnoteTextStyle); - - const footnoteTextCharStyle = new FootnoteTextChar(); - styles.push(footnoteTextCharStyle); - return styles; } } diff --git a/src/file/styles/style/character-style.spec.ts b/src/file/styles/style/character-style.spec.ts index c7594f3829..fa12e5e512 100644 --- a/src/file/styles/style/character-style.spec.ts +++ b/src/file/styles/style/character-style.spec.ts @@ -1,15 +1,16 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; +import { UnderlineType } from "file/paragraph/run/underline"; +import { ShadingType } from "file/table"; +import { EMPTY_OBJECT } from "file/xml-components"; import { CharacterStyle } from "./character-style"; -import { EMPTY_OBJECT } from "file/xml-components"; - describe("CharacterStyle", () => { describe("#constructor", () => { it("should set the style type to character and use the given style id", () => { - const style = new CharacterStyle("myStyleId"); + const style = new CharacterStyle({ id: "myStyleId" }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -17,7 +18,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -29,7 +30,10 @@ describe("CharacterStyle", () => { }); it("should set the name of the style, if given", () => { - const style = new CharacterStyle("myStyleId", "Style Name"); + const style = new CharacterStyle({ + id: "myStyleId", + name: "Style Name", + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -38,7 +42,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -52,7 +56,7 @@ describe("CharacterStyle", () => { describe("formatting methods: style attributes", () => { it("#basedOn", () => { - const style = new CharacterStyle("myStyleId").basedOn("otherId"); + const style = new CharacterStyle({ id: "myStyleId", basedOn: "otherId" }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -60,7 +64,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -75,7 +79,12 @@ describe("CharacterStyle", () => { describe("formatting methods: run properties", () => { it("#size", () => { - const style = new CharacterStyle("myStyleId").size(24); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + size: 24, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -86,7 +95,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -99,7 +108,12 @@ describe("CharacterStyle", () => { describe("#underline", () => { it("should set underline to 'single' if no arguments are given", () => { - const style = new CharacterStyle("myStyleId").underline(); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + underline: {}, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -110,7 +124,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -122,7 +136,14 @@ describe("CharacterStyle", () => { }); it("should set the style if given", () => { - const style = new CharacterStyle("myStyleId").underline("double"); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + underline: { + type: UnderlineType.DOUBLE, + }, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -133,7 +154,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -145,7 +166,15 @@ describe("CharacterStyle", () => { }); it("should set the style and color if given", () => { - const style = new CharacterStyle("myStyleId").underline("double", "005599"); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + underline: { + type: UnderlineType.DOUBLE, + color: "005599", + }, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -156,7 +185,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -169,7 +198,12 @@ describe("CharacterStyle", () => { }); it("#superScript", () => { - const style = new CharacterStyle("myStyleId").superScript(); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + superScript: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -188,7 +222,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -200,7 +234,12 @@ describe("CharacterStyle", () => { }); it("#color", () => { - const style = new CharacterStyle("myStyleId").color("123456"); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + color: "123456", + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -211,7 +250,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -223,7 +262,12 @@ describe("CharacterStyle", () => { }); it("#bold", () => { - const style = new CharacterStyle("myStyleId").bold(); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + bold: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -234,7 +278,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -246,7 +290,12 @@ describe("CharacterStyle", () => { }); it("#italics", () => { - const style = new CharacterStyle("myStyleId").italics(); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + italics: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -257,7 +306,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -269,7 +318,7 @@ describe("CharacterStyle", () => { }); it("#link", () => { - const style = new CharacterStyle("myStyleId").link("MyLink"); + const style = new CharacterStyle({ id: "myStyleId", link: "MyLink" }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -277,7 +326,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -290,7 +339,7 @@ describe("CharacterStyle", () => { }); it("#semiHidden", () => { - const style = new CharacterStyle("myStyleId").semiHidden(); + const style = new CharacterStyle({ id: "myStyleId", semiHidden: true }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -298,7 +347,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -309,7 +358,12 @@ describe("CharacterStyle", () => { }); it("#highlight", () => { - const style = new CharacterStyle("myStyleId").highlight("005599"); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + highlight: "005599", + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -320,7 +374,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -332,7 +386,16 @@ describe("CharacterStyle", () => { }); it("#shadow", () => { - const style = new CharacterStyle("myStyleId").shadow("pct10", "00FFFF", "FF0000"); + const style = new CharacterStyle({ + id: "myStyleId", + run: { + shadow: { + type: ShadingType.PERCENT_10, + fill: "00FFFF", + color: "FF0000", + }, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -343,7 +406,7 @@ describe("CharacterStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, diff --git a/src/file/styles/style/character-style.ts b/src/file/styles/style/character-style.ts index c60cca9394..32ff4b6b69 100644 --- a/src/file/styles/style/character-style.ts +++ b/src/file/styles/style/character-style.ts @@ -1,69 +1,128 @@ import * as formatting from "file/paragraph/run/formatting"; import { RunProperties } from "file/paragraph/run/properties"; -import { XmlComponent } from "file/xml-components"; +import { UnderlineType } from "file/paragraph/run/underline"; + import { BasedOn, Link, SemiHidden, UiPriority, UnhideWhenUsed } from "./components"; import { Style } from "./style"; +export interface IBaseCharacterStyleOptions { + readonly basedOn?: string; + readonly link?: string; + readonly semiHidden?: boolean; + readonly run?: { + readonly size?: number; + readonly bold?: boolean; + readonly italics?: boolean; + readonly smallCaps?: boolean; + readonly allCaps?: boolean; + readonly strike?: boolean; + readonly doubleStrike?: boolean; + readonly subScript?: boolean; + readonly superScript?: boolean; + readonly underline?: { + readonly type?: UnderlineType; + readonly color?: string; + }; + readonly color?: string; + readonly font?: string; + readonly characterSpacing?: number; + readonly highlight?: string; + readonly shadow?: { + readonly type: string; + readonly fill: string; + readonly color: string; + }; + }; +} + +export interface ICharacterStyleOptions extends IBaseCharacterStyleOptions { + readonly id: string; + readonly name?: string; +} + export class CharacterStyle extends Style { private readonly runProperties: RunProperties; - constructor(styleId: string, name?: string) { - super({ type: "character", styleId: styleId }, name); + constructor(options: ICharacterStyleOptions) { + super({ type: "character", styleId: options.id }, options.name); this.runProperties = new RunProperties(); this.root.push(this.runProperties); - this.root.push(new UiPriority("99")); + this.root.push(new UiPriority(99)); this.root.push(new UnhideWhenUsed()); - } - public basedOn(parentId: string): CharacterStyle { - this.root.push(new BasedOn(parentId)); - return this; - } + if (options.basedOn) { + this.root.push(new BasedOn(options.basedOn)); + } - public addRunProperty(property: XmlComponent): CharacterStyle { - this.runProperties.push(property); - return this; - } + if (options.link) { + this.root.push(new Link(options.link)); + } - public color(color: string): CharacterStyle { - return this.addRunProperty(new formatting.Color(color)); - } + if (options.semiHidden) { + this.root.push(new SemiHidden()); + } - public bold(): CharacterStyle { - return this.addRunProperty(new formatting.Bold()); - } + if (options.run) { + if (options.run.size) { + this.runProperties.push(new formatting.Size(options.run.size)); + this.runProperties.push(new formatting.SizeComplexScript(options.run.size)); + } - public italics(): CharacterStyle { - return this.addRunProperty(new formatting.Italics()); - } + if (options.run.bold) { + this.runProperties.push(new formatting.Bold()); + } - public underline(underlineType?: string, color?: string): CharacterStyle { - return this.addRunProperty(new formatting.Underline(underlineType, color)); - } + if (options.run.italics) { + this.runProperties.push(new formatting.Italics()); + } - public superScript(): CharacterStyle { - return this.addRunProperty(new formatting.SuperScript()); - } + if (options.run.smallCaps) { + this.runProperties.push(new formatting.SmallCaps()); + } - public size(twips: number): CharacterStyle { - return this.addRunProperty(new formatting.Size(twips)).addRunProperty(new formatting.SizeComplexScript(twips)); - } + if (options.run.allCaps) { + this.runProperties.push(new formatting.Caps()); + } - public link(link: string): CharacterStyle { - this.root.push(new Link(link)); - return this; - } + if (options.run.strike) { + this.runProperties.push(new formatting.Strike()); + } - public semiHidden(): CharacterStyle { - this.root.push(new SemiHidden()); - return this; - } + if (options.run.doubleStrike) { + this.runProperties.push(new formatting.DoubleStrike()); + } - public highlight(color: string): CharacterStyle { - return this.addRunProperty(new formatting.Highlight(color)); - } + if (options.run.subScript) { + this.runProperties.push(new formatting.SubScript()); + } - public shadow(value: string, fill: string, color: string): CharacterStyle { - return this.addRunProperty(new formatting.Shading(value, fill, color)); + if (options.run.superScript) { + this.runProperties.push(new formatting.SuperScript()); + } + + if (options.run.underline) { + this.runProperties.push(new formatting.Underline(options.run.underline.type, options.run.underline.color)); + } + + if (options.run.color) { + this.runProperties.push(new formatting.Color(options.run.color)); + } + + if (options.run.font) { + this.runProperties.push(new formatting.RunFonts(options.run.font)); + } + + if (options.run.characterSpacing) { + this.runProperties.push(new formatting.CharacterSpacing(options.run.characterSpacing)); + } + + if (options.run.highlight) { + this.runProperties.push(new formatting.Highlight(options.run.highlight)); + } + + if (options.run.shadow) { + this.runProperties.push(new formatting.Shading(options.run.shadow.type, options.run.shadow.fill, options.run.shadow.color)); + } + } } } diff --git a/src/file/styles/style/components.spec.ts b/src/file/styles/style/components.spec.ts index 7542cf009f..b1720ef4b4 100644 --- a/src/file/styles/style/components.spec.ts +++ b/src/file/styles/style/components.spec.ts @@ -30,9 +30,9 @@ describe("Style components", () => { }); it("UiPriority#constructor", () => { - const style = new components.UiPriority("123"); + const style = new components.UiPriority(123); const tree = new Formatter().format(style); - expect(tree).to.deep.equal({ "w:uiPriority": { _attr: { "w:val": "123" } } }); + expect(tree).to.deep.equal({ "w:uiPriority": { _attr: { "w:val": 123 } } }); }); it("UnhideWhenUsed#constructor", () => { diff --git a/src/file/styles/style/components.ts b/src/file/styles/style/components.ts index 019b50624b..a051a75005 100644 --- a/src/file/styles/style/components.ts +++ b/src/file/styles/style/components.ts @@ -1,7 +1,8 @@ +// http://officeopenxml.com/WPstyleGenProps.php import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; interface IComponentAttributes { - readonly val: string; + readonly val: string | number; } class ComponentAttributes extends XmlAttributeComponent { @@ -37,7 +38,7 @@ export class Link extends XmlComponent { } export class UiPriority extends XmlComponent { - constructor(value: string) { + constructor(value: number) { super("w:uiPriority"); // TODO: this value should be a ST_DecimalNumber this.root.push(new ComponentAttributes({ val: value })); diff --git a/src/file/styles/style/default-styles.spec.ts b/src/file/styles/style/default-styles.spec.ts index ac6022583b..1cf26ba482 100644 --- a/src/file/styles/style/default-styles.spec.ts +++ b/src/file/styles/style/default-styles.spec.ts @@ -1,12 +1,15 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; -import * as defaultStyels from "./default-styles"; +import * as defaultStyles from "./default-styles"; import { EMPTY_OBJECT } from "file/xml-components"; describe("Default Styles", () => { it("HeadingStyle#constructor", () => { - const style = new defaultStyels.HeadingStyle("Heading1", "Heading 1"); + const style = new defaultStyles.HeadingStyle({ + id: "Heading1", + name: "Heading 1", + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -20,7 +23,7 @@ describe("Default Styles", () => { }); it("TitleStyle#constructor", () => { - const style = new defaultStyels.TitleStyle(); + const style = new defaultStyles.TitleStyle({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -34,7 +37,7 @@ describe("Default Styles", () => { }); it("Heading1Style#constructor", () => { - const style = new defaultStyels.Heading1Style(); + const style = new defaultStyles.Heading1Style({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -48,7 +51,7 @@ describe("Default Styles", () => { }); it("Heading2Style#constructor", () => { - const style = new defaultStyels.Heading2Style(); + const style = new defaultStyles.Heading2Style({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -62,7 +65,7 @@ describe("Default Styles", () => { }); it("Heading3Style#constructor", () => { - const style = new defaultStyels.Heading3Style(); + const style = new defaultStyles.Heading3Style({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -76,7 +79,7 @@ describe("Default Styles", () => { }); it("Heading4Style#constructor", () => { - const style = new defaultStyels.Heading4Style(); + const style = new defaultStyles.Heading4Style({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -90,7 +93,7 @@ describe("Default Styles", () => { }); it("Heading5Style#constructor", () => { - const style = new defaultStyels.Heading5Style(); + const style = new defaultStyles.Heading5Style({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -104,7 +107,7 @@ describe("Default Styles", () => { }); it("Heading6Style#constructor", () => { - const style = new defaultStyels.Heading6Style(); + const style = new defaultStyles.Heading6Style({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -118,7 +121,7 @@ describe("Default Styles", () => { }); it("ListParagraph#constructor", () => { - const style = new defaultStyels.ListParagraph(); + const style = new defaultStyles.ListParagraph({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -131,7 +134,7 @@ describe("Default Styles", () => { }); it("FootnoteText#constructor", () => { - const style = new defaultStyels.FootnoteText(); + const style = new defaultStyles.FootnoteText({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -171,14 +174,14 @@ describe("Default Styles", () => { { "w:basedOn": { _attr: { "w:val": "Normal" } } }, { "w:link": { _attr: { "w:val": "FootnoteTextChar" } } }, { - "w:uiPriority": { - _attr: { - "w:val": "99", - }, - }, + "w:semiHidden": EMPTY_OBJECT, }, { - "w:semiHidden": EMPTY_OBJECT, + "w:uiPriority": { + _attr: { + "w:val": 99, + }, + }, }, { "w:unhideWhenUsed": EMPTY_OBJECT, @@ -188,7 +191,7 @@ describe("Default Styles", () => { }); it("FootnoteReferenceStyle#constructor", () => { - const style = new defaultStyels.FootnoteReferenceStyle(); + const style = new defaultStyles.FootnoteReferenceStyle({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -208,7 +211,7 @@ describe("Default Styles", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -225,7 +228,7 @@ describe("Default Styles", () => { }); it("FootnoteTextChar#constructor", () => { - const style = new defaultStyels.FootnoteTextChar(); + const style = new defaultStyles.FootnoteTextChar({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -252,7 +255,7 @@ describe("Default Styles", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -269,19 +272,28 @@ describe("Default Styles", () => { }); it("HyperlinkStyle#constructor", () => { - const style = new defaultStyels.HyperlinkStyle(); + const style = new defaultStyles.HyperlinkStyle({}); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ { _attr: { "w:type": "character", "w:styleId": "Hyperlink" } }, { "w:name": { _attr: { "w:val": "Hyperlink" } } }, { - "w:rPr": [{ "w:color": { _attr: { "w:val": "0563C1" } } }, { "w:u": { _attr: { "w:val": "single" } } }], + "w:rPr": [ + { "w:u": { _attr: { "w:val": "single" } } }, + { + "w:color": { + _attr: { + "w:val": "0563C1", + }, + }, + }, + ], }, { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, diff --git a/src/file/styles/style/default-styles.ts b/src/file/styles/style/default-styles.ts index d9572499c2..8974435a95 100644 --- a/src/file/styles/style/default-styles.ts +++ b/src/file/styles/style/default-styles.ts @@ -1,106 +1,170 @@ -import { CharacterStyle } from "./character-style"; -import { ParagraphStyle } from "./paragraph-style"; +import { UnderlineType } from "file/paragraph/run/underline"; + +import { CharacterStyle, IBaseCharacterStyleOptions } from "./character-style"; +import { IBaseParagraphStyleOptions, IParagraphStyleOptions, ParagraphStyle } from "./paragraph-style"; export class HeadingStyle extends ParagraphStyle { - constructor(styleId: string, name: string) { - super(styleId, name); - this.basedOn("Normal"); - this.next("Normal"); - this.quickFormat(); + constructor(options: IParagraphStyleOptions) { + super({ + ...options, + basedOn: "Normal", + next: "Normal", + quickFormat: true, + }); } } export class TitleStyle extends HeadingStyle { - constructor() { - super("Title", "Title"); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "Title", + name: "Title", + }); } } export class Heading1Style extends HeadingStyle { - constructor() { - super("Heading1", "Heading 1"); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "Heading1", + name: "Heading 1", + }); } } export class Heading2Style extends HeadingStyle { - constructor() { - super("Heading2", "Heading 2"); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "Heading2", + name: "Heading 2", + }); } } export class Heading3Style extends HeadingStyle { - constructor() { - super("Heading3", "Heading 3"); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "Heading3", + name: "Heading 3", + }); } } export class Heading4Style extends HeadingStyle { - constructor() { - super("Heading4", "Heading 4"); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "Heading4", + name: "Heading 4", + }); } } export class Heading5Style extends HeadingStyle { - constructor() { - super("Heading5", "Heading 5"); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "Heading5", + name: "Heading 5", + }); } } export class Heading6Style extends HeadingStyle { - constructor() { - super("Heading6", "Heading 6"); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "Heading6", + name: "Heading 6", + }); } } export class ListParagraph extends ParagraphStyle { - constructor() { - super("ListParagraph", "List Paragraph"); - this.basedOn("Normal"); - this.quickFormat(); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "ListParagraph", + name: "List Paragraph", + basedOn: "Normal", + quickFormat: true, + }); } } export class FootnoteText extends ParagraphStyle { - constructor() { - super("FootnoteText", "footnote text"); - this.basedOn("Normal") - .link("FootnoteTextChar") - .uiPriority("99") - .semiHidden() - .unhideWhenUsed() - .spacing({ - after: 0, - line: 240, - lineRule: "auto", - }) - .size(20); + constructor(options: IBaseParagraphStyleOptions) { + super({ + ...options, + id: "FootnoteText", + name: "footnote text", + link: "FootnoteTextChar", + basedOn: "Normal", + uiPriority: 99, + semiHidden: true, + unhideWhenUsed: true, + paragraph: { + spacing: { + after: 0, + line: 240, + lineRule: "auto", + }, + }, + run: { + size: 20, + }, + }); } } export class FootnoteReferenceStyle extends CharacterStyle { - constructor() { - super("FootnoteReference", "footnote reference"); - this.basedOn("DefaultParagraphFont") - .semiHidden() - .superScript(); + constructor(options: IBaseCharacterStyleOptions) { + super({ + ...options, + id: "FootnoteReference", + name: "footnote reference", + basedOn: "DefaultParagraphFont", + semiHidden: true, + run: { + superScript: true, + }, + }); } } export class FootnoteTextChar extends CharacterStyle { - constructor() { - super("FootnoteTextChar", "Footnote Text Char"); - this.basedOn("DefaultParagraphFont") - .link("FootnoteText") - .semiHidden() - .size(20); + constructor(options: IBaseCharacterStyleOptions) { + super({ + ...options, + id: "FootnoteTextChar", + name: "Footnote Text Char", + basedOn: "DefaultParagraphFont", + link: "FootnoteText", + semiHidden: true, + run: { + size: 20, + }, + }); } } export class HyperlinkStyle extends CharacterStyle { - constructor() { - super("Hyperlink", "Hyperlink"); - this.basedOn("DefaultParagraphFont") - .color("0563C1") - .underline("single"); + constructor(options: IBaseCharacterStyleOptions) { + super({ + ...options, + id: "Hyperlink", + name: "Hyperlink", + basedOn: "DefaultParagraphFont", + run: { + color: "0563C1", + underline: { + type: UnderlineType.SINGLE, + }, + }, + }); } } diff --git a/src/file/styles/style/paragraph-style.spec.ts b/src/file/styles/style/paragraph-style.spec.ts index d3a77b9a15..93b0c6777c 100644 --- a/src/file/styles/style/paragraph-style.spec.ts +++ b/src/file/styles/style/paragraph-style.spec.ts @@ -1,7 +1,9 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; -import { TabStopPosition } from "file/paragraph"; +import { AlignmentType, TabStopPosition } from "file/paragraph"; +import { UnderlineType } from "file/paragraph/run/underline"; +import { ShadingType } from "file/table"; import { EMPTY_OBJECT } from "file/xml-components"; import { ParagraphStyle } from "./paragraph-style"; @@ -9,7 +11,7 @@ import { ParagraphStyle } from "./paragraph-style"; describe("ParagraphStyle", () => { describe("#constructor", () => { it("should set the style type to paragraph and use the given style id", () => { - const style = new ParagraphStyle("myStyleId"); + const style = new ParagraphStyle({ id: "myStyleId" }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": { _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } }, @@ -17,7 +19,10 @@ describe("ParagraphStyle", () => { }); it("should set the name of the style, if given", () => { - const style = new ParagraphStyle("myStyleId", "Style Name"); + const style = new ParagraphStyle({ + id: "myStyleId", + name: "Style Name", + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -30,7 +35,7 @@ describe("ParagraphStyle", () => { describe("formatting methods: style attributes", () => { it("#basedOn", () => { - const style = new ParagraphStyle("myStyleId").basedOn("otherId"); + const style = new ParagraphStyle({ id: "myStyleId", basedOn: "otherId" }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -41,7 +46,7 @@ describe("ParagraphStyle", () => { }); it("#quickFormat", () => { - const style = new ParagraphStyle("myStyleId").quickFormat(); + const style = new ParagraphStyle({ id: "myStyleId", quickFormat: true }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [{ _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } }, { "w:qFormat": EMPTY_OBJECT }], @@ -49,7 +54,7 @@ describe("ParagraphStyle", () => { }); it("#next", () => { - const style = new ParagraphStyle("myStyleId").next("otherId"); + const style = new ParagraphStyle({ id: "myStyleId", next: "otherId" }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -62,7 +67,12 @@ describe("ParagraphStyle", () => { describe("formatting methods: paragraph properties", () => { it("#indent", () => { - const style = new ParagraphStyle("myStyleId").indent({ left: 720 }); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + indent: { left: 720 }, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -75,7 +85,7 @@ describe("ParagraphStyle", () => { }); it("#spacing", () => { - const style = new ParagraphStyle("myStyleId").spacing({ before: 50, after: 150 }); + const style = new ParagraphStyle({ id: "myStyleId", paragraph: { spacing: { before: 50, after: 150 } } }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -88,7 +98,12 @@ describe("ParagraphStyle", () => { }); it("#center", () => { - const style = new ParagraphStyle("myStyleId").center(); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + alignment: AlignmentType.CENTER, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -101,7 +116,12 @@ describe("ParagraphStyle", () => { }); it("#character spacing", () => { - const style = new ParagraphStyle("myStyleId").characterSpacing(24); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + characterSpacing: 24, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -114,7 +134,12 @@ describe("ParagraphStyle", () => { }); it("#left", () => { - const style = new ParagraphStyle("myStyleId").left(); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + alignment: AlignmentType.LEFT, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -127,7 +152,12 @@ describe("ParagraphStyle", () => { }); it("#right", () => { - const style = new ParagraphStyle("myStyleId").right(); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + alignment: AlignmentType.RIGHT, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -140,7 +170,12 @@ describe("ParagraphStyle", () => { }); it("#justified", () => { - const style = new ParagraphStyle("myStyleId").justified(); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + alignment: AlignmentType.JUSTIFIED, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -153,7 +188,12 @@ describe("ParagraphStyle", () => { }); it("#thematicBreak", () => { - const style = new ParagraphStyle("myStyleId").thematicBreak(); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + thematicBreak: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -181,7 +221,12 @@ describe("ParagraphStyle", () => { }); it("#leftTabStop", () => { - const style = new ParagraphStyle("myStyleId").leftTabStop(1200); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + leftTabStop: 1200, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -198,7 +243,12 @@ describe("ParagraphStyle", () => { }); it("#maxRightTabStop", () => { - const style = new ParagraphStyle("myStyleId").rightTabStop(TabStopPosition.MAX); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + rightTabStop: TabStopPosition.MAX, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -215,7 +265,12 @@ describe("ParagraphStyle", () => { }); it("#keepLines", () => { - const style = new ParagraphStyle("myStyleId").keepLines(); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + keepLines: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [{ _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } }, { "w:pPr": [{ "w:keepLines": EMPTY_OBJECT }] }], @@ -223,7 +278,12 @@ describe("ParagraphStyle", () => { }); it("#keepNext", () => { - const style = new ParagraphStyle("myStyleId").keepNext(); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + keepNext: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [{ _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } }, { "w:pPr": [{ "w:keepNext": EMPTY_OBJECT }] }], @@ -231,7 +291,12 @@ describe("ParagraphStyle", () => { }); it("#outlineLevel", () => { - const style = new ParagraphStyle("myStyleId").outlineLevel(1); + const style = new ParagraphStyle({ + id: "myStyleId", + paragraph: { + outlineLevel: 1, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -244,7 +309,12 @@ describe("ParagraphStyle", () => { describe("formatting methods: run properties", () => { it("#size", () => { - const style = new ParagraphStyle("myStyleId").size(24); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + size: 24, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -257,7 +327,12 @@ describe("ParagraphStyle", () => { }); it("#smallCaps", () => { - const style = new ParagraphStyle("myStyleId").smallCaps(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + smallCaps: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -270,7 +345,12 @@ describe("ParagraphStyle", () => { }); it("#allCaps", () => { - const style = new ParagraphStyle("myStyleId").allCaps(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + allCaps: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -283,7 +363,12 @@ describe("ParagraphStyle", () => { }); it("#strike", () => { - const style = new ParagraphStyle("myStyleId").strike(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + strike: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -296,7 +381,12 @@ describe("ParagraphStyle", () => { }); it("#doubleStrike", () => { - const style = new ParagraphStyle("myStyleId").doubleStrike(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + doubleStrike: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -309,7 +399,12 @@ describe("ParagraphStyle", () => { }); it("#subScript", () => { - const style = new ParagraphStyle("myStyleId").subScript(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + subScript: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -322,7 +417,12 @@ describe("ParagraphStyle", () => { }); it("#superScript", () => { - const style = new ParagraphStyle("myStyleId").superScript(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + superScript: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -335,7 +435,12 @@ describe("ParagraphStyle", () => { }); it("#font", () => { - const style = new ParagraphStyle("myStyleId").font("Times"); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + font: "Times", + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -350,7 +455,12 @@ describe("ParagraphStyle", () => { }); it("#bold", () => { - const style = new ParagraphStyle("myStyleId").bold(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + bold: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -363,7 +473,12 @@ describe("ParagraphStyle", () => { }); it("#italics", () => { - const style = new ParagraphStyle("myStyleId").italics(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + italics: true, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -376,7 +491,12 @@ describe("ParagraphStyle", () => { }); it("#highlight", () => { - const style = new ParagraphStyle("myStyleId").highlight("005599"); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + highlight: "005599", + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -389,7 +509,16 @@ describe("ParagraphStyle", () => { }); it("#shadow", () => { - const style = new ParagraphStyle("myStyleId").shadow("pct10", "00FFFF", "FF0000"); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + shadow: { + type: ShadingType.PERCENT_10, + fill: "00FFFF", + color: "FF0000", + }, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -403,7 +532,12 @@ describe("ParagraphStyle", () => { describe("#underline", () => { it("should set underline to 'single' if no arguments are given", () => { - const style = new ParagraphStyle("myStyleId").underline(); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + underline: {}, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -416,7 +550,14 @@ describe("ParagraphStyle", () => { }); it("should set the style if given", () => { - const style = new ParagraphStyle("myStyleId").underline("double"); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + underline: { + type: UnderlineType.DOUBLE, + }, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -429,7 +570,15 @@ describe("ParagraphStyle", () => { }); it("should set the style and color if given", () => { - const style = new ParagraphStyle("myStyleId").underline("double", "005599"); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + underline: { + type: UnderlineType.DOUBLE, + color: "005599", + }, + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -443,7 +592,12 @@ describe("ParagraphStyle", () => { }); it("#color", () => { - const style = new ParagraphStyle("myStyleId").color("123456"); + const style = new ParagraphStyle({ + id: "myStyleId", + run: { + color: "123456", + }, + }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -456,7 +610,7 @@ describe("ParagraphStyle", () => { }); it("#link", () => { - const style = new ParagraphStyle("myStyleId").link("MyLink"); + const style = new ParagraphStyle({ id: "myStyleId", link: "MyLink" }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [{ _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } }, { "w:link": { _attr: { "w:val": "MyLink" } } }], @@ -464,7 +618,7 @@ describe("ParagraphStyle", () => { }); it("#semiHidden", () => { - const style = new ParagraphStyle("myStyleId").semiHidden(); + const style = new ParagraphStyle({ id: "myStyleId", semiHidden: true }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [{ _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } }, { "w:semiHidden": EMPTY_OBJECT }], @@ -472,7 +626,7 @@ describe("ParagraphStyle", () => { }); it("#uiPriority", () => { - const style = new ParagraphStyle("myStyleId").uiPriority("99"); + const style = new ParagraphStyle({ id: "myStyleId", uiPriority: 99 }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [ @@ -480,7 +634,7 @@ describe("ParagraphStyle", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -489,7 +643,7 @@ describe("ParagraphStyle", () => { }); it("#unhideWhenUsed", () => { - const style = new ParagraphStyle("myStyleId").unhideWhenUsed(); + const style = new ParagraphStyle({ id: "myStyleId", unhideWhenUsed: true }); const tree = new Formatter().format(style); expect(tree).to.deep.equal({ "w:style": [{ _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } }, { "w:unhideWhenUsed": EMPTY_OBJECT }], diff --git a/src/file/styles/style/paragraph-style.ts b/src/file/styles/style/paragraph-style.ts index 360e2924de..ab9f75ccec 100644 --- a/src/file/styles/style/paragraph-style.ts +++ b/src/file/styles/style/paragraph-style.ts @@ -14,179 +14,199 @@ import { import { RightTabStop } from "file/paragraph/formatting"; import * as formatting from "file/paragraph/run/formatting"; import { RunProperties } from "file/paragraph/run/properties"; -import { XmlComponent } from "file/xml-components"; +import { UnderlineType } from "file/paragraph/run/underline"; +import { ShadingType } from "file/table"; + import { BasedOn, Link, Next, QuickFormat, SemiHidden, UiPriority, UnhideWhenUsed } from "./components"; import { Style } from "./style"; +export interface IBaseParagraphStyleOptions { + readonly basedOn?: string; + readonly next?: string; + readonly quickFormat?: boolean; + readonly link?: string; + readonly semiHidden?: boolean; + readonly uiPriority?: number; + readonly unhideWhenUsed?: boolean; + readonly run?: { + readonly size?: number; + readonly bold?: boolean; + readonly italics?: boolean; + readonly smallCaps?: boolean; + readonly allCaps?: boolean; + readonly strike?: boolean; + readonly doubleStrike?: boolean; + readonly subScript?: boolean; + readonly superScript?: boolean; + readonly underline?: { + readonly type?: UnderlineType; + readonly color?: string; + }; + readonly color?: string; + readonly font?: string; + readonly characterSpacing?: number; + readonly highlight?: string; + readonly shadow?: { + readonly type: ShadingType; + readonly fill: string; + readonly color: string; + }; + }; + readonly paragraph?: { + readonly alignment?: AlignmentType; + readonly thematicBreak?: boolean; + readonly rightTabStop?: number; + readonly leftTabStop?: number; + readonly indent?: object; + readonly spacing?: ISpacingProperties; + readonly keepNext?: boolean; + readonly keepLines?: boolean; + readonly outlineLevel?: number; + }; +} + +export interface IParagraphStyleOptions extends IBaseParagraphStyleOptions { + readonly id: string; + readonly name?: string; +} export class ParagraphStyle extends Style { private readonly paragraphProperties: ParagraphProperties; private readonly runProperties: RunProperties; - constructor(styleId: string, name?: string) { - super({ type: "paragraph", styleId: styleId }, name); + constructor(options: IParagraphStyleOptions) { + super({ type: "paragraph", styleId: options.id }, options.name); this.paragraphProperties = new ParagraphProperties({}); this.runProperties = new RunProperties(); this.root.push(this.paragraphProperties); this.root.push(this.runProperties); - } - public addParagraphProperty(property: XmlComponent): ParagraphStyle { - this.paragraphProperties.push(property); - return this; - } + if (options.basedOn) { + this.root.push(new BasedOn(options.basedOn)); + } - public outlineLevel(level: number): ParagraphStyle { - this.paragraphProperties.push(new OutlineLevel(level)); - return this; - } + if (options.next) { + this.root.push(new Next(options.next)); + } - public addRunProperty(property: XmlComponent): ParagraphStyle { - this.runProperties.push(property); - return this; - } + if (options.quickFormat) { + this.root.push(new QuickFormat()); + } - public basedOn(parentId: string): ParagraphStyle { - this.root.push(new BasedOn(parentId)); - return this; - } + if (options.link) { + this.root.push(new Link(options.link)); + } - public quickFormat(): ParagraphStyle { - this.root.push(new QuickFormat()); - return this; - } + if (options.semiHidden) { + this.root.push(new SemiHidden()); + } - public next(nextId: string): ParagraphStyle { - this.root.push(new Next(nextId)); - return this; - } + if (options.uiPriority) { + this.root.push(new UiPriority(options.uiPriority)); + } - // ---------- Run formatting ---------------------- // + if (options.unhideWhenUsed) { + this.root.push(new UnhideWhenUsed()); + } - public size(twips: number): ParagraphStyle { - return this.addRunProperty(new formatting.Size(twips)).addRunProperty(new formatting.SizeComplexScript(twips)); - } + if (options.run) { + if (options.run.size) { + this.runProperties.push(new formatting.Size(options.run.size)); + this.runProperties.push(new formatting.SizeComplexScript(options.run.size)); + } - public bold(): ParagraphStyle { - return this.addRunProperty(new formatting.Bold()); - } + if (options.run.bold) { + this.runProperties.push(new formatting.Bold()); + } - public italics(): ParagraphStyle { - return this.addRunProperty(new formatting.Italics()); - } + if (options.run.italics) { + this.runProperties.push(new formatting.Italics()); + } - public smallCaps(): ParagraphStyle { - return this.addRunProperty(new formatting.SmallCaps()); - } + if (options.run.smallCaps) { + this.runProperties.push(new formatting.SmallCaps()); + } - public allCaps(): ParagraphStyle { - return this.addRunProperty(new formatting.Caps()); - } + if (options.run.allCaps) { + this.runProperties.push(new formatting.Caps()); + } - public strike(): ParagraphStyle { - return this.addRunProperty(new formatting.Strike()); - } + if (options.run.strike) { + this.runProperties.push(new formatting.Strike()); + } - public doubleStrike(): ParagraphStyle { - return this.addRunProperty(new formatting.DoubleStrike()); - } + if (options.run.doubleStrike) { + this.runProperties.push(new formatting.DoubleStrike()); + } - public subScript(): ParagraphStyle { - return this.addRunProperty(new formatting.SubScript()); - } + if (options.run.subScript) { + this.runProperties.push(new formatting.SubScript()); + } - public superScript(): ParagraphStyle { - return this.addRunProperty(new formatting.SuperScript()); - } + if (options.run.superScript) { + this.runProperties.push(new formatting.SuperScript()); + } - public underline(underlineType?: string, color?: string): ParagraphStyle { - return this.addRunProperty(new formatting.Underline(underlineType, color)); - } + if (options.run.underline) { + this.runProperties.push(new formatting.Underline(options.run.underline.type, options.run.underline.color)); + } - public color(color: string): ParagraphStyle { - return this.addRunProperty(new formatting.Color(color)); - } + if (options.run.color) { + this.runProperties.push(new formatting.Color(options.run.color)); + } - public font(fontName: string): ParagraphStyle { - return this.addRunProperty(new formatting.RunFonts(fontName)); - } + if (options.run.font) { + this.runProperties.push(new formatting.RunFonts(options.run.font)); + } - public characterSpacing(value: number): ParagraphStyle { - return this.addRunProperty(new formatting.CharacterSpacing(value)); - } + if (options.run.characterSpacing) { + this.runProperties.push(new formatting.CharacterSpacing(options.run.characterSpacing)); + } - public highlight(color: string): ParagraphStyle { - return this.addRunProperty(new formatting.Highlight(color)); - } + if (options.run.highlight) { + this.runProperties.push(new formatting.Highlight(options.run.highlight)); + } - public shadow(value: string, fill: string, color: string): ParagraphStyle { - return this.addRunProperty(new formatting.Shading(value, fill, color)); - } + if (options.run.shadow) { + this.runProperties.push(new formatting.Shading(options.run.shadow.type, options.run.shadow.fill, options.run.shadow.color)); + } + } - // --------------------- Paragraph formatting ------------------------ // + if (options.paragraph) { + if (options.paragraph.alignment) { + this.paragraphProperties.push(new Alignment(options.paragraph.alignment)); + } - public center(): ParagraphStyle { - return this.addParagraphProperty(new Alignment(AlignmentType.CENTER)); - } + if (options.paragraph.thematicBreak) { + this.paragraphProperties.push(new ThematicBreak()); + } - public left(): ParagraphStyle { - return this.addParagraphProperty(new Alignment(AlignmentType.LEFT)); - } + if (options.paragraph.rightTabStop) { + this.paragraphProperties.push(new RightTabStop(options.paragraph.rightTabStop)); + } - public right(): ParagraphStyle { - return this.addParagraphProperty(new Alignment(AlignmentType.RIGHT)); - } + if (options.paragraph.leftTabStop) { + this.paragraphProperties.push(new LeftTabStop(options.paragraph.leftTabStop)); + } - public justified(): ParagraphStyle { - return this.addParagraphProperty(new Alignment(AlignmentType.BOTH)); - } + if (options.paragraph.indent) { + this.paragraphProperties.push(new Indent(options.paragraph.indent)); + } - public thematicBreak(): ParagraphStyle { - return this.addParagraphProperty(new ThematicBreak()); - } + if (options.paragraph.spacing) { + this.paragraphProperties.push(new Spacing(options.paragraph.spacing)); + } - public rightTabStop(position: number): ParagraphStyle { - return this.addParagraphProperty(new RightTabStop(position)); - } + if (options.paragraph.keepNext) { + this.paragraphProperties.push(new KeepNext()); + } - public leftTabStop(position: number): ParagraphStyle { - return this.addParagraphProperty(new LeftTabStop(position)); - } + if (options.paragraph.keepLines) { + this.paragraphProperties.push(new KeepLines()); + } - public indent(attrs: object): ParagraphStyle { - return this.addParagraphProperty(new Indent(attrs)); - } - - public spacing(params: ISpacingProperties): ParagraphStyle { - return this.addParagraphProperty(new Spacing(params)); - } - - public keepNext(): ParagraphStyle { - return this.addParagraphProperty(new KeepNext()); - } - - public keepLines(): ParagraphStyle { - return this.addParagraphProperty(new KeepLines()); - } - - /*-------------- Style Properties -----------------*/ - - public link(link: string): ParagraphStyle { - this.root.push(new Link(link)); - return this; - } - - public semiHidden(): ParagraphStyle { - this.root.push(new SemiHidden()); - return this; - } - - public uiPriority(priority: string): ParagraphStyle { - this.root.push(new UiPriority(priority)); - return this; - } - - public unhideWhenUsed(): ParagraphStyle { - this.root.push(new UnhideWhenUsed()); - return this; + if (options.paragraph.outlineLevel) { + this.paragraphProperties.push(new OutlineLevel(options.paragraph.outlineLevel)); + } + } } } diff --git a/src/file/styles/styles.spec.ts b/src/file/styles/styles.spec.ts index 69c0bd931e..acc782c743 100644 --- a/src/file/styles/styles.spec.ts +++ b/src/file/styles/styles.spec.ts @@ -1,31 +1,20 @@ -import { assert, expect } from "chai"; +import { expect } from "chai"; import { Formatter } from "export/formatter"; - -import { CharacterStyle, ParagraphStyle } from "./style"; +import { EMPTY_OBJECT } from "file/xml-components"; import { Styles } from "./styles"; -import { EMPTY_OBJECT } from "file/xml-components"; - describe("Styles", () => { - let styles: Styles; - - beforeEach(() => { - styles = new Styles(); - }); - - describe("#constructor()", () => { - it("should create styles with correct rootKey", () => { - const newJson = JSON.parse(JSON.stringify(styles)); - assert.equal(newJson.rootKey, "w:styles"); - }); - }); - describe("#createParagraphStyle", () => { it("should create a new paragraph style and push it onto this collection", () => { - const pStyle = styles.createParagraphStyle("pStyleId"); - expect(pStyle).to.instanceOf(ParagraphStyle); + const styles = new Styles({ + paragraphStyles: [ + { + id: "pStyleId", + }, + ], + }); const tree = new Formatter().format(styles)["w:styles"].filter((x) => !x._attr); expect(tree).to.deep.equal([ { @@ -35,8 +24,14 @@ describe("Styles", () => { }); it("should set the paragraph name if given", () => { - const pStyle = styles.createParagraphStyle("pStyleId", "Paragraph Style"); - expect(pStyle).to.instanceOf(ParagraphStyle); + const styles = new Styles({ + paragraphStyles: [ + { + id: "pStyleId", + name: "Paragraph Style", + }, + ], + }); const tree = new Formatter().format(styles)["w:styles"].filter((x) => !x._attr); expect(tree).to.deep.equal([ { @@ -51,8 +46,13 @@ describe("Styles", () => { describe("#createCharacterStyle", () => { it("should create a new character style and push it onto this collection", () => { - const cStyle = styles.createCharacterStyle("pStyleId"); - expect(cStyle).to.instanceOf(CharacterStyle); + const styles = new Styles({ + characterStyles: [ + { + id: "pStyleId", + }, + ], + }); const tree = new Formatter().format(styles)["w:styles"].filter((x) => !x._attr); expect(tree).to.deep.equal([ { @@ -61,7 +61,7 @@ describe("Styles", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, @@ -74,8 +74,14 @@ describe("Styles", () => { }); it("should set the character name if given", () => { - const cStyle = styles.createCharacterStyle("pStyleId", "Character Style"); - expect(cStyle).to.instanceOf(CharacterStyle); + const styles = new Styles({ + characterStyles: [ + { + id: "pStyleId", + name: "Character Style", + }, + ], + }); const tree = new Formatter().format(styles)["w:styles"].filter((x) => !x._attr); expect(tree).to.deep.equal([ { @@ -85,7 +91,7 @@ describe("Styles", () => { { "w:uiPriority": { _attr: { - "w:val": "99", + "w:val": 99, }, }, }, diff --git a/src/file/styles/styles.ts b/src/file/styles/styles.ts index ff38f5ec6e..6e5baa8f2a 100644 --- a/src/file/styles/styles.ts +++ b/src/file/styles/styles.ts @@ -1,36 +1,48 @@ -import { BaseXmlComponent, XmlComponent } from "file/xml-components"; +import { BaseXmlComponent, ImportedXmlComponent, XmlComponent } from "file/xml-components"; + import { DocumentDefaults } from "./defaults"; import { CharacterStyle, ParagraphStyle } from "./style"; +import { ICharacterStyleOptions } from "./style/character-style"; +import { IParagraphStyleOptions } from "./style/paragraph-style"; export * from "./border"; -export class Styles extends XmlComponent { - constructor(initialStyles?: BaseXmlComponent) { - super("w:styles"); - if (initialStyles) { - this.root.push(initialStyles); - } - } +interface IStylesOptions { + readonly initialStyles?: BaseXmlComponent; + readonly paragraphStyles?: IParagraphStyleOptions[]; + readonly characterStyles?: ICharacterStyleOptions[]; + readonly importedStyles?: Array; +} - public push(style: XmlComponent): Styles { - this.root.push(style); - return this; +export class Styles extends XmlComponent { + constructor(options: IStylesOptions) { + super("w:styles"); + + if (options.initialStyles) { + this.root.push(options.initialStyles); + } + + if (options.paragraphStyles) { + for (const style of options.paragraphStyles) { + this.root.push(new ParagraphStyle(style)); + } + } + + if (options.characterStyles) { + for (const style of options.characterStyles) { + this.root.push(new CharacterStyle(style)); + } + } + + if (options.importedStyles) { + for (const style of options.importedStyles) { + this.root.push(style); + } + } } public createDocumentDefaults(): DocumentDefaults { const defaults = new DocumentDefaults(); - this.push(defaults); + this.root.push(defaults); return defaults; } - - public createParagraphStyle(styleId: string, name?: string): ParagraphStyle { - const paragraphStyle = new ParagraphStyle(styleId, name); - this.push(paragraphStyle); - return paragraphStyle; - } - - public createCharacterStyle(styleId: string, name?: string): CharacterStyle { - const characterStyle = new CharacterStyle(styleId, name); - this.push(characterStyle); - return characterStyle; - } } From 10ab3c70bf728f3820fc4f5326bb40d6c3e58678 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 4 Oct 2019 02:37:22 +0100 Subject: [PATCH 35/57] Add back default styles --- demo/2-declaritive-styles.ts | 6 +++--- src/file/core-properties/properties.ts | 5 +++-- src/file/file.ts | 9 +++++++-- src/file/styles/factory.ts | 11 ++++------- src/file/styles/styles.ts | 21 +++++++-------------- 5 files changed, 24 insertions(+), 28 deletions(-) diff --git a/demo/2-declaritive-styles.ts b/demo/2-declaritive-styles.ts index 04502264a3..eaf39daffe 100644 --- a/demo/2-declaritive-styles.ts +++ b/demo/2-declaritive-styles.ts @@ -1,13 +1,13 @@ // Example on how to customise the look at feel using Styles // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph, Styles, TextRun, UnderlineType } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, TextRun, UnderlineType } from "../build"; const doc = new Document({ creator: "Clippy", title: "Sample Document", description: "A brief example of using docx", - styles: new Styles({ + styles: { paragraphStyles: [ { id: "Heading1", @@ -81,7 +81,7 @@ const doc = new Document({ quickFormat: true, }, ], - }), + }, }); const numberedAbstract = doc.Numbering.createAbstractNumbering(); diff --git a/src/file/core-properties/properties.ts b/src/file/core-properties/properties.ts index 7d3e447523..a99c74d98f 100644 --- a/src/file/core-properties/properties.ts +++ b/src/file/core-properties/properties.ts @@ -1,6 +1,7 @@ import { XmlComponent } from "file/xml-components"; + import { DocumentAttributes } from "../document/document-attributes"; -import { Styles } from "../styles"; +import { IStylesOptions } from "../styles"; import { Created, Creator, Description, Keywords, LastModifiedBy, Modified, Revision, Subject, Title } from "./components"; export interface IPropertiesOptions { @@ -12,7 +13,7 @@ export interface IPropertiesOptions { readonly lastModifiedBy?: string; readonly revision?: string; readonly externalStyles?: string; - readonly styles?: Styles; + readonly styles?: IStylesOptions; } export class CoreProperties extends XmlComponent { diff --git a/src/file/file.ts b/src/file/file.ts index f68760328d..ccf5fe374c 100644 --- a/src/file/file.ts +++ b/src/file/file.ts @@ -97,10 +97,15 @@ export class File { const stylesFactory = new ExternalStylesFactory(); this.styles = stylesFactory.newInstance(options.externalStyles); } else if (options.styles) { - this.styles = options.styles; + const stylesFactory = new DefaultStylesFactory(); + const defaultStyles = stylesFactory.newInstance(); + this.styles = new Styles({ + ...defaultStyles, + ...options.styles, + }); } else { const stylesFactory = new DefaultStylesFactory(); - this.styles = stylesFactory.newInstance(); + this.styles = new Styles(stylesFactory.newInstance()); } this.addDefaultRelationships(); diff --git a/src/file/styles/factory.ts b/src/file/styles/factory.ts index d43f46b732..f5bca8248d 100644 --- a/src/file/styles/factory.ts +++ b/src/file/styles/factory.ts @@ -1,5 +1,5 @@ import { DocumentAttributes } from "../document/document-attributes"; -import { Styles } from "./styles"; +import { IStylesOptions } from "./styles"; import { DocumentDefaults } from "./defaults"; import { @@ -18,7 +18,7 @@ import { } from "./style"; export class DefaultStylesFactory { - public newInstance(): Styles { + public newInstance(): IStylesOptions { const documentAttributes = new DocumentAttributes({ mc: "http://schemas.openxmlformats.org/markup-compatibility/2006", r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships", @@ -27,7 +27,7 @@ export class DefaultStylesFactory { w15: "http://schemas.microsoft.com/office/word/2012/wordml", Ignorable: "w14 w15", }); - const styles = new Styles({ + return { initialStyles: documentAttributes, importedStyles: [ new DocumentDefaults(), @@ -76,9 +76,6 @@ export class DefaultStylesFactory { new FootnoteText({}), new FootnoteTextChar({}), ], - }); - styles.createDocumentDefaults(); - - return styles; + }; } } diff --git a/src/file/styles/styles.ts b/src/file/styles/styles.ts index 6e5baa8f2a..064411e419 100644 --- a/src/file/styles/styles.ts +++ b/src/file/styles/styles.ts @@ -1,12 +1,11 @@ import { BaseXmlComponent, ImportedXmlComponent, XmlComponent } from "file/xml-components"; -import { DocumentDefaults } from "./defaults"; import { CharacterStyle, ParagraphStyle } from "./style"; import { ICharacterStyleOptions } from "./style/character-style"; import { IParagraphStyleOptions } from "./style/paragraph-style"; export * from "./border"; -interface IStylesOptions { +export interface IStylesOptions { readonly initialStyles?: BaseXmlComponent; readonly paragraphStyles?: IParagraphStyleOptions[]; readonly characterStyles?: ICharacterStyleOptions[]; @@ -21,6 +20,12 @@ export class Styles extends XmlComponent { this.root.push(options.initialStyles); } + if (options.importedStyles) { + for (const style of options.importedStyles) { + this.root.push(style); + } + } + if (options.paragraphStyles) { for (const style of options.paragraphStyles) { this.root.push(new ParagraphStyle(style)); @@ -32,17 +37,5 @@ export class Styles extends XmlComponent { this.root.push(new CharacterStyle(style)); } } - - if (options.importedStyles) { - for (const style of options.importedStyles) { - this.root.push(style); - } - } - } - - public createDocumentDefaults(): DocumentDefaults { - const defaults = new DocumentDefaults(); - this.root.push(defaults); - return defaults; } } From a37c9d8f2f9a81345df91bf345d705cc590da5d6 Mon Sep 17 00:00:00 2001 From: James Montalvo Date: Thu, 3 Oct 2019 22:12:23 -0500 Subject: [PATCH 36/57] Revert "fix: try to remove unnecessary paragraph", which caused #418 This reverts commit cb7486824764ac25ae5617e1a7028dd957376f02. --- .nycrc | 6 +++--- src/file/document/body/body.spec.ts | 3 +++ src/file/document/body/body.ts | 13 ++++++++++++- src/file/file.spec.ts | 24 ++++++++++++------------ 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.nycrc b/.nycrc index 1e3c3b1e22..d5f12ccbc3 100644 --- a/.nycrc +++ b/.nycrc @@ -1,9 +1,9 @@ { "check-coverage": true, - "lines": 92.34, - "functions": 88.27, + "lines": 92.35, + "functions": 88.28, "branches": 84.64, - "statements": 92.15, + "statements": 92.16, "include": [ "src/**/*.ts" ], diff --git a/src/file/document/body/body.spec.ts b/src/file/document/body/body.spec.ts index b63a95dcd1..a5bc222fb4 100644 --- a/src/file/document/body/body.spec.ts +++ b/src/file/document/body/body.spec.ts @@ -22,6 +22,9 @@ describe("Body", () => { expect(tree).to.deep.equal({ "w:body": [ + { + "w:p": {}, + }, { "w:sectPr": [ { "w:pgSz": { _attr: { "w:w": 10000, "w:h": 10000, "w:orient": "portrait" } } }, diff --git a/src/file/document/body/body.ts b/src/file/document/body/body.ts index c79edfc132..e91b72d59a 100644 --- a/src/file/document/body/body.ts +++ b/src/file/document/body/body.ts @@ -1,5 +1,5 @@ import { IXmlableObject, XmlComponent } from "file/xml-components"; -import { TableOfContents } from "../.."; +import { Paragraph, ParagraphProperties, TableOfContents } from "../.."; import { SectionProperties, SectionPropertiesOptions } from "./section-properties/section-properties"; export class Body extends XmlComponent { @@ -18,6 +18,9 @@ export class Body extends XmlComponent { * @param options new section options */ public addSection(options: SectionPropertiesOptions): void { + const currentSection = this.sections.pop() as SectionProperties; + this.root.push(this.createSectionParagraph(currentSection)); + this.sections.push(new SectionProperties(options)); } @@ -36,4 +39,12 @@ export class Body extends XmlComponent { public getTablesOfContents(): TableOfContents[] { return this.root.filter((child) => child instanceof TableOfContents) as TableOfContents[]; } + + private createSectionParagraph(section: SectionProperties): Paragraph { + const paragraph = new Paragraph({}); + const properties = new ParagraphProperties({}); + properties.addChildElement(section); + paragraph.addChildElement(properties); + return paragraph; + } } diff --git a/src/file/file.spec.ts b/src/file/file.spec.ts index 59b42e009c..b82748ca54 100644 --- a/src/file/file.spec.ts +++ b/src/file/file.spec.ts @@ -20,8 +20,8 @@ describe("File", () => { const tree = new Formatter().format(doc.Document.Body); - expect(tree["w:body"][0]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); - expect(tree["w:body"][0]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][1]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][1]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("default"); }); it("should create with correct headers and footers", () => { @@ -39,8 +39,8 @@ describe("File", () => { const tree = new Formatter().format(doc.Document.Body); - expect(tree["w:body"][0]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); - expect(tree["w:body"][0]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][1]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][1]["w:sectPr"][5]["w:footerReference"]._attr["w:type"]).to.equal("default"); }); it("should create with first headers and footers", () => { @@ -58,8 +58,8 @@ describe("File", () => { const tree = new Formatter().format(doc.Document.Body); - expect(tree["w:body"][0]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first"); - expect(tree["w:body"][0]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("first"); + expect(tree["w:body"][1]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first"); + expect(tree["w:body"][1]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("first"); }); it("should create with correct headers", () => { @@ -81,13 +81,13 @@ describe("File", () => { const tree = new Formatter().format(doc.Document.Body); - expect(tree["w:body"][0]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); - expect(tree["w:body"][0]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first"); - expect(tree["w:body"][0]["w:sectPr"][6]["w:headerReference"]._attr["w:type"]).to.equal("even"); + expect(tree["w:body"][1]["w:sectPr"][4]["w:headerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][1]["w:sectPr"][5]["w:headerReference"]._attr["w:type"]).to.equal("first"); + expect(tree["w:body"][1]["w:sectPr"][6]["w:headerReference"]._attr["w:type"]).to.equal("even"); - expect(tree["w:body"][0]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("default"); - expect(tree["w:body"][0]["w:sectPr"][8]["w:footerReference"]._attr["w:type"]).to.equal("first"); - expect(tree["w:body"][0]["w:sectPr"][9]["w:footerReference"]._attr["w:type"]).to.equal("even"); + expect(tree["w:body"][1]["w:sectPr"][7]["w:footerReference"]._attr["w:type"]).to.equal("default"); + expect(tree["w:body"][1]["w:sectPr"][8]["w:footerReference"]._attr["w:type"]).to.equal("first"); + expect(tree["w:body"][1]["w:sectPr"][9]["w:footerReference"]._attr["w:type"]).to.equal("even"); }); }); From 0d4c7a5fc0c93d3d8bc1e6d8603598b08db816c0 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 9 Oct 2019 02:03:39 +0100 Subject: [PATCH 37/57] Update documentation --- docs/usage/styling-with-js.md | 227 ++++++++++++++--------- src/file/styles/style/paragraph-style.ts | 4 +- 2 files changed, 138 insertions(+), 93 deletions(-) diff --git a/docs/usage/styling-with-js.md b/docs/usage/styling-with-js.md index c39e7a7f40..26d294c942 100644 --- a/docs/usage/styling-with-js.md +++ b/docs/usage/styling-with-js.md @@ -3,112 +3,147 @@ ## Example ```ts -const para = new Paragraph("To whom it may concern:").heading2().center(); +const para = new Paragraph({ + text: "To whom it may concern:", + heading: HeadingLevel.HEADING_2, + alignment: AlignmentType.CENTER, +}); -const name = new TextRun("Name:") - .bold() - .font("Calibri") - .allCaps(); +const name = new TextRun({ + text: "Name:", + bold: true, + font: "Calibri", + allCaps: true, +}); ``` -## Available methods +## Available Options -* For run formatting: - * `.bold()`, `.italics()`, `.smallCaps()`, `.allCaps()`, `.strike()`, `.doubleStrike()`, `.subScript()`, `.superScript()`: Set the formatting property to true - * `.underline(style="single", color=null)`: Set the underline style and color - * `.color(color)`: Set the text color, using 6 hex characters for RRGGBB (no leading `#`) - * `.size(halfPts)`: Set the font size, measured in half-points - * `.font(name)`: Set the run's font - * `.style(name)`: Apply a named run style - * `.characterSpacing(value)`: Set the character spacing adjustment (in TWIPs) -* For paragraph formatting: - * `.heading1()`, `.heading2()`, `.heading3()`, `.heading4()`, `.heading5()`, `.title()`: apply the appropriate style to the paragraph - * `.left()`, `.center()`, `.right()`, `.justified()`: set the paragraph's alignment - * `.thematicBreak()`, `.pageBreak()`: Insert a thick rule or a page break beneath the paragraph - * `.leftTabStop(position)`: Add a left tab stop (measured in TWIPs from the left) - * `.maxRightTabStop()`: Add a right tab stop at the far right - * `.bullet()`: Use the default bullet style - * `.setNumbering(numbering, indentLevel)`: Use a custom numbering format for the paragraph - * `.style(name)`: Apply a named paragraph style - * `.indent(start, hanging=0)`: Set the paragraph's indent level (in TWIPs) - * `.spacing({before=0, after=0, line=0})`: Set the line and before/after on the paragraph. Before/after is measured in TWIPs, line is measured in 240ths of a line +### Run formatting -Paragraph styles have all the run formatting methods, except `style()`, and `.left()`, `.center()`, `.right()`, `.justified()`, `.thematicBreak()`, `.leftTabStop(position)`, `.maxRightTabStop()`, `.indent(start, hanging=0)`, and `.spacing({before=0, after=0, line=0})` methods. +- `bold`, `italics`, `smallCaps`, `allCaps`, `strike`, `doubleStrike`, `subScript`, `superScript`: Set the formatting property to true +- `underline(style="single", color=null)`: Set the underline style and color +- `color(color)`: Set the text color, using 6 hex characters for RRGGBB (no leading `#`) +- `size(halfPts)`: Set the font size, measured in half-points +- `font(name)`: Set the run's font +- `style(name)`: Apply a named run style +- `characterSpacing(value)`: Set the character spacing adjustment (in TWIPs) + +### Paragraph formatting + +- `heading1`, `heading2`, `heading3`, `heading4`, `heading5`, `title`: apply the appropriate style to the paragraph +- `left`, `center`, `right`, `justified`: set the paragraph's alignment +- `thematicBreak`, `pageBreak`: Insert a thick rule or a page break beneath the paragraph +- `leftTabStop(position)`: Add a left tab stop (measured in TWIPs from the left) +- `maxRightTabStop`: Add a right tab stop at the far right +- `bullet`: Use the default bullet style +- `setNumbering(numbering, indentLevel)`: Use a custom numbering format for the paragraph +- `style(name)`: Apply a named paragraph style +- `indent(start, hanging=0)`: Set the paragraph's indent level (in TWIPs) +- `spacing({before=0, after=0, line=0})`: Set the line and before/after on the paragraph. Before/after is measured in TWIPs, line is measured in 240ths of a line + +Paragraph styles have all the run formatting methods, except `style()`, and `left()`, `center()`, `right()`, `justified()`, `thematicBreak()`, `leftTabStop(position)`, `maxRightTabStop()`, `indent(start, hanging=0)`, and `spacing({before=0, after=0, line=0})` methods. ## Detailed guide -There are 4 items in DOCX that can be styled: +There are 4 items in `docx` that can be styled: -* Characters: Attributes that can change within a paragraph. e.g., bold, italics, etc. -* Paragraphs: Attributes like indent, text alignment, line spacing, etc. -* Tables: Border styles, table formats, etc. -* List items: These are the numbers and bullets that are automatically inserted +- Characters: Attributes that can change within a paragraph. e.g., bold, italics, etc. +- Paragraphs: Attributes like indent, text alignment, line spacing, etc. +- Tables: Border styles, table formats, etc. +- List items: These are the numbers and bullets that are automatically inserted -There are a few different ways of styling this content in DOCX, which somewhat resemble the HTML/CSS approach. In order of greatest to lowest priority: +There are a few different ways of styling this content in `docx`, which somewhat resemble the HTML/CSS approach. In order of greatest to lowest priority: -1. Direct formatting (AKA inline formatting) -2. Centrally defined styles (similar to external CSS) +1. Direct formatting (inline formatting) +2. Declaritive Styles (similar to external CSS) 3. Document defaults (similar to a `*` rule in CSS) Unlike CSS, less specific rules don't _necessarily_ override parent rules. The rules are a bit wonky, but if you're interested, see the [advanced formatting section](#Advanced formatting). -### Direct formatting (AKA inline formatting) +### Direct formatting (inline formatting) -This is the type of formatting that your uncle uses when he types out documents: _N ... a ... m ... e ... :_ Then he grabs the mouse, highlights _Name:_ and moves over to the **B** for bold. This manner of formatting results in markup that is similar to writing `Name:` if you were typing out HTML. DOCX (the format) allows you to specify this for any of the four types of items. `docx` (the library) only supports this type of formatting for paragraphs and characters, using a _fluent_ api. Thus you could do: +This is the type of formatting that your uncle uses when he types out documents: _N ... a ... m ... e ... :_ Then he grabs the mouse, highlights _Name:_ and moves over to the **B** for bold. This manner of formatting results in markup that is similar to writing `Name:` if you were typing out HTML. `docx` (the format) allows you to specify this for any of the four types of items. `docx` (the library) only supports this type of formatting for paragraphs and characters, using a _fluent_ api. Thus you could do: ```ts -const name = new TextRun("Name:") - .bold() - .font("Calibri") - .allCaps(); +const name = new TextRun({ + text: "Name:", + bold: true, + font: "Calibri", + allCaps: true, +}); ``` Or for paragraph formatting: ```ts -const para = new Paragraph("To whom it may concern:").heading2().center(); +const para = new Paragraph({ + text: "To whom it may concern:", + heading: HeadingLevel.HEADING_2, + alignment: AlignmentType.CENTER, +}); ``` -### Centrally defined styles (similar to external CSS) +### Declaritive Styles (similar to external CSS) -DOCX files contain a styles section separate from the main content, much like how HTML includes CSS files. Unlike CSS, DOCX distinguishes between styles meant for tables (which show up in the table formatting toolbar), styles for lists (which show up under bullets and numbering), and styles for runs and paragraphs, which show up as dropdowns offering standard styles, like "Heading 1", "Caption", or any custom styles defined in that document. . `docx` allows you to define these styles using a fluent interface as well. +`docx` files contain a styles section separate from the main content, much like how HTML includes CSS files. Unlike CSS, `docx` distinguishes between styles meant for tables (which show up in the table formatting toolbar), styles for lists (which show up under bullets and numbering), and styles for runs and paragraphs, which show up as dropdowns offering standard styles, like "Heading 1", "Caption", or any custom styles defined in that document. . `docx` allows you to define these styles using a fluent interface as well. -There are three parts to using custom styles with `docx`: +To add styles, define your custom styles in the `document`: -1. Create a container object for the style definitions: - ```ts - const myStyles = new docx.Styles(); - ``` -2. Define your custom styles, similar to the way you would format a paragraph or run - - ```ts - // The first argument is an ID you use to apply the style to paragraphs - // The second argument is a human-friendly name to show in the UI - myStyles - .createParagraphStyle("myWonkyStyle", "My Wonky Style") - .basedOn("Normal") - .next("Normal") - .color("999999") - .italics() - .indent(720) // 720 TWIP === 720 / 20 pt === .5 in - .spacing({ line: 276 }); // 276 / 240 = 1.15x line spacing - - myStyles - .createParagraphStyle("Heading2", "Heading 2") - .basedOn("Normal") - .next("Normal") - .quickFormat() - .size(26) // 26 half-points === 13pt font - .bold() - .underline("double", "FF0000") - .spacing({ before: 240, after: 120 }); // TWIP for both - ``` - -3. When you generate your document, make sure to pass the `styles` container to the `Packer`: - - ```ts - Packer.pack(myOutStream); - ``` +```ts +// The first argument is an ID you use to apply the style to paragraphs +// The second argument is a human-friendly name to show in the UI +const doc = new Document({ + creator: "Clippy", + title: "Sample Document", + description: "A brief example of using docx", + styles: { + paragraphStyles: [ + { + id: "myWonkyStyle", + name: "My Wonky Style", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + italics: true, + color: "999999", + }, + paragraph: { + spacing: { + line: 276, + }, + indent: { + left: 720, + }, + }, + }, + { + id: "Heading2", + name: "Heading 2", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + size: 26 + bold: true, + color: "999999", + { + type: UnderlineType.DOUBLE, + color: "FF0000", + }, + }, + paragraph: { + spacing: { + before: 240, + after: 120 + }, + }, + }, + ] + } +}); +``` **Note**: If you are using the `.headingX` or `.title` methods of paragraphs, you must make sure to define `HeadingX` or `Title` styles for these. Otherwise they'll show up unstyled :(. If you are using the `.bullet` or `.setNumbering` methods, you need to define a `ListParagraph` style or the numbers may not show up. @@ -144,19 +179,29 @@ To determine the value of a styling property, you must first identify whether it The following properties are treated in a special manner; they're called toggle properties: -* Bold -* All caps -* Small caps -* Italics -* Single strike-through -* Hidden -* Imprint -* Emboss -* Character outline -* Character shadow +- Bold +- All caps +- Small caps +- Italics +- Single strike-through +- Hidden +- Imprint +- Emboss +- Character outline +- Character shadow For these properties, the rules state the following conflict resolution in case the property is specified at multiple points for the same item: -* Direct formatting trumps all if specified (either true or false) -* Otherwise, if the property is true in document defaults, the property is set to true -* Otherwise, the property's value is an XOR of its effective table, paragraph, and character values. (So specifying bold `true` on a table style and a paragraph style would result in non-bold text if a paragraph inside the table had that style) +- Direct formatting trumps all if specified (either true or false) +- Otherwise, if the property is true in document defaults, the property is set to true +- Otherwise, the property's value is an XOR of its effective table, paragraph, and character values. (So specifying bold `true` on a table style and a paragraph style would result in non-bold text if a paragraph inside the table had that style) + +## Examples + +### Declaritive styles + +Importing Images from file system path + +[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/2-declaritive-styles.ts ':include') + +_Source: https://github.com/dolanmiu/docx/blob/master/demo/2-declaritive-styles.ts_ diff --git a/src/file/styles/style/paragraph-style.ts b/src/file/styles/style/paragraph-style.ts index ab9f75ccec..077df26292 100644 --- a/src/file/styles/style/paragraph-style.ts +++ b/src/file/styles/style/paragraph-style.ts @@ -11,7 +11,7 @@ import { Spacing, ThematicBreak, } from "file/paragraph"; -import { RightTabStop } from "file/paragraph/formatting"; +import { IIndentAttributesProperties, RightTabStop } from "file/paragraph/formatting"; import * as formatting from "file/paragraph/run/formatting"; import { RunProperties } from "file/paragraph/run/properties"; import { UnderlineType } from "file/paragraph/run/underline"; @@ -57,7 +57,7 @@ export interface IBaseParagraphStyleOptions { readonly thematicBreak?: boolean; readonly rightTabStop?: number; readonly leftTabStop?: number; - readonly indent?: object; + readonly indent?: IIndentAttributesProperties; readonly spacing?: ISpacingProperties; readonly keepNext?: boolean; readonly keepLines?: boolean; From 40d1a3a7c2c3e9e4cd22e0709fd6856141cee8cf Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 9 Oct 2019 20:56:31 +0100 Subject: [PATCH 38/57] Multiple tab stops --- demo/10-my-cv.ts | 9 +-- docs/usage/tab-stops.md | 63 +++++++++++++------ src/file/numbering/level.ts | 8 +-- .../paragraph/formatting/tab-stop.spec.ts | 10 +-- src/file/paragraph/formatting/tab-stop.ts | 28 ++------- src/file/paragraph/paragraph.spec.ts | 30 +++++---- src/file/paragraph/paragraph.ts | 31 +++------ src/file/styles/style/paragraph-style.ts | 7 +-- 8 files changed, 92 insertions(+), 94 deletions(-) diff --git a/demo/10-my-cv.ts b/demo/10-my-cv.ts index 75c5d9e8bd..b3e7c55e01 100644 --- a/demo/10-my-cv.ts +++ b/demo/10-my-cv.ts @@ -1,7 +1,7 @@ // Generate a CV // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, TabStopPosition, TextRun } from "../build"; +import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, TabStopPosition, TabStopType, TextRun } from "../build"; // tslint:disable:no-shadowed-variable @@ -226,11 +226,12 @@ class DocumentCreator { public createInstitutionHeader(institutionName: string, dateText: string): Paragraph { return new Paragraph({ - tabStop: { - right: { + tabStops: [ + { + type: TabStopType.RIGHT, position: TabStopPosition.MAX, }, - }, + ], children: [ new TextRun({ text: institutionName, diff --git a/docs/usage/tab-stops.md b/docs/usage/tab-stops.md index e266c0b310..5c7a99da42 100644 --- a/docs/usage/tab-stops.md +++ b/docs/usage/tab-stops.md @@ -13,11 +13,12 @@ Simply call the relevant methods on the paragraph listed below. Then just add a ```ts const paragraph = new Paragraph({ children: [new TextRun("Hey everyone").bold(), new TextRun("11th November 1999").tab()], - tabStop: { - right: { + tabStops: [ + { + type: TabStopType.RIGHT, position: TabStopPosition.MAX, }, - }, + ], }); ``` @@ -26,28 +27,49 @@ The example above will create a left aligned text, and a right aligned text on t ```ts const paragraph = new Paragraph({ children: [new TextRun("Second tab stop here I come!").tab().tab()], - tabStop: { - right: { + tabStops: [ + { + type: TabStopType.RIGHT, position: TabStopPosition.MAX, }, - left: { + { + type: TabStopType.LEFT, position: 1000, }, - }, + ], }); ``` The above shows the use of two tab stops, and how to select/use it. +You can add multiple tab stops of the same `type` too. + +```ts +const paragraph = new Paragraph({ + children: [new TextRun("Multiple tab stops!").tab().tab()], + tabStops: [ + { + type: TabStopType.RIGHT, + position: TabStopPosition.MAX, + }, + { + type: TabStopType.RIGHT, + position: 1000, + }, + ], +}); +``` + ## Left Tab Stop ```ts const paragraph = new Paragraph({ - tabStop: { - left: { + tabStops: [ + { + type: TabStopType.LEFT, position: 2268, }, - }, + ], }); ``` @@ -57,11 +79,12 @@ const paragraph = new Paragraph({ ```ts const paragraph = new Paragraph({ - tabStop: { - center: { + tabStops: [ + { + type: TabStopType.CENTER, position: 2268, }, - }, + ], }); ``` @@ -71,11 +94,12 @@ const paragraph = new Paragraph({ ```ts const paragraph = new Paragraph({ - tabStop: { - right: { + tabStops: [ + { + type: TabStopType.RIGHT, position: 2268, }, - }, + ], }); ``` @@ -85,11 +109,12 @@ const paragraph = new Paragraph({ ```ts const paragraph = new Paragraph({ - tabStop: { - right: { + tabStops: [ + { + type: TabStopType.RIGHT, position: TabStopPosition.MAX, }, - }, + ], }); ``` diff --git a/src/file/numbering/level.ts b/src/file/numbering/level.ts index b0fa183f53..bdc65fbba4 100644 --- a/src/file/numbering/level.ts +++ b/src/file/numbering/level.ts @@ -7,9 +7,9 @@ import { ISpacingProperties, KeepLines, KeepNext, - LeftTabStop, - RightTabStop, Spacing, + TabStop, + TabStopType, ThematicBreak, } from "../paragraph/formatting"; import { ParagraphProperties } from "../paragraph/properties"; @@ -237,11 +237,11 @@ export class LevelBase extends XmlComponent { } public rightTabStop(position: number): Level { - return this.addParagraphProperty(new RightTabStop(position)); + return this.addParagraphProperty(new TabStop(TabStopType.RIGHT, position)); } public leftTabStop(position: number): Level { - this.addParagraphProperty(new LeftTabStop(position)); + this.addParagraphProperty(new TabStop(TabStopType.LEFT, position)); return this; } diff --git a/src/file/paragraph/formatting/tab-stop.spec.ts b/src/file/paragraph/formatting/tab-stop.spec.ts index 558289ba8e..377e7bb060 100644 --- a/src/file/paragraph/formatting/tab-stop.spec.ts +++ b/src/file/paragraph/formatting/tab-stop.spec.ts @@ -2,13 +2,13 @@ import { assert } from "chai"; import { Utility } from "tests/utility"; -import { LeaderType, LeftTabStop, RightTabStop } from "./tab-stop"; +import { LeaderType, TabStop, TabStopType } from "./tab-stop"; describe("LeftTabStop", () => { - let tabStop: LeftTabStop; + let tabStop: TabStop; beforeEach(() => { - tabStop = new LeftTabStop(100); + tabStop = new TabStop(TabStopType.LEFT, 100); }); describe("#constructor()", () => { @@ -29,10 +29,10 @@ describe("LeftTabStop", () => { }); describe("RightTabStop", () => { - let tabStop: RightTabStop; + let tabStop: TabStop; beforeEach(() => { - tabStop = new RightTabStop(100, LeaderType.DOT); + tabStop = new TabStop(TabStopType.RIGHT, 100, LeaderType.DOT); }); describe("#constructor()", () => { diff --git a/src/file/paragraph/formatting/tab-stop.ts b/src/file/paragraph/formatting/tab-stop.ts index e934b80c06..cfe121b119 100644 --- a/src/file/paragraph/formatting/tab-stop.ts +++ b/src/file/paragraph/formatting/tab-stop.ts @@ -2,13 +2,13 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; export class TabStop extends XmlComponent { - constructor(tab: TabStopItem) { + constructor(type: TabStopType, position: number, leader?: LeaderType) { super("w:tabs"); - this.root.push(tab); + this.root.push(new TabStopItem(type, position, leader)); } } -export enum TabValue { +export enum TabStopType { LEFT = "left", RIGHT = "right", CENTER = "center", @@ -33,7 +33,7 @@ export enum TabStopPosition { } export class TabAttributes extends XmlAttributeComponent<{ - readonly val: TabValue; + readonly val: TabStopType; readonly pos: string | number; readonly leader?: LeaderType; }> { @@ -41,7 +41,7 @@ export class TabAttributes extends XmlAttributeComponent<{ } export class TabStopItem extends XmlComponent { - constructor(value: TabValue, position: string | number, leader?: LeaderType) { + constructor(value: TabStopType, position: string | number, leader?: LeaderType) { super("w:tab"); this.root.push( new TabAttributes({ @@ -52,21 +52,3 @@ export class TabStopItem extends XmlComponent { ); } } - -export class LeftTabStop extends TabStop { - constructor(position: number, leader?: LeaderType) { - super(new TabStopItem(TabValue.LEFT, position, leader)); - } -} - -export class RightTabStop extends TabStop { - constructor(position: number, leader?: LeaderType) { - super(new TabStopItem(TabValue.RIGHT, position, leader)); - } -} - -export class CenterTabStop extends TabStop { - constructor(position: number, leader?: LeaderType) { - super(new TabStopItem(TabValue.CENTER, position, leader)); - } -} diff --git a/src/file/paragraph/paragraph.spec.ts b/src/file/paragraph/paragraph.spec.ts index 0536e44505..e8e5f6c8c9 100644 --- a/src/file/paragraph/paragraph.spec.ts +++ b/src/file/paragraph/paragraph.spec.ts @@ -4,7 +4,7 @@ import { Formatter } from "export/formatter"; import { EMPTY_OBJECT } from "file/xml-components"; import { Numbering } from "../numbering"; -import { AlignmentType, HeadingLevel, LeaderType, PageBreak, TabStopPosition } from "./formatting"; +import { AlignmentType, HeadingLevel, LeaderType, PageBreak, TabStopPosition, TabStopType } from "./formatting"; import { Paragraph } from "./paragraph"; describe("Paragraph", () => { @@ -256,11 +256,12 @@ describe("Paragraph", () => { describe("#maxRightTabStop()", () => { it("should add right tab stop to JSON", () => { const paragraph = new Paragraph({ - tabStop: { - right: { + tabStops: [ + { + type: TabStopType.RIGHT, position: TabStopPosition.MAX, }, - }, + ], }); const tree = new Formatter().format(paragraph); expect(tree).to.deep.equal({ @@ -289,12 +290,13 @@ describe("Paragraph", () => { describe("#leftTabStop()", () => { it("should add leftTabStop to JSON", () => { const paragraph = new Paragraph({ - tabStop: { - left: { + tabStops: [ + { + type: TabStopType.LEFT, position: 100, leader: LeaderType.HYPHEN, }, - }, + ], }); const tree = new Formatter().format(paragraph); expect(tree).to.deep.equal({ @@ -324,12 +326,13 @@ describe("Paragraph", () => { describe("#rightTabStop()", () => { it("should add rightTabStop to JSON", () => { const paragraph = new Paragraph({ - tabStop: { - right: { + tabStops: [ + { + type: TabStopType.RIGHT, position: 100, leader: LeaderType.DOT, }, - }, + ], }); const tree = new Formatter().format(paragraph); expect(tree).to.deep.equal({ @@ -359,12 +362,13 @@ describe("Paragraph", () => { describe("#centerTabStop()", () => { it("should add centerTabStop to JSON", () => { const paragraph = new Paragraph({ - tabStop: { - center: { + tabStops: [ + { + type: TabStopType.CENTER, position: 100, leader: LeaderType.MIDDLE_DOT, }, - }, + ], }); const tree = new Formatter().format(paragraph); expect(tree).to.deep.equal({ diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index cd8f3a1bcd..5d8b4e0ae0 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -11,17 +11,12 @@ import { KeepLines, KeepNext } from "./formatting/keep"; import { PageBreak, PageBreakBefore } from "./formatting/page-break"; import { ContextualSpacing, ISpacingProperties, Spacing } from "./formatting/spacing"; import { HeadingLevel, Style } from "./formatting/style"; -import { CenterTabStop, LeaderType, LeftTabStop, RightTabStop, TabStopPosition } from "./formatting/tab-stop"; +import { LeaderType, TabStop, TabStopPosition, TabStopType } from "./formatting/tab-stop"; import { NumberProperties } from "./formatting/unordered-list"; import { Bookmark, Hyperlink, OutlineLevel } from "./links"; import { ParagraphProperties } from "./properties"; import { PictureRun, Run, SequentialIdentifier, SymbolRun, TextRun } from "./run"; -interface ITabStopOptions { - readonly position: number | TabStopPosition; - readonly leader?: LeaderType; -} - export interface IParagraphOptions { readonly text?: string; readonly border?: IBorderOptions; @@ -36,11 +31,11 @@ export interface IParagraphOptions { readonly indent?: IIndentAttributesProperties; readonly keepLines?: boolean; readonly keepNext?: boolean; - readonly tabStop?: { - readonly left?: ITabStopOptions; - readonly right?: ITabStopOptions; - readonly center?: ITabStopOptions; - }; + readonly tabStops?: Array<{ + readonly position: number | TabStopPosition; + readonly type: TabStopType; + readonly leader?: LeaderType; + }>; readonly style?: string; readonly bullet?: { readonly level: number; @@ -127,17 +122,9 @@ export class Paragraph extends XmlComponent { this.properties.push(new KeepNext()); } - if (options.tabStop) { - if (options.tabStop.left) { - this.properties.push(new LeftTabStop(options.tabStop.left.position, options.tabStop.left.leader)); - } - - if (options.tabStop.right) { - this.properties.push(new RightTabStop(options.tabStop.right.position, options.tabStop.right.leader)); - } - - if (options.tabStop.center) { - this.properties.push(new CenterTabStop(options.tabStop.center.position, options.tabStop.center.leader)); + if (options.tabStops) { + for (const tabStop of options.tabStops) { + this.properties.push(new TabStop(tabStop.type, tabStop.position, tabStop.leader)); } } diff --git a/src/file/styles/style/paragraph-style.ts b/src/file/styles/style/paragraph-style.ts index 077df26292..ab592a9fc6 100644 --- a/src/file/styles/style/paragraph-style.ts +++ b/src/file/styles/style/paragraph-style.ts @@ -5,13 +5,12 @@ import { ISpacingProperties, KeepLines, KeepNext, - LeftTabStop, OutlineLevel, ParagraphProperties, Spacing, ThematicBreak, } from "file/paragraph"; -import { IIndentAttributesProperties, RightTabStop } from "file/paragraph/formatting"; +import { IIndentAttributesProperties, TabStop, TabStopType } from "file/paragraph/formatting"; import * as formatting from "file/paragraph/run/formatting"; import { RunProperties } from "file/paragraph/run/properties"; import { UnderlineType } from "file/paragraph/run/underline"; @@ -181,11 +180,11 @@ export class ParagraphStyle extends Style { } if (options.paragraph.rightTabStop) { - this.paragraphProperties.push(new RightTabStop(options.paragraph.rightTabStop)); + this.paragraphProperties.push(new TabStop(TabStopType.RIGHT, options.paragraph.rightTabStop)); } if (options.paragraph.leftTabStop) { - this.paragraphProperties.push(new LeftTabStop(options.paragraph.leftTabStop)); + this.paragraphProperties.push(new TabStop(TabStopType.LEFT, options.paragraph.leftTabStop)); } if (options.paragraph.indent) { From f16126e9480c0f239369545f4506a53db1599ae1 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 9 Oct 2019 21:19:41 +0100 Subject: [PATCH 39/57] Fix tests --- demo/21-bookmarks.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/demo/21-bookmarks.ts b/demo/21-bookmarks.ts index ae7427aaf4..cc0bac5517 100644 --- a/demo/21-bookmarks.ts +++ b/demo/21-bookmarks.ts @@ -1,8 +1,7 @@ // This demo shows how to create bookmarks then link to them with internal hyperlinks // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph } from "../build"; -import { PageBreak } from "../build/file/paragraph"; +import { Document, HeadingLevel, Packer, PageBreak, Paragraph } from "../build"; const LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mi velit, convallis convallis scelerisque nec, faucibus nec leo. Phasellus at posuere mauris, tempus dignissim velit. Integer et tortor dolor. Duis auctor efficitur mattis. Vivamus ut metus accumsan tellus auctor sollicitudin venenatis et nibh. Cras quis massa ac metus fringilla venenatis. Proin rutrum mauris purus, ut suscipit magna consectetur id. Integer consectetur sollicitudin ante, vitae faucibus neque efficitur in. Praesent ultricies nibh lectus. Mauris pharetra id odio eget iaculis. Duis dictum, risus id pellentesque rutrum, lorem quam malesuada massa, quis ullamcorper turpis urna a diam. Cras vulputate metus vel massa porta ullamcorper. Etiam porta condimentum nulla nec tristique. Sed nulla urna, pharetra non tortor sed, sollicitudin molestie diam. Maecenas enim leo, feugiat eget vehicula id, sollicitudin vitae ante."; From 721de305878f68d5f2cbf39f2193e7bd8d32f4db Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 10 Oct 2019 01:08:01 +0100 Subject: [PATCH 40/57] Fix demos --- demo/11-declaritive-styles-2.ts | 221 +++++++++++++++-------- demo/27-declaritive-styles-3.ts | 67 ++++--- demo/28-table-of-contents.ts | 26 ++- demo/47-number-of-total-pages-section.ts | 56 +++--- 4 files changed, 244 insertions(+), 126 deletions(-) diff --git a/demo/11-declaritive-styles-2.ts b/demo/11-declaritive-styles-2.ts index c6780c440f..3a0154a0fb 100644 --- a/demo/11-declaritive-styles-2.ts +++ b/demo/11-declaritive-styles-2.ts @@ -1,82 +1,153 @@ // Setting styles with JavaScript configuration // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { AlignmentType, Document, Footer, HeadingLevel, Media, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; +import { + AlignmentType, + Document, + Footer, + HeadingLevel, + Media, + Packer, + Paragraph, + Table, + TableCell, + TableRow, + TabStopPosition, + UnderlineType, +} from "../build"; -const doc = new Document(); - -doc.Styles.createParagraphStyle("Heading1", "Heading 1") - .basedOn("Normal") - .next("Normal") - .quickFormat() - .font("Calibri") - .size(52) - .center() - .bold() - .color("000000") - .spacing({ line: 340 }) - .underline("single", "000000"); - -doc.Styles.createParagraphStyle("Heading2", "Heading 2") - .basedOn("Normal") - .next("Normal") - .font("Calibri") - .quickFormat() - .size(26) - .bold() - .spacing({ line: 340 }); - -doc.Styles.createParagraphStyle("Heading3", "Heading 3") - .basedOn("Normal") - .next("Normal") - .font("Calibri") - .quickFormat() - .size(26) - .bold() - .spacing({ line: 276 }); - -doc.Styles.createParagraphStyle("Heading4", "Heading 4") - .basedOn("Normal") - .next("Normal") - .justified() - .font("Calibri") - .size(26) - .bold(); - -doc.Styles.createParagraphStyle("normalPara", "Normal Para") - .basedOn("Normal") - .next("Normal") - .font("Calibri") - .quickFormat() - .leftTabStop(453.543307087) - .maxRightTabStop() - .size(26) - .spacing({ line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }); - -doc.Styles.createParagraphStyle("normalPara2", "Normal Para2") - .basedOn("Normal") - .next("Normal") - .quickFormat() - .font("Calibri") - .size(26) - .justified() - .spacing({ line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }); - -doc.Styles.createParagraphStyle("aside", "Aside") - .basedOn("Normal") - .next("Normal") - .color("999999") - .italics() - .indent({ left: 720 }) - .spacing({ line: 276 }); - -doc.Styles.createParagraphStyle("wellSpaced", "Well Spaced") - .basedOn("Normal") - .spacing({ line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }); - -doc.Styles.createParagraphStyle("ListParagraph", "List Paragraph") - .quickFormat() - .basedOn("Normal"); +const doc = new Document({ + styles: { + paragraphStyles: [ + { + id: "Heading1", + name: "Heading 1", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + font: "Calibri", + size: 52, + bold: true, + color: "000000", + underline: { + type: UnderlineType.SINGLE, + color: "000000", + }, + }, + paragraph: { + alignment: AlignmentType.CENTER, + spacing: { line: 340 }, + }, + }, + { + id: "Heading2", + name: "Heading 2", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + font: "Calibri", + size: 26, + bold: true, + }, + paragraph: { + spacing: { line: 340 }, + }, + }, + { + id: "Heading3", + name: "Heading 3", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + font: "Calibri", + size: 26, + bold: true, + }, + paragraph: { + spacing: { line: 276 }, + }, + }, + { + id: "Heading4", + name: "Heading 4", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + font: "Calibri", + size: 26, + bold: true, + }, + paragraph: { + alignment: AlignmentType.JUSTIFIED, + }, + }, + { + id: "normalPara", + name: "Normal Para", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + font: "Calibri", + size: 26, + bold: true, + }, + paragraph: { + spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, + rightTabStop: TabStopPosition.MAX, + leftTabStop: 453.543307087, + }, + }, + { + id: "normalPara2", + name: "Normal Para2", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + font: "Calibri", + size: 26, + }, + paragraph: { + alignment: AlignmentType.JUSTIFIED, + spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, + }, + }, + { + id: "aside", + name: "Aside", + basedOn: "Normal", + next: "Normal", + run: { + color: "999999", + italics: true, + }, + paragraph: { + spacing: { line: 276 }, + indent: { left: 720 }, + }, + }, + { + id: "wellSpaced", + name: "Well Spaced", + basedOn: "Normal", + paragraph: { + spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, + }, + }, + { + id: "ListParagraph", + name: "List Paragraph", + basedOn: "Normal", + quickFormat: true, + }, + ], + }, +}); const image = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); diff --git a/demo/27-declaritive-styles-3.ts b/demo/27-declaritive-styles-3.ts index 31994dfe4a..8419467799 100644 --- a/demo/27-declaritive-styles-3.ts +++ b/demo/27-declaritive-styles-3.ts @@ -1,28 +1,53 @@ // Custom styles using JavaScript configuration // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, UnderlineType } from "../build"; -const doc = new Document(); - -// The first argument is an ID you use to apply the style to paragraphs -// The second argument is a human-friendly name to show in the UI -doc.Styles.createParagraphStyle("myWonkyStyle", "My Wonky Style") - .basedOn("Normal") - .next("Normal") - .color("990000") - .italics() - .indent({ left: 720 }) // 720 TWIP === 720 / 20 pt === .5 in - .spacing({ line: 276 }); // 276 / 240 = 1.15x line spacing - -doc.Styles.createParagraphStyle("Heading2", "Heading 2") - .basedOn("Normal") - .next("Normal") - .quickFormat() - .size(26) // 26 half-points === 13pt font - .bold() - .underline("double", "FF0000") - .spacing({ before: 240, after: 120 }); // TWIP for both +const doc = new Document({ + styles: { + paragraphStyles: [ + { + id: "myWonkyStyle", + name: "My Wonky Style", + basedOn: "Normal", + next: "Normal", + run: { + color: "990000", + italics: true, + }, + paragraph: { + indent: { + left: 720, + }, + spacing: { + line: 276, + }, + }, + }, + { + id: "Heading2", + name: "Heading 2", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + bold: true, + size: 26, + underline: { + type: UnderlineType.DOUBLE, + color: "FF0000", + }, + }, + paragraph: { + spacing: { + before: 240, + after: 120, + }, + }, + }, + ], + }, +}); doc.addSection({ children: [ diff --git a/demo/28-table-of-contents.ts b/demo/28-table-of-contents.ts index 83160b0177..76789ee256 100644 --- a/demo/28-table-of-contents.ts +++ b/demo/28-table-of-contents.ts @@ -3,15 +3,23 @@ import * as fs from "fs"; import { File, HeadingLevel, Packer, Paragraph, StyleLevel, TableOfContents } from "../build"; -const doc = new File(); - -// The first argument is an ID you use to apply the style to paragraphs -// The second argument is a human-friendly name to show in the UI -doc.Styles.createParagraphStyle("MySpectacularStyle", "My Spectacular Style") - .basedOn("Heading1") - .next("Heading1") - .color("990000") - .italics(); +const doc = new File({ + styles: { + paragraphStyles: [ + { + id: "MySpectacularStyle", + name: "My Spectacular Style", + basedOn: "Heading1", + next: "Heading1", + quickFormat: true, + run: { + italics: true, + color: "990000", + }, + }, + ], + }, +}); // WordprocessingML docs for TableOfContents can be found here: // http://officeopenxml.com/WPtableOfContents.php diff --git a/demo/47-number-of-total-pages-section.ts b/demo/47-number-of-total-pages-section.ts index 7ccc44e22a..988206e524 100644 --- a/demo/47-number-of-total-pages-section.ts +++ b/demo/47-number-of-total-pages-section.ts @@ -1,18 +1,26 @@ // Multiple sections with total number of pages in each section // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, PageNumberFormat, TextRun } from "../build"; +import { AlignmentType, Document, Packer, PageNumberFormat, TextRun, Header, Paragraph, Footer, PageBreak } from "../build"; const doc = new Document(); +const header = new Header({ + children: [ + new Paragraph({ + children: [ + new TextRun("Header on another page"), + new TextRun("Page Number: ").pageNumber(), + new TextRun(" to ").numberOfTotalPagesSection(), + ], + alignment: AlignmentType.CENTER, + }), + ], +}); -const header = doc.createHeader(); -header.createParagraph("Header on another page"); -const footer = doc.createFooter(); -footer.createParagraph("Foo Bar corp. ") - .center() - .addRun(new TextRun("Page Number: ").pageNumber()) - .addRun(new TextRun(" to ").numberOfTotalPagesSection()); +const footer = new Footer({ + children: [new Paragraph("Foo Bar corp. ")], +}); doc.addSection({ headers: { @@ -21,13 +29,17 @@ doc.addSection({ footers: { default: footer, }, - pageNumberStart: 1, - pageNumberFormatType: PageNumberFormat.DECIMAL, + properties: { + pageNumberStart: 1, + pageNumberFormatType: PageNumberFormat.DECIMAL, + }, + children: [ + new Paragraph({ + children: [new TextRun("Section 1"), new PageBreak(), new TextRun("Section 1"), new PageBreak()], + }), + ], }); -doc.createParagraph("Section 1").pageBreak(); -doc.createParagraph("Section 1").pageBreak(); - doc.addSection({ headers: { default: header, @@ -35,15 +47,17 @@ doc.addSection({ footers: { default: footer, }, - pageNumberStart: 1, - pageNumberFormatType: PageNumberFormat.DECIMAL, + properties: { + pageNumberStart: 1, + pageNumberFormatType: PageNumberFormat.DECIMAL, + }, + children: [ + new Paragraph({ + children: [new TextRun("Section 2"), new PageBreak(), new TextRun("Section 2"), new PageBreak()], + }), + ], }); -doc.createParagraph("Section 2").pageBreak(); -doc.createParagraph("Section 2").pageBreak(); - -const packer = new Packer(); - -packer.toBuffer(doc).then((buffer) => { +Packer.toBuffer(doc).then((buffer) => { fs.writeFileSync("My Document.docx", buffer); }); From b571a7550f0ffba26e45ff0ecef4a687f789abb3 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 10 Oct 2019 01:18:20 +0100 Subject: [PATCH 41/57] Fix demo --- demo/33-sequential-captions.ts | 50 ++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/demo/33-sequential-captions.ts b/demo/33-sequential-captions.ts index c06c3aa1cc..aed113d0fa 100644 --- a/demo/33-sequential-captions.ts +++ b/demo/33-sequential-captions.ts @@ -1,28 +1,44 @@ // Sequential Captions // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun } from "../build"; +import { Document, Packer, Paragraph, SequentialIdentifier, TextRun } from "../build"; const doc = new Document(); doc.addSection({ children: [ - new Paragraph("Hello World 1->") - .addSequentialIdentifier("Caption") - .addRun(new TextRun(" text after sequencial caption 2->")) - .addSequentialIdentifier("Caption"), - new Paragraph("Hello World 1->") - .addSequentialIdentifier("Label") - .addRun(new TextRun(" text after sequencial caption 2->")) - .addSequentialIdentifier("Label"), - new Paragraph("Hello World 1->") - .addSequentialIdentifier("Another") - .addRun(new TextRun(" text after sequencial caption 3->")) - .addSequentialIdentifier("Label"), - new Paragraph("Hello World 2->") - .addSequentialIdentifier("Another") - .addRun(new TextRun(" text after sequencial caption 4->")) - .addSequentialIdentifier("Label"), + new Paragraph({ + children: [ + new TextRun("Hello World 1->"), + new SequentialIdentifier("Caption"), + new TextRun(" text after sequencial caption 2->"), + new SequentialIdentifier("Caption"), + ], + }), + new Paragraph({ + children: [ + new TextRun("Hello World 1->"), + new SequentialIdentifier("Label"), + new TextRun(" text after sequencial caption 2->"), + new SequentialIdentifier("Label"), + ], + }), + new Paragraph({ + children: [ + new TextRun("Hello World 1->"), + new SequentialIdentifier("Another"), + new TextRun(" text after sequencial caption 3->"), + new SequentialIdentifier("Label"), + ], + }), + new Paragraph({ + children: [ + new TextRun("Hello World 2->"), + new SequentialIdentifier("Another"), + new TextRun(" text after sequencial caption 4->"), + new SequentialIdentifier("Label"), + ], + }), ], }); From 2bb7e08adeb552b28fec271b680ae396edd4d926 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 10 Oct 2019 01:19:55 +0100 Subject: [PATCH 42/57] Remove unnecessary method --- src/file/paragraph/paragraph.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index 5d8b4e0ae0..b11393ee37 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -45,7 +45,7 @@ export interface IParagraphOptions { readonly level: number; readonly custom?: boolean; }; - readonly children?: Array; + readonly children?: Array; } export class Paragraph extends XmlComponent { @@ -167,9 +167,4 @@ export class Paragraph extends XmlComponent { this.root.splice(1, 0, run); return this; } - - public addSequentialIdentifier(identifier: string): Paragraph { - this.root.push(new SequentialIdentifier(identifier)); - return this; - } } From 3b289be5ce7c03a990970f1cfd52003404c20937 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 10 Oct 2019 01:25:37 +0100 Subject: [PATCH 43/57] Fix demo --- demo/16-multiple-sections.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/16-multiple-sections.ts b/demo/16-multiple-sections.ts index 10e2098704..6e947a9d8a 100644 --- a/demo/16-multiple-sections.ts +++ b/demo/16-multiple-sections.ts @@ -1,12 +1,12 @@ // Multiple sections and headers // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Footer, Header, Packer, PageNumberFormat, PageOrientation, Paragraph, TextRun } from "../build"; +import { Document, Footer, Header, Packer, PageBreak, PageNumberFormat, PageOrientation, Paragraph, TextRun } from "../build"; const doc = new Document(); doc.addSection({ - children: [new Paragraph("Hello World").pageBreak()], + children: [new Paragraph("Hello World"), new PageBreak()], }); doc.addSection({ From 1d5e806ff45127b85a6f7d2e167a31e2e30a51b3 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 10 Oct 2019 21:03:38 +0100 Subject: [PATCH 44/57] Add character style tests --- demo/16-multiple-sections.ts | 4 +- src/file/styles/style/character-style.spec.ts | 215 ++++++++++++++++++ 2 files changed, 217 insertions(+), 2 deletions(-) diff --git a/demo/16-multiple-sections.ts b/demo/16-multiple-sections.ts index 6e947a9d8a..5518eb5416 100644 --- a/demo/16-multiple-sections.ts +++ b/demo/16-multiple-sections.ts @@ -1,12 +1,12 @@ // Multiple sections and headers // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Footer, Header, Packer, PageBreak, PageNumberFormat, PageOrientation, Paragraph, TextRun } from "../build"; +import { Document, Footer, Header, Packer, PageNumberFormat, PageOrientation, Paragraph, TextRun } from "../build"; const doc = new Document(); doc.addSection({ - children: [new Paragraph("Hello World"), new PageBreak()], + children: [new Paragraph("Hello World")], }); doc.addSection({ diff --git a/src/file/styles/style/character-style.spec.ts b/src/file/styles/style/character-style.spec.ts index fa12e5e512..fe269bfceb 100644 --- a/src/file/styles/style/character-style.spec.ts +++ b/src/file/styles/style/character-style.spec.ts @@ -52,6 +52,221 @@ describe("CharacterStyle", () => { ], }); }); + + it("should add smallCaps", () => { + const style = new CharacterStyle({ + id: "myStyleId", + run: { + smallCaps: true, + }, + }); + const tree = new Formatter().format(style); + expect(tree).to.deep.equal({ + "w:style": [ + { _attr: { "w:type": "character", "w:styleId": "myStyleId" } }, + { + "w:rPr": [{ "w:smallCaps": { _attr: { "w:val": true } } }], + }, + { + "w:uiPriority": { + _attr: { + "w:val": 99, + }, + }, + }, + { + "w:unhideWhenUsed": EMPTY_OBJECT, + }, + ], + }); + }); + + it("should add allCaps", () => { + const style = new CharacterStyle({ + id: "myStyleId", + run: { + allCaps: true, + }, + }); + const tree = new Formatter().format(style); + expect(tree).to.deep.equal({ + "w:style": [ + { _attr: { "w:type": "character", "w:styleId": "myStyleId" } }, + { + "w:rPr": [{ "w:caps": { _attr: { "w:val": true } } }], + }, + { + "w:uiPriority": { + _attr: { + "w:val": 99, + }, + }, + }, + { + "w:unhideWhenUsed": EMPTY_OBJECT, + }, + ], + }); + }); + + it("should add strike", () => { + const style = new CharacterStyle({ + id: "myStyleId", + run: { + strike: true, + }, + }); + const tree = new Formatter().format(style); + expect(tree).to.deep.equal({ + "w:style": [ + { _attr: { "w:type": "character", "w:styleId": "myStyleId" } }, + { + "w:rPr": [{ "w:strike": { _attr: { "w:val": true } } }], + }, + { + "w:uiPriority": { + _attr: { + "w:val": 99, + }, + }, + }, + { + "w:unhideWhenUsed": EMPTY_OBJECT, + }, + ], + }); + }); + + it("should add double strike", () => { + const style = new CharacterStyle({ + id: "myStyleId", + run: { + doubleStrike: true, + }, + }); + const tree = new Formatter().format(style); + expect(tree).to.deep.equal({ + "w:style": [ + { _attr: { "w:type": "character", "w:styleId": "myStyleId" } }, + { + "w:rPr": [{ "w:dstrike": { _attr: { "w:val": true } } }], + }, + { + "w:uiPriority": { + _attr: { + "w:val": 99, + }, + }, + }, + { + "w:unhideWhenUsed": EMPTY_OBJECT, + }, + ], + }); + }); + + it("should add sub script", () => { + const style = new CharacterStyle({ + id: "myStyleId", + run: { + subScript: true, + }, + }); + const tree = new Formatter().format(style); + expect(tree).to.deep.equal({ + "w:style": [ + { _attr: { "w:type": "character", "w:styleId": "myStyleId" } }, + { + "w:rPr": [ + { + "w:vertAlign": { + _attr: { + "w:val": "subscript", + }, + }, + }, + ], + }, + { + "w:uiPriority": { + _attr: { + "w:val": 99, + }, + }, + }, + { + "w:unhideWhenUsed": EMPTY_OBJECT, + }, + ], + }); + }); + + it("should add font", () => { + const style = new CharacterStyle({ + id: "myStyleId", + run: { + font: "test font", + }, + }); + const tree = new Formatter().format(style); + expect(tree).to.deep.equal({ + "w:style": [ + { _attr: { "w:type": "character", "w:styleId": "myStyleId" } }, + { + "w:rPr": [ + { + "w:rFonts": { + _attr: { + "w:ascii": "test font", + "w:cs": "test font", + "w:eastAsia": "test font", + "w:hAnsi": "test font", + }, + }, + }, + ], + }, + { + "w:uiPriority": { + _attr: { + "w:val": 99, + }, + }, + }, + { + "w:unhideWhenUsed": EMPTY_OBJECT, + }, + ], + }); + }); + + it("should add character spacing", () => { + const style = new CharacterStyle({ + id: "myStyleId", + run: { + characterSpacing: 100, + }, + }); + const tree = new Formatter().format(style); + expect(tree).to.deep.equal({ + "w:style": [ + { _attr: { "w:type": "character", "w:styleId": "myStyleId" } }, + { + "w:rPr": [{ "w:spacing": { _attr: { "w:val": 100 } } }], + }, + { + "w:uiPriority": { + _attr: { + "w:val": 99, + }, + }, + }, + { + "w:unhideWhenUsed": EMPTY_OBJECT, + }, + ], + }); + }); }); describe("formatting methods: style attributes", () => { From db59474f1e75e641e90f47ef1fe41cc9d42d2e6f Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 10 Oct 2019 21:10:03 +0100 Subject: [PATCH 45/57] Remove unused method --- src/file/styles/style/style.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/file/styles/style/style.ts b/src/file/styles/style/style.ts index 92df610e0d..d0d69f17ed 100644 --- a/src/file/styles/style/style.ts +++ b/src/file/styles/style/style.ts @@ -25,8 +25,4 @@ export class Style extends XmlComponent { this.root.push(new Name(name)); } } - - public push(styleSegment: XmlComponent): void { - this.root.push(styleSegment); - } } From 75c3c2f98500a891691047ae683d2fb15153ee59 Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 10 Oct 2019 21:27:27 +0100 Subject: [PATCH 46/57] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 10ca32c5c4..1fbe0f4f2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docx", - "version": "5.0.0-rc6", + "version": "5.0.0-rc7", "description": "Generate .docx documents with JavaScript (formerly Office-Clippy)", "main": "build/index.js", "scripts": { From 06abde24252318f199e275cdd36cc34283e65bf8 Mon Sep 17 00:00:00 2001 From: Seiya Date: Sat, 12 Oct 2019 02:06:17 +0300 Subject: [PATCH 47/57] fix set table cell width --- src/file/table/table-cell/table-cell.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/file/table/table-cell/table-cell.ts b/src/file/table/table-cell/table-cell.ts index 5c34d17903..469331bc08 100644 --- a/src/file/table/table-cell/table-cell.ts +++ b/src/file/table/table-cell/table-cell.ts @@ -6,7 +6,7 @@ import { IXmlableObject, XmlComponent } from "file/xml-components"; import { ITableShadingAttributesProperties } from "../shading"; import { Table } from "../table"; import { ITableCellMarginOptions } from "./cell-margin/table-cell-margins"; -import { VerticalAlign, VerticalMergeType } from "./table-cell-components"; +import { VerticalAlign, VerticalMergeType, WidthType } from "./table-cell-components"; import { TableCellProperties } from "./table-cell-properties"; export interface ITableCellOptions { @@ -14,6 +14,10 @@ export interface ITableCellOptions { readonly margins?: ITableCellMarginOptions; readonly verticalAlign?: VerticalAlign; readonly verticalMerge?: VerticalMergeType; + readonly width?: { + readonly size: number | string; + readonly type?: WidthType; + }; readonly columnSpan?: number; readonly rowSpan?: number; readonly borders?: { @@ -78,6 +82,10 @@ export class TableCell extends XmlComponent { this.properties.addVerticalMerge(VerticalMergeType.RESTART); } + if (options.width) { + this.properties.setWidth(options.width.size, options.width.type); + } + if (options.borders) { if (options.borders.top) { this.properties.Borders.addTopBorder(options.borders.top.style, options.borders.top.size, options.borders.top.color); From bfbe59cb84b9f124b303a86887d381fb55a07e5e Mon Sep 17 00:00:00 2001 From: Seiya Date: Sat, 12 Oct 2019 03:14:25 +0300 Subject: [PATCH 48/57] table cell width test --- src/file/table/table-cell/table-cell.spec.ts | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/file/table/table-cell/table-cell.spec.ts b/src/file/table/table-cell/table-cell.spec.ts index 4dd86ffc9c..a4c316f7ba 100644 --- a/src/file/table/table-cell/table-cell.spec.ts +++ b/src/file/table/table-cell/table-cell.spec.ts @@ -395,6 +395,33 @@ describe("TableCell", () => { }); }); + it("should create with width", () => { + const cell = new TableCell({ + children: [], + width: { size: 100, type: WidthType.DXA }, + }); + const tree = new Formatter().format(cell); + expect(tree).to.deep.equal({ + "w:tc": [ + { + "w:tcPr": [ + { + "w:tcW": { + _attr: { + "w:type": "dxa", + "w:w": 100, + }, + }, + }, + ], + }, + { + "w:p": {}, + }, + ], + }); + }); + it("should create with column span", () => { const cell = new TableCell({ children: [], From fcc42025983ce4b75a451efd0030317abf49cd74 Mon Sep 17 00:00:00 2001 From: James Montalvo Date: Sat, 12 Oct 2019 00:42:54 -0500 Subject: [PATCH 49/57] Bump nyc from 13.1.0 to 14.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1fbe0f4f2f..976e4d23f3 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "jszip": "^3.1.5", "mocha": "^5.2.0", "mocha-webpack": "^1.0.1", - "nyc": "^13.1.0", + "nyc": "^14.1.1", "pre-commit": "^1.2.2", "prettier": "^1.15.2", "prompt": "^1.0.0", From 50911fff5774bac9eaf32d6d50f60a0fa443f840 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 12 Oct 2019 21:42:10 +0100 Subject: [PATCH 50/57] Add color to example --- demo/2-declaritive-styles.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/demo/2-declaritive-styles.ts b/demo/2-declaritive-styles.ts index eaf39daffe..34d7e19e70 100644 --- a/demo/2-declaritive-styles.ts +++ b/demo/2-declaritive-styles.ts @@ -19,6 +19,7 @@ const doc = new Document({ size: 28, bold: true, italics: true, + color: "red", }, paragraph: { spacing: { From f685dbe0d1296cdda4985f72f0094974899ddd30 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 12 Oct 2019 21:46:18 +0100 Subject: [PATCH 51/57] Add lock file --- .gitignore | 1 - package-lock.json | 8452 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 8452 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index 8a7c8baf67..7b65d85792 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,6 @@ docs/.nojekyll .idea # Lock files -package-lock.json yarn.lock # Documents diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..90cf8f386f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,8452 @@ +{ + "name": "docx", + "version": "5.0.0-rc7", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", + "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "dev": true, + "requires": { + "@babel/types": "^7.6.3", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + } + } + }, + "@babel/parser": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", + "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "dev": true + }, + "@babel/template": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", + "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" + } + }, + "@babel/traverse": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", + "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.6.3", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.6.3", + "@babel/types": "^7.6.3", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + } + } + }, + "@sinonjs/commons": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz", + "integrity": "sha512-9jHK3YF/8HtJ9wCAbG+j8cD0i0+ATS9A7gXFqS36TblLPNy6rEEc+SB0imo91eCboGaBYGV/MT1/br/J+EE7Tw==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + }, + "dependencies": { + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + } + } + }, + "@sinonjs/formatio": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", + "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", + "dev": true, + "requires": { + "samsam": "1.3.0" + } + }, + "@sinonjs/samsam": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.2.tgz", + "integrity": "sha512-ILO/rR8LfAb60Y1Yfp9vxfYAASK43NFC2mLzpvLUbCQY/Qu8YwReboseu8aheCEkyElZF2L2T9mHcR2bgdvZyA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.0.2", + "array-from": "^2.1.1", + "lodash": "^4.17.11" + } + }, + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "@types/anymatch": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz", + "integrity": "sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==", + "dev": true + }, + "@types/bluebird": { + "version": "3.5.27", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.27.tgz", + "integrity": "sha512-6BmYWSBea18+tSjjSC3QIyV93ZKAeNWGM7R6aYt1ryTZXrlHF+QLV0G2yV0viEGVyRkyQsWfMoJ0k/YghBX5sQ==", + "dev": true + }, + "@types/caseless": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz", + "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", + "dev": true + }, + "@types/chai": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-3.5.2.tgz", + "integrity": "sha1-wRzSgX06QBt7oPWkIPNcVhObHB4=", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/form-data": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", + "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/fs-extra": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.1.tgz", + "integrity": "sha512-h3wnflb+jMTipvbbZnClgA2BexrT4w0GcfoCz5qyxd0IRsbqhLSyesM6mqZTAnhbVmhyTm5tuxfRu9R+8l+lGw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/handlebars": { + "version": "4.0.36", + "resolved": "https://registry.npmjs.org/@types/handlebars/-/handlebars-4.0.36.tgz", + "integrity": "sha512-LjNiTX7TY7wtuC6y3QwC93hKMuqYhgV9A1uXBKNvZtVC8ZvyWAjZkJ5BvT0K7RKqORRYRLMrqCxpw5RgS+MdrQ==", + "dev": true + }, + "@types/highlight.js": { + "version": "9.12.2", + "resolved": "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.12.2.tgz", + "integrity": "sha512-y5x0XD/WXDaGSyiTaTcKS4FurULJtSiYbGTeQd0m2LYZGBcZZ/7fM6t5H/DzeUF+kv8y6UfmF6yJABQsHcp9VQ==", + "dev": true + }, + "@types/jszip": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@types/jszip/-/jszip-3.1.6.tgz", + "integrity": "sha512-m8uFcI+O2EupCfbEVQWsBM/4nhbegjOHL7cQgBpM95FeF98kdFJXzy9/8yhx4b3lCRl/gMBhcvyh30Qt3X+XPQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/lodash": { + "version": "4.14.104", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.104.tgz", + "integrity": "sha512-ufQcVg4daO8xQ5kopxRHanqFdL4AI7ondQkV+2f+7mz3gvp0LkBx2zBRC6hfs3T87mzQFmf5Fck7Fi145Ul6NQ==", + "dev": true + }, + "@types/marked": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@types/marked/-/marked-0.3.0.tgz", + "integrity": "sha512-CSf9YWJdX1DkTNu9zcNtdCcn6hkRtB5ILjbhRId4ZOQqx30fXmdecuaXhugQL6eyrhuXtaHJ7PHI+Vm7k9ZJjg==", + "dev": true + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/mocha": { + "version": "2.2.48", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", + "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", + "dev": true + }, + "@types/node": { + "version": "12.0.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.12.tgz", + "integrity": "sha512-Uy0PN4R5vgBUXFoJrKryf5aTk3kJ8Rv3PdlHjl6UaX+Cqp1QE0yPQ68MPXGrZOfG7gZVNDIJZYyot0B9ubXUrQ==" + }, + "@types/request": { + "version": "2.48.1", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.1.tgz", + "integrity": "sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg==", + "dev": true, + "requires": { + "@types/caseless": "*", + "@types/form-data": "*", + "@types/node": "*", + "@types/tough-cookie": "*" + } + }, + "@types/request-promise": { + "version": "4.1.44", + "resolved": "https://registry.npmjs.org/@types/request-promise/-/request-promise-4.1.44.tgz", + "integrity": "sha512-RId7eFsUKxfal1LirDDIcOp9u3MM3NXFDBcC3sqIMcmu7f4U6DsCEMD8RbLZtnPrQlN5Jc79di/WPsIEDO4keg==", + "dev": true, + "requires": { + "@types/bluebird": "*", + "@types/request": "*" + } + }, + "@types/shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha512-M2giRw93PxKS7YjU6GZjtdV9HASdB7TWqizBXe4Ju7AqbKlWvTr0gNO92XH56D/gMxqD/jNHLNfC5hA34yGqrQ==", + "dev": true, + "requires": { + "@types/glob": "*", + "@types/node": "*" + } + }, + "@types/sinon": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-4.3.3.tgz", + "integrity": "sha512-Tt7w/ylBS/OEAlSCwzB0Db1KbxnkycP/1UkQpbvKFYoUuRn4uYsC3xh5TRPrOjTy0i8TIkSz1JdNL4GPVdf3KQ==", + "dev": true + }, + "@types/tapable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.4.tgz", + "integrity": "sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ==", + "dev": true + }, + "@types/tough-cookie": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.5.tgz", + "integrity": "sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg==", + "dev": true + }, + "@types/uglify-js": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.0.4.tgz", + "integrity": "sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + } + }, + "@types/webpack": { + "version": "4.4.34", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.4.34.tgz", + "integrity": "sha512-GnEBgjHsfO1M7DIQ0dAupSofcmDItE3Zsu3reK8SQpl/6N0rtUQxUmQzVFAS5ou/FGjsYKjXAWfItLZ0kNFTfQ==", + "dev": true, + "requires": { + "@types/anymatch": "*", + "@types/node": "*", + "@types/tapable": "*", + "@types/uglify-js": "*", + "source-map": "^0.6.0" + } + }, + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", + "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", + "dev": true, + "requires": { + "acorn": "^4.0.3" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ajv-keywords": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", + "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "dev": true, + "requires": { + "string-width": "^2.0.0" + } + }, + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + } + } + }, + "append-transform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", + "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "dev": true, + "requires": { + "default-require-extensions": "^2.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-from": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", + "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "awesome-typescript-loader": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/awesome-typescript-loader/-/awesome-typescript-loader-3.5.0.tgz", + "integrity": "sha512-qzgm9SEvodVkSi9QY7Me1/rujg+YBNMjayNSAyzNghwTEez++gXoPCwMvpbHRG7wrOkDCiF6dquvv9ESmUBAuw==", + "dev": true, + "requires": { + "chalk": "^2.3.1", + "enhanced-resolve": "3.3.0", + "loader-utils": "^1.1.0", + "lodash": "^4.17.4", + "micromatch": "^3.0.3", + "mkdirp": "^0.5.1", + "source-map-support": "^0.5.3" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-polyfill": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", + "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "core-js": "^2.4.0", + "regenerator-runtime": "^0.10.0" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + } + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "bluebird": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "dev": true, + "requires": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "caching-transform": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", + "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", + "dev": true, + "requires": { + "hasha": "^3.0.0", + "make-dir": "^2.0.0", + "package-hash": "^3.0.0", + "write-file-atomic": "^2.4.2" + }, + "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "capture-stack-trace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chai": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", + "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", + "dev": true, + "requires": { + "assertion-error": "^1.0.1", + "deep-eql": "^0.1.3", + "type-detect": "^1.0.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "ci-info": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "clipboard": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz", + "integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==", + "dev": true, + "optional": true, + "requires": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", + "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "configstore": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", + "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "unique-string": "^1.0.0", + "write-file-atomic": "^2.0.0", + "xdg-basedir": "^3.0.0" + } + }, + "connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + } + }, + "connect-livereload": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/connect-livereload/-/connect-livereload-0.6.1.tgz", + "integrity": "sha512-3R0kMOdL7CjJpU66fzAkCe6HNtd3AavCS4m+uW4KtJjrdGPT0SQEZieAYd+cm+lJoBznNQ4lqipYWkhBMgk00g==", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", + "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cp-file": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-4.2.0.tgz", + "integrity": "sha1-cVNhZjtx7eC23dvDyA4roC5yXsM=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "nested-error-stacks": "^2.0.0", + "pify": "^2.3.0", + "safe-buffer": "^5.0.1" + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-error-class": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "dev": true, + "requires": { + "capture-stack-trace": "^1.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "crypto-random-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", + "dev": true + }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", + "dev": true + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "dev": true, + "requires": { + "type-detect": "0.1.1" + }, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", + "dev": true + } + } + }, + "deep-equal": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", + "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=", + "dev": true + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "default-require-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "dev": true, + "requires": { + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", + "dev": true, + "optional": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "docsify": { + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/docsify/-/docsify-4.9.4.tgz", + "integrity": "sha512-Xtm6sfrNU7cqOViWMewDhscn0cySF60q2KTKok9OaPmzt6nRkTAIvYU4dj916IT21o/b336Or3vO2hsvmaQzxg==", + "dev": true, + "requires": { + "marked": "^0.5.1", + "medium-zoom": "^0.4.0", + "opencollective": "^1.0.3", + "prismjs": "^1.15.0", + "tinydate": "^1.0.0", + "tweezer.js": "^1.4.0" + } + }, + "docsify-cli": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/docsify-cli/-/docsify-cli-4.3.0.tgz", + "integrity": "sha512-88O1sMeoZv4lb5GPSJzDtOAv2KzBjpQaSqVlVqY+6hGJfb2wpz9PvlUhvlgPq54zu4kPDeCCyUYgqa/llhKg3w==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "connect": "^3.6.0", + "connect-livereload": "^0.6.0", + "cp-file": "^4.1.1", + "docsify": ">=3", + "docsify-server-renderer": ">=4", + "fs-extra": "^2.1.2", + "livereload": "^0.7.0", + "lru-cache": "^4.1.1", + "opn": "^5.3.0", + "serve-static": "^1.12.1", + "update-notifier": "^2.1.0", + "y18n": "^3.2.1", + "yargonaut": "^1.1.2", + "yargs": "^7.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "fs-extra": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", + "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "opn": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "dev": true, + "requires": { + "is-wsl": "^1.1.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + } + } + } + }, + "docsify-server-renderer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/docsify-server-renderer/-/docsify-server-renderer-4.9.1.tgz", + "integrity": "sha512-JERMD3yEJq38nSim/o1VGBoyqxsRo1VRscafpkx3mT7g07orOg5UARUgztKQNmv+0xnkWsmu+BMr9nsurXmBMQ==", + "dev": true, + "requires": { + "debug": "^2.6.8", + "docsify": "^4.8.0", + "node-fetch": "^1.7.0", + "resolve-pathname": "^2.1.0" + }, + "dependencies": { + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "dev": true, + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + } + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "elliptic": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", + "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.3.0.tgz", + "integrity": "sha512-2qbxE7ek3YxPJ1ML6V+satHkzHpJQKWkRHmRx6mfAoW59yP8YH8BFplbegSP+u2hBd6B6KCOpvJQ3dZAP+hkpg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "object-assign": "^4.0.1", + "tapable": "^0.2.5" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es5-ext": { + "version": "0.10.50", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", + "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "^1.0.0" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-set": "~0.1.5", + "es6-symbol": "~3.1.1", + "event-emitter": "~0.3.5" + } + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-symbol": "3.1.1", + "event-emitter": "~0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "requires": { + "es6-map": "^0.1.3", + "es6-weak-map": "^2.0.1", + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", + "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "figlet": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.2.3.tgz", + "integrity": "sha512-+F5zdvZ66j77b8x2KCPvWUHC0UCKUMWrewxmewgPlagp3wmDpcrHMbyv/ygq/6xoxBPGQA+UJU3SMoBzKoROQQ==", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "foreground-child": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + } + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "fs-extra": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", + "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", + "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", + "dev": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", + "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", + "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", + "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "dev": true, + "optional": true + } + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "dev": true, + "requires": { + "ini": "^1.3.4" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", + "dev": true, + "optional": true, + "requires": { + "delegate": "^3.1.2" + } + }, + "got": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "dev": true, + "requires": { + "create-error-class": "^3.0.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-redirect": "^1.0.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "lowercase-keys": "^1.0.0", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "unzip-response": "^2.0.1", + "url-parse-lax": "^1.0.0" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + } + } + }, + "graceful-fs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "handlebars": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "dev": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.1.tgz", + "integrity": "sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + } + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hasha": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", + "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", + "dev": true, + "requires": { + "is-stream": "^1.0.1" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "highlight.js": { + "version": "9.15.8", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.8.tgz", + "integrity": "sha512-RrapkKQWwE+wKdF73VsOa2RQdIoO3mxwJ4P8mhbI6KYJUraUHRKM5w5zQQKXNk0xNL4UVRdulV9SBJcmzJNzVA==", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "http-errors": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", + "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "i": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", + "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "inquirer": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz", + "integrity": "sha1-4EqqnQW3o8ubD0B9BDdfBEcZA0c=", + "dev": true, + "requires": { + "ansi-escapes": "^1.1.0", + "chalk": "^1.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.1", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx": "^4.1.0", + "string-width": "^2.0.0", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-ci": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", + "dev": true, + "requires": { + "ci-info": "^1.5.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + }, + "dependencies": { + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + } + } + }, + "is-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "dev": true, + "requires": { + "global-dirs": "^0.1.0", + "is-path-inside": "^1.0.0" + } + }, + "is-npm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", + "dev": true + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-instrumenter-loader": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-instrumenter-loader/-/istanbul-instrumenter-loader-3.0.1.tgz", + "integrity": "sha512-a5SPObZgS0jB/ixaKSMdn6n/gXSrK2S6q/UfRJBT3e6gQmVjwZROTODQsYW5ZNwOu78hG62Y3fWlebaVOL0C+w==", + "dev": true, + "requires": { + "convert-source-map": "^1.5.0", + "istanbul-lib-instrument": "^1.7.3", + "loader-utils": "^1.1.0", + "schema-utils": "^0.3.0" + } + }, + "istanbul-lib-coverage": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz", + "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", + "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", + "dev": true, + "requires": { + "append-transform": "^1.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz", + "integrity": "sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A==", + "dev": true, + "requires": { + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.18.0", + "istanbul-lib-coverage": "^1.2.1", + "semver": "^5.3.0" + } + }, + "istanbul-lib-report": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", + "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", + "dev": true, + "requires": { + "handlebars": "^4.1.2" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json-loader": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", + "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jszip": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.2.2.tgz", + "integrity": "sha512-NmKajvAFQpbg3taXQXr/ccS2wcucR1AZ+NtyWp2Nq7HHVsXhcJFR8p0Baf32C2yVvBylFWVeKf+WI2AnvlPhpA==", + "requires": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "set-immediate-shim": "~1.0.1" + } + }, + "just-extend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", + "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "latest-version": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", + "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", + "dev": true, + "requires": { + "package-json": "^4.0.0" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "requires": { + "immediate": "~3.0.5" + } + }, + "livereload": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/livereload/-/livereload-0.7.0.tgz", + "integrity": "sha512-PHnIGczQEvmCctDvRTWylA+1wSwE0/eFm+LkNhlmlAFus/aCRlVE97UOLOf6TUGLmZyfg7z7twG37ZiOgNJAyQ==", + "dev": true, + "requires": { + "chokidar": "^1.7.0", + "opts": ">= 1.2.0", + "ws": "^1.1.5" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "dev": true + }, + "loader-utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^2.0.0", + "json5": "^1.0.1" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lolex": { + "version": "2.7.5", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", + "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "dev": true + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "marked": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.5.2.tgz", + "integrity": "sha512-fdZvBa7/vSQIZCi4uuwo2N3q+7jJURpMVCcbaX0S1Mg65WZ5ilXvC67MviJAsdjqqgD+CEq4RKo5AYGgINkVAA==", + "dev": true + }, + "math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "medium-zoom": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-0.4.0.tgz", + "integrity": "sha512-0z7yMfd6I1BTCAa8QaR4cp5AqDkQD571GzhHIbbfefKEssGLSvs+4Xai/itOAncm4FBlF5gUoMQ22yW9/f8Sig==", + "dev": true + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + }, + "dependencies": { + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + } + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "merge-source-map": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "dev": true, + "requires": { + "mime-db": "1.40.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "mocha-webpack": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mocha-webpack/-/mocha-webpack-1.1.0.tgz", + "integrity": "sha512-brmE0tR6G5JbEzZXspJmF/uZm2J/YM/69M3VS6ND76i6wXbebFpE+bQDaehilK8CZanNSsTCcqTTLh1PZuRKJw==", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "chalk": "^2.3.0", + "chokidar": "^1.6.1", + "glob-parent": "^3.1.0", + "globby": "^6.1.0", + "interpret": "^1.0.1", + "is-glob": "^4.0.0", + "loader-utils": "^1.1.0", + "lodash": "^4.3.0", + "memory-fs": "^0.4.1", + "nodent-runtime": "^3.0.3", + "normalize-path": "^2.0.1", + "progress": "^2.0.0", + "source-map-support": "^0.5.0", + "strip-ansi": "^4.0.0", + "toposort": "^1.0.0", + "yargs": "^4.8.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "ncp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", + "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=", + "dev": true + }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, + "nested-error-stacks": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", + "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "nise": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.0.tgz", + "integrity": "sha512-Z3sfYEkLFzFmL8KY6xnSJLRxwQwYBjOXi/24lb62ZnZiGA0JUzGGTI6TBIgfCSMIDl9Jlu8SRmHNACLTemDHww==", + "dev": true, + "requires": { + "@sinonjs/formatio": "^3.1.0", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "lolex": "^4.1.0", + "path-to-regexp": "^1.7.0" + }, + "dependencies": { + "@sinonjs/formatio": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz", + "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1", + "@sinonjs/samsam": "^3.1.0" + } + }, + "lolex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.1.0.tgz", + "integrity": "sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw==", + "dev": true + } + } + }, + "node-fetch": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz", + "integrity": "sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=", + "dev": true, + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "nodent-runtime": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/nodent-runtime/-/nodent-runtime-3.2.1.tgz", + "integrity": "sha512-7Ws63oC+215smeKJQCxzrK21VFVlCFBkwl0MOObt0HOpVQXs3u483sAmtkF33nNqZ5rSOQjB76fgyPBmAUrtCA==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nyc": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", + "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "caching-transform": "^3.0.2", + "convert-source-map": "^1.6.0", + "cp-file": "^6.2.0", + "find-cache-dir": "^2.1.0", + "find-up": "^3.0.0", + "foreground-child": "^1.5.6", + "glob": "^7.1.3", + "istanbul-lib-coverage": "^2.0.5", + "istanbul-lib-hook": "^2.0.7", + "istanbul-lib-instrument": "^3.3.0", + "istanbul-lib-report": "^2.0.8", + "istanbul-lib-source-maps": "^3.0.6", + "istanbul-reports": "^2.2.4", + "js-yaml": "^3.13.1", + "make-dir": "^2.1.0", + "merge-source-map": "^1.1.0", + "resolve-from": "^4.0.0", + "rimraf": "^2.6.3", + "signal-exit": "^3.0.2", + "spawn-wrap": "^1.4.2", + "test-exclude": "^5.2.3", + "uuid": "^3.3.2", + "yargs": "^13.2.2", + "yargs-parser": "^13.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "cp-file": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", + "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "make-dir": "^2.0.0", + "nested-error-stacks": "^2.0.0", + "pify": "^4.0.1", + "safe-buffer": "^5.0.1" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "opencollective": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz", + "integrity": "sha1-ruY3K8KBRFg2kMPKja7PwSDdDvE=", + "dev": true, + "requires": { + "babel-polyfill": "6.23.0", + "chalk": "1.1.3", + "inquirer": "3.0.6", + "minimist": "1.2.0", + "node-fetch": "1.6.3", + "opn": "4.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "opn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", + "integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + } + } + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", + "dev": true + }, + "opts": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/opts/-/opts-1.2.6.tgz", + "integrity": "sha1-0YXAQlz9652h0YKQi2W1wCOP67M=", + "dev": true + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "package-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", + "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^3.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "package-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", + "dev": true, + "requires": { + "got": "^6.7.1", + "registry-auth-token": "^3.0.1", + "registry-url": "^3.0.3", + "semver": "^5.1.0" + } + }, + "pako": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==" + }, + "parent-require": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parent-require/-/parent-require-1.0.0.tgz", + "integrity": "sha1-dGoWdjgIOoYLDu9nMssn7UbDKXc=", + "dev": true + }, + "parse-asn1": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", + "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + } + } + }, + "pkginfo": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", + "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "pre-commit": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz", + "integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "spawn-sync": "^1.0.15", + "which": "1.2.x" + } + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prettier": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", + "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "dev": true + }, + "prismjs": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.16.0.tgz", + "integrity": "sha512-OA4MKxjFZHSvZcisLGe14THYsug/nF6O1f0pAJc0KN0wTyAcLqmsbE+lTGKSpyh+9pEW57+k6pg2AfYR+coyHA==", + "dev": true, + "requires": { + "clipboard": "^2.0.0" + } + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "prompt": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.0.0.tgz", + "integrity": "sha1-jlcSPDlquYiJf7Mn/Trtw+c15P4=", + "dev": true, + "requires": { + "colors": "^1.1.2", + "pkginfo": "0.x.x", + "read": "1.0.x", + "revalidator": "0.1.x", + "utile": "0.3.x", + "winston": "2.1.x" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz", + "integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "dev": true, + "requires": { + "mute-stream": "~0.0.4" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "registry-auth-token": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", + "integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", + "dev": true, + "requires": { + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "requires": { + "rc": "^1.0.1" + } + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "replace-in-file": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-3.4.4.tgz", + "integrity": "sha512-ehq0dFsxSpfPiPLBU5kli38Ud8bZL0CQKG8WQVbvhmyilXaMJ8y4LtDZs/K3MD8C0+rHbsfW8c9r2bUEy0B/6Q==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "glob": "^7.1.3", + "yargs": "^13.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.0" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "request-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.4.tgz", + "integrity": "sha512-8wgMrvE546PzbR5WbYxUQogUnUDfM0S7QIFZMID+J73vdFARkFy+HElj4T+MWYhpXwlLp0EQ8Zoj8xUA0he4Vg==", + "dev": true, + "requires": { + "bluebird": "^3.5.0", + "request-promise-core": "1.1.2", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, + "request-promise-core": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", + "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", + "dev": true, + "requires": { + "lodash": "^4.17.11" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "resolve-pathname": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-2.2.0.tgz", + "integrity": "sha512-bAFz9ld18RzJfddgrO2e/0S2O81710++chRMUxHjXOYKF6jTAMrUNZrEZ1PvV0zlhfjidm08iRPdTLPno1FuRg==", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "revalidator": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", + "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rx": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", + "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "samsam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", + "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", + "dev": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "schema-utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", + "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", + "dev": true, + "requires": { + "ajv": "^5.0.0" + } + }, + "select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=", + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "semver-diff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "dev": true, + "requires": { + "semver": "^5.0.3" + } + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "sinon": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-5.1.1.tgz", + "integrity": "sha512-h/3uHscbt5pQNxkf7Y/Lb9/OM44YNCicHakcq73ncbrIS8lXg+ZGOZbtuU+/km4YnyiCYfQQEwANaReJz7KDfw==", + "dev": true, + "requires": { + "@sinonjs/formatio": "^2.0.0", + "diff": "^3.5.0", + "lodash.get": "^4.4.2", + "lolex": "^2.4.2", + "nise": "^1.3.3", + "supports-color": "^5.4.0", + "type-detect": "^4.0.8" + }, + "dependencies": { + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "dev": true, + "requires": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, + "spawn-wrap": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", + "integrity": "sha512-IgB8md0QW/+tWqcavuFgKYR/qIRvJkRLPJDFaoXtLLUaVcCDK0+HeFTkmQHj3eprcYhc+gOl0aEA1w7qZlYezw==", + "dev": true, + "requires": { + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" + }, + "dependencies": { + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tapable": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.9.tgz", + "integrity": "sha512-2wsvQ+4GwBvLPLWsNfLCDYGsW6xb7aeC6utq2Qh0PFwgEy7K7dsma9Jsmb2zSQj7GvYAyUGSntLtsv++GmgL1A==", + "dev": true + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "requires": { + "execa": "^0.7.0" + }, + "dependencies": { + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + } + } + }, + "test-exclude": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "dev": true, + "requires": { + "glob": "^7.1.3", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, + "timers-browserify": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", + "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "dev": true, + "optional": true + }, + "tinydate": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.1.0.tgz", + "integrity": "sha512-YF6YTOyBRHX4b3EtEI0W/mROcv82Gt6VccmVuSAkRV3FNORug2457wSGvT2cThbfuctQvVSmC5GobGheScxtIw==", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, + "toposort": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz", + "integrity": "sha1-LmhELZ9k7HILjMieZEOsbKqVACk=", + "dev": true + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "ts-node": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", + "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", + "dev": true, + "requires": { + "arrify": "^1.0.0", + "buffer-from": "^1.1.0", + "diff": "^3.1.0", + "make-error": "^1.1.1", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "source-map-support": "^0.5.6", + "yn": "^2.0.0" + } + }, + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "dev": true + }, + "tslint": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", + "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + } + }, + "tslint-immutable": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/tslint-immutable/-/tslint-immutable-4.9.1.tgz", + "integrity": "sha512-iIFCq08H4YyNIX0bV5N6fGQtAmjc4OQZKQCgBP5WHgQaITyGAHPVmAw+Yf7qe0zbRCvCDZdrdEC/191fLGFiww==", + "dev": true + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "tweezer.js": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/tweezer.js/-/tweezer.js-1.5.0.tgz", + "integrity": "sha512-aSiJz7rGWNAQq7hjMK9ZYDuEawXupcCWgl3woQQSoDP2Oh8O4srWb/uO1PzzHIsrPEOqrjJ2sUb9FERfzuBabQ==", + "dev": true + }, + "type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", + "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==", + "dev": true + }, + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typedoc": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.11.1.tgz", + "integrity": "sha512-jdNIoHm5wkZqxQTe/g9AQ3LKnZyrzHXqu6A/c9GUOeJyBWLxNr7/Dm3rwFvLksuxRNwTvY/0HRDU9sJTa9WQSg==", + "dev": true, + "requires": { + "@types/fs-extra": "5.0.1", + "@types/handlebars": "4.0.36", + "@types/highlight.js": "9.12.2", + "@types/lodash": "4.14.104", + "@types/marked": "0.3.0", + "@types/minimatch": "3.0.3", + "@types/shelljs": "0.7.8", + "fs-extra": "^5.0.0", + "handlebars": "^4.0.6", + "highlight.js": "^9.0.0", + "lodash": "^4.17.5", + "marked": "^0.3.17", + "minimatch": "^3.0.0", + "progress": "^2.0.0", + "shelljs": "^0.8.1", + "typedoc-default-themes": "^0.5.0", + "typescript": "2.7.2" + }, + "dependencies": { + "marked": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "dev": true + }, + "shelljs": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", + "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "typescript": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz", + "integrity": "sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw==", + "dev": true + } + } + }, + "typedoc-default-themes": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz", + "integrity": "sha1-bcJDPnjti+qOiHo6zeLzF4W9Yic=", + "dev": true + }, + "typescript": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", + "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "dev": true + }, + "uglify-js": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "dev": true, + "optional": true, + "requires": { + "commander": "~2.20.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true, + "optional": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "uglifyjs-webpack-plugin": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz", + "integrity": "sha1-uVH0q7a9YX5m9j64kUmOORdj4wk=", + "dev": true, + "requires": { + "source-map": "^0.5.6", + "uglify-js": "^2.8.29", + "webpack-sources": "^1.0.1" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "dev": true, + "requires": { + "crypto-random-string": "^1.0.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "unzip-response": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", + "dev": true + }, + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true + }, + "update-notifier": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", + "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", + "dev": true, + "requires": { + "boxen": "^1.2.1", + "chalk": "^2.0.1", + "configstore": "^3.0.0", + "import-lazy": "^2.1.0", + "is-ci": "^1.0.10", + "is-installed-globally": "^0.1.0", + "is-npm": "^1.0.0", + "latest-version": "^3.0.0", + "semver-diff": "^2.0.0", + "xdg-basedir": "^3.0.0" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utile": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/utile/-/utile-0.3.0.tgz", + "integrity": "sha1-E1LDQOuCDk2N26A5pPv6oy7U7zo=", + "dev": true, + "requires": { + "async": "~0.9.0", + "deep-equal": "~0.2.1", + "i": "0.3.x", + "mkdirp": "0.x.x", + "ncp": "1.0.x", + "rimraf": "2.x.x" + } + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vm-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true + }, + "watchpack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "dev": true, + "requires": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "chokidar": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + } + } + }, + "webpack": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.12.0.tgz", + "integrity": "sha512-Sw7MdIIOv/nkzPzee4o0EdvCuPmxT98+vVpIvwtcwcF1Q4SDSNp92vwcKc4REe7NItH9f1S4ra9FuQ7yuYZ8bQ==", + "dev": true, + "requires": { + "acorn": "^5.0.0", + "acorn-dynamic-import": "^2.0.0", + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0", + "async": "^2.1.2", + "enhanced-resolve": "^3.4.0", + "escope": "^3.6.0", + "interpret": "^1.0.0", + "json-loader": "^0.5.4", + "json5": "^0.5.1", + "loader-runner": "^2.3.0", + "loader-utils": "^1.1.0", + "memory-fs": "~0.4.1", + "mkdirp": "~0.5.0", + "node-libs-browser": "^2.0.0", + "source-map": "^0.5.3", + "supports-color": "^4.2.1", + "tapable": "^0.2.7", + "uglifyjs-webpack-plugin": "^0.4.6", + "watchpack": "^1.4.0", + "webpack-sources": "^1.0.1", + "yargs": "^8.0.2" + }, + "dependencies": { + "ajv": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.1.tgz", + "integrity": "sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "dev": true, + "requires": { + "lodash": "^4.17.11" + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "enhanced-resolve": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", + "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "object-assign": "^4.0.1", + "tapable": "^0.2.7" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", + "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "read-pkg-up": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^7.0.0" + } + }, + "yargs-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", + "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "webpack-sources": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz", + "integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + }, + "which": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", + "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "dev": true, + "requires": { + "string-width": "^2.1.1" + } + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", + "dev": true + }, + "winston": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.1.1.tgz", + "integrity": "sha1-PJNJ0ZYgf9G9/51LxD73JRDjoS4=", + "dev": true, + "requires": { + "async": "~1.0.0", + "colors": "1.0.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "pkginfo": "0.3.x", + "stack-trace": "0.0.x" + }, + "dependencies": { + "async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", + "dev": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + }, + "pkginfo": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz", + "integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=", + "dev": true + } + } + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "ws": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", + "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", + "dev": true, + "requires": { + "options": ">=0.0.5", + "ultron": "1.0.x" + } + }, + "xdg-basedir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", + "dev": true + }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=" + }, + "xml-js": { + "version": "1.6.11", + "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", + "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", + "requires": { + "sax": "^1.2.4" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargonaut": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/yargonaut/-/yargonaut-1.1.4.tgz", + "integrity": "sha512-rHgFmbgXAAzl+1nngqOcwEljqHGG9uUZoPjsdZEs1w5JW9RXYzrSvH/u70C1JE5qFi0qjsdhnUX/dJRpWqitSA==", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "figlet": "^1.1.1", + "parent-require": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "yargs": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "dev": true, + "requires": { + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" + } + }, + "yn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "dev": true + } + } +} From 75cdae1473a45d51f065a5e36b546389055153cb Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 12 Oct 2019 22:16:36 +0100 Subject: [PATCH 52/57] Put docx in a seperate namespace in the browser version rather than the global namespace --- demo/browser-demo.html | 12 ++++++------ webpack.config.ts | 20 +++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/demo/browser-demo.html b/demo/browser-demo.html index 22c7c821a5..82f064deb2 100644 --- a/demo/browser-demo.html +++ b/demo/browser-demo.html @@ -12,18 +12,18 @@