@json-to-office/core-docx 1.3.0 → 1.4.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.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +238 -158
- package/dist/index.js.map +1 -1
- package/dist/ir/compiler.d.ts.map +1 -1
- package/dist/plugin/example/index.js +234 -158
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/renderers/docxjs/index.d.ts.map +1 -1
- package/dist/renderers/office-open/index.d.ts.map +1 -1
- package/dist/renderers/registry.d.ts +18 -4
- package/dist/renderers/registry.d.ts.map +1 -1
- package/dist/styles/themeToStyles.d.ts +35 -1
- package/dist/styles/themeToStyles.d.ts.map +1 -1
- package/dist/templates/themes/apex.docx.theme.json +1 -2
- package/dist/templates/themes/corporate.docx.theme.json +1 -2
- package/dist/templates/themes/devportal.docx.theme.json +1 -2
- package/dist/templates/themes/minimal.docx.theme.json +1 -2
- package/dist/templates/themes/modern.docx.theme.json +1 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/docxjs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAIL,QAAQ,EAUT,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAAqB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,QAAQ,CAAC;AAGhB,eAAO,MAAM,kBAAkB,EAAE,cAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/docxjs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAIL,QAAQ,EAUT,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAAqB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,QAAQ,CAAC;AAGhB,eAAO,MAAM,kBAAkB,EAAE,cAAyB,CAAC;AAwC3D,wBAAgB,oBAAoB,IAAI,YAAY,CA0BnD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,SAAS,GAAE,aAAyB,GACnC,QAAQ,CA2CV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/office-open/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EACV,MAAM,EAEN,cAAc,EAGf,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAAqB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAWhF,eAAO,MAAM,4BAA4B,EAAE,cAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/office-open/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EACV,MAAM,EAEN,cAAc,EAGf,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAAqB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAWhF,eAAO,MAAM,4BAA4B,EAAE,cAA8B,CAAC;AA8D1E,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,YAAY,CAAC,CAqD1E;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,cAAc,EAAO,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA4ClC"}
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DOCX renderer registry.
|
|
3
3
|
*
|
|
4
|
-
* Adapters are registered as async factories so
|
|
5
|
-
*
|
|
6
|
-
* `@office-open/docx`, and a
|
|
7
|
-
*
|
|
4
|
+
* Adapters are registered as async factories so a backend is only imported
|
|
5
|
+
* when it is actually selected — choosing `docxjs` never loads
|
|
6
|
+
* `@office-open/docx`, and a backend that cannot be loaded at all (an
|
|
7
|
+
* `--omit=optional` install, a broken tree) surfaces as an actionable install
|
|
8
|
+
* hint rather than a bare module-resolution failure. `statuses()` asks the
|
|
9
|
+
* same question up front, so a discovery surface never advertises a renderer
|
|
10
|
+
* that would fail on the first render.
|
|
8
11
|
*/
|
|
12
|
+
import { type RendererStatus } from '@json-to-office/shared/rendering';
|
|
9
13
|
import { type DocxRenderer, type DocxRendererId } from './types';
|
|
10
14
|
/** Resolve a renderer by id, defaulting to `docxjs`. */
|
|
11
15
|
export declare function resolveDocxRenderer(id?: DocxRendererId): Promise<DocxRenderer>;
|
|
12
16
|
/** Renderer ids registered for DOCX. */
|
|
13
17
|
export declare function docxRendererIds(): readonly DocxRendererId[];
|
|
18
|
+
/**
|
|
19
|
+
* Every registered renderer with whether its backend can be loaded here.
|
|
20
|
+
*
|
|
21
|
+
* Registration is not availability: the factory only runs on selection, so an
|
|
22
|
+
* id alone says nothing about whether the render behind it will work. Callers
|
|
23
|
+
* that advertise renderers — `jto_info`, `jto_discover` — report this instead
|
|
24
|
+
* of docxRendererIds() so a renderer that cannot run is never offered as one
|
|
25
|
+
* that can.
|
|
26
|
+
*/
|
|
27
|
+
export declare function docxRendererStatuses(): Promise<RendererStatus<DocxRendererId>[]>;
|
|
14
28
|
export declare function isDocxRendererId(value: string): value is DocxRendererId;
|
|
15
29
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/renderers/registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/renderers/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAiBjB,wDAAwD;AACxD,wBAAgB,mBAAmB,CACjC,EAAE,CAAC,EAAE,cAAc,GAClB,OAAO,CAAC,YAAY,CAAC,CAEvB;AAED,wCAAwC;AACxC,wBAAgB,eAAe,IAAI,SAAS,cAAc,EAAE,CAE3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAC7C,cAAc,CAAC,cAAc,CAAC,EAAE,CACjC,CAEA;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAEvE"}
|
|
@@ -6,7 +6,41 @@
|
|
|
6
6
|
* shape, so which styles a document defines — and what each one says — is
|
|
7
7
|
* decided once, here, rather than once per renderer.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Style ids a `statistic` lowers to.
|
|
11
|
+
*
|
|
12
|
+
* Exported because the compiler names them on every statistic paragraph it
|
|
13
|
+
* emits and the two must not drift: a `w:pStyle` pointing at a style the
|
|
14
|
+
* document does not define is not an error anywhere in OOXML, it just resolves
|
|
15
|
+
* to Normal — which is how the component came to render as two ordinary body
|
|
16
|
+
* paragraphs with nothing to tell the number from its caption.
|
|
17
|
+
*/
|
|
18
|
+
export declare const STATISTIC_NUMBER_STYLE_ID = "StatisticNumber";
|
|
19
|
+
export declare const STATISTIC_DESCRIPTION_STYLE_ID = "StatisticDescription";
|
|
20
|
+
/**
|
|
21
|
+
* The number's size, in points, per the component's `size` prop.
|
|
22
|
+
*
|
|
23
|
+
* `medium` is what the style itself carries; the compiler overrides the run
|
|
24
|
+
* for the other two, so a document that never states `size` needs no run
|
|
25
|
+
* properties at all and restyling every statistic stays a one-style edit.
|
|
26
|
+
*/
|
|
27
|
+
export declare const STATISTIC_SIZE_POINTS: Readonly<Record<string, number>>;
|
|
28
|
+
import type { DocxIrParagraphStyle, DocxIrStyles } from '../ir/types';
|
|
10
29
|
import type { ThemeConfig } from './index';
|
|
11
30
|
export declare function createDocumentStyles(themeNameOrObject?: string | ThemeConfig, language?: string): DocxIrStyles;
|
|
31
|
+
/**
|
|
32
|
+
* The two paragraph styles a `statistic` lowers to.
|
|
33
|
+
*
|
|
34
|
+
* Separate from `createDocumentStyles`, and appended by the compiler only when
|
|
35
|
+
* the document actually contains a statistic. Defining them unconditionally
|
|
36
|
+
* would rewrite `word/styles.xml` in every document ever produced — including
|
|
37
|
+
* the ones with no statistic in them — to fix a component most documents never
|
|
38
|
+
* use, and every recorded golden with it.
|
|
39
|
+
*
|
|
40
|
+
* A theme that names either id under `styles` has already had it emitted as a
|
|
41
|
+
* custom style, so that one is skipped rather than defined twice: two entries
|
|
42
|
+
* with the same id leave the later one winning, and the later one here is the
|
|
43
|
+
* default, not the theme's.
|
|
44
|
+
*/
|
|
45
|
+
export declare function createStatisticStyles(theme: ThemeConfig): DocxIrParagraphStyle[];
|
|
12
46
|
//# sourceMappingURL=themeToStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeToStyles.d.ts","sourceRoot":"","sources":["../../src/styles/themeToStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"themeToStyles.d.ts","sourceRoot":"","sources":["../../src/styles/themeToStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,oBAAoB,CAAC;AAC3D,eAAO,MAAM,8BAA8B,yBAAyB,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIlE,CAAC;AAEF,OAAO,KAAK,EAMV,oBAAoB,EAEpB,YAAY,EAEb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAoX3C,wBAAgB,oBAAoB,CAClC,iBAAiB,GAAE,MAAM,GAAG,WAAuB,EACnD,QAAQ,CAAC,EAAE,MAAM,GAChB,YAAY,CAgjBd;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,WAAW,GACjB,oBAAoB,EAAE,CAmExB"}
|