@json-to-office/core-docx 0.17.3 → 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/highcharts.d.ts.map +1 -1
- package/dist/components/image.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/render.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 +202 -60
- package/dist/index.js.map +1 -1
- package/dist/plugin/example/eldermoor-census.component.d.ts +32 -0
- package/dist/plugin/example/eldermoor-census.component.d.ts.map +1 -0
- package/dist/plugin/example/index.js +202 -60
- 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 +32 -0
- package/dist/templates/themes/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/imageUtils.d.ts +13 -0
- package/dist/utils/imageUtils.d.ts.map +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 +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/components/heading.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAsB,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/components/heading.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAsB,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,CA+Cb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highcharts.d.ts","sourceRoot":"","sources":["../../src/components/highcharts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAUxC,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"highcharts.d.ts","sourceRoot":"","sources":["../../src/components/highcharts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAUxC,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AA2DD;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,CA+BhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/components/image.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAoB,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/components/image.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAoB,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,EAAE,CAAC,CA2BtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../src/components/paragraph.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAwB,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AA6DxC;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../src/components/paragraph.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAwB,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AA6DxC;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,CA6Ib"}
|
package/dist/core/content.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/core/content.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EAET,KAAK,EAQL,MAAM,EACN,MAAM,EAQP,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/core/content.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EAET,KAAK,EAQL,MAAM,EACN,MAAM,EAQP,MAAM,MAAM,CAAC;AAUd,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAYxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EACL,mBAAmB,EAKpB,MAAM,UAAU,CAAC;AAoDlB,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,O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,OAAO,CAAC,SAAS,CAAC,CA8DpB;AAED;;GAEG;AAEH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,CAAC,MAAM,GAAG,mBAAmB,CAAC,EAAE,EAAE,EACxC,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE;QACZ,CAAC,QAAQ,EAAE,MAAM,GAAG;YAClB,CAAC,SAAS,EAAE,MAAM,GAAG;gBACnB,IAAI,CAAC,EAAE,OAAO,CAAC;gBACf,KAAK,CAAC,EAAE,MAAM,CAAC;gBACf,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;SACH,CAAC;KACH,CAAC;IACF,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,OAAO,CAAC,KAAK,CAAC,CAsMhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/core/render.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,QAAQ,EACR,SAAS,EACT,KAAK,EACL,eAAe,EACf,eAAe,EAKf,OAAO,EACR,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/core/render.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,QAAQ,EACR,SAAS,EACT,KAAK,EACL,eAAe,EACf,eAAe,EAKf,OAAO,EACR,MAAM,MAAM,CAAC;AAcd,OAAO,EACL,mBAAmB,EACnB,aAAa,EAed,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,EAAE,iBAAiB,EAAuB,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAKrD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAwC7D;;GAEG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,GACA,OAAO,CAAC,QAAQ,CAAC,CAwJnB;AAqOD;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,EACtB,cAAc,CAAC,EAAE,MAAM,EACvB,aAAa,CAAC,EAAE,OAAO,GACtB,OAAO,CAAC,eAAe,CAAC,CAiH1B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,GAAG,eAAe,GAAG,OAAO,CAAC,EAAE,CAAC,CAmC5D"}
|
package/dist/core/structure.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export interface ProcessedDocument {
|
|
|
11
11
|
themeName: string;
|
|
12
12
|
/** Open the generated document in track-changes mode */
|
|
13
13
|
trackRevisions?: boolean;
|
|
14
|
+
/** Default document language (BCP-47) applied to docDefaults proofing */
|
|
15
|
+
language?: string;
|
|
14
16
|
}
|
|
15
17
|
export interface DocumentMetadata {
|
|
16
18
|
title?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../src/core/structure.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EACzB,aAAa,EAGd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQxC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,cAAc,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../src/core/structure.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EACzB,aAAa,EAGd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQxC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KA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AAO,CAAC,mBAAmB,EAAE,CAAC,CAmDhC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,aAAa,CA0Bf"}
|
package/dist/index.js
CHANGED
|
@@ -2114,12 +2114,17 @@ function resolveComponentTree(components, theme) {
|
|
|
2114
2114
|
async function processDocument(document, theme, themeName) {
|
|
2115
2115
|
const metadata = createDocumentMetadata(document.props);
|
|
2116
2116
|
const docDefaults = document.props.componentDefaults;
|
|
2117
|
-
const
|
|
2117
|
+
const mergedComponentDefaults = docDefaults ? mergeWithDefaults2(docDefaults, theme.componentDefaults || {}) : void 0;
|
|
2118
|
+
const docNoProofWords = document.props.noProofWords;
|
|
2119
|
+
const mergedNoProofWords = docNoProofWords || theme.noProofWords ? Array.from(
|
|
2120
|
+
/* @__PURE__ */ new Set([...theme.noProofWords || [], ...docNoProofWords || []])
|
|
2121
|
+
) : void 0;
|
|
2122
|
+
const effectiveTheme = mergedComponentDefaults || mergedNoProofWords ? {
|
|
2118
2123
|
...theme,
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2124
|
+
...mergedComponentDefaults && {
|
|
2125
|
+
componentDefaults: mergedComponentDefaults
|
|
2126
|
+
},
|
|
2127
|
+
...mergedNoProofWords && { noProofWords: mergedNoProofWords }
|
|
2123
2128
|
} : theme;
|
|
2124
2129
|
const context = createRenderContext(
|
|
2125
2130
|
{
|
|
@@ -2141,7 +2146,8 @@ async function processDocument(document, theme, themeName) {
|
|
|
2141
2146
|
sections,
|
|
2142
2147
|
theme: effectiveTheme,
|
|
2143
2148
|
themeName,
|
|
2144
|
-
trackRevisions: document.props.trackRevisions
|
|
2149
|
+
trackRevisions: document.props.trackRevisions,
|
|
2150
|
+
language: document.props.language
|
|
2145
2151
|
};
|
|
2146
2152
|
}
|
|
2147
2153
|
function createDocumentMetadata(props) {
|
|
@@ -2768,6 +2774,16 @@ async function downloadImageFromUrl(url) {
|
|
|
2768
2774
|
throw new Error(`Failed to download image from ${url}: Unknown error`);
|
|
2769
2775
|
}
|
|
2770
2776
|
}
|
|
2777
|
+
function resolveImageSource(props) {
|
|
2778
|
+
const hasValue = (v) => typeof v === "string" && v.trim().length > 0;
|
|
2779
|
+
if (hasValue(props.svg)) {
|
|
2780
|
+
const encoded = Buffer.from(props.svg, "utf-8").toString("base64");
|
|
2781
|
+
return `data:image/svg+xml;base64,${encoded}`;
|
|
2782
|
+
}
|
|
2783
|
+
if (hasValue(props.base64)) return props.base64;
|
|
2784
|
+
if (hasValue(props.path)) return props.path;
|
|
2785
|
+
return void 0;
|
|
2786
|
+
}
|
|
2771
2787
|
async function getImageBuffer(imagePath) {
|
|
2772
2788
|
if (isBase64Image(imagePath)) {
|
|
2773
2789
|
return { buffer: decodeBase64Image(imagePath) };
|
|
@@ -2995,7 +3011,7 @@ function convertBorders(borders, theme) {
|
|
|
2995
3011
|
...right && { right }
|
|
2996
3012
|
} : void 0;
|
|
2997
3013
|
}
|
|
2998
|
-
function createWordStyles(themeNameOrObject = "minimal") {
|
|
3014
|
+
function createWordStyles(themeNameOrObject = "minimal", language) {
|
|
2999
3015
|
const theme = typeof themeNameOrObject === "string" ? getTheme(themeNameOrObject) || getTheme("minimal") : themeNameOrObject;
|
|
3000
3016
|
const paragraphStyles = [
|
|
3001
3017
|
// Normal body text style
|
|
@@ -3453,8 +3469,20 @@ function createWordStyles(themeNameOrObject = "minimal") {
|
|
|
3453
3469
|
});
|
|
3454
3470
|
}
|
|
3455
3471
|
return {
|
|
3456
|
-
paragraphStyles
|
|
3472
|
+
paragraphStyles,
|
|
3457
3473
|
// Cast needed due to docx typing
|
|
3474
|
+
// Document-default proofing language (w:docDefaults/w:rPrDefault). Runs that
|
|
3475
|
+
// don't set their own w:lang inherit this, so Word spell-checks the whole
|
|
3476
|
+
// document in the requested language unless a component overrides it.
|
|
3477
|
+
...language && {
|
|
3478
|
+
default: {
|
|
3479
|
+
document: {
|
|
3480
|
+
run: {
|
|
3481
|
+
language: { value: language }
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3458
3486
|
};
|
|
3459
3487
|
}
|
|
3460
3488
|
function getStyleIdForLevel(level) {
|
|
@@ -3576,6 +3604,37 @@ import {
|
|
|
3576
3604
|
|
|
3577
3605
|
// src/utils/textParser.ts
|
|
3578
3606
|
import { TextRun, ExternalHyperlink, InternalHyperlink } from "docx";
|
|
3607
|
+
function escapeRegExp(s) {
|
|
3608
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3609
|
+
}
|
|
3610
|
+
function buildNoProofWordsRegex(noProofWords) {
|
|
3611
|
+
const words = (noProofWords || []).filter((w) => w && w.trim().length > 0);
|
|
3612
|
+
if (words.length === 0) return null;
|
|
3613
|
+
const escaped = words.slice().sort((a, b) => b.length - a.length).map(escapeRegExp);
|
|
3614
|
+
return new RegExp(
|
|
3615
|
+
`(?<![\\p{L}\\p{N}])(?:${escaped.join("|")})(?![\\p{L}\\p{N}])`,
|
|
3616
|
+
"giu"
|
|
3617
|
+
);
|
|
3618
|
+
}
|
|
3619
|
+
function splitByNoProofWords(text, makeRun, noProofWords) {
|
|
3620
|
+
const regex = buildNoProofWordsRegex(noProofWords);
|
|
3621
|
+
if (!regex || !text) return [makeRun(text, false)];
|
|
3622
|
+
const runs = [];
|
|
3623
|
+
let lastIndex = 0;
|
|
3624
|
+
let match;
|
|
3625
|
+
while ((match = regex.exec(text)) !== null) {
|
|
3626
|
+
if (match.index > lastIndex) {
|
|
3627
|
+
runs.push(makeRun(text.slice(lastIndex, match.index), false));
|
|
3628
|
+
}
|
|
3629
|
+
runs.push(makeRun(match[0], true));
|
|
3630
|
+
lastIndex = match.index + match[0].length;
|
|
3631
|
+
if (regex.lastIndex === match.index) regex.lastIndex++;
|
|
3632
|
+
}
|
|
3633
|
+
if (lastIndex < text.length) {
|
|
3634
|
+
runs.push(makeRun(text.slice(lastIndex), false));
|
|
3635
|
+
}
|
|
3636
|
+
return runs.length > 0 ? runs : [makeRun(text, false)];
|
|
3637
|
+
}
|
|
3579
3638
|
function parseTextWithDecorators(text, baseStyle = {}, options = {}) {
|
|
3580
3639
|
if (!text) {
|
|
3581
3640
|
return [new TextRun({ text: "", ...baseStyle })];
|
|
@@ -3586,7 +3645,8 @@ function parseTextWithDecorators(text, baseStyle = {}, options = {}) {
|
|
|
3586
3645
|
return processTextWithPlaceholders(
|
|
3587
3646
|
normalizedText,
|
|
3588
3647
|
baseStyle,
|
|
3589
|
-
options.placeholderContext || {}
|
|
3648
|
+
options.placeholderContext || {},
|
|
3649
|
+
options.noProofWords
|
|
3590
3650
|
);
|
|
3591
3651
|
}
|
|
3592
3652
|
if (options.enableHyperlinks) {
|
|
@@ -3657,20 +3717,38 @@ function createTextRunsWithNewlines(text, baseStyle, options, overrideStyle) {
|
|
|
3657
3717
|
bold: overrideStyle?.bold ?? baseStyle.bold,
|
|
3658
3718
|
italics: overrideStyle?.italics ?? baseStyle.italics
|
|
3659
3719
|
};
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3720
|
+
const commonProps = {
|
|
3721
|
+
...baseStyle.font && { font: baseStyle.font },
|
|
3722
|
+
...baseStyle.size && { size: baseStyle.size },
|
|
3723
|
+
...baseStyle.color && {
|
|
3724
|
+
color: runStyle.bold && options.boldColor ? options.boldColor : baseStyle.color
|
|
3725
|
+
},
|
|
3726
|
+
...runStyle.bold !== void 0 && { bold: runStyle.bold },
|
|
3727
|
+
...runStyle.italics !== void 0 && { italics: runStyle.italics },
|
|
3728
|
+
...baseStyle.underline && { underline: baseStyle.underline },
|
|
3729
|
+
...baseStyle.language && { language: baseStyle.language }
|
|
3730
|
+
};
|
|
3731
|
+
const wholeRunNoProof = baseStyle.noProof === true;
|
|
3732
|
+
const wordsForLine = wholeRunNoProof ? void 0 : options.noProofWords;
|
|
3733
|
+
let firstSegment = true;
|
|
3734
|
+
const lineRuns = splitByNoProofWords(
|
|
3735
|
+
line,
|
|
3736
|
+
(segment, matched) => {
|
|
3737
|
+
const segNoProof = matched || wholeRunNoProof;
|
|
3738
|
+
const run = new TextRun({
|
|
3739
|
+
text: segment,
|
|
3740
|
+
...commonProps,
|
|
3741
|
+
...(matched || baseStyle.noProof !== void 0) && {
|
|
3742
|
+
noProof: segNoProof
|
|
3743
|
+
},
|
|
3744
|
+
...needsLineBreak && firstSegment && { break: 1 }
|
|
3745
|
+
});
|
|
3746
|
+
firstSegment = false;
|
|
3747
|
+
return run;
|
|
3748
|
+
},
|
|
3749
|
+
wordsForLine
|
|
3673
3750
|
);
|
|
3751
|
+
runs.push(...lineRuns);
|
|
3674
3752
|
}
|
|
3675
3753
|
}
|
|
3676
3754
|
return runs;
|
|
@@ -3775,7 +3853,7 @@ var PlaceholderRegistry = class {
|
|
|
3775
3853
|
this.handlers.clear();
|
|
3776
3854
|
}
|
|
3777
3855
|
};
|
|
3778
|
-
function processTextWithPlaceholders(text, baseStyle = {}, context = {}) {
|
|
3856
|
+
function processTextWithPlaceholders(text, baseStyle = {}, context = {}, noProofWords) {
|
|
3779
3857
|
const normalizedText = normalizeUnicodeText(text);
|
|
3780
3858
|
const combinedRegex = /(\*\*\*|___)([\s\S]*?)\1|(\*\*|__)([\s\S]*?)\3|(\*|_)([\s\S]*?)\5|\{([^}]+)\}/g;
|
|
3781
3859
|
const result = [];
|
|
@@ -3785,7 +3863,9 @@ function processTextWithPlaceholders(text, baseStyle = {}, context = {}) {
|
|
|
3785
3863
|
if (match.index > lastIndex) {
|
|
3786
3864
|
const beforeText = normalizedText.substring(lastIndex, match.index);
|
|
3787
3865
|
if (beforeText) {
|
|
3788
|
-
result.push(
|
|
3866
|
+
result.push(
|
|
3867
|
+
...createTextRunsWithNewlines2(beforeText, baseStyle, noProofWords)
|
|
3868
|
+
);
|
|
3789
3869
|
}
|
|
3790
3870
|
}
|
|
3791
3871
|
if (match[7]) {
|
|
@@ -3799,11 +3879,17 @@ function processTextWithPlaceholders(text, baseStyle = {}, context = {}) {
|
|
|
3799
3879
|
result.push(placeholderResult);
|
|
3800
3880
|
} else if (typeof placeholderResult === "string") {
|
|
3801
3881
|
result.push(
|
|
3802
|
-
...createTextRunsWithNewlines2(
|
|
3882
|
+
...createTextRunsWithNewlines2(
|
|
3883
|
+
placeholderResult,
|
|
3884
|
+
baseStyle,
|
|
3885
|
+
noProofWords
|
|
3886
|
+
)
|
|
3803
3887
|
);
|
|
3804
3888
|
}
|
|
3805
3889
|
} else {
|
|
3806
|
-
result.push(
|
|
3890
|
+
result.push(
|
|
3891
|
+
...createTextRunsWithNewlines2(match[0], baseStyle, noProofWords)
|
|
3892
|
+
);
|
|
3807
3893
|
}
|
|
3808
3894
|
} else {
|
|
3809
3895
|
let decoratedText;
|
|
@@ -3838,33 +3924,54 @@ function processTextWithPlaceholders(text, baseStyle = {}, context = {}) {
|
|
|
3838
3924
|
if (lastIndex < normalizedText.length) {
|
|
3839
3925
|
const remainingText = normalizedText.substring(lastIndex);
|
|
3840
3926
|
if (remainingText) {
|
|
3841
|
-
result.push(
|
|
3927
|
+
result.push(
|
|
3928
|
+
...createTextRunsWithNewlines2(remainingText, baseStyle, noProofWords)
|
|
3929
|
+
);
|
|
3842
3930
|
}
|
|
3843
3931
|
}
|
|
3844
3932
|
if (result.length === 0 && normalizedText) {
|
|
3845
|
-
result.push(
|
|
3933
|
+
result.push(
|
|
3934
|
+
...createTextRunsWithNewlines2(normalizedText, baseStyle, noProofWords)
|
|
3935
|
+
);
|
|
3846
3936
|
}
|
|
3847
3937
|
return result;
|
|
3848
3938
|
}
|
|
3849
|
-
function createTextRunsWithNewlines2(text, baseStyle) {
|
|
3939
|
+
function createTextRunsWithNewlines2(text, baseStyle, noProofWords) {
|
|
3850
3940
|
const runs = [];
|
|
3851
3941
|
const lines = text.split("\n");
|
|
3852
3942
|
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
3853
3943
|
const line = lines[lineIndex];
|
|
3854
3944
|
const needsLineBreak = lineIndex > 0;
|
|
3855
3945
|
if (line || needsLineBreak) {
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3946
|
+
const commonProps = {
|
|
3947
|
+
font: baseStyle.font,
|
|
3948
|
+
size: baseStyle.size,
|
|
3949
|
+
color: baseStyle.color,
|
|
3950
|
+
bold: baseStyle.bold,
|
|
3951
|
+
italics: baseStyle.italics,
|
|
3952
|
+
underline: baseStyle.underline,
|
|
3953
|
+
...baseStyle.language && { language: baseStyle.language }
|
|
3954
|
+
};
|
|
3955
|
+
const wholeRunNoProof = baseStyle.noProof === true;
|
|
3956
|
+
const wordsForLine = wholeRunNoProof ? void 0 : noProofWords;
|
|
3957
|
+
let firstSegment = true;
|
|
3958
|
+
const lineRuns = splitByNoProofWords(
|
|
3959
|
+
line,
|
|
3960
|
+
(segment, matched) => {
|
|
3961
|
+
const run = new TextRun2({
|
|
3962
|
+
text: segment,
|
|
3963
|
+
...commonProps,
|
|
3964
|
+
...(matched || baseStyle.noProof !== void 0) && {
|
|
3965
|
+
noProof: matched || wholeRunNoProof
|
|
3966
|
+
},
|
|
3967
|
+
break: needsLineBreak && firstSegment ? 1 : void 0
|
|
3968
|
+
});
|
|
3969
|
+
firstSegment = false;
|
|
3970
|
+
return run;
|
|
3971
|
+
},
|
|
3972
|
+
wordsForLine
|
|
3867
3973
|
);
|
|
3974
|
+
runs.push(...lineRuns);
|
|
3868
3975
|
}
|
|
3869
3976
|
}
|
|
3870
3977
|
return runs;
|
|
@@ -4240,6 +4347,11 @@ function applyFontWeightAlias(opts) {
|
|
|
4240
4347
|
);
|
|
4241
4348
|
return { font: synth.family, bold: synth.bold, italics: synth.italic };
|
|
4242
4349
|
}
|
|
4350
|
+
function resolveNoProofWords(theme, optionWords) {
|
|
4351
|
+
const themeWords = theme.noProofWords;
|
|
4352
|
+
const merged = [...themeWords || [], ...optionWords || []];
|
|
4353
|
+
return merged.length > 0 ? Array.from(new Set(merged)) : void 0;
|
|
4354
|
+
}
|
|
4243
4355
|
function createText(content, theme, themeName, options = {}) {
|
|
4244
4356
|
const normalizedContent = normalizeUnicodeText(content);
|
|
4245
4357
|
const style = options.style || "Normal";
|
|
@@ -4282,7 +4394,11 @@ function createText(content, theme, themeName, options = {}) {
|
|
|
4282
4394
|
...weighted.italics !== void 0 && { italics: weighted.italics },
|
|
4283
4395
|
...options.underline !== void 0 && {
|
|
4284
4396
|
underline: options.underline ? { type: "single" } : void 0
|
|
4285
|
-
}
|
|
4397
|
+
},
|
|
4398
|
+
// Proofing: per-run language and/or no-proof. Omitting language lets the
|
|
4399
|
+
// run inherit the document default set on docDefaults.
|
|
4400
|
+
...options.language && { language: { value: options.language } },
|
|
4401
|
+
...options.noProof !== void 0 && { noProof: options.noProof }
|
|
4286
4402
|
};
|
|
4287
4403
|
if (options.revision) {
|
|
4288
4404
|
const revisionRuns = createRevisionRuns(options.revision, baseTextStyle);
|
|
@@ -4304,7 +4420,8 @@ function createText(content, theme, themeName, options = {}) {
|
|
|
4304
4420
|
} else {
|
|
4305
4421
|
const textRuns = parseTextWithDecorators(normalizedContent, baseTextStyle, {
|
|
4306
4422
|
boldColor: options.boldColor,
|
|
4307
|
-
enableHyperlinks: true
|
|
4423
|
+
enableHyperlinks: true,
|
|
4424
|
+
noProofWords: resolveNoProofWords(theme, options.noProofWords)
|
|
4308
4425
|
});
|
|
4309
4426
|
if (options.bookmarkId) {
|
|
4310
4427
|
globalBookmarkRegistry.register(
|
|
@@ -4439,8 +4556,21 @@ function createHeading(text, level, theme, _themeName, options = {}) {
|
|
|
4439
4556
|
},
|
|
4440
4557
|
...options.underline !== void 0 && {
|
|
4441
4558
|
underline: options.underline ? { type: "single" } : void 0
|
|
4442
|
-
}
|
|
4559
|
+
},
|
|
4560
|
+
// Proofing: per-run language and/or no-proof (see createText).
|
|
4561
|
+
...options.language && { language: { value: options.language } },
|
|
4562
|
+
...options.noProof !== void 0 && { noProof: options.noProof }
|
|
4443
4563
|
};
|
|
4564
|
+
const headingNoProofWords = resolveNoProofWords(theme, options.noProofWords);
|
|
4565
|
+
const makeHeadingRuns = (value) => splitByNoProofWords(
|
|
4566
|
+
value,
|
|
4567
|
+
(segment, matched) => new TextRun4({
|
|
4568
|
+
text: segment,
|
|
4569
|
+
...baseTextStyle,
|
|
4570
|
+
...matched && { noProof: true }
|
|
4571
|
+
}),
|
|
4572
|
+
headingNoProofWords
|
|
4573
|
+
);
|
|
4444
4574
|
if (options.revision) {
|
|
4445
4575
|
const revisionRuns = createRevisionRuns(options.revision, baseTextStyle);
|
|
4446
4576
|
if (options.bookmarkId) {
|
|
@@ -4468,13 +4598,12 @@ function createHeading(text, level, theme, _themeName, options = {}) {
|
|
|
4468
4598
|
if (hasDecorators) {
|
|
4469
4599
|
const textRuns = parseTextWithDecorators(normalizedText, baseTextStyle, {
|
|
4470
4600
|
boldColor: options.boldColor,
|
|
4471
|
-
enableHyperlinks: true
|
|
4601
|
+
enableHyperlinks: true,
|
|
4602
|
+
noProofWords: headingNoProofWords
|
|
4472
4603
|
});
|
|
4473
4604
|
headingTextChildren.push(...textRuns);
|
|
4474
4605
|
} else {
|
|
4475
|
-
headingTextChildren.push(
|
|
4476
|
-
new TextRun4({ text: normalizedText, ...baseTextStyle })
|
|
4477
|
-
);
|
|
4606
|
+
headingTextChildren.push(...makeHeadingRuns(normalizedText));
|
|
4478
4607
|
}
|
|
4479
4608
|
children.push(
|
|
4480
4609
|
new Bookmark({
|
|
@@ -4486,11 +4615,12 @@ function createHeading(text, level, theme, _themeName, options = {}) {
|
|
|
4486
4615
|
if (hasDecorators) {
|
|
4487
4616
|
const textRuns = parseTextWithDecorators(normalizedText, baseTextStyle, {
|
|
4488
4617
|
boldColor: options.boldColor,
|
|
4489
|
-
enableHyperlinks: true
|
|
4618
|
+
enableHyperlinks: true,
|
|
4619
|
+
noProofWords: headingNoProofWords
|
|
4490
4620
|
});
|
|
4491
4621
|
children.push(...textRuns);
|
|
4492
4622
|
} else {
|
|
4493
|
-
children.push(
|
|
4623
|
+
children.push(...makeHeadingRuns(normalizedText));
|
|
4494
4624
|
}
|
|
4495
4625
|
}
|
|
4496
4626
|
return new Paragraph({
|
|
@@ -5016,10 +5146,10 @@ async function createTable(columns, tableConfig, theme, themeName, _options = {}
|
|
|
5016
5146
|
} else if (isImageComponent(cell)) {
|
|
5017
5147
|
const imageComp = cell;
|
|
5018
5148
|
try {
|
|
5019
|
-
const imageSource = imageComp.props
|
|
5149
|
+
const imageSource = resolveImageSource(imageComp.props);
|
|
5020
5150
|
if (!imageSource) {
|
|
5021
5151
|
throw new Error(
|
|
5022
|
-
'Image component requires
|
|
5152
|
+
'Image component requires one of "path", "base64", or "svg" property'
|
|
5023
5153
|
);
|
|
5024
5154
|
}
|
|
5025
5155
|
const imageResult = await getImageBuffer(imageSource);
|
|
@@ -5045,7 +5175,7 @@ async function createTable(columns, tableConfig, theme, themeName, _options = {}
|
|
|
5045
5175
|
});
|
|
5046
5176
|
cellChildren = [imageRun];
|
|
5047
5177
|
} catch (error) {
|
|
5048
|
-
const imageSource = imageComp.props.base64 || imageComp.props.path || "unknown";
|
|
5178
|
+
const imageSource = imageComp.props.svg?.trim() ? "inline-svg" : imageComp.props.base64 || imageComp.props.path || "unknown";
|
|
5049
5179
|
cellChildren = [
|
|
5050
5180
|
new TextRun4({
|
|
5051
5181
|
text: `[IMAGE: ${imageSource.substring(0, 50)}${imageSource.length > 50 ? "..." : ""}]`,
|
|
@@ -5453,6 +5583,10 @@ function renderHeadingComponent(component, theme, themeName) {
|
|
|
5453
5583
|
fontWeight: config.font?.fontWeight,
|
|
5454
5584
|
italic: config.font?.italic,
|
|
5455
5585
|
underline: config.font?.underline,
|
|
5586
|
+
// Proofing: local language override + no-proof toggle + known-words list
|
|
5587
|
+
language: config.language,
|
|
5588
|
+
noProof: config.noProof,
|
|
5589
|
+
noProofWords: config.noProofWords,
|
|
5456
5590
|
// Pagination control
|
|
5457
5591
|
keepNext: config.keepNext,
|
|
5458
5592
|
keepLines: config.keepLines,
|
|
@@ -5571,6 +5705,10 @@ function renderParagraphComponent(component, theme, themeName) {
|
|
|
5571
5705
|
fontWeight: resolvedConfig.font?.fontWeight,
|
|
5572
5706
|
italic: resolvedConfig.font?.italic,
|
|
5573
5707
|
underline: resolvedConfig.font?.underline,
|
|
5708
|
+
// Proofing: local language override + no-proof toggle + known-words list
|
|
5709
|
+
language: resolvedConfig.language,
|
|
5710
|
+
noProof: resolvedConfig.noProof,
|
|
5711
|
+
noProofWords: resolvedConfig.noProofWords,
|
|
5574
5712
|
// Pass outline level for TOC support
|
|
5575
5713
|
outlineLevel,
|
|
5576
5714
|
// Pass floating positioning properties
|
|
@@ -5722,10 +5860,10 @@ function renderListComponent(component, theme, themeName) {
|
|
|
5722
5860
|
async function renderImageComponent(component, theme, themeName) {
|
|
5723
5861
|
if (!isImageComponent(component)) return [];
|
|
5724
5862
|
const resolvedConfig = component.props;
|
|
5725
|
-
const imageSource = resolvedConfig
|
|
5863
|
+
const imageSource = resolveImageSource(resolvedConfig);
|
|
5726
5864
|
if (!imageSource) {
|
|
5727
5865
|
throw new Error(
|
|
5728
|
-
'Image component requires
|
|
5866
|
+
'Image component requires one of "path", "base64", or "svg" property'
|
|
5729
5867
|
);
|
|
5730
5868
|
}
|
|
5731
5869
|
return await createImage(imageSource, theme, themeName, {
|
|
@@ -6414,7 +6552,10 @@ async function generateChart(config, servicesConfig) {
|
|
|
6414
6552
|
infile: config.options,
|
|
6415
6553
|
type: "png",
|
|
6416
6554
|
b64: true,
|
|
6417
|
-
scale: config.scale
|
|
6555
|
+
scale: config.scale,
|
|
6556
|
+
// Forward resources verbatim only when present so the payload stays
|
|
6557
|
+
// byte-identical to before for callers that omit it.
|
|
6558
|
+
...config.resources ? { resources: config.resources } : {}
|
|
6418
6559
|
};
|
|
6419
6560
|
const response = await postJsonToService({
|
|
6420
6561
|
url: serverUrl,
|
|
@@ -6708,7 +6849,7 @@ async function renderDocument(structure, layout, options) {
|
|
|
6708
6849
|
}
|
|
6709
6850
|
const numberingConfigs = globalNumberingRegistry2.getAll();
|
|
6710
6851
|
return new Document({
|
|
6711
|
-
styles: createWordStyles(structure.theme),
|
|
6852
|
+
styles: createWordStyles(structure.theme, structure.language),
|
|
6712
6853
|
sections,
|
|
6713
6854
|
features: {
|
|
6714
6855
|
updateFields: true,
|
|
@@ -6759,13 +6900,13 @@ async function renderHeaderFooterComponents(components, theme, themeName, contex
|
|
|
6759
6900
|
);
|
|
6760
6901
|
} else if (isImageComponent(component)) {
|
|
6761
6902
|
const imageComp = component;
|
|
6762
|
-
let imageSource = imageComp.props
|
|
6903
|
+
let imageSource = resolveImageSource(imageComp.props);
|
|
6763
6904
|
if (!imageSource) {
|
|
6764
6905
|
elements.push(
|
|
6765
6906
|
new Paragraph7({
|
|
6766
6907
|
children: [
|
|
6767
6908
|
new TextRun6({
|
|
6768
|
-
text: "[IMAGE: Missing path or
|
|
6909
|
+
text: "[IMAGE: Missing path, base64, or svg property]",
|
|
6769
6910
|
font: getThemeFonts(theme).body.family,
|
|
6770
6911
|
size: 20,
|
|
6771
6912
|
bold: true,
|
|
@@ -6839,15 +6980,16 @@ async function renderHeaderFooterComponents(components, theme, themeName, contex
|
|
|
6839
6980
|
})
|
|
6840
6981
|
);
|
|
6841
6982
|
} catch (error) {
|
|
6983
|
+
const sourcePreview = imageSource.substring(0, 50);
|
|
6842
6984
|
console.error(
|
|
6843
|
-
`[Header/Footer Image Error] Failed to render image: ${
|
|
6985
|
+
`[Header/Footer Image Error] Failed to render image: ${sourcePreview}...`,
|
|
6844
6986
|
error instanceof Error ? error.message : error
|
|
6845
6987
|
);
|
|
6846
6988
|
elements.push(
|
|
6847
6989
|
new Paragraph7({
|
|
6848
6990
|
children: [
|
|
6849
6991
|
new TextRun6({
|
|
6850
|
-
text: `[IMAGE: ${
|
|
6992
|
+
text: `[IMAGE: ${sourcePreview}]`,
|
|
6851
6993
|
font: getThemeFonts(theme).body.family,
|
|
6852
6994
|
size: 20,
|
|
6853
6995
|
color: getThemeColors(theme).secondary,
|