From 36a18c5af3b8574c369de5fb264eb964807f2c80 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Mon, 26 Jul 2021 09:55:33 +0300 Subject: [PATCH 01/46] 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/46] 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/46] 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/46] 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/46] 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/46] 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 e1c777738ba6233c831f2ab816eea8573285fb99 Mon Sep 17 00:00:00 2001 From: Graham Charles Date: Tue, 27 Jul 2021 22:11:46 -0700 Subject: [PATCH 07/46] Update tab-stops.md corrected docs to reflect declarative style for tab stops; removed tab() and bold() --- docs/usage/tab-stops.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/usage/tab-stops.md b/docs/usage/tab-stops.md index 23b13905cb..5628095a09 100644 --- a/docs/usage/tab-stops.md +++ b/docs/usage/tab-stops.md @@ -4,15 +4,15 @@ !> **Note**: The unit of measurement for a tab stop is in [DXA](https://stackoverflow.com/questions/14360183/default-wordml-unit-measurement-pixel-or-point-or-inches) -![Word 2013 Tabs](http://www.teachucomp.com/wp-content/uploads/blog-4-22-2015-UsingTabStopsInWord-1024x577.png "Word 2013 Tab Stops") +![Word 2013 Tabs](https://support.content.office.net/en-us/media/d75ca75d-9fe9-4d46-9a8b-4534c13acbc5.png "Word 2013 Tab Stops") -Simply call the relevant methods on the paragraph listed below. Then just add a `tab()` method call to a text object. Adding multiple `tabStops` will mean you would have to chain `tab()` until the desired `tabStop` is selected. Example is shown below. +Simply declare the tab stops on the paragraph, as shown below. Use the tab character `\t` to indicate the tab position within the `text` property of a `TextRun`. Adding multiple `tabStops` will mean you can add additional `\t` characters until the desired `tabStop` is selected. Example is shown below. ## Example ```ts const paragraph = new Paragraph({ - children: [new TextRun("Hey everyone").bold(), new TextRun(\t"11th November 1999")], + children: [new TextRun({ text: "Hey everyone", bold: true}, new TextRun("\t11th November 1999")], tabStops: [ { type: TabStopType.RIGHT, @@ -26,7 +26,7 @@ The example above will create a left aligned text, and a right aligned text on t ```ts const paragraph = new Paragraph({ - children: [new TextRun("Second tab stop here I come!")], + children: [new TextRun("\t\tSecond tab stop here I come!")], tabStops: [ { type: TabStopType.RIGHT, @@ -46,7 +46,7 @@ You can add multiple tab stops of the same `type` too. ```ts const paragraph = new Paragraph({ - children: [new TextRun("Multiple tab stops!")], + children: [new TextRun("Multiple \ttab \tstops!")], tabStops: [ { type: TabStopType.RIGHT, From 2ccf27162e59d59ea5b4268b8e345deb05209540 Mon Sep 17 00:00:00 2001 From: Graham Charles Date: Tue, 27 Jul 2021 22:16:21 -0700 Subject: [PATCH 08/46] updated tab stops docs --- docs/usage/tab-stops.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/tab-stops.md b/docs/usage/tab-stops.md index 5628095a09..5c859a1bac 100644 --- a/docs/usage/tab-stops.md +++ b/docs/usage/tab-stops.md @@ -12,7 +12,7 @@ Simply declare the tab stops on the paragraph, as shown below. Use the tab chara ```ts const paragraph = new Paragraph({ - children: [new TextRun({ text: "Hey everyone", bold: true}, new TextRun("\t11th November 1999")], + children: [new TextRun({ text: "Hey everyone", bold: true}), new TextRun("\t11th November 1999")], tabStops: [ { type: TabStopType.RIGHT, 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 09/46] 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 10/46] 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 11/46] 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 12/46] 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 13/46] 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 14/46] 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 15/46] 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 16/46] 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 17/46] 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 18/46] 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 19/46] 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 20/46] 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 21/46] 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 22/46] 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 23/46] 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 24/46] 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 25/46] 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 26/46] 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 27/46] 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 28/46] 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 29/46] 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 30/46] 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 31/46] 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 32/46] 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 33/46] 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 34/46] 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 35/46] 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 36/46] 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 37/46] 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 38/46] 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 39/46] 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 40/46] 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 41/46] 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 42/46] 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 43/46] 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 44/46] 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 45/46] 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 46/46] 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()], }); } }