@json-to-office/core-docx 7.2.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1539 -471
- package/dist/index.js.map +1 -1
- package/dist/ir/chartValues.d.ts +16 -0
- package/dist/ir/chartValues.d.ts.map +1 -0
- package/dist/ir/compiler.d.ts.map +1 -1
- package/dist/ir/features.d.ts.map +1 -1
- package/dist/ir/theme.d.ts +43 -0
- package/dist/ir/theme.d.ts.map +1 -0
- package/dist/ir/types.d.ts +39 -3
- package/dist/ir/types.d.ts.map +1 -1
- package/dist/ir/validation.d.ts +2 -1
- package/dist/ir/validation.d.ts.map +1 -1
- package/dist/plugin/example/index.js +1536 -468
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/renderers/chartText.d.ts +43 -0
- package/dist/renderers/chartText.d.ts.map +1 -0
- package/dist/renderers/docxjs/charts.d.ts +45 -0
- package/dist/renderers/docxjs/charts.d.ts.map +1 -0
- package/dist/renderers/docxjs/docxSubpath.d.ts +34 -0
- package/dist/renderers/docxjs/docxSubpath.d.ts.map +1 -0
- package/dist/renderers/docxjs/drawingGroup.d.ts +79 -0
- package/dist/renderers/docxjs/drawingGroup.d.ts.map +1 -0
- package/dist/renderers/docxjs/drawingGroupRepair.d.ts +36 -0
- package/dist/renderers/docxjs/drawingGroupRepair.d.ts.map +1 -0
- package/dist/renderers/docxjs/emit.d.ts +10 -2
- package/dist/renderers/docxjs/emit.d.ts.map +1 -1
- package/dist/renderers/docxjs/index.d.ts +2 -1
- package/dist/renderers/docxjs/index.d.ts.map +1 -1
- package/dist/renderers/docxjs/presetShapes.d.ts +233 -0
- package/dist/renderers/docxjs/presetShapes.d.ts.map +1 -0
- package/dist/renderers/office-open/chartLook.d.ts +45 -0
- package/dist/renderers/office-open/chartLook.d.ts.map +1 -0
- package/dist/renderers/office-open/chartParts.d.ts +29 -15
- package/dist/renderers/office-open/chartParts.d.ts.map +1 -1
- package/dist/renderers/office-open/emit.d.ts +25 -39
- package/dist/renderers/office-open/emit.d.ts.map +1 -1
- package/dist/renderers/office-open/index.d.ts +16 -4
- package/dist/renderers/office-open/index.d.ts.map +1 -1
- package/dist/renderers/office-open/themePart.d.ts +28 -0
- package/dist/renderers/office-open/themePart.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/chartWorkbook.d.ts +2 -1
- package/dist/utils/chartWorkbook.d.ts.map +1 -1
- package/dist/utils/fixFloatingImageIds.d.ts +17 -9
- package/dist/utils/fixFloatingImageIds.d.ts.map +1 -1
- package/dist/utils/packageDocument.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/renderers/office-open/cellTocs.d.ts +0 -26
- package/dist/renderers/office-open/cellTocs.d.ts.map +0 -1
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* turning those five parts into a ZIP, with adm-zip, which is this core's
|
|
8
8
|
* archive library and not the other's.
|
|
9
9
|
*/
|
|
10
|
+
import { chartWorkbookParts } from '@json-to-office/shared/rendering';
|
|
10
11
|
import type { ChartPartSeries } from '@json-to-office/shared/rendering';
|
|
11
12
|
/**
|
|
12
13
|
* Build the xlsx package a chart's `c:externalData` points at.
|
|
@@ -14,6 +15,6 @@ import type { ChartPartSeries } from '@json-to-office/shared/rendering';
|
|
|
14
15
|
* Entry order comes from the shared part list rather than from iteration
|
|
15
16
|
* order here, so the ZIP central directory is a function of the data alone.
|
|
16
17
|
*/
|
|
17
|
-
export declare function buildChartWorkbook(series: readonly ChartPartSeries[]): Uint8Array;
|
|
18
|
+
export declare function buildChartWorkbook(series: readonly ChartPartSeries[], options?: Parameters<typeof chartWorkbookParts>[1]): Uint8Array;
|
|
18
19
|
export { CHART_WORKBOOK_SHEET_NAME, categoryReference, columnLetter, seriesNameReference, seriesValueReference, } from '@json-to-office/shared/rendering';
|
|
19
20
|
//# sourceMappingURL=chartWorkbook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chartWorkbook.d.ts","sourceRoot":"","sources":["../../src/utils/chartWorkbook.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"chartWorkbook.d.ts","sourceRoot":"","sources":["../../src/utils/chartWorkbook.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMxE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,OAAO,GAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAM,GACrD,UAAU,CAgBZ;AAED,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,kCAAkC,CAAC"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Give every drawing in a docx.js package a deterministic, package-unique
|
|
3
|
+
* `wp:docPr` id.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* docx 9.8.0 draws `wp:docPr` ids from one counter shared by every drawing in
|
|
6
|
+
* the process (dolanmiu/docx#3521): unique, but the numbers depend on how many
|
|
7
|
+
* drawings were created before this document, so the same document rendered
|
|
8
|
+
* twice produces different bytes. Before 9.8.0 the ids were per instance and
|
|
9
|
+
* every drawing outside `document.xml` carried `id="1"`.
|
|
6
10
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
11
|
+
* OOXML wants the id unique across the whole document, headers and notes
|
|
12
|
+
* included, so this pass renumbers one sequence across every part that can
|
|
13
|
+
* hold a drawing, in a fixed order: the body first, then headers and footers
|
|
14
|
+
* by number, then footnotes, endnotes and comments. The body's ids are the
|
|
15
|
+
* ones the pre-9.8.0 pass wrote, so a document without chrome drawings is
|
|
16
|
+
* unchanged.
|
|
12
17
|
*/
|
|
13
18
|
/// <reference types="node" />
|
|
14
19
|
/// <reference types="node" />
|
|
15
|
-
|
|
20
|
+
export declare const DRAWING_PART: RegExp;
|
|
21
|
+
/** The order ids are allocated in: body, headers, footers, notes, comments. */
|
|
22
|
+
export declare function compareDrawingParts(a: string, b: string): number;
|
|
23
|
+
/** Renumber every `wp:docPr` id in the package, one sequence across parts. */
|
|
16
24
|
export declare function fixFloatingImageIdsInBuffer(buffer: Buffer): Buffer;
|
|
17
25
|
/**
|
|
18
26
|
* Fix floating image issues in a generated DOCX file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixFloatingImageIds.d.ts","sourceRoot":"","sources":["../../src/utils/fixFloatingImageIds.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fixFloatingImageIds.d.ts","sourceRoot":"","sources":["../../src/utils/fixFloatingImageIds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAKH,eAAO,MAAM,YAAY,QACiD,CAAC;AAU3E,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED,8EAA8E;AAC9E,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA8BlE;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageDocument.d.ts","sourceRoot":"","sources":["../../src/utils/packageDocument.ts"],"names":[],"mappings":";;AAGA,MAAM,WAAW,sBAAsB;IACrC,8EAA8E;IAC9E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,MAAuC,CAAC;AAE5E,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAiB5E;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAU5C;
|
|
1
|
+
{"version":3,"file":"packageDocument.d.ts","sourceRoot":"","sources":["../../src/utils/packageDocument.ts"],"names":[],"mappings":";;AAGA,MAAM,WAAW,sBAAsB;IACrC,8EAA8E;IAC9E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,MAAuC,CAAC;AAE5E,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAiB5E;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAU5C;AA4MD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,WAAW,GAAE,IAA8B,GAC1C,MAAM,CA8BR;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@json-to-office/core-docx",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Core DOCX document generation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@office-open/docx": "0.
|
|
21
|
+
"@office-open/docx": "0.14.6",
|
|
22
22
|
"@resvg/resvg-js": "2.6.2",
|
|
23
23
|
"@sinclair/typebox": "0.34.38",
|
|
24
24
|
"adm-zip": "0.5.16",
|
|
25
25
|
"date-fns": "3.6.0",
|
|
26
26
|
"probe-image-size": "7.2.3",
|
|
27
27
|
"@json-to-office/quality": "^7.2.0",
|
|
28
|
-
"@json-to-office/shared": "^7.0
|
|
29
|
-
"@json-to-office/shared-docx": "^7.
|
|
28
|
+
"@json-to-office/shared": "^7.3.0",
|
|
29
|
+
"@json-to-office/shared-docx": "^7.3.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"docx": "9.
|
|
32
|
+
"docx": "9.8.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@office-open/core": "0.
|
|
35
|
+
"@office-open/core": "0.14.6",
|
|
36
36
|
"@types/adm-zip": "0.5.7",
|
|
37
37
|
"@types/node": "22.20.2",
|
|
38
38
|
"@types/probe-image-size": "7.2.4",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A table of contents in a table cell, for DOCX.
|
|
3
|
-
*
|
|
4
|
-
* `@office-open/docx` writes a table cell's paragraphs and tables and nothing
|
|
5
|
-
* else: `stringifyCellChild` answers any other child with an empty string, so
|
|
6
|
-
* a contents field in a cell used to vanish from the package. The emitter
|
|
7
|
-
* therefore hands one over as its entry paragraphs between two marker
|
|
8
|
-
* paragraphs (`cellChildren` in `emit.ts`), and this replaces the three with
|
|
9
|
-
* what the backend writes for a table of contents in the body: its own
|
|
10
|
-
* `stringifyTableOfContents`, around the same entry paragraphs — which the
|
|
11
|
-
* backend writes the same way in a cell as in the body.
|
|
12
|
-
*/
|
|
13
|
-
import type AdmZip from 'adm-zip';
|
|
14
|
-
import type { CellToc } from './emit';
|
|
15
|
-
/** The backend's writer for a table of contents: an `sdt` around the field. */
|
|
16
|
-
export type StringifyTableOfContents = (alias?: string, options?: Record<string, unknown>, entriesXml?: string) => string;
|
|
17
|
-
/**
|
|
18
|
-
* Put every table of contents the emitter left in a cell back together.
|
|
19
|
-
*
|
|
20
|
-
* Each marker has to be found exactly once. One that is missing, repeated or
|
|
21
|
-
* out of order means the paragraphs between the two are not the entries that
|
|
22
|
-
* were emitted, and a field around the wrong paragraphs — or marker text left
|
|
23
|
-
* in the document — is worse than a failed render.
|
|
24
|
-
*/
|
|
25
|
-
export declare function spliceCellTocs(zip: AdmZip, tocs: readonly CellToc[], stringifyTableOfContents: StringifyTableOfContents): void;
|
|
26
|
-
//# sourceMappingURL=cellTocs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cellTocs.d.ts","sourceRoot":"","sources":["../../../src/renderers/office-open/cellTocs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,+EAA+E;AAC/E,MAAM,MAAM,wBAAwB,GAAG,CACrC,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,UAAU,CAAC,EAAE,MAAM,KAChB,MAAM,CAAC;AAKZ;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,wBAAwB,EAAE,wBAAwB,GACjD,IAAI,CAmCN"}
|