@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.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var version = "0.3.25";
2
+ var version = "0.3.26";
3
3
 
4
4
  // src/dataset/enum/Common.ts
5
5
  var MaxHeightRatio = /* @__PURE__ */ ((MaxHeightRatio2) => {
@@ -24379,6 +24379,7 @@ var DEFAULT_DOCX_FILE_NAME = "document.docx";
24379
24379
  var DEFAULT_IMAGE_WIDTH = 320;
24380
24380
  var DEFAULT_IMAGE_HEIGHT = 180;
24381
24381
  var DEFAULT_LINE_HEIGHT = 1.15;
24382
+ var DOCX_FOOTER_TEXT_COLOR = "#000000";
24382
24383
  var docxBulletCharMap = {
24383
24384
  ["disc" /* DISC */]: "\u2022",
24384
24385
  ["circle" /* CIRCLE */]: "\u25E6",
@@ -24419,9 +24420,17 @@ async function createDocxDocument(payload) {
24419
24420
  const editorOptions = options;
24420
24421
  const context = createSerializeContext();
24421
24422
  const headerChildren = editorOptions.header.disabled ? [] : await serializeElementList(data2.header || [], editorOptions, context);
24422
- const footerChildren = editorOptions.footer.disabled ? [] : await serializeElementList(data2.footer || [], editorOptions, context);
24423
+ const docxFooterElementList = forceDocxFooterTextColor(data2.footer || []);
24424
+ const footerChildren = editorOptions.footer.disabled ? [] : await serializeElementList(
24425
+ docxFooterElementList,
24426
+ editorOptions,
24427
+ context
24428
+ );
24423
24429
  const pageNumberParagraph = createPageNumberParagraph(
24424
- editorOptions.pageNumber
24430
+ {
24431
+ ...editorOptions.pageNumber,
24432
+ color: DOCX_FOOTER_TEXT_COLOR
24433
+ }
24425
24434
  );
24426
24435
  if (pageNumberParagraph) {
24427
24436
  footerChildren.push(pageNumberParagraph);
@@ -24993,6 +25002,30 @@ function createPageNumberParagraph(pageNumber) {
24993
25002
  alignment: mapRowFlexToAlignment(pageNumber.rowFlex)
24994
25003
  });
24995
25004
  }
25005
+ function forceDocxFooterTextColor(elementList) {
25006
+ const footerElementList = deepClone(elementList);
25007
+ forceColorValue(footerElementList);
25008
+ return footerElementList;
25009
+ }
25010
+ function forceColorValue(value) {
25011
+ if (!value || typeof value !== "object") {
25012
+ return;
25013
+ }
25014
+ if (Array.isArray(value)) {
25015
+ for (let i = 0; i < value.length; i++) {
25016
+ forceColorValue(value[i]);
25017
+ }
25018
+ return;
25019
+ }
25020
+ const record = value;
25021
+ if ("color" in record) {
25022
+ record.color = DOCX_FOOTER_TEXT_COLOR;
25023
+ }
25024
+ const keys = Object.keys(record);
25025
+ for (let i = 0; i < keys.length; i++) {
25026
+ forceColorValue(record[keys[i]]);
25027
+ }
25028
+ }
24996
25029
  function createNumberingConfig() {
24997
25030
  const config = [
24998
25031
  createOrderedReference("windoc-ol-decimal", Array(9).fill("decimal" /* DECIMAL */)),