docx 9.2.0 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.iife.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/index.umd.cjs +3 -3
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
[![Known Vulnerabilities][snky-image]][snky-url]
|
|
15
15
|
[![PRs Welcome][pr-image]][pr-url]
|
|
16
16
|
[![codecov][codecov-image]][codecov-url]
|
|
17
|
+
[![Docx.js Editor][docxjs-editor-image]][docxjs-editor-url]
|
|
17
18
|
|
|
18
19
|
<p align="center">
|
|
19
20
|
<img src="https://i.imgur.com/QeL1HuU.png" alt="drawing"/>
|
|
@@ -64,6 +65,10 @@ More [here](https://github.com/dolanmiu/docx/tree/master/demo)
|
|
|
64
65
|
|
|
65
66
|
Please refer to the [documentation at https://docx.js.org/](https://docx.js.org/) for details on how to use this library, examples and much more!
|
|
66
67
|
|
|
68
|
+
# Playground
|
|
69
|
+
|
|
70
|
+
Experience `docx` in action through [Docx.js Editor][docxjs-editor-url], an interactive playground where you can code and preview the results in real-time.
|
|
71
|
+
|
|
67
72
|
# Examples
|
|
68
73
|
|
|
69
74
|
Check the [demo folder](https://github.com/dolanmiu/docx/tree/master/demo) for examples.
|
|
@@ -115,3 +120,5 @@ Made with 💖
|
|
|
115
120
|
[patreon-url]: https://www.patreon.com/dolanmiu
|
|
116
121
|
[browserstack-image]: https://user-images.githubusercontent.com/2917613/54233552-128e9d00-4505-11e9-88fb-025a4e04007c.png
|
|
117
122
|
[browserstack-url]: https://www.browserstack.com
|
|
123
|
+
[docxjs-editor-image]: https://img.shields.io/badge/Docx.js%20Editor-2b579a.svg?style=flat&logo=javascript&logoColor=white
|
|
124
|
+
[docxjs-editor-url]: https://docxjs-editor.vercel.app/
|
package/dist/index.cjs
CHANGED
|
@@ -13017,7 +13017,7 @@ class SpacingAttributes extends XmlAttributeComponent {
|
|
|
13017
13017
|
line: "w:line",
|
|
13018
13018
|
lineRule: "w:lineRule",
|
|
13019
13019
|
beforeAutoSpacing: "w:beforeAutospacing",
|
|
13020
|
-
afterAutoSpacing: "w:
|
|
13020
|
+
afterAutoSpacing: "w:afterAutospacing"
|
|
13021
13021
|
});
|
|
13022
13022
|
}
|
|
13023
13023
|
}
|
|
@@ -15310,10 +15310,10 @@ const createFont = ({
|
|
|
15310
15310
|
// http://www.datypic.com/sc/ooxml/e-w_charset-1.html
|
|
15311
15311
|
...charset ? [createStringElement("w:charset", charset)] : [],
|
|
15312
15312
|
// http://www.datypic.com/sc/ooxml/e-w_family-1.html
|
|
15313
|
-
...
|
|
15313
|
+
...[createStringElement("w:family", family)],
|
|
15314
15314
|
// http://www.datypic.com/sc/ooxml/e-w_notTrueType-1.html
|
|
15315
15315
|
...notTrueType ? [new OnOffElement("w:notTrueType", notTrueType)] : [],
|
|
15316
|
-
...
|
|
15316
|
+
...[createStringElement("w:pitch", pitch)],
|
|
15317
15317
|
// http://www.datypic.com/sc/ooxml/e-w_sig-1.html
|
|
15318
15318
|
...sig ? [
|
|
15319
15319
|
new BuilderElement({
|
package/dist/index.d.cts
CHANGED
|
@@ -1387,7 +1387,7 @@ export declare type IParagraphStylePropertiesOptions = {
|
|
|
1387
1387
|
|
|
1388
1388
|
export declare type IPatch = ParagraphPatch | FilePatch;
|
|
1389
1389
|
|
|
1390
|
-
declare type IPropertiesOptions = {
|
|
1390
|
+
export declare type IPropertiesOptions = {
|
|
1391
1391
|
readonly sections: readonly ISectionOptions[];
|
|
1392
1392
|
readonly title?: string;
|
|
1393
1393
|
readonly subject?: string;
|
|
@@ -2142,7 +2142,7 @@ declare type OutlineSchemeSolidFill = {
|
|
|
2142
2142
|
|
|
2143
2143
|
declare type OutlineSolidFill = OutlineRgbSolidFill | OutlineSchemeSolidFill;
|
|
2144
2144
|
|
|
2145
|
-
declare type OutputByType = {
|
|
2145
|
+
export declare type OutputByType = {
|
|
2146
2146
|
readonly base64: string;
|
|
2147
2147
|
readonly string: string;
|
|
2148
2148
|
readonly text: string;
|
|
@@ -2154,7 +2154,7 @@ declare type OutputByType = {
|
|
|
2154
2154
|
readonly nodebuffer: Buffer;
|
|
2155
2155
|
};
|
|
2156
2156
|
|
|
2157
|
-
declare type OutputType = keyof OutputByType;
|
|
2157
|
+
export declare type OutputType = keyof OutputByType;
|
|
2158
2158
|
|
|
2159
2159
|
export declare const OverlapType: {
|
|
2160
2160
|
readonly NEVER: "never";
|
package/dist/index.d.ts
CHANGED
|
@@ -1387,7 +1387,7 @@ export declare type IParagraphStylePropertiesOptions = {
|
|
|
1387
1387
|
|
|
1388
1388
|
export declare type IPatch = ParagraphPatch | FilePatch;
|
|
1389
1389
|
|
|
1390
|
-
declare type IPropertiesOptions = {
|
|
1390
|
+
export declare type IPropertiesOptions = {
|
|
1391
1391
|
readonly sections: readonly ISectionOptions[];
|
|
1392
1392
|
readonly title?: string;
|
|
1393
1393
|
readonly subject?: string;
|
|
@@ -2142,7 +2142,7 @@ declare type OutlineSchemeSolidFill = {
|
|
|
2142
2142
|
|
|
2143
2143
|
declare type OutlineSolidFill = OutlineRgbSolidFill | OutlineSchemeSolidFill;
|
|
2144
2144
|
|
|
2145
|
-
declare type OutputByType = {
|
|
2145
|
+
export declare type OutputByType = {
|
|
2146
2146
|
readonly base64: string;
|
|
2147
2147
|
readonly string: string;
|
|
2148
2148
|
readonly text: string;
|
|
@@ -2154,7 +2154,7 @@ declare type OutputByType = {
|
|
|
2154
2154
|
readonly nodebuffer: Buffer;
|
|
2155
2155
|
};
|
|
2156
2156
|
|
|
2157
|
-
declare type OutputType = keyof OutputByType;
|
|
2157
|
+
export declare type OutputType = keyof OutputByType;
|
|
2158
2158
|
|
|
2159
2159
|
export declare const OverlapType: {
|
|
2160
2160
|
readonly NEVER: "never";
|
package/dist/index.iife.js
CHANGED
|
@@ -13017,7 +13017,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
13017
13017
|
line: "w:line",
|
|
13018
13018
|
lineRule: "w:lineRule",
|
|
13019
13019
|
beforeAutoSpacing: "w:beforeAutospacing",
|
|
13020
|
-
afterAutoSpacing: "w:
|
|
13020
|
+
afterAutoSpacing: "w:afterAutospacing"
|
|
13021
13021
|
});
|
|
13022
13022
|
}
|
|
13023
13023
|
}
|
|
@@ -15310,10 +15310,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
15310
15310
|
// http://www.datypic.com/sc/ooxml/e-w_charset-1.html
|
|
15311
15311
|
...charset ? [createStringElement("w:charset", charset)] : [],
|
|
15312
15312
|
// http://www.datypic.com/sc/ooxml/e-w_family-1.html
|
|
15313
|
-
...
|
|
15313
|
+
...[createStringElement("w:family", family)],
|
|
15314
15314
|
// http://www.datypic.com/sc/ooxml/e-w_notTrueType-1.html
|
|
15315
15315
|
...notTrueType ? [new OnOffElement("w:notTrueType", notTrueType)] : [],
|
|
15316
|
-
...
|
|
15316
|
+
...[createStringElement("w:pitch", pitch)],
|
|
15317
15317
|
// http://www.datypic.com/sc/ooxml/e-w_sig-1.html
|
|
15318
15318
|
...sig ? [
|
|
15319
15319
|
new BuilderElement({
|
package/dist/index.mjs
CHANGED
|
@@ -13015,7 +13015,7 @@ class SpacingAttributes extends XmlAttributeComponent {
|
|
|
13015
13015
|
line: "w:line",
|
|
13016
13016
|
lineRule: "w:lineRule",
|
|
13017
13017
|
beforeAutoSpacing: "w:beforeAutospacing",
|
|
13018
|
-
afterAutoSpacing: "w:
|
|
13018
|
+
afterAutoSpacing: "w:afterAutospacing"
|
|
13019
13019
|
});
|
|
13020
13020
|
}
|
|
13021
13021
|
}
|
|
@@ -15308,10 +15308,10 @@ const createFont = ({
|
|
|
15308
15308
|
// http://www.datypic.com/sc/ooxml/e-w_charset-1.html
|
|
15309
15309
|
...charset ? [createStringElement("w:charset", charset)] : [],
|
|
15310
15310
|
// http://www.datypic.com/sc/ooxml/e-w_family-1.html
|
|
15311
|
-
...
|
|
15311
|
+
...[createStringElement("w:family", family)],
|
|
15312
15312
|
// http://www.datypic.com/sc/ooxml/e-w_notTrueType-1.html
|
|
15313
15313
|
...notTrueType ? [new OnOffElement("w:notTrueType", notTrueType)] : [],
|
|
15314
|
-
...
|
|
15314
|
+
...[createStringElement("w:pitch", pitch)],
|
|
15315
15315
|
// http://www.datypic.com/sc/ooxml/e-w_sig-1.html
|
|
15316
15316
|
...sig ? [
|
|
15317
15317
|
new BuilderElement({
|
package/dist/index.umd.cjs
CHANGED
|
@@ -13019,7 +13019,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
13019
13019
|
line: "w:line",
|
|
13020
13020
|
lineRule: "w:lineRule",
|
|
13021
13021
|
beforeAutoSpacing: "w:beforeAutospacing",
|
|
13022
|
-
afterAutoSpacing: "w:
|
|
13022
|
+
afterAutoSpacing: "w:afterAutospacing"
|
|
13023
13023
|
});
|
|
13024
13024
|
}
|
|
13025
13025
|
}
|
|
@@ -15312,10 +15312,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
15312
15312
|
// http://www.datypic.com/sc/ooxml/e-w_charset-1.html
|
|
15313
15313
|
...charset ? [createStringElement("w:charset", charset)] : [],
|
|
15314
15314
|
// http://www.datypic.com/sc/ooxml/e-w_family-1.html
|
|
15315
|
-
...
|
|
15315
|
+
...[createStringElement("w:family", family)],
|
|
15316
15316
|
// http://www.datypic.com/sc/ooxml/e-w_notTrueType-1.html
|
|
15317
15317
|
...notTrueType ? [new OnOffElement("w:notTrueType", notTrueType)] : [],
|
|
15318
|
-
...
|
|
15318
|
+
...[createStringElement("w:pitch", pitch)],
|
|
15319
15319
|
// http://www.datypic.com/sc/ooxml/e-w_sig-1.html
|
|
15320
15320
|
...sig ? [
|
|
15321
15321
|
new BuilderElement({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docx",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.3.0",
|
|
4
4
|
"description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.umd.cjs",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/node": "^22.7.5",
|
|
62
62
|
"hash.js": "^1.1.7",
|
|
63
63
|
"jszip": "^3.10.1",
|
|
64
|
-
"nanoid": "^5.
|
|
64
|
+
"nanoid": "^5.1.3",
|
|
65
65
|
"xml": "^1.0.1",
|
|
66
66
|
"xml-js": "^1.6.8"
|
|
67
67
|
},
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"@types/xml": "^1.0.8",
|
|
80
80
|
"@typescript-eslint/eslint-plugin": "^8.8.1",
|
|
81
81
|
"@typescript-eslint/parser": "^8.8.1",
|
|
82
|
-
"@vitest/coverage-v8": "^
|
|
83
|
-
"@vitest/ui": "^
|
|
82
|
+
"@vitest/coverage-v8": "^3.0.8",
|
|
83
|
+
"@vitest/ui": "^3.0.8",
|
|
84
84
|
"cspell": "^8.2.3",
|
|
85
85
|
"docsify-cli": "^4.3.0",
|
|
86
86
|
"eslint": "^9.13.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"glob": "^11.0.0",
|
|
96
96
|
"inquirer": "^12.0.0",
|
|
97
97
|
"jiti": "^2.3.3",
|
|
98
|
-
"jsdom": "^
|
|
98
|
+
"jsdom": "^26.0.0",
|
|
99
99
|
"pre-commit": "^1.2.2",
|
|
100
100
|
"prettier": "^3.1.1",
|
|
101
101
|
"tsconfig-paths": "^4.0.0",
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
"unzipper": "^0.12.3",
|
|
107
107
|
"vite": "^6.0.1",
|
|
108
108
|
"vite-plugin-dts": "^4.2.4",
|
|
109
|
-
"vite-plugin-node-polyfills": "^0.
|
|
109
|
+
"vite-plugin-node-polyfills": "^0.23.0",
|
|
110
110
|
"vite-tsconfig-paths": "^5.0.1",
|
|
111
|
-
"vitest": "^
|
|
111
|
+
"vitest": "^3.0.8"
|
|
112
112
|
},
|
|
113
113
|
"engines": {
|
|
114
114
|
"node": ">=10"
|