@json-to-office/core-docx 0.18.0 → 0.19.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/heading.d.ts.map +1 -1
- package/dist/components/paragraph.d.ts.map +1 -1
- package/dist/core/content.d.ts +3 -0
- package/dist/core/content.d.ts.map +1 -1
- package/dist/core/structure.d.ts +2 -0
- package/dist/core/structure.d.ts.map +1 -1
- package/dist/index.js +178 -50
- package/dist/index.js.map +1 -1
- package/dist/plugin/example/index.js +178 -50
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/styles/themeToDocxAdapter.d.ts +1 -1
- package/dist/styles/themeToDocxAdapter.d.ts.map +1 -1
- package/dist/templates/themes/index.d.ts +28 -0
- package/dist/templates/themes/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/placeholderProcessor.d.ts +1 -1
- package/dist/utils/placeholderProcessor.d.ts.map +1 -1
- package/dist/utils/textParser.d.ts +25 -0
- package/dist/utils/textParser.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -49,7 +49,7 @@ export declare function processPlaceholders(text: string, baseStyle?: TextStyle,
|
|
|
49
49
|
/**
|
|
50
50
|
* Process text with both decorators and placeholders
|
|
51
51
|
*/
|
|
52
|
-
export declare function processTextWithPlaceholders(text: string, baseStyle?: TextStyle, context?: PlaceholderContext): ParagraphChild[];
|
|
52
|
+
export declare function processTextWithPlaceholders(text: string, baseStyle?: TextStyle, context?: PlaceholderContext, noProofWords?: string[]): ParagraphChild[];
|
|
53
53
|
/**
|
|
54
54
|
* Initialize built-in placeholders
|
|
55
55
|
*/
|
|
@@ -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;A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AAc,EACzB,OAAO,GAAE,kBAAuB,EAChC,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB,cAAc,EAAE,CAyGlB;AAsDD;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CAsEpD"}
|
|
@@ -10,12 +10,37 @@ export interface TextStyle {
|
|
|
10
10
|
type?: 'single' | 'double' | 'thick' | 'dotted' | 'dash' | 'dotDash' | 'dotDotDash' | 'wave' | 'none' | 'words' | 'dottedHeavy' | 'dashedHeavy' | 'dashLong' | 'dashLongHeavy' | 'dashDotHeavy' | 'dashDotDotHeavy' | 'wavyHeavy' | 'wavyDouble';
|
|
11
11
|
color?: string;
|
|
12
12
|
};
|
|
13
|
+
language?: {
|
|
14
|
+
value?: string;
|
|
15
|
+
eastAsia?: string;
|
|
16
|
+
bidirectional?: string;
|
|
17
|
+
};
|
|
18
|
+
noProof?: boolean;
|
|
13
19
|
}
|
|
14
20
|
export interface TextDecoratorOptions {
|
|
15
21
|
boldColor?: string;
|
|
16
22
|
placeholderContext?: PlaceholderContext;
|
|
17
23
|
enableHyperlinks?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* "Known words" allowlist: each whole-word, case-insensitive occurrence is
|
|
26
|
+
* emitted as its own no-proof run so Word never flags it, while surrounding
|
|
27
|
+
* text stays spell-checked.
|
|
28
|
+
*/
|
|
29
|
+
noProofWords?: string[];
|
|
18
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Build a matcher for the known-words allowlist, or null when there's nothing
|
|
33
|
+
* to match. Matches each word as a whole token (no letter/number directly
|
|
34
|
+
* adjacent on either side) so "Wiseair" doesn't match inside "Wiseairy", while
|
|
35
|
+
* internal punctuation like "json-to-office" is matched literally.
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildNoProofWordsRegex(noProofWords?: string[]): RegExp | null;
|
|
38
|
+
/**
|
|
39
|
+
* Split a plain string into TextRuns, marking every known-word occurrence as a
|
|
40
|
+
* no-proof run via `makeRun`. When there are no known words, returns a single
|
|
41
|
+
* run for the whole text.
|
|
42
|
+
*/
|
|
43
|
+
export declare function splitByNoProofWords(text: string, makeRun: (segment: string, noProof: boolean) => TextRun, noProofWords?: string[]): TextRun[];
|
|
19
44
|
/**
|
|
20
45
|
* Parses text with inline markdown-style decorators, placeholders, and newlines, returning an array of TextRun objects
|
|
21
46
|
* Supports:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textParser.d.ts","sourceRoot":"","sources":["../../src/utils/textParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,EAEL,kBAAkB,EACnB,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;
|
|
1
|
+
{"version":3,"file":"textParser.d.ts","sourceRoot":"","sources":["../../src/utils/textParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,EAEL,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI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,GAAE,oBAAyB,GACjC,CAAC,OAAO,GAAG,iBAAiB,GAAG,iBAAiB,CAAC,EAAE,CAoGrD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@json-to-office/core-docx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Core DOCX document generation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"date-fns": "3.6.0",
|
|
24
24
|
"probe-image-size": "7.2.3",
|
|
25
25
|
"@json-to-office/shared": "^0.16.0",
|
|
26
|
-
"@json-to-office/shared-docx": "^0.
|
|
26
|
+
"@json-to-office/shared-docx": "^0.19.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"docx": "9.5.1"
|