Compare commits

...

393 Commits

Author SHA1 Message Date
c5a2c1c0cb Ability to add PageNumber to paragraph 2023-02-13 23:04:59 +00:00
d505281a7e Merge pull request #1928 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.51.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.50.0 to 5.51.0
2023-02-08 15:01:28 +00:00
58575342e0 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.50.0 to 5.51.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/v5.51.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>
2023-02-08 11:21:24 +00:00
60ad6d6ab5 Merge pull request #1930 from dolanmiu/dependabot/npm_and_yarn/prettier-2.8.4
build(deps-dev): bump prettier from 2.8.3 to 2.8.4
2023-02-08 11:19:43 +00:00
f9dec1cb3c build(deps-dev): bump prettier from 2.8.3 to 2.8.4
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.3 to 2.8.4.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.3...2.8.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-08 11:01:31 +00:00
c713e6f371 Merge pull request #1927 from dolanmiu/dependabot/npm_and_yarn/types/node-18.13.0
build(deps): bump @types/node from 18.11.18 to 18.13.0
2023-02-07 15:39:18 +00:00
3c55f9fc1f Merge pull request #1925 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.8.0
build(deps-dev): bump eslint-plugin-jsdoc from 39.7.5 to 39.8.0
2023-02-07 15:39:11 +00:00
c9a8a99278 Merge pull request #1923 from dolanmiu/dependabot/npm_and_yarn/cspell-6.22.0
build(deps-dev): bump cspell from 6.21.0 to 6.22.0
2023-02-07 15:39:02 +00:00
b309d327f0 Merge pull request #1922 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-functional-5.0.4
build(deps-dev): bump eslint-plugin-functional from 5.0.1 to 5.0.4
2023-02-07 15:38:53 +00:00
58bad10bfe Merge pull request #1929 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.51.0
build(deps-dev): bump @typescript-eslint/parser from 5.50.0 to 5.51.0
2023-02-07 15:38:46 +00:00
26ea6c518f build(deps-dev): bump @typescript-eslint/parser from 5.50.0 to 5.51.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.50.0 to 5.51.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.51.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-02-07 11:02:29 +00:00
d4594a97a2 build(deps): bump @types/node from 18.11.18 to 18.13.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.18 to 18.13.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>
2023-02-07 11:01:04 +00:00
68f951ef79 build(deps-dev): bump eslint-plugin-jsdoc from 39.7.5 to 39.8.0
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.7.5 to 39.8.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/v39.7.5...v39.8.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>
2023-02-06 11:02:34 +00:00
12e29c6a75 build(deps-dev): bump cspell from 6.21.0 to 6.22.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.21.0 to 6.22.0.
- [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.21.0...v6.22.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 11:01:46 +00:00
05eedb2ac1 build(deps-dev): bump eslint-plugin-functional from 5.0.1 to 5.0.4
Bumps [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional) from 5.0.1 to 5.0.4.
- [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.1...v5.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 11:01:24 +00:00
46ded68369 Merge pull request #1919 from dolanmiu/dependabot/npm_and_yarn/cspell-6.21.0
build(deps-dev): bump cspell from 6.20.1 to 6.21.0
2023-02-03 22:06:17 +00:00
b3a53d341d build(deps-dev): bump cspell from 6.20.1 to 6.21.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.20.1 to 6.21.0.
- [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.20.1...v6.21.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-03 11:01:04 +00:00
afcd5e70a1 Upgrade eslint plugin functional 2023-02-02 17:44:12 +00:00
ae48999e38 Merge pull request #1917 from dolanmiu/dependabot/npm_and_yarn/http-cache-semantics-4.1.1
build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1
2023-02-02 17:37:26 +00:00
4c38e45455 Merge pull request #1918 from dolanmiu/feature/upgrade-code-cov
Fix eslint issues
2023-02-02 17:37:17 +00:00
ec847dccf9 Fix prettier issue 2023-02-02 17:22:49 +00:00
ca47a1dc3f Merge pull request #1914 from dolanmiu/dependabot/npm_and_yarn/cspell-6.20.1
build(deps-dev): bump cspell from 6.19.2 to 6.20.1
2023-02-02 17:00:33 +00:00
cc53ff417b build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/commits)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-02 16:59:58 +00:00
fcba817a4a Fix eslint issues 2023-02-02 16:59:37 +00:00
bcd8249d17 Merge pull request #1916 from dolanmiu/feature/upgrade-code-cov
Upgrade codecov
2023-02-02 16:59:22 +00:00
bc0a197ba1 Upgrade codecov 2023-02-02 16:31:12 +00:00
2e16279d7b build(deps-dev): bump cspell from 6.19.2 to 6.20.1
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.19.2 to 6.20.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/v6.19.2...v6.20.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-02 11:01:04 +00:00
87590aedbd Merge pull request #1913 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.7.5
build(deps-dev): bump eslint-plugin-jsdoc from 39.7.4 to 39.7.5
2023-02-01 20:35:24 +00:00
0fef7763d5 build(deps-dev): bump eslint-plugin-jsdoc from 39.7.4 to 39.7.5
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.7.4 to 39.7.5.
- [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/v39.7.4...v39.7.5)

---
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-02-01 11:01:06 +00:00
e55698d221 Merge pull request #1910 from dolanmiu/dependabot/npm_and_yarn/typescript-4.9.5
build(deps-dev): bump typescript from 4.9.4 to 4.9.5
2023-01-31 21:22:49 +00:00
d410b5e96f Merge pull request #1907 from dolanmiu/dependabot/npm_and_yarn/eslint-8.33.0
build(deps-dev): bump eslint from 8.32.0 to 8.33.0
2023-01-31 21:22:37 +00:00
8587601411 Merge pull request #1906 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.7.4
build(deps-dev): bump eslint-plugin-jsdoc from 39.6.9 to 39.7.4
2023-01-31 21:22:28 +00:00
5b67cb21c6 Merge pull request #1909 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.50.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.49.0 to 5.50.0
2023-01-31 21:22:20 +00:00
42fd9d06de Merge pull request #1911 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.50.0
build(deps-dev): bump @typescript-eslint/parser from 5.49.0 to 5.50.0
2023-01-31 21:22:14 +00:00
1e0b74fd27 build(deps-dev): bump @typescript-eslint/parser from 5.49.0 to 5.50.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.49.0 to 5.50.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.50.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-01-31 11:02:29 +00:00
21934ec85b build(deps-dev): bump typescript from 4.9.4 to 4.9.5
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.4 to 4.9.5.
- [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-01-31 11:01:53 +00:00
b4f01fb6ec 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.49.0 to 5.50.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/v5.50.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>
2023-01-31 11:01:28 +00:00
fbf6329500 build(deps-dev): bump eslint from 8.32.0 to 8.33.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.32.0 to 8.33.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.32.0...v8.33.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-01-30 11:01:14 +00:00
41549443c3 build(deps-dev): bump eslint-plugin-jsdoc from 39.6.9 to 39.7.4
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.6.9 to 39.7.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/v39.6.9...v39.7.4)

---
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-01-30 11:00:52 +00:00
92630af4e1 Merge pull request #1905 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.6.9
build(deps-dev): bump eslint-plugin-jsdoc from 39.6.8 to 39.6.9
2023-01-27 11:12:56 +00:00
4db633da16 build(deps-dev): bump eslint-plugin-jsdoc from 39.6.8 to 39.6.9
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.6.8 to 39.6.9.
- [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/v39.6.8...v39.6.9)

---
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-01-27 11:01:09 +00:00
dac02f13ae Merge pull request #1901 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.49.0
build(deps-dev): bump @typescript-eslint/parser from 5.48.2 to 5.49.0
2023-01-27 10:46:54 +00:00
1a52dec1c2 build(deps-dev): bump @typescript-eslint/parser from 5.48.2 to 5.49.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.48.2 to 5.49.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.49.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-01-27 10:27:04 +00:00
be1ca51162 Merge pull request #1900 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.6.8
build(deps-dev): bump eslint-plugin-jsdoc from 39.6.7 to 39.6.8
2023-01-27 10:26:08 +00:00
768e20bb79 Merge pull request #1902 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.49.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.48.2 to 5.49.0
2023-01-27 10:25:37 +00:00
26b9b15de8 Merge pull request #1903 from dolanmiu/dependabot/npm_and_yarn/rimraf-4.1.2
build(deps-dev): bump rimraf from 4.1.1 to 4.1.2
2023-01-27 10:25:23 +00:00
42713095b6 Merge pull request #1904 from dolanmiu/dependabot/npm_and_yarn/types/prompt-1.1.5
build(deps-dev): bump @types/prompt from 1.1.4 to 1.1.5
2023-01-27 10:25:08 +00:00
3acafeca38 build(deps-dev): bump @types/prompt from 1.1.4 to 1.1.5
Bumps [@types/prompt](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prompt) from 1.1.4 to 1.1.5.
- [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>
2023-01-26 11:00:45 +00:00
7ca75c8c5a build(deps-dev): bump rimraf from 4.1.1 to 4.1.2
Bumps [rimraf](https://github.com/isaacs/rimraf) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/rimraf/compare/v4.1.1...v4.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-24 11:02:11 +00:00
c00ad454a9 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.48.2 to 5.49.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/v5.49.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>
2023-01-24 11:01:54 +00:00
16d04eb4d3 build(deps-dev): bump eslint-plugin-jsdoc from 39.6.7 to 39.6.8
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.6.7 to 39.6.8.
- [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/v39.6.7...v39.6.8)

---
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-01-24 11:00:46 +00:00
816845f271 Merge pull request #1893 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.6.7
build(deps-dev): bump eslint-plugin-jsdoc from 39.6.4 to 39.6.7
2023-01-23 15:02:42 +00:00
12eeda8d33 Merge pull request #1894 from dolanmiu/dependabot/npm_and_yarn/types/glob-8.0.1
build(deps-dev): bump @types/glob from 8.0.0 to 8.0.1
2023-01-23 15:01:37 +00:00
3d622c2ef1 Merge pull request #1898 from dolanmiu/feat/strict-types-for-File-Child
Add strict types for file child
2023-01-23 15:01:03 +00:00
21a6767c6f Add strict types for file child 2023-01-23 14:14:05 +00:00
7a7326ec09 build(deps-dev): bump @types/glob from 8.0.0 to 8.0.1
Bumps [@types/glob](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/glob) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/glob)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-20 11:01:17 +00:00
9b3af4e217 build(deps-dev): bump eslint-plugin-jsdoc from 39.6.4 to 39.6.7
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.6.4 to 39.6.7.
- [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/v39.6.4...v39.6.7)

---
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-01-20 11:00:55 +00:00
cee0114f81 Merge pull request #1890 from dolanmiu/dependabot/npm_and_yarn/cspell-6.19.2
build(deps-dev): bump cspell from 6.18.1 to 6.19.2
2023-01-18 17:03:52 +00:00
03399aedf0 Merge pull request #1891 from dolanmiu/dependabot/npm_and_yarn/rimraf-4.1.1
build(deps-dev): bump rimraf from 4.1.0 to 4.1.1
2023-01-18 17:03:45 +00:00
2739b94bd8 build(deps-dev): bump rimraf from 4.1.0 to 4.1.1
Bumps [rimraf](https://github.com/isaacs/rimraf) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/rimraf/compare/v4.1.0...v4.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-18 11:01:15 +00:00
c720441d62 build(deps-dev): bump cspell from 6.18.1 to 6.19.2
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.18.1 to 6.19.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/v6.18.1...v6.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-18 11:00:58 +00:00
00b5898fe0 Merge pull request #1889 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.48.2
build(deps-dev): bump @typescript-eslint/parser from 5.48.1 to 5.48.2
2023-01-18 04:23:15 +00:00
0d0940b7a5 Merge pull request #1888 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.48.2
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.48.1 to 5.48.2
2023-01-18 04:23:06 +00:00
f28c949ac6 Merge pull request #1887 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-import-2.27.5
build(deps-dev): bump eslint-plugin-import from 2.27.4 to 2.27.5
2023-01-18 04:22:59 +00:00
63317d6ac8 Merge pull request #1886 from dolanmiu/dependabot/npm_and_yarn/rimraf-4.1.0
build(deps-dev): bump rimraf from 4.0.4 to 4.1.0
2023-01-18 04:22:52 +00:00
6406ba831f Merge pull request #1884 from dolanmiu/dependabot/npm_and_yarn/prettier-2.8.3
build(deps-dev): bump prettier from 2.8.2 to 2.8.3
2023-01-18 04:22:45 +00:00
7a7575964a Merge pull request #1883 from dolanmiu/dependabot/npm_and_yarn/eslint-8.32.0
build(deps-dev): bump eslint from 8.31.0 to 8.32.0
2023-01-18 04:22:37 +00:00
d75c833717 Merge pull request #1882 from dolanmiu/dependabot/npm_and_yarn/glob-8.1.0
build(deps-dev): bump glob from 8.0.3 to 8.1.0
2023-01-18 04:22:27 +00:00
40344b57d9 build(deps-dev): bump @typescript-eslint/parser from 5.48.1 to 5.48.2
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.48.1 to 5.48.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/v5.48.2/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-17 11:02:10 +00:00
6fc26d1da3 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.48.1 to 5.48.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/v5.48.2/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-17 11:01:49 +00:00
a012a0e418 build(deps-dev): bump eslint-plugin-import from 2.27.4 to 2.27.5
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.27.4 to 2.27.5.
- [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.4...v2.27.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-17 11:01:16 +00:00
bf1a2f3059 build(deps-dev): bump rimraf from 4.0.4 to 4.1.0
Bumps [rimraf](https://github.com/isaacs/rimraf) from 4.0.4 to 4.1.0.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/rimraf/compare/v4.0.4...v4.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-17 11:00:58 +00:00
ca316b4e6d build(deps-dev): bump prettier from 2.8.2 to 2.8.3
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.2 to 2.8.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/2.8.2...2.8.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 11:02:22 +00:00
1fb5c581c9 build(deps-dev): bump eslint from 8.31.0 to 8.32.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.31.0 to 8.32.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.31.0...v8.32.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-01-16 11:01:59 +00:00
efa64b451a build(deps-dev): bump glob from 8.0.3 to 8.1.0
Bumps [glob](https://github.com/isaacs/node-glob) from 8.0.3 to 8.1.0.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v8.0.3...v8.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 11:01:33 +00:00
38059ea6b9 Merge pull request #1879 from dolanmiu/dependabot/npm_and_yarn/rimraf-4.0.4
build(deps-dev): bump rimraf from 3.0.2 to 4.0.4
2023-01-15 20:23:37 +00:00
c2110622ca Merge pull request #1875 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-import-2.27.4
build(deps-dev): bump eslint-plugin-import from 2.26.0 to 2.27.4
2023-01-15 20:23:31 +00:00
0452959b85 build(deps-dev): bump rimraf from 3.0.2 to 4.0.4
Bumps [rimraf](https://github.com/isaacs/rimraf) from 3.0.2 to 4.0.4.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/rimraf/compare/v3.0.2...v4.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-13 11:00:53 +00:00
0eca8389b6 build(deps-dev): bump eslint-plugin-import from 2.26.0 to 2.27.4
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.26.0 to 2.27.4.
- [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.26.0...v2.27.4)

---
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>
2023-01-12 11:01:10 +00:00
66e043137b Merge pull request #1871 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.48.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.48.0 to 5.48.1
2023-01-10 18:03:32 +00:00
d684654625 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.48.0 to 5.48.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.48.1/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-10 17:44:35 +00:00
7749f6b20f Merge pull request #1872 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.48.1
build(deps-dev): bump @typescript-eslint/parser from 5.48.0 to 5.48.1
2023-01-10 17:43:48 +00:00
15c9c0ae3e build(deps-dev): bump @typescript-eslint/parser from 5.48.0 to 5.48.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.48.0 to 5.48.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.48.1/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-10 11:02:06 +00:00
74fddc2ada Merge pull request #1869 from dolanmiu/dependabot/npm_and_yarn/prettier-2.8.2
build(deps-dev): bump prettier from 2.8.1 to 2.8.2
2023-01-09 18:17:01 +00:00
cff866ecdc Merge pull request #1870 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.23.24
build(deps-dev): bump typedoc from 0.23.23 to 0.23.24
2023-01-09 18:16:54 +00:00
e952c02c83 build(deps-dev): bump typedoc from 0.23.23 to 0.23.24
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.23.23 to 0.23.24.
- [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.23.23...v0.23.24)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 11:01:20 +00:00
546983c6ba build(deps-dev): bump prettier from 2.8.1 to 2.8.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.1 to 2.8.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/2.8.1...2.8.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 11:00:50 +00:00
c7134564a3 Merge pull request #1867 from dolanmiu/dependabot/npm_and_yarn/json5-1.0.2
build(deps): bump json5 from 1.0.1 to 1.0.2
2023-01-06 16:47:05 +00:00
984a3573eb build(deps): bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-05 22:29:30 +00:00
defe94a2b2 Merge pull request #1865 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.48.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.46.1 to 5.48.0
2023-01-05 22:29:13 +00:00
e23c8c4b46 Merge pull request #1864 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.48.0
build(deps-dev): bump @typescript-eslint/parser from 5.46.1 to 5.48.0
2023-01-05 22:29:06 +00:00
7941ff487a Merge pull request #1863 from dolanmiu/dependabot/npm_and_yarn/tsconfig-paths-4.1.2
build(deps-dev): bump tsconfig-paths from 4.1.1 to 4.1.2
2023-01-05 22:28:54 +00:00
7b7df33a0f Merge pull request #1862 from dolanmiu/dependabot/npm_and_yarn/eslint-8.31.0
build(deps-dev): bump eslint from 8.30.0 to 8.31.0
2023-01-05 22:28:47 +00:00
68b04f2511 Merge pull request #1860 from dolanmiu/dependabot/npm_and_yarn/cspell-6.18.1
build(deps-dev): bump cspell from 6.17.0 to 6.18.1
2023-01-05 22:28:37 +00:00
db3e017a7d Merge pull request #1854 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.18
build(deps): bump @types/node from 18.11.17 to 18.11.18
2023-01-05 22:28:30 +00:00
c21d45a79e Merge pull request #1859 from dolanmiu/feat/more-run-props
Add more run properties and Universal measure
2023-01-05 22:28:18 +00:00
6defb686bb Remove unessesary checks for values 2023-01-05 21:39:46 +00:00
f68796dae1 build(deps): bump @types/node from 18.11.17 to 18.11.18
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.17 to 18.11.18.
- [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-01-05 14:19:14 +00:00
b1872bcb95 Merge pull request #1866 from dolanmiu/hot-fix/return-constructor-value
Fix more empty return values
2023-01-05 14:18:11 +00:00
3006f4d2c1 Version bump 2023-01-05 00:25:31 +00:00
7f88a38219 Fix more empty return values 2023-01-04 22:45:27 +00:00
aeb2487c70 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.46.1 to 5.48.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/v5.48.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>
2023-01-03 11:01:20 +00:00
e42e50dd39 build(deps-dev): bump @typescript-eslint/parser from 5.46.1 to 5.48.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.46.1 to 5.48.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.48.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-01-03 11:00:40 +00:00
f4572b9720 build(deps-dev): bump tsconfig-paths from 4.1.1 to 4.1.2
Bumps [tsconfig-paths](https://github.com/dividab/tsconfig-paths) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/dividab/tsconfig-paths/releases)
- [Changelog](https://github.com/dividab/tsconfig-paths/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dividab/tsconfig-paths/compare/v4.1.1...v4.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-02 11:01:07 +00:00
7646f3a845 build(deps-dev): bump eslint from 8.30.0 to 8.31.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.30.0 to 8.31.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.30.0...v8.31.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-01-02 11:00:57 +00:00
e4e5b1e4f6 Merge pull request #1861 from dolanmiu/hot-fix/return-constructor-value
Hot fix/return constructor value
2022-12-30 16:40:35 +00:00
a481518470 Version bump 2022-12-30 16:21:00 +00:00
2435ebf16e Correctly return value from constructor 2022-12-30 16:16:59 +00:00
414fa70e5d build(deps-dev): bump cspell from 6.17.0 to 6.18.1
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.17.0 to 6.18.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/v6.17.0...v6.18.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-30 11:00:49 +00:00
f255d4c141 Fix tests 2022-12-29 12:12:53 +00:00
4513bb529b Add more run properties and Universal measure 2022-12-29 09:57:15 +00:00
5907132062 Merge pull request #1853 from dolanmiu/feat/hyperlink-images
#1699 Allow images to work with Hyperlink
2022-12-26 15:42:02 +00:00
69bf313f18 Remove module tsconfig 2022-12-26 15:16:01 +00:00
fe8b0a6b2b #1699 Allow images to work with Hyperlink
Add stack to IContext for prepForXml
2022-12-26 15:12:44 +00:00
abcfd79f2f Merge pull request #1845 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.23.23
build(deps-dev): bump typedoc from 0.23.22 to 0.23.23
2022-12-24 21:03:07 +00:00
41e3b078ec Merge pull request #1844 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.17
build(deps): bump @types/node from 18.11.15 to 18.11.17
2022-12-24 21:03:00 +00:00
4eb2f92c1f Merge pull request #1843 from dolanmiu/dependabot/npm_and_yarn/eslint-8.30.0
build(deps-dev): bump eslint from 8.29.0 to 8.30.0
2022-12-24 21:02:53 +00:00
9bfb5bf681 Merge pull request #1852 from dolanmiu/feat/positional-tab
#940 - Add positional tab feature
2022-12-24 21:02:44 +00:00
473ad2947c Remove demo 2022-12-24 20:30:35 +00:00
ee28f6ad84 Revert demo 75 2022-12-24 19:49:13 +00:00
11bebd42ac #940 - Add positional tab feature
Also add extra run elements as per spec
2022-12-24 19:32:44 +00:00
49b4ca67e0 Merge pull request #1848 from dolanmiu/feat/refactoring
Different Language support
2022-12-21 04:38:38 +00:00
3282f762df Add language support 2022-12-20 21:42:26 +00:00
d335106b46 build(deps-dev): bump typedoc from 0.23.22 to 0.23.23
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.23.22 to 0.23.23.
- [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.23.22...v0.23.23)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 11:01:42 +00:00
cefa01f7ec build(deps): bump @types/node from 18.11.15 to 18.11.17
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.15 to 18.11.17.
- [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>
2022-12-19 11:01:19 +00:00
b7ba2b3306 build(deps-dev): bump eslint from 8.29.0 to 8.30.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.29.0 to 8.30.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.29.0...v8.30.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 11:00:46 +00:00
03d5152e7c Add BuilderElement and lang 2022-12-18 00:52:29 +00:00
af3b7f2613 Remove unused method 2022-12-17 19:39:27 +00:00
1405841565 Merge pull request #1839 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.46.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.46.0 to 5.46.1
2022-12-16 23:39:45 +00:00
211d2dc0d6 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.46.0 to 5.46.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.46.1/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-16 16:21:09 +00:00
82f431465f Merge pull request #1841 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.15
build(deps): bump @types/node from 18.11.13 to 18.11.15
2022-12-16 16:20:12 +00:00
247afe56ce Merge pull request #1838 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.46.1
build(deps-dev): bump @typescript-eslint/parser from 5.46.0 to 5.46.1
2022-12-16 16:19:53 +00:00
91e874eee5 Merge pull request #1837 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-unicorn-45.0.2
build(deps-dev): bump eslint-plugin-unicorn from 45.0.1 to 45.0.2
2022-12-16 16:19:46 +00:00
ff67c3660b Merge pull request #1842 from dolanmiu/dependabot/npm_and_yarn/sinon-15.0.1
build(deps-dev): bump sinon from 15.0.0 to 15.0.1
2022-12-16 16:19:35 +00:00
58c580b9ca build(deps-dev): bump sinon from 15.0.0 to 15.0.1
Bumps [sinon](https://github.com/sinonjs/sinon) from 15.0.0 to 15.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v15.0.0...v15.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-16 11:01:13 +00:00
a9da151026 Add examples for continuous headers
Add different headers for different sections
2022-12-16 00:27:04 +00:00
83c72d0dbb build(deps): bump @types/node from 18.11.13 to 18.11.15
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.13 to 18.11.15.
- [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>
2022-12-14 11:01:06 +00:00
2c31367851 build(deps-dev): bump @typescript-eslint/parser from 5.46.0 to 5.46.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.46.0 to 5.46.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.46.1/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-13 11:01:16 +00:00
3b618f3a2c build(deps-dev): bump eslint-plugin-unicorn from 45.0.1 to 45.0.2
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 45.0.1 to 45.0.2.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v45.0.1...v45.0.2)

---
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>
2022-12-13 11:00:47 +00:00
4c5bc6232d Merge pull request #1834 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.23.22
build(deps-dev): bump typedoc from 0.23.21 to 0.23.22
2022-12-12 11:14:53 +00:00
694835bdac Merge pull request #1835 from dolanmiu/dependabot/npm_and_yarn/mocha-10.2.0
build(deps-dev): bump mocha from 10.1.0 to 10.2.0
2022-12-12 11:14:46 +00:00
c8b75c19da Merge pull request #1836 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.13
build(deps): bump @types/node from 18.11.12 to 18.11.13
2022-12-12 11:12:18 +00:00
c0181aa83a build(deps): bump @types/node from 18.11.12 to 18.11.13
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.12 to 18.11.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 11:01:25 +00:00
c5b615ae2a build(deps-dev): bump mocha from 10.1.0 to 10.2.0
Bumps [mocha](https://github.com/mochajs/mocha) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.1.0...v10.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 11:01:04 +00:00
54cbd56f42 build(deps-dev): bump typedoc from 0.23.21 to 0.23.22
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.23.21 to 0.23.22.
- [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.23.21...v0.23.22)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 11:00:46 +00:00
c8914a109e Merge pull request #1823 from anti-the-social/overrideLevels-impl
Override levels impl
2022-12-10 23:15:39 +00:00
62d0767ceb Version bump 2022-12-10 15:43:26 +00:00
8509bccc4f Fix comment tests to support testing in different time zones 2022-12-10 13:06:22 +02:00
4ce53a3d76 Fix failing test 2022-12-10 12:47:48 +02:00
8024c01a82 Merge pull request #1831 from dolanmiu/dependabot/npm_and_yarn/qs-6.5.3
build(deps): bump qs from 6.5.2 to 6.5.3
2022-12-10 01:35:59 +00:00
1b380c3fdb Merge pull request #1825 from dolanmiu/dependabot/npm_and_yarn/prettier-2.8.1
build(deps-dev): bump prettier from 2.8.0 to 2.8.1
2022-12-10 00:13:12 +00:00
06b67bd292 build(deps): bump qs from 6.5.2 to 6.5.3
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-10 00:12:40 +00:00
8a1087f601 Merge pull request #1824 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.46.0
build(deps-dev): bump @typescript-eslint/parser from 5.45.1 to 5.46.0
2022-12-10 00:12:37 +00:00
ff09d6515c Merge pull request #1826 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.46.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.45.1 to 5.46.0
2022-12-10 00:12:29 +00:00
ebe85d8e14 Merge pull request #1827 from dolanmiu/dependabot/npm_and_yarn/typescript-4.9.4
build(deps-dev): bump typescript from 4.9.3 to 4.9.4
2022-12-10 00:12:20 +00:00
5dc27ac46a Merge pull request #1828 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.12
build(deps): bump @types/node from 18.11.11 to 18.11.12
2022-12-10 00:12:11 +00:00
1dcc8ee761 Merge pull request #1830 from dolanmiu/feat/optional-background
Optional background property
2022-12-10 00:12:01 +00:00
ec69f9ac07 Downgrade nanoid 2022-12-09 21:56:50 +00:00
f789f60e22 Optional background property 2022-12-09 21:07:08 +00:00
32e3f07d57 build(deps): bump @types/node from 18.11.11 to 18.11.12
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.11 to 18.11.12.
- [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>
2022-12-09 11:01:11 +00:00
9ea41ab3ce build(deps-dev): bump typescript from 4.9.3 to 4.9.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.3 to 4.9.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.9.3...v4.9.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 11:02:37 +00:00
4b8d062862 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.45.1 to 5.46.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/v5.46.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>
2022-12-08 11:02:17 +00:00
d9408029f3 build(deps-dev): bump prettier from 2.8.0 to 2.8.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 11:01:36 +00:00
9fe0406078 build(deps-dev): bump @typescript-eslint/parser from 5.45.1 to 5.46.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.45.1 to 5.46.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.46.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>
2022-12-08 11:01:18 +00:00
5a4fe5d5da Formatting applied 2022-12-07 23:03:42 +02:00
e6af9b4b73 fix for tests && new tests for multi-level cases 2022-12-07 22:55:15 +02:00
361f9231d8 default numbering with overrideLevels 2022-12-07 22:54:51 +02:00
4215932550 overrideLevels as array impl instead of overrideLevel 2022-12-07 22:54:26 +02:00
29da523579 Interface (overrideLevel -> overrideLevels)
Breaking change
2022-12-07 22:11:34 +02:00
fbb4d7cfde Merge pull request #9 from dolanmiu/master
Upd to latest version of docx js
2022-12-07 21:58:14 +02:00
3ea453a07f Merge pull request #1822 from dolanmiu/feat/underline-none
#1807 Add underline none
2022-12-06 23:51:05 +00:00
984e762a53 Fix test 2022-12-06 23:42:22 +00:00
1592aa7117 Add underline none
Add space options for Text
2022-12-06 22:04:30 +00:00
62b4522c94 Merge pull request #1819 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.45.1
build(deps-dev): bump @typescript-eslint/parser from 5.45.0 to 5.45.1
2022-12-06 13:53:02 +00:00
8b86751c95 build(deps-dev): bump @typescript-eslint/parser from 5.45.0 to 5.45.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.45.0 to 5.45.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.45.1/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 13:19:01 +00:00
afa380e336 Merge pull request #1818 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.11
build(deps): bump @types/node from 18.11.10 to 18.11.11
2022-12-06 13:18:20 +00:00
feebff9077 Merge pull request #1816 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.45.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.45.0 to 5.45.1
2022-12-06 13:18:13 +00:00
028b50ff99 Merge pull request #1815 from dolanmiu/dependabot/npm_and_yarn/cspell-6.17.0
build(deps-dev): bump cspell from 6.16.0 to 6.17.0
2022-12-06 13:18:03 +00:00
559e81c3fe Merge pull request #1817 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-5.0.1
build(deps-dev): bump webpack-cli from 5.0.0 to 5.0.1
2022-12-06 13:17:55 +00:00
4da6b98437 build(deps): bump @types/node from 18.11.10 to 18.11.11
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.10 to 18.11.11.
- [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>
2022-12-06 11:03:55 +00:00
5b2409c76f build(deps-dev): bump webpack-cli from 5.0.0 to 5.0.1
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@5.0.0...webpack-cli@5.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 11:03:32 +00:00
ff027d172e 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.45.0 to 5.45.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.45.1/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 11:03:20 +00:00
3f23290a46 build(deps-dev): bump cspell from 6.16.0 to 6.17.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.16.0 to 6.17.0.
- [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.16.0...v6.17.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 11:02:53 +00:00
f1a10d32e6 Merge pull request #1813 from dolanmiu/dependabot/npm_and_yarn/cspell-6.16.0
build(deps-dev): bump cspell from 6.15.1 to 6.16.0
2022-12-05 17:14:33 +00:00
a71f40e873 Merge pull request #1810 from dolanmiu/dependabot/npm_and_yarn/tsconfig-paths-4.1.1
build(deps-dev): bump tsconfig-paths from 4.1.0 to 4.1.1
2022-12-05 17:14:27 +00:00
7f449319cd Merge pull request #1809 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.10
build(deps): bump @types/node from 18.11.9 to 18.11.10
2022-12-05 17:14:20 +00:00
ab5c8ea698 Merge pull request #1814 from dolanmiu/dependabot/npm_and_yarn/eslint-8.29.0
build(deps-dev): bump eslint from 8.28.0 to 8.29.0
2022-12-05 17:14:12 +00:00
68cfa9360b build(deps-dev): bump eslint from 8.28.0 to 8.29.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.28.0 to 8.29.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.28.0...v8.29.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 11:01:36 +00:00
f627e3d994 build(deps-dev): bump cspell from 6.15.1 to 6.16.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.15.1 to 6.16.0.
- [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.15.1...v6.16.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 11:01:06 +00:00
7c870548d9 Merge pull request #1811 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.4.2
build(deps-dev): bump ts-loader from 9.4.1 to 9.4.2
2022-12-02 14:34:36 +00:00
57ccc41547 Merge pull request #1812 from dolanmiu/dependabot/npm_and_yarn/cspell-6.15.1
build(deps-dev): bump cspell from 6.15.0 to 6.15.1
2022-12-02 14:34:25 +00:00
988ba45197 build(deps-dev): bump cspell from 6.15.0 to 6.15.1
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.15.0 to 6.15.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/v6.15.0...v6.15.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 11:02:12 +00:00
df6606041b build(deps-dev): bump ts-loader from 9.4.1 to 9.4.2
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.4.1 to 9.4.2.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/9.4.1...v9.4.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 11:01:53 +00:00
3ae27b466f build(deps-dev): bump tsconfig-paths from 4.1.0 to 4.1.1
Bumps [tsconfig-paths](https://github.com/dividab/tsconfig-paths) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/dividab/tsconfig-paths/releases)
- [Changelog](https://github.com/dividab/tsconfig-paths/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dividab/tsconfig-paths/compare/v4.1.0...v4.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 11:01:25 +00:00
69f5e21435 build(deps): bump @types/node from 18.11.9 to 18.11.10
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.9 to 18.11.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 11:01:05 +00:00
6da73c612a Add demo for thai distributed 2022-11-30 03:54:01 +00:00
e1b1c1492f Merge pull request #1803 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.45.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.44.0 to 5.45.0
2022-11-30 01:47:32 +00:00
6ca13c4fce Merge pull request #1802 from dolanmiu/dependabot/npm_and_yarn/types/mocha-10.0.1
build(deps-dev): bump @types/mocha from 10.0.0 to 10.0.1
2022-11-30 01:47:24 +00:00
b474567d20 Merge pull request #1801 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.45.0
build(deps-dev): bump @typescript-eslint/parser from 5.44.0 to 5.45.0
2022-11-30 01:47:13 +00:00
c07170902e Merge pull request #1804 from dolanmiu/dependabot/npm_and_yarn/sinon-15.0.0
build(deps-dev): bump sinon from 14.0.2 to 15.0.0
2022-11-30 01:47:04 +00:00
0f201d2f4b Update README.md 2022-11-29 19:29:32 +00:00
b875d6f183 build(deps-dev): bump sinon from 14.0.2 to 15.0.0
Bumps [sinon](https://github.com/sinonjs/sinon) from 14.0.2 to 15.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v14.0.2...v15.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 11:02:17 +00:00
831b92239d 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.44.0 to 5.45.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/v5.45.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>
2022-11-29 11:01:30 +00:00
66b91c22dd build(deps-dev): bump @types/mocha from 10.0.0 to 10.0.1
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 11:01:14 +00:00
1242c0689f build(deps-dev): bump @typescript-eslint/parser from 5.44.0 to 5.45.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.44.0 to 5.45.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.45.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>
2022-11-29 11:01:01 +00:00
4386d02526 Merge pull request #1799 from dolanmiu/dependabot/npm_and_yarn/cspell-6.15.0
build(deps-dev): bump cspell from 6.14.3 to 6.15.0
2022-11-29 10:32:39 +00:00
3ba521f8cc Merge pull request #1800 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-unicorn-45.0.1
build(deps-dev): bump eslint-plugin-unicorn from 45.0.0 to 45.0.1
2022-11-29 10:32:30 +00:00
85bb818ae6 build(deps-dev): bump eslint-plugin-unicorn from 45.0.0 to 45.0.1
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 45.0.0 to 45.0.1.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v45.0.0...v45.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>
2022-11-28 11:01:03 +00:00
be7e2aa8fe build(deps-dev): bump cspell from 6.14.3 to 6.15.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.14.3 to 6.15.0.
- [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.14.3...v6.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 11:00:50 +00:00
7f71f6e3f1 Add demo for data source for tables 2022-11-26 20:32:32 +00:00
a94d23e2ae Add default npmrc 2022-11-26 19:33:58 +00:00
133c255ce2 Merge pull request #1798 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.6.4
build(deps-dev): bump eslint-plugin-jsdoc from 39.6.2 to 39.6.4
2022-11-25 11:11:26 +00:00
863e27ff9b build(deps-dev): bump eslint-plugin-jsdoc from 39.6.2 to 39.6.4
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.6.2 to 39.6.4.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v39.6.2...v39.6.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>
2022-11-25 11:00:50 +00:00
5c63e6ae12 Merge pull request #1797 from dolanmiu/feat/new-levels
#212 Add more levels support
2022-11-25 01:48:30 +00:00
10dd36569d #212 Add more levels support 2022-11-25 01:36:59 +00:00
be5985fb6a Merge pull request #1795 from dolanmiu/dependabot/npm_and_yarn/prettier-2.8.0
build(deps-dev): bump prettier from 2.7.1 to 2.8.0
2022-11-23 20:17:39 +00:00
0d7f169613 build(deps-dev): bump prettier from 2.7.1 to 2.8.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 to 2.8.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.7.1...2.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-23 11:01:16 +00:00
eaddcb83ab Merge pull request #1792 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.44.0
build(deps-dev): bump @typescript-eslint/parser from 5.43.0 to 5.44.0
2022-11-23 01:00:45 +00:00
9a6885f124 Add Thai Distributed demo 2022-11-23 00:36:54 +00:00
7284ee818b build(deps-dev): bump @typescript-eslint/parser from 5.43.0 to 5.44.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.43.0 to 5.44.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.44.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>
2022-11-22 23:51:30 +00:00
20964454c4 Merge pull request #1793 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.44.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.43.0 to 5.44.0
2022-11-22 23:50:51 +00:00
d7670929d1 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.43.0 to 5.44.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/v5.44.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>
2022-11-22 11:02:02 +00:00
58f0761423 Merge pull request #1790 from dolanmiu/dependabot/npm_and_yarn/eslint-8.28.0
build(deps-dev): bump eslint from 8.27.0 to 8.28.0
2022-11-21 23:26:13 +00:00
3f28bc09bc Merge pull request #1791 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-unicorn-45.0.0
build(deps-dev): bump eslint-plugin-unicorn from 44.0.2 to 45.0.0
2022-11-21 23:26:02 +00:00
323895f0ab Merge remote-tracking branch 'upstream/master' 2022-11-21 21:25:36 +02:00
6efa734e81 build(deps-dev): bump eslint-plugin-unicorn from 44.0.2 to 45.0.0
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 44.0.2 to 45.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v44.0.2...v45.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>
2022-11-21 11:01:31 +00:00
47d64af737 build(deps-dev): bump eslint from 8.27.0 to 8.28.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.27.0 to 8.28.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.27.0...v8.28.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 11:00:53 +00:00
4a2b91ce07 Update sidebar for docs 2022-11-19 22:16:04 +00:00
080a77cc73 Merge pull request #1787 from dolanmiu/feat/more-alignment-options
#1784 Add more alignment options according to spec
2022-11-19 22:08:12 +00:00
9b874b0061 #1784 Add more alignment options according to spec 2022-11-19 20:14:15 +00:00
ff8a2ed538 Merge pull request #1785 from dolanmiu/feat/exact
#1773 Add `exact` for spacing
2022-11-19 16:24:07 +00:00
251eafe103 #1773 Add exact for spacing 2022-11-19 15:51:41 +00:00
64b604c9ac Merge pull request #1782 from dolanmiu/dependabot/npm_and_yarn/cspell-6.14.3
build(deps-dev): bump cspell from 6.14.2 to 6.14.3
2022-11-18 17:11:29 +00:00
72fc5f9874 Merge pull request #1783 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-5.0.0
build(deps-dev): bump webpack-cli from 4.10.0 to 5.0.0
2022-11-18 17:11:22 +00:00
71dcdf0ca2 build(deps-dev): bump webpack-cli from 4.10.0 to 5.0.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.10.0 to 5.0.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.10.0...webpack-cli@5.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 11:02:49 +00:00
e23fc987a7 build(deps-dev): bump cspell from 6.14.2 to 6.14.3
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.14.2 to 6.14.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/v6.14.2...v6.14.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 11:01:56 +00:00
36dba1a36f Merge pull request #1781 from dolanmiu/dependabot/npm_and_yarn/typescript-4.9.3
build(deps-dev): bump typescript from 4.8.4 to 4.9.3
2022-11-17 00:39:57 +00:00
1b1547d4b6 build(deps-dev): bump typescript from 4.8.4 to 4.9.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.8.4 to 4.9.3.
- [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-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-16 11:01:25 +00:00
8008482592 Version bump 2022-11-15 21:15:57 +00:00
6d1a7fe438 Merge pull request #1778 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.43.0
build(deps-dev): bump @typescript-eslint/parser from 5.42.1 to 5.43.0
2022-11-15 11:40:04 +00:00
90c58b0498 Merge pull request #1777 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.43.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.42.1 to 5.43.0
2022-11-15 11:39:57 +00:00
c91bb71700 build(deps-dev): bump @typescript-eslint/parser from 5.42.1 to 5.43.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.42.1 to 5.43.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.43.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>
2022-11-15 11:01:20 +00:00
3d09c45205 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.42.1 to 5.43.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/v5.43.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>
2022-11-15 11:01:05 +00:00
f1e41d883c Merge pull request #1776 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.23.21
build(deps-dev): bump typedoc from 0.23.20 to 0.23.21
2022-11-14 14:58:03 +00:00
4f783ec8e4 build(deps-dev): bump typedoc from 0.23.20 to 0.23.21
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.23.20 to 0.23.21.
- [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.23.20...v0.23.21)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-14 11:00:55 +00:00
3d35e84953 Merge pull request #1772 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.42.1
build(deps-dev): bump @typescript-eslint/parser from 5.42.0 to 5.42.1
2022-11-11 11:42:35 +00:00
e80bc8b584 Merge pull request #1775 from dolanmiu/dependabot/npm_and_yarn/cspell-6.14.2
build(deps-dev): bump cspell from 6.13.3 to 6.14.2
2022-11-11 11:39:31 +00:00
2848b39479 build(deps-dev): bump @typescript-eslint/parser from 5.42.0 to 5.42.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.42.0 to 5.42.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.42.1/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 11:24:53 +00:00
7ee9be200c Merge pull request #1771 from dolanmiu/dependabot/npm_and_yarn/sinon-14.0.2
build(deps-dev): bump sinon from 14.0.1 to 14.0.2
2022-11-11 11:22:48 +00:00
94cdd740ad Merge pull request #1770 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.42.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.42.0 to 5.42.1
2022-11-11 11:22:33 +00:00
9130687164 Merge pull request #1769 from dolanmiu/dependabot/npm_and_yarn/chai-4.3.7
build(deps-dev): bump chai from 4.3.6 to 4.3.7
2022-11-11 11:22:23 +00:00
2f52f47463 build(deps-dev): bump cspell from 6.13.3 to 6.14.2
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.13.3 to 6.14.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/v6.13.3...v6.14.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 11:01:36 +00:00
01866f4802 build(deps-dev): bump chai from 4.3.6 to 4.3.7
Bumps [chai](https://github.com/chaijs/chai) from 4.3.6 to 4.3.7.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/4.x.x/History.md)
- [Commits](https://github.com/chaijs/chai/compare/v4.3.6...v4.3.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 17:34:14 +00:00
fa8ac0f2e4 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.42.0 to 5.42.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.42.1/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 17:31:07 +00:00
e9a909ed20 build(deps-dev): bump sinon from 14.0.1 to 14.0.2
Bumps [sinon](https://github.com/sinonjs/sinon) from 14.0.1 to 14.0.2.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v14.0.1...v14.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 17:31:01 +00:00
8808447963 Merge pull request #1768 from dolanmiu/dependabot/npm_and_yarn/eslint-8.27.0
build(deps-dev): bump eslint from 8.26.0 to 8.27.0
2022-11-10 17:29:56 +00:00
056b496189 build(deps-dev): bump eslint from 8.26.0 to 8.27.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.26.0 to 8.27.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.26.0...v8.27.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 16:47:03 +00:00
11b374ea75 Merge pull request #1774 from dolanmiu/dependabot/npm_and_yarn/webpack-5.75.0
build(deps-dev): bump webpack from 5.74.0 to 5.75.0
2022-11-10 16:45:49 +00:00
f8f9744786 build(deps-dev): bump webpack from 5.74.0 to 5.75.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.74.0 to 5.75.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.74.0...v5.75.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 11:01:00 +00:00
6f6888d638 #1413 - Add side by side table demo 2022-11-04 00:30:12 +00:00
995430b76f Merge pull request #1762 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.6.2
build(deps-dev): bump eslint-plugin-jsdoc from 39.5.0 to 39.6.2
2022-11-03 12:44:53 +00:00
d4a5ec4e14 Merge pull request #1763 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.23.20
build(deps-dev): bump typedoc from 0.23.19 to 0.23.20
2022-11-03 12:44:46 +00:00
c7dce059f8 build(deps-dev): bump typedoc from 0.23.19 to 0.23.20
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.23.19 to 0.23.20.
- [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.23.19...v0.23.20)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-03 11:01:11 +00:00
2f4e3f2153 build(deps-dev): bump eslint-plugin-jsdoc from 39.5.0 to 39.6.2
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.5.0 to 39.6.2.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v39.5.0...v39.6.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>
2022-11-03 11:00:46 +00:00
a37c5646b6 Merge pull request #1760 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.5.0
build(deps-dev): bump eslint-plugin-jsdoc from 39.4.0 to 39.5.0
2022-11-03 01:54:01 +00:00
ddc9c8f62f Merge pull request #1761 from dolanmiu/feat/add-scale
#1507 - Add scale for run
2022-11-03 01:47:27 +00:00
1b06fc71cf #1507 - Add scale for run 2022-11-03 00:30:16 +00:00
e65a3bfeab build(deps-dev): bump eslint-plugin-jsdoc from 39.4.0 to 39.5.0
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.4.0 to 39.5.0.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v39.4.0...v39.5.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>
2022-11-02 11:27:08 +00:00
b9ceabcc07 Merge pull request #1750 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.4.0
build(deps-dev): bump eslint-plugin-jsdoc from 39.3.25 to 39.4.0
2022-11-02 02:39:37 +00:00
35be3bfb9b Merge pull request #1755 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.42.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.41.0 to 5.42.0
2022-11-02 02:39:31 +00:00
572c8efbc7 Merge pull request #1756 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.42.0
build(deps-dev): bump @typescript-eslint/parser from 5.41.0 to 5.42.0
2022-11-02 02:39:24 +00:00
b1b3e2369b Merge pull request #1757 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.9
build(deps): bump @types/node from 18.11.7 to 18.11.9
2022-11-02 02:39:17 +00:00
dc72bb629e Merge pull request #1758 from dolanmiu/dependabot/npm_and_yarn/cspell-6.13.3
build(deps-dev): bump cspell from 6.13.1 to 6.13.3
2022-11-02 02:39:09 +00:00
a724706817 build(deps-dev): bump cspell from 6.13.1 to 6.13.3
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.13.1 to 6.13.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/v6.13.1...v6.13.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 11:02:16 +00:00
84989116ef build(deps): bump @types/node from 18.11.7 to 18.11.9
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.7 to 18.11.9.
- [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>
2022-11-01 11:01:54 +00:00
6c4efe4a1c build(deps-dev): bump @typescript-eslint/parser from 5.41.0 to 5.42.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.41.0 to 5.42.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.42.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>
2022-11-01 11:01:41 +00:00
8596d70b79 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.41.0 to 5.42.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/v5.42.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>
2022-11-01 11:01:27 +00:00
db6c9b2700 build(deps-dev): bump eslint-plugin-jsdoc from 39.3.25 to 39.4.0
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.3.25 to 39.4.0.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v39.3.25...v39.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>
2022-10-31 11:00:53 +00:00
a33602ccf6 Merge pull request #1749 from dolanmiu/feat/compatibility
#1126 - Add all comptability options
2022-10-30 18:14:35 +00:00
988987ddbe #1126 - Add all comptability options 2022-10-29 15:10:02 +01:00
309e66a6de Merge pull request #1748 from dolanmiu/feat/clean-up
Move SpaceType to shared
2022-10-29 04:21:57 +01:00
7d8cfc0382 Move SpaceType to shared 2022-10-29 03:10:29 +01:00
5cbae5d3f7 Merge pull request #1746 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.23.19
build(deps-dev): bump typedoc from 0.23.18 to 0.23.19
2022-10-28 23:18:44 +01:00
9b630c4ef7 Merge pull request #1745 from dolanmiu/dependabot/npm_and_yarn/cspell-6.13.1
build(deps-dev): bump cspell from 6.12.0 to 6.13.1
2022-10-28 23:14:18 +01:00
befcbabe27 Merge pull request #1747 from dolanmiu/feat/vanish
#1744 - Add `vanish` and `specVanish`
2022-10-28 22:46:08 +01:00
4cfb0ade88 #1744 - Add vanish and specVanish 2022-10-28 22:20:16 +01:00
a6f528537b build(deps-dev): bump typedoc from 0.23.18 to 0.23.19
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.23.18 to 0.23.19.
- [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.23.18...v0.23.19)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-28 11:01:56 +00:00
dfc82a517d build(deps-dev): bump cspell from 6.12.0 to 6.13.1
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.12.0 to 6.13.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/v6.12.0...v6.13.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-28 11:01:44 +00:00
29f421686f Merge pull request #1743 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.7
build(deps): bump @types/node from 18.11.5 to 18.11.7
2022-10-28 03:07:46 +01:00
c11299076f build(deps): bump @types/node from 18.11.5 to 18.11.7
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.5 to 18.11.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-27 11:01:05 +00:00
1cb2ef565e Increase coverage threshold 2022-10-27 02:01:14 +01:00
2de07d04a8 Merge pull request #1742 from dolanmiu/feat/tab-feature
#1281 - Tab feature
2022-10-27 00:38:25 +01:00
75e064dd1d #1281 - Tab feature 2022-10-27 00:17:02 +01:00
5f0091ee25 Merge pull request #1741 from dolanmiu/feat/alt-text
#756 Adding alt text feature
2022-10-26 23:56:10 +01:00
d2c0e656d0 Add tests 2022-10-26 23:43:51 +01:00
522b21862b #756 Adding alt text feature 2022-10-26 23:09:36 +01:00
ccf66dbd50 Merge pull request #1734 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.41.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.40.1 to 5.41.0
2022-10-26 10:28:57 +01:00
6e30ab0355 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.40.1 to 5.41.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/v5.41.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>
2022-10-25 21:25:52 +00:00
568c764e3c Merge pull request #1729 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.23.18
build(deps-dev): bump typedoc from 0.23.15 to 0.23.18
2022-10-25 22:25:02 +01:00
d508e8ae31 Merge pull request #1730 from dolanmiu/dependabot/npm_and_yarn/eslint-8.26.0
build(deps-dev): bump eslint from 8.25.0 to 8.26.0
2022-10-25 22:24:56 +01:00
ded346e34a Merge pull request #1733 from dolanmiu/dependabot/npm_and_yarn/types/chai-4.3.3
build(deps-dev): bump @types/chai from 4.3.1 to 4.3.3
2022-10-25 22:24:47 +01:00
edb8eddce1 Merge pull request #1735 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.41.0
build(deps-dev): bump @typescript-eslint/parser from 5.40.1 to 5.41.0
2022-10-25 22:24:35 +01:00
abd3641da4 build(deps-dev): bump eslint from 8.25.0 to 8.26.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.25.0 to 8.26.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.25.0...v8.26.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 21:01:04 +00:00
7e1165d012 Merge pull request #1737 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.5
build(deps): bump @types/node from 18.11.2 to 18.11.5
2022-10-25 22:00:44 +01:00
461754e591 build(deps-dev): bump typedoc from 0.23.15 to 0.23.18
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.23.15 to 0.23.18.
- [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.23.15...v0.23.18)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 21:00:39 +00:00
e649330dbc build(deps-dev): bump @types/chai from 4.3.1 to 4.3.3
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.3.1 to 4.3.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 21:00:27 +00:00
baec324811 build(deps-dev): bump @typescript-eslint/parser from 5.40.1 to 5.41.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.40.1 to 5.41.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.41.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>
2022-10-25 21:00:10 +00:00
91c430d9e2 Merge pull request #1739 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-jsdoc-39.3.25
build(deps-dev): bump eslint-plugin-jsdoc from 39.3.6 to 39.3.25
2022-10-25 21:59:32 +01:00
efd853d519 Merge pull request #1725 from kkocdko/patch-1
Change `globalObject` to `globalThis`
2022-10-25 21:58:07 +01:00
f717b0eae4 build(deps-dev): bump eslint-plugin-jsdoc from 39.3.6 to 39.3.25
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 39.3.6 to 39.3.25.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v39.3.6...v39.3.25)

---
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>
2022-10-25 20:44:04 +00:00
d76d21a1f2 build(deps): bump @types/node from 18.11.2 to 18.11.5
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.2 to 18.11.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-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 20:43:47 +00:00
712450d717 Character style example for underline and strike 2022-10-25 21:29:22 +01:00
b9d93c9d33 Fix declarative styles example 2022-10-25 21:03:59 +01:00
c7ca51cd65 Merge pull request #1738 from dolanmiu/feat/word-wrap
#1529 - Word wrap feature
2022-10-25 20:51:45 +01:00
20b793620a #1720 - Update demo 2 to show underline and strike used together 2022-10-25 19:03:48 +01:00
9bed303d34 #1529 - Word wrap feature 2022-10-25 18:53:00 +01:00
f4ed171f85 Fix demos 2022-10-25 01:13:44 +01:00
8a3ccdb196 Upgrade chai to 4.x 2022-10-25 01:08:54 +01:00
41765d133f Merge pull request #1722 from dolanmiu/dependabot/npm_and_yarn/mocha-10.1.0
build(deps-dev): bump mocha from 10.0.0 to 10.1.0
2022-10-24 23:40:42 +01:00
482ea1b186 Change globalObject to globalThis 2022-10-21 15:40:54 +08:00
3bba7f9d23 build(deps-dev): bump mocha from 10.0.0 to 10.1.0
Bumps [mocha](https://github.com/mochajs/mocha) from 10.0.0 to 10.1.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.0.0...v10.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-20 11:04:03 +00:00
7e5e2baf92 Version bump 2022-10-19 21:21:33 +01:00
53c70e6cd1 Merge pull request #1718 from codecnmc/patch-1
Update numbering.md
2022-10-19 20:26:21 +01:00
4bfb87ea74 Merge pull request #1716 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.40.1
build(deps-dev): bump @typescript-eslint/parser from 5.38.1 to 5.40.1
2022-10-19 20:25:47 +01:00
86e12c7d40 Merge pull request #1715 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.40.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.38.1 to 5.40.1
2022-10-19 20:25:40 +01:00
eb5449adf8 build(deps-dev): bump @typescript-eslint/parser from 5.38.1 to 5.40.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.38.1 to 5.40.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.40.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>
2022-10-19 19:13:25 +00:00
19eeec9fc8 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.38.1 to 5.40.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.40.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>
2022-10-19 19:13:20 +00:00
449f5f5be3 Merge pull request #1719 from dolanmiu/dependabot/npm_and_yarn/types/node-18.11.2
build(deps): bump @types/node from 18.7.23 to 18.11.2
2022-10-19 20:12:01 +01:00
bc5a1b52b7 Merge pull request #1702 from dolanmiu/dependabot/npm_and_yarn/eslint-8.25.0
build(deps-dev): bump eslint from 8.24.0 to 8.25.0
2022-10-19 20:11:53 +01:00
fc7f37767f Merge pull request #1697 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-unicorn-44.0.2
build(deps-dev): bump eslint-plugin-unicorn from 44.0.0 to 44.0.2
2022-10-19 20:11:45 +01:00
38dbdd02ae Merge pull request #1692 from dolanmiu/dependabot/npm_and_yarn/sinon-14.0.1
build(deps-dev): bump sinon from 14.0.0 to 14.0.1
2022-10-19 20:11:40 +01:00
7bb3fa74ce Merge pull request #1691 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-functional-4.4.1
build(deps-dev): bump eslint-plugin-functional from 4.4.0 to 4.4.1
2022-10-19 20:11:35 +01:00
a33660d32c Merge pull request #1686 from dolanmiu/dependabot/npm_and_yarn/types/prompt-1.1.4
build(deps-dev): bump @types/prompt from 1.1.3 to 1.1.4
2022-10-19 20:11:28 +01:00
ef842d1f3f Merge pull request #1709 from ronram5126/master
FIX: multiple tabStop support for LibreWriter
2022-10-19 20:11:03 +01:00
e5c2a0a87b Fix linting and spelling 2022-10-19 19:58:46 +01:00
817ffe8fd0 build(deps): bump @types/node from 18.7.23 to 18.11.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.7.23 to 18.11.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>
2022-10-19 11:01:41 +00:00
5b582d45ba Update numbering.md
Long time to find a way to unident ,See the document can't resolve my problem,Source code analysis found that does not belong to the indent.
2022-10-19 17:35:46 +08:00
6a303532f4 DEMO: 75-tab-stops.ts added missing \t 2022-10-17 14:56:12 +05:45
c75abb7cb9 DEMO: added demo/75-tab-stops.ts 2022-10-17 14:49:32 +05:45
8282d76b87 Merge branch 'dolanmiu:master' into master 2022-10-17 14:25:48 +05:45
79f3866c4c Merge pull request #1700 from tvale1/master
Add MathIntegral class
2022-10-16 00:54:57 +01:00
6dcf3f25e9 Fix test 2022-10-16 00:44:40 +01:00
e80acea63f Add more MathIntegral tests 2022-10-16 00:38:02 +01:00
640639264d Add MathIntegral tests 2022-10-16 00:33:44 +01:00
3ccdd2585c Fix prettier and linting 2022-10-16 00:29:16 +01:00
2c4b55c692 Refactor code to simplify interface 2022-10-16 00:21:34 +01:00
70a3b25d54 Fix Prettier errors 2022-10-16 00:20:16 +01:00
d053baef03 FIX: added legacy support for TabStop 2022-10-14 17:01:41 +05:45
629c586014 FIX: multiple tabStop support for LibreWriter 2022-10-14 16:38:02 +05:45
32a5cca878 Upd version, include security fix into package 2022-10-14 11:45:53 +03:00
911c705b59 Security fix via npm audit 2022-10-14 11:42:59 +03:00
594c8d72b8 Upd nanoid to v4 2022-10-14 11:09:51 +03:00
7ea5232b22 Changing name&version 2022-10-14 11:05:46 +03:00
be12d61795 Merge remote-tracking branch 'upstream/master' 2022-10-13 13:00:55 +03:00
925340eb3d Adjusting name and version for publishing (old one) 2022-10-13 11:45:21 +03:00
e4b03b3f71 build(deps-dev): bump eslint from 8.24.0 to 8.25.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.24.0 to 8.25.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.24.0...v8.25.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 11:02:11 +00:00
9ab6df99b1 Add MathIntegral class 2022-10-08 12:56:35 +11:00
51519a55ef build(deps-dev): bump eslint-plugin-unicorn from 44.0.0 to 44.0.2
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 44.0.0 to 44.0.2.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v44.0.0...v44.0.2)

---
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>
2022-10-07 11:00:58 +00:00
059455929b Merge pull request #1685 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-unicorn-44.0.0
build(deps-dev): bump eslint-plugin-unicorn from 43.0.2 to 44.0.0
2022-10-04 15:24:15 +01:00
8a1df4438e build(deps-dev): bump sinon from 14.0.0 to 14.0.1
Bumps [sinon](https://github.com/sinonjs/sinon) from 14.0.0 to 14.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v14.0.0...v14.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 11:03:04 +00:00
cbf6e46e35 build(deps-dev): bump eslint-plugin-functional from 4.4.0 to 4.4.1
Bumps [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional) from 4.4.0 to 4.4.1.
- [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/v4.4.0...v4.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 11:02:30 +00:00
727b1bd63b build(deps-dev): bump @types/prompt from 1.1.3 to 1.1.4
Bumps [@types/prompt](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prompt) from 1.1.3 to 1.1.4.
- [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>
2022-10-03 11:02:26 +00:00
363b8d74ae build(deps-dev): bump eslint-plugin-unicorn from 43.0.2 to 44.0.0
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 43.0.2 to 44.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v43.0.2...v44.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>
2022-10-03 11:01:33 +00:00
b31ecd6583 Merge pull request #1684 from dolanmiu/dependabot/npm_and_yarn/cspell-6.12.0
build(deps-dev): bump cspell from 6.10.1 to 6.12.0
2022-10-03 11:27:15 +01:00
563914a0ef Merge pull request #1682 from dolanmiu/dependabot/npm_and_yarn/typescript-4.8.4
build(deps-dev): bump typescript from 4.8.3 to 4.8.4
2022-10-03 11:27:06 +01:00
1e8adbb240 Merge pull request #1681 from dolanmiu/dependabot/npm_and_yarn/types/mocha-10.0.0
build(deps-dev): bump @types/mocha from 9.1.1 to 10.0.0
2022-10-03 11:26:57 +01:00
4b1f89a561 Merge pull request #1680 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.38.1
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.38.0 to 5.38.1
2022-10-03 11:26:48 +01:00
1a4a0ea5b8 Merge pull request #1679 from dolanmiu/dependabot/npm_and_yarn/types/node-18.7.23
build(deps): bump @types/node from 18.7.18 to 18.7.23
2022-10-03 11:26:39 +01:00
f781028b08 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.38.0 to 5.38.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.38.1/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 16:50:54 +00:00
56e8ad4f17 build(deps-dev): bump cspell from 6.10.1 to 6.12.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.10.1 to 6.12.0.
- [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.10.1...v6.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 16:50:37 +00:00
62c34ae612 build(deps-dev): bump typescript from 4.8.3 to 4.8.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.8.3 to 4.8.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.8.3...v4.8.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 16:50:05 +00:00
26123b0a93 build(deps): bump @types/node from 18.7.18 to 18.7.23
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.7.18 to 18.7.23.
- [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>
2022-09-30 16:49:55 +00:00
4023464a13 build(deps-dev): bump @types/mocha from 9.1.1 to 10.0.0
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 9.1.1 to 10.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 16:49:48 +00:00
0c92f354c5 Merge pull request #1678 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.38.1
build(deps-dev): bump @typescript-eslint/parser from 5.38.0 to 5.38.1
2022-09-30 17:48:40 +01:00
676723c8bd build(deps-dev): bump @typescript-eslint/parser from 5.38.0 to 5.38.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.38.0 to 5.38.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.38.1/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 15:12:31 +00:00
2f4d5afaea Merge pull request #1676 from dolanmiu/dependabot/npm_and_yarn/eslint-8.24.0
build(deps-dev): bump eslint from 8.23.1 to 8.24.0
2022-09-30 16:10:45 +01:00
d0abceb08d Merge pull request #1677 from hunterwilhelm/patch-1
Added the name horizontal line or horizontal rules
2022-09-30 16:10:30 +01:00
8b165e93e1 Specify which borders could look like a <hr/> 2022-09-28 09:19:18 -06:00
321969eb85 Added the name horizontal line or horizontal rules
There was some confusion in https://github.com/dolanmiu/docx/issues/437 because the docs don't mention anything called horizontal lines or horizontal rules. Microsoft calls them by that name here https://support.microsoft.com/en-us/office/insert-a-line-9bf172f6-5908-4791-9bb9-2c952197b1a9
This will make it easier for people to find this in the docs.
2022-09-26 10:22:32 -06:00
85ec90849e build(deps-dev): bump eslint from 8.23.1 to 8.24.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.23.1 to 8.24.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.23.1...v8.24.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-26 11:01:39 +00:00
96451bc5b7 Merge pull request #1669 from dolanmiu/dependabot/npm_and_yarn/eslint-8.23.1
build(deps-dev): bump eslint from 8.23.0 to 8.23.1
2022-09-25 09:57:01 +01:00
311cbf55ef Merge pull request #1670 from dolanmiu/dependabot/npm_and_yarn/eslint-plugin-functional-4.4.0
build(deps-dev): bump eslint-plugin-functional from 4.3.1 to 4.4.0
2022-09-25 09:56:54 +01:00
0258b256f2 Merge pull request #1671 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/parser-5.38.0
build(deps-dev): bump @typescript-eslint/parser from 5.36.1 to 5.38.0
2022-09-25 09:56:47 +01:00
c615de97c4 Merge pull request #1672 from dolanmiu/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.38.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.36.1 to 5.38.0
2022-09-25 09:56:39 +01:00
e29a7bf146 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.36.1 to 5.38.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/v5.38.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>
2022-09-22 11:02:29 +00:00
b665c243f0 build(deps-dev): bump @typescript-eslint/parser from 5.36.1 to 5.38.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.36.1 to 5.38.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.38.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>
2022-09-22 11:01:59 +00:00
bea1c9ed61 build(deps-dev): bump eslint-plugin-functional from 4.3.1 to 4.4.0
Bumps [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional) from 4.3.1 to 4.4.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/v4.3.1...v4.4.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>
2022-09-22 11:01:40 +00:00
0e6bdaa9c9 build(deps-dev): bump eslint from 8.23.0 to 8.23.1
Bumps [eslint](https://github.com/eslint/eslint) from 8.23.0 to 8.23.1.
- [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.23.0...v8.23.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-22 11:01:19 +00:00
7925689618 Merge pull request #1652 from dolanmiu/dependabot/npm_and_yarn/typescript-4.8.3
build(deps-dev): bump typescript from 4.7.4 to 4.8.3
2022-09-22 09:27:39 +01:00
791441ec86 build(deps-dev): bump typescript from 4.7.4 to 4.8.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.7.4 to 4.8.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.7.4...v4.8.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-22 08:14:04 +00:00
601a4038f4 Merge pull request #6 from dolanmiu/master
Update from Dolan's master
2022-09-16 15:24:38 +03:00
e0576c889b Merge pull request #5 from dolanmiu/master
Upd to latest Dolan master
2022-06-29 16:37:28 +03:00
4ff7f0a7bd Merge pull request #4 from dolanmiu/master
Merge latest changes from Dolans master (V7)
2022-05-16 11:42:13 +03:00
145 changed files with 9875 additions and 3202 deletions

View File

@ -47,7 +47,9 @@
"/xmlKeys = {[^}]+}/g", "/xmlKeys = {[^}]+}/g",
"/\\.to\\.deep\\.equal\\({[^)]+}\\)/g", "/\\.to\\.deep\\.equal\\({[^)]+}\\)/g",
"\\.to\\.include\\.members\\(\\[[^\\]]+]\\)", "\\.to\\.include\\.members\\(\\[[^\\]]+]\\)",
"/new [a-zA-Z]+\\({[^£]+}\\)/g" "/new [a-zA-Z]+\\({[^£]+}\\)/g",
"/<element name=\"[a-z]+\"/gi",
"/<attribute name=\"[a-z]+\"/gi"
], ],
"ignorePaths": ["package.json", "docs/api"], "ignorePaths": ["package.json", "docs/api"],
"allowCompoundWords": true, "allowCompoundWords": true,

View File

@ -96,8 +96,8 @@ module.exports = {
"@typescript-eslint/explicit-function-return-type": [ "@typescript-eslint/explicit-function-return-type": [
"error", "error",
{ {
allowExpressions: false, allowExpressions: true,
allowTypedFunctionExpressions: false, allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: false, allowHigherOrderFunctions: false,
allowDirectConstAssertionInArrowFunctions: true, allowDirectConstAssertionInArrowFunctions: true,
allowConciseArrowFunctionExpressionsStartingWithVoid: true, allowConciseArrowFunctionExpressionsStartingWithVoid: true,
@ -214,7 +214,6 @@ module.exports = {
"no-sequences": "error", "no-sequences": "error",
"no-shadow": "off", "no-shadow": "off",
"no-sparse-arrays": "error", "no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error", "no-throw-literal": "error",
"no-trailing-spaces": "error", "no-trailing-spaces": "error",
"no-undef-init": "error", "no-undef-init": "error",
@ -243,7 +242,6 @@ module.exports = {
"unicorn/prefer-ternary": "error", "unicorn/prefer-ternary": "error",
"use-isnan": "error", "use-isnan": "error",
"valid-typeof": "off", "valid-typeof": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"functional/immutable-data": [ "functional/immutable-data": [
"error", "error",
{ {
@ -252,9 +250,12 @@ module.exports = {
ignoreAccessorPattern: ["**.root*", "**.numberingReferences*", "**.sections*", "**.properties*"], ignoreAccessorPattern: ["**.root*", "**.numberingReferences*", "**.sections*", "**.properties*"],
}, },
], ],
"functional/no-method-signature": "error", "functional/prefer-property-signatures": "error",
"functional/no-mixed-type": "error", "functional/no-mixed-types": "error",
// TODO: Deprecated. Use prefer-immutable-types and type-declaration-immutability instead
"functional/prefer-readonly-type": "error", "functional/prefer-readonly-type": "error",
// "functional/prefer-immutable-types": "error",
// "functional/type-declaration-immutability": "error",
"no-unused-vars": ["error", { argsIgnorePattern: "^[_]+$" }], "no-unused-vars": ["error", { argsIgnorePattern: "^[_]+$" }],
}, },
overrides: [ overrides: [
@ -264,6 +265,7 @@ module.exports = {
"@typescript-eslint/no-unused-expressions": "off", "@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/dot-notation": "off", "@typescript-eslint/dot-notation": "off",
"prefer-destructuring": "off", "prefer-destructuring": "off",
"@typescript-eslint/explicit-function-return-type": "off",
}, },
}, },
], ],

View File

@ -34,7 +34,7 @@ jobs:
- name: Test - name: Test
run: npm run test.coverage run: npm run test.coverage
- name: Codecov - name: Codecov
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v3
with: with:
fail_ci_if_error: true fail_ci_if_error: true
verbose: true verbose: true

View File

@ -689,3 +689,120 @@ jobs:
with: with:
xml-file: build/extracted-doc/word/document.xml xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd 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

1
.npmrc Normal file
View File

@ -0,0 +1 @@
registry=https://registry.npmjs.org/

8
.nycrc
View File

@ -1,9 +1,9 @@
{ {
"check-coverage": true, "check-coverage": true,
"statements": 99.72, "statements": 99.79,
"branches": 97.95, "branches": 98.41,
"functions": 99.82, "functions": 100,
"lines": 99.71, "lines": 99.73,
"include": [ "include": [
"src/**/*.ts" "src/**/*.ts"
], ],

View File

@ -29,11 +29,12 @@ Here are examples of `docx` being used with basic `HTML/JS` in a browser environ
- https://codepen.io/dolanmiu/pen/RwNeObg - https://codepen.io/dolanmiu/pen/RwNeObg
- https://jsfiddle.net/dolanmiu/onadx1gu/ - https://jsfiddle.net/dolanmiu/onadx1gu/
Here is an example of `docx` working in `Angular`: Here are examples of `docx` working in `Angular`:
- https://stackblitz.com/edit/angular-docx - https://stackblitz.com/edit/angular-docx
- https://stackblitz.com/edit/angular-wmd6k3
Here is an example of `docx` working in `React`: Here are examples of `docx` working in `React`:
- https://stackblitz.com/edit/react-docx - https://stackblitz.com/edit/react-docx
- https://stackblitz.com/edit/react-docx-images (adding images to Word Document) - https://stackblitz.com/edit/react-docx-images (adding images to Word Document)

View File

@ -1,7 +1,7 @@
// Simple example to add text to a document // Simple example to add text to a document
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build"; import { Document, Packer, Paragraph, Tab, TextRun } from "../build";
const doc = new Document({ const doc = new Document({
sections: [ sections: [
@ -14,9 +14,10 @@ const doc = new Document({
new TextRun({ new TextRun({
text: "Foo Bar", text: "Foo Bar",
bold: true, bold: true,
size: 40,
}), }),
new TextRun({ new TextRun({
text: "\tGithub is the best", children: [new Tab(), "Github is the best"],
bold: true, bold: true,
}), }),
], ],

View File

@ -1,7 +1,7 @@
// Generate a CV // Generate a CV
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, TabStopPosition, TabStopType, TextRun } from "../build"; import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, Tab, TabStopPosition, TabStopType, TextRun } from "../build";
// tslint:disable:no-shadowed-variable // tslint:disable:no-shadowed-variable
@ -284,7 +284,7 @@ class DocumentCreator {
bold: true, bold: true,
}), }),
new TextRun({ new TextRun({
text: `\t${dateText}`, children: [new Tab(), dateText],
bold: true, bold: true,
}), }),
], ],

View File

@ -1,7 +1,7 @@
// Export to base64 string - Useful in a browser environment. // Export to base64 string - Useful in a browser environment.
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build"; import { Document, Packer, Paragraph, Tab, TextRun } from "../build";
const doc = new Document({ const doc = new Document({
sections: [ sections: [
@ -15,7 +15,7 @@ const doc = new Document({
bold: true, bold: true,
}), }),
new TextRun({ new TextRun({
text: "\tBar", children: [new Tab(), "Bar"],
bold: true, bold: true,
}), }),
], ],

View File

@ -82,6 +82,32 @@ const doc = new Document({
spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 },
}, },
}, },
{
id: "strikeUnderline",
name: "Strike Underline",
basedOn: "Normal",
quickFormat: true,
run: {
strike: true,
underline: {
type: UnderlineType.SINGLE,
},
},
},
],
characterStyles: [
{
id: "strikeUnderlineCharacter",
name: "Strike Underline",
basedOn: "Normal",
quickFormat: true,
run: {
strike: true,
underline: {
type: UnderlineType.SINGLE,
},
},
},
], ],
}, },
numbering: { numbering: {
@ -169,6 +195,14 @@ const doc = new Document({
new TextRun({ new TextRun({
text: "and back to normal.", text: "and back to normal.",
}), }),
new TextRun({
text: "This text will be invisible!",
vanish: true,
}),
new TextRun({
text: "This text will be VERY invisible! Word processors cannot override this!",
specVanish: true,
}),
], ],
}), }),
new Paragraph({ new Paragraph({
@ -182,6 +216,49 @@ const doc = new Document({
}), }),
], ],
}), }),
new Paragraph({
style: "strikeUnderline",
children: [
new TextRun({
text: "Underline and Strike",
}),
new TextRun({
text: " Override Underline ",
underline: {
type: UnderlineType.NONE,
},
}),
new TextRun({
text: "Strike and Underline",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Hello World ",
}),
new TextRun({
style: "strikeUnderlineCharacter",
text: "Underline and Strike",
}),
new TextRun({
text: " Another Hello World",
}),
new TextRun({
scale: 50,
text: " Scaled text",
}),
],
}),
new Paragraph({
scale: 200,
children: [
new TextRun({
text: "Scaled paragraph",
}),
],
}),
], ],
}, },
], ],

View File

@ -1,7 +1,7 @@
// Example of making content of section vertically aligned // Example of making content of section vertically aligned
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, VerticalAlign, TextRun } from "../build"; import { Document, Packer, Paragraph, VerticalAlign, TextRun, Tab } from "../build";
const doc = new Document({ const doc = new Document({
sections: [ sections: [
@ -18,7 +18,7 @@ const doc = new Document({
bold: true, bold: true,
}), }),
new TextRun({ new TextRun({
text: "\tGithub is the best", children: [new Tab(), "Github is the best"],
bold: true, bold: true,
}), }),
], ],

View File

@ -25,6 +25,11 @@ const doc = new Document({
width: 100, width: 100,
height: 100, height: 100,
}, },
altText: {
title: "This is an ultimate title",
description: "This is an ultimate image",
name: "My Ultimate Image",
},
}), }),
], ],
}), }),

View File

@ -16,6 +16,7 @@ import {
MathSubScript, MathSubScript,
MathSubSuperScript, MathSubSuperScript,
MathSum, MathSum,
MathIntegral,
MathSuperScript, MathSuperScript,
Packer, Packer,
Paragraph, Paragraph,
@ -90,6 +91,35 @@ const doc = new Document({
}), }),
], ],
}), }),
new Paragraph({
children: [
new Math({
children: [
new MathIntegral({
children: [new MathRun("test")],
}),
new MathIntegral({
children: [
new MathSuperScript({
children: [new MathRun("e")],
superScript: [new MathRun("2")],
}),
],
subScript: [new MathRun("i")],
}),
new MathIntegral({
children: [
new MathRadical({
children: [new MathRun("i")],
}),
],
subScript: [new MathRun("i")],
superScript: [new MathRun("10")],
}),
],
}),
],
}),
new Paragraph({ new Paragraph({
children: [ children: [
new Math({ new Math({

View File

@ -1,7 +1,7 @@
// Change background colour of whole document // Change background colour of whole document
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build"; import { Document, Packer, Paragraph, Tab, TextRun } from "../build";
const doc = new Document({ const doc = new Document({
background: { background: {
@ -19,7 +19,7 @@ const doc = new Document({
bold: true, bold: true,
}), }),
new TextRun({ new TextRun({
text: "\tGithub is the best", children: [new Tab(), "Github is the best"],
bold: true, bold: true,
}), }),
], ],

View File

@ -1,7 +1,7 @@
// Example of how to change page borders // Example of how to change page borders
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "../build"; import { Document, HeadingLevel, Packer, Paragraph, Tab, TextRun } from "../build";
const doc = new Document({ const doc = new Document({
sections: [ sections: [
@ -25,7 +25,7 @@ const doc = new Document({
bold: true, bold: true,
}), }),
new TextRun({ new TextRun({
text: "\tGithub is the best", children: [new Tab(), "Github is the best"],
bold: true, bold: true,
}), }),
], ],

View File

@ -12,6 +12,7 @@ import {
PageNumber, PageNumber,
Paragraph, Paragraph,
ShadingType, ShadingType,
Tab,
TextRun, TextRun,
} from "../build"; } from "../build";
@ -111,7 +112,7 @@ const doc = new Document({
}), }),
new TextRun({ new TextRun({
bold: true, bold: true,
children: ["\tuse Inserted and Deleted TextRuns.", new FootnoteReferenceRun(1)], children: [new Tab(), "use Inserted and Deleted TextRuns.", new FootnoteReferenceRun(1)],
}), }),
new TextRun({ new TextRun({
bold: true, bold: true,

View File

@ -8,6 +8,7 @@ import {
HorizontalPositionAlign, HorizontalPositionAlign,
Packer, Packer,
Paragraph, Paragraph,
Tab,
TextRun, TextRun,
VerticalPositionAlign, VerticalPositionAlign,
} from "../build"; } from "../build";
@ -67,7 +68,7 @@ const doc = new Document({
bold: true, bold: true,
}), }),
new TextRun({ new TextRun({
text: "\tGithub is the best", children: [new Tab(), "Github is the best"],
bold: true, bold: true,
}), }),
], ],

View File

@ -7,12 +7,31 @@ const doc = new Document({
sections: [ sections: [
{ {
children: [ children: [
new Paragraph({
wordWrap: true,
children: [
new TextRun("我今天遛狗去公园"),
new TextRun({
text: "456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345",
}),
],
}),
new Paragraph({
wordWrap: true,
children: [
new TextRun(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",
),
new TextRun({
text: "456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345",
}),
],
}),
new Paragraph({ new Paragraph({
children: [ children: [
new TextRun("我今天遛狗去公园"), new TextRun("我今天遛狗去公园"),
new TextRun({ new TextRun({
text: "456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345", text: "456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345",
space: SpaceType.PRESERVE,
}), }),
], ],
}), }),
@ -23,7 +42,6 @@ const doc = new Document({
), ),
new TextRun({ new TextRun({
text: "456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345", text: "456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345456435234523456435564745673456345",
space: SpaceType.PRESERVE,
}), }),
], ],
}), }),

View File

@ -1,7 +1,7 @@
// Exporting the document as a stream // Exporting the document as a stream
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build"; import { Document, Packer, Paragraph, Tab, TextRun } from "../build";
const doc = new Document({ const doc = new Document({
sections: [ sections: [
@ -16,7 +16,7 @@ const doc = new Document({
bold: true, bold: true,
}), }),
new TextRun({ new TextRun({
text: "\tGithub is the best", children: [new Tab(), "Github is the best"],
bold: true, bold: true,
}), }),
], ],

80
demo/75-tab-stops.ts Normal file
View File

@ -0,0 +1,80 @@
// Example of using tab stops
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, HeadingLevel, Packer, Paragraph, TabStopPosition, TabStopType, TextRun } from "../build";
const columnWidth = TabStopPosition.MAX / 4;
const receiptTabStops = [
// no need to define first left tab column
// the right aligned tab column position should point to the end of column
// i.e. in this case
// (end position of 1st) + (end position of current)
// columnWidth + columnWidth = columnWidth * 2
{ type: TabStopType.RIGHT, position: columnWidth * 2 },
{ type: TabStopType.RIGHT, position: columnWidth * 3 },
{ type: TabStopType.RIGHT, position: TabStopPosition.MAX },
],
twoTabStops = [{ type: TabStopType.RIGHT, position: TabStopPosition.MAX }];
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
heading: HeadingLevel.HEADING_1,
children: [new TextRun("Receipt 001")],
}),
new Paragraph({
tabStops: twoTabStops,
children: [
new TextRun({
text: "To Bob.\tBy Alice.",
bold: true,
}),
],
}),
new Paragraph({
tabStops: twoTabStops,
children: [new TextRun("Foo Inc\tBar Inc")],
}),
new Paragraph({ text: "" }),
new Paragraph({
tabStops: receiptTabStops,
children: [
new TextRun({
text: "Item\tPrice\tQuantity\tSub-total",
bold: true,
}),
],
}),
new Paragraph({
tabStops: receiptTabStops,
text: "Item 3\t10\t5\t50",
}),
new Paragraph({
tabStops: receiptTabStops,
text: "Item 3\t10\t5\t50",
}),
new Paragraph({
tabStops: receiptTabStops,
text: "Item 3\t10\t5\t50",
}),
new Paragraph({
tabStops: receiptTabStops,
children: [
new TextRun({
text: "\t\t\tTotal: 200",
bold: true,
}),
],
}),
],
},
],
});
const stream = Packer.toStream(doc);
stream.pipe(fs.createWriteStream("My Document.docx"));

87
demo/76-compatibility.ts Normal file
View File

@ -0,0 +1,87 @@
// Add compatibility options
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
compatibility: {
useSingleBorderforContiguousCells: true,
wordPerfectJustification: true,
noTabStopForHangingIndent: true,
noLeading: true,
spaceForUnderline: true,
noColumnBalance: true,
balanceSingleByteDoubleByteWidth: true,
noExtraLineSpacing: true,
doNotLeaveBackslashAlone: true,
underlineTrailingSpaces: true,
doNotExpandShiftReturn: true,
spacingInWholePoints: true,
lineWrapLikeWord6: true,
printBodyTextBeforeHeader: true,
printColorsBlack: true,
spaceWidth: true,
showBreaksInFrames: true,
subFontBySize: true,
suppressBottomSpacing: true,
suppressTopSpacing: true,
suppressSpacingAtTopOfPage: true,
suppressTopSpacingWP: true,
suppressSpBfAfterPgBrk: true,
swapBordersFacingPages: true,
convertMailMergeEsc: true,
truncateFontHeightsLikeWP6: true,
macWordSmallCaps: true,
usePrinterMetrics: true,
doNotSuppressParagraphBorders: true,
wrapTrailSpaces: true,
footnoteLayoutLikeWW8: true,
shapeLayoutLikeWW8: true,
alignTablesRowByRow: true,
forgetLastTabAlignment: true,
adjustLineHeightInTable: true,
autoSpaceLikeWord95: true,
noSpaceRaiseLower: true,
doNotUseHTMLParagraphAutoSpacing: true,
layoutRawTableWidth: true,
layoutTableRowsApart: true,
useWord97LineBreakRules: true,
doNotBreakWrappedTables: true,
doNotSnapToGridInCell: true,
selectFieldWithFirstOrLastCharacter: true,
applyBreakingRules: true,
doNotWrapTextWithPunctuation: true,
doNotUseEastAsianBreakRules: true,
useWord2002TableStyleRules: true,
growAutofit: true,
useFELayout: true,
useNormalStyleForList: true,
doNotUseIndentAsNumberingTabStop: true,
useAlternateEastAsianLineBreakRules: true,
allowSpaceOfSameStyleInTable: true,
doNotSuppressIndentation: true,
doNotAutofitConstrainedTables: true,
autofitToFirstFixedWidthCell: true,
underlineTabInNumberingList: true,
displayHangulFixedWidth: true,
splitPgBreakAndParaMark: true,
doNotVerticallyAlignCellWithSp: true,
doNotBreakConstrainedForcedTable: true,
ignoreVerticalAlignmentInTextboxes: true,
useAnsiKerningPairs: true,
cachedColumnBalance: true,
},
sections: [
{
children: [
new Paragraph({
children: [new TextRun("Hello World")],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,116 @@
// Exporting the document as a stream
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, Table, TableBorders, TableCell, TableRow, WidthType } from "../build";
const table1 = new Table({
columnWidths: [3505, 5505],
rows: [
new TableRow({
children: [
new TableCell({
width: {
size: 3505,
type: WidthType.DXA,
},
children: [new Paragraph("Hello")],
}),
new TableCell({
width: {
size: 5505,
type: WidthType.DXA,
},
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
width: {
size: 3505,
type: WidthType.DXA,
},
children: [],
}),
new TableCell({
width: {
size: 5505,
type: WidthType.DXA,
},
children: [new Paragraph("World")],
}),
],
}),
],
});
const table2 = new Table({
columnWidths: [3505, 5505],
rows: [
new TableRow({
children: [
new TableCell({
width: {
size: 3505,
type: WidthType.DXA,
},
children: [new Paragraph("Foo")],
}),
new TableCell({
width: {
size: 5505,
type: WidthType.DXA,
},
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
width: {
size: 3505,
type: WidthType.DXA,
},
children: [],
}),
new TableCell({
width: {
size: 5505,
type: WidthType.DXA,
},
children: [new Paragraph("Bar")],
}),
],
}),
],
});
const noBorderTable = new Table({
borders: TableBorders.NONE,
rows: [
new TableRow({
children: [
new TableCell({
children: [table1],
}),
new TableCell({
children: [table2],
}),
],
}),
],
});
const doc = new Document({
sections: [
{
properties: {},
children: [noBorderTable],
},
],
});
const stream = Packer.toStream(doc);
stream.pipe(fs.createWriteStream("My Document.docx"));

View File

@ -0,0 +1,27 @@
// Simple example to add text to a document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
alignment: AlignmentType.THAI_DISTRIBUTE,
children: [
new TextRun({
text: "บริษัท บิสกิด จำกัด (บริษัทฯ) ได้จดทะเบียนจัดตั้งขึ้นเป็นบริษัทจำกัดตามประมวลกฎหมายแพ่งและพาณิชย์ของประเทศไทย เมื่อวันที่ 30 พฤษภาคม 2561 ทะเบียนนิติบุคคลเลขที่ 0845561005665",
size: 36,
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,193 @@
// Example of how you would create a table and add data to it from a data source
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import {
Document,
HeadingLevel,
Packer,
Paragraph,
Table,
TableCell,
TableRow,
VerticalAlign,
TextDirection,
TextRun,
WidthType,
} from "../build";
interface StockPrice {
readonly date: Date;
readonly ticker: string;
readonly price: number;
}
const DATA: StockPrice[] = [
{
date: new Date("2007-08-28"),
ticker: "Apple",
price: 18.12,
},
{
date: new Date("2007-08-29"),
ticker: "Apple",
price: 19.15,
},
{
date: new Date("2007-08-30"),
ticker: "Apple",
price: 19.46,
},
{
date: new Date("2007-08-31"),
ticker: "Apple",
price: 19.78,
},
{
date: new Date("2007-09-04"),
ticker: "Apple",
price: 20.59,
},
{
date: new Date("2007-09-05"),
ticker: "Apple",
price: 19.54,
},
{
date: new Date("2007-09-06"),
ticker: "Apple",
price: 19.29,
},
{
date: new Date("2007-09-07"),
ticker: "Apple",
price: 18.82,
},
{
date: new Date("2007-09-10"),
ticker: "Apple",
price: 19.53,
},
{
date: new Date("2007-09-11"),
ticker: "Apple",
price: 19.36,
},
{
date: new Date("2007-09-12"),
ticker: "Apple",
price: 19.55,
},
{
date: new Date("2007-09-13"),
ticker: "Apple",
price: 19.6,
},
{
date: new Date("2007-09-14"),
ticker: "Apple",
price: 19.83,
},
{
date: new Date("2007-09-17"),
ticker: "Apple",
price: 19.77,
},
];
const generateRows = (prices: StockPrice[]): TableRow[] =>
prices.map(
({ date, ticker, price }) =>
new TableRow({
children: [
new TableCell({
children: [new Paragraph(date.toString())],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.LEFT_TO_RIGHT_TOP_TO_BOTTOM,
}),
new TableCell({
children: [new Paragraph(ticker)],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.LEFT_TO_RIGHT_TOP_TO_BOTTOM,
}),
new TableCell({
children: [new Paragraph(price.toString())],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
}),
],
}),
);
const doc = new Document({
sections: [
{
children: [
new Table({
width: {
size: 9070,
type: WidthType.DXA,
},
rows: [
new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [
new TextRun({
text: "Date",
bold: true,
size: 40,
}),
],
}),
],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.LEFT_TO_RIGHT_TOP_TO_BOTTOM,
}),
new TableCell({
children: [
new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [
new TextRun({
text: "Ticker",
bold: true,
size: 40,
}),
],
}),
],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.LEFT_TO_RIGHT_TOP_TO_BOTTOM,
}),
new TableCell({
children: [
new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [
new TextRun({
text: "Price",
bold: true,
size: 40,
}),
],
}),
],
verticalAlign: VerticalAlign.CENTER,
textDirection: TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
}),
],
}),
...generateRows(DATA),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,49 @@
// Simple example to add text to a document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, convertMillimetersToTwip, Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
styles: {
paragraphStyles: [
{
id: "test",
name: "Test",
basedOn: "Normal",
next: "Normal",
paragraph: {
indent: { left: convertMillimetersToTwip(6.4) },
},
},
],
},
sections: [
{
properties: {
page: {
margin: {
top: 0,
right: convertMillimetersToTwip(24),
bottom: convertMillimetersToTwip(24),
left: convertMillimetersToTwip(24),
},
},
},
children: [
new Paragraph({
alignment: AlignmentType.THAI_DISTRIBUTE,
children: [
new TextRun({
text: "บริษัทฯ มีเงินสด 41,985.00 บาท และ 25,855.66 บาทตามลำดับ เงินสดทั้งจำนวนอยู่ในความดูแลและรับผิดชอบของกรรมการ บริษัทฯบันทึกการรับชำระเงินและการจ่ายชำระเงินผ่านบัญชีเงินสดเพียงเท่านั้น ซึ่งอาจกระทบต่อความถูกต้องครบถ้วนของการบันทึกบัญชี ทั้งนี้ขึ้นอยู่กับระบบการควบคุมภายในของบริษัท",
size: 28,
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,148 @@
// Example of a continuous header
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Footer, Header, Packer, Paragraph, SectionType, Tab, TextRun } from "../build";
const doc = new Document({
creator: "Creator",
title: "Title",
sections: [
{
properties: { titlePage: true },
headers: {
first: new Header({
children: [
new Paragraph({
children: [
new TextRun({
text: "HEADER PAGE ONE",
}),
],
}),
],
}),
default: new Header({
children: [
new Paragraph({
children: [
new TextRun({
text: "HEADER PAGE TWO AND FOLLOWING PAGES",
}),
],
}),
],
}),
},
footers: {
first: new Footer({
children: [
new Paragraph({
children: [
new TextRun({
text: "FOOTER PAGE ONE",
}),
],
}),
],
}),
default: new Footer({
children: [
new Paragraph({
children: [
new TextRun({
text: "FOOTER PAGE TWO AND FOLLOWING PAGES",
}),
],
}),
],
}),
},
children: [
new Paragraph({
children: [
new TextRun({
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ac suscipit orci, in lobortis risus. Nulla vehicula rutrum finibus. Nullam consequat, magna in vehicula commodo, enim massa consectetur nisl, sit amet rutrum nunc ante vel lorem. Sed sit amet scelerisque velit. Proin non quam eget mauris aliquet posuere a sed orci. Proin posuere ante suscipit neque dignissim hendrerit. Pellentesque eget dapibus metus. Donec at mollis mauris. Vestibulum sit amet scelerisque nulla. Vivamus ipsum erat, tempor sed volutpat non, molestie at odio. Vivamus lectus ligula, finibus at mattis vitae, euismod sed tellus. Etiam neque massa, faucibus a fringilla nec, mollis at ex. Aliquam eget nibh tortor. Sed ut viverra libero. Nulla facilisis bibendum quam eget porttitor.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed eget nunc ac turpis facilisis volutpat. Duis eget arcu vitae neque porta hendrerit. Proin vel ante nulla. Duis congue efficitur dui. Suspendisse potenti. Aliquam aliquam nibh eu ipsum sagittis efficitur. Quisque sagittis metus dui, vitae suscipit tortor sollicitudin at. Suspendisse convallis, sem ac ornare condimentum, odio ipsum dapibus justo, a aliquam risus massa ut enim. Mauris vel placerat nibh. Ut iaculis vitae nibh at elementum. Quisque hendrerit et magna vitae mollis. Duis dictum euismod leo, at cursus risus sodales sed.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed gravida commodo felis, at aliquet risus volutpat ut. Nam nec ex eleifend tellus sodales volutpat nec ac nibh. Vestibulum pretium, leo vitae lobortis accumsan, urna libero euismod ante, consequat aliquam enim risus id nisl. Donec sagittis, justo eu luctus posuere, leo purus pellentesque turpis, eget volutpat mi leo vitae lacus. Etiam ante ante, posuere at augue non, lacinia ornare purus. Praesent vitae velit in enim congue maximus. Vivamus tincidunt fringilla neque. Curabitur fermentum justo nec sapien porttitor, ac ullamcorper nisi imperdiet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed non orci vel eros egestas eleifend sit amet a diam. Duis mattis at ligula quis faucibus. Donec elementum lacus velit, a vehicula nunc gravida a. Phasellus eget nunc vehicula, varius velit a, maximus velit. Sed a suscipit nisi, non hendrerit felis. Proin mattis facilisis massa, quis elementum neque fringilla non.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed gravida commodo felis, at aliquet risus volutpat ut. Nam nec ex eleifend tellus sodales volutpat nec ac nibh. Vestibulum pretium, leo vitae lobortis accumsan, urna libero euismod ante, consequat aliquam enim risus id nisl. Donec sagittis, justo eu luctus posuere, leo purus pellentesque turpis, eget volutpat mi leo vitae lacus. Etiam ante ante, posuere at augue non, lacinia ornare purus. Praesent vitae velit in enim congue maximus. Vivamus tincidunt fringilla neque. Curabitur fermentum justo nec sapien porttitor, ac ullamcorper nisi imperdiet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed non orci vel eros egestas eleifend sit amet a diam. Duis mattis at ligula quis faucibus. Donec elementum lacus velit, a vehicula nunc gravida a. Phasellus eget nunc vehicula, varius velit a, maximus velit. Sed a suscipit nisi, non hendrerit felis. Proin mattis facilisis massa, quis elementum neque fringilla non.",
}),
],
}),
new Paragraph({
spacing: {
after: 500,
},
children: [
new TextRun({
text: "The first section ends after this paragraph.",
}),
],
}),
],
},
{
properties: {
type: SectionType.CONTINUOUS,
},
children: [
new Paragraph({
children: [
new TextRun({
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ac suscipit orci, in lobortis risus. Nulla vehicula rutrum finibus. Nullam consequat, magna in vehicula commodo, enim massa consectetur nisl, sit amet rutrum nunc ante vel lorem. Sed sit amet scelerisque velit. Proin non quam eget mauris aliquet posuere a sed orci. Proin posuere ante suscipit neque dignissim hendrerit. Pellentesque eget dapibus metus. Donec at mollis mauris. Vestibulum sit amet scelerisque nulla. Vivamus ipsum erat, tempor sed volutpat non, molestie at odio. Vivamus lectus ligula, finibus at mattis vitae, euismod sed tellus. Etiam neque massa, faucibus a fringilla nec, mollis at ex. Aliquam eget nibh tortor. Sed ut viverra libero. Nulla facilisis bibendum quam eget porttitor.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed eget nunc ac turpis facilisis volutpat. Duis eget arcu vitae neque porta hendrerit. Proin vel ante nulla. Duis congue efficitur dui. Suspendisse potenti. Aliquam aliquam nibh eu ipsum sagittis efficitur. Quisque sagittis metus dui, vitae suscipit tortor sollicitudin at. Suspendisse convallis, sem ac ornare condimentum, odio ipsum dapibus justo, a aliquam risus massa ut enim. Mauris vel placerat nibh. Ut iaculis vitae nibh at elementum. Quisque hendrerit et magna vitae mollis. Duis dictum euismod leo, at cursus risus sodales sed.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed gravida commodo felis, at aliquet risus volutpat ut. Nam nec ex eleifend tellus sodales volutpat nec ac nibh. Vestibulum pretium, leo vitae lobortis accumsan, urna libero euismod ante, consequat aliquam enim risus id nisl. Donec sagittis, justo eu luctus posuere, leo purus pellentesque turpis, eget volutpat mi leo vitae lacus. Etiam ante ante, posuere at augue non, lacinia ornare purus. Praesent vitae velit in enim congue maximus. Vivamus tincidunt fringilla neque. Curabitur fermentum justo nec sapien porttitor, ac ullamcorper nisi imperdiet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed non orci vel eros egestas eleifend sit amet a diam. Duis mattis at ligula quis faucibus. Donec elementum lacus velit, a vehicula nunc gravida a. Phasellus eget nunc vehicula, varius velit a, maximus velit. Sed a suscipit nisi, non hendrerit felis. Proin mattis facilisis massa, quis elementum neque fringilla non.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed gravida commodo felis, at aliquet risus volutpat ut. Nam nec ex eleifend tellus sodales volutpat nec ac nibh. Vestibulum pretium, leo vitae lobortis accumsan, urna libero euismod ante, consequat aliquam enim risus id nisl. Donec sagittis, justo eu luctus posuere, leo purus pellentesque turpis, eget volutpat mi leo vitae lacus. Etiam ante ante, posuere at augue non, lacinia ornare purus. Praesent vitae velit in enim congue maximus. Vivamus tincidunt fringilla neque. Curabitur fermentum justo nec sapien porttitor, ac ullamcorper nisi imperdiet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed non orci vel eros egestas eleifend sit amet a diam. Duis mattis at ligula quis faucibus. Donec elementum lacus velit, a vehicula nunc gravida a. Phasellus eget nunc vehicula, varius velit a, maximus velit. Sed a suscipit nisi, non hendrerit felis. Proin mattis facilisis massa, quis elementum neque fringilla non.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "The second section starts with the headline above. Move cursor to the end of this text and press enter until next page is generated in continuous section break mode.",
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,148 @@
// Example of using headers and footers in a new section
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Footer, Header, Packer, Paragraph, SectionType, Tab, TextRun } from "../build";
const doc = new Document({
creator: "Creator",
title: "Title",
sections: [
{
headers: {
default: new Header({
children: [
new Paragraph({
children: [
new TextRun({
text: "HEADER PAGE ONE",
}),
],
}),
],
}),
},
footers: {
default: new Footer({
children: [
new Paragraph({
children: [
new TextRun({
text: "FOOTER PAGE ONE",
}),
],
}),
],
}),
},
children: [
new Paragraph({
children: [
new TextRun({
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ac suscipit orci, in lobortis risus. Nulla vehicula rutrum finibus. Nullam consequat, magna in vehicula commodo, enim massa consectetur nisl, sit amet rutrum nunc ante vel lorem. Sed sit amet scelerisque velit. Proin non quam eget mauris aliquet posuere a sed orci. Proin posuere ante suscipit neque dignissim hendrerit. Pellentesque eget dapibus metus. Donec at mollis mauris. Vestibulum sit amet scelerisque nulla. Vivamus ipsum erat, tempor sed volutpat non, molestie at odio. Vivamus lectus ligula, finibus at mattis vitae, euismod sed tellus. Etiam neque massa, faucibus a fringilla nec, mollis at ex. Aliquam eget nibh tortor. Sed ut viverra libero. Nulla facilisis bibendum quam eget porttitor.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed eget nunc ac turpis facilisis volutpat. Duis eget arcu vitae neque porta hendrerit. Proin vel ante nulla. Duis congue efficitur dui. Suspendisse potenti. Aliquam aliquam nibh eu ipsum sagittis efficitur. Quisque sagittis metus dui, vitae suscipit tortor sollicitudin at. Suspendisse convallis, sem ac ornare condimentum, odio ipsum dapibus justo, a aliquam risus massa ut enim. Mauris vel placerat nibh. Ut iaculis vitae nibh at elementum. Quisque hendrerit et magna vitae mollis. Duis dictum euismod leo, at cursus risus sodales sed.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed gravida commodo felis, at aliquet risus volutpat ut. Nam nec ex eleifend tellus sodales volutpat nec ac nibh. Vestibulum pretium, leo vitae lobortis accumsan, urna libero euismod ante, consequat aliquam enim risus id nisl. Donec sagittis, justo eu luctus posuere, leo purus pellentesque turpis, eget volutpat mi leo vitae lacus. Etiam ante ante, posuere at augue non, lacinia ornare purus. Praesent vitae velit in enim congue maximus. Vivamus tincidunt fringilla neque. Curabitur fermentum justo nec sapien porttitor, ac ullamcorper nisi imperdiet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed non orci vel eros egestas eleifend sit amet a diam. Duis mattis at ligula quis faucibus. Donec elementum lacus velit, a vehicula nunc gravida a. Phasellus eget nunc vehicula, varius velit a, maximus velit. Sed a suscipit nisi, non hendrerit felis. Proin mattis facilisis massa, quis elementum neque fringilla non.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed gravida commodo felis, at aliquet risus volutpat ut. Nam nec ex eleifend tellus sodales volutpat nec ac nibh. Vestibulum pretium, leo vitae lobortis accumsan, urna libero euismod ante, consequat aliquam enim risus id nisl. Donec sagittis, justo eu luctus posuere, leo purus pellentesque turpis, eget volutpat mi leo vitae lacus. Etiam ante ante, posuere at augue non, lacinia ornare purus. Praesent vitae velit in enim congue maximus. Vivamus tincidunt fringilla neque. Curabitur fermentum justo nec sapien porttitor, ac ullamcorper nisi imperdiet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed non orci vel eros egestas eleifend sit amet a diam. Duis mattis at ligula quis faucibus. Donec elementum lacus velit, a vehicula nunc gravida a. Phasellus eget nunc vehicula, varius velit a, maximus velit. Sed a suscipit nisi, non hendrerit felis. Proin mattis facilisis massa, quis elementum neque fringilla non.",
}),
],
}),
new Paragraph({
spacing: {
after: 500,
},
children: [
new TextRun({
text: "The first section ends after this paragraph.",
}),
],
}),
],
},
{
headers: {
default: new Header({
children: [
new Paragraph({
children: [
new TextRun({
text: "HEADER PAGE TWO AND FOLLOWING PAGES",
}),
],
}),
],
}),
},
footers: {
default: new Footer({
children: [
new Paragraph({
children: [
new TextRun({
text: "FOOTER PAGE TWO AND FOLLOWING PAGES",
}),
],
}),
],
}),
},
children: [
new Paragraph({
children: [
new TextRun({
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ac suscipit orci, in lobortis risus. Nulla vehicula rutrum finibus. Nullam consequat, magna in vehicula commodo, enim massa consectetur nisl, sit amet rutrum nunc ante vel lorem. Sed sit amet scelerisque velit. Proin non quam eget mauris aliquet posuere a sed orci. Proin posuere ante suscipit neque dignissim hendrerit. Pellentesque eget dapibus metus. Donec at mollis mauris. Vestibulum sit amet scelerisque nulla. Vivamus ipsum erat, tempor sed volutpat non, molestie at odio. Vivamus lectus ligula, finibus at mattis vitae, euismod sed tellus. Etiam neque massa, faucibus a fringilla nec, mollis at ex. Aliquam eget nibh tortor. Sed ut viverra libero. Nulla facilisis bibendum quam eget porttitor.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed eget nunc ac turpis facilisis volutpat. Duis eget arcu vitae neque porta hendrerit. Proin vel ante nulla. Duis congue efficitur dui. Suspendisse potenti. Aliquam aliquam nibh eu ipsum sagittis efficitur. Quisque sagittis metus dui, vitae suscipit tortor sollicitudin at. Suspendisse convallis, sem ac ornare condimentum, odio ipsum dapibus justo, a aliquam risus massa ut enim. Mauris vel placerat nibh. Ut iaculis vitae nibh at elementum. Quisque hendrerit et magna vitae mollis. Duis dictum euismod leo, at cursus risus sodales sed.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed gravida commodo felis, at aliquet risus volutpat ut. Nam nec ex eleifend tellus sodales volutpat nec ac nibh. Vestibulum pretium, leo vitae lobortis accumsan, urna libero euismod ante, consequat aliquam enim risus id nisl. Donec sagittis, justo eu luctus posuere, leo purus pellentesque turpis, eget volutpat mi leo vitae lacus. Etiam ante ante, posuere at augue non, lacinia ornare purus. Praesent vitae velit in enim congue maximus. Vivamus tincidunt fringilla neque. Curabitur fermentum justo nec sapien porttitor, ac ullamcorper nisi imperdiet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed non orci vel eros egestas eleifend sit amet a diam. Duis mattis at ligula quis faucibus. Donec elementum lacus velit, a vehicula nunc gravida a. Phasellus eget nunc vehicula, varius velit a, maximus velit. Sed a suscipit nisi, non hendrerit felis. Proin mattis facilisis massa, quis elementum neque fringilla non.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "Sed gravida commodo felis, at aliquet risus volutpat ut. Nam nec ex eleifend tellus sodales volutpat nec ac nibh. Vestibulum pretium, leo vitae lobortis accumsan, urna libero euismod ante, consequat aliquam enim risus id nisl. Donec sagittis, justo eu luctus posuere, leo purus pellentesque turpis, eget volutpat mi leo vitae lacus. Etiam ante ante, posuere at augue non, lacinia ornare purus. Praesent vitae velit in enim congue maximus. Vivamus tincidunt fringilla neque. Curabitur fermentum justo nec sapien porttitor, ac ullamcorper nisi imperdiet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed non orci vel eros egestas eleifend sit amet a diam. Duis mattis at ligula quis faucibus. Donec elementum lacus velit, a vehicula nunc gravida a. Phasellus eget nunc vehicula, varius velit a, maximus velit. Sed a suscipit nisi, non hendrerit felis. Proin mattis facilisis massa, quis elementum neque fringilla non.",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "The second section starts with the headline above. Move cursor to the end of this text and press enter until next page is generated in continuous section break mode.",
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,69 @@
// Simple example to add text to a document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph } from "../build";
const doc = new Document({
styles: {
default: {
document: {
run: {
color: "ff0000",
language: {
value: "es-ES",
},
},
},
},
paragraphStyles: [
{
id: "frenchNormal",
name: "French Normal",
basedOn: "Normal",
next: "Normal",
run: {
color: "999999",
italics: true,
language: {
value: "fr-FR",
},
},
},
{
id: "koreanNormal",
name: "Korean Normal",
basedOn: "Normal",
next: "Normal",
run: {
color: "0000ff",
bold: true,
language: {
value: "ko-KR",
},
},
},
],
},
sections: [
{
properties: {},
children: [
new Paragraph({
text: "Yo vivo en Granada, una ciudad pequeña que tiene monumentos muy importantes como la Alhambra. Aquí la comida es deliciosa y son famosos el gazpacho, el rebujito y el salmorejo.",
}),
new Paragraph({
text: "Toute personne a droit à l'éducation. L'éducation doit être gratuite, au moins en ce qui concerne l'enseignement élémentaire et fondamental. L'enseignement élémentaire est obligatoire. L'enseignement technique et professionnel doit être généralisé; l'accès aux études supérieures doit être ouvert en pleine égalité à tous en fonction de leur mérite.",
style: "frenchNormal",
}),
new Paragraph({
text: "대법관은 대법원장의 제청으로 국회의 동의를 얻어 대통령이 임명한다. 강화조약. 국가는 국민 모두의 생산 및 생활의 기반이 되는 국토의 효율적이고 균형있는 이용·개발과 보전을 위하여 법률이 정하는 바에 의하여 그에 관한 필요한 제한과 의무를 과할 수 있다, 국가는 청원에 대하여 심사할 의무를 진다.",
style: "koreanNormal",
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,60 @@
// Simple example apply positional tabs to a document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import {
Document,
Packer,
Paragraph,
PositionalTab,
Tab,
TextRun,
PositionalTabAlignment,
PositionalTabRelativeTo,
PositionalTabLeader,
} from "../build";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
children: [
new TextRun("Full name"),
new TextRun({
children: [
new PositionalTab({
alignment: PositionalTabAlignment.RIGHT,
relativeTo: PositionalTabRelativeTo.MARGIN,
leader: PositionalTabLeader.DOT,
}),
"John Doe",
],
bold: true,
}),
],
}),
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
children: [
new PositionalTab({
alignment: PositionalTabAlignment.CENTER,
relativeTo: PositionalTabRelativeTo.INDENT,
leader: PositionalTabLeader.HYPHEN,
}),
"Foo bar",
],
bold: true,
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -24,7 +24,7 @@
bold: true, bold: true,
}), }),
new docx.TextRun({ new docx.TextRun({
text: "\tGithub is the best", children: [new docx.Tab(), "Github is the best"],
bold: true, bold: true,
}), }),
], ],

View File

@ -11,22 +11,26 @@
- [Document](usage/document.md) - [Document](usage/document.md)
- [Sections](usage/sections.md) - [Sections](usage/sections.md)
- [Paragraph](usage/paragraph.md) - [Paragraph](usage/paragraph.md)
- [Text Frames](usage/text-frames.md)
- [Symbols](usage/symbols.md)
- [Text](usage/text.md) - [Text](usage/text.md)
- [Image](usage/images.md) - [Images](usage/images.md)
- [Headers & Footers](usage/headers-and-footers.md) - [Headers & Footers](usage/headers-and-footers.md)
- [Bullet Points](usage/bullet-points.md) - [Bullet Points](usage/bullet-points.md)
- [Hyperlinks](usage/hyperlinks.md) - [Hyperlinks](usage/hyperlinks.md)
- [Numbering](usage/numbering.md) - [Numbering](usage/numbering.md)
- [Tables](usage/tables.md) - [Tables](usage/tables.md)
- [Tab Stops](usage/tab-stops.md) - [Tabs](usage/tabs.md)
- [Table of Contents](usage/table-of-contents.md) - [Table of Contents](usage/table-of-contents.md)
- [Page Numbers](usage/page-numbers.md) - [Page Numbers](usage/page-numbers.md)
- [Change Tracking](usage/change-tracking.md) - [Change Tracking](usage/change-tracking.md)
- [Math](usage/math.md) - [Math](usage/math.md)
- [Text Frames](usage/text-frames.md) - [Comments](usage/comments.md)
- [Footnotes](usage/footnotes.md)
- [Fields](usage/fields.md)
- Styling - Styling
_ [Styling with JS](usage/styling-with-js.md) - [Styling with JS](usage/styling-with-js.md)
_ [Styling with XML](usage/styling-with-xml.md) - [Styling with XML](usage/styling-with-xml.md)
- Exporting - Exporting

View File

@ -22,20 +22,19 @@ const doc = new docx.Document({
### Full list of options: ### Full list of options:
- creator
* creator - description
* description - title
* title - subject
* subject - keywords
* keywords - lastModifiedBy
* lastModifiedBy - revision
* revision - externalStyles
* externalStyles - styles
* styles - numbering
* numbering - footnotes
* footnotes - hyperlinks
* hyperlinks - background
* background
### Change background color of Document ### Change background color of Document
@ -55,3 +54,87 @@ You can mix and match whatever properties you want, or provide no properties.
Various parts of the API require positioning arguments. The units are "20ths of a point" from the [OOXML](http://officeopenxml.com/index.php) specification. Various parts of the API require positioning arguments. The units are "20ths of a point" from the [OOXML](http://officeopenxml.com/index.php) specification.
See [Lars Corneliussen's blog post](https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/) for more information and how to convert units. See [Lars Corneliussen's blog post](https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/) for more information and how to convert units.
## Compatibility
Compatibility Settings are optional settings used to preserve visual fidelity of documents created in earlier word processing applications. Some of these settings provide ability for specific behaviors, described in detail below; and others simply instruct applications to mimic the behavior of an existing word processing application.
```ts
const doc = new docx.Document({
compatibility: {
version: 15,
doNotExpandShiftReturn: true,
},
});
```
### Compatibility Options
| Property | Type | Notes | Possible Values |
| ----------------------------------- | --------- | -------- | ---------------------------- |
| version | `number` | Optional | `15`, `16`, `17` |
| useSingleBorderforContiguousCells | `boolean` | Optional | `true`, `false`, `undefined` |
| wordPerfectJustification | `boolean` | Optional | `true`, `false`, `undefined` |
| noTabStopForHangingIndent | `boolean` | Optional | `true`, `false`, `undefined` |
| noLeading | `boolean` | Optional | `true`, `false`, `undefined` |
| spaceForUnderline | `boolean` | Optional | `true`, `false`, `undefined` |
| noColumnBalance | `boolean` | Optional | `true`, `false`, `undefined` |
| balanceSingleByteDoubleByteWidth | `boolean` | Optional | `true`, `false`, `undefined` |
| noExtraLineSpacing | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotLeaveBackslashAlone | `boolean` | Optional | `true`, `false`, `undefined` |
| underlineTrailingSpaces | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotExpandShiftReturn | `boolean` | Optional | `true`, `false`, `undefined` |
| spacingInWholePoints | `boolean` | Optional | `true`, `false`, `undefined` |
| lineWrapLikeWord6 | `boolean` | Optional | `true`, `false`, `undefined` |
| printBodyTextBeforeHeader | `boolean` | Optional | `true`, `false`, `undefined` |
| printColorsBlack | `boolean` | Optional | `true`, `false`, `undefined` |
| spaceWidth | `boolean` | Optional | `true`, `false`, `undefined` |
| showBreaksInFrames | `boolean` | Optional | `true`, `false`, `undefined` |
| subFontBySize | `boolean` | Optional | `true`, `false`, `undefined` |
| suppressBottomSpacing | `boolean` | Optional | `true`, `false`, `undefined` |
| suppressTopSpacing | `boolean` | Optional | `true`, `false`, `undefined` |
| suppressSpacingAtTopOfPage | `boolean` | Optional | `true`, `false`, `undefined` |
| suppressTopSpacingWP | `boolean` | Optional | `true`, `false`, `undefined` |
| suppressSpBfAfterPgBrk | `boolean` | Optional | `true`, `false`, `undefined` |
| swapBordersFacingPages | `boolean` | Optional | `true`, `false`, `undefined` |
| convertMailMergeEsc | `boolean` | Optional | `true`, `false`, `undefined` |
| truncateFontHeightsLikeWP6 | `boolean` | Optional | `true`, `false`, `undefined` |
| macWordSmallCaps | `boolean` | Optional | `true`, `false`, `undefined` |
| usePrinterMetrics | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotSuppressParagraphBorders | `boolean` | Optional | `true`, `false`, `undefined` |
| wrapTrailSpaces | `boolean` | Optional | `true`, `false`, `undefined` |
| footnoteLayoutLikeWW8 | `boolean` | Optional | `true`, `false`, `undefined` |
| shapeLayoutLikeWW8 | `boolean` | Optional | `true`, `false`, `undefined` |
| alignTablesRowByRow | `boolean` | Optional | `true`, `false`, `undefined` |
| forgetLastTabAlignment | `boolean` | Optional | `true`, `false`, `undefined` |
| adjustLineHeightInTable | `boolean` | Optional | `true`, `false`, `undefined` |
| autoSpaceLikeWord95 | `boolean` | Optional | `true`, `false`, `undefined` |
| noSpaceRaiseLower | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotUseHTMLParagraphAutoSpacing | `boolean` | Optional | `true`, `false`, `undefined` |
| layoutRawTableWidth | `boolean` | Optional | `true`, `false`, `undefined` |
| layoutTableRowsApart | `boolean` | Optional | `true`, `false`, `undefined` |
| useWord97LineBreakRules | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotBreakWrappedTables | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotSnapToGridInCell | `boolean` | Optional | `true`, `false`, `undefined` |
| selectFieldWithFirstOrLastCharacter | `boolean` | Optional | `true`, `false`, `undefined` |
| applyBreakingRules | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotWrapTextWithPunctuation | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotUseEastAsianBreakRules | `boolean` | Optional | `true`, `false`, `undefined` |
| useWord2002TableStyleRules | `boolean` | Optional | `true`, `false`, `undefined` |
| growAutofit | `boolean` | Optional | `true`, `false`, `undefined` |
| useFELayout | `boolean` | Optional | `true`, `false`, `undefined` |
| useNormalStyleForList | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotUseIndentAsNumberingTabStop | `boolean` | Optional | `true`, `false`, `undefined` |
| useAlternateEastAsianLineBreakRules | `boolean` | Optional | `true`, `false`, `undefined` |
| allowSpaceOfSameStyleInTable | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotSuppressIndentation | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotAutofitConstrainedTables | `boolean` | Optional | `true`, `false`, `undefined` |
| autofitToFirstFixedWidthCell | `boolean` | Optional | `true`, `false`, `undefined` |
| underlineTabInNumberingList | `boolean` | Optional | `true`, `false`, `undefined` |
| displayHangulFixedWidth | `boolean` | Optional | `true`, `false`, `undefined` |
| splitPgBreakAndParaMark | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotVerticallyAlignCellWithSp | `boolean` | Optional | `true`, `false`, `undefined` |
| doNotBreakConstrainedForcedTable | `boolean` | Optional | `true`, `false`, `undefined` |
| ignoreVerticalAlignmentInTextboxes | `boolean` | Optional | `true`, `false`, `undefined` |
| useAnsiKerningPairs | `boolean` | Optional | `true`, `false`, `undefined` |
| cachedColumnBalance | `boolean` | Optional | `true`, `false`, `undefined` |

View File

@ -252,13 +252,36 @@ const image = new ImageRun({
}); });
``` ```
## Alternative Text
Specifies common non-visual DrawingML properties. A name, title and description for a picture can be specified.
```ts
const image = new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
altText: {
title: "This is an ultimate title",
description: "This is an ultimate image",
name: "My Ultimate Image",
},
});
```
### Options
| Property | Type | Notes | Possible Values |
| ----------- | -------- | -------- | ------------------------------------ |
| name | `string` | Required | `Specimen A` |
| title | `string` | Required | `My awesome title of my image` |
| description | `string` | Required | `My awesome description of my image` |
## Examples ## Examples
### Add image to the document ### Add image to the document
Importing Images from file system path Importing Images from file system path
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/5-images.ts ':include') [Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/5-images.ts ":include")
_Source: https://github.com/dolanmiu/docx/blob/master/demo/5-images.ts_ _Source: https://github.com/dolanmiu/docx/blob/master/demo/5-images.ts_
@ -266,7 +289,7 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/5-images.ts_
Example showing how to add image to headers and footers Example showing how to add image to headers and footers
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/9-images-in-header-and-footer.ts ':include') [Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/9-images-in-header-and-footer.ts ":include")
_Source: https://github.com/dolanmiu/docx/blob/master/demo/9-images-in-header-and-footer.ts_ _Source: https://github.com/dolanmiu/docx/blob/master/demo/9-images-in-header-and-footer.ts_
@ -274,6 +297,6 @@ _Source: https://github.com/dolanmiu/docx/blob/master/demo/9-images-in-header-an
Example showing how to float images on top of text and optimally give a `margin` Example showing how to float images on top of text and optimally give a `margin`
[Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/38-text-wrapping.ts ':include') [Example](https://raw.githubusercontent.com/dolanmiu/docx/master/demo/38-text-wrapping.ts ":include")
_Source: https://github.com/dolanmiu/docx/blob/master/demo/38-text-wrapping.ts_ _Source: https://github.com/dolanmiu/docx/blob/master/demo/38-text-wrapping.ts_

View File

@ -86,3 +86,34 @@ topLevelP.setNumbering(concrete, 0);
subP.setNumbering(concrete, 1); subP.setNumbering(concrete, 1);
subSubP.setNumbering(concrete, 2); 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=[
{
level: 0,
format: "decimal",
text: "%1.",
alignment: AlignmentType.START,
suffix: LevelSuffix.NOTHING, // Cancel intent
}]
```

View File

@ -60,29 +60,29 @@ const doc = new Document({
This is the list of options for a paragraph. A detailed explanation is below: This is the list of options for a paragraph. A detailed explanation is below:
| Property | Type | Mandatory? | Possible Values | | Property | Type | Mandatory? | Possible Values |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------- | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [text](#text) | `string` | Optional | | | [text](#text) | `string` | Optional | |
| [heading](#heading) | `HeadingLevel` | Optional | `HEADING_1`, `HEADING_2`, `HEADING_3`, `HEADING_4`, `HEADING_5`, `HEADING_6`, `TITLE` | | [heading](#heading) | `HeadingLevel` | Optional | `HEADING_1`, `HEADING_2`, `HEADING_3`, `HEADING_4`, `HEADING_5`, `HEADING_6`, `TITLE` |
| [border](#border) | `IBorderOptions` | Optional | `top`, `bottom`, `left`, `right`. Each of these are of type IBorderPropertyOptions. Click here for Example | | [border](#border) | `IBorderOptions` | Optional | `top`, `bottom`, `left`, `right`. Each of these are of type IBorderPropertyOptions. Click here for Example |
| [spacing](#spacing) | `ISpacingProperties` | Optional | See below for ISpacingProperties | | [spacing](#spacing) | `ISpacingProperties` | Optional | See below for ISpacingProperties |
| [outlineLevel](#outline-level) | `number` | Optional | | | [outlineLevel](#outline-level) | `number` | Optional | |
| alignment | `AlignmentType` | Optional | | | alignment | `AlignmentType` | Optional | `START`, `CENTER`, `END`, `BOTH`, `MEDIUM_KASHIDA`, `DISTRIBUTE`, `NUM_TAB`, `HIGH_KASHIDA`, `LOW_KASHIDA`, `THAI_DISTRIBUTE`, `LEFT`, `RIGHT`, `JUSTIFIED` |
| heading | `HeadingLevel` | Optional | | | heading | `HeadingLevel` | Optional | |
| bidirectional | `boolean` | Optional | | | bidirectional | `boolean` | Optional | |
| thematicBreak | `boolean` | Optional | | | thematicBreak | `boolean` | Optional | |
| pageBreakBefore | `boolean` | Optional | | | pageBreakBefore | `boolean` | Optional | |
| contextualSpacing | `boolean` | Optional | | | contextualSpacing | `boolean` | Optional | |
| indent | `IIndentAttributesProperties` | Optional | | | indent | `IIndentAttributesProperties` | Optional | |
| keepLines | `boolean` | Optional | | | keepLines | `boolean` | Optional | |
| keepNext | `boolean` | Optional | | | keepNext | `boolean` | Optional | |
| children | `(TextRun or ImageRun or Hyperlink)[]` | Optional | | | children | `(TextRun or ImageRun or Hyperlink)[]` | Optional | |
| style | `string` | Optional | | | style | `string` | Optional | |
| [tabStop](usage/tab-stops) | `{ left?: ITabStopOptions; right?: ITabStopOptions; maxRight?: { leader: LeaderType; }; center?: ITabStopOptions }` | Optional | | | [tabStop](usage/tab-stops) | `{ left?: ITabStopOptions; right?: ITabStopOptions; maxRight?: { leader: LeaderType; }; center?: ITabStopOptions }` | Optional | |
| [bullet](usage/bullet-points) | `{ level: number }` | Optional | | | [bullet](usage/bullet-points) | `{ level: number }` | Optional | |
| [numbering](usage/numbering) | `{ num: ConcreteNumbering; level: number; custom?: boolean }` | Optional | | | [numbering](usage/numbering) | `{ num: ConcreteNumbering; level: number; custom?: boolean }` | Optional | |
| [widowControl](#widow-control) | `boolean` | Optional | | | [widowControl](#widow-control) | `boolean` | Optional | |
| [frame](usage/text-frames.md) | `IFrameOptions` | Optional | | | [frame](usage/text-frames.md) | `IFrameOptions` | Optional | |
## Text ## Text
@ -111,7 +111,7 @@ const paragraph = new Paragraph({
## Border ## Border
Add borders to a `Paragraph`. Good for making the `Paragraph` stand out Add borders to a `Paragraph`. Good for making the `Paragraph` stand out. Border top and border bottom can be used as a horizontal rule (also known as horizontal line).
#### IBorderPropertyOptions #### IBorderPropertyOptions
@ -180,12 +180,14 @@ Adding spacing between paragraphs
### ISpacingProperties ### ISpacingProperties
| Property | Type | Notes | Possible Values | | Property | Type | Notes | Possible Values |
| -------- | -------------- | -------- | ----------------------------- | | -------- | -------------- | -------- | -------------------------------------- |
| after | `number` | Optional | | | after | `number` | Optional | |
| before | `number` | Optional | | | before | `number` | Optional | |
| line | `number` | Optional | | | line | `number` | Optional | |
| lineRule | `LineRuleType` | Optional | `AT_LEAST`, `EXACTLY`, `AUTO` | | lineRule | `LineRuleType` | Optional | `AT_LEAST`, `EXACTLY`, `EXACT`, `AUTO` |
Note: The `lineRule` property has different values depending on the version of Word you are using. The `EXACTLY` value is only available in Word 2016 and above. Use `EXACT` for greater support, including LibreOffice etc. Read this issue for more information: https://github.com/dolanmiu/docx/issues/1773.
**Example:** **Example:**

View File

@ -1,121 +0,0 @@
# Tab Stops
> Tab stops are useful, if you are unclear of what they are, [here is a link explaining](https://en.wikipedia.org/wiki/Tab_stop). It enables side by side text which is nicely laid out without the need for tables, or constantly pressing space bar.
!> **Note**: The unit of measurement for a tab stop is in [DXA](https://stackoverflow.com/questions/14360183/default-wordml-unit-measurement-pixel-or-point-or-inches)
![Word 2013 Tabs](https://support.content.office.net/en-us/media/d75ca75d-9fe9-4d46-9a8b-4534c13acbc5.png "Word 2013 Tab Stops")
Simply declare the tab stops on the paragraph, as shown below. Use the tab character `\t` to indicate the tab position within the `text` property of a `TextRun`. Adding multiple `tabStops` will mean you can add additional `\t` characters until the desired `tabStop` is selected. Example is shown below.
## Example
```ts
const paragraph = new Paragraph({
children: [new TextRun({ text: "Hey everyone", bold: true}), new TextRun("\t11th November 1999")],
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
],
});
```
The example above will create a left aligned text, and a right aligned text on the same line. The laymans approach to this problem would be to either use text boxes or tables. Not ideal!
```ts
const paragraph = new Paragraph({
children: [new TextRun("\t\tSecond tab stop here I come!")],
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
{
type: TabStopType.LEFT,
position: 1000,
},
],
});
```
The above shows the use of two tab stops, and how to select/use it.
You can add multiple tab stops of the same `type` too.
```ts
const paragraph = new Paragraph({
children: [new TextRun("Multiple \ttab \tstops!")],
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
{
type: TabStopType.RIGHT,
position: 1000,
},
],
});
```
## Left Tab Stop
```ts
const paragraph = new Paragraph({
tabStops: [
{
type: TabStopType.LEFT,
position: 2268,
},
],
});
```
2268 is the distance from the left side.
## Center Tab Stop
```ts
const paragraph = new Paragraph({
tabStops: [
{
type: TabStopType.CENTER,
position: 2268,
},
],
});
```
2268 is the distance from the center.
## Right Tab Stop
```ts
const paragraph = new Paragraph({
tabStops: [
{
type: TabStopType.RIGHT,
position: 2268,
},
],
});
```
2268 is the distance from the left side.
## Max Right Tab Stop
```ts
const paragraph = new Paragraph({
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
],
});
```
This will create a tab stop on the very edge of the right hand side. Handy for right aligning and left aligning text on the same line.

184
docs/usage/tabs.md Normal file
View File

@ -0,0 +1,184 @@
# Tabs and Tab Stops
## Tab Stops
> Tab stops are useful, if you are unclear of what they are, [here is a link explaining](https://en.wikipedia.org/wiki/Tab_stop). It enables side by side text which is nicely laid out without the need for tables, or constantly pressing space bar.
!> **Note**: The unit of measurement for a tab stop is in [DXA](https://stackoverflow.com/questions/14360183/default-wordml-unit-measurement-pixel-or-point-or-inches)
![Word 2013 Tabs](https://support.content.office.net/en-us/media/d75ca75d-9fe9-4d46-9a8b-4534c13acbc5.png "Word 2013 Tab Stops")
Simply declare the tab stops on the paragraph, as shown below. Use the tab character `\t` or add the `new Tab()` child to indicate the tab position within the `text` property of a `TextRun`. Adding multiple `tabStops` will mean you can add additional `\t` characters until the desired `tabStop` is selected. Example is shown below.
### Example
```ts
const paragraph = new Paragraph({
children: [
new TextRun({ text: "Hey everyone", bold: true }),
new TextRun("\t11th November 1999"),
new TextRun({
children: [new Tab(), "11th November 1999"],
}),
],
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
],
});
```
The example above will create a left aligned text, and a right aligned text on the same line. The laymans approach to this problem would be to either use text boxes or tables. Not ideal!
```ts
const paragraph = new Paragraph({
children: [new TextRun("\t\tSecond tab stop here I come!")],
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
{
type: TabStopType.LEFT,
position: 1000,
},
],
});
```
The above shows the use of two tab stops, and how to select/use it.
You can add multiple tab stops of the same `type` too.
```ts
const paragraph = new Paragraph({
children: [new TextRun("Multiple \ttab \tstops!")],
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
{
type: TabStopType.RIGHT,
position: 1000,
},
],
});
const paragraph = new Paragraph({
children: [
new TextRun({
children: ["Multiple ", new Tab(), "tab ", new Tab(), "stops!"],
}),
],
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
{
type: TabStopType.RIGHT,
position: 1000,
},
],
});
```
### Left Tab Stop
```ts
const paragraph = new Paragraph({
tabStops: [
{
type: TabStopType.LEFT,
position: 2268,
},
],
});
```
2268 is the distance from the left side.
### Center Tab Stop
```ts
const paragraph = new Paragraph({
tabStops: [
{
type: TabStopType.CENTER,
position: 2268,
},
],
});
```
2268 is the distance from the center.
### Right Tab Stop
```ts
const paragraph = new Paragraph({
tabStops: [
{
type: TabStopType.RIGHT,
position: 2268,
},
],
});
```
2268 is the distance from the left side.
### Max Right Tab Stop
```ts
const paragraph = new Paragraph({
tabStops: [
{
type: TabStopType.RIGHT,
position: TabStopPosition.MAX,
},
],
});
```
This will create a tab stop on the very edge of the right hand side. Handy for right aligning and left aligning text on the same line.
## Positional Tabs
> Positional tab allow you to create a tab stop that is relative to the margin, or the page. This is useful if you want to create a table of contents, or a table of figures.
They are easier to use than the normal tab stops, as you can use the `PositionalTab` class to create a tab stop, and then add the text to the `TextRun` children. Useful for most cases.
![Word Positional Tabs](https://user-images.githubusercontent.com/26860966/209019464-d4b50236-c324-4cdb-8139-b9d172b1b993.png "Word Positional Tabs")
### Example
```ts
new Paragraph({
children: [
new TextRun("Full name"),
new TextRun({
children: [
new PositionalTab({
alignment: PositionalTabAlignment.RIGHT,
relativeTo: PositionalTabRelativeTo.MARGIN,
leader: PositionalTabLeader.DOT,
}),
"John Doe",
],
bold: true,
}),
],
}),
```
### Options
| Option | Type | Description | Possible Values |
| ---------- | ------------------------- | ------------------------------------- | ------------------------------------------------------------- |
| alignment | `PositionalTabAlignment` | The alignment of the tab stop | `LEFT`, `RIGHT`, `CENTER` |
| relativeTo | `PositionalTabRelativeTo` | The relative position of the tab stop | `MARGIN`, `INDENT` |
| leader | `PositionalTabLeader` | The leader of the tab stop | `NONE`, `DOT`, `HYPHEN`, `UNDERSCORE`, `MIDDLE_DOT`, `EQUALS` |

View File

@ -151,6 +151,28 @@ const text = new TextRun({
}); });
``` ```
### Vanish and SpecVanish
You may want to hide your text in your document.
`Vanish` should affect the normal display of text, but an application may have settings to force hidden text to be displayed.
```ts
const text = new TextRun({
text: "This text will be hidden",
vanish: true,
});
```
`SpecVanish` was typically used to ensure that a paragraph style can be applied to a part of a paragraph, and still appear as in the Table of Contents (which in previous word processors would ignore the use of the style if it were being used as a character style).
```ts
const text = new TextRun({
text: "This text will be hidden forever.",
specVanish: true,
});
```
## Break ## Break
Sometimes you would want to put text underneath another line of text but inside the same paragraph. Sometimes you would want to put text underneath another line of text but inside the same paragraph.

4591
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "docx", "name": "docx",
"version": "7.5.0", "version": "7.8.2",
"description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.", "description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",
"main": "build/index.js", "main": "build/index.js",
"scripts": { "scripts": {
@ -52,7 +52,7 @@
"dependencies": { "dependencies": {
"@types/node": "^18.0.0", "@types/node": "^18.0.0",
"jszip": "^3.1.5", "jszip": "^3.1.5",
"nanoid": "^3.1.20", "nanoid": "^3.3.4",
"xml": "^1.0.1", "xml": "^1.0.1",
"xml-js": "^1.6.8" "xml-js": "^1.6.8"
}, },
@ -65,7 +65,7 @@
"devDependencies": { "devDependencies": {
"@types/chai": "^4.2.15", "@types/chai": "^4.2.15",
"@types/glob": "^8.0.0", "@types/glob": "^8.0.0",
"@types/mocha": "^9.0.0", "@types/mocha": "^10.0.0",
"@types/prompt": "^1.1.1", "@types/prompt": "^1.1.1",
"@types/request-promise": "^4.1.42", "@types/request-promise": "^4.1.42",
"@types/shelljs": "^0.8.9", "@types/shelljs": "^0.8.9",
@ -75,16 +75,16 @@
"@typescript-eslint/eslint-plugin": "^5.36.1", "@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1", "@typescript-eslint/parser": "^5.36.1",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"chai": "^3.5.0", "chai": "^4.3.6",
"cspell": "^6.2.2", "cspell": "^6.2.2",
"docsify-cli": "^4.3.0", "docsify-cli": "^4.3.0",
"eslint": "^8.23.0", "eslint": "^8.23.0",
"eslint-plugin-functional": "^4.3.1", "eslint-plugin-functional": "^5.0.1",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.3.6", "eslint-plugin-jsdoc": "^39.3.6",
"eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-unicorn": "^43.0.2", "eslint-plugin-unicorn": "^45.0.0",
"glob": "^8.0.1", "glob": "^8.0.1",
"jszip": "^3.1.5", "jszip": "^3.1.5",
"mocha": "^10.0.0", "mocha": "^10.0.0",
@ -96,19 +96,19 @@
"replace-in-file": "^6.2.0", "replace-in-file": "^6.2.0",
"request": "^2.88.0", "request": "^2.88.0",
"request-promise": "^4.2.2", "request-promise": "^4.2.2",
"rimraf": "^3.0.2", "rimraf": "^4.0.4",
"shelljs": "^0.8.4", "shelljs": "^0.8.4",
"sinon": "^14.0.0", "sinon": "^15.0.0",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"ts-loader": "^9.0.0", "ts-loader": "^9.0.0",
"ts-node": "^10.2.1", "ts-node": "^10.2.1",
"tsconfig-paths": "^4.0.0", "tsconfig-paths": "^4.0.0",
"tsconfig-paths-webpack-plugin": "^4.0.0", "tsconfig-paths-webpack-plugin": "^4.0.0",
"typedoc": "^0.23.2", "typedoc": "^0.23.2",
"typescript": "4.7.4", "typescript": "4.9.5",
"unzipper": "^0.10.11", "unzipper": "^0.10.11",
"webpack": "^5.28.0", "webpack": "^5.28.0",
"webpack-cli": "^4.6.0" "webpack-cli": "^5.0.0"
}, },
"engines": { "engines": {
"node": ">=10" "node": ">=10"

View File

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

View File

@ -74,6 +74,7 @@ export class Compiler {
this.formatter.format(file.Document.View, { this.formatter.format(file.Document.View, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -100,6 +101,7 @@ export class Compiler {
this.formatter.format(file.Document.Relationships, { this.formatter.format(file.Document.Relationships, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -125,6 +127,7 @@ export class Compiler {
this.formatter.format(file.Styles, { this.formatter.format(file.Styles, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -144,6 +147,7 @@ export class Compiler {
this.formatter.format(file.CoreProperties, { this.formatter.format(file.CoreProperties, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -160,6 +164,7 @@ export class Compiler {
this.formatter.format(file.Numbering, { this.formatter.format(file.Numbering, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -176,6 +181,7 @@ export class Compiler {
this.formatter.format(file.FileRelationships, { this.formatter.format(file.FileRelationships, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -191,6 +197,7 @@ export class Compiler {
this.formatter.format(headerWrapper.View, { this.formatter.format(headerWrapper.View, {
viewWrapper: headerWrapper, viewWrapper: headerWrapper,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -214,6 +221,7 @@ export class Compiler {
this.formatter.format(headerWrapper.Relationships, { this.formatter.format(headerWrapper.Relationships, {
viewWrapper: headerWrapper, viewWrapper: headerWrapper,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -230,6 +238,7 @@ export class Compiler {
this.formatter.format(footerWrapper.View, { this.formatter.format(footerWrapper.View, {
viewWrapper: footerWrapper, viewWrapper: footerWrapper,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -253,6 +262,7 @@ export class Compiler {
this.formatter.format(footerWrapper.Relationships, { this.formatter.format(footerWrapper.Relationships, {
viewWrapper: footerWrapper, viewWrapper: footerWrapper,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -269,6 +279,7 @@ export class Compiler {
this.formatter.format(headerWrapper.View, { this.formatter.format(headerWrapper.View, {
viewWrapper: headerWrapper, viewWrapper: headerWrapper,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -293,6 +304,7 @@ export class Compiler {
this.formatter.format(footerWrapper.View, { this.formatter.format(footerWrapper.View, {
viewWrapper: footerWrapper, viewWrapper: footerWrapper,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -317,6 +329,7 @@ export class Compiler {
this.formatter.format(file.ContentTypes, { this.formatter.format(file.ContentTypes, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -332,6 +345,7 @@ export class Compiler {
this.formatter.format(file.CustomProperties, { this.formatter.format(file.CustomProperties, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -348,6 +362,7 @@ export class Compiler {
this.formatter.format(file.AppProperties, { this.formatter.format(file.AppProperties, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -363,7 +378,8 @@ export class Compiler {
data: xml( data: xml(
this.formatter.format(file.FootNotes.View, { this.formatter.format(file.FootNotes.View, {
viewWrapper: file.FootNotes, viewWrapper: file.FootNotes,
file: file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -378,7 +394,8 @@ export class Compiler {
data: xml( data: xml(
this.formatter.format(file.FootNotes.Relationships, { this.formatter.format(file.FootNotes.Relationships, {
viewWrapper: file.FootNotes, viewWrapper: file.FootNotes,
file: file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -394,6 +411,7 @@ export class Compiler {
this.formatter.format(file.Settings, { this.formatter.format(file.Settings, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,
@ -410,6 +428,7 @@ export class Compiler {
this.formatter.format(file.Comments, { this.formatter.format(file.Comments, {
viewWrapper: file.Document, viewWrapper: file.Document,
file, file,
stack: [],
}), }),
{ {
indent: prettify, indent: prettify,

View File

@ -1,4 +1,5 @@
import { ICommentsOptions } from "@file/paragraph/run/comment-run"; import { ICommentsOptions } from "@file/paragraph/run/comment-run";
import { ICompatibilityOptions } from "@file/settings/compatibility";
import { StringContainer, XmlComponent } from "@file/xml-components"; import { StringContainer, XmlComponent } from "@file/xml-components";
import { dateTimeValue } from "@util/values"; import { dateTimeValue } from "@util/values";
@ -35,6 +36,7 @@ export interface IPropertiesOptions {
readonly updateFields?: boolean; readonly updateFields?: boolean;
}; };
readonly compatabilityModeVersion?: number; readonly compatabilityModeVersion?: number;
readonly compatibility?: ICompatibilityOptions;
readonly customProperties?: readonly ICustomPropertyOptions[]; readonly customProperties?: readonly ICustomPropertyOptions[];
readonly evenAndOddHeaderAndFooters?: boolean; readonly evenAndOddHeaderAndFooters?: boolean;
} }

View File

@ -1,25 +1,23 @@
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { twipsMeasureValue } from "@util/values"; import { PositiveUniversalMeasure, twipsMeasureValue } from "@util/values";
export interface IColumnAttributes { // <xsd:complexType name="CT_Column">
readonly width: number | string; // <xsd:attribute name="w" type="s:ST_TwipsMeasure" use="optional" />
readonly space?: number | string; // <xsd:attribute name="space" type="s:ST_TwipsMeasure" use="optional" default="0" />
} // </xsd:complexType>
export class ColumnAttributes extends XmlAttributeComponent<IColumnAttributes> { type IColumnAttributes = {
protected readonly xmlKeys = { readonly width: number | PositiveUniversalMeasure;
width: "w:w", readonly space?: number | PositiveUniversalMeasure;
space: "w:space", };
};
}
export class Column extends XmlComponent { export class Column extends XmlComponent {
public constructor({ width, space }: IColumnAttributes) { public constructor({ width, space }: IColumnAttributes) {
super("w:col"); super("w:col");
this.root.push( this.root.push(
new ColumnAttributes({ new NextAttributeComponent<IColumnAttributes>({
width: twipsMeasureValue(width), width: { key: "w:w", value: twipsMeasureValue(width) },
space: space === undefined ? undefined : twipsMeasureValue(space), space: { key: "w:space", value: space === undefined ? undefined : twipsMeasureValue(space) },
}), }),
); );
} }

View File

@ -1,5 +1,5 @@
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { decimalNumber, twipsMeasureValue } from "@util/values"; import { decimalNumber, PositiveUniversalMeasure, twipsMeasureValue } from "@util/values";
import { Column } from "./column"; import { Column } from "./column";
@ -12,32 +12,23 @@ import { Column } from "./column";
// <xsd:attribute name="num" type="ST_DecimalNumber" use="optional" default="1"/> // <xsd:attribute name="num" type="ST_DecimalNumber" use="optional" default="1"/>
// <xsd:attribute name="sep" type="s:ST_OnOff" use="optional"/> // <xsd:attribute name="sep" type="s:ST_OnOff" use="optional"/>
// </xsd:complexType> // </xsd:complexType>
export interface IColumnsAttributes { export type IColumnsAttributes = {
readonly space?: number | string; readonly space?: number | PositiveUniversalMeasure;
readonly count?: number; readonly count?: number;
readonly separate?: boolean; readonly separate?: boolean;
readonly equalWidth?: boolean; readonly equalWidth?: boolean;
readonly children?: readonly Column[]; readonly children?: readonly Column[];
} };
export class ColumnsAttributes extends XmlAttributeComponent<IColumnsAttributes> {
protected readonly xmlKeys = {
space: "w:space",
count: "w:num",
separate: "w:sep",
equalWidth: "w:equalWidth",
};
}
export class Columns extends XmlComponent { export class Columns extends XmlComponent {
public constructor({ space, count, separate, equalWidth, children }: IColumnsAttributes) { public constructor({ space, count, separate, equalWidth, children }: IColumnsAttributes) {
super("w:cols"); super("w:cols");
this.root.push( this.root.push(
new ColumnsAttributes({ new NextAttributeComponent<Omit<IColumnsAttributes, "children">>({
space: space === undefined ? undefined : twipsMeasureValue(space), space: { key: "w:space", value: space === undefined ? undefined : twipsMeasureValue(space) },
count: count === undefined ? undefined : decimalNumber(count), count: { key: "w:num", value: count === undefined ? undefined : decimalNumber(count) },
separate, separate: { key: "w:sep", value: separate },
equalWidth, equalWidth: { key: "w:equalWidth", value: equalWidth },
}), }),
); );

View File

@ -1,6 +1,6 @@
// http://officeopenxml.com/WPsectionLineNumbering.php // http://officeopenxml.com/WPsectionLineNumbering.php
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { decimalNumber, twipsMeasureValue } from "@util/values"; import { decimalNumber, PositiveUniversalMeasure, twipsMeasureValue } from "@util/values";
// <xsd:simpleType name="ST_LineNumberRestart"> // <xsd:simpleType name="ST_LineNumberRestart">
// <xsd:restriction base="xsd:string"> // <xsd:restriction base="xsd:string">
@ -26,27 +26,23 @@ export interface ILineNumberAttributes {
readonly countBy?: number; readonly countBy?: number;
readonly start?: number; readonly start?: number;
readonly restart?: LineNumberRestartFormat; readonly restart?: LineNumberRestartFormat;
readonly distance?: number | string; readonly distance?: number | PositiveUniversalMeasure;
}
export class LineNumberAttributes extends XmlAttributeComponent<ILineNumberAttributes> {
protected readonly xmlKeys = {
countBy: "w:countBy",
start: "w:start",
restart: "w:restart",
distance: "w:distance",
};
} }
export class LineNumberType extends XmlComponent { export class LineNumberType extends XmlComponent {
public constructor({ countBy, start, restart, distance }: ILineNumberAttributes) { public constructor({ countBy, start, restart, distance }: ILineNumberAttributes) {
super("w:lnNumType"); super("w:lnNumType");
this.root.push( this.root.push(
new LineNumberAttributes({ new NextAttributeComponent<{
countBy: countBy === undefined ? undefined : decimalNumber(countBy), readonly countBy?: number;
start: start === undefined ? undefined : decimalNumber(start), readonly start?: number;
restart, readonly restart?: LineNumberRestartFormat;
distance: distance === undefined ? undefined : twipsMeasureValue(distance), readonly distance?: number | PositiveUniversalMeasure;
}>({
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) },
}), }),
); );
} }

View File

@ -75,7 +75,7 @@ export class PageBorders extends IgnoreIfEmptyXmlComponent {
super("w:pgBorders"); super("w:pgBorders");
if (!options) { if (!options) {
return; return this;
} }
if (options.pageBorders) { if (options.pageBorders) {

View File

@ -1,5 +1,5 @@
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { signedTwipsMeasureValue, twipsMeasureValue } from "@util/values"; import { PositiveUniversalMeasure, signedTwipsMeasureValue, twipsMeasureValue, UniversalMeasure } from "@util/values";
// <xsd:complexType name="CT_PageMar"> // <xsd:complexType name="CT_PageMar">
// <xsd:attribute name="top" type="ST_SignedTwipsMeasure" use="required"/> // <xsd:attribute name="top" type="ST_SignedTwipsMeasure" use="required"/>
@ -10,48 +10,36 @@ import { signedTwipsMeasureValue, twipsMeasureValue } from "@util/values";
// <xsd:attribute name="footer" type="s:ST_TwipsMeasure" use="required"/> // <xsd:attribute name="footer" type="s:ST_TwipsMeasure" use="required"/>
// <xsd:attribute name="gutter" type="s:ST_TwipsMeasure" use="required"/> // <xsd:attribute name="gutter" type="s:ST_TwipsMeasure" use="required"/>
// </xsd:complexType> // </xsd:complexType>
export interface IPageMarginAttributes { export type IPageMarginAttributes = {
readonly top?: number | string; readonly top?: number | UniversalMeasure;
readonly right?: number | string; readonly right?: number | PositiveUniversalMeasure;
readonly bottom?: number | string; readonly bottom?: number | UniversalMeasure;
readonly left?: number | string; readonly left?: number | PositiveUniversalMeasure;
readonly header?: number | string; readonly header?: number | PositiveUniversalMeasure;
readonly footer?: number | string; readonly footer?: number | PositiveUniversalMeasure;
readonly gutter?: number | string; readonly gutter?: number | PositiveUniversalMeasure;
} };
export class PageMarginAttributes extends XmlAttributeComponent<IPageMarginAttributes> {
protected readonly xmlKeys = {
top: "w:top",
right: "w:right",
bottom: "w:bottom",
left: "w:left",
header: "w:header",
footer: "w:footer",
gutter: "w:gutter",
};
}
export class PageMargin extends XmlComponent { export class PageMargin extends XmlComponent {
public constructor( public constructor(
top: number | string, top: number | UniversalMeasure,
right: number | string, right: number | PositiveUniversalMeasure,
bottom: number | string, bottom: number | UniversalMeasure,
left: number | string, left: number | PositiveUniversalMeasure,
header: number | string, header: number | PositiveUniversalMeasure,
footer: number | string, footer: number | PositiveUniversalMeasure,
gutter: number | string, gutter: number | PositiveUniversalMeasure,
) { ) {
super("w:pgMar"); super("w:pgMar");
this.root.push( this.root.push(
new PageMarginAttributes({ new NextAttributeComponent<IPageMarginAttributes>({
top: signedTwipsMeasureValue(top), top: { key: "w:top", value: signedTwipsMeasureValue(top) },
right: twipsMeasureValue(right), right: { key: "w:right", value: twipsMeasureValue(right) },
bottom: signedTwipsMeasureValue(bottom), bottom: { key: "w:bottom", value: signedTwipsMeasureValue(bottom) },
left: twipsMeasureValue(left), left: { key: "w:left", value: twipsMeasureValue(left) },
header: twipsMeasureValue(header), header: { key: "w:header", value: twipsMeasureValue(header) },
footer: twipsMeasureValue(footer), footer: { key: "w:footer", value: twipsMeasureValue(footer) },
gutter: twipsMeasureValue(gutter), gutter: { key: "w:gutter", value: twipsMeasureValue(gutter) },
}), }),
); );
} }

View File

@ -1,5 +1,5 @@
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { twipsMeasureValue } from "@util/values"; import { PositiveUniversalMeasure, twipsMeasureValue } from "@util/values";
// <xsd:simpleType name="ST_PageOrientation"> // <xsd:simpleType name="ST_PageOrientation">
// <xsd:restriction base="xsd:string"> // <xsd:restriction base="xsd:string">
@ -18,22 +18,14 @@ export enum PageOrientation {
// <xsd:attribute name="orient" type="ST_PageOrientation" use="optional"/> // <xsd:attribute name="orient" type="ST_PageOrientation" use="optional"/>
// <xsd:attribute name="code" type="ST_DecimalNumber" use="optional"/> // <xsd:attribute name="code" type="ST_DecimalNumber" use="optional"/>
// </xsd:complexType> // </xsd:complexType>
export interface IPageSizeAttributes { export type IPageSizeAttributes = {
readonly width?: number | string; readonly width?: number | PositiveUniversalMeasure;
readonly height?: number | string; readonly height?: number | PositiveUniversalMeasure;
readonly orientation?: PageOrientation; readonly orientation?: PageOrientation;
} };
export class PageSizeAttributes extends XmlAttributeComponent<IPageSizeAttributes> {
protected readonly xmlKeys = {
width: "w:w",
height: "w:h",
orientation: "w:orient",
};
}
export class PageSize extends XmlComponent { export class PageSize extends XmlComponent {
public constructor(width: number | string, height: number | string, orientation: PageOrientation) { public constructor(width: number | PositiveUniversalMeasure, height: number | PositiveUniversalMeasure, orientation: PageOrientation) {
super("w:pgSz"); super("w:pgSz");
const flip = orientation === PageOrientation.LANDSCAPE; const flip = orientation === PageOrientation.LANDSCAPE;
@ -42,10 +34,10 @@ export class PageSize extends XmlComponent {
const heightTwips = twipsMeasureValue(height); const heightTwips = twipsMeasureValue(height);
this.root.push( this.root.push(
new PageSizeAttributes({ new NextAttributeComponent<IPageSizeAttributes>({
width: flip ? heightTwips : widthTwips, width: { key: "w:w", value: flip ? heightTwips : widthTwips },
height: flip ? widthTwips : heightTwips, height: { key: "w:h", value: flip ? widthTwips : heightTwips },
orientation: orientation, orientation: { key: "w:orient", value: orientation },
}), }),
); );
} }

View File

@ -5,9 +5,9 @@ import { FooterWrapper } from "@file/footer-wrapper";
import { HeaderWrapper } from "@file/header-wrapper"; import { HeaderWrapper } from "@file/header-wrapper";
import { VerticalAlign, VerticalAlignElement } from "@file/vertical-align"; import { VerticalAlign, VerticalAlignElement } from "@file/vertical-align";
import { OnOffElement, XmlComponent } from "@file/xml-components"; import { OnOffElement, XmlComponent } from "@file/xml-components";
import { PositiveUniversalMeasure, UniversalMeasure } from "@util/values";
import { HeaderFooterReference, HeaderFooterReferenceType, HeaderFooterType } from "./properties/header-footer-reference"; import { HeaderFooterReference, HeaderFooterReferenceType, HeaderFooterType } from "./properties/header-footer-reference";
import { Columns, IColumnsAttributes } from "./properties/columns"; import { Columns, IColumnsAttributes } from "./properties/columns";
import { DocumentGrid, IDocGridAttributesProperties } from "./properties/doc-grid"; import { DocumentGrid, IDocGridAttributesProperties } from "./properties/doc-grid";
import { ILineNumberAttributes, LineNumberType } from "./properties/line-number"; import { ILineNumberAttributes, LineNumberType } from "./properties/line-number";
@ -76,10 +76,10 @@ export interface ISectionPropertiesOptions {
// </xsd:group> // </xsd:group>
export const sectionMarginDefaults = { export const sectionMarginDefaults = {
TOP: "1in", TOP: "1in" as UniversalMeasure,
RIGHT: "1in", RIGHT: "1in" as PositiveUniversalMeasure,
BOTTOM: "1in", BOTTOM: "1in" as UniversalMeasure,
LEFT: "1in", LEFT: "1in" as PositiveUniversalMeasure,
HEADER: 708, HEADER: 708,
FOOTER: 708, FOOTER: 708,
GUTTER: 0, GUTTER: 0,

View File

@ -8,7 +8,7 @@ import { DocumentAttributes } from "./document-attributes";
import { DocumentBackground, IDocumentBackgroundOptions } from "./document-background"; import { DocumentBackground, IDocumentBackgroundOptions } from "./document-background";
export interface IDocumentOptions { export interface IDocumentOptions {
readonly background: IDocumentBackgroundOptions; readonly background?: IDocumentBackgroundOptions;
} }
// <xsd:element name="document" type="CT_Document"/> // <xsd:element name="document" type="CT_Document"/>
@ -73,7 +73,9 @@ export class Document extends XmlComponent {
}), }),
); );
this.body = new Body(); this.body = new Body();
this.root.push(new DocumentBackground(options.background)); if (options.background) {
this.root.push(new DocumentBackground(options.background));
}
this.root.push(this.body); this.root.push(this.body);
} }

View File

@ -1,4 +1,8 @@
import { assert } from "chai"; import { assert, expect } from "chai";
import { SinonStub, stub } from "sinon";
import { Formatter } from "@export/formatter";
import * as convenienceFunctions from "@util/convenience-functions";
import { Utility } from "tests/utility"; import { Utility } from "tests/utility";
@ -36,6 +40,14 @@ const createAnchor = (drawingOptions: IDrawingOptions): Anchor =>
); );
describe("Anchor", () => { describe("Anchor", () => {
before(() => {
stub(convenienceFunctions, "uniqueNumericId").callsFake(() => 0);
});
after(() => {
(convenienceFunctions.uniqueNumericId as SinonStub).restore();
});
let anchor: Anchor; let anchor: Anchor;
describe("#constructor()", () => { describe("#constructor()", () => {
@ -362,5 +374,236 @@ describe("Anchor", () => {
relativeHeight: 120, relativeHeight: 120,
}); });
}); });
it("should create a Drawing with doc properties", () => {
anchor = createAnchor({
floating: {
verticalPosition: {
offset: 0,
},
horizontalPosition: {
offset: 0,
},
zIndex: 120,
},
docProperties: {
name: "test",
description: "test",
title: "test",
},
});
const tree = new Formatter().format(anchor);
expect(tree).to.deep.equal({
"wp:anchor": [
{
_attr: {
allowOverlap: "1",
behindDoc: "0",
distB: 0,
distL: 0,
distR: 0,
distT: 0,
layoutInCell: "1",
locked: "0",
relativeHeight: 120,
simplePos: "0",
},
},
{
"wp:simplePos": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"wp:positionH": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["0"],
},
],
},
{
"wp:positionV": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["0"],
},
],
},
{
"wp:extent": {
_attr: {
cx: 952500,
cy: 952500,
},
},
},
{
"wp:effectExtent": {
_attr: {
b: 0,
l: 0,
r: 0,
t: 0,
},
},
},
{
"wp:wrapNone": {},
},
{
"wp:docPr": {
_attr: {
descr: "test",
id: 0,
name: "test",
title: "test",
},
},
},
{
"wp:cNvGraphicFramePr": [
{
"a:graphicFrameLocks": {
_attr: {
noChangeAspect: 1,
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
},
},
},
],
},
{
"a:graphic": [
{
_attr: {
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
},
},
{
"a:graphicData": [
{
_attr: {
uri: "http://schemas.openxmlformats.org/drawingml/2006/picture",
},
},
{
"pic:pic": [
{
_attr: {
"xmlns:pic": "http://schemas.openxmlformats.org/drawingml/2006/picture",
},
},
{
"pic:nvPicPr": [
{
"pic:cNvPr": {
_attr: {
descr: "",
id: 0,
name: "",
},
},
},
{
"pic:cNvPicPr": [
{
"a:picLocks": {
_attr: {
noChangeArrowheads: 1,
noChangeAspect: 1,
},
},
},
],
},
],
},
{
"pic:blipFill": [
{
"a:blip": {
_attr: {
cstate: "none",
"r:embed": "rId{test.png}",
},
},
},
{
"a:srcRect": {},
},
{
"a:stretch": [
{
"a:fillRect": {},
},
],
},
],
},
{
"pic:spPr": [
{
_attr: {
bwMode: "auto",
},
},
{
"a:xfrm": [
{
_attr: {},
},
{
"a:off": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"a:ext": {
_attr: {
cx: 952500,
cy: 952500,
},
},
},
],
},
{
"a:prstGeom": [
{
_attr: {
prst: "rect",
},
},
{
"a:avLst": {},
},
],
},
],
},
],
},
],
},
],
},
],
});
});
}); });
}); });

View File

@ -90,7 +90,7 @@ export class Anchor extends XmlComponent {
this.root.push(new WrapNone()); this.root.push(new WrapNone());
} }
this.root.push(new DocProperties()); this.root.push(new DocProperties(drawingOptions.docProperties));
this.root.push(new GraphicFrameProperties()); this.root.push(new GraphicFrameProperties());
this.root.push(new Graphic(mediaData, transform)); this.root.push(new Graphic(mediaData, transform));
} }

View File

@ -1,13 +0,0 @@
import { XmlAttributeComponent } from "@file/xml-components";
export class DocPropertiesAttributes extends XmlAttributeComponent<{
readonly id?: number;
readonly name?: string;
readonly descr?: string;
}> {
protected readonly xmlKeys = {
id: "id",
name: "name",
descr: "descr",
};
}

View File

@ -0,0 +1,61 @@
import { expect } from "chai";
import { Formatter } from "@export/formatter";
import { createHyperlinkClick, createHyperlinkHover } from "./doc-properties-children";
describe("Document Properties Children", () => {
describe("#createHyperlinkClick", () => {
it("should create a Hyperlink Click component", () => {
const tree = new Formatter().format(createHyperlinkClick("1", false));
expect(tree).to.deep.equal({
"a:hlinkClick": {
_attr: {
"r:id": "rId1",
},
},
});
});
it("should create a Hyperlink Click component with xmlns:a", () => {
const tree = new Formatter().format(createHyperlinkClick("1", true));
expect(tree).to.deep.equal({
"a:hlinkClick": {
_attr: {
"r:id": "rId1",
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
},
},
});
});
});
describe("#createHyperlinkHover", () => {
it("should create a Hyperlink Hover component", () => {
const tree = new Formatter().format(createHyperlinkHover("1", false));
expect(tree).to.deep.equal({
"a:hlinkHover": {
_attr: {
"r:id": "rId1",
},
},
});
});
it("should create a Hyperlink Hover component with xmlns:a", () => {
const tree = new Formatter().format(createHyperlinkHover("1", true));
expect(tree).to.deep.equal({
"a:hlinkHover": {
_attr: {
"r:id": "rId1",
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
},
},
});
});
});
});

View File

@ -0,0 +1,57 @@
// <sequence>
// <element name="hlinkClick" type="CT_Hyperlink" minOccurs="0" maxOccurs="1" />
// <element name="hlinkHover" type="CT_Hyperlink" minOccurs="0" maxOccurs="1" />
// <element name="extLst" type="CT_OfficeArtExtensionList" minOccurs="0" maxOccurs="1" />
// </sequence>
import { BuilderElement, XmlComponent } from "@file/xml-components";
// <xsd:complexType name="CT_Hyperlink">
// <xsd:group ref="EG_PContent" minOccurs="0" maxOccurs="unbounded" />
// <xsd:attribute name="tgtFrame" type="s:ST_String" use="optional" />
// <xsd:attribute name="tooltip" type="s:ST_String" use="optional" />
// <xsd:attribute name="docLocation" type="s:ST_String" use="optional" />
// <xsd:attribute name="history" type="s:ST_OnOff" use="optional" />
// <xsd:attribute name="anchor" type="s:ST_String" use="optional" />
// <xsd:attribute ref="r:id" />
// </xsd:complexType>
// TODO: Implement the rest of the attributes
export const createHyperlinkClick = (linkId: string, hasXmlNs: boolean): XmlComponent =>
new BuilderElement({
name: "a:hlinkClick",
attributes: {
...(hasXmlNs
? {
xmlns: {
key: "xmlns:a",
value: "http://schemas.openxmlformats.org/drawingml/2006/main",
},
}
: {}),
id: {
key: "r:id",
value: `rId${linkId}`,
},
},
});
export const createHyperlinkHover = (linkId: string, hasXmlNs: boolean): XmlComponent =>
new BuilderElement({
name: "a:hlinkHover",
attributes: {
...(hasXmlNs
? {
xmlns: {
key: "xmlns:a",
value: "http://schemas.openxmlformats.org/drawingml/2006/main",
},
}
: {}),
id: {
key: "r:id",
value: `rId${linkId}`,
},
},
});

View File

@ -1,16 +1,67 @@
import { XmlComponent } from "@file/xml-components"; // https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_docPr_topic_ID0ES32OB.html
import { DocPropertiesAttributes } from "./doc-properties-attributes"; import { IContext, IXmlableObject, NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { ConcreteHyperlink } from "@file/paragraph";
import { uniqueNumericId } from "@util/convenience-functions";
import { createHyperlinkClick } from "./doc-properties-children";
// <complexType name="CT_NonVisualDrawingProps">
// <sequence>
// <element name="hlinkClick" type="CT_Hyperlink" minOccurs="0" maxOccurs="1" />
// <element name="hlinkHover" type="CT_Hyperlink" minOccurs="0" maxOccurs="1" />
// <element name="extLst" type="CT_OfficeArtExtensionList" minOccurs="0" maxOccurs="1" />
// </sequence>
// <attribute name="id" type="ST_DrawingElementId" use="required" />
// <attribute name="name" type="xsd:string" use="required" />
// <attribute name="descr" type="xsd:string" use="optional" default="" />
// <attribute name="hidden" type="xsd:boolean" use="optional" default="false" />
// </complexType>
export interface DocPropertiesOptions {
readonly name: string;
readonly description: string;
readonly title: string;
}
export class DocProperties extends XmlComponent { export class DocProperties extends XmlComponent {
public constructor() { public constructor({ name, description, title }: DocPropertiesOptions = { name: "", description: "", title: "" }) {
super("wp:docPr"); super("wp:docPr");
this.root.push( this.root.push(
new DocPropertiesAttributes({ new NextAttributeComponent({
id: 0, id: {
name: "", key: "id",
descr: "", value: uniqueNumericId(),
},
name: {
key: "name",
value: name,
},
description: {
key: "descr",
value: description,
},
title: {
key: "title",
value: title,
},
}), }),
); );
} }
public prepForXml(context: IContext): IXmlableObject | undefined {
for (let i = context.stack.length - 1; i >= 0; i--) {
const element = context.stack[i];
if (!(element instanceof ConcreteHyperlink)) {
continue;
}
this.root.push(createHyperlinkClick(element.linkId, true));
break;
}
return super.prepForXml(context);
}
} }

View File

@ -1,7 +1,11 @@
import { expect } from "chai"; import { expect } from "chai";
import { SinonStub, stub } from "sinon";
import { IContext } from "@file/xml-components";
import { Formatter } from "@export/formatter"; import { Formatter } from "@export/formatter";
import * as convenienceFunctions from "@util/convenience-functions";
import { ConcreteHyperlink, TextRun } from "../";
import { Drawing, IDrawingOptions } from "./drawing"; import { Drawing, IDrawingOptions } from "./drawing";
const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEfHx8eHh4nHR0lHBwkGyQjIyMiIiIgICAfHx8mHh4lHh4kHR0jHCMiGyIhISEgICAfHx8lHx8kHh4jHR0hHCEhISEgICAlHx8kHx8jHh4jHh4iHSIhHCEhISElICAkHx8jHx8jHh4iHh4iHSIhHSElICAkICAjHx8jHx8iHh4iHh4hHiEhHSEkICAjHx8iHx8iHx8hHh4hHiEkHSEjHSAjHx8iHx8iHx8hHh4kHiEkHiEjHSAiHx8hHx8hHh4kHiEjHiAjHSAiHx8iHx8hHx8kHh4jHiEjHiAjHiAiICAiHx8kHx8jHh4jHiEjHiAiHiAiHSAiHx8jHx8jHx8jHiAiHiAiHiAiHSAiHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8iHx8iHSAiHiAjHiAjHx8jHx8hHx8iHx8iHyAiHiAjHiAjHiAjHh4hHx8iHx8iHx8iHyAjHSAjHiAjHiAjHh4hHx8iHx8iHx8jHyAjHiAhHh4iHx8iHx8jHyAjHSAjHSAhHiAhHh4iHx8iHx8jHx8jHyAjHSAjHSAiHh4iHh4jHx8jHx8jHyAjHyAhHSAhHSAiHh4iHh4jHx8jHx8jHyAhHyAhHSAiHSAiHh4jHh4jHx8jHx8jHyAhHyAhHSAiHSAjHR4jHh4jHx8jHx8hHyAhHyAiHSAjHSAjHR4jHh4jHx8hHx8hHyAhHyAiHyAjHSAjHR4jHR4hHh4hHx8hHyAiHyAjHyAjHSAjHR4jHR4hHh4hHx8hHyAjHyAjHyAjHSAjHR4hHR4hHR4hHx8iHyAjHyAjHyAjHSAhHR4hHR4hHR4hHx8jHyAjHyAjHyAjHyC9S2xeAAAA7nRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFxgZGhscHR4fICEiIyQlJicoKSorLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZISUpLTE1OUFFSU1RVVllaW1xdXmBhYmNkZWZnaGprbG1ub3Byc3R1dnd4eXp8fn+AgYKDhIWGiImKi4yNj5CRkpOUlZaXmJmam5ydnp+goaKjpKaoqqusra6vsLGys7S1tri5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+fkZpVQAABcBJREFUGBntwftjlQMcBvDnnLNL22qzJjWlKLHFVogyty3SiFq6EZliqZGyhnSxsLlMRahYoZKRFcul5dKFCatYqWZaNKvWtrPz/A2+7/b27qRzec/lPfvl/XxgMplMJpPJZDKZAtA9HJ3ppnIez0KnSdtC0RCNznHdJrbrh85wdSlVVRaEXuoGamYi5K5430HNiTiEWHKJg05eRWgNfKeV7RxbqUhGKPV/207VupQ8is0IoX5vtFC18SqEHaK4GyHTZ2kzVR8PBTCO4oANIZL4ShNVZcOhKKeYg9DoWdhI1ec3os2VFI0JCIUez5+i6st0qJZRrEAIJCw+QdW223BG/EmKwTBc/IJ/qfp2FDrkUnwFo8U9dZyqnaPhxLqfYjyM1S3vb6p+GGOBszsojoTDSDFz6qj66R4LzvYJxVMwUNRjf1H1ywQr/megg2RzLximy8waqvbda8M5iijegVEiHjlM1W/3h+FcXesphsMY4dMOUnUgOxyuPEzxPQwRNvV3qg5Nj4BreyimwADWe/dRVTMjEm6MoGLzGwtystL6RyOY3qSqdlYU3FpLZw1VW0sK5943MvUCKwJ1noNtjs6Ohge76Zq9ZkfpigU5WWkDYuCfbs1U5HWFR8/Qq4a9W0uK5k4ZmdrTCl8spGIePLPlbqqsc1Afe83O0hULc8alDYiBd7ZyitYMeBfR55rR2fOKP6ioPk2dGvZ+UVI0d8rtqT2tcCexlqK2F3wRn5Q+YVbBqrLKOupkr9lZujAOrmS0UpTb4JeIPkNHZ+cXr6uoPk2vyuBSPhWLEKj45PQJuQWryyqP0Z14uGLdROHIRNBEXDR09EP5r62rOHCazhrD4VKPwxTH+sIA3ZPTJ+YuWV22n+IruHFDC8X2CBjnPoolcGc2FYUwzmsUWXDHsoGKLBhmN0VvuBVfTVE/AAbpaid5CB4MbaLY1QXGuIViLTyZQcVyGGMuxWPwaA0Vk2GI9RRp8Ci2iuLkIBjhT5LNUfAspZFiTwyC72KK7+DNg1SsRvCNp3gZXq2k4iEEXSHFJHgVXUlxejCCbTvFAHiXdIJiXxyCK7KJ5FHoMZGK9xBcwyg2QpdlVMxEUM2iyIMuXXZQNF+HswxMsSAAJRQjoE//eoqDCXBSTO6f1xd+O0iyNRY6jaWi1ALNYCocZROj4JdEikroVkjFk9DcStXxpdfCD2MoXodu4RUU9ptxxmXssOfxnvDVcxRTod9FxyhqLoAqis5aPhwTDp9spRgEH2Q6KLbYoKqlaKTm6Isp0C/sJMnjFvhiERXPQvUNRe9p29lhR04CdBpC8Sl8YiuncIxEuzUUg4Dkgj+paVozygY9plPMh28SaymO9kabAopREGF3vt9MzeFFl8G7lRSZ8FFGK8XX4VA8QjEd7XrM3M0OXz8YCy+qKBLgq3wqnofiTorF0Ax56Rg1J1elW+BBAsVe+My6iYq7IK6keBdOIseV2qn5Pb8f3MqkWAXf9ThM8c8lAOIotuFsF875lRrH5klRcG0+xcPwQ1oLxfeRAP4heQTnGL78X2rqlw2DK59SXAV/zKaiGMAuko5InCt68mcOan5+ohf+z1pP8lQY/GHZQMV4YD3FpXDp4qerqbF/lBWBswyi+AL+ia+maLgcRRQj4IYlY/UpauqKBsPJAxQF8NM1TRQ/RudSPAD34rK3scOuR8/HGcspxsJfOVS8NZbiGXiUtPgINU3v3WFDmx8pEuG3EiqKKVbCC1vm2iZqap5LAtCtleQf8F9sFYWDohzeJczYyQ4V2bEZFGsQgJRGqqqhS2phHTWn9lDkIhBTqWqxQZ+IsRvtdHY9AvI2VX2hW68nfqGmuQsCEl3JdjfCF8OW1bPdtwhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`; const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEfHx8eHh4nHR0lHBwkGyQjIyMiIiIgICAfHx8mHh4lHh4kHR0jHCMiGyIhISEgICAfHx8lHx8kHh4jHR0hHCEhISEgICAlHx8kHx8jHh4jHh4iHSIhHCEhISElICAkHx8jHx8jHh4iHh4iHSIhHSElICAkICAjHx8jHx8iHh4iHh4hHiEhHSEkICAjHx8iHx8iHx8hHh4hHiEkHSEjHSAjHx8iHx8iHx8hHh4kHiEkHiEjHSAiHx8hHx8hHh4kHiEjHiAjHSAiHx8iHx8hHx8kHh4jHiEjHiAjHiAiICAiHx8kHx8jHh4jHiEjHiAiHiAiHSAiHx8jHx8jHx8jHiAiHiAiHiAiHSAiHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8iHx8iHSAiHiAjHiAjHx8jHx8hHx8iHx8iHyAiHiAjHiAjHiAjHh4hHx8iHx8iHx8iHyAjHSAjHiAjHiAjHh4hHx8iHx8iHx8jHyAjHiAhHh4iHx8iHx8jHyAjHSAjHSAhHiAhHh4iHx8iHx8jHx8jHyAjHSAjHSAiHh4iHh4jHx8jHx8jHyAjHyAhHSAhHSAiHh4iHh4jHx8jHx8jHyAhHyAhHSAiHSAiHh4jHh4jHx8jHx8jHyAhHyAhHSAiHSAjHR4jHh4jHx8jHx8hHyAhHyAiHSAjHSAjHR4jHh4jHx8hHx8hHyAhHyAiHyAjHSAjHR4jHR4hHh4hHx8hHyAiHyAjHyAjHSAjHR4jHR4hHh4hHx8hHyAjHyAjHyAjHSAjHR4hHR4hHR4hHx8iHyAjHyAjHyAjHSAhHR4hHR4hHR4hHx8jHyAjHyAjHyAjHyC9S2xeAAAA7nRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFxgZGhscHR4fICEiIyQlJicoKSorLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZISUpLTE1OUFFSU1RVVllaW1xdXmBhYmNkZWZnaGprbG1ub3Byc3R1dnd4eXp8fn+AgYKDhIWGiImKi4yNj5CRkpOUlZaXmJmam5ydnp+goaKjpKaoqqusra6vsLGys7S1tri5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+fkZpVQAABcBJREFUGBntwftjlQMcBvDnnLNL22qzJjWlKLHFVogyty3SiFq6EZliqZGyhnSxsLlMRahYoZKRFcul5dKFCatYqWZaNKvWtrPz/A2+7/b27qRzec/lPfvl/XxgMplMJpPJZDKZAtA9HJ3ppnIez0KnSdtC0RCNznHdJrbrh85wdSlVVRaEXuoGamYi5K5430HNiTiEWHKJg05eRWgNfKeV7RxbqUhGKPV/207VupQ8is0IoX5vtFC18SqEHaK4GyHTZ2kzVR8PBTCO4oANIZL4ShNVZcOhKKeYg9DoWdhI1ec3os2VFI0JCIUez5+i6st0qJZRrEAIJCw+QdW223BG/EmKwTBc/IJ/qfp2FDrkUnwFo8U9dZyqnaPhxLqfYjyM1S3vb6p+GGOBszsojoTDSDFz6qj66R4LzvYJxVMwUNRjf1H1ywQr/megg2RzLximy8waqvbda8M5iijegVEiHjlM1W/3h+FcXesphsMY4dMOUnUgOxyuPEzxPQwRNvV3qg5Nj4BreyimwADWe/dRVTMjEm6MoGLzGwtystL6RyOY3qSqdlYU3FpLZw1VW0sK5943MvUCKwJ1noNtjs6Ohge76Zq9ZkfpigU5WWkDYuCfbs1U5HWFR8/Qq4a9W0uK5k4ZmdrTCl8spGIePLPlbqqsc1Afe83O0hULc8alDYiBd7ZyitYMeBfR55rR2fOKP6ioPk2dGvZ+UVI0d8rtqT2tcCexlqK2F3wRn5Q+YVbBqrLKOupkr9lZujAOrmS0UpTb4JeIPkNHZ+cXr6uoPk2vyuBSPhWLEKj45PQJuQWryyqP0Z14uGLdROHIRNBEXDR09EP5r62rOHCazhrD4VKPwxTH+sIA3ZPTJ+YuWV22n+IruHFDC8X2CBjnPoolcGc2FYUwzmsUWXDHsoGKLBhmN0VvuBVfTVE/AAbpaid5CB4MbaLY1QXGuIViLTyZQcVyGGMuxWPwaA0Vk2GI9RRp8Ci2iuLkIBjhT5LNUfAspZFiTwyC72KK7+DNg1SsRvCNp3gZXq2k4iEEXSHFJHgVXUlxejCCbTvFAHiXdIJiXxyCK7KJ5FHoMZGK9xBcwyg2QpdlVMxEUM2iyIMuXXZQNF+HswxMsSAAJRQjoE//eoqDCXBSTO6f1xd+O0iyNRY6jaWi1ALNYCocZROj4JdEikroVkjFk9DcStXxpdfCD2MoXodu4RUU9ptxxmXssOfxnvDVcxRTod9FxyhqLoAqis5aPhwTDp9spRgEH2Q6KLbYoKqlaKTm6Isp0C/sJMnjFvhiERXPQvUNRe9p29lhR04CdBpC8Sl8YiuncIxEuzUUg4Dkgj+paVozygY9plPMh28SaymO9kabAopREGF3vt9MzeFFl8G7lRSZ8FFGK8XX4VA8QjEd7XrM3M0OXz8YCy+qKBLgq3wqnofiTorF0Ax56Rg1J1elW+BBAsVe+My6iYq7IK6keBdOIseV2qn5Pb8f3MqkWAXf9ThM8c8lAOIotuFsF875lRrH5klRcG0+xcPwQ1oLxfeRAP4heQTnGL78X2rqlw2DK59SXAV/zKaiGMAuko5InCt68mcOan5+ohf+z1pP8lQY/GHZQMV4YD3FpXDp4qerqbF/lBWBswyi+AL+ia+maLgcRRQj4IYlY/UpauqKBsPJAxQF8NM1TRQ/RudSPAD34rK3scOuR8/HGcspxsJfOVS8NZbiGXiUtPgINU3v3WFDmx8pEuG3EiqKKVbCC1vm2iZqap5LAtCtleQf8F9sFYWDohzeJczYyQ4V2bEZFGsQgJRGqqqhS2phHTWn9lDkIhBTqWqxQZ+IsRvtdHY9AvI2VX2hW68nfqGmuQsCEl3JdjfCF8OW1bPdtwhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`;
@ -26,6 +30,14 @@ const createDrawing = (drawingOptions?: IDrawingOptions): Drawing =>
); );
describe("Drawing", () => { describe("Drawing", () => {
before(() => {
stub(convenienceFunctions, "uniqueNumericId").callsFake(() => 0);
});
after(() => {
(convenienceFunctions.uniqueNumericId as SinonStub).restore();
});
let currentBreak: Drawing; let currentBreak: Drawing;
describe("#constructor()", () => { describe("#constructor()", () => {
@ -68,6 +80,7 @@ describe("Drawing", () => {
descr: "", descr: "",
id: 0, id: 0,
name: "", name: "",
title: "",
}, },
}, },
}, },
@ -298,6 +311,7 @@ describe("Drawing", () => {
descr: "", descr: "",
id: 0, id: 0,
name: "", name: "",
title: "",
}, },
}, },
}, },
@ -438,5 +452,257 @@ describe("Drawing", () => {
], ],
}); });
}); });
it("should create a drawing with a hyperlink", () => {
currentBreak = createDrawing({
floating: {
horizontalPosition: {
offset: 0,
},
verticalPosition: {
offset: 0,
},
},
});
const tree = new Formatter().format(currentBreak, {
stack: [new ConcreteHyperlink([new TextRun("Test")], "1")],
} as unknown as IContext);
expect(tree).to.deep.equal({
"w:drawing": [
{
"wp:anchor": [
{
_attr: {
allowOverlap: "1",
behindDoc: "0",
distB: 0,
distL: 0,
distR: 0,
distT: 0,
layoutInCell: "1",
locked: "0",
relativeHeight: 952500,
simplePos: "0",
},
},
{
"wp:simplePos": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"wp:positionH": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["0"],
},
],
},
{
"wp:positionV": [
{
_attr: {
relativeFrom: "page",
},
},
{
"wp:posOffset": ["0"],
},
],
},
{
"wp:extent": {
_attr: {
cx: 952500,
cy: 952500,
},
},
},
{
"wp:effectExtent": {
_attr: {
b: 0,
l: 0,
r: 0,
t: 0,
},
},
},
{
"wp:wrapNone": {},
},
{
"wp:docPr": [
{
_attr: {
descr: "",
id: 0,
name: "",
title: "",
},
},
{
"a:hlinkClick": {
_attr: {
"r:id": "rId1",
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
},
},
},
],
},
{
"wp:cNvGraphicFramePr": [
{
"a:graphicFrameLocks": {
_attr: {
// tslint:disable-next-line:object-literal-key-quotes
noChangeAspect: 1,
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
},
},
},
],
},
{
"a:graphic": [
{
_attr: {
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
},
},
{
"a:graphicData": [
{
_attr: {
uri: "http://schemas.openxmlformats.org/drawingml/2006/picture",
},
},
{
"pic:pic": [
{
_attr: {
"xmlns:pic": "http://schemas.openxmlformats.org/drawingml/2006/picture",
},
},
{
"pic:nvPicPr": [
{
"pic:cNvPr": [
{
_attr: {
descr: "",
id: 0,
name: "",
},
},
{
"a:hlinkClick": {
_attr: {
"r:id": "rId1",
},
},
},
],
},
{
"pic:cNvPicPr": [
{
"a:picLocks": {
_attr: {
noChangeArrowheads: 1,
noChangeAspect: 1,
},
},
},
],
},
],
},
{
"pic:blipFill": [
{
"a:blip": {
_attr: {
// tslint:disable-next-line:object-literal-key-quotes
cstate: "none",
"r:embed": "rId{test.jpg}",
},
},
},
{
"a:srcRect": {},
},
{
"a:stretch": [
{
"a:fillRect": {},
},
],
},
],
},
{
"pic:spPr": [
{
_attr: {
bwMode: "auto",
},
},
{
"a:xfrm": [
{
_attr: {},
},
{
"a:off": {
_attr: {
x: 0,
y: 0,
},
},
},
{
"a:ext": {
_attr: {
cx: 952500,
cy: 952500,
},
},
},
],
},
{
"a:prstGeom": [
{
_attr: {
prst: "rect",
},
},
{
"a:avLst": {},
},
],
},
],
},
],
},
],
},
],
},
],
},
],
});
});
}); });
}); });

View File

@ -1,6 +1,8 @@
import { IMediaData } from "@file/media"; import { IMediaData } from "@file/media";
import { XmlComponent } from "@file/xml-components"; import { XmlComponent } from "@file/xml-components";
import { Anchor } from "./anchor"; import { Anchor } from "./anchor";
import { DocPropertiesOptions } from "./doc-properties/doc-properties";
import { IFloating } from "./floating"; import { IFloating } from "./floating";
import { Inline } from "./inline"; import { Inline } from "./inline";
@ -13,6 +15,7 @@ export interface IDistance {
export interface IDrawingOptions { export interface IDrawingOptions {
readonly floating?: IFloating; readonly floating?: IFloating;
readonly docProperties?: DocPropertiesOptions;
} }
// <xsd:complexType name="CT_Drawing"> // <xsd:complexType name="CT_Drawing">
@ -29,7 +32,11 @@ export class Drawing extends XmlComponent {
super("w:drawing"); super("w:drawing");
if (!drawingOptions.floating) { if (!drawingOptions.floating) {
this.inline = new Inline(imageData, imageData.transformation); this.inline = new Inline({
mediaData: imageData,
transform: imageData.transformation,
docProperties: drawingOptions.docProperties,
});
this.root.push(this.inline); this.root.push(this.inline);
} else { } else {
this.root.push(new Anchor(imageData, imageData.transformation, drawingOptions)); this.root.push(new Anchor(imageData, imageData.transformation, drawingOptions));

View File

@ -1,6 +1,21 @@
import { XmlComponent } from "@file/xml-components"; import { IContext, IXmlableObject, XmlComponent } from "@file/xml-components";
import { createHyperlinkClick } from "@file/drawing/doc-properties/doc-properties-children";
import { ConcreteHyperlink } from "@file/paragraph";
import { NonVisualPropertiesAttributes } from "./non-visual-properties-attributes"; import { NonVisualPropertiesAttributes } from "./non-visual-properties-attributes";
// <complexType name="CT_NonVisualDrawingProps">
// <sequence>
// <element name="hlinkClick" type="CT_Hyperlink" minOccurs="0" maxOccurs="1" />
// <element name="hlinkHover" type="CT_Hyperlink" minOccurs="0" maxOccurs="1" />
// <element name="extLst" type="CT_OfficeArtExtensionList" minOccurs="0" maxOccurs="1" />
// </sequence>
// <attribute name="id" type="ST_DrawingElementId" use="required" />
// <attribute name="name" type="xsd:string" use="required" />
// <attribute name="descr" type="xsd:string" use="optional" default="" />
// <attribute name="hidden" type="xsd:boolean" use="optional" default="false" />
// </complexType>
export class NonVisualProperties extends XmlComponent { export class NonVisualProperties extends XmlComponent {
public constructor() { public constructor() {
super("pic:cNvPr"); super("pic:cNvPr");
@ -13,4 +28,19 @@ export class NonVisualProperties extends XmlComponent {
}), }),
); );
} }
public prepForXml(context: IContext): IXmlableObject | undefined {
for (let i = context.stack.length - 1; i >= 0; i--) {
const element = context.stack[i];
if (!(element instanceof ConcreteHyperlink)) {
continue;
}
this.root.push(createHyperlinkClick(element.linkId, false));
break;
}
return super.prepForXml(context);
}
} }

View File

@ -1,13 +1,19 @@
// http://officeopenxml.com/drwPicInline.php // http://officeopenxml.com/drwPicInline.php
import { IMediaData, IMediaDataTransformation } from "@file/media"; import { IMediaData, IMediaDataTransformation } from "@file/media";
import { XmlComponent } from "@file/xml-components"; import { XmlComponent } from "@file/xml-components";
import { DocProperties } from "./../doc-properties/doc-properties"; import { DocProperties, DocPropertiesOptions } from "./../doc-properties/doc-properties";
import { EffectExtent } from "./../effect-extent/effect-extent"; import { EffectExtent } from "./../effect-extent/effect-extent";
import { Extent } from "./../extent/extent"; import { Extent } from "./../extent/extent";
import { GraphicFrameProperties } from "./../graphic-frame/graphic-frame-properties"; import { GraphicFrameProperties } from "./../graphic-frame/graphic-frame-properties";
import { Graphic } from "./../inline/graphic"; import { Graphic } from "./../inline/graphic";
import { InlineAttributes } from "./inline-attributes"; import { InlineAttributes } from "./inline-attributes";
interface InlineOptions {
readonly mediaData: IMediaData;
readonly transform: IMediaDataTransformation;
readonly docProperties?: DocPropertiesOptions;
}
// <xsd:complexType name="CT_Inline"> // <xsd:complexType name="CT_Inline">
// <xsd:sequence> // <xsd:sequence>
// <xsd:element name="extent" type="a:CT_PositiveSize2D"/> // <xsd:element name="extent" type="a:CT_PositiveSize2D"/>
@ -26,7 +32,7 @@ export class Inline extends XmlComponent {
private readonly extent: Extent; private readonly extent: Extent;
private readonly graphic: Graphic; private readonly graphic: Graphic;
public constructor(mediaData: IMediaData, transform: IMediaDataTransformation) { public constructor({ mediaData, transform, docProperties }: InlineOptions) {
super("wp:inline"); super("wp:inline");
this.root.push( this.root.push(
@ -43,7 +49,7 @@ export class Inline extends XmlComponent {
this.root.push(this.extent); this.root.push(this.extent);
this.root.push(new EffectExtent()); this.root.push(new EffectExtent());
this.root.push(new DocProperties()); this.root.push(new DocProperties(docProperties));
this.root.push(new GraphicFrameProperties()); this.root.push(new GraphicFrameProperties());
this.root.push(this.graphic); this.root.push(this.graphic);
} }

5
src/file/file-child.ts Normal file
View File

@ -0,0 +1,5 @@
import { XmlComponent } from "@file/xml-components";
export class FileChild extends XmlComponent {
public readonly fileChild = Symbol();
}

View File

@ -11,15 +11,13 @@ import { Footer, Header } from "./header";
import { HeaderWrapper, IDocumentHeader } from "./header-wrapper"; import { HeaderWrapper, IDocumentHeader } from "./header-wrapper";
import { Media } from "./media"; import { Media } from "./media";
import { Numbering } from "./numbering"; import { Numbering } from "./numbering";
import { Paragraph } from "./paragraph";
import { Comments } from "./paragraph/run/comment-run"; import { Comments } from "./paragraph/run/comment-run";
import { Relationships } from "./relationships"; import { Relationships } from "./relationships";
import { Settings } from "./settings"; import { Settings } from "./settings";
import { Styles } from "./styles"; import { Styles } from "./styles";
import { ExternalStylesFactory } from "./styles/external-styles-factory"; import { ExternalStylesFactory } from "./styles/external-styles-factory";
import { DefaultStylesFactory } from "./styles/factory"; import { DefaultStylesFactory } from "./styles/factory";
import { Table } from "./table"; import { FileChild } from "./file-child";
import { TableOfContents } from "./table-of-contents";
export interface ISectionOptions { export interface ISectionOptions {
readonly headers?: { readonly headers?: {
@ -33,7 +31,7 @@ export interface ISectionOptions {
readonly even?: Footer; readonly even?: Footer;
}; };
readonly properties?: ISectionPropertiesOptions; readonly properties?: ISectionPropertiesOptions;
readonly children: readonly (Paragraph | Table | TableOfContents)[]; readonly children: readonly FileChild[];
} }
export class File { export class File {
@ -73,9 +71,10 @@ export class File {
this.appProperties = new AppProperties(); this.appProperties = new AppProperties();
this.footnotesWrapper = new FootnotesWrapper(); this.footnotesWrapper = new FootnotesWrapper();
this.contentTypes = new ContentTypes(); this.contentTypes = new ContentTypes();
this.documentWrapper = new DocumentWrapper({ background: options.background || {} }); this.documentWrapper = new DocumentWrapper({ background: options.background });
this.settings = new Settings({ this.settings = new Settings({
compatabilityModeVersion: options.compatabilityModeVersion, compatibilityModeVersion: options.compatabilityModeVersion,
compatibility: options.compatibility,
evenAndOddHeaders: options.evenAndOddHeaderAndFooters ? true : false, evenAndOddHeaders: options.evenAndOddHeaderAndFooters ? true : false,
trackRevisions: options.features?.trackRevisions, trackRevisions: options.features?.trackRevisions,
updateFields: options.features?.updateFields, updateFields: options.features?.updateFields,

View File

@ -18,4 +18,3 @@ export * from "./track-revision";
export * from "./shared"; export * from "./shared";
export * from "./border"; export * from "./border";
export * from "./vertical-align"; export * from "./vertical-align";
export * from "./space-type";

File diff suppressed because it is too large Load Diff

View File

@ -12,9 +12,11 @@ describe("ConcreteNumbering", () => {
abstractNumId: 1, abstractNumId: 1,
reference: "1", reference: "1",
instance: 0, instance: 0,
overrideLevel: { overrideLevels: [
num: 3, {
}, num: 3,
},
],
}); });
const tree = new Formatter().format(concreteNumbering); const tree = new Formatter().format(concreteNumbering);
@ -44,29 +46,216 @@ describe("ConcreteNumbering", () => {
}); });
}); });
it("sets a new override level for two different level numbers", () => {
const concreteNumbering = new ConcreteNumbering({
numId: 0,
abstractNumId: 1,
reference: "1",
instance: 0,
overrideLevels: [{ num: 3 }, { num: 5 }],
});
const tree = new Formatter().format(concreteNumbering);
expect(tree).to.deep.equal({
"w:num": [
{
_attr: {
"w:numId": 0,
},
},
{
"w:abstractNumId": {
_attr: {
"w:val": 1,
},
},
},
{
"w:lvlOverride": {
_attr: {
"w:ilvl": 3,
},
},
},
{
"w:lvlOverride": {
_attr: {
"w:ilvl": 5,
},
},
},
],
});
});
it("sets the startOverride element if start is given", () => { it("sets the startOverride element if start is given", () => {
const concreteNumbering = new ConcreteNumbering({ const concreteNumbering = new ConcreteNumbering({
numId: 0, numId: 0,
abstractNumId: 1, abstractNumId: 1,
reference: "1", reference: "1",
instance: 0, instance: 0,
overrideLevel: { overrideLevels: [
num: 1, {
start: 9, num: 1,
}, start: 9,
},
],
}); });
const tree = new Formatter().format(concreteNumbering); const tree = new Formatter().format(concreteNumbering);
expect(tree["w:num"]).to.include({ expect(tree).to.deep.equal({
"w:lvlOverride": [ "w:num": [
{ {
_attr: { _attr: {
"w:ilvl": 1, "w:numId": 0,
}, },
}, },
{ {
"w:startOverride": { "w:abstractNumId": {
_attr: { _attr: {
"w:val": 9, "w:val": 1,
},
},
},
{
"w:lvlOverride": [
{
_attr: {
"w:ilvl": 1,
},
},
{
"w:startOverride": {
_attr: {
"w:val": 9,
},
},
},
],
},
],
});
});
it("sets the startOverride element for several levels if start is given", () => {
const concreteNumbering = new ConcreteNumbering({
numId: 0,
abstractNumId: 1,
reference: "1",
instance: 0,
overrideLevels: [
{
num: 1,
start: 9,
},
{
num: 3,
start: 10,
},
],
});
const tree = new Formatter().format(concreteNumbering);
expect(tree).to.deep.equal({
"w:num": [
{
_attr: {
"w:numId": 0,
},
},
{
"w:abstractNumId": {
_attr: {
"w:val": 1,
},
},
},
{
"w:lvlOverride": [
{
_attr: {
"w:ilvl": 1,
},
},
{
"w:startOverride": {
_attr: {
"w:val": 9,
},
},
},
],
},
{
"w:lvlOverride": [
{
_attr: {
"w:ilvl": 3,
},
},
{
"w:startOverride": {
_attr: {
"w:val": 10,
},
},
},
],
},
],
});
});
it("Mix of overrideLevels with start and without", () => {
const concreteNumbering = new ConcreteNumbering({
numId: 0,
abstractNumId: 1,
reference: "1",
instance: 0,
overrideLevels: [
{
num: 1,
start: 9,
},
{
num: 3,
},
],
});
const tree = new Formatter().format(concreteNumbering);
expect(tree).to.deep.equal({
"w:num": [
{
_attr: {
"w:numId": 0,
},
},
{
"w:abstractNumId": {
_attr: {
"w:val": 1,
},
},
},
{
"w:lvlOverride": [
{
_attr: {
"w:ilvl": 1,
},
},
{
"w:startOverride": {
_attr: {
"w:val": 9,
},
},
},
],
},
{
"w:lvlOverride": {
_attr: {
"w:ilvl": 3,
}, },
}, },
}, },
@ -80,9 +269,11 @@ describe("ConcreteNumbering", () => {
abstractNumId: 1, abstractNumId: 1,
reference: "1", reference: "1",
instance: 0, instance: 0,
overrideLevel: { overrideLevels: [
num: 1, {
}, num: 1,
},
],
}); });
const tree = new Formatter().format(concreteNumbering); const tree = new Formatter().format(concreteNumbering);
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({

View File

@ -1,4 +1,5 @@
// http://officeopenxml.com/WPnumbering-numFmt.php // http://officeopenxml.com/WPnumbering-numFmt.php
// http://www.datypic.com/sc/ooxml/a-w_val-57.html
import { Attributes, NumberValueElement, XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { Attributes, NumberValueElement, XmlAttributeComponent, XmlComponent } from "@file/xml-components";
import { decimalNumber } from "@util/values"; import { decimalNumber } from "@util/values";
@ -6,21 +7,138 @@ import { AlignmentType } from "../paragraph/formatting";
import { ILevelParagraphStylePropertiesOptions, ParagraphProperties } from "../paragraph/properties"; import { ILevelParagraphStylePropertiesOptions, ParagraphProperties } from "../paragraph/properties";
import { IRunStylePropertiesOptions, RunProperties } from "../paragraph/run/properties"; import { IRunStylePropertiesOptions, RunProperties } from "../paragraph/run/properties";
// TODO: Breaking change - consolidate with number-format
// <xsd:simpleType name="ST_NumberFormat">
// <xsd:restriction base="xsd:string">
// <xsd:enumeration value="decimal"/>
// <xsd:enumeration value="upperRoman"/>
// <xsd:enumeration value="lowerRoman"/>
// <xsd:enumeration value="upperLetter"/>
// <xsd:enumeration value="lowerLetter"/>
// <xsd:enumeration value="ordinal"/>
// <xsd:enumeration value="cardinalText"/>
// <xsd:enumeration value="ordinalText"/>
// <xsd:enumeration value="hex"/>
// <xsd:enumeration value="chicago"/>
// <xsd:enumeration value="ideographDigital"/>
// <xsd:enumeration value="japaneseCounting"/>
// <xsd:enumeration value="aiueo"/>
// <xsd:enumeration value="iroha"/>
// <xsd:enumeration value="decimalFullWidth"/>
// <xsd:enumeration value="decimalHalfWidth"/>
// <xsd:enumeration value="japaneseLegal"/>
// <xsd:enumeration value="japaneseDigitalTenThousand"/>
// <xsd:enumeration value="decimalEnclosedCircle"/>
// <xsd:enumeration value="decimalFullWidth2"/>
// <xsd:enumeration value="aiueoFullWidth"/>
// <xsd:enumeration value="irohaFullWidth"/>
// <xsd:enumeration value="decimalZero"/>
// <xsd:enumeration value="bullet"/>
// <xsd:enumeration value="ganada"/>
// <xsd:enumeration value="chosung"/>
// <xsd:enumeration value="decimalEnclosedFullstop"/>
// <xsd:enumeration value="decimalEnclosedParen"/>
// <xsd:enumeration value="decimalEnclosedCircleChinese"/>
// <xsd:enumeration value="ideographEnclosedCircle"/>
// <xsd:enumeration value="ideographTraditional"/>
// <xsd:enumeration value="ideographZodiac"/>
// <xsd:enumeration value="ideographZodiacTraditional"/>
// <xsd:enumeration value="taiwaneseCounting"/>
// <xsd:enumeration value="ideographLegalTraditional"/>
// <xsd:enumeration value="taiwaneseCountingThousand"/>
// <xsd:enumeration value="taiwaneseDigital"/>
// <xsd:enumeration value="chineseCounting"/>
// <xsd:enumeration value="chineseLegalSimplified"/>
// <xsd:enumeration value="chineseCountingThousand"/>
// <xsd:enumeration value="koreanDigital"/>
// <xsd:enumeration value="koreanCounting"/>
// <xsd:enumeration value="koreanLegal"/>
// <xsd:enumeration value="koreanDigital2"/>
// <xsd:enumeration value="vietnameseCounting"/>
// <xsd:enumeration value="russianLower"/>
// <xsd:enumeration value="russianUpper"/>
// <xsd:enumeration value="none"/>
// <xsd:enumeration value="numberInDash"/>
// <xsd:enumeration value="hebrew1"/>
// <xsd:enumeration value="hebrew2"/>
// <xsd:enumeration value="arabicAlpha"/>
// <xsd:enumeration value="arabicAbjad"/>
// <xsd:enumeration value="hindiVowels"/>
// <xsd:enumeration value="hindiConsonants"/>
// <xsd:enumeration value="hindiNumbers"/>
// <xsd:enumeration value="hindiCounting"/>
// <xsd:enumeration value="thaiLetters"/>
// <xsd:enumeration value="thaiNumbers"/>
// <xsd:enumeration value="thaiCounting"/>
// <xsd:enumeration value="bahtText"/>
// <xsd:enumeration value="dollarText"/>
// <xsd:enumeration value="custom"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum LevelFormat { export enum LevelFormat {
BULLET = "bullet",
CARDINAL_TEXT = "cardinalText",
CHICAGO = "chicago",
DECIMAL = "decimal", DECIMAL = "decimal",
UPPER_ROMAN = "upperRoman",
LOWER_ROMAN = "lowerRoman",
UPPER_LETTER = "upperLetter",
LOWER_LETTER = "lowerLetter",
ORDINAL = "ordinal",
CARDINAL_TEXT = "cardinalText",
ORDINAL_TEXT = "ordinalText",
HEX = "hex",
CHICAGO = "chicago",
IDEOGRAPH__DIGITAL = "ideographDigital",
JAPANESE_COUNTING = "japaneseCounting",
AIUEO = "aiueo",
IROHA = "iroha",
DECIMAL_FULL_WIDTH = "decimalFullWidth",
DECIMAL_HALF_WIDTH = "decimalHalfWidth",
JAPANESE_LEGAL = "japaneseLegal",
JAPANESE_DIGITAL_TEN_THOUSAND = "japaneseDigitalTenThousand",
DECIMAL_ENCLOSED_CIRCLE = "decimalEnclosedCircle", DECIMAL_ENCLOSED_CIRCLE = "decimalEnclosedCircle",
DECIMAL_FULL_WIDTH2 = "decimalFullWidth2",
AIUEO_FULL_WIDTH = "aiueoFullWidth",
IROHA_FULL_WIDTH = "irohaFullWidth",
DECIMAL_ZERO = "decimalZero",
BULLET = "bullet",
GANADA = "ganada",
CHOSUNG = "chosung",
DECIMAL_ENCLOSED_FULLSTOP = "decimalEnclosedFullstop", DECIMAL_ENCLOSED_FULLSTOP = "decimalEnclosedFullstop",
DECIMAL_ENCLOSED_PARENTHESES = "decimalEnclosedParen", DECIMAL_ENCLOSED_PARENTHESES = "decimalEnclosedParen",
DECIMAL_ZERO = "decimalZero", DECIMAL_ENCLOSED_CIRCLE_CHINESE = "decimalEnclosedCircleChinese",
LOWER_LETTER = "lowerLetter", IDEOGRAPH_ENCLOSED_CIRCLE = "ideographEnclosedCircle",
LOWER_ROMAN = "lowerRoman", IDEOGRAPH_TRADITIONAL = "ideographTraditional",
IDEOGRAPH_ZODIAC = "ideographZodiac",
IDEOGRAPH_ZODIAC_TRADITIONAL = "ideographZodiacTraditional",
TAIWANESE_COUNTING = "taiwaneseCounting",
IDEOGRAPH_LEGAL_TRADITIONAL = "ideographLegalTraditional",
TAIWANESE_COUNTING_THOUSAND = "taiwaneseCountingThousand",
TAIWANESE_DIGITAL = "taiwaneseDigital",
CHINESE_COUNTING = "chineseCounting",
CHINESE_LEGAL_SIMPLIFIED = "chineseLegalSimplified",
CHINESE_COUNTING_THOUSAND = "chineseCountingThousand",
KOREAN_DIGITAL = "koreanDigital",
KOREAN_COUNTING = "koreanCounting",
KOREAN_LEGAL = "koreanLegal",
KOREAN_DIGITAL2 = "koreanDigital2",
VIETNAMESE_COUNTING = "vietnameseCounting",
RUSSIAN_LOWER = "russianLower",
RUSSIAN_UPPER = "russianUpper",
NONE = "none", NONE = "none",
ORDINAL_TEXT = "ordinalText", NUMBER_IN_DASH = "numberInDash",
UPPER_LETTER = "upperLetter", HEBREW1 = "hebrew1",
UPPER_ROMAN = "upperRoman", HEBREW2 = "hebrew2",
ARABIC_ALPHA = "arabicAlpha",
ARABIC_ABJAD = "arabicAbjad",
HINDI_VOWELS = "hindiVowels",
HINDI_CONSONANTS = "hindiConsonants",
HINDI_NUMBERS = "hindiNumbers",
HINDI_COUNTING = "hindiCounting",
THAI_LETTERS = "thaiLetters",
THAI_NUMBERS = "thaiNumbers",
THAI_COUNTING = "thaiCounting",
BAHT_TEXT = "bahtText",
DOLLAR_TEXT = "dollarText",
CUSTOM = "custom",
} }
class LevelAttributes extends XmlAttributeComponent<{ class LevelAttributes extends XmlAttributeComponent<{

View File

@ -18,15 +18,17 @@ class NumAttributes extends XmlAttributeComponent<{
protected readonly xmlKeys = { numId: "w:numId" }; protected readonly xmlKeys = { numId: "w:numId" };
} }
interface IOverrideLevel {
readonly num: number;
readonly start?: number;
}
export interface IConcreteNumberingOptions { export interface IConcreteNumberingOptions {
readonly numId: number; readonly numId: number;
readonly abstractNumId: number; readonly abstractNumId: number;
readonly reference: string; readonly reference: string;
readonly instance: number; readonly instance: number;
readonly overrideLevel?: { readonly overrideLevels?: readonly IOverrideLevel[];
readonly num: number;
readonly start?: number;
};
} }
// <xsd:complexType name="CT_Numbering"> // <xsd:complexType name="CT_Numbering">
@ -60,8 +62,10 @@ export class ConcreteNumbering extends XmlComponent {
this.root.push(new AbstractNumId(decimalNumber(options.abstractNumId))); this.root.push(new AbstractNumId(decimalNumber(options.abstractNumId)));
if (options.overrideLevel) { if (options.overrideLevels && options.overrideLevels.length) {
this.root.push(new LevelOverride(options.overrideLevel.num, options.overrideLevel.start)); for (const level of options.overrideLevels) {
this.root.push(new LevelOverride(level.num, level.start));
}
} }
} }
} }

View File

@ -164,10 +164,12 @@ export class Numbering extends XmlComponent {
abstractNumId: abstractNumbering.id, abstractNumId: abstractNumbering.id,
reference: "default-bullet-numbering", reference: "default-bullet-numbering",
instance: 0, instance: 0,
overrideLevel: { overrideLevels: [
num: 0, {
start: 1, num: 0,
}, start: 1,
},
],
}), }),
); );

View File

@ -1,16 +1,51 @@
// http://officeopenxml.com/WPalignment.php // http://officeopenxml.com/WPalignment.php
// http://officeopenxml.com/WPtableAlignment.php // http://officeopenxml.com/WPtableAlignment.php
// http://www.datypic.com/sc/ooxml/t-w_ST_Jc.html
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
// <xsd:simpleType name="ST_Jc">
// <xsd:restriction base="xsd:string">
// <xsd:enumeration value="start"/>
// <xsd:enumeration value="center"/>
// <xsd:enumeration value="end"/>
// <xsd:enumeration value="both"/>
// <xsd:enumeration value="mediumKashida"/>
// <xsd:enumeration value="distribute"/>
// <xsd:enumeration value="numTab"/>
// <xsd:enumeration value="highKashida"/>
// <xsd:enumeration value="lowKashida"/>
// <xsd:enumeration value="thaiDistribute"/>
// <xsd:enumeration value="left"/>
// <xsd:enumeration value="right"/>
// </xsd:restriction>
// </xsd:simpleType>
export enum AlignmentType { export enum AlignmentType {
/** Align Start */
START = "start", START = "start",
END = "end", /** Align Center */
CENTER = "center", CENTER = "center",
/** End */
END = "end",
/** Justified */
BOTH = "both", BOTH = "both",
JUSTIFIED = "both", /** Medium Kashida Length */
MEDIUM_KASHIDA = "mediumKashida",
/** Distribute All Characters Equally */
DISTRIBUTE = "distribute", DISTRIBUTE = "distribute",
/** Align to List Tab */
NUM_TAB = "numTab",
/** Widest Kashida Length */
HIGH_KASHIDA = "highKashida",
/** Low Kashida Length */
LOW_KASHIDA = "lowKashida",
/** Thai Language Justification */
THAI_DISTRIBUTE = "thaiDistribute",
/** Align Left */
LEFT = "left", LEFT = "left",
/** Align Right */
RIGHT = "right", RIGHT = "right",
/** Justified */
JUSTIFIED = "both",
} }
export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentType }> { export class AlignmentAttributes extends XmlAttributeComponent<{ readonly val: AlignmentType }> {

View File

@ -1,39 +1,14 @@
// http://officeopenxml.com/WPindentation.php // http://officeopenxml.com/WPindentation.php
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { NextAttributeComponent, XmlComponent } from "@file/xml-components";
import { signedTwipsMeasureValue, twipsMeasureValue } from "@util/values"; import { PositiveUniversalMeasure, signedTwipsMeasureValue, twipsMeasureValue, UniversalMeasure } from "@util/values";
export interface IIndentAttributesProperties { export interface IIndentAttributesProperties {
readonly start?: number | string; readonly start?: number | UniversalMeasure;
readonly end?: number | string; readonly end?: number | UniversalMeasure;
readonly left?: number | string; readonly left?: number | UniversalMeasure;
readonly right?: number | string; readonly right?: number | UniversalMeasure;
readonly hanging?: number | string; readonly hanging?: number | PositiveUniversalMeasure;
readonly firstLine?: number | string; readonly firstLine?: number | PositiveUniversalMeasure;
}
// <xsd:complexType name="CT_Ind">
// <xsd:attribute name="start" type="ST_SignedTwipsMeasure" use="optional"/>
// <xsd:attribute name="startChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="end" type="ST_SignedTwipsMeasure" use="optional"/>
// <xsd:attribute name="endChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="left" type="ST_SignedTwipsMeasure" use="optional"/>
// <xsd:attribute name="leftChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="right" type="ST_SignedTwipsMeasure" use="optional"/>
// <xsd:attribute name="rightChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="hanging" type="s:ST_TwipsMeasure" use="optional"/>
// <xsd:attribute name="hangingChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="firstLine" type="s:ST_TwipsMeasure" use="optional"/>
// <xsd:attribute name="firstLineChars" type="ST_DecimalNumber" use="optional"/>
// </xsd:complexType>
class IndentAttributes extends XmlAttributeComponent<IIndentAttributesProperties> {
protected readonly xmlKeys = {
start: "w:start",
end: "w:end",
left: "w:left",
right: "w:right",
hanging: "w:hanging",
firstLine: "w:firstLine",
};
} }
// <xsd:complexType name="CT_PPrBase"> // <xsd:complexType name="CT_PPrBase">
@ -43,14 +18,53 @@ class IndentAttributes extends XmlAttributeComponent<IIndentAttributesProperties
export class Indent extends XmlComponent { export class Indent extends XmlComponent {
public constructor({ start, end, left, right, hanging, firstLine }: IIndentAttributesProperties) { public constructor({ start, end, left, right, hanging, firstLine }: IIndentAttributesProperties) {
super("w:ind"); super("w:ind");
// <xsd:complexType name="CT_Ind">
// <xsd:attribute name="start" type="ST_SignedTwipsMeasure" use="optional"/>
// <xsd:attribute name="startChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="end" type="ST_SignedTwipsMeasure" use="optional"/>
// <xsd:attribute name="endChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="left" type="ST_SignedTwipsMeasure" use="optional"/>
// <xsd:attribute name="leftChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="right" type="ST_SignedTwipsMeasure" use="optional"/>
// <xsd:attribute name="rightChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="hanging" type="s:ST_TwipsMeasure" use="optional"/>
// <xsd:attribute name="hangingChars" type="ST_DecimalNumber" use="optional"/>
// <xsd:attribute name="firstLine" type="s:ST_TwipsMeasure" use="optional"/>
// <xsd:attribute name="firstLineChars" type="ST_DecimalNumber" use="optional"/>
// </xsd:complexType>
this.root.push( this.root.push(
new IndentAttributes({ new NextAttributeComponent<{
start: start === undefined ? undefined : signedTwipsMeasureValue(start), readonly start?: number | UniversalMeasure;
end: end === undefined ? undefined : signedTwipsMeasureValue(end), readonly end?: number | UniversalMeasure;
left: left === undefined ? undefined : signedTwipsMeasureValue(left), readonly left?: number | UniversalMeasure;
right: right === undefined ? undefined : signedTwipsMeasureValue(right), readonly right?: number | UniversalMeasure;
hanging: hanging === undefined ? undefined : twipsMeasureValue(hanging), readonly hanging?: number | PositiveUniversalMeasure;
firstLine: firstLine === undefined ? undefined : twipsMeasureValue(firstLine), readonly firstLine?: number | PositiveUniversalMeasure;
}>({
start: {
key: "w:start",
value: start === undefined ? undefined : signedTwipsMeasureValue(start),
},
end: {
key: "w:end",
value: end === undefined ? undefined : signedTwipsMeasureValue(end),
},
left: {
key: "w:left",
value: left === undefined ? undefined : signedTwipsMeasureValue(left),
},
right: {
key: "w:right",
value: right === undefined ? undefined : signedTwipsMeasureValue(right),
},
hanging: {
key: "w:hanging",
value: hanging === undefined ? undefined : twipsMeasureValue(hanging),
},
firstLine: {
key: "w:firstLine",
value: firstLine === undefined ? undefined : twipsMeasureValue(firstLine),
},
}), }),
); );
} }

View File

@ -4,6 +4,7 @@ import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
export enum LineRuleType { export enum LineRuleType {
AT_LEAST = "atLeast", AT_LEAST = "atLeast",
EXACTLY = "exactly", EXACTLY = "exactly",
EXACT = "exact",
AUTO = "auto", AUTO = "auto",
} }
export interface ISpacingProperties { export interface ISpacingProperties {

View File

@ -8,7 +8,7 @@ describe("LeftTabStop", () => {
let tabStop: TabStop; let tabStop: TabStop;
beforeEach(() => { beforeEach(() => {
tabStop = new TabStop(TabStopType.LEFT, 100); tabStop = new TabStop([{ type: TabStopType.LEFT, position: 100 }]);
}); });
describe("#constructor()", () => { describe("#constructor()", () => {
@ -32,7 +32,7 @@ describe("RightTabStop", () => {
let tabStop: TabStop; let tabStop: TabStop;
beforeEach(() => { beforeEach(() => {
tabStop = new TabStop(TabStopType.RIGHT, 100, LeaderType.DOT); tabStop = new TabStop([{ type: TabStopType.RIGHT, position: 100, leader: LeaderType.DOT }]);
}); });
describe("#constructor()", () => { describe("#constructor()", () => {

View File

@ -1,10 +1,19 @@
// http://officeopenxml.com/WPtab.php // http://officeopenxml.com/WPtab.php
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
export interface TabStopDefinition {
readonly type: TabStopType;
readonly position: number | TabStopPosition;
readonly leader?: LeaderType;
}
export class TabStop extends XmlComponent { export class TabStop extends XmlComponent {
public constructor(type: TabStopType, position: number, leader?: LeaderType) { public constructor(tabDefinitions: readonly TabStopDefinition[]) {
super("w:tabs"); super("w:tabs");
this.root.push(new TabStopItem(type, position, leader));
for (const tabDefinition of tabDefinitions) {
this.root.push(new TabStopItem(tabDefinition));
}
} }
} }
@ -41,13 +50,13 @@ export class TabAttributes extends XmlAttributeComponent<{
} }
export class TabStopItem extends XmlComponent { export class TabStopItem extends XmlComponent {
public constructor(value: TabStopType, position: string | number, leader?: LeaderType) { public constructor({ type, position, leader }: TabStopDefinition) {
super("w:tab"); super("w:tab");
this.root.push( this.root.push(
new TabAttributes({ new TabAttributes({
val: value, val: type,
pos: position, pos: position,
leader, leader: leader,
}), }),
); );
} }

View File

View File

@ -0,0 +1,20 @@
import { expect } from "chai";
import { Formatter } from "@export/formatter";
import { WordWrap } from "./word-wrap";
describe("WordWrap", () => {
it("should create", () => {
const wordWrap = new WordWrap();
const tree = new Formatter().format(wordWrap);
expect(tree).to.deep.equal({
"w:wordWrap": {
_attr: {
"w:val": 0,
},
},
});
});
});

View File

@ -0,0 +1,14 @@
// http://officeopenxml.com/WPalignment.php
// http://officeopenxml.com/WPtableAlignment.php
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
export class WordWrapAttributes extends XmlAttributeComponent<{ readonly val: 0 }> {
protected readonly xmlKeys = { val: "w:val" };
}
export class WordWrap extends XmlComponent {
public constructor() {
super("w:wordWrap");
this.root.push(new WordWrapAttributes({ val: 0 }));
}
}

View File

@ -1,4 +1,4 @@
import { SpaceType } from "@file/space-type"; import { SpaceType } from "@file/shared";
import { XmlComponent } from "@file/xml-components"; import { XmlComponent } from "@file/xml-components";
import { TextAttributes } from "../run/text-attributes"; import { TextAttributes } from "../run/text-attributes";

View File

@ -2,7 +2,7 @@ import { MathAngledBrackets, MathCurlyBrackets, MathRoundBrackets, MathSquareBra
import { MathFraction } from "./fraction"; import { MathFraction } from "./fraction";
import { MathFunction } from "./function"; import { MathFunction } from "./function";
import { MathRun } from "./math-run"; import { MathRun } from "./math-run";
import { MathSum } from "./n-ary"; import { MathSum, MathIntegral } from "./n-ary";
import { MathRadical } from "./radical"; import { MathRadical } from "./radical";
import { MathSubScript, MathSubSuperScript, MathSuperScript } from "./script"; import { MathSubScript, MathSubSuperScript, MathSuperScript } from "./script";
@ -10,6 +10,7 @@ export type MathComponent =
| MathRun | MathRun
| MathFraction | MathFraction
| MathSum | MathSum
| MathIntegral
| MathSuperScript | MathSuperScript
| MathSubScript | MathSubScript
| MathSubSuperScript | MathSubSuperScript

View File

@ -4,4 +4,5 @@ export * from "./math-limit-location";
export * from "./math-n-ary-properties"; export * from "./math-n-ary-properties";
export * from "./math-sub-script"; export * from "./math-sub-script";
export * from "./math-sum"; export * from "./math-sum";
export * from "./math-integral";
export * from "./math-super-script"; export * from "./math-super-script";

View File

@ -0,0 +1,116 @@
import { expect } from "chai";
import { Formatter } from "@export/formatter";
import { MathRun } from "../math-run";
import { MathIntegral } from "./math-integral";
describe("MathIntegral", () => {
describe("#constructor()", () => {
it("should create a MathIntegral with correct root key", () => {
const mathIntegral = new MathIntegral({
children: [new MathRun("1")],
subScript: [new MathRun("2")],
superScript: [new MathRun("3")],
});
const tree = new Formatter().format(mathIntegral);
expect(tree).to.deep.equal({
"m:nary": [
{
"m:naryPr": [
{
"m:limLoc": {
_attr: {
"m:val": "undOvr",
},
},
},
],
},
{
"m:sub": [
{
"m:r": [
{
"m:t": ["2"],
},
],
},
],
},
{
"m:sup": [
{
"m:r": [
{
"m:t": ["3"],
},
],
},
],
},
{
"m:e": [
{
"m:r": [
{
"m:t": ["1"],
},
],
},
],
},
],
});
});
it("should create a MathIntegral with correct root key without sub-script and super-scripts", () => {
const mathIntegral = new MathIntegral({
children: [new MathRun("1")],
});
const tree = new Formatter().format(mathIntegral);
expect(tree).to.deep.equal({
"m:nary": [
{
"m:naryPr": [
{
"m:limLoc": {
_attr: {
"m:val": "undOvr",
},
},
},
{
"m:supHide": {
_attr: {
"m:val": 1,
},
},
},
{
"m:subHide": {
_attr: {
"m:val": 1,
},
},
},
],
},
{
"m:e": [
{
"m:r": [
{
"m:t": ["1"],
},
],
},
],
},
],
});
});
});
});

View File

@ -0,0 +1,31 @@
import { XmlComponent } from "@file/xml-components";
import { MathComponent } from "../math-component";
import { MathBase } from "./math-base";
import { MathNAryProperties } from "./math-n-ary-properties";
import { MathSubScriptElement } from "./math-sub-script";
import { MathSuperScriptElement } from "./math-super-script";
export interface IMathIntegralOptions {
readonly children: readonly MathComponent[];
readonly subScript?: readonly MathComponent[];
readonly superScript?: readonly MathComponent[];
}
export class MathIntegral extends XmlComponent {
public constructor(options: IMathIntegralOptions) {
super("m:nary");
this.root.push(new MathNAryProperties("", !!options.superScript, !!options.subScript));
if (!!options.subScript) {
this.root.push(new MathSubScriptElement(options.subScript));
}
if (!!options.superScript) {
this.root.push(new MathSuperScriptElement(options.superScript));
}
this.root.push(new MathBase(options.children));
}
}

View File

@ -10,7 +10,9 @@ export class MathNAryProperties extends XmlComponent {
public constructor(accent: string, hasSuperScript: boolean, hasSubScript: boolean) { public constructor(accent: string, hasSuperScript: boolean, hasSubScript: boolean) {
super("m:naryPr"); super("m:naryPr");
this.root.push(new MathAccentCharacter(accent)); if (!!accent) {
this.root.push(new MathAccentCharacter(accent));
}
this.root.push(new MathLimitLocation()); this.root.push(new MathLimitLocation());
if (!hasSuperScript) { if (!hasSuperScript) {

View File

@ -3,6 +3,7 @@ import { SinonStub, stub } from "sinon";
import * as convenienceFunctions from "@util/convenience-functions"; import * as convenienceFunctions from "@util/convenience-functions";
import { HorizontalPositionAlign, VerticalPositionAlign } from "@file/shared";
import { Formatter } from "@export/formatter"; import { Formatter } from "@export/formatter";
import { BorderStyle } from "@file/border"; import { BorderStyle } from "@file/border";
import { EMPTY_OBJECT } from "@file/xml-components"; import { EMPTY_OBJECT } from "@file/xml-components";
@ -10,7 +11,6 @@ import { EMPTY_OBJECT } from "@file/xml-components";
import { IViewWrapper } from "../document-wrapper"; import { IViewWrapper } from "../document-wrapper";
import { File } from "../file"; import { File } from "../file";
import { ShadingType } from "../shading"; import { ShadingType } from "../shading";
import { HorizontalPositionAlign, VerticalPositionAlign } from "../shared";
import { AlignmentType, HeadingLevel, LeaderType, PageBreak, TabStopPosition, TabStopType } from "./formatting"; import { AlignmentType, HeadingLevel, LeaderType, PageBreak, TabStopPosition, TabStopType } from "./formatting";
import { FrameAnchorType } from "./frame"; import { FrameAnchorType } from "./frame";
import { Bookmark, ExternalHyperlink } from "./links"; import { Bookmark, ExternalHyperlink } from "./links";
@ -25,6 +25,7 @@ describe("Paragraph", () => {
after(() => { after(() => {
(convenienceFunctions.uniqueId as SinonStub).restore(); (convenienceFunctions.uniqueId as SinonStub).restore();
(convenienceFunctions.uniqueNumericId as SinonStub).restore();
}); });
describe("#constructor()", () => { describe("#constructor()", () => {
@ -953,6 +954,7 @@ describe("Paragraph", () => {
paragraph.prepForXml({ paragraph.prepForXml({
viewWrapper: viewWrapperMock, viewWrapper: viewWrapperMock,
file: file, file: file,
stack: [],
}); });
const tree = new Formatter().format(paragraph); const tree = new Formatter().format(paragraph);
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({

View File

@ -1,7 +1,8 @@
// http://officeopenxml.com/WPparagraph.php // http://officeopenxml.com/WPparagraph.php
import { FootnoteReferenceRun } from "@file/footnotes"; import { FootnoteReferenceRun } from "@file/footnotes";
import { IContext, IXmlableObject, XmlComponent } from "@file/xml-components"; import { IContext, IXmlableObject } from "@file/xml-components";
import { uniqueId } from "@util/convenience-functions"; import { uniqueId } from "@util/convenience-functions";
import { FileChild } from "@file/file-child";
import { TargetModeType } from "../relationships/relationship/relationship"; import { TargetModeType } from "../relationships/relationship/relationship";
import { DeletedTextRun, InsertedTextRun } from "../track-revision"; import { DeletedTextRun, InsertedTextRun } from "../track-revision";
@ -9,8 +10,10 @@ import { ColumnBreak, PageBreak } from "./formatting/break";
import { Bookmark, ConcreteHyperlink, ExternalHyperlink, InternalHyperlink } from "./links"; import { Bookmark, ConcreteHyperlink, ExternalHyperlink, InternalHyperlink } from "./links";
import { Math } from "./math"; import { Math } from "./math";
import { IParagraphPropertiesOptions, ParagraphProperties } from "./properties"; import { IParagraphPropertiesOptions, ParagraphProperties } from "./properties";
import { ImageRun, Run, SequentialIdentifier, SimpleField, SimpleMailMergeField, SymbolRun, TextRun } from "./run"; import { ImageRun, PageNumber, Run, SequentialIdentifier, SimpleField, SimpleMailMergeField, SymbolRun, TextRun } from "./run";
import { Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments } from "./run/comment-run"; import { Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments } from "./run/comment-run";
import { Begin, End, Separate } from "./run/field";
import { NumberOfPages, NumberOfPagesSection, Page } from "./run/page-number";
export type ParagraphChild = export type ParagraphChild =
| TextRun | TextRun
@ -32,14 +35,15 @@ export type ParagraphChild =
| Comment | Comment
| CommentRangeStart | CommentRangeStart
| CommentRangeEnd | CommentRangeEnd
| CommentReference; | CommentReference
| PageNumber;
export interface IParagraphOptions extends IParagraphPropertiesOptions { export interface IParagraphOptions extends IParagraphPropertiesOptions {
readonly text?: string; readonly text?: string;
readonly children?: readonly ParagraphChild[]; readonly children?: readonly ParagraphChild[];
} }
export class Paragraph extends XmlComponent { export class Paragraph extends FileChild {
private readonly properties: ParagraphProperties; private readonly properties: ParagraphProperties;
public constructor(options: string | IParagraphOptions) { public constructor(options: string | IParagraphOptions) {
@ -62,6 +66,34 @@ export class Paragraph extends XmlComponent {
if (options.children) { if (options.children) {
for (const child of options.children) { for (const child of options.children) {
if (typeof child === "string") {
switch (child) {
case PageNumber.CURRENT:
this.root.push(new TextRun({ children: [new Begin()] }));
this.root.push(new TextRun({ children: [new Page()] }));
this.root.push(new TextRun({ children: [new Separate()] }));
this.root.push(new TextRun({ children: [new End()] }));
break;
case PageNumber.TOTAL_PAGES:
this.root.push(new TextRun({ children: [new Begin()] }));
this.root.push(new TextRun({ children: [new NumberOfPages()] }));
this.root.push(new TextRun({ children: [new Separate()] }));
this.root.push(new TextRun("0"));
this.root.push(new TextRun({ children: [new End()] }));
break;
case PageNumber.TOTAL_PAGES_IN_SECTION:
this.root.push(new TextRun({ children: [new Begin()] }));
this.root.push(new TextRun({ children: [new NumberOfPagesSection()] }));
this.root.push(new TextRun({ children: [new Separate()] }));
this.root.push(new TextRun({ children: [new End()] }));
break;
default:
this.root.push(new TextRun(child));
break;
}
continue;
}
if (child instanceof Bookmark) { if (child instanceof Bookmark) {
this.root.push(child.start); this.root.push(child.start);
for (const textRun of child.children) { for (const textRun of child.children) {

View File

@ -31,6 +31,7 @@ describe("ParagraphProperties", () => {
} as File, } as File,
// tslint:disable-next-line: no-object-literal-type-assertion // tslint:disable-next-line: no-object-literal-type-assertion
viewWrapper: new DocumentWrapper({ background: {} }), viewWrapper: new DocumentWrapper({ background: {} }),
stack: [],
}); });
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
@ -123,5 +124,24 @@ describe("ParagraphProperties", () => {
], ],
}); });
}); });
it("should create with the wordWrap property", () => {
const properties = new ParagraphProperties({
wordWrap: true,
});
const tree = new Formatter().format(properties);
expect(tree).to.deep.equal({
"w:pPr": [
{
"w:wordWrap": {
_attr: {
"w:val": 0,
},
},
},
],
});
});
}); });
}); });

View File

@ -9,8 +9,9 @@ import { PageBreakBefore } from "./formatting/break";
import { IIndentAttributesProperties, Indent } from "./formatting/indent"; import { IIndentAttributesProperties, Indent } from "./formatting/indent";
import { ISpacingProperties, Spacing } from "./formatting/spacing"; import { ISpacingProperties, Spacing } from "./formatting/spacing";
import { HeadingLevel, Style } from "./formatting/style"; import { HeadingLevel, Style } from "./formatting/style";
import { LeaderType, TabStop, TabStopPosition, TabStopType } from "./formatting/tab-stop"; import { TabStop, TabStopDefinition, TabStopType } from "./formatting/tab-stop";
import { NumberProperties } from "./formatting/unordered-list"; import { NumberProperties } from "./formatting/unordered-list";
import { WordWrap } from "./formatting/word-wrap";
import { FrameProperties, IFrameOptions } from "./frame/frame-properties"; import { FrameProperties, IFrameOptions } from "./frame/frame-properties";
import { OutlineLevel } from "./links"; import { OutlineLevel } from "./links";
@ -41,11 +42,7 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp
readonly heading?: HeadingLevel; readonly heading?: HeadingLevel;
readonly bidirectional?: boolean; readonly bidirectional?: boolean;
readonly pageBreakBefore?: boolean; readonly pageBreakBefore?: boolean;
readonly tabStops?: readonly { readonly tabStops?: readonly TabStopDefinition[];
readonly position: number | TabStopPosition;
readonly type: TabStopType;
readonly leader?: LeaderType;
}[];
readonly style?: string; readonly style?: string;
readonly bullet?: { readonly bullet?: {
readonly level: number; readonly level: number;
@ -54,6 +51,8 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp
readonly widowControl?: boolean; readonly widowControl?: boolean;
readonly frame?: IFrameOptions; readonly frame?: IFrameOptions;
readonly suppressLineNumbers?: boolean; readonly suppressLineNumbers?: boolean;
readonly wordWrap?: boolean;
readonly scale?: number;
} }
export class ParagraphProperties extends IgnoreIfEmptyXmlComponent { export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
@ -132,19 +131,26 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
this.push(new Shading(options.shading)); this.push(new Shading(options.shading));
} }
if (options.rightTabStop) { if (options.wordWrap) {
this.push(new TabStop(TabStopType.RIGHT, options.rightTabStop)); this.push(new WordWrap());
} }
if (options.tabStops) { /**
for (const tabStop of options.tabStops) { * FIX: Multitab support for Libre Writer
this.push(new TabStop(tabStop.type, tabStop.position, tabStop.leader)); * Ensure there is only one w:tabs tag with multiple w:tab
} */
} const tabDefinitions: readonly TabStopDefinition[] = [
...(options.rightTabStop ? [{ type: TabStopType.RIGHT, position: options.rightTabStop }] : []),
...(options.tabStops ? options.tabStops : []),
...(options.leftTabStop ? [{ type: TabStopType.LEFT, position: options.leftTabStop }] : []),
];
if (options.leftTabStop) { if (tabDefinitions.length > 0) {
this.push(new TabStop(TabStopType.LEFT, options.leftTabStop)); this.push(new TabStop(tabDefinitions));
} }
/**
* FIX - END
*/
if (options.bidirectional !== undefined) { if (options.bidirectional !== undefined) {
this.push(new OnOffElement("w:bidi", options.bidirectional)); this.push(new OnOffElement("w:bidi", options.bidirectional));

View File

@ -1,4 +1,5 @@
import { expect } from "chai"; import { expect } from "chai";
import * as sinon from "sinon";
import { Formatter } from "@export/formatter"; import { Formatter } from "@export/formatter";
import { Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments } from "./comment-run"; import { Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments } from "./comment-run";
@ -40,12 +41,54 @@ describe("CommentReference", () => {
}); });
describe("Comment", () => { describe("Comment", () => {
let clock: sinon.SinonFakeTimers;
beforeEach(() => {
const now = new Date("1999-01-01T00:00:00.000Z");
clock = sinon.useFakeTimers(now.getTime());
});
afterEach(() => {
clock.restore();
});
describe("#constructor()", () => { describe("#constructor()", () => {
it("should create", () => { it("should create", () => {
const component = new Comment({ const component = new Comment({
id: 0, id: 0,
text: "test-comment", text: "test-comment",
date: new Date(1999, 0, 1), date: new Date("1999-01-01T00:00:00.000Z"),
});
const tree = new Formatter().format(component);
expect(tree).to.deep.equal({
"w:comment": [
{ _attr: { "w:id": 0, "w:date": "1999-01-01T00:00:00.000Z" } },
{
"w:p": [
{
"w:r": [
{
"w:t": [
{
_attr: {
"xml:space": "preserve",
},
},
"test-comment",
],
},
],
},
],
},
],
});
});
it("should create by using default date", () => {
const component = new Comment({
id: 0,
text: "test-comment",
}); });
const tree = new Formatter().format(component); const tree = new Formatter().format(component);
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
@ -83,12 +126,12 @@ describe("Comments", () => {
{ {
id: 0, id: 0,
text: "test-comment", text: "test-comment",
date: new Date(1999, 0, 1), date: new Date("1999-01-01T00:00:00.000Z"),
}, },
{ {
id: 1, id: 1,
text: "test-comment-2", text: "test-comment-2",
date: new Date(1999, 0, 1), date: new Date("1999-01-01T00:00:00.000Z"),
}, },
], ],
}); });

View File

@ -0,0 +1,229 @@
import { expect } from "chai";
import { Formatter } from "@export/formatter";
import {
AnnotationReference,
CarriageReturn,
ContinuationSeparator,
DayLong,
DayShort,
EndnoteReference,
FootnoteReferenceElement,
LastRenderedPageBreak,
MonthLong,
MonthShort,
NoBreakHyphen,
PageNumberElement,
Separator,
SoftHyphen,
Tab,
YearLong,
YearShort,
} from "./empty-children";
// <xsd:element name="noBreakHyphen" type="CT_Empty"/>
// <xsd:element name="softHyphen" type="CT_Empty" minOccurs="0" />
// <xsd:element name="dayShort" type="CT_Empty" minOccurs="0" />
// <xsd:element name="monthShort" type="CT_Empty" minOccurs="0" />
// <xsd:element name="yearShort" type="CT_Empty" minOccurs="0" />
// <xsd:element name="dayLong" type="CT_Empty" minOccurs="0" />
// <xsd:element name="monthLong" type="CT_Empty" minOccurs="0" />
// <xsd:element name="yearLong" type="CT_Empty" minOccurs="0" />
// <xsd:element name="annotationRef" type="CT_Empty" minOccurs="0" />
// <xsd:element name="footnoteRef" type="CT_Empty" minOccurs="0" />
// <xsd:element name="endnoteRef" type="CT_Empty" minOccurs="0" />
// <xsd:element name="separator" type="CT_Empty" minOccurs="0" />
// <xsd:element name="continuationSeparator" type="CT_Empty" minOccurs="0" />
// ...
// <xsd:element name="pgNum" type="CT_Empty" minOccurs="0" />
// <xsd:element name="cr" type="CT_Empty" minOccurs="0" />
// <xsd:element name="tab" type="CT_Empty" minOccurs="0" />
// ...
// <xsd:element name="lastRenderedPageBreak" type="CT_Empty" minOccurs="0" maxOccurs="1" />
describe("NoBreakHyphen", () => {
describe("#constructor()", () => {
it("should create a NoBreakHyphen with correct root key", () => {
const tree = new Formatter().format(new NoBreakHyphen());
expect(tree).to.deep.equal({
"w:noBreakHyphen": {},
});
});
});
});
describe("SoftHyphen", () => {
describe("#constructor()", () => {
it("should create a SoftHyphen with correct root key", () => {
const tree = new Formatter().format(new SoftHyphen());
expect(tree).to.deep.equal({
"w:softHyphen": {},
});
});
});
});
describe("DayShort", () => {
describe("#constructor()", () => {
it("should create a DayShort with correct root key", () => {
const tree = new Formatter().format(new DayShort());
expect(tree).to.deep.equal({
"w:dayShort": {},
});
});
});
});
describe("MonthShort", () => {
describe("#constructor()", () => {
it("should create a MonthShort with correct root key", () => {
const tree = new Formatter().format(new MonthShort());
expect(tree).to.deep.equal({
"w:monthShort": {},
});
});
});
});
describe("YearShort", () => {
describe("#constructor()", () => {
it("should create a YearShort with correct root key", () => {
const tree = new Formatter().format(new YearShort());
expect(tree).to.deep.equal({
"w:yearShort": {},
});
});
});
});
describe("DayLong", () => {
describe("#constructor()", () => {
it("should create a DayLong with correct root key", () => {
const tree = new Formatter().format(new DayLong());
expect(tree).to.deep.equal({
"w:dayLong": {},
});
});
});
});
describe("MonthLong", () => {
describe("#constructor()", () => {
it("should create a MonthLong with correct root key", () => {
const tree = new Formatter().format(new MonthLong());
expect(tree).to.deep.equal({
"w:monthLong": {},
});
});
});
});
describe("YearLong", () => {
describe("#constructor()", () => {
it("should create a YearLong with correct root key", () => {
const tree = new Formatter().format(new YearLong());
expect(tree).to.deep.equal({
"w:yearLong": {},
});
});
});
});
describe("AnnotationReference", () => {
describe("#constructor()", () => {
it("should create a AnnotationReference with correct root key", () => {
const tree = new Formatter().format(new AnnotationReference());
expect(tree).to.deep.equal({
"w:annotationRef": {},
});
});
});
});
describe("FootnoteReferenceElement", () => {
describe("#constructor()", () => {
it("should create a FootnoteReferenceElement with correct root key", () => {
const tree = new Formatter().format(new FootnoteReferenceElement());
expect(tree).to.deep.equal({
"w:footnoteRef": {},
});
});
});
});
describe("EndnoteReference", () => {
describe("#constructor()", () => {
it("should create a EndnoteReference with correct root key", () => {
const tree = new Formatter().format(new EndnoteReference());
expect(tree).to.deep.equal({
"w:endnoteRef": {},
});
});
});
});
describe("Separator", () => {
describe("#constructor()", () => {
it("should create a Separator with correct root key", () => {
const tree = new Formatter().format(new Separator());
expect(tree).to.deep.equal({
"w:separator": {},
});
});
});
});
describe("ContinuationSeparator", () => {
describe("#constructor()", () => {
it("should create a ContinuationSeparator with correct root key", () => {
const tree = new Formatter().format(new ContinuationSeparator());
expect(tree).to.deep.equal({
"w:continuationSeparator": {},
});
});
});
});
describe("PageNumberElement", () => {
describe("#constructor()", () => {
it("should create a PageNumberElement with correct root key", () => {
const tree = new Formatter().format(new PageNumberElement());
expect(tree).to.deep.equal({
"w:pgNum": {},
});
});
});
});
describe("CarriageReturn", () => {
describe("#constructor()", () => {
it("should create a CarriageReturn with correct root key", () => {
const tree = new Formatter().format(new CarriageReturn());
expect(tree).to.deep.equal({
"w:cr": {},
});
});
});
});
describe("Tab", () => {
describe("#constructor()", () => {
it("should create a Tab with correct root key", () => {
const tree = new Formatter().format(new Tab());
expect(tree).to.deep.equal({
"w:tab": {},
});
});
});
});
describe("LastRenderedPageBreak", () => {
describe("#constructor()", () => {
it("should create a LastRenderedPageBreak with correct root key", () => {
const tree = new Formatter().format(new LastRenderedPageBreak());
expect(tree).to.deep.equal({
"w:lastRenderedPageBreak": {},
});
});
});
});

View File

@ -0,0 +1,127 @@
import { EmptyElement } from "@file/xml-components";
// <xsd:group name="EG_RunInnerContent">
// ...
// <xsd:element name="noBreakHyphen" type="CT_Empty"/>
// <xsd:element name="softHyphen" type="CT_Empty" minOccurs="0" />
// <xsd:element name="dayShort" type="CT_Empty" minOccurs="0" />
// <xsd:element name="monthShort" type="CT_Empty" minOccurs="0" />
// <xsd:element name="yearShort" type="CT_Empty" minOccurs="0" />
// <xsd:element name="dayLong" type="CT_Empty" minOccurs="0" />
// <xsd:element name="monthLong" type="CT_Empty" minOccurs="0" />
// <xsd:element name="yearLong" type="CT_Empty" minOccurs="0" />
// <xsd:element name="annotationRef" type="CT_Empty" minOccurs="0" />
// <xsd:element name="footnoteRef" type="CT_Empty" minOccurs="0" />
// <xsd:element name="endnoteRef" type="CT_Empty" minOccurs="0" />
// <xsd:element name="separator" type="CT_Empty" minOccurs="0" />
// <xsd:element name="continuationSeparator" type="CT_Empty" minOccurs="0" />
// ...
// <xsd:element name="pgNum" type="CT_Empty" minOccurs="0" />
// <xsd:element name="cr" type="CT_Empty" minOccurs="0" />
// <xsd:element name="tab" type="CT_Empty" minOccurs="0" />
// ...
// <xsd:element name="lastRenderedPageBreak" type="CT_Empty" minOccurs="0" maxOccurs="1" />
// </xsd:choice>
// </xsd:group>
export class NoBreakHyphen extends EmptyElement {
public constructor() {
super("w:noBreakHyphen");
}
}
export class SoftHyphen extends EmptyElement {
public constructor() {
super("w:softHyphen");
}
}
export class DayShort extends EmptyElement {
public constructor() {
super("w:dayShort");
}
}
export class MonthShort extends EmptyElement {
public constructor() {
super("w:monthShort");
}
}
export class YearShort extends EmptyElement {
public constructor() {
super("w:yearShort");
}
}
export class DayLong extends EmptyElement {
public constructor() {
super("w:dayLong");
}
}
export class MonthLong extends EmptyElement {
public constructor() {
super("w:monthLong");
}
}
export class YearLong extends EmptyElement {
public constructor() {
super("w:yearLong");
}
}
export class AnnotationReference extends EmptyElement {
public constructor() {
super("w:annotationRef");
}
}
export class FootnoteReferenceElement extends EmptyElement {
public constructor() {
super("w:footnoteRef");
}
}
export class EndnoteReference extends EmptyElement {
public constructor() {
super("w:endnoteRef");
}
}
export class Separator extends EmptyElement {
public constructor() {
super("w:separator");
}
}
export class ContinuationSeparator extends EmptyElement {
public constructor() {
super("w:continuationSeparator");
}
}
export class PageNumberElement extends EmptyElement {
public constructor() {
super("w:pgNum");
}
}
export class CarriageReturn extends EmptyElement {
public constructor() {
super("w:cr");
}
}
export class Tab extends EmptyElement {
public constructor() {
super("w:tab");
}
}
export class LastRenderedPageBreak extends EmptyElement {
public constructor() {
super("w:lastRenderedPageBreak");
}
}

View File

@ -1,13 +1,29 @@
// http://www.datypic.com/sc/ooxml/e-w_fldChar-1.html
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
// <xsd:complexType name="CT_FldChar">
// <xsd:choice>
// <xsd:element name="fldData" type="CT_Text" minOccurs="0" maxOccurs="1" />
// <xsd:element name="ffData" type="CT_FFData" minOccurs="0" maxOccurs="1" />
// <xsd:element name="numberingChange" type="CT_TrackChangeNumbering" minOccurs="0" />
// </xsd:choice>
// <xsd:attribute name="fldCharType" type="ST_FldCharType" use="required" />
// <xsd:attribute name="fldLock" type="s:ST_OnOff" />
// <xsd:attribute name="dirty" type="s:ST_OnOff" />
// </xsd:complexType>
enum FieldCharacterType { enum FieldCharacterType {
BEGIN = "begin", BEGIN = "begin",
END = "end", END = "end",
SEPARATE = "separate", SEPARATE = "separate",
} }
class FidCharAttrs extends XmlAttributeComponent<{ readonly type: FieldCharacterType; readonly dirty?: boolean }> { class FidCharAttrs extends XmlAttributeComponent<{
protected readonly xmlKeys = { type: "w:fldCharType", dirty: "w:dirty" }; readonly type: FieldCharacterType;
readonly dirty?: boolean;
readonly fieldLock?: boolean;
}> {
protected readonly xmlKeys = { type: "w:fldCharType", dirty: "w:dirty", fieldLock: "w:fldLock" };
} }
export class Begin extends XmlComponent { export class Begin extends XmlComponent {

View File

@ -1,8 +1,8 @@
import { Attributes, XmlComponent } from "@file/xml-components"; import { Attributes, XmlComponent } from "@file/xml-components";
import { hexColorValue, signedTwipsMeasureValue } from "@util/values"; import { hexColorValue, signedTwipsMeasureValue, UniversalMeasure } from "@util/values";
export class CharacterSpacing extends XmlComponent { export class CharacterSpacing extends XmlComponent {
public constructor(value: number | string) { public constructor(value: number | UniversalMeasure) {
super("w:spacing"); super("w:spacing");
this.root.push( this.root.push(
new Attributes({ new Attributes({

View File

@ -11,10 +11,12 @@ import { ImageRun } from "./image-run";
describe("ImageRun", () => { describe("ImageRun", () => {
before(() => { before(() => {
stub(convenienceFunctions, "uniqueId").callsFake(() => "test-unique-id"); stub(convenienceFunctions, "uniqueId").callsFake(() => "test-unique-id");
stub(convenienceFunctions, "uniqueNumericId").callsFake(() => 0);
}); });
after(() => { after(() => {
(convenienceFunctions.uniqueId as SinonStub).restore(); (convenienceFunctions.uniqueId as SinonStub).restore();
(convenienceFunctions.uniqueNumericId as SinonStub).restore();
}); });
describe("#constructor()", () => { describe("#constructor()", () => {
@ -45,6 +47,7 @@ describe("ImageRun", () => {
}, },
} as unknown as File, } as unknown as File,
viewWrapper: {} as unknown as IViewWrapper, viewWrapper: {} as unknown as IViewWrapper,
stack: [],
}); });
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
"w:r": [ "w:r": [
@ -125,6 +128,7 @@ describe("ImageRun", () => {
descr: "", descr: "",
id: 0, id: 0,
name: "", name: "",
title: "",
}, },
}, },
}, },
@ -295,6 +299,7 @@ describe("ImageRun", () => {
}, },
} as unknown as File, } as unknown as File,
viewWrapper: {} as unknown as IViewWrapper, viewWrapper: {} as unknown as IViewWrapper,
stack: [],
}); });
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
"w:r": [ "w:r": [
@ -375,6 +380,7 @@ describe("ImageRun", () => {
descr: "", descr: "",
id: 0, id: 0,
name: "", name: "",
title: "",
}, },
}, },
}, },
@ -548,6 +554,7 @@ describe("ImageRun", () => {
}, },
} as unknown as File, } as unknown as File,
viewWrapper: {} as unknown as IViewWrapper, viewWrapper: {} as unknown as IViewWrapper,
stack: [],
}); });
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
@ -629,6 +636,7 @@ describe("ImageRun", () => {
descr: "", descr: "",
id: 0, id: 0,
name: "", name: "",
title: "",
}, },
}, },
}, },
@ -805,6 +813,7 @@ describe("ImageRun", () => {
}, },
} as unknown as File, } as unknown as File,
viewWrapper: {} as unknown as IViewWrapper, viewWrapper: {} as unknown as IViewWrapper,
stack: [],
}); });
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
@ -886,6 +895,7 @@ describe("ImageRun", () => {
descr: "", descr: "",
id: 0, id: 0,
name: "", name: "",
title: "",
}, },
}, },
}, },

View File

@ -1,6 +1,7 @@
import { uniqueId } from "@util/convenience-functions"; import { uniqueId } from "@util/convenience-functions";
import { IContext, IXmlableObject } from "@file/xml-components"; import { IContext, IXmlableObject } from "@file/xml-components";
import { DocPropertiesOptions } from "@file/drawing/doc-properties/doc-properties";
import { Drawing, IFloating } from "../../drawing"; import { Drawing, IFloating } from "../../drawing";
import { IMediaTransformation } from "../../media"; import { IMediaTransformation } from "../../media";
@ -11,6 +12,7 @@ export interface IImageOptions {
readonly data: Buffer | string | Uint8Array | ArrayBuffer; readonly data: Buffer | string | Uint8Array | ArrayBuffer;
readonly transformation: IMediaTransformation; readonly transformation: IMediaTransformation;
readonly floating?: IFloating; readonly floating?: IFloating;
readonly altText?: DocPropertiesOptions;
} }
export class ImageRun extends Run { export class ImageRun extends Run {
@ -37,7 +39,7 @@ export class ImageRun extends Run {
rotation: options.transformation.rotation ? options.transformation.rotation * 60000 : undefined, rotation: options.transformation.rotation ? options.transformation.rotation * 60000 : undefined,
}, },
}; };
const drawing = new Drawing(this.imageData, { floating: options.floating }); const drawing = new Drawing(this.imageData, { floating: options.floating, docProperties: options.altText });
this.root.push(drawing); this.root.push(drawing);
} }
@ -49,15 +51,16 @@ export class ImageRun extends Run {
} }
private convertDataURIToBinary(dataURI: string): Uint8Array { private convertDataURIToBinary(dataURI: string): Uint8Array {
// https://gist.github.com/borismus/1032746
// https://github.com/mafintosh/base64-to-uint8array
const BASE64_MARKER = ";base64,";
const base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
if (typeof atob === "function") { if (typeof atob === "function") {
// https://gist.github.com/borismus/1032746
// https://github.com/mafintosh/base64-to-uint8array
const BASE64_MARKER = ";base64,";
const base64Index = dataURI.indexOf(BASE64_MARKER);
const base64IndexWithOffset = base64Index === -1 ? 0 : base64Index + BASE64_MARKER.length;
return new Uint8Array( return new Uint8Array(
atob(dataURI.substring(base64Index)) atob(dataURI.substring(base64IndexWithOffset))
.split("") .split("")
.map((c) => c.charCodeAt(0)), .map((c) => c.charCodeAt(0)),
); );

View File

@ -7,6 +7,7 @@ export * from "./run-fonts";
export * from "./sequential-identifier"; export * from "./sequential-identifier";
export * from "./underline"; export * from "./underline";
export * from "./emphasis-mark"; export * from "./emphasis-mark";
export * from "./tab";
export * from "./simple-field"; export * from "./simple-field";
export * from "./comment-run"; export * from "./comment-run";
export * from "./empty-children";
export * from "./positional-tab";

View File

@ -0,0 +1,29 @@
import { expect } from "chai";
import { Formatter } from "@export/formatter";
import { createLanguageComponent } from "./language";
describe("Language", () => {
describe("#createLanguageComponent", () => {
it("should create a language component", () => {
const tree = new Formatter().format(
createLanguageComponent({
value: "en-US",
eastAsia: "zh-CN",
bidirectional: "ar-SA",
}),
);
expect(tree).to.deep.equal({
"w:lang": {
_attr: {
"w:bidi": "ar-SA",
"w:eastAsia": "zh-CN",
"w:val": "en-US",
},
},
});
});
});
});

View File

@ -0,0 +1,35 @@
import { BuilderElement, XmlComponent } from "@file/xml-components";
// <xsd:complexType name="CT_Language">
// <xsd:attribute name="val" type="s:ST_Lang" use="optional"/>
// <xsd:attribute name="eastAsia" type="s:ST_Lang" use="optional"/>
// <xsd:attribute name="bidi" type="s:ST_Lang" use="optional"/>
// </xsd:complexType>
export interface ILanguageOptions {
readonly value?: string;
readonly eastAsia?: string;
readonly bidirectional?: string;
}
export const createLanguageComponent = (options: ILanguageOptions): XmlComponent =>
new BuilderElement<{
readonly value?: string;
readonly eastAsia?: string;
readonly bidirectional?: string;
}>({
name: "w:lang",
attributes: {
value: {
key: "w:val",
value: options.value,
},
eastAsia: {
key: "w:eastAsia",
value: options.eastAsia,
},
bidirectional: {
key: "w:bidi",
value: options.bidirectional,
},
},
});

View File

@ -1,4 +1,4 @@
import { SpaceType } from "@file/space-type"; import { SpaceType } from "@file/shared";
import { XmlComponent } from "@file/xml-components"; import { XmlComponent } from "@file/xml-components";
import { TextAttributes } from "./text-attributes"; import { TextAttributes } from "./text-attributes";

View File

@ -0,0 +1,27 @@
import { expect } from "chai";
import { Formatter } from "@export/formatter";
import { PositionalTab, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo } from "./positional-tab";
describe("PositionalTab", () => {
it("should create a PositionalTab with correct root key", () => {
const tree = new Formatter().format(
new PositionalTab({
alignment: PositionalTabAlignment.CENTER,
relativeTo: PositionalTabRelativeTo.MARGIN,
leader: PositionalTabLeader.DOT,
}),
);
expect(tree).to.deep.equal({
"w:ptab": {
_attr: {
"w:alignment": "center",
"w:relativeTo": "margin",
"w:leader": "dot",
},
},
});
});
});

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