@windoc/core 0.3.25 → 0.3.26
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/index.js +36 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -78,7 +78,7 @@ __export(index_exports, {
|
|
|
78
78
|
module.exports = __toCommonJS(index_exports);
|
|
79
79
|
|
|
80
80
|
// src/version.ts
|
|
81
|
-
var version = "0.3.
|
|
81
|
+
var version = "0.3.26";
|
|
82
82
|
|
|
83
83
|
// src/dataset/enum/Common.ts
|
|
84
84
|
var MaxHeightRatio = /* @__PURE__ */ ((MaxHeightRatio2) => {
|
|
@@ -24432,6 +24432,7 @@ var DEFAULT_DOCX_FILE_NAME = "document.docx";
|
|
|
24432
24432
|
var DEFAULT_IMAGE_WIDTH = 320;
|
|
24433
24433
|
var DEFAULT_IMAGE_HEIGHT = 180;
|
|
24434
24434
|
var DEFAULT_LINE_HEIGHT = 1.15;
|
|
24435
|
+
var DOCX_FOOTER_TEXT_COLOR = "#000000";
|
|
24435
24436
|
var docxBulletCharMap = {
|
|
24436
24437
|
["disc" /* DISC */]: "\u2022",
|
|
24437
24438
|
["circle" /* CIRCLE */]: "\u25E6",
|
|
@@ -24472,9 +24473,17 @@ async function createDocxDocument(payload) {
|
|
|
24472
24473
|
const editorOptions = options;
|
|
24473
24474
|
const context = createSerializeContext();
|
|
24474
24475
|
const headerChildren = editorOptions.header.disabled ? [] : await serializeElementList(data2.header || [], editorOptions, context);
|
|
24475
|
-
const
|
|
24476
|
+
const docxFooterElementList = forceDocxFooterTextColor(data2.footer || []);
|
|
24477
|
+
const footerChildren = editorOptions.footer.disabled ? [] : await serializeElementList(
|
|
24478
|
+
docxFooterElementList,
|
|
24479
|
+
editorOptions,
|
|
24480
|
+
context
|
|
24481
|
+
);
|
|
24476
24482
|
const pageNumberParagraph = createPageNumberParagraph(
|
|
24477
|
-
|
|
24483
|
+
{
|
|
24484
|
+
...editorOptions.pageNumber,
|
|
24485
|
+
color: DOCX_FOOTER_TEXT_COLOR
|
|
24486
|
+
}
|
|
24478
24487
|
);
|
|
24479
24488
|
if (pageNumberParagraph) {
|
|
24480
24489
|
footerChildren.push(pageNumberParagraph);
|
|
@@ -25046,6 +25055,30 @@ function createPageNumberParagraph(pageNumber) {
|
|
|
25046
25055
|
alignment: mapRowFlexToAlignment(pageNumber.rowFlex)
|
|
25047
25056
|
});
|
|
25048
25057
|
}
|
|
25058
|
+
function forceDocxFooterTextColor(elementList) {
|
|
25059
|
+
const footerElementList = deepClone(elementList);
|
|
25060
|
+
forceColorValue(footerElementList);
|
|
25061
|
+
return footerElementList;
|
|
25062
|
+
}
|
|
25063
|
+
function forceColorValue(value) {
|
|
25064
|
+
if (!value || typeof value !== "object") {
|
|
25065
|
+
return;
|
|
25066
|
+
}
|
|
25067
|
+
if (Array.isArray(value)) {
|
|
25068
|
+
for (let i = 0; i < value.length; i++) {
|
|
25069
|
+
forceColorValue(value[i]);
|
|
25070
|
+
}
|
|
25071
|
+
return;
|
|
25072
|
+
}
|
|
25073
|
+
const record = value;
|
|
25074
|
+
if ("color" in record) {
|
|
25075
|
+
record.color = DOCX_FOOTER_TEXT_COLOR;
|
|
25076
|
+
}
|
|
25077
|
+
const keys = Object.keys(record);
|
|
25078
|
+
for (let i = 0; i < keys.length; i++) {
|
|
25079
|
+
forceColorValue(record[keys[i]]);
|
|
25080
|
+
}
|
|
25081
|
+
}
|
|
25049
25082
|
function createNumberingConfig() {
|
|
25050
25083
|
const config = [
|
|
25051
25084
|
createOrderedReference("windoc-ol-decimal", Array(9).fill("decimal" /* DECIMAL */)),
|