@office-open/docx 0.10.14 → 0.10.15

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.
@@ -1,4 +1,4 @@
1
- import { $ as parseRunProperties, C as FontWrapper, Q as stringifyRunProperties, Z as stringifyParagraphProperties, c as stringifyTableProperties, d as stringifyParagraphInline, et as stringifyElement, h as parseParagraph, i as parseTableRowPropertiesEl, it as WidthType, l as stringifyTableRowProperties, n as parseTableCellPropertiesEl, r as parseTablePropertiesEl, s as stringifyTableCellProperties, st as BorderStyle, xt as Media } from "./comments-Cn9Q0iT6.mjs";
1
+ import { $ as parseRunProperties, C as FontWrapper, Q as stringifyRunProperties, Z as stringifyParagraphProperties, c as stringifyTableProperties, d as stringifyParagraphInline, et as stringifyElement, h as parseParagraph, i as parseTableRowPropertiesEl, it as WidthType, l as stringifyTableRowProperties, n as parseTableCellPropertiesEl, r as parseTablePropertiesEl, s as stringifyTableCellProperties, st as BorderStyle, xt as Media } from "./comments-D_flVfxw.mjs";
2
2
  import { DOCX_PARTS, Relationships, appPropertiesDesc, buildContentTypeOverrides, convertInchesToTwip, customPropertiesDesc, decimalNumber, derivePasswordHash, uniqueNumericIdCreator } from "@office-open/core";
3
3
  import { attr, attrBool, attrMeasure, attrNum, escapeXml, findChild, js2xml, stringify, textOf, xml2js } from "@office-open/xml";
4
4
  import { ChartCollection } from "@office-open/core/chart";
@@ -2315,6 +2315,13 @@ function stringifyColorSchemeMapping(opts) {
2315
2315
  if (opts.followedHyperlink !== void 0) attrs["w:followedHyperlink"] = opts.followedHyperlink;
2316
2316
  return attrEl("w:clrSchemeMapping", attrs);
2317
2317
  }
2318
+ /** MS Office default compatSettings for a fresh Word 2013+ document. */
2319
+ const FRESH_COMPATIBILITY = {
2320
+ version: 15,
2321
+ overrideTableStyleFontSizeAndJustification: true,
2322
+ enableOpenTypeFeatures: true,
2323
+ doNotFlipMirrorIndents: true
2324
+ };
2318
2325
  function stringifyCompatibility(opts) {
2319
2326
  const p = [];
2320
2327
  if (opts.useSingleBorderforContiguousCells) p.push(onOff("w:useSingleBorderforContiguousCells", true));
@@ -2541,11 +2548,13 @@ const settingsDesc = {
2541
2548
  if (opts.hdrShapeDefaults !== void 0) p.push(`<w:hdrShapeDefaults>${opts.hdrShapeDefaults}</w:hdrShapeDefaults>`);
2542
2549
  if (opts.footnotePr !== void 0) p.push(stringifyFootnotePr(opts.footnotePr));
2543
2550
  if (opts.endnotePr !== void 0) p.push(stringifyEndnotePr(opts.endnotePr));
2544
- const compatXml = stringifyCompatibility({
2545
- ...opts.compatibility,
2546
- version: opts.compatibility?.version ?? opts.compatibilityModeVersion ?? 15
2547
- });
2548
- if (compatXml) p.push(compatXml);
2551
+ if (opts.compatibility !== false) {
2552
+ const compatXml = stringifyCompatibility(opts.compatibility === void 0 ? FRESH_COMPATIBILITY : {
2553
+ ...opts.compatibility,
2554
+ version: opts.compatibility.version ?? opts.compatibilityModeVersion ?? 15
2555
+ });
2556
+ if (compatXml) p.push(compatXml);
2557
+ }
2549
2558
  if (opts.docVars?.length) {
2550
2559
  const vars = opts.docVars.map((v) => attrEl("w:docVar", {
2551
2560
  "w:name": v.name,
@@ -2827,10 +2836,7 @@ const settingsDesc = {
2827
2836
  if (en) opts.endnotePr = en;
2828
2837
  }
2829
2838
  const compatEl = findChild(el, "w:compat");
2830
- if (compatEl) {
2831
- const compat = parseCompatibility(compatEl);
2832
- if (compat) opts.compatibility = compat;
2833
- }
2839
+ opts.compatibility = (compatEl ? parseCompatibility(compatEl) : void 0) ?? false;
2834
2840
  const docVarsEl = findChild(el, "w:docVars");
2835
2841
  if (docVarsEl) {
2836
2842
  const vars = [];
@@ -4527,4 +4533,4 @@ var DocxReadContext = class {
4527
4533
  //#endregion
4528
4534
  export { parseStyleDefinitions as A, LevelFormat as B, endnotesDesc as C, buildNumberingCache as D, Styles as E, stringifyNumberingStyle as F, AlignmentType as H, stringifyParagraphStyle as I, stringifyTableStyle as L, stringifyCharacterStyle as M, stringifyConditionalTableStyle as N, buildStyleCache as O, stringifyDocDefaults as P, Numbering as R, AltChunkCollection as S, settingsDesc as T, LevelSuffix as V, DocPartType as _, framesetXml as a, fontTableDesc as b, customPropertiesDesc as c, contentTypesDesc as d, ensureCustomPropertiesOverride as f, DocPartGallery as g, DocPartBehavior as h, frameXml as i, DefaultStylesFactory as j, extractStyleId as k, corePropertiesDesc as l, withMediaDefaults as m, DocxWriteContext as n, webSettingsDesc as o, withAltChunkOverrides as p, TargetScreenSize as r, appPropertiesDesc as s, DocxReadContext as t, buildContentTypesFromRegistry as u, glossaryDesc as v, footnotesDesc as w, SubDocCollection as x, bibliographyDesc as y, parseNumberingDefinitions as z };
4529
4535
 
4530
- //# sourceMappingURL=context-B5k1UabT.mjs.map
4536
+ //# sourceMappingURL=context-DLmSgNzb.mjs.map