From d19ff1e300d552d32fca56ee51b1a594da7505c8 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 15 Dec 2017 01:16:04 +0000 Subject: [PATCH 01/28] Add file class --- src/docx/file.ts | 26 ++++++++++++++++++++++++++ src/docx/index.ts | 1 + 2 files changed, 27 insertions(+) create mode 100644 src/docx/file.ts diff --git a/src/docx/file.ts b/src/docx/file.ts new file mode 100644 index 0000000000..e0053cc691 --- /dev/null +++ b/src/docx/file.ts @@ -0,0 +1,26 @@ +import { Media } from "../media"; +import { Numbering } from "../numbering"; +import { Properties } from "../properties"; +import { Styles } from "../styles"; +import { Document } from "./document"; + +export class File { + + private document: Document; + private styles: Styles; + private properties: Properties; + private numbering: Numbering; + private media: Media; + + constructor() { + this.document = new Document(); + this.styles = new Styles(); + this.properties = new Properties({ + creator: "Un-named", + revision: "1", + lastModifiedBy: "Un-named", + }); + this.numbering = new Numbering(); + this.media = new Media(); + } +} diff --git a/src/docx/index.ts b/src/docx/index.ts index 9e7f554a4e..c11178fda4 100644 --- a/src/docx/index.ts +++ b/src/docx/index.ts @@ -2,3 +2,4 @@ export * from "./document"; export * from "./paragraph"; export * from "./run"; export { Table } from "./table"; +export { File } from "./file"; From 742e2b50896391f9fa5ad47edb634659eec933d2 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 15 Dec 2017 02:15:44 +0000 Subject: [PATCH 02/28] Make compiler take in a file --- src/docx/document/document.ts | 1 - src/docx/file.ts | 60 ++++++++++++++++++++++++++++----- src/export/packer/compiler.ts | 37 ++++---------------- src/export/packer/express.ts | 10 ++---- src/export/packer/local.spec.ts | 26 ++++++-------- src/export/packer/local.ts | 10 ++---- 6 files changed, 76 insertions(+), 68 deletions(-) diff --git a/src/docx/document/document.ts b/src/docx/document/document.ts index fa13145b94..74f602eb5e 100644 --- a/src/docx/document/document.ts +++ b/src/docx/document/document.ts @@ -52,5 +52,4 @@ export class Document extends XmlComponent { this.addTable(table); return table; } - } diff --git a/src/docx/file.ts b/src/docx/file.ts index e0053cc691..2b11926fdb 100644 --- a/src/docx/file.ts +++ b/src/docx/file.ts @@ -1,8 +1,10 @@ import { Media } from "../media"; import { Numbering } from "../numbering"; -import { Properties } from "../properties"; +import { IPropertiesOptions, Properties } from "../properties"; import { Styles } from "../styles"; +import { DefaultStylesFactory } from "../styles/factory"; import { Document } from "./document"; +import { Paragraph, Table } from "./index"; export class File { @@ -12,15 +14,57 @@ export class File { private numbering: Numbering; private media: Media; - constructor() { + constructor(options?: IPropertiesOptions) { this.document = new Document(); - this.styles = new Styles(); - this.properties = new Properties({ - creator: "Un-named", - revision: "1", - lastModifiedBy: "Un-named", - }); + const stylesFactory = new DefaultStylesFactory(); + this.styles = stylesFactory.newInstance(); + + if (!options) { + options = { + creator: "Un-named", + revision: "1", + lastModifiedBy: "Un-named", + }; + } + + this.properties = new Properties(options); this.numbering = new Numbering(); this.media = new Media(); } + + public addParagraph(paragraph: Paragraph): void { + this.document.addParagraph(paragraph); + } + + public createParagraph(text?: string): Paragraph { + return this.document.createParagraph(); + } + + public addTable(table: Table): void { + return this.document.addTable(table); + } + + public createTable(rows: number, cols: number): Table { + return this.document.createTable(rows, cols); + } + + public get Document(): Document { + return this.document; + } + + public get Styles(): Styles { + return this.styles; + } + + public get Properties(): Properties { + return this.properties; + } + + public get Numbering(): Numbering { + return this.numbering; + } + + public get Media(): Media { + return this.media; + } } diff --git a/src/export/packer/compiler.ts b/src/export/packer/compiler.ts index b1e3f0a1d7..66765906fd 100644 --- a/src/export/packer/compiler.ts +++ b/src/export/packer/compiler.ts @@ -4,12 +4,7 @@ import * as fs from "fs"; import * as path from "path"; import * as xml from "xml"; -import { Document } from "../../docx"; -import { Media } from "../../media"; -import { Numbering } from "../../numbering"; -import { Properties } from "../../properties"; -import { Styles } from "../../styles"; -import { DefaultStylesFactory } from "../../styles/factory"; +import { File } from "../../docx"; import { Formatter } from "../formatter"; const TEMPLATE_PATH = path.resolve(__dirname, "../../../template"); @@ -17,29 +12,11 @@ const TEMPLATE_PATH = path.resolve(__dirname, "../../../template"); export class Compiler { protected archive: archiver.Archiver; private formatter: Formatter; - private style: Styles; - constructor( - protected document: Document, - style?: Styles, - private properties: Properties = new Properties({ - creator: "Un-named", - revision: "1", - lastModifiedBy: "Un-named", - }), - private numbering: Numbering = new Numbering(), - private media: Media = new Media(), - ) { + constructor(private file: File) { this.formatter = new Formatter(); this.archive = archiver.create("zip", {}); - if (style) { - this.style = style; - } else { - const stylesFactory = new DefaultStylesFactory(); - this.style = stylesFactory.newInstance(); - } - this.archive.on("error", (err) => { throw err; }); @@ -55,15 +32,15 @@ export class Compiler { cwd: TEMPLATE_PATH, }); - const xmlDocument = xml(this.formatter.format(this.document)); - const xmlStyles = xml(this.formatter.format(this.style)); - const xmlProperties = xml(this.formatter.format(this.properties), { + const xmlDocument = xml(this.formatter.format(this.file.Document)); + const xmlStyles = xml(this.formatter.format(this.file.Styles)); + const xmlProperties = xml(this.formatter.format(this.file.Properties), { declaration: { standalone: "yes", encoding: "UTF-8", }, }); - const xmlNumbering = xml(this.formatter.format(this.numbering)); + const xmlNumbering = xml(this.formatter.format(this.file.Numbering)); this.archive.append(xmlDocument, { name: "word/document.xml", @@ -81,7 +58,7 @@ export class Compiler { name: "word/numbering.xml", }); - for (const data of this.media.array) { + for (const data of this.file.Media.array) { this.archive.append(data.stream, { name: `media/${data.fileName}`, }); diff --git a/src/export/packer/express.ts b/src/export/packer/express.ts index f5f2789f1d..5c065e60b5 100644 --- a/src/export/packer/express.ts +++ b/src/export/packer/express.ts @@ -1,10 +1,6 @@ import * as express from "express"; -import { Document } from "../../docx/document"; -import { Media } from "../../media"; -import { Numbering } from "../../numbering"; -import { Properties } from "../../properties"; -import { Styles } from "../../styles"; +import { File } from "../../docx"; import { Compiler } from "./compiler"; import { IPacker } from "./packer"; @@ -12,8 +8,8 @@ export class ExpressPacker implements IPacker { private res: express.Response; private packer: Compiler; - constructor(document: Document, res: express.Response, styles?: Styles, properties?: Properties, numbering?: Numbering, media?: Media) { - this.packer = new Compiler(document, styles, properties, numbering, media); + constructor(file: File, res: express.Response) { + this.packer = new Compiler(file); this.res = res; diff --git a/src/export/packer/local.spec.ts b/src/export/packer/local.spec.ts index 79caf6dd9c..092fe97a6b 100644 --- a/src/export/packer/local.spec.ts +++ b/src/export/packer/local.spec.ts @@ -1,31 +1,27 @@ /* tslint:disable:typedef space-before-function-paren */ import * as fs from "fs"; -import { Document } from "../../docx/document"; +import { File } from "../../docx"; import { Paragraph } from "../../docx/paragraph"; import { LocalPacker } from "../../export/packer/local"; -import { Properties } from "../../properties"; -import { DefaultStylesFactory } from "../../styles/factory"; -describe("LocalPacker", () => { +describe.only("LocalPacker", () => { let packer: LocalPacker; - let stylesFactory: DefaultStylesFactory; beforeEach(() => { - const document = new Document(); - const paragraph = new Paragraph("test text"); - const heading = new Paragraph("Hello world").heading1(); - document.addParagraph(new Paragraph("title").title()); - document.addParagraph(heading); - document.addParagraph(new Paragraph("heading 2").heading2()); - document.addParagraph(paragraph); - const properties = new Properties({ + const file = new File({ creator: "Dolan Miu", revision: "1", lastModifiedBy: "Dolan Miu", }); - stylesFactory = new DefaultStylesFactory(); - packer = new LocalPacker(document, stylesFactory.newInstance(), properties); + const paragraph = new Paragraph("test text"); + const heading = new Paragraph("Hello world").heading1(); + file.addParagraph(new Paragraph("title").title()); + file.addParagraph(heading); + file.addParagraph(new Paragraph("heading 2").heading2()); + file.addParagraph(paragraph); + + packer = new LocalPacker(file); }); describe("#pack()", () => { diff --git a/src/export/packer/local.ts b/src/export/packer/local.ts index 1fefb6cb20..a1d293e0e0 100644 --- a/src/export/packer/local.ts +++ b/src/export/packer/local.ts @@ -2,11 +2,7 @@ import * as fs from "fs"; import * as os from "os"; import * as path from "path"; -import { Document } from "../../docx/document"; -import { Media } from "../../media"; -import { Numbering } from "../../numbering"; -import { Properties } from "../../properties"; -import { Styles } from "../../styles"; +import { File } from "../../docx"; import { Compiler } from "./compiler"; import { IPacker } from "./packer"; import { PdfConvertWrapper } from "./pdf-convert-wrapper"; @@ -16,9 +12,9 @@ export class LocalPacker implements IPacker { private pdfConverter: PdfConvertWrapper; private packer: Compiler; - constructor(document: Document, styles?: Styles, properties?: Properties, numbering?: Numbering, media?: Media) { + constructor(file: File) { this.pdfConverter = new PdfConvertWrapper(); - this.packer = new Compiler(document, styles, properties, numbering, media); + this.packer = new Compiler(file); } public async pack(filePath: string): Promise { From cc67a83ce87db312ded02602077072628c8d56d7 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 19 Dec 2017 21:42:17 +0000 Subject: [PATCH 03/28] For importing absolute path in future --- src/tsconfig.json | 8 +++++++- src/tslint.json | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tsconfig.json b/src/tsconfig.json index fc3e28c1a2..6d075e7f8a 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -10,7 +10,13 @@ "rootDir": "./", "module": "commonjs", "declaration": true, - "noUnusedLocals": true + "noUnusedLocals": true, + "baseUrl": "./", + "paths" : { + "/*": [ + "./*" + ] + } }, "exclude": [ "tests", diff --git a/src/tslint.json b/src/tslint.json index 48b5fbfc6a..66e44398fc 100644 --- a/src/tslint.json +++ b/src/tslint.json @@ -34,6 +34,7 @@ "no-unused-variable": [ true ], - "no-implicit-dependencies": false + "no-implicit-dependencies": false, + "no-submodule-imports": false } } \ No newline at end of file From 49fc28d86c6ce6c964b0a3115e1447ff93ac3e80 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 19 Dec 2017 21:49:44 +0000 Subject: [PATCH 04/28] Updated demos --- demo/demo1.js | 2 +- demo/demo2.js | 34 ++++++++++++++++------------------ demo/demo3.js | 2 +- demo/demo4.js | 2 +- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/demo/demo1.js b/demo/demo1.js index 2a36bb1a83..1a550b5977 100644 --- a/demo/demo1.js +++ b/demo/demo1.js @@ -1,6 +1,6 @@ const docx = require('../build'); -var doc = new docx.Document(); +var doc = new docx.File(); var paragraph = new docx.Paragraph("Hello World"); var institutionText = new docx.TextRun("University College London").bold(); diff --git a/demo/demo2.js b/demo/demo2.js index ba880e2e30..9ae4ad8dc5 100644 --- a/demo/demo2.js +++ b/demo/demo2.js @@ -1,7 +1,12 @@ const docx = require('../build'); -const styles = new docx.Styles(); -styles.createParagraphStyle('Heading1', 'Heading 1') +const doc = new docx.File({ + creator: 'Clippy', + title: 'Sample Document', + description: 'A brief example of using docx', +}); + +doc.Styles.createParagraphStyle('Heading1', 'Heading 1') .basedOn("Normal") .next("Normal") .quickFormat() @@ -10,7 +15,7 @@ styles.createParagraphStyle('Heading1', 'Heading 1') .italics() .spacing({after: 120}); -styles.createParagraphStyle('Heading2', 'Heading 2') +doc.Styles.createParagraphStyle('Heading2', 'Heading 2') .basedOn("Normal") .next("Normal") .quickFormat() @@ -19,7 +24,7 @@ styles.createParagraphStyle('Heading2', 'Heading 2') .underline('double', 'FF0000') .spacing({before: 240, after: 120}); -styles.createParagraphStyle('aside', 'Aside') +doc.Styles.createParagraphStyle('aside', 'Aside') .basedOn('Normal') .next('Normal') .color('999999') @@ -27,31 +32,24 @@ styles.createParagraphStyle('aside', 'Aside') .indent(720) .spacing({line: 276}); -styles.createParagraphStyle('wellSpaced', 'Well Spaced') +doc.Styles.createParagraphStyle('wellSpaced', 'Well Spaced') .basedOn('Normal') .spacing({line: 276, before: 20 * 72 * .1, after: 20 * 72 * .05}); -styles.createParagraphStyle('ListParagraph', 'List Paragraph') +doc.Styles.createParagraphStyle('ListParagraph', 'List Paragraph') .quickFormat() .basedOn('Normal'); -const numbering = new docx.Numbering(); -const numberedAbstract = numbering.createAbstractNumbering(); +const numberedAbstract = doc.Numbering.createAbstractNumbering(); numberedAbstract.createLevel(0, "lowerLetter", "%1)", "left"); -const doc = new docx.Document({ - creator: 'Clippy', - title: 'Sample Document', - description: 'A brief example of using docx', -}); - doc.createParagraph('Test heading1, bold and italicized').heading1(); doc.createParagraph('Some simple content'); doc.createParagraph('Test heading2 with double red underline').heading2(); -const letterNumbering = numbering.createConcreteNumbering(numberedAbstract); -const letterNumbering5 = numbering.createConcreteNumbering(numberedAbstract); +const letterNumbering = doc.Numbering.createConcreteNumbering(numberedAbstract); +const letterNumbering5 = doc.Numbering.createConcreteNumbering(numberedAbstract); letterNumbering5.overrideLevel(0, 5); doc.createParagraph('Option1').setNumbering(letterNumbering, 0); @@ -70,5 +68,5 @@ para.createTextRun(' switching to normal '); para.createTextRun('and then underlined ').underline(); para.createTextRun('and back to normal.'); -const exporter = new docx.LocalPacker(doc, styles, undefined, numbering); -exporter.pack('test.docx'); +const exporter = new docx.LocalPacker(doc); +exporter.pack('My Document'); diff --git a/demo/demo3.js b/demo/demo3.js index 1cebd68076..e0606cad9c 100644 --- a/demo/demo3.js +++ b/demo/demo3.js @@ -1,6 +1,6 @@ const docx = require('../build'); -var doc = new docx.Document(); +var doc = new docx.File(); const numbering = new docx.Numbering(); diff --git a/demo/demo4.js b/demo/demo4.js index 4429895940..900e9a49c7 100644 --- a/demo/demo4.js +++ b/demo/demo4.js @@ -1,6 +1,6 @@ const docx = require('../build'); -var doc = new docx.Document(); +var doc = new docx.File(); const table = doc.createTable(4, 4); table.getCell(2, 2).addContent(new docx.Paragraph('Hello')); From df6c7cf19fb3c89774fc147c72d014f5973cf395 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 19 Dec 2017 23:13:11 +0000 Subject: [PATCH 05/28] Re-order package --- src/docx/{run/run-components => }/drawing/drawing.spec.ts | 2 +- src/docx/{run/run-components => }/drawing/index.ts | 4 ++-- .../drawing/inline/graphic/graphic-data/index.ts | 2 +- .../inline/graphic/graphic-data/pic/blip/blip-fill.ts | 2 +- .../drawing/inline/graphic/graphic-data/pic/blip/blip.ts | 2 +- .../graphic/graphic-data/pic/blip/source-rectangle.ts | 2 +- .../drawing/inline/graphic/graphic-data/pic/blip/stretch.ts | 2 +- .../drawing/inline/graphic/graphic-data/pic/index.ts | 2 +- .../run-components => }/drawing/inline/graphic/index.ts | 2 +- src/docx/{run/run-components => }/drawing/inline/index.ts | 2 +- src/docx/index.ts | 5 ++--- src/docx/paragraph/formatting/page-break.ts | 2 +- src/docx/paragraph/index.ts | 2 ++ src/docx/paragraph/paragraph.ts | 4 +--- src/docx/{ => paragraph}/run/break.spec.ts | 2 +- src/docx/{ => paragraph}/run/break.ts | 2 +- src/docx/{ => paragraph}/run/caps.ts | 2 +- src/docx/{ => paragraph}/run/formatting.ts | 2 +- src/docx/{ => paragraph}/run/index.ts | 0 src/docx/{ => paragraph}/run/picture-run.ts | 4 ++-- src/docx/{ => paragraph}/run/properties.ts | 2 +- src/docx/{ => paragraph}/run/run-components/text.spec.ts | 2 +- src/docx/{ => paragraph}/run/run-components/text.ts | 2 +- src/docx/{ => paragraph}/run/run-fonts.spec.ts | 2 +- src/docx/{ => paragraph}/run/run-fonts.ts | 2 +- src/docx/{ => paragraph}/run/run.spec.ts | 4 ++-- src/docx/{ => paragraph}/run/run.ts | 2 +- src/docx/{ => paragraph}/run/script.spec.ts | 2 +- src/docx/{ => paragraph}/run/script.ts | 2 +- src/docx/{ => paragraph}/run/strike.spec.ts | 2 +- src/docx/{ => paragraph}/run/style.ts | 2 +- src/docx/{ => paragraph}/run/tab.spec.ts | 2 +- src/docx/{ => paragraph}/run/tab.ts | 2 +- src/docx/{ => paragraph}/run/text-run.spec.ts | 2 +- src/docx/{ => paragraph}/run/text-run.ts | 0 src/docx/{ => paragraph}/run/underline.spec.ts | 4 ++-- src/docx/{ => paragraph}/run/underline.ts | 2 +- src/export/packer/local.spec.ts | 2 +- src/numbering/level.ts | 4 ++-- src/numbering/numbering.ts | 2 +- src/styles/defaults/run-properties.ts | 6 +++--- src/styles/factory.ts | 2 +- src/styles/style/index.ts | 4 ++-- 43 files changed, 51 insertions(+), 52 deletions(-) rename src/docx/{run/run-components => }/drawing/drawing.spec.ts (93%) rename src/docx/{run/run-components => }/drawing/index.ts (75%) rename src/docx/{run/run-components => }/drawing/inline/graphic/graphic-data/index.ts (75%) rename src/docx/{run/run-components => }/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts (84%) rename src/docx/{run/run-components => }/drawing/inline/graphic/graphic-data/pic/blip/blip.ts (93%) rename src/docx/{run/run-components => }/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts (60%) rename src/docx/{run/run-components => }/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts (77%) rename src/docx/{run/run-components => }/drawing/inline/graphic/graphic-data/pic/index.ts (75%) rename src/docx/{run/run-components => }/drawing/inline/graphic/index.ts (96%) rename src/docx/{run/run-components => }/drawing/inline/index.ts (77%) rename src/docx/{ => paragraph}/run/break.spec.ts (89%) rename src/docx/{ => paragraph}/run/break.ts (74%) rename src/docx/{ => paragraph}/run/caps.ts (79%) rename src/docx/{ => paragraph}/run/formatting.ts (96%) rename src/docx/{ => paragraph}/run/index.ts (100%) rename src/docx/{ => paragraph}/run/picture-run.ts (75%) rename src/docx/{ => paragraph}/run/properties.ts (77%) rename src/docx/{ => paragraph}/run/run-components/text.spec.ts (92%) rename src/docx/{ => paragraph}/run/run-components/text.ts (82%) rename src/docx/{ => paragraph}/run/run-fonts.spec.ts (93%) rename src/docx/{ => paragraph}/run/run-fonts.ts (88%) rename src/docx/{ => paragraph}/run/run.spec.ts (97%) rename src/docx/{ => paragraph}/run/run.ts (97%) rename src/docx/{ => paragraph}/run/script.spec.ts (96%) rename src/docx/{ => paragraph}/run/script.ts (86%) rename src/docx/{ => paragraph}/run/strike.spec.ts (94%) rename src/docx/{ => paragraph}/run/style.ts (79%) rename src/docx/{ => paragraph}/run/tab.spec.ts (88%) rename src/docx/{ => paragraph}/run/tab.ts (63%) rename src/docx/{ => paragraph}/run/text-run.spec.ts (89%) rename src/docx/{ => paragraph}/run/text-run.ts (100%) rename src/docx/{ => paragraph}/run/underline.spec.ts (98%) rename src/docx/{ => paragraph}/run/underline.ts (97%) diff --git a/src/docx/run/run-components/drawing/drawing.spec.ts b/src/docx/drawing/drawing.spec.ts similarity index 93% rename from src/docx/run/run-components/drawing/drawing.spec.ts rename to src/docx/drawing/drawing.spec.ts index aa55535059..8bda6243e7 100644 --- a/src/docx/run/run-components/drawing/drawing.spec.ts +++ b/src/docx/drawing/drawing.spec.ts @@ -1,7 +1,7 @@ import { assert } from "chai"; import * as fs from "fs"; -import { Utility } from "../../../../tests/utility"; +import { Utility } from "../../tests/utility"; import { Drawing } from "./"; describe("Drawing", () => { diff --git a/src/docx/run/run-components/drawing/index.ts b/src/docx/drawing/index.ts similarity index 75% rename from src/docx/run/run-components/drawing/index.ts rename to src/docx/drawing/index.ts index fab434e058..8278cab933 100644 --- a/src/docx/run/run-components/drawing/index.ts +++ b/src/docx/drawing/index.ts @@ -1,5 +1,5 @@ -import { IData } from "../../../../media/data"; -import { XmlComponent } from "../../../xml-components"; +import { XmlComponent } from "../../docx/xml-components"; +import { IData } from "../../media/data"; import { Inline } from "./inline"; export class Drawing extends XmlComponent { diff --git a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/index.ts b/src/docx/drawing/inline/graphic/graphic-data/index.ts similarity index 75% rename from src/docx/run/run-components/drawing/inline/graphic/graphic-data/index.ts rename to src/docx/drawing/inline/graphic/graphic-data/index.ts index c717a1098c..c1d427a4c9 100644 --- a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/index.ts +++ b/src/docx/drawing/inline/graphic/graphic-data/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../../xml-components"; +import { XmlComponent } from "../../../../xml-components"; import { Pic } from "./pic"; export class GraphicData extends XmlComponent { diff --git a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts b/src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts similarity index 84% rename from src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts rename to src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts index ac2ca1d580..a97e007ee3 100644 --- a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts +++ b/src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../../../../xml-components"; +import { XmlComponent } from "../../../../../../xml-components"; import { Blip } from "./blip"; import { SourceRectangle } from "./source-rectangle"; import { Stretch } from "./stretch"; diff --git a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip.ts b/src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip.ts similarity index 93% rename from src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip.ts rename to src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip.ts index 2926c52893..2a8f1a04cb 100644 --- a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip.ts +++ b/src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../../../../../../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../../../../../../xml-components"; interface IBlipProperties { embed: string; diff --git a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts b/src/docx/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts similarity index 60% rename from src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts rename to src/docx/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts index 32df3eaaac..ff8429c110 100644 --- a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts +++ b/src/docx/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../../../../xml-components"; +import { XmlComponent } from "../../../../../../xml-components"; export class SourceRectangle extends XmlComponent { diff --git a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts b/src/docx/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts similarity index 77% rename from src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts rename to src/docx/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts index c42fa04ff3..b2a612f25e 100644 --- a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts +++ b/src/docx/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../../../../xml-components"; +import { XmlComponent } from "../../../../../../xml-components"; class FillRectangle extends XmlComponent { diff --git a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/index.ts b/src/docx/drawing/inline/graphic/graphic-data/pic/index.ts similarity index 75% rename from src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/index.ts rename to src/docx/drawing/inline/graphic/graphic-data/pic/index.ts index 54628facf8..a4598fb4af 100644 --- a/src/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/index.ts +++ b/src/docx/drawing/inline/graphic/graphic-data/pic/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../../../xml-components"; +import { XmlComponent } from "../../../../../xml-components"; import { BlipFill } from "./blip/blip-fill"; export class Pic extends XmlComponent { diff --git a/src/docx/run/run-components/drawing/inline/graphic/index.ts b/src/docx/drawing/inline/graphic/index.ts similarity index 96% rename from src/docx/run/run-components/drawing/inline/graphic/index.ts rename to src/docx/drawing/inline/graphic/index.ts index 0ee4f17a88..a057950ea3 100644 --- a/src/docx/run/run-components/drawing/inline/graphic/index.ts +++ b/src/docx/drawing/inline/graphic/index.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../../../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../../../../docx/xml-components"; import { GraphicData } from "./graphic-data"; interface IGraphicProperties { diff --git a/src/docx/run/run-components/drawing/inline/index.ts b/src/docx/drawing/inline/index.ts similarity index 77% rename from src/docx/run/run-components/drawing/inline/index.ts rename to src/docx/drawing/inline/index.ts index 8f752edfcc..81bd51755d 100644 --- a/src/docx/run/run-components/drawing/inline/index.ts +++ b/src/docx/drawing/inline/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../xml-components"; +import { XmlComponent } from "../../../docx/xml-components"; import { Graphic } from "./graphic"; export class Inline extends XmlComponent { diff --git a/src/docx/index.ts b/src/docx/index.ts index c11178fda4..f9ebf81f68 100644 --- a/src/docx/index.ts +++ b/src/docx/index.ts @@ -1,5 +1,4 @@ export * from "./document"; export * from "./paragraph"; -export * from "./run"; -export { Table } from "./table"; -export { File } from "./file"; +export * from "./table"; +export * from "./file"; diff --git a/src/docx/paragraph/formatting/page-break.ts b/src/docx/paragraph/formatting/page-break.ts index 055b0a106c..13c5e68e2b 100644 --- a/src/docx/paragraph/formatting/page-break.ts +++ b/src/docx/paragraph/formatting/page-break.ts @@ -1,6 +1,6 @@ // http://officeopenxml.com/WPtextSpecialContent-break.php -import { Run } from "../../run"; import { Attributes, XmlComponent } from "../../xml-components"; +import { Run } from "../run"; class Break extends XmlComponent { diff --git a/src/docx/paragraph/index.ts b/src/docx/paragraph/index.ts index 653e1a8e97..77b08885fb 100644 --- a/src/docx/paragraph/index.ts +++ b/src/docx/paragraph/index.ts @@ -1,3 +1,5 @@ export * from "./formatting"; export * from "./paragraph"; export * from "./properties"; +export * from "./run"; + diff --git a/src/docx/paragraph/paragraph.ts b/src/docx/paragraph/paragraph.ts index fcba366b8f..71661e346f 100644 --- a/src/docx/paragraph/paragraph.ts +++ b/src/docx/paragraph/paragraph.ts @@ -1,10 +1,8 @@ // http://officeopenxml.com/WPparagraph.php import { IData } from "../../media/data"; import { Num } from "../../numbering/num"; -import { Run } from "../run"; -import { PictureRun } from "../run/picture-run"; -import { TextRun } from "../run/text-run"; import { XmlComponent } from "../xml-components"; +import { PictureRun, Run, TextRun } from "./run"; import { Alignment } from "./formatting/alignment"; import { ThematicBreak } from "./formatting/border"; diff --git a/src/docx/run/break.spec.ts b/src/docx/paragraph/run/break.spec.ts similarity index 89% rename from src/docx/run/break.spec.ts rename to src/docx/paragraph/run/break.spec.ts index f34f60bfbc..2a317dd8b2 100644 --- a/src/docx/run/break.spec.ts +++ b/src/docx/paragraph/run/break.spec.ts @@ -1,6 +1,6 @@ import { assert } from "chai"; -import { Utility } from "../../tests/utility"; +import { Utility } from "../../../tests/utility"; import { Break } from "./break"; describe("Break", () => { diff --git a/src/docx/run/break.ts b/src/docx/paragraph/run/break.ts similarity index 74% rename from src/docx/run/break.ts rename to src/docx/paragraph/run/break.ts index 75254a09c6..b88ef0dfa8 100644 --- a/src/docx/run/break.ts +++ b/src/docx/paragraph/run/break.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPtextSpecialContent-break.php -import { XmlComponent } from "../xml-components"; +import { XmlComponent } from "../../xml-components"; export class Break extends XmlComponent { diff --git a/src/docx/run/caps.ts b/src/docx/paragraph/run/caps.ts similarity index 79% rename from src/docx/run/caps.ts rename to src/docx/paragraph/run/caps.ts index d1e0f8f2cb..1e7bf463c9 100644 --- a/src/docx/run/caps.ts +++ b/src/docx/paragraph/run/caps.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../xml-components"; +import { XmlComponent } from "../../xml-components"; export class SmallCaps extends XmlComponent { diff --git a/src/docx/run/formatting.ts b/src/docx/paragraph/run/formatting.ts similarity index 96% rename from src/docx/run/formatting.ts rename to src/docx/paragraph/run/formatting.ts index 2685f07fda..830597c481 100644 --- a/src/docx/run/formatting.ts +++ b/src/docx/paragraph/run/formatting.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../xml-components"; +import { Attributes, XmlComponent } from "../../xml-components"; export { Underline } from "./underline"; export { SubScript, SuperScript } from "./script"; export { RunFonts } from "./run-fonts"; diff --git a/src/docx/run/index.ts b/src/docx/paragraph/run/index.ts similarity index 100% rename from src/docx/run/index.ts rename to src/docx/paragraph/run/index.ts diff --git a/src/docx/run/picture-run.ts b/src/docx/paragraph/run/picture-run.ts similarity index 75% rename from src/docx/run/picture-run.ts rename to src/docx/paragraph/run/picture-run.ts index 038d1fc7bf..57ab1e56a7 100644 --- a/src/docx/run/picture-run.ts +++ b/src/docx/paragraph/run/picture-run.ts @@ -1,6 +1,6 @@ -import { IData } from "../../media/data"; +import { IData } from "../../../media/data"; +import { Drawing } from "../../drawing"; import { Run } from "../run"; -import { Drawing } from "./run-components/drawing"; export class PictureRun extends Run { diff --git a/src/docx/run/properties.ts b/src/docx/paragraph/run/properties.ts similarity index 77% rename from src/docx/run/properties.ts rename to src/docx/paragraph/run/properties.ts index 7c781fe04c..0f06de0323 100644 --- a/src/docx/run/properties.ts +++ b/src/docx/paragraph/run/properties.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../xml-components"; +import { XmlComponent } from "../../xml-components"; export class RunProperties extends XmlComponent { diff --git a/src/docx/run/run-components/text.spec.ts b/src/docx/paragraph/run/run-components/text.spec.ts similarity index 92% rename from src/docx/run/run-components/text.spec.ts rename to src/docx/paragraph/run/run-components/text.spec.ts index 046951ff93..56c6643adc 100644 --- a/src/docx/run/run-components/text.spec.ts +++ b/src/docx/paragraph/run/run-components/text.spec.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; -import { Formatter } from "../../../export/formatter"; +import { Formatter } from "../../../../export/formatter"; import { Text } from "./text"; describe("Text", () => { diff --git a/src/docx/run/run-components/text.ts b/src/docx/paragraph/run/run-components/text.ts similarity index 82% rename from src/docx/run/run-components/text.ts rename to src/docx/paragraph/run/run-components/text.ts index a07cf8f618..a6783d2dfa 100644 --- a/src/docx/run/run-components/text.ts +++ b/src/docx/paragraph/run/run-components/text.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../../../xml-components"; class TextAttributes extends XmlAttributeComponent<{space: "default" | "preserve"}> { protected xmlKeys = {space: "xml:space"}; diff --git a/src/docx/run/run-fonts.spec.ts b/src/docx/paragraph/run/run-fonts.spec.ts similarity index 93% rename from src/docx/run/run-fonts.spec.ts rename to src/docx/paragraph/run/run-fonts.spec.ts index cf419a4e18..359635d22b 100644 --- a/src/docx/run/run-fonts.spec.ts +++ b/src/docx/paragraph/run/run-fonts.spec.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; -import { Formatter } from "../../export/formatter"; +import { Formatter } from "../../../export/formatter"; import { RunFonts } from "./run-fonts"; describe("RunFonts", () => { diff --git a/src/docx/run/run-fonts.ts b/src/docx/paragraph/run/run-fonts.ts similarity index 88% rename from src/docx/run/run-fonts.ts rename to src/docx/paragraph/run/run-fonts.ts index 674f1395b9..7f15449739 100644 --- a/src/docx/run/run-fonts.ts +++ b/src/docx/paragraph/run/run-fonts.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; interface IRunFontAttributesProperties { ascii: string; diff --git a/src/docx/run/run.spec.ts b/src/docx/paragraph/run/run.spec.ts similarity index 97% rename from src/docx/run/run.spec.ts rename to src/docx/paragraph/run/run.spec.ts index 32b277592e..d4b0236304 100644 --- a/src/docx/run/run.spec.ts +++ b/src/docx/paragraph/run/run.spec.ts @@ -1,7 +1,7 @@ import { assert, expect } from "chai"; -import { Formatter } from "../../export/formatter"; -import { Utility } from "../../tests/utility"; +import { Formatter } from "../../../export/formatter"; +import { Utility } from "../../../tests/utility"; import { Run } from "./"; describe("Run", () => { diff --git a/src/docx/run/run.ts b/src/docx/paragraph/run/run.ts similarity index 97% rename from src/docx/run/run.ts rename to src/docx/paragraph/run/run.ts index a0b8584a58..4453f4fda3 100644 --- a/src/docx/run/run.ts +++ b/src/docx/paragraph/run/run.ts @@ -9,7 +9,7 @@ import { Style } from "./style"; import { Tab } from "./tab"; import { Underline } from "./underline"; -import { XmlComponent } from "../xml-components"; +import { XmlComponent } from "../../xml-components"; export class Run extends XmlComponent { private properties: RunProperties; diff --git a/src/docx/run/script.spec.ts b/src/docx/paragraph/run/script.spec.ts similarity index 96% rename from src/docx/run/script.spec.ts rename to src/docx/paragraph/run/script.spec.ts index 5f8cdb3aeb..df3d6fa01a 100644 --- a/src/docx/run/script.spec.ts +++ b/src/docx/paragraph/run/script.spec.ts @@ -1,6 +1,6 @@ import { assert } from "chai"; -import { Utility } from "../../tests/utility"; +import { Utility } from "../../../tests/utility"; import { SubScript, SuperScript } from "./script"; describe("SubScript", () => { diff --git a/src/docx/run/script.ts b/src/docx/paragraph/run/script.ts similarity index 86% rename from src/docx/run/script.ts rename to src/docx/paragraph/run/script.ts index a39841709a..3c1bf5bb4d 100644 --- a/src/docx/run/script.ts +++ b/src/docx/paragraph/run/script.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../xml-components"; +import { Attributes, XmlComponent } from "../../xml-components"; export abstract class VerticalAlign extends XmlComponent { diff --git a/src/docx/run/strike.spec.ts b/src/docx/paragraph/run/strike.spec.ts similarity index 94% rename from src/docx/run/strike.spec.ts rename to src/docx/paragraph/run/strike.spec.ts index 4b07b308b9..4e266da540 100644 --- a/src/docx/run/strike.spec.ts +++ b/src/docx/paragraph/run/strike.spec.ts @@ -1,6 +1,6 @@ import { assert } from "chai"; -import { Utility } from "../../tests/utility"; +import { Utility } from "../../../tests/utility"; import { DoubleStrike, Strike } from "./formatting"; describe("Strike", () => { diff --git a/src/docx/run/style.ts b/src/docx/paragraph/run/style.ts similarity index 79% rename from src/docx/run/style.ts rename to src/docx/paragraph/run/style.ts index 713752377e..31c62f055b 100644 --- a/src/docx/run/style.ts +++ b/src/docx/paragraph/run/style.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; class StyleAttributes extends XmlAttributeComponent<{val: string}> { protected xmlKeys = {val: "w:val"}; diff --git a/src/docx/run/tab.spec.ts b/src/docx/paragraph/run/tab.spec.ts similarity index 88% rename from src/docx/run/tab.spec.ts rename to src/docx/paragraph/run/tab.spec.ts index b709eb88be..4ae84e5f2b 100644 --- a/src/docx/run/tab.spec.ts +++ b/src/docx/paragraph/run/tab.spec.ts @@ -1,6 +1,6 @@ import { assert } from "chai"; -import { Utility } from "../../tests/utility"; +import { Utility } from "../../../tests/utility"; import { Tab } from "./tab"; describe("Tab", () => { diff --git a/src/docx/run/tab.ts b/src/docx/paragraph/run/tab.ts similarity index 63% rename from src/docx/run/tab.ts rename to src/docx/paragraph/run/tab.ts index 3e346b6062..e938d199c7 100644 --- a/src/docx/run/tab.ts +++ b/src/docx/paragraph/run/tab.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../xml-components"; +import { XmlComponent } from "../../xml-components"; export class Tab extends XmlComponent { diff --git a/src/docx/run/text-run.spec.ts b/src/docx/paragraph/run/text-run.spec.ts similarity index 89% rename from src/docx/run/text-run.spec.ts rename to src/docx/paragraph/run/text-run.spec.ts index 9f52e9a402..7fe1b7c3d4 100644 --- a/src/docx/run/text-run.spec.ts +++ b/src/docx/paragraph/run/text-run.spec.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; -import { Formatter } from "../../export/formatter"; +import { Formatter } from "../../../export/formatter"; import { TextRun } from "./text-run"; describe("TextRun", () => { diff --git a/src/docx/run/text-run.ts b/src/docx/paragraph/run/text-run.ts similarity index 100% rename from src/docx/run/text-run.ts rename to src/docx/paragraph/run/text-run.ts diff --git a/src/docx/run/underline.spec.ts b/src/docx/paragraph/run/underline.spec.ts similarity index 98% rename from src/docx/run/underline.spec.ts rename to src/docx/paragraph/run/underline.spec.ts index 70c70d8cad..386892a750 100644 --- a/src/docx/run/underline.spec.ts +++ b/src/docx/paragraph/run/underline.spec.ts @@ -1,7 +1,7 @@ import { assert, expect } from "chai"; -import { Formatter } from "../../export/formatter"; -import { Utility } from "../../tests/utility"; +import { Formatter } from "../../../export/formatter"; +import { Utility } from "../../../tests/utility"; import * as u from "./underline"; describe("Underline", () => { diff --git a/src/docx/run/underline.ts b/src/docx/paragraph/run/underline.ts similarity index 97% rename from src/docx/run/underline.ts rename to src/docx/paragraph/run/underline.ts index 096f72d29f..b034c39082 100644 --- a/src/docx/run/underline.ts +++ b/src/docx/paragraph/run/underline.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../xml-components"; +import { Attributes, XmlComponent } from "../../xml-components"; export abstract class BaseUnderline extends XmlComponent { diff --git a/src/export/packer/local.spec.ts b/src/export/packer/local.spec.ts index 092fe97a6b..572ecdefb2 100644 --- a/src/export/packer/local.spec.ts +++ b/src/export/packer/local.spec.ts @@ -5,7 +5,7 @@ import { File } from "../../docx"; import { Paragraph } from "../../docx/paragraph"; import { LocalPacker } from "../../export/packer/local"; -describe.only("LocalPacker", () => { +describe("LocalPacker", () => { let packer: LocalPacker; beforeEach(() => { diff --git a/src/numbering/level.ts b/src/numbering/level.ts index 15f3abaa8a..856b49c9e3 100644 --- a/src/numbering/level.ts +++ b/src/numbering/level.ts @@ -1,7 +1,7 @@ import * as paragraph from "../docx/paragraph/formatting"; import { ParagraphProperties } from "../docx/paragraph/properties"; -import * as formatting from "../docx/run/formatting"; -import { RunProperties } from "../docx/run/properties"; +import * as formatting from "../docx/paragraph/run/formatting"; +import { RunProperties } from "../docx/paragraph/run/properties"; import { Attributes, XmlAttributeComponent, XmlComponent } from "../docx/xml-components"; interface ILevelAttributesProperties { diff --git a/src/numbering/numbering.ts b/src/numbering/numbering.ts index b8a601e96c..4fbde9aa8a 100644 --- a/src/numbering/numbering.ts +++ b/src/numbering/numbering.ts @@ -1,6 +1,6 @@ import { DocumentAttributes } from "../docx/document/document-attributes"; import { Indent } from "../docx/paragraph/formatting"; -import { RunFonts } from "../docx/run/run-fonts"; +import { RunFonts } from "../docx/paragraph/run/run-fonts"; import { XmlComponent } from "../docx/xml-components"; import { AbstractNumbering } from "./abstract-numbering"; import { Num } from "./num"; diff --git a/src/styles/defaults/run-properties.ts b/src/styles/defaults/run-properties.ts index 898bc34ad1..95bf678f3b 100644 --- a/src/styles/defaults/run-properties.ts +++ b/src/styles/defaults/run-properties.ts @@ -1,6 +1,6 @@ -import { Size } from "../../docx/run/formatting"; -import { RunProperties } from "../../docx/run/properties"; -import { RunFonts } from "../../docx/run/run-fonts"; +import { Size } from "../../docx/paragraph/run/formatting"; +import { RunProperties } from "../../docx/paragraph/run/properties"; +import { RunFonts } from "../../docx/paragraph/run/run-fonts"; import { XmlComponent } from "../../docx/xml-components"; export class RunPropertiesDefaults extends XmlComponent { diff --git a/src/styles/factory.ts b/src/styles/factory.ts index 3d65ca8d85..d76183644e 100644 --- a/src/styles/factory.ts +++ b/src/styles/factory.ts @@ -1,4 +1,4 @@ -import { Color, Italics, Size } from "../docx/run/formatting"; +import { Color, Italics, Size } from "../docx/paragraph/run/formatting"; import { Styles } from "./"; // import { DocumentDefaults } from "./defaults"; diff --git a/src/styles/style/index.ts b/src/styles/style/index.ts index 349565e0f6..6464886e2e 100644 --- a/src/styles/style/index.ts +++ b/src/styles/style/index.ts @@ -1,6 +1,6 @@ import * as paragraph from "../../docx/paragraph"; -import * as formatting from "../../docx/run/formatting"; -import { RunProperties } from "../../docx/run/properties"; +import * as formatting from "../../docx/paragraph/run/formatting"; +import { RunProperties } from "../../docx/paragraph/run/properties"; import { XmlAttributeComponent, XmlComponent } from "../../docx/xml-components"; import { BasedOn, Name, Next, QuickFormat } from "./components"; From 96413d6c47da4c22ffe607c9666be41d33200c03 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 19 Dec 2017 23:14:23 +0000 Subject: [PATCH 06/28] Fix lint --- src/docx/paragraph/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/docx/paragraph/index.ts b/src/docx/paragraph/index.ts index 77b08885fb..08d4e487cf 100644 --- a/src/docx/paragraph/index.ts +++ b/src/docx/paragraph/index.ts @@ -2,4 +2,3 @@ export * from "./formatting"; export * from "./paragraph"; export * from "./properties"; export * from "./run"; - From 4c369510ce0306e3ff30ee3376718df0810e9129 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 00:01:23 +0000 Subject: [PATCH 07/28] Move numbering into sub folder --- src/docx/file.ts | 5 +++-- src/docx/index.ts | 1 + src/{ => docx}/numbering/abstract-numbering.ts | 2 +- src/{ => docx}/numbering/index.ts | 0 src/{ => docx}/numbering/level.ts | 10 +++++----- src/{ => docx}/numbering/multi-level-type.ts | 2 +- src/{ => docx}/numbering/num.ts | 2 +- src/{ => docx}/numbering/numbering.spec.ts | 2 +- src/{ => docx}/numbering/numbering.ts | 8 ++++---- src/docx/paragraph/paragraph.spec.ts | 2 +- src/docx/paragraph/paragraph.ts | 2 +- src/index.ts | 1 - 12 files changed, 19 insertions(+), 18 deletions(-) rename src/{ => docx}/numbering/abstract-numbering.ts (93%) rename src/{ => docx}/numbering/index.ts (100%) rename src/{ => docx}/numbering/level.ts (95%) rename src/{ => docx}/numbering/multi-level-type.ts (75%) rename src/{ => docx}/numbering/num.ts (98%) rename src/{ => docx}/numbering/numbering.spec.ts (99%) rename src/{ => docx}/numbering/numbering.ts (94%) diff --git a/src/docx/file.ts b/src/docx/file.ts index 2b11926fdb..4580121479 100644 --- a/src/docx/file.ts +++ b/src/docx/file.ts @@ -1,10 +1,11 @@ import { Media } from "../media"; -import { Numbering } from "../numbering"; import { IPropertiesOptions, Properties } from "../properties"; import { Styles } from "../styles"; import { DefaultStylesFactory } from "../styles/factory"; import { Document } from "./document"; -import { Paragraph, Table } from "./index"; +import { Numbering } from "./numbering"; +import { Paragraph } from "./paragraph"; +import { Table } from "./table"; export class File { diff --git a/src/docx/index.ts b/src/docx/index.ts index f9ebf81f68..2e44ea7113 100644 --- a/src/docx/index.ts +++ b/src/docx/index.ts @@ -2,3 +2,4 @@ export * from "./document"; export * from "./paragraph"; export * from "./table"; export * from "./file"; +export * from "./numbering"; diff --git a/src/numbering/abstract-numbering.ts b/src/docx/numbering/abstract-numbering.ts similarity index 93% rename from src/numbering/abstract-numbering.ts rename to src/docx/numbering/abstract-numbering.ts index 3491ec6426..2565444eef 100644 --- a/src/numbering/abstract-numbering.ts +++ b/src/docx/numbering/abstract-numbering.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../docx/xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../xml-components"; import { Level } from "./level"; import { MultiLevelType } from "./multi-level-type"; diff --git a/src/numbering/index.ts b/src/docx/numbering/index.ts similarity index 100% rename from src/numbering/index.ts rename to src/docx/numbering/index.ts diff --git a/src/numbering/level.ts b/src/docx/numbering/level.ts similarity index 95% rename from src/numbering/level.ts rename to src/docx/numbering/level.ts index 856b49c9e3..3130fad96f 100644 --- a/src/numbering/level.ts +++ b/src/docx/numbering/level.ts @@ -1,8 +1,8 @@ -import * as paragraph from "../docx/paragraph/formatting"; -import { ParagraphProperties } from "../docx/paragraph/properties"; -import * as formatting from "../docx/paragraph/run/formatting"; -import { RunProperties } from "../docx/paragraph/run/properties"; -import { Attributes, XmlAttributeComponent, XmlComponent } from "../docx/xml-components"; +import * as paragraph from "../paragraph/formatting"; +import { ParagraphProperties } from "../paragraph/properties"; +import * as formatting from "../paragraph/run/formatting"; +import { RunProperties } from "../paragraph/run/properties"; +import { Attributes, XmlAttributeComponent, XmlComponent } from "../xml-components"; interface ILevelAttributesProperties { ilvl?: number; diff --git a/src/numbering/multi-level-type.ts b/src/docx/numbering/multi-level-type.ts similarity index 75% rename from src/numbering/multi-level-type.ts rename to src/docx/numbering/multi-level-type.ts index 9822b18c1a..d17e1a19b0 100644 --- a/src/numbering/multi-level-type.ts +++ b/src/docx/numbering/multi-level-type.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../docx/xml-components"; +import { Attributes, XmlComponent } from "../xml-components"; export class MultiLevelType extends XmlComponent { diff --git a/src/numbering/num.ts b/src/docx/numbering/num.ts similarity index 98% rename from src/numbering/num.ts rename to src/docx/numbering/num.ts index 5e73441f8d..0f9bd7e5f8 100644 --- a/src/numbering/num.ts +++ b/src/docx/numbering/num.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlAttributeComponent, XmlComponent } from "../docx/xml-components"; +import { Attributes, XmlAttributeComponent, XmlComponent } from "../xml-components"; import { LevelForOverride } from "./level"; class AbstractNumId extends XmlComponent { diff --git a/src/numbering/numbering.spec.ts b/src/docx/numbering/numbering.spec.ts similarity index 99% rename from src/numbering/numbering.spec.ts rename to src/docx/numbering/numbering.spec.ts index 58483841af..a61d352c33 100644 --- a/src/numbering/numbering.spec.ts +++ b/src/docx/numbering/numbering.spec.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { Formatter } from "../export/formatter"; +import { Formatter } from "../../export/formatter"; import { Numbering } from "./"; import { AbstractNumbering } from "./abstract-numbering"; import { LevelForOverride } from "./level"; diff --git a/src/numbering/numbering.ts b/src/docx/numbering/numbering.ts similarity index 94% rename from src/numbering/numbering.ts rename to src/docx/numbering/numbering.ts index 4fbde9aa8a..e2f146771f 100644 --- a/src/numbering/numbering.ts +++ b/src/docx/numbering/numbering.ts @@ -1,7 +1,7 @@ -import { DocumentAttributes } from "../docx/document/document-attributes"; -import { Indent } from "../docx/paragraph/formatting"; -import { RunFonts } from "../docx/paragraph/run/run-fonts"; -import { XmlComponent } from "../docx/xml-components"; +import { DocumentAttributes } from "../document/document-attributes"; +import { Indent } from "../paragraph/formatting"; +import { RunFonts } from "../paragraph/run/run-fonts"; +import { XmlComponent } from "../xml-components"; import { AbstractNumbering } from "./abstract-numbering"; import { Num } from "./num"; diff --git a/src/docx/paragraph/paragraph.spec.ts b/src/docx/paragraph/paragraph.spec.ts index bc239fc298..0a629de668 100644 --- a/src/docx/paragraph/paragraph.spec.ts +++ b/src/docx/paragraph/paragraph.spec.ts @@ -2,7 +2,7 @@ import { assert, expect } from "chai"; import * as docx from "../../docx"; import { Formatter } from "../../export/formatter"; -import { Numbering } from "../../numbering"; +import { Numbering } from "../numbering"; describe("Paragraph", () => { let paragraph: docx.Paragraph; diff --git a/src/docx/paragraph/paragraph.ts b/src/docx/paragraph/paragraph.ts index 71661e346f..8c2ba415a1 100644 --- a/src/docx/paragraph/paragraph.ts +++ b/src/docx/paragraph/paragraph.ts @@ -1,6 +1,6 @@ // http://officeopenxml.com/WPparagraph.php import { IData } from "../../media/data"; -import { Num } from "../../numbering/num"; +import { Num } from "../numbering/num"; import { XmlComponent } from "../xml-components"; import { PictureRun, Run, TextRun } from "./run"; diff --git a/src/index.ts b/src/index.ts index 7c5a2fda81..34c4233792 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,5 @@ export * from "./docx"; export * from "./export"; -export { Numbering } from "./numbering"; export { Styles } from "./styles"; export { Media } from "./media"; export * from "./export"; From e9e68bc802fa518e37507a05bd9b28bfebb599c9 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 00:06:08 +0000 Subject: [PATCH 08/28] Move media to sub folder --- src/docx/drawing/index.ts | 2 +- src/docx/file.ts | 2 +- src/docx/index.ts | 2 ++ src/{ => docx}/media/data.ts | 0 src/docx/media/index.ts | 2 ++ src/{media/index.ts => docx/media/media.ts} | 0 src/docx/paragraph/paragraph.ts | 2 +- src/docx/paragraph/run/picture-run.ts | 2 +- src/index.ts | 4 +--- 9 files changed, 9 insertions(+), 7 deletions(-) rename src/{ => docx}/media/data.ts (100%) create mode 100644 src/docx/media/index.ts rename src/{media/index.ts => docx/media/media.ts} (100%) diff --git a/src/docx/drawing/index.ts b/src/docx/drawing/index.ts index 8278cab933..46b77e7a58 100644 --- a/src/docx/drawing/index.ts +++ b/src/docx/drawing/index.ts @@ -1,5 +1,5 @@ import { XmlComponent } from "../../docx/xml-components"; -import { IData } from "../../media/data"; +import { IData } from "../media"; import { Inline } from "./inline"; export class Drawing extends XmlComponent { diff --git a/src/docx/file.ts b/src/docx/file.ts index 4580121479..ef32c39c73 100644 --- a/src/docx/file.ts +++ b/src/docx/file.ts @@ -1,8 +1,8 @@ -import { Media } from "../media"; import { IPropertiesOptions, Properties } from "../properties"; import { Styles } from "../styles"; import { DefaultStylesFactory } from "../styles/factory"; import { Document } from "./document"; +import { Media } from "./media"; import { Numbering } from "./numbering"; import { Paragraph } from "./paragraph"; import { Table } from "./table"; diff --git a/src/docx/index.ts b/src/docx/index.ts index 2e44ea7113..063242fd49 100644 --- a/src/docx/index.ts +++ b/src/docx/index.ts @@ -3,3 +3,5 @@ export * from "./paragraph"; export * from "./table"; export * from "./file"; export * from "./numbering"; +export * from "./media"; +export * from "./drawing"; diff --git a/src/media/data.ts b/src/docx/media/data.ts similarity index 100% rename from src/media/data.ts rename to src/docx/media/data.ts diff --git a/src/docx/media/index.ts b/src/docx/media/index.ts new file mode 100644 index 0000000000..3575274e26 --- /dev/null +++ b/src/docx/media/index.ts @@ -0,0 +1,2 @@ +export * from "./media"; +export * from "./data"; diff --git a/src/media/index.ts b/src/docx/media/media.ts similarity index 100% rename from src/media/index.ts rename to src/docx/media/media.ts diff --git a/src/docx/paragraph/paragraph.ts b/src/docx/paragraph/paragraph.ts index 8c2ba415a1..c455cc7d49 100644 --- a/src/docx/paragraph/paragraph.ts +++ b/src/docx/paragraph/paragraph.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPparagraph.php -import { IData } from "../../media/data"; +import { IData } from "../media/data"; import { Num } from "../numbering/num"; import { XmlComponent } from "../xml-components"; import { PictureRun, Run, TextRun } from "./run"; diff --git a/src/docx/paragraph/run/picture-run.ts b/src/docx/paragraph/run/picture-run.ts index 57ab1e56a7..f5d7f4e763 100644 --- a/src/docx/paragraph/run/picture-run.ts +++ b/src/docx/paragraph/run/picture-run.ts @@ -1,5 +1,5 @@ -import { IData } from "../../../media/data"; import { Drawing } from "../../drawing"; +import { IData } from "../../media/data"; import { Run } from "../run"; export class PictureRun extends Run { diff --git a/src/index.ts b/src/index.ts index 34c4233792..0969794c83 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,3 @@ export * from "./docx"; export * from "./export"; -export { Styles } from "./styles"; -export { Media } from "./media"; -export * from "./export"; +export * from "./styles"; From f1d1570b10f30c812308a401fe5644bc172b93b6 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 00:09:01 +0000 Subject: [PATCH 09/28] Move relationships to sub folder --- src/{ => docx}/relationships/attributes.ts | 0 src/docx/relationships/index.ts | 1 + .../index.ts => docx/relationships/relationships.ts} | 0 src/relationships/relationship.ts | 0 4 files changed, 1 insertion(+) rename src/{ => docx}/relationships/attributes.ts (100%) create mode 100644 src/docx/relationships/index.ts rename src/{relationships/index.ts => docx/relationships/relationships.ts} (100%) delete mode 100644 src/relationships/relationship.ts diff --git a/src/relationships/attributes.ts b/src/docx/relationships/attributes.ts similarity index 100% rename from src/relationships/attributes.ts rename to src/docx/relationships/attributes.ts diff --git a/src/docx/relationships/index.ts b/src/docx/relationships/index.ts new file mode 100644 index 0000000000..8233ccd5d7 --- /dev/null +++ b/src/docx/relationships/index.ts @@ -0,0 +1 @@ +export * from "./relationships"; diff --git a/src/relationships/index.ts b/src/docx/relationships/relationships.ts similarity index 100% rename from src/relationships/index.ts rename to src/docx/relationships/relationships.ts diff --git a/src/relationships/relationship.ts b/src/relationships/relationship.ts deleted file mode 100644 index e69de29bb2..0000000000 From 0b8094dea8333c357802471173c5ce73424c05da Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 00:52:41 +0000 Subject: [PATCH 10/28] Move styles to sub folder --- src/docx/file.ts | 4 ++-- src/docx/index.ts | 1 + src/{ => docx}/styles/defaults/index.ts | 2 +- src/{ => docx}/styles/defaults/paragraph-properties.ts | 4 ++-- src/{ => docx}/styles/defaults/run-properties.ts | 8 ++++---- src/{ => docx}/styles/factory.ts | 2 +- src/{ => docx}/styles/index.ts | 4 ++-- src/{ => docx}/styles/latent-styles/exceptions.ts | 0 src/{ => docx}/styles/latent-styles/index.ts | 0 src/{ => docx}/styles/sample/index.ts | 0 src/{ => docx}/styles/style/components.ts | 2 +- src/{ => docx}/styles/style/index.ts | 8 ++++---- src/{ => docx}/styles/styles.spec.ts | 2 +- src/index.ts | 1 - 14 files changed, 19 insertions(+), 19 deletions(-) rename src/{ => docx}/styles/defaults/index.ts (91%) rename src/{ => docx}/styles/defaults/paragraph-properties.ts (57%) rename src/{ => docx}/styles/defaults/run-properties.ts (67%) rename src/{ => docx}/styles/factory.ts (96%) rename src/{ => docx}/styles/index.ts (89%) rename src/{ => docx}/styles/latent-styles/exceptions.ts (100%) rename src/{ => docx}/styles/latent-styles/index.ts (100%) rename src/{ => docx}/styles/sample/index.ts (100%) rename src/{ => docx}/styles/style/components.ts (94%) rename src/{ => docx}/styles/style/index.ts (96%) rename src/{ => docx}/styles/styles.spec.ts (99%) diff --git a/src/docx/file.ts b/src/docx/file.ts index ef32c39c73..414639ea53 100644 --- a/src/docx/file.ts +++ b/src/docx/file.ts @@ -1,10 +1,10 @@ import { IPropertiesOptions, Properties } from "../properties"; -import { Styles } from "../styles"; -import { DefaultStylesFactory } from "../styles/factory"; import { Document } from "./document"; import { Media } from "./media"; import { Numbering } from "./numbering"; import { Paragraph } from "./paragraph"; +import { Styles } from "./styles"; +import { DefaultStylesFactory } from "./styles/factory"; import { Table } from "./table"; export class File { diff --git a/src/docx/index.ts b/src/docx/index.ts index 063242fd49..544723257e 100644 --- a/src/docx/index.ts +++ b/src/docx/index.ts @@ -5,3 +5,4 @@ export * from "./file"; export * from "./numbering"; export * from "./media"; export * from "./drawing"; +export * from "./styles"; diff --git a/src/styles/defaults/index.ts b/src/docx/styles/defaults/index.ts similarity index 91% rename from src/styles/defaults/index.ts rename to src/docx/styles/defaults/index.ts index 065ed785bd..074baea968 100644 --- a/src/styles/defaults/index.ts +++ b/src/docx/styles/defaults/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../docx/xml-components"; +import { XmlComponent } from "../../xml-components"; import { ParagraphPropertiesDefaults } from "./paragraph-properties"; import { RunPropertiesDefaults } from "./run-properties"; diff --git a/src/styles/defaults/paragraph-properties.ts b/src/docx/styles/defaults/paragraph-properties.ts similarity index 57% rename from src/styles/defaults/paragraph-properties.ts rename to src/docx/styles/defaults/paragraph-properties.ts index bac85aa796..f8641e3a85 100644 --- a/src/styles/defaults/paragraph-properties.ts +++ b/src/docx/styles/defaults/paragraph-properties.ts @@ -1,5 +1,5 @@ -import { ParagraphProperties } from "../../docx/paragraph/properties"; -import { XmlComponent } from "../../docx/xml-components"; +import { ParagraphProperties } from "../../paragraph/properties"; +import { XmlComponent } from "../../xml-components"; export class ParagraphPropertiesDefaults extends XmlComponent { diff --git a/src/styles/defaults/run-properties.ts b/src/docx/styles/defaults/run-properties.ts similarity index 67% rename from src/styles/defaults/run-properties.ts rename to src/docx/styles/defaults/run-properties.ts index 95bf678f3b..3a7c619417 100644 --- a/src/styles/defaults/run-properties.ts +++ b/src/docx/styles/defaults/run-properties.ts @@ -1,7 +1,7 @@ -import { Size } from "../../docx/paragraph/run/formatting"; -import { RunProperties } from "../../docx/paragraph/run/properties"; -import { RunFonts } from "../../docx/paragraph/run/run-fonts"; -import { XmlComponent } from "../../docx/xml-components"; +import { Size } from "../../paragraph/run/formatting"; +import { RunProperties } from "../../paragraph/run/properties"; +import { RunFonts } from "../../paragraph/run/run-fonts"; +import { XmlComponent } from "../../xml-components"; export class RunPropertiesDefaults extends XmlComponent { private properties: RunProperties; diff --git a/src/styles/factory.ts b/src/docx/styles/factory.ts similarity index 96% rename from src/styles/factory.ts rename to src/docx/styles/factory.ts index d76183644e..aeb06bedf6 100644 --- a/src/styles/factory.ts +++ b/src/docx/styles/factory.ts @@ -1,4 +1,4 @@ -import { Color, Italics, Size } from "../docx/paragraph/run/formatting"; +import { Color, Italics, Size } from "../paragraph/run/formatting"; import { Styles } from "./"; // import { DocumentDefaults } from "./defaults"; diff --git a/src/styles/index.ts b/src/docx/styles/index.ts similarity index 89% rename from src/styles/index.ts rename to src/docx/styles/index.ts index 4487d70083..f05afd8e68 100644 --- a/src/styles/index.ts +++ b/src/docx/styles/index.ts @@ -1,5 +1,5 @@ -import { DocumentAttributes } from "../docx/document/document-attributes"; -import { XmlComponent } from "../docx/xml-components"; +import { DocumentAttributes } from "../document/document-attributes"; +import { XmlComponent } from "../xml-components"; import { DocumentDefaults } from "./defaults"; import { ParagraphStyle } from "./style"; diff --git a/src/styles/latent-styles/exceptions.ts b/src/docx/styles/latent-styles/exceptions.ts similarity index 100% rename from src/styles/latent-styles/exceptions.ts rename to src/docx/styles/latent-styles/exceptions.ts diff --git a/src/styles/latent-styles/index.ts b/src/docx/styles/latent-styles/index.ts similarity index 100% rename from src/styles/latent-styles/index.ts rename to src/docx/styles/latent-styles/index.ts diff --git a/src/styles/sample/index.ts b/src/docx/styles/sample/index.ts similarity index 100% rename from src/styles/sample/index.ts rename to src/docx/styles/sample/index.ts diff --git a/src/styles/style/components.ts b/src/docx/styles/style/components.ts similarity index 94% rename from src/styles/style/components.ts rename to src/docx/styles/style/components.ts index 8980ee8a58..df5c8b62c1 100644 --- a/src/styles/style/components.ts +++ b/src/docx/styles/style/components.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../docx/xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; interface IComponentAttributes { val: string; diff --git a/src/styles/style/index.ts b/src/docx/styles/style/index.ts similarity index 96% rename from src/styles/style/index.ts rename to src/docx/styles/style/index.ts index 6464886e2e..fc75bb99d9 100644 --- a/src/styles/style/index.ts +++ b/src/docx/styles/style/index.ts @@ -1,7 +1,7 @@ -import * as paragraph from "../../docx/paragraph"; -import * as formatting from "../../docx/paragraph/run/formatting"; -import { RunProperties } from "../../docx/paragraph/run/properties"; -import { XmlAttributeComponent, XmlComponent } from "../../docx/xml-components"; +import * as paragraph from "../../paragraph"; +import * as formatting from "../../paragraph/run/formatting"; +import { RunProperties } from "../../paragraph/run/properties"; +import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; import { BasedOn, Name, Next, QuickFormat } from "./components"; diff --git a/src/styles/styles.spec.ts b/src/docx/styles/styles.spec.ts similarity index 99% rename from src/styles/styles.spec.ts rename to src/docx/styles/styles.spec.ts index 090b48dffe..40e87b8d9b 100644 --- a/src/styles/styles.spec.ts +++ b/src/docx/styles/styles.spec.ts @@ -1,5 +1,5 @@ import { assert, expect } from "chai"; -import { Formatter } from "../export/formatter"; +import { Formatter } from "../../export/formatter"; import { Styles } from "./"; import { ParagraphStyle, Style } from "./style"; import * as components from "./style/components"; diff --git a/src/index.ts b/src/index.ts index 0969794c83..83ebe0a886 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,2 @@ export * from "./docx"; export * from "./export"; -export * from "./styles"; From 43ebfe7a2f576f58f01381d1aaa34b589969a9fd Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 00:58:24 +0000 Subject: [PATCH 11/28] Move properties to sub folder --- src/docx/file.ts | 2 +- src/{ => docx}/properties/components.ts | 4 ++-- src/docx/properties/index.ts | 1 + src/{ => docx}/properties/properties.spec.ts | 4 ++-- src/{properties/index.ts => docx/properties/properties.ts} | 4 ++-- src/export/formatter.spec.ts | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) rename src/{ => docx}/properties/components.ts (94%) create mode 100644 src/docx/properties/index.ts rename src/{ => docx}/properties/properties.spec.ts (97%) rename src/{properties/index.ts => docx/properties/properties.ts} (92%) diff --git a/src/docx/file.ts b/src/docx/file.ts index 414639ea53..59e913743f 100644 --- a/src/docx/file.ts +++ b/src/docx/file.ts @@ -1,8 +1,8 @@ -import { IPropertiesOptions, Properties } from "../properties"; import { Document } from "./document"; import { Media } from "./media"; import { Numbering } from "./numbering"; import { Paragraph } from "./paragraph"; +import { IPropertiesOptions, Properties } from "./properties"; import { Styles } from "./styles"; import { DefaultStylesFactory } from "./styles/factory"; import { Table } from "./table"; diff --git a/src/properties/components.ts b/src/docx/properties/components.ts similarity index 94% rename from src/properties/components.ts rename to src/docx/properties/components.ts index 387524a35b..bfcf28f5f1 100644 --- a/src/properties/components.ts +++ b/src/docx/properties/components.ts @@ -1,5 +1,5 @@ -import { DocumentAttributes } from "../docx/document/document-attributes"; -import { XmlComponent } from "../docx/xml-components"; +import { DocumentAttributes } from "../document/document-attributes"; +import { XmlComponent } from "../xml-components"; export class Title extends XmlComponent { diff --git a/src/docx/properties/index.ts b/src/docx/properties/index.ts new file mode 100644 index 0000000000..99d40e003c --- /dev/null +++ b/src/docx/properties/index.ts @@ -0,0 +1 @@ +export * from "./properties"; diff --git a/src/properties/properties.spec.ts b/src/docx/properties/properties.spec.ts similarity index 97% rename from src/properties/properties.spec.ts rename to src/docx/properties/properties.spec.ts index f28c0ae72f..d938873b56 100644 --- a/src/properties/properties.spec.ts +++ b/src/docx/properties/properties.spec.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; -import { Formatter } from "../export/formatter"; -import { Properties } from "./"; +import { Formatter } from "../../export/formatter"; +import { Properties } from "./properties"; describe("Properties", () => { diff --git a/src/properties/index.ts b/src/docx/properties/properties.ts similarity index 92% rename from src/properties/index.ts rename to src/docx/properties/properties.ts index 943a620677..bd3229b434 100644 --- a/src/properties/index.ts +++ b/src/docx/properties/properties.ts @@ -1,5 +1,5 @@ -import { DocumentAttributes } from "../docx/document/document-attributes"; -import { XmlComponent } from "../docx/xml-components"; +import { DocumentAttributes } from "../document/document-attributes"; +import { XmlComponent } from "../xml-components"; import { Created, Creator, Description, Keywords, LastModifiedBy, Modified, Revision, Subject, Title } from "./components"; export interface IPropertiesOptions { diff --git a/src/export/formatter.spec.ts b/src/export/formatter.spec.ts index 5bab6ab24b..9b3433c3bb 100644 --- a/src/export/formatter.spec.ts +++ b/src/export/formatter.spec.ts @@ -1,9 +1,9 @@ import { assert } from "chai"; import * as docx from "../docx"; +import { Properties } from "../docx/properties"; import { Attributes } from "../docx/xml-components"; import { Formatter } from "../export/formatter"; -import { Properties } from "../properties"; import { Utility } from "../tests/utility"; describe("Formatter", () => { From 2358139a6b1916735b2153ab6b9caff9f045647a Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 01:03:20 +0000 Subject: [PATCH 12/28] Change docx folder to more appropriate "file" folder --- src/export/formatter.spec.ts | 16 ++++++++-------- src/export/formatter.ts | 4 ++-- src/export/packer/compiler.ts | 2 +- src/export/packer/express.ts | 2 +- src/export/packer/local.spec.ts | 3 +-- src/export/packer/local.ts | 2 +- src/{docx => file}/document/body/body.spec.ts | 0 src/{docx => file}/document/body/body.ts | 0 src/{docx => file}/document/body/columns.ts | 0 src/{docx => file}/document/body/doc-grid.ts | 0 src/{docx => file}/document/body/index.ts | 0 src/{docx => file}/document/body/page-margin.ts | 0 src/{docx => file}/document/body/page-size.ts | 0 .../document/body/section-properties.ts | 0 .../document/document-attributes.ts | 0 src/{docx => file}/document/document.spec.ts | 0 src/{docx => file}/document/document.ts | 0 src/{docx => file}/document/index.ts | 0 src/{docx => file}/drawing/drawing.spec.ts | 0 src/{docx => file}/drawing/index.ts | 2 +- .../drawing/inline/graphic/graphic-data/index.ts | 0 .../graphic/graphic-data/pic/blip/blip-fill.ts | 0 .../inline/graphic/graphic-data/pic/blip/blip.ts | 0 .../graphic-data/pic/blip/source-rectangle.ts | 0 .../graphic/graphic-data/pic/blip/stretch.ts | 0 .../inline/graphic/graphic-data/pic/index.ts | 0 .../drawing/inline/graphic/index.ts | 2 +- src/{docx => file}/drawing/inline/index.ts | 2 +- src/{docx => file}/file.ts | 0 src/{docx => file}/index.ts | 0 src/{docx => file}/media/data.ts | 0 src/{docx => file}/media/index.ts | 0 src/{docx => file}/media/media.ts | 0 .../numbering/abstract-numbering.ts | 0 src/{docx => file}/numbering/index.ts | 0 src/{docx => file}/numbering/level.ts | 0 src/{docx => file}/numbering/multi-level-type.ts | 0 src/{docx => file}/numbering/num.ts | 0 src/{docx => file}/numbering/numbering.spec.ts | 0 src/{docx => file}/numbering/numbering.ts | 0 .../paragraph/formatting/alignment.ts | 0 .../paragraph/formatting/border.spec.ts | 0 .../paragraph/formatting/border.ts | 0 .../paragraph/formatting/indent.ts | 0 src/{docx => file}/paragraph/formatting/index.ts | 0 src/{docx => file}/paragraph/formatting/keep.ts | 0 .../paragraph/formatting/page-break.spec.ts | 0 .../paragraph/formatting/page-break.ts | 0 .../paragraph/formatting/spacing.spec.ts | 0 .../paragraph/formatting/spacing.ts | 0 .../paragraph/formatting/style.spec.ts | 0 src/{docx => file}/paragraph/formatting/style.ts | 0 .../paragraph/formatting/tab-stop.spec.ts | 0 .../paragraph/formatting/tab-stop.ts | 0 .../paragraph/formatting/unordered-list.spec.ts | 0 .../paragraph/formatting/unordered-list.ts | 0 src/{docx => file}/paragraph/index.ts | 0 src/{docx => file}/paragraph/paragraph.spec.ts | 8 ++++---- src/{docx => file}/paragraph/paragraph.ts | 0 src/{docx => file}/paragraph/properties.ts | 0 src/{docx => file}/paragraph/run/break.spec.ts | 0 src/{docx => file}/paragraph/run/break.ts | 0 src/{docx => file}/paragraph/run/caps.ts | 0 src/{docx => file}/paragraph/run/formatting.ts | 0 src/{docx => file}/paragraph/run/index.ts | 0 src/{docx => file}/paragraph/run/picture-run.ts | 0 src/{docx => file}/paragraph/run/properties.ts | 0 .../paragraph/run/run-components/text.spec.ts | 0 .../paragraph/run/run-components/text.ts | 0 .../paragraph/run/run-fonts.spec.ts | 0 src/{docx => file}/paragraph/run/run-fonts.ts | 0 src/{docx => file}/paragraph/run/run.spec.ts | 0 src/{docx => file}/paragraph/run/run.ts | 0 src/{docx => file}/paragraph/run/script.spec.ts | 0 src/{docx => file}/paragraph/run/script.ts | 0 src/{docx => file}/paragraph/run/strike.spec.ts | 0 src/{docx => file}/paragraph/run/style.ts | 0 src/{docx => file}/paragraph/run/tab.spec.ts | 0 src/{docx => file}/paragraph/run/tab.ts | 0 .../paragraph/run/text-run.spec.ts | 0 src/{docx => file}/paragraph/run/text-run.ts | 0 .../paragraph/run/underline.spec.ts | 0 src/{docx => file}/paragraph/run/underline.ts | 0 src/{docx => file}/properties/components.ts | 0 src/{docx => file}/properties/index.ts | 0 src/{docx => file}/properties/properties.spec.ts | 0 src/{docx => file}/properties/properties.ts | 0 src/{docx => file}/relationships/attributes.ts | 0 src/{docx => file}/relationships/index.ts | 0 .../relationships/relationships.ts | 0 src/{docx => file}/styles/defaults/index.ts | 0 .../styles/defaults/paragraph-properties.ts | 0 .../styles/defaults/run-properties.ts | 0 src/{docx => file}/styles/factory.ts | 0 src/{docx => file}/styles/index.ts | 0 .../styles/latent-styles/exceptions.ts | 0 src/{docx => file}/styles/latent-styles/index.ts | 0 src/{docx => file}/styles/sample/index.ts | 0 src/{docx => file}/styles/style/components.ts | 0 src/{docx => file}/styles/style/index.ts | 0 src/{docx => file}/styles/styles.spec.ts | 0 src/{docx => file}/table/grid.spec.ts | 0 src/{docx => file}/table/grid.ts | 0 src/{docx => file}/table/index.ts | 0 src/{docx => file}/table/properties.spec.ts | 0 src/{docx => file}/table/properties.ts | 0 src/{docx => file}/table/table.spec.ts | 0 src/{docx => file}/table/table.ts | 0 .../xml-components/attribute.spec.ts | 0 src/{docx => file}/xml-components/attributes.ts | 0 src/{docx => file}/xml-components/base.ts | 0 .../xml-components/default-attributes.ts | 0 src/{docx => file}/xml-components/index.ts | 0 .../xml-components/xml-component.spec.ts | 0 .../xml-components/xml-component.ts | 0 .../xml-components/xmlable-object.ts | 0 src/index.ts | 2 +- 117 files changed, 22 insertions(+), 23 deletions(-) rename src/{docx => file}/document/body/body.spec.ts (100%) rename src/{docx => file}/document/body/body.ts (100%) rename src/{docx => file}/document/body/columns.ts (100%) rename src/{docx => file}/document/body/doc-grid.ts (100%) rename src/{docx => file}/document/body/index.ts (100%) rename src/{docx => file}/document/body/page-margin.ts (100%) rename src/{docx => file}/document/body/page-size.ts (100%) rename src/{docx => file}/document/body/section-properties.ts (100%) rename src/{docx => file}/document/document-attributes.ts (100%) rename src/{docx => file}/document/document.spec.ts (100%) rename src/{docx => file}/document/document.ts (100%) rename src/{docx => file}/document/index.ts (100%) rename src/{docx => file}/drawing/drawing.spec.ts (100%) rename src/{docx => file}/drawing/index.ts (86%) rename src/{docx => file}/drawing/inline/graphic/graphic-data/index.ts (100%) rename src/{docx => file}/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts (100%) rename src/{docx => file}/drawing/inline/graphic/graphic-data/pic/blip/blip.ts (100%) rename src/{docx => file}/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts (100%) rename src/{docx => file}/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts (100%) rename src/{docx => file}/drawing/inline/graphic/graphic-data/pic/index.ts (100%) rename src/{docx => file}/drawing/inline/graphic/index.ts (86%) rename src/{docx => file}/drawing/inline/index.ts (77%) rename src/{docx => file}/file.ts (100%) rename src/{docx => file}/index.ts (100%) rename src/{docx => file}/media/data.ts (100%) rename src/{docx => file}/media/index.ts (100%) rename src/{docx => file}/media/media.ts (100%) rename src/{docx => file}/numbering/abstract-numbering.ts (100%) rename src/{docx => file}/numbering/index.ts (100%) rename src/{docx => file}/numbering/level.ts (100%) rename src/{docx => file}/numbering/multi-level-type.ts (100%) rename src/{docx => file}/numbering/num.ts (100%) rename src/{docx => file}/numbering/numbering.spec.ts (100%) rename src/{docx => file}/numbering/numbering.ts (100%) rename src/{docx => file}/paragraph/formatting/alignment.ts (100%) rename src/{docx => file}/paragraph/formatting/border.spec.ts (100%) rename src/{docx => file}/paragraph/formatting/border.ts (100%) rename src/{docx => file}/paragraph/formatting/indent.ts (100%) rename src/{docx => file}/paragraph/formatting/index.ts (100%) rename src/{docx => file}/paragraph/formatting/keep.ts (100%) rename src/{docx => file}/paragraph/formatting/page-break.spec.ts (100%) rename src/{docx => file}/paragraph/formatting/page-break.ts (100%) rename src/{docx => file}/paragraph/formatting/spacing.spec.ts (100%) rename src/{docx => file}/paragraph/formatting/spacing.ts (100%) rename src/{docx => file}/paragraph/formatting/style.spec.ts (100%) rename src/{docx => file}/paragraph/formatting/style.ts (100%) rename src/{docx => file}/paragraph/formatting/tab-stop.spec.ts (100%) rename src/{docx => file}/paragraph/formatting/tab-stop.ts (100%) rename src/{docx => file}/paragraph/formatting/unordered-list.spec.ts (100%) rename src/{docx => file}/paragraph/formatting/unordered-list.ts (100%) rename src/{docx => file}/paragraph/index.ts (100%) rename src/{docx => file}/paragraph/paragraph.spec.ts (98%) rename src/{docx => file}/paragraph/paragraph.ts (100%) rename src/{docx => file}/paragraph/properties.ts (100%) rename src/{docx => file}/paragraph/run/break.spec.ts (100%) rename src/{docx => file}/paragraph/run/break.ts (100%) rename src/{docx => file}/paragraph/run/caps.ts (100%) rename src/{docx => file}/paragraph/run/formatting.ts (100%) rename src/{docx => file}/paragraph/run/index.ts (100%) rename src/{docx => file}/paragraph/run/picture-run.ts (100%) rename src/{docx => file}/paragraph/run/properties.ts (100%) rename src/{docx => file}/paragraph/run/run-components/text.spec.ts (100%) rename src/{docx => file}/paragraph/run/run-components/text.ts (100%) rename src/{docx => file}/paragraph/run/run-fonts.spec.ts (100%) rename src/{docx => file}/paragraph/run/run-fonts.ts (100%) rename src/{docx => file}/paragraph/run/run.spec.ts (100%) rename src/{docx => file}/paragraph/run/run.ts (100%) rename src/{docx => file}/paragraph/run/script.spec.ts (100%) rename src/{docx => file}/paragraph/run/script.ts (100%) rename src/{docx => file}/paragraph/run/strike.spec.ts (100%) rename src/{docx => file}/paragraph/run/style.ts (100%) rename src/{docx => file}/paragraph/run/tab.spec.ts (100%) rename src/{docx => file}/paragraph/run/tab.ts (100%) rename src/{docx => file}/paragraph/run/text-run.spec.ts (100%) rename src/{docx => file}/paragraph/run/text-run.ts (100%) rename src/{docx => file}/paragraph/run/underline.spec.ts (100%) rename src/{docx => file}/paragraph/run/underline.ts (100%) rename src/{docx => file}/properties/components.ts (100%) rename src/{docx => file}/properties/index.ts (100%) rename src/{docx => file}/properties/properties.spec.ts (100%) rename src/{docx => file}/properties/properties.ts (100%) rename src/{docx => file}/relationships/attributes.ts (100%) rename src/{docx => file}/relationships/index.ts (100%) rename src/{docx => file}/relationships/relationships.ts (100%) rename src/{docx => file}/styles/defaults/index.ts (100%) rename src/{docx => file}/styles/defaults/paragraph-properties.ts (100%) rename src/{docx => file}/styles/defaults/run-properties.ts (100%) rename src/{docx => file}/styles/factory.ts (100%) rename src/{docx => file}/styles/index.ts (100%) rename src/{docx => file}/styles/latent-styles/exceptions.ts (100%) rename src/{docx => file}/styles/latent-styles/index.ts (100%) rename src/{docx => file}/styles/sample/index.ts (100%) rename src/{docx => file}/styles/style/components.ts (100%) rename src/{docx => file}/styles/style/index.ts (100%) rename src/{docx => file}/styles/styles.spec.ts (100%) rename src/{docx => file}/table/grid.spec.ts (100%) rename src/{docx => file}/table/grid.ts (100%) rename src/{docx => file}/table/index.ts (100%) rename src/{docx => file}/table/properties.spec.ts (100%) rename src/{docx => file}/table/properties.ts (100%) rename src/{docx => file}/table/table.spec.ts (100%) rename src/{docx => file}/table/table.ts (100%) rename src/{docx => file}/xml-components/attribute.spec.ts (100%) rename src/{docx => file}/xml-components/attributes.ts (100%) rename src/{docx => file}/xml-components/base.ts (100%) rename src/{docx => file}/xml-components/default-attributes.ts (100%) rename src/{docx => file}/xml-components/index.ts (100%) rename src/{docx => file}/xml-components/xml-component.spec.ts (100%) rename src/{docx => file}/xml-components/xml-component.ts (100%) rename src/{docx => file}/xml-components/xmlable-object.ts (100%) diff --git a/src/export/formatter.spec.ts b/src/export/formatter.spec.ts index 9b3433c3bb..d6e29cee8e 100644 --- a/src/export/formatter.spec.ts +++ b/src/export/formatter.spec.ts @@ -1,9 +1,9 @@ import { assert } from "chai"; -import * as docx from "../docx"; -import { Properties } from "../docx/properties"; -import { Attributes } from "../docx/xml-components"; import { Formatter } from "../export/formatter"; +import * as file from "../file"; +import { Properties } from "../file/properties"; +import { Attributes } from "../file/xml-components"; import { Utility } from "../tests/utility"; describe("Formatter", () => { @@ -15,21 +15,21 @@ describe("Formatter", () => { describe("#format()", () => { it("should format simple paragraph", () => { - const paragraph = new docx.Paragraph(); + const paragraph = new file.Paragraph(); const newJson = formatter.format(paragraph); assert.isDefined(newJson["w:p"]); }); it("should remove xmlKeys", () => { - const paragraph = new docx.Paragraph(); + const paragraph = new file.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 docx.Paragraph(); - paragraph.addRun(new docx.TextRun("test").bold()); + const paragraph = new file.Paragraph(); + paragraph.addRun(new file.TextRun("test").bold()); const newJson = formatter.format(paragraph); assert.isDefined(newJson["w:p"][1]["w:r"][0]["w:rPr"][0]["w:b"][0]._attr["w:val"]); }); @@ -61,7 +61,7 @@ describe("Formatter", () => { }); it("should should change 'p' tag into 'w:p' tag", () => { - const paragraph = new docx.Paragraph(); + const paragraph = new file.Paragraph(); const newJson = formatter.format(paragraph); assert.isDefined(newJson["w:p"]); }); diff --git a/src/export/formatter.ts b/src/export/formatter.ts index fe8d142c31..d2e4d58ca2 100644 --- a/src/export/formatter.ts +++ b/src/export/formatter.ts @@ -1,5 +1,5 @@ -import { BaseXmlComponent } from "../docx/xml-components"; -import { IXmlableObject } from "../docx/xml-components/xmlable-object"; +import { BaseXmlComponent } from "../file/xml-components"; +import { IXmlableObject } from "../file/xml-components/xmlable-object"; export class Formatter { public format(input: BaseXmlComponent): IXmlableObject { diff --git a/src/export/packer/compiler.ts b/src/export/packer/compiler.ts index 66765906fd..3604f41ed2 100644 --- a/src/export/packer/compiler.ts +++ b/src/export/packer/compiler.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import * as path from "path"; import * as xml from "xml"; -import { File } from "../../docx"; +import { File } from "../../file"; import { Formatter } from "../formatter"; const TEMPLATE_PATH = path.resolve(__dirname, "../../../template"); diff --git a/src/export/packer/express.ts b/src/export/packer/express.ts index 5c065e60b5..2dfb7b4345 100644 --- a/src/export/packer/express.ts +++ b/src/export/packer/express.ts @@ -1,6 +1,6 @@ import * as express from "express"; -import { File } from "../../docx"; +import { File } from "../../file"; import { Compiler } from "./compiler"; import { IPacker } from "./packer"; diff --git a/src/export/packer/local.spec.ts b/src/export/packer/local.spec.ts index 572ecdefb2..1f28f47874 100644 --- a/src/export/packer/local.spec.ts +++ b/src/export/packer/local.spec.ts @@ -1,9 +1,8 @@ /* tslint:disable:typedef space-before-function-paren */ import * as fs from "fs"; -import { File } from "../../docx"; -import { Paragraph } from "../../docx/paragraph"; import { LocalPacker } from "../../export/packer/local"; +import { File, Paragraph } from "../../file"; describe("LocalPacker", () => { let packer: LocalPacker; diff --git a/src/export/packer/local.ts b/src/export/packer/local.ts index a1d293e0e0..f59526bbc4 100644 --- a/src/export/packer/local.ts +++ b/src/export/packer/local.ts @@ -2,7 +2,7 @@ import * as fs from "fs"; import * as os from "os"; import * as path from "path"; -import { File } from "../../docx"; +import { File } from "../../file"; import { Compiler } from "./compiler"; import { IPacker } from "./packer"; import { PdfConvertWrapper } from "./pdf-convert-wrapper"; diff --git a/src/docx/document/body/body.spec.ts b/src/file/document/body/body.spec.ts similarity index 100% rename from src/docx/document/body/body.spec.ts rename to src/file/document/body/body.spec.ts diff --git a/src/docx/document/body/body.ts b/src/file/document/body/body.ts similarity index 100% rename from src/docx/document/body/body.ts rename to src/file/document/body/body.ts diff --git a/src/docx/document/body/columns.ts b/src/file/document/body/columns.ts similarity index 100% rename from src/docx/document/body/columns.ts rename to src/file/document/body/columns.ts diff --git a/src/docx/document/body/doc-grid.ts b/src/file/document/body/doc-grid.ts similarity index 100% rename from src/docx/document/body/doc-grid.ts rename to src/file/document/body/doc-grid.ts diff --git a/src/docx/document/body/index.ts b/src/file/document/body/index.ts similarity index 100% rename from src/docx/document/body/index.ts rename to src/file/document/body/index.ts diff --git a/src/docx/document/body/page-margin.ts b/src/file/document/body/page-margin.ts similarity index 100% rename from src/docx/document/body/page-margin.ts rename to src/file/document/body/page-margin.ts diff --git a/src/docx/document/body/page-size.ts b/src/file/document/body/page-size.ts similarity index 100% rename from src/docx/document/body/page-size.ts rename to src/file/document/body/page-size.ts diff --git a/src/docx/document/body/section-properties.ts b/src/file/document/body/section-properties.ts similarity index 100% rename from src/docx/document/body/section-properties.ts rename to src/file/document/body/section-properties.ts diff --git a/src/docx/document/document-attributes.ts b/src/file/document/document-attributes.ts similarity index 100% rename from src/docx/document/document-attributes.ts rename to src/file/document/document-attributes.ts diff --git a/src/docx/document/document.spec.ts b/src/file/document/document.spec.ts similarity index 100% rename from src/docx/document/document.spec.ts rename to src/file/document/document.spec.ts diff --git a/src/docx/document/document.ts b/src/file/document/document.ts similarity index 100% rename from src/docx/document/document.ts rename to src/file/document/document.ts diff --git a/src/docx/document/index.ts b/src/file/document/index.ts similarity index 100% rename from src/docx/document/index.ts rename to src/file/document/index.ts diff --git a/src/docx/drawing/drawing.spec.ts b/src/file/drawing/drawing.spec.ts similarity index 100% rename from src/docx/drawing/drawing.spec.ts rename to src/file/drawing/drawing.spec.ts diff --git a/src/docx/drawing/index.ts b/src/file/drawing/index.ts similarity index 86% rename from src/docx/drawing/index.ts rename to src/file/drawing/index.ts index 46b77e7a58..b21db46885 100644 --- a/src/docx/drawing/index.ts +++ b/src/file/drawing/index.ts @@ -1,5 +1,5 @@ -import { XmlComponent } from "../../docx/xml-components"; import { IData } from "../media"; +import { XmlComponent } from "../xml-components"; import { Inline } from "./inline"; export class Drawing extends XmlComponent { diff --git a/src/docx/drawing/inline/graphic/graphic-data/index.ts b/src/file/drawing/inline/graphic/graphic-data/index.ts similarity index 100% rename from src/docx/drawing/inline/graphic/graphic-data/index.ts rename to src/file/drawing/inline/graphic/graphic-data/index.ts diff --git a/src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts b/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts similarity index 100% rename from src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts rename to src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts diff --git a/src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip.ts b/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts similarity index 100% rename from src/docx/drawing/inline/graphic/graphic-data/pic/blip/blip.ts rename to src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts diff --git a/src/docx/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts b/src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts similarity index 100% rename from src/docx/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts rename to src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts diff --git a/src/docx/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts b/src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts similarity index 100% rename from src/docx/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts rename to src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts diff --git a/src/docx/drawing/inline/graphic/graphic-data/pic/index.ts b/src/file/drawing/inline/graphic/graphic-data/pic/index.ts similarity index 100% rename from src/docx/drawing/inline/graphic/graphic-data/pic/index.ts rename to src/file/drawing/inline/graphic/graphic-data/pic/index.ts diff --git a/src/docx/drawing/inline/graphic/index.ts b/src/file/drawing/inline/graphic/index.ts similarity index 86% rename from src/docx/drawing/inline/graphic/index.ts rename to src/file/drawing/inline/graphic/index.ts index a057950ea3..88e90f95cc 100644 --- a/src/docx/drawing/inline/graphic/index.ts +++ b/src/file/drawing/inline/graphic/index.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../../../docx/xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../../../xml-components"; import { GraphicData } from "./graphic-data"; interface IGraphicProperties { diff --git a/src/docx/drawing/inline/index.ts b/src/file/drawing/inline/index.ts similarity index 77% rename from src/docx/drawing/inline/index.ts rename to src/file/drawing/inline/index.ts index 81bd51755d..4d854de96d 100644 --- a/src/docx/drawing/inline/index.ts +++ b/src/file/drawing/inline/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../docx/xml-components"; +import { XmlComponent } from "../../xml-components"; import { Graphic } from "./graphic"; export class Inline extends XmlComponent { diff --git a/src/docx/file.ts b/src/file/file.ts similarity index 100% rename from src/docx/file.ts rename to src/file/file.ts diff --git a/src/docx/index.ts b/src/file/index.ts similarity index 100% rename from src/docx/index.ts rename to src/file/index.ts diff --git a/src/docx/media/data.ts b/src/file/media/data.ts similarity index 100% rename from src/docx/media/data.ts rename to src/file/media/data.ts diff --git a/src/docx/media/index.ts b/src/file/media/index.ts similarity index 100% rename from src/docx/media/index.ts rename to src/file/media/index.ts diff --git a/src/docx/media/media.ts b/src/file/media/media.ts similarity index 100% rename from src/docx/media/media.ts rename to src/file/media/media.ts diff --git a/src/docx/numbering/abstract-numbering.ts b/src/file/numbering/abstract-numbering.ts similarity index 100% rename from src/docx/numbering/abstract-numbering.ts rename to src/file/numbering/abstract-numbering.ts diff --git a/src/docx/numbering/index.ts b/src/file/numbering/index.ts similarity index 100% rename from src/docx/numbering/index.ts rename to src/file/numbering/index.ts diff --git a/src/docx/numbering/level.ts b/src/file/numbering/level.ts similarity index 100% rename from src/docx/numbering/level.ts rename to src/file/numbering/level.ts diff --git a/src/docx/numbering/multi-level-type.ts b/src/file/numbering/multi-level-type.ts similarity index 100% rename from src/docx/numbering/multi-level-type.ts rename to src/file/numbering/multi-level-type.ts diff --git a/src/docx/numbering/num.ts b/src/file/numbering/num.ts similarity index 100% rename from src/docx/numbering/num.ts rename to src/file/numbering/num.ts diff --git a/src/docx/numbering/numbering.spec.ts b/src/file/numbering/numbering.spec.ts similarity index 100% rename from src/docx/numbering/numbering.spec.ts rename to src/file/numbering/numbering.spec.ts diff --git a/src/docx/numbering/numbering.ts b/src/file/numbering/numbering.ts similarity index 100% rename from src/docx/numbering/numbering.ts rename to src/file/numbering/numbering.ts diff --git a/src/docx/paragraph/formatting/alignment.ts b/src/file/paragraph/formatting/alignment.ts similarity index 100% rename from src/docx/paragraph/formatting/alignment.ts rename to src/file/paragraph/formatting/alignment.ts diff --git a/src/docx/paragraph/formatting/border.spec.ts b/src/file/paragraph/formatting/border.spec.ts similarity index 100% rename from src/docx/paragraph/formatting/border.spec.ts rename to src/file/paragraph/formatting/border.spec.ts diff --git a/src/docx/paragraph/formatting/border.ts b/src/file/paragraph/formatting/border.ts similarity index 100% rename from src/docx/paragraph/formatting/border.ts rename to src/file/paragraph/formatting/border.ts diff --git a/src/docx/paragraph/formatting/indent.ts b/src/file/paragraph/formatting/indent.ts similarity index 100% rename from src/docx/paragraph/formatting/indent.ts rename to src/file/paragraph/formatting/indent.ts diff --git a/src/docx/paragraph/formatting/index.ts b/src/file/paragraph/formatting/index.ts similarity index 100% rename from src/docx/paragraph/formatting/index.ts rename to src/file/paragraph/formatting/index.ts diff --git a/src/docx/paragraph/formatting/keep.ts b/src/file/paragraph/formatting/keep.ts similarity index 100% rename from src/docx/paragraph/formatting/keep.ts rename to src/file/paragraph/formatting/keep.ts diff --git a/src/docx/paragraph/formatting/page-break.spec.ts b/src/file/paragraph/formatting/page-break.spec.ts similarity index 100% rename from src/docx/paragraph/formatting/page-break.spec.ts rename to src/file/paragraph/formatting/page-break.spec.ts diff --git a/src/docx/paragraph/formatting/page-break.ts b/src/file/paragraph/formatting/page-break.ts similarity index 100% rename from src/docx/paragraph/formatting/page-break.ts rename to src/file/paragraph/formatting/page-break.ts diff --git a/src/docx/paragraph/formatting/spacing.spec.ts b/src/file/paragraph/formatting/spacing.spec.ts similarity index 100% rename from src/docx/paragraph/formatting/spacing.spec.ts rename to src/file/paragraph/formatting/spacing.spec.ts diff --git a/src/docx/paragraph/formatting/spacing.ts b/src/file/paragraph/formatting/spacing.ts similarity index 100% rename from src/docx/paragraph/formatting/spacing.ts rename to src/file/paragraph/formatting/spacing.ts diff --git a/src/docx/paragraph/formatting/style.spec.ts b/src/file/paragraph/formatting/style.spec.ts similarity index 100% rename from src/docx/paragraph/formatting/style.spec.ts rename to src/file/paragraph/formatting/style.spec.ts diff --git a/src/docx/paragraph/formatting/style.ts b/src/file/paragraph/formatting/style.ts similarity index 100% rename from src/docx/paragraph/formatting/style.ts rename to src/file/paragraph/formatting/style.ts diff --git a/src/docx/paragraph/formatting/tab-stop.spec.ts b/src/file/paragraph/formatting/tab-stop.spec.ts similarity index 100% rename from src/docx/paragraph/formatting/tab-stop.spec.ts rename to src/file/paragraph/formatting/tab-stop.spec.ts diff --git a/src/docx/paragraph/formatting/tab-stop.ts b/src/file/paragraph/formatting/tab-stop.ts similarity index 100% rename from src/docx/paragraph/formatting/tab-stop.ts rename to src/file/paragraph/formatting/tab-stop.ts diff --git a/src/docx/paragraph/formatting/unordered-list.spec.ts b/src/file/paragraph/formatting/unordered-list.spec.ts similarity index 100% rename from src/docx/paragraph/formatting/unordered-list.spec.ts rename to src/file/paragraph/formatting/unordered-list.spec.ts diff --git a/src/docx/paragraph/formatting/unordered-list.ts b/src/file/paragraph/formatting/unordered-list.ts similarity index 100% rename from src/docx/paragraph/formatting/unordered-list.ts rename to src/file/paragraph/formatting/unordered-list.ts diff --git a/src/docx/paragraph/index.ts b/src/file/paragraph/index.ts similarity index 100% rename from src/docx/paragraph/index.ts rename to src/file/paragraph/index.ts diff --git a/src/docx/paragraph/paragraph.spec.ts b/src/file/paragraph/paragraph.spec.ts similarity index 98% rename from src/docx/paragraph/paragraph.spec.ts rename to src/file/paragraph/paragraph.spec.ts index 0a629de668..7d9720ce1d 100644 --- a/src/docx/paragraph/paragraph.spec.ts +++ b/src/file/paragraph/paragraph.spec.ts @@ -1,14 +1,14 @@ import { assert, expect } from "chai"; -import * as docx from "../../docx"; import { Formatter } from "../../export/formatter"; +import * as file from "../../file"; import { Numbering } from "../numbering"; describe("Paragraph", () => { - let paragraph: docx.Paragraph; + let paragraph: file.Paragraph; beforeEach(() => { - paragraph = new docx.Paragraph(); + paragraph = new file.Paragraph(); }); describe("#constructor()", () => { @@ -35,7 +35,7 @@ describe("Paragraph", () => { describe("#createTextRun", () => { it("should add a new run to the paragraph and return it", () => { const run = paragraph.createTextRun("this is a test run"); - expect(run).to.be.instanceof(docx.TextRun); + expect(run).to.be.instanceof(file.TextRun); const tree = new Formatter().format(paragraph)["w:p"]; expect(tree).to.be.an("array").which.includes({ "w:r": [ diff --git a/src/docx/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts similarity index 100% rename from src/docx/paragraph/paragraph.ts rename to src/file/paragraph/paragraph.ts diff --git a/src/docx/paragraph/properties.ts b/src/file/paragraph/properties.ts similarity index 100% rename from src/docx/paragraph/properties.ts rename to src/file/paragraph/properties.ts diff --git a/src/docx/paragraph/run/break.spec.ts b/src/file/paragraph/run/break.spec.ts similarity index 100% rename from src/docx/paragraph/run/break.spec.ts rename to src/file/paragraph/run/break.spec.ts diff --git a/src/docx/paragraph/run/break.ts b/src/file/paragraph/run/break.ts similarity index 100% rename from src/docx/paragraph/run/break.ts rename to src/file/paragraph/run/break.ts diff --git a/src/docx/paragraph/run/caps.ts b/src/file/paragraph/run/caps.ts similarity index 100% rename from src/docx/paragraph/run/caps.ts rename to src/file/paragraph/run/caps.ts diff --git a/src/docx/paragraph/run/formatting.ts b/src/file/paragraph/run/formatting.ts similarity index 100% rename from src/docx/paragraph/run/formatting.ts rename to src/file/paragraph/run/formatting.ts diff --git a/src/docx/paragraph/run/index.ts b/src/file/paragraph/run/index.ts similarity index 100% rename from src/docx/paragraph/run/index.ts rename to src/file/paragraph/run/index.ts diff --git a/src/docx/paragraph/run/picture-run.ts b/src/file/paragraph/run/picture-run.ts similarity index 100% rename from src/docx/paragraph/run/picture-run.ts rename to src/file/paragraph/run/picture-run.ts diff --git a/src/docx/paragraph/run/properties.ts b/src/file/paragraph/run/properties.ts similarity index 100% rename from src/docx/paragraph/run/properties.ts rename to src/file/paragraph/run/properties.ts diff --git a/src/docx/paragraph/run/run-components/text.spec.ts b/src/file/paragraph/run/run-components/text.spec.ts similarity index 100% rename from src/docx/paragraph/run/run-components/text.spec.ts rename to src/file/paragraph/run/run-components/text.spec.ts diff --git a/src/docx/paragraph/run/run-components/text.ts b/src/file/paragraph/run/run-components/text.ts similarity index 100% rename from src/docx/paragraph/run/run-components/text.ts rename to src/file/paragraph/run/run-components/text.ts diff --git a/src/docx/paragraph/run/run-fonts.spec.ts b/src/file/paragraph/run/run-fonts.spec.ts similarity index 100% rename from src/docx/paragraph/run/run-fonts.spec.ts rename to src/file/paragraph/run/run-fonts.spec.ts diff --git a/src/docx/paragraph/run/run-fonts.ts b/src/file/paragraph/run/run-fonts.ts similarity index 100% rename from src/docx/paragraph/run/run-fonts.ts rename to src/file/paragraph/run/run-fonts.ts diff --git a/src/docx/paragraph/run/run.spec.ts b/src/file/paragraph/run/run.spec.ts similarity index 100% rename from src/docx/paragraph/run/run.spec.ts rename to src/file/paragraph/run/run.spec.ts diff --git a/src/docx/paragraph/run/run.ts b/src/file/paragraph/run/run.ts similarity index 100% rename from src/docx/paragraph/run/run.ts rename to src/file/paragraph/run/run.ts diff --git a/src/docx/paragraph/run/script.spec.ts b/src/file/paragraph/run/script.spec.ts similarity index 100% rename from src/docx/paragraph/run/script.spec.ts rename to src/file/paragraph/run/script.spec.ts diff --git a/src/docx/paragraph/run/script.ts b/src/file/paragraph/run/script.ts similarity index 100% rename from src/docx/paragraph/run/script.ts rename to src/file/paragraph/run/script.ts diff --git a/src/docx/paragraph/run/strike.spec.ts b/src/file/paragraph/run/strike.spec.ts similarity index 100% rename from src/docx/paragraph/run/strike.spec.ts rename to src/file/paragraph/run/strike.spec.ts diff --git a/src/docx/paragraph/run/style.ts b/src/file/paragraph/run/style.ts similarity index 100% rename from src/docx/paragraph/run/style.ts rename to src/file/paragraph/run/style.ts diff --git a/src/docx/paragraph/run/tab.spec.ts b/src/file/paragraph/run/tab.spec.ts similarity index 100% rename from src/docx/paragraph/run/tab.spec.ts rename to src/file/paragraph/run/tab.spec.ts diff --git a/src/docx/paragraph/run/tab.ts b/src/file/paragraph/run/tab.ts similarity index 100% rename from src/docx/paragraph/run/tab.ts rename to src/file/paragraph/run/tab.ts diff --git a/src/docx/paragraph/run/text-run.spec.ts b/src/file/paragraph/run/text-run.spec.ts similarity index 100% rename from src/docx/paragraph/run/text-run.spec.ts rename to src/file/paragraph/run/text-run.spec.ts diff --git a/src/docx/paragraph/run/text-run.ts b/src/file/paragraph/run/text-run.ts similarity index 100% rename from src/docx/paragraph/run/text-run.ts rename to src/file/paragraph/run/text-run.ts diff --git a/src/docx/paragraph/run/underline.spec.ts b/src/file/paragraph/run/underline.spec.ts similarity index 100% rename from src/docx/paragraph/run/underline.spec.ts rename to src/file/paragraph/run/underline.spec.ts diff --git a/src/docx/paragraph/run/underline.ts b/src/file/paragraph/run/underline.ts similarity index 100% rename from src/docx/paragraph/run/underline.ts rename to src/file/paragraph/run/underline.ts diff --git a/src/docx/properties/components.ts b/src/file/properties/components.ts similarity index 100% rename from src/docx/properties/components.ts rename to src/file/properties/components.ts diff --git a/src/docx/properties/index.ts b/src/file/properties/index.ts similarity index 100% rename from src/docx/properties/index.ts rename to src/file/properties/index.ts diff --git a/src/docx/properties/properties.spec.ts b/src/file/properties/properties.spec.ts similarity index 100% rename from src/docx/properties/properties.spec.ts rename to src/file/properties/properties.spec.ts diff --git a/src/docx/properties/properties.ts b/src/file/properties/properties.ts similarity index 100% rename from src/docx/properties/properties.ts rename to src/file/properties/properties.ts diff --git a/src/docx/relationships/attributes.ts b/src/file/relationships/attributes.ts similarity index 100% rename from src/docx/relationships/attributes.ts rename to src/file/relationships/attributes.ts diff --git a/src/docx/relationships/index.ts b/src/file/relationships/index.ts similarity index 100% rename from src/docx/relationships/index.ts rename to src/file/relationships/index.ts diff --git a/src/docx/relationships/relationships.ts b/src/file/relationships/relationships.ts similarity index 100% rename from src/docx/relationships/relationships.ts rename to src/file/relationships/relationships.ts diff --git a/src/docx/styles/defaults/index.ts b/src/file/styles/defaults/index.ts similarity index 100% rename from src/docx/styles/defaults/index.ts rename to src/file/styles/defaults/index.ts diff --git a/src/docx/styles/defaults/paragraph-properties.ts b/src/file/styles/defaults/paragraph-properties.ts similarity index 100% rename from src/docx/styles/defaults/paragraph-properties.ts rename to src/file/styles/defaults/paragraph-properties.ts diff --git a/src/docx/styles/defaults/run-properties.ts b/src/file/styles/defaults/run-properties.ts similarity index 100% rename from src/docx/styles/defaults/run-properties.ts rename to src/file/styles/defaults/run-properties.ts diff --git a/src/docx/styles/factory.ts b/src/file/styles/factory.ts similarity index 100% rename from src/docx/styles/factory.ts rename to src/file/styles/factory.ts diff --git a/src/docx/styles/index.ts b/src/file/styles/index.ts similarity index 100% rename from src/docx/styles/index.ts rename to src/file/styles/index.ts diff --git a/src/docx/styles/latent-styles/exceptions.ts b/src/file/styles/latent-styles/exceptions.ts similarity index 100% rename from src/docx/styles/latent-styles/exceptions.ts rename to src/file/styles/latent-styles/exceptions.ts diff --git a/src/docx/styles/latent-styles/index.ts b/src/file/styles/latent-styles/index.ts similarity index 100% rename from src/docx/styles/latent-styles/index.ts rename to src/file/styles/latent-styles/index.ts diff --git a/src/docx/styles/sample/index.ts b/src/file/styles/sample/index.ts similarity index 100% rename from src/docx/styles/sample/index.ts rename to src/file/styles/sample/index.ts diff --git a/src/docx/styles/style/components.ts b/src/file/styles/style/components.ts similarity index 100% rename from src/docx/styles/style/components.ts rename to src/file/styles/style/components.ts diff --git a/src/docx/styles/style/index.ts b/src/file/styles/style/index.ts similarity index 100% rename from src/docx/styles/style/index.ts rename to src/file/styles/style/index.ts diff --git a/src/docx/styles/styles.spec.ts b/src/file/styles/styles.spec.ts similarity index 100% rename from src/docx/styles/styles.spec.ts rename to src/file/styles/styles.spec.ts diff --git a/src/docx/table/grid.spec.ts b/src/file/table/grid.spec.ts similarity index 100% rename from src/docx/table/grid.spec.ts rename to src/file/table/grid.spec.ts diff --git a/src/docx/table/grid.ts b/src/file/table/grid.ts similarity index 100% rename from src/docx/table/grid.ts rename to src/file/table/grid.ts diff --git a/src/docx/table/index.ts b/src/file/table/index.ts similarity index 100% rename from src/docx/table/index.ts rename to src/file/table/index.ts diff --git a/src/docx/table/properties.spec.ts b/src/file/table/properties.spec.ts similarity index 100% rename from src/docx/table/properties.spec.ts rename to src/file/table/properties.spec.ts diff --git a/src/docx/table/properties.ts b/src/file/table/properties.ts similarity index 100% rename from src/docx/table/properties.ts rename to src/file/table/properties.ts diff --git a/src/docx/table/table.spec.ts b/src/file/table/table.spec.ts similarity index 100% rename from src/docx/table/table.spec.ts rename to src/file/table/table.spec.ts diff --git a/src/docx/table/table.ts b/src/file/table/table.ts similarity index 100% rename from src/docx/table/table.ts rename to src/file/table/table.ts diff --git a/src/docx/xml-components/attribute.spec.ts b/src/file/xml-components/attribute.spec.ts similarity index 100% rename from src/docx/xml-components/attribute.spec.ts rename to src/file/xml-components/attribute.spec.ts diff --git a/src/docx/xml-components/attributes.ts b/src/file/xml-components/attributes.ts similarity index 100% rename from src/docx/xml-components/attributes.ts rename to src/file/xml-components/attributes.ts diff --git a/src/docx/xml-components/base.ts b/src/file/xml-components/base.ts similarity index 100% rename from src/docx/xml-components/base.ts rename to src/file/xml-components/base.ts diff --git a/src/docx/xml-components/default-attributes.ts b/src/file/xml-components/default-attributes.ts similarity index 100% rename from src/docx/xml-components/default-attributes.ts rename to src/file/xml-components/default-attributes.ts diff --git a/src/docx/xml-components/index.ts b/src/file/xml-components/index.ts similarity index 100% rename from src/docx/xml-components/index.ts rename to src/file/xml-components/index.ts diff --git a/src/docx/xml-components/xml-component.spec.ts b/src/file/xml-components/xml-component.spec.ts similarity index 100% rename from src/docx/xml-components/xml-component.spec.ts rename to src/file/xml-components/xml-component.spec.ts diff --git a/src/docx/xml-components/xml-component.ts b/src/file/xml-components/xml-component.ts similarity index 100% rename from src/docx/xml-components/xml-component.ts rename to src/file/xml-components/xml-component.ts diff --git a/src/docx/xml-components/xmlable-object.ts b/src/file/xml-components/xmlable-object.ts similarity index 100% rename from src/docx/xml-components/xmlable-object.ts rename to src/file/xml-components/xmlable-object.ts diff --git a/src/index.ts b/src/index.ts index 83ebe0a886..0116f99460 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,2 @@ -export * from "./docx"; +export * from "./file"; export * from "./export"; From b34ad22ad6f136768375cc4770b96dcc07f75023 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 01:40:52 +0000 Subject: [PATCH 13/28] Add editorconfig --- .editorconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..9b7352176a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false From 32be6e36da88c5528194f0e0310bd22774772d3e Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 01:41:32 +0000 Subject: [PATCH 14/28] Add package-lock to ignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 7c5b7bc2bd..83b42c1a11 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ build-tests # vscode .vscode + +# Lock files +package-lock.json \ No newline at end of file From c469fb24dbb0ad0d090e26a8cfc1d4a061cac72a Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 20 Dec 2017 01:41:53 +0000 Subject: [PATCH 15/28] Fix imports --- src/file/relationships/attributes.ts | 2 +- src/file/relationships/relationships.ts | 2 +- src/file/styles/latent-styles/exceptions.ts | 2 +- src/file/styles/latent-styles/index.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/file/relationships/attributes.ts b/src/file/relationships/attributes.ts index 14d88b7a96..8765d314f6 100644 --- a/src/file/relationships/attributes.ts +++ b/src/file/relationships/attributes.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent } from "../docx/xml-components"; +import { XmlAttributeComponent } from "../xml-components"; export interface IRelationshipsAttributesProperties { xmlns: string; diff --git a/src/file/relationships/relationships.ts b/src/file/relationships/relationships.ts index e2c27f36e8..972e056263 100644 --- a/src/file/relationships/relationships.ts +++ b/src/file/relationships/relationships.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../docx/xml-components"; +import { XmlComponent } from "../xml-components"; import { RelationshipsAttributes } from "./attributes"; export class Relationships extends XmlComponent { diff --git a/src/file/styles/latent-styles/exceptions.ts b/src/file/styles/latent-styles/exceptions.ts index ceaf5477fe..e547aeb352 100644 --- a/src/file/styles/latent-styles/exceptions.ts +++ b/src/file/styles/latent-styles/exceptions.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../docx/xml-components"; +import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; export interface ILatentStyleExceptionAttributesProperties { name?: string; diff --git a/src/file/styles/latent-styles/index.ts b/src/file/styles/latent-styles/index.ts index 583ab1e0e0..6cde391eb2 100644 --- a/src/file/styles/latent-styles/index.ts +++ b/src/file/styles/latent-styles/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../docx/xml-components"; +import { XmlComponent } from "../../xml-components"; import { LatentStyleException } from "./exceptions"; export class LatentStyles extends XmlComponent { From 90dc1103f68fc9cdf757d7d02d6206c920334712 Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 22 Dec 2017 16:49:25 +0000 Subject: [PATCH 16/28] Experimental webpack support --- package.json | 5 ++++- webpack.config.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 webpack.config.js diff --git a/package.json b/package.json index f344126761..8b7f5d66ae 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "prepublishOnly": "npm run build", "lint": "tslint --project ./src", "build": "rimraf ./build && tsc -p src", + "webpack": "rimraf ./build && webpack", "demo": "npm run build && node ./demo", "typedoc": "typedoc --out docs/ src/ --module commonjs --target ES6 --disableOutputCheck" }, @@ -53,6 +54,7 @@ "devDependencies": { "@types/chai": "^3.4.35", "@types/mocha": "^2.2.39", + "awesome-typescript-loader": "^3.4.1", "chai": "^3.5.0", "mocha": "^3.2.0", "prompt": "^1.0.0", @@ -60,6 +62,7 @@ "shelljs": "^0.7.7", "tslint": "^5.1.0", "typedoc": "^0.5.10", - "typescript": "2.4.1" + "typescript": "2.4.1", + "webpack": "^3.10.0" } } diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000000..847516f798 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,31 @@ +const path = require('path'); +const { TsConfigPathsPlugin } = require('awesome-typescript-loader'); + +module.exports = { + entry: './src/index.ts', + + output: { + path: path.resolve('build'), + filename: 'bundle.js' + }, + + resolve: { + extensions: ['.ts', '.tsx', '.js'], + plugins: [ + new TsConfigPathsPlugin(/* { configFileName, compiler } */) + ] + }, + + // Source maps support ('inline-source-map' also works) + devtool: 'source-map', + + module: { + rules: [ + { + test: /\.ts|\.tsx$/, + loader: 'awesome-typescript-loader', + exclude: [/^(?!.*\.spec\.ts$).*\.ts$/] + } + ] + }, +}; From f84af9a44b39d11d80c17920f67ae717d0267832 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 01:11:59 +0000 Subject: [PATCH 17/28] Move tsconfig files to root, and made webpack config build --- package.json | 7 ++++--- src/tests/utility.ts | 1 + src/test-tsconfig.json => test-tsconfig.json | 9 ++++++--- src/tsconfig.json => tsconfig.json | 9 +++++---- src/tslint.json => tslint.json | 0 webpack.config.js | 20 +++++++------------- 6 files changed, 23 insertions(+), 23 deletions(-) rename src/test-tsconfig.json => test-tsconfig.json (69%) rename src/tsconfig.json => tsconfig.json (75%) rename src/tslint.json => tslint.json (100%) diff --git a/package.json b/package.json index 8b7f5d66ae..10fa6bba60 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,12 @@ "description": "Generate .docx documents with JavaScript (formerly Office-Clippy)", "main": "build/index.js", "scripts": { - "pretest": "rimraf ./build-tests && tsc -p src/test-tsconfig.json", + "pretest": "rimraf ./build-tests && tsc -p ./test-tsconfig.json", "test": "mocha ./build-tests --recursive", "prepublishOnly": "npm run build", - "lint": "tslint --project ./src", - "build": "rimraf ./build && tsc -p src", + "lint": "tslint --project .", + "build": "npm run tsc", + "tsc": "rimraf ./build && tsc -p .", "webpack": "rimraf ./build && webpack", "demo": "npm run build && node ./demo", "typedoc": "typedoc --out docs/ src/ --module commonjs --target ES6 --disableOutputCheck" diff --git a/src/tests/utility.ts b/src/tests/utility.ts index f89701b726..c43d0f6cc3 100644 --- a/src/tests/utility.ts +++ b/src/tests/utility.ts @@ -1,4 +1,5 @@ export class Utility { + // tslint:disable-next-line:no-any public static jsonify(obj: object): any { const stringifiedJson = JSON.stringify(obj); return JSON.parse(stringifiedJson); diff --git a/src/test-tsconfig.json b/test-tsconfig.json similarity index 69% rename from src/test-tsconfig.json rename to test-tsconfig.json index b8c28cb188..606934f43c 100644 --- a/src/test-tsconfig.json +++ b/test-tsconfig.json @@ -5,14 +5,17 @@ "sourceMap": true, "removeComments": true, "preserveConstEnums": true, - "outDir": "../build-tests", - "sourceRoot": "./", - "rootDir": "./", + "outDir": "./build-tests", + "sourceRoot": "./src", + "rootDir": "./src", "module": "commonjs", "noUnusedLocals": true }, "include": [ "**/*.spec.ts", "**/*.d.ts" + ], + "exclude": [ + "node_modules" ] } diff --git a/src/tsconfig.json b/tsconfig.json similarity index 75% rename from src/tsconfig.json rename to tsconfig.json index 6d075e7f8a..6427330d2d 100644 --- a/src/tsconfig.json +++ b/tsconfig.json @@ -5,13 +5,13 @@ "sourceMap": true, "removeComments": true, "preserveConstEnums": true, - "outDir": "../build", - "sourceRoot": "./", - "rootDir": "./", + "outDir": "./build", + "sourceRoot": "./src", + "rootDir": "./src", "module": "commonjs", "declaration": true, "noUnusedLocals": true, - "baseUrl": "./", + "baseUrl": "./src", "paths" : { "/*": [ "./*" @@ -19,6 +19,7 @@ } }, "exclude": [ + "node_modules", "tests", "**/*.spec.ts", "**/_*" diff --git a/src/tslint.json b/tslint.json similarity index 100% rename from src/tslint.json rename to tslint.json diff --git a/webpack.config.js b/webpack.config.js index 847516f798..57d4623375 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,31 +1,25 @@ const path = require('path'); -const { TsConfigPathsPlugin } = require('awesome-typescript-loader'); module.exports = { entry: './src/index.ts', output: { path: path.resolve('build'), - filename: 'bundle.js' + filename: 'index.js' }, resolve: { - extensions: ['.ts', '.tsx', '.js'], - plugins: [ - new TsConfigPathsPlugin(/* { configFileName, compiler } */) - ] + extensions: ['.tsx', '.ts', '.js'] }, - // Source maps support ('inline-source-map' also works) - devtool: 'source-map', - module: { rules: [ { - test: /\.ts|\.tsx$/, - loader: 'awesome-typescript-loader', - exclude: [/^(?!.*\.spec\.ts$).*\.ts$/] + test: /\.ts$/, + loaders: ["awesome-typescript-loader"], } - ] + ], }, + + target: 'node' }; From ece2b23407e8e3144302022bfb2507d0325aa138 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 01:16:45 +0000 Subject: [PATCH 18/28] Export as a library --- webpack.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 57d4623375..cac0f1aa19 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,7 +5,8 @@ module.exports = { output: { path: path.resolve('build'), - filename: 'index.js' + filename: 'index.js', + library: true }, resolve: { From f7412690b69273688cb984402d1c55d5b6d77db4 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 01:36:42 +0000 Subject: [PATCH 19/28] Fix library export --- webpack.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index cac0f1aa19..205b7943d3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,7 +6,8 @@ module.exports = { output: { path: path.resolve('build'), filename: 'index.js', - library: true + library: 'docx', + libraryTarget: 'umd' }, resolve: { From 75d699f7ef9ee931bda620c725cdc6b0eb6d5b13 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 01:45:33 +0000 Subject: [PATCH 20/28] Enable dirname --- webpack.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 205b7943d3..b97028e38c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,5 +23,9 @@ module.exports = { ], }, - target: 'node' + target: 'node', + + node: { + __dirname: true + } }; From 89c658746dc183a3c1d87b2e7f738494efe51d06 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 01:46:31 +0000 Subject: [PATCH 21/28] Use webpack as the main builder --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 10fa6bba60..083bfac685 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test": "mocha ./build-tests --recursive", "prepublishOnly": "npm run build", "lint": "tslint --project .", - "build": "npm run tsc", + "build": "npm run webpack", "tsc": "rimraf ./build && tsc -p .", "webpack": "rimraf ./build && webpack", "demo": "npm run build && node ./demo", From 362a99718775972533ab3a8605b9aa98bdc4e741 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 01:48:46 +0000 Subject: [PATCH 22/28] Redundant library specification --- webpack.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index b97028e38c..d180384606 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,7 +6,6 @@ module.exports = { output: { path: path.resolve('build'), filename: 'index.js', - library: 'docx', libraryTarget: 'umd' }, From 4f900d6566be210d4b89f9cb703003c6d245c320 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 02:05:34 +0000 Subject: [PATCH 23/28] Update typedoc --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 083bfac685..bed7f9ab16 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "rimraf": "^2.5.2", "shelljs": "^0.7.7", "tslint": "^5.1.0", - "typedoc": "^0.5.10", + "typedoc": "^0.9.0", "typescript": "2.4.1", "webpack": "^3.10.0" } From 928e4b9bc2d5c2ee0aaf3cc6759008f3afa7e741 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 02:06:44 +0000 Subject: [PATCH 24/28] Turn off sourceRoot to hotfix typedoc --- tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 6427330d2d..2d46f20143 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,6 @@ "removeComments": true, "preserveConstEnums": true, "outDir": "./build", - "sourceRoot": "./src", "rootDir": "./src", "module": "commonjs", "declaration": true, From d8d16b4a7d8aec78ebc9062451719461ff8ac45d Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Fri, 29 Dec 2017 02:26:26 +0000 Subject: [PATCH 25/28] Absolute path imports! --- src/file/paragraph/paragraph.ts | 2 +- webpack.config.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index c455cc7d49..21e8ac9ad6 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -1,7 +1,7 @@ // http://officeopenxml.com/WPparagraph.php +import { XmlComponent } from "file/xml-components"; import { IData } from "../media/data"; import { Num } from "../numbering/num"; -import { XmlComponent } from "../xml-components"; import { PictureRun, Run, TextRun } from "./run"; import { Alignment } from "./formatting/alignment"; diff --git a/webpack.config.js b/webpack.config.js index d180384606..a8000404c1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,7 +10,8 @@ module.exports = { }, resolve: { - extensions: ['.tsx', '.ts', '.js'] + extensions: ['.tsx', '.ts', '.js'], + modules: [path.resolve('./src'), "node_modules"] }, module: { From c518d1c6c7901c6c22cc73394f903e1d69d651f5 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 30 Dec 2017 20:01:20 +0000 Subject: [PATCH 26/28] Fix tests using new mocha-webpack --- package.json | 4 ++-- src/export/packer/local.spec.ts | 8 ++++---- test-tsconfig.json | 21 --------------------- 3 files changed, 6 insertions(+), 27 deletions(-) delete mode 100644 test-tsconfig.json diff --git a/package.json b/package.json index bed7f9ab16..9bb0b1fa78 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,7 @@ "description": "Generate .docx documents with JavaScript (formerly Office-Clippy)", "main": "build/index.js", "scripts": { - "pretest": "rimraf ./build-tests && tsc -p ./test-tsconfig.json", - "test": "mocha ./build-tests --recursive", + "test": "mocha-webpack \"src/**/*.ts\"", "prepublishOnly": "npm run build", "lint": "tslint --project .", "build": "npm run webpack", @@ -58,6 +57,7 @@ "awesome-typescript-loader": "^3.4.1", "chai": "^3.5.0", "mocha": "^3.2.0", + "mocha-webpack": "^1.0.1", "prompt": "^1.0.0", "rimraf": "^2.5.2", "shelljs": "^0.7.7", diff --git a/src/export/packer/local.spec.ts b/src/export/packer/local.spec.ts index 1f28f47874..39a721195d 100644 --- a/src/export/packer/local.spec.ts +++ b/src/export/packer/local.spec.ts @@ -26,8 +26,8 @@ describe("LocalPacker", () => { describe("#pack()", () => { it("should create a standard docx file", async function () { this.timeout(99999999); - await packer.pack("build-tests/tests/test"); - fs.statSync("build-tests/tests/test.docx"); + await packer.pack("build/tests/test"); + fs.statSync("build/tests/test.docx"); }); }); @@ -35,8 +35,8 @@ describe("LocalPacker", () => { it("should create a standard PDF file", async function () { this.timeout(99999999); - await packer.packPdf("build-tests/tests/pdf-test"); - fs.statSync("build-tests/tests/pdf-test.pdf"); + await packer.packPdf("build/tests/pdf-test"); + fs.statSync("build/tests/pdf-test.pdf"); }); }); }); diff --git a/test-tsconfig.json b/test-tsconfig.json deleted file mode 100644 index 606934f43c..0000000000 --- a/test-tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "strictNullChecks": true, - "sourceMap": true, - "removeComments": true, - "preserveConstEnums": true, - "outDir": "./build-tests", - "sourceRoot": "./src", - "rootDir": "./src", - "module": "commonjs", - "noUnusedLocals": true - }, - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ], - "exclude": [ - "node_modules" - ] -} From ab348bd5f9581d8ef833da884e4322d22ba68efc Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 30 Dec 2017 20:02:44 +0000 Subject: [PATCH 27/28] Add build before typedoc --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9bb0b1fa78..4c41f92e12 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "tsc": "rimraf ./build && tsc -p .", "webpack": "rimraf ./build && webpack", "demo": "npm run build && node ./demo", - "typedoc": "typedoc --out docs/ src/ --module commonjs --target ES6 --disableOutputCheck" + "typedoc": "npm run build && typedoc --out docs/ src/ --module commonjs --target ES6 --disableOutputCheck" }, "files": [ "src", From eb71fc20e69116e6983946b78566c2be9179fa29 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 30 Dec 2017 20:25:16 +0000 Subject: [PATCH 28/28] Use absolute path rather than silly relative path --- package.json | 1 + src/export/formatter.ts | 4 ++-- src/export/packer/compiler.ts | 2 +- src/export/packer/express.ts | 2 +- src/file/document/body/body.ts | 2 +- src/file/document/body/columns.ts | 2 +- src/file/document/body/doc-grid.ts | 2 +- src/file/document/body/page-margin.ts | 2 +- src/file/document/body/page-size.ts | 2 +- src/file/document/body/section-properties.ts | 2 +- src/file/document/document-attributes.ts | 2 +- src/file/document/document.ts | 2 +- src/file/drawing/index.ts | 4 ++-- src/file/drawing/inline/graphic/graphic-data/index.ts | 2 +- .../drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts | 2 +- src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts | 2 +- .../inline/graphic/graphic-data/pic/blip/source-rectangle.ts | 2 +- .../drawing/inline/graphic/graphic-data/pic/blip/stretch.ts | 2 +- src/file/drawing/inline/graphic/graphic-data/pic/index.ts | 2 +- src/file/drawing/inline/graphic/index.ts | 2 +- src/file/drawing/inline/index.ts | 2 +- src/file/numbering/abstract-numbering.ts | 2 +- src/file/numbering/level.ts | 2 +- src/file/numbering/multi-level-type.ts | 2 +- src/file/numbering/num.ts | 2 +- src/file/numbering/numbering.ts | 2 +- src/file/paragraph/formatting/alignment.ts | 2 +- src/file/paragraph/formatting/border.ts | 2 +- src/file/paragraph/formatting/indent.ts | 2 +- src/file/paragraph/formatting/keep.ts | 2 +- src/file/paragraph/formatting/page-break.ts | 2 +- src/file/paragraph/formatting/spacing.ts | 2 +- src/file/paragraph/formatting/style.ts | 2 +- src/file/paragraph/formatting/tab-stop.ts | 2 +- src/file/paragraph/formatting/unordered-list.ts | 2 +- src/file/paragraph/paragraph.ts | 4 ++-- src/file/paragraph/properties.ts | 2 +- src/file/paragraph/run/break.ts | 2 +- src/file/paragraph/run/caps.ts | 2 +- src/file/paragraph/run/formatting.ts | 2 +- src/file/paragraph/run/properties.ts | 2 +- src/file/paragraph/run/run-components/text.ts | 2 +- src/file/paragraph/run/run-fonts.ts | 2 +- src/file/paragraph/run/run.ts | 2 +- src/file/paragraph/run/script.ts | 2 +- src/file/paragraph/run/style.ts | 2 +- src/file/paragraph/run/tab.ts | 2 +- src/file/paragraph/run/underline.ts | 2 +- src/file/properties/components.ts | 2 +- src/file/properties/properties.ts | 2 +- src/file/relationships/attributes.ts | 2 +- src/file/relationships/relationships.ts | 2 +- src/file/styles/defaults/index.ts | 2 +- src/file/styles/defaults/paragraph-properties.ts | 2 +- src/file/styles/defaults/run-properties.ts | 2 +- src/file/styles/index.ts | 2 +- src/file/styles/latent-styles/exceptions.ts | 2 +- src/file/styles/latent-styles/index.ts | 2 +- src/file/styles/style/components.ts | 2 +- src/file/styles/style/index.ts | 2 +- src/file/table/grid.ts | 2 +- src/file/table/properties.ts | 2 +- src/file/table/table.ts | 4 ++-- 63 files changed, 67 insertions(+), 66 deletions(-) diff --git a/package.json b/package.json index 4c41f92e12..f08aeec4fe 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Generate .docx documents with JavaScript (formerly Office-Clippy)", "main": "build/index.js", "scripts": { + "pretest": "rimraf ./build", "test": "mocha-webpack \"src/**/*.ts\"", "prepublishOnly": "npm run build", "lint": "tslint --project .", diff --git a/src/export/formatter.ts b/src/export/formatter.ts index d2e4d58ca2..95c4e38e78 100644 --- a/src/export/formatter.ts +++ b/src/export/formatter.ts @@ -1,5 +1,5 @@ -import { BaseXmlComponent } from "../file/xml-components"; -import { IXmlableObject } from "../file/xml-components/xmlable-object"; +import { BaseXmlComponent } from "file/xml-components"; +import { IXmlableObject } from "file/xml-components/xmlable-object"; export class Formatter { public format(input: BaseXmlComponent): IXmlableObject { diff --git a/src/export/packer/compiler.ts b/src/export/packer/compiler.ts index 3604f41ed2..45be0d7a15 100644 --- a/src/export/packer/compiler.ts +++ b/src/export/packer/compiler.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import * as path from "path"; import * as xml from "xml"; -import { File } from "../../file"; +import { File } from "file"; import { Formatter } from "../formatter"; const TEMPLATE_PATH = path.resolve(__dirname, "../../../template"); diff --git a/src/export/packer/express.ts b/src/export/packer/express.ts index 2dfb7b4345..4c6a573d4f 100644 --- a/src/export/packer/express.ts +++ b/src/export/packer/express.ts @@ -1,6 +1,6 @@ import * as express from "express"; -import { File } from "../../file"; +import { File } from "file"; import { Compiler } from "./compiler"; import { IPacker } from "./packer"; diff --git a/src/file/document/body/body.ts b/src/file/document/body/body.ts index 993d353573..24cb1bf8bc 100644 --- a/src/file/document/body/body.ts +++ b/src/file/document/body/body.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; export class Body extends XmlComponent { diff --git a/src/file/document/body/columns.ts b/src/file/document/body/columns.ts index 3a1b3a1f60..0f66904faa 100644 --- a/src/file/document/body/columns.ts +++ b/src/file/document/body/columns.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export class Columns extends XmlComponent { diff --git a/src/file/document/body/doc-grid.ts b/src/file/document/body/doc-grid.ts index ec10ef4830..5b2f280014 100644 --- a/src/file/document/body/doc-grid.ts +++ b/src/file/document/body/doc-grid.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export class DocumentGrid extends XmlComponent { diff --git a/src/file/document/body/page-margin.ts b/src/file/document/body/page-margin.ts index 6c98ecf8c2..b02c788c5f 100644 --- a/src/file/document/body/page-margin.ts +++ b/src/file/document/body/page-margin.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export class PageMargin extends XmlComponent { diff --git a/src/file/document/body/page-size.ts b/src/file/document/body/page-size.ts index 8259326347..cda39d728e 100644 --- a/src/file/document/body/page-size.ts +++ b/src/file/document/body/page-size.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export class PageSize extends XmlComponent { diff --git a/src/file/document/body/section-properties.ts b/src/file/document/body/section-properties.ts index c2d556de33..c112674f44 100644 --- a/src/file/document/body/section-properties.ts +++ b/src/file/document/body/section-properties.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; import { Columns } from "./columns"; import { DocumentGrid } from "./doc-grid"; import { PageMargin } from "./page-margin"; diff --git a/src/file/document/document-attributes.ts b/src/file/document/document-attributes.ts index 88031719e9..68df58ca61 100644 --- a/src/file/document/document-attributes.ts +++ b/src/file/document/document-attributes.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent } from "../xml-components"; +import { XmlAttributeComponent } from "file/xml-components"; export interface IDocumentAttributesProperties { wpc?: string; diff --git a/src/file/document/document.ts b/src/file/document/document.ts index 74f602eb5e..23b73a97fd 100644 --- a/src/file/document/document.ts +++ b/src/file/document/document.ts @@ -1,7 +1,7 @@ // http://officeopenxml.com/WPdocument.php +import { XmlComponent } from "file/xml-components"; import { Paragraph } from "../paragraph"; import { Table } from "../table"; -import { XmlComponent } from "../xml-components"; import { Body } from "./body"; import { DocumentAttributes } from "./document-attributes"; diff --git a/src/file/drawing/index.ts b/src/file/drawing/index.ts index b21db46885..fe79f86673 100644 --- a/src/file/drawing/index.ts +++ b/src/file/drawing/index.ts @@ -1,5 +1,5 @@ -import { IData } from "../media"; -import { XmlComponent } from "../xml-components"; +import { IData } from "file/media"; +import { XmlComponent } from "file/xml-components"; import { Inline } from "./inline"; export class Drawing extends XmlComponent { diff --git a/src/file/drawing/inline/graphic/graphic-data/index.ts b/src/file/drawing/inline/graphic/graphic-data/index.ts index c1d427a4c9..0f462b62ae 100644 --- a/src/file/drawing/inline/graphic/graphic-data/index.ts +++ b/src/file/drawing/inline/graphic/graphic-data/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../xml-components"; +import { XmlComponent } from "file/xml-components"; import { Pic } from "./pic"; export class GraphicData extends XmlComponent { diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts b/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts index a97e007ee3..69b6bf40a4 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../../xml-components"; +import { XmlComponent } from "file/xml-components"; import { Blip } from "./blip"; import { SourceRectangle } from "./source-rectangle"; import { Stretch } from "./stretch"; diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts b/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts index 2a8f1a04cb..c4aca1f156 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../../../../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; interface IBlipProperties { embed: string; diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts b/src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts index ff8429c110..c944ebbc77 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../../xml-components"; +import { XmlComponent } from "file/xml-components"; export class SourceRectangle extends XmlComponent { diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts b/src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts index b2a612f25e..2de9775885 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../../xml-components"; +import { XmlComponent } from "file/xml-components"; class FillRectangle extends XmlComponent { diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/index.ts b/src/file/drawing/inline/graphic/graphic-data/pic/index.ts index a4598fb4af..b7907e20dc 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/index.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../../../../xml-components"; +import { XmlComponent } from "file/xml-components"; import { BlipFill } from "./blip/blip-fill"; export class Pic extends XmlComponent { diff --git a/src/file/drawing/inline/graphic/index.ts b/src/file/drawing/inline/graphic/index.ts index 88e90f95cc..81251fd41c 100644 --- a/src/file/drawing/inline/graphic/index.ts +++ b/src/file/drawing/inline/graphic/index.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; import { GraphicData } from "./graphic-data"; interface IGraphicProperties { diff --git a/src/file/drawing/inline/index.ts b/src/file/drawing/inline/index.ts index 4d854de96d..3e7ab22831 100644 --- a/src/file/drawing/inline/index.ts +++ b/src/file/drawing/inline/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; import { Graphic } from "./graphic"; export class Inline extends XmlComponent { diff --git a/src/file/numbering/abstract-numbering.ts b/src/file/numbering/abstract-numbering.ts index 2565444eef..eb64487cdc 100644 --- a/src/file/numbering/abstract-numbering.ts +++ b/src/file/numbering/abstract-numbering.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; import { Level } from "./level"; import { MultiLevelType } from "./multi-level-type"; diff --git a/src/file/numbering/level.ts b/src/file/numbering/level.ts index 3130fad96f..801746ca88 100644 --- a/src/file/numbering/level.ts +++ b/src/file/numbering/level.ts @@ -1,8 +1,8 @@ +import { Attributes, XmlAttributeComponent, XmlComponent } from "file/xml-components"; import * as paragraph from "../paragraph/formatting"; import { ParagraphProperties } from "../paragraph/properties"; import * as formatting from "../paragraph/run/formatting"; import { RunProperties } from "../paragraph/run/properties"; -import { Attributes, XmlAttributeComponent, XmlComponent } from "../xml-components"; interface ILevelAttributesProperties { ilvl?: number; diff --git a/src/file/numbering/multi-level-type.ts b/src/file/numbering/multi-level-type.ts index d17e1a19b0..4b688e35fb 100644 --- a/src/file/numbering/multi-level-type.ts +++ b/src/file/numbering/multi-level-type.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export class MultiLevelType extends XmlComponent { diff --git a/src/file/numbering/num.ts b/src/file/numbering/num.ts index 0f9bd7e5f8..e9362a3c9e 100644 --- a/src/file/numbering/num.ts +++ b/src/file/numbering/num.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlAttributeComponent, XmlComponent } from "../xml-components"; +import { Attributes, XmlAttributeComponent, XmlComponent } from "file/xml-components"; import { LevelForOverride } from "./level"; class AbstractNumId extends XmlComponent { diff --git a/src/file/numbering/numbering.ts b/src/file/numbering/numbering.ts index e2f146771f..59caa49951 100644 --- a/src/file/numbering/numbering.ts +++ b/src/file/numbering/numbering.ts @@ -1,7 +1,7 @@ +import { XmlComponent } from "file/xml-components"; import { DocumentAttributes } from "../document/document-attributes"; import { Indent } from "../paragraph/formatting"; import { RunFonts } from "../paragraph/run/run-fonts"; -import { XmlComponent } from "../xml-components"; import { AbstractNumbering } from "./abstract-numbering"; import { Num } from "./num"; diff --git a/src/file/paragraph/formatting/alignment.ts b/src/file/paragraph/formatting/alignment.ts index 5923f0d623..a260aa18ff 100644 --- a/src/file/paragraph/formatting/alignment.ts +++ b/src/file/paragraph/formatting/alignment.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPalignment.php -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; export type AlignmentOptions = "left" | "center" | "right" | "both"; diff --git a/src/file/paragraph/formatting/border.ts b/src/file/paragraph/formatting/border.ts index 11eb7c45aa..b8c5142fde 100644 --- a/src/file/paragraph/formatting/border.ts +++ b/src/file/paragraph/formatting/border.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPborders.php -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; class Border extends XmlComponent { diff --git a/src/file/paragraph/formatting/indent.ts b/src/file/paragraph/formatting/indent.ts index 67ca37b905..98ab4e0212 100644 --- a/src/file/paragraph/formatting/indent.ts +++ b/src/file/paragraph/formatting/indent.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPindentation.php -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; interface IIndentAttributesProperties { left?: number; diff --git a/src/file/paragraph/formatting/keep.ts b/src/file/paragraph/formatting/keep.ts index 1e3e27c422..5f1abb53f8 100644 --- a/src/file/paragraph/formatting/keep.ts +++ b/src/file/paragraph/formatting/keep.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; export class KeepLines extends XmlComponent { constructor() { diff --git a/src/file/paragraph/formatting/page-break.ts b/src/file/paragraph/formatting/page-break.ts index 13c5e68e2b..c35d5f10af 100644 --- a/src/file/paragraph/formatting/page-break.ts +++ b/src/file/paragraph/formatting/page-break.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPtextSpecialContent-break.php -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; import { Run } from "../run"; class Break extends XmlComponent { diff --git a/src/file/paragraph/formatting/spacing.ts b/src/file/paragraph/formatting/spacing.ts index 23df8523ac..fceab8af8c 100644 --- a/src/file/paragraph/formatting/spacing.ts +++ b/src/file/paragraph/formatting/spacing.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPspacing.php -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; export interface ISpacingProperties { after?: number; diff --git a/src/file/paragraph/formatting/style.ts b/src/file/paragraph/formatting/style.ts index 4f73e0f2b5..08d6500c34 100644 --- a/src/file/paragraph/formatting/style.ts +++ b/src/file/paragraph/formatting/style.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export class Style extends XmlComponent { diff --git a/src/file/paragraph/formatting/tab-stop.ts b/src/file/paragraph/formatting/tab-stop.ts index 4042b7d47d..cd65ae76f5 100644 --- a/src/file/paragraph/formatting/tab-stop.ts +++ b/src/file/paragraph/formatting/tab-stop.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPtab.php -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; export class TabStop extends XmlComponent { diff --git a/src/file/paragraph/formatting/unordered-list.ts b/src/file/paragraph/formatting/unordered-list.ts index 50af69c20d..82a432603a 100644 --- a/src/file/paragraph/formatting/unordered-list.ts +++ b/src/file/paragraph/formatting/unordered-list.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export class NumberProperties extends XmlComponent { diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index 21e8ac9ad6..766b7d7d14 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -1,7 +1,7 @@ // http://officeopenxml.com/WPparagraph.php +import { IData } from "file/media"; +import { Num } from "file/numbering/num"; import { XmlComponent } from "file/xml-components"; -import { IData } from "../media/data"; -import { Num } from "../numbering/num"; import { PictureRun, Run, TextRun } from "./run"; import { Alignment } from "./formatting/alignment"; diff --git a/src/file/paragraph/properties.ts b/src/file/paragraph/properties.ts index 16013986c0..7b54f23350 100644 --- a/src/file/paragraph/properties.ts +++ b/src/file/paragraph/properties.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPparagraphProperties.php -import { XmlComponent } from "../xml-components"; +import { XmlComponent } from "file/xml-components"; export class ParagraphProperties extends XmlComponent { diff --git a/src/file/paragraph/run/break.ts b/src/file/paragraph/run/break.ts index b88ef0dfa8..a40abea558 100644 --- a/src/file/paragraph/run/break.ts +++ b/src/file/paragraph/run/break.ts @@ -1,5 +1,5 @@ // http://officeopenxml.com/WPtextSpecialContent-break.php -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; export class Break extends XmlComponent { diff --git a/src/file/paragraph/run/caps.ts b/src/file/paragraph/run/caps.ts index 1e7bf463c9..bc12d6e256 100644 --- a/src/file/paragraph/run/caps.ts +++ b/src/file/paragraph/run/caps.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; export class SmallCaps extends XmlComponent { diff --git a/src/file/paragraph/run/formatting.ts b/src/file/paragraph/run/formatting.ts index 830597c481..f6abf1a770 100644 --- a/src/file/paragraph/run/formatting.ts +++ b/src/file/paragraph/run/formatting.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export { Underline } from "./underline"; export { SubScript, SuperScript } from "./script"; export { RunFonts } from "./run-fonts"; diff --git a/src/file/paragraph/run/properties.ts b/src/file/paragraph/run/properties.ts index 0f06de0323..191aaf715c 100644 --- a/src/file/paragraph/run/properties.ts +++ b/src/file/paragraph/run/properties.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; export class RunProperties extends XmlComponent { diff --git a/src/file/paragraph/run/run-components/text.ts b/src/file/paragraph/run/run-components/text.ts index a6783d2dfa..36bd17c507 100644 --- a/src/file/paragraph/run/run-components/text.ts +++ b/src/file/paragraph/run/run-components/text.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; class TextAttributes extends XmlAttributeComponent<{space: "default" | "preserve"}> { protected xmlKeys = {space: "xml:space"}; diff --git a/src/file/paragraph/run/run-fonts.ts b/src/file/paragraph/run/run-fonts.ts index 7f15449739..61f8e8758e 100644 --- a/src/file/paragraph/run/run-fonts.ts +++ b/src/file/paragraph/run/run-fonts.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; interface IRunFontAttributesProperties { ascii: string; diff --git a/src/file/paragraph/run/run.ts b/src/file/paragraph/run/run.ts index 4453f4fda3..243cea68d3 100644 --- a/src/file/paragraph/run/run.ts +++ b/src/file/paragraph/run/run.ts @@ -9,7 +9,7 @@ import { Style } from "./style"; import { Tab } from "./tab"; import { Underline } from "./underline"; -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; export class Run extends XmlComponent { private properties: RunProperties; diff --git a/src/file/paragraph/run/script.ts b/src/file/paragraph/run/script.ts index 3c1bf5bb4d..88f0dbddda 100644 --- a/src/file/paragraph/run/script.ts +++ b/src/file/paragraph/run/script.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export abstract class VerticalAlign extends XmlComponent { diff --git a/src/file/paragraph/run/style.ts b/src/file/paragraph/run/style.ts index 31c62f055b..5382724eb7 100644 --- a/src/file/paragraph/run/style.ts +++ b/src/file/paragraph/run/style.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; class StyleAttributes extends XmlAttributeComponent<{val: string}> { protected xmlKeys = {val: "w:val"}; diff --git a/src/file/paragraph/run/tab.ts b/src/file/paragraph/run/tab.ts index e938d199c7..c6c4a2f0d7 100644 --- a/src/file/paragraph/run/tab.ts +++ b/src/file/paragraph/run/tab.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; export class Tab extends XmlComponent { diff --git a/src/file/paragraph/run/underline.ts b/src/file/paragraph/run/underline.ts index b034c39082..f83b5479f9 100644 --- a/src/file/paragraph/run/underline.ts +++ b/src/file/paragraph/run/underline.ts @@ -1,4 +1,4 @@ -import { Attributes, XmlComponent } from "../../xml-components"; +import { Attributes, XmlComponent } from "file/xml-components"; export abstract class BaseUnderline extends XmlComponent { diff --git a/src/file/properties/components.ts b/src/file/properties/components.ts index bfcf28f5f1..f4dbd8fd9a 100644 --- a/src/file/properties/components.ts +++ b/src/file/properties/components.ts @@ -1,5 +1,5 @@ +import { XmlComponent } from "file/xml-components"; import { DocumentAttributes } from "../document/document-attributes"; -import { XmlComponent } from "../xml-components"; export class Title extends XmlComponent { diff --git a/src/file/properties/properties.ts b/src/file/properties/properties.ts index bd3229b434..ca01056fb2 100644 --- a/src/file/properties/properties.ts +++ b/src/file/properties/properties.ts @@ -1,5 +1,5 @@ +import { XmlComponent } from "file/xml-components"; import { DocumentAttributes } from "../document/document-attributes"; -import { XmlComponent } from "../xml-components"; import { Created, Creator, Description, Keywords, LastModifiedBy, Modified, Revision, Subject, Title } from "./components"; export interface IPropertiesOptions { diff --git a/src/file/relationships/attributes.ts b/src/file/relationships/attributes.ts index 8765d314f6..54cbd62472 100644 --- a/src/file/relationships/attributes.ts +++ b/src/file/relationships/attributes.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent } from "../xml-components"; +import { XmlAttributeComponent } from "file/xml-components"; export interface IRelationshipsAttributesProperties { xmlns: string; diff --git a/src/file/relationships/relationships.ts b/src/file/relationships/relationships.ts index 972e056263..d9c0562a74 100644 --- a/src/file/relationships/relationships.ts +++ b/src/file/relationships/relationships.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../xml-components"; +import { XmlComponent } from "file/xml-components"; import { RelationshipsAttributes } from "./attributes"; export class Relationships extends XmlComponent { diff --git a/src/file/styles/defaults/index.ts b/src/file/styles/defaults/index.ts index 074baea968..93211ac5ec 100644 --- a/src/file/styles/defaults/index.ts +++ b/src/file/styles/defaults/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; import { ParagraphPropertiesDefaults } from "./paragraph-properties"; import { RunPropertiesDefaults } from "./run-properties"; diff --git a/src/file/styles/defaults/paragraph-properties.ts b/src/file/styles/defaults/paragraph-properties.ts index f8641e3a85..4fe9c341ce 100644 --- a/src/file/styles/defaults/paragraph-properties.ts +++ b/src/file/styles/defaults/paragraph-properties.ts @@ -1,5 +1,5 @@ +import { XmlComponent } from "file/xml-components"; import { ParagraphProperties } from "../../paragraph/properties"; -import { XmlComponent } from "../../xml-components"; export class ParagraphPropertiesDefaults extends XmlComponent { diff --git a/src/file/styles/defaults/run-properties.ts b/src/file/styles/defaults/run-properties.ts index 3a7c619417..242aa3e58d 100644 --- a/src/file/styles/defaults/run-properties.ts +++ b/src/file/styles/defaults/run-properties.ts @@ -1,7 +1,7 @@ +import { XmlComponent } from "file/xml-components"; import { Size } from "../../paragraph/run/formatting"; import { RunProperties } from "../../paragraph/run/properties"; import { RunFonts } from "../../paragraph/run/run-fonts"; -import { XmlComponent } from "../../xml-components"; export class RunPropertiesDefaults extends XmlComponent { private properties: RunProperties; diff --git a/src/file/styles/index.ts b/src/file/styles/index.ts index f05afd8e68..9c54752998 100644 --- a/src/file/styles/index.ts +++ b/src/file/styles/index.ts @@ -1,5 +1,5 @@ +import { XmlComponent } from "file/xml-components"; import { DocumentAttributes } from "../document/document-attributes"; -import { XmlComponent } from "../xml-components"; import { DocumentDefaults } from "./defaults"; import { ParagraphStyle } from "./style"; diff --git a/src/file/styles/latent-styles/exceptions.ts b/src/file/styles/latent-styles/exceptions.ts index e547aeb352..9bede8257f 100644 --- a/src/file/styles/latent-styles/exceptions.ts +++ b/src/file/styles/latent-styles/exceptions.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; export interface ILatentStyleExceptionAttributesProperties { name?: string; diff --git a/src/file/styles/latent-styles/index.ts b/src/file/styles/latent-styles/index.ts index 6cde391eb2..5ab51e1c4e 100644 --- a/src/file/styles/latent-styles/index.ts +++ b/src/file/styles/latent-styles/index.ts @@ -1,4 +1,4 @@ -import { XmlComponent } from "../../xml-components"; +import { XmlComponent } from "file/xml-components"; import { LatentStyleException } from "./exceptions"; export class LatentStyles extends XmlComponent { diff --git a/src/file/styles/style/components.ts b/src/file/styles/style/components.ts index df5c8b62c1..199b1f064e 100644 --- a/src/file/styles/style/components.ts +++ b/src/file/styles/style/components.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; interface IComponentAttributes { val: string; diff --git a/src/file/styles/style/index.ts b/src/file/styles/style/index.ts index fc75bb99d9..3f45c5805c 100644 --- a/src/file/styles/style/index.ts +++ b/src/file/styles/style/index.ts @@ -1,7 +1,7 @@ +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; import * as paragraph from "../../paragraph"; import * as formatting from "../../paragraph/run/formatting"; import { RunProperties } from "../../paragraph/run/properties"; -import { XmlAttributeComponent, XmlComponent } from "../../xml-components"; import { BasedOn, Name, Next, QuickFormat } from "./components"; diff --git a/src/file/table/grid.ts b/src/file/table/grid.ts index 3731891177..16bab3fa75 100644 --- a/src/file/table/grid.ts +++ b/src/file/table/grid.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; export class TableGrid extends XmlComponent { constructor(cols: number[]) { diff --git a/src/file/table/properties.ts b/src/file/table/properties.ts index 09ced45d00..c11797c1fd 100644 --- a/src/file/table/properties.ts +++ b/src/file/table/properties.ts @@ -1,4 +1,4 @@ -import { XmlAttributeComponent, XmlComponent } from "../xml-components"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; export type WidthTypes = "dxa" | "pct" | "nil" | "auto"; diff --git a/src/file/table/table.ts b/src/file/table/table.ts index 9969926fb7..43a41cd78e 100644 --- a/src/file/table/table.ts +++ b/src/file/table/table.ts @@ -1,6 +1,6 @@ +import { XmlComponent } from "file/xml-components"; +import { IXmlableObject } from "file/xml-components/xmlable-object"; import { Paragraph } from "../paragraph"; -import { XmlComponent } from "../xml-components"; -import { IXmlableObject } from "../xml-components/xmlable-object"; import { TableGrid } from "./grid"; import { TableProperties, WidthTypes } from "./properties";