@json-to-office/core-docx 4.5.0 → 5.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/blueprints/index.d.ts +9 -31
- package/dist/blueprints/index.d.ts.map +1 -1
- package/dist/index.js +1443 -367
- package/dist/index.js.map +1 -1
- package/dist/plugin/example/index.js +516 -48
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/quality/rules.d.ts +43 -1
- package/dist/quality/rules.d.ts.map +1 -1
- package/dist/templates/blueprints/technical-report.docx.blueprint.json +693 -0
- package/dist/templates/themes/devportal.docx.theme.json +313 -36
- package/dist/templates/themes/vermilion.docx.theme.json +203 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -3,43 +3,21 @@
|
|
|
3
3
|
* turns one into a document.
|
|
4
4
|
*
|
|
5
5
|
* The registry is the JSON files under `templates/blueprints`: the bundled
|
|
6
|
-
*
|
|
6
|
+
* ones are imported so a stale or missing `dist` cannot lose them, and the
|
|
7
7
|
* directory is scanned for any other `*.docx.blueprint.json` beside it, so
|
|
8
8
|
* adding a blueprint is a file. Each is validated against the shared
|
|
9
9
|
* blueprint schema when this module loads, so a malformed one fails at import
|
|
10
|
-
* rather than at scaffold time.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* fill-map entry: where it is, what kind of slot holds it, its budget and the
|
|
16
|
-
* guidance the marker text carries. Nothing here composes or styles.
|
|
10
|
+
* rather than at scaffold time. What instantiating means — copying a variant,
|
|
11
|
+
* carrying the definitions it invokes and their dependencies, listing every
|
|
12
|
+
* `{{…}}` marker with its slot budget and guidance — is shared with the PPTX
|
|
13
|
+
* core; this module only says what a document's root looks like: metadata
|
|
14
|
+
* under `props.metadata`. Nothing here composes or styles.
|
|
17
15
|
*/
|
|
18
|
-
import { type Blueprint, type BlueprintFillEntry, type
|
|
16
|
+
import { valueAt, type Blueprint, type BlueprintFillEntry, type InstantiateBlueprintOptions, type InstantiatedBlueprint } from '@json-to-office/shared';
|
|
19
17
|
/** Every bundled DOCX blueprint, by id. */
|
|
20
18
|
export declare const DOCX_BLUEPRINTS: Readonly<Record<string, Blueprint>>;
|
|
21
19
|
export declare function docxBlueprint(id: string): Blueprint | undefined;
|
|
22
|
-
export type { BlueprintFillEntry };
|
|
23
|
-
export
|
|
24
|
-
/** A variant id from `blueprint.variants`; the first when omitted. */
|
|
25
|
-
variant?: string;
|
|
26
|
-
/** Overrides the blueprint's recommended theme. */
|
|
27
|
-
theme?: string;
|
|
28
|
-
/**
|
|
29
|
-
* The block definitions the variant invokes — the `props.blocks` of the
|
|
30
|
-
* playground template the blueprint names. The scaffold carries the ones it
|
|
31
|
-
* uses, plus their dependencies; nothing is looked up at render time.
|
|
32
|
-
*/
|
|
33
|
-
definitions: Readonly<Record<string, JsonBlockDefinition>>;
|
|
34
|
-
/** Metadata values that replace the variant's marked ones. */
|
|
35
|
-
metadata?: Readonly<Record<string, string>>;
|
|
36
|
-
}
|
|
37
|
-
export interface InstantiatedBlueprint {
|
|
38
|
-
document: Record<string, unknown>;
|
|
39
|
-
fillMap: BlueprintFillEntry[];
|
|
40
|
-
variant: string;
|
|
41
|
-
}
|
|
20
|
+
export type { BlueprintFillEntry, InstantiateBlueprintOptions, InstantiatedBlueprint, };
|
|
21
|
+
export { valueAt };
|
|
42
22
|
export declare function instantiateDocxBlueprint(blueprint: Blueprint, options: InstantiateBlueprintOptions): InstantiatedBlueprint;
|
|
43
|
-
/** The value a JSON pointer names, or undefined. */
|
|
44
|
-
export declare function valueAt(root: unknown, pointer: string): unknown;
|
|
45
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blueprints/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blueprints/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAGL,OAAO,EACP,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC3B,MAAM,wBAAwB,CAAC;AAoChC,2CAA2C;AAC3C,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAG/D,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE/D;AAED,YAAY,EACV,kBAAkB,EAClB,2BAA2B,EAC3B,qBAAqB,GACtB,CAAC;AACF,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,2BAA2B,GACnC,qBAAqB,CASvB"}
|