Compare commits

...

346 Commits
8.1.0 ... 9.3.0

Author SHA1 Message Date
a708475539 export IPropertiesOptions for use by other libraries or code using docx library (#2979)
* export IPropertiesOptions for use by other libraries or code using docx library

* fixes #2978: export OutputTypes

* Export file in main index file

* Move type export to inside

---------

Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2025-03-15 03:18:43 +00:00
9c60cfcbc7 build(deps): bump the npm_and_yarn group with 12 updates (#2992)
Bumps the npm_and_yarn group with 15 updates:

| Package | From | To |
| --- | --- | --- |
| [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `2.1.8` | `2.1.9` |
| [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) | `2.1.8` | `2.1.9` |
| [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) | `2.1.8` | `2.1.9` |
| [dompurify](https://github.com/cure53/DOMPurify) | `2.5.7` | `removed` |
| [docsify](https://github.com/docsifyjs/docsify) | `4.12.2` | `4.13.1` |
| [docsify-server-renderer](https://github.com/docsifyjs/docsify) | `4.12.2` | `4.13.1` |
| [elliptic](https://github.com/indutny/elliptic) | `6.6.0` | `6.6.1` |
| [esbuild](https://github.com/evanw/esbuild) | `0.21.5` | `0.25.1` |
| [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) | `2.1.9` | `3.0.8` |
| [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) | `2.1.9` | `3.0.8` |
| [tsx](https://github.com/privatenumber/tsx) | `4.19.2` | `4.19.3` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `6.0.9` | `6.2.2` |
| [vite-plugin-node-polyfills](https://github.com/davidmyersdev/vite-plugin-node-polyfills) | `0.22.0` | `0.23.0` |
| [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `2.1.9` | `3.0.8` |
| [prismjs](https://github.com/PrismJS/prism) | `1.27.0` | `1.30.0` |


Updates `vitest` from 2.1.8 to 2.1.9
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/vitest)

Updates `@vitest/coverage-v8` from 2.1.8 to 2.1.9
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/coverage-v8)

Updates `@vitest/ui` from 2.1.8 to 2.1.9
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/ui)

Removes `dompurify`

Updates `docsify` from 4.12.2 to 4.13.1
- [Release notes](https://github.com/docsifyjs/docsify/releases)
- [Changelog](https://github.com/docsifyjs/docsify/blob/v4.13.1/CHANGELOG.md)
- [Commits](https://github.com/docsifyjs/docsify/compare/v4.12.2...v4.13.1)

Updates `docsify-server-renderer` from 4.12.2 to 4.13.1
- [Release notes](https://github.com/docsifyjs/docsify/releases)
- [Changelog](https://github.com/docsifyjs/docsify/blob/v4.13.1/CHANGELOG.md)
- [Commits](https://github.com/docsifyjs/docsify/compare/v4.12.2...v4.13.1)

Updates `elliptic` from 6.6.0 to 6.6.1
- [Commits](https://github.com/indutny/elliptic/compare/v6.6.0...v6.6.1)

Updates `esbuild` from 0.21.5 to 0.25.1
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.21.5...v0.25.1)

Updates `@vitest/coverage-v8` from 2.1.9 to 3.0.8
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/coverage-v8)

Updates `@vitest/ui` from 2.1.9 to 3.0.8
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/ui)

Updates `tsx` from 4.19.2 to 4.19.3
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.19.2...v4.19.3)

Updates `vite` from 6.0.9 to 6.2.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.2/packages/vite)

Updates `vite-plugin-node-polyfills` from 0.22.0 to 0.23.0
- [Release notes](https://github.com/davidmyersdev/vite-plugin-node-polyfills/releases)
- [Commits](https://github.com/davidmyersdev/vite-plugin-node-polyfills/compare/v0.22.0...v0.23.0)

Updates `vitest` from 2.1.9 to 3.0.8
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/vitest)

Updates `prismjs` from 1.27.0 to 1.30.0
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.27.0...v1.30.0)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: dompurify
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: docsify
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: docsify-server-renderer
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: elliptic
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: esbuild
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: tsx
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: vite
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: vite-plugin-node-polyfills
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: vitest
  dependency-type: direct:development
  dependency-group: npm_and_yarn
- dependency-name: prismjs
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-15 03:05:07 +00:00
a5454edc61 Feature/math improve (#2976)
* add new feature

* add test file

* update test file

* update test file

* Fix linting

---------

Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2025-03-15 03:04:01 +00:00
7152abfe48 build(deps-dev): bump eslint-plugin-jsdoc from 50.6.0 to 50.6.6 (#2987)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 50.6.0 to 50.6.6.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v50.6.0...v50.6.6)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:44:41 +00:00
075eeb7e3c build(deps-dev): bump eslint from 9.16.0 to 9.22.0 (#2983)
Bumps [eslint](https://github.com/eslint/eslint) from 9.16.0 to 9.22.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.16.0...v9.22.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:44:33 +00:00
f0acb3f3fb build(deps-dev): bump inquirer from 12.3.0 to 12.4.3 (#2982)
Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 12.3.0 to 12.4.3.
- [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
- [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@12.3.0...inquirer@12.4.3)

---
updated-dependencies:
- dependency-name: inquirer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:44:26 +00:00
ae048833a1 build(deps-dev): bump vite-plugin-dts from 4.3.0 to 4.5.3 (#2973)
Bumps [vite-plugin-dts](https://github.com/qmhc/vite-plugin-dts) from 4.3.0 to 4.5.3.
- [Release notes](https://github.com/qmhc/vite-plugin-dts/releases)
- [Changelog](https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/qmhc/vite-plugin-dts/compare/v4.3.0...v4.5.3)

---
updated-dependencies:
- dependency-name: vite-plugin-dts
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:44:17 +00:00
ebae72004c Fix support for after auto-spacing. (#2975) 2025-03-14 23:44:09 +00:00
13744abff5 build(deps-dev): bump cspell from 8.16.1 to 8.17.5 (#2969)
Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.16.1 to 8.17.5.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.17.5/packages/cspell)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:43:46 +00:00
492ef29d7f build(deps-dev): bump vite from 6.0.7 to 6.0.9 in the npm_and_yarn group (#2940)
Bumps the npm_and_yarn group with 1 update: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 6.0.7 to 6.0.9
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.0.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:43:39 +00:00
a6e6463a36 build(deps-dev): bump jiti from 2.4.1 to 2.4.2 (#2932)
Bumps [jiti](https://github.com/unjs/jiti) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/unjs/jiti/releases)
- [Changelog](https://github.com/unjs/jiti/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unjs/jiti/compare/v2.4.1...v2.4.2)

---
updated-dependencies:
- dependency-name: jiti
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:43:32 +00:00
2ef596543b build(deps-dev): bump glob from 11.0.0 to 11.0.1 (#2930)
Bumps [glob](https://github.com/isaacs/node-glob) from 11.0.0 to 11.0.1.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v11.0.0...v11.0.1)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:43:25 +00:00
85005c3c07 build(deps-dev): bump jsdom from 25.0.1 to 26.0.0 (#2928)
Bumps [jsdom](https://github.com/jsdom/jsdom) from 25.0.1 to 26.0.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/25.0.1...26.0.0)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 23:43:17 +00:00
0d2b433446 Chore: bump nanoid to fix security issue (#2991) 2025-03-14 23:43:08 +00:00
b1f67652e9 docs: add Playground (Docx.js Editor) url to README.md (#2965) 2025-02-23 20:36:33 +01:00
4e2befb7ef Update docs for new Packer methods (#2961)
To cover #2920
2025-02-17 21:22:07 +00:00
a887927968 Version bump 2025-02-16 18:35:16 +00:00
ee6db1429a Add shading and border settings to paragraph style options. (#2955)
* Add shading and border settings to paragraph style options.

* Fix prettier

---------

Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2025-02-16 18:33:21 +00:00
170309a7ed Add Packer.pack and Packer.toArrayBuffer (#2959)
* Add Packer.pack and Packer.toArrayBuffer

To mirror patchDocument's outputType parameter.

See https://github.com/dolanmiu/docx/discussions/2920

* Ignore coverage

---------

Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2025-02-16 18:24:15 +00:00
05fcf6edd4 Feat: subfile overrides (#2941)
* Adds overrides parameter to Packer methods and compiler

* Adds tests for overrides parameter

* Update Packer usage examples
2025-01-27 10:39:23 +00:00
eb2174e566 Version bump 2025-01-10 12:31:16 +00:00
2a56360875 build(deps-dev): bump typescript-eslint from 8.16.0 to 8.19.1 (#2921)
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.16.0 to 8.19.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.19.1/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-10 11:22:37 +00:00
ba862766a6 build(deps-dev): bump vite from 6.0.1 to 6.0.7 (#2919)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.0.1 to 6.0.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.0.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-10 11:22:29 +00:00
71291dab8f build(deps-dev): bump typedoc from 0.27.3 to 0.27.6 (#2913)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.27.3 to 0.27.6.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.27.3...v0.27.6)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-10 11:22:21 +00:00
974ba7b450 build(deps-dev): bump inquirer from 12.1.0 to 12.3.0 (#2908)
Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 12.1.0 to 12.3.0.
- [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
- [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@12.1.0...inquirer@12.3.0)

---
updated-dependencies:
- dependency-name: inquirer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-10 11:22:13 +00:00
8f7df39c07 build(deps-dev): bump execa from 9.5.1 to 9.5.2 (#2892)
Bumps [execa](https://github.com/sindresorhus/execa) from 9.5.1 to 9.5.2.
- [Release notes](https://github.com/sindresorhus/execa/releases)
- [Commits](https://github.com/sindresorhus/execa/compare/v9.5.1...v9.5.2)

---
updated-dependencies:
- dependency-name: execa
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-10 11:22:03 +00:00
ca3d8f0121 build(deps-dev): bump vite-tsconfig-paths from 5.1.3 to 5.1.4 (#2890)
Bumps [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) from 5.1.3 to 5.1.4.
- [Release notes](https://github.com/aleclarson/vite-tsconfig-paths/releases)
- [Commits](https://github.com/aleclarson/vite-tsconfig-paths/compare/v5.1.3...v5.1.4)

---
updated-dependencies:
- dependency-name: vite-tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-10 11:21:55 +00:00
46c517d195 build(deps-dev): bump eslint-import-resolver-typescript (#2887)
Bumps [eslint-import-resolver-typescript](https://github.com/import-js/eslint-import-resolver-typescript) from 3.6.3 to 3.7.0.
- [Release notes](https://github.com/import-js/eslint-import-resolver-typescript/releases)
- [Changelog](https://github.com/import-js/eslint-import-resolver-typescript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-import-resolver-typescript/compare/v3.6.3...v3.7.0)

---
updated-dependencies:
- dependency-name: eslint-import-resolver-typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-10 11:21:43 +00:00
ff37f3b460 fix: Ensure necessary namespaces are in patched doc (#2698)
* refactor: Extract timestamp properties

In preparation for reworking DocumentAttributes.

* refactor: Consolidate namespaces

* fix: Ensure necessary namespaces are in patched doc

Fixes #2697

* Fix tsc and ESLint errors

* Fix CSpell

* Add a test to fix code coverage failure
2025-01-06 22:19:00 +00:00
7b9b474484 Fix: custom fonts support on the Browser (#2898) 2024-12-19 02:08:52 +00:00
e80a50d36c #2846 Type error when importing docx in CJS file with TypeScript modu… (#2883)
* #2846 Type error when importing docx in CJS file with TypeScript moduleResolution set to node16

* Adhere to publint
2024-12-06 13:44:42 +00:00
df99f96469 Chore: Update vitest (#2882)
* Chore: Update vitest

* Fix test
2024-12-05 15:43:30 +00:00
f87ad6a43c build(deps-dev): bump typedoc from 0.26.11 to 0.27.3 (#2879)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.26.11 to 0.27.3.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.26.11...v0.27.3)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 14:04:43 +00:00
8bf5220e31 build(deps-dev): bump prettier from 3.3.3 to 3.4.2 (#2878)
Bumps [prettier](https://github.com/prettier/prettier) from 3.3.3 to 3.4.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.4.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 14:04:24 +00:00
da8148251a build(deps-dev): bump eslint from 9.14.0 to 9.16.0 (#2874)
Bumps [eslint](https://github.com/eslint/eslint) from 9.14.0 to 9.16.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.14.0...v9.16.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 14:04:06 +00:00
01183ac34d build(deps-dev): bump jiti from 2.4.0 to 2.4.1 (#2871)
Bumps [jiti](https://github.com/unjs/jiti) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/unjs/jiti/releases)
- [Changelog](https://github.com/unjs/jiti/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unjs/jiti/compare/v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: jiti
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 14:03:46 +00:00
d553e4763a build(deps): bump @types/node from 22.9.0 to 22.10.1 (#2868)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.9.0 to 22.10.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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 14:03:36 +00:00
213c3d29f3 build(deps-dev): bump eslint-plugin-unicorn from 56.0.0 to 56.0.1 (#2867)
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 56.0.0 to 56.0.1.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v56.0.0...v56.0.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-unicorn
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 14:03:28 +00:00
697c1d91c6 build(deps): bump nanoid from 5.0.8 to 5.0.9 (#2866)
Bumps [nanoid](https://github.com/ai/nanoid) from 5.0.8 to 5.0.9.
- [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/5.0.8...5.0.9)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 14:03:07 +00:00
b22de4ac4f build(deps-dev): bump cspell from 8.16.0 to 8.16.1 (#2865)
Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.16.0 to 8.16.1.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.16.1/packages/cspell)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 14:02:53 +00:00
0af9d27dcc Chore: Remove @eslint/compat (#2881) 2024-12-05 13:54:43 +00:00
b89b571c4e Fix replacer error on patches with empty Runs (#2875)
* Add test to demonstrate empty strings not creating runs

* Fix Run not creating Text child for empty strings

* Simplify TextRun constructor

Since `Run` already has a option for instantiating a `Text` element, we don't need to push children here.

* Add replacer test for empty runs

* Add replacer test for empty runs

* replacer: handle patches with empty runs

* Fix incorrect test name
2024-12-03 11:25:22 +00:00
64505a295f build(deps-dev): bump eslint-plugin-jsdoc from 50.4.3 to 50.6.0 (#2863)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 50.4.3 to 50.6.0.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v50.4.3...v50.6.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-28 10:47:45 +00:00
c247bbf409 build(deps-dev): bump @vitest/ui from 2.1.4 to 2.1.6 (#2862)
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 2.1.4 to 2.1.6.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.6/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-28 10:47:22 +00:00
4c60e6a0c0 build(deps-dev): bump vite from 5.4.10 to 6.0.1 (#2861)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.10 to 6.0.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.0.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-28 10:47:13 +00:00
086e5ef184 build(deps-dev): bump typescript-eslint from 8.13.0 to 8.16.0 (#2857)
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.13.0 to 8.16.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.16.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-28 10:46:36 +00:00
7e81f7b368 build(deps-dev): bump vite-tsconfig-paths from 5.1.0 to 5.1.3 (#2850)
Bumps [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) from 5.1.0 to 5.1.3.
- [Release notes](https://github.com/aleclarson/vite-tsconfig-paths/releases)
- [Commits](https://github.com/aleclarson/vite-tsconfig-paths/compare/v5.1.0...v5.1.3)

---
updated-dependencies:
- dependency-name: vite-tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-28 10:46:26 +00:00
defa431aa9 build(deps-dev): bump inquirer from 12.0.1 to 12.1.0 (#2838)
Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 12.0.1 to 12.1.0.
- [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
- [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@12.0.1...inquirer@12.1.0)

---
updated-dependencies:
- dependency-name: inquirer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-28 10:44:33 +00:00
17eb4fe8c4 Version bump 2024-11-28 10:38:29 +00:00
3997ce538d fix(replacer): errors suppressed by catch statement (#2856) 2024-11-28 10:35:11 +00:00
3654eb0800 New Textbox Component (#2718)
* Adding textbox with no props

* Fixing namings and adding shape style

* simplify usage

* Fix linting issues

* Re-name demo

* Use new shape authoring style

* Add tests

Simplify API

* Add better types for styles

* Add more options to TextBox and add documentation

---------

Co-authored-by: zohar11 <zohar@sumit-ai.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-11-28 10:33:19 +00:00
c6bb255641 Add hyphenation support (#2678)
* Add hyphenation support

* Remove unneeded linebreaks

* Add documentation and fix eslint

* Add tests

---------

Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2024-11-21 10:41:31 +00:00
05a3cf5b43 fix: add rel to fontTable (#2800)
* fix: add rel to fontTable

* Fix prettier

---------

Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-11-20 11:19:43 +00:00
dece0f58e1 Fix duplicated br tags (#2717)
* Adjust test to demo duplicated br tags

* Fix patchDocument duplicating br tags

* Only include w:Pr

* Fix tag condition

---------

Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-11-20 11:19:25 +00:00
7f3c5615c9 Version bump 2024-11-07 23:46:27 +00:00
56d23176b7 build(deps-dev): bump cspell from 8.15.7 to 8.16.0 (#2834)
Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.15.7 to 8.16.0.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.16.0/packages/cspell)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-07 20:56:09 +00:00
958538c96a build(deps): bump @types/node from 22.8.6 to 22.9.0 (#2833)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.8.6 to 22.9.0.
- [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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-07 02:50:49 +00:00
9fa6d5392b build(deps-dev): bump typescript-eslint from 8.12.2 to 8.13.0 (#2832)
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.12.2 to 8.13.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.13.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-07 02:50:41 +00:00
d7fdbf9736 build(deps-dev): bump @typescript-eslint/parser from 8.12.2 to 8.13.0 (#2831)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.12.2 to 8.13.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.13.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-07 02:40:01 +00:00
0af1279b1d build(deps-dev): bump vite-tsconfig-paths from 5.0.1 to 5.1.0 (#2830)
Bumps [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) from 5.0.1 to 5.1.0.
- [Release notes](https://github.com/aleclarson/vite-tsconfig-paths/releases)
- [Commits](https://github.com/aleclarson/vite-tsconfig-paths/compare/v5.0.1...v5.1.0)

---
updated-dependencies:
- dependency-name: vite-tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-06 00:54:50 +00:00
2bb2333cb9 build(deps-dev): bump @typescript-eslint/eslint-plugin (#2829)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.12.2 to 8.13.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.13.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-06 00:54:42 +00:00
78c511cab9 build(deps-dev): bump tsx from 4.19.1 to 4.19.2 (#2827)
Bumps [tsx](https://github.com/privatenumber/tsx) from 4.19.1 to 4.19.2.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.19.1...v4.19.2)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:02:55 +00:00
4016e961a9 build(deps-dev): bump typedoc from 0.26.10 to 0.26.11 (#2826)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.26.10 to 0.26.11.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.26.10...v0.26.11)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:02:48 +00:00
9f3888d94f build(deps-dev): bump @eslint/compat from 1.2.1 to 1.2.2 (#2825)
Bumps [@eslint/compat](https://github.com/eslint/rewrite) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](https://github.com/eslint/rewrite/compare/compat-v1.2.1...compat-v1.2.2)

---
updated-dependencies:
- dependency-name: "@eslint/compat"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:02:41 +00:00
316891a1f2 build(deps-dev): bump @vitest/ui from 2.1.3 to 2.1.4 (#2824)
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 2.1.3 to 2.1.4.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.4/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:02:33 +00:00
0a9d844dcc build(deps-dev): bump jiti from 2.3.3 to 2.4.0 (#2823)
Bumps [jiti](https://github.com/unjs/jiti) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/unjs/jiti/releases)
- [Changelog](https://github.com/unjs/jiti/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unjs/jiti/compare/v2.3.3...v2.4.0)

---
updated-dependencies:
- dependency-name: jiti
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:02:24 +00:00
15b8d85562 build(deps-dev): bump cspell from 8.15.4 to 8.15.7 (#2822)
Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.15.4 to 8.15.7.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.15.7/packages/cspell)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:02:17 +00:00
d1f3df5600 build(deps): bump nanoid from 5.0.7 to 5.0.8 (#2821)
Bumps [nanoid](https://github.com/ai/nanoid) from 5.0.7 to 5.0.8.
- [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/5.0.7...5.0.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:02:08 +00:00
0fc0921aa9 build(deps-dev): bump eslint from 9.13.0 to 9.14.0 (#2820)
Bumps [eslint](https://github.com/eslint/eslint) from 9.13.0 to 9.14.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.13.0...v9.14.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:02:02 +00:00
7ad4c5409c build(deps-dev): bump typescript-eslint from 8.10.0 to 8.12.2 (#2816)
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.10.0 to 8.12.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.2/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 01:01:53 +00:00
a645accf5d build(deps-dev): bump @typescript-eslint/eslint-plugin (#2815)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.10.0 to 8.12.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.2/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 23:17:44 +00:00
b64cb2d448 build(deps): bump @types/node from 22.7.6 to 22.8.6 (#2819)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.6 to 22.8.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-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 22:59:26 +00:00
cfcea6c863 build(deps-dev): bump elliptic in the npm_and_yarn group (#2817)
Bumps the npm_and_yarn group with 1 update: [elliptic](https://github.com/indutny/elliptic).


Updates `elliptic` from 6.5.7 to 6.6.0
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.7...v6.6.0)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 22:59:13 +00:00
d1cd17ff6e build(deps-dev): bump @typescript-eslint/parser from 8.10.0 to 8.12.2 (#2814)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.10.0 to 8.12.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.2/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 22:58:54 +00:00
408869fa96 build(deps-dev): bump execa from 9.4.1 to 9.5.1 (#2808)
Bumps [execa](https://github.com/sindresorhus/execa) from 9.4.1 to 9.5.1.
- [Release notes](https://github.com/sindresorhus/execa/releases)
- [Commits](https://github.com/sindresorhus/execa/compare/v9.4.1...v9.5.1)

---
updated-dependencies:
- dependency-name: execa
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 22:58:46 +00:00
ed146fbffd build(deps-dev): bump inquirer from 12.0.0 to 12.0.1 (#2805)
Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 12.0.0 to 12.0.1.
- [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
- [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@12.0.0...inquirer@12.0.1)

---
updated-dependencies:
- dependency-name: inquirer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 22:58:37 +00:00
e49e1cc7b9 build(deps-dev): bump vite-plugin-dts from 4.2.4 to 4.3.0 (#2803)
Bumps [vite-plugin-dts](https://github.com/qmhc/vite-plugin-dts) from 4.2.4 to 4.3.0.
- [Release notes](https://github.com/qmhc/vite-plugin-dts/releases)
- [Changelog](https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/qmhc/vite-plugin-dts/compare/v4.2.4...v4.3.0)

---
updated-dependencies:
- dependency-name: vite-plugin-dts
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 22:58:29 +00:00
2c9233c021 build(deps-dev): bump vite from 5.4.9 to 5.4.10 (#2801)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.9 to 5.4.10.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.10/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.10/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 22:58:22 +00:00
b2ad04e4e7 build(deps-dev): bump eslint-plugin-functional from 7.0.2 to 7.1.0 (#2794)
Bumps [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional) from 7.0.2 to 7.1.0.
- [Release notes](https://github.com/eslint-functional/eslint-plugin-functional/releases)
- [Changelog](https://github.com/eslint-functional/eslint-plugin-functional/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint-functional/eslint-plugin-functional/compare/v7.0.2...v7.1.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-functional
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 22:58:14 +00:00
2381ba8a05 build(deps-dev): bump eslint from 8.57.1 to 9.13.0 (#2792)
* build(deps-dev): bump eslint from 8.57.1 to 9.13.0

Bumps [eslint](https://github.com/eslint/eslint) from 8.57.1 to 9.13.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.57.1...v9.13.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Upgrade EsLint

* Fix all new lint errors

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2024-10-21 03:57:15 +01:00
9cff0b2a57 docs!: Add ProtonMail as user (#2793) 2024-10-19 18:26:01 +01:00
a4754ebcfe build(deps-dev): bump @typescript-eslint/parser from 8.9.0 to 8.10.0 (#2791)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.9.0 to 8.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.10.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-19 04:18:36 +01:00
8988f471c3 build(deps-dev): bump cspell from 8.15.2 to 8.15.4 (#2790)
Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.15.2 to 8.15.4.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.15.4/packages/cspell)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-19 04:18:22 +01:00
5f4ff94e26 build(deps-dev): bump @typescript-eslint/eslint-plugin (#2789)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.9.0 to 8.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.10.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-19 04:18:02 +01:00
6f531c5abc build(deps-dev): bump eslint-plugin-jsdoc from 50.4.1 to 50.4.3 (#2788)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 50.4.1 to 50.4.3.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v50.4.1...v50.4.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-19 03:45:07 +01:00
c761a362d1 build(deps): bump @types/node from 22.7.5 to 22.7.6 (#2787)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.5 to 22.7.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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-19 03:44:58 +01:00
2e155ddebc build(deps-dev): bump execa from 9.4.0 to 9.4.1 (#2785)
Bumps [execa](https://github.com/sindresorhus/execa) from 9.4.0 to 9.4.1.
- [Release notes](https://github.com/sindresorhus/execa/releases)
- [Commits](https://github.com/sindresorhus/execa/compare/v9.4.0...v9.4.1)

---
updated-dependencies:
- dependency-name: execa
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-19 03:44:49 +01:00
9c8a07eadc build(deps-dev): bump typedoc from 0.26.9 to 0.26.10 (#2784)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.26.9 to 0.26.10.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.26.9...v0.26.10)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-16 22:00:14 +01:00
9cb9c8c462 build(deps-dev): bump execa from 8.0.1 to 9.4.0 (#2782)
Bumps [execa](https://github.com/sindresorhus/execa) from 8.0.1 to 9.4.0.
- [Release notes](https://github.com/sindresorhus/execa/releases)
- [Commits](https://github.com/sindresorhus/execa/compare/v8.0.1...v9.4.0)

---
updated-dependencies:
- dependency-name: execa
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 22:49:44 +01:00
4268c9d466 build(deps-dev): bump eslint-plugin-jsdoc from 50.4.0 to 50.4.1 (#2783)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 50.4.0 to 50.4.1.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v50.4.0...v50.4.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 14:16:13 +01:00
26f77eb45f build(deps-dev): bump @typescript-eslint/eslint-plugin (#2781)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.8.1 to 8.9.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.9.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 14:15:47 +01:00
dea23e4349 build(deps-dev): bump inquirer from 9.2.12 to 12.0.0 (#2780)
Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 9.2.12 to 12.0.0.
- [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
- [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@9.2.12...inquirer@12.0.0)

---
updated-dependencies:
- dependency-name: inquirer
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 14:15:38 +01:00
0ade4b1557 build(deps-dev): bump @typescript-eslint/parser from 8.8.1 to 8.9.0 (#2779)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.8.1 to 8.9.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.9.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 14:15:30 +01:00
165d48323b build(deps-dev): bump vite-plugin-node-polyfills from 0.19.0 to 0.22.0 (#2778)
Bumps [vite-plugin-node-polyfills](https://github.com/davidmyersdev/vite-plugin-node-polyfills) from 0.19.0 to 0.22.0.
- [Release notes](https://github.com/davidmyersdev/vite-plugin-node-polyfills/releases)
- [Commits](https://github.com/davidmyersdev/vite-plugin-node-polyfills/compare/v0.19.0...v0.22.0)

---
updated-dependencies:
- dependency-name: vite-plugin-node-polyfills
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 14:15:21 +01:00
179598cc07 build(deps-dev): bump vite from 5.4.8 to 5.4.9 (#2776)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.8 to 5.4.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.9/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 14:15:13 +01:00
a8656ca3fe build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.0.0 to 8.8.1 (#2769)
* build(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.0.0 to 8.8.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.8.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Deprecate @typescript-eslint/ban-types

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2024-10-15 02:39:29 +01:00
020e0eb669 build(deps-dev): bump typedoc from 0.25.12 to 0.26.9 (#2775)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.25.12 to 0.26.9.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.25.12...v0.26.9)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:40:25 +01:00
e5dfce523a build(deps-dev): bump eslint-plugin-jsdoc from 50.3.1 to 50.4.0 (#2774)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 50.3.1 to 50.4.0.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v50.3.1...v50.4.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:40:17 +01:00
b53b4a77b4 build(deps): bump nanoid from 5.0.4 to 5.0.7 (#2773)
Bumps [nanoid](https://github.com/ai/nanoid) from 5.0.4 to 5.0.7.
- [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/5.0.4...5.0.7)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:40:08 +01:00
dd86cf3d27 build(deps-dev): bump @vitest/ui from 2.1.2 to 2.1.3 (#2772)
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.3/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:40:02 +01:00
32953b3696 build(deps-dev): bump eslint-plugin-import from 2.29.1 to 2.31.0 (#2771)
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.29.1 to 2.31.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.29.1...v2.31.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:39:53 +01:00
cfec058c9d build(deps-dev): bump @types/unzipper from 0.10.9 to 0.10.10 (#2770)
Bumps [@types/unzipper](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/unzipper) from 0.10.9 to 0.10.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/unzipper)

---
updated-dependencies:
- dependency-name: "@types/unzipper"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:39:44 +01:00
a1c07d5a8e build(deps-dev): bump prettier from 3.2.5 to 3.3.3 (#2768)
Bumps [prettier](https://github.com/prettier/prettier) from 3.2.5 to 3.3.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.2.5...3.3.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:39:30 +01:00
5be745b081 build(deps-dev): bump cspell from 8.15.1 to 8.15.2 (#2766)
Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.15.1 to 8.15.2.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.15.2/packages/cspell)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 00:38:30 +01:00
b4fcfd6386 Version bump 2024-10-14 01:51:16 +01:00
6e371d42a7 fix: npm publish install 2024-10-14 01:47:59 +01:00
e8564d58c6 Create SECURITY.md (#2765) 2024-10-14 00:09:03 +01:00
368aa431a0 build(deps-dev): bump vite-tsconfig-paths from 4.2.3 to 5.0.1 (#2758)
Bumps [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) from 4.2.3 to 5.0.1.
- [Release notes](https://github.com/aleclarson/vite-tsconfig-paths/releases)
- [Commits](https://github.com/aleclarson/vite-tsconfig-paths/compare/v4.2.3...v5.0.1)

---
updated-dependencies:
- dependency-name: vite-tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-13 23:02:22 +01:00
afcd1ae060 build(deps-dev): bump @vitest/ui from 1.4.0 to 2.1.2 (#2757)
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 1.4.0 to 2.1.2.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.2/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-13 23:02:12 +01:00
244d2b8904 build(deps-dev): bump cspell from 8.3.2 to 8.15.1 (#2763)
Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.3.2 to 8.15.1.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.15.1/packages/cspell)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 20:27:03 +01:00
6dae62e1ab build(deps-dev): bump vite-plugin-dts from 3.7.0 to 4.2.4 (#2761)
Bumps [vite-plugin-dts](https://github.com/qmhc/vite-plugin-dts) from 3.7.0 to 4.2.4.
- [Release notes](https://github.com/qmhc/vite-plugin-dts/releases)
- [Changelog](https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/qmhc/vite-plugin-dts/compare/v3.7.0...v4.2.4)

---
updated-dependencies:
- dependency-name: vite-plugin-dts
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 20:26:54 +01:00
5810cb5f02 build(deps-dev): bump ws from 7.5.7 to 7.5.10 (#2764)
Bumps [ws](https://github.com/websockets/ws) from 7.5.7 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.5.7...7.5.10)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 20:26:41 +01:00
11c26af3a9 build(deps-dev): bump eslint-plugin-unicorn from 50.0.1 to 56.0.0 (#2756)
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 50.0.1 to 56.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v50.0.1...v56.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-unicorn
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 20:26:19 +01:00
1b9b815214 build(deps-dev): bump eslint-plugin-functional from 6.0.0 to 6.6.3 (#2755)
Bumps [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional) from 6.0.0 to 6.6.3.
- [Release notes](https://github.com/eslint-functional/eslint-plugin-functional/releases)
- [Changelog](https://github.com/eslint-functional/eslint-plugin-functional/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint-functional/eslint-plugin-functional/compare/v6.0.0...v6.6.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-functional
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-13 20:26:05 +01:00
c342137c6f build(deps-dev): bump jsdom from 24.0.0 to 25.0.1 (#2754)
Bumps [jsdom](https://github.com/jsdom/jsdom) from 24.0.0 to 25.0.1.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/24.0.0...25.0.1)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 02:55:07 +01:00
eefc8bd8a5 build(deps-dev): bump unzipper from 0.10.14 to 0.12.3 (#2753)
Bumps [unzipper](https://github.com/ZJONSSON/node-unzipper) from 0.10.14 to 0.12.3.
- [Release notes](https://github.com/ZJONSSON/node-unzipper/releases)
- [Commits](https://github.com/ZJONSSON/node-unzipper/commits/v0.12.3)

---
updated-dependencies:
- dependency-name: unzipper
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-13 02:54:58 +01:00
9873861210 build(deps-dev): bump glob from 10.3.10 to 11.0.0 (#2752)
Bumps [glob](https://github.com/isaacs/node-glob) from 10.3.10 to 11.0.0.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.3.10...v11.0.0)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-13 02:34:04 +01:00
cf7a05e05d build(deps-dev): bump tsx from 4.7.0 to 4.19.1 (#2750)
Bumps [tsx](https://github.com/privatenumber/tsx) from 4.7.0 to 4.19.1.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.7.0...v4.19.1)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 02:14:45 +01:00
6eb11d8842 Revert github action version change 2024-10-13 02:06:22 +01:00
3ad68337e7 Version bump 2024-10-13 01:58:44 +01:00
07f363fcb7 feat: Add npm publish GitHub Action workflow (#2762)
* feat: Add npm publish GitHub Action workflow

* Fix typo
2024-10-13 01:48:04 +01:00
2d2e4cdab2 fix: Missing text property for patchDocument (#2760)
* fix: Missing text property

Ignore <br /> for patched files

* Fix spelling issues
2024-10-13 01:29:32 +01:00
0cadec7f58 build(deps-dev): bump @typescript-eslint/parser from 6.17.0 to 8.8.1 (#2742)
* build(deps-dev): bump @typescript-eslint/parser from 6.17.0 to 8.8.1

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.17.0 to 8.8.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.8.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix type definitions

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2024-10-11 04:47:51 +01:00
e86dbd3398 Change ImageRun keys to be based on image data content (#2681)
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 01:13:51 +01:00
021f1b0c4d Update bullet-points.md (#2684)
Excluding ; from example

Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 01:13:26 +01:00
5aa2027252 build(deps): bump send and serve-static (#2736)
Bumps [send](https://github.com/pillarjs/send) and [serve-static](https://github.com/expressjs/serve-static). These dependencies needed to be updated together.

Updates `send` from 0.17.2 to 0.19.0
- [Release notes](https://github.com/pillarjs/send/releases)
- [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md)
- [Commits](https://github.com/pillarjs/send/compare/0.17.2...0.19.0)

Updates `serve-static` from 1.14.2 to 1.16.2
- [Release notes](https://github.com/expressjs/serve-static/releases)
- [Changelog](https://github.com/expressjs/serve-static/blob/v1.16.2/HISTORY.md)
- [Commits](https://github.com/expressjs/serve-static/compare/v1.14.2...v1.16.2)

---
updated-dependencies:
- dependency-name: send
  dependency-type: indirect
- dependency-name: serve-static
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 01:13:14 +01:00
2fc297ef3c build(deps-dev): bump braces from 3.0.2 to 3.0.3 (#2749)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 01:12:50 +01:00
3fe216846c build(deps-dev): bump dompurify from 2.3.6 to 2.5.7 (#2737)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.3.6 to 2.5.7.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/2.3.6...2.5.7)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 01:05:41 +01:00
649a50f7c5 build(deps-dev): bump serve-static from 1.14.2 to 1.16.2 (#2739)
Bumps [serve-static](https://github.com/expressjs/serve-static) from 1.14.2 to 1.16.2.
- [Release notes](https://github.com/expressjs/serve-static/releases)
- [Changelog](https://github.com/expressjs/serve-static/blob/v1.16.2/HISTORY.md)
- [Commits](https://github.com/expressjs/serve-static/compare/v1.14.2...v1.16.2)

---
updated-dependencies:
- dependency-name: serve-static
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 01:05:35 +01:00
dc14123a5a build(deps-dev): bump rollup from 3.29.4 to 4.24.0 (#2740)
Bumps [rollup](https://github.com/rollup/rollup) from 3.29.4 to 4.24.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v3.29.4...v4.24.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 01:05:25 +01:00
048a035a5d build(deps-dev): bump elliptic from 6.5.4 to 6.5.7 (#2738)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.4 to 6.5.7.
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.4...v6.5.7)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 00:58:47 +01:00
f212cf0251 Update styling-with-js.md (#2734)
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 00:57:11 +01:00
1f2f5988e1 build(deps-dev): bump vite from 5.0.10 to 5.4.8 (#2741)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.10 to 5.4.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.8/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 00:56:49 +01:00
f1359a4750 build(deps-dev): bump @types/prompt from 1.1.8 to 1.1.9 (#2746)
Bumps [@types/prompt](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prompt) from 1.1.8 to 1.1.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prompt)

---
updated-dependencies:
- dependency-name: "@types/prompt"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 00:33:21 +01:00
f2775ed13c build(deps): bump @types/node from 20.12.4 to 22.7.5 (#2747)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.12.4 to 22.7.5.
- [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-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 00:33:12 +01:00
3ae749278e build(deps-dev): bump eslint-plugin-jsdoc from 48.0.2 to 50.3.1 (#2745)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.0.2 to 50.3.1.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.0.2...v50.3.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-10-11 00:30:35 +01:00
0bcc6910f4 Use codecov token (#2748)
* Use codecov token

* Using env to pass token
2024-10-11 00:22:43 +01:00
c15951550c Version bump 2024-10-10 01:30:32 +01:00
8308b6413e Add documentation 2024-10-10 00:38:25 +01:00
5b75875684 Enable rollupTypes in the vite build configuration. (#2714)
This resolves issues with in dependent TypeScipt packages that are using moduleResolution: NodeNext
Modern ES modules cannot use extensionless relative paths in imports.
2024-10-10 00:15:04 +01:00
28029f4c1c chore[tables.md]: replace semicolon to commas (#2708) 2024-10-10 00:14:09 +01:00
824d7f9893 build(deps-dev): bump vite from 5.0.10 to 5.2.8 (#2668)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.10 to 5.2.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.2.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 00:13:52 +01:00
b3aea4b9a0 build(deps-dev): bump @vitest/coverage-v8 from 1.1.1 to 1.4.0 (#2645)
Bumps [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) from 1.1.1 to 1.4.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.4.0/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 00:10:13 +01:00
32377d187d build(deps-dev): bump @vitest/ui from 1.1.1 to 1.4.0 (#2644)
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 1.1.1 to 1.4.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.4.0/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 21:26:07 +01:00
a80815822d build(deps-dev): bump vitest from 1.1.1 to 1.4.0 (#2642)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.1.1 to 1.4.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.4.0/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 21:26:01 +01:00
c198154fdc build(deps-dev): bump typedoc from 0.25.6 to 0.25.12 (#2634)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.25.6 to 0.25.12.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.25.6...v0.25.12)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 21:25:52 +01:00
618c7a8578 build(deps-dev): bump @typescript-eslint/eslint-plugin (#2595)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.17.0 to 7.0.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.0.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 21:25:44 +01:00
ef7b930d4d build(deps-dev): bump prettier from 3.1.1 to 3.2.5 (#2579)
Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.1...3.2.5)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 21:25:29 +01:00
8296895cc6 build(deps-dev): bump jsdom from 23.0.1 to 24.0.0 (#2557)
Bumps [jsdom](https://github.com/jsdom/jsdom) from 23.0.1 to 24.0.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/23.0.1...24.0.0)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 21:25:12 +01:00
1dce6fee15 build(deps): bump @types/node from 20.10.6 to 20.12.4 (#2669)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.10.6 to 20.12.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 21:25:03 +01:00
444e7771b4 Version bump 2024-10-09 21:21:08 +01:00
962795743c feat: Add ability to detect patches which are present in a file (#2633)
* feat: Add ability to detect patches which are present in a file

* chore: export patchDetector function

* fix: Make sure we don't attempt to call toJson on binary content

---------

Co-authored-by: Christopher Fox <cfox@homebound.com>
2024-05-22 03:05:48 +01:00
f98f852a55 Allow disabling numbering inherited from a paragraph style (#2531) 2024-05-20 03:15:11 +01:00
e379a7fe04 Document the 'keepOriginalStyles' options (#2549)
Co-authored-by: Dolan <dolan_miu@hotmail.com>
2024-05-20 03:13:05 +01:00
022b25cfcd Export FileChild class (#2523) 2024-01-25 01:53:26 +00:00
e20bd66663 Limit the list of supported highlight colors (#2522)
* Limit the list of supported highlight colors

* Fix tests: use fixed highlight color values

---------

Co-authored-by: ilyasogonov <sogonov.ilya@customscard.ru>
2024-01-12 00:16:15 +00:00
6b8e22368b build(deps-dev): bump eslint-plugin-jsdoc from 47.0.2 to 48.0.2 (#2515)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 47.0.2 to 48.0.2.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v47.0.2...v48.0.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-04 02:42:26 +00:00
4304e82751 build(deps-dev): bump cspell from 8.3.1 to 8.3.2 (#2514)
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.3.1 to 8.3.2.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.3.1...v8.3.2)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-04 02:42:19 +00:00
75715fde37 Fix the incorrect limit location value of MathIntergral #2512 (#2513) 2024-01-04 02:42:05 +00:00
e779f6ea62 build(deps-dev): bump cspell from 8.2.4 to 8.3.1 (#2509)
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.2.4 to 8.3.1.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.2.4...v8.3.1)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:15:33 +00:00
9280cdba50 build(deps-dev): bump @typescript-eslint/eslint-plugin (#2508)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.16.0 to 6.17.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.17.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:15:27 +00:00
8410d0c06d build(deps-dev): bump @typescript-eslint/parser from 6.16.0 to 6.17.0 (#2507)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.16.0 to 6.17.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.17.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:15:22 +00:00
d47d85bdcf build(deps-dev): bump typedoc from 0.25.4 to 0.25.6 (#2506)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.25.4 to 0.25.6.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.25.4...v0.25.6)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:15:16 +00:00
6ae45327fe build(deps-dev): bump @vitest/coverage-v8 from 1.1.0 to 1.1.1 (#2503)
Bumps [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.1.1/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:15:10 +00:00
464cd946dc build(deps-dev): bump @vitest/ui from 1.1.0 to 1.1.1 (#2500)
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.1.1/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:15:03 +00:00
cbff540b6e build(deps-dev): bump eslint-plugin-jsdoc from 46.9.1 to 47.0.2 (#2504)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.9.1 to 47.0.2.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.9.1...v47.0.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:14:53 +00:00
a8e6ba4c49 build(deps): bump @types/node from 20.10.5 to 20.10.6 (#2502)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.10.5 to 20.10.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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:14:45 +00:00
efc1ceaf1a build(deps-dev): bump vitest from 1.1.0 to 1.1.1 (#2498)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.1.1/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 00:14:38 +00:00
c4ed19e589 Add math limit component (#2510) 2024-01-03 00:13:13 +00:00
13cf3eee5a Feature/multiple patch document exports (#2497)
* Turn patch document into options object

Add outputType to options

* Set keep styles to true by default

* Simplify method

* Rename variable

* #2267 Multiple patches of same key

* Remove path which won't be visited
2023-12-31 23:16:48 +00:00
24c159de37 Add SVG image suport (#2487)
* Add SVG blip extentions

* SVG Image feature now works

* Add and simplify tests

* Fix falsey issue with file

Write tests
100% Coverage
2023-12-31 18:54:35 +00:00
7570fc2bf5 Version bump (#2496) 2023-12-31 14:35:06 +00:00
6929dee846 Revery demo 14 (#2495) 2023-12-31 14:22:22 +00:00
d4ac2a08ee Make demos synchronous (#2494) 2023-12-31 14:14:41 +00:00
010ef05ce3 Feat/embedded fonts (#2174)
* #239 Embedded fonts

* Add boilerplate for font table

* Fix linting

* Fix linting

* Fix odttf naming

* Correct writing of fonts to relationships and font table

new uuid function

* Add font to run

* Add demo

Fix tests

* Add character set support

* Add tests

* Write tests
2023-12-30 02:23:54 +00:00
fa401297da Re-name variables (#2486) 2023-12-29 23:52:43 +00:00
ce0e9936c3 build(deps-dev): bump @typescript-eslint/eslint-plugin (#2488)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.15.0 to 6.16.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.16.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-29 23:51:46 +00:00
c13e9938cf Set target to es2015 in vite config (#2492)
* Set target to es2015 in vite config

* Remove document
2023-12-29 23:51:31 +00:00
b8f97553b3 #933 Discriminated union for frame alignment (#2477) 2023-12-29 15:07:42 +00:00
2550da199d build(deps-dev): bump vite-tsconfig-paths from 4.2.2 to 4.2.3 (#2493)
Bumps [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/aleclarson/vite-tsconfig-paths/releases)
- [Commits](https://github.com/aleclarson/vite-tsconfig-paths/compare/v4.2.2...v4.2.3)

---
updated-dependencies:
- dependency-name: vite-tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-29 15:06:48 +00:00
682b679bdb build(deps-dev): bump @typescript-eslint/parser from 6.15.0 to 6.16.0 (#2489)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.15.0 to 6.16.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.16.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-28 22:06:50 +00:00
e0fd7e751c build(deps-dev): bump cspell from 8.2.3 to 8.2.4 (#2490)
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.2.3 to 8.2.4.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.2.3...v8.2.4)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-28 22:06:24 +00:00
9b57db4716 build(deps-dev): bump vite-plugin-node-polyfills from 0.9.0 to 0.19.0 (#2491)
Bumps [vite-plugin-node-polyfills](https://github.com/davidmyersdev/vite-plugin-node-polyfills) from 0.9.0 to 0.19.0.
- [Release notes](https://github.com/davidmyersdev/vite-plugin-node-polyfills/releases)
- [Commits](https://github.com/davidmyersdev/vite-plugin-node-polyfills/compare/v0.9.0...v0.19.0)

---
updated-dependencies:
- dependency-name: vite-plugin-node-polyfills
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-28 22:05:59 +00:00
d23f453d28 Add image borders (#2472)
* Add image borders

* Fix prettier

* Fix spelling

* Fix spelling

* Finish feature

* Update demo

* Try and fix demo 14
2023-12-27 20:20:45 +00:00
6c28f8bab0 Page number in section (#2485)
* Page number in section

* Inline Lorem Ipsum

* Re-name current page in section to current section
2023-12-25 22:29:32 +00:00
10b87b5a70 Run demo GitHub Action in parallel (#2484)
* Run demo GitHub Action in parallel

* Fix path of action yml

* Move checkout to demo action

* Prettier format

* Specifying shell

* Try to fix uses

* Fix spelling issue

* Fix demo

* Downloading artifacts too unreliable

Building instead

* Re-name step

Re-use action elsewhere
2023-12-25 15:29:13 +00:00
6b6f9d7ed4 Use standard script names for test and prettier (#2483) 2023-12-25 13:02:00 +00:00
0434d00ff7 build(deps-dev): bump prettier from 3.0.0 to 3.1.1 (#2480)
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.0...3.1.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 12:44:20 +00:00
7e3acc25b9 build(deps-dev): bump cspell from 7.3.8 to 8.2.3 (#2482)
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 7.3.8 to 8.2.3.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v7.3.8...v8.2.3)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 12:38:24 +00:00
62ad8f12b7 build(deps-dev): bump vite-plugin-dts from 3.6.4 to 3.7.0 (#2481)
Bumps [vite-plugin-dts](https://github.com/qmhc/vite-plugin-dts) from 3.6.4 to 3.7.0.
- [Release notes](https://github.com/qmhc/vite-plugin-dts/releases)
- [Changelog](https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/qmhc/vite-plugin-dts/compare/v3.6.4...v3.7.0)

---
updated-dependencies:
- dependency-name: vite-plugin-dts
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 12:38:07 +00:00
a6a656f1a0 build(deps-dev): bump jsdom from 22.1.0 to 23.0.1 (#2479)
Bumps [jsdom](https://github.com/jsdom/jsdom) from 22.1.0 to 23.0.1.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/22.1.0...23.0.1)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 12:37:56 +00:00
1bf36009e8 #916 Add overflow punctuation (#2478)
* #916 Add overflow punctuation

* Fix tests
2023-12-25 04:09:54 +00:00
86bdf3e199 build(deps-dev): bump @types/xml from 1.0.8 to 1.0.11 (#2464)
Bumps [@types/xml](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/xml) from 1.0.8 to 1.0.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/xml)

---
updated-dependencies:
- dependency-name: "@types/xml"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 02:58:48 +00:00
a3c796aae3 Add deprecation warning to addChildElement (#2476) 2023-12-25 02:54:46 +00:00
dbe0586f70 build(deps-dev): bump typedoc from 0.24.8 to 0.25.4 (#2466)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.24.8 to 0.25.4.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.24.8...v0.25.4)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 02:48:33 +00:00
7e2538dffc build(deps): bump @types/node from 20.8.6 to 20.10.5 (#2463)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.8.6 to 20.10.5.
- [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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 02:48:20 +00:00
c3080ff9d9 Update vitest (#2475)
* Update vitest

* Update vite test config

* Fix coverage metrics and bump coverage
2023-12-25 02:47:43 +00:00
772fc8462a build(deps-dev): bump eslint-plugin-jsdoc from 46.8.2 to 46.9.1 (#2468)
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.8.2 to 46.9.1.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.8.2...v46.9.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 01:56:30 +00:00
e194780cd1 build(deps-dev): bump @vitest/ui from 0.33.0 to 0.34.7 (#2467)
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 0.33.0 to 0.34.7.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.34.7/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 01:56:22 +00:00
5b80ea32d7 build(deps-dev): bump @typescript-eslint/parser from 6.9.1 to 6.15.0 (#2462)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.9.1 to 6.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.15.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 01:56:12 +00:00
31b7e07ab3 build(deps-dev): bump @types/prompt from 1.1.5 to 1.1.8 (#2465)
Bumps [@types/prompt](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prompt) from 1.1.5 to 1.1.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prompt)

---
updated-dependencies:
- dependency-name: "@types/prompt"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 01:55:56 +00:00
939d418af1 build(deps-dev): bump @typescript-eslint/eslint-plugin (#2461)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.9.1 to 6.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.15.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 01:55:46 +00:00
4258dd2a2e build(deps-dev): bump typescript from 5.1.6 to 5.3.3 (#2469)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.1.6 to 5.3.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.1.6...v5.3.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 01:55:38 +00:00
b7334a1ab5 Version bump 2023-12-25 01:52:12 +00:00
9229f45d59 Downgrade Build to ES2015 (#2473) 2023-12-25 01:50:26 +00:00
2bd4aacdd5 #2388 - Add default tab stop (#2470)
* #2388 - Check for undefined rather than falsey

* Add default tab stop

* Add back tab stop positions

* Add test for default tab stop
2023-12-24 03:37:36 +00:00
abbd695a8f Version bump 2023-12-22 01:32:44 +00:00
f7b98bcde8 build(deps-dev): bump eslint-plugin-functional from 5.0.8 to 6.0.0 (#2409)
* build(deps-dev): bump eslint-plugin-functional from 5.0.8 to 6.0.0

Bumps [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional) from 5.0.8 to 6.0.0.
- [Release notes](https://github.com/eslint-functional/eslint-plugin-functional/releases)
- [Changelog](https://github.com/eslint-functional/eslint-plugin-functional/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint-functional/eslint-plugin-functional/compare/v5.0.8...v6.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-functional
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove assumeTypes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2023-12-22 01:31:34 +00:00
a756a7697c Change all project enums to objects with as const (#2445)
* feat: change all enums to as const objects

* Add word to dictionary

---------

Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
2023-12-22 01:25:00 +00:00
fd1ea5b4dc build(deps-dev): bump eslint-plugin-unicorn from 48.0.1 to 50.0.1 (#2458)
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 48.0.1 to 50.0.1.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v48.0.1...v50.0.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-unicorn
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-22 01:21:22 +00:00
d83e089cd3 add run options to ParagraphPropertiesOptions (#2457) 2023-12-22 01:21:12 +00:00
33715cc50c build(deps-dev): bump vite from 4.5.0 to 5.0.10 (#2455)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.0 to 5.0.10.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.10/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-22 01:20:42 +00:00
f3f1f2d0b1 build(deps-dev): bump eslint from 8.45.0 to 8.56.0 (#2454)
Bumps [eslint](https://github.com/eslint/eslint) from 8.45.0 to 8.56.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.56.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-22 01:20:33 +00:00
c35e706fa8 build(deps-dev): bump eslint-plugin-import from 2.27.5 to 2.29.1 (#2453)
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.27.5 to 2.29.1.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.27.5...v2.29.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-22 01:20:25 +00:00
35cebfe1a2 build(deps-dev): bump vite-tsconfig-paths from 4.2.0 to 4.2.2 (#2442)
Bumps [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) from 4.2.0 to 4.2.2.
- [Release notes](https://github.com/aleclarson/vite-tsconfig-paths/releases)
- [Commits](https://github.com/aleclarson/vite-tsconfig-paths/compare/v4.2.0...v4.2.2)

---
updated-dependencies:
- dependency-name: vite-tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-22 01:20:17 +00:00
d04c42cbe8 Use esm for ts-node (#2459)
* Use esm for ts-node

* Add esm flag

* Change tsconfig properties

* Use tsx rather than ts-node

* Use tsx

* Remove ts-node
2023-12-22 01:10:54 +00:00
8744e613ac Merge pull request #2438 from dolanmiu/dependabot/npm_and_yarn/vite-4.5.1
build(deps-dev): bump vite from 4.5.0 to 4.5.1
2023-12-21 23:52:36 +00:00
cbeecbf3e1 Merge pull request #2435 from dolanmiu/dependabot/npm_and_yarn/nanoid-5.0.4
build(deps): bump nanoid from 4.0.2 to 5.0.4
2023-12-21 23:52:28 +00:00
f8ab2d1701 Merge pull request #2433 from dolanmiu/dependabot/npm_and_yarn/vite-plugin-dts-3.6.4
build(deps-dev): bump vite-plugin-dts from 3.3.1 to 3.6.4
2023-12-21 23:52:20 +00:00
adc5c6f594 Merge pull request #2419 from dolanmiu/dependabot/npm_and_yarn/types/unzipper-0.10.9
build(deps-dev): bump @types/unzipper from 0.10.6 to 0.10.9
2023-12-21 23:52:14 +00:00
c9524cc497 Merge pull request #2418 from dolanmiu/dependabot/npm_and_yarn/inquirer-and-types/inquirer-9.2.12
build(deps-dev): bump inquirer and @types/inquirer
2023-12-21 23:52:06 +00:00
90de6ba7e1 Merge pull request #2407 from dolanmiu/dependabot/npm_and_yarn/vitest/coverage-v8-0.34.6
build(deps-dev): bump @vitest/coverage-v8 from 0.33.0 to 0.34.6
2023-12-21 23:51:57 +00:00
78d74ae60b Merge pull request #2439 from morlay/master
Run prop snapToGrid should be false
2023-12-06 12:09:40 +00:00
579593a467 Run prop snapToGrid should be false 2023-12-06 10:15:46 +08:00
b5393dadae build(deps-dev): bump vite from 4.5.0 to 4.5.1
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.1/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-06 00:01:15 +00:00
528ab1933e build(deps): bump nanoid from 4.0.2 to 5.0.4
Bumps [nanoid](https://github.com/ai/nanoid) from 4.0.2 to 5.0.4.
- [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/4.0.2...5.0.4)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 11:15:37 +00:00
36181f8c91 build(deps-dev): bump vite-plugin-dts from 3.3.1 to 3.6.4
Bumps [vite-plugin-dts](https://github.com/qmhc/vite-plugin-dts) from 3.3.1 to 3.6.4.
- [Release notes](https://github.com/qmhc/vite-plugin-dts/releases)
- [Changelog](https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/qmhc/vite-plugin-dts/compare/v3.3.1...v3.6.4)

---
updated-dependencies:
- dependency-name: vite-plugin-dts
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-30 11:36:50 +00:00
45af681db1 build(deps-dev): bump @types/unzipper from 0.10.6 to 0.10.9
Bumps [@types/unzipper](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/unzipper) from 0.10.6 to 0.10.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/unzipper)

---
updated-dependencies:
- dependency-name: "@types/unzipper"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-08 12:04:31 +00:00
ad6b482136 build(deps-dev): bump inquirer and @types/inquirer
Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) and [@types/inquirer](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/inquirer). These dependencies needed to be updated together.

Updates `inquirer` from 9.2.11 to 9.2.12
- [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
- [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@9.2.11...inquirer@9.2.12)

Updates `@types/inquirer` from 9.0.3 to 9.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/inquirer)

---
updated-dependencies:
- dependency-name: inquirer
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: "@types/inquirer"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-08 11:59:29 +00:00
a6e1c2b019 build(deps-dev): bump @vitest/coverage-v8 from 0.33.0 to 0.34.6
Bumps [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) from 0.33.0 to 0.34.6.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.34.6/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 11:15:26 +00:00
3eb98533ae Version bump 2023-11-02 03:02:21 +00:00
f5f021834e Merge pull request #2403 from dolanmiu/feature/bump-eslint-plugin
Upgrade @typescript-eslint/parser
2023-11-02 03:01:55 +00:00
35702c3f77 Upgrade @typescript-eslint/parser 2023-11-01 22:52:41 +00:00
8fbbd571ad Merge pull request #2402 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.9.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.60.1 to 6.9.1
2023-11-01 22:27:36 +00:00
2dd228be69 build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.60.1 to 6.9.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 21:16:40 +00:00
562835cfe7 Merge pull request #2401 from dolanmiu/dependabot/npm_and_yarn/vite-4.5.0
build(deps-dev): bump vite from 4.3.9 to 4.5.0
2023-11-01 21:15:57 +00:00
6bac06e84d Merge pull request #2382 from dolanmiu/dependabot/npm_and_yarn/cspell-7.3.8
build(deps-dev): bump cspell from 6.31.1 to 7.3.8
2023-11-01 21:15:33 +00:00
88436168ee Merge pull request #2400 from dolanmiu/dependabot/npm_and_yarn/browserify-sign-4.2.2
build(deps-dev): bump browserify-sign from 4.2.1 to 4.2.2
2023-11-01 21:15:26 +00:00
0c3206d2e2 Merge pull request #2350 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-46.8.2
build(deps-dev): bump eslint-plugin-jsdoc from 46.4.4 to 46.8.2
2023-11-01 21:15:08 +00:00
033debd339 Merge pull request #2303 from dolanmiu/dependabot/npm_and_yarn/execa-8.0.1
build(deps-dev): bump execa from 7.1.1 to 8.0.1
2023-11-01 21:15:00 +00:00
d4f160732a Use Record instead of Object 2023-11-01 20:56:02 +00:00
4238fc9ab4 build(deps-dev): bump execa from 7.1.1 to 8.0.1
Bumps [execa](https://github.com/sindresorhus/execa) from 7.1.1 to 8.0.1.
- [Release notes](https://github.com/sindresorhus/execa/releases)
- [Commits](https://github.com/sindresorhus/execa/compare/v7.1.1...v8.0.1)

---
updated-dependencies:
- dependency-name: execa
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 20:55:59 +00:00
0d042b8dd1 build(deps-dev): bump vite from 4.3.9 to 4.5.0
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.3.9 to 4.5.0.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.0/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 20:55:35 +00:00
afdd5f2d8f Merge pull request #2383 from dolanmiu/dependabot/npm_and_yarn/types/node-20.8.6
build(deps): bump @types/node from 20.4.2 to 20.8.6
2023-11-01 20:55:29 +00:00
70c7b3d1b3 Merge pull request #2374 from dolanmiu/dependabot/npm_and_yarn/postcss-8.4.31
build(deps-dev): bump postcss from 8.4.23 to 8.4.31
2023-11-01 20:55:22 +00:00
7b1cd5fe86 build(deps-dev): bump browserify-sign from 4.2.1 to 4.2.2
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 20:55:02 +00:00
09ab169ffd Merge pull request #2359 from dolanmiu/dependabot/npm_and_yarn/glob-10.3.10
build(deps-dev): bump glob from 10.3.1 to 10.3.10
2023-11-01 20:55:01 +00:00
35a82cf12e Merge pull request #2333 from dolanmiu/dependabot/npm_and_yarn/inquirer-9.2.11
build(deps-dev): bump inquirer from 9.2.7 to 9.2.11
2023-11-01 20:54:54 +00:00
8d33cb01dd Merge pull request #2268 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-unicorn-48.0.1
build(deps-dev): bump eslint-plugin-unicorn from 47.0.0 to 48.0.1
2023-11-01 20:54:35 +00:00
438d11dd86 Merge pull request #2387 from wilkmaia/fix/patch-styling
Fix style being missed on patchDocument
2023-11-01 20:54:23 +00:00
d23b0d0789 Fix coverage 2023-11-01 20:40:30 +00:00
1fa8c7ac82 Merge pull request #2397 from hom/master
fix: #2082 Numbering instance restart number not work since v8.0.0 and work well in v7.8.2
2023-10-27 00:41:01 +01:00
3d6ead0359 Merge pull request #2 from hom/fix/#2082 2023-10-27 03:59:58 +08:00
379050dccd Merge pull request #1 from dolanmiu/master 2023-10-27 03:31:07 +08:00
f9d1c197cf Merge pull request #2379 from rahon6000/master
changed default section margin from inch to Twip
2023-10-20 22:10:03 +01:00
a89ee463e6 Fix style being missed on patchDocument
There were scenarios in which patching a document would result in loss
of style for the template runs and, possibly, their right-adjacent run
as well (post-splitting). That was due to the run style elements not
being added to the newly created runs.

This commit addresses this issue by introducing a new, optional, flag
for the `patchDocument` function: `keepOriginalStyles`. It defaults to
`false` (current behavior) and, when `true`, ensures that there is no
loss of styling.

This should address https://github.com/dolanmiu/docx/issues/2293.
2023-10-18 12:58:01 -03:00
036caaacc8 build(deps): bump @types/node from 20.4.2 to 20.8.6
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.4.2 to 20.8.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-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 11:53:19 +00:00
80c37afe2b build(deps-dev): bump cspell from 6.31.1 to 7.3.8
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.31.1 to 7.3.8.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v6.31.1...v7.3.8)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 11:52:24 +00:00
3a36d912fe changed default section margin from inch to Twip 2023-10-12 12:14:13 +09:00
c741d5d8ac build(deps-dev): bump postcss from 8.4.23 to 8.4.31
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.23 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.23...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-07 19:43:49 +00:00
0fa7dd13ad build(deps-dev): bump glob from 10.3.1 to 10.3.10
Bumps [glob](https://github.com/isaacs/node-glob) from 10.3.1 to 10.3.10.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.3.1...v10.3.10)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-27 11:43:28 +00:00
d5d80550e7 Version bump 2023-09-26 23:00:51 +01:00
23a0a59454 Use .mjs for ESM 2023-09-26 22:59:32 +01:00
066aa56f6a build(deps-dev): bump eslint-plugin-jsdoc from 46.4.4 to 46.8.2
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.4.4 to 46.8.2.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.4.4...v46.8.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 11:59:15 +00:00
3997b7a5d6 fix: #2082 Numbering instance restart number not work since v8.0.0 and work well in v7.8.2 2023-09-13 17:08:59 +08:00
ccc391607a Merge pull request #2331 from hshoja/doc/update-style-with-xml
Update styling with xml  docs
2023-09-11 21:04:32 +01:00
9577192d41 build(deps-dev): bump inquirer from 9.2.7 to 9.2.11
Bumps [inquirer](https://github.com/SBoudrias/Inquirer.js) from 9.2.7 to 9.2.11.
- [Release notes](https://github.com/SBoudrias/Inquirer.js/releases)
- [Commits](https://github.com/SBoudrias/Inquirer.js/compare/inquirer@9.2.7...inquirer@9.2.11)

---
updated-dependencies:
- dependency-name: inquirer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 11:40:53 +00:00
968c3aed0f Update styling-with-xml doc 2023-09-10 15:57:48 +02:00
9c7a80729b Merge branch 'master' of github.com:dolanmiu/docx 2023-08-06 20:10:11 +01:00
5f26ca1c94 Update numbering docs 2023-08-06 20:10:03 +01:00
f2b1587bff build(deps-dev): bump eslint-plugin-unicorn from 47.0.0 to 48.0.1
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 47.0.0 to 48.0.1.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v47.0.0...v48.0.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-unicorn
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-26 11:15:05 +00:00
3b9f80fb1a Merge pull request #2259 from dolanmiu/feat/bump-prettier
Bump prettier
2023-07-21 22:13:17 +01:00
8da57bec51 Bump prettier
Fix new prettier issues
2023-07-21 20:11:52 +01:00
63db9f290c Version bump 2023-07-20 22:44:30 +01:00
e8bd4bd6c6 Merge pull request #2256 from dolanmiu/feature/tweak-build
Remove default browser export
2023-07-20 22:42:56 +01:00
28d93b0c42 Remove default browser export
Fixes Angular issue
2023-07-20 20:46:53 +01:00
95f8e37006 Version bump 2023-07-19 02:10:13 +01:00
87083cb264 Merge pull request #2240 from dolanmiu/dependabot/npm_and_yarn/vite-plugin-dts-3.3.1
build(deps-dev): bump vite-plugin-dts from 2.3.0 to 3.3.1
2023-07-19 01:49:10 +01:00
1e8dc95c9c Merge pull request #2227 from dolanmiu/dependabot/npm_and_yarn/vitest/ui-0.33.0
build(deps-dev): bump @vitest/ui from 0.32.2 to 0.33.0
2023-07-19 01:49:04 +01:00
abfa242c28 build(deps-dev): bump @vitest/ui from 0.32.2 to 0.33.0
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 0.32.2 to 0.33.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.33.0/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 00:37:38 +00:00
56b5414152 build(deps-dev): bump vite-plugin-dts from 2.3.0 to 3.3.1
Bumps [vite-plugin-dts](https://github.com/qmhc/vite-plugin-dts) from 2.3.0 to 3.3.1.
- [Release notes](https://github.com/qmhc/vite-plugin-dts/releases)
- [Changelog](https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/qmhc/vite-plugin-dts/compare/v2.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: vite-plugin-dts
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 00:37:28 +00:00
8f46060be2 Merge pull request #2235 from dolanmiu/dependabot/npm_and_yarn/types/node-20.4.2
build(deps): bump @types/node from 20.3.2 to 20.4.2
2023-07-19 01:36:41 +01:00
93b17ca2af Merge pull request #2226 from dolanmiu/dependabot/npm_and_yarn/vitest/coverage-v8-0.33.0
build(deps-dev): bump @vitest/coverage-v8 from 0.32.2 to 0.33.0
2023-07-19 01:36:27 +01:00
66008115b8 build(deps-dev): bump @vitest/coverage-v8 from 0.32.2 to 0.33.0
Bumps [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) from 0.32.2 to 0.33.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.33.0/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 00:23:34 +00:00
55697a7c32 build(deps): bump @types/node from 20.3.2 to 20.4.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.3.2 to 20.4.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 00:22:54 +00:00
e9b259db6b Merge pull request #2241 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-46.4.4
build(deps-dev): bump eslint-plugin-jsdoc from 46.4.2 to 46.4.4
2023-07-19 01:22:29 +01:00
55c51f7af1 Merge pull request #2238 from dolanmiu/dependabot/npm_and_yarn/eslint-8.45.0
build(deps-dev): bump eslint from 8.43.0 to 8.45.0
2023-07-19 01:22:22 +01:00
4e7fd6a6dc Merge pull request #2242 from dolanmiu/dependabot/npm_and_yarn/esbuild/win32-x64-0.18.14
build(deps-dev): bump @esbuild/win32-x64 from 0.18.10 to 0.18.14
2023-07-19 01:22:06 +01:00
6294ec448f Merge pull request #2234 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.62.0
build(deps-dev): bump @typescript-eslint/parser from 5.60.1 to 5.62.0
2023-07-19 01:21:48 +01:00
668198b5d1 Merge pull request #2228 from dolanmiu/dependabot/npm_and_yarn/vitest-0.33.0
build(deps-dev): bump vitest from 0.32.2 to 0.33.0
2023-07-19 01:21:41 +01:00
56b2ffe706 Merge pull request #2209 from dolanmiu/dependabot/npm_and_yarn/typescript-5.1.6
build(deps-dev): bump typescript from 5.1.3 to 5.1.6
2023-07-19 01:21:35 +01:00
2ab06ffe36 Merge pull request #2244 from dolanmiu/feature/build-fixes
Fix `vite` build issues
2023-07-19 01:19:15 +01:00
0c51082bb9 Add logging output to demo 2023-07-18 21:07:19 +01:00
9a9a2019f6 Do not polyfill buffer 2023-07-18 21:06:35 +01:00
d94348f5ca Export correct type in patchDocument 2023-07-18 20:49:43 +01:00
4c10741862 build(deps-dev): bump @esbuild/win32-x64 from 0.18.10 to 0.18.14
Bumps [@esbuild/win32-x64](https://github.com/evanw/esbuild) from 0.18.10 to 0.18.14.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.18.10...v0.18.14)

---
updated-dependencies:
- dependency-name: "@esbuild/win32-x64"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 11:17:06 +00:00
222a25e4e2 Compile umd version as .js format 2023-07-18 01:53:56 +01:00
5fd4490c4f build(deps-dev): bump eslint-plugin-jsdoc from 46.4.2 to 46.4.4
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.4.2 to 46.4.4.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.4.2...v46.4.4)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-17 11:58:39 +00:00
e1cc65cb97 build(deps-dev): bump eslint from 8.43.0 to 8.45.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.43.0 to 8.45.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.43.0...v8.45.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-17 11:57:25 +00:00
991f837bc1 build(deps-dev): bump @typescript-eslint/parser from 5.60.1 to 5.62.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.60.1 to 5.62.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.62.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-11 11:42:13 +00:00
87b3035465 build(deps-dev): bump vitest from 0.32.2 to 0.33.0
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.32.2 to 0.33.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.33.0/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-07 11:26:34 +00:00
4498305a6c Remove gitter from README 2023-07-04 12:38:54 +01:00
cac7abba91 build(deps-dev): bump typescript from 5.1.3 to 5.1.6
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.1.3 to 5.1.6.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-30 11:39:27 +00:00
b9b55b2829 Version bump 2023-06-30 01:40:40 +01:00
11365d5be5 Merge pull request #2182 from dolanmiu/dependabot/npm_and_yarn/eslint-8.43.0
build(deps-dev): bump eslint from 8.42.0 to 8.43.0
2023-06-29 17:32:50 +01:00
47a5aff40c build(deps-dev): bump eslint from 8.42.0 to 8.43.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.42.0 to 8.43.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.42.0...v8.43.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-29 16:07:10 +00:00
721fbbac67 Merge pull request #2180 from dolanmiu/dependabot/npm_and_yarn/vitest/ui-0.32.2
build(deps-dev): bump @vitest/ui from 0.32.0 to 0.32.2
2023-06-29 17:05:51 +01:00
bcca50fb40 Merge pull request #2192 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.60.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.59.11 to 5.60.1
2023-06-29 17:05:45 +01:00
229d2eb689 Merge pull request #2179 from dolanmiu/dependabot/npm_and_yarn/vitest/coverage-v8-0.32.2
build(deps-dev): bump @vitest/coverage-v8 from 0.32.0 to 0.32.2
2023-06-29 17:05:39 +01:00
3ef80cc7b3 Merge pull request #2181 from dolanmiu/dependabot/npm_and_yarn/vitest-0.32.2
build(deps-dev): bump vitest from 0.32.0 to 0.32.2
2023-06-29 17:05:32 +01:00
f1f11f36e4 Merge pull request #2193 from dolanmiu/dependabot/npm_and_yarn/types/node-20.3.2
build(deps): bump @types/node from 20.3.1 to 20.3.2
2023-06-29 17:05:24 +01:00
28f187064e Merge pull request #2194 from dolanmiu/dependabot/npm_and_yarn/esbuild/win32-x64-0.18.10
build(deps-dev): bump @esbuild/win32-x64 from 0.18.3 to 0.18.10
2023-06-29 17:05:17 +01:00
c391ca533a Merge pull request #2195 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.60.1
build(deps-dev): bump @typescript-eslint/parser from 5.59.11 to 5.60.1
2023-06-29 17:05:07 +01:00
0ca92b80f9 Merge pull request #2200 from dolanmiu/dependabot/npm_and_yarn/glob-10.3.1
build(deps-dev): bump glob from 10.2.7 to 10.3.1
2023-06-29 16:58:27 +01:00
84501b6038 Merge pull request #2206 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-46.4.2
build(deps-dev): bump eslint-plugin-jsdoc from 46.2.6 to 46.4.2
2023-06-29 16:58:20 +01:00
dcd3e90b19 Merge pull request #2201 from performonkey/master
Fix patch doc add duplicate content type
2023-06-29 15:05:44 +01:00
be7d84dfa0 build(deps-dev): bump eslint-plugin-jsdoc from 46.2.6 to 46.4.2
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.2.6 to 46.4.2.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.2.6...v46.4.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-29 11:17:21 +00:00
b0d60109c9 Fix prettier issue 2023-06-29 10:43:44 +08:00
b4659f9901 Merge pull request #2203 from dolanmiu/feature/do-not-override-default-styles
Fix override order in default styles
2023-06-28 23:50:33 +01:00
25f657b842 Add right align example 2023-06-28 22:02:09 +01:00
dfffb066f3 Fix override order in default styles 2023-06-28 21:40:20 +01:00
4f06d760a3 Fix patch doc add duplicate content type 2023-06-28 23:34:16 +08:00
aea2531111 build(deps-dev): bump glob from 10.2.7 to 10.3.1
Bumps [glob](https://github.com/isaacs/node-glob) from 10.2.7 to 10.3.1.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.2.7...v10.3.1)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-28 11:57:13 +00:00
16707201b4 build(deps-dev): bump @typescript-eslint/parser from 5.59.11 to 5.60.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.59.11 to 5.60.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.60.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-27 11:57:32 +00:00
c7c9652095 build(deps-dev): bump @esbuild/win32-x64 from 0.18.3 to 0.18.10
Bumps [@esbuild/win32-x64](https://github.com/evanw/esbuild) from 0.18.3 to 0.18.10.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.18.3...v0.18.10)

---
updated-dependencies:
- dependency-name: "@esbuild/win32-x64"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-27 11:57:12 +00:00
05378f58ae build(deps): bump @types/node from 20.3.1 to 20.3.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.3.1 to 20.3.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] <support@github.com>
2023-06-27 11:57:01 +00:00
d7549a1140 build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.59.11 to 5.60.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.60.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-27 11:56:43 +00:00
e3ee455186 Merge pull request #2189 from dolanmiu/feature/check-boxes
Feature/check boxes
2023-06-25 03:23:45 +01:00
210d9c58f2 Improve API for check boxes 2023-06-25 03:09:29 +01:00
db85c3dd2f Merge remote-tracking branch 'ric/master' into feature/check-boxes 2023-06-24 20:50:35 +01:00
414d0248f5 Update Checkbox test description 2023-06-23 15:36:08 -04:00
fa400bcf39 update CheckBox and tests to handle optional alias field 2023-06-23 13:06:18 -04:00
9e9ca526fe Prettier syntax update of sdt-properties 2023-06-23 13:05:21 -04:00
41c0fb5fc0 Update sdt-properties to make alias optional 2023-06-23 13:04:28 -04:00
58e7dbf445 Revert "Modify sdt-properties to accommodate for children elements"
This reverts commit f706d8e62d.
2023-06-22 15:39:39 -04:00
20e0213c7d Revert "Revert unnecessary changes to sdt-properties"
This reverts commit d1f75e3a42.
2023-06-22 15:37:00 -04:00
b8f83fd6ad Update CheckBox element and test file according to sdt-properties correction 2023-06-22 15:21:45 -04:00
d1f75e3a42 Revert unnecessary changes to sdt-properties 2023-06-22 15:20:56 -04:00
337ff464cf Modify/create index files to handle exporting 2023-06-22 14:51:10 -04:00
cad4a5510b Create test files for CheckBox and CheckBoxUtil 2023-06-22 14:50:07 -04:00
aa8438d8bd Create CheckBox element and supporting child elements 2023-06-22 14:49:03 -04:00
79363c2c2c Modify Pargraph's children to accept CheckBox 2023-06-22 14:43:10 -04:00
f706d8e62d Modify sdt-properties to accommodate for children elements 2023-06-22 14:42:17 -04:00
e7ee2a0fdf build(deps-dev): bump vitest from 0.32.0 to 0.32.2
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.32.0 to 0.32.2.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.32.2/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 11:57:31 +00:00
bd17df8e98 build(deps-dev): bump @vitest/ui from 0.32.0 to 0.32.2
Bumps [@vitest/ui](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui) from 0.32.0 to 0.32.2.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.32.2/packages/ui)

---
updated-dependencies:
- dependency-name: "@vitest/ui"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 11:57:19 +00:00
e237326319 build(deps-dev): bump @vitest/coverage-v8 from 0.32.0 to 0.32.2
Bumps [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) from 0.32.0 to 0.32.2.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.32.2/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 11:56:47 +00:00
349 changed files with 17643 additions and 11093 deletions

View File

@ -8,18 +8,23 @@
// words - list of words to be always considered correct
"words": [
"Abjad",
"aink",
"aiueo",
"ATLEAST",
"chosung",
"clippy",
"datas",
"dcmitype",
"dcterms",
"docsify",
"dolan",
"execa",
"falsey",
"horz",
"iife",
"Initializable",
"iroha",
"JOHAB",
"jsonify",
"jszip",
"NUMPAGES",
@ -30,6 +35,7 @@
"panose",
"rels",
"rsid",
"sdtdh",
"twip",
"twips",
"Xmlable",
@ -53,7 +59,8 @@
"\\.to\\.include\\.members\\(\\[[^\\]]+]\\)",
"/new [a-zA-Z]+\\({[^£]+}\\)/g",
"/<element name=\"[a-z]+\"/gi",
"/<attribute name=\"[a-z]+\"/gi"
"/<attribute name=\"[a-z]+\"/gi",
"/key: \".+\"/"
],
"ignorePaths": ["package.json", "docs/api", "*.docx", "build"],
"allowCompoundWords": true,

View File

@ -1,239 +0,0 @@
extends: eslint:recommended
env:
browser: true
es6: true
node: true
parser: "@typescript-eslint/parser"
parserOptions:
project:
- tsconfig.json
- demo/tsconfig.json
sourceType: module
plugins:
- eslint-plugin-import
- eslint-plugin-no-null
- eslint-plugin-unicorn
- eslint-plugin-jsdoc
- eslint-plugin-prefer-arrow
- "@typescript-eslint"
- eslint-plugin-functional
root: true
rules:
no-undef: "off"
no-extra-boolean-cast: "off"
no-alert: error
no-self-compare: error
no-unreachable-loop: error
no-template-curly-in-string: error
no-unused-private-class-members: error
no-extend-native: error
no-floating-decimal: error
no-implied-eval: error
no-iterator: error
no-lone-blocks: error
no-loop-func: error
no-new-object: error
no-proto: error
no-useless-catch: error
one-var-declaration-per-line: error
prefer-arrow-callback: error
prefer-destructuring: error
prefer-exponentiation-operator: error
prefer-promise-reject-errors: error
prefer-regex-literals: error
prefer-spread: error
prefer-template: error
require-await: error
"@typescript-eslint/adjacent-overload-signatures": error
"@typescript-eslint/array-type":
- error
- default: array
"@typescript-eslint/ban-types":
- error
- types:
Object:
message: Avoid using the `Object` type. Did you mean `object`?
Function:
message: >-
Avoid using the `Function` type. Prefer a specific function type,
like `() => void`.
Boolean:
message: Avoid using the `Boolean` type. Did you mean `boolean`?
Number:
message: Avoid using the `Number` type. Did you mean `number`?
String:
message: Avoid using the `String` type. Did you mean `string`?
Symbol:
message: Avoid using the `Symbol` type. Did you mean `symbol`?
"@typescript-eslint/consistent-type-assertions": error
"@typescript-eslint/dot-notation": error
"@typescript-eslint/explicit-function-return-type":
- error
- allowExpressions: true
allowTypedFunctionExpressions: true
allowHigherOrderFunctions: false
allowDirectConstAssertionInArrowFunctions: true
allowConciseArrowFunctionExpressionsStartingWithVoid: true
"@typescript-eslint/explicit-member-accessibility":
- error
- accessibility: explicit
overrides:
accessors: explicit
"@typescript-eslint/explicit-module-boundary-types":
- error
- allowArgumentsExplicitlyTypedAsAny: true
allowDirectConstAssertionInArrowFunctions: true
allowHigherOrderFunctions: false
allowTypedFunctionExpressions: false
"@typescript-eslint/naming-convention":
- error
- selector:
- objectLiteralProperty
leadingUnderscore: allow
format:
- camelCase
- PascalCase
filter:
regex: (^[a-z]+:.+)|_attr|[0-9]
match: false
"@typescript-eslint/no-empty-function": error
"@typescript-eslint/no-empty-interface": error
"@typescript-eslint/no-explicit-any": error
"@typescript-eslint/no-misused-new": error
"@typescript-eslint/no-namespace": error
"@typescript-eslint/no-parameter-properties": "off"
"@typescript-eslint/no-require-imports": error
"@typescript-eslint/no-shadow":
- error
- hoist: all
"@typescript-eslint/no-this-alias": error
"@typescript-eslint/no-unused-expressions": error
"@typescript-eslint/no-use-before-define": "off"
"@typescript-eslint/no-var-requires": error
"@typescript-eslint/prefer-for-of": error
"@typescript-eslint/prefer-function-type": error
"@typescript-eslint/prefer-namespace-keyword": error
"@typescript-eslint/prefer-readonly": error
"@typescript-eslint/triple-slash-reference":
- error
- path: always
types: prefer-import
lib: always
"@typescript-eslint/typedef":
- error
- parameter: true
propertyDeclaration: true
"@typescript-eslint/unified-signatures": error
arrow-body-style: error
complexity: "off"
consistent-return: error
constructor-super: error
curly: error
dot-notation: "off"
eqeqeq:
- error
- smart
guard-for-in: error
id-denylist:
- error
- any
- Number
- number
- String
- string
- Boolean
- boolean
- Undefined
- undefined
id-match: error
import/no-default-export: error
import/no-extraneous-dependencies: "off"
import/no-internal-modules: "off"
import/order: error
indent: "off"
jsdoc/check-alignment: error
jsdoc/check-indentation: "off"
max-classes-per-file: "off"
max-len: "off"
new-parens: error
no-bitwise: error
no-caller: error
no-cond-assign: error
no-console: error
no-debugger: error
no-duplicate-case: error
no-duplicate-imports: error
no-empty: error
no-empty-function: "off"
no-eval: error
no-extra-bind: error
no-fallthrough: "off"
no-invalid-this: "off"
no-multiple-empty-lines: error
no-new-func: error
no-new-wrappers: error
no-null/no-null: error
no-param-reassign: error
no-redeclare: error
no-return-await: error
no-sequences: error
no-shadow: "off"
no-sparse-arrays: error
no-throw-literal: error
no-trailing-spaces: error
no-undef-init: error
no-underscore-dangle:
- error
- allow:
- _attr
no-unsafe-finally: error
no-unused-expressions: "off"
no-unused-labels: error
no-use-before-define: "off"
no-useless-constructor: error
no-var: error
object-shorthand: "off"
one-var:
- error
- never
prefer-arrow/prefer-arrow-functions: error
prefer-const: error
prefer-object-spread: error
radix: error
space-in-parens:
- error
- never
spaced-comment:
- error
- always
- markers:
- /
unicorn/filename-case: error
unicorn/prefer-ternary: error
use-isnan: error
valid-typeof: "off"
functional/immutable-data:
- error
- assumeTypes: true
ignoreImmediateMutation: true
ignoreAccessorPattern:
- "**.root*"
- "**.numberingReferences*"
- "**.sections*"
- "**.properties*"
functional/prefer-property-signatures: error
functional/no-mixed-types: error
functional/prefer-readonly-type: error
no-unused-vars:
- error
- argsIgnorePattern: ^[_]+$
ignorePatterns:
- vite.config.ts
overrides:
- files:
- "*.spec.ts"
rules:
"@typescript-eslint/no-unused-expressions": "off"
"@typescript-eslint/dot-notation": "off"
prefer-destructuring: "off"
"@typescript-eslint/explicit-function-return-type": "off"

View File

@ -0,0 +1,12 @@
name: Install dependencies and build ⚙️
description: Install dependencies and build
runs:
using: composite
steps:
- name: Install Dependencies
shell: bash
run: npm ci --force
- name: Build
shell: bash
run: npm run build

View File

@ -0,0 +1,14 @@
name: Extract and Validate Document ⚙️
description: Extract the document and validate the XML against the schema.
runs:
using: composite
steps:
- name: Extract Word Document
shell: bash
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

View File

@ -13,13 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci --force
- name: Build
run: npm run build
uses: actions/checkout@v4
- uses: "./.github/actions/install-and-build"
- name: Archive Production Artifact
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: build
path: build
@ -28,22 +25,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci --force
- name: Test
run: npm run test.ci
run: npm run test:ci
- name: Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci --force
- name: Lint
@ -53,18 +52,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci --force
- name: Prettier
run: npm run style
run: npm run prettier
cspell:
name: CSpell
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci --force
- name: Prettier
- name: CSpell
run: npm run cspell

View File

@ -8,792 +8,189 @@ on:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci --force
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: build
path: build
demos:
name: Run Demos and Validate
needs: [build]
name: Demos
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci --force
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: build
path: build
- name: Run Demo
run: npm run ts-node -- ./demo/1-basic.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
- name: Run Demo
run: npm run ts-node -- ./demo/2-declaritive-styles.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
- name: Run Demo
run: npm run ts-node -- ./demo/3-numbering-and-bullet-points.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
- name: Run Demo
run: npm run ts-node -- ./demo/4-basic-table.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
- name: Run Demo
run: npm run ts-node -- ./demo/5-images.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
- name: Run Demo
run: npm run ts-node -- ./demo/6-page-borders.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
- name: Run Demo
run: npm run ts-node -- ./demo/7-landscape.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
- name: Run Demo
run: npm run ts-node -- ./demo/8-header-footer.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
- name: Run Demo
run: npm run ts-node -- ./demo/9-images-in-header-and-footer.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
- name: Run Demo
run: npm run ts-node -- ./demo/10-my-cv.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
- name: Run Demo
run: npm run ts-node -- ./demo/11-declaritive-styles-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
- name: Run Demo
run: npm run ts-node -- ./demo/12-scaling-images.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
- name: Run Demo
run: npm run ts-node -- ./demo/13-xml-styles.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
- name: Run Demo
run: npm run ts-node -- ./demo/14-page-numbers.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
- name: Run Demo
run: npm run ts-node -- ./demo/15-page-break-before.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
- name: Run Demo
run: npm run ts-node -- ./demo/16-multiple-sections.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
- name: Run Demo
run: npm run ts-node -- ./demo/17-footnotes.ts
- name: Extract Word Document
run: npm run extract
- uses: actions/checkout@v4
- uses: "./.github/actions/install-and-build"
- name: Run Demos
run: npm run run-ts -- ./demo/1-basic.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/2-declaritive-styles.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/3-numbering-and-bullet-points.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/4-basic-table.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/5-images.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/6-page-borders.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/7-landscape.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/8-header-footer.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/9-images-in-header-and-footer.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/10-my-cv.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/11-declaritive-styles-2.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/12-scaling-images.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/13-xml-styles.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/14-page-numbers.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/15-page-break-before.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/16-multiple-sections.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/17-footnotes.ts
# element r: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r': This element is not expected.
# - 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/18-image-from-buffer.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
- name: Run Demo
run: npm run ts-node -- ./demo/19-export-to-base64.ts
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/18-image-from-buffer.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/19-export-to-base64.ts
# 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
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/21-bookmarks.ts
- name: Extract Word Document
run: npm run extract
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/20-table-cell-borders.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/21-bookmarks.ts
# Bad ID - need numeric ID
# - 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/22-right-to-left-text.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
- name: Run Demo
run: npm run ts-node -- ./demo/23-base64-images.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
- name: Run Demo
run: npm run ts-node -- ./demo/24-images-to-table-cell.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
- name: Run Demo
run: npm run ts-node -- ./demo/25-table-xml-styles.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
- name: Run Demo
run: npm run ts-node -- ./demo/26-paragraph-borders.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
- name: Run Demo
run: npm run ts-node -- ./demo/27-declaritive-styles-3.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
- name: Run Demo
run: npm run ts-node -- ./demo/28-table-of-contents.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
- name: Run Demo
run: npm run ts-node -- ./demo/29-numbered-lists.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
- name: Run Demo
run: npm run ts-node -- ./demo/31-tables.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
- name: Run Demo
run: npm run ts-node -- ./demo/32-merge-and-shade-table-cells.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
- name: Run Demo
run: npm run ts-node -- ./demo/33-sequential-captions.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
- name: Run Demo
run: npm run ts-node -- ./demo/34-floating-tables.ts
- name: Extract Word Document
run: npm run extract
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/22-right-to-left-text.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/23-base64-images.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/24-images-to-table-cell.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/25-table-xml-styles.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/26-paragraph-borders.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/27-declaritive-styles-3.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/28-table-of-contents.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/29-numbered-lists.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/31-tables.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/32-merge-and-shade-table-cells.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/33-sequential-captions.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/34-floating-tables.ts
# element tblpPr: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}tblpPr', attribute 'overlap': The attribute 'overlap' is not allowed.
# element tblpPr: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}tblpPr': Element content is not allowed, because the content type is empty.
# - 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/35-hyperlinks.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
- name: Run Demo
run: npm run ts-node -- ./demo/36-image-to-table-cell.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
- name: Run Demo
run: npm run ts-node -- ./demo/37-images-to-header-and-footer.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
- name: Run Demo
run: npm run ts-node -- ./demo/38-text-wrapping.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
- name: Run Demo
run: npm run ts-node -- ./demo/39-page-numbers.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
- name: Run Demo
run: npm run ts-node -- ./demo/40-line-numbers.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
- name: Run Demo
run: npm run ts-node -- ./demo/41-merge-table-cells-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
- name: Run Demo
run: npm run ts-node -- ./demo/42-restart-page-numbers.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
- name: Run Demo
run: npm run ts-node -- ./demo/43-images-to-table-cell-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
- name: Run Demo
run: npm run ts-node -- ./demo/44-multiple-columns.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
- name: Run Demo
run: npm run ts-node -- ./demo/45-highlighting-text.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
- name: Run Demo
run: npm run ts-node -- ./demo/46-shading-text.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
- name: Run Demo
run: npm run ts-node -- ./demo/47-number-of-total-pages-section.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
- name: Run Demo
run: npm run ts-node -- ./demo/48-vertical-align.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
- name: Run Demo
run: npm run ts-node -- ./demo/49-table-borders.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
- name: Run Demo
run: npm run ts-node -- ./demo/50-readme-demo.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
- name: Run Demo
run: npm run ts-node -- ./demo/51-character-styles.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
- name: Run Demo
run: npm run ts-node -- ./demo/52-japanese.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
- name: Run Demo
run: npm run ts-node -- ./demo/53-chinese.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
- name: Run Demo
run: npm run ts-node -- ./demo/54-custom-properties.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
- name: Run Demo
run: npm run ts-node -- ./demo/55-math.ts
- name: Extract Word Document
run: npm run extract
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/35-hyperlinks.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/36-image-to-table-cell.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/37-images-to-header-and-footer.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/38-text-wrapping.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/39-page-numbers.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/40-line-numbers.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/41-merge-table-cells-2.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/42-restart-page-numbers.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/43-images-to-table-cell-2.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/44-multiple-columns.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/45-highlighting-text.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/46-shading-text.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/47-number-of-total-pages-section.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/48-vertical-align.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/49-table-borders.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/50-readme-demo.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/51-character-styles.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/52-japanese.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/53-chinese.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/54-custom-properties.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/55-math.ts
#: element subHide: Schemas validity error : Element '{http://schemas.openxmlformats.org/officeDocument/2006/math}subHide': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/officeDocument/2006/math}ctrlPr ).
#: element e: Schemas validity error : Element '{http://schemas.openxmlformats.org/officeDocument/2006/math}e': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/officeDocument/2006/math}sub ).
#: element e: Schemas validity error : Element '{http://schemas.openxmlformats.org/officeDocument/2006/math}e': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/officeDocument/2006/math}sup ).
#: element e: Schemas validity error : Element '{http://schemas.openxmlformats.org/officeDocument/2006/math}e': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/officeDocument/2006/math}sub ).
# - 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/56-background-color.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
- name: Run Demo
run: npm run ts-node -- ./demo/57-add-parent-numbered-lists.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
- name: Run Demo
run: npm run ts-node -- ./demo/58-section-types.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
- name: Run Demo
run: npm run ts-node -- ./demo/59-header-footer-margins.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
- name: Run Demo
run: npm run ts-node -- ./demo/60-track-revisions.ts
- name: Extract Word Document
run: npm run extract
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/56-background-color.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/57-add-parent-numbered-lists.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/58-section-types.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/59-header-footer-margins.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/60-track-revisions.ts
# element r: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r': This element is not expected.
# - 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/61-text-frame.ts
- name: Extract Word Document
run: npm run extract
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/61-text-frame.ts
# element left: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}left': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}right, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}between, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}bar ).
# - 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/62-paragraph-spacing.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
- name: Run Demo
run: npm run ts-node -- ./demo/63-odd-even-header-footer.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
- name: Run Demo
run: npm run ts-node -- ./demo/64-complex-numbering-text.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
- name: Run Demo
run: npm run ts-node -- ./demo/65-page-sizes.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
- name: Run Demo
run: npm run ts-node -- ./demo/66-fields.ts
- name: Extract Word Document
run: npm run extract
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/62-paragraph-spacing.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/63-odd-even-header-footer.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/64-complex-numbering-text.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/65-page-sizes.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/66-fields.ts
# element bookmarkStart: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bookmarkStart', attribute '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}id': '-irrswq-ln94j4fdgdjxs' is not a valid value of the atomic type '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_DecimalNumber'.
# element bookmarkEnd: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bookmarkEnd', attribute '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}id': '-irrswq-ln94j4fdgdjxs' is not a valid value of the atomic type '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_DecimalNumber'.
# - 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/67-column-break.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
- name: Run Demo
run: npm run ts-node -- ./demo/68-numbering-instances-and-starting-number.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
- name: Run Demo
run: npm run ts-node -- ./demo/69-different-width-columns.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
- name: Run Demo
run: npm run ts-node -- ./demo/70-line-numbers-suppression.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
- 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
- name: Run Demo
run: npm run ts-node -- ./demo/72-word-wrap.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
- name: Run Demo
run: npm run ts-node -- ./demo/73-comments.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
- name: Run Demo
run: npm run ts-node -- ./demo/73-comments.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
# - name: Run Demo
# run: npm run ts-node -- ./demo/75-tab-stops.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
- name: Run Demo
run: npm run ts-node -- ./demo/76-compatibility.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
- name: Run Demo
run: npm run ts-node -- ./demo/77-side-by-side-tables.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
- name: Run Demo
run: npm run ts-node -- ./demo/78-thai-distributed.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
- name: Run Demo
run: npm run ts-node -- ./demo/79-table-from-data-source.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
- name: Run Demo
run: npm run ts-node -- ./demo/80-thai-distributed.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
- name: Run Demo
run: npm run ts-node -- ./demo/81-continuous-header.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
- name: Run Demo
run: npm run ts-node -- ./demo/82-new-headers-new-section.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
- name: Run Demo
run: npm run ts-node -- ./demo/83-setting-languages.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
- name: Run Demo
run: npm run ts-node -- ./demo/84-positional-tabs.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
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/67-column-break.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/68-numbering-instances-and-starting-number.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/69-different-width-columns.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/70-line-numbers-suppression.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/71-page-borders-2.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/72-word-wrap.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/73-comments.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/74-nodejs-stream.ts
# - uses: "./.github/actions/validate-docx"
# run: npm run run-ts -- ./demo/75-tab-stops.ts
# - uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/76-compatibility.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/77-side-by-side-tables.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/78-thai-distributed.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/79-table-from-data-source.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/80-thai-distributed.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/81-continuous-header.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/82-new-headers-new-section.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/83-setting-languages.ts
- uses: "./.github/actions/validate-docx"
- run: npm run run-ts -- ./demo/84-positional-tabs.ts
- uses: "./.github/actions/validate-docx"

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci --force
- name: Build 🔧
@ -19,7 +19,7 @@ jobs:
echo "docx.js.org" > docs/.nojekyll
echo "docx.js.org" > docs/CNAME
- name: Archive Production Artifact
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: docs
path: docs
@ -28,11 +28,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo 🛎️
uses: actions/checkout@master
uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci --force
- name: Download Artifact
uses: actions/download-artifact@master
uses: actions/download-artifact@v4
with:
name: docs
path: docs

46
.github/workflows/npm-publish.yml vendored Normal file
View File

@ -0,0 +1,46 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Node.js Package
on:
release:
types: [created]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- run: npm ci --force
- run: npm run cspell
- run: npm run prettier
- run: npm run lint
- run: npm run test:ci
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- run: npm ci --force
- run: npm run build
publish-npm:
needs: [test, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: https://registry.npmjs.org/
- run: npm ci --force
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

3
.gitignore vendored
View File

@ -33,8 +33,7 @@ node_modules
.node_repl_history
# build
build
build-tests
dist
# Documentation
docs/api/

16
.vscode/launch.json vendored
View File

@ -1,18 +1,4 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Demo",
"type": "node",
"request": "launch",
"runtimeArgs": [
"-r",
"${workspaceFolder}/node_modules/ts-node/register",
"-r",
"${workspaceFolder}/node_modules/tsconfig-paths/register"
],
"cwd": "${workspaceRoot}",
"program": "${workspaceFolder}/demo/85-template-document.ts"
}
]
"configurations": []
}

View File

@ -5,5 +5,6 @@
"editor.formatOnSave": false,
"prettier.tabWidth": 4,
"prettier.arrowParens": "always",
"prettier.bracketSpacing": true
"prettier.bracketSpacing": true,
"eslint.useFlatConfig": true
}

20
.vscode/tasks.json vendored
View File

@ -2,23 +2,5 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
]
},
{
"type": "npm",
"script": "ts-node",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
"tasks": []
}

View File

@ -12,9 +12,9 @@
[![Downloads per month][downloads-image]][downloads-url]
[![GitHub Action Workflow Status][github-actions-workflow-image]][github-actions-workflow-url]
[![Known Vulnerabilities][snky-image]][snky-url]
[![Chat on Gitter][gitter-image]][gitter-url]
[![PRs Welcome][pr-image]][pr-url]
[![codecov][codecov-image]][codecov-url]
[![Docx.js Editor][docxjs-editor-image]][docxjs-editor-url]
<p align="center">
<img src="https://i.imgur.com/QeL1HuU.png" alt="drawing"/>
@ -65,6 +65,10 @@ More [here](https://github.com/dolanmiu/docx/tree/master/demo)
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!
# Playground
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.
# Examples
Check the [demo folder](https://github.com/dolanmiu/docx/tree/master/demo) for examples.
@ -89,6 +93,7 @@ Read the contribution guidelines [here](https://docx.js.org/#/contribution-guide
[<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/)
[<img src="https://i.imgur.com/9tqJaHw.png" alt="drawing" height="50"/>](https://novelpad.co/)
[<img src="https://i.imgur.com/5bLKFeP.png" alt="drawing" height="50"/>](https://proton.me/)
...and many more!
@ -107,8 +112,6 @@ Made with 💖
[github-actions-workflow-url]: https://github.com/dolanmiu/docx/actions
[snky-image]: https://snyk.io/test/github/dolanmiu/docx/badge.svg
[snky-url]: https://snyk.io/test/github/dolanmiu/docx
[gitter-image]: https://badges.gitter.im/dolanmiu/docx.svg
[gitter-url]: https://gitter.im/docx-lib/Lobby
[pr-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[pr-url]: http://makeapullrequest.com
[codecov-image]: https://codecov.io/gh/dolanmiu/docx/branch/master/graph/badge.svg
@ -117,3 +120,5 @@ Made with 💖
[patreon-url]: https://www.patreon.com/dolanmiu
[browserstack-image]: https://user-images.githubusercontent.com/2917613/54233552-128e9d00-4505-11e9-88fb-025a4e04007c.png
[browserstack-url]: https://www.browserstack.com
[docxjs-editor-image]: https://img.shields.io/badge/Docx.js%20Editor-2b579a.svg?style=flat&amp;logo=javascript&amp;logoColor=white
[docxjs-editor-url]: https://docxjs-editor.vercel.app/

24
SECURITY.md Normal file
View File

@ -0,0 +1,24 @@
# Security Policy
## Supported Versions
Use this section to tell people about which versions of your project are
currently being supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| 9.0.x | :white_check_mark: |
## Reporting a Vulnerability
We encourage responsible disclosure of security vulnerabilities. If you believe you have found a security vulnerability in this project, please report it via the [Security Tab](https://github.com/dolanmiu/docx/security/advisories)
Please include the following information in your report:
* A description of the vulnerability
* Steps to reproduce the vulnerability
* Impact of the vulnerability
We will investigate all reported vulnerabilities and take appropriate action.
We appreciate your help in keeping this project secure.

View File

@ -45,7 +45,7 @@ const doc = new Document({
children: [
new TextRun("My Title "),
new TextRun({
children: ["Footer - Page ", PageNumber.CURRENT],
children: ["Footer - Page ", PageNumber.CURRENT, " of ", PageNumber.TOTAL_PAGES],
}),
],
}),

View File

@ -43,6 +43,15 @@ const doc = new Document({
color: "#FF0000",
},
},
document: {
run: {
size: "11pt",
font: "Calibri",
},
paragraph: {
alignment: AlignmentType.RIGHT,
},
},
},
paragraphStyles: [
{

View File

@ -4,6 +4,18 @@ import * as fs from "fs";
import { Document, ExternalHyperlink, Footer, FootnoteReferenceRun, ImageRun, Packer, Paragraph, TextRun } from "docx";
const doc = new Document({
styles: {
default: {
hyperlink: {
run: {
color: "FF0000",
underline: {
color: "0000FF",
},
},
},
},
},
footnotes: {
1: {
children: [

View File

@ -2,6 +2,7 @@
import * as fs from "fs";
import {
convertMillimetersToTwip,
Document,
HorizontalPositionAlign,
HorizontalPositionRelativeFrom,
@ -20,6 +21,7 @@ const doc = new Document({
new Paragraph({
children: [
new ImageRun({
type: "jpg",
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: {
width: 100,
@ -36,17 +38,24 @@ const doc = new Document({
new Paragraph({
children: [
new ImageRun({
type: "png",
data: fs.readFileSync("./demo/images/dog.png").toString("base64"),
transformation: {
width: 100,
height: 100,
},
outline: {
type: "solidFill",
solidFillType: "rgb",
value: "FF0000",
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
type: "jpg",
data: fs.readFileSync("./demo/images/cat.jpg"),
transformation: {
width: 100,
@ -55,12 +64,19 @@ const doc = new Document({
vertical: true,
},
},
outline: {
type: "solidFill",
solidFillType: "rgb",
value: "0000FF",
width: convertMillimetersToTwip(600),
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
type: "bmp",
data: fs.readFileSync("./demo/images/parrots.bmp"),
transformation: {
width: 150,
@ -76,6 +92,7 @@ const doc = new Document({
new Paragraph({
children: [
new ImageRun({
type: "gif",
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
@ -91,6 +108,7 @@ const doc = new Document({
new Paragraph({
children: [
new ImageRun({
type: "gif",
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
@ -112,6 +130,7 @@ const doc = new Document({
new Paragraph({
children: [
new ImageRun({
type: "jpg",
data: fs.readFileSync("./demo/images/cat.jpg"),
transformation: {
width: 200,
@ -131,6 +150,22 @@ const doc = new Document({
}),
],
}),
new Paragraph({
children: [
new ImageRun({
type: "svg",
data: fs.readFileSync("./demo/images/linux-svg.svg"),
transformation: {
width: 200,
height: 200,
},
fallback: {
type: "png",
data: fs.readFileSync("./demo/images/linux-png.png"),
},
}),
],
}),
],
},
],

View File

@ -21,6 +21,8 @@ import {
Packer,
Paragraph,
TextRun,
MathLimitLower,
MathLimitUpper,
} from "docx";
const doc = new Document({
@ -316,6 +318,23 @@ const doc = new Document({
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathLimitUpper({
children: [new MathRun("x")],
limit: [new MathRun("-")],
}),
new MathRun("="),
new MathLimitLower({
children: [new MathRun("lim")],
limit: [new MathRun("x→0")],
}),
],
}),
],
}),
],
},
],

View File

@ -2,6 +2,7 @@
import * as fs from "fs";
import {
AlignmentType,
BorderStyle,
Document,
FrameAnchorType,
@ -20,6 +21,7 @@ const doc = new Document({
children: [
new Paragraph({
frame: {
type: "absolute",
position: {
x: 1000,
y: 3000,
@ -30,6 +32,54 @@ const doc = new Document({
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
border: {
top: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
bottom: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
left: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
right: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
},
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
new TextRun({
children: [new Tab(), "Github is the best"],
bold: true,
}),
],
}),
new Paragraph({
frame: {
type: "alignment",
width: 4000,
height: 1000,
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
alignment: {
x: HorizontalPositionAlign.CENTER,
y: VerticalPositionAlign.TOP,
@ -73,6 +123,59 @@ const doc = new Document({
}),
],
}),
new Paragraph({
frame: {
type: "alignment",
width: 4000,
height: 1000,
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
alignment: {
x: HorizontalPositionAlign.CENTER,
y: VerticalPositionAlign.BOTTOM,
},
},
border: {
top: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
bottom: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
left: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
right: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
},
alignment: AlignmentType.RIGHT,
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
new TextRun({
children: [new Tab(), "Github is the best"],
bold: true,
}),
],
}),
],
},
],

View File

@ -107,5 +107,5 @@ const doc = new Document({
// Used to export the file into a .docx file
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("6-numbering.docx", buffer);
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -18,6 +18,7 @@ const receiptTabStops = [
const twoTabStops = [{ type: TabStopType.RIGHT, position: TabStopPosition.MAX }];
const doc = new Document({
defaultTabStop: 0,
sections: [
{
properties: {},

View File

@ -16,7 +16,9 @@ import {
VerticalAlign,
} from "docx";
patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
patchDocument({
outputType: "nodebuffer",
data: fs.readFileSync("demo/assets/simple-template.docx"),
patches: {
name: {
type: PatchType.PARAGRAPH,
@ -56,7 +58,11 @@ patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
],
link: "https://www.google.co.uk",
}),
new ImageRun({ data: fs.readFileSync("./demo/images/dog.png"), transformation: { width: 100, height: 100 } }),
new ImageRun({
type: "png",
data: fs.readFileSync("./demo/images/dog.png"),
transformation: { width: 100, height: 100 },
}),
],
}),
],
@ -82,7 +88,13 @@ patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
},
image_test: {
type: PatchType.PARAGRAPH,
children: [new ImageRun({ data: fs.readFileSync("./demo/images/image1.jpeg"), transformation: { width: 100, height: 100 } })],
children: [
new ImageRun({
type: "jpg",
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: { width: 100, height: 100 },
}),
],
},
table: {
type: PatchType.DOCUMENT,

View File

@ -3,7 +3,9 @@
import * as fs from "fs";
import { patchDocument, PatchType, TextRun } from "docx";
patchDocument(fs.readFileSync("demo/assets/simple-template-2.docx"), {
patchDocument({
outputType: "nodebuffer",
data: fs.readFileSync("demo/assets/simple-template-2.docx"),
patches: {
name: {
type: PatchType.PARAGRAPH,

View File

@ -24,7 +24,9 @@ const patches = getPatches({
paragraph_replace: "Lorem ipsum paragraph",
});
patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
patchDocument({
outputType: "nodebuffer",
data: fs.readFileSync("demo/assets/simple-template.docx"),
patches,
}).then((doc) => {
fs.writeFileSync("My Document.docx", doc);

View File

@ -22,8 +22,11 @@ const patches = getPatches({
"first-name": "John",
});
patchDocument(fs.readFileSync("demo/assets/simple-template-3.docx"), {
patchDocument({
outputType: "nodebuffer",
data: fs.readFileSync("demo/assets/simple-template-3.docx"),
patches,
keepOriginalStyles: true,
}).then((doc) => {
fs.writeFileSync("My Document.docx", doc);
});

44
demo/90-check-boxes.ts Normal file
View File

@ -0,0 +1,44 @@
// Simple example to add check boxes to a document
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun, CheckBox } from "docx";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({ break: 1 }),
new CheckBox(),
new TextRun({ break: 1 }),
new CheckBox({ checked: true }),
new TextRun({ break: 1 }),
new CheckBox({ checked: true, checkedState: { value: "2611" } }),
new TextRun({ break: 1 }),
new CheckBox({ checked: true, checkedState: { value: "2611", font: "MS Gothic" } }),
new TextRun({ break: 1 }),
new CheckBox({
checked: true,
checkedState: { value: "2611", font: "MS Gothic" },
uncheckedState: { value: "2610", font: "MS Gothic" },
}),
new TextRun({ break: 1 }),
new CheckBox({
checked: true,
checkedState: { value: "2611", font: "MS Gothic" },
uncheckedState: { value: "2610", font: "MS Gothic" },
}),
new TextRun({ text: "Are you ok?", break: 1 }),
new CheckBox({ checked: true, alias: "Are you ok?" }),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

40
demo/91-custom-fonts.ts Normal file
View File

@ -0,0 +1,40 @@
// Simple example to add text to a document
import * as fs from "fs";
import { CharacterSet, Document, Packer, Paragraph, Tab, TextRun } from "docx";
const font = fs.readFileSync("./demo/assets/Pacifico.ttf");
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
run: {
font: "Pacifico",
},
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
size: 40,
font: "Pacifico",
}),
new TextRun({
children: [new Tab(), "Github is the best"],
bold: true,
font: "Pacifico",
}),
],
}),
],
},
],
fonts: [{ name: "Pacifico", data: font, characterSet: CharacterSet.ANSI }],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,44 @@
// Simple example to add text to a document
import * as fs from "fs";
import { Document, Packer, Paragraph, Tab, TextRun } from "docx";
const font = fs.readFileSync("./demo/assets/Pacifico.ttf");
const doc = new Document({
styles: {
default: {
document: {
run: {
font: "Pacifico",
},
},
},
},
sections: [
{
properties: {},
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
size: 40,
}),
new TextRun({
children: [new Tab(), "Github is the best"],
bold: true,
}),
],
}),
],
},
],
fonts: [{ name: "Pacifico", data: font, characterSet: "00" }],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,72 @@
// Patch a document with patches
import * as fs from "fs";
import { patchDocument, PatchType, TextRun } from "docx";
patchDocument({
outputType: "nodebuffer",
data: fs.readFileSync("demo/assets/field-trip.docx"),
patches: {
todays_date: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: new Date().toLocaleDateString() })],
},
school_name: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
address: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "blah blah" })],
},
city: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
state: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
zip: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
phone: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
first_name: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
last_name: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
email_address: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
ft_dates: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
grade: {
type: PatchType.PARAGRAPH,
children: [new TextRun({ text: "test" })],
},
},
}).then((doc) => {
fs.writeFileSync("My Document.docx", doc);
});

43
demo/94-texbox.ts Normal file
View File

@ -0,0 +1,43 @@
// Simple example to add textbox to a document
import { Document, Packer, Paragraph, Textbox, TextRun } from "docx";
import * as fs from "fs";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Textbox({
alignment: "center",
children: [
new Paragraph({
children: [new TextRun("Hi i'm a textbox!")],
}),
],
style: {
width: "200pt",
height: "auto",
},
}),
new Textbox({
alignment: "center",
children: [
new Paragraph({
children: [new TextRun("Hi i'm a textbox with a hidden box!")],
}),
],
style: {
width: "300pt",
height: 400,
visibility: "hidden",
zIndex: "auto",
},
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,60 @@
import * as fs from "fs";
import { BorderStyle, Document, Packer, Paragraph, TextRun } from "docx";
const doc = new Document({
styles: {
paragraphStyles: [
{
id: "withSingleBlackBordersAndYellowShading",
name: "Paragraph Style with Black Borders and Yellow Shading",
basedOn: "Normal",
paragraph: {
shading: {
color: "#fff000",
type: "solid",
},
border: {
top: {
style: BorderStyle.SINGLE,
color: "#000000",
size: 4,
},
bottom: {
style: BorderStyle.SINGLE,
color: "#000000",
size: 4,
},
left: {
style: BorderStyle.SINGLE,
color: "#000000",
size: 4,
},
right: {
style: BorderStyle.SINGLE,
color: "#000000",
size: 4,
},
},
},
},
],
},
sections: [
{
children: [
new Paragraph({
style: "withSingleBlackBordersAndYellowShading",
children: [
new TextRun({
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

BIN
demo/assets/Pacifico.ttf Normal file

Binary file not shown.

BIN
demo/assets/field-trip.docx Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<script src="../build/index.umd.cjs"></script>
<script src="../build/index.umd.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.js"></script>
</head>

BIN
demo/images/linux-png.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

183
demo/images/linux-svg.svg Normal file
View File

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="500pt" height="600pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/">
<defs>
<linearGradient id="linearGradient172">
<stop style="stop-color:#3f2600;stop-opacity:0.6;" offset="0" id="stop173" />
<stop style="stop-color:#3f2600;stop-opacity:0;" offset="1" id="stop174" />
</linearGradient>
<linearGradient id="linearGradient167">
<stop style="stop-color:#ffffff;stop-opacity:0.65;" offset="0" id="stop168" />
<stop style="stop-color:#ffffff;stop-opacity:0;" offset="1" id="stop169" />
</linearGradient>
<linearGradient id="linearGradient162">
<stop style="stop-color:#ffa63f;stop-opacity:1;" offset="0" id="stop163" />
<stop style="stop-color:#ffff00;stop-opacity:1;" offset="1" id="stop164" />
</linearGradient>
<linearGradient id="linearGradient153">
<stop style="stop-color:#ffeed7;stop-opacity:1;" offset="0" id="stop154" />
<stop style="stop-color:#bdbfc2;stop-opacity:1;" offset="1" id="stop155" /></linearGradient>
<linearGradient id="linearGradient138">
<stop style="stop-color:#ffffff;stop-opacity:0.8;" offset="0" id="stop139" />
<stop style="stop-color:#ffffff;stop-opacity:0;" offset="1" id="stop140" />
</linearGradient>
<linearGradient xlink:href="#linearGradient138" id="linearGradient141" x1="0.47424799" y1="0.020191999" x2="0.417539" y2="0.90125799" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient142" x1="0.55880702" y1="0.031192999" x2="0.553922" y2="0.94531101" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient143" x1="0.46557701" y1="0.028819799" x2="0.41365999" y2="0.93366498" gradientUnits="objectBoundingBox"/>
<linearGradient xlink:href="#linearGradient167" id="linearGradient144" x1="0.70346397" y1="0.059404202" x2="0.64553201" y2="0.94063401" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient145" x1="0.46741399" y1="-0.036155298" x2="0.86741799" y2="0.75857902" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient146" x1="0.57152498" y1="0.023441499" x2="0.57143003" y2="0.71875" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient147" x1="0.5" y1="0.0234362" x2="0.5" y2="0.8125" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient148" x1="0.50799799" y1="0.37435901" x2="0.51599997" y2="0.92820501" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient138" id="linearGradient149" x1="0.5" y1="0.131707" x2="0.50400001" y2="0.94634098" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient150" x1="-0.30509499" y1="0.099496603" x2="0.156323" y2="0.94191301" gradientUnits="objectBoundingBox" gradientTransform="matrix(-0.928523,0.283938,0.435332,0.943857,-1.91327e-7,5.49908e-8)" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient151" x1="0.433979" y1="0.022184599" x2="0.487055" y2="1.02569" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient152" x1="0.5" y1="0.89842999" x2="0.5" y2="0.40625" gradientUnits="objectBoundingBox" spreadMethod="reflect" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient156" x1="0.43568701" y1="0.98882002" x2="0.453989" y2="0.23093501" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient157" x1="0.49180499" y1="1.15284" x2="0.49482101" y2="0.41252401" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient158" x1="0.51730198" y1="0.85418499" x2="0.49843901" y2="0.136172" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient159" x1="0.46201" y1="0.87917101" x2="0.49215299" y2="0.096282303" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient162" id="linearGradient161" x1="0.50086302" y1="0.34872901" x2="0.41209599" y2="0.98558098" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient162" id="linearGradient165" x1="0.60399801" y1="0.51020199" x2="0.46399999" y2="0.98367399" gradientUnits="objectBoundingBox" />
<linearGradient xlink:href="#linearGradient162" id="linearGradient166" x1="0.50000501" y1="0.191616" x2="0.50800002" y2="0.97005898" gradientUnits="objectBoundingBox" />
<radialGradient xlink:href="#linearGradient172" id="radialGradient171" cx="0.5" cy="0.5" fx="0.5" fy="0.5" r="0.5" gradientUnits="objectBoundingBox" />
<radialGradient xlink:href="#linearGradient172" id="radialGradient176" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient178" x1="0.94027299" y1="1.2934099" x2="0.19452" y2="-0.675295" gradientUnits="objectBoundingBox" />
<radialGradient xlink:href="#linearGradient172" id="radialGradient1399" gradientTransform="scale(1.045233,0.956725)" cx="446.77762" cy="1219.4125" fx="446.77762" fy="1219.4125" r="195.07191" gradientUnits="userSpaceOnUse" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient1401" gradientUnits="userSpaceOnUse" x1="400.57785" y1="369.53015" x2="400.84448" y2="304.07886" gradientTransform="scale(0.575262,1.738339)" />
<linearGradient xlink:href="#linearGradient138" id="linearGradient1403" gradientUnits="userSpaceOnUse" x1="303.01761" y1="237.93179" x2="297.0856" y2="330.09561" gradientTransform="scale(1.116071,0.896001)" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient1405" gradientUnits="userSpaceOnUse" gradientTransform="scale(0.816497,1.224744)" x1="378.93771" y1="278.60202" x2="380.27319" y2="243.91606" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient1407" gradientUnits="userSpaceOnUse" x1="381.38742" y1="277.495" x2="380.5517" y2="245.68338" gradientTransform="scale(0.816497,1.224744)" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1409" gradientUnits="userSpaceOnUse" gradientTransform="scale(0.816497,1.224744)" x1="379.09573" y1="240.92712" x2="376.79556" y2="281.01636" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1411" gradientUnits="userSpaceOnUse" x1="389.63535" y1="242.28218" x2="387.06866" y2="281.32513" gradientTransform="scale(0.816497,1.224744)" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient1413" gradientUnits="userSpaceOnUse" spreadMethod="reflect" x1="437.57941" y1="528.87177" x2="437.57941" y2="394.10361" gradientTransform="scale(0.812855,1.230232)" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient1415" gradientUnits="userSpaceOnUse" x1="375.17325" y1="419.78485" x2="377.48541" y2="324.03815" gradientTransform="scale(0.649784,1.538974)" />
<linearGradient xlink:href="#linearGradient138" id="linearGradient1417" gradientUnits="userSpaceOnUse" x1="320.75104" y1="498.17776" x2="321.32224" y2="614.50439" gradientTransform="scale(1.074798,0.930408)" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1419" gradientUnits="userSpaceOnUse" x1="322.48257" y1="435.26761" x2="323.2514" y2="488.48251" gradientTransform="scale(1.077001,0.928504)" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1421" gradientUnits="userSpaceOnUse" x1="411.2215" y1="242.94365" x2="411.2215" y2="331.44858" gradientTransform="scale(0.571707,1.749147)" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1423" gradientUnits="userSpaceOnUse" x1="867.34546" y1="234.73897" x2="867.33453" y2="314.83911" gradientTransform="scale(0.572667,1.746214)" />
<linearGradient xlink:href="#linearGradient162" id="linearGradient1425" gradientUnits="userSpaceOnUse" x1="236.25362" y1="657.11133" x2="212.5099" y2="737.41229" gradientTransform="scale(1.011514,0.988617)" />
<linearGradient xlink:href="#linearGradient153" id="linearGradient1427" gradientUnits="userSpaceOnUse" x1="381.56607" y1="655.73102" x2="279.64313" y2="386.66583" gradientTransform="scale(1.065499,0.938527)" />
<linearGradient xlink:href="#linearGradient162" id="linearGradient1429" gradientUnits="userSpaceOnUse" x1="218.11714" y1="630.30475" x2="203.12654" y2="737.8537" gradientTransform="scale(1.009851,0.990245)" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1431" gradientUnits="userSpaceOnUse" gradientTransform="scale(1.007724,0.992335)" x1="117.88966" y1="587.23602" x2="182.24524" y2="704.73077" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1433" gradientUnits="userSpaceOnUse" x1="223.10072" y1="570.41809" x2="230.53499" y2="710.97723" gradientTransform="scale(0.999504,1.000496)" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1435" gradientUnits="userSpaceOnUse" x1="316.93988" y1="474.01779" x2="371.60889" y2="582.63507" gradientTransform="scale(1.065499,0.938527)" />
<linearGradient xlink:href="#linearGradient162" id="linearGradient1437" gradientUnits="userSpaceOnUse" x1="284.68652" y1="410.46326" x2="285.45923" y2="485.69934" gradientTransform="scale(1.218684,0.820557)" />
<linearGradient xlink:href="#linearGradient167" id="linearGradient1439" gradientUnits="userSpaceOnUse" x1="288.82358" y1="398.85422" x2="288.37628" y2="482.55939" gradientTransform="scale(1.221941,0.81837)" />
</defs>
<g id="g1369" transform="translate(-310.7524,-64.25268)">
<path transform="matrix(1.4177,0,0,0.414745,-38.7944,222.194)" d="M 670.88202 1166.6423 A 203.89551 186.63016 0 1 1 263.091,1166.6423 A 203.89551 186.63016 0 1 1 670.88202 1166.6423 z" id="path175" style="fill:url(#radialGradient1399);stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter" />
<path transform="matrix(1.25,0,0,1.25,185.454,-167.505)" id="path106" d="M 223.627,632.24 C 201.239,600.017 196.873,495.256 249.114,430.81 C 275,399.892 281.604,378.345 283.645,349.417 C 285.034,316.438 260.32,217.975 353.528,210.473 C 447.934,202.941 442.864,296.133 442.321,345.448 C 441.87,387.088 472.895,410.689 494.117,443.143 C 533.396,502.773 530.074,605.443 486.718,661.015 C 431.801,730.583 384.765,700.413 353.528,702.945 C 295.035,706.147 293.101,737.336 223.627,632.24 z " style="fill:#000000;stroke:none;stroke-width:1.25;" />
<path transform="matrix(-1.67739,-2.24516e-2,-2.11236e-2,1.4709,1173.58,-293.017)" id="path113" d="M 246.571,470.864 C 234.332,483.36 202.175,539.956 251.44,576.224 C 268.809,588.857 235.063,635.719 219.435,612.532 C 191.865,570.914 210.604,505.591 227.75,482.344 C 239.402,465.857 256.98,459.668 246.571,470.864 z " style="fill:url(#linearGradient1401);stroke:none;stroke-width:0.99464899;" />
<path transform="matrix(-1.67755,0,0,1.52374,1174.62,-318.082)" id="path111" d="M 256.513,459.837 C 236.598,477.554 200.337,539.928 253.225,580.443 C 270.595,593.075 237.832,632.906 219.435,612.532 C 155.472,541.712 221.104,460.278 243.697,432.282 C 263.889,407.935 281.775,438.034 256.513,459.837 z " style="fill:#000000;stroke:#000000;stroke-width:0.97729802;" />
<path transform="matrix(1.26626,-7.13667e-2,-4.59795e-2,1.19574,202.143,-125.761)" d="M 399.56879 258.15753 A 58.37323 46.863022 0 1 1 282.82233,258.15753 A 58.37323 46.863022 0 1 1 399.56879 258.15753 z" id="path114" style="fill:url(#linearGradient1403);stroke:none;stroke-width:1.26498997;" />
<path transform="matrix(1.30445,-7.55326e-2,7.71251e-2,1.34257,144.757,-177.617)" d="M 328.86324 320.64151 A 18.087479 27.131195 0 1 1 292.68828,320.64151 A 18.087479 27.131195 0 1 1 328.86324 320.64151 z" id="path115" style="fill:url(#linearGradient1405);stroke:none;stroke-width:1.17873001;" />
<path transform="matrix(-1.81082,4.95107e-2,3.17324e-2,1.55333,1207.46,-284.777)" d="M 328.86324 320.64151 A 18.087479 27.131195 0 1 1 292.68828,320.64151 A 18.087479 27.131195 0 1 1 328.86324 320.64151 z" id="path116" style="fill:url(#linearGradient1407);stroke:none;stroke-width:0.93138498;" />
<path transform="matrix(-0.823196,-1.76123e-3,-1.82321e-2,0.852662,913.674,-37.9902)" d="M 328.86324 320.64151 A 18.087479 27.131195 0 1 1 292.68828,320.64151 A 18.087479 27.131195 0 1 1 328.86324 320.64151 z" id="path117" style="fill:#000000;stroke:none;stroke-width:1.86495996;" />
<path transform="matrix(0.59438,-7.22959e-2,6.88176e-2,0.705838,367.448,32.4186)" d="M 328.86324 320.64151 A 18.087479 27.131195 0 1 1 292.68828,320.64151 A 18.087479 27.131195 0 1 1 328.86324 320.64151 z" id="path118" style="fill:#000000;stroke:none;stroke-width:2.39814997;" />
<path transform="matrix(-0.480323,-3.6454e-2,-4.67935e-2,0.475606,813.496,87.0124)" d="M 328.86324 320.64151 A 18.087479 27.131195 0 1 1 292.68828,320.64151 A 18.087479 27.131195 0 1 1 328.86324 320.64151 z" id="path121" style="fill:url(#linearGradient1409);stroke:none;stroke-width:3.1916101;" />
<path transform="matrix(0.35691,-4.08211e-2,4.13232e-2,0.398544,449.334,114.991)" d="M 328.86324 320.64151 A 18.087479 27.131195 0 1 1 292.68828,320.64151 A 18.087479 27.131195 0 1 1 328.86324 320.64151 z" id="path122" style="fill:url(#linearGradient1411);stroke:none;stroke-width:4.12025976;" />
<path transform="matrix(1.25,0,0,1.25,185.454,-168.23)" id="path128" d="M 258.702,495.425 C 271.538,466.322 298.816,415.199 299.397,375.667 C 299.397,344.225 393.576,336.716 401.134,368.109 C 408.692,399.502 427.875,446.592 440.084,469.265 C 452.292,491.937 487.893,563.96 449.968,626.811 C 415.811,682.455 312.243,726.477 256.958,619.254 C 238.355,582.047 241.673,535.939 258.702,495.425 z " style="fill:url(#linearGradient1413);stroke:none;stroke-width:1.25;" />
<path transform="matrix(1.38936,-0.111074,0.102211,1.30214,108.413,-165.938)" id="path112" d="M 242.905,473.815 C 231.642,492.782 207.405,543.124 255.042,575.862 C 306.353,610.682 301.515,672.924 239.435,637.817 C 182.658,606.028 216.59,500.039 234.925,475.551 C 247.032,458.337 264.822,437.52 242.905,473.815 z " style="fill:url(#linearGradient1415);stroke:none;stroke-width:1.15804005;" />
<path transform="matrix(1.25,0,0,1.25,185.454,-167.505)" id="path109" d="M 256.513,449.72 C 239.048,478.228 197.136,545.533 253.225,580.443 C 328.794,626.798 307.398,673.154 238.426,631.417 C 141.317,573.153 226.601,455.801 265.557,411.079 C 310.001,360.879 274.111,420.166 256.513,449.72 z " style="fill:#000000;stroke:#000000;stroke-width:1.25;" />
<path id="path125" d="M 421.481,504.727 C 421.481,537.139 392.209,579.243 341.953,578.865 C 290.125,579.32 268.004,537.139 268.004,504.727 C 268.004,472.315 302.383,446.01 344.743,446.01 C 387.102,446.01 421.481,472.315 421.481,504.727 z " style="font-size:12px;fill:url(#linearGradient1417);stroke:none;stroke-width:1.23705006;stroke-dasharray:none" transform="matrix(1.30209,0,0,1.22525,170.042,-153.557)" />
<path id="path127" d="M 398.227,412.292 C 397.615,450.864 375.047,459.963 346.487,459.963 C 317.926,459.963 297.195,454.269 294.746,412.292 C 294.746,385.978 317.926,370.75 346.487,370.75 C 375.047,370.75 398.227,385.978 398.227,412.292 z " style="font-size:12px;fill:url(#linearGradient1419);stroke:none;stroke-width:1.38846004;stroke-dasharray:none" transform="matrix(1.1868,0,0,1.06708,210.623,-100.078)" />
<path transform="matrix(1.25,0,0,1.25,185.454,-167.505)" id="path129" d="M 234.285,456.475 C 252.001,429.479 289.3,388.111 241.262,462.288 C 202.311,523.331 226.859,562.561 239.518,573.327 C 276.045,605.889 274.484,627.676 245.913,610.533 C 184.288,573.907 197.078,512.285 234.285,456.475 z " style="fill:url(#linearGradient1421);stroke:none;stroke-width:1.25;" />
<path transform="matrix(1.25,0,0,1.25,185.454,-167.505)" id="path131" d="M 490.662,467.52 C 475.343,435.819 426.528,355.618 492.988,448.917 C 553.449,533.214 511.01,591.93 503.452,597.744 C 495.895,603.557 470.315,615.184 477.873,594.837 C 485.43,574.49 523.107,535.864 490.662,467.52 z " style="fill:url(#linearGradient1423);stroke:none;stroke-width:1.25;" />
<path transform="matrix(1.25,0,0,1.25,185.454,-167.505)" id="path132" d="M 220.915,716.921 C 180.473,695.505 121.663,721.045 143.013,662.855 C 147.289,649.617 136.638,629.847 143.594,616.929 C 151.733,601.231 169.174,604.72 179.639,594.255 C 189.957,583.364 196.498,564.606 215.683,567.513 C 234.867,570.42 247.628,593.974 261.027,622.742 C 270.91,643.38 305.968,672.406 303.677,695.5 C 300.981,731 260.65,737.69 220.915,716.921 z " style="fill:url(#linearGradient1425);stroke:#e68c3f;stroke-width:6.25;" />
<path id="path177" d="M 415.072,495.764 C 412.065,520.67 379.259,572.391 345.554,577.298 C 311.294,582.634 279.122,543.238 271.407,506.184 C 261.518,464.978 293.994,448.584 343.345,449.557 C 396.646,451.211 417.466,463.448 415.072,495.764 z " style="font-size:12px;fill:url(#linearGradient1427);stroke:none;stroke-width:2.85509992;stroke-dasharray:none" transform="matrix(0.598206,0.268584,-0.239623,0.617213,700.568,140.464)" />
<path transform="matrix(-1.1685,0.423145,0.475283,1.16478,728.343,-213.821)" id="path133" d="M 220.274,718.402 C 178.947,694.812 120.38,724.007 143.013,662.855 C 147.749,649.787 136.417,629.303 143.373,616.385 C 151.512,600.687 169.174,604.72 179.639,594.255 C 189.957,583.364 198.466,566.387 217.651,569.294 C 236.835,572.201 247.628,593.974 261.027,622.742 C 270.91,643.38 304.442,671.713 302.151,694.807 C 299.455,730.307 259.427,740.278 220.274,718.402 z " style="fill:url(#linearGradient1429);stroke:#e68c3f;stroke-width:6.25067997;" />
<path transform="matrix(-0.945096,0.343745,0.424076,0.956058,714.328,-64.342)" id="path134" d="M 216.482,675.68 C 129.951,618.177 169.174,604.72 179.639,594.255 C 189.957,583.364 198.466,566.387 217.651,569.294 C 236.835,572.201 247.628,593.974 261.027,622.742 C 270.91,643.38 304.087,671.66 302.151,694.807 C 299.535,721.917 253.961,700.294 216.482,675.68 z " style="fill:url(#linearGradient1431);stroke:none;stroke-width:1.52532005;" />
<path transform="matrix(1.00431,-5.2286e-2,-1.74e-2,1.04575,244.191,-28.4653)" id="path135" d="M 216.506,677.071 C 129.975,619.568 169.709,603.501 182.56,595.791 C 197.959,585.849 197.718,564.96 216.903,567.867 C 236.087,570.774 247.628,593.974 261.027,622.742 C 270.91,643.38 304.087,671.66 302.151,694.807 C 299.535,721.917 253.985,701.685 216.506,677.071 z " style="fill:url(#linearGradient1433);stroke:none;stroke-width:1.52532005;" />
<path id="path136" d="M 415.072,495.764 C 412.065,520.67 379.259,572.391 345.554,577.298 C 311.294,582.634 279.122,543.238 271.407,506.184 C 261.518,464.978 293.994,448.584 343.345,449.557 C 396.646,451.211 417.466,463.448 415.072,495.764 z " style="font-size:12px;fill:#000000;stroke:none;stroke-width:2.85509992;" transform="matrix(0.515584,0.215259,-0.206526,0.49467,713.3,222.559)" />
<path id="path137" d="M 415.072,495.764 C 412.065,520.67 379.259,572.391 345.554,577.298 C 311.294,582.634 279.122,543.238 271.407,506.184 C 261.518,464.978 293.994,448.584 343.345,449.557 C 396.646,451.211 417.466,463.448 415.072,495.764 z " style="font-size:12px;fill:url(#linearGradient1435);stroke:none;stroke-width:2.85509992;" transform="matrix(0.351231,0.149463,-0.128856,0.343469,724.522,318.291)" />
<path transform="matrix(1.25,0,0,1.25,185.454,-167.505)" id="path119" d="M 309.954,338.729 C 317.101,331.959 334.765,311.663 367.915,332.974 C 374.077,336.984 379.077,337.351 390.936,342.429 C 414.662,352.178 403.318,375.688 378.192,383.537 C 367.434,387.026 357.656,400.093 338.063,398.976 C 321.329,397.999 316.944,387.102 306.665,381.07 C 288.396,370.759 285.7,356.816 295.565,349.417 C 305.431,342.018 309.29,339.358 309.954,338.729 z " style="fill:url(#linearGradient1437);stroke:#e68c3f;stroke-width:3.75;" />
<path transform="matrix(1.25,0,0,1.25,185.454,-167.505)" id="path120" d="M 391.251,357.645 C 381.368,358.226 359.858,379.736 337.185,379.736 C 314.512,379.736 301.141,358.807 297.653,358.807" style="fill:none;stroke:#e68c3f;stroke-width:2.5;" />
<path transform="matrix(0.627885,0,0,0.595666,392.366,51.8173)" id="path123" d="M 309.954,338.729 C 317.101,331.959 339.645,313.381 369.542,332.401 C 375.841,336.167 382.346,340.266 392.02,345.865 C 411.182,357.613 401.691,374.543 378.734,385.255 C 368.316,389.75 351.141,399.67 338.063,398.976 C 323.53,397.568 314.128,387.577 304.496,381.07 C 286.826,368.767 287.899,358.833 296.107,350.562 C 302.312,344.883 309.29,339.358 309.954,338.729 z " style="fill:url(#linearGradient1439);stroke:none;" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -5,9 +5,9 @@ import inquirer from "inquirer";
import { $ } from "execa";
export type Answers = {
type: "list" | "number";
demoNumber?: number;
demoFile?: number;
readonly type: "list" | "number";
readonly demoNumber?: number;
readonly demoFile?: number;
};
const dir = "./demo";
@ -15,8 +15,7 @@ const fileNames = fs.readdirSync(dir);
const keys = fileNames.map((f) => path.parse(f).name);
const getFileNumber = (file: string): number => {
const nameParts = file.split("-");
const firstPart = nameParts[0];
const [firstPart] = file.split("-");
return Number(firstPart);
};
@ -35,15 +34,15 @@ const answers = await inquirer.prompt<Answers>([
name: "demoFile",
message: "What demo do you wish to run?",
choices: demoFiles,
filter: (input) => parseInt(input.split("-")[0]),
when: (answers) => answers.type === "list",
filter: (input) => parseInt(input.split("-")[0], 10),
when: (a) => a.type === "list",
},
{
type: "number",
name: "demoNumber",
message: "What demo do you wish to run? (Enter a number)",
default: 1,
when: (answers) => answers.type === "number",
when: (a) => a.type === "number",
},
]);
@ -56,6 +55,7 @@ if (files.length === 0) {
const filePath = path.join(dir, files[0]);
console.log(`Running demo ${demoNumber}: ${files[0]}`);
await $`ts-node --project demo/tsconfig.json ${filePath}`;
const { stdout } = await $`tsx ${filePath}`;
console.log(stdout);
console.log("Successfully created document!");
}

View File

@ -4,7 +4,7 @@
- Simple, declarative API
- 80+ usage examples
- Battle tested, mature, 99.9%+ coverage
- Battle tested, mature, 100% coverage (yes, every line is tested)
[GitHub](https://github.com/dolanmiu/docx)
[Get Started](#Welcome)

View File

@ -22,7 +22,7 @@ const doc = new Document({
}
})
],
}];
}]
});
```

View File

@ -22,19 +22,30 @@ const doc = new docx.Document({
### Full list of options:
- creator
- description
- title
- subject
- keywords
- lastModifiedBy
- revision
- externalStyles
- styles
- numbering
- footnotes
- hyperlinks
- background
| Property | Type | Notes |
| -------------------------- | -------------------------------------------------------- | -------- |
| sections | `ISectionOptions[]` | Optional |
| title | `string` | Optional |
| subject | `string` | Optional |
| creator | `string` | Optional |
| keywords | `string` | Optional |
| description | `string` | Optional |
| lastModifiedBy | `string` | Optional |
| revision | `number` | Optional |
| externalStyles | `string` | Optional |
| styles | `IStylesOptions` | Optional |
| numbering | `INumberingOptions` | Optional |
| comments | `ICommentsOptions` | Optional |
| footnotes | `Record<string, { children: Paragraph[] }>` | Optional |
| background | `IDocumentBackgroundOptions` | Optional |
| features | `{ trackRevisions?: boolean; updateFields?: boolean; }` | Optional |
| compatabilityModeVersion | `number` | Optional |
| compatibility | `ICompatibilityOptions` | Optional |
| customProperties | ` ICustomPropertyOptions`[] | Optional |
| evenAndOddHeaderAndFooters | `boolean` | Optional |
| defaultTabStop | `number` | Optional |
| fonts | ` FontOptions[]` | Optional |
| hyphenation | `IHyphenationOptions` | Optional |
### Change background color of Document

View File

@ -6,6 +6,7 @@ To create a `floating` image on top of text:
```ts
const image = new ImageRun({
type: 'gif',
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
@ -26,6 +27,7 @@ By default with no arguments, its an `inline` image:
```ts
const image = new ImageRun({
type: 'gif',
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
@ -59,6 +61,7 @@ const doc = new Document({
new Paragraph({
children: [
new ImageRun({
type: [IMAGE_TYPE],
data: [IMAGE_BUFFER],
transformation: {
width: [IMAGE_SIZE],
@ -97,6 +100,7 @@ To change the position the image to be on top of the text, simply add the `float
```ts
const image = new ImageRun({
type: 'png',
data: buffer,
transformation: {
width: 903,
@ -115,6 +119,7 @@ const image = new ImageRun({
```ts
const image = new ImageRun({
type: 'png',
data: buffer,
transformation: {
width: 903,
@ -180,6 +185,7 @@ For example:
```ts
const image = new ImageRun({
type: 'gif',
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
@ -228,6 +234,7 @@ For example:
```ts
const image = new ImageRun({
type: 'gif',
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
@ -258,6 +265,7 @@ Specifies common non-visual DrawingML properties. A name, title and description
```ts
const image = new ImageRun({
type: 'gif',
data: fs.readFileSync("./demo/images/pizza.gif"),
altText: {
title: "This is an ultimate title",

View File

@ -263,3 +263,23 @@ new MathAngledBrackets({
],
}),
```
### Limit
#### Limit Upper
```ts
new MathLimitUpper({
children: [new MathRun("x")],
limit: [new MathRun("-")],
}),
```
#### Limit Lower
```ts
new MathLimitLower({
children: [new MathRun("lim")],
limit: [new MathRun("x→0")],
}),
```

View File

@ -1,5 +1,7 @@
# Bullets and Numbering
!> Bullets and Numbering requires an understanding of [Sections](usage/sections.md) and [Paragraphs](usage/paragraph.md).
`docx` is quite flexible in its bullets and numbering system, allowing
the user great freedom in how bullets and numbers are to be styled and
displayed. E.g., numbers can be shown using Arabic numerals, roman
@ -8,112 +10,184 @@ format also supports re-using bullets/numbering styles throughout the
document, so that different lists using the same style need not
redefine them.
Because of this flexibility, bullets and numbering in DOCX involves a
couple of moving pieces:
## Configuration
1. Document-level bullets/numbering definitions (abstract)
2. Document-level bullets/numbering definitions (concrete)
3. Paragraph-level bullets/numbering selection
## Document-level bullets/numbering definitions (abstract)
Every document contains a set of abstract bullets/numbering
definitions which define the formatting and layout of paragraphs using
those bullets/numbering. An abstract numbering system defines how
bullets/numbers are to be shown for lists, including any sublists that
may be used. Thus each abstract definition includes a series of
_levels_ which form a sequence starting at 0 indicating the top-level
list look and increasing from there to describe the sublists, then
sub-sublists, etc. Each level includes the following properties:
* **level**: This is its 0-based index in the definition stack
* **numberFormat**: This indicates how the bullet or number should be
generated. Options include `bullet` (meaning don't count), `decimal`
(arabic numerals), `upperRoman`, `lowerRoman`, `hex`, and many
more.
* **levelText**: This is a format string using the output of the
`numberFormat` function and generating a string to insert before
every item in the list. You may use `%1`, `%2`, ... to reference the
numbers from each numbering level before this one. Thus a level
text of `%d)` with a number format of `lowerLetter` would result in
the sequence "a)", "b)", ...
* and a few others, which you can see in the OOXML spec section 17.9.6
## Document-level bullets/numbering definitions (concrete)
Concrete definitions are sort of like concrete subclasses of the
abstract definitions. They indicate their parent and are allowed to
override certain level definitions. Thus two lists that differ only in
how sub-sub-lists are to be displayed can share the same abstract
numbering definition and have slightly different concrete definitions.
## Paragraph-level bullets/numbering selection
In order to use a bullets/numbering definition (which must be
concrete), paragraphs need to select it, similar to applying a CSS
class to an element, using both the concrete numbering definition ID
and the level number that the paragraph should be at. Additionally, MS
Word and LibreOffice typically apply a "ListParagraph" style to
paragraphs that are being numbered.
## Using bullets/numbering in `docx`
`docx` includes a pre-defined bullet style which you can add to your
paragraphs using `para.bullets()`. If you require different bullet
styles or numbering of any kind, you'll have to use the
`docx.Numbering` class.
First you need to create a new numbering container class and use it to
create your abstract numbering style, define your levels, and create
your concrete numbering style:
Numbering is configured by adding config into `Document`:
```ts
const numbering = new docx.Numbering();
const abstractNum = numbering.createAbstractNumbering();
abstractNum.createLevel(0, "upperRoman", "%1", "start").addParagraphProperty(new Indent(720, 260));
abstractNum.createLevel(1, "decimal", "%2.", "start").addParagraphProperty(new Indent(1440, 980));
abstractNum.createLevel(2, "lowerLetter", "%3)", "start").addParagraphProperty(new Indent(2160, 1700));
const concrete = numbering.createConcreteNumbering(abstractNum);
new Document({
numbering: {
config: [...]
}
})
```
You can then apply your concrete style to paragraphs using the
`setNumbering` method:
Each `config` entry includes the following properties:
. Each level includes the following properties:
| Property | Type | Notes | Possible Values |
| --------- | ----------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| reference | `string` | Required | A unique `string` |
| levels | `ILevelOptions[]` | Required | a series of _levels_ which form a sequence starting at 0 indicating the top-level list look and increasing from there to describe the sublists, then sub-sublists, etc |
### Level Options
Levels define the numbering definition itself, what it looks like, the indention, the alignment and the style. The reason why it is an array is because it allows the ability to create sub-lists. A sub list will have a different configuration because you may want the sub-list to have a different indentation or different bullet.
| Property | Type | Notes | Possible Values |
| --------- | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| level | `number` | Required | The list level this definition is for. `0` is for the root level, `1` is for a sub list, `2` is for a sub-sub-list etc. |
| format | `LevelFormat` | Optional | `DECIMAL`, `UPPER_ROMAN`, `LOWER_ROMAN`, `UPPER_LETTER`, `LOWER_LETTER`, `ORDINAL`, `CARDINAL_TEXT`, `ORDINAL_TEXT`, `HEX`, `CHICAGO`, `IDEOGRAPH__DIGITAL`, `JAPANESE_COUNTING`, `AIUEO`, `IROHA`, `DECIMAL_FULL_WIDTH`, `DECIMAL_HALF_WIDTH`, `JAPANESE_LEGAL`, `JAPANESE_DIGITAL_TEN_THOUSAND`, `DECIMAL_ENCLOSED_CIRCLE`, `DECIMAL_FULL_WIDTH2`, `AIUEO_FULL_WIDTH`, `IROHA_FULL_WIDTH`, `DECIMAL_ZERO`, `BULLET`, `GANADA`, `CHOSUNG`, `DECIMAL_ENCLOSED_FULLSTOP`, `DECIMAL_ENCLOSED_PARENTHESES`, `DECIMAL_ENCLOSED_CIRCLE_CHINESE`, `IDEOGRAPH_ENCLOSED_CIRCLE`, `IDEOGRAPH_TRADITIONAL`, `IDEOGRAPH_ZODIAC`, `IDEOGRAPH_ZODIAC_TRADITIONAL`, `TAIWANESE_COUNTING`, `IDEOGRAPH_LEGAL_TRADITIONAL`, `TAIWANESE_COUNTING_THOUSAND`, `TAIWANESE_DIGITAL`, `CHINESE_COUNTING`, `CHINESE_LEGAL_SIMPLIFIED`, `CHINESE_COUNTING_THOUSAND`, `KOREAN_DIGITAL`, `KOREAN_COUNTING`, `KOREAN_LEGAL`, `KOREAN_DIGITAL2`, `VIETNAMESE_COUNTING`, `RUSSIAN_LOWER`, `RUSSIAN_UPPER`, `NONE`, `NUMBER_IN_DASH`, `HEBREW1`, `HEBREW2`, `ARABIC_ALPHA`, `ARABIC_ABJAD`, `HINDI_VOWELS`, `HINDI_CONSONANTS`, `HINDI_NUMBERS`, `HINDI_COUNTING`, `THAI_LETTERS`, `THAI_NUMBERS`, `THAI_COUNTING`, `BAHT_TEXT`, `DOLLAR_TEXT`, `CUSTOM` |
| text | `string` | Optional | A unique `string` to describe the shape of the bullet |
| alignment | `string` | Required | `START`, `CENTER`, `END`, `BOTH`, `MEDIUM_KASHIDA`, `DISTRIBUTE`, `NUM_TAB`, `HIGH_KASHIDA`, `LOW_KASHIDA`, `THAI_DISTRIBUTE`, `LEFT`, `RIGHT`, `JUSTIFIED` |
| style | `string` | Optional | [Sections](usage/styling-with-js.md) |
## Using ordered lists in `docx`
Add a `numbering` section to the `Document` to numbering style, define your levels. Use `LevelFormat.UPPER_ROMAN` for the `format` in `levels`:
```ts
topLevelP.setNumbering(concrete, 0);
subP.setNumbering(concrete, 1);
subSubP.setNumbering(concrete, 2);
```
## Unindent numbering
Default:1. test
After:1.test
Use default numbering have indent,If you want unindent numbering
How to custom number see the demo:
https://runkit.com/dolanmiu/docx-demo3
```ts
enum LevelSuffix {
NOTHING = "nothing",
SPACE = "space",
TAB = "tab"
}
// custom numbering
const levels=[
{
const doc = new Document({
...
numbering: {
config: [
{
reference: "my-numbering",
levels: [
{
level: 0,
format: "decimal",
text: "%1.",
format: LevelFormat.UPPER_ROMAN,
text: "%1",
alignment: AlignmentType.START,
suffix: LevelSuffix.NOTHING, // Cancel intent
}]
style: {
paragraph: {
indent: { left: 2880, hanging: 2420 },
},
},
},
...
],
},
],
},
...
});
```
And then on a `Paragraph`, we can add use the numbering created:
```ts
new Paragraph({
text: "Hey you!",
numbering: {
reference: "my-numbering",
level: 0,
},
}),
```
## Un-ordered lists / Bullet points
Add a `numbering` section to the `Document` to numbering style, define your levels. Use `LevelFormat.BULLET` for the `format` in `levels`:
```ts
const doc = new Document({
...
numbering: {
config: [
{
reference: "my-bullet-points",
levels: [
{
level: 0,
format: LevelFormat.BULLET,
text: "\u1F60",
alignment: AlignmentType.LEFT,
style: {
paragraph: {
indent: { left: convertInchesToTwip(0.5), hanging: convertInchesToTwip(0.25) },
},
},
},
],
},
],
},
...
});
```
And then on a `Paragraph`, we can add use the numbering created:
```ts
new Paragraph({
text: "Hey you!",
numbering: {
reference: "my-bullet-points",
level: 0,
},
}),
```
## Disabling numbering inherited from paragraph style
If the numbering is set on a paragraph style, you may wish to disable it for a specific paragraph:
```ts
const doc = new Document({
...
numbering: {
config: [
{
reference: "my-bullet-points",
levels: [
{
level: 0,
format: LevelFormat.BULLET,
text: "\u1F60",
alignment: AlignmentType.LEFT,
style: {
paragraph: {
indent: { left: convertInchesToTwip(0.5), hanging: convertInchesToTwip(0.25) },
},
},
},
],
},
],
},
styles: {
paragraphStyles: [
{
id: 'bullet',
name: 'Bullet',
basedOn: 'Normal',
next: 'Normal',
run: {},
paragraph: {
numbering: {
reference: 'my-bullet-points',
level: 0,
},
},
},
],
},
...
});
```
```ts
new Paragraph({
text: "No bullet points!",
style: "Bullet",
numbering: false,
}),
```
## Full Example
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/3-numbering-and-bullet-points.ts ":include")
_Source: https://github.com/dolanmiu/docx/blob/master/demo/3-numbering-and-bullet-points.ts_

View File

@ -2,7 +2,7 @@
> Packers are the way in which `docx` turns your code into `.docx` format. It is completely decoupled from the `docx.Document`.
Packers works in both a node and browser environment (Angular etc). Now, the packer returns a `Buffer`, `Blob` or `base64 string`. It is up to you to take that and persist it with node's `fs`, send it down as a downloadable file, or anything else you wish. As of `version 4+`, this library will not have options to export to PDF.
Packers works in both a node and browser environment (Angular etc). Now, the packer returns a `Buffer`, `Blob`, `string`, `base64 string`, `ArrayBuffer`, or `Stream`. It is up to you to take that and persist it with node's `fs`, send it down as a downloadable file, or anything else you wish. As of `version 4+`, this library will not have options to export to PDF.
### Export as Buffer
@ -14,6 +14,14 @@ Packer.toBuffer(doc).then((buffer) => {
});
```
### Export as string
```ts
Packer.toString(doc).then((string) => {
console.log(string);
});
```
### Export as a `base64` string
```ts
@ -32,3 +40,46 @@ Packer.toBlob(doc).then((blob) => {
saveAs(blob, "example.docx");
});
```
### Export as ArrayBuffer
This may be useful when working in a Node.js worker.
```ts
Packer.toArrayBuffer(doc).then((arrayBuffer) => {
port.postMessage(arrayBuffer, [arrayBuffer]);
});
```
### Export as a Stream
```ts
Packer.toStream(doc).then((stream) => {
// read from stream
});
```
### Export using optional arguments
The `Packer` methods support 2 optional arguments.
The first is for controlling the indentation of the xml and should be a `boolean` or `keyof typeof PrettifyType`.
The second is an array of subfile overrides (`{path: string, data: string}[]`). These overrides can be used to write additional subfiles to the result or even override default subfiles in the case that the default handling of these subfiles does not meet your needs.
```ts
const overrides = [{ path: "word/commentsExtended.xml", data: "string_data" }];
Packer.toString(doc, true, overrides).then((string) => {
console.log(string);
});
```
### Export to arbitrary formats
You can also use the lower-level `Packer.pack` method to export to any specified type.
```ts
Packer.pack(doc, 'string').then((string) => {
console.log(string);
});
```

View File

@ -35,6 +35,9 @@ interface Patch {
| type | `PatchType` | Required | `DOCUMENT`, `PARAGRAPH` |
| children | `FileChild[] or ParagraphChild[]` | Required | The contents to replace with. A `FileChild` is a `Paragraph` or `Table`, whereas a `ParagraphChild` is typical `Paragraph` children. |
The patcher also takes in a `keepOriginalStyles` boolean, which will preserve the styles of the patched text when set to true.
### How to patch existing document
1. Open your existing word document in your favorite Word Processor
@ -76,7 +79,7 @@ patchDocument(fs.readFileSync("My Document.docx"), {
],
link: "https://www.google.co.uk",
}),
new ImageRun({ data: fs.readFileSync("./demo/images/dog.png"), transformation: { width: 100, height: 100 } }),
new ImageRun({ type: 'png', data: fs.readFileSync("./demo/images/dog.png"), transformation: { width: 100, height: 100 } }),
],
}),
],

View File

@ -126,10 +126,10 @@ const doc = new Document({
next: "Normal",
quickFormat: true,
run: {
size: 26
size: 26,
bold: true,
color: "999999",
{
underline: {
type: UnderlineType.DOUBLE,
color: "FF0000",
},

View File

@ -9,11 +9,16 @@
![image](https://user-images.githubusercontent.com/2917613/41195113-65edebfa-6c1f-11e8-97b4-77de2d60044a.png)
![image](https://user-images.githubusercontent.com/2917613/41195126-ca99c36c-6c1f-11e8-9e58-19e5f69b3b87.png)
*Note*: Font and color selection from the theme are currently not supported.
3. You can even create a totally new `Style`:
![image](https://user-images.githubusercontent.com/2917613/41195135-f0f7862a-6c1f-11e8-8be4-dd6d8fe5be03.png)
![image](https://user-images.githubusercontent.com/2917613/41195139-0ec52130-6c20-11e8-8fae-f6b44b43fdf8.png)
*Note*: When selecting the style type, it is important to consider the component being used.
4. Save
5. Re-name the saved `.docx` file to `.zip` and un-zip
6. Find `styles.xml`

View File

@ -22,7 +22,7 @@ Then add the table in the `section`
const doc = new Document({
sections: [{
children: [table],
}];
}],
});
```

26
docs/usage/text-box.md Normal file
View File

@ -0,0 +1,26 @@
# Text Box
Similar `Text Frames`, but the difference being that it is `VML` `Shape` based.
!> `Text Boxes` requires an understanding of [Paragraphs](usage/paragraph.md).
> `Text boxes` are paragraphs of text in a document which are positioned in a separate region or frame in the document, and can be positioned with a specific size and position relative to non-frame paragraphs in the current document.
## Intro
To make a `Text Box`, simply create a `Textbox` object inside the `Document`:
```ts
new Textbox({
alignment: "center",
children: [
new Paragraph({
children: [new TextRun("Hi i'm a textbox!")],
}),
],
style: {
width: "200pt",
height: "auto",
},
});
```

View File

@ -1,6 +1,6 @@
# Text Frames
Also known as `Text Boxes`
> Similar to `Text Boxes`!
!> Text Frames requires an understanding of [Paragraphs](usage/paragraph.md).

370
eslint.config.ts Normal file
View File

@ -0,0 +1,370 @@
import eslint from "@eslint/js";
import type { Linter } from "eslint";
import importPlugin from "eslint-plugin-import";
import unicorn from "eslint-plugin-unicorn";
import jsdoc from "eslint-plugin-jsdoc";
import preferArrow from "eslint-plugin-prefer-arrow";
import functional from "eslint-plugin-functional";
import globals from "globals";
import tsEslint from "typescript-eslint";
const config: Linter.Config<Linter.RulesRecord>[] = [
{
ignores: ["**/vite.config.ts", "**/dist/**", "**/coverage/**", "**/*.js", "eslint.config.ts", "**/demo/**", "**/scripts/**"],
},
eslint.configs.recommended,
importPlugin.flatConfigs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,
{
files: ["**/src/**/*.ts"],
plugins: {
unicorn,
jsdoc,
"prefer-arrow": preferArrow,
functional,
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
"import/resolver": {
typescript: true,
node: true,
},
},
rules: {
"no-undef": "off",
"no-extra-boolean-cast": "off",
"no-alert": "error",
"no-self-compare": "error",
"no-unreachable-loop": "error",
"no-template-curly-in-string": "error",
"no-unused-private-class-members": "error",
"no-extend-native": "error",
"no-floating-decimal": "error",
"no-implied-eval": "error",
"no-iterator": "error",
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-new-object": "error",
"no-proto": "error",
"no-useless-catch": "error",
"one-var-declaration-per-line": "error",
"prefer-arrow-callback": "error",
"prefer-destructuring": "error",
"prefer-exponentiation-operator": "error",
"prefer-promise-reject-errors": "error",
"prefer-regex-literals": "error",
"prefer-spread": "error",
"prefer-template": "error",
"require-await": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": [
"error",
{
default: "array",
},
],
"@typescript-eslint/no-restricted-types": [
"error",
{
types: {
Object: {
message: "Avoid using the `Object` type. Did you mean `object`?",
fixWith: "object",
},
Function: {
message: "Avoid using the `Function` type. Prefer a specific function type, like `() => void`.",
},
Boolean: {
message: "Avoid using the `Boolean` type. Did you mean `boolean`?",
fixWith: "boolean",
},
Number: {
message: "Avoid using the `Number` type. Did you mean `number`?",
fixWith: "number",
},
String: {
message: "Avoid using the `String` type. Did you mean `string`?",
fixWith: "string",
},
Symbol: {
message: "Avoid using the `Symbol` type. Did you mean `symbol`?",
fixWith: "symbol",
},
},
},
],
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: false,
allowDirectConstAssertionInArrowFunctions: true,
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
},
],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: "explicit",
overrides: {
accessors: "explicit",
},
},
],
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{
allowArgumentsExplicitlyTypedAsAny: true,
allowDirectConstAssertionInArrowFunctions: true,
allowHigherOrderFunctions: false,
allowTypedFunctionExpressions: false,
},
],
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["objectLiteralProperty"],
leadingUnderscore: "allow",
format: ["camelCase", "PascalCase", "UPPER_CASE"],
filter: {
regex: "(^[a-z]+:.+)|_attr|[0-9]",
match: false,
},
},
],
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-shadow": [
"error",
{
hoist: "all",
},
],
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/triple-slash-reference": [
"error",
{
path: "always",
types: "prefer-import",
lib: "always",
},
],
"@typescript-eslint/typedef": [
"error",
{
parameter: true,
propertyDeclaration: true,
},
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
complexity: "off",
"consistent-return": "error",
"constructor-super": "error",
curly: "error",
"dot-notation": "off",
eqeqeq: ["error", "smart"],
"guard-for-in": "error",
"id-denylist": ["error", "any", "Number", "number", "String", "string", "Boolean", "boolean", "Undefined", "undefined"],
"id-match": "error",
"import/no-default-export": "error",
"import/no-extraneous-dependencies": "off",
"import/no-internal-modules": "off",
"sort-imports": [
"error",
{
allowSeparatedGroups: true,
ignoreDeclarationSort: true,
},
],
"import/order": [
"error",
{
groups: [["external", "builtin"], "internal", ["sibling", "parent", "index"]],
"newlines-between": "always",
pathGroups: [
{ pattern: "@file/**/*", group: "internal" },
{ pattern: "@file/**", group: "internal" },
{ pattern: "@export/**", group: "internal" },
],
pathGroupsExcludedImportTypes: ["internal"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
indent: "off",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "off",
"max-classes-per-file": "off",
"max-len": "off",
"new-parens": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "error",
"no-debugger": "error",
"no-duplicate-case": "error",
"no-duplicate-imports": "error",
"no-empty": "error",
"no-empty-function": "off",
"no-eval": "error",
"no-extra-bind": "error",
"no-fallthrough": "off",
"no-invalid-this": "off",
"no-multiple-empty-lines": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-param-reassign": "error",
"no-redeclare": "error",
"no-return-await": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-sparse-arrays": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": [
"error",
{
allow: ["_attr"],
},
],
"no-unsafe-finally": "error",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-use-before-define": "off",
"no-useless-constructor": "error",
"no-var": "error",
"object-shorthand": "off",
"one-var": ["error", "never"],
"prefer-arrow/prefer-arrow-functions": "error",
"prefer-const": "error",
"prefer-object-spread": "error",
radix: "error",
"space-in-parens": ["error", "never"],
"spaced-comment": [
"error",
"always",
{
markers: ["/"],
},
],
"unicorn/filename-case": "error",
"unicorn/prefer-ternary": "error",
"use-isnan": "error",
"valid-typeof": "off",
"functional/immutable-data": [
"error",
{
ignoreImmediateMutation: true,
ignoreAccessorPattern: ["**.root*", "**.numberingReferences*", "**.sections*", "**.properties*"],
},
],
"functional/prefer-property-signatures": "error",
"functional/no-mixed-types": "error",
"functional/prefer-readonly-type": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^[_]+$",
},
],
},
},
{
files: ["**/*.spec.ts"],
plugins: {
unicorn,
jsdoc,
"prefer-arrow": preferArrow,
functional,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
sourceType: "module",
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
project: ["tsconfig.json"],
},
},
rules: {
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/dot-notation": "off",
"prefer-destructuring": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^[_]+$",
},
],
},
},
];
export default config;

17238
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +1,44 @@
{
"name": "docx",
"version": "8.1.0",
"version": "9.2.0",
"description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",
"type": "module",
"main": "build/index.umd.cjs",
"module": "./build/index.js",
"types": "./build/index.d.ts",
"main": "dist/index.umd.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"browser": {
"default": "./build/index.umd.cjs"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"require": "./build/index.cjs",
"types": "./build/index.d.ts",
"import": "./build/index.js",
"default": "./build/index.js"
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"files": [
"build"
"dist"
],
"scripts": {
"build": "tsc && vite build",
"test": "vitest --ui --coverage",
"test.ci": "vitest run --coverage",
"test:ci": "vitest run --coverage",
"prepublishOnly": "npm run build --omit=dev",
"lint": "eslint --ext .ts src",
"lint": "eslint --flag unstable_ts_config --config eslint.config.ts",
"predemo": "npm run build",
"demo": "ts-node --project demo/tsconfig.json ./demo/index.ts",
"demo": "tsx ./demo/index.ts",
"typedoc": "typedoc src/index.ts --tsconfig tsconfig.typedoc.json",
"style": "prettier -l \"{src,scripts,demo}/**/*.{ts,html}\"",
"style.fix": "npm run style -- --write",
"prettier": "prettier -l \"{src,scripts,demo}/**/*.{ts,html}\"",
"prettier:fix": "npm run prettier -- --write",
"cspell": "cspell \"{src,demo,docs,scripts}/**/*.{ts,scss,html,md}\" && cspell \"./*.*\"",
"serve.docs": "cd docs && docsify serve",
"extract": "ts-node scripts/extract-document.ts",
"ts-node": "ts-node --project demo/tsconfig.json"
"extract": "tsx scripts/extract-document.ts",
"run-ts": "tsx"
},
"pre-commit": [
"style",
"prettier",
"lint"
],
"repository": {
@ -57,10 +58,10 @@
"clippy"
],
"dependencies": {
"@types/node": "^20.3.1",
"fflate": "^0.8.0",
"@types/node": "^22.7.5",
"hash.js": "^1.1.7",
"jszip": "^3.10.1",
"nanoid": "^4.0.2",
"nanoid": "^5.1.3",
"xml": "^1.0.1",
"xml-js": "^1.6.8"
},
@ -71,40 +72,43 @@
},
"homepage": "https://docx.js.org",
"devDependencies": {
"@esbuild/win32-x64": "^0.18.3",
"@types/eslint__js": "^8.42.3",
"@types/inquirer": "^9.0.3",
"@types/prompt": "^1.1.1",
"@types/unzipper": "^0.10.4",
"@types/xml": "^1.0.8",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"@vitest/coverage-v8": "^0.32.0",
"@vitest/ui": "^0.32.0",
"cspell": "^6.2.2",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"@vitest/coverage-v8": "^3.0.8",
"@vitest/ui": "^3.0.8",
"cspell": "^8.2.3",
"docsify-cli": "^4.3.0",
"eslint": "^8.23.0",
"eslint-plugin-functional": "^5.0.8",
"eslint": "^9.13.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-functional": "^7.0.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^46.2.6",
"eslint-plugin-jsdoc": "^50.3.1",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-unicorn": "^47.0.0",
"execa": "^7.1.1",
"glob": "^10.2.7",
"inquirer": "^9.2.7",
"jsdom": "^22.1.0",
"eslint-plugin-unicorn": "^56.0.0",
"execa": "^9.4.0",
"glob": "^11.0.0",
"inquirer": "^12.0.0",
"jiti": "^2.3.3",
"jsdom": "^26.0.0",
"pre-commit": "^1.2.2",
"prettier": "^2.3.1",
"ts-node": "^10.2.1",
"prettier": "^3.1.1",
"tsconfig-paths": "^4.0.0",
"typedoc": "^0.24.8",
"typescript": "5.1.3",
"unzipper": "^0.10.11",
"vite": "^4.3.2",
"vite-plugin-dts": "^2.3.0",
"vite-plugin-node-polyfills": "^0.9.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^0.32.0"
"tsx": "^4.7.0",
"typedoc": "^0.27.3",
"typescript": "5.3.3",
"typescript-eslint": "^8.10.0",
"unzipper": "^0.12.3",
"vite": "^6.0.1",
"vite-plugin-dts": "^4.2.4",
"vite-plugin-node-polyfills": "^0.23.0",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^3.0.8"
},
"engines": {
"node": ">=10"

View File

@ -1,7 +1,6 @@
import { BaseXmlComponent, IContext, IXmlableObject } from "@file/xml-components";
export class Formatter {
// tslint:disable-next-line: no-object-literal-type-assertion
public format(input: BaseXmlComponent, context: IContext = { stack: [] } as unknown as IContext): IXmlableObject {
const output = input.prepForXml(context);

View File

@ -12,7 +12,8 @@ describe("ImageReplacer", () => {
"test {test-image.png} test",
[
{
stream: Buffer.from(""),
type: "png",
data: Buffer.from(""),
fileName: "test-image.png",
transformation: {
pixels: {

View File

@ -36,7 +36,7 @@ describe("Compiler", () => {
const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name);
expect(fileNames).is.an.instanceof(Array);
expect(fileNames).has.length(17);
expect(fileNames).has.length(19);
expect(fileNames).to.include("word/document.xml");
expect(fileNames).to.include("word/styles.xml");
expect(fileNames).to.include("docProps/core.xml");
@ -47,7 +47,9 @@ describe("Compiler", () => {
expect(fileNames).to.include("word/_rels/footnotes.xml.rels");
expect(fileNames).to.include("word/settings.xml");
expect(fileNames).to.include("word/comments.xml");
expect(fileNames).to.include("word/fontTable.xml");
expect(fileNames).to.include("word/_rels/document.xml.rels");
expect(fileNames).to.include("word/_rels/fontTable.xml.rels");
expect(fileNames).to.include("[Content_Types].xml");
expect(fileNames).to.include("_rels/.rels");
},
@ -94,7 +96,7 @@ describe("Compiler", () => {
const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name);
expect(fileNames).is.an.instanceof(Array);
expect(fileNames).has.length(25);
expect(fileNames).has.length(27);
expect(fileNames).to.include("word/header1.xml");
expect(fileNames).to.include("word/_rels/header1.xml.rels");
@ -110,6 +112,41 @@ describe("Compiler", () => {
},
);
it(
"should pack subfile overrides",
async () => {
const file = new File({
sections: [],
comments: {
children: [],
},
});
const subfileData1 = "comments";
const subfileData2 = "commentsExtended";
const overrides = [
{ path: "word/comments.xml", data: subfileData1 },
{ path: "word/commentsExtended.xml", data: subfileData2 },
];
const zipFile = compiler.compile(file, "", overrides);
const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name);
expect(fileNames).is.an.instanceof(Array);
expect(fileNames).has.length(20);
expect(fileNames).to.include("word/comments.xml");
expect(fileNames).to.include("word/commentsExtended.xml");
const commentsText = await zipFile.file("word/comments.xml")?.async("text");
const commentsExtendedText = await zipFile.file("word/commentsExtended.xml")?.async("text");
expect(commentsText).toBe(subfileData1);
expect(commentsExtendedText).toBe(subfileData2);
},
{
timeout: 99999999,
},
);
it("should call the format method X times equalling X files to be formatted", () => {
// This test is required because before, there was a case where Document was formatted twice, which was inefficient
// This also caused issues such as running prepForXml multiple times as format() was ran multiple times.
@ -123,16 +160,13 @@ describe("Compiler", () => {
],
});
// tslint:disable-next-line: no-string-literal
const spy = vi.spyOn(compiler["formatter"], "format");
compiler.compile(file);
expect(spy).toBeCalledTimes(13);
expect(spy).toBeCalledTimes(15);
});
it("should work with media datas", () => {
// This test is required because before, there was a case where Document was formatted twice, which was inefficient
// This also caused issues such as running prepForXml multiple times as format() was ran multiple times.
const file = new File({
sections: [
{
@ -150,12 +184,25 @@ describe("Compiler", () => {
new Paragraph({
children: [
new ImageRun({
type: "png",
data: Buffer.from("", "base64"),
transformation: {
width: 100,
height: 100,
},
}),
new ImageRun({
type: "svg",
data: Buffer.from("", "base64"),
transformation: {
width: 100,
height: 100,
},
fallback: {
type: "png",
data: Buffer.from("", "base64"),
},
}),
],
}),
],
@ -165,7 +212,8 @@ describe("Compiler", () => {
vi.spyOn(compiler["imageReplacer"], "getMediaData").mockReturnValue([
{
stream: Buffer.from(""),
type: "png",
data: Buffer.from(""),
fileName: "test",
transformation: {
pixels: {
@ -178,9 +226,48 @@ describe("Compiler", () => {
},
},
},
{
type: "svg",
data: Buffer.from(""),
fileName: "test",
transformation: {
pixels: {
x: 100,
y: 100,
},
emus: {
x: 100,
y: 100,
},
},
fallback: {
type: "png",
data: Buffer.from(""),
fileName: "test",
transformation: {
pixels: {
x: 100,
y: 100,
},
emus: {
x: 100,
y: 100,
},
},
},
},
]);
compiler.compile(file);
});
it("should work with fonts", () => {
const file = new File({
sections: [],
fonts: [{ name: "Pacifico", data: Buffer.from("") }],
});
compiler.compile(file);
});
});
});

View File

@ -2,18 +2,19 @@ import JSZip from "jszip";
import xml from "xml";
import { File } from "@file/file";
import { obfuscate } from "@file/fonts/obfuscate-ttf-to-odttf";
import { Formatter } from "../formatter";
import { ImageReplacer } from "./image-replacer";
import { NumberingReplacer } from "./numbering-replacer";
import { PrettifyType } from "./packer";
interface IXmlifyedFile {
export type IXmlifyedFile = {
readonly data: string;
readonly path: string;
}
};
interface IXmlifyedFileMapping {
type IXmlifyedFileMapping = {
readonly Document: IXmlifyedFile;
readonly Styles: IXmlifyedFile;
readonly Properties: IXmlifyedFile;
@ -31,7 +32,9 @@ interface IXmlifyedFileMapping {
readonly FootNotesRelationships: IXmlifyedFile;
readonly Settings: IXmlifyedFile;
readonly Comments?: IXmlifyedFile;
}
readonly FontTable?: IXmlifyedFile;
readonly FontTableRelationships?: IXmlifyedFile;
};
export class Compiler {
private readonly formatter: Formatter;
@ -44,7 +47,11 @@ export class Compiler {
this.numberingReplacer = new NumberingReplacer();
}
public compile(file: File, prettifyXml?: PrettifyType): JSZip {
public compile(
file: File,
prettifyXml?: (typeof PrettifyType)[keyof typeof PrettifyType],
overrides: readonly IXmlifyedFile[] = [],
): JSZip {
const zip = new JSZip();
const xmlifiedFileMapping = this.xmlifyFile(file, prettifyXml);
const map = new Map<string, IXmlifyedFile | readonly IXmlifyedFile[]>(Object.entries(xmlifiedFileMapping));
@ -59,14 +66,28 @@ export class Compiler {
}
}
for (const { stream, fileName } of file.Media.Array) {
zip.file(`word/media/${fileName}`, stream);
for (const subFile of overrides) {
zip.file(subFile.path, subFile.data);
}
for (const data of file.Media.Array) {
if (data.type !== "svg") {
zip.file(`word/media/${data.fileName}`, data.data);
} else {
zip.file(`word/media/${data.fileName}`, data.data);
zip.file(`word/media/${data.fallback.fileName}`, data.fallback.data);
}
}
for (const { data: buffer, name, fontKey } of file.FontTable.fontOptionsWithKey) {
const [nameWithoutExtension] = name.split(".");
zip.file(`word/fonts/${nameWithoutExtension}.odttf`, obfuscate(buffer, fontKey));
}
return zip;
}
private xmlifyFile(file: File, prettify?: PrettifyType): IXmlifyedFileMapping {
private xmlifyFile(file: File, prettify?: (typeof PrettifyType)[keyof typeof PrettifyType]): IXmlifyedFileMapping {
const documentRelationshipCount = file.Document.Relationships.RelationshipCount + 1;
const documentXmlData = xml(
@ -96,6 +117,12 @@ export class Compiler {
);
});
file.Document.Relationships.createRelationship(
file.Document.Relationships.RelationshipCount + 1,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",
"fontTable.xml",
);
return xml(
this.formatter.format(file.Document.Relationships, {
viewWrapper: file.Document,
@ -439,6 +466,40 @@ export class Compiler {
),
path: "word/comments.xml",
},
FontTable: {
data: xml(
this.formatter.format(file.FontTable.View, {
viewWrapper: file.Document,
file,
stack: [],
}),
{
indent: prettify,
declaration: {
standalone: "yes",
encoding: "UTF-8",
},
},
),
path: "word/fontTable.xml",
},
FontTableRelationships: {
data: (() =>
xml(
this.formatter.format(file.FontTable.Relationships, {
viewWrapper: file.Document,
file,
stack: [],
}),
{
indent: prettify,
declaration: {
encoding: "UTF-8",
},
},
))(),
path: "word/_rels/fontTable.xml.rels",
},
};
}
}

View File

@ -46,7 +46,7 @@ describe("Packer", () => {
await Packer.toString(file, true);
expect(spy).toBeCalledWith(expect.anything(), PrettifyType.WITH_2_BLANKS);
expect(spy).toBeCalledWith(expect.anything(), PrettifyType.WITH_2_BLANKS, expect.anything());
});
it("should use a prettify value", async () => {
@ -55,7 +55,7 @@ describe("Packer", () => {
await Packer.toString(file, PrettifyType.WITH_4_BLANKS);
expect(spy).toBeCalledWith(expect.anything(), PrettifyType.WITH_4_BLANKS);
expect(spy).toBeCalledWith(expect.anything(), PrettifyType.WITH_4_BLANKS, expect.anything());
});
it("should use an undefined prettify value", async () => {
@ -64,7 +64,32 @@ describe("Packer", () => {
await Packer.toString(file, false);
expect(spy).toBeCalledWith(expect.anything(), undefined);
expect(spy).toBeCalledWith(expect.anything(), undefined, expect.anything());
});
});
describe("overrides", () => {
afterEach(() => {
vi.restoreAllMocks();
});
it("should use an overrides value", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const spy = vi.spyOn((Packer as any).compiler, "compile");
const overrides = [{ path: "word/comments.xml", data: "comments" }];
await Packer.toString(file, true, overrides);
expect(spy).toBeCalledWith(expect.anything(), expect.anything(), overrides);
});
it("should use a default overrides value", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const spy = vi.spyOn((Packer as any).compiler, "compile");
await Packer.toString(file);
expect(spy).toBeCalledWith(expect.anything(), undefined, []);
});
});
@ -139,7 +164,6 @@ describe("Packer", () => {
it("should create a standard docx file", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vi.spyOn((Packer as any).compiler, "compile").mockReturnValue({
// tslint:disable-next-line: no-empty
generateAsync: () => vi.fn(),
});
const str = await Packer.toBlob(file);
@ -163,11 +187,37 @@ describe("Packer", () => {
});
});
describe("#toArrayBuffer()", () => {
it("should create a standard docx file", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vi.spyOn((Packer as any).compiler, "compile").mockReturnValue({
generateAsync: () => vi.fn(),
});
const str = await Packer.toArrayBuffer(file);
assert.isDefined(str);
});
it("should handle exception if it throws any", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vi.spyOn((Packer as any).compiler, "compile").mockImplementation(() => {
throw new Error();
});
return Packer.toArrayBuffer(file).catch((error) => {
assert.isDefined(error);
});
});
afterEach(() => {
vi.resetAllMocks();
});
});
describe("#toStream()", () => {
it("should create a standard docx file", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
vi.spyOn((Packer as any).compiler, "compile").mockReturnValue({
// tslint:disable-next-line: no-empty
generateAsync: () => Promise.resolve(vi.fn()),
});
const stream = Packer.toStream(file);

View File

@ -1,69 +1,89 @@
import { Stream } from "stream";
import { File } from "@file/file";
import { Compiler } from "./next-compiler";
import { File } from "@file/file";
import { OutputByType, OutputType } from "@util/output-type";
import { Compiler, IXmlifyedFile } from "./next-compiler";
/**
* Use blanks to prettify
*/
export enum PrettifyType {
NONE = "",
WITH_2_BLANKS = " ",
WITH_4_BLANKS = " ",
WITH_TAB = "\t",
}
export const PrettifyType = {
NONE: "",
WITH_2_BLANKS: " ",
WITH_4_BLANKS: " ",
const convertPrettifyType = (prettify?: boolean | PrettifyType): PrettifyType | undefined =>
WITH_TAB: "\t",
} as const;
const convertPrettifyType = (
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
): (typeof PrettifyType)[keyof typeof PrettifyType] | undefined =>
prettify === true ? PrettifyType.WITH_2_BLANKS : prettify === false ? undefined : prettify;
export class Packer {
public static async toString(file: File, prettify?: boolean | PrettifyType): Promise<string> {
const zip = this.compiler.compile(file, convertPrettifyType(prettify));
const zipData = await zip.generateAsync({
type: "string",
// eslint-disable-next-line require-await
public static async pack<T extends OutputType>(
file: File,
type: T,
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
overrides: readonly IXmlifyedFile[] = [],
): Promise<OutputByType[T]> {
const zip = this.compiler.compile(file, convertPrettifyType(prettify), overrides);
return zip.generateAsync({
type,
mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
compression: "DEFLATE",
});
return zipData;
}
public static async toBuffer(file: File, prettify?: boolean | PrettifyType): Promise<Buffer> {
const zip = this.compiler.compile(file, convertPrettifyType(prettify));
const zipData = await zip.generateAsync({
type: "nodebuffer",
mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
compression: "DEFLATE",
});
return zipData;
public static toString(
file: File,
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
overrides: readonly IXmlifyedFile[] = [],
): Promise<string> {
return Packer.pack(file, "string", prettify, overrides);
}
public static async toBase64String(file: File, prettify?: boolean | PrettifyType): Promise<string> {
const zip = this.compiler.compile(file, convertPrettifyType(prettify));
const zipData = await zip.generateAsync({
type: "base64",
mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
compression: "DEFLATE",
});
return zipData;
public static toBuffer(
file: File,
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
overrides: readonly IXmlifyedFile[] = [],
): Promise<Buffer> {
return Packer.pack(file, "nodebuffer", prettify, overrides);
}
public static async toBlob(file: File, prettify?: boolean | PrettifyType): Promise<Blob> {
const zip = this.compiler.compile(file, convertPrettifyType(prettify));
const zipData = await zip.generateAsync({
type: "blob",
mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
compression: "DEFLATE",
});
return zipData;
public static toBase64String(
file: File,
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
overrides: readonly IXmlifyedFile[] = [],
): Promise<string> {
return Packer.pack(file, "base64", prettify, overrides);
}
public static toStream(file: File, prettify?: boolean | PrettifyType): Stream {
public static toBlob(
file: File,
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
overrides: readonly IXmlifyedFile[] = [],
): Promise<Blob> {
return Packer.pack(file, "blob", prettify, overrides);
}
public static toArrayBuffer(
file: File,
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
overrides: readonly IXmlifyedFile[] = [],
): Promise<ArrayBuffer> {
return Packer.pack(file, "arraybuffer", prettify, overrides);
}
public static toStream(
file: File,
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
overrides: readonly IXmlifyedFile[] = [],
): Stream {
const stream = new Stream();
const zip = this.compiler.compile(file, convertPrettifyType(prettify));
const zip = this.compiler.compile(file, convertPrettifyType(prettify), overrides);
zip.generateAsync({
type: "nodebuffer",

View File

@ -1,4 +1,5 @@
import { XmlComponent } from "@file/xml-components";
import { AppPropertiesAttributes } from "./app-properties-attributes";
export class AppProperties extends XmlComponent {

View File

@ -22,15 +22,15 @@
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
import { eighthPointMeasureValue, hexColorValue, pointMeasureValue } from "@util/values";
export interface IBorderOptions {
readonly style: BorderStyle;
export type IBorderOptions = {
readonly style: (typeof BorderStyle)[keyof typeof BorderStyle];
/** Border color, in hex (eg 'FF00AA') */
readonly color?: string;
/** Size of the border in 1/8 pt */
readonly size?: number;
/** Spacing offset. Values are specified in pt */
readonly space?: number;
}
};
export class BorderElement extends XmlComponent {
public constructor(elementName: string, { color, size, space, style }: IBorderOptions) {
@ -55,32 +55,32 @@ class BordersAttributes extends XmlAttributeComponent<IBorderOptions> {
};
}
export enum BorderStyle {
SINGLE = "single",
DASH_DOT_STROKED = "dashDotStroked",
DASHED = "dashed",
DASH_SMALL_GAP = "dashSmallGap",
DOT_DASH = "dotDash",
DOT_DOT_DASH = "dotDotDash",
DOTTED = "dotted",
DOUBLE = "double",
DOUBLE_WAVE = "doubleWave",
INSET = "inset",
NIL = "nil",
NONE = "none",
OUTSET = "outset",
THICK = "thick",
THICK_THIN_LARGE_GAP = "thickThinLargeGap",
THICK_THIN_MEDIUM_GAP = "thickThinMediumGap",
THICK_THIN_SMALL_GAP = "thickThinSmallGap",
THIN_THICK_LARGE_GAP = "thinThickLargeGap",
THIN_THICK_MEDIUM_GAP = "thinThickMediumGap",
THIN_THICK_SMALL_GAP = "thinThickSmallGap",
THIN_THICK_THIN_LARGE_GAP = "thinThickThinLargeGap",
THIN_THICK_THIN_MEDIUM_GAP = "thinThickThinMediumGap",
THIN_THICK_THIN_SMALL_GAP = "thinThickThinSmallGap",
THREE_D_EMBOSS = "threeDEmboss",
THREE_D_ENGRAVE = "threeDEngrave",
TRIPLE = "triple",
WAVE = "wave",
}
export const BorderStyle = {
SINGLE: "single",
DASH_DOT_STROKED: "dashDotStroked",
DASHED: "dashed",
DASH_SMALL_GAP: "dashSmallGap",
DOT_DASH: "dotDash",
DOT_DOT_DASH: "dotDotDash",
DOTTED: "dotted",
DOUBLE: "double",
DOUBLE_WAVE: "doubleWave",
INSET: "inset",
NIL: "nil",
NONE: "none",
OUTSET: "outset",
THICK: "thick",
THICK_THIN_LARGE_GAP: "thickThinLargeGap",
THICK_THIN_MEDIUM_GAP: "thickThinMediumGap",
THICK_THIN_SMALL_GAP: "thickThinSmallGap",
THIN_THICK_LARGE_GAP: "thinThickLargeGap",
THIN_THICK_MEDIUM_GAP: "thinThickMediumGap",
THIN_THICK_SMALL_GAP: "thinThickSmallGap",
THIN_THICK_THIN_LARGE_GAP: "thinThickThinLargeGap",
THIN_THICK_THIN_MEDIUM_GAP: "thinThickThinMediumGap",
THIN_THICK_THIN_SMALL_GAP: "thinThickThinSmallGap",
THREE_D_EMBOSS: "threeDEmboss",
THREE_D_ENGRAVE: "threeDEngrave",
TRIPLE: "triple",
WAVE: "wave",
} as const;

View File

@ -0,0 +1,29 @@
// This represents element type CT_SdtCheckboxSymbol element
// <xsd:complexType name="CT_SdtCheckboxSymbol">
// <xsd:attribute name="font" type="w:ST_String"/>
// <xsd:attribute name="val" type="w:ST_ShortHexNumber"/>
// </xsd:complexType>
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
import { shortHexNumber } from "@util/values";
class CheckboxSymbolAttributes extends XmlAttributeComponent<{
readonly val?: string | number | boolean;
readonly symbolfont?: string;
}> {
protected readonly xmlKeys = {
val: "w14:val",
symbolfont: "w14:font",
};
}
export class CheckBoxSymbolElement extends XmlComponent {
public constructor(name: string, val: string, font?: string) {
super(name);
if (font) {
this.root.push(new CheckboxSymbolAttributes({ val: shortHexNumber(val), symbolfont: font }));
} else {
this.root.push(new CheckboxSymbolAttributes({ val }));
}
}
}

View File

@ -0,0 +1,87 @@
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { CheckBoxUtil } from ".";
describe("CheckBoxUtil", () => {
describe("#constructor()", () => {
it("should create a CheckBoxUtil with proper root and default values", () => {
const checkBoxUtil = new CheckBoxUtil();
const tree = new Formatter().format(checkBoxUtil);
expect(tree).to.deep.equal({
"w14:checkbox": [
{
"w14:checked": {
_attr: {
"w14:val": "0",
},
},
},
{
"w14:checkedState": {
_attr: {
"w14:font": "MS Gothic",
"w14:val": "2612",
},
},
},
{
"w14:uncheckedState": {
_attr: {
"w14:font": "MS Gothic",
"w14:val": "2610",
},
},
},
],
});
});
it("should create a CheckBoxUtil with proper structure and custom values", () => {
const checkBoxUtil = new CheckBoxUtil({
checked: true,
checkedState: {
value: "2713",
font: "Segoe UI Symbol",
},
uncheckedState: {
value: "2705",
font: "Segoe UI Symbol",
},
});
const tree = new Formatter().format(checkBoxUtil);
expect(tree).to.deep.equal({
"w14:checkbox": [
{
"w14:checked": {
_attr: {
"w14:val": "1",
},
},
},
{
"w14:checkedState": {
_attr: {
"w14:font": "Segoe UI Symbol",
"w14:val": "2713",
},
},
},
{
"w14:uncheckedState": {
_attr: {
"w14:font": "Segoe UI Symbol",
"w14:val": "2705",
},
},
},
],
});
});
});
});

View File

@ -0,0 +1,45 @@
// <xsd:complexType name="CT_SdtCheckbox">
// <xsd:sequence>
// <xsd:element name="checked" type="CT_OnOff" minOccurs="0"/>
// <xsd:element name="checkedState" type="CT_SdtCheckboxSymbol" minOccurs="0"/>
// <xsd:element name="uncheckedState" type="CT_SdtCheckboxSymbol" minOccurs="0"/>
// </xsd:sequence>
// </xsd:complexType>
// <xsd:element name="checkbox" type="CT_SdtCheckbox"/>
import { CheckBoxSymbolElement } from "@file/checkbox/checkbox-symbol";
import { XmlComponent } from "@file/xml-components";
export type ICheckboxSymbolProperties = {
readonly value?: string;
readonly font?: string;
};
export type ICheckboxSymbolOptions = {
readonly alias?: string;
readonly checked?: boolean;
readonly checkedState?: ICheckboxSymbolProperties;
readonly uncheckedState?: ICheckboxSymbolProperties;
};
export class CheckBoxUtil extends XmlComponent {
private readonly DEFAULT_UNCHECKED_SYMBOL: string = "2610";
private readonly DEFAULT_CHECKED_SYMBOL: string = "2612";
private readonly DEFAULT_FONT: string = "MS Gothic";
public constructor(options?: ICheckboxSymbolOptions) {
super("w14:checkbox");
const value = options?.checked ? "1" : "0";
let symbol: string;
let font: string;
this.root.push(new CheckBoxSymbolElement("w14:checked", value));
symbol = options?.checkedState?.value ? options?.checkedState?.value : this.DEFAULT_CHECKED_SYMBOL;
font = options?.checkedState?.font ? options?.checkedState?.font : this.DEFAULT_FONT;
this.root.push(new CheckBoxSymbolElement("w14:checkedState", symbol, font));
symbol = options?.uncheckedState?.value ? options?.uncheckedState?.value : this.DEFAULT_UNCHECKED_SYMBOL;
font = options?.uncheckedState?.font ? options?.uncheckedState?.font : this.DEFAULT_FONT;
this.root.push(new CheckBoxSymbolElement("w14:uncheckedState", symbol, font));
}
}

View File

@ -0,0 +1,214 @@
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { CheckBox } from "./checkbox";
describe("CheckBox", () => {
describe("#constructor()", () => {
it("should create a CheckBox with proper root and default values (no alias, no custom state)", () => {
const checkBox = new CheckBox();
const tree = new Formatter().format(checkBox);
expect(tree).to.deep.equal({
"w:sdt": [
{
"w:sdtPr": [
{
"w14:checkbox": [
{
"w14:checked": {
_attr: {
"w14:val": "0",
},
},
},
{
"w14:checkedState": {
_attr: {
"w14:font": "MS Gothic",
"w14:val": "2612",
},
},
},
{
"w14:uncheckedState": {
_attr: {
"w14:font": "MS Gothic",
"w14:val": "2610",
},
},
},
],
},
],
},
{
"w:sdtContent": [
{
"w:r": [
{
"w:sym": {
_attr: {
"w:char": "2610",
"w:font": "MS Gothic",
},
},
},
],
},
],
},
],
});
});
it.each([
["2713", "Segoe UI Symbol", "2713", "Segoe UI Symbol"],
[undefined, undefined, "2612", "MS Gothic"],
])("should create a CheckBox with proper root and custom values", (inputChar, inputFont, actualChar, actualFont) => {
const checkBox = new CheckBox({
alias: "Custom Checkbox",
checked: true,
checkedState: {
value: inputChar,
font: inputFont,
},
uncheckedState: {
value: "2705",
font: "Segoe UI Symbol",
},
});
const tree = new Formatter().format(checkBox);
expect(tree).to.deep.equal({
"w:sdt": [
{
"w:sdtPr": [
{
"w:alias": {
_attr: {
"w:val": "Custom Checkbox",
},
},
},
{
"w14:checkbox": [
{
"w14:checked": {
_attr: {
"w14:val": "1",
},
},
},
{
"w14:checkedState": {
_attr: {
"w14:font": actualFont,
"w14:val": actualChar,
},
},
},
{
"w14:uncheckedState": {
_attr: {
"w14:font": "Segoe UI Symbol",
"w14:val": "2705",
},
},
},
],
},
],
},
{
"w:sdtContent": [
{
"w:r": [
{
"w:sym": {
_attr: {
"w:char": actualChar,
"w:font": actualFont,
},
},
},
],
},
],
},
],
});
});
it("should create a CheckBox with proper root, custom state, and no alias", () => {
const checkBox = new CheckBox({
checked: false,
checkedState: {
value: "2713",
font: "Segoe UI Symbol",
},
uncheckedState: {
value: "2705",
font: "Segoe UI Symbol",
},
});
const tree = new Formatter().format(checkBox);
expect(tree).to.deep.equal({
"w:sdt": [
{
"w:sdtPr": [
{
"w14:checkbox": [
{
"w14:checked": {
_attr: {
"w14:val": "0",
},
},
},
{
"w14:checkedState": {
_attr: {
"w14:font": "Segoe UI Symbol",
"w14:val": "2713",
},
},
},
{
"w14:uncheckedState": {
_attr: {
"w14:font": "Segoe UI Symbol",
"w14:val": "2705",
},
},
},
],
},
],
},
{
"w:sdtContent": [
{
"w:r": [
{
"w:sym": {
_attr: {
"w:char": "2705",
"w:font": "Segoe UI Symbol",
},
},
},
],
},
],
},
],
});
});
});
});

View File

@ -0,0 +1,44 @@
import { SymbolRun } from "@file/paragraph/run/symbol-run";
import { StructuredDocumentTagContent } from "@file/table-of-contents/sdt-content";
import { StructuredDocumentTagProperties } from "@file/table-of-contents/sdt-properties";
import { XmlComponent } from "@file/xml-components";
import { CheckBoxUtil, ICheckboxSymbolOptions } from "./checkbox-util";
export class CheckBox extends XmlComponent {
// default values per Microsoft
private readonly DEFAULT_UNCHECKED_SYMBOL: string = "2610";
private readonly DEFAULT_CHECKED_SYMBOL: string = "2612";
private readonly DEFAULT_FONT: string = "MS Gothic";
public constructor(options?: ICheckboxSymbolOptions) {
super("w:sdt");
const properties = new StructuredDocumentTagProperties(options?.alias);
properties.addChildElement(new CheckBoxUtil(options));
this.root.push(properties);
const content = new StructuredDocumentTagContent();
const checkedFont: string | undefined = options?.checkedState?.font;
const checkedText: string | undefined = options?.checkedState?.value;
const uncheckedFont: string | undefined = options?.uncheckedState?.font;
const uncheckedText: string | undefined = options?.uncheckedState?.value;
let symbolFont: string;
let char: string;
if (options?.checked) {
symbolFont = checkedFont ? checkedFont : this.DEFAULT_FONT;
char = checkedText ? checkedText : this.DEFAULT_CHECKED_SYMBOL;
} else {
symbolFont = uncheckedFont ? uncheckedFont : this.DEFAULT_FONT;
char = uncheckedText ? uncheckedText : this.DEFAULT_UNCHECKED_SYMBOL;
}
const initialRenderedChar = new SymbolRun({
char: char,
symbolfont: symbolFont,
});
content.addChildElement(initialRenderedChar);
this.root.push(content);
}
}

View File

@ -0,0 +1,3 @@
export * from "./checkbox-util";
export * from "./checkbox-symbol";
export * from "./checkbox";

View File

@ -1,5 +1,3 @@
// tslint:disable:no-string-literal
import { beforeEach, describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
@ -25,11 +23,21 @@ describe("ContentTypes", () => {
expect(tree["Types"][3]).to.deep.equal({ Default: { _attr: { ContentType: "image/jpeg", Extension: "jpg" } } });
expect(tree["Types"][4]).to.deep.equal({ Default: { _attr: { ContentType: "image/bmp", Extension: "bmp" } } });
expect(tree["Types"][5]).to.deep.equal({ Default: { _attr: { ContentType: "image/gif", Extension: "gif" } } });
expect(tree["Types"][6]).to.deep.equal({
expect(tree["Types"][6]).to.deep.equal({ Default: { _attr: { ContentType: "image/svg+xml", Extension: "svg" } } });
expect(tree["Types"][7]).to.deep.equal({
Default: { _attr: { ContentType: "application/vnd.openxmlformats-package.relationships+xml", Extension: "rels" } },
});
expect(tree["Types"][7]).to.deep.equal({ Default: { _attr: { ContentType: "application/xml", Extension: "xml" } } });
expect(tree["Types"][8]).to.deep.equal({
expect(tree["Types"][8]).to.deep.equal({ Default: { _attr: { ContentType: "application/xml", Extension: "xml" } } });
expect(tree["Types"][9]).to.deep.equal({
Default: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.obfuscatedFont",
Extension: "odttf",
},
},
});
expect(tree["Types"][10]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",
@ -37,7 +45,7 @@ describe("ContentTypes", () => {
},
},
});
expect(tree["Types"][9]).to.deep.equal({
expect(tree["Types"][11]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",
@ -45,7 +53,7 @@ describe("ContentTypes", () => {
},
},
});
expect(tree["Types"][10]).to.deep.equal({
expect(tree["Types"][12]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-package.core-properties+xml",
@ -53,7 +61,7 @@ describe("ContentTypes", () => {
},
},
});
expect(tree["Types"][11]).to.deep.equal({
expect(tree["Types"][13]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.custom-properties+xml",
@ -61,7 +69,7 @@ describe("ContentTypes", () => {
},
},
});
expect(tree["Types"][12]).to.deep.equal({
expect(tree["Types"][14]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.extended-properties+xml",
@ -69,7 +77,7 @@ describe("ContentTypes", () => {
},
},
});
expect(tree["Types"][13]).to.deep.equal({
expect(tree["Types"][15]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",
@ -77,7 +85,7 @@ describe("ContentTypes", () => {
},
},
});
expect(tree["Types"][14]).to.deep.equal({
expect(tree["Types"][16]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",
@ -85,7 +93,7 @@ describe("ContentTypes", () => {
},
},
});
expect(tree["Types"][15]).to.deep.equal({
expect(tree["Types"][17]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml",
@ -102,7 +110,7 @@ describe("ContentTypes", () => {
contentTypes.addFooter(102);
const tree = new Formatter().format(contentTypes);
expect(tree["Types"][17]).to.deep.equal({
expect(tree["Types"][20]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",
@ -111,7 +119,7 @@ describe("ContentTypes", () => {
},
});
expect(tree["Types"][18]).to.deep.equal({
expect(tree["Types"][21]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",
@ -128,7 +136,7 @@ describe("ContentTypes", () => {
contentTypes.addHeader(202);
const tree = new Formatter().format(contentTypes);
expect(tree["Types"][17]).to.deep.equal({
expect(tree["Types"][20]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",
@ -137,7 +145,7 @@ describe("ContentTypes", () => {
},
});
expect(tree["Types"][18]).to.deep.equal({
expect(tree["Types"][21]).to.deep.equal({
Override: {
_attr: {
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",

View File

@ -1,4 +1,5 @@
import { XmlComponent } from "@file/xml-components";
import { ContentTypeAttributes } from "./content-types-attributes";
import { Default } from "./default/default";
import { Override } from "./override/override";
@ -18,8 +19,10 @@ export class ContentTypes extends XmlComponent {
this.root.push(new Default("image/jpeg", "jpg"));
this.root.push(new Default("image/bmp", "bmp"));
this.root.push(new Default("image/gif", "gif"));
this.root.push(new Default("image/svg+xml", "svg"));
this.root.push(new Default("application/vnd.openxmlformats-package.relationships+xml", "rels"));
this.root.push(new Default("application/xml", "xml"));
this.root.push(new Default("application/vnd.openxmlformats-officedocument.obfuscatedFont", "odttf"));
this.root.push(
new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", "/word/document.xml"),
@ -33,6 +36,7 @@ export class ContentTypes extends XmlComponent {
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml", "/word/footnotes.xml"));
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml", "/word/settings.xml"));
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml", "/word/comments.xml"));
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml", "/word/fontTable.xml"));
}
public addFooter(index: number): void {

View File

@ -1,4 +1,5 @@
import { XmlComponent } from "@file/xml-components";
import { DefaultAttributes } from "./default-attributes";
export class Default extends XmlComponent {

View File

@ -1,4 +1,5 @@
import { XmlComponent } from "@file/xml-components";
import { OverrideAttributes } from "./override-attributes";
export class Override extends XmlComponent {

View File

@ -45,7 +45,7 @@ describe("Properties", () => {
expect(tree["cp:coreProperties"]).to.be.an.instanceof(Array);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const key = (obj: { readonly [key: string]: any }) => Object.keys(obj)[0];
const key = (obj: Readonly<Record<string, any>>) => Object.keys(obj)[0];
expect(tree["cp:coreProperties"].map(key)).to.include.members([
"_attr",
"cp:keywords",

View File

@ -1,18 +1,19 @@
import { FontOptions } from "@file/fonts/font-table";
import { ICommentsOptions } from "@file/paragraph/run/comment-run";
import { IHyphenationOptions } from "@file/settings";
import { ICompatibilityOptions } from "@file/settings/compatibility";
import { StringContainer, XmlComponent } from "@file/xml-components";
import { StringContainer, XmlAttributeComponent, XmlComponent } from "@file/xml-components";
import { dateTimeValue } from "@util/values";
import { ICustomPropertyOptions } from "../custom-properties";
import { IDocumentBackgroundOptions } from "../document";
import { DocumentAttributes } from "../document/document-attributes";
import { ISectionOptions } from "../file";
import { INumberingOptions } from "../numbering";
import { Paragraph } from "../paragraph";
import { IStylesOptions } from "../styles";
export interface IPropertiesOptions {
export type IPropertiesOptions = {
readonly sections: readonly ISectionOptions[];
readonly title?: string;
readonly subject?: string;
@ -25,11 +26,14 @@ export interface IPropertiesOptions {
readonly styles?: IStylesOptions;
readonly numbering?: INumberingOptions;
readonly comments?: ICommentsOptions;
readonly footnotes?: {
readonly [key: string]: {
readonly footnotes?: Readonly<
Record<
string,
{
readonly children: readonly Paragraph[];
};
};
}
>
>;
readonly background?: IDocumentBackgroundOptions;
readonly features?: {
readonly trackRevisions?: boolean;
@ -39,7 +43,10 @@ export interface IPropertiesOptions {
readonly compatibility?: ICompatibilityOptions;
readonly customProperties?: readonly ICustomPropertyOptions[];
readonly evenAndOddHeaderAndFooters?: boolean;
}
readonly defaultTabStop?: number;
readonly fonts?: readonly FontOptions[];
readonly hyphenation?: IHyphenationOptions;
};
// <xs:element name="coreProperties" type="CT_CoreProperties"/>
@ -68,15 +75,7 @@ export interface IPropertiesOptions {
export class CoreProperties extends XmlComponent {
public constructor(options: Omit<IPropertiesOptions, "sections">) {
super("cp:coreProperties");
this.root.push(
new DocumentAttributes({
cp: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
dc: "http://purl.org/dc/elements/1.1/",
dcterms: "http://purl.org/dc/terms/",
dcmitype: "http://purl.org/dc/dcmitype/",
xsi: "http://www.w3.org/2001/XMLSchema-instance",
}),
);
this.root.push(new DocumentAttributes(["cp", "dc", "dcterms", "dcmitype", "xsi"]));
if (options.title) {
this.root.push(new StringContainer("dc:title", options.title));
}
@ -103,11 +102,15 @@ export class CoreProperties extends XmlComponent {
}
}
class TimestampElementProperties extends XmlAttributeComponent<{ readonly type: string }> {
protected readonly xmlKeys = { type: "xsi:type" };
}
class TimestampElement extends XmlComponent {
public constructor(name: string) {
super(name);
this.root.push(
new DocumentAttributes({
new TimestampElementProperties({
type: "dcterms:W3CDTF",
}),
);

View File

@ -1,4 +1,5 @@
import { IContext, IXmlableObject, XmlComponent } from "@file/xml-components";
import { CustomPropertiesAttributes } from "./custom-properties-attributes";
import { CustomProperty, ICustomPropertyOptions } from "./custom-property";

View File

@ -1,10 +1,11 @@
import { XmlComponent } from "@file/xml-components";
import { CustomPropertyAttributes } from "./custom-property-attributes";
export interface ICustomPropertyOptions {
export type ICustomPropertyOptions = {
readonly name: string;
readonly value: string;
}
};
export class CustomProperty extends XmlComponent {
public constructor(id: number, properties: ICustomPropertyOptions) {

View File

@ -3,11 +3,12 @@ import { Footer } from "./footer/footer";
import { FootNotes } from "./footnotes";
import { Header } from "./header/header";
import { Relationships } from "./relationships";
import { XmlComponent } from "./xml-components";
export interface IViewWrapper {
readonly View: Document | Footer | Header | FootNotes;
export type IViewWrapper = {
readonly View: Document | Footer | Header | FootNotes | XmlComponent;
readonly Relationships: Relationships;
}
};
export class DocumentWrapper implements IViewWrapper {
private readonly document: Document;

View File

@ -1,5 +1,5 @@
import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { decimalNumber, PositiveUniversalMeasure, twipsMeasureValue } from "@util/values";
import { PositiveUniversalMeasure, decimalNumber, twipsMeasureValue } from "@util/values";
import { Column } from "./column";

View File

@ -17,17 +17,18 @@ import { decimalNumber } from "@util/values";
// <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;
export const DocumentGridType = {
DEFAULT: "default",
LINES: "lines",
LINES_AND_CHARS: "linesAndChars",
SNAP_TO_CHARS: "snapToChars",
} as const;
export type IDocGridAttributesProperties = {
readonly type?: (typeof DocumentGridType)[keyof typeof DocumentGridType];
readonly linePitch?: number;
readonly charSpace?: number;
}
};
export class DocGridAttributes extends XmlAttributeComponent<IDocGridAttributesProperties> {
protected readonly xmlKeys = {
@ -38,7 +39,7 @@ export class DocGridAttributes extends XmlAttributeComponent<IDocGridAttributesP
}
export class DocumentGrid extends XmlComponent {
public constructor(linePitch: number, charSpace?: number, type?: DocumentGridType) {
public constructor(linePitch: number, charSpace?: number, type?: (typeof DocumentGridType)[keyof typeof DocumentGridType]) {
super("w:docGrid");
this.root.push(

View File

@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { HeaderFooterReference, HeaderFooterReferenceType, HeaderFooterType } from "./header-footer-reference";
describe("HeaderFooterReference", () => {

View File

@ -7,11 +7,11 @@ import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
// <xsd:enumeration value="first"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum HeaderFooterReferenceType {
DEFAULT = "default",
FIRST = "first",
EVEN = "even",
}
export const HeaderFooterReferenceType = {
DEFAULT: "default",
FIRST: "first",
EVEN: "even",
} as const;
// </xsd:complexType>
// <xsd:group name="EG_HdrFtrReferences">
@ -32,13 +32,13 @@ export enum HeaderFooterReferenceType {
// <xsd:attribute ref="r:id" use="required"/>
// </xsd:complexType>
export interface IHeaderFooterOptions {
readonly type?: HeaderFooterReferenceType;
export type IHeaderFooterOptions = {
readonly type?: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];
readonly id?: number;
}
};
class FooterReferenceAttributes extends XmlAttributeComponent<{
readonly type: HeaderFooterReferenceType;
readonly type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];
readonly id: string;
}> {
protected readonly xmlKeys = {
@ -47,12 +47,13 @@ class FooterReferenceAttributes extends XmlAttributeComponent<{
};
}
export enum HeaderFooterType {
HEADER = "w:headerReference",
FOOTER = "w:footerReference",
}
export const HeaderFooterType = {
HEADER: "w:headerReference",
FOOTER: "w:footerReference",
} as const;
export class HeaderFooterReference extends XmlComponent {
public constructor(type: HeaderFooterType, options: IHeaderFooterOptions) {
public constructor(type: (typeof HeaderFooterType)[keyof typeof HeaderFooterType], options: IHeaderFooterOptions) {
super(type);
this.root.push(

View File

@ -0,0 +1,34 @@
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { createLineNumberType } from "./line-number";
describe("createLineNumberType", () => {
it("should work", () => {
const textDirection = createLineNumberType({ countBy: 0, start: 0, restart: "newPage", distance: 10 });
const tree = new Formatter().format(textDirection);
expect(tree).to.deep.equal({
"w:lnNumType": { _attr: { "w:countBy": 0, "w:start": 0, "w:restart": "newPage", "w:distance": 10 } },
});
});
it("should work with string measures for distance", () => {
const textDirection = createLineNumberType({ countBy: 0, start: 0, restart: "newPage", distance: "10mm" });
const tree = new Formatter().format(textDirection);
expect(tree).to.deep.equal({
"w:lnNumType": { _attr: { "w:countBy": 0, "w:start": 0, "w:restart": "newPage", "w:distance": "10mm" } },
});
});
it("should work with blank entries", () => {
const textDirection = createLineNumberType({});
const tree = new Formatter().format(textDirection);
expect(tree).to.deep.equal({
"w:lnNumType": { _attr: {} },
});
});
});

View File

@ -1,6 +1,6 @@
// http://officeopenxml.com/WPsectionLineNumbering.php
import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { decimalNumber, PositiveUniversalMeasure, twipsMeasureValue } from "@util/values";
import { BuilderElement, XmlComponent } from "@file/xml-components";
import { PositiveUniversalMeasure, decimalNumber, twipsMeasureValue } from "@util/values";
// <xsd:simpleType name="ST_LineNumberRestart">
// <xsd:restriction base="xsd:string">
@ -9,11 +9,12 @@ import { decimalNumber, PositiveUniversalMeasure, twipsMeasureValue } from "@uti
// <xsd:enumeration value="continuous"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum LineNumberRestartFormat {
NEW_PAGE = "newPage",
NEW_SECTION = "newSection",
CONTINUOUS = "continuous",
}
export const LineNumberRestartFormat = {
NEW_PAGE: "newPage",
NEW_SECTION: "newSection",
CONTINUOUS: "continuous",
} as const;
// <xsd:complexType name="CT_LineNumber">
// <xsd:attribute name="countBy" type="ST_DecimalNumber" use="optional"/>
@ -22,28 +23,23 @@ export enum LineNumberRestartFormat {
// <xsd:attribute name="restart" type="ST_LineNumberRestart" use="optional" default="newPage"/>
// </xsd:complexType>
export interface ILineNumberAttributes {
export type ILineNumberAttributes = {
readonly countBy?: number;
readonly start?: number;
readonly restart?: LineNumberRestartFormat;
readonly restart?: (typeof LineNumberRestartFormat)[keyof typeof LineNumberRestartFormat];
readonly distance?: number | PositiveUniversalMeasure;
}
};
export class LineNumberType extends XmlComponent {
public constructor({ countBy, start, restart, distance }: ILineNumberAttributes) {
super("w:lnNumType");
this.root.push(
new NextAttributeComponent<{
readonly countBy?: number;
readonly start?: number;
readonly restart?: LineNumberRestartFormat;
readonly distance?: number | PositiveUniversalMeasure;
}>({
export const createLineNumberType = ({ countBy, start, restart, distance }: ILineNumberAttributes): XmlComponent =>
new BuilderElement<ILineNumberAttributes>({
name: "w:lnNumType",
attributes: {
countBy: { key: "w:countBy", value: countBy === undefined ? undefined : decimalNumber(countBy) },
start: { key: "w:start", value: start === undefined ? undefined : decimalNumber(start) },
restart: { key: "w:restart", value: restart },
distance: { key: "w:distance", value: distance === undefined ? undefined : twipsMeasureValue(distance) },
}),
);
}
}
distance: {
key: "w:distance",
value: distance === undefined ? undefined : twipsMeasureValue(distance),
},
},
});

View File

@ -3,7 +3,7 @@ import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { BorderStyle } from "@file/border";
import { PageBorderDisplay, PageBorders, PageBorderZOrder } from "./page-borders";
import { PageBorderDisplay, PageBorderZOrder, PageBorders } from "./page-borders";
describe("PageBorders", () => {
describe("#constructor()", () => {

View File

@ -9,11 +9,12 @@ import { IgnoreIfEmptyXmlComponent, XmlAttributeComponent } from "@file/xml-comp
// <xsd:enumeration value="notFirstPage"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum PageBorderDisplay {
ALL_PAGES = "allPages",
FIRST_PAGE = "firstPage",
NOT_FIRST_PAGE = "notFirstPage",
}
export const PageBorderDisplay = {
ALL_PAGES: "allPages",
FIRST_PAGE: "firstPage",
NOT_FIRST_PAGE: "notFirstPage",
} as const;
// <xsd:simpleType name="ST_PageBorderOffset">
// <xsd:restriction base="xsd:string">
@ -21,10 +22,10 @@ export enum PageBorderDisplay {
// <xsd:enumeration value="text"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum PageBorderOffsetFrom {
PAGE = "page",
TEXT = "text",
}
export const PageBorderOffsetFrom = {
PAGE: "page",
TEXT: "text",
} as const;
// <xsd:simpleType name="ST_PageBorderZOrder">
// <xsd:restriction base="xsd:string">
@ -32,24 +33,24 @@ export enum PageBorderOffsetFrom {
// <xsd:enumeration value="back"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum PageBorderZOrder {
BACK = "back",
FRONT = "front",
}
export const PageBorderZOrder = {
BACK: "back",
FRONT: "front",
} as const;
export interface IPageBorderAttributes {
readonly display?: PageBorderDisplay;
readonly offsetFrom?: PageBorderOffsetFrom;
readonly zOrder?: PageBorderZOrder;
}
export type IPageBorderAttributes = {
readonly display?: (typeof PageBorderDisplay)[keyof typeof PageBorderDisplay];
readonly offsetFrom?: (typeof PageBorderOffsetFrom)[keyof typeof PageBorderOffsetFrom];
readonly zOrder?: (typeof PageBorderZOrder)[keyof typeof PageBorderZOrder];
};
export interface IPageBordersOptions {
export type IPageBordersOptions = {
readonly pageBorders?: IPageBorderAttributes;
readonly pageBorderTop?: IBorderOptions;
readonly pageBorderRight?: IBorderOptions;
readonly pageBorderBottom?: IBorderOptions;
readonly pageBorderLeft?: IBorderOptions;
}
};
class PageBordersAttributes extends XmlAttributeComponent<IPageBorderAttributes> {
protected readonly xmlKeys = {

View File

@ -1,5 +1,5 @@
import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { PositiveUniversalMeasure, signedTwipsMeasureValue, twipsMeasureValue, UniversalMeasure } from "@util/values";
import { PositiveUniversalMeasure, UniversalMeasure, signedTwipsMeasureValue, twipsMeasureValue } from "@util/values";
// <xsd:complexType name="CT_PageMar">
// <xsd:attribute name="top" type="ST_SignedTwipsMeasure" use="required"/>

View File

@ -12,19 +12,20 @@ import { decimalNumber } from "@util/values";
// <xsd:enumeration value="enDash"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum PageNumberSeparator {
HYPHEN = "hyphen",
PERIOD = "period",
COLON = "colon",
EM_DASH = "emDash",
EN_DASH = "endash",
}
export interface IPageNumberTypeAttributes {
export const PageNumberSeparator = {
HYPHEN: "hyphen",
PERIOD: "period",
COLON: "colon",
EM_DASH: "emDash",
EN_DASH: "endash",
} as const;
export type IPageNumberTypeAttributes = {
readonly start?: number;
readonly formatType?: NumberFormat;
readonly separator?: PageNumberSeparator;
}
readonly formatType?: (typeof NumberFormat)[keyof typeof NumberFormat];
readonly separator?: (typeof PageNumberSeparator)[keyof typeof PageNumberSeparator];
};
// <xsd:complexType name="CT_PageNumber">
// <xsd:attribute name="fmt" type="ST_NumberFormat" use="optional" default="decimal"/>
@ -40,6 +41,7 @@ export class PageNumberTypeAttributes extends XmlAttributeComponent<IPageNumberT
separator: "w:chapSep",
};
}
export class PageNumberType extends XmlComponent {
public constructor({ start, formatType, separator }: IPageNumberTypeAttributes) {
super("w:pgNumType");

View File

@ -7,10 +7,10 @@ import { PositiveUniversalMeasure, twipsMeasureValue } from "@util/values";
// <xsd:enumeration value="landscape"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum PageOrientation {
PORTRAIT = "portrait",
LANDSCAPE = "landscape",
}
export const PageOrientation = {
PORTRAIT: "portrait",
LANDSCAPE: "landscape",
} as const;
// <xsd:complexType name="CT_PageSz">
// <xsd:attribute name="w" type="s:ST_TwipsMeasure"/>
@ -21,11 +21,15 @@ export enum PageOrientation {
export type IPageSizeAttributes = {
readonly width?: number | PositiveUniversalMeasure;
readonly height?: number | PositiveUniversalMeasure;
readonly orientation?: PageOrientation;
readonly orientation?: (typeof PageOrientation)[keyof typeof PageOrientation];
};
export class PageSize extends XmlComponent {
public constructor(width: number | PositiveUniversalMeasure, height: number | PositiveUniversalMeasure, orientation: PageOrientation) {
public constructor(
width: number | PositiveUniversalMeasure,
height: number | PositiveUniversalMeasure,
orientation: (typeof PageOrientation)[keyof typeof PageOrientation],
) {
super("w:pgSz");
const flip = orientation === PageOrientation.LANDSCAPE;

View File

@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { PageTextDirection, PageTextDirectionType } from "./page-text-direction";
describe("PageTextDirection", () => {

View File

@ -1,16 +1,18 @@
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
export enum PageTextDirectionType {
LEFT_TO_RIGHT_TOP_TO_BOTTOM = "lrTb",
TOP_TO_BOTTOM_RIGHT_TO_LEFT = "tbRl",
}
export const PageTextDirectionType = {
LEFT_TO_RIGHT_TOP_TO_BOTTOM: "lrTb",
TOP_TO_BOTTOM_RIGHT_TO_LEFT: "tbRl",
} as const;
class PageTextDirectionAttributes extends XmlAttributeComponent<{ readonly val: PageTextDirectionType }> {
class PageTextDirectionAttributes extends XmlAttributeComponent<{
readonly val: (typeof PageTextDirectionType)[keyof typeof PageTextDirectionType];
}> {
protected readonly xmlKeys = { val: "w:val" };
}
export class PageTextDirection extends XmlComponent {
public constructor(value: PageTextDirectionType) {
public constructor(value: (typeof PageTextDirectionType)[keyof typeof PageTextDirectionType]) {
super("w:textDirection");
this.root.push(

View File

@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { SectionType, Type } from "./section-type";
describe("Type", () => {

View File

@ -10,19 +10,20 @@ import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
// <xsd:enumeration value="oddPage"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum SectionType {
NEXT_PAGE = "nextPage",
NEXT_COLUMN = "nextColumn",
CONTINUOUS = "continuous",
EVEN_PAGE = "evenPage",
ODD_PAGE = "oddPage",
}
export const SectionType = {
NEXT_PAGE: "nextPage",
NEXT_COLUMN: "nextColumn",
CONTINUOUS: "continuous",
EVEN_PAGE: "evenPage",
ODD_PAGE: "oddPage",
} as const;
// <xsd:complexType name="CT_SectType">
// <xsd:attribute name="val" type="ST_SectionMark"/>
// </xsd:complexType>
export class SectionTypeAttributes extends XmlAttributeComponent<{
readonly val: SectionType;
readonly val: (typeof SectionType)[keyof typeof SectionType];
}> {
protected readonly xmlKeys = {
val: "w:val",
@ -30,7 +31,7 @@ export class SectionTypeAttributes extends XmlAttributeComponent<{
}
export class Type extends XmlComponent {
public constructor(value: SectionType) {
public constructor(value: (typeof SectionType)[keyof typeof SectionType]) {
super("w:type");
this.root.push(new SectionTypeAttributes({ val: value }));
}

View File

@ -15,7 +15,7 @@ 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";
import { SectionProperties, sectionMarginDefaults, sectionPageSizeDefaults } from "./section-properties";
const DEFAULT_MARGINS = {
"w:bottom": sectionMarginDefaults.BOTTOM,

View File

@ -1,16 +1,14 @@
// http://officeopenxml.com/WPsection.php
// tslint:disable: no-unnecessary-initializer
import { FooterWrapper } from "@file/footer-wrapper";
import { HeaderWrapper } from "@file/header-wrapper";
import { VerticalAlign, VerticalAlignElement } from "@file/vertical-align";
import { OnOffElement, XmlComponent } from "@file/xml-components";
import { PositiveUniversalMeasure, UniversalMeasure } from "@util/values";
import { HeaderFooterReference, HeaderFooterReferenceType, HeaderFooterType } from "./properties/header-footer-reference";
import { Columns, IColumnsAttributes } from "./properties/columns";
import { DocumentGrid, IDocGridAttributesProperties } from "./properties/doc-grid";
import { ILineNumberAttributes, LineNumberType } from "./properties/line-number";
import { HeaderFooterReference, HeaderFooterReferenceType, HeaderFooterType } from "./properties/header-footer-reference";
import { ILineNumberAttributes, createLineNumberType } from "./properties/line-number";
import { IPageBordersOptions, PageBorders } from "./properties/page-borders";
import { IPageMarginAttributes, PageMargin } from "./properties/page-margin";
import { IPageNumberTypeAttributes, PageNumberType } from "./properties/page-number";
@ -18,29 +16,29 @@ import { IPageSizeAttributes, PageOrientation, PageSize } from "./properties/pag
import { PageTextDirection, PageTextDirectionType } from "./properties/page-text-direction";
import { SectionType, Type } from "./properties/section-type";
export interface IHeaderFooterGroup<T> {
export type IHeaderFooterGroup<T> = {
readonly default?: T;
readonly first?: T;
readonly even?: T;
}
};
export interface ISectionPropertiesOptions {
export type ISectionPropertiesOptions = {
readonly page?: {
readonly size?: IPageSizeAttributes;
readonly margin?: IPageMarginAttributes;
readonly pageNumbers?: IPageNumberTypeAttributes;
readonly borders?: IPageBordersOptions;
readonly textDirection?: PageTextDirectionType;
readonly textDirection?: (typeof PageTextDirectionType)[keyof typeof PageTextDirectionType];
};
readonly grid?: IDocGridAttributesProperties;
readonly headerWrapperGroup?: IHeaderFooterGroup<HeaderWrapper>;
readonly footerWrapperGroup?: IHeaderFooterGroup<FooterWrapper>;
readonly lineNumbers?: ILineNumberAttributes;
readonly titlePage?: boolean;
readonly verticalAlign?: VerticalAlign;
readonly verticalAlign?: (typeof VerticalAlign)[keyof typeof VerticalAlign];
readonly column?: IColumnsAttributes;
readonly type?: SectionType;
}
readonly type?: (typeof SectionType)[keyof typeof SectionType];
};
// <xsd:complexType name="CT_SectPr">
// <xsd:sequence>
@ -76,10 +74,10 @@ export interface ISectionPropertiesOptions {
// </xsd:group>
export const sectionMarginDefaults = {
TOP: "1in" as UniversalMeasure,
RIGHT: "1in" as PositiveUniversalMeasure,
BOTTOM: "1in" as UniversalMeasure,
LEFT: "1in" as PositiveUniversalMeasure,
TOP: 1440,
RIGHT: 1440,
BOTTOM: 1440,
LEFT: 1440,
HEADER: 708,
FOOTER: 708,
GUTTER: 0,
@ -138,7 +136,7 @@ export class SectionProperties extends XmlComponent {
}
if (lineNumbers) {
this.root.push(new LineNumberType(lineNumbers));
this.root.push(createLineNumberType(lineNumbers));
}
this.root.push(new PageNumberType(pageNumbers));
@ -163,7 +161,7 @@ export class SectionProperties extends XmlComponent {
}
private addHeaderFooterGroup(
type: HeaderFooterType,
type: (typeof HeaderFooterType)[keyof typeof HeaderFooterType],
group: IHeaderFooterGroup<HeaderWrapper> | IHeaderFooterGroup<FooterWrapper>,
): void {
if (group.default) {

View File

@ -1,89 +1,60 @@
import { XmlAttributeComponent } from "@file/xml-components";
import { AttributeMap, XmlAttributeComponent } from "@file/xml-components";
/* cSpell:disable */
export interface IDocumentAttributesProperties {
readonly wpc?: string;
readonly mc?: string;
readonly o?: string;
readonly r?: string;
readonly m?: string;
readonly v?: string;
readonly wp14?: string;
readonly wp?: string;
readonly w10?: string;
readonly w?: string;
readonly w14?: string;
readonly w15?: string;
readonly wpg?: string;
readonly wpi?: string;
readonly wne?: string;
readonly wps?: string;
readonly Ignorable?: string;
readonly cp?: string;
readonly dc?: string;
readonly dcterms?: string;
readonly dcmitype?: string;
readonly xsi?: string;
readonly type?: string;
readonly cx?: string;
readonly cx1?: string;
readonly cx2?: string;
readonly cx3?: string;
readonly cx4?: string;
readonly cx5?: string;
readonly cx6?: string;
readonly cx7?: string;
readonly cx8?: string;
readonly aink?: string;
readonly am3d?: string;
readonly w16cex?: string;
readonly w16cid?: string;
readonly w16?: string;
readonly w16sdtdh?: string;
readonly w16se?: string;
}
export const DocumentAttributeNamespaces = {
wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",
mc: "http://schemas.openxmlformats.org/markup-compatibility/2006",
o: "urn:schemas-microsoft-com:office:office",
r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
m: "http://schemas.openxmlformats.org/officeDocument/2006/math",
v: "urn:schemas-microsoft-com:vml",
wp14: "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",
wp: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",
w10: "urn:schemas-microsoft-com:office:word",
w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
w14: "http://schemas.microsoft.com/office/word/2010/wordml",
w15: "http://schemas.microsoft.com/office/word/2012/wordml",
wpg: "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",
wpi: "http://schemas.microsoft.com/office/word/2010/wordprocessingInk",
wne: "http://schemas.microsoft.com/office/word/2006/wordml",
wps: "http://schemas.microsoft.com/office/word/2010/wordprocessingShape",
cp: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
dc: "http://purl.org/dc/elements/1.1/",
dcterms: "http://purl.org/dc/terms/",
dcmitype: "http://purl.org/dc/dcmitype/",
xsi: "http://www.w3.org/2001/XMLSchema-instance",
cx: "http://schemas.microsoft.com/office/drawing/2014/chartex",
cx1: "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",
cx2: "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",
cx3: "http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",
cx4: "http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",
cx5: "http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",
cx6: "http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",
cx7: "http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",
cx8: "http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",
aink: "http://schemas.microsoft.com/office/drawing/2016/ink",
am3d: "http://schemas.microsoft.com/office/drawing/2017/model3d",
w16cex: "http://schemas.microsoft.com/office/word/2018/wordml/cex",
w16cid: "http://schemas.microsoft.com/office/word/2016/wordml/cid",
w16: "http://schemas.microsoft.com/office/word/2018/wordml",
w16sdtdh: "http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",
w16se: "http://schemas.microsoft.com/office/word/2015/wordml/symex",
};
/* cSpell:enable */
export type DocumentAttributeNamespace = keyof typeof DocumentAttributeNamespaces;
export type IDocumentAttributesProperties = Partial<Record<DocumentAttributeNamespace, string>> & {
readonly Ignorable?: string;
};
export class DocumentAttributes extends XmlAttributeComponent<IDocumentAttributesProperties> {
protected readonly xmlKeys = {
wpc: "xmlns:wpc",
mc: "xmlns:mc",
o: "xmlns:o",
r: "xmlns:r",
m: "xmlns:m",
v: "xmlns:v",
wp14: "xmlns:wp14",
wp: "xmlns:wp",
w10: "xmlns:w10",
w: "xmlns:w",
w14: "xmlns:w14",
w15: "xmlns:w15",
wpg: "xmlns:wpg",
wpi: "xmlns:wpi",
wne: "xmlns:wne",
wps: "xmlns:wps",
Ignorable: "mc:Ignorable",
cp: "xmlns:cp",
dc: "xmlns:dc",
dcterms: "xmlns:dcterms",
dcmitype: "xmlns:dcmitype",
xsi: "xmlns:xsi",
type: "xsi:type",
cx: "xmlns:cx",
cx1: "xmlns:cx1",
cx2: "xmlns:cx2",
cx3: "xmlns:cx3",
cx4: "xmlns:cx4",
cx5: "xmlns:cx5",
cx6: "xmlns:cx6",
cx7: "xmlns:cx7",
cx8: "xmlns:cx8",
aink: "xmlns:aink",
am3d: "xmlns:am3d",
w16cex: "xmlns:w16cex",
w16cid: "xmlns:w16cid",
w16: "xmlns:w16",
w16sdtdh: "xmlns:w16sdtdh",
w16se: "xmlns:w16se",
};
...Object.fromEntries(Object.keys(DocumentAttributeNamespaces).map((key) => [key, `xmlns:${key}`])),
} as AttributeMap<IDocumentAttributesProperties>;
public constructor(ns: readonly DocumentAttributeNamespace[], Ignorable?: string) {
super({ Ignorable, ...Object.fromEntries(ns.map((n) => [n, DocumentAttributeNamespaces[n]])) });
}
}

View File

@ -39,12 +39,12 @@ export class DocumentBackgroundAttributes extends XmlAttributeComponent<{
};
}
export interface IDocumentBackgroundOptions {
export type IDocumentBackgroundOptions = {
readonly color?: string;
readonly themeColor?: string;
readonly themeShade?: string;
readonly themeTint?: string;
}
};
// <xsd:complexType name="CT_Background">
// <xsd:sequence>

View File

@ -1,5 +1,6 @@
// http://officeopenxml.com/WPdocument.php
import { XmlComponent } from "@file/xml-components";
import { ConcreteHyperlink, Paragraph } from "../paragraph";
import { Table } from "../table";
import { TableOfContents } from "../table-of-contents";
@ -7,9 +8,9 @@ import { Body } from "./body";
import { DocumentAttributes } from "./document-attributes";
import { DocumentBackground, IDocumentBackgroundOptions } from "./document-background";
export interface IDocumentOptions {
export type IDocumentOptions = {
readonly background?: IDocumentBackgroundOptions;
}
};
// <xsd:element name="document" type="CT_Document"/>
//
@ -36,41 +37,43 @@ export class Document extends XmlComponent {
public constructor(options: IDocumentOptions) {
super("w:document");
this.root.push(
new DocumentAttributes({
wpc: "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",
mc: "http://schemas.openxmlformats.org/markup-compatibility/2006",
o: "urn:schemas-microsoft-com:office:office",
r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
m: "http://schemas.openxmlformats.org/officeDocument/2006/math",
v: "urn:schemas-microsoft-com:vml",
wp14: "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",
wp: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",
w10: "urn:schemas-microsoft-com:office:word",
w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
w14: "http://schemas.microsoft.com/office/word/2010/wordml",
w15: "http://schemas.microsoft.com/office/word/2012/wordml",
wpg: "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",
wpi: "http://schemas.microsoft.com/office/word/2010/wordprocessingInk",
wne: "http://schemas.microsoft.com/office/word/2006/wordml",
wps: "http://schemas.microsoft.com/office/word/2010/wordprocessingShape",
cx: "http://schemas.microsoft.com/office/drawing/2014/chartex",
cx1: "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",
cx2: "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",
cx3: "http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",
cx4: "http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",
cx5: "http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",
cx6: "http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",
cx7: "http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",
cx8: "http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",
aink: "http://schemas.microsoft.com/office/drawing/2016/ink",
am3d: "http://schemas.microsoft.com/office/drawing/2017/model3d",
w16cex: "http://schemas.microsoft.com/office/word/2018/wordml/cex",
w16cid: "http://schemas.microsoft.com/office/word/2016/wordml/cid",
w16: "http://schemas.microsoft.com/office/word/2018/wordml",
w16sdtdh: "http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",
w16se: "http://schemas.microsoft.com/office/word/2015/wordml/symex",
Ignorable: "w14 w15 wp14",
}),
new DocumentAttributes(
[
"wpc",
"mc",
"o",
"r",
"m",
"v",
"wp14",
"wp",
"w10",
"w",
"w14",
"w15",
"wpg",
"wpi",
"wne",
"wps",
"cx",
"cx1",
"cx2",
"cx3",
"cx4",
"cx5",
"cx6",
"cx7",
"cx8",
"aink",
"am3d",
"w16cex",
"w16cid",
"w16",
"w16sdtdh",
"w16se",
],
"w14 w15 wp14",
),
);
this.body = new Body();
if (options.background) {

View File

@ -1,14 +1,15 @@
import { XmlAttributeComponent } from "@file/xml-components";
import { IDistance } from "../drawing";
export interface IAnchorAttributes extends IDistance {
export type IAnchorAttributes = {
readonly allowOverlap?: "0" | "1";
readonly behindDoc?: "0" | "1";
readonly layoutInCell?: "0" | "1";
readonly locked?: "0" | "1";
readonly relativeHeight?: number;
readonly simplePos?: "0" | "1";
}
} & IDistance;
export class AnchorAttributes extends XmlAttributeComponent<IAnchorAttributes> {
protected readonly xmlKeys = {

View File

@ -1,7 +1,6 @@
import { assert, describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { Utility } from "tests/utility";
import { IDrawingOptions } from "../drawing";
@ -9,10 +8,11 @@ import { TextWrappingType } from "../text-wrap";
import { Anchor } from "./anchor";
const createAnchor = (drawingOptions: IDrawingOptions): Anchor =>
new Anchor(
{
new Anchor({
mediaData: {
type: "png",
fileName: "test.png",
stream: new Buffer(""),
data: Buffer.from(""),
transformation: {
pixels: {
x: 0,
@ -24,7 +24,7 @@ const createAnchor = (drawingOptions: IDrawingOptions): Anchor =>
},
},
},
{
transform: {
pixels: {
x: 100,
y: 100,
@ -35,7 +35,7 @@ const createAnchor = (drawingOptions: IDrawingOptions): Anchor =>
},
},
drawingOptions,
);
});
describe("Anchor", () => {
let anchor: Anchor;

Some files were not shown because too many files have changed in this diff Show More