@harbour-enterprises/superdoc 1.3.0-next.1 → 1.3.0-next.11

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.
@@ -7489,134 +7489,200 @@ const INLINE_OVERRIDE_PROPERTIES = [
7489
7489
  "italic",
7490
7490
  "strike",
7491
7491
  "underline",
7492
- "letterSpacing",
7493
- "vertAlign",
7494
- "position"
7492
+ "letterSpacing"
7495
7493
  ];
7496
7494
  const DEFAULT_FONT_SIZE_HALF_POINTS = 20;
7497
- const SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65;
7498
- const resolveRunProperties = (params, inlineRpr, resolvedPpr, isListNumber = false, numberingDefinedInline = false) => {
7495
+ function isObject(item) {
7496
+ return item != null && typeof item === "object" && !Array.isArray(item);
7497
+ }
7498
+ function combineProperties$1(propertiesArray, options = {}) {
7499
+ const { fullOverrideProps = [], specialHandling = {} } = options;
7500
+ if (!propertiesArray || propertiesArray.length === 0) {
7501
+ return {};
7502
+ }
7503
+ const merge = (target, source) => {
7504
+ const output = { ...target };
7505
+ if (isObject(target) && isObject(source)) {
7506
+ for (const key in source) {
7507
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
7508
+ const handler2 = specialHandling[key];
7509
+ if (handler2 && typeof handler2 === "function") {
7510
+ output[key] = handler2(output, source);
7511
+ } else if (!fullOverrideProps.includes(key) && isObject(source[key])) {
7512
+ if (key in target && isObject(target[key])) {
7513
+ output[key] = merge(target[key], source[key]);
7514
+ } else {
7515
+ output[key] = source[key];
7516
+ }
7517
+ } else {
7518
+ output[key] = source[key];
7519
+ }
7520
+ }
7521
+ }
7522
+ }
7523
+ return output;
7524
+ };
7525
+ return propertiesArray.reduce((acc, current) => merge(acc, current ?? {}), {});
7526
+ }
7527
+ function combineRunProperties$1(propertiesArray) {
7528
+ return combineProperties$1(propertiesArray, {
7529
+ fullOverrideProps: ["fontFamily", "color"]
7530
+ });
7531
+ }
7532
+ function applyInlineOverrides(finalProps, inlineProps, overrideKeys = INLINE_OVERRIDE_PROPERTIES) {
7533
+ if (!inlineProps) return finalProps;
7534
+ for (const prop of overrideKeys) {
7535
+ if (inlineProps[prop] != null) {
7536
+ finalProps[prop] = inlineProps[prop];
7537
+ }
7538
+ }
7539
+ return finalProps;
7540
+ }
7541
+ function isValidFontSize(value) {
7542
+ return typeof value === "number" && Number.isFinite(value) && value > 0;
7543
+ }
7544
+ function resolveFontSizeWithFallback(value, defaultProps, normalProps) {
7545
+ if (isValidFontSize(value)) {
7546
+ return value;
7547
+ }
7548
+ if (defaultProps && isValidFontSize(defaultProps.fontSize)) {
7549
+ return defaultProps.fontSize;
7550
+ }
7551
+ if (normalProps && isValidFontSize(normalProps.fontSize)) {
7552
+ return normalProps.fontSize;
7553
+ }
7554
+ return DEFAULT_FONT_SIZE_HALF_POINTS;
7555
+ }
7556
+ function orderDefaultsAndNormal(defaultProps, normalProps, isNormalDefault) {
7557
+ if (isNormalDefault) {
7558
+ return [defaultProps, normalProps];
7559
+ } else {
7560
+ return [normalProps, defaultProps];
7561
+ }
7562
+ }
7563
+ function createFirstLineIndentHandler() {
7564
+ return (target, source) => {
7565
+ if (target.hanging != null && source.firstLine != null) {
7566
+ delete target.hanging;
7567
+ }
7568
+ return source.firstLine;
7569
+ };
7570
+ }
7571
+ function combineIndentProperties(indentChain) {
7572
+ const indentOnly = indentChain.map((props) => props.indent != null ? { indent: props.indent } : {});
7573
+ return combineProperties$1(indentOnly, {
7574
+ specialHandling: {
7575
+ firstLine: createFirstLineIndentHandler()
7576
+ }
7577
+ });
7578
+ }
7579
+ function createOoxmlResolver(translators) {
7580
+ return {
7581
+ resolveRunProperties: (params, inlineRpr, resolvedPpr, isListNumber = false, numberingDefinedInline = false) => resolveRunProperties$1(translators, params, inlineRpr, resolvedPpr, isListNumber, numberingDefinedInline),
7582
+ resolveParagraphProperties: (params, inlineProps, insideTable = false, overrideInlineStyleId = false, tableStyleId = null) => resolveParagraphProperties$1(translators, params, inlineProps, insideTable, overrideInlineStyleId, tableStyleId),
7583
+ getDefaultProperties,
7584
+ getStyleProperties,
7585
+ resolveStyleChain,
7586
+ getNumberingProperties: (params, ilvl, numId, translator2, tries = 0) => getNumberingProperties(translators, params, ilvl, numId, translator2, tries)
7587
+ };
7588
+ }
7589
+ function resolveRunProperties$1(translators, params, inlineRpr, resolvedPpr, isListNumber = false, numberingDefinedInline = false) {
7499
7590
  const paragraphStyleId = resolvedPpr?.styleId;
7500
- const paragraphStyleProps = resolveStyleChain(params, paragraphStyleId, translator$1O);
7501
- const defaultProps = getDefaultProperties(params, translator$1O);
7502
- const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params, "Normal", translator$1O);
7591
+ const paragraphStyleProps = resolveStyleChain(params, paragraphStyleId, translators.rPr);
7592
+ const defaultProps = getDefaultProperties(params, translators.rPr);
7593
+ const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params, "Normal", translators.rPr);
7503
7594
  let runStyleProps = {};
7504
7595
  if (!paragraphStyleId?.startsWith("TOC")) {
7505
- runStyleProps = inlineRpr.styleId ? resolveStyleChain(params, inlineRpr.styleId, translator$1O) : {};
7596
+ runStyleProps = inlineRpr?.styleId ? resolveStyleChain(params, inlineRpr.styleId, translators.rPr) : {};
7506
7597
  }
7598
+ const defaultsChain = orderDefaultsAndNormal(defaultProps, normalProps, isNormalDefault);
7599
+ const inlineRprSafe = inlineRpr ?? {};
7507
7600
  let styleChain;
7508
- if (isNormalDefault) {
7509
- styleChain = [defaultProps, normalProps];
7510
- } else {
7511
- styleChain = [normalProps, defaultProps];
7512
- }
7601
+ let inlineOverrideSource = inlineRprSafe;
7513
7602
  if (isListNumber) {
7514
7603
  let numberingProps = {};
7515
- const numId = resolvedPpr?.numberingProperties?.numId;
7604
+ const numberingProperties = resolvedPpr?.numberingProperties;
7605
+ const numId = numberingProperties?.numId;
7516
7606
  if (numId != null && numId !== 0 && numId !== "0") {
7517
7607
  numberingProps = getNumberingProperties(
7608
+ translators,
7518
7609
  params,
7519
- resolvedPpr.numberingProperties.ilvl ?? 0,
7610
+ numberingProperties?.ilvl ?? 0,
7520
7611
  numId,
7521
- translator$1O
7612
+ translators.rPr
7522
7613
  );
7523
7614
  }
7524
- if (!numberingDefinedInline) {
7525
- inlineRpr = {};
7526
- }
7527
- if (inlineRpr?.underline) {
7528
- delete inlineRpr.underline;
7615
+ const inlineRprForList = numberingDefinedInline ? inlineRprSafe : {};
7616
+ if (inlineRprForList?.underline) {
7617
+ delete inlineRprForList.underline;
7529
7618
  }
7530
- styleChain = [...styleChain, paragraphStyleProps, runStyleProps, inlineRpr, numberingProps];
7619
+ styleChain = [...defaultsChain, paragraphStyleProps, runStyleProps, inlineRprForList, numberingProps];
7620
+ inlineOverrideSource = inlineRprForList;
7531
7621
  } else {
7532
- styleChain = [...styleChain, paragraphStyleProps, runStyleProps, inlineRpr];
7533
- }
7534
- const finalProps = combineProperties(styleChain, ["fontFamily", "color"]);
7535
- for (const prop of INLINE_OVERRIDE_PROPERTIES) {
7536
- if (inlineRpr?.[prop] != null) {
7537
- finalProps[prop] = inlineRpr[prop];
7538
- }
7539
- }
7540
- if (finalProps.fontSize == null || typeof finalProps.fontSize !== "number" || !Number.isFinite(finalProps.fontSize) || finalProps.fontSize <= 0) {
7541
- let defaultFontSize = DEFAULT_FONT_SIZE_HALF_POINTS;
7542
- if (defaultProps?.fontSize != null && typeof defaultProps.fontSize === "number" && Number.isFinite(defaultProps.fontSize) && defaultProps.fontSize > 0) {
7543
- defaultFontSize = defaultProps.fontSize;
7544
- } else if (normalProps?.fontSize != null && typeof normalProps.fontSize === "number" && Number.isFinite(normalProps.fontSize) && normalProps.fontSize > 0) {
7545
- defaultFontSize = normalProps.fontSize;
7546
- }
7547
- finalProps.fontSize = defaultFontSize;
7622
+ styleChain = [...defaultsChain, paragraphStyleProps, runStyleProps, inlineRprSafe];
7548
7623
  }
7624
+ const finalProps = combineRunProperties$1(styleChain);
7625
+ applyInlineOverrides(finalProps, inlineOverrideSource);
7626
+ finalProps.fontSize = resolveFontSizeWithFallback(finalProps.fontSize, defaultProps, normalProps);
7549
7627
  return finalProps;
7550
- };
7551
- function resolveParagraphProperties(params, inlineProps, insideTable = false, overrideInlineStyleId = false, tableStyleId = null) {
7552
- const defaultProps = getDefaultProperties(params, translator$14);
7553
- const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params, "Normal", translator$14);
7554
- let styleId = inlineProps?.styleId;
7555
- let styleProps = inlineProps?.styleId ? resolveStyleChain(params, inlineProps?.styleId, translator$14) : {};
7628
+ }
7629
+ function resolveParagraphProperties$1(translators, params, inlineProps, insideTable = false, overrideInlineStyleId = false, tableStyleId = null) {
7630
+ const defaultProps = getDefaultProperties(params, translators.pPr);
7631
+ const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params, "Normal", translators.pPr);
7632
+ const inlinePropsSafe = inlineProps ?? {};
7633
+ let styleId = inlinePropsSafe?.styleId;
7634
+ let styleProps = inlinePropsSafe?.styleId ? resolveStyleChain(params, inlinePropsSafe.styleId, translators.pPr) : {};
7556
7635
  let numberingProps = {};
7557
- let ilvl = inlineProps?.numberingProperties?.ilvl ?? styleProps?.numberingProperties?.ilvl;
7558
- let numId = inlineProps?.numberingProperties?.numId ?? styleProps?.numberingProperties?.numId;
7559
- let numberingDefinedInline = inlineProps?.numberingProperties?.numId != null;
7560
- const inlineNumIdDisablesNumbering = inlineProps?.numberingProperties?.numId === 0 || inlineProps?.numberingProperties?.numId === "0";
7636
+ const ilvl = inlinePropsSafe?.numberingProperties?.ilvl ?? styleProps?.numberingProperties?.ilvl;
7637
+ let numId = inlinePropsSafe?.numberingProperties?.numId ?? styleProps?.numberingProperties?.numId;
7638
+ let numberingDefinedInline = inlinePropsSafe?.numberingProperties?.numId != null;
7639
+ const inlineNumId = inlinePropsSafe?.numberingProperties?.numId;
7640
+ const inlineNumIdDisablesNumbering = inlineNumId === 0 || inlineNumId === "0";
7561
7641
  if (inlineNumIdDisablesNumbering) {
7562
7642
  numId = null;
7563
7643
  }
7564
7644
  const isList2 = numId != null && numId !== 0 && numId !== "0";
7565
7645
  if (isList2) {
7566
- ilvl = ilvl != null ? ilvl : 0;
7567
- numberingProps = getNumberingProperties(params, ilvl, numId, translator$14);
7646
+ const ilvlNum = ilvl != null ? ilvl : 0;
7647
+ numberingProps = getNumberingProperties(translators, params, ilvlNum, numId, translators.pPr);
7568
7648
  if (overrideInlineStyleId && numberingProps.styleId) {
7569
7649
  styleId = numberingProps.styleId;
7570
- styleProps = resolveStyleChain(params, styleId, translator$14);
7571
- if (inlineProps) {
7572
- inlineProps.styleId = styleId;
7573
- if (styleProps.numberingProperties?.ilvl === inlineProps.numberingProperties?.ilvl && styleProps.numberingProperties?.numId === inlineProps.numberingProperties?.numId) {
7574
- delete inlineProps.numberingProperties;
7650
+ styleProps = resolveStyleChain(params, styleId, translators.pPr);
7651
+ if (inlinePropsSafe) {
7652
+ inlinePropsSafe.styleId = styleId;
7653
+ const inlineNumProps = inlinePropsSafe.numberingProperties;
7654
+ if (styleProps.numberingProperties?.ilvl === inlineNumProps?.ilvl && styleProps.numberingProperties?.numId === inlineNumProps?.numId) {
7655
+ delete inlinePropsSafe.numberingProperties;
7575
7656
  numberingDefinedInline = false;
7576
7657
  }
7577
7658
  }
7578
7659
  }
7579
7660
  }
7580
- const tableProps = tableStyleId ? resolveStyleChain(params, tableStyleId, translator$14) : {};
7581
- let defaultsChain;
7582
- if (isNormalDefault) {
7583
- defaultsChain = [defaultProps, normalProps];
7584
- } else {
7585
- defaultsChain = [normalProps, defaultProps];
7586
- }
7587
- const propsChain = [...defaultsChain, tableProps, numberingProps, styleProps, inlineProps];
7661
+ const tableProps = tableStyleId ? resolveStyleChain(params, tableStyleId, translators.pPr) : {};
7662
+ const defaultsChain = orderDefaultsAndNormal(defaultProps, normalProps, isNormalDefault);
7663
+ const propsChain = [...defaultsChain, tableProps, numberingProps, styleProps, inlinePropsSafe];
7588
7664
  let indentChain;
7589
7665
  if (isList2) {
7590
7666
  if (numberingDefinedInline) {
7591
- indentChain = [...defaultsChain, styleProps, numberingProps, inlineProps];
7667
+ indentChain = [...defaultsChain, styleProps, numberingProps, inlinePropsSafe];
7592
7668
  } else {
7593
- styleProps = resolveStyleChain(params, styleId, translator$14, false);
7594
- indentChain = [...defaultsChain, numberingProps, styleProps, inlineProps];
7669
+ styleProps = resolveStyleChain(params, styleId, translators.pPr, false);
7670
+ indentChain = [...defaultsChain, numberingProps, styleProps, inlinePropsSafe];
7595
7671
  }
7596
7672
  } else {
7597
- indentChain = [...defaultsChain, numberingProps, styleProps, inlineProps];
7673
+ indentChain = [...defaultsChain, numberingProps, styleProps, inlinePropsSafe];
7598
7674
  }
7599
- let finalProps = combineProperties(propsChain);
7600
- let finalIndent = combineProperties(
7601
- indentChain.map((props) => props.indent != null ? { indent: props.indent } : {}),
7602
- [],
7603
- {
7604
- firstLine: (target, source) => {
7605
- if (target.hanging != null && source.firstLine != null) {
7606
- delete target.hanging;
7607
- }
7608
- return source.firstLine;
7609
- }
7610
- }
7611
- );
7675
+ const finalProps = combineProperties$1(propsChain);
7676
+ const finalIndent = combineIndentProperties(indentChain);
7612
7677
  finalProps.indent = finalIndent.indent;
7613
- if (insideTable && !inlineProps?.spacing && !styleProps.spacing) {
7678
+ if (insideTable && !inlinePropsSafe?.spacing && !styleProps?.spacing) {
7614
7679
  finalProps.spacing = void 0;
7615
7680
  }
7616
7681
  return finalProps;
7617
7682
  }
7618
- const resolveStyleChain = (params, styleId, translator2, followBasedOnChain = true) => {
7619
- let styleProps = {}, basedOn = null;
7683
+ function resolveStyleChain(params, styleId, translator2, followBasedOnChain = true) {
7684
+ let styleProps = {};
7685
+ let basedOn = void 0;
7620
7686
  if (styleId && styleId !== "Normal") {
7621
7687
  ({ properties: styleProps, basedOn } = getStyleProperties(params, styleId, translator2));
7622
7688
  }
@@ -7628,7 +7694,7 @@ const resolveStyleChain = (params, styleId, translator2, followBasedOnChain = tr
7628
7694
  break;
7629
7695
  }
7630
7696
  seenStyles.add(basedOn);
7631
- const result = getStyleProperties(params, basedOn, translator2);
7697
+ const result = getStyleProperties(params, nextBasedOn, translator2);
7632
7698
  const basedOnProps = result.properties;
7633
7699
  nextBasedOn = result.basedOn;
7634
7700
  if (basedOnProps && Object.keys(basedOnProps).length) {
@@ -7637,120 +7703,151 @@ const resolveStyleChain = (params, styleId, translator2, followBasedOnChain = tr
7637
7703
  basedOn = nextBasedOn;
7638
7704
  }
7639
7705
  styleChain = styleChain.reverse();
7640
- const combinedStyleProps = combineProperties(styleChain);
7641
- return combinedStyleProps;
7642
- };
7706
+ return combineProperties$1(styleChain);
7707
+ }
7643
7708
  function getDefaultProperties(params, translator2) {
7644
- const { docx } = params;
7645
- const styles = docx["word/styles.xml"];
7709
+ const docx = params?.docx;
7710
+ const styles = docx?.["word/styles.xml"];
7646
7711
  const rootElements = styles?.elements?.[0]?.elements;
7647
7712
  if (!rootElements?.length) {
7648
7713
  return {};
7649
7714
  }
7650
7715
  const defaults = rootElements.find((el) => el.name === "w:docDefaults");
7651
7716
  const xmlName = translator2.xmlName;
7652
- const elementPrDefault = defaults?.elements?.find((el) => el.name === `${xmlName}Default`) || {};
7653
- const elementPr = elementPrDefault?.elements?.find((el) => el.name === xmlName);
7717
+ const defaultsElements = defaults?.elements;
7718
+ const elementPrDefault = defaultsElements?.find((el) => el.name === `${xmlName}Default`);
7719
+ const elementPrDefaultElements = elementPrDefault?.elements;
7720
+ const elementPr = elementPrDefaultElements?.find((el) => el.name === xmlName);
7654
7721
  if (!elementPr) {
7655
7722
  return {};
7656
7723
  }
7657
- const result = translator2.encode({ ...params, nodes: [elementPr] }) || {};
7658
- return result;
7724
+ return translator2.encode({ ...params, nodes: [elementPr] }) || {};
7659
7725
  }
7660
7726
  function getStyleProperties(params, styleId, translator2) {
7661
- const { docx } = params;
7662
- const emptyResult = { properties: {}, isDefault: false, basedOn: null };
7727
+ const emptyResult = { properties: {}, isDefault: false, basedOn: void 0 };
7663
7728
  if (!styleId) return emptyResult;
7664
- const styles = docx["word/styles.xml"];
7729
+ const docx = params?.docx;
7730
+ const styles = docx?.["word/styles.xml"];
7665
7731
  const rootElements = styles?.elements?.[0]?.elements;
7666
7732
  if (!rootElements?.length) {
7667
7733
  return emptyResult;
7668
7734
  }
7669
- const style = rootElements.find((el) => el.name === "w:style" && el.attributes["w:styleId"] === styleId);
7670
- let basedOn = style?.elements?.find((el) => el.name === "w:basedOn");
7671
- if (basedOn) {
7672
- basedOn = basedOn?.attributes?.["w:val"];
7673
- }
7674
- const elementPr = style?.elements?.find((el) => el.name === translator2.xmlName);
7735
+ const style = rootElements.find(
7736
+ (el) => el.name === "w:style" && el.attributes?.["w:styleId"] === styleId
7737
+ );
7738
+ const styleElements = style?.elements;
7739
+ const basedOnElement = styleElements?.find((el) => el.name === "w:basedOn");
7740
+ const basedOn = basedOnElement?.attributes?.["w:val"];
7741
+ const elementPr = styleElements?.find((el) => el.name === translator2.xmlName);
7675
7742
  if (!elementPr) {
7676
7743
  return { ...emptyResult, basedOn };
7677
7744
  }
7678
7745
  const result = translator2.encode({ ...params, nodes: [elementPr] }) || {};
7679
- return { properties: result, isDefault: style?.attributes?.["w:default"] === "1", basedOn };
7746
+ const isDefault = style?.attributes?.["w:default"] === "1";
7747
+ return { properties: result, isDefault, basedOn };
7680
7748
  }
7681
- function getNumberingProperties(params, ilvl, numId, translator2, tries = 0) {
7682
- const { numbering: allDefinitions } = params;
7683
- if (!allDefinitions) return {};
7684
- const { definitions, abstracts } = allDefinitions;
7749
+ function getNumberingProperties(translators, params, ilvl, numId, translator2, tries = 0) {
7750
+ const numbering = params?.numbering;
7751
+ if (!numbering) return {};
7752
+ const { definitions, abstracts } = numbering;
7753
+ if (!definitions || !abstracts) return {};
7685
7754
  const propertiesChain = [];
7686
7755
  const numDefinition = definitions[numId];
7687
7756
  if (!numDefinition) return {};
7688
- const lvlOverride = numDefinition?.elements?.find(
7689
- (element) => element.name === "w:lvlOverride" && element.attributes["w:ilvl"] == ilvl
7757
+ const numDefElements = numDefinition.elements;
7758
+ const lvlOverride = numDefElements?.find(
7759
+ (element) => element.name === "w:lvlOverride" && element.attributes?.["w:ilvl"] == ilvl
7690
7760
  );
7691
- const overridePr = lvlOverride?.elements?.find((el) => el.name === translator2.xmlName);
7761
+ const lvlOverrideElements = lvlOverride?.elements;
7762
+ const overridePr = lvlOverrideElements?.find((el) => el.name === translator2.xmlName);
7692
7763
  if (overridePr) {
7693
7764
  const overrideProps = translator2.encode({ ...params, nodes: [overridePr] }) || {};
7694
7765
  propertiesChain.push(overrideProps);
7695
7766
  }
7696
- const abstractNumId = numDefinition.elements?.find((item) => item.name === "w:abstractNumId")?.attributes?.["w:val"];
7767
+ const abstractNumIdElement = numDefElements?.find((item) => item.name === "w:abstractNumId");
7768
+ const abstractNumId = abstractNumIdElement?.attributes?.["w:val"];
7697
7769
  const listDefinitionForThisNumId = abstracts[abstractNumId];
7698
7770
  if (!listDefinitionForThisNumId) return {};
7699
- const numStyleLink = listDefinitionForThisNumId.elements?.find((item) => item.name === "w:numStyleLink");
7771
+ const listDefElements = listDefinitionForThisNumId.elements;
7772
+ const numStyleLink = listDefElements?.find((item) => item.name === "w:numStyleLink");
7700
7773
  const styleId = numStyleLink?.attributes?.["w:val"];
7701
7774
  if (styleId && tries < 1) {
7702
- const { properties: styleProps } = getStyleProperties(params, styleId, translator$14);
7703
- if (styleProps?.numberingProperties?.numId) {
7704
- return getNumberingProperties(params, ilvl, styleProps.numberingProperties.numId, translator2, tries + 1);
7775
+ const { properties: styleProps } = getStyleProperties(params, styleId, translators.pPr);
7776
+ const numIdFromStyle = styleProps?.numberingProperties?.numId;
7777
+ if (numIdFromStyle) {
7778
+ return getNumberingProperties(
7779
+ translators,
7780
+ params,
7781
+ ilvl,
7782
+ numIdFromStyle,
7783
+ translator2,
7784
+ tries + 1
7785
+ );
7705
7786
  }
7706
7787
  }
7707
- const levelDefinition = listDefinitionForThisNumId?.elements?.find(
7708
- (element) => element.name === "w:lvl" && element.attributes["w:ilvl"] == ilvl
7788
+ const levelDefinition = listDefElements?.find(
7789
+ (element) => element.name === "w:lvl" && element.attributes?.["w:ilvl"] == ilvl
7709
7790
  );
7710
7791
  if (!levelDefinition) return {};
7711
- const abstractElementPr = levelDefinition?.elements?.find((el) => el.name === translator2.xmlName);
7792
+ const levelDefElements = levelDefinition.elements;
7793
+ const abstractElementPr = levelDefElements?.find((el) => el.name === translator2.xmlName);
7712
7794
  if (!abstractElementPr) return {};
7713
7795
  const abstractProps = translator2.encode({ ...params, nodes: [abstractElementPr] }) || {};
7714
- const pStyleElement = levelDefinition?.elements?.find((el) => el.name === "w:pStyle");
7796
+ const pStyleElement = levelDefElements?.find((el) => el.name === "w:pStyle");
7715
7797
  if (pStyleElement) {
7716
- const pStyleId = pStyleElement?.attributes?.["w:val"];
7798
+ const pStyleId = pStyleElement.attributes?.["w:val"];
7717
7799
  abstractProps.styleId = pStyleId;
7718
7800
  }
7719
7801
  propertiesChain.push(abstractProps);
7720
7802
  propertiesChain.reverse();
7721
- const result = combineProperties(propertiesChain);
7722
- return result;
7803
+ return combineProperties$1(propertiesChain);
7723
7804
  }
7724
- const combineProperties = (propertiesArray, fullOverrideProps = [], specialHandling = {}) => {
7725
- if (!propertiesArray || propertiesArray.length === 0) {
7726
- return {};
7727
- }
7728
- const isObject = (item) => item && typeof item === "object" && !Array.isArray(item);
7729
- const merge = (target, source) => {
7730
- const output = { ...target };
7731
- if (isObject(target) && isObject(source)) {
7732
- for (const key in source) {
7733
- if (Object.prototype.hasOwnProperty.call(source, key)) {
7734
- if (!fullOverrideProps.includes(key) && isObject(source[key])) {
7735
- if (key in target && isObject(target[key])) {
7736
- output[key] = merge(target[key], source[key]);
7737
- } else {
7738
- output[key] = source[key];
7739
- }
7740
- } else {
7741
- const handler2 = specialHandling[key];
7742
- if (handler2 && typeof handler2 === "function") {
7743
- output[key] = handler2(output, source);
7744
- } else {
7745
- output[key] = source[key];
7746
- }
7747
- }
7748
- }
7749
- }
7805
+ function resolveDocxFontFamily(attributes, docx, toCssFontFamily) {
7806
+ if (!attributes || typeof attributes !== "object") return null;
7807
+ const ascii = attributes["w:ascii"] ?? attributes["ascii"];
7808
+ const themeAscii = attributes["w:asciiTheme"] ?? attributes["asciiTheme"];
7809
+ let resolved = ascii;
7810
+ if (docx && themeAscii) {
7811
+ const theme = docx["word/theme/theme1.xml"];
7812
+ const themeElements = theme?.elements;
7813
+ if (themeElements?.length) {
7814
+ const topElement = themeElements[0];
7815
+ const topElementElements = topElement?.elements;
7816
+ const themeElementsNode = topElementElements?.find((el) => el.name === "a:themeElements");
7817
+ const themeElementsElements = themeElementsNode?.elements;
7818
+ const fontScheme = themeElementsElements?.find((el) => el.name === "a:fontScheme");
7819
+ const fontSchemeElements = fontScheme?.elements;
7820
+ const prefix = themeAscii.startsWith("minor") ? "minor" : "major";
7821
+ const font = fontSchemeElements?.find((el) => el.name === `a:${prefix}Font`);
7822
+ const fontElements = font?.elements;
7823
+ const latin = fontElements?.find((el) => el.name === "a:latin");
7824
+ const typeface = latin?.attributes?.typeface;
7825
+ resolved = typeface || resolved;
7750
7826
  }
7751
- return output;
7752
- };
7753
- return propertiesArray.reduce((acc, current) => merge(acc, current), {});
7827
+ }
7828
+ if (!resolved) return null;
7829
+ if (toCssFontFamily) {
7830
+ return toCssFontFamily(resolved, docx ?? void 0);
7831
+ }
7832
+ return resolved;
7833
+ }
7834
+ const ooxmlResolver = createOoxmlResolver({ pPr: translator$14, rPr: translator$1O });
7835
+ const getToCssFontFamily = () => {
7836
+ return SuperConverter.toCssFontFamily;
7837
+ };
7838
+ const SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65;
7839
+ const resolveRunProperties = (params, inlineRpr, resolvedPpr, isListNumber = false, numberingDefinedInline = false) => ooxmlResolver.resolveRunProperties(params, inlineRpr, resolvedPpr, isListNumber, numberingDefinedInline);
7840
+ function resolveParagraphProperties(params, inlineProps, insideTable = false, overrideInlineStyleId = false, tableStyleId = null) {
7841
+ return ooxmlResolver.resolveParagraphProperties(
7842
+ params,
7843
+ inlineProps,
7844
+ insideTable,
7845
+ overrideInlineStyleId,
7846
+ tableStyleId
7847
+ );
7848
+ }
7849
+ const combineProperties = (propertiesArray, fullOverrideProps = [], specialHandling = {}) => {
7850
+ return combineProperties$1(propertiesArray, { fullOverrideProps, specialHandling });
7754
7851
  };
7755
7852
  const combineRunProperties = (propertiesArray) => {
7756
7853
  return combineProperties(propertiesArray, ["fontFamily", "color"]);
@@ -7809,9 +7906,9 @@ function encodeMarksFromRPr(runProperties, docx) {
7809
7906
  textStyleAttrs[key] = `${spacing}pt`;
7810
7907
  break;
7811
7908
  case "fontFamily":
7812
- const fontFamily = getFontFamilyValue$1(value, docx);
7909
+ const fontFamily = resolveDocxFontFamily(value, docx, getToCssFontFamily());
7813
7910
  textStyleAttrs[key] = fontFamily;
7814
- const eastAsiaFamily = value["eastAsia"];
7911
+ const eastAsiaFamily = typeof value === "object" && value !== null ? value["eastAsia"] : void 0;
7815
7912
  if (eastAsiaFamily) {
7816
7913
  const eastAsiaCss = getFontFamilyValue$1({ "w:ascii": eastAsiaFamily }, docx);
7817
7914
  if (!fontFamily || eastAsiaCss !== textStyleAttrs.fontFamily) {
@@ -8066,11 +8163,11 @@ function encodeCSSFromRPr(runProperties, docx) {
8066
8163
  }
8067
8164
  case "fontFamily": {
8068
8165
  if (!value) break;
8069
- const fontFamily = getFontFamilyValue$1(value, docx);
8166
+ const fontFamily = resolveDocxFontFamily(value, docx, getToCssFontFamily());
8070
8167
  if (fontFamily) {
8071
8168
  css["font-family"] = fontFamily;
8072
8169
  }
8073
- const eastAsiaFamily = value["eastAsia"];
8170
+ const eastAsiaFamily = typeof value === "object" && value !== null ? value["eastAsia"] : void 0;
8074
8171
  if (eastAsiaFamily) {
8075
8172
  const eastAsiaCss = getFontFamilyValue$1({ "w:ascii": eastAsiaFamily }, docx);
8076
8173
  if (eastAsiaCss && (!fontFamily || eastAsiaCss !== fontFamily)) {
@@ -9417,6 +9514,9 @@ function handleTableCellNode({
9417
9514
  columnIndex,
9418
9515
  columnWidth = null,
9419
9516
  allColumnWidths = [],
9517
+ rowIndex = 0,
9518
+ totalRows = 1,
9519
+ totalColumns,
9420
9520
  _referencedStyles
9421
9521
  }) {
9422
9522
  const { nodeListHandler } = params;
@@ -9425,19 +9525,46 @@ function handleTableCellNode({
9425
9525
  const tcPr = node.elements.find((el) => el.name === "w:tcPr");
9426
9526
  const tableCellProperties = tcPr ? translator$J.encode({ ...params, nodes: [tcPr] }) ?? {} : {};
9427
9527
  attributes["tableCellProperties"] = tableCellProperties;
9428
- if (rowBorders?.insideH) {
9429
- rowBorders["bottom"] = rowBorders.insideH;
9430
- delete rowBorders.insideH;
9431
- }
9432
- if (rowBorders?.insideV) {
9433
- rowBorders["right"] = rowBorders.insideV;
9434
- delete rowBorders?.insideV;
9435
- }
9436
- if (rowBorders) attributes["borders"] = { ...rowBorders };
9437
- const inlineBorders = processInlineCellBorders(tableCellProperties.borders, rowBorders);
9438
- if (inlineBorders) attributes["borders"] = Object.assign(attributes["borders"] || {}, inlineBorders);
9439
- const colspan = tableCellProperties.gridSpan;
9440
- if (colspan && !isNaN(parseInt(colspan, 10))) attributes["colspan"] = parseInt(colspan, 10);
9528
+ const effectiveTotalColumns = totalColumns ?? (allColumnWidths.length || 1);
9529
+ const effectiveTotalRows = totalRows ?? (table?.elements?.filter((el) => el.name === "w:tr").length || 1);
9530
+ const colspan = parseInt(tableCellProperties.gridSpan || 1, 10);
9531
+ const isFirstRow = rowIndex === 0;
9532
+ const isLastRow = rowIndex === effectiveTotalRows - 1;
9533
+ const isFirstColumn = columnIndex === 0;
9534
+ const isLastColumn = columnIndex + colspan >= effectiveTotalColumns;
9535
+ const cellBorders = {};
9536
+ if (rowBorders) {
9537
+ if (rowBorders.top?.val === "none") {
9538
+ cellBorders.top = rowBorders.top;
9539
+ } else if (isFirstRow && rowBorders.top) {
9540
+ cellBorders.top = rowBorders.top;
9541
+ }
9542
+ if (rowBorders.bottom?.val === "none") {
9543
+ cellBorders.bottom = rowBorders.bottom;
9544
+ } else if (isLastRow && rowBorders.bottom) {
9545
+ cellBorders.bottom = rowBorders.bottom;
9546
+ }
9547
+ if (rowBorders.left?.val === "none") {
9548
+ cellBorders.left = rowBorders.left;
9549
+ } else if (isFirstColumn && rowBorders.left) {
9550
+ cellBorders.left = rowBorders.left;
9551
+ }
9552
+ if (rowBorders.right?.val === "none") {
9553
+ cellBorders.right = rowBorders.right;
9554
+ } else if (isLastColumn && rowBorders.right) {
9555
+ cellBorders.right = rowBorders.right;
9556
+ }
9557
+ if (!isLastRow && rowBorders.insideH) {
9558
+ cellBorders.bottom = rowBorders.insideH;
9559
+ }
9560
+ if (!isLastColumn && rowBorders.insideV) {
9561
+ cellBorders.right = rowBorders.insideV;
9562
+ }
9563
+ }
9564
+ attributes["borders"] = cellBorders;
9565
+ const inlineBorders = processInlineCellBorders(tableCellProperties.borders, cellBorders);
9566
+ if (inlineBorders) attributes["borders"] = Object.assign(attributes["borders"], inlineBorders);
9567
+ if (colspan > 1) attributes["colspan"] = colspan;
9441
9568
  let width = tableCellProperties.cellWidth?.value ? twipsToPixels(tableCellProperties.cellWidth?.value) : null;
9442
9569
  const widthType = tableCellProperties.cellWidth?.type;
9443
9570
  if (widthType) attributes["widthType"] = widthType;
@@ -9447,10 +9574,9 @@ function handleTableCellNode({
9447
9574
  attributes["widthUnit"] = "px";
9448
9575
  const defaultColWidths = allColumnWidths;
9449
9576
  const hasDefaultColWidths = allColumnWidths && allColumnWidths.length > 0;
9450
- const colspanNum = parseInt(colspan || 1, 10);
9451
- if (colspanNum && colspanNum > 1 && hasDefaultColWidths) {
9577
+ if (colspan > 1 && hasDefaultColWidths) {
9452
9578
  let colwidth = [];
9453
- for (let i = 0; i < colspanNum; i++) {
9579
+ for (let i = 0; i < colspan; i++) {
9454
9580
  let colwidthValue = defaultColWidths[columnIndex + i];
9455
9581
  let defaultColwidth = 100;
9456
9582
  if (typeof colwidthValue !== "undefined") {
@@ -9600,22 +9726,18 @@ const processInlineCellBorders = (borders, rowBorders) => {
9600
9726
  return ["bottom", "top", "left", "right"].reduce((acc, direction) => {
9601
9727
  const borderAttrs = borders[direction];
9602
9728
  const rowBorderAttrs = rowBorders[direction];
9603
- if (borderAttrs && borderAttrs["val"] !== "nil") {
9729
+ if (borderAttrs && borderAttrs["val"] !== "none") {
9604
9730
  const color = borderAttrs["color"];
9605
9731
  let size = borderAttrs["size"];
9606
9732
  if (size) size = eighthPointsToPixels(size);
9607
9733
  acc[direction] = { color, size, val: borderAttrs["val"] };
9608
9734
  return acc;
9609
9735
  }
9610
- if (borderAttrs && borderAttrs["val"] === "nil") {
9736
+ if (borderAttrs && borderAttrs["val"] === "none") {
9611
9737
  const border = Object.assign({}, rowBorderAttrs || {});
9612
- if (!Object.keys(border).length) {
9613
- return acc;
9614
- } else {
9615
- border["val"] = "none";
9616
- acc[direction] = border;
9617
- return acc;
9618
- }
9738
+ border["val"] = "none";
9739
+ acc[direction] = border;
9740
+ return acc;
9619
9741
  }
9620
9742
  return acc;
9621
9743
  }, {});
@@ -9751,6 +9873,9 @@ function encode$w(params, encodedAttrs) {
9751
9873
  columnIndex,
9752
9874
  columnWidth,
9753
9875
  columnWidths: allColumnWidths,
9876
+ rowIndex,
9877
+ totalRows,
9878
+ totalColumns,
9754
9879
  _referencedStyles
9755
9880
  } = params.extraParams;
9756
9881
  const schemaNode = handleTableCellNode({
@@ -9762,6 +9887,9 @@ function encode$w(params, encodedAttrs) {
9762
9887
  columnIndex,
9763
9888
  columnWidth,
9764
9889
  allColumnWidths,
9890
+ rowIndex,
9891
+ totalRows,
9892
+ totalColumns,
9765
9893
  _referencedStyles
9766
9894
  });
9767
9895
  if (encodedAttrs && Object.keys(encodedAttrs).length) {
@@ -9785,13 +9913,26 @@ const config$i = {
9785
9913
  attributes: validXmlAttributes$a
9786
9914
  };
9787
9915
  const translator$I = NodeTranslator.from(config$i);
9788
- const translator$H = NodeTranslator.from({
9916
+ const propertyTranslators$3 = [
9917
+ translator$1q,
9918
+ translator$Z,
9919
+ translator$X,
9920
+ translator$W,
9921
+ translator$1o,
9922
+ translator$1m,
9923
+ translator$V,
9924
+ translator$1k
9925
+ ];
9926
+ const translator$H = NodeTranslator.from(
9927
+ createNestedPropertiesTranslator("w:tblBorders", "borders", propertyTranslators$3)
9928
+ );
9929
+ const translator$G = NodeTranslator.from({
9789
9930
  xmlName: "w:cantSplit",
9790
9931
  sdNodeOrKeyName: "cantSplit",
9791
9932
  encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
9792
9933
  decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
9793
9934
  });
9794
- const translator$G = NodeTranslator.from(
9935
+ const translator$F = NodeTranslator.from(
9795
9936
  createSingleAttrPropertyHandler(
9796
9937
  "w:gridAfter",
9797
9938
  null,
@@ -9800,7 +9941,7 @@ const translator$G = NodeTranslator.from(
9800
9941
  (v2) => integerToString(v2)
9801
9942
  )
9802
9943
  );
9803
- const translator$F = NodeTranslator.from(
9944
+ const translator$E = NodeTranslator.from(
9804
9945
  createSingleAttrPropertyHandler(
9805
9946
  "w:gridBefore",
9806
9947
  null,
@@ -9809,20 +9950,20 @@ const translator$F = NodeTranslator.from(
9809
9950
  (v2) => integerToString(v2)
9810
9951
  )
9811
9952
  );
9812
- const translator$E = NodeTranslator.from({
9953
+ const translator$D = NodeTranslator.from({
9813
9954
  xmlName: "w:hidden",
9814
9955
  sdNodeOrKeyName: "hidden",
9815
9956
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
9816
9957
  decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
9817
9958
  });
9818
- const translator$D = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
9819
- const translator$C = NodeTranslator.from({
9959
+ const translator$C = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
9960
+ const translator$B = NodeTranslator.from({
9820
9961
  xmlName: "w:tblHeader",
9821
9962
  sdNodeOrKeyName: "repeatHeader",
9822
9963
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
9823
9964
  decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
9824
9965
  });
9825
- const translator$B = NodeTranslator.from({
9966
+ const translator$A = NodeTranslator.from({
9826
9967
  xmlName: "w:trHeight",
9827
9968
  sdNodeOrKeyName: "rowHeight",
9828
9969
  encode: ({ nodes }) => {
@@ -9849,24 +9990,24 @@ const translator$B = NodeTranslator.from({
9849
9990
  return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
9850
9991
  }
9851
9992
  });
9852
- const translator$A = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
9853
- const translator$z = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
9854
- const propertyTranslators$3 = [
9855
- translator$H,
9993
+ const translator$z = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
9994
+ const translator$y = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
9995
+ const propertyTranslators$2 = [
9996
+ translator$G,
9856
9997
  translator$1I,
9857
9998
  translator$1G,
9858
- translator$G,
9859
9999
  translator$F,
9860
10000
  translator$E,
9861
- translator$1D,
9862
10001
  translator$D,
10002
+ translator$1D,
9863
10003
  translator$C,
9864
10004
  translator$B,
9865
10005
  translator$A,
9866
- translator$z
10006
+ translator$z,
10007
+ translator$y
9867
10008
  ];
9868
- const translator$y = NodeTranslator.from(
9869
- createNestedPropertiesTranslator("w:trPr", "tableRowProperties", propertyTranslators$3, {
10009
+ const translator$x = NodeTranslator.from(
10010
+ createNestedPropertiesTranslator("w:trPr", "tableRowProperties", propertyTranslators$2, {
9870
10011
  cantSplit: false,
9871
10012
  hidden: false,
9872
10013
  repeatHeader: false
@@ -9944,7 +10085,7 @@ const encode$v = (params, encodedAttrs) => {
9944
10085
  let tableRowProperties = {};
9945
10086
  const tPr = row.elements.find((el) => el.name === "w:trPr");
9946
10087
  if (tPr) {
9947
- tableRowProperties = translator$y.encode({
10088
+ tableRowProperties = translator$x.encode({
9948
10089
  ...params,
9949
10090
  nodes: [tPr]
9950
10091
  });
@@ -9954,6 +10095,12 @@ const encode$v = (params, encodedAttrs) => {
9954
10095
  encodedAttrs["tableRowProperties"] = Object.freeze(tableRowProperties);
9955
10096
  encodedAttrs["rowHeight"] = twipsToPixels(tableRowProperties["rowHeight"]?.value);
9956
10097
  encodedAttrs["cantSplit"] = tableRowProperties["cantSplit"];
10098
+ const baseBorders = params.extraParams?.rowBorders;
10099
+ const rowTableBorders = getRowTableBorders({
10100
+ params,
10101
+ row,
10102
+ baseBorders
10103
+ });
9957
10104
  const { columnWidths: gridColumnWidths, activeRowSpans = [] } = params.extraParams;
9958
10105
  const totalColumns = Array.isArray(gridColumnWidths) ? gridColumnWidths.length : 0;
9959
10106
  const pendingRowSpans = Array.isArray(activeRowSpans) ? activeRowSpans.slice() : [];
@@ -9986,6 +10133,10 @@ const encode$v = (params, encodedAttrs) => {
9986
10133
  path: [...params.path || [], node],
9987
10134
  extraParams: {
9988
10135
  ...params.extraParams,
10136
+ rowBorders: {
10137
+ ...baseBorders,
10138
+ ...rowTableBorders
10139
+ },
9989
10140
  node,
9990
10141
  columnIndex: startColumn,
9991
10142
  columnWidth
@@ -10015,6 +10166,33 @@ const encode$v = (params, encodedAttrs) => {
10015
10166
  };
10016
10167
  return newNode;
10017
10168
  };
10169
+ function getRowTableBorders({ params, row, baseBorders }) {
10170
+ const tblPrEx = row?.elements?.find?.((el) => el.name === "w:tblPrEx");
10171
+ const tblBorders = tblPrEx?.elements?.find?.((el) => el.name === "w:tblBorders");
10172
+ if (!tblBorders) {
10173
+ return baseBorders;
10174
+ }
10175
+ const rawOverrides = translator$H.encode({ ...params, nodes: [tblBorders] }) || {};
10176
+ const overrides = processRawTableBorders(rawOverrides);
10177
+ if (!Object.keys(overrides).length) {
10178
+ return baseBorders;
10179
+ }
10180
+ return { ...baseBorders || {}, ...overrides };
10181
+ }
10182
+ function processRawTableBorders(rawBorders) {
10183
+ const borders = {};
10184
+ Object.entries(rawBorders || {}).forEach(([name, attributes]) => {
10185
+ const attrs = {};
10186
+ const color = attributes?.color;
10187
+ const size = attributes?.size;
10188
+ const val = attributes?.val;
10189
+ if (color && color !== "auto") attrs.color = color.startsWith("#") ? color : `#${color}`;
10190
+ if (size != null && size !== "auto") attrs.size = eighthPointsToPixels(size);
10191
+ if (val) attrs.val = val;
10192
+ borders[name] = attrs;
10193
+ });
10194
+ return borders;
10195
+ }
10018
10196
  const decode$x = (params, decodedAttrs) => {
10019
10197
  const { node } = params;
10020
10198
  const cells = node.content || [];
@@ -10055,7 +10233,7 @@ const decode$x = (params, decodedAttrs) => {
10055
10233
  }
10056
10234
  }
10057
10235
  tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
10058
- const trPr = translator$y.decode({
10236
+ const trPr = translator$x.decode({
10059
10237
  ...params,
10060
10238
  node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
10061
10239
  });
@@ -10075,7 +10253,7 @@ const config$h = {
10075
10253
  decode: decode$x,
10076
10254
  attributes: validXmlAttributes$9
10077
10255
  };
10078
- const translator$x = NodeTranslator.from(config$h);
10256
+ const translator$w = NodeTranslator.from(config$h);
10079
10257
  function parseTagValueJSON(json) {
10080
10258
  if (typeof json !== "string") {
10081
10259
  return {};
@@ -24766,7 +24944,7 @@ const config$g = {
24766
24944
  decode: decode$w,
24767
24945
  attributes: validXmlAttributes$8
24768
24946
  };
24769
- const translator$w = NodeTranslator.from(config$g);
24947
+ const translator$v = NodeTranslator.from(config$g);
24770
24948
  function handleInlineNode(params) {
24771
24949
  const { node } = params.extraParams;
24772
24950
  if (node.name !== "wp:inline") {
@@ -24820,7 +24998,7 @@ const config$f = {
24820
24998
  decode: decode$v,
24821
24999
  attributes: validXmlAttributes$7
24822
25000
  };
24823
- const translator$v = NodeTranslator.from(config$f);
25001
+ const translator$u = NodeTranslator.from(config$f);
24824
25002
  const XML_NODE_NAME$f = "w:drawing";
24825
25003
  const SD_NODE_NAME$d = [];
24826
25004
  const validXmlAttributes$6 = [];
@@ -24828,8 +25006,8 @@ function encode$s(params) {
24828
25006
  const nodes = params.nodes;
24829
25007
  const node = nodes[0];
24830
25008
  const translatorByChildName = {
24831
- "wp:anchor": translator$w,
24832
- "wp:inline": translator$v
25009
+ "wp:anchor": translator$v,
25010
+ "wp:inline": translator$u
24833
25011
  };
24834
25012
  const result = (node.elements || []).reduce((acc, child) => {
24835
25013
  if (acc) return acc;
@@ -24852,7 +25030,7 @@ function decode$u(params) {
24852
25030
  if (!node || !node.type) {
24853
25031
  return null;
24854
25032
  }
24855
- const childTranslator = node.attrs.isAnchor ? translator$w : translator$v;
25033
+ const childTranslator = node.attrs.isAnchor ? translator$v : translator$u;
24856
25034
  const resultNode = childTranslator.decode(params);
24857
25035
  return wrapTextInRun(
24858
25036
  {
@@ -24870,7 +25048,7 @@ const config$e = {
24870
25048
  decode: decode$u,
24871
25049
  attributes: validXmlAttributes$6
24872
25050
  };
24873
- const translator$u = NodeTranslator.from(config$e);
25051
+ const translator$t = NodeTranslator.from(config$e);
24874
25052
  function getTextNodeForExport(text, marks, params) {
24875
25053
  const hasLeadingOrTrailingSpace = /^\s|\s$/.test(text);
24876
25054
  const space = hasLeadingOrTrailingSpace ? "preserve" : null;
@@ -25220,8 +25398,9 @@ function translateFieldAnnotation(params) {
25220
25398
  hash: attrs.hash
25221
25399
  };
25222
25400
  const annotationAttrsJson = JSON.stringify(annotationAttrs);
25401
+ const sanitizedDisplayLabel = attrs.displayLabel === "undefined" || attrs.displayLabel === void 0 ? "" : attrs.displayLabel;
25223
25402
  const sdtPrElements = [
25224
- { name: "w:alias", attributes: { "w:val": attrs.displayLabel } },
25403
+ { name: "w:alias", attributes: { "w:val": sanitizedDisplayLabel } },
25225
25404
  { name: "w:tag", attributes: { "w:val": annotationAttrsJson } },
25226
25405
  { name: "w:id", attributes: { "w:val": id } }
25227
25406
  ];
@@ -25277,7 +25456,7 @@ function prepareTextAnnotation(params) {
25277
25456
  return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params);
25278
25457
  }
25279
25458
  function prepareImageAnnotation(params, imageSize) {
25280
- return translator$u.decode({
25459
+ return translator$t.decode({
25281
25460
  ...params,
25282
25461
  imageSize
25283
25462
  });
@@ -25739,7 +25918,7 @@ const config$d = {
25739
25918
  decode: decode$t,
25740
25919
  attributes: validXmlAttributes$5
25741
25920
  };
25742
- const translator$t = NodeTranslator.from(config$d);
25921
+ const translator$s = NodeTranslator.from(config$d);
25743
25922
  function preProcessVerticalMergeCells(table, { editorSchema }) {
25744
25923
  if (!table || !Array.isArray(table.content)) {
25745
25924
  return table;
@@ -25780,17 +25959,17 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
25780
25959
  }
25781
25960
  return table;
25782
25961
  }
25783
- const translator$s = NodeTranslator.from({
25962
+ const translator$r = NodeTranslator.from({
25784
25963
  xmlName: "w:bidiVisual",
25785
25964
  sdNodeOrKeyName: "rightToLeft",
25786
25965
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
25787
25966
  decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
25788
25967
  });
25789
- const translator$r = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
25790
- const translator$q = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
25791
- const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
25792
- const translator$o = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
25793
- const translator$n = NodeTranslator.from({
25968
+ const translator$q = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
25969
+ const translator$p = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
25970
+ const translator$o = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
25971
+ const translator$n = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
25972
+ const translator$m = NodeTranslator.from({
25794
25973
  xmlName: "w:tblLook",
25795
25974
  sdNodeOrKeyName: "tblLook",
25796
25975
  attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
@@ -25802,16 +25981,16 @@ const translator$n = NodeTranslator.from({
25802
25981
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
25803
25982
  }
25804
25983
  });
25805
- const translator$m = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
25806
- const translator$l = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
25807
- const translator$k = NodeTranslator.from(
25984
+ const translator$l = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
25985
+ const translator$k = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
25986
+ const translator$j = NodeTranslator.from(
25808
25987
  createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
25809
25988
  );
25810
- const translator$j = NodeTranslator.from(
25989
+ const translator$i = NodeTranslator.from(
25811
25990
  createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
25812
25991
  );
25813
- const translator$i = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
25814
- const translator$h = NodeTranslator.from({
25992
+ const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
25993
+ const translator$g = NodeTranslator.from({
25815
25994
  xmlName: "w:tblpPr",
25816
25995
  sdNodeOrKeyName: "floatingTableProperties",
25817
25996
  attributes: ["w:leftFromText", "w:rightFromText", "w:topFromText", "w:bottomFromText", "w:tblpX", "w:tblpY"].map((attr) => createAttributeHandler(attr, null, parseInteger, integerToString)).concat(["w:horzAnchor", "w:vertAnchor", "w:tblpXSpec", "w:tblpYSpec"].map((attr) => createAttributeHandler(attr))),
@@ -25823,19 +26002,6 @@ const translator$h = NodeTranslator.from({
25823
26002
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
25824
26003
  }
25825
26004
  });
25826
- const propertyTranslators$2 = [
25827
- translator$1q,
25828
- translator$Z,
25829
- translator$X,
25830
- translator$W,
25831
- translator$1o,
25832
- translator$1m,
25833
- translator$V,
25834
- translator$1k
25835
- ];
25836
- const translator$g = NodeTranslator.from(
25837
- createNestedPropertiesTranslator("w:tblBorders", "borders", propertyTranslators$2)
25838
- );
25839
26005
  const propertyTranslators$1 = [
25840
26006
  translator$1p,
25841
26007
  translator$Y,
@@ -25848,12 +26014,11 @@ const translator$f = NodeTranslator.from(
25848
26014
  createNestedPropertiesTranslator("w:tblCellMar", "cellMargins", propertyTranslators$1)
25849
26015
  );
25850
26016
  const propertyTranslators = [
25851
- translator$s,
26017
+ translator$r,
25852
26018
  translator$1D,
25853
26019
  translator$2b,
25854
- translator$r,
25855
- translator$D,
25856
26020
  translator$q,
26021
+ translator$C,
25857
26022
  translator$p,
25858
26023
  translator$o,
25859
26024
  translator$n,
@@ -25864,6 +26029,7 @@ const propertyTranslators = [
25864
26029
  translator$i,
25865
26030
  translator$h,
25866
26031
  translator$g,
26032
+ translator$H,
25867
26033
  translator$f
25868
26034
  ];
25869
26035
  const translator$e = NodeTranslator.from(
@@ -26123,8 +26289,7 @@ const encode$p = (params, encodedAttrs) => {
26123
26289
  }
26124
26290
  const borderProps = _processTableBorders(encodedAttrs.tableProperties.borders || {});
26125
26291
  const referencedStyles = _getReferencedTableStyles(encodedAttrs.tableStyleId, params) || {};
26126
- const rowBorders = { ...referencedStyles.rowBorders, ...borderProps.rowBorders };
26127
- encodedAttrs.borders = { ...referencedStyles.borders, ...borderProps.borders };
26292
+ encodedAttrs.borders = { ...referencedStyles.borders, ...borderProps };
26128
26293
  encodedAttrs.tableProperties.cellMargins = referencedStyles.cellMargins = {
26129
26294
  ...referencedStyles.cellMargins,
26130
26295
  ...encodedAttrs.tableProperties.cellMargins
@@ -26145,19 +26310,22 @@ const encode$p = (params, encodedAttrs) => {
26145
26310
  }
26146
26311
  const content = [];
26147
26312
  const totalColumns = columnWidths.length;
26313
+ const totalRows = rows.length;
26148
26314
  const activeRowSpans = totalColumns > 0 ? new Array(totalColumns).fill(0) : [];
26149
26315
  rows.forEach((row, rowIndex) => {
26150
- const result = translator$x.encode({
26316
+ const result = translator$w.encode({
26151
26317
  ...params,
26152
26318
  path: [...params.path || [], node],
26153
26319
  nodes: [row],
26154
26320
  extraParams: {
26155
26321
  row,
26156
26322
  table: node,
26157
- rowBorders,
26323
+ rowBorders: encodedAttrs.borders,
26158
26324
  columnWidths,
26159
26325
  activeRowSpans: activeRowSpans.slice(),
26160
26326
  rowIndex,
26327
+ totalRows,
26328
+ totalColumns,
26161
26329
  _referencedStyles: referencedStyles
26162
26330
  }
26163
26331
  });
@@ -26232,21 +26400,17 @@ const decode$r = (params, decodedAttrs) => {
26232
26400
  };
26233
26401
  function _processTableBorders(rawBorders) {
26234
26402
  const borders = {};
26235
- const rowBorders = {};
26236
26403
  Object.entries(rawBorders).forEach(([name, attributes]) => {
26237
26404
  const attrs = {};
26238
26405
  const color = attributes.color;
26239
26406
  const size = attributes.size;
26407
+ const val = attributes.val;
26240
26408
  if (color && color !== "auto") attrs["color"] = color.startsWith("#") ? color : `#${color}`;
26241
26409
  if (size && size !== "auto") attrs["size"] = eighthPointsToPixels(size);
26242
- const rowBorderNames = ["insideH", "insideV"];
26243
- if (rowBorderNames.includes(name)) rowBorders[name] = attrs;
26410
+ if (val) attrs["val"] = val;
26244
26411
  borders[name] = attrs;
26245
26412
  });
26246
- return {
26247
- borders,
26248
- rowBorders
26249
- };
26413
+ return borders;
26250
26414
  }
26251
26415
  function _getReferencedTableStyles(tableStyleReference, params) {
26252
26416
  if (!tableStyleReference) return null;
@@ -26286,9 +26450,8 @@ function _getReferencedTableStyles(tableStyleReference, params) {
26286
26450
  }
26287
26451
  const tableProperties = translator$e.encode({ ...params, nodes: [tblPr] });
26288
26452
  if (tableProperties) {
26289
- const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
26290
- if (borders) stylesToReturn.borders = borders;
26291
- if (rowBorders) stylesToReturn.rowBorders = rowBorders;
26453
+ const borders = _processTableBorders(tableProperties.borders || {});
26454
+ if (borders || Object.keys(borders).length) stylesToReturn.borders = borders;
26292
26455
  const cellMargins = {};
26293
26456
  Object.entries(tableProperties.cellMargins || {}).forEach(([key, attrs]) => {
26294
26457
  if (attrs?.value != null) {
@@ -27137,7 +27300,7 @@ const handleDrawingNode = (params) => {
27137
27300
  return { nodes: [], consumed: 0 };
27138
27301
  }
27139
27302
  const translatorParams = { ...params, nodes: [node] };
27140
- const schemaNode = translator$u.encode(translatorParams);
27303
+ const schemaNode = translator$t.encode(translatorParams);
27141
27304
  const newNodes = schemaNode ? [schemaNode] : [];
27142
27305
  return { nodes: newNodes, consumed: 1 };
27143
27306
  };
@@ -27294,7 +27457,8 @@ const encode$1 = (params, encodedAttrs = {}) => {
27294
27457
  text = text.replace(/^[ \t\n\r]+/, "").replace(/[ \t\n\r]+$/, "");
27295
27458
  }
27296
27459
  text = text.replace(/\[\[sdspace\]\]/g, "");
27297
- if (xmlSpace !== "preserve" && typeof text === "string" && !text.trim()) {
27460
+ const isWhitespaceOnly = /^[ \t\n\r]*$/.test(text);
27461
+ if (xmlSpace !== "preserve" && isWhitespaceOnly) {
27298
27462
  return null;
27299
27463
  }
27300
27464
  } else if (!elements.length && encodedAttrs.xmlSpace === "preserve") {
@@ -27379,7 +27543,7 @@ const handleSdtNode = (params) => {
27379
27543
  if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
27380
27544
  return { nodes: [], consumed: 0 };
27381
27545
  }
27382
- const result = translator$t.encode(params);
27546
+ const result = translator$s.encode(params);
27383
27547
  if (!result) {
27384
27548
  return { nodes: [], consumed: 0 };
27385
27549
  }
@@ -27407,12 +27571,12 @@ const translatorList = Array.from(
27407
27571
  translator$1s,
27408
27572
  translator$2n,
27409
27573
  translator$2m,
27410
- translator$s,
27574
+ translator$r,
27411
27575
  translator$9,
27412
27576
  translator$a,
27413
27577
  translator$1q,
27414
27578
  translator$2r,
27415
- translator$H,
27579
+ translator$G,
27416
27580
  translator$2c,
27417
27581
  translator$1I,
27418
27582
  translator$2h,
@@ -27420,7 +27584,7 @@ const translatorList = Array.from(
27420
27584
  translator$1R,
27421
27585
  translator$2,
27422
27586
  translator$1G,
27423
- translator$u,
27587
+ translator$t,
27424
27588
  translator$2i,
27425
27589
  translator$1T,
27426
27590
  translator$1Z,
@@ -27429,13 +27593,13 @@ const translatorList = Array.from(
27429
27593
  translator$Z,
27430
27594
  translator$1U,
27431
27595
  translator$1F,
27432
- translator$G,
27433
27596
  translator$F,
27597
+ translator$E,
27434
27598
  translator$d,
27435
27599
  translator$$,
27436
27600
  translator$L,
27437
27601
  translator$K,
27438
- translator$E,
27602
+ translator$D,
27439
27603
  translator$M,
27440
27604
  translator$2q,
27441
27605
  translator$12,
@@ -27477,7 +27641,7 @@ const translatorList = Array.from(
27477
27641
  translator$2f,
27478
27642
  translator$1S,
27479
27643
  translator$1m,
27480
- translator$t,
27644
+ translator$s,
27481
27645
  translator$20,
27482
27646
  translator$2b,
27483
27647
  translator$27,
@@ -27495,23 +27659,23 @@ const translatorList = Array.from(
27495
27659
  translator$2p,
27496
27660
  translator$1b,
27497
27661
  translator$b,
27498
- translator$g,
27499
- translator$r,
27500
- translator$f,
27501
- translator$D,
27662
+ translator$H,
27502
27663
  translator$q,
27503
- translator$c,
27664
+ translator$f,
27504
27665
  translator$C,
27505
27666
  translator$p,
27667
+ translator$c,
27668
+ translator$B,
27506
27669
  translator$o,
27507
27670
  translator$n,
27508
27671
  translator$m,
27509
- translator$e,
27510
27672
  translator$l,
27673
+ translator$e,
27511
27674
  translator$k,
27512
27675
  translator$j,
27513
27676
  translator$i,
27514
27677
  translator$h,
27678
+ translator$g,
27515
27679
  translator$I,
27516
27680
  translator$R,
27517
27681
  translator$O,
@@ -27520,10 +27684,10 @@ const translatorList = Array.from(
27520
27684
  translator$10,
27521
27685
  translator$19,
27522
27686
  translator$T,
27523
- translator$x,
27687
+ translator$w,
27524
27688
  translator$S,
27525
- translator$B,
27526
- translator$y,
27689
+ translator$A,
27690
+ translator$x,
27527
27691
  translator$1a,
27528
27692
  translator$18,
27529
27693
  translator$17,
@@ -27534,13 +27698,13 @@ const translatorList = Array.from(
27534
27698
  translator$28,
27535
27699
  translator$_,
27536
27700
  translator$1X,
27537
- translator$A,
27538
27701
  translator$z,
27702
+ translator$y,
27539
27703
  translator$1P,
27540
27704
  translator$16,
27541
27705
  translator$15,
27542
- translator$w,
27543
27706
  translator$v,
27707
+ translator$u,
27544
27708
  commentRangeStartTranslator,
27545
27709
  commentRangeEndTranslator
27546
27710
  ])
@@ -27879,8 +28043,8 @@ function importCommentData({ docx, editor, converter }) {
27879
28043
  converter,
27880
28044
  path: [el]
27881
28045
  });
27882
- const { attrs } = parsedElements[0];
27883
- const paraId = attrs["w14:paraId"];
28046
+ const lastElement = parsedElements[parsedElements.length - 1];
28047
+ const paraId = lastElement?.attrs?.["w14:paraId"];
27884
28048
  return {
27885
28049
  commentId: internalId || v4(),
27886
28050
  importedId,
@@ -27923,7 +28087,11 @@ const generateCommentsWithExtendedData = ({ docx, comments }) => {
27923
28087
  if (!extendedDef) return { ...comment, isDone: comment.isDone ?? false };
27924
28088
  const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
27925
28089
  let parentComment;
27926
- if (paraIdParent) parentComment = comments.find((c) => c.paraId === paraIdParent);
28090
+ if (paraIdParent) {
28091
+ parentComment = comments.find(
28092
+ (c) => c.paraId === paraIdParent || c.elements?.some((el) => el.attrs?.["w14:paraId"] === paraIdParent)
28093
+ );
28094
+ }
27927
28095
  const newComment = {
27928
28096
  ...comment,
27929
28097
  isDone: isDone ?? false,
@@ -29808,13 +29976,13 @@ function exportSchemaToJson(params) {
29808
29976
  text: translator$1,
29809
29977
  lineBreak: translator$2r,
29810
29978
  table: translator$b,
29811
- tableRow: translator$x,
29979
+ tableRow: translator$w,
29812
29980
  tableCell: translator$I,
29813
29981
  bookmarkStart: translator$a,
29814
29982
  bookmarkEnd: translator$9,
29815
- fieldAnnotation: translator$t,
29983
+ fieldAnnotation: translator$s,
29816
29984
  tab: translator$2p,
29817
- image: translator$u,
29985
+ image: translator$t,
29818
29986
  hardBreak: translator$2r,
29819
29987
  commentRangeStart: commentRangeStartTranslator,
29820
29988
  commentRangeEnd: commentRangeEndTranslator,
@@ -29826,10 +29994,10 @@ function exportSchemaToJson(params) {
29826
29994
  contentBlock: translator,
29827
29995
  vectorShape: translateVectorShape,
29828
29996
  shapeGroup: translateShapeGroup,
29829
- structuredContent: translator$t,
29830
- structuredContentBlock: translator$t,
29831
- documentPartObject: translator$t,
29832
- documentSection: translator$t,
29997
+ structuredContent: translator$s,
29998
+ structuredContentBlock: translator$s,
29999
+ documentPartObject: translator$s,
30000
+ documentSection: translator$s,
29833
30001
  "page-number": translator$4,
29834
30002
  "total-page-number": translator$3,
29835
30003
  pageReference: translator$6,
@@ -30839,7 +31007,7 @@ class SuperConverter {
30839
31007
  static getStoredSuperdocVersion(docx) {
30840
31008
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
30841
31009
  }
30842
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.1") {
31010
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.11") {
30843
31011
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
30844
31012
  }
30845
31013
  /**
@@ -31485,45 +31653,49 @@ function generateCustomXml() {
31485
31653
  return DEFAULT_CUSTOM_XML;
31486
31654
  }
31487
31655
  export {
31488
- decodeRPrFromMarks as $,
31656
+ createOoxmlResolver as $,
31489
31657
  AllSelection as A,
31490
- getResolvedParagraphProperties as B,
31491
- changeListLevel as C,
31658
+ htmlHandler as B,
31659
+ ReplaceStep as C,
31492
31660
  DOMParser$1 as D,
31493
- isList as E,
31661
+ getResolvedParagraphProperties as E,
31494
31662
  Fragment as F,
31495
- updateNumberingProperties as G,
31496
- inputRulesPlugin as H,
31497
- TrackDeleteMarkName as I,
31498
- TrackInsertMarkName as J,
31499
- TrackFormatMarkName as K,
31663
+ changeListLevel as G,
31664
+ isList as H,
31665
+ updateNumberingProperties as I,
31666
+ inputRulesPlugin as J,
31667
+ TrackDeleteMarkName as K,
31500
31668
  ListHelpers as L,
31501
31669
  Mapping as M,
31502
31670
  NodeSelection as N,
31503
- AddMarkStep as O,
31671
+ TrackInsertMarkName as O,
31504
31672
  PluginKey as P,
31505
- RemoveMarkStep as Q,
31673
+ TrackFormatMarkName as Q,
31506
31674
  ReplaceAroundStep as R,
31507
31675
  SuperConverter as S,
31508
31676
  TextSelection as T,
31509
- CommandService as U,
31510
- EditorState as V,
31511
- unflattenListsInHtml as W,
31512
- SelectionRange as X,
31513
- Transform as Y,
31514
- resolveParagraphProperties as Z,
31515
- _getReferencedTableStyles as _,
31677
+ AddMarkStep as U,
31678
+ RemoveMarkStep as V,
31679
+ CommandService as W,
31680
+ EditorState as X,
31681
+ unflattenListsInHtml as Y,
31682
+ SelectionRange as Z,
31683
+ Transform as _,
31516
31684
  createDocFromHTML as a,
31517
- calculateResolvedParagraphProperties as a0,
31518
- resolveRunProperties as a1,
31519
- encodeCSSFromPPr as a2,
31520
- encodeCSSFromRPr as a3,
31521
- generateOrderedListIndex as a4,
31522
- docxNumberingHelpers as a5,
31523
- InputRule as a6,
31524
- insertNewRelationship as a7,
31525
- kebabCase as a8,
31526
- getUnderlineCssString as a9,
31685
+ translator$14 as a0,
31686
+ translator$1O as a1,
31687
+ resolveDocxFontFamily as a2,
31688
+ _getReferencedTableStyles as a3,
31689
+ decodeRPrFromMarks as a4,
31690
+ calculateResolvedParagraphProperties as a5,
31691
+ encodeCSSFromPPr as a6,
31692
+ encodeCSSFromRPr as a7,
31693
+ generateOrderedListIndex as a8,
31694
+ docxNumberingHelpers as a9,
31695
+ InputRule as aa,
31696
+ insertNewRelationship as ab,
31697
+ kebabCase as ac,
31698
+ getUnderlineCssString as ad,
31527
31699
  chainableEditorState as b,
31528
31700
  createDocFromMarkdown as c,
31529
31701
  convertMarkdownToHTML as d,
@@ -31542,11 +31714,11 @@ export {
31542
31714
  Schema$1 as q,
31543
31715
  registeredHandlers as r,
31544
31716
  canSplit as s,
31545
- liftTarget as t,
31546
- canJoin as u,
31547
- joinPoint as v,
31717
+ resolveRunProperties as t,
31718
+ encodeMarksFromRPr as u,
31719
+ liftTarget as v,
31548
31720
  wrapTextsInRuns as w,
31549
- replaceStep as x,
31550
- htmlHandler as y,
31551
- ReplaceStep as z
31721
+ canJoin as x,
31722
+ joinPoint as y,
31723
+ replaceStep as z
31552
31724
  };