@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.
@@ -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
- * one is imported so a stale or missing `dist` cannot lose it, and the
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. `instantiate` copies
11
- * a variant's children, writes the recommended theme and the archetype's
12
- * quality profile onto the root, brings the block definitions the children
13
- * invoke and the definitions those depend on from the playground
14
- * template the blueprint names, and lists every `{{…}}` scaffold marker as a
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 JsonBlockDefinition } from '@json-to-office/shared';
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 interface InstantiateBlueprintOptions {
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;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,kBAAkB,EAGvB,KAAK,mBAAmB,EACzB,MAAM,wBAAwB,CAAC;AAyDhC,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,EAAE,kBAAkB,EAAE,CAAC;AAEnC,MAAM,WAAW,2BAA2B;IAC1C,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC3D,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAA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