@json-to-office/core-docx 0.20.0 → 0.22.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/components/highcharts.d.ts.map +1 -1
- package/dist/components/section.d.ts.map +1 -1
- package/dist/components/toc/index.d.ts.map +1 -1
- package/dist/core/cached-render.d.ts.map +1 -1
- package/dist/core/content.d.ts.map +1 -1
- package/dist/core/generator.d.ts +6 -2
- package/dist/core/generator.d.ts.map +1 -1
- package/dist/core/render.d.ts +8 -6
- package/dist/core/render.d.ts.map +1 -1
- package/dist/core/structure.d.ts +5 -2
- package/dist/core/structure.d.ts.map +1 -1
- package/dist/index.js +508 -381
- package/dist/index.js.map +1 -1
- package/dist/plugin/createDocumentGenerator.d.ts +4 -0
- package/dist/plugin/createDocumentGenerator.d.ts.map +1 -1
- package/dist/plugin/example/index.js +486 -321
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/plugin/types.d.ts +4 -0
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/styles/utils/colorUtils.d.ts +4 -3
- package/dist/styles/utils/colorUtils.d.ts.map +1 -1
- package/dist/styles/utils/resolveComponentTree.d.ts +3 -0
- package/dist/styles/utils/resolveComponentTree.d.ts.map +1 -1
- package/dist/templates/themes/apex.docx.theme.json +1 -6
- package/dist/templates/themes/corporate.docx.theme.json +7 -7
- package/dist/templates/themes/devportal.docx.theme.json +1 -6
- package/dist/templates/themes/index.d.ts +12 -0
- package/dist/templates/themes/index.d.ts.map +1 -1
- package/dist/templates/themes/minimal.docx.theme.json +1 -6
- package/dist/templates/themes/modern.docx.theme.json +1 -6
- package/dist/themes/defaults.d.ts +3 -0
- package/dist/themes/defaults.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/bookmarkRegistry.d.ts +5 -2
- package/dist/utils/bookmarkRegistry.d.ts.map +1 -1
- package/dist/utils/fixFloatingImageIds.d.ts +3 -0
- package/dist/utils/fixFloatingImageIds.d.ts.map +1 -1
- package/dist/utils/generationContext.d.ts +5 -0
- package/dist/utils/generationContext.d.ts.map +1 -0
- package/dist/utils/numberingConfig.d.ts +5 -2
- package/dist/utils/numberingConfig.d.ts.map +1 -1
- package/dist/utils/packageDocument.d.ts +20 -0
- package/dist/utils/packageDocument.d.ts.map +1 -0
- package/dist/utils/placeholderProcessor.d.ts +5 -5
- package/dist/utils/placeholderProcessor.d.ts.map +1 -1
- package/dist/utils/revisionUtils.d.ts +5 -5
- package/dist/utils/revisionUtils.d.ts.map +1 -1
- package/dist/utils/textParser.d.ts +3 -3
- package/dist/utils/textParser.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -12,8 +12,11 @@ export interface BookmarkInfo {
|
|
|
12
12
|
* Used to track bookmark IDs and validate internal hyperlink targets
|
|
13
13
|
*/
|
|
14
14
|
export declare class BookmarkRegistry {
|
|
15
|
-
private
|
|
16
|
-
private
|
|
15
|
+
private readonly fallback;
|
|
16
|
+
private readonly scopes;
|
|
17
|
+
private get state();
|
|
18
|
+
/** Run work with an isolated registry that follows its async call chain. */
|
|
19
|
+
runScoped<T>(callback: () => T): T;
|
|
17
20
|
/**
|
|
18
21
|
* Register a bookmark
|
|
19
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookmarkRegistry.d.ts","sourceRoot":"","sources":["../../src/utils/bookmarkRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"bookmarkRegistry.d.ts","sourceRoot":"","sources":["../../src/utils/bookmarkRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAMD;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IACpE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;IAEjE,OAAO,KAAK,KAAK,GAEhB;IAED,4EAA4E;IAC5E,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;IAIlC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IASvD;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAmB,GAAG,MAAM;IAkB5D;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI3B;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAIzC;;OAEG;IACH,MAAM,IAAI,YAAY,EAAE;IAIxB;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;;OAGG;IACH,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;CAStD;AAGD,eAAO,MAAM,sBAAsB,kBAAyB,CAAC"}
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
*
|
|
11
11
|
* This utility extracts the DOCX, fixes duplicate IDs, and re-packages it.
|
|
12
12
|
*/
|
|
13
|
+
/// <reference types="node" />
|
|
14
|
+
/** Fix duplicate floating-image IDs without touching the filesystem. */
|
|
15
|
+
export declare function fixFloatingImageIdsInBuffer(buffer: Buffer): Buffer;
|
|
13
16
|
/**
|
|
14
17
|
* Fix floating image issues in a generated DOCX file
|
|
15
18
|
* @param docxPath - Path to the DOCX file to fix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixFloatingImageIds.d.ts","sourceRoot":"","sources":["../../src/utils/fixFloatingImageIds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"fixFloatingImageIds.d.ts","sourceRoot":"","sources":["../../src/utils/fixFloatingImageIds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;AAKH,wEAAwE;AACxE,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmBlE;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Scope render-time values without leaking them across concurrent documents. */
|
|
2
|
+
export declare function runWithGenerationDate<T>(date: Date, callback: () => T): T;
|
|
3
|
+
/** Current document date, falling back to the wall clock outside generation. */
|
|
4
|
+
export declare function getGenerationDate(): Date;
|
|
5
|
+
//# sourceMappingURL=generationContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generationContext.d.ts","sourceRoot":"","sources":["../../src/utils/generationContext.ts"],"names":[],"mappings":"AAIA,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAEzE;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
|
|
@@ -44,8 +44,11 @@ export declare function createNumberedListConfig(reference: string, start?: numb
|
|
|
44
44
|
* Registry for managing numbering configurations
|
|
45
45
|
*/
|
|
46
46
|
export declare class NumberingRegistry {
|
|
47
|
-
private
|
|
48
|
-
private
|
|
47
|
+
private readonly fallback;
|
|
48
|
+
private readonly scopes;
|
|
49
|
+
private get state();
|
|
50
|
+
/** Run work with an isolated registry that follows its async call chain. */
|
|
51
|
+
runScoped<T>(callback: () => T): T;
|
|
49
52
|
/**
|
|
50
53
|
* Register a numbering configuration
|
|
51
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberingConfig.d.ts","sourceRoot":"","sources":["../../src/utils/numberingConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,cA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,4EAA4E;IAC5E,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;IAIlC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,cAAc,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAMzE;;OAEG;IACH,iBAAiB,CAAC,MAAM,GAAE,MAAe,GAAG,MAAM;IAIlD;;OAEG;IACH,MAAM,IAAI;QAAE,MAAM,EAAE,cAAc,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE;IAI3D;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI/B;;OAEG;IACH,GAAG,CACD,SAAS,EAAE,MAAM,GAChB;QAAE,MAAM,EAAE,cAAc,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;CAG/D;AAGD,eAAO,MAAM,uBAAuB,mBAA0B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { type Document } from 'docx';
|
|
3
|
+
export interface DocumentPackageOptions {
|
|
4
|
+
/** Normalize volatile OOXML metadata and ZIP timestamps. Defaults to true. */
|
|
5
|
+
deterministic?: boolean;
|
|
6
|
+
/** Timestamp used for generated metadata. Defaults to a stable epoch. */
|
|
7
|
+
generatedAt?: string | Date;
|
|
8
|
+
}
|
|
9
|
+
/** Stable, valid OOXML/ZIP timestamp used when no build timestamp is supplied. */
|
|
10
|
+
export declare const DEFAULT_GENERATION_DATE: Date;
|
|
11
|
+
export declare function resolveGenerationDate(options?: DocumentPackageOptions): Date;
|
|
12
|
+
/**
|
|
13
|
+
* Normalize package-level values that otherwise change on every render.
|
|
14
|
+
* ZIP headers are written from UTC components because DOS timestamps carry no
|
|
15
|
+
* timezone; this produces identical header bits in every locale.
|
|
16
|
+
*/
|
|
17
|
+
export declare function canonicalizeDocxBuffer(buffer: Buffer, generatedAt?: Date): Buffer;
|
|
18
|
+
/** Package a DOCX and apply all required OOXML post-processing once. */
|
|
19
|
+
export declare function packageDocument(document: Document, options?: DocumentPackageOptions): Promise<Buffer>;
|
|
20
|
+
//# sourceMappingURL=packageDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageDocument.d.ts","sourceRoot":"","sources":["../../src/utils/packageDocument.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,QAAQ,EAAU,MAAM,MAAM,CAAC;AAG7C,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;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,WAAW,GAAE,IAA8B,GAC1C,MAAM,CA6BR;AAED,wEAAwE;AACxE,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,MAAM,CAAC,CASjB"}
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { TextRun, ExternalHyperlink, InternalHyperlink } from 'docx';
|
|
6
6
|
import { TextStyle } from './textParser';
|
|
7
|
-
type
|
|
7
|
+
export type PlaceholderChild = TextRun | ExternalHyperlink | InternalHyperlink;
|
|
8
8
|
/**
|
|
9
9
|
* Placeholder handler function type
|
|
10
10
|
*/
|
|
11
|
-
export type PlaceholderHandler = (_context?: PlaceholderContext) =>
|
|
11
|
+
export type PlaceholderHandler = (_context?: PlaceholderContext) => PlaceholderChild | PlaceholderChild[] | string;
|
|
12
12
|
/**
|
|
13
13
|
* Context passed to placeholder handlers
|
|
14
14
|
*/
|
|
15
15
|
export interface PlaceholderContext {
|
|
16
16
|
style?: TextStyle;
|
|
17
|
+
date?: Date;
|
|
17
18
|
[key: string]: unknown;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
@@ -45,14 +46,13 @@ export declare class PlaceholderRegistry {
|
|
|
45
46
|
/**
|
|
46
47
|
* Process text containing placeholders and return array of paragraph children
|
|
47
48
|
*/
|
|
48
|
-
export declare function processPlaceholders(text: string, baseStyle?: TextStyle, context?: PlaceholderContext):
|
|
49
|
+
export declare function processPlaceholders(text: string, baseStyle?: TextStyle, context?: PlaceholderContext): PlaceholderChild[];
|
|
49
50
|
/**
|
|
50
51
|
* Process text with both decorators and placeholders
|
|
51
52
|
*/
|
|
52
|
-
export declare function processTextWithPlaceholders(text: string, baseStyle?: TextStyle, context?: PlaceholderContext, noProofWords?: string[]):
|
|
53
|
+
export declare function processTextWithPlaceholders(text: string, baseStyle?: TextStyle, context?: PlaceholderContext, noProofWords?: string[]): PlaceholderChild[];
|
|
53
54
|
/**
|
|
54
55
|
* Initialize built-in placeholders
|
|
55
56
|
*/
|
|
56
57
|
export declare function initializeBuiltinPlaceholders(): void;
|
|
57
|
-
export {};
|
|
58
58
|
//# sourceMappingURL=placeholderProcessor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeholderProcessor.d.ts","sourceRoot":"","sources":["../../src/utils/placeholderProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,OAAO,EAEP,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,MAAM,CAAC;AACd,OAAO,EAGL,SAAS,EACV,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"placeholderProcessor.d.ts","sourceRoot":"","sources":["../../src/utils/placeholderProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH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GACtB,gBAAgB,EAAE,CAyGpB;AAsDD;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CA4CpD"}
|
|
@@ -11,13 +11,13 @@ export declare const DEFAULT_REVISION_AUTHOR = "json-to-office";
|
|
|
11
11
|
export declare const DEFAULT_REVISION_DATE = "1970-01-01T00:00:00Z";
|
|
12
12
|
/**
|
|
13
13
|
* OOXML requires a numeric id on every w:ins / w:del element, unique within
|
|
14
|
-
* one document.
|
|
15
|
-
*
|
|
16
|
-
* intra-document uniqueness holds even when renders interleave (a per-render
|
|
17
|
-
* reset would let one render clear the counter mid-flight for another).
|
|
14
|
+
* one document. Async-local state gives each render its own deterministic
|
|
15
|
+
* counter without collisions when documents render concurrently.
|
|
18
16
|
*/
|
|
19
17
|
declare class RevisionIdRegistry {
|
|
20
|
-
private
|
|
18
|
+
private fallbackCounter;
|
|
19
|
+
private readonly scopes;
|
|
20
|
+
runScoped<T>(callback: () => T): T;
|
|
21
21
|
next(): number;
|
|
22
22
|
/** Test-only: deterministic ids for snapshot assertions. */
|
|
23
23
|
clear(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revisionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/revisionUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"revisionUtils.d.ts","sourceRoot":"","sources":["../../src/utils/revisionUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAM5D,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAExD,eAAO,MAAM,qBAAqB,yBAAyB,CAAC;AAE5D;;;;GAIG;AACH,cAAM,kBAAkB;IACtB,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgD;IAEvE,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;IAIlC,IAAI,IAAI,MAAM;IAUd,4DAA4D;IAC5D,KAAK,IAAI,IAAI;CAQd;AAED,eAAO,MAAM,wBAAwB,oBAA2B,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,eAAe,GAAG,cAAc,CAAC;AAIrE,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC;AAgBhE;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,iBAAiB,GAC3B,cAAc,EAAE,CAoDlB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB,GAAG,OAAO,CA6BV"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TextRun
|
|
2
|
-
import { PlaceholderContext } from './placeholderProcessor';
|
|
1
|
+
import { TextRun } from 'docx';
|
|
2
|
+
import { type PlaceholderChild, type PlaceholderContext } from './placeholderProcessor';
|
|
3
3
|
export interface TextStyle {
|
|
4
4
|
font?: string;
|
|
5
5
|
size?: number;
|
|
@@ -56,5 +56,5 @@ export declare function splitByNoProofWords(text: string, makeRun: (segment: str
|
|
|
56
56
|
* @param options Additional options for text decoration
|
|
57
57
|
* @returns Array of TextRun and hyperlink objects with appropriate styling
|
|
58
58
|
*/
|
|
59
|
-
export declare function parseTextWithDecorators(text: string, baseStyle?: TextStyle, options?: TextDecoratorOptions):
|
|
59
|
+
export declare function parseTextWithDecorators(text: string, baseStyle?: TextStyle, options?: TextDecoratorOptions): PlaceholderChild[];
|
|
60
60
|
//# sourceMappingURL=textParser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textParser.d.ts","sourceRoot":"","sources":["../../src/utils/textParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"textParser.d.ts","sourceRoot":"","sources":["../../src/utils/textParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAwC,MAAM,MAAM,CAAC;AACrE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE;QACV,IAAI,CAAC,EACD,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,MAAM,GACN,SAAS,GACT,YAAY,GACZ,MAAM,GACN,MAAM,GACN,OAAO,GACP,aAAa,GACb,aAAa,GACb,UAAU,GACV,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,WAAW,GACX,YAAY,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAEF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAMD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAY7E;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,EACvD,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB,OAAO,EAAE,CAoBX;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,SAAc,EACzB,OAAO,GAAE,oBAAyB,GACjC,gBAAgB,EAAE,CAoGpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@json-to-office/core-docx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Core DOCX document generation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"adm-zip": "0.5.16",
|
|
23
23
|
"date-fns": "3.6.0",
|
|
24
24
|
"probe-image-size": "7.2.3",
|
|
25
|
-
"@json-to-office/shared": "^0.
|
|
26
|
-
"@json-to-office/shared-docx": "^0.
|
|
25
|
+
"@json-to-office/shared": "^0.22.0",
|
|
26
|
+
"@json-to-office/shared-docx": "^0.22.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"docx": "9.5.1"
|