From 36a18c5af3b8574c369de5fb264eb964807f2c80 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Mon, 26 Jul 2021 09:55:33 +0300 Subject: [PATCH 01/66] Use level.start for overrideLevel.start if possible Implemented via additional reference config map. --- src/file/numbering/numbering.ts | 37 +++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/file/numbering/numbering.ts b/src/file/numbering/numbering.ts index 8f37b386c5..0a532d4e76 100644 --- a/src/file/numbering/numbering.ts +++ b/src/file/numbering/numbering.ts @@ -29,6 +29,7 @@ export interface INumberingOptions { export class Numbering extends XmlComponent { private readonly abstractNumberingMap = new Map(); private readonly concreteNumberingMap = new Map(); + private readonly referenceConfigMap = new Map(); constructor(options: INumberingOptions) { super("w:numbering"); @@ -174,6 +175,7 @@ export class Numbering extends XmlComponent { for (const con of options.config) { this.abstractNumberingMap.set(con.reference, new AbstractNumbering(uniqueNumericId(), con.levels)); + this.referenceConfigMap.set(con.reference, con.levels); } } @@ -201,19 +203,28 @@ export class Numbering extends XmlComponent { return; } - this.concreteNumberingMap.set( - fullReference, - new ConcreteNumbering({ - numId: uniqueNumericId(), - abstractNumId: abstractNumbering.id, - reference, - instance, - overrideLevel: { - num: 0, - start: 1, - }, - }), - ); + const concreteNumberingSettings = { + numId: uniqueNumericId(), + abstractNumId: abstractNumbering.id, + reference, + instance, + }; + + const referenceConfigLevels = this.referenceConfigMap.get(reference); + const firstLevelStartNumber = referenceConfigLevels?.[0]?.start; + if (firstLevelStartNumber) { + concreteNumberingSettings.overrideLevel = { + num: 0, + start: firstLevelStartNumber, + }; + } else { + concreteNumberingSettings.overrideLevel = { + num: 0, + start: 1, + }; + } + + this.concreteNumberingMap.set(fullReference, new ConcreteNumbering(concreteNumberingSettings)); } public get ConcreteNumbering(): ConcreteNumbering[] { From 2fd4f064ae1bcf60b869a6c52d5de785172394c5 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Mon, 26 Jul 2021 13:28:55 +0300 Subject: [PATCH 02/66] Simplify + TS related fix --- src/file/numbering/numbering.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/file/numbering/numbering.ts b/src/file/numbering/numbering.ts index 0a532d4e76..fd2bf0754a 100644 --- a/src/file/numbering/numbering.ts +++ b/src/file/numbering/numbering.ts @@ -29,7 +29,7 @@ export interface INumberingOptions { export class Numbering extends XmlComponent { private readonly abstractNumberingMap = new Map(); private readonly concreteNumberingMap = new Map(); - private readonly referenceConfigMap = new Map(); + private readonly referenceConfigMap = new Map(); constructor(options: INumberingOptions) { super("w:numbering"); @@ -208,6 +208,10 @@ export class Numbering extends XmlComponent { abstractNumId: abstractNumbering.id, reference, instance, + overrideLevel: { + num: 0, + start: 1, + }, }; const referenceConfigLevels = this.referenceConfigMap.get(reference); @@ -217,11 +221,6 @@ export class Numbering extends XmlComponent { num: 0, start: firstLevelStartNumber, }; - } else { - concreteNumberingSettings.overrideLevel = { - num: 0, - start: 1, - }; } this.concreteNumberingMap.set(fullReference, new ConcreteNumbering(concreteNumberingSettings)); From f21fb064675393e66a2ebf9323880f90278f7465 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jul 2021 11:01:05 +0000 Subject: [PATCH 03/66] Bump jszip from 3.6.0 to 3.7.0 Bumps [jszip](https://github.com/Stuk/jszip) from 3.6.0 to 3.7.0. - [Release notes](https://github.com/Stuk/jszip/releases) - [Changelog](https://github.com/Stuk/jszip/blob/master/CHANGES.md) - [Commits](https://github.com/Stuk/jszip/commits) --- updated-dependencies: - dependency-name: jszip dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b9bb14b34..527c53b672 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3149,9 +3149,9 @@ } }, "jszip": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.6.0.tgz", - "integrity": "sha512-jgnQoG9LKnWO3mnVNBnfhkh0QknICd1FGSrXcgrl67zioyJ4wgx25o9ZqwNtrROSflGBCGYnJfjrIyRIby1OoQ==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.0.tgz", + "integrity": "sha512-Y2OlFIzrDOPWUnpU0LORIcDn2xN7rC9yKffFM/7pGhQuhO+SUhfm2trkJ/S5amjFvem0Y+1EALz/MEPkvHXVNw==", "requires": { "lie": "~3.3.0", "pako": "~1.0.2", @@ -4215,9 +4215,9 @@ } }, "pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", - "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==" + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" }, "parent-require": { "version": "1.0.0", From f50c7f20cb653a51608afccaa4932dbf680e183a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jul 2021 11:01:19 +0000 Subject: [PATCH 04/66] Bump ts-loader from 9.2.3 to 9.2.4 Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.3 to 9.2.4. - [Release notes](https://github.com/TypeStrong/ts-loader/releases) - [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.3...v9.2.4) --- updated-dependencies: - dependency-name: ts-loader dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b9bb14b34..87570a9354 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5273,9 +5273,9 @@ } }, "ts-loader": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.3.tgz", - "integrity": "sha512-sEyWiU3JMHBL55CIeC4iqJQadI0U70A5af0kvgbNLHVNz2ACztQg0j/9x10bjjIht8WfFYLKfn4L6tkZ+pu+8Q==", + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.4.tgz", + "integrity": "sha512-Ats2BCqPFBkgsoZUmmYMjuQu+iBNExt4o3QDsJqRMuPdStWlnOthdqX/GHHJnxSSgw7Gu6Hll/MD5b4usgKFOg==", "dev": true, "requires": { "chalk": "^4.1.0", From d523b2dae75d5d1835a6d7d9aecfd0e6880f484d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jul 2021 11:01:36 +0000 Subject: [PATCH 05/66] Bump mocha from 9.0.2 to 9.0.3 Bumps [mocha](https://github.com/mochajs/mocha) from 9.0.2 to 9.0.3. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v9.0.2...v9.0.3) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b9bb14b34..796b2639f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3578,9 +3578,9 @@ } }, "mocha": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.2.tgz", - "integrity": "sha512-FpspiWU+UT9Sixx/wKimvnpkeW0mh6ROAKkIaPokj3xZgxeRhcna/k5X57jJghEr8X+Cgu/Vegf8zCX5ugSuTA==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz", + "integrity": "sha512-hnYFrSefHxYS2XFGtN01x8un0EwNu2bzKvhpRFhgoybIvMaOkkL60IVPmkb5h6XDmUl4IMSB+rT5cIO4/4bJgg==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", From 0f531b2a9b2bd351924629a0dc85ab48bf66f0ae Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Mon, 26 Jul 2021 14:22:59 +0300 Subject: [PATCH 06/66] Additional demo on use of start & instance numbers --- ...numbering-instances-and-starting-number.ts | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 demo/68-numbering-instances-and-starting-number.ts diff --git a/demo/68-numbering-instances-and-starting-number.ts b/demo/68-numbering-instances-and-starting-number.ts new file mode 100644 index 0000000000..6bfda02e96 --- /dev/null +++ b/demo/68-numbering-instances-and-starting-number.ts @@ -0,0 +1,86 @@ +import * as fs from "fs"; +import { Document, Packer, Paragraph, PageNumberFormat} from "../build"; + +const doc = new Document({ + numbering:{ + config:[ + { + reference: 'ref1', + levels: [ + { + level: 0, + format: PageNumberFormat.DECIMAL, + text: '%1', + start: 10, + } + ], + }, + { + reference: 'ref2', + levels: [ + { + level: 0, + format: PageNumberFormat.DECIMAL, + text: '%1' + } + ], + }, + ] + }, + sections: [{ + children: [ + new Paragraph({ + text: "REF1 - inst:0 - lvl:0", + numbering : { + reference: 'ref1', + instance: 0, + level: 0, + } + }), + new Paragraph({ + text: "REF1 - inst:0 - lvl:0", + numbering : { + reference: 'ref1', + instance: 0, + level: 0, + } + }), + new Paragraph({ + text: "REF1 - inst:1 - lvl:0", + numbering : { + reference: 'ref1', + instance: 1, + level: 0, + }, + }), + new Paragraph({ + text: "REF1 - inst:1 - lvl:0", + numbering : { + reference: 'ref1', + instance: 1, + level: 0, + } + }), + new Paragraph({ + text: "REF2 - inst:0 - lvl:0", + numbering : { + reference: 'ref2', + instance: 1, + level: 0, + } + }), + new Paragraph({ + text: "REF2 - inst:0 - lvl:0", + numbering : { + reference: 'ref2', + instance: 1, + level: 0, + } + }) + ], + }] +}); + +Packer.toBuffer(doc).then((buffer) => { + fs.writeFileSync("My Document.docx", buffer); +}); \ No newline at end of file From 0088d58fea221d1dbdf034d03bfa86fb2cebed3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jul 2021 11:01:07 +0000 Subject: [PATCH 07/66] Bump webpack from 5.46.0 to 5.47.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.46.0 to 5.47.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.46.0...v5.47.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b9bb14b34..1e364f4a0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1305,9 +1305,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001246", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001246.tgz", - "integrity": "sha512-Tc+ff0Co/nFNbLOrziBXmMVtpt9S2c2Y+Z9Nk9Khj09J+0zR9ejvIW5qkZAErCbOrVODCx/MN+GpB5FNBs5GFA==", + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", "dev": true }, "caseless": { @@ -1934,9 +1934,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.784", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.784.tgz", - "integrity": "sha512-JTPxdUibkefeomWNaYs8lI/x/Zb4cOhZWX+d7kpzsNKzUd07pNuo/AcHeNJ/qgEchxM1IAxda9aaGUhKN/poOg==", + "version": "1.3.789", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.789.tgz", + "integrity": "sha512-lK4xn6C6ZF1kgLaC/EhOtC1MSKENExj3rMwGVnBTfHW81Z/Hb1Rge5YaWawN/YOXy3xCaESuE4KWSD50kOZ9rQ==", "dev": true }, "emoji-regex": { @@ -4944,12 +4944,6 @@ } } }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5740,9 +5734,9 @@ } }, "webpack": { - "version": "5.46.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.46.0.tgz", - "integrity": "sha512-qxD0t/KTedJbpcXUmvMxY5PUvXDbF8LsThCzqomeGaDlCA6k998D8yYVwZMvO8sSM3BTEOaD4uzFniwpHaTIJw==", + "version": "5.47.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.47.0.tgz", + "integrity": "sha512-soKLGwcUM1R3YEbJhJNiZzy7T43TnI7ENda/ywfDp9G1mDlDTpO+qfc8I5b0AzMr9xM3jyvQ0n7ctJyiXuXW6Q==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -5767,7 +5761,7 @@ "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", "watchpack": "^2.2.0", - "webpack-sources": "^2.3.1" + "webpack-sources": "^3.0.1" }, "dependencies": { "graceful-fs": { @@ -5833,14 +5827,10 @@ } }, "webpack-sources": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.3.1.tgz", - "integrity": "sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA==", - "dev": true, - "requires": { - "source-list-map": "^2.0.1", - "source-map": "^0.6.1" - } + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.0.2.tgz", + "integrity": "sha512-XQ6aGLmqoxZtmpbgwySGhYLNFav1W6+qgMWPGgn6qScxfGrQgMdigkUqZXQ7oB0ydUrvfs9RRyHaSfV153K8Xg==", + "dev": true }, "which": { "version": "1.2.14", From 2a1685ab82b07a93f88e85236483d14bb716592e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jul 2021 11:01:51 +0000 Subject: [PATCH 08/66] Bump sinon from 11.1.1 to 11.1.2 Bumps [sinon](https://github.com/sinonjs/sinon) from 11.1.1 to 11.1.2. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinonjs/sinon/commits) --- updated-dependencies: - dependency-name: sinon dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b9bb14b34..1078e771f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -485,9 +485,9 @@ } }, "@sinonjs/fake-timers": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.0.4.tgz", - "integrity": "sha512-fW3SzjLF0sjI0x1Opc7cUG4J/Nr4U0TXPNnKNAgrxA4xXsQNk6nypZK0yJg5FNw5cCo2yC/ZMdaVhDTKeeF6zg==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz", + "integrity": "sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0" @@ -4905,28 +4905,19 @@ "dev": true }, "sinon": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-11.1.1.tgz", - "integrity": "sha512-ZSSmlkSyhUWbkF01Z9tEbxZLF/5tRC9eojCdFh33gtQaP7ITQVaMWQHGuFM7Cuf/KEfihuh1tTl3/ABju3AQMg==", + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-11.1.2.tgz", + "integrity": "sha512-59237HChms4kg7/sXhiRcUzdSkKuydDeTiamT/jesUVHshBgL8XAmhgFo0GfK6RruMDM/iRSij1EybmMog9cJw==", "dev": true, "requires": { "@sinonjs/commons": "^1.8.3", - "@sinonjs/fake-timers": "^7.1.0", + "@sinonjs/fake-timers": "^7.1.2", "@sinonjs/samsam": "^6.0.2", "diff": "^5.0.0", "nise": "^5.1.0", "supports-color": "^7.2.0" }, "dependencies": { - "@sinonjs/fake-timers": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.0.tgz", - "integrity": "sha512-hAEzXi6Wbvlb67NnGMGSNOeAflLVnMa4yliPU/ty1qjgW/vAletH15/v/esJwASSIA0YlIyjnloenFbEZc9q9A==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", From a92f3a7ba1d3d46b3029dafafa3cecec24590def Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Jul 2021 11:01:25 +0000 Subject: [PATCH 09/66] Bump @types/node from 16.4.1 to 16.4.6 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.4.1 to 16.4.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b9bb14b34..daf3c7c525 100644 --- a/package-lock.json +++ b/package-lock.json @@ -598,9 +598,9 @@ "dev": true }, "@types/node": { - "version": "16.4.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.1.tgz", - "integrity": "sha512-UW7cbLqf/Wu5XH2RKKY1cHwUNLicIDRLMraYKz+HHAerJ0ZffUEk+fMnd8qU2JaS6cAy0r8tsaf7yqHASf/Y0Q==" + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.6.tgz", + "integrity": "sha512-FKyawK3o5KL16AwbeFajen8G4K3mmqUrQsehn5wNKs8IzlKHE8TfnSmILXVMVziAEcnB23u1RCFU1NT6hSyr7Q==" }, "@types/request": { "version": "2.48.6", From d77397287755ab3d8bef65e394f3733f48bcd1b5 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Fri, 30 Jul 2021 11:58:55 +0300 Subject: [PATCH 10/66] Test coverage issue fix --- src/file/numbering/numbering.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file/numbering/numbering.ts b/src/file/numbering/numbering.ts index fd2bf0754a..599fc1c8a8 100644 --- a/src/file/numbering/numbering.ts +++ b/src/file/numbering/numbering.ts @@ -215,8 +215,8 @@ export class Numbering extends XmlComponent { }; const referenceConfigLevels = this.referenceConfigMap.get(reference); - const firstLevelStartNumber = referenceConfigLevels?.[0]?.start; - if (firstLevelStartNumber) { + const firstLevelStartNumber = referenceConfigLevels && referenceConfigLevels[0].start; + if (firstLevelStartNumber && Number.isInteger(firstLevelStartNumber)) { concreteNumberingSettings.overrideLevel = { num: 0, start: firstLevelStartNumber, From f378c37b62290fc8e67f4eeaca715ad9ee9d0f51 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Fri, 30 Jul 2021 11:59:49 +0300 Subject: [PATCH 11/66] Test at spec.ts for referenceConfigMap --- src/file/numbering/numbering.spec.ts | 21 +++++++++++++++++++++ src/file/numbering/numbering.ts | 3 +++ 2 files changed, 24 insertions(+) diff --git a/src/file/numbering/numbering.spec.ts b/src/file/numbering/numbering.spec.ts index 6053a5e3cd..83314eabcd 100644 --- a/src/file/numbering/numbering.spec.ts +++ b/src/file/numbering/numbering.spec.ts @@ -112,5 +112,26 @@ describe("Numbering", () => { expect(numbering.ConcreteNumbering).to.have.length(2); }); }); + describe("#referenceConfigMap", () => { + it("should store level configs into referenceConfigMap", () => { + const numbering = new Numbering({ + config: [ + { + reference: "test-reference", + levels: [ + { + level: 0, + start: 10, + }, + ], + }, + ], + }); + numbering.createConcreteNumberingInstance("test-reference", 0); + const referenceConfig = numbering.ReferenceConfig[0]; + const zeroLevelConfig = referenceConfig[0]; + expect(zeroLevelConfig.start).to.be.equal(10); + }); + }); }); }); diff --git a/src/file/numbering/numbering.ts b/src/file/numbering/numbering.ts index 599fc1c8a8..998cd144a2 100644 --- a/src/file/numbering/numbering.ts +++ b/src/file/numbering/numbering.ts @@ -229,4 +229,7 @@ export class Numbering extends XmlComponent { public get ConcreteNumbering(): ConcreteNumbering[] { return Array.from(this.concreteNumberingMap.values()); } + public get ReferenceConfig(): object[] { + return Array.from(this.referenceConfigMap.values()); + } } From d52bf7b57d3c436abf7a7e55c8a80ea944bfb674 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Jul 2021 11:01:30 +0000 Subject: [PATCH 12/66] Bump webpack from 5.47.0 to 5.47.1 Bumps [webpack](https://github.com/webpack/webpack) from 5.47.0 to 5.47.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.47.0...v5.47.1) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index e4f5ccf322..17e63816c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1934,9 +1934,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.789", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.789.tgz", - "integrity": "sha512-lK4xn6C6ZF1kgLaC/EhOtC1MSKENExj3rMwGVnBTfHW81Z/Hb1Rge5YaWawN/YOXy3xCaESuE4KWSD50kOZ9rQ==", + "version": "1.3.791", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.791.tgz", + "integrity": "sha512-Tdx7w1fZpeWOOBluK+kXTAKCXyc79K65RB6Zp0+sPSZZhDjXlrxfGlXrlMGVVQUrKCyEZFQs1UBBLNz5IdbF0g==", "dev": true }, "emoji-regex": { @@ -5725,9 +5725,9 @@ } }, "webpack": { - "version": "5.47.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.47.0.tgz", - "integrity": "sha512-soKLGwcUM1R3YEbJhJNiZzy7T43TnI7ENda/ywfDp9G1mDlDTpO+qfc8I5b0AzMr9xM3jyvQ0n7ctJyiXuXW6Q==", + "version": "5.47.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.47.1.tgz", + "integrity": "sha512-cW+Mzy9SCDapFV4OrkHuP6EFV2mAsiQd+gOa3PKtHNoKg6qPqQXZzBlHH+CnQG1osplBCqwsJZ8CfGO6XWah0g==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -5752,7 +5752,7 @@ "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", "watchpack": "^2.2.0", - "webpack-sources": "^3.0.1" + "webpack-sources": "^3.1.1" }, "dependencies": { "graceful-fs": { @@ -5818,9 +5818,9 @@ } }, "webpack-sources": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.0.2.tgz", - "integrity": "sha512-XQ6aGLmqoxZtmpbgwySGhYLNFav1W6+qgMWPGgn6qScxfGrQgMdigkUqZXQ7oB0ydUrvfs9RRyHaSfV153K8Xg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.1.2.tgz", + "integrity": "sha512-//DeuK5SzM6yFRXNOGK+4tX7QB8PghkL8kFBPyqSlN62oJOUkmby8ptV7+IBGH6BkIuIw5Rjd7OvvwZaoiF4ag==", "dev": true }, "which": { From d77314821887578a82d6f22c806832745d7be389 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Jul 2021 11:01:49 +0000 Subject: [PATCH 13/66] Bump @types/node from 16.4.6 to 16.4.7 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.4.6 to 16.4.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e4f5ccf322..7e41412287 100644 --- a/package-lock.json +++ b/package-lock.json @@ -598,9 +598,9 @@ "dev": true }, "@types/node": { - "version": "16.4.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.6.tgz", - "integrity": "sha512-FKyawK3o5KL16AwbeFajen8G4K3mmqUrQsehn5wNKs8IzlKHE8TfnSmILXVMVziAEcnB23u1RCFU1NT6hSyr7Q==" + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.7.tgz", + "integrity": "sha512-aDDY54sst8sx47CWT6QQqIZp45yURq4dic0+HCYfYNcY5Ejlb/CLmFnRLfy3wQuYafOeh3lB/DAKaqRKBtcZmA==" }, "@types/request": { "version": "2.48.6", From 1ff31a2a42fb3e6547154497b336f6d951eb7d88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Aug 2021 11:01:11 +0000 Subject: [PATCH 14/66] Bump typedoc from 0.21.4 to 0.21.5 Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.4 to 0.21.5. - [Release notes](https://github.com/TypeStrong/TypeDoc/releases) - [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.4...v0.21.5) --- updated-dependencies: - dependency-name: typedoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70749fbbe5..5bd1ed570d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4879,23 +4879,6 @@ "json5": "^2.2.0", "onigasm": "^2.2.5", "vscode-textmate": "5.2.0" - }, - "dependencies": { - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - } } }, "signal-exit": { @@ -5504,9 +5487,9 @@ } }, "typedoc": { - "version": "0.21.4", - "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.21.4.tgz", - "integrity": "sha512-slZQhvD9U0d9KacktYAyuNMMOXJRFNHy+Gd8xY2Qrqq3eTTTv3frv3N4au/cFnab9t3T5WA0Orb6QUjMc+1bDA==", + "version": "0.21.5", + "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.21.5.tgz", + "integrity": "sha512-uRDRmYheE5Iju9Zz0X50pTASTpBorIHFt02F5Y8Dt4eBt55h3mwk1CBSY2+EfwBxY16N4Xm7f8KXhnfFZ0AmBw==", "dev": true, "requires": { "glob": "^7.1.7", @@ -5532,9 +5515,9 @@ "dev": true }, "uglify-js": { - "version": "3.13.10", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.10.tgz", - "integrity": "sha512-57H3ACYFXeo1IaZ1w02sfA71wI60MGco/IQFjOqK+WtKoprh7Go2/yvd2HPtoJILO2Or84ncLccI4xoHMTSbGg==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", + "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==", "dev": true, "optional": true }, From 3f257bf5a4784d9d5a355724e9ac9c59a93f01d0 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Tue, 3 Aug 2021 15:58:26 +0200 Subject: [PATCH 15/66] Add the pageref element This instruction is useful if you want to get the number of the page containing a specific bookmark. --- demo/21-bookmarks.ts | 8 +- docs/usage/hyperlinks.md | 11 +++ src/file/paragraph/links/index.ts | 1 + .../links/pageref-field-instruction.spec.ts | 24 ++++++ .../links/pageref-field-instruction.ts | 25 ++++++ .../paragraph/links/pageref-properties.ts | 16 ++++ src/file/paragraph/links/pageref.spec.ts | 76 +++++++++++++++++++ src/file/paragraph/links/pageref.ts | 13 ++++ 8 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 src/file/paragraph/links/pageref-field-instruction.spec.ts create mode 100644 src/file/paragraph/links/pageref-field-instruction.ts create mode 100644 src/file/paragraph/links/pageref-properties.ts create mode 100644 src/file/paragraph/links/pageref.spec.ts create mode 100644 src/file/paragraph/links/pageref.ts diff --git a/demo/21-bookmarks.ts b/demo/21-bookmarks.ts index 5455ee8875..6c673f1520 100644 --- a/demo/21-bookmarks.ts +++ b/demo/21-bookmarks.ts @@ -1,7 +1,7 @@ // This demo shows how to create bookmarks then link to them with internal hyperlinks // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Bookmark, Document, Footer, HeadingLevel, InternalHyperlink, Packer, PageBreak, Paragraph, TextRun } from "../build"; +import { Bookmark, Document, Footer, HeadingLevel, InternalHyperlink, Packer, PageBreak, Paragraph, TextRun, PageRef } from "../build"; const LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mi velit, convallis convallis scelerisque nec, faucibus nec leo. Phasellus at posuere mauris, tempus dignissim velit. Integer et tortor dolor. Duis auctor efficitur mattis. Vivamus ut metus accumsan tellus auctor sollicitudin venenatis et nibh. Cras quis massa ac metus fringilla venenatis. Proin rutrum mauris purus, ut suscipit magna consectetur id. Integer consectetur sollicitudin ante, vitae faucibus neque efficitur in. Praesent ultricies nibh lectus. Mauris pharetra id odio eget iaculis. Duis dictum, risus id pellentesque rutrum, lorem quam malesuada massa, quis ullamcorper turpis urna a diam. Cras vulputate metus vel massa porta ullamcorper. Etiam porta condimentum nulla nec tristique. Sed nulla urna, pharetra non tortor sed, sollicitudin molestie diam. Maecenas enim leo, feugiat eget vehicula id, sollicitudin vitae ante."; @@ -55,6 +55,12 @@ const doc = new Document({ }), ], }), + new Paragraph({ + children: [ + new TextRun("The bookmark can be seen on page "), + new PageRef("myAnchorId"), + ] + }), ], }, ], diff --git a/docs/usage/hyperlinks.md b/docs/usage/hyperlinks.md index 82bfb366f9..f8d53416ee 100644 --- a/docs/usage/hyperlinks.md +++ b/docs/usage/hyperlinks.md @@ -24,6 +24,17 @@ const link = this.doc.createInternalHyperLink('anchorForChapter1', 'This is a li paragraph.addHyperLink(link); ``` +You can also get the page number of the bookmark by creating a page reference to it: + +```ts +new Paragraph({ + children: [ + new TextRun("The chapter1 can be seen on page "), + new PageRef("anchorForChapter1"), + ] +}) +``` + ## External To create an external hyperlink you just need to specify the url and the text of the link, then add it to a paragraph with `doc.createHyperlink(url, text)`: diff --git a/src/file/paragraph/links/index.ts b/src/file/paragraph/links/index.ts index 82715b62e8..f3b83733bd 100644 --- a/src/file/paragraph/links/index.ts +++ b/src/file/paragraph/links/index.ts @@ -1,3 +1,4 @@ export * from "./hyperlink"; export * from "./bookmark"; export * from "./outline-level"; +export * from "./pageref"; diff --git a/src/file/paragraph/links/pageref-field-instruction.spec.ts b/src/file/paragraph/links/pageref-field-instruction.spec.ts new file mode 100644 index 0000000000..de1a28863c --- /dev/null +++ b/src/file/paragraph/links/pageref-field-instruction.spec.ts @@ -0,0 +1,24 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; +import { PageRefFieldInstruction } from "./pageref-field-instruction"; + +describe("PageRef field instruction", () => { + describe("#constructor()", () => { + it("should construct a pageref field instruction without options", () => { + const instruction = new PageRefFieldInstruction("anchor"); + const tree = new Formatter().format(instruction); + + expect(tree).to.be.deep.equal({ + "w:instrText": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "PAGEREF anchor", + ], + }); + }); + }); +}); diff --git a/src/file/paragraph/links/pageref-field-instruction.ts b/src/file/paragraph/links/pageref-field-instruction.ts new file mode 100644 index 0000000000..198f5427c9 --- /dev/null +++ b/src/file/paragraph/links/pageref-field-instruction.ts @@ -0,0 +1,25 @@ +import { SpaceType } from "file/space-type"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; +import { IPageRefOptions } from "./pageref-properties"; + +class TextAttributes extends XmlAttributeComponent<{ readonly space: SpaceType }> { + protected readonly xmlKeys = { space: "xml:space" }; +} + +export class PageRefFieldInstruction extends XmlComponent { + constructor(bookmarkId: string, options: IPageRefOptions = {}) { + super("w:instrText"); + this.root.push(new TextAttributes({ space: SpaceType.PRESERVE })); + + let instruction = `PAGEREF ${bookmarkId}`; + + if (options.hyperlink) { + instruction = `${instruction} \\h`; + } + if (options.useRelativePosition) { + instruction = `${instruction} \\p`; + } + + this.root.push(instruction); + } +} diff --git a/src/file/paragraph/links/pageref-properties.ts b/src/file/paragraph/links/pageref-properties.ts new file mode 100644 index 0000000000..963c5331d6 --- /dev/null +++ b/src/file/paragraph/links/pageref-properties.ts @@ -0,0 +1,16 @@ +// Options according to https://www.ecma-international.org/publications/standards/Ecma-376.htm (at Part 1, Page 1234) + +export interface IPageRefOptions { + /** + * \h option - Creates a hyperlink to the bookmarked paragraph. + */ + readonly hyperlink?: boolean; + /** + * \p option - Causes the field to display its position relative to the source + * bookmark. If the PAGEREF field is on the same page as the + * bookmark, it omits "on page #" and returns "above" or "below" + * only. If the PAGEREF field is not on the same page as the + * bookmark, the string "on page #" is used. + */ + readonly useRelativePosition?: boolean; +} diff --git a/src/file/paragraph/links/pageref.spec.ts b/src/file/paragraph/links/pageref.spec.ts new file mode 100644 index 0000000000..459429373b --- /dev/null +++ b/src/file/paragraph/links/pageref.spec.ts @@ -0,0 +1,76 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; +import { PageRef } from "./pageref"; + +describe("PageRef", () => { + describe("#constructor()", () => { + it("should construct a pageref without options", () => { + const pageref = new PageRef("some_bookmark"); + const tree = new Formatter().format(pageref); + expect(tree).to.be.deep.equal({ + "w:r": [ + { + "w:fldChar": { + _attr: { + "w:dirty": true, + "w:fldCharType": "begin", + }, + }, + }, + { + "w:instrText": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "PAGEREF some_bookmark", + ], + }, + { + "w:fldChar": { + _attr: { + "w:fldCharType": "end", + }, + }, + }, + ], + }); + }); + + it("should construct a pageref with all the options", () => { + const pageref = new PageRef("some_bookmark", { hyperlink: true, useRelativePosition: true }); + const tree = new Formatter().format(pageref); + expect(tree).to.be.deep.equal({ + "w:r": [ + { + "w:fldChar": { + _attr: { + "w:dirty": true, + "w:fldCharType": "begin", + }, + }, + }, + { + "w:instrText": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "PAGEREF some_bookmark \\h \\p", + ], + }, + { + "w:fldChar": { + _attr: { + "w:fldCharType": "end", + }, + }, + }, + ], + }); + }); + }); +}); diff --git a/src/file/paragraph/links/pageref.ts b/src/file/paragraph/links/pageref.ts new file mode 100644 index 0000000000..7cb6acfeec --- /dev/null +++ b/src/file/paragraph/links/pageref.ts @@ -0,0 +1,13 @@ +// See https://www.ecma-international.org/publications/standards/Ecma-376.htm (at Part 1, Page 1234) +import { Begin, End } from "file/paragraph/run/field"; +import { Run } from "../run"; +import { PageRefFieldInstruction } from "./pageref-field-instruction"; +import type { IPageRefOptions } from "./pageref-properties"; + +export class PageRef extends Run { + constructor(bookmarkId: string, options: IPageRefOptions = {}) { + super({ + children: [new Begin(true), new PageRefFieldInstruction(bookmarkId, options), new End()], + }); + } +} From 33d6544aba83ed7937eacdfa440c7d2ad201a7f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Aug 2021 11:01:07 +0000 Subject: [PATCH 16/66] Bump ts-loader from 9.2.4 to 9.2.5 Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.4 to 9.2.5. - [Release notes](https://github.com/TypeStrong/ts-loader/releases) - [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.4...v9.2.5) --- updated-dependencies: - dependency-name: ts-loader dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70749fbbe5..f062b16c8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5258,9 +5258,9 @@ } }, "ts-loader": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.4.tgz", - "integrity": "sha512-Ats2BCqPFBkgsoZUmmYMjuQu+iBNExt4o3QDsJqRMuPdStWlnOthdqX/GHHJnxSSgw7Gu6Hll/MD5b4usgKFOg==", + "version": "9.2.5", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.5.tgz", + "integrity": "sha512-al/ATFEffybdRMUIr5zMEWQdVnCGMUA9d3fXJ8dBVvBlzytPvIszoG9kZoR+94k6/i293RnVOXwMaWbXhNy9pQ==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -5279,9 +5279,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", From e9aea8b8a9cabc413fa2b7a18159842c2f6d56c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Aug 2021 11:01:03 +0000 Subject: [PATCH 17/66] Bump jszip from 3.7.0 to 3.7.1 Bumps [jszip](https://github.com/Stuk/jszip) from 3.7.0 to 3.7.1. - [Release notes](https://github.com/Stuk/jszip/releases) - [Changelog](https://github.com/Stuk/jszip/blob/master/CHANGES.md) - [Commits](https://github.com/Stuk/jszip/compare/v3.7.0...v3.7.1) --- updated-dependencies: - dependency-name: jszip dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70749fbbe5..913851141b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3149,9 +3149,9 @@ } }, "jszip": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.0.tgz", - "integrity": "sha512-Y2OlFIzrDOPWUnpU0LORIcDn2xN7rC9yKffFM/7pGhQuhO+SUhfm2trkJ/S5amjFvem0Y+1EALz/MEPkvHXVNw==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz", + "integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==", "requires": { "lie": "~3.3.0", "pako": "~1.0.2", From 3a9f09b57804c38f47f0b8a2925ffe9462a31c42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Aug 2021 11:01:26 +0000 Subject: [PATCH 18/66] Bump webpack from 5.47.1 to 5.50.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.47.1 to 5.50.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.47.1...v5.50.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 63 ++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70749fbbe5..8321027e24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -578,9 +578,9 @@ "dev": true }, "@types/json-schema": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", - "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, "@types/jszip": { @@ -865,6 +865,12 @@ "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", "dev": true }, + "acorn-import-assertions": { + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.7.6.tgz", + "integrity": "sha512-FlVvVFA1TX6l3lp8VjDnYYq7R1nyW6x3svAt4nDgrWQ9SBaSh9CnbwgSUTasgfNfOG5HlM1ehugCvM+hjo56LA==", + "dev": true + }, "aggregate-error": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", @@ -1206,16 +1212,16 @@ "dev": true }, "browserslist": { - "version": "4.16.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", - "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "version": "4.16.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.7.tgz", + "integrity": "sha512-7I4qVwqZltJ7j37wObBe3SoTz+nS8APaNcrBOlgoirb6/HbEU2XxW/LpUDTCngM6iauwFqmRTuOMfyKnFGY5JA==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001219", + "caniuse-lite": "^1.0.30001248", "colorette": "^1.2.2", - "electron-to-chromium": "^1.3.723", + "electron-to-chromium": "^1.3.793", "escalade": "^3.1.1", - "node-releases": "^1.1.71" + "node-releases": "^1.1.73" } }, "buffer": { @@ -1305,9 +1311,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001248", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", - "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "version": "1.0.30001249", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001249.tgz", + "integrity": "sha512-vcX4U8lwVXPdqzPWi6cAJ3FnQaqXbBqy/GZseKNQzRj37J7qZdGcBtxq/QLFNLLlfsoXLUdHw8Iwenri86Tagw==", "dev": true }, "caseless": { @@ -1934,9 +1940,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.791", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.791.tgz", - "integrity": "sha512-Tdx7w1fZpeWOOBluK+kXTAKCXyc79K65RB6Zp0+sPSZZhDjXlrxfGlXrlMGVVQUrKCyEZFQs1UBBLNz5IdbF0g==", + "version": "1.3.802", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.802.tgz", + "integrity": "sha512-dXB0SGSypfm3iEDxrb5n/IVKeX4uuTnFHdve7v+yKJqNpEP0D4mjFJ8e1znmSR+OOVlVC+kDO6f2kAkTFXvJBg==", "dev": true }, "emoji-regex": { @@ -3756,9 +3762,9 @@ } }, "node-releases": { - "version": "1.1.73", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", - "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==", + "version": "1.1.74", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.74.tgz", + "integrity": "sha512-caJBVempXZPepZoZAPCWRTNxYQ+xtG/KAi4ozTA5A+nJ7IU+kLQCbqaUjb5Rwy14M9upBWiQ4NutcmW04LJSRw==", "dev": true }, "normalize-path": { @@ -5725,9 +5731,9 @@ } }, "webpack": { - "version": "5.47.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.47.1.tgz", - "integrity": "sha512-cW+Mzy9SCDapFV4OrkHuP6EFV2mAsiQd+gOa3PKtHNoKg6qPqQXZzBlHH+CnQG1osplBCqwsJZ8CfGO6XWah0g==", + "version": "5.50.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.50.0.tgz", + "integrity": "sha512-hqxI7t/KVygs0WRv/kTgUW8Kl3YC81uyWQSo/7WUs5LsuRw0htH/fCwbVBGCuiX/t4s7qzjXFcf41O8Reiypag==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -5736,6 +5742,7 @@ "@webassemblyjs/wasm-edit": "1.11.1", "@webassemblyjs/wasm-parser": "1.11.1", "acorn": "^8.4.1", + "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.8.0", @@ -5752,13 +5759,13 @@ "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", "watchpack": "^2.2.0", - "webpack-sources": "^3.1.1" + "webpack-sources": "^3.2.0" }, "dependencies": { "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", "dev": true } } @@ -5818,9 +5825,9 @@ } }, "webpack-sources": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.1.2.tgz", - "integrity": "sha512-//DeuK5SzM6yFRXNOGK+4tX7QB8PghkL8kFBPyqSlN62oJOUkmby8ptV7+IBGH6BkIuIw5Rjd7OvvwZaoiF4ag==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.0.tgz", + "integrity": "sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw==", "dev": true }, "which": { From 4c4e253883c10bd48fc87d789aa57b2aedb99426 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Aug 2021 14:02:37 +0000 Subject: [PATCH 19/66] Bump path-parse from 1.0.6 to 1.0.7 Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70749fbbe5..2042f8540c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4250,9 +4250,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-to-regexp": { From fcd0427fe47bb4a46c555244267dbd313b7e4b19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:01:03 +0000 Subject: [PATCH 20/66] Bump @types/node from 16.4.7 to 16.6.1 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.4.7 to 16.6.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70749fbbe5..941533bdee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -598,9 +598,9 @@ "dev": true }, "@types/node": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.7.tgz", - "integrity": "sha512-aDDY54sst8sx47CWT6QQqIZp45yURq4dic0+HCYfYNcY5Ejlb/CLmFnRLfy3wQuYafOeh3lB/DAKaqRKBtcZmA==" + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz", + "integrity": "sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw==" }, "@types/request": { "version": "2.48.6", From 046ef0330acb44b1df31d7803595574b17c462d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:01:19 +0000 Subject: [PATCH 21/66] Bump nanoid from 3.1.23 to 3.1.25 Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.23 to 3.1.25. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](https://github.com/ai/nanoid/compare/3.1.23...3.1.25) --- updated-dependencies: - dependency-name: nanoid dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70749fbbe5..b8dea0deba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3660,6 +3660,12 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -3705,9 +3711,9 @@ "dev": true }, "nanoid": { - "version": "3.1.23", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", - "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==" + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==" }, "ncp": { "version": "1.0.1", From e8db8ec66936b70fbdc9e50ec57a3a380cb89a3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Aug 2021 11:01:26 +0000 Subject: [PATCH 22/66] Bump webpack-cli from 4.7.2 to 4.8.0 Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.7.2 to 4.8.0. - [Release notes](https://github.com/webpack/webpack-cli/releases) - [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.7.2...webpack-cli@4.8.0) --- updated-dependencies: - dependency-name: webpack-cli dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8637e6a631..19c0e5a9ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -842,9 +842,9 @@ } }, "@webpack-cli/serve": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.1.tgz", - "integrity": "sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.2.tgz", + "integrity": "sha512-vgJ5OLWadI8aKjDlOH3rb+dYyPd2GTZuQC/Tihjct6F9GpXGZINo3Y/IVuZVTM1eDQB+/AOsjPUWH/WySDaXvw==", "dev": true }, "@xtuc/ieee754": { @@ -2818,9 +2818,9 @@ } }, "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, "is-typedarray": { @@ -5760,15 +5760,15 @@ } }, "webpack-cli": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.2.tgz", - "integrity": "sha512-mEoLmnmOIZQNiRl0ebnjzQ74Hk0iKS5SiEEnpq3dRezoyR3yPaeQZCMCe+db4524pj1Pd5ghZXjT41KLzIhSLw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.8.0.tgz", + "integrity": "sha512-+iBSWsX16uVna5aAYN6/wjhJy1q/GKk4KjKvfg90/6hykCTSgozbfz5iRgDTSJt/LgSbYxdBX3KBHeobIs+ZEw==", "dev": true, "requires": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^1.0.4", "@webpack-cli/info": "^1.3.0", - "@webpack-cli/serve": "^1.5.1", + "@webpack-cli/serve": "^1.5.2", "colorette": "^1.2.1", "commander": "^7.0.0", "execa": "^5.0.0", @@ -5793,9 +5793,9 @@ "dev": true }, "rechoir": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", - "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "dev": true, "requires": { "resolve": "^1.9.0" From 31c6f0a8ca4698921b290a6302cd067f0327fed6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Aug 2021 11:01:01 +0000 Subject: [PATCH 23/66] Bump typedoc from 0.21.5 to 0.21.6 Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.5 to 0.21.6. - [Release notes](https://github.com/TypeStrong/TypeDoc/releases) - [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.5...v0.21.6) --- updated-dependencies: - dependency-name: typedoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 19c0e5a9ec..75f12a1290 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4883,9 +4883,9 @@ } }, "shiki": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.5.tgz", - "integrity": "sha512-XFn+rl3wIowDjzdr5DlHoHgQphXefgUTs2bNp/bZu4WF9gTrTLnKwio3f28VjiFG6Jpip7yQn/p4mMj6OrjrtQ==", + "version": "0.9.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.7.tgz", + "integrity": "sha512-rOoAmwRWDiGKjQ1GaSKmbp1J5CamCera+I+DMM3wG/phbwNYQPt1mrjBBZbK66v80Vl1/A9TTLgXVHMbgtOCIQ==", "dev": true, "requires": { "json5": "^2.2.0", @@ -5499,9 +5499,9 @@ } }, "typedoc": { - "version": "0.21.5", - "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.21.5.tgz", - "integrity": "sha512-uRDRmYheE5Iju9Zz0X50pTASTpBorIHFt02F5Y8Dt4eBt55h3mwk1CBSY2+EfwBxY16N4Xm7f8KXhnfFZ0AmBw==", + "version": "0.21.6", + "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.21.6.tgz", + "integrity": "sha512-+4u3PEBjQdaL5/yfus5WJbjIdQHv7E/FpZq3cNki9BBdGmZhqnTF6JLIXDQ2EfVggojOJG9/soB5QVFgXRYnIw==", "dev": true, "requires": { "glob": "^7.1.7", From 3b7394fe743556273ad23bb933c869330a783b16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Aug 2021 11:01:36 +0000 Subject: [PATCH 24/66] Bump @types/node from 16.6.1 to 16.6.2 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.6.1 to 16.6.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 19c0e5a9ec..44b88b8d6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -598,9 +598,9 @@ "dev": true }, "@types/node": { - "version": "16.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz", - "integrity": "sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw==" + "version": "16.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.2.tgz", + "integrity": "sha512-LSw8TZt12ZudbpHc6EkIyDM3nHVWKYrAvGy6EAJfNfjusbwnThqjqxUKKRwuV3iWYeW/LYMzNgaq3MaLffQ2xA==" }, "@types/request": { "version": "2.48.6", From 5dab97241e4786fbabc64ad164af6ff2993c5584 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Aug 2021 11:01:10 +0000 Subject: [PATCH 25/66] Bump webpack from 5.50.0 to 5.51.1 Bumps [webpack](https://github.com/webpack/webpack) from 5.50.0 to 5.51.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.50.0...v5.51.1) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 19c0e5a9ec..03c78b39c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1212,16 +1212,24 @@ "dev": true }, "browserslist": { - "version": "4.16.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.7.tgz", - "integrity": "sha512-7I4qVwqZltJ7j37wObBe3SoTz+nS8APaNcrBOlgoirb6/HbEU2XxW/LpUDTCngM6iauwFqmRTuOMfyKnFGY5JA==", + "version": "4.16.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz", + "integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001248", - "colorette": "^1.2.2", - "electron-to-chromium": "^1.3.793", + "caniuse-lite": "^1.0.30001251", + "colorette": "^1.3.0", + "electron-to-chromium": "^1.3.811", "escalade": "^3.1.1", - "node-releases": "^1.1.73" + "node-releases": "^1.1.75" + }, + "dependencies": { + "colorette": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", + "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", + "dev": true + } } }, "buffer": { @@ -1311,9 +1319,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001249", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001249.tgz", - "integrity": "sha512-vcX4U8lwVXPdqzPWi6cAJ3FnQaqXbBqy/GZseKNQzRj37J7qZdGcBtxq/QLFNLLlfsoXLUdHw8Iwenri86Tagw==", + "version": "1.0.30001251", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz", + "integrity": "sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A==", "dev": true }, "caseless": { @@ -1940,9 +1948,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.802", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.802.tgz", - "integrity": "sha512-dXB0SGSypfm3iEDxrb5n/IVKeX4uuTnFHdve7v+yKJqNpEP0D4mjFJ8e1znmSR+OOVlVC+kDO6f2kAkTFXvJBg==", + "version": "1.3.813", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.813.tgz", + "integrity": "sha512-YcSRImHt6JZZ2sSuQ4Bzajtk98igQ0iKkksqlzZLzbh4p0OIyJRSvUbsgqfcR8txdfsoYCc4ym306t4p2kP/aw==", "dev": true }, "emoji-regex": { @@ -3768,9 +3776,9 @@ } }, "node-releases": { - "version": "1.1.74", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.74.tgz", - "integrity": "sha512-caJBVempXZPepZoZAPCWRTNxYQ+xtG/KAi4ozTA5A+nJ7IU+kLQCbqaUjb5Rwy14M9upBWiQ4NutcmW04LJSRw==", + "version": "1.1.75", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.75.tgz", + "integrity": "sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw==", "dev": true }, "normalize-path": { @@ -5720,9 +5728,9 @@ } }, "webpack": { - "version": "5.50.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.50.0.tgz", - "integrity": "sha512-hqxI7t/KVygs0WRv/kTgUW8Kl3YC81uyWQSo/7WUs5LsuRw0htH/fCwbVBGCuiX/t4s7qzjXFcf41O8Reiypag==", + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.51.1.tgz", + "integrity": "sha512-xsn3lwqEKoFvqn4JQggPSRxE4dhsRcysWTqYABAZlmavcoTmwlOb9b1N36Inbt/eIispSkuHa80/FJkDTPos1A==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", From 8cf9b83068732a066cae48b5d6ad8cba31471376 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Aug 2021 11:01:29 +0000 Subject: [PATCH 26/66] Bump mocha from 9.0.3 to 9.1.0 Bumps [mocha](https://github.com/mochajs/mocha) from 9.0.3 to 9.1.0. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v9.0.3...v9.1.0) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 19c0e5a9ec..04d4671621 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3390,9 +3390,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -3584,9 +3584,9 @@ } }, "mocha": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz", - "integrity": "sha512-hnYFrSefHxYS2XFGtN01x8un0EwNu2bzKvhpRFhgoybIvMaOkkL60IVPmkb5h6XDmUl4IMSB+rT5cIO4/4bJgg==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.0.tgz", + "integrity": "sha512-Kjg/XxYOFFUi0h/FwMOeb6RoroiZ+P1yOfya6NK7h3dNhahrJx1r2XIT3ge4ZQvJM86mdjNA+W5phqRQh7DwCg==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", From e48ca53660dc933449f7358c21097bd633b68069 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 11:01:18 +0000 Subject: [PATCH 27/66] Bump @types/node from 16.6.2 to 16.7.1 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.6.2 to 16.7.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 02ccee440e..a18eb217f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -598,9 +598,9 @@ "dev": true }, "@types/node": { - "version": "16.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.2.tgz", - "integrity": "sha512-LSw8TZt12ZudbpHc6EkIyDM3nHVWKYrAvGy6EAJfNfjusbwnThqjqxUKKRwuV3iWYeW/LYMzNgaq3MaLffQ2xA==" + "version": "16.7.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.1.tgz", + "integrity": "sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A==" }, "@types/request": { "version": "2.48.6", From 94592de477000221e1cb0a005d1bff957a2f0458 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 11:01:05 +0000 Subject: [PATCH 28/66] Bump tsconfig-paths from 3.10.1 to 3.11.0 Bumps [tsconfig-paths](https://github.com/dividab/tsconfig-paths) from 3.10.1 to 3.11.0. - [Release notes](https://github.com/dividab/tsconfig-paths/releases) - [Changelog](https://github.com/dividab/tsconfig-paths/blob/master/CHANGELOG.md) - [Commits](https://github.com/dividab/tsconfig-paths/compare/v3.10.1...v3.11.0) --- updated-dependencies: - dependency-name: tsconfig-paths dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a18eb217f0..d25592cf05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -583,6 +583,12 @@ "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/jszip": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@types/jszip/-/jszip-3.4.1.tgz", @@ -5380,14 +5386,26 @@ } }, "tsconfig-paths": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", - "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz", + "integrity": "sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA==", "dev": true, "requires": { - "json5": "^2.2.0", + "@types/json5": "^0.0.29", + "json5": "^1.0.1", "minimist": "^1.2.0", "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } } }, "tslib": { From 631f5614419f14c3728c41bbdf9e68acc74c6eb8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Aug 2021 11:01:05 +0000 Subject: [PATCH 29/66] Bump prompt from 1.1.0 to 1.2.0 Bumps [prompt](https://github.com/flatiron/prompt) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/flatiron/prompt/releases) - [Changelog](https://github.com/flatiron/prompt/blob/master/CHANGELOG.md) - [Commits](https://github.com/flatiron/prompt/commits) --- updated-dependencies: - dependency-name: prompt dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 68 +++-------------------------------------------- 1 file changed, 4 insertions(+), 64 deletions(-) diff --git a/package-lock.json b/package-lock.json index a18eb217f0..35931d4f04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1657,12 +1657,6 @@ } } }, - "deep-equal": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", - "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=", - "dev": true - }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -2663,12 +2657,6 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, - "i": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", - "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", - "dev": true - }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -3574,23 +3562,6 @@ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, "mocha": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.0.tgz", @@ -3729,12 +3700,6 @@ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==" }, - "ncp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", - "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=", - "dev": true - }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -4405,15 +4370,15 @@ "dev": true }, "prompt": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.1.0.tgz", - "integrity": "sha512-ec1vUPXCplDBDUVD8uPa3XGA+OzLrO40Vxv3F1uxoiZGkZhdctlK2JotcHq5X6ExjocDOGwGdCSXloGNyU5L1Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.2.0.tgz", + "integrity": "sha512-iGerYRpRUg5ZyC+FJ/25G5PUKuWAGRjW1uOlhX7Pi3O5YygdK6R+KEaBjRbHSkU5vfS5PZCltSPZdDtUYwRCZA==", "dev": true, "requires": { + "async": "~0.9.0", "colors": "^1.1.2", "read": "1.0.x", "revalidator": "0.1.x", - "utile": "0.3.x", "winston": "2.x" } }, @@ -5657,31 +5622,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "utile": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/utile/-/utile-0.3.0.tgz", - "integrity": "sha1-E1LDQOuCDk2N26A5pPv6oy7U7zo=", - "dev": true, - "requires": { - "async": "~0.9.0", - "deep-equal": "~0.2.1", - "i": "0.3.x", - "mkdirp": "0.x.x", - "ncp": "1.0.x", - "rimraf": "2.x.x" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", From 9efee181ba848c0dcc20653b88b8f7174d7a46cb Mon Sep 17 00:00:00 2001 From: Dolan Date: Fri, 27 Aug 2021 10:12:08 +0100 Subject: [PATCH 30/66] Update tables.md --- docs/usage/tables.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/usage/tables.md b/docs/usage/tables.md index a13b7f5a02..aba2e35c6f 100644 --- a/docs/usage/tables.md +++ b/docs/usage/tables.md @@ -242,12 +242,12 @@ const cell = new TableCell({ `WidthType` values can be: -| Property | Notes | -| -------- | --------------------------------- | -| AUTO | | -| DXA | value is in twentieths of a point | -| NIL | is considered as zero | -| PCT | percent of table width | +| Property | Notes | +| ---------- | --------------------------------- | +| AUTO | | +| DXA | Value is in twentieths of a point | +| NIL | Is considered as zero | +| PERCENTAGE | Percent of table width | ### Nested Tables From c1cc211c7f84b9a675a8dd86c00b0ffc50ac636d Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Fri, 27 Aug 2021 16:53:11 -0600 Subject: [PATCH 31/66] Add children to hyperlink --- src/file/paragraph/links/hyperlink.spec.ts | 22 +++++++++++++--------- src/file/paragraph/links/hyperlink.ts | 10 ++++++---- src/file/paragraph/paragraph.spec.ts | 2 +- src/file/paragraph/paragraph.ts | 2 +- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/file/paragraph/links/hyperlink.spec.ts b/src/file/paragraph/links/hyperlink.spec.ts index 50d6aa76aa..8b6fefb691 100644 --- a/src/file/paragraph/links/hyperlink.spec.ts +++ b/src/file/paragraph/links/hyperlink.spec.ts @@ -10,10 +10,12 @@ describe("ConcreteHyperlink", () => { beforeEach(() => { hyperlink = new ConcreteHyperlink( - new TextRun({ - text: "https://example.com", - style: "Hyperlink", - }), + [ + new TextRun({ + text: "https://example.com", + style: "Hyperlink", + }), + ], "superid", ); }); @@ -42,10 +44,12 @@ describe("ConcreteHyperlink", () => { describe("with optional anchor parameter", () => { beforeEach(() => { hyperlink = new ConcreteHyperlink( - new TextRun({ - text: "Anchor Text", - style: "Hyperlink", - }), + [ + new TextRun({ + text: "Anchor Text", + style: "Hyperlink", + }), + ], "superid2", "anchor", ); @@ -78,7 +82,7 @@ describe("ExternalHyperlink", () => { describe("#constructor()", () => { it("should create", () => { const externalHyperlink = new ExternalHyperlink({ - child: new TextRun("test"), + children: [new TextRun("test")], link: "http://www.google.com", }); diff --git a/src/file/paragraph/links/hyperlink.ts b/src/file/paragraph/links/hyperlink.ts index 7ced10d07c..7ee4409298 100644 --- a/src/file/paragraph/links/hyperlink.ts +++ b/src/file/paragraph/links/hyperlink.ts @@ -13,7 +13,7 @@ export enum HyperlinkType { export class ConcreteHyperlink extends XmlComponent { public readonly linkId: string; - constructor(child: ParagraphChild, relationshipId: string, anchor?: string) { + constructor(children: ParagraphChild[], relationshipId: string, anchor?: string) { super("w:hyperlink"); this.linkId = relationshipId; @@ -26,16 +26,18 @@ export class ConcreteHyperlink extends XmlComponent { const attributes = new HyperlinkAttributes(props); this.root.push(attributes); - this.root.push(child); + children.forEach((child) => { + this.root.push(child); + }); } } export class InternalHyperlink extends ConcreteHyperlink { constructor(options: { readonly child: ParagraphChild; readonly anchor: string }) { - super(options.child, uniqueId(), options.anchor); + super([options.child], uniqueId(), options.anchor); } } export class ExternalHyperlink { - constructor(public readonly options: { readonly child: ParagraphChild; readonly link: string }) {} + constructor(public readonly options: { readonly children: ParagraphChild[]; readonly link: string }) {} } diff --git a/src/file/paragraph/paragraph.spec.ts b/src/file/paragraph/paragraph.spec.ts index 90c6c8bedd..ab06d59ac1 100644 --- a/src/file/paragraph/paragraph.spec.ts +++ b/src/file/paragraph/paragraph.spec.ts @@ -927,7 +927,7 @@ describe("Paragraph", () => { const paragraph = new Paragraph({ children: [ new ExternalHyperlink({ - child: new TextRun("test"), + children: [new TextRun("test")], link: "http://www.google.com", }), ], diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index afd9da1b7d..2f73f7cc65 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -75,7 +75,7 @@ export class Paragraph extends XmlComponent { for (const element of this.root) { if (element instanceof ExternalHyperlink) { const index = this.root.indexOf(element); - const concreteHyperlink = new ConcreteHyperlink(element.options.child, uniqueId()); + const concreteHyperlink = new ConcreteHyperlink(element.options.children, uniqueId()); context.viewWrapper.Relationships.createRelationship( concreteHyperlink.linkId, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", From 7fa94b6996c699da65c856bcf3cff1b55c0fcbf3 Mon Sep 17 00:00:00 2001 From: 1shaked <40497915+1shaked@users.noreply.github.com> Date: Sun, 29 Aug 2021 09:43:09 +0300 Subject: [PATCH 32/66] Update README.md fix typing error with the extra ; --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 64a6a85225..6e06856207 100644 --- a/docs/README.md +++ b/docs/README.md @@ -44,7 +44,7 @@ const doc = new Document({ ], }), ], - }]; + }], }); // Used to export the file into a .docx file From bef9ea28f29f35cb67728386f21002a1f3418141 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 11:01:17 +0000 Subject: [PATCH 33/66] Bump typedoc from 0.21.6 to 0.21.9 Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.6 to 0.21.9. - [Release notes](https://github.com/TypeStrong/TypeDoc/releases) - [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.6...v0.21.9) --- updated-dependencies: - dependency-name: typedoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index a18eb217f0..296340a971 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3485,9 +3485,9 @@ "dev": true }, "marked": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", - "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.2.tgz", + "integrity": "sha512-TMJQQ79Z0e3rJYazY0tIoMsFzteUGw9fB3FD+gzuIT3zLuG9L9ckIvUfF51apdJkcqc208jJN2KbtPbOvXtbjA==", "dev": true }, "medium-zoom": { @@ -4891,9 +4891,9 @@ } }, "shiki": { - "version": "0.9.7", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.7.tgz", - "integrity": "sha512-rOoAmwRWDiGKjQ1GaSKmbp1J5CamCera+I+DMM3wG/phbwNYQPt1mrjBBZbK66v80Vl1/A9TTLgXVHMbgtOCIQ==", + "version": "0.9.8", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.8.tgz", + "integrity": "sha512-499zQUTjcNTVwwiaPrWldUTXIV3T9HZWxDwE82bY+9GE7P2uD6hpHUTXNbTof3iOG6WT+/062+OMbl0lDoG8WQ==", "dev": true, "requires": { "json5": "^2.2.0", @@ -5507,18 +5507,18 @@ } }, "typedoc": { - "version": "0.21.6", - "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.21.6.tgz", - "integrity": "sha512-+4u3PEBjQdaL5/yfus5WJbjIdQHv7E/FpZq3cNki9BBdGmZhqnTF6JLIXDQ2EfVggojOJG9/soB5QVFgXRYnIw==", + "version": "0.21.9", + "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.21.9.tgz", + "integrity": "sha512-VRo7aII4bnYaBBM1lhw4bQFmUcDQV8m8tqgjtc7oXl87jc1Slbhfw2X5MccfcR2YnEClHDWgsiQGgNB8KJXocA==", "dev": true, "requires": { "glob": "^7.1.7", "handlebars": "^4.7.7", "lunr": "^2.3.9", - "marked": "^2.1.1", + "marked": "^3.0.2", "minimatch": "^3.0.0", "progress": "^2.0.3", - "shiki": "^0.9.3", + "shiki": "^0.9.8", "typedoc-default-themes": "^0.12.10" } }, From 831ef9a98c9d52960100296b13b4e6ba4b2896ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 11:02:05 +0000 Subject: [PATCH 34/66] Bump mocha from 9.1.0 to 9.1.1 Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.0 to 9.1.1. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v9.1.0...v9.1.1) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a18eb217f0..343d113d4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3592,9 +3592,9 @@ } }, "mocha": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.0.tgz", - "integrity": "sha512-Kjg/XxYOFFUi0h/FwMOeb6RoroiZ+P1yOfya6NK7h3dNhahrJx1r2XIT3ge4ZQvJM86mdjNA+W5phqRQh7DwCg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-0wE74YMgOkCgBUj8VyIDwmLUjTsS13WV1Pg7l0SHea2qzZzlq7MDnfbPsHKcELBRk3+izEVkRofjmClpycudCA==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", From 44520bc54bc500b1890e48db7afeb1a9a8ecc406 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Aug 2021 11:01:41 +0000 Subject: [PATCH 35/66] Bump @types/node from 16.7.1 to 16.7.8 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.1 to 16.7.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a18eb217f0..65d352bd0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -598,9 +598,9 @@ "dev": true }, "@types/node": { - "version": "16.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.1.tgz", - "integrity": "sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A==" + "version": "16.7.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.8.tgz", + "integrity": "sha512-8upnoQU0OPzbIkm+ZMM0zCeFCkw2s3mS0IWdx0+AAaWqm4fkBb0UJp8Edl7FVKRamYbpJC/aVsHpKWBIbiC7Zg==" }, "@types/request": { "version": "2.48.6", From 243d73542f9a29662fdbcb737350379f3b1752e3 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Tue, 31 Aug 2021 18:55:38 -0600 Subject: [PATCH 36/66] Update demo 35 with new API --- demo/35-hyperlinks.ts | 101 +++++++++++++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 27 deletions(-) diff --git a/demo/35-hyperlinks.ts b/demo/35-hyperlinks.ts index f8aca4f622..6039e6f443 100644 --- a/demo/35-hyperlinks.ts +++ b/demo/35-hyperlinks.ts @@ -11,10 +11,12 @@ const doc = new Document({ children: [ new TextRun("Click here for the "), new ExternalHyperlink({ - child: new TextRun({ - text: "Footnotes external hyperlink", - style: "Hyperlink", - }), + children: [ + new TextRun({ + text: "Footnotes external hyperlink", + style: "Hyperlink", + }), + ], link: "http://www.example.com", }), ], @@ -31,10 +33,12 @@ const doc = new Document({ children: [ new TextRun("Click here for the "), new ExternalHyperlink({ - child: new TextRun({ - text: "Footer external hyperlink", - style: "Hyperlink", - }), + children: [ + new TextRun({ + text: "Footer external hyperlink", + style: "Hyperlink", + }), + ], link: "http://www.example.com", }), ], @@ -49,10 +53,12 @@ const doc = new Document({ children: [ new TextRun("Click here for the "), new ExternalHyperlink({ - child: new TextRun({ - text: "Header external hyperlink", - style: "Hyperlink", - }), + children: [ + new TextRun({ + text: "Header external hyperlink", + style: "Hyperlink", + }), + ], link: "http://www.google.com", }), ], @@ -64,10 +70,12 @@ const doc = new Document({ new Paragraph({ children: [ new ExternalHyperlink({ - child: new TextRun({ - text: "Anchor Text", - style: "Hyperlink", - }), + children: [ + new TextRun({ + text: "Anchor Text", + style: "Hyperlink", + }), + ], link: "http://www.example.com", }), new FootnoteReferenceRun(1), @@ -76,24 +84,63 @@ const doc = new Document({ new Paragraph({ children: [ new ExternalHyperlink({ - child: new ImageRun({ - data: fs.readFileSync("./demo/images/image1.jpeg"), - transformation: { - width: 100, - height: 100, - }, - }), + children: [ + new ImageRun({ + data: fs.readFileSync("./demo/images/image1.jpeg"), + transformation: { + width: 100, + height: 100, + }, + }), + ], link: "http://www.google.com", }), new ExternalHyperlink({ - child: new TextRun({ - text: "BBC News Link", - style: "Hyperlink", - }), + children: [ + new TextRun({ + text: "BBC News Link", + style: "Hyperlink", + }), + ], link: "https://www.bbc.co.uk/news", }), ], }), + new Paragraph({ + children: [ + new TextRun({ + text: "This is a hyperlink with formatting: ", + }), + new ExternalHyperlink({ + children: [ + new TextRun({ + text: "A ", + style: "Hyperlink", + }), + new TextRun({ + text: "single ", + bold: true, + style: "Hyperlink", + }), + new TextRun({ + text: "link", + doubleStrike: true, + style: "Hyperlink", + }), + new TextRun({ + text: "1", + superScript: true, + style: "Hyperlink", + }), + new TextRun({ + text: "!", + style: "Hyperlink", + }), + ], + link: "http://www.example.com", + }), + ], + }), ], }, ], From 41f516d64b76a4561364602c4696287afb122808 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Tue, 31 Aug 2021 19:54:33 -0600 Subject: [PATCH 37/66] Make the internal hyperlink consistent --- demo/21-bookmarks.ts | 30 +++++++++++++--------- src/file/paragraph/links/hyperlink.spec.ts | 2 +- src/file/paragraph/links/hyperlink.ts | 4 +-- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/demo/21-bookmarks.ts b/demo/21-bookmarks.ts index 6c673f1520..56343c94cd 100644 --- a/demo/21-bookmarks.ts +++ b/demo/21-bookmarks.ts @@ -18,10 +18,12 @@ const doc = new Document({ new Paragraph({ children: [ new InternalHyperlink({ - child: new TextRun({ - text: "Click here!", - style: "Hyperlink", - }), + children: [ + new TextRun({ + text: "Click here!", + style: "Hyperlink", + }), + ], anchor: "myAnchorId", }), ], @@ -47,19 +49,23 @@ const doc = new Document({ new Paragraph({ children: [ new InternalHyperlink({ - child: new TextRun({ - text: "Anchor Text", - style: "Hyperlink", - }), + children: [ + new TextRun({ + text: "Styled", + bold: true, + style: "Hyperlink", + }), + new TextRun({ + text: " Anchor Text", + style: "Hyperlink", + }), + ], anchor: "myAnchorId", }), ], }), new Paragraph({ - children: [ - new TextRun("The bookmark can be seen on page "), - new PageRef("myAnchorId"), - ] + children: [new TextRun("The bookmark can be seen on page "), new PageRef("myAnchorId")], }), ], }, diff --git a/src/file/paragraph/links/hyperlink.spec.ts b/src/file/paragraph/links/hyperlink.spec.ts index 8b6fefb691..9f79a19ff1 100644 --- a/src/file/paragraph/links/hyperlink.spec.ts +++ b/src/file/paragraph/links/hyperlink.spec.ts @@ -95,7 +95,7 @@ describe("InternalHyperlink", () => { describe("#constructor()", () => { it("should create", () => { const internalHyperlink = new InternalHyperlink({ - child: new TextRun("test"), + children: [new TextRun("test")], anchor: "test-id", }); diff --git a/src/file/paragraph/links/hyperlink.ts b/src/file/paragraph/links/hyperlink.ts index 7ee4409298..2c39997908 100644 --- a/src/file/paragraph/links/hyperlink.ts +++ b/src/file/paragraph/links/hyperlink.ts @@ -33,8 +33,8 @@ export class ConcreteHyperlink extends XmlComponent { } export class InternalHyperlink extends ConcreteHyperlink { - constructor(options: { readonly child: ParagraphChild; readonly anchor: string }) { - super([options.child], uniqueId(), options.anchor); + constructor(options: { readonly children: ParagraphChild[]; readonly anchor: string }) { + super(options.children, uniqueId(), options.anchor); } } From 727e741b08a71cba8b4737e9b25e51d7b98e5b3b Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Tue, 31 Aug 2021 19:54:57 -0600 Subject: [PATCH 38/66] Hyperlink documentation --- docs/_sidebar.md | 1 + docs/usage/hyperlinks.md | 86 +++++++++++++++++++++++++++++----------- 2 files changed, 64 insertions(+), 23 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 7fa4e9f745..356f64239a 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -15,6 +15,7 @@ * [Image](usage/images.md) * [Headers & Footers](usage/headers-and-footers.md) * [Bullet Points](usage/bullet-points.md) + * [Hyperlinks](usage/hyperlinks.md) * [Numbering](usage/numbering.md) * [Tables](usage/tables.md) * [Tab Stops](usage/tab-stops.md) diff --git a/docs/usage/hyperlinks.md b/docs/usage/hyperlinks.md index f8d53416ee..d49d9aa0a2 100644 --- a/docs/usage/hyperlinks.md +++ b/docs/usage/hyperlinks.md @@ -1,58 +1,98 @@ # Hyperlinks +!> Hyperlinks require an understanding of [Paragraphs](usage/paragraph.md) and [Text](usage/text.md). + There are two types of hyperlinks: internal (pointing to a bookmark inside the document) and external (pointing to an external url). ## Internal -To create an internal hyperlink you need first to create a bookmark (the paragraph that will be the destination of the hyperlink) with `doc.createBookmark(anchor, text)`. +To create an internal hyperlink you need first to create a `Bookmark`, which contains the content that will be the destination of the hyperlink. -A bookmark is composed of an anchor (an identifier) and the text displayed. After creating a bookmark just add it to a paragraph with `paragraph.addBookmark(bookmark)` - -For example: +A bookmark is composed of an anchor (an identifier) and the text displayed. After creating a bookmark just add it to a paragraph. For example, creating a bookmarked heading: ```ts -const paragraph = this.doc.createParagraph(); -const bookmark = this.doc.createBookmark('anchorForChapter1', 'This is chapter1'); -paragraph.addBookmark(bookmark); +const chapter1 = new Paragraph({ + heading: HeadingLevel.HEADING_1, + children: [ + new Bookmark({ + id: "anchorForChapter1", + children: [ + new TextRun("Chapter 1"), + ], + }), + ], +}) ``` -Then you can create an hyperlink pointing to that bookmark with `doc.createInternalHyperLink(anchor,text)`: +Then you can create an hyperlink pointing to that bookmark with an `InternalHyperLink`: ```ts -const paragraph = this.doc.createParagraph(); -const link = this.doc.createInternalHyperLink('anchorForChapter1', 'This is a link to chapter1'); -paragraph.addHyperLink(link); +const link = new InternalHyperlink({ + children: [ + new TextRun({ + text: "See Chapter 1", + style: "Hyperlink", + }), + ], + anchor: "anchorForChapter1", +}) ``` You can also get the page number of the bookmark by creating a page reference to it: ```ts -new Paragraph({ +const paragraph = new Paragraph({ children: [ - new TextRun("The chapter1 can be seen on page "), + new TextRun("Chapter 1 can be seen on page "), new PageRef("anchorForChapter1"), - ] -}) + ], +}); ``` ## External -To create an external hyperlink you just need to specify the url and the text of the link, then add it to a paragraph with `doc.createHyperlink(url, text)`: +To create an external hyperlink you just need to specify the url and the text of the link, then add it to a paragraph: ```ts -const paragraph = this.doc.createParagraph(); -const link = this.doc.createHyperlink('https://docx.js.org', 'This is an external link'); -paragraph.addHyperLink(link); +const paragraph = new Paragraph({ + children: [ + new ExternalHyperlink({ + children: [ + new TextRun({ + text: "This is an external link!", + style: "Hyperlink", + }), + ], + link: "https://docx.js.org", + }), + ], +}); ``` -## Styling an hyperlink +## Styling hyperlinks -It is possible to set the style of the text of an hyperlink. This can be done applying run formatting on `TextRun` property of the hyperlink. +It is possible to set the style of the text of both internal and external hyperlinks. This can be done applying run formatting on any of the `TextRun` children of the hyperlink. Use the `style: "Hyperlink"` property to show the default link styles, which can be combined with any other style. Example: ```ts -const link = this.doc.createHyperlink('https://docx.js.org', 'This is an external link'); -link.TextRun.bold().italics() +const styledLink = new ExternalHyperlink({ + children: [ + new TextRun({ + text: "This is a ", + style: "Hyperlink", + }), + new TextRun({ + text: "bold", + bold: true, + style: "Hyperlink", + }), + new TextRun({ + text: " link!", + style: "Hyperlink", + }), + ], + link: "https://docx.js.org", +}); ``` From 463c2825685eb03cec170722c64a7a9fc7796bb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 03:40:07 +0000 Subject: [PATCH 39/66] Bump @types/node from 16.7.8 to 16.7.10 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.8 to 16.7.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ed1f4abf1..bee5bfbf0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -604,9 +604,9 @@ "dev": true }, "@types/node": { - "version": "16.7.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.8.tgz", - "integrity": "sha512-8upnoQU0OPzbIkm+ZMM0zCeFCkw2s3mS0IWdx0+AAaWqm4fkBb0UJp8Edl7FVKRamYbpJC/aVsHpKWBIbiC7Zg==" + "version": "16.7.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz", + "integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA==" }, "@types/request": { "version": "2.48.6", From 4e3a2fd90f66b1e9316d61162291a1225fb1b4c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 11:01:36 +0000 Subject: [PATCH 40/66] Bump typescript from 4.3.5 to 4.4.2 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.5 to 4.4.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.3.5...v4.4.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ed1f4abf1..ccc025dc94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5512,9 +5512,9 @@ "dev": true }, "typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", + "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index e38e903856..142e167301 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "tslint": "^6.1.3", "tslint-immutable": "^6.0.1", "typedoc": "^0.21.1", - "typescript": "4.3.5", + "typescript": "4.4.2", "webpack": "^5.28.0", "webpack-cli": "^4.6.0" }, From dc2f9c3bdc59e4304dd79302022a402cee21a332 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Wed, 1 Sep 2021 12:20:54 -0600 Subject: [PATCH 41/66] Allow other types in bookmarks --- src/file/paragraph/links/bookmark.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/file/paragraph/links/bookmark.ts b/src/file/paragraph/links/bookmark.ts index b7d32bdbad..a0342b6fcb 100644 --- a/src/file/paragraph/links/bookmark.ts +++ b/src/file/paragraph/links/bookmark.ts @@ -2,15 +2,15 @@ import { uniqueId } from "convenience-functions"; import { XmlComponent } from "file/xml-components"; -import { TextRun } from "../run"; +import { ParagraphChild } from "../paragraph"; import { BookmarkEndAttributes, BookmarkStartAttributes } from "./bookmark-attributes"; export class Bookmark { public readonly start: BookmarkStart; - public readonly children: TextRun[]; + public readonly children: ParagraphChild[]; public readonly end: BookmarkEnd; - constructor(options: { readonly id: string; readonly children: TextRun[] }) { + constructor(options: { readonly id: string; readonly children: ParagraphChild[] }) { const linkId = uniqueId(); this.start = new BookmarkStart(options.id, linkId); From 4221b9085a385d5d9d13a52adb8c06ea843ed047 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Sep 2021 11:01:32 +0000 Subject: [PATCH 42/66] Bump webpack from 5.51.1 to 5.52.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.51.1 to 5.52.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.51.1...v5.52.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 58 +++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index ef4a23b098..eb241ed2ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -866,9 +866,9 @@ "dev": true }, "acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true }, "acorn-import-assertions": { @@ -1218,14 +1218,14 @@ "dev": true }, "browserslist": { - "version": "4.16.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz", - "integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.0.tgz", + "integrity": "sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001251", + "caniuse-lite": "^1.0.30001254", "colorette": "^1.3.0", - "electron-to-chromium": "^1.3.811", + "electron-to-chromium": "^1.3.830", "escalade": "^3.1.1", "node-releases": "^1.1.75" }, @@ -1325,9 +1325,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001251", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz", - "integrity": "sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A==", + "version": "1.0.30001255", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001255.tgz", + "integrity": "sha512-F+A3N9jTZL882f/fg/WWVnKSu6IOo3ueLz4zwaOPbPYHNmM/ZaDUyzyJwS1mZhX7Ex5jqTyW599Gdelh5PDYLQ==", "dev": true }, "caseless": { @@ -1948,9 +1948,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.813", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.813.tgz", - "integrity": "sha512-YcSRImHt6JZZ2sSuQ4Bzajtk98igQ0iKkksqlzZLzbh4p0OIyJRSvUbsgqfcR8txdfsoYCc4ym306t4p2kP/aw==", + "version": "1.3.830", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.830.tgz", + "integrity": "sha512-gBN7wNAxV5vl1430dG+XRcQhD4pIeYeak6p6rjdCtlz5wWNwDad8jwvphe5oi1chL5MV6RNRikfffBBiFuj+rQ==", "dev": true }, "emoji-regex": { @@ -3045,9 +3045,9 @@ } }, "jest-worker": { - "version": "27.0.6", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.6.tgz", - "integrity": "sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA==", + "version": "27.1.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.1.0.tgz", + "integrity": "sha512-mO4PHb2QWLn9yRXGp7rkvXLAYuxwhq1ZYUo0LoDhg8wqvv4QizP1ZWEJOeolgbEgAWZLIEU0wsku8J+lGWfBhg==", "dev": true, "requires": { "@types/node": "*", @@ -5126,9 +5126,9 @@ "dev": true }, "terser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", - "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.2.tgz", + "integrity": "sha512-0Omye+RD4X7X69O0eql3lC4Heh/5iLj3ggxR/B5ketZLOtLiOqukUgjw3q4PDnNQbsrkKr3UMypqStQG3XKRvw==", "dev": true, "requires": { "commander": "^2.20.0", @@ -5151,17 +5151,17 @@ } }, "terser-webpack-plugin": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz", - "integrity": "sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.3.tgz", + "integrity": "sha512-eDbuaDlXhVaaoKuLD3DTNTozKqln6xOG6Us0SzlKG5tNlazG+/cdl8pm9qiF1Di89iWScTI0HcO+CDcf2dkXiw==", "dev": true, "requires": { - "jest-worker": "^27.0.2", + "jest-worker": "^27.0.6", "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", + "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^5.7.0" + "terser": "^5.7.2" }, "dependencies": { "p-limit": { @@ -5686,9 +5686,9 @@ } }, "webpack": { - "version": "5.51.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.51.1.tgz", - "integrity": "sha512-xsn3lwqEKoFvqn4JQggPSRxE4dhsRcysWTqYABAZlmavcoTmwlOb9b1N36Inbt/eIispSkuHa80/FJkDTPos1A==", + "version": "5.52.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.52.0.tgz", + "integrity": "sha512-yRZOat8jWGwBwHpco3uKQhVU7HYaNunZiJ4AkAVQkPCUGoZk/tiIXiwG+8HIy/F+qsiZvSOa+GLQOj3q5RKRYg==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", From ff7756f8c5e4cb1ecbba19c2c586694cb79d4c4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Sep 2021 11:01:33 +0000 Subject: [PATCH 43/66] Bump @types/node from 16.7.10 to 16.7.13 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.10 to 16.7.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ef4a23b098..a9c1f040ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -604,9 +604,9 @@ "dev": true }, "@types/node": { - "version": "16.7.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz", - "integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA==" + "version": "16.7.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.13.tgz", + "integrity": "sha512-pLUPDn+YG3FYEt/pHI74HmnJOWzeR+tOIQzUx93pi9M7D8OE7PSLr97HboXwk5F+JS+TLtWuzCOW97AHjmOXXA==" }, "@types/request": { "version": "2.48.6", From ce2a94917687b77076b4a92d1e33f820829875c3 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Wed, 8 Sep 2021 00:41:40 +0100 Subject: [PATCH 44/66] Re-name PageRef to PageReference --- demo/21-bookmarks.ts | 4 ++-- docs/usage/hyperlinks.md | 2 +- .../paragraph/links/pageref-field-instruction.spec.ts | 6 +++--- src/file/paragraph/links/pageref-field-instruction.ts | 6 +++--- src/file/paragraph/links/pageref-properties.ts | 2 +- src/file/paragraph/links/pageref.spec.ts | 10 +++++----- src/file/paragraph/links/pageref.ts | 10 +++++----- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/demo/21-bookmarks.ts b/demo/21-bookmarks.ts index 56343c94cd..decb882be0 100644 --- a/demo/21-bookmarks.ts +++ b/demo/21-bookmarks.ts @@ -1,7 +1,7 @@ // This demo shows how to create bookmarks then link to them with internal hyperlinks // Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Bookmark, Document, Footer, HeadingLevel, InternalHyperlink, Packer, PageBreak, Paragraph, TextRun, PageRef } from "../build"; +import { Bookmark, Document, Footer, HeadingLevel, InternalHyperlink, Packer, PageBreak, Paragraph, TextRun, PageReference } from "../build"; const LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mi velit, convallis convallis scelerisque nec, faucibus nec leo. Phasellus at posuere mauris, tempus dignissim velit. Integer et tortor dolor. Duis auctor efficitur mattis. Vivamus ut metus accumsan tellus auctor sollicitudin venenatis et nibh. Cras quis massa ac metus fringilla venenatis. Proin rutrum mauris purus, ut suscipit magna consectetur id. Integer consectetur sollicitudin ante, vitae faucibus neque efficitur in. Praesent ultricies nibh lectus. Mauris pharetra id odio eget iaculis. Duis dictum, risus id pellentesque rutrum, lorem quam malesuada massa, quis ullamcorper turpis urna a diam. Cras vulputate metus vel massa porta ullamcorper. Etiam porta condimentum nulla nec tristique. Sed nulla urna, pharetra non tortor sed, sollicitudin molestie diam. Maecenas enim leo, feugiat eget vehicula id, sollicitudin vitae ante."; @@ -65,7 +65,7 @@ const doc = new Document({ ], }), new Paragraph({ - children: [new TextRun("The bookmark can be seen on page "), new PageRef("myAnchorId")], + children: [new TextRun("The bookmark can be seen on page "), new PageReference("myAnchorId")], }), ], }, diff --git a/docs/usage/hyperlinks.md b/docs/usage/hyperlinks.md index d49d9aa0a2..1d7c1355d5 100644 --- a/docs/usage/hyperlinks.md +++ b/docs/usage/hyperlinks.md @@ -44,7 +44,7 @@ You can also get the page number of the bookmark by creating a page reference to const paragraph = new Paragraph({ children: [ new TextRun("Chapter 1 can be seen on page "), - new PageRef("anchorForChapter1"), + new PageReference("anchorForChapter1"), ], }); ``` diff --git a/src/file/paragraph/links/pageref-field-instruction.spec.ts b/src/file/paragraph/links/pageref-field-instruction.spec.ts index de1a28863c..942c108be9 100644 --- a/src/file/paragraph/links/pageref-field-instruction.spec.ts +++ b/src/file/paragraph/links/pageref-field-instruction.spec.ts @@ -1,12 +1,12 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; -import { PageRefFieldInstruction } from "./pageref-field-instruction"; +import { PageReferenceFieldInstruction } from "./pageref-field-instruction"; -describe("PageRef field instruction", () => { +describe("PageReference field instruction", () => { describe("#constructor()", () => { it("should construct a pageref field instruction without options", () => { - const instruction = new PageRefFieldInstruction("anchor"); + const instruction = new PageReferenceFieldInstruction("anchor"); const tree = new Formatter().format(instruction); expect(tree).to.be.deep.equal({ diff --git a/src/file/paragraph/links/pageref-field-instruction.ts b/src/file/paragraph/links/pageref-field-instruction.ts index 198f5427c9..99be950d28 100644 --- a/src/file/paragraph/links/pageref-field-instruction.ts +++ b/src/file/paragraph/links/pageref-field-instruction.ts @@ -1,13 +1,13 @@ import { SpaceType } from "file/space-type"; import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; -import { IPageRefOptions } from "./pageref-properties"; +import { IPageReferenceOptions } from "./pageref-properties"; class TextAttributes extends XmlAttributeComponent<{ readonly space: SpaceType }> { protected readonly xmlKeys = { space: "xml:space" }; } -export class PageRefFieldInstruction extends XmlComponent { - constructor(bookmarkId: string, options: IPageRefOptions = {}) { +export class PageReferenceFieldInstruction extends XmlComponent { + constructor(bookmarkId: string, options: IPageReferenceOptions = {}) { super("w:instrText"); this.root.push(new TextAttributes({ space: SpaceType.PRESERVE })); diff --git a/src/file/paragraph/links/pageref-properties.ts b/src/file/paragraph/links/pageref-properties.ts index 963c5331d6..f557cfc322 100644 --- a/src/file/paragraph/links/pageref-properties.ts +++ b/src/file/paragraph/links/pageref-properties.ts @@ -1,6 +1,6 @@ // Options according to https://www.ecma-international.org/publications/standards/Ecma-376.htm (at Part 1, Page 1234) -export interface IPageRefOptions { +export interface IPageReferenceOptions { /** * \h option - Creates a hyperlink to the bookmarked paragraph. */ diff --git a/src/file/paragraph/links/pageref.spec.ts b/src/file/paragraph/links/pageref.spec.ts index 459429373b..c26c8c8632 100644 --- a/src/file/paragraph/links/pageref.spec.ts +++ b/src/file/paragraph/links/pageref.spec.ts @@ -1,12 +1,12 @@ import { expect } from "chai"; import { Formatter } from "export/formatter"; -import { PageRef } from "./pageref"; +import { PageReference } from "./pageref"; -describe("PageRef", () => { +describe("PageReference", () => { describe("#constructor()", () => { it("should construct a pageref without options", () => { - const pageref = new PageRef("some_bookmark"); + const pageref = new PageReference("some_bookmark"); const tree = new Formatter().format(pageref); expect(tree).to.be.deep.equal({ "w:r": [ @@ -40,8 +40,8 @@ describe("PageRef", () => { }); it("should construct a pageref with all the options", () => { - const pageref = new PageRef("some_bookmark", { hyperlink: true, useRelativePosition: true }); - const tree = new Formatter().format(pageref); + const pageReference = new PageReference("some_bookmark", { hyperlink: true, useRelativePosition: true }); + const tree = new Formatter().format(pageReference); expect(tree).to.be.deep.equal({ "w:r": [ { diff --git a/src/file/paragraph/links/pageref.ts b/src/file/paragraph/links/pageref.ts index 7cb6acfeec..b2f1880d2d 100644 --- a/src/file/paragraph/links/pageref.ts +++ b/src/file/paragraph/links/pageref.ts @@ -1,13 +1,13 @@ // See https://www.ecma-international.org/publications/standards/Ecma-376.htm (at Part 1, Page 1234) import { Begin, End } from "file/paragraph/run/field"; import { Run } from "../run"; -import { PageRefFieldInstruction } from "./pageref-field-instruction"; -import type { IPageRefOptions } from "./pageref-properties"; +import { PageReferenceFieldInstruction } from "./pageref-field-instruction"; +import type { IPageReferenceOptions } from "./pageref-properties"; -export class PageRef extends Run { - constructor(bookmarkId: string, options: IPageRefOptions = {}) { +export class PageReference extends Run { + constructor(bookmarkId: string, options: IPageReferenceOptions = {}) { super({ - children: [new Begin(true), new PageRefFieldInstruction(bookmarkId, options), new End()], + children: [new Begin(true), new PageReferenceFieldInstruction(bookmarkId, options), new End()], }); } } From da9ebbdb9a5a74d4c3f96dd9335a66fd0cc85d9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:00:59 +0000 Subject: [PATCH 45/66] Bump typedoc from 0.21.9 to 0.22.3 Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.9 to 0.22.3. - [Release notes](https://github.com/TypeStrong/TypeDoc/releases) - [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.9...v0.22.3) --- updated-dependencies: - dependency-name: typedoc dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 73 ++++++++--------------------------------------- package.json | 2 +- 2 files changed, 13 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc528fa5cf..3a432cac50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2507,27 +2507,6 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", - "dev": true, - "requires": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4", - "wordwrap": "^1.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - } - } - }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -3479,9 +3458,9 @@ "dev": true }, "marked": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.2.tgz", - "integrity": "sha512-TMJQQ79Z0e3rJYazY0tIoMsFzteUGw9fB3FD+gzuIT3zLuG9L9ckIvUfF51apdJkcqc208jJN2KbtPbOvXtbjA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.3.tgz", + "integrity": "sha512-4oIDhVSQ2s+xNCfek9OnZgCQR/WykGCom02JzIIvi4Pme+MIwPYqvGVW8CQWOXeoZu0TtVB6pTxIuoLm+dKqDA==", "dev": true }, "medium-zoom": { @@ -4369,12 +4348,6 @@ "fromentries": "^1.2.0" } }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, "prompt": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.2.0.tgz", @@ -4862,9 +4835,9 @@ } }, "shiki": { - "version": "0.9.8", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.8.tgz", - "integrity": "sha512-499zQUTjcNTVwwiaPrWldUTXIV3T9HZWxDwE82bY+9GE7P2uD6hpHUTXNbTof3iOG6WT+/062+OMbl0lDoG8WQ==", + "version": "0.9.10", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.10.tgz", + "integrity": "sha512-xeM7Oc6hY+6iW5O/T5hor8ul7mEprzyl5y4r5zthEHToQNw7MIhREMgU3r2gKDB0NaMLNrkcEQagudCdzE13Lg==", "dev": true, "requires": { "json5": "^2.2.0", @@ -5490,40 +5463,24 @@ } }, "typedoc": { - "version": "0.21.9", - "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.21.9.tgz", - "integrity": "sha512-VRo7aII4bnYaBBM1lhw4bQFmUcDQV8m8tqgjtc7oXl87jc1Slbhfw2X5MccfcR2YnEClHDWgsiQGgNB8KJXocA==", + "version": "0.22.3", + "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.22.3.tgz", + "integrity": "sha512-EOWf9Vf3Vfb/jzBzr87uoLybQw9fx3iyXLUcpQn9F2Ks1/ZJN9iGeBbYRU+VNqrWvV4T+aS7Ife7GFEJUf0ohQ==", "dev": true, "requires": { "glob": "^7.1.7", - "handlebars": "^4.7.7", "lunr": "^2.3.9", - "marked": "^3.0.2", - "minimatch": "^3.0.0", - "progress": "^2.0.3", - "shiki": "^0.9.8", - "typedoc-default-themes": "^0.12.10" + "marked": "^3.0.3", + "minimatch": "^3.0.4", + "shiki": "^0.9.10" } }, - "typedoc-default-themes": { - "version": "0.12.10", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz", - "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==", - "dev": true - }, "typescript": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", "dev": true }, - "uglify-js": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", - "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==", - "dev": true, - "optional": true - }, "unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", @@ -5886,12 +5843,6 @@ } } }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, "workerpool": { "version": "6.1.5", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", diff --git a/package.json b/package.json index 142e167301..c0163c82ad 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "tsconfig-paths": "^3.9.0", "tslint": "^6.1.3", "tslint-immutable": "^6.0.1", - "typedoc": "^0.21.1", + "typedoc": "^0.22.3", "typescript": "4.4.2", "webpack": "^5.28.0", "webpack-cli": "^4.6.0" From 996594da9bdf91912faf5b8158e0d55d39aaf080 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Thu, 16 Sep 2021 13:01:47 +0300 Subject: [PATCH 46/66] Moving numbering from IParagraphPropertiesOptions to IParagraphStylePropertiesOptions --- src/file/paragraph/properties.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/file/paragraph/properties.ts b/src/file/paragraph/properties.ts index bafac51776..6a2537f839 100644 --- a/src/file/paragraph/properties.ts +++ b/src/file/paragraph/properties.ts @@ -24,6 +24,12 @@ export interface IParagraphStylePropertiesOptions { readonly keepNext?: boolean; readonly keepLines?: boolean; readonly outlineLevel?: number; + readonly numbering?: { + readonly reference: string; + readonly level: number; + readonly instance?: number; + readonly custom?: boolean; + }; } export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOptions { @@ -40,12 +46,6 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp readonly bullet?: { readonly level: number; }; - readonly numbering?: { - readonly reference: string; - readonly level: number; - readonly instance?: number; - readonly custom?: boolean; - }; readonly shading?: IShadingAttributesProperties; readonly widowControl?: boolean; readonly frame?: IFrameOptions; From 75290aeaf5ed04bb00f4df3777468d466bc4a775 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Thu, 16 Sep 2021 13:03:34 +0300 Subject: [PATCH 47/66] Adding numberingReplacer for styles.xml at next-compiler.ts --- src/export/packer/next-compiler.ts | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/export/packer/next-compiler.ts b/src/export/packer/next-compiler.ts index 3311301a61..24cf9d3186 100644 --- a/src/export/packer/next-compiler.ts +++ b/src/export/packer/next-compiler.ts @@ -123,19 +123,23 @@ export class Compiler { path: "word/document.xml", }, Styles: { - data: xml( - this.formatter.format(file.Styles, { - viewWrapper: file.Document, - file, - }), - { - indent: prettify, - declaration: { - standalone: "yes", - encoding: "UTF-8", + data: (() => { + const xmlStyles = xml( + this.formatter.format(file.Styles, { + viewWrapper: file.Document, + file, + }), + { + indent: prettify, + declaration: { + standalone: "yes", + encoding: "UTF-8", + }, }, - }, - ), + ); + const referencedXmlStyles = this.numberingReplacer.replace(xmlStyles, file.Numbering.ConcreteNumbering); + return referencedXmlStyles; + })(), path: "word/styles.xml", }, Properties: { From bc1bca762e971014d37645d834525405e1439046 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Thu, 16 Sep 2021 13:21:21 +0300 Subject: [PATCH 48/66] Demo on numbering attaching to custom styles --- demo/11-declaritive-styles-2.ts | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/demo/11-declaritive-styles-2.ts b/demo/11-declaritive-styles-2.ts index 3881e2f258..1035faab45 100644 --- a/demo/11-declaritive-styles-2.ts +++ b/demo/11-declaritive-styles-2.ts @@ -15,6 +15,7 @@ import { TableRow, TabStopPosition, UnderlineType, + LevelFormat, } from "../build"; const table = new Table({ @@ -51,6 +52,19 @@ const table = new Table({ }); const doc = new Document({ + numbering:{ + config:[{ + reference: 'ref1', + levels: [ + { + level: 0, + format: LevelFormat.DECIMAL, + text: '%1)', + start: 50, + } + ], + }] + }, styles: { default: { heading1: { @@ -155,6 +169,28 @@ const doc = new Document({ spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, }, }, + { + id: "numberedPara", + name: "Numbered Para", + basedOn: "Normal", + next: "Normal", + quickFormat: true, + run: { + font: "Calibri", + size: 26, + bold: true, + }, + paragraph: { + spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, + rightTabStop: TabStopPosition.MAX, + leftTabStop: 453.543307087, + numbering : { + reference: 'ref1', + instance: 0, + level: 0, + } + }, + }, ], }, sections: [ @@ -260,6 +296,14 @@ const doc = new Document({ text: "Test 2", style: "normalPara2", }), + new Paragraph({ + text: "Numbered paragraph that has numbering attached to custom styles", + style: "numberedPara", + }), + new Paragraph({ + text: "Numbered para would show up in the styles pane at Word", + style: "numberedPara", + }), ], }, ], From ab5c5c0fb761abb3095ed12171685c3e0c791c1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 11:01:11 +0000 Subject: [PATCH 49/66] Bump prettier from 2.3.2 to 2.4.1 Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc528fa5cf..c47962b48f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4338,9 +4338,9 @@ "dev": true }, "prettier": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", - "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", "dev": true }, "prismjs": { From 607087d256275c7164853f2b84ea69e1e9a5b56e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 11:01:16 +0000 Subject: [PATCH 50/66] Bump @types/node from 16.7.13 to 16.9.2 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.13 to 16.9.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c47962b48f..ef3cd440e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -604,9 +604,9 @@ "dev": true }, "@types/node": { - "version": "16.7.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.13.tgz", - "integrity": "sha512-pLUPDn+YG3FYEt/pHI74HmnJOWzeR+tOIQzUx93pi9M7D8OE7PSLr97HboXwk5F+JS+TLtWuzCOW97AHjmOXXA==" + "version": "16.9.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.2.tgz", + "integrity": "sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w==" }, "@types/request": { "version": "2.48.6", From a1fbbde149eb7c1da992f36246ea4c8e76fe44c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 11:01:51 +0000 Subject: [PATCH 51/66] Bump webpack from 5.52.0 to 5.53.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.52.0 to 5.53.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.52.0...v5.53.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 56 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index c47962b48f..eb1f9e0a96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1231,9 +1231,9 @@ }, "dependencies": { "colorette": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", - "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", "dev": true } } @@ -1325,9 +1325,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001255", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001255.tgz", - "integrity": "sha512-F+A3N9jTZL882f/fg/WWVnKSu6IOo3ueLz4zwaOPbPYHNmM/ZaDUyzyJwS1mZhX7Ex5jqTyW599Gdelh5PDYLQ==", + "version": "1.0.30001258", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001258.tgz", + "integrity": "sha512-RBByOG6xWXUp0CR2/WU2amXz3stjKpSl5J1xU49F1n2OxD//uBZO4wCKUiG+QMGf7CHGfDDcqoKriomoGVxTeA==", "dev": true }, "caseless": { @@ -1948,9 +1948,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.830", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.830.tgz", - "integrity": "sha512-gBN7wNAxV5vl1430dG+XRcQhD4pIeYeak6p6rjdCtlz5wWNwDad8jwvphe5oi1chL5MV6RNRikfffBBiFuj+rQ==", + "version": "1.3.842", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.842.tgz", + "integrity": "sha512-P/nDMPIYdb2PyqCQwhTXNi5JFjX1AsDVR0y6FrHw752izJIAJ+Pn5lugqyBq4tXeRSZBMBb2ZGvRGB1djtELEQ==", "dev": true }, "emoji-regex": { @@ -3045,9 +3045,9 @@ } }, "jest-worker": { - "version": "27.1.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.1.0.tgz", - "integrity": "sha512-mO4PHb2QWLn9yRXGp7rkvXLAYuxwhq1ZYUo0LoDhg8wqvv4QizP1ZWEJOeolgbEgAWZLIEU0wsku8J+lGWfBhg==", + "version": "27.2.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.0.tgz", + "integrity": "sha512-laB0ZVIBz+voh/QQy9dmUuuDsadixeerrKqyVpgPz+CCWiOYjOBabUXHIXZhsdvkWbLqSHbgkAHWl5cg24Q6RA==", "dev": true, "requires": { "@types/node": "*", @@ -4916,9 +4916,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -5126,14 +5126,14 @@ "dev": true }, "terser": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.2.tgz", - "integrity": "sha512-0Omye+RD4X7X69O0eql3lC4Heh/5iLj3ggxR/B5ketZLOtLiOqukUgjw3q4PDnNQbsrkKr3UMypqStQG3XKRvw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.8.0.tgz", + "integrity": "sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A==", "dev": true, "requires": { "commander": "^2.20.0", "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map-support": "~0.5.20" }, "dependencies": { "commander": { @@ -5151,9 +5151,9 @@ } }, "terser-webpack-plugin": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.3.tgz", - "integrity": "sha512-eDbuaDlXhVaaoKuLD3DTNTozKqln6xOG6Us0SzlKG5tNlazG+/cdl8pm9qiF1Di89iWScTI0HcO+CDcf2dkXiw==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz", + "integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==", "dev": true, "requires": { "jest-worker": "^27.0.6", @@ -5686,9 +5686,9 @@ } }, "webpack": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.52.0.tgz", - "integrity": "sha512-yRZOat8jWGwBwHpco3uKQhVU7HYaNunZiJ4AkAVQkPCUGoZk/tiIXiwG+8HIy/F+qsiZvSOa+GLQOj3q5RKRYg==", + "version": "5.53.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.53.0.tgz", + "integrity": "sha512-RZ1Z3z3ni44snoWjfWeHFyzvd9HMVYDYC5VXmlYUT6NWgEOWdCNpad5Fve2CzzHoRED7WtsKe+FCyP5Vk4pWiQ==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -5780,9 +5780,9 @@ } }, "webpack-sources": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.0.tgz", - "integrity": "sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz", + "integrity": "sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA==", "dev": true }, "which": { From 755895ebef87aac1cbfca6f0ed276d8fb23686d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 12:12:09 +0000 Subject: [PATCH 52/66] Bump minimist from 1.2.0 to 1.2.5 Bumps [minimist](https://github.com/substack/minimist) from 1.2.0 to 1.2.5. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.0...1.2.5) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2f88dc395d..3686ba2d47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,12 +90,6 @@ "minimist": "^1.2.5" } }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -3104,14 +3098,6 @@ "dev": true, "requires": { "minimist": "^1.2.5" - }, - "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - } } }, "jsonfile": { @@ -3542,9 +3528,9 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mocha": { @@ -5379,12 +5365,6 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", From 9555ddd648d4b1e51a93b5c5b3b6a58750eb2c1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 12:13:28 +0000 Subject: [PATCH 53/66] Bump typescript from 4.4.2 to 4.4.3 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.2 to 4.4.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.2...v4.4.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2f88dc395d..7d74db4437 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5476,9 +5476,9 @@ } }, "typescript": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", - "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "dev": true }, "unique-string": { diff --git a/package.json b/package.json index c0163c82ad..95d3d4ab84 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "tslint": "^6.1.3", "tslint-immutable": "^6.0.1", "typedoc": "^0.22.3", - "typescript": "4.4.2", + "typescript": "4.4.3", "webpack": "^5.28.0", "webpack-cli": "^4.6.0" }, From a2566e92d2ced018ffe4dda28d0fdda2bc4b6aa4 Mon Sep 17 00:00:00 2001 From: askoufis Date: Sat, 18 Sep 2021 22:42:56 +1000 Subject: [PATCH 54/66] Fix error message typos --- src/import-dotx/import-dotx.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/import-dotx/import-dotx.ts b/src/import-dotx/import-dotx.ts index 61340bf79e..74a63b8ea4 100644 --- a/src/import-dotx/import-dotx.ts +++ b/src/import-dotx/import-dotx.ts @@ -215,7 +215,7 @@ export class ImportDotx { } const headers = headersXmlArray.map((item) => { if (item._attributes === undefined) { - throw Error("header referecne element has no attributes"); + throw Error("header reference element has no attributes"); } return { type: item._attributes["w:type"] as HeaderFooterReferenceType, @@ -235,7 +235,7 @@ export class ImportDotx { const footers = footersXmlArray.map((item) => { if (item._attributes === undefined) { - throw Error("footer referecne element has no attributes"); + throw Error("footer reference element has no attributes"); } return { type: item._attributes["w:type"] as HeaderFooterReferenceType, From 23fd3b483f5800ec605bb5b76717d94553d28598 Mon Sep 17 00:00:00 2001 From: askoufis Date: Sat, 18 Sep 2021 22:58:19 +1000 Subject: [PATCH 55/66] Add API for specifying columns with different widths --- .../section-properties/properties/column.ts | 26 +++++++++++++ .../properties/columns.spec.ts | 37 +++++++++++++++++++ .../section-properties/properties/columns.ts | 8 +++- .../section-properties/properties/index.ts | 1 + 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/file/document/body/section-properties/properties/column.ts create mode 100644 src/file/document/body/section-properties/properties/columns.spec.ts diff --git a/src/file/document/body/section-properties/properties/column.ts b/src/file/document/body/section-properties/properties/column.ts new file mode 100644 index 0000000000..943723a6f3 --- /dev/null +++ b/src/file/document/body/section-properties/properties/column.ts @@ -0,0 +1,26 @@ +import { twipsMeasureValue } from "file/values"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; + +export interface IColumnAttributes { + readonly width: number | string; + readonly space?: number | string; +} + +export class ColumnAttributes extends XmlAttributeComponent { + protected readonly xmlKeys = { + width: 'w:w', + space: 'w:space', + } +} + +export class Column extends XmlComponent { + constructor({width, space}: IColumnAttributes) { + super("w:col"); + this.root.push( + new ColumnAttributes({ + width: twipsMeasureValue(width), + space: space === undefined ? undefined : twipsMeasureValue(space), + }) + ) + } +} diff --git a/src/file/document/body/section-properties/properties/columns.spec.ts b/src/file/document/body/section-properties/properties/columns.spec.ts new file mode 100644 index 0000000000..694d917e6e --- /dev/null +++ b/src/file/document/body/section-properties/properties/columns.spec.ts @@ -0,0 +1,37 @@ +import { expect } from "chai"; +import { Columns } from "."; +import { Formatter } from "export/formatter"; +import { Column } from "./column"; + +describe("Columns", () => { + describe("#constructor()", () => { + it("should create columns of equal width if equalWidth is true", () => { + const columns = new Columns({ count: 3, space: 720 }); + const tree = new Formatter().format(columns); + + expect(tree["w:cols"]).to.deep.equal({ _attr: { "w:num": 3, "w:space": 720 } }); + }); + + it("should ignore individual column attributes if equalWidth is true", () => { + const unequalColumns = [new Column({ width: 1000, space: 400 }), new Column({ width: 2000 })]; + const columns = new Columns({ count: 3, space: 720, equalWidth: true, children: unequalColumns }); + const tree = new Formatter().format(columns); + + expect(tree).to.deep.equal({ "w:cols": { _attr: { "w:num": 3, "w:space": 720, "w:equalWidth": true } } }); + }); + + it("should have column children if equalWidth is false and individual columns are provided", () => { + const unequalColumns = [new Column({ width: 1000, space: 400 }), new Column({ width: 2000 })]; + const columns = new Columns({ count: 3, space: 720, equalWidth: false, children: unequalColumns }); + const tree = new Formatter().format(columns); + + expect(tree).to.deep.equal({ + "w:cols": [ + { _attr: { "w:num": 3, "w:space": 720, "w:equalWidth": false } }, + { "w:col": { _attr: { "w:space": 400, "w:w": 1000 } } }, + { "w:col": { _attr: { "w:w": 2000 } } }, + ], + }); + }); + }); +}); diff --git a/src/file/document/body/section-properties/properties/columns.ts b/src/file/document/body/section-properties/properties/columns.ts index 395df4ecae..e418b0ff1f 100644 --- a/src/file/document/body/section-properties/properties/columns.ts +++ b/src/file/document/body/section-properties/properties/columns.ts @@ -1,5 +1,6 @@ import { decimalNumber, twipsMeasureValue } from "file/values"; import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; +import { Column } from "./column"; // // @@ -15,6 +16,7 @@ export interface IColumnsAttributes { readonly count?: number; readonly separate?: boolean; readonly equalWidth?: boolean; + readonly children?: Column[]; } export class ColumnsAttributes extends XmlAttributeComponent { @@ -27,7 +29,7 @@ export class ColumnsAttributes extends XmlAttributeComponent } export class Columns extends XmlComponent { - constructor({ space, count, separate, equalWidth }: IColumnsAttributes) { + constructor({ space, count, separate, equalWidth, children }: IColumnsAttributes) { super("w:cols"); this.root.push( new ColumnsAttributes({ @@ -37,5 +39,9 @@ export class Columns extends XmlComponent { equalWidth, }), ); + + if (!equalWidth && children) { + children.forEach((column) => this.addChildElement(column)); + } } } diff --git a/src/file/document/body/section-properties/properties/index.ts b/src/file/document/body/section-properties/properties/index.ts index 089a005744..3349b2595f 100644 --- a/src/file/document/body/section-properties/properties/index.ts +++ b/src/file/document/body/section-properties/properties/index.ts @@ -1,3 +1,4 @@ +export * from "./column"; export * from "./columns"; export * from "./doc-grid"; // export * from "./header-reference"; From 3a795401d12299c6752d16ad06aa0fc64dfc546e Mon Sep 17 00:00:00 2001 From: askoufis Date: Sat, 18 Sep 2021 23:09:45 +1000 Subject: [PATCH 56/66] Add demo file for columns with different widths --- demo/69-different-width-columns.ts | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 demo/69-different-width-columns.ts diff --git a/demo/69-different-width-columns.ts b/demo/69-different-width-columns.ts new file mode 100644 index 0000000000..883391c195 --- /dev/null +++ b/demo/69-different-width-columns.ts @@ -0,0 +1,31 @@ +// Sections with multiple columns +// Import from 'docx' rather than '../build' if you install from npm +import * as fs from "fs"; +import { Column, Document, Packer, Paragraph } from "../build"; + +const doc = new Document({ + sections: [ + { + properties: { + column: { + count: 2, + space: 720, + equalWidth: false, + children: [new Column({ width: 2880, space: 720 }), new Column({ width: 5760 })], + }, + }, + children: [ + new Paragraph( + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", + ), + new Paragraph( + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", + ), + ], + }, + ], +}); + +Packer.toBuffer(doc).then((buffer) => { + fs.writeFileSync("My Document.docx", buffer); +}); From eec084767ff7357c06a21db329070509d15de898 Mon Sep 17 00:00:00 2001 From: askoufis Date: Sat, 18 Sep 2021 23:14:13 +1000 Subject: [PATCH 57/66] Fix lint and style errors --- .../body/section-properties/properties/column.ts | 12 ++++++------ .../section-properties/properties/columns.spec.ts | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/file/document/body/section-properties/properties/column.ts b/src/file/document/body/section-properties/properties/column.ts index 943723a6f3..d1f48a7aa5 100644 --- a/src/file/document/body/section-properties/properties/column.ts +++ b/src/file/document/body/section-properties/properties/column.ts @@ -8,19 +8,19 @@ export interface IColumnAttributes { export class ColumnAttributes extends XmlAttributeComponent { protected readonly xmlKeys = { - width: 'w:w', - space: 'w:space', - } + width: "w:w", + space: "w:space", + }; } export class Column extends XmlComponent { - constructor({width, space}: IColumnAttributes) { + constructor({ width, space }: IColumnAttributes) { super("w:col"); this.root.push( new ColumnAttributes({ width: twipsMeasureValue(width), space: space === undefined ? undefined : twipsMeasureValue(space), - }) - ) + }), + ); } } diff --git a/src/file/document/body/section-properties/properties/columns.spec.ts b/src/file/document/body/section-properties/properties/columns.spec.ts index 694d917e6e..596b30bdb1 100644 --- a/src/file/document/body/section-properties/properties/columns.spec.ts +++ b/src/file/document/body/section-properties/properties/columns.spec.ts @@ -1,7 +1,8 @@ import { expect } from "chai"; -import { Columns } from "."; + import { Formatter } from "export/formatter"; -import { Column } from "./column"; + +import { Column, Columns } from "."; describe("Columns", () => { describe("#constructor()", () => { From 5609b11188cd42c02021fb073af3e6dab4994f7c Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 18 Sep 2021 18:07:59 +0100 Subject: [PATCH 58/66] Use correct value for height rule --- src/file/paragraph/frame/frame-properties.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/file/paragraph/frame/frame-properties.ts b/src/file/paragraph/frame/frame-properties.ts index 13a7e72745..4a6b5a5505 100644 --- a/src/file/paragraph/frame/frame-properties.ts +++ b/src/file/paragraph/frame/frame-properties.ts @@ -1,6 +1,7 @@ // http://officeopenxml.com/WPparagraph-textFrames.php import { HorizontalPositionAlign, VerticalPositionAlign } from "file/shared/alignment"; import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; +import { HeightRule } from "/file"; export enum DropCapType { NONE = "none", @@ -42,7 +43,7 @@ export interface IFrameOptions { readonly horizontal: number; readonly vertical: number; }; - readonly rule?: number; + readonly rule?: HeightRule; readonly alignment: { readonly x: HorizontalPositionAlign; readonly y: VerticalPositionAlign; @@ -62,7 +63,7 @@ export class FramePropertiesAttributes extends XmlAttributeComponent<{ readonly anchorVertical?: FrameAnchorType; readonly spaceHorizontal?: number; readonly spaceVertical?: number; - readonly rule?: number; + readonly rule?: HeightRule; readonly alignmentX?: HorizontalPositionAlign; readonly alignmentY?: VerticalPositionAlign; }> { From 5ca97ce96fb7e6154bbafa862e496b9a477ce96b Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 18 Sep 2021 18:10:44 +0100 Subject: [PATCH 59/66] Remove @types/jszip --- package-lock.json | 10 +--------- package.json | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a2d24777b..230aa4d750 100644 --- a/package-lock.json +++ b/package-lock.json @@ -583,14 +583,6 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, - "@types/jszip": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/@types/jszip/-/jszip-3.4.1.tgz", - "integrity": "sha512-TezXjmf3lj+zQ651r6hPqvSScqBLvyPI9FxdXBqpEwBijNGQ2NXpaFW/7joGzveYkKQUil7iiDHLo6LV71Pc0A==", - "requires": { - "jszip": "*" - } - }, "@types/mocha": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", @@ -3521,7 +3513,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" diff --git a/package.json b/package.json index 95d3d4ab84..816cfcb96d 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ ], "types": "./build/index.d.ts", "dependencies": { - "@types/jszip": "^3.1.4", "@types/node": "^16.0.0", "jszip": "^3.1.5", "nanoid": "^3.1.20", From 7944a7064e3ae55652567342d004c7a931896dd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Sep 2021 11:01:32 +0000 Subject: [PATCH 60/66] Bump @types/node from 16.9.2 to 16.9.4 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.9.2 to 16.9.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 230aa4d750..cd624f80cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -590,9 +590,9 @@ "dev": true }, "@types/node": { - "version": "16.9.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.2.tgz", - "integrity": "sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w==" + "version": "16.9.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.4.tgz", + "integrity": "sha512-KDazLNYAGIuJugdbULwFZULF9qQ13yNWEBFnfVpqlpgAAo6H/qnM9RjBgh0A0kmHf3XxAKLdN5mTIng9iUvVLA==" }, "@types/request": { "version": "2.48.6", From 5c08b889b16729e81fa64294b640860f538f3854 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Sep 2021 11:01:50 +0000 Subject: [PATCH 61/66] Bump typedoc from 0.22.3 to 0.22.4 Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.3 to 0.22.4. - [Release notes](https://github.com/TypeStrong/TypeDoc/releases) - [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.3...v0.22.4) --- updated-dependencies: - dependency-name: typedoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 230aa4d750..20f815a50a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3083,14 +3083,11 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true }, "jsonfile": { "version": "4.0.0", @@ -3436,9 +3433,9 @@ "dev": true }, "marked": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.3.tgz", - "integrity": "sha512-4oIDhVSQ2s+xNCfek9OnZgCQR/WykGCom02JzIIvi4Pme+MIwPYqvGVW8CQWOXeoZu0TtVB6pTxIuoLm+dKqDA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.4.tgz", + "integrity": "sha512-jBo8AOayNaEcvBhNobg6/BLhdsK3NvnKWJg33MAAPbvTWiG4QBn9gpW1+7RssrKu4K1dKlN+0goVQwV41xEfOA==", "dev": true }, "medium-zoom": { @@ -4813,12 +4810,12 @@ } }, "shiki": { - "version": "0.9.10", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.10.tgz", - "integrity": "sha512-xeM7Oc6hY+6iW5O/T5hor8ul7mEprzyl5y4r5zthEHToQNw7MIhREMgU3r2gKDB0NaMLNrkcEQagudCdzE13Lg==", + "version": "0.9.11", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.11.tgz", + "integrity": "sha512-tjruNTLFhU0hruCPoJP0y+B9LKOmcqUhTpxn7pcJB3fa+04gFChuEmxmrUfOJ7ZO6Jd+HwMnDHgY3lv3Tqonuw==", "dev": true, "requires": { - "json5": "^2.2.0", + "jsonc-parser": "^3.0.0", "onigasm": "^2.2.5", "vscode-textmate": "5.2.0" } @@ -5435,16 +5432,16 @@ } }, "typedoc": { - "version": "0.22.3", - "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.22.3.tgz", - "integrity": "sha512-EOWf9Vf3Vfb/jzBzr87uoLybQw9fx3iyXLUcpQn9F2Ks1/ZJN9iGeBbYRU+VNqrWvV4T+aS7Ife7GFEJUf0ohQ==", + "version": "0.22.4", + "resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.22.4.tgz", + "integrity": "sha512-M/a8NnPxq3/iZNNVjzFCK5gu4m//HTJIPbSS0JQVbkHJPP9wyepR12agylWTSqeVZe0xsbidVtO26+PP7iD/jw==", "dev": true, "requires": { "glob": "^7.1.7", "lunr": "^2.3.9", - "marked": "^3.0.3", + "marked": "^3.0.4", "minimatch": "^3.0.4", - "shiki": "^0.9.10" + "shiki": "^0.9.11" } }, "typescript": { From 01bc6093ddef3a2f816bf72bbd35ed9853c7b661 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Mon, 20 Sep 2021 21:58:07 +0300 Subject: [PATCH 62/66] Separate paragraph style options interface for level --- src/file/numbering/level.ts | 4 ++-- src/file/paragraph/properties.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/file/numbering/level.ts b/src/file/numbering/level.ts index 93fcbe6f67..d35c742c16 100644 --- a/src/file/numbering/level.ts +++ b/src/file/numbering/level.ts @@ -2,7 +2,7 @@ import { decimalNumber } from "file/values"; import { Attributes, NumberValueElement, XmlAttributeComponent, XmlComponent } from "file/xml-components"; import { AlignmentType } from "../paragraph/formatting"; -import { IParagraphStylePropertiesOptions, ParagraphProperties } from "../paragraph/properties"; +import { ILevelParagraphStylePropertiesOptions, ParagraphProperties } from "../paragraph/properties"; import { IRunStylePropertiesOptions, RunProperties } from "../paragraph/run/properties"; export enum LevelFormat { @@ -88,7 +88,7 @@ export interface ILevelsOptions { readonly suffix?: LevelSuffix; readonly style?: { readonly run?: IRunStylePropertiesOptions; - readonly paragraph?: IParagraphStylePropertiesOptions; + readonly paragraph?: ILevelParagraphStylePropertiesOptions; }; } diff --git a/src/file/paragraph/properties.ts b/src/file/paragraph/properties.ts index 6a2537f839..bb055bc893 100644 --- a/src/file/paragraph/properties.ts +++ b/src/file/paragraph/properties.ts @@ -13,7 +13,7 @@ import { NumberProperties } from "./formatting/unordered-list"; import { FrameProperties, IFrameOptions } from "./frame/frame-properties"; import { OutlineLevel } from "./links"; -export interface IParagraphStylePropertiesOptions { +export interface ILevelParagraphStylePropertiesOptions { readonly alignment?: AlignmentType; readonly thematicBreak?: boolean; readonly contextualSpacing?: boolean; @@ -24,6 +24,9 @@ export interface IParagraphStylePropertiesOptions { readonly keepNext?: boolean; readonly keepLines?: boolean; readonly outlineLevel?: number; +} + +export interface IParagraphStylePropertiesOptions extends ILevelParagraphStylePropertiesOptions { readonly numbering?: { readonly reference: string; readonly level: number; From 9991700701afdb2924ea09cd3cc19adae9465c08 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Sep 2021 21:38:30 +0000 Subject: [PATCH 63/66] Bump prismjs from 1.24.0 to 1.25.0 Bumps [prismjs](https://github.com/PrismJS/prism) from 1.24.0 to 1.25.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.24.0...v1.25.0) --- updated-dependencies: - dependency-name: prismjs dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 230aa4d750..d4b96d1b3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4301,9 +4301,9 @@ "dev": true }, "prismjs": { - "version": "1.24.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.0.tgz", - "integrity": "sha512-SqV5GRsNqnzCL8k5dfAjCNhUrF3pR0A9lTDSCUZeh/LIshheXJEaP0hwLz2t4XHivd2J/v2HR+gRnigzeKe3cQ==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz", + "integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg==", "dev": true }, "process": { From 18791c99f567be2257c7eb9b0ccf2620826afaf8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 11:01:49 +0000 Subject: [PATCH 64/66] Bump ts-loader from 9.2.5 to 9.2.6 Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.5 to 9.2.6. - [Release notes](https://github.com/TypeStrong/ts-loader/releases) - [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.5...v9.2.6) --- updated-dependencies: - dependency-name: ts-loader dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 230aa4d750..d601fc369d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5183,9 +5183,9 @@ } }, "ts-loader": { - "version": "9.2.5", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.5.tgz", - "integrity": "sha512-al/ATFEffybdRMUIr5zMEWQdVnCGMUA9d3fXJ8dBVvBlzytPvIszoG9kZoR+94k6/i293RnVOXwMaWbXhNy9pQ==", + "version": "9.2.6", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz", + "integrity": "sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw==", "dev": true, "requires": { "chalk": "^4.1.0", From 439f8ff4bc3e1d4dbe240bf874435a604b104e9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 11:02:06 +0000 Subject: [PATCH 65/66] Bump @types/chai from 4.2.21 to 4.2.22 Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.21 to 4.2.22. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai) --- updated-dependencies: - dependency-name: "@types/chai" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 230aa4d750..7d61568c18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -534,9 +534,9 @@ "dev": true }, "@types/chai": { - "version": "4.2.21", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.21.tgz", - "integrity": "sha512-yd+9qKmJxm496BOV9CMNaey8TWsikaZOwMRwPHQIjcOJM9oV+fi9ZMNw3JsVnbEEbo2gRTDnGEBv8pjyn67hNg==", + "version": "4.2.22", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz", + "integrity": "sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ==", "dev": true }, "@types/color-name": { From d521e20c0ee6dc054b91e9da2f98f6efa5181241 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 11:02:42 +0000 Subject: [PATCH 66/66] Bump @types/sinon from 10.0.2 to 10.0.3 Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 10.0.2 to 10.0.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon) --- updated-dependencies: - dependency-name: "@types/sinon" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 230aa4d750..162031868b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -630,23 +630,12 @@ } }, "@types/sinon": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.2.tgz", - "integrity": "sha512-BHn8Bpkapj8Wdfxvh2jWIUoaYB/9/XhsL0oOvBfRagJtKlSl9NWPcFOz2lRukI9szwGxFtYZCTejJSqsGDbdmw==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.3.tgz", + "integrity": "sha512-XUaFuUOQ3A/r6gS1qCU/USMleascaqGeQpGR1AZ5JdRtBPlzijRzKsik1TuGzvdtPA0mdq42JqaJmJ+Afg1LJg==", "dev": true, "requires": { "@sinonjs/fake-timers": "^7.1.0" - }, - "dependencies": { - "@sinonjs/fake-timers": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz", - "integrity": "sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - } } }, "@types/tough-cookie": {