@json-to-office/core-docx 7.5.1 → 7.6.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/core/fontEmbedding.d.ts +39 -0
- package/dist/core/fontEmbedding.d.ts.map +1 -0
- package/dist/core/fontResolution.d.ts +13 -9
- package/dist/core/fontResolution.d.ts.map +1 -1
- package/dist/core/generateFromIr.d.ts +8 -1
- package/dist/core/generateFromIr.d.ts.map +1 -1
- package/dist/core/generationContext.d.ts.map +1 -1
- package/dist/index.js +176 -29
- package/dist/index.js.map +1 -1
- package/dist/plugin/example/index.js +164 -17
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/renderers/docxjs/index.d.ts +3 -1
- package/dist/renderers/docxjs/index.d.ts.map +1 -1
- package/dist/renderers/types.d.ts +11 -1
- package/dist/renderers/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/packageDocument.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { Document, type PageNumberEstimator } from 'docx';
|
|
10
10
|
import type { DocxIR } from '../../ir/types';
|
|
11
11
|
import type { DocxRenderer, DocxRendererId } from '../types';
|
|
12
|
+
import type { EmbeddedFontFace } from '@json-to-office/shared';
|
|
12
13
|
import { type EmitResources } from './emit';
|
|
13
14
|
export declare const DOCXJS_RENDERER_ID: DocxRendererId;
|
|
14
15
|
export declare function createDocxJsRenderer(): DocxRenderer;
|
|
@@ -20,6 +21,7 @@ export declare function createDocxJsRenderer(): DocxRenderer;
|
|
|
20
21
|
* `await loadDocxCharts()` first; `render()` does it. `pageNumbers` is the
|
|
21
22
|
* estimator a document with a contents field is laid out with
|
|
22
23
|
* (`createPageNumberEstimator`); without it no field is filled.
|
|
24
|
+
* `embeddedFonts` are the faces `embed` mode writes into the package.
|
|
23
25
|
*/
|
|
24
|
-
export declare function buildDocument(ir: DocxIR, resources?: EmitResources, pageNumbers?: PageNumberEstimator): Document;
|
|
26
|
+
export declare function buildDocument(ir: DocxIR, resources?: EmitResources, pageNumbers?: PageNumberEstimator, embeddedFonts?: readonly EmbeddedFontFace[]): Document;
|
|
25
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/docxjs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAIL,QAAQ,EAcR,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAC;AAQd,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,gBAAgB,CAAC;AAQxB,OAAO,KAAK,EAAqB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAML,KAAK,aAAa,EAEnB,MAAM,QAAQ,CAAC;AAUhB,eAAO,MAAM,kBAAkB,EAAE,cAAyB,CAAC;AAwD3D,wBAAgB,oBAAoB,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/docxjs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAIL,QAAQ,EAcR,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAC;AAQd,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,gBAAgB,CAAC;AAQxB,OAAO,KAAK,EAAqB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAML,KAAK,aAAa,EAEnB,MAAM,QAAQ,CAAC;AAUhB,eAAO,MAAM,kBAAkB,EAAE,cAAyB,CAAC;AAwD3D,wBAAgB,oBAAoB,IAAI,YAAY,CA4DnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,SAAS,GAAE,aAAyB,EACpC,WAAW,CAAC,EAAE,mBAAmB,EACjC,aAAa,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAC1C,QAAQ,CAsDV"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* do, and they are the only places allowed to.
|
|
7
7
|
*/
|
|
8
8
|
import type { OfficeRenderer, RenderOptions } from '@json-to-office/shared/rendering';
|
|
9
|
-
import type { GenerationWarning } from '@json-to-office/shared';
|
|
9
|
+
import type { EmbeddedFontFace, GenerationWarning } from '@json-to-office/shared';
|
|
10
10
|
import type { DocxFeature } from '../ir/features';
|
|
11
11
|
import type { DocxIR } from '../ir/types';
|
|
12
12
|
import { DEFAULT_DOCX_RENDERER_ID, type DocxRendererId } from '@json-to-office/shared-docx';
|
|
@@ -36,6 +36,16 @@ export interface DocxRenderOptions extends RenderOptions {
|
|
|
36
36
|
* can turn it off and get the render back.
|
|
37
37
|
*/
|
|
38
38
|
svgRasterFallback?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Font faces to write into the package (`embed` export mode), one entry per
|
|
41
|
+
* family with its regular face and up to three more.
|
|
42
|
+
*
|
|
43
|
+
* A render-time resource, not document semantics: which faces embed was
|
|
44
|
+
* decided for this render, against the renderer writing it, and the IR is
|
|
45
|
+
* the same whether or not anything does. An adapter that cannot embed
|
|
46
|
+
* ignores it — `office-open` does, and the pipeline never hands it any.
|
|
47
|
+
*/
|
|
48
|
+
embeddedFonts?: readonly EmbeddedFontFace[];
|
|
39
49
|
}
|
|
40
50
|
export interface DocxRenderer extends OfficeRenderer<DocxIR, DocxFeature, DocxRendererId> {
|
|
41
51
|
render(document: DocxIR, options?: DocxRenderOptions): Promise<Uint8Array>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/renderers/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/renderers/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,wBAAwB,EACxB,KAAK,cAAc,EACpB,MAAM,6BAA6B,CAAC;AAErC;;;;;GAKG;AACH,OAAO,EAAE,wBAAwB,EAAE,CAAC;AACpC,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,YACf,SAAQ,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC;IAC3D,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC5E;AAED,YAAY,EAAE,aAAa,EAAE,CAAC"}
|