Compare commits
137 Commits
Author | SHA1 | Date | |
---|---|---|---|
8583aa0632 | |||
7682745402 | |||
2eb0b537f1 | |||
6d3ebf90c1 | |||
ed8b4180f8 | |||
4ad34920b7 | |||
ede6a32537 | |||
078d4908c2 | |||
c9135953f7 | |||
5259f30752 | |||
2223cfb6b2 | |||
345ce6db6d | |||
7accb91195 | |||
2bb9a78d2f | |||
f303306935 | |||
c82ad9711b | |||
41acda6a06 | |||
5d7ef7ab58 | |||
29f7f1a240 | |||
6b0d777bd7 | |||
455e66f74d | |||
36af1643a4 | |||
3a022c4d2a | |||
e50a6edbed | |||
31728ea253 | |||
5289ea8e1c | |||
d808b287a7 | |||
5ad7fd8a15 | |||
74fbc715e9 | |||
1385a5d702 | |||
e08ad990a8 | |||
35d987430a | |||
bb48068408 | |||
75d62723b6 | |||
02222c8681 | |||
c3800c4559 | |||
0e033131b2 | |||
0be6f31611 | |||
e8a8b73ad0 | |||
953c6806ce | |||
1cf68c696e | |||
6d354674b2 | |||
e598faad28 | |||
137b9a06cb | |||
c43f04da52 | |||
1941721070 | |||
9f282952cd | |||
09b81017d0 | |||
4f58979096 | |||
898104ea2c | |||
7d15eeda88 | |||
cba3f77272 | |||
91dffc45ff | |||
47eb46e700 | |||
8271ddc78e | |||
6b08545ef9 | |||
9cddfb4ce7 | |||
19b26e1c5e | |||
936fffd0a1 | |||
2f24d062b3 | |||
4e373d4ab6 | |||
c01d3d9f67 | |||
d2f344b83f | |||
d7f5a44b45 | |||
0a9b98e1aa | |||
fd188870e8 | |||
c28e6ac22e | |||
9381bd8ddb | |||
454fc76e8d | |||
ba963b0360 | |||
19d3ed47c9 | |||
0757295213 | |||
76c677a6b1 | |||
ce8842b52f | |||
a039fe3223 | |||
a669b2148f | |||
53a7d87b03 | |||
388ab4f3b1 | |||
567713b7ba | |||
9547805ec2 | |||
89040e0237 | |||
dd657a9e88 | |||
fe21bb1702 | |||
a01d352925 | |||
e1fb07989f | |||
b0d6be1929 | |||
a2e0c66dc8 | |||
fe028c3ac1 | |||
92ef5805b8 | |||
e30f3b2035 | |||
cdcaba651c | |||
63aff461ed | |||
54565e2228 | |||
cce6d3fcbe | |||
26809a33c6 | |||
030594ccae | |||
396470886c | |||
0408a2808c | |||
14f9347311 | |||
40747603e8 | |||
608ba89c7c | |||
f34d4833a8 | |||
051a1226c0 | |||
5b2350c01c | |||
0ffc114005 | |||
ff25a4faa5 | |||
e73b12cd76 | |||
7a2f209430 | |||
0174e9b423 | |||
794571c7e1 | |||
c34a4f2613 | |||
f648ecf0b8 | |||
e1cc557bec | |||
2310b7f479 | |||
e64bb9c7b9 | |||
af98f80db0 | |||
8a704776d2 | |||
67a205cae7 | |||
1fb1f50756 | |||
50049113b5 | |||
49694a53fd | |||
ead04d0764 | |||
47099d0468 | |||
abbd620220 | |||
303b025aee | |||
1421b06df7 | |||
1e37282e06 | |||
7b992ed254 | |||
deba94d69c | |||
5e09c27a0d | |||
31563f53ec | |||
a967e560c6 | |||
c4427f7bb9 | |||
a563659eca | |||
caca11d807 | |||
c79d68d83e | |||
7af63f4b0c |
24
.github/workflows/demos.yml
vendored
24
.github/workflows/demos.yml
vendored
@ -202,13 +202,14 @@ jobs:
|
||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
||||
- name: Run Demo
|
||||
run: npm run ts-node -- ./demo/19-export-to-base64.ts
|
||||
- name: Extract Word Document
|
||||
run: npm run extract
|
||||
- name: Validate XML
|
||||
uses: ChristophWurst/xmllint-action@v1
|
||||
with:
|
||||
xml-file: build/extracted-doc/word/document.xml
|
||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
||||
# Base 64 No longer works, abruptly. Node issue?
|
||||
# - name: Extract Word Document
|
||||
# run: npm run extract
|
||||
# - name: Validate XML
|
||||
# uses: ChristophWurst/xmllint-action@v1
|
||||
# with:
|
||||
# xml-file: build/extracted-doc/word/document.xml
|
||||
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
||||
- name: Run Demo
|
||||
run: npm run ts-node -- ./demo/20-table-cell-borders.ts
|
||||
- name: Extract Word Document
|
||||
@ -679,3 +680,12 @@ jobs:
|
||||
with:
|
||||
xml-file: build/extracted-doc/word/document.xml
|
||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
||||
- name: Run Demo
|
||||
run: npm run ts-node -- ./demo/71-page-borders-2.ts
|
||||
- name: Extract Word Document
|
||||
run: npm run extract
|
||||
- name: Validate XML
|
||||
uses: ChristophWurst/xmllint-action@v1
|
||||
with:
|
||||
xml-file: build/extracted-doc/word/document.xml
|
||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
6
.nycrc
6
.nycrc
@ -1,9 +1,9 @@
|
||||
{
|
||||
"check-coverage": true,
|
||||
"lines": 99.32,
|
||||
"functions": 99.11,
|
||||
"branches": 96.27,
|
||||
"statements": 99.32,
|
||||
"branches": 96.27,
|
||||
"functions": 99.11,
|
||||
"lines": 99.32,
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
],
|
||||
|
@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<img alt="clippy the assistant" src="https://i.imgur.com/37uBGhO.gif">
|
||||
<img src="./logo/logo-animate.svg" width="100%" height="300" alt="clippy the assistant">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@ -85,8 +85,9 @@ Read the contribution guidelines [here](https://docx.js.org/#/contribution-guide
|
||||
[<img src="https://i.imgur.com/QEZXU5b.png" alt="drawing" height="50"/>](https://www.beekast.com/)
|
||||
[<img src="https://i.imgur.com/XVU6aoi.png" alt="drawing" height="50"/>](https://herraizsoto.com/)
|
||||
[<img src="https://i.imgur.com/fn1xccG.png" alt="drawing" height="50"/>](http://www.ativer.com.br/)
|
||||
[<img src="https://i.imgur.com/cmykN7c.png" alt="drawing" />](https://www.arity.co/)
|
||||
[<img src="https://i.imgur.com/cmykN7c.png" alt="drawing"/>](https://www.arity.co/)
|
||||
[<img src="https://i.imgur.com/PXo25um.png" alt="drawing" height="50"/>](https://www.circadianrisk.com/)
|
||||
[<img src="https://i.imgur.com/AKGhtlh.png" alt="drawing"/>](https://lexense.com/)
|
||||
|
||||
|
||||
...and many more!
|
||||
|
@ -113,6 +113,16 @@ const doc = new Document({
|
||||
bold: true,
|
||||
children: ["\tuse Inserted and Deleted TextRuns.", new FootnoteReferenceRun(1)],
|
||||
}),
|
||||
new TextRun({
|
||||
bold: true,
|
||||
text: "And some style changes",
|
||||
revision: {
|
||||
id: 4,
|
||||
author: "Firstname Lastname",
|
||||
date: "2020-10-06T09:05:00Z",
|
||||
bold: false,
|
||||
}
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
63
demo/71-page-borders-2.ts
Normal file
63
demo/71-page-borders-2.ts
Normal file
@ -0,0 +1,63 @@
|
||||
// Example demonstrating page borders with style, colors and size
|
||||
// Import from 'docx' rather than '../build' if you install from npm
|
||||
import * as fs from "fs";
|
||||
import { Document, Packer, TextRun, Paragraph, BorderStyle, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder } from "../build";
|
||||
|
||||
const doc = new Document({
|
||||
sections: [
|
||||
{
|
||||
properties: {
|
||||
page: {
|
||||
borders: {
|
||||
pageBorderBottom: {
|
||||
style: BorderStyle.SINGLE,
|
||||
size: 2 * 8, //2pt;
|
||||
color: "000000",
|
||||
},
|
||||
pageBorderLeft: {
|
||||
style: BorderStyle.SINGLE,
|
||||
size: 1 * 8, //1pt;
|
||||
color: "000000",
|
||||
},
|
||||
pageBorderRight: {
|
||||
style: BorderStyle.SINGLE,
|
||||
size: 1 * 8, //1pt;
|
||||
color: "FF00AA",
|
||||
},
|
||||
pageBorderTop: {
|
||||
style: BorderStyle.SINGLE,
|
||||
size: 1 * 8, //1pt;
|
||||
color: "000000",
|
||||
},
|
||||
pageBorders: {
|
||||
display: PageBorderDisplay.ALL_PAGES,
|
||||
offsetFrom: PageBorderOffsetFrom.TEXT,
|
||||
zOrder: PageBorderZOrder.FRONT,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
children: [
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun({
|
||||
text: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
new Paragraph({
|
||||
children: [
|
||||
new TextRun({
|
||||
text: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// Used to export the file into a .docx file
|
||||
Packer.toBuffer(doc).then((buffer) => {
|
||||
fs.writeFileSync("My Document.docx", buffer);
|
||||
});
|
@ -12,7 +12,7 @@ const doc = new Document({
|
||||
new Paragraph({
|
||||
text: "Bullet points",
|
||||
bullet: {
|
||||
level: 0 //How deep you want the bullet to be
|
||||
level: 0 // How deep you want the bullet to be. Maximum level is 9
|
||||
}
|
||||
}),
|
||||
new Paragraph({
|
||||
|
@ -59,3 +59,18 @@ const doc = new Document({
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
If you want to express a style changes, you can add a `revision` to a `TextRun` which need to include all previous style attributes.
|
||||
|
||||
```ts
|
||||
new TextRun({
|
||||
bold: true,
|
||||
text: "This text is now bold and was previously not",
|
||||
revision: {
|
||||
id: 1,
|
||||
author: "Firstname Lastname",
|
||||
date: "2020-10-06T09:05:00Z",
|
||||
bold: false,
|
||||
}
|
||||
}).break()
|
||||
````
|
||||
|
@ -8,24 +8,24 @@ Every Section has a sections which you can define its Headers and Footers:
|
||||
const doc = new Document({
|
||||
sections: [{
|
||||
headers: {
|
||||
default: new Header({ // The standard default header
|
||||
default: new Header({ // The standard default header on every page or header on odd pages when the 'Different Odd & Even Pages' option is activated
|
||||
children: [],
|
||||
}),
|
||||
first: new Header({ // The first header
|
||||
first: new Header({ // The header on first page when the 'Different First Page' option is activated
|
||||
children: [],
|
||||
}),
|
||||
even: new Header({ // The header on every other page
|
||||
even: new Header({ // The header on even pages when the 'Different Odd & Even Pages' option is activated
|
||||
children: [],
|
||||
}),
|
||||
},
|
||||
footers: {
|
||||
default: new Footer({ // The standard default footer
|
||||
default: new Footer({ // The standard default footer on every page or footer on odd pages when the 'Different Odd & Even Pages' option is activated
|
||||
children: [],
|
||||
}),
|
||||
first: new Footer({ // The first footer
|
||||
first: new Footer({ // The footer on first page when the 'Different First Page' option is activated
|
||||
children: [],
|
||||
}),
|
||||
even: new Footer({ // The footer on every other page
|
||||
even: new Footer({ // The footer on even pages when the 'Different Odd & Even Pages' option is activated
|
||||
children: [],
|
||||
}),
|
||||
},
|
||||
|
15
logo/logo-animate.svg
Normal file
15
logo/logo-animate.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 1200 600" xml:space="preserve">
|
||||
<style>
|
||||
.st0{fill:#2B579A;}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
path { fill: #fff; }
|
||||
}
|
||||
</style>
|
||||
<path id="X" d="m1009.42 294.26 90.58 216.8h-35.63l-76.09-187.21-75.49 187.21h-35.03l92.4-219.21-85.75-203.52h36.23l70.05 176.34 65.82-176.34h34.42l-81.51 205.93z"/>
|
||||
<path id="C" d="M837.51 426.82c0 60.39-32.61 89.38-96.62 89.38h-1.21c-64.01 0-96.62-28.38-96.62-89.38V173.18c0-57.97 32.61-89.38 96.62-89.38h1.21c64.01 0 96.62 31.4 96.62 89.38v72.47H804.9v-61.6c0-49.52-17.51-70.05-64.62-70.05-47.1 0-64.62 20.53-64.62 70.05v231.89c0 49.52 17.51 70.05 64.62 70.05 47.1 0 64.62-20.53 64.62-70.05v-71.86h32.61v82.74z"/>
|
||||
<path id="O" class="st0" d="M450.95 83.82c2.71.26 5.42.49 8.13.79 15.24 1.66 29.25 6.4 40.96 16.68 10.94 9.62 17.43 21.88 20.97 35.84a76.36 76.36 0 0 1 2.28 18.8c-.03 86.6-.01 173.2-.04 259.8a58.86 58.86 0 0 1-8.11 29.93c-7.35 12.68-18.54 19.97-32.83 22.46-12.27 2.14-24.47 1.56-36.32-2.45-17.14-5.81-27.01-18.1-30.48-35.61-.87-4.4-1.03-8.99-1.1-13.51-.16-10-.05-20.01-.05-30.01V168.27c0-7.04 4.19-10.9 11.29-10.25 1.88.17 3.81.59 5.55 1.31 3.12 1.29 4.69 3.69 4.69 7.22-.03 82.93-.03 165.87-.02 248.8 0 15.01 10.45 28.32 24.92 31.6a38.74 38.74 0 0 0 20.16-.6c10.74-3.27 16.83-10.95 19.56-21.5a35.05 35.05 0 0 0 1.14-8.77c.06-87.53.19-175.06-.07-262.59-.05-17.27-7.1-31.7-21.8-41.66-6.46-4.38-13.78-6.65-21.46-7.74-10.77-1.52-21.49-1.19-31.92 2.09-17.94 5.63-28.41 18.23-32.67 36.19a56.84 56.84 0 0 0-1.45 12.93c-.08 86.6-.13 173.2 0 259.8.03 18.77 4.97 36.32 15.53 52 10.75 15.96 26 25.08 44.85 28.24 15.3 2.56 30.51 1.86 45.37-2.6 24.06-7.22 38.48-23.7 44.77-47.69a92.5 92.5 0 0 0 2.74-28.17c-.05-.87-.04-1.74-.04-2.62V155.51c0-7.45 4.58-11.41 12.11-10.44.81.1 1.61.23 2.4.42 3.53.83 6.05 2.82 7.17 6.37v267.31c-.13.56-.33 1.11-.37 1.68a121.32 121.32 0 0 1-8.14 36.58c-13.92 35.27-39.92 54.47-77.59 58.02l-7.78.74h-8.72l-2.57-.37c-6.55-.84-13.21-1.22-19.65-2.61-23.98-5.2-42.64-18.19-55.3-39.33a114.04 114.04 0 0 1-16.33-59.24c-.13-86.17-.04-172.34-.07-258.52 0-6.38.69-12.63 2.23-18.8 3.53-14.09 10.06-26.46 21.12-36.13 11.73-10.26 25.74-14.98 40.98-16.61 2.65-.28 5.3-.52 7.95-.78 2.66.02 5.33.02 8.01.02z"/>
|
||||
<path id="D" d="M295.06 178.01v243.97c0 59.18-32.61 89.38-96.62 89.38H100V88.64h98.43c64.02 0 96.63 30.19 96.63 89.37zm-99.04-59.18h-63.41v362.34h63.41c47.71 0 66.43-19.93 66.43-70.05V188.88c0-50.12-18.72-70.05-66.43-70.05z"/>
|
||||
<path id="bar" d="M1118.5 25h10v550h-10z">
|
||||
<animate attributeName="visibility" values="hidden;visible" dur="2s" repeatCount="indefinite" />
|
||||
</path>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
12
logo/logo.svg
Normal file
12
logo/logo.svg
Normal file
@ -0,0 +1,12 @@
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 1200 600" xml:space="preserve">
|
||||
<style>
|
||||
.st0{fill:#2B579A;}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
path { fill: #fff; }
|
||||
}
|
||||
</style>
|
||||
<path id="X" d="m1009.42 294.26 90.58 216.8h-35.63l-76.09-187.21-75.49 187.21h-35.03l92.4-219.21-85.75-203.52h36.23l70.05 176.34 65.82-176.34h34.42l-81.51 205.93z"/>
|
||||
<path id="C" d="M837.51 426.82c0 60.39-32.61 89.38-96.62 89.38h-1.21c-64.01 0-96.62-28.38-96.62-89.38V173.18c0-57.97 32.61-89.38 96.62-89.38h1.21c64.01 0 96.62 31.4 96.62 89.38v72.47H804.9v-61.6c0-49.52-17.51-70.05-64.62-70.05-47.1 0-64.62 20.53-64.62 70.05v231.89c0 49.52 17.51 70.05 64.62 70.05 47.1 0 64.62-20.53 64.62-70.05v-71.86h32.61v82.74z"/>
|
||||
<path id="O" class="st0" d="M450.95 83.82c2.71.26 5.42.49 8.13.79 15.24 1.66 29.25 6.4 40.96 16.68 10.94 9.62 17.43 21.88 20.97 35.84a76.36 76.36 0 0 1 2.28 18.8c-.03 86.6-.01 173.2-.04 259.8a58.86 58.86 0 0 1-8.11 29.93c-7.35 12.68-18.54 19.97-32.83 22.46-12.27 2.14-24.47 1.56-36.32-2.45-17.14-5.81-27.01-18.1-30.48-35.61-.87-4.4-1.03-8.99-1.1-13.51-.16-10-.05-20.01-.05-30.01V168.27c0-7.04 4.19-10.9 11.29-10.25 1.88.17 3.81.59 5.55 1.31 3.12 1.29 4.69 3.69 4.69 7.22-.03 82.93-.03 165.87-.02 248.8 0 15.01 10.45 28.32 24.92 31.6a38.74 38.74 0 0 0 20.16-.6c10.74-3.27 16.83-10.95 19.56-21.5a35.05 35.05 0 0 0 1.14-8.77c.06-87.53.19-175.06-.07-262.59-.05-17.27-7.1-31.7-21.8-41.66-6.46-4.38-13.78-6.65-21.46-7.74-10.77-1.52-21.49-1.19-31.92 2.09-17.94 5.63-28.41 18.23-32.67 36.19a56.84 56.84 0 0 0-1.45 12.93c-.08 86.6-.13 173.2 0 259.8.03 18.77 4.97 36.32 15.53 52 10.75 15.96 26 25.08 44.85 28.24 15.3 2.56 30.51 1.86 45.37-2.6 24.06-7.22 38.48-23.7 44.77-47.69a92.5 92.5 0 0 0 2.74-28.17c-.05-.87-.04-1.74-.04-2.62V155.51c0-7.45 4.58-11.41 12.11-10.44.81.1 1.61.23 2.4.42 3.53.83 6.05 2.82 7.17 6.37v267.31c-.13.56-.33 1.11-.37 1.68a121.32 121.32 0 0 1-8.14 36.58c-13.92 35.27-39.92 54.47-77.59 58.02l-7.78.74h-8.72l-2.57-.37c-6.55-.84-13.21-1.22-19.65-2.61-23.98-5.2-42.64-18.19-55.3-39.33a114.04 114.04 0 0 1-16.33-59.24c-.13-86.17-.04-172.34-.07-258.52 0-6.38.69-12.63 2.23-18.8 3.53-14.09 10.06-26.46 21.12-36.13 11.73-10.26 25.74-14.98 40.98-16.61 2.65-.28 5.3-.52 7.95-.78 2.66.02 5.33.02 8.01.02z"/>
|
||||
<path id="D" d="M295.06 178.01v243.97c0 59.18-32.61 89.38-96.62 89.38H100V88.64h98.43c64.02 0 96.63 30.19 96.63 89.37zm-99.04-59.18h-63.41v362.34h63.41c47.71 0 66.43-19.93 66.43-70.05V188.88c0-50.12-18.72-70.05-66.43-70.05z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.4 KiB |
463
package-lock.json
generated
463
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docx",
|
||||
"version": "7.1.0",
|
||||
"version": "7.2.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -395,18 +395,18 @@
|
||||
"dev": true
|
||||
},
|
||||
"@cspotcode/source-map-support": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz",
|
||||
"integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==",
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz",
|
||||
"integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cspotcode/source-map-consumer": "0.8.0"
|
||||
}
|
||||
},
|
||||
"@discoveryjs/json-ext": {
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz",
|
||||
"integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==",
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz",
|
||||
"integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==",
|
||||
"dev": true
|
||||
},
|
||||
"@istanbuljs/load-nyc-config": {
|
||||
@ -573,9 +573,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/chai": {
|
||||
"version": "4.2.22",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz",
|
||||
"integrity": "sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz",
|
||||
"integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/color-name": {
|
||||
@ -585,9 +585,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/eslint": {
|
||||
"version": "7.28.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz",
|
||||
"integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==",
|
||||
"version": "8.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.2.1.tgz",
|
||||
"integrity": "sha512-UP9rzNn/XyGwb5RQ2fok+DzcIRIYwc16qTXse5+Smsy8MOIccCChT15KAwnsgQx4PzJkaMq4myFyZ4CL5TjhIQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/estree": "*",
|
||||
@ -611,9 +611,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/glob": {
|
||||
"version": "7.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz",
|
||||
"integrity": "sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA==",
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/minimatch": "*",
|
||||
@ -645,14 +645,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.10.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.2.tgz",
|
||||
"integrity": "sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ=="
|
||||
"version": "17.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.0.tgz",
|
||||
"integrity": "sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw=="
|
||||
},
|
||||
"@types/prompt": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/prompt/-/prompt-1.1.1.tgz",
|
||||
"integrity": "sha512-Ht3nSZy87jqKM5Y92GWKD6RQTqQIi6tAKhrWgEvFPh+P13L5olqBYs+P1HySBYRHyIezEqrB3StK4X7lBFmIEQ==",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/prompt/-/prompt-1.1.2.tgz",
|
||||
"integrity": "sha512-Zc9YzOvjAWxxGY7qo0Q6yINMVVspAa4p68UCzucWMU+GaPujpjwbOwzI38s7Jq01k0GztzLxXlRiFcZf/aeIWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
@ -701,9 +701,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/shelljs": {
|
||||
"version": "0.8.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.9.tgz",
|
||||
"integrity": "sha512-flVe1dvlrCyQJN/SGrnBxqHG+RzXrVKsmjD8WS/qYHpq5UPjfq7UWFBENP0ZuOl0g6OpAlL6iBoLSvKYUUmyQw==",
|
||||
"version": "0.8.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.10.tgz",
|
||||
"integrity": "sha512-nhBdUA/n0nRo1B6E4BuRnUvllYAqal4T9zd91ZDnBh+qQMQTwvxmJHx6xEn/0vdjP2kqEA5eVeLazs4nMxeuFg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/glob": "*",
|
||||
@ -711,9 +711,9 @@
|
||||
}
|
||||
},
|
||||
"@types/sinon": {
|
||||
"version": "10.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.4.tgz",
|
||||
"integrity": "sha512-fOYjrxQv8zJsqOY6V6ecP4eZhQBxtY80X0er1VVnUIAIZo74jHm8e1vguG5Yt4Iv8W2Wr7TgibB8MfRe32k9pA==",
|
||||
"version": "10.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.6.tgz",
|
||||
"integrity": "sha512-6EF+wzMWvBNeGrfP3Nx60hhx+FfwSg1JJBLAAP/IdIUq0EYkqCYf70VT3PhuhPX9eLD+Dp+lNdpb/ZeHG8Yezg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@sinonjs/fake-timers": "^7.1.0"
|
||||
@ -898,24 +898,24 @@
|
||||
}
|
||||
},
|
||||
"@webpack-cli/configtest": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.4.tgz",
|
||||
"integrity": "sha512-cs3XLy+UcxiP6bj0A6u7MLLuwdXJ1c3Dtc0RkKg+wiI1g/Ti1om8+/2hc2A2B60NbBNAbMgyBMHvyymWm/j4wQ==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.0.tgz",
|
||||
"integrity": "sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg==",
|
||||
"dev": true
|
||||
},
|
||||
"@webpack-cli/info": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.3.0.tgz",
|
||||
"integrity": "sha512-ASiVB3t9LOKHs5DyVUcxpraBXDOKubYu/ihHhU+t1UPpxsivg6Od2E2qU4gJCekfEddzRBzHhzA/Acyw/mlK/w==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.0.tgz",
|
||||
"integrity": "sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"envinfo": "^7.7.3"
|
||||
}
|
||||
},
|
||||
"@webpack-cli/serve": {
|
||||
"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==",
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.0.tgz",
|
||||
"integrity": "sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA==",
|
||||
"dev": true
|
||||
},
|
||||
"@xtuc/ieee754": {
|
||||
@ -937,9 +937,9 @@
|
||||
"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==",
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz",
|
||||
"integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-walk": {
|
||||
@ -1305,16 +1305,16 @@
|
||||
"dev": true
|
||||
},
|
||||
"browserslist": {
|
||||
"version": "4.17.1",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.1.tgz",
|
||||
"integrity": "sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ==",
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.18.1.tgz",
|
||||
"integrity": "sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"caniuse-lite": "^1.0.30001259",
|
||||
"electron-to-chromium": "^1.3.846",
|
||||
"caniuse-lite": "^1.0.30001280",
|
||||
"electron-to-chromium": "^1.3.896",
|
||||
"escalade": "^3.1.1",
|
||||
"nanocolors": "^0.1.5",
|
||||
"node-releases": "^1.1.76"
|
||||
"node-releases": "^2.0.1",
|
||||
"picocolors": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"buffer": {
|
||||
@ -1416,9 +1416,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001261",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001261.tgz",
|
||||
"integrity": "sha512-vM8D9Uvp7bHIN0fZ2KQ4wnmYFpJo/Etb4Vwsuc+ka0tfGDHvOPrFm6S/7CCNLSOkAUjenT2HnUPESdOIL91FaA==",
|
||||
"version": "1.0.30001285",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001285.tgz",
|
||||
"integrity": "sha512-KAOkuUtcQ901MtmvxfKD+ODHH9YVDYnBt+TGYSz2KIfnq22CiArbUxXPN9067gNbgMlnNYRSwho8OPXZPALB9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"caseless": {
|
||||
@ -1585,9 +1585,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"colorette": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
|
||||
"integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
|
||||
"version": "2.0.16",
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz",
|
||||
"integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==",
|
||||
"dev": true
|
||||
},
|
||||
"colors": {
|
||||
@ -1690,6 +1690,52 @@
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"cross-env": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
|
||||
"integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cross-spawn": "^7.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
"which": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"shebang-command": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"shebang-regex": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"shebang-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
|
||||
@ -2057,9 +2103,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"electron-to-chromium": {
|
||||
"version": "1.3.853",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.853.tgz",
|
||||
"integrity": "sha512-W4U8n+U8I5/SUaFcqZgbKRmYZwcyEIQVBDf+j5QQK6xChjXnQD+wj248eGR9X4u+dDmDR//8vIfbu4PrdBBIoQ==",
|
||||
"version": "1.4.12",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.12.tgz",
|
||||
"integrity": "sha512-zjfhG9Us/hIy8AlQ5OzfbR/C4aBv1Dg/ak4GX35CELYlJ4tDAtoEcQivXvyBdqdNQ+R6PhlgQqV8UNPJmhkJog==",
|
||||
"dev": true
|
||||
},
|
||||
"emoji-regex": {
|
||||
@ -2117,9 +2163,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"es-module-lexer": {
|
||||
"version": "0.9.1",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.1.tgz",
|
||||
"integrity": "sha512-17Ed9misDnpyNBJh63g1OhW3qUFecDgGOivI85JeZY/LGhDum8e+cltukbkSK8pcJnXXEkya56sp4vSS1nzoUw==",
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz",
|
||||
"integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==",
|
||||
"dev": true
|
||||
},
|
||||
"es6-error": {
|
||||
@ -2178,9 +2224,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"estraverse": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
|
||||
"integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
|
||||
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@ -2253,9 +2299,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
|
||||
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz",
|
||||
"integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==",
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
@ -2792,9 +2838,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"import-local": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz",
|
||||
"integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==",
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz",
|
||||
"integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pkg-dir": "^4.2.0",
|
||||
@ -3156,9 +3202,9 @@
|
||||
}
|
||||
},
|
||||
"jest-worker": {
|
||||
"version": "27.2.3",
|
||||
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.3.tgz",
|
||||
"integrity": "sha512-ZwOvv4GCIPviL+Ie4pVguz4N5w/6IGbTaHBYOl3ZcsZZktaL7d8JOU0rmovoED7AJZKA8fvmLbBg8yg80u/tGA==",
|
||||
"version": "27.4.2",
|
||||
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.4.2.tgz",
|
||||
"integrity": "sha512-0QMy/zPovLfUPyHuOuuU4E+kGACXXE84nRnq6lBVI9GJg5DCBiA97SATi+ZP8CpiJwEQy1oCPjRBf8AnLjN+Ag==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
@ -3229,6 +3275,15 @@
|
||||
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
|
||||
"dev": true
|
||||
},
|
||||
"json5": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
||||
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"jsonc-parser": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz",
|
||||
@ -3585,9 +3640,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"marked": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-3.0.4.tgz",
|
||||
"integrity": "sha512-jBo8AOayNaEcvBhNobg6/BLhdsK3NvnKWJg33MAAPbvTWiG4QBn9gpW1+7RssrKu4K1dKlN+0goVQwV41xEfOA==",
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz",
|
||||
"integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==",
|
||||
"dev": true
|
||||
},
|
||||
"medium-zoom": {
|
||||
@ -3684,9 +3739,9 @@
|
||||
}
|
||||
},
|
||||
"mocha": {
|
||||
"version": "9.1.2",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.2.tgz",
|
||||
"integrity": "sha512-ta3LtJ+63RIBP03VBjMGtSqbe6cWXRejF9SyM9Zyli1CKZJZ+vfCTj3oW24V7wAphMJdpOFLoMI3hjJ1LWbs0w==",
|
||||
"version": "9.1.3",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz",
|
||||
"integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@ungap/promise-all-settled": "1.1.2",
|
||||
@ -3829,16 +3884,10 @@
|
||||
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
|
||||
"dev": true
|
||||
},
|
||||
"nanocolors": {
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.1.12.tgz",
|
||||
"integrity": "sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==",
|
||||
"dev": true
|
||||
},
|
||||
"nanoid": {
|
||||
"version": "3.1.28",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.28.tgz",
|
||||
"integrity": "sha512-gSu9VZ2HtmoKYe/lmyPFES5nknFrHa+/DT9muUFWFMi6Jh9E1I7bkvlQ8xxf1Kos9pi9o8lBnIOkatMhKX/YUw=="
|
||||
"version": "3.1.30",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.30.tgz",
|
||||
"integrity": "sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ=="
|
||||
},
|
||||
"neo-async": {
|
||||
"version": "2.6.2",
|
||||
@ -3881,9 +3930,9 @@
|
||||
}
|
||||
},
|
||||
"node-releases": {
|
||||
"version": "1.1.76",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.76.tgz",
|
||||
"integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
|
||||
"integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
|
||||
"dev": true
|
||||
},
|
||||
"normalize-path": {
|
||||
@ -4403,6 +4452,12 @@
|
||||
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
|
||||
"dev": true
|
||||
},
|
||||
"picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
|
||||
"dev": true
|
||||
},
|
||||
"picomatch": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
|
||||
@ -4472,9 +4527,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz",
|
||||
"integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==",
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
|
||||
"integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
|
||||
"dev": true
|
||||
},
|
||||
"prismjs": {
|
||||
@ -4655,14 +4710,14 @@
|
||||
}
|
||||
},
|
||||
"replace-in-file": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-6.2.0.tgz",
|
||||
"integrity": "sha512-Im2AF9G/qgkYneOc9QwWwUS/efyyonTUBvzXS2VXuxPawE5yQIjT/e6x4CTijO0Quq48lfAujuo+S89RR2TP2Q==",
|
||||
"version": "6.3.2",
|
||||
"resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-6.3.2.tgz",
|
||||
"integrity": "sha512-Dbt5pXKvFVPL3WAaEB3ZX+95yP0CeAtIPJDwYzHbPP5EAHn+0UoegH/Wg3HKflU9dYBH8UnBC2NvY3P+9EZtTg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^4.1.0",
|
||||
"glob": "^7.1.6",
|
||||
"yargs": "^16.2.0"
|
||||
"chalk": "^4.1.2",
|
||||
"glob": "^7.2.0",
|
||||
"yargs": "^17.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
@ -4675,9 +4730,9 @@
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
|
||||
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
|
||||
"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",
|
||||
@ -4713,6 +4768,33 @@
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"y18n": {
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
|
||||
"dev": true
|
||||
},
|
||||
"yargs": {
|
||||
"version": "17.2.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.2.1.tgz",
|
||||
"integrity": "sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cliui": "^7.0.2",
|
||||
"escalade": "^3.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"string-width": "^4.2.0",
|
||||
"y18n": "^5.0.5",
|
||||
"yargs-parser": "^20.2.2"
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "20.2.9",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
|
||||
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -4996,9 +5078,9 @@
|
||||
}
|
||||
},
|
||||
"shiki": {
|
||||
"version": "0.9.11",
|
||||
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.11.tgz",
|
||||
"integrity": "sha512-tjruNTLFhU0hruCPoJP0y+B9LKOmcqUhTpxn7pcJB3fa+04gFChuEmxmrUfOJ7ZO6Jd+HwMnDHgY3lv3Tqonuw==",
|
||||
"version": "0.9.12",
|
||||
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.12.tgz",
|
||||
"integrity": "sha512-VXcROdldv0/Qu0w2XvzU4IrvTeBNs/Kj/FCmtcEXGz7Tic/veQzliJj6tEiAgoKianhQstpYmbPDStHU5Opqcw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"jsonc-parser": "^3.0.0",
|
||||
@ -5013,19 +5095,28 @@
|
||||
"dev": true
|
||||
},
|
||||
"sinon": {
|
||||
"version": "11.1.2",
|
||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-11.1.2.tgz",
|
||||
"integrity": "sha512-59237HChms4kg7/sXhiRcUzdSkKuydDeTiamT/jesUVHshBgL8XAmhgFo0GfK6RruMDM/iRSij1EybmMog9cJw==",
|
||||
"version": "12.0.1",
|
||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-12.0.1.tgz",
|
||||
"integrity": "sha512-iGu29Xhym33ydkAT+aNQFBINakjq69kKO6ByPvTsm3yyIACfyQttRTP03aBP/I8GfhFmLzrnKwNNkr0ORb1udg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@sinonjs/commons": "^1.8.3",
|
||||
"@sinonjs/fake-timers": "^7.1.2",
|
||||
"@sinonjs/fake-timers": "^8.1.0",
|
||||
"@sinonjs/samsam": "^6.0.2",
|
||||
"diff": "^5.0.0",
|
||||
"nise": "^5.1.0",
|
||||
"supports-color": "^7.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sinonjs/fake-timers": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz",
|
||||
"integrity": "sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==",
|
||||
"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",
|
||||
@ -5050,9 +5141,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.20",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz",
|
||||
"integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==",
|
||||
"version": "0.5.21",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
|
||||
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@ -5167,6 +5258,46 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||
"dev": true
|
||||
},
|
||||
"emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||
"dev": true
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
@ -5233,9 +5364,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"terser": {
|
||||
"version": "5.9.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz",
|
||||
"integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==",
|
||||
"version": "5.10.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz",
|
||||
"integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "^2.20.0",
|
||||
@ -5258,28 +5389,16 @@
|
||||
}
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "5.2.4",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz",
|
||||
"integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==",
|
||||
"version": "5.2.5",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.5.tgz",
|
||||
"integrity": "sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"jest-worker": "^27.0.6",
|
||||
"p-limit": "^3.1.0",
|
||||
"schema-utils": "^3.1.1",
|
||||
"serialize-javascript": "^6.0.0",
|
||||
"source-map": "^0.6.1",
|
||||
"terser": "^5.7.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"p-limit": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"yocto-queue": "^0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"test-exclude": {
|
||||
@ -5432,12 +5551,12 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "10.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz",
|
||||
"integrity": "sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==",
|
||||
"version": "10.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz",
|
||||
"integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cspotcode/source-map-support": "0.6.1",
|
||||
"@cspotcode/source-map-support": "0.7.0",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
@ -5460,26 +5579,15 @@
|
||||
}
|
||||
},
|
||||
"tsconfig-paths": {
|
||||
"version": "3.11.0",
|
||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
|
||||
"integrity": "sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA==",
|
||||
"version": "3.12.0",
|
||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz",
|
||||
"integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@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": {
|
||||
@ -5593,22 +5701,22 @@
|
||||
}
|
||||
},
|
||||
"typedoc": {
|
||||
"version": "0.22.4",
|
||||
"resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.22.4.tgz",
|
||||
"integrity": "sha512-M/a8NnPxq3/iZNNVjzFCK5gu4m//HTJIPbSS0JQVbkHJPP9wyepR12agylWTSqeVZe0xsbidVtO26+PP7iD/jw==",
|
||||
"version": "0.22.10",
|
||||
"resolved": "http://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz",
|
||||
"integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.7",
|
||||
"glob": "^7.2.0",
|
||||
"lunr": "^2.3.9",
|
||||
"marked": "^3.0.4",
|
||||
"marked": "^3.0.8",
|
||||
"minimatch": "^3.0.4",
|
||||
"shiki": "^0.9.11"
|
||||
"shiki": "^0.9.12"
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
|
||||
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz",
|
||||
"integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==",
|
||||
"dev": true
|
||||
},
|
||||
"unique-string": {
|
||||
@ -5771,12 +5879,6 @@
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==",
|
||||
"dev": true
|
||||
},
|
||||
"v8-compile-cache": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
|
||||
"integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==",
|
||||
"dev": true
|
||||
},
|
||||
"verror": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
|
||||
@ -5795,9 +5897,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"watchpack": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz",
|
||||
"integrity": "sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz",
|
||||
"integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
@ -5805,9 +5907,9 @@
|
||||
}
|
||||
},
|
||||
"webpack": {
|
||||
"version": "5.55.1",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.55.1.tgz",
|
||||
"integrity": "sha512-EYp9lwaOOAs+AA/KviNZ7bQiITHm4bXQvyTPewD2+f5YGjv6sfiClm40yeX5FgBMxh5bxcB6LryiFoP09B97Ug==",
|
||||
"version": "5.65.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.65.0.tgz",
|
||||
"integrity": "sha512-Q5or2o6EKs7+oKmJo7LaqZaMOlDWQse9Tm5l1WAfU/ujLGN5Pb0SqGeVkN/4bpPmEqEP5RnVhiqsOtWtUVwGRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/eslint-scope": "^3.7.0",
|
||||
@ -5832,8 +5934,8 @@
|
||||
"schema-utils": "^3.1.0",
|
||||
"tapable": "^2.1.1",
|
||||
"terser-webpack-plugin": "^5.1.3",
|
||||
"watchpack": "^2.2.0",
|
||||
"webpack-sources": "^3.2.0"
|
||||
"watchpack": "^2.3.1",
|
||||
"webpack-sources": "^3.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"enhanced-resolve": {
|
||||
@ -5855,23 +5957,22 @@
|
||||
}
|
||||
},
|
||||
"webpack-cli": {
|
||||
"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==",
|
||||
"version": "4.9.1",
|
||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.1.tgz",
|
||||
"integrity": "sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ==",
|
||||
"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.2",
|
||||
"colorette": "^1.2.1",
|
||||
"@webpack-cli/configtest": "^1.1.0",
|
||||
"@webpack-cli/info": "^1.4.0",
|
||||
"@webpack-cli/serve": "^1.6.0",
|
||||
"colorette": "^2.0.14",
|
||||
"commander": "^7.0.0",
|
||||
"execa": "^5.0.0",
|
||||
"fastest-levenshtein": "^1.0.12",
|
||||
"import-local": "^3.0.2",
|
||||
"interpret": "^2.2.0",
|
||||
"rechoir": "^0.7.0",
|
||||
"v8-compile-cache": "^2.2.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -5909,9 +6010,9 @@
|
||||
}
|
||||
},
|
||||
"webpack-sources": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz",
|
||||
"integrity": "sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA==",
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.2.tgz",
|
||||
"integrity": "sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==",
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
|
11
package.json
11
package.json
@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "docx",
|
||||
"version": "7.1.1",
|
||||
"version": "7.3.0",
|
||||
"description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",
|
||||
"main": "build/index.js",
|
||||
"scripts": {
|
||||
"pretest": "rimraf ./build",
|
||||
"test": "TS_NODE_PROJECT=\"tsconfig.spec.json\" mocha -r ts-node/register -r tsconfig-paths/register \"src/**/*.ts\"",
|
||||
"test": "cross-env TS_NODE_PROJECT=\"tsconfig.spec.json\" mocha -r ts-node/register -r tsconfig-paths/register \"src/**/*.ts\"",
|
||||
"test.coverage": "nyc npm test",
|
||||
"test.watch": "npm test -- --watch",
|
||||
"prepublishOnly": "npm run build --production",
|
||||
@ -49,7 +49,7 @@
|
||||
],
|
||||
"types": "./build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@types/node": "^16.0.0",
|
||||
"@types/node": "^17.0.0",
|
||||
"jszip": "^3.1.5",
|
||||
"nanoid": "^3.1.20",
|
||||
"xml": "^1.0.1",
|
||||
@ -73,6 +73,7 @@
|
||||
"@types/webpack": "^5.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"chai": "^3.5.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"docsify-cli": "^4.3.0",
|
||||
"glob": "^7.1.2",
|
||||
"jszip": "^3.1.5",
|
||||
@ -87,7 +88,7 @@
|
||||
"request-promise": "^4.2.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"shelljs": "^0.8.4",
|
||||
"sinon": "^11.0.0",
|
||||
"sinon": "^12.0.1",
|
||||
"stream-browserify": "^3.0.0",
|
||||
"ts-loader": "^9.0.0",
|
||||
"ts-node": "^10.2.1",
|
||||
@ -95,7 +96,7 @@
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-immutable": "^6.0.1",
|
||||
"typedoc": "^0.22.3",
|
||||
"typescript": "4.4.3",
|
||||
"typescript": "4.5.4",
|
||||
"unzipper": "^0.10.11",
|
||||
"webpack": "^5.28.0",
|
||||
"webpack-cli": "^4.6.0"
|
||||
|
@ -44,14 +44,9 @@ export class Compiler {
|
||||
public compile(file: File, prettifyXml?: boolean): JSZip {
|
||||
const zip = new JSZip();
|
||||
const xmlifiedFileMapping = this.xmlifyFile(file, prettifyXml);
|
||||
const map = new Map<string, IXmlifyedFile | IXmlifyedFile[]>(Object.entries(xmlifiedFileMapping));
|
||||
|
||||
for (const key in xmlifiedFileMapping) {
|
||||
if (!xmlifiedFileMapping[key]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const obj = xmlifiedFileMapping[key] as IXmlifyedFile | IXmlifyedFile[];
|
||||
|
||||
for (const [, obj] of map) {
|
||||
if (Array.isArray(obj)) {
|
||||
for (const subFile of obj) {
|
||||
zip.file(subFile.path, subFile.data);
|
||||
|
@ -12,7 +12,7 @@ describe("Packer", () => {
|
||||
beforeEach(() => {
|
||||
file = new File({
|
||||
creator: "Dolan Miu",
|
||||
revision: "1",
|
||||
revision: 1,
|
||||
lastModifiedBy: "Dolan Miu",
|
||||
sections: [
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ describe("Properties", () => {
|
||||
keywords: "test docx",
|
||||
description: "testing document",
|
||||
lastModifiedBy: "the author",
|
||||
revision: "123",
|
||||
revision: 123,
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
expect(Object.keys(tree)).to.deep.equal(["cp:coreProperties"]);
|
||||
|
@ -17,7 +17,7 @@ export interface IPropertiesOptions {
|
||||
readonly keywords?: string;
|
||||
readonly description?: string;
|
||||
readonly lastModifiedBy?: string;
|
||||
readonly revision?: string;
|
||||
readonly revision?: number;
|
||||
readonly externalStyles?: string;
|
||||
readonly styles?: IStylesOptions;
|
||||
readonly numbering?: INumberingOptions;
|
||||
@ -89,7 +89,7 @@ export class CoreProperties extends XmlComponent {
|
||||
this.root.push(new StringContainer("cp:lastModifiedBy", options.lastModifiedBy));
|
||||
}
|
||||
if (options.revision) {
|
||||
this.root.push(new StringContainer("cp:revision", options.revision));
|
||||
this.root.push(new StringContainer("cp:revision", String(options.revision)));
|
||||
}
|
||||
this.root.push(new TimestampElement("dcterms:created"));
|
||||
this.root.push(new TimestampElement("dcterms:modified"));
|
||||
|
@ -0,0 +1,30 @@
|
||||
import { expect } from "chai";
|
||||
|
||||
import { Formatter } from "export/formatter";
|
||||
|
||||
import { DocumentGrid, DocumentGridType } from ".";
|
||||
|
||||
describe("DocumentGrid", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should create documentGrid with specified linePitch", () => {
|
||||
const docGrid = new DocumentGrid(360);
|
||||
const tree = new Formatter().format(docGrid);
|
||||
|
||||
expect(tree["w:docGrid"]).to.deep.equal({ _attr: { "w:linePitch": 360 } });
|
||||
});
|
||||
|
||||
it("should create documentGrid with specified linePitch and type", () => {
|
||||
const docGrid = new DocumentGrid(360, undefined, DocumentGridType.LINES);
|
||||
const tree = new Formatter().format(docGrid);
|
||||
|
||||
expect(tree["w:docGrid"]).to.deep.equal({ _attr: { "w:linePitch": 360, "w:type": "lines" } });
|
||||
});
|
||||
|
||||
it("should create documentGrid with specified linePitch,charSpace and type", () => {
|
||||
const docGrid = new DocumentGrid(346, -1541, DocumentGridType.LINES_AND_CHARS);
|
||||
const tree = new Formatter().format(docGrid);
|
||||
|
||||
expect(tree["w:docGrid"]).to.deep.equal({ _attr: { "w:linePitch": 346, "w:charSpace": -1541, "w:type": "linesAndChars" } });
|
||||
});
|
||||
});
|
||||
});
|
@ -16,22 +16,36 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
// <xsd:attribute name="linePitch" type="ST_DecimalNumber"/>
|
||||
// <xsd:attribute name="charSpace" type="ST_DecimalNumber"/>
|
||||
// </xsd:complexType>
|
||||
|
||||
export enum DocumentGridType {
|
||||
DEFAULT = "default",
|
||||
LINES = "lines",
|
||||
LINES_AND_CHARS = "linesAndChars",
|
||||
SNAP_TO_CHARS = "snapToChars",
|
||||
}
|
||||
export interface IDocGridAttributesProperties {
|
||||
readonly type?: DocumentGridType;
|
||||
readonly linePitch?: number;
|
||||
readonly charSpace?: number;
|
||||
}
|
||||
|
||||
export class DocGridAttributes extends XmlAttributeComponent<IDocGridAttributesProperties> {
|
||||
protected readonly xmlKeys = {
|
||||
type: "w:type",
|
||||
linePitch: "w:linePitch",
|
||||
charSpace: "w:charSpace",
|
||||
};
|
||||
}
|
||||
|
||||
export class DocumentGrid extends XmlComponent {
|
||||
constructor(linePitch: number) {
|
||||
constructor(linePitch: number, charSpace?: number, type?: DocumentGridType) {
|
||||
super("w:docGrid");
|
||||
|
||||
this.root.push(
|
||||
new DocGridAttributes({
|
||||
type: type,
|
||||
linePitch: decimalNumber(linePitch),
|
||||
charSpace: charSpace ? decimalNumber(charSpace) : undefined,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ export * from "./page-number";
|
||||
export * from "./page-borders";
|
||||
export * from "./page-margin";
|
||||
export * from "./page-borders";
|
||||
export * from "./page-text-direction";
|
||||
export * from "./line-number";
|
||||
export * from "./section-type";
|
||||
export * from "./header-footer-reference";
|
||||
|
@ -0,0 +1,22 @@
|
||||
import { expect } from "chai";
|
||||
|
||||
import { Formatter } from "export/formatter";
|
||||
import { PageTextDirection, PageTextDirectionType } from "./page-text-direction";
|
||||
|
||||
describe("PageTextDirection", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should set the direction of the text flow to top-to-bottom-right-to-left", () => {
|
||||
const textDirection = new PageTextDirection(PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT);
|
||||
|
||||
const tree = new Formatter().format(textDirection);
|
||||
|
||||
expect(tree).to.deep.equal({
|
||||
"w:textDirection": {
|
||||
_attr: {
|
||||
"w:val": "tbRl",
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
|
||||
export enum PageTextDirectionType {
|
||||
LEFT_TO_RIGHT_TOP_TO_BOTTOM = "lrTb",
|
||||
TOP_TO_BOTTOM_RIGHT_TO_LEFT = "tbRl",
|
||||
}
|
||||
|
||||
class PageTextDirectionAttributes extends XmlAttributeComponent<{ readonly val: PageTextDirectionType }> {
|
||||
protected readonly xmlKeys = { val: "w:val" };
|
||||
}
|
||||
|
||||
export class PageTextDirection extends XmlComponent {
|
||||
constructor(value: PageTextDirectionType) {
|
||||
super("w:textDirection");
|
||||
|
||||
this.root.push(
|
||||
new PageTextDirectionAttributes({
|
||||
val: value,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
@ -9,8 +9,10 @@ import { NumberFormat } from "file/shared/number-format";
|
||||
import { VerticalAlign } from "file/vertical-align";
|
||||
|
||||
import { PageOrientation } from "./properties";
|
||||
import { DocumentGridType } from "./properties/doc-grid";
|
||||
import { LineNumberRestartFormat } from "./properties/line-number";
|
||||
import { PageBorderOffsetFrom } from "./properties/page-borders";
|
||||
import { PageTextDirectionType } from "./properties/page-text-direction";
|
||||
import { SectionType } from "./properties/section-type";
|
||||
import { sectionMarginDefaults, sectionPageSizeDefaults, SectionProperties } from "./section-properties";
|
||||
|
||||
@ -63,6 +65,7 @@ describe("SectionProperties", () => {
|
||||
},
|
||||
grid: {
|
||||
linePitch: convertInchesToTwip(0.25),
|
||||
type: DocumentGridType.LINES,
|
||||
},
|
||||
headerWrapperGroup: {
|
||||
default: new HeaderWrapper(media, 100),
|
||||
@ -99,7 +102,7 @@ describe("SectionProperties", () => {
|
||||
expect(tree["w:sectPr"][5]).to.deep.equal({ "w:cols": { _attr: { "w:space": 208, "w:sep": true, "w:num": 2 } } });
|
||||
expect(tree["w:sectPr"][6]).to.deep.equal({ "w:vAlign": { _attr: { "w:val": "top" } } });
|
||||
expect(tree["w:sectPr"][7]).to.deep.equal({ "w:titlePg": {} });
|
||||
expect(tree["w:sectPr"][8]).to.deep.equal({ "w:docGrid": { _attr: { "w:linePitch": 360 } } });
|
||||
expect(tree["w:sectPr"][8]).to.deep.equal({ "w:docGrid": { _attr: { "w:linePitch": 360, "w:type": "lines" } } });
|
||||
});
|
||||
|
||||
it("should create section properties with no options", () => {
|
||||
@ -258,5 +261,19 @@ describe("SectionProperties", () => {
|
||||
"w:lnNumType": { _attr: { "w:countBy": 2, "w:distance": 4, "w:restart": "continuous", "w:start": 2 } },
|
||||
});
|
||||
});
|
||||
|
||||
it("should create section properties with text flow direction", () => {
|
||||
const properties = new SectionProperties({
|
||||
page: {
|
||||
textDirection: PageTextDirectionType.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
|
||||
},
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]);
|
||||
const type = tree["w:sectPr"].find((item) => item["w:textDirection"] !== undefined);
|
||||
expect(type).to.deep.equal({
|
||||
"w:textDirection": { _attr: { "w:val": "tbRl" } },
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -15,6 +15,7 @@ import { IPageBordersOptions, PageBorders } from "./properties/page-borders";
|
||||
import { IPageMarginAttributes, PageMargin } from "./properties/page-margin";
|
||||
import { IPageNumberTypeAttributes, PageNumberType } from "./properties/page-number";
|
||||
import { IPageSizeAttributes, PageOrientation, PageSize } from "./properties/page-size";
|
||||
import { PageTextDirection, PageTextDirectionType } from "./properties/page-text-direction";
|
||||
import { SectionType, Type } from "./properties/section-type";
|
||||
|
||||
export interface IHeaderFooterGroup<T> {
|
||||
@ -29,6 +30,7 @@ export interface ISectionPropertiesOptions {
|
||||
readonly margin?: IPageMarginAttributes;
|
||||
readonly pageNumbers?: IPageNumberTypeAttributes;
|
||||
readonly borders?: IPageBordersOptions;
|
||||
readonly textDirection?: PageTextDirectionType;
|
||||
};
|
||||
readonly grid?: IDocGridAttributesProperties;
|
||||
readonly headerWrapperGroup?: IHeaderFooterGroup<HeaderWrapper>;
|
||||
@ -108,8 +110,9 @@ export class SectionProperties extends XmlComponent {
|
||||
} = {},
|
||||
pageNumbers = {},
|
||||
borders,
|
||||
textDirection,
|
||||
} = {},
|
||||
grid: { linePitch = 360 } = {},
|
||||
grid: { linePitch = 360, charSpace, type: gridType } = {},
|
||||
headerWrapperGroup = {},
|
||||
footerWrapperGroup = {},
|
||||
lineNumbers,
|
||||
@ -152,7 +155,11 @@ export class SectionProperties extends XmlComponent {
|
||||
this.root.push(new OnOffElement("w:titlePg", titlePage));
|
||||
}
|
||||
|
||||
this.root.push(new DocumentGrid(linePitch));
|
||||
if (textDirection) {
|
||||
this.root.push(new PageTextDirection(textDirection));
|
||||
}
|
||||
|
||||
this.root.push(new DocumentGrid(linePitch, charSpace, gridType));
|
||||
}
|
||||
|
||||
private addHeaderFooterGroup(
|
||||
|
@ -6,14 +6,12 @@ import { DocumentBackground } from "./document-background";
|
||||
|
||||
describe("DocumentBackground", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should create a DocumentBackground with no options and set color to auto", () => {
|
||||
it("should create a DocumentBackground with no options", () => {
|
||||
const documentBackground = new DocumentBackground({});
|
||||
const tree = new Formatter().format(documentBackground);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:background": {
|
||||
_attr: {
|
||||
"w:color": "FFFFFF",
|
||||
},
|
||||
_attr: {},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
||||
// </xsd:simpleType>
|
||||
|
||||
export class DocumentBackgroundAttributes extends XmlAttributeComponent<{
|
||||
readonly color: string;
|
||||
readonly color?: string;
|
||||
readonly themeColor?: string;
|
||||
readonly themeShade?: string;
|
||||
readonly themeTint?: string;
|
||||
@ -68,7 +68,7 @@ export class DocumentBackground extends XmlComponent {
|
||||
|
||||
this.root.push(
|
||||
new DocumentBackgroundAttributes({
|
||||
color: hexColorValue(options.color ? options.color : "FFFFFF"),
|
||||
color: options.color === undefined ? undefined : hexColorValue(options.color),
|
||||
themeColor: options.themeColor,
|
||||
themeShade: options.themeShade === undefined ? undefined : uCharHexNumber(options.themeShade),
|
||||
themeTint: options.themeTint === undefined ? undefined : uCharHexNumber(options.themeTint),
|
||||
|
@ -40,9 +40,7 @@ describe("Document", () => {
|
||||
},
|
||||
{
|
||||
"w:background": {
|
||||
_attr: {
|
||||
"w:color": "FFFFFF",
|
||||
},
|
||||
_attr: {},
|
||||
},
|
||||
},
|
||||
{ "w:body": {} },
|
||||
|
@ -57,7 +57,7 @@ export class File {
|
||||
this.coreProperties = new CoreProperties({
|
||||
...options,
|
||||
creator: options.creator ?? "Un-named",
|
||||
revision: options.revision ?? "1",
|
||||
revision: options.revision ?? 1,
|
||||
lastModifiedBy: options.lastModifiedBy ?? "Un-named",
|
||||
});
|
||||
|
||||
|
25
src/file/numbering/level.spec.ts
Normal file
25
src/file/numbering/level.spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { expect } from "chai";
|
||||
|
||||
import { LevelFormat, LevelSuffix } from ".";
|
||||
import { AlignmentType } from "..";
|
||||
|
||||
import { Level } from "./level";
|
||||
|
||||
describe("Level", () => {
|
||||
describe("#constructor", () => {
|
||||
it("should throw an error if level exceeds 9", () => {
|
||||
expect(
|
||||
() =>
|
||||
new Level({
|
||||
level: 10,
|
||||
format: LevelFormat.BULLET,
|
||||
text: "test",
|
||||
alignment: AlignmentType.BOTH,
|
||||
start: 3,
|
||||
style: { run: {}, paragraph: {} },
|
||||
suffix: LevelSuffix.SPACE,
|
||||
}),
|
||||
).to.throw();
|
||||
});
|
||||
});
|
||||
});
|
@ -161,6 +161,12 @@ export class LevelBase extends XmlComponent {
|
||||
this.root.push(this.paragraphProperties);
|
||||
this.root.push(this.runProperties);
|
||||
|
||||
if (level > 9) {
|
||||
throw new Error(
|
||||
"Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7",
|
||||
);
|
||||
}
|
||||
|
||||
this.root.push(
|
||||
new LevelAttributes({
|
||||
ilvl: decimalNumber(level),
|
||||
|
@ -5,21 +5,17 @@ import { Formatter } from "export/formatter";
|
||||
import { NumberProperties } from "./unordered-list";
|
||||
|
||||
describe("NumberProperties", () => {
|
||||
let numberProperties: NumberProperties;
|
||||
|
||||
beforeEach(() => {
|
||||
numberProperties = new NumberProperties(5, 10);
|
||||
});
|
||||
|
||||
describe("#constructor()", () => {
|
||||
it("should create a Number Properties with correct root key", () => {
|
||||
const numberProperties = new NumberProperties(5, 9);
|
||||
|
||||
const tree = new Formatter().format(numberProperties);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:numPr": [
|
||||
{
|
||||
"w:ilvl": {
|
||||
_attr: {
|
||||
"w:val": 10,
|
||||
"w:val": 9,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -33,5 +29,9 @@ describe("NumberProperties", () => {
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("should throw an error if level exceeds 9", () => {
|
||||
expect(() => new NumberProperties(5, 10)).to.throw();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -11,6 +11,13 @@ export class NumberProperties extends XmlComponent {
|
||||
class IndentLevel extends XmlComponent {
|
||||
constructor(level: number) {
|
||||
super("w:ilvl");
|
||||
|
||||
if (level > 9) {
|
||||
throw new Error(
|
||||
"Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7",
|
||||
);
|
||||
}
|
||||
|
||||
this.root.push(
|
||||
new Attributes({
|
||||
val: level,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { XmlAttributeComponent } from "file/xml-components";
|
||||
|
||||
export class BookmarkStartAttributes extends XmlAttributeComponent<{
|
||||
readonly id: string;
|
||||
readonly id: number;
|
||||
readonly name: string;
|
||||
}> {
|
||||
protected readonly xmlKeys = {
|
||||
@ -11,7 +11,7 @@ export class BookmarkStartAttributes extends XmlAttributeComponent<{
|
||||
}
|
||||
|
||||
export class BookmarkEndAttributes extends XmlAttributeComponent<{
|
||||
readonly id: string;
|
||||
readonly id: number;
|
||||
}> {
|
||||
protected readonly xmlKeys = {
|
||||
id: "w:id",
|
||||
|
@ -36,6 +36,6 @@ describe("Bookmark", () => {
|
||||
|
||||
it("should create a bookmark with the correct attributes on the bookmark end element", () => {
|
||||
const newJson = Utility.jsonify(bookmark);
|
||||
expect(newJson.end.root[0].root.id).to.be.a("string");
|
||||
expect(newJson.end.root[0].root.id).to.be.a("number");
|
||||
});
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
// http://officeopenxml.com/WPbookmark.php
|
||||
import { uniqueId } from "convenience-functions";
|
||||
import { uniqueNumericId } from "convenience-functions";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
|
||||
import { ParagraphChild } from "../paragraph";
|
||||
@ -11,7 +11,7 @@ export class Bookmark {
|
||||
public readonly end: BookmarkEnd;
|
||||
|
||||
constructor(options: { readonly id: string; readonly children: ParagraphChild[] }) {
|
||||
const linkId = uniqueId();
|
||||
const linkId = uniqueNumericId();
|
||||
|
||||
this.start = new BookmarkStart(options.id, linkId);
|
||||
this.children = options.children;
|
||||
@ -19,8 +19,40 @@ export class Bookmark {
|
||||
}
|
||||
}
|
||||
|
||||
// <xsd:element name="bookmarkStart" type="CT_Bookmark"/>
|
||||
// <xsd:element name="bookmarkEnd" type="CT_MarkupRange"/>
|
||||
|
||||
// <xsd:complexType name="CT_Bookmark">
|
||||
// <xsd:complexContent>
|
||||
// <xsd:extension base="CT_BookmarkRange">
|
||||
// <xsd:attribute name="name" type="s:ST_String" use="required"/>
|
||||
// </xsd:extension>
|
||||
// </xsd:complexContent>
|
||||
// </xsd:complexType>
|
||||
|
||||
// <xsd:complexType name="CT_BookmarkRange">
|
||||
// <xsd:complexContent>
|
||||
// <xsd:extension base="CT_MarkupRange">
|
||||
// <xsd:attribute name="colFirst" type="ST_DecimalNumber" use="optional"/>
|
||||
// <xsd:attribute name="colLast" type="ST_DecimalNumber" use="optional"/>
|
||||
// </xsd:extension>
|
||||
// </xsd:complexContent>
|
||||
// </xsd:complexType>
|
||||
|
||||
// <xsd:complexType name="CT_MarkupRange">
|
||||
// <xsd:complexContent>
|
||||
// <xsd:extension base="CT_Markup">
|
||||
// <xsd:attribute name="displacedByCustomXml" type="ST_DisplacedByCustomXml" use="optional"/>
|
||||
// </xsd:extension>
|
||||
// </xsd:complexContent>
|
||||
// </xsd:complexType>
|
||||
|
||||
// <xsd:complexType name="CT_Markup">
|
||||
// <xsd:attribute name="id" type="ST_DecimalNumber" use="required"/>
|
||||
// </xsd:complexType>
|
||||
|
||||
export class BookmarkStart extends XmlComponent {
|
||||
constructor(id: string, linkId: string) {
|
||||
constructor(id: string, linkId: number) {
|
||||
super("w:bookmarkStart");
|
||||
|
||||
const attributes = new BookmarkStartAttributes({
|
||||
@ -32,7 +64,7 @@ export class BookmarkStart extends XmlComponent {
|
||||
}
|
||||
|
||||
export class BookmarkEnd extends XmlComponent {
|
||||
constructor(linkId: string) {
|
||||
constructor(linkId: number) {
|
||||
super("w:bookmarkEnd");
|
||||
|
||||
const attributes = new BookmarkEndAttributes({
|
||||
|
@ -22,6 +22,9 @@ describe("Paragraph", () => {
|
||||
stub(convenienceFunctions, "uniqueId").callsFake(() => {
|
||||
return "test-unique-id";
|
||||
});
|
||||
stub(convenienceFunctions, "uniqueNumericId").callsFake(() => {
|
||||
return -101;
|
||||
});
|
||||
});
|
||||
|
||||
after(() => {
|
||||
@ -716,7 +719,7 @@ describe("Paragraph", () => {
|
||||
{
|
||||
"w:bookmarkStart": {
|
||||
_attr: {
|
||||
"w:id": "test-unique-id",
|
||||
"w:id": -101,
|
||||
"w:name": "test-id",
|
||||
},
|
||||
},
|
||||
@ -738,7 +741,7 @@ describe("Paragraph", () => {
|
||||
{
|
||||
"w:bookmarkEnd": {
|
||||
_attr: {
|
||||
"w:id": "test-unique-id",
|
||||
"w:id": -101,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -70,18 +70,7 @@ describe("ParagraphProperties", () => {
|
||||
const properties = new ParagraphProperties({
|
||||
widowControl: true,
|
||||
});
|
||||
const tree = new Formatter().format(properties, {
|
||||
// tslint:disable-next-line: no-object-literal-type-assertion
|
||||
file: {
|
||||
Numbering: {
|
||||
createConcreteNumberingInstance: (_: string, __: number) => {
|
||||
return;
|
||||
},
|
||||
},
|
||||
} as File,
|
||||
// tslint:disable-next-line: no-object-literal-type-assertion
|
||||
viewWrapper: new DocumentWrapper({ background: {} }),
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
|
||||
expect(tree).to.deep.equal({
|
||||
"w:pPr": [
|
||||
@ -91,5 +80,50 @@ describe("ParagraphProperties", () => {
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("should create with the bidirectional property", () => {
|
||||
const properties = new ParagraphProperties({
|
||||
bidirectional: true,
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
|
||||
expect(tree).to.deep.equal({
|
||||
"w:pPr": [
|
||||
{
|
||||
"w:bidi": {},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("should create with the contextualSpacing property", () => {
|
||||
const properties = new ParagraphProperties({
|
||||
contextualSpacing: true,
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
|
||||
expect(tree).to.deep.equal({
|
||||
"w:pPr": [
|
||||
{
|
||||
"w:contextualSpacing": {},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("should create with the suppressLineNumbers property", () => {
|
||||
const properties = new ParagraphProperties({
|
||||
suppressLineNumbers: true,
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
|
||||
expect(tree).to.deep.equal({
|
||||
"w:pPr": [
|
||||
{
|
||||
"w:suppressLineNumbers": {},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -146,7 +146,7 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
|
||||
}
|
||||
|
||||
if (options.bidirectional !== undefined) {
|
||||
this.push(new OnOffElement("w:bidi", options.contextualSpacing));
|
||||
this.push(new OnOffElement("w:bidi", options.bidirectional));
|
||||
}
|
||||
|
||||
if (options.spacing) {
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { ChangeAttributes, IChangedAttributesProperties } from "../../track-revision/track-revision";
|
||||
|
||||
import { IShadingAttributesProperties, Shading } from "file/shading";
|
||||
import { HpsMeasureElement, IgnoreIfEmptyXmlComponent, OnOffElement, StringValueElement, XmlComponent } from "file/xml-components";
|
||||
import { EmphasisMark, EmphasisMarkType } from "./emphasis-mark";
|
||||
@ -40,12 +42,15 @@ export interface IRunStylePropertiesOptions {
|
||||
readonly shading?: IShadingAttributesProperties;
|
||||
readonly emboss?: boolean;
|
||||
readonly imprint?: boolean;
|
||||
readonly revision?: IRunPropertiesChangeOptions;
|
||||
}
|
||||
|
||||
export interface IRunPropertiesOptions extends IRunStylePropertiesOptions {
|
||||
readonly style?: string;
|
||||
}
|
||||
|
||||
export interface IRunPropertiesChangeOptions extends IRunPropertiesOptions, IChangedAttributesProperties {}
|
||||
|
||||
// <xsd:group name="EG_RPrBase">
|
||||
// <xsd:choice>
|
||||
// <xsd:element name="rStyle" type="CT_String"/>
|
||||
@ -200,9 +205,27 @@ export class RunProperties extends IgnoreIfEmptyXmlComponent {
|
||||
if (options.shading) {
|
||||
this.push(new Shading(options.shading));
|
||||
}
|
||||
|
||||
if (options.revision) {
|
||||
this.push(new RunPropertiesChange(options.revision));
|
||||
}
|
||||
}
|
||||
|
||||
public push(item: XmlComponent): void {
|
||||
this.root.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
export class RunPropertiesChange extends XmlComponent {
|
||||
constructor(options: IRunPropertiesChangeOptions) {
|
||||
super("w:rPrChange");
|
||||
this.root.push(
|
||||
new ChangeAttributes({
|
||||
id: options.id,
|
||||
author: options.author,
|
||||
date: options.date,
|
||||
}),
|
||||
);
|
||||
this.addChildElement(new RunProperties(options as IRunPropertiesOptions));
|
||||
}
|
||||
}
|
||||
|
@ -428,4 +428,64 @@ describe("Run", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("#revisions", () => {
|
||||
it("should add style revisions", () => {
|
||||
const run = new Run({
|
||||
bold: true,
|
||||
italics: true,
|
||||
revision: {
|
||||
id: 0,
|
||||
author: "Firstname Lastname",
|
||||
date: "123",
|
||||
bold: false,
|
||||
italics: true,
|
||||
},
|
||||
});
|
||||
const tree = new Formatter().format(run);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:r": [
|
||||
{
|
||||
"w:rPr": [
|
||||
{ "w:b": {} },
|
||||
{
|
||||
"w:bCs": {},
|
||||
},
|
||||
{ "w:i": {} },
|
||||
{
|
||||
"w:iCs": {},
|
||||
},
|
||||
{
|
||||
"w:rPrChange": [
|
||||
{
|
||||
_attr: {
|
||||
"w:author": "Firstname Lastname",
|
||||
"w:date": "123",
|
||||
"w:id": 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
"w:rPr": [
|
||||
{ "w:b": { _attr: { "w:val": false } } },
|
||||
{
|
||||
"w:bCs": {
|
||||
_attr: {
|
||||
"w:val": false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "w:i": {} },
|
||||
{
|
||||
"w:iCs": {},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user