@superdoc-dev/mcp 0.12.0-next.46 → 0.12.0-next.48

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.
Files changed (2) hide show
  1. package/dist/index.js +1240 -208
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -50479,7 +50479,7 @@ var init_remark_gfm_BUJjZJLy_es = __esm(() => {
50479
50479
  emptyOptions2 = {};
50480
50480
  });
50481
50481
 
50482
- // ../../packages/superdoc/dist/chunks/SuperConverter-DRKaQwZS.es.js
50482
+ // ../../packages/superdoc/dist/chunks/SuperConverter-Ed3nFN54.es.js
50483
50483
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
50484
50484
  const fieldValue = extension$1.config[field];
50485
50485
  if (typeof fieldValue === "function")
@@ -60055,6 +60055,50 @@ function getCellSpacingPx(cellSpacing) {
60055
60055
  const asPx = (cellSpacing.type ?? "").toLowerCase() === "dxa" && v >= 20 ? v / TWIPS_PER_PX : v;
60056
60056
  return Math.max(0, asPx);
60057
60057
  }
60058
+ function getBorderBandProfile(value) {
60059
+ if (value == null || typeof value !== "object")
60060
+ return null;
60061
+ if ("none" in value && value.none)
60062
+ return null;
60063
+ const raw = value;
60064
+ if (!raw.style)
60065
+ return null;
60066
+ const formula = COMPOUND_PROFILES[raw.style];
60067
+ if (!formula)
60068
+ return null;
60069
+ const w = typeof raw.width === "number" ? raw.width : typeof raw.size === "number" ? raw.size : 1;
60070
+ if (w <= 0)
60071
+ return null;
60072
+ const segments = formula(w).map((s) => Math.max(1, s));
60073
+ return {
60074
+ segments,
60075
+ band: segments.reduce((sum, s) => sum + s, 0)
60076
+ };
60077
+ }
60078
+ function getBorderBandWidthPx(value) {
60079
+ if (value == null)
60080
+ return 0;
60081
+ if (typeof value !== "object")
60082
+ return 0;
60083
+ if ("none" in value && value.none)
60084
+ return 0;
60085
+ const raw = value;
60086
+ if (raw.style === "none")
60087
+ return 0;
60088
+ const w = typeof raw.width === "number" ? raw.width : typeof raw.size === "number" ? raw.size : 1;
60089
+ const width = Math.max(0, w);
60090
+ if (width === 0)
60091
+ return 0;
60092
+ if (raw.style === "thick")
60093
+ return Math.max(width, 1);
60094
+ const profile = getBorderBandProfile(value);
60095
+ if (profile)
60096
+ return profile.band;
60097
+ return width;
60098
+ }
60099
+ function isNativeCssDoubleStyle(style) {
60100
+ return style === "double";
60101
+ }
60058
60102
  function coerceRelativeHeight(raw) {
60059
60103
  if (typeof raw === "number" && Number.isFinite(raw))
60060
60104
  return raw;
@@ -61662,6 +61706,11 @@ function resolveConditionalProps(propertyType, styleType, styleId, translatedLin
61662
61706
  const props = def?.tableStyleProperties?.[styleType]?.[propertyType];
61663
61707
  if (props)
61664
61708
  chain.push(props);
61709
+ if (styleType === "wholeTable" && propertyType === "tableCellProperties") {
61710
+ const baseProps = def?.tableCellProperties;
61711
+ if (baseProps)
61712
+ chain.push(baseProps);
61713
+ }
61665
61714
  currentId = def?.basedOn;
61666
61715
  }
61667
61716
  if (chain.length === 0)
@@ -61675,7 +61724,7 @@ function resolveCellStyles(propertyType, tableInfo, translatedLinkedStyles) {
61675
61724
  const cellStyleProps = [];
61676
61725
  const tableStyleId = tableInfo.tableProperties.tableStyleId;
61677
61726
  const { rowBandSize, colBandSize } = resolveEffectiveBandSizes(tableStyleId, translatedLinkedStyles);
61678
- determineCellStyleTypes(tableInfo.tableProperties?.tblLook ?? DEFAULT_TBL_LOOK, tableInfo.rowIndex, tableInfo.cellIndex, tableInfo.numRows, tableInfo.numCells, rowBandSize, colBandSize, tableInfo.rowCnfStyle, tableInfo.cellCnfStyle).forEach((styleType) => {
61727
+ determineCellStyleTypes(tableInfo.tableProperties?.tblLook ?? DEFAULT_TBL_LOOK, tableInfo.rowIndex, tableInfo.cellIndex, tableInfo.numRows, tableInfo.numCells, rowBandSize, colBandSize, tableInfo.rowCnfStyle, tableInfo.cellCnfStyle, tableInfo.gridColumnStart, tableInfo.gridColumnSpan, tableInfo.numGridCols).forEach((styleType) => {
61679
61728
  const typeProps = resolveConditionalProps(propertyType, styleType, tableStyleId, translatedLinkedStyles);
61680
61729
  if (typeProps)
61681
61730
  cellStyleProps.push(typeProps);
@@ -61693,12 +61742,15 @@ function resolveTableCellProperties(inlineProps, tableInfo, translatedLinkedStyl
61693
61742
  chain.push(inlineProps);
61694
61743
  return combineProperties(chain, { fullOverrideProps: ["shading"] });
61695
61744
  }
61696
- function determineCellStyleTypes(tblLook, rowIndex, cellIndex, numRows, numCells, rowBandSize = 1, colBandSize = 1, rowCnfStyle, cellCnfStyle) {
61745
+ function determineCellStyleTypes(tblLook, rowIndex, cellIndex, numRows, numCells, rowBandSize = 1, colBandSize = 1, rowCnfStyle, cellCnfStyle, gridColumnStart, gridColumnSpan, numGridCols) {
61697
61746
  const applicable = new Set(["wholeTable"]);
61698
61747
  const normalizedRowBandSize = rowBandSize > 0 ? rowBandSize : 1;
61699
61748
  const normalizedColBandSize = colBandSize > 0 ? colBandSize : 1;
61749
+ const columnStart = gridColumnStart ?? cellIndex;
61750
+ const columnEnd = columnStart + (gridColumnSpan ?? 1);
61751
+ const columnCount = numGridCols != null && numCells != null ? Math.max(numGridCols, numCells) : numGridCols ?? numCells;
61700
61752
  const bandRowIndex = Math.max(0, rowIndex - (tblLook?.firstRow ? 1 : 0));
61701
- const bandColIndex = Math.max(0, cellIndex - (tblLook?.firstColumn ? 1 : 0));
61753
+ const bandColIndex = Math.max(0, columnStart - (tblLook?.firstColumn ? 1 : 0));
61702
61754
  const rowGroup = Math.floor(bandRowIndex / normalizedRowBandSize);
61703
61755
  const colGroup = Math.floor(bandColIndex / normalizedColBandSize);
61704
61756
  if (!tblLook?.noHBand)
@@ -61707,8 +61759,8 @@ function determineCellStyleTypes(tblLook, rowIndex, cellIndex, numRows, numCells
61707
61759
  applicable.add(colGroup % 2 === 0 ? "band1Vert" : "band2Vert");
61708
61760
  const isFirstRow = !!tblLook?.firstRow && rowIndex === 0;
61709
61761
  const isLastRow = !!tblLook?.lastRow && numRows != null && numRows > 0 && rowIndex === numRows - 1;
61710
- const isFirstCol = !!tblLook?.firstColumn && cellIndex === 0;
61711
- const isLastCol = !!tblLook?.lastColumn && numCells != null && numCells > 0 && cellIndex === numCells - 1;
61762
+ const isFirstCol = !!tblLook?.firstColumn && columnStart === 0;
61763
+ const isLastCol = !!tblLook?.lastColumn && columnCount != null && columnCount > 0 && columnEnd >= columnCount;
61712
61764
  if (isFirstRow)
61713
61765
  applicable.add("firstRow");
61714
61766
  if (isFirstCol)
@@ -87050,34 +87102,62 @@ function hydrateImageBlocks(blocks, mediaFiles) {
87050
87102
  if (blk.kind === "drawing") {
87051
87103
  const drawingBlock = blk;
87052
87104
  if (drawingBlock.drawingKind === "vectorShape" || drawingBlock.drawingKind === "textboxShape") {
87053
- const parts = drawingBlock.textContent?.parts;
87054
- if (!parts || parts.length === 0)
87055
- return blk;
87056
- let partsChanged = false;
87057
- const hydratedParts = parts.map((part) => {
87058
- if (part?.kind !== "image" || !part.src || part.src.startsWith("data:"))
87105
+ let blockChanged = false;
87106
+ let nextBlock = drawingBlock;
87107
+ if (drawingBlock.drawingKind === "textboxShape") {
87108
+ const contentBlocks = drawingBlock.contentBlocks;
87109
+ if (Array.isArray(contentBlocks) && contentBlocks.length > 0) {
87110
+ let contentBlocksChanged = false;
87111
+ const hydratedContentBlocks = contentBlocks.map((paragraphBlock) => {
87112
+ if (paragraphBlock.kind !== "paragraph" || !paragraphBlock.runs?.length)
87113
+ return paragraphBlock;
87114
+ const hydratedRuns = hydrateRuns(paragraphBlock.runs);
87115
+ if (hydratedRuns !== paragraphBlock.runs) {
87116
+ contentBlocksChanged = true;
87117
+ return {
87118
+ ...paragraphBlock,
87119
+ runs: hydratedRuns
87120
+ };
87121
+ }
87122
+ return paragraphBlock;
87123
+ });
87124
+ if (contentBlocksChanged) {
87125
+ blockChanged = true;
87126
+ nextBlock = {
87127
+ ...drawingBlock,
87128
+ contentBlocks: hydratedContentBlocks
87129
+ };
87130
+ }
87131
+ }
87132
+ }
87133
+ const parts = nextBlock.textContent?.parts;
87134
+ if (parts && parts.length > 0) {
87135
+ let partsChanged = false;
87136
+ const hydratedParts = parts.map((part) => {
87137
+ if (part?.kind !== "image" || !part.src || part.src.startsWith("data:"))
87138
+ return part;
87139
+ const resolvedSrc = resolveImageSrc(part.src, part.rId, undefined, part.extension);
87140
+ if (resolvedSrc) {
87141
+ partsChanged = true;
87142
+ return {
87143
+ ...part,
87144
+ src: resolvedSrc
87145
+ };
87146
+ }
87059
87147
  return part;
87060
- const resolvedSrc = resolveImageSrc(part.src, part.rId, undefined, part.extension);
87061
- if (resolvedSrc) {
87062
- partsChanged = true;
87063
- return {
87064
- ...part,
87065
- src: resolvedSrc
87148
+ });
87149
+ if (partsChanged) {
87150
+ blockChanged = true;
87151
+ nextBlock = {
87152
+ ...nextBlock,
87153
+ textContent: {
87154
+ ...nextBlock.textContent,
87155
+ parts: hydratedParts
87156
+ }
87066
87157
  };
87067
87158
  }
87068
- return part;
87069
- });
87070
- if (partsChanged) {
87071
- const vectorShapeBlock = drawingBlock;
87072
- return {
87073
- ...vectorShapeBlock,
87074
- textContent: {
87075
- ...vectorShapeBlock.textContent,
87076
- parts: hydratedParts
87077
- }
87078
- };
87079
87159
  }
87080
- return blk;
87160
+ return blockChanged ? nextBlock : blk;
87081
87161
  }
87082
87162
  if (drawingBlock.drawingKind !== "shapeGroup")
87083
87163
  return blk;
@@ -89242,6 +89322,7 @@ function shapeContainerNodeToDrawingBlock(node2, nextBlockId, positions) {
89242
89322
  const textContent = shapeTextboxNode ? extractTextboxTextContent(shapeTextboxNode) : undefined;
89243
89323
  return buildDrawingBlock({
89244
89324
  ...rawAttrs,
89325
+ ...resolveInlineAlignmentFromWrapper(rawAttrs),
89245
89326
  ...textContent ? { textContent } : {},
89246
89327
  ...rawAttrs.textAlign == null && textContent?.horizontalAlign ? { textAlign: textContent.horizontalAlign } : {},
89247
89328
  ...rawAttrs.textInsets == null ? { textInsets: resolveTextboxInsetsFromAttrs(textboxAttrs) } : {},
@@ -89532,10 +89613,40 @@ function normalizeLegacyBorderStyle(value) {
89532
89613
  return "dotDash";
89533
89614
  case "dotdotdash":
89534
89615
  return "dotDotDash";
89616
+ case "dashsmallgap":
89617
+ return "dashSmallGap";
89618
+ case "thinthicksmallgap":
89619
+ return "thinThickSmallGap";
89620
+ case "thickthinsmallgap":
89621
+ return "thickThinSmallGap";
89622
+ case "thinthickthinsmallgap":
89623
+ return "thinThickThinSmallGap";
89624
+ case "thinthickmediumgap":
89625
+ return "thinThickMediumGap";
89626
+ case "thickthinmediumgap":
89627
+ return "thickThinMediumGap";
89628
+ case "thinthickthinmediumgap":
89629
+ return "thinThickThinMediumGap";
89630
+ case "thinthicklargegap":
89631
+ return "thinThickLargeGap";
89632
+ case "thickthinlargegap":
89633
+ return "thickThinLargeGap";
89634
+ case "thinthickthinlargegap":
89635
+ return "thinThickThinLargeGap";
89535
89636
  case "wave":
89536
89637
  return "wave";
89537
89638
  case "doublewave":
89538
89639
  return "doubleWave";
89640
+ case "dashdotstroked":
89641
+ return "dashDotStroked";
89642
+ case "threedemboss":
89643
+ return "threeDEmboss";
89644
+ case "threedengrave":
89645
+ return "threeDEngrave";
89646
+ case "outset":
89647
+ return "outset";
89648
+ case "inset":
89649
+ return "inset";
89539
89650
  case "single":
89540
89651
  default:
89541
89652
  return "single";
@@ -89646,14 +89757,21 @@ function tableNodeToBlock(node2, { nextBlockId, positions, storyKey, trackedChan
89646
89757
  tableStyleId: effectiveStyleId ?? undefined
89647
89758
  } : undefined;
89648
89759
  const rows = [];
89760
+ const grid = node2.attrs?.grid;
89761
+ const numGridCols = Array.isArray(grid) && grid.length > 0 ? grid.length : undefined;
89762
+ let activeRowSpans = [];
89649
89763
  node2.content.forEach((rowNode, rowIndex) => {
89764
+ const { placements, nextActiveRowSpans } = placeRowCellsOnGrid(rowNode, activeRowSpans);
89765
+ activeRowSpans = nextActiveRowSpans;
89650
89766
  const parsedRow = parseTableRow({
89651
89767
  rowNode,
89652
89768
  rowIndex,
89653
89769
  numRows: node2?.content?.length ?? 1,
89654
89770
  context: parserDeps,
89655
89771
  defaultCellPadding,
89656
- tableProperties: tablePropertiesForCascade
89772
+ tableProperties: tablePropertiesForCascade,
89773
+ cellGridPlacements: placements,
89774
+ numGridCols
89657
89775
  });
89658
89776
  if (parsedRow) {
89659
89777
  if (!shouldHideTrackedNode(parsedRow.attrs?.trackedChange, parserDeps.trackedChangesConfig))
@@ -99361,7 +99479,7 @@ var isRegExp = (value) => {
99361
99479
  return true;
99362
99480
  }, areAttrsEqual = (attrsA = {}, attrsB = {}) => {
99363
99481
  return objectIncludes(attrsA, attrsB);
99364
- }, TrackInsertMarkName = "trackInsert", TrackDeleteMarkName = "trackDelete", TrackFormatMarkName = "trackFormat", TrackedFormatMarkNames, TAB_POSITION_TOLERANCE_TWIPS = 20, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX = 15, isPlainObject$3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, resolveOuterShadowOffset = (shadow) => {
99482
+ }, TrackInsertMarkName = "trackInsert", TrackDeleteMarkName = "trackDelete", TrackFormatMarkName = "trackFormat", TrackedFormatMarkNames, TAB_POSITION_TOLERANCE_TWIPS = 20, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX = 15, PT_075 = 1, PT_150 = 2, COMPOUND_PROFILES, isPlainObject$3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, resolveOuterShadowOffset = (shadow) => {
99365
99483
  const radians = shadow.direction * Math.PI / 180;
99366
99484
  return {
99367
99485
  dx: shadow.distance * Math.cos(radians),
@@ -117461,6 +117579,37 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
117461
117579
  required2.bottom = Math.max(required2.bottom, Math.max(0, childY + childHeight + paintExtent.bottom - height));
117462
117580
  }
117463
117581
  return hasEffectExtent(required2) ? required2 : undefined;
117582
+ }, resolveWrapperAlignment = (justification) => {
117583
+ switch (justification) {
117584
+ case "center":
117585
+ case "distribute":
117586
+ return "center";
117587
+ case "right":
117588
+ case "end":
117589
+ return "right";
117590
+ default:
117591
+ return;
117592
+ }
117593
+ }, resolveInlineAlignmentFromWrapper = (rawAttrs) => {
117594
+ if (rawAttrs.wrap?.type !== "Inline" || !isPlainObject4(rawAttrs.wrapperParagraph))
117595
+ return {};
117596
+ const wrapper = rawAttrs.wrapperParagraph;
117597
+ const justification = (isPlainObject4(wrapper.paragraphProperties) ? wrapper.paragraphProperties : undefined)?.justification;
117598
+ const textAlign = typeof wrapper.textAlign === "string" ? wrapper.textAlign : undefined;
117599
+ const effectiveAlignment = resolveWrapperAlignment(justification) ?? textAlign;
117600
+ if (effectiveAlignment !== "center" && effectiveAlignment !== "right")
117601
+ return {};
117602
+ const metadata = { inlineParagraphAlignment: effectiveAlignment };
117603
+ const { paragraphAttrs } = computeParagraphAttrs({
117604
+ type: "paragraph",
117605
+ attrs: wrapper
117606
+ });
117607
+ const indent2 = paragraphAttrs.indent;
117608
+ if (typeof indent2?.left === "number")
117609
+ metadata.paragraphIndentLeft = indent2.left;
117610
+ if (typeof indent2?.right === "number")
117611
+ metadata.paragraphIndentRight = indent2.right;
117612
+ return metadata;
117464
117613
  }, getAttrs$1 = (node2) => {
117465
117614
  return isPlainObject4(node2.attrs) ? { ...node2.attrs } : {};
117466
117615
  }, parseFullWidth = (value) => {
@@ -117843,6 +117992,39 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
117843
117992
  value: measurement.value,
117844
117993
  type: measurement.type ?? "px"
117845
117994
  };
117995
+ }, placeRowCellsOnGrid = (rowNode, activeRowSpans) => {
117996
+ const placements = [];
117997
+ const nextActiveRowSpans = activeRowSpans.map((count) => Math.max(0, count - 1));
117998
+ let column = 0;
117999
+ const cellSpan = (cellNode) => {
118000
+ const colspan = cellNode.attrs?.colspan;
118001
+ if (typeof colspan === "number" && colspan > 0)
118002
+ return colspan;
118003
+ const colwidth = cellNode.attrs?.colwidth;
118004
+ return Array.isArray(colwidth) && colwidth.length > 0 ? colwidth.length : 1;
118005
+ };
118006
+ for (const cellNode of Array.isArray(rowNode.content) ? rowNode.content : []) {
118007
+ if (!isTableCellNode(cellNode)) {
118008
+ placements.push(null);
118009
+ continue;
118010
+ }
118011
+ while ((activeRowSpans[column] ?? 0) > 0)
118012
+ column += 1;
118013
+ const span = cellSpan(cellNode);
118014
+ placements.push({
118015
+ gridColumnStart: column,
118016
+ gridColumnSpan: span
118017
+ });
118018
+ const rowspan = typeof cellNode.attrs?.rowspan === "number" ? cellNode.attrs.rowspan : 1;
118019
+ if (rowspan > 1)
118020
+ for (let covered = column;covered < column + span; covered += 1)
118021
+ nextActiveRowSpans[covered] = Math.max(nextActiveRowSpans[covered] ?? 0, rowspan - 1);
118022
+ column += span;
118023
+ }
118024
+ return {
118025
+ placements,
118026
+ nextActiveRowSpans
118027
+ };
117846
118028
  }, isTableRowNode = (node2) => node2.type === "tableRow" || node2.type === "table_row", isTableCellNode = (node2) => node2.type === "tableCell" || node2.type === "table_cell" || node2.type === "tableHeader" || node2.type === "table_header", isTableSkipPlaceholderCell = (node2) => {
117847
118029
  const placeholder = node2.attrs?.__placeholder;
117848
118030
  return placeholder === "gridBefore" || placeholder === "gridAfter";
@@ -117885,7 +118067,12 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
117885
118067
  numCells,
117886
118068
  numRows,
117887
118069
  rowCnfStyle,
117888
- cellCnfStyle
118070
+ cellCnfStyle,
118071
+ ...args.gridPlacement != null && args.numGridCols != null ? {
118072
+ gridColumnStart: args.gridPlacement.gridColumnStart,
118073
+ gridColumnSpan: args.gridPlacement.gridColumnSpan,
118074
+ numGridCols: args.numGridCols
118075
+ } : {}
117889
118076
  } : undefined;
117890
118077
  const inlineTcProps = cellNode.attrs?.tableCellProperties;
117891
118078
  const resolvedTcProps = resolveTableCellProperties(inlineTcProps, tableInfo, context.converterContext?.translatedLinkedStyles);
@@ -118176,7 +118363,9 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
118176
118363
  tableProperties,
118177
118364
  numCells: rowNode?.content?.length || 1,
118178
118365
  numRows,
118179
- rowCnfStyle
118366
+ rowCnfStyle,
118367
+ gridPlacement: args.cellGridPlacements?.[cellIndex] ?? null,
118368
+ numGridCols: args.numGridCols
118180
118369
  });
118181
118370
  if (parsedCell)
118182
118371
  cells.push(parsedCell);
@@ -118763,7 +118952,7 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
118763
118952
  state.kern = kernNode.attributes["w:val"];
118764
118953
  }
118765
118954
  }, SuperConverter;
118766
- var init_SuperConverter_DRKaQwZS_es = __esm(() => {
118955
+ var init_SuperConverter_Ed3nFN54_es = __esm(() => {
118767
118956
  init_rolldown_runtime_Bg48TavK_es();
118768
118957
  init_jszip_C49i9kUs_es();
118769
118958
  init_xml_js_CqGKpaft_es();
@@ -123209,6 +123398,71 @@ var init_SuperConverter_DRKaQwZS_es = __esm(() => {
123209
123398
  "highlight",
123210
123399
  "link"
123211
123400
  ];
123401
+ COMPOUND_PROFILES = {
123402
+ double: (w) => [
123403
+ w,
123404
+ w,
123405
+ w
123406
+ ],
123407
+ triple: (w) => [
123408
+ w,
123409
+ w,
123410
+ w,
123411
+ w,
123412
+ w
123413
+ ],
123414
+ thinThickSmallGap: (w) => [
123415
+ w,
123416
+ PT_075,
123417
+ PT_075
123418
+ ],
123419
+ thickThinSmallGap: (w) => [
123420
+ PT_075,
123421
+ PT_075,
123422
+ w
123423
+ ],
123424
+ thinThickMediumGap: (w) => [
123425
+ w,
123426
+ w / 2,
123427
+ w / 2
123428
+ ],
123429
+ thickThinMediumGap: (w) => [
123430
+ w / 2,
123431
+ w / 2,
123432
+ w
123433
+ ],
123434
+ thinThickLargeGap: (w) => [
123435
+ PT_150,
123436
+ w,
123437
+ PT_075
123438
+ ],
123439
+ thickThinLargeGap: (w) => [
123440
+ PT_075,
123441
+ w,
123442
+ PT_150
123443
+ ],
123444
+ thinThickThinSmallGap: (w) => [
123445
+ PT_075,
123446
+ PT_075,
123447
+ w,
123448
+ PT_075,
123449
+ PT_075
123450
+ ],
123451
+ thinThickThinMediumGap: (w) => [
123452
+ w / 2,
123453
+ w / 2,
123454
+ w,
123455
+ w / 2,
123456
+ w / 2
123457
+ ],
123458
+ thinThickThinLargeGap: (w) => [
123459
+ PT_075,
123460
+ w,
123461
+ PT_150,
123462
+ w,
123463
+ PT_075
123464
+ ]
123465
+ };
123212
123466
  SPACE_CHARS = new Set([" ", " "]);
123213
123467
  idlessSdtContainerKeys = /* @__PURE__ */ new WeakMap;
123214
123468
  DRAWING_DIAGNOSTIC_CODES = {
@@ -146034,13 +146288,28 @@ var init_SuperConverter_DRKaQwZS_es = __esm(() => {
146034
146288
  "single",
146035
146289
  "double",
146036
146290
  "dashed",
146291
+ "dashSmallGap",
146037
146292
  "dotted",
146038
146293
  "thick",
146039
146294
  "triple",
146040
146295
  "dotDash",
146041
146296
  "dotDotDash",
146297
+ "thinThickSmallGap",
146298
+ "thickThinSmallGap",
146299
+ "thinThickThinSmallGap",
146300
+ "thinThickMediumGap",
146301
+ "thickThinMediumGap",
146302
+ "thinThickThinMediumGap",
146303
+ "thinThickLargeGap",
146304
+ "thickThinLargeGap",
146305
+ "thinThickThinLargeGap",
146042
146306
  "wave",
146043
- "doubleWave"
146307
+ "doubleWave",
146308
+ "dashDotStroked",
146309
+ "threeDEmboss",
146310
+ "threeDEngrave",
146311
+ "outset",
146312
+ "inset"
146044
146313
  ]);
146045
146314
  FONT_FAMILY_FALLBACKS$1 = Object.freeze({
146046
146315
  swiss: "Arial, sans-serif",
@@ -147689,7 +147958,7 @@ var init_SuperConverter_DRKaQwZS_es = __esm(() => {
147689
147958
  };
147690
147959
  });
147691
147960
 
147692
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-ChACxHAH.es.js
147961
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-PSeH6IV5.es.js
147693
147962
  function parseSizeUnit(val = "0") {
147694
147963
  const length = val.toString() || "0";
147695
147964
  const value = Number.parseFloat(length);
@@ -158492,9 +158761,9 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, MARK_KEYS, STEP_OP_CATALOG_UNFROZEN, PU
158492
158761
  }
158493
158762
  };
158494
158763
  };
158495
- var init_create_headless_toolbar_ChACxHAH_es = __esm(() => {
158764
+ var init_create_headless_toolbar_PSeH6IV5_es = __esm(() => {
158496
158765
  init_rolldown_runtime_Bg48TavK_es();
158497
- init_SuperConverter_DRKaQwZS_es();
158766
+ init_SuperConverter_Ed3nFN54_es();
158498
158767
  init_jszip_C49i9kUs_es();
158499
158768
  init_uuid_B2wVPhPi_es();
158500
158769
  init_constants_D9qj59G2_es();
@@ -214108,7 +214377,7 @@ var init_remark_gfm_DCND_V_3_es = __esm(() => {
214108
214377
  init_remark_gfm_BUJjZJLy_es();
214109
214378
  });
214110
214379
 
214111
- // ../../packages/superdoc/dist/chunks/src-ly1ZYfUZ.es.js
214380
+ // ../../packages/superdoc/dist/chunks/src-bMRzO9Kl.es.js
214112
214381
  function deleteProps(obj, propOrProps) {
214113
214382
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
214114
214383
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -218953,6 +219222,12 @@ function updateTableWrapper(tableWrapper, table2) {
218953
219222
  borderWidth = Math.ceil(Math.max(borderLeftMax, borderRightMax));
218954
219223
  tableWrapper.style.setProperty("--table-border-width", `${borderWidth || defaultBorderWidth}px`);
218955
219224
  }
219225
+ function cellWidthDxa(widthPx) {
219226
+ return {
219227
+ value: widthPx * 15,
219228
+ type: "dxa"
219229
+ };
219230
+ }
218956
219231
  function cloneBorders(borders, sides) {
218957
219232
  if (!borders || typeof borders !== "object")
218958
219233
  return {};
@@ -257996,6 +258271,19 @@ function countHeaderRows(block) {
257996
258271
  break;
257997
258272
  return count;
257998
258273
  }
258274
+ function countRepeatableHeaderRows(block) {
258275
+ const headerCount = countHeaderRows(block);
258276
+ if (headerCount === 0)
258277
+ return 0;
258278
+ let bandEnd = headerCount;
258279
+ for (let r$1 = 0;r$1 < headerCount && r$1 < block.rows.length; r$1++)
258280
+ for (const cell2 of block.rows[r$1]?.cells ?? []) {
258281
+ const rowSpan = cell2.rowSpan ?? 1;
258282
+ if (rowSpan > 1)
258283
+ bandEnd = Math.max(bandEnd, r$1 + rowSpan);
258284
+ }
258285
+ return Math.min(bandEnd, block.rows.length);
258286
+ }
257999
258287
  function sumRowHeights(rows, fromRow, toRow) {
258000
258288
  let total = 0;
258001
258289
  for (let i3 = fromRow;i3 < toRow && i3 < rows.length; i3++)
@@ -258380,7 +258668,7 @@ function layoutTableBlock({ block, measure, columnWidth, ensurePage, advanceColu
258380
258668
  });
258381
258669
  return;
258382
258670
  }
258383
- const headerCount = countHeaderRows(block);
258671
+ const headerCount = countRepeatableHeaderRows(block);
258384
258672
  const headerPrefixHeights = [0];
258385
258673
  for (let i3 = 0;i3 < headerCount; i3 += 1)
258386
258674
  headerPrefixHeights.push(headerPrefixHeights[i3] + (measure.rows[i3]?.height ?? 0));
@@ -259279,7 +259567,7 @@ function layoutDrawingBlock({ block, measure, columns, ensurePage, advanceColumn
259279
259567
  const indentRight = typeof attrs?.hrIndentRight === "number" ? attrs.hrIndentRight : 0;
259280
259568
  const maxWidthForBlock = attrs?.isFullWidth === true && maxWidth > 0 ? Math.max(1, maxWidth - indentLeft - indentRight) : maxWidth;
259281
259569
  const rawWrap = attrs?.wrap;
259282
- const isInlineShapeGroup = block.drawingKind === "shapeGroup" && rawWrap?.type === "Inline";
259570
+ const isInlineAlignableDrawing = (block.drawingKind === "shapeGroup" || block.drawingKind === "textboxShape") && rawWrap?.type === "Inline";
259283
259571
  const inlineParagraphAlignment = attrs?.inlineParagraphAlignment === "center" || attrs?.inlineParagraphAlignment === "right" ? attrs.inlineParagraphAlignment : undefined;
259284
259572
  if (width > maxWidthForBlock && maxWidthForBlock > 0) {
259285
259573
  const scale = maxWidthForBlock / width;
@@ -259298,7 +259586,7 @@ function layoutDrawingBlock({ block, measure, columns, ensurePage, advanceColumn
259298
259586
  state = advanceColumn(state);
259299
259587
  const pmRange = extractBlockPmRange(block);
259300
259588
  let x = columnX(state) + marginLeft + indentLeft;
259301
- if (isInlineShapeGroup && inlineParagraphAlignment) {
259589
+ if (isInlineAlignableDrawing && inlineParagraphAlignment) {
259302
259590
  const pIndentLeft = typeof attrs?.paragraphIndentLeft === "number" ? attrs.paragraphIndentLeft : 0;
259303
259591
  const pIndentRight = typeof attrs?.paragraphIndentRight === "number" ? attrs.paragraphIndentRight : 0;
259304
259592
  const alignBox = Math.max(0, maxWidthForBlock - pIndentLeft - pIndentRight);
@@ -263623,6 +263911,17 @@ function remeasureParagraph(block, maxWidth, firstLineIndent = 0) {
263623
263911
  endChar = text5.length > 0 ? text5.length : start$1 + 1;
263624
263912
  continue;
263625
263913
  }
263914
+ if (text5.length === 0 && isAtomicLayoutRun(run2)) {
263915
+ const atomicWidth = getAtomicRunLayoutWidth(run2);
263916
+ if (width > 0 && width + atomicWidth > effectiveMaxWidth - WIDTH_FUDGE_PX) {
263917
+ didBreakInThisLine = true;
263918
+ break;
263919
+ }
263920
+ width += atomicWidth;
263921
+ endRun = r$1;
263922
+ endChar = 1;
263923
+ continue;
263924
+ }
263626
263925
  for (let c = start$1;c < text5.length; c += 1) {
263627
263926
  const ch = text5[c];
263628
263927
  if (ch === "\t") {
@@ -263711,6 +264010,7 @@ function remeasureParagraph(block, maxWidth, firstLineIndent = 0) {
263711
264010
  endRun = startRun;
263712
264011
  endChar = startChar + 1;
263713
264012
  }
264013
+ const lineMaxAtomicHeight = getLineMaxAtomicHeight(runs2, startRun, startChar, endRun, endChar);
263714
264014
  const line = {
263715
264015
  fromRun: startRun,
263716
264016
  fromChar: startChar,
@@ -263719,8 +264019,9 @@ function remeasureParagraph(block, maxWidth, firstLineIndent = 0) {
263719
264019
  width,
263720
264020
  ascent: 0,
263721
264021
  descent: 0,
263722
- lineHeight: lineHeightForRuns(runs2, startRun, endRun, lastMeasuredFontSize),
263723
- maxWidth: effectiveMaxWidth
264022
+ lineHeight: Math.max(lineHeightForRuns(runs2, startRun, endRun, lastMeasuredFontSize), lineMaxAtomicHeight),
264023
+ maxWidth: effectiveMaxWidth,
264024
+ ...lineMaxAtomicHeight > 0 ? { maxImageHeight: lineMaxAtomicHeight } : {}
263724
264025
  };
263725
264026
  lines.push(line);
263726
264027
  if (lineMaxTextFontSize > 0)
@@ -271172,12 +271473,14 @@ function computeAutoFitColumnWidths(input2) {
271172
271473
  const currentWidths = fixedLayout.columnWidths.slice(0, gridColumnCount);
271173
271474
  const minBounds = new Array(gridColumnCount).fill(0);
271174
271475
  const maxBounds = new Array(gridColumnCount).fill(0);
271476
+ const textBounds = new Array(gridColumnCount).fill(0);
271175
271477
  const preferredOverrides = new Array(gridColumnCount).fill(undefined);
271176
271478
  const multiSpanCells = [];
271177
271479
  accumulateBounds({
271178
271480
  rows: normalizedRows,
271179
271481
  minBounds,
271180
271482
  maxBounds,
271483
+ textBounds,
271181
271484
  preferredOverrides,
271182
271485
  multiSpanCells
271183
271486
  });
@@ -271200,7 +271503,26 @@ function computeAutoFitColumnWidths(input2) {
271200
271503
  targetTableWidth = Math.min(targetTableWidth, maxResolvedTableWidth);
271201
271504
  } else {
271202
271505
  targetTableWidth = Math.min(targetTableWidth, maxResolvedTableWidth);
271203
- if (!shouldPreservePreferredGrid) {
271506
+ if (workingInput.contentSizeAutoTable === true) {
271507
+ const columnBandAllowances = workingInput.columnBandAllowances;
271508
+ resolvedWidths = maxBounds.map((max$2, index2) => {
271509
+ const allowance = columnBandAllowances?.[index2] ?? 0;
271510
+ const withAllowance = Math.max(max$2, minBounds[index2]) + allowance;
271511
+ const textFloor = textBounds[index2] + allowance * 2;
271512
+ return Math.max(withAllowance, textFloor);
271513
+ });
271514
+ for (const spanCell of multiSpanCells) {
271515
+ const covered = resolvedWidths.slice(spanCell.startColumn, spanCell.startColumn + spanCell.span);
271516
+ const currentTotal = sumWidths$1(covered);
271517
+ const demand = spanCell.preferredWidth ?? spanCell.maxContentWidth;
271518
+ if (currentTotal < demand && covered.length > 0) {
271519
+ const topUp = (demand - currentTotal) / covered.length;
271520
+ for (let index2 = 0;index2 < covered.length; index2++)
271521
+ resolvedWidths[spanCell.startColumn + index2] += topUp;
271522
+ }
271523
+ }
271524
+ targetTableWidth = Math.min(sumWidths$1(resolvedWidths), maxResolvedTableWidth);
271525
+ } else if (!shouldPreservePreferredGrid) {
271204
271526
  resolvedWidths = redistributeTowardMaximumsWithinCurrentTable(resolvedWidths, minBounds, maxBounds);
271205
271527
  resolvedWidths = redistributeTowardContentWeightedShape(resolvedWidths, minBounds, maxBounds);
271206
271528
  }
@@ -271262,7 +271584,8 @@ function resolveAutoFitContext(input2) {
271262
271584
  span: cell2.span,
271263
271585
  preferredWidth: cell2.preferredWidth,
271264
271586
  minContentWidth: cell2.minContentWidth,
271265
- maxContentWidth: cell2.maxContentWidth
271587
+ maxContentWidth: cell2.maxContentWidth,
271588
+ horizontalInsets: cell2.horizontalInsets
271266
271589
  }))
271267
271590
  })),
271268
271591
  minColumnWidth
@@ -271295,7 +271618,8 @@ function normalizeLegacyRows(rows) {
271295
271618
  span,
271296
271619
  preferredWidth: sanitizeOptionalWidth(cell2.preferredWidth),
271297
271620
  minContentWidth: Math.max(0, cell2.minContentWidth ?? 0),
271298
- maxContentWidth: Math.max(0, cell2.maxContentWidth ?? cell2.minContentWidth ?? 0)
271621
+ maxContentWidth: Math.max(0, cell2.maxContentWidth ?? cell2.minContentWidth ?? 0),
271622
+ horizontalInsets: Math.max(0, cell2.horizontalInsets ?? 0)
271299
271623
  });
271300
271624
  columnIndex += span;
271301
271625
  }
@@ -271332,7 +271656,8 @@ function buildNormalizedRows(workingInput, rowMetrics) {
271332
271656
  span: Math.max(1, placedCell.span ?? metrics?.span ?? 1),
271333
271657
  preferredWidth: sanitizeOptionalWidth(metrics?.preferredWidth ?? placedCell.preferredWidth),
271334
271658
  minContentWidth: Math.max(0, metrics?.minContentWidth ?? 0),
271335
- maxContentWidth: Math.max(0, metrics?.maxContentWidth ?? metrics?.minContentWidth ?? 0)
271659
+ maxContentWidth: Math.max(0, metrics?.maxContentWidth ?? metrics?.minContentWidth ?? 0),
271660
+ horizontalInsets: Math.max(0, metrics?.horizontalInsets ?? 0)
271336
271661
  };
271337
271662
  }),
271338
271663
  skippedColumns: (workingRow.skippedColumns ?? []).map((skipped) => ({
@@ -271346,7 +271671,7 @@ function buildNormalizedRows(workingInput, rowMetrics) {
271346
271671
  });
271347
271672
  }
271348
271673
  function accumulateBounds(args$1) {
271349
- const { rows, minBounds, maxBounds, preferredOverrides, multiSpanCells } = args$1;
271674
+ const { rows, minBounds, maxBounds, textBounds, preferredOverrides, multiSpanCells } = args$1;
271350
271675
  for (const row2 of rows) {
271351
271676
  for (const skipped of row2.skippedColumns) {
271352
271677
  minBounds[skipped.columnIndex] = Math.max(minBounds[skipped.columnIndex], skipped.minContentWidth);
@@ -271358,6 +271683,7 @@ function accumulateBounds(args$1) {
271358
271683
  if (cell2.span === 1) {
271359
271684
  minBounds[cell2.startColumn] = Math.max(minBounds[cell2.startColumn], cell2.minContentWidth);
271360
271685
  maxBounds[cell2.startColumn] = Math.max(maxBounds[cell2.startColumn], cell2.maxContentWidth);
271686
+ textBounds[cell2.startColumn] = Math.max(textBounds[cell2.startColumn], Math.max(0, cell2.maxContentWidth - cell2.horizontalInsets));
271361
271687
  if (preferredOverrides[cell2.startColumn] == null && cell2.preferredWidth != null)
271362
271688
  preferredOverrides[cell2.startColumn] = cell2.preferredWidth;
271363
271689
  } else
@@ -271801,16 +272127,29 @@ function buildAutoFitWorkingGridInput(block, constraints) {
271801
272127
  layoutMode,
271802
272128
  preferredColumnWidths,
271803
272129
  preferredTableWidth,
271804
- gridColumnCount
272130
+ gridColumnCount,
272131
+ rows
271805
272132
  });
271806
272133
  const preserveExplicitAutoGrid = shouldPreserveExplicitAutoGrid({
271807
272134
  layoutMode,
272135
+ tableWidth,
271808
272136
  preferredColumnWidths,
271809
272137
  preferredTableWidth,
271810
272138
  gridColumnCount,
271811
272139
  rows
271812
272140
  });
271813
- const autoGridWidthBudget = resolveAutoGridWidthBudget({
272141
+ const contentSizeAutoTable = resolveContentSizeAutoTable({
272142
+ layoutMode,
272143
+ tableWidth,
272144
+ preferredTableWidth,
272145
+ preferredColumnWidths,
272146
+ maxTableWidth,
272147
+ rows,
272148
+ preserveAutoGrid,
272149
+ preserveExplicitAutoGrid
272150
+ });
272151
+ const columnBandAllowances = contentSizeAutoTable ? resolveColumnBandAllowances(block.attrs?.borders, gridColumnCount) : undefined;
272152
+ const autoGridWidthBudget = contentSizeAutoTable ? undefined : resolveAutoGridWidthBudget({
271814
272153
  layoutMode,
271815
272154
  tableWidth,
271816
272155
  preferredColumnWidths,
@@ -271825,6 +272164,8 @@ function buildAutoFitWorkingGridInput(block, constraints) {
271825
272164
  ...preserveAutoGrid ? { preserveAutoGrid } : {},
271826
272165
  ...preserveExplicitAutoGrid ? { preserveExplicitAutoGrid } : {},
271827
272166
  ...autoGridWidthBudget != null ? { autoGridWidthBudget } : {},
272167
+ ...contentSizeAutoTable ? { contentSizeAutoTable } : {},
272168
+ ...columnBandAllowances ? { columnBandAllowances } : {},
271828
272169
  preferredTableWidth,
271829
272170
  preferredColumnWidths,
271830
272171
  gridColumnCount,
@@ -271846,19 +272187,21 @@ function shouldPreserveAuthoredGrid(args$1) {
271846
272187
  return approximatelyEqual(totalPreferredColumnWidth, preferredTableWidth) || isSlightlyUnderPreferredTableWidth(totalPreferredColumnWidth, preferredTableWidth);
271847
272188
  }
271848
272189
  function shouldPreserveAutoGrid(args$1) {
271849
- const { layoutMode, preferredColumnWidths, preferredTableWidth, gridColumnCount } = args$1;
272190
+ const { layoutMode, preferredColumnWidths, preferredTableWidth, gridColumnCount, rows } = args$1;
271850
272191
  if (layoutMode !== "autofit")
271851
272192
  return false;
271852
272193
  if (preferredTableWidth != null)
271853
272194
  return false;
271854
272195
  if (preferredColumnWidths.length === 0 || preferredColumnWidths.length !== gridColumnCount)
271855
272196
  return false;
272197
+ if (preferredColumnWidths.length === 1 && !hasConcreteCellWidthRequest(rows))
272198
+ return false;
271856
272199
  if (!hasNonUniformGrid(preferredColumnWidths))
271857
272200
  return false;
271858
272201
  return true;
271859
272202
  }
271860
272203
  function shouldPreserveExplicitAutoGrid(args$1) {
271861
- const { layoutMode, preferredColumnWidths, preferredTableWidth, gridColumnCount, rows } = args$1;
272204
+ const { layoutMode, tableWidth, preferredColumnWidths, preferredTableWidth, gridColumnCount, rows } = args$1;
271862
272205
  if (layoutMode !== "autofit")
271863
272206
  return false;
271864
272207
  if (preferredTableWidth == null || preferredTableWidth <= 0)
@@ -271867,8 +272210,52 @@ function shouldPreserveExplicitAutoGrid(args$1) {
271867
272210
  return false;
271868
272211
  if (!hasNonUniformGrid(preferredColumnWidths) && !hasConcreteCellWidthRequest(rows))
271869
272212
  return false;
272213
+ if (isPercentTableWidth(tableWidth))
272214
+ return true;
271870
272215
  return approximatelyEqual(sumWidths(preferredColumnWidths), preferredTableWidth);
271871
272216
  }
272217
+ function isPercentTableWidth(tableWidth) {
272218
+ return typeof tableWidth === "object" && tableWidth != null && typeof tableWidth.type === "string" && tableWidth.type.toLowerCase() === "pct";
272219
+ }
272220
+ function resolveContentSizeAutoTable(args$1) {
272221
+ const { layoutMode, tableWidth, preferredTableWidth, preferredColumnWidths, maxTableWidth, rows, preserveAutoGrid, preserveExplicitAutoGrid } = args$1;
272222
+ if (layoutMode !== "autofit")
272223
+ return false;
272224
+ if (preferredTableWidth != null)
272225
+ return false;
272226
+ if (preserveAutoGrid || preserveExplicitAutoGrid)
272227
+ return false;
272228
+ if (!isAutoOrNilTableWidth(tableWidth))
272229
+ return false;
272230
+ if (hasConcreteCellWidthRequest(rows))
272231
+ return false;
272232
+ if (sumWidths(preferredColumnWidths) > maxTableWidth + 0.5)
272233
+ return false;
272234
+ return true;
272235
+ }
272236
+ function isAutoOrNilTableWidth(tableWidth) {
272237
+ if (tableWidth == null)
272238
+ return true;
272239
+ if (hasAutoTableWidthSemantics(tableWidth))
272240
+ return true;
272241
+ if (typeof tableWidth === "object" && typeof tableWidth.type === "string")
272242
+ return tableWidth.type.toLowerCase() === "nil";
272243
+ return false;
272244
+ }
272245
+ function resolveColumnBandAllowances(borders, gridColumnCount) {
272246
+ if (gridColumnCount <= 0)
272247
+ return;
272248
+ const left$1 = getBorderBandWidthPx(borders?.left);
272249
+ const insideV = getBorderBandWidthPx(borders?.insideV);
272250
+ const right$1 = getBorderBandWidthPx(borders?.right);
272251
+ const allowances = [];
272252
+ for (let i3 = 0;i3 < gridColumnCount; i3++) {
272253
+ const edgeLeft = i3 === 0 ? left$1 : insideV;
272254
+ const edgeRight = i3 === gridColumnCount - 1 ? right$1 : insideV;
272255
+ allowances.push((edgeLeft + edgeRight) / 2);
272256
+ }
272257
+ return allowances.some((a2) => a2 > 0) ? allowances : undefined;
272258
+ }
271872
272259
  function resolveAutoGridWidthBudget(args$1) {
271873
272260
  const { layoutMode, tableWidth, preferredColumnWidths, preferredTableWidth, gridColumnCount, maxTableWidth } = args$1;
271874
272261
  if (layoutMode !== "autofit")
@@ -272169,7 +272556,8 @@ async function measureTableCellContentMetrics(cell2, options) {
272169
272556
  if (contentBlocks.length === 0) {
272170
272557
  const emptyMetrics = {
272171
272558
  minWidthPx: horizontalInsets,
272172
- maxWidthPx: horizontalInsets
272559
+ maxWidthPx: horizontalInsets,
272560
+ horizontalInsetsPx: horizontalInsets
272173
272561
  };
272174
272562
  tableCellMetricsCache.set(cacheKey, emptyMetrics);
272175
272563
  return emptyMetrics;
@@ -272183,7 +272571,8 @@ async function measureTableCellContentMetrics(cell2, options) {
272183
272571
  }
272184
272572
  const result = {
272185
272573
  minWidthPx: minContentWidthPx + horizontalInsets,
272186
- maxWidthPx: maxContentWidthPx + horizontalInsets
272574
+ maxWidthPx: maxContentWidthPx + horizontalInsets,
272575
+ horizontalInsetsPx: horizontalInsets
272187
272576
  };
272188
272577
  tableCellMetricsCache.set(cacheKey, result);
272189
272578
  return result;
@@ -272213,7 +272602,8 @@ async function measureTableAutoFitContentMetrics(table2, workingInput, fixedLayo
272213
272602
  span,
272214
272603
  preferredWidth: normalizedCell?.preferredWidth,
272215
272604
  minContentWidth: metrics.minWidthPx,
272216
- maxContentWidth: metrics.maxWidthPx
272605
+ maxContentWidth: metrics.maxWidthPx,
272606
+ horizontalInsets: metrics.horizontalInsetsPx
272217
272607
  };
272218
272608
  }))
272219
272609
  };
@@ -272228,7 +272618,8 @@ async function measureTableAutoFitContentMetrics(table2, workingInput, fixedLayo
272228
272618
  span: cellMetrics.span,
272229
272619
  preferredWidth: cellMetrics.preferredWidth,
272230
272620
  minContentWidth: cellMetrics.minContentWidth,
272231
- maxContentWidth: cellMetrics.maxContentWidth
272621
+ maxContentWidth: cellMetrics.maxContentWidth,
272622
+ horizontalInsets: cellMetrics.horizontalInsets
272232
272623
  })),
272233
272624
  skippedAfter: normalizedRow.skippedAfter ?? []
272234
272625
  };
@@ -272432,14 +272823,14 @@ function capitalizeText$1(text5, fullText, startOffset) {
272432
272823
  return result;
272433
272824
  }
272434
272825
  function measureFieldAnnotationWidth(run2, fontContext) {
272435
- const fontSize = typeof run2.fontSize === "number" ? run2.fontSize : typeof run2.fontSize === "string" ? parseFloat(run2.fontSize) || DEFAULT_FIELD_ANNOTATION_FONT_SIZE$1 : DEFAULT_FIELD_ANNOTATION_FONT_SIZE$1;
272826
+ const fontSize = typeof run2.fontSize === "number" ? run2.fontSize : typeof run2.fontSize === "string" ? parseFloat(run2.fontSize) || DEFAULT_FIELD_ANNOTATION_FONT_SIZE : DEFAULT_FIELD_ANNOTATION_FONT_SIZE;
272436
272827
  const font = buildFontString$1({
272437
272828
  fontFamily: normalizeFontFamily$1(run2.fontFamily ?? "Arial"),
272438
272829
  fontSize,
272439
272830
  bold: run2.bold,
272440
272831
  italic: run2.italic
272441
272832
  }, fontContext);
272442
- return getMeasuredTextWidth(applyTextTransform$1(run2.displayLabel || "", { text: run2.displayLabel || "" }), font, 0, getCanvasContext$1()) + (run2.highlighted === false ? 0 : FIELD_ANNOTATION_PILL_PADDING$1);
272833
+ return getMeasuredTextWidth(applyTextTransform$1(run2.displayLabel || "", { text: run2.displayLabel || "" }), font, 0, getCanvasContext$1()) + (run2.highlighted === false ? 0 : FIELD_ANNOTATION_PILL_PADDING);
272443
272834
  }
272444
272835
  function isExplicitLineBreakRun(run2) {
272445
272836
  return run2.kind === "lineBreak" || run2.kind === "break" && run2.breakType === "line";
@@ -272480,18 +272871,7 @@ function clearTextMeasurementCaches() {
272480
272871
  canvasContext = null;
272481
272872
  }
272482
272873
  function getTableBorderWidthPx(value) {
272483
- if (value == null)
272484
- return 0;
272485
- if (typeof value === "object" && "none" in value && value.none)
272486
- return 0;
272487
- const raw = value;
272488
- const w = typeof raw.width === "number" ? raw.width : typeof raw.size === "number" ? raw.size : 1;
272489
- const width = Math.max(0, w);
272490
- if (raw.style === "none")
272491
- return 0;
272492
- if (raw.style === "thick")
272493
- return Math.max(width * 2, 3);
272494
- return width;
272874
+ return getBorderBandWidthPx(value);
272495
272875
  }
272496
272876
  function getTableBorderWidths(borders) {
272497
272877
  return {
@@ -272625,6 +273005,15 @@ function measureTabAlignmentGroup(startRunIndex, runs2, ctx$1, decimalSeparator
272625
273005
  endRunIndex: runs2.length
272626
273006
  };
272627
273007
  let foundDecimal = false;
273008
+ const measureAtomicText$1 = (text5, atomicRun, fontSize) => {
273009
+ const { font } = buildFontString({
273010
+ fontFamily: atomicRun.fontFamily ?? "Arial",
273011
+ fontSize,
273012
+ bold: atomicRun.bold,
273013
+ italic: atomicRun.italic
273014
+ }, fontContext);
273015
+ return measureRunWidth(text5, font, ctx$1, atomicRun, 0);
273016
+ };
272628
273017
  for (let i3 = startRunIndex;i3 < runs2.length; i3++) {
272629
273018
  const run2 = runs2[i3];
272630
273019
  if (isTabRun(run2)) {
@@ -272666,40 +273055,13 @@ function measureTabAlignmentGroup(startRunIndex, runs2, ctx$1, decimalSeparator
272666
273055
  });
272667
273056
  continue;
272668
273057
  }
272669
- if (isImageRun(run2)) {
272670
- const leftSpace = run2.distLeft ?? 0;
272671
- const rightSpace = run2.distRight ?? 0;
272672
- const imageWidth = run2.width + leftSpace + rightSpace;
273058
+ if (isImageRun(run2) || run2.kind === "math" || isFieldAnnotationRun(run2)) {
273059
+ const { width } = getAtomicRunLayoutSize(run2, measureAtomicText$1);
272673
273060
  result.runs.push({
272674
273061
  runIndex: i3,
272675
- width: imageWidth
272676
- });
272677
- result.totalWidth += imageWidth;
272678
- continue;
272679
- }
272680
- if (run2.kind === "math") {
272681
- const mathWidth = run2.width ?? 20;
272682
- result.runs.push({
272683
- runIndex: i3,
272684
- width: mathWidth
272685
- });
272686
- result.totalWidth += mathWidth;
272687
- continue;
272688
- }
272689
- if (isFieldAnnotationRun(run2)) {
272690
- const fontSize = run2.fontSize ?? DEFAULT_FIELD_ANNOTATION_FONT_SIZE;
272691
- const { font } = buildFontString({
272692
- fontFamily: run2.fontFamily ?? "Arial",
272693
- fontSize,
272694
- bold: run2.bold,
272695
- italic: run2.italic
272696
- }, fontContext);
272697
- const pillWidth = (run2.displayLabel ? measureRunWidth(run2.displayLabel, font, ctx$1, run2, 0) : 0) + FIELD_ANNOTATION_PILL_PADDING;
272698
- result.runs.push({
272699
- runIndex: i3,
272700
- width: pillWidth
273062
+ width
272701
273063
  });
272702
- result.totalWidth += pillWidth;
273064
+ result.totalWidth += width;
272703
273065
  continue;
272704
273066
  }
272705
273067
  result.runs.push({
@@ -272729,6 +273091,13 @@ async function measureBlock(block, constraints, fontContext = DEFAULT_FONT_MEASU
272729
273091
  }
272730
273092
  async function measureParagraphBlock(block, maxWidth, fontContext) {
272731
273093
  const ctx$1 = getCanvasContext();
273094
+ const measureAtomicText$1 = (text5, run2, fontSize) => {
273095
+ const family2 = fontContext.resolvePhysical(run2.fontFamily || "Arial, sans-serif", faceOf(run2));
273096
+ const weight = run2.bold ? "bold" : "normal";
273097
+ ctx$1.font = `${run2.italic ? "italic" : "normal"} ${weight} ${fontSize}px ${family2}`;
273098
+ const displayText = applyTextTransform(text5, run2);
273099
+ return displayText ? ctx$1.measureText(displayText).width : 0;
273100
+ };
272732
273101
  const wordLayout = block.attrs?.wordLayout;
272733
273102
  const firstTextRunWithSize = block.runs.find((run2) => isTextRun$22(run2) && ("fontSize" in run2) && run2.fontSize != null);
272734
273103
  const fallbackFontSize = normalizeFontSize2((firstTextRunWithSize ?? block.runs.find((run2) => typeof run2.fontSize === "number" && run2.fontSize > 0))?.fontSize, DEFAULT_PARAGRAPH_FONT_SIZE);
@@ -273258,12 +273627,7 @@ async function measureParagraphBlock(block, maxWidth, fontContext) {
273258
273627
  continue;
273259
273628
  }
273260
273629
  if (isImageRun(run2)) {
273261
- const leftSpace = run2.distLeft ?? 0;
273262
- const rightSpace = run2.distRight ?? 0;
273263
- const imageWidth = run2.width + leftSpace + rightSpace;
273264
- const topSpace = run2.distTop ?? 0;
273265
- const bottomSpace = run2.distBottom ?? 0;
273266
- const imageHeight = run2.height + topSpace + bottomSpace;
273630
+ const { width: imageWidth, height: imageHeight } = getAtomicRunLayoutSize(run2, measureAtomicText$1);
273267
273631
  let imageStartX;
273268
273632
  if (activeTabGroup && currentLine) {
273269
273633
  imageStartX = activeTabGroup.currentX;
@@ -273354,9 +273718,7 @@ async function measureParagraphBlock(block, maxWidth, fontContext) {
273354
273718
  continue;
273355
273719
  }
273356
273720
  if (run2.kind === "math") {
273357
- const mathRun = run2;
273358
- const mathWidth = mathRun.width ?? 20;
273359
- const mathHeight = mathRun.height ?? 24;
273721
+ const { width: mathWidth, height: mathHeight } = getAtomicRunLayoutSize(run2, measureAtomicText$1);
273360
273722
  if (!currentLine)
273361
273723
  currentLine = {
273362
273724
  fromRun: runIndex,
@@ -273393,26 +273755,7 @@ async function measureParagraphBlock(block, maxWidth, fontContext) {
273393
273755
  continue;
273394
273756
  }
273395
273757
  if (isFieldAnnotationRun(run2)) {
273396
- const displayText = applyTextTransform(run2.displayLabel || "", run2);
273397
- const annotationFontSize = typeof run2.fontSize === "number" ? run2.fontSize : typeof run2.fontSize === "string" ? parseFloat(run2.fontSize) || DEFAULT_FIELD_ANNOTATION_FONT_SIZE : DEFAULT_FIELD_ANNOTATION_FONT_SIZE;
273398
- const annotationFontFamily = fontContext.resolvePhysical(run2.fontFamily || "Arial, sans-serif", faceOf(run2));
273399
- const fontWeight = run2.bold ? "bold" : "normal";
273400
- ctx$1.font = `${run2.italic ? "italic" : "normal"} ${fontWeight} ${annotationFontSize}px ${annotationFontFamily}`;
273401
- const textWidth = displayText ? ctx$1.measureText(displayText).width : 0;
273402
- const annotationHorizontalPadding = run2.highlighted === false ? 0 : FIELD_ANNOTATION_PILL_PADDING;
273403
- const annotationVerticalPadding = run2.highlighted === false ? 0 : FIELD_ANNOTATION_VERTICAL_PADDING;
273404
- const annotationWidth = textWidth + annotationHorizontalPadding;
273405
- let annotationHeight = annotationFontSize * FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER + annotationVerticalPadding;
273406
- if (run2.variant === "signature" && run2.imageSrc) {
273407
- const signatureHeight = 28 + annotationVerticalPadding;
273408
- annotationHeight = Math.max(annotationHeight, signatureHeight);
273409
- }
273410
- if (run2.variant === "image" && run2.imageSrc && run2.size?.height) {
273411
- const imageHeight = run2.size.height + annotationVerticalPadding;
273412
- annotationHeight = Math.max(annotationHeight, imageHeight);
273413
- }
273414
- if (run2.variant === "html" && run2.size?.height)
273415
- annotationHeight = Math.max(annotationHeight, run2.size.height);
273758
+ const { width: annotationWidth, height: annotationHeight } = getAtomicRunLayoutSize(run2, measureAtomicText$1);
273416
273759
  let annotationStartX;
273417
273760
  if (pendingTabAlignment && currentLine)
273418
273761
  annotationStartX = alignPendingTabForWidth(annotationWidth);
@@ -274229,12 +274572,17 @@ async function measureTableBlock(block, constraints, fontContext) {
274229
274572
  });
274230
274573
  if (rowspan === 1)
274231
274574
  rowBaseHeights[rowIndex] = Math.max(rowBaseHeights[rowIndex], totalCellHeight);
274232
- else
274575
+ else {
274576
+ const firstBlockMeasure = blockMeasures[0];
274577
+ const firstLineHeight = firstBlockMeasure?.kind === "paragraph" && firstBlockMeasure.lines.length > 0 ? firstBlockMeasure.lines[0].lineHeight : undefined;
274578
+ const minRowHeight = Math.min(totalCellHeight, firstLineHeight != null ? firstLineHeight + paddingTop + paddingBottom : totalCellHeight / rowspan);
274233
274579
  spanConstraints.push({
274234
274580
  startRow: rowIndex,
274235
274581
  rowSpan: rowspan,
274236
- requiredHeight: totalCellHeight
274582
+ requiredHeight: totalCellHeight,
274583
+ minRowHeight
274237
274584
  });
274585
+ }
274238
274586
  gridColIndex += colspan;
274239
274587
  }
274240
274588
  for (let col = gridColIndex;col < gridColumnCount; col++)
@@ -274246,6 +274594,12 @@ async function measureTableBlock(block, constraints, fontContext) {
274246
274594
  });
274247
274595
  }
274248
274596
  const rowHeights = [...rowBaseHeights];
274597
+ for (const constraint of spanConstraints) {
274598
+ const spanLength = Math.min(constraint.rowSpan, rowHeights.length - constraint.startRow);
274599
+ for (let i3 = 0;i3 < spanLength; i3++)
274600
+ if (rowBaseHeights[constraint.startRow + i3] === 0)
274601
+ rowHeights[constraint.startRow + i3] = Math.max(rowHeights[constraint.startRow + i3], constraint.minRowHeight);
274602
+ }
274249
274603
  for (const constraint of spanConstraints) {
274250
274604
  const { startRow, rowSpan, requiredHeight } = constraint;
274251
274605
  if (rowSpan <= 0)
@@ -274260,6 +274614,34 @@ async function measureTableBlock(block, constraints, fontContext) {
274260
274614
  rowHeights[startRow + i3] += increment2;
274261
274615
  }
274262
274616
  }
274617
+ if ((block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse")) !== "separate" && block.rows.length > 0) {
274618
+ const tableBordersForBands = block.attrs?.borders;
274619
+ const bandReservation = (band) => band > 2 ? band - 1 : 0;
274620
+ const gridlineBand = (gridline) => {
274621
+ let band = 0;
274622
+ const rowAbove = gridline > 0 ? block.rows[gridline - 1] : undefined;
274623
+ const rowBelow = gridline < block.rows.length ? block.rows[gridline] : undefined;
274624
+ for (const row2 of [rowAbove, rowBelow]) {
274625
+ if (!row2)
274626
+ continue;
274627
+ const override = row2.attrs?.borders;
274628
+ const eff = override ? {
274629
+ ...tableBordersForBands ?? {},
274630
+ ...override
274631
+ } : tableBordersForBands;
274632
+ const value = gridline === 0 ? eff?.top : gridline === block.rows.length ? eff?.bottom : eff?.insideH;
274633
+ band = Math.max(band, getBorderBandWidthPx(value));
274634
+ }
274635
+ for (const cell2 of rowAbove?.cells ?? [])
274636
+ band = Math.max(band, getBorderBandWidthPx(cell2.attrs?.borders?.bottom));
274637
+ for (const cell2 of rowBelow?.cells ?? [])
274638
+ band = Math.max(band, getBorderBandWidthPx(cell2.attrs?.borders?.top));
274639
+ return band;
274640
+ };
274641
+ for (let i3 = 0;i3 < block.rows.length; i3++)
274642
+ rowHeights[i3] += bandReservation(gridlineBand(i3));
274643
+ rowHeights[block.rows.length - 1] += bandReservation(gridlineBand(block.rows.length));
274644
+ }
274263
274645
  block.rows.forEach((row2, index2) => {
274264
274646
  const spec = row2.attrs?.rowHeight;
274265
274647
  if (spec?.value != null && Number.isFinite(spec.value))
@@ -281907,7 +282289,10 @@ var Node$13 = class Node$14 {
281907
282289
  const headerCells = [];
281908
282290
  const cells = [];
281909
282291
  for (let index2 = 0;index2 < colsCount; index2++) {
281910
- const cellAttrs = columnWidths ? { colwidth: [columnWidths[index2]] } : null;
282292
+ const cellAttrs = columnWidths ? {
282293
+ colwidth: [columnWidths[index2]],
282294
+ tableCellProperties: { cellWidth: cellWidthDxa(columnWidths[index2]) }
282295
+ } : null;
281911
282296
  const cell2 = createCell2(types2.tableCell, cellContent, cellAttrs);
281912
282297
  if (cell2)
281913
282298
  cells.push(cell2);
@@ -297216,15 +297601,30 @@ menclose::after {
297216
297601
  single: "solid",
297217
297602
  double: "double",
297218
297603
  dashed: "dashed",
297604
+ dashSmallGap: "dashed",
297219
297605
  dotted: "dotted",
297220
297606
  thick: "solid",
297221
297607
  triple: "solid",
297222
297608
  dotDash: "dashed",
297223
297609
  dotDotDash: "dashed",
297610
+ thinThickSmallGap: "solid",
297611
+ thickThinSmallGap: "solid",
297612
+ thinThickThinSmallGap: "solid",
297613
+ thinThickMediumGap: "solid",
297614
+ thickThinMediumGap: "solid",
297615
+ thinThickThinMediumGap: "solid",
297616
+ thinThickLargeGap: "solid",
297617
+ thickThinLargeGap: "solid",
297618
+ thinThickThinLargeGap: "solid",
297224
297619
  wave: "solid",
297225
- doubleWave: "solid"
297620
+ doubleWave: "solid",
297621
+ dashDotStroked: "dashed",
297622
+ threeDEmboss: "ridge",
297623
+ threeDEngrave: "groove",
297624
+ outset: "solid",
297625
+ inset: "solid"
297226
297626
  }[style2];
297227
- }, isValidHexColor2 = (color2) => /^#[0-9A-Fa-f]{6}$/.test(color2), applyBorder = (element3, side, border) => {
297627
+ }, isValidHexColor2 = (color2) => /^#[0-9A-Fa-f]{6}$/.test(color2), applyBorder = (element3, side, border, widthOverridePx) => {
297228
297628
  if (!border)
297229
297629
  return;
297230
297630
  if (border.style === "none" || border.width === 0) {
@@ -297232,18 +297632,40 @@ menclose::after {
297232
297632
  return;
297233
297633
  }
297234
297634
  const style2 = borderStyleToCSS(border.style);
297235
- const width = border.width ?? 1;
297236
297635
  const color2 = border.color ?? "#000000";
297237
297636
  const safeColor = isValidHexColor2(color2) ? color2 : "#000000";
297238
- const actualWidth = border.style === "thick" ? Math.max(width * 2, 3) : width;
297637
+ const actualWidth = widthOverridePx ?? getBorderBandWidthPx(border);
297239
297638
  element3.style[`border${side}`] = `${actualWidth}px ${style2} ${safeColor}`;
297240
- }, applyCellBorders = (element3, borders) => {
297639
+ }, applyCellBorders = (element3, borders, widthOverridesPx) => {
297241
297640
  if (!borders)
297242
297641
  return;
297243
297642
  applyBorder(element3, "Top", borders.top);
297244
- applyBorder(element3, "Right", borders.right);
297643
+ applyBorder(element3, "Right", borders.right, widthOverridesPx?.right);
297245
297644
  applyBorder(element3, "Bottom", borders.bottom);
297246
- applyBorder(element3, "Left", borders.left);
297645
+ applyBorder(element3, "Left", borders.left, widthOverridesPx?.left);
297646
+ }, BEVEL_LIGHT_AUTO = "#F0F0F0", BEVEL_DARK_AUTO = "#A0A0A0", bevelDarkColor = (color2) => {
297647
+ if (!color2 || !/^#[0-9A-Fa-f]{6}$/.test(color2) || color2.toLowerCase() === "#000000")
297648
+ return BEVEL_DARK_AUTO;
297649
+ const half = (i3) => Math.floor(parseInt(color2.slice(i3, i3 + 2), 16) / 2);
297650
+ return `#${[
297651
+ 1,
297652
+ 3,
297653
+ 5
297654
+ ].map((i3) => half(i3).toString(16).padStart(2, "0")).join("")}`;
297655
+ }, bevelLightColor = (color2) => {
297656
+ if (!color2 || !/^#[0-9A-Fa-f]{6}$/.test(color2) || color2.toLowerCase() === "#000000")
297657
+ return BEVEL_LIGHT_AUTO;
297658
+ return color2;
297659
+ }, bevelToneSpec = (spec, visualSide, owner) => {
297660
+ if (!spec || spec.style !== "outset" && spec.style !== "inset")
297661
+ return spec;
297662
+ const raisedSide = visualSide === "top" || visualSide === "left";
297663
+ const light = spec.style === "outset" === (owner === "table") === raisedSide;
297664
+ return {
297665
+ ...spec,
297666
+ style: "single",
297667
+ color: light ? bevelLightColor(spec.color) : bevelDarkColor(spec.color)
297668
+ };
297247
297669
  }, borderValueToSpec = (value) => {
297248
297670
  if (!value)
297249
297671
  return;
@@ -297326,7 +297748,7 @@ menclose::after {
297326
297748
  left: borders.right,
297327
297749
  right: borders.left
297328
297750
  };
297329
- }, getFiniteNumber = (value) => {
297751
+ }, FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER = 1.2, getFiniteNumber = (value) => {
297330
297752
  if (typeof value !== "number" || !Number.isFinite(value))
297331
297753
  return;
297332
297754
  return value;
@@ -298352,7 +298774,7 @@ menclose::after {
298352
298774
  hasSdtContainerChrome
298353
298775
  };
298354
298776
  }, renderTableCell = (deps) => {
298355
- const { doc: doc$12, x, y: y$1, rowHeight, cellMeasure, cell: cell2, borders, useDefaultBorder, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, context, applySdtDataset: applySdtDataset$1, chrome: chrome2, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, tableIndent, isRtl, cellWidth, fromLine, toLine, resolvePhysical } = deps;
298777
+ const { doc: doc$12, x, y: y$1, rowHeight, cellMeasure, cell: cell2, borders, useDefaultBorder, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, context, applySdtDataset: applySdtDataset$1, chrome: chrome2, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, tableIndent, isRtl, cellWidth, fromLine, toLine, resolvePhysical, borderBandOverridesPx } = deps;
298356
298778
  const padding = cell2?.attrs?.padding || {
298357
298779
  top: 0,
298358
298780
  left: 4,
@@ -298360,9 +298782,16 @@ menclose::after {
298360
298782
  bottom: 0
298361
298783
  };
298362
298784
  const buildTableImageHyperlinkAnchor = (imageEl, hyperlink, display) => buildImageHyperlinkAnchor(doc$12, imageEl, hyperlink, display);
298363
- const paddingLeft = isRtl ? padding.right ?? 4 : padding.left ?? 4;
298785
+ const compoundBandEats = (border, bandInCellPx) => {
298786
+ const profile = border ? getBorderBandProfile(border) : null;
298787
+ if (!profile)
298788
+ return 0;
298789
+ const bandInCell = bandInCellPx ?? profile.band;
298790
+ return Math.max(0, bandInCell - profile.band / 2);
298791
+ };
298792
+ const paddingLeft = Math.max(0, (isRtl ? padding.right ?? 4 : padding.left ?? 4) - compoundBandEats(borders?.left, borderBandOverridesPx?.left));
298364
298793
  const paddingTop = padding.top ?? 0;
298365
- const paddingRight = isRtl ? padding.left ?? 4 : padding.right ?? 4;
298794
+ const paddingRight = Math.max(0, (isRtl ? padding.left ?? 4 : padding.right ?? 4) - compoundBandEats(borders?.right, borderBandOverridesPx?.right));
298366
298795
  const paddingBottom = padding.bottom ?? 0;
298367
298796
  const cellEl = doc$12.createElement("div");
298368
298797
  cellEl.style.position = "absolute";
@@ -298377,7 +298806,7 @@ menclose::after {
298377
298806
  cellEl.style.paddingRight = `${paddingRight}px`;
298378
298807
  cellEl.style.paddingBottom = `${paddingBottom}px`;
298379
298808
  if (borders)
298380
- applyCellBorders(cellEl, borders);
298809
+ applyCellBorders(cellEl, borders, borderBandOverridesPx);
298381
298810
  else if (useDefaultBorder)
298382
298811
  cellEl.style.border = "1px solid rgba(0,0,0,0.6)";
298383
298812
  if (cell2?.attrs?.background)
@@ -298851,16 +299280,25 @@ menclose::after {
298851
299280
  elem.dataset.trackChangeAuthorColor = meta4.color;
298852
299281
  if (meta4.date)
298853
299282
  elem.dataset.trackChangeDate = meta4.date;
298854
- }, hasAnyResolvedBorder = (borders) => Boolean(borders.top || borders.right || borders.bottom || borders.left), resolveRenderedCellBorders = ({ cellBorders, hasBordersAttribute, tableBorders, cellPosition, cellSpacingPx, continuesFromPrev, continuesOnNext, aboveCellBorders, leftCellBorders, rightCellBorders, nextRowLeavesRightGap, deferTopToAboveCell, nextRowSuppressesSharedTop }) => {
299283
+ }, hasAnyResolvedBorder = (borders) => Boolean(borders.top || borders.right || borders.bottom || borders.left), resolveRenderedCellBorders = ({ cellBorders, hasBordersAttribute, tableBorders, cellPosition, cellSpacingPx, continuesFromPrev, continuesOnNext, aboveCellBorders, leftCellBorders, rightCellBorders, separateBorders, nextRowSuppressesSharedTop }) => {
298855
299284
  const hasExplicitBorders = hasExplicitCellBorders(cellBorders);
298856
299285
  const cellBounds = getTableCellGridBounds(cellPosition);
298857
299286
  const touchesTopBoundary = cellBounds.touchesTopEdge || continuesFromPrev;
298858
- const touchesBottomBoundary = cellBounds.touchesBottomEdge || continuesOnNext || nextRowLeavesRightGap === true;
298859
- const hasInteriorNeighborBorder = !touchesTopBoundary && !deferTopToAboveCell && isPresentBorder(aboveCellBorders?.bottom) || !cellBounds.touchesLeftEdge && isPresentBorder(leftCellBorders?.right);
299287
+ const touchesBottomBoundary = cellBounds.touchesBottomEdge || continuesOnNext;
299288
+ const hasInteriorNeighborBorder = !touchesTopBoundary && isPresentBorder(aboveCellBorders?.bottom) || !cellBounds.touchesLeftEdge && isPresentBorder(leftCellBorders?.right);
299289
+ if (separateBorders && cellSpacingPx === 0) {
299290
+ const cb = cellBorders ?? {};
299291
+ return {
299292
+ top: resolveTableBorderValue(cb.top, touchesTopBoundary ? tableBorders?.top : tableBorders?.insideH),
299293
+ right: resolveTableBorderValue(cb.right, cellBounds.touchesRightEdge ? tableBorders?.right : tableBorders?.insideV),
299294
+ bottom: resolveTableBorderValue(cb.bottom, touchesBottomBoundary ? tableBorders?.bottom : tableBorders?.insideH),
299295
+ left: resolveTableBorderValue(cb.left, cellBounds.touchesLeftEdge ? tableBorders?.left : tableBorders?.insideV)
299296
+ };
299297
+ }
298860
299298
  if (cellSpacingPx === 0 && (hasExplicitBorders || hasInteriorNeighborBorder)) {
298861
299299
  const cb = cellBorders ?? {};
298862
299300
  return {
298863
- top: touchesTopBoundary ? resolveTableBorderValue(cb.top, tableBorders?.top) : deferTopToAboveCell ? undefined : resolveBorderConflict(cb.top, aboveCellBorders?.bottom) ?? (isExplicitNoneBorder(cb.top) && isExplicitNoneBorder(aboveCellBorders?.bottom) ? undefined : borderValueToSpec(tableBorders?.insideH)),
299301
+ top: touchesTopBoundary ? resolveTableBorderValue(cb.top, tableBorders?.top) : resolveBorderConflict(cb.top, aboveCellBorders?.bottom) ?? (isExplicitNoneBorder(cb.top) && isExplicitNoneBorder(aboveCellBorders?.bottom) ? undefined : borderValueToSpec(tableBorders?.insideH)),
298864
299302
  left: cellBounds.touchesLeftEdge ? resolveTableBorderValue(cb.left, tableBorders?.left) : isPresentBorder(cb.left) ? resolveBorderConflict(cb.left, leftCellBorders?.right) ?? borderValueToSpec(tableBorders?.insideV) : isPresentBorder(leftCellBorders?.right) ? undefined : isExplicitNoneBorder(cb.left) && isExplicitNoneBorder(leftCellBorders?.right) ? undefined : borderValueToSpec(tableBorders?.insideV),
298865
299303
  right: cellBounds.touchesRightEdge ? resolveTableBorderValue(cb.right, tableBorders?.right) : isPresentBorder(cb.right) && !isPresentBorder(rightCellBorders?.left) ? cb.right : undefined,
298866
299304
  bottom: touchesBottomBoundary ? resolveTableBorderValue(cb.bottom, tableBorders?.bottom) : undefined
@@ -298900,8 +299338,102 @@ menclose::after {
298900
299338
  bottom: touchesBottomBoundary ? borderValueToSpec(tableBorders.bottom) : interiorBottom,
298901
299339
  left: baseBorders.left
298902
299340
  };
299341
+ }, appendCompoundBorderRects = (doc$12, container, cellElement, borders, rect, edges) => {
299342
+ if (!borders)
299343
+ return;
299344
+ const { ownsBottomBand, rightIsBoundary, leftIsBoundary, suppressMid } = edges;
299345
+ const sideInfo = [
299346
+ "top",
299347
+ "right",
299348
+ "bottom",
299349
+ "left"
299350
+ ].map((side) => {
299351
+ const spec = borders[side];
299352
+ const profile = spec ? getBorderBandProfile(spec) : null;
299353
+ if (!spec || !profile)
299354
+ return null;
299355
+ if (isNativeCssDoubleStyle(spec.style)) {
299356
+ if (side === "top" || side === "bottom" && ownsBottomBand || side === "left" && leftIsBoundary || side === "right" && rightIsBoundary)
299357
+ return null;
299358
+ }
299359
+ const { segments } = profile;
299360
+ return {
299361
+ side,
299362
+ band: Math.max(1, Math.round(profile.band)),
299363
+ outerRule: Math.max(1, Math.round(segments[0])),
299364
+ innerRule: Math.max(1, Math.round(segments[segments.length - 1])),
299365
+ midRule: segments.length === 5 ? Math.max(1, Math.round(segments[2])) : 0,
299366
+ midOffset: segments.length === 5 ? Math.round(segments[0] + segments[1]) : 0,
299367
+ color: spec.color && /^#[0-9A-Fa-f]{6}$/.test(spec.color) ? spec.color : "#000000"
299368
+ };
299369
+ });
299370
+ if (!sideInfo.some(Boolean))
299371
+ return;
299372
+ const x0$1 = Math.round(rect.x);
299373
+ const y0 = Math.round(rect.y);
299374
+ const x1 = Math.round(rect.x + rect.width);
299375
+ const y1 = Math.round(rect.y + rect.height);
299376
+ for (const info of sideInfo) {
299377
+ if (!info)
299378
+ continue;
299379
+ const cssSide = info.side[0].toUpperCase() + info.side.slice(1);
299380
+ cellElement.style[`border${cssSide}Color`] = "transparent";
299381
+ }
299382
+ const [top$1, right$1, bottom$1, left$1] = sideInfo;
299383
+ const rectEl = doc$12.createElement("div");
299384
+ rectEl.className = "superdoc-compound-border-rect";
299385
+ const st = rectEl.style;
299386
+ st.position = "absolute";
299387
+ st.boxSizing = "border-box";
299388
+ st.pointerEvents = "none";
299389
+ const topInset = top$1 ? top$1.band - top$1.innerRule : 0;
299390
+ const leftInset = left$1 ? leftIsBoundary ? left$1.band - left$1.innerRule : Math.round(left$1.band / 2) - left$1.innerRule : 0;
299391
+ const bottomInset = bottom$1 ? ownsBottomBand ? bottom$1.band - bottom$1.innerRule : Math.round(bottom$1.band / 2) - bottom$1.outerRule : 0;
299392
+ const rightInset = right$1 ? rightIsBoundary ? right$1.band - right$1.innerRule : Math.round(right$1.band / 2) - right$1.outerRule : 0;
299393
+ st.left = `${x0$1 + leftInset}px`;
299394
+ st.top = `${y0 + topInset}px`;
299395
+ st.width = `${x1 - x0$1 - leftInset - rightInset}px`;
299396
+ st.height = `${y1 - y0 - topInset - bottomInset}px`;
299397
+ if (top$1)
299398
+ st.borderTop = `${top$1.innerRule}px solid ${top$1.color}`;
299399
+ if (bottom$1)
299400
+ st.borderBottom = `${ownsBottomBand ? bottom$1.innerRule : bottom$1.outerRule}px solid ${bottom$1.color}`;
299401
+ if (left$1)
299402
+ st.borderLeft = `${left$1.innerRule}px solid ${left$1.color}`;
299403
+ if (right$1)
299404
+ st.borderRight = `${rightIsBoundary ? right$1.innerRule : right$1.outerRule}px solid ${right$1.color}`;
299405
+ container.appendChild(rectEl);
299406
+ const midTop = top$1 && top$1.midRule > 0 && !suppressMid?.top ? top$1 : null;
299407
+ const midLeft = left$1 && left$1.midRule > 0 && !suppressMid?.left ? left$1 : null;
299408
+ const midBottom = bottom$1 && bottom$1.midRule > 0 && ownsBottomBand && !suppressMid?.bottom ? bottom$1 : null;
299409
+ const midRight = right$1 && right$1.midRule > 0 && rightIsBoundary && !suppressMid?.right ? right$1 : null;
299410
+ if (midTop || midLeft || midBottom || midRight) {
299411
+ const mid = doc$12.createElement("div");
299412
+ mid.className = "superdoc-compound-border-mid";
299413
+ const ms = mid.style;
299414
+ ms.position = "absolute";
299415
+ ms.boxSizing = "border-box";
299416
+ ms.pointerEvents = "none";
299417
+ const tIn = midTop ? midTop.midOffset : 0;
299418
+ const lIn = midLeft ? midLeft.midOffset : 0;
299419
+ const bIn = midBottom ? midBottom.midOffset : 0;
299420
+ const rIn = midRight ? midRight.midOffset : 0;
299421
+ ms.left = `${x0$1 + lIn}px`;
299422
+ ms.top = `${y0 + tIn}px`;
299423
+ ms.width = `${x1 - x0$1 - lIn - rIn}px`;
299424
+ ms.height = `${y1 - y0 - tIn - bIn}px`;
299425
+ if (midTop)
299426
+ ms.borderTop = `${midTop.midRule}px solid ${midTop.color}`;
299427
+ if (midBottom)
299428
+ ms.borderBottom = `${midBottom.midRule}px solid ${midBottom.color}`;
299429
+ if (midLeft)
299430
+ ms.borderLeft = `${midLeft.midRule}px solid ${midLeft.color}`;
299431
+ if (midRight)
299432
+ ms.borderRight = `${midRight.midRule}px solid ${midRight.color}`;
299433
+ container.appendChild(mid);
299434
+ }
298903
299435
  }, renderTableRow = (deps) => {
298904
- const { doc: doc$12, container, rowIndex, y: y$1, rowMeasure, row: row2, prevRow, prevRowMeasure, nextRow, nextRowMeasure, rowOccupiedRightCol, nextRowOccupiedRightCol, totalRows, tableBorders, columnWidths, allRowHeights, tableIndent, isRtl, context, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applySdtDataset: applySdtDataset$1, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, continuesFromPrev, continuesOnNext, partialRow, cellSpacingPx = 0, chrome: chrome2, resolvePhysical } = deps;
299436
+ const { doc: doc$12, container, rowIndex, y: y$1, rowMeasure, row: row2, prevRow, prevRowMeasure, nextRow, rowOccupiedRightCol, separateBorders, totalRows, tableBorders, columnWidths, allRowHeights, tableIndent, isRtl, context, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applySdtDataset: applySdtDataset$1, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, continuesFromPrev, continuesOnNext, partialRow, cellSpacingPx = 0, chrome: chrome2, resolvePhysical } = deps;
298905
299437
  const totalCols = columnWidths.length;
298906
299438
  const rowTrackedChange = row2?.attrs?.trackedChange;
298907
299439
  let rowTrackedChangeConfig;
@@ -298965,17 +299497,6 @@ menclose::after {
298965
299497
  return cells[i3]?.attrs?.borders;
298966
299498
  }
298967
299499
  };
298968
- const findCellRightEdgeAtColumn = (measureCells, gridCol) => {
298969
- if (!measureCells)
298970
- return;
298971
- for (let i3 = 0;i3 < measureCells.length; i3++) {
298972
- const start$1 = measureCells[i3].gridColumnStart ?? i3;
298973
- const span = measureCells[i3].colSpan ?? 1;
298974
- if (gridCol >= start$1 && gridCol < start$1 + span)
298975
- return start$1 + span;
298976
- }
298977
- };
298978
- const nextRowMaxCol = nextRowOccupiedRightCol != null && nextRowOccupiedRightCol > 0 ? nextRowOccupiedRightCol : nextRowMeasure?.cells?.length ? Math.max(...nextRowMeasure.cells.map((c) => (c.gridColumnStart ?? 0) + (c.colSpan ?? 1))) : Infinity;
298979
299500
  for (let cellIndex = 0;cellIndex < rowMeasure.cells.length; cellIndex += 1) {
298980
299501
  const cellMeasure = rowMeasure.cells[cellIndex];
298981
299502
  const cell2 = row2?.cells?.[cellIndex];
@@ -298996,8 +299517,6 @@ menclose::after {
298996
299517
  const aboveCellBorders = findCellBordersAtColumn(prevRow?.cells, prevRowMeasure?.cells, gridColumnStart);
298997
299518
  const leftCellBorders = gridColumnStart > 0 ? findCellBordersAtColumn(row2?.cells, rowMeasure.cells, gridColumnStart - 1) : undefined;
298998
299519
  const rightCellBorders = findCellBordersAtColumn(row2?.cells, rowMeasure.cells, gridColumnStart + colSpan);
298999
- const nextRowLeavesRightGap = gridColumnStart + colSpan > nextRowMaxCol;
299000
- const aboveCellRightEdge = findCellRightEdgeAtColumn(prevRowMeasure?.cells, gridColumnStart);
299001
299520
  const resolvedBorders = resolveRenderedCellBorders({
299002
299521
  cellBorders: cellBordersAttr,
299003
299522
  hasBordersAttribute,
@@ -299009,11 +299528,16 @@ menclose::after {
299009
299528
  aboveCellBorders,
299010
299529
  leftCellBorders,
299011
299530
  rightCellBorders,
299012
- nextRowLeavesRightGap,
299013
- deferTopToAboveCell: aboveCellRightEdge !== undefined && aboveCellRightEdge > rowRightEdgeCol,
299531
+ separateBorders,
299014
299532
  nextRowSuppressesSharedTop
299015
299533
  });
299016
299534
  const finalBorders = isRtl && resolvedBorders ? swapCellBordersLR(resolvedBorders) : resolvedBorders;
299535
+ const tonedBorders = separateBorders && finalBorders ? {
299536
+ top: bevelToneSpec(finalBorders.top, "top", "cell"),
299537
+ right: bevelToneSpec(finalBorders.right, "right", "cell"),
299538
+ bottom: bevelToneSpec(finalBorders.bottom, "bottom", "cell"),
299539
+ left: bevelToneSpec(finalBorders.left, "left", "cell")
299540
+ } : finalBorders;
299017
299541
  let cellHeight;
299018
299542
  if (partialRow)
299019
299543
  cellHeight = partialRow.partialHeight;
@@ -299026,6 +299550,34 @@ menclose::after {
299026
299550
  const computedCellWidth = calculateColspanWidth(gridColumnStart, colSpan);
299027
299551
  if (isRtl && computedCellWidth > 0)
299028
299552
  x = tableContentWidth - x - computedCellWidth;
299553
+ const cellGridBounds = getTableCellGridBounds(cellPosition);
299554
+ const cellIsIntentionallyBorderless = hasBordersAttribute && !hasExplicitCellBorders(cellBordersAttr);
299555
+ const cb = cellBordersAttr ?? {};
299556
+ const effectiveSideSpecs = cellIsIntentionallyBorderless ? {} : {
299557
+ top: cellGridBounds.touchesTopEdge || continuesFromPrev === true ? resolveTableBorderValue(cb.top, effectiveTableBorders?.top) : resolveBorderConflict(cb.top, aboveCellBorders?.bottom) ?? borderValueToSpec(effectiveTableBorders?.insideH),
299558
+ bottom: cellGridBounds.touchesBottomEdge || continuesOnNext === true ? resolveTableBorderValue(cb.bottom, effectiveTableBorders?.bottom) : resolveBorderConflict(cb.bottom, undefined) ?? borderValueToSpec(effectiveTableBorders?.insideH),
299559
+ left: cellGridBounds.touchesLeftEdge ? resolveTableBorderValue(cb.left, effectiveTableBorders?.left) : resolveBorderConflict(cb.left, leftCellBorders?.right) ?? borderValueToSpec(effectiveTableBorders?.insideV),
299560
+ right: cellGridBounds.touchesRightEdge ? resolveTableBorderValue(cb.right, effectiveTableBorders?.right) : resolveBorderConflict(cb.right, rightCellBorders?.left) ?? borderValueToSpec(effectiveTableBorders?.insideV)
299561
+ };
299562
+ const rectBorders = (isRtl ? swapCellBordersLR(effectiveSideSpecs) : effectiveSideSpecs) ?? effectiveSideSpecs;
299563
+ const visualTouchesLeft = isRtl ? cellGridBounds.touchesRightEdge : cellGridBounds.touchesLeftEdge;
299564
+ const visualTouchesRight = isRtl ? cellGridBounds.touchesLeftEdge : cellGridBounds.touchesRightEdge;
299565
+ const leftStraddleProfile = !visualTouchesLeft && rectBorders.left ? getBorderBandProfile(rectBorders.left) : null;
299566
+ const rightStraddleProfile = !visualTouchesRight && rectBorders.right ? getBorderBandProfile(rectBorders.right) : null;
299567
+ let paintBorders = tonedBorders;
299568
+ let borderBandOverridesPx;
299569
+ if (leftStraddleProfile || rightStraddleProfile) {
299570
+ paintBorders = { ...tonedBorders ?? {} };
299571
+ borderBandOverridesPx = {};
299572
+ if (leftStraddleProfile) {
299573
+ paintBorders.left = rectBorders.left;
299574
+ borderBandOverridesPx.left = leftStraddleProfile.band / 2;
299575
+ }
299576
+ if (rightStraddleProfile) {
299577
+ paintBorders.right = rectBorders.right;
299578
+ borderBandOverridesPx.right = rightStraddleProfile.band / 2;
299579
+ }
299580
+ }
299029
299581
  const { cellElement } = renderTableCell({
299030
299582
  doc: doc$12,
299031
299583
  x,
@@ -299033,7 +299585,8 @@ menclose::after {
299033
299585
  rowHeight: cellHeight,
299034
299586
  cellMeasure,
299035
299587
  cell: cell2,
299036
- borders: finalBorders,
299588
+ borders: paintBorders,
299589
+ borderBandOverridesPx,
299037
299590
  useDefaultBorder: false,
299038
299591
  renderLine: renderLine$1,
299039
299592
  captureLineSnapshot,
@@ -299056,7 +299609,68 @@ menclose::after {
299056
299609
  if (rowTrackedChange && rowTrackedChangeConfig)
299057
299610
  applyRowTrackedChangeToCell(cellElement, rowTrackedChange, rowTrackedChangeConfig);
299058
299611
  container.appendChild(cellElement);
299612
+ const tableProvidesMid = (value) => {
299613
+ const profile = value != null && typeof value === "object" ? getBorderBandProfile(value) : null;
299614
+ return profile != null && profile.segments.length === 5;
299615
+ };
299616
+ const suppressMid = {
299617
+ top: tableProvidesMid(cellGridBounds.touchesTopEdge || continuesFromPrev === true ? effectiveTableBorders?.top : effectiveTableBorders?.insideH),
299618
+ bottom: tableProvidesMid(cellGridBounds.touchesBottomEdge || continuesOnNext === true ? effectiveTableBorders?.bottom : effectiveTableBorders?.insideH),
299619
+ left: tableProvidesMid(visualTouchesLeft ? isRtl ? effectiveTableBorders?.right : effectiveTableBorders?.left : effectiveTableBorders?.insideV),
299620
+ right: tableProvidesMid(visualTouchesRight ? isRtl ? effectiveTableBorders?.left : effectiveTableBorders?.right : effectiveTableBorders?.insideV)
299621
+ };
299622
+ appendCompoundBorderRects(doc$12, container, cellElement, rectBorders, {
299623
+ x,
299624
+ y: y$1,
299625
+ width: computedCellWidth > 0 ? computedCellWidth : cellMeasure.width ?? 0,
299626
+ height: cellHeight
299627
+ }, {
299628
+ ownsBottomBand: cellGridBounds.touchesBottomEdge || continuesOnNext === true,
299629
+ rightIsBoundary: visualTouchesRight,
299630
+ leftIsBoundary: visualTouchesLeft,
299631
+ suppressMid
299632
+ });
299633
+ }
299634
+ }, buildColumnOccupancy = (rows, numCols) => {
299635
+ const occupancy = rows.map(() => new Array(numCols).fill(null));
299636
+ rows.forEach((row2, rowIndex) => {
299637
+ row2?.cells?.forEach((cell2, cellIndex) => {
299638
+ const startCol = cell2.gridColumnStart ?? 0;
299639
+ const endCol = Math.min(numCols, startCol + (cell2.colSpan ?? 1));
299640
+ const endRow = Math.min(rows.length, rowIndex + (cell2.rowSpan ?? 1));
299641
+ const ref$1 = {
299642
+ rowIndex,
299643
+ cellIndex
299644
+ };
299645
+ for (let r$1 = rowIndex;r$1 < endRow; r$1 += 1)
299646
+ for (let c = startCol;c < endCol; c += 1)
299647
+ occupancy[r$1][c] = ref$1;
299648
+ });
299649
+ });
299650
+ return occupancy;
299651
+ }, computeBoundaryGapSegments = (occupancy, belowRowIndex) => {
299652
+ const above = occupancy[belowRowIndex - 1];
299653
+ const below = occupancy[belowRowIndex];
299654
+ if (!above || !below)
299655
+ return [];
299656
+ const segments = [];
299657
+ let current = null;
299658
+ for (let c = 0;c < above.length; c += 1) {
299659
+ const aboveCell = above[c];
299660
+ const isGap = aboveCell !== null && below[c] === null;
299661
+ if (isGap && current && current.aboveCell === aboveCell)
299662
+ current.endColExclusive = c + 1;
299663
+ else if (isGap) {
299664
+ current = {
299665
+ startCol: c,
299666
+ endColExclusive: c + 1,
299667
+ aboveCell
299668
+ };
299669
+ segments.push(current);
299670
+ } else
299671
+ current = null;
299059
299672
  }
299673
+ return segments;
299060
299674
  }, renderTableFragment = (deps) => {
299061
299675
  const { doc: doc$12, fragment, block, measure, cellSpacingPx, effectiveColumnWidths, chrome: chrome2, context, sdtBoundary, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applyFragmentFrame, applySdtDataset: applySdtDataset$1, applyContainerSdtDataset: applyContainerSdtDataset$1, applyStyles: applyStyles$3, resolvePhysical } = deps;
299062
299676
  if (!doc$12) {
@@ -299208,11 +299822,23 @@ menclose::after {
299208
299822
  }
299209
299823
  if (block.id)
299210
299824
  container.setAttribute("data-sd-block-id", block.id);
299211
- if ((block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse")) === "separate" && tableBorders) {
299212
- applyBorder(container, "Top", borderValueToSpec(tableBorders.top));
299213
- applyBorder(container, "Right", borderValueToSpec(isRtl ? tableBorders.left : tableBorders.right));
299214
- applyBorder(container, "Bottom", borderValueToSpec(tableBorders.bottom));
299215
- applyBorder(container, "Left", borderValueToSpec(isRtl ? tableBorders.right : tableBorders.left));
299825
+ const borderCollapse = block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse");
299826
+ const separateBorders = borderCollapse === "separate";
299827
+ if (borderCollapse === "separate" && tableBorders) {
299828
+ applyBorder(container, "Top", bevelToneSpec(borderValueToSpec(tableBorders.top), "top", "table"));
299829
+ applyBorder(container, "Right", bevelToneSpec(borderValueToSpec(isRtl ? tableBorders.left : tableBorders.right), "right", "table"));
299830
+ applyBorder(container, "Bottom", bevelToneSpec(borderValueToSpec(tableBorders.bottom), "bottom", "table"));
299831
+ applyBorder(container, "Left", bevelToneSpec(borderValueToSpec(isRtl ? tableBorders.right : tableBorders.left), "left", "table"));
299832
+ for (const [cssSide, value] of [
299833
+ ["Top", tableBorders.top],
299834
+ ["Right", isRtl ? tableBorders.left : tableBorders.right],
299835
+ ["Bottom", tableBorders.bottom],
299836
+ ["Left", isRtl ? tableBorders.right : tableBorders.left]
299837
+ ]) {
299838
+ const spec = borderValueToSpec(value);
299839
+ if (spec && getBorderBandProfile(spec) && !isNativeCssDoubleStyle(spec.style))
299840
+ container.style[`border${cssSide}Color`] = "transparent";
299841
+ }
299216
299842
  }
299217
299843
  const allRowHeights = measure.rows.map((r$1, idx) => {
299218
299844
  if (fragment.partialRow && fragment.partialRow.rowIndex === idx)
@@ -299245,9 +299871,8 @@ menclose::after {
299245
299871
  prevRow: r$1 > 0 ? block.rows[r$1 - 1] : undefined,
299246
299872
  prevRowMeasure: r$1 > 0 ? measure.rows[r$1 - 1] : undefined,
299247
299873
  nextRow: r$1 < block.rows.length - 1 ? block.rows[r$1 + 1] : undefined,
299248
- nextRowMeasure: r$1 < block.rows.length - 1 ? measure.rows[r$1 + 1] : undefined,
299249
299874
  rowOccupiedRightCol: rowOccupiedRightCols[r$1],
299250
- nextRowOccupiedRightCol: rowOccupiedRightCols[r$1 + 1],
299875
+ separateBorders,
299251
299876
  totalRows: block.rows.length,
299252
299877
  tableBorders,
299253
299878
  columnWidths: effectiveColumnWidths,
@@ -299351,10 +299976,16 @@ menclose::after {
299351
299976
  }
299352
299977
  }
299353
299978
  }
299979
+ const interiorRowBoundaries = [];
299354
299980
  for (let r$1 = fragment.fromRow;r$1 < fragment.toRow; r$1 += 1) {
299355
299981
  const rowMeasure = measure.rows[r$1];
299356
299982
  if (!rowMeasure)
299357
299983
  break;
299984
+ if (r$1 > fragment.fromRow)
299985
+ interiorRowBoundaries.push({
299986
+ y: y$1,
299987
+ belowRowIndex: r$1
299988
+ });
299358
299989
  const isFirstRenderedBodyRow = r$1 === fragment.fromRow;
299359
299990
  const isLastRenderedBodyRow = r$1 === fragment.toRow - 1;
299360
299991
  const partialRowData = fragment.partialRow && fragment.partialRow.rowIndex === r$1 ? fragment.partialRow : undefined;
@@ -299369,9 +300000,8 @@ menclose::after {
299369
300000
  prevRow: r$1 > 0 ? block.rows[r$1 - 1] : undefined,
299370
300001
  prevRowMeasure: r$1 > 0 ? measure.rows[r$1 - 1] : undefined,
299371
300002
  nextRow: r$1 < block.rows.length - 1 ? block.rows[r$1 + 1] : undefined,
299372
- nextRowMeasure: r$1 < block.rows.length - 1 ? measure.rows[r$1 + 1] : undefined,
299373
300003
  rowOccupiedRightCol: rowOccupiedRightCols[r$1],
299374
- nextRowOccupiedRightCol: rowOccupiedRightCols[r$1 + 1],
300004
+ separateBorders,
299375
300005
  totalRows: block.rows.length,
299376
300006
  tableBorders,
299377
300007
  columnWidths: effectiveColumnWidths,
@@ -299397,6 +300027,171 @@ menclose::after {
299397
300027
  });
299398
300028
  y$1 += actualRowHeight + cellSpacingPx;
299399
300029
  }
300030
+ {
300031
+ const sides = [
300032
+ [
300033
+ "top",
300034
+ tableBorders?.top,
300035
+ fragment.continuesFromPrev !== true
300036
+ ],
300037
+ [
300038
+ "right",
300039
+ isRtl ? tableBorders?.left : tableBorders?.right,
300040
+ true
300041
+ ],
300042
+ [
300043
+ "bottom",
300044
+ tableBorders?.bottom,
300045
+ fragment.continuesOnNext !== true
300046
+ ],
300047
+ [
300048
+ "left",
300049
+ isRtl ? tableBorders?.right : tableBorders?.left,
300050
+ true
300051
+ ]
300052
+ ];
300053
+ let outlineEl = null;
300054
+ for (const [side, value, enabled] of sides) {
300055
+ if (!enabled || value == null || typeof value !== "object")
300056
+ continue;
300057
+ const spec = value;
300058
+ const profile = getBorderBandProfile(value);
300059
+ if (!profile)
300060
+ continue;
300061
+ if (isNativeCssDoubleStyle(spec.style))
300062
+ continue;
300063
+ const rule = Math.max(1, Math.round(profile.segments[0]));
300064
+ const color2 = spec.color && /^#[0-9A-Fa-f]{6}$/.test(spec.color) ? spec.color : "#000000";
300065
+ if (!outlineEl) {
300066
+ outlineEl = doc$12.createElement("div");
300067
+ outlineEl.className = "superdoc-compound-border-outline";
300068
+ const st = outlineEl.style;
300069
+ st.position = "absolute";
300070
+ st.inset = "0";
300071
+ st.boxSizing = "border-box";
300072
+ st.pointerEvents = "none";
300073
+ container.appendChild(outlineEl);
300074
+ }
300075
+ const cssSide = side[0].toUpperCase() + side.slice(1);
300076
+ outlineEl.style[`border${cssSide}`] = `${rule}px solid ${color2}`;
300077
+ }
300078
+ }
300079
+ {
300080
+ const midProfileOf = (value) => {
300081
+ if (value == null || typeof value !== "object")
300082
+ return null;
300083
+ const profile = getBorderBandProfile(value);
300084
+ return profile && profile.segments.length === 5 ? profile : null;
300085
+ };
300086
+ const colorOf = (value) => {
300087
+ const c = value?.color;
300088
+ return c && /^#[0-9A-Fa-f]{6}$/.test(c) ? c : "#000000";
300089
+ };
300090
+ const midOffsetOf = (profile) => Math.round(profile.segments[0] + profile.segments[1]);
300091
+ const midRuleOf = (profile) => Math.max(1, Math.round(profile.segments[2]));
300092
+ const topBorder = tableBorders?.top;
300093
+ const bottomBorder = tableBorders?.bottom;
300094
+ const leftBorder = isRtl ? tableBorders?.right : tableBorders?.left;
300095
+ const rightBorder = isRtl ? tableBorders?.left : tableBorders?.right;
300096
+ const topMid = fragment.continuesFromPrev !== true ? midProfileOf(topBorder) : null;
300097
+ const bottomMid = fragment.continuesOnNext !== true ? midProfileOf(bottomBorder) : null;
300098
+ const leftMid = midProfileOf(leftBorder);
300099
+ const rightMid = midProfileOf(rightBorder);
300100
+ const insideHMid = midProfileOf(tableBorders?.insideH);
300101
+ const insideVMid = midProfileOf(tableBorders?.insideV);
300102
+ const fragmentWidth = fragment.width;
300103
+ const fragmentHeight = fragment.height;
300104
+ const ringTopInset = topMid ? midOffsetOf(topMid) : 0;
300105
+ const ringBottomInset = bottomMid ? midOffsetOf(bottomMid) : 0;
300106
+ const ringLeftInset = leftMid ? midOffsetOf(leftMid) : 0;
300107
+ const ringRightInset = rightMid ? midOffsetOf(rightMid) : 0;
300108
+ if (topMid || bottomMid || leftMid || rightMid) {
300109
+ const ring = doc$12.createElement("div");
300110
+ ring.className = "superdoc-compound-border-midring";
300111
+ const rs = ring.style;
300112
+ rs.position = "absolute";
300113
+ rs.boxSizing = "border-box";
300114
+ rs.pointerEvents = "none";
300115
+ rs.left = `${ringLeftInset}px`;
300116
+ rs.top = `${ringTopInset}px`;
300117
+ rs.width = `${fragmentWidth - ringLeftInset - ringRightInset}px`;
300118
+ rs.height = `${fragmentHeight - ringTopInset - ringBottomInset}px`;
300119
+ if (topMid)
300120
+ rs.borderTop = `${midRuleOf(topMid)}px solid ${colorOf(topBorder)}`;
300121
+ if (bottomMid)
300122
+ rs.borderBottom = `${midRuleOf(bottomMid)}px solid ${colorOf(bottomBorder)}`;
300123
+ if (leftMid)
300124
+ rs.borderLeft = `${midRuleOf(leftMid)}px solid ${colorOf(leftBorder)}`;
300125
+ if (rightMid)
300126
+ rs.borderRight = `${midRuleOf(rightMid)}px solid ${colorOf(rightBorder)}`;
300127
+ container.appendChild(ring);
300128
+ }
300129
+ const appendStrip = (className, l, t, w, h$2, color2) => {
300130
+ const strip = doc$12.createElement("div");
300131
+ strip.className = className;
300132
+ const ss = strip.style;
300133
+ ss.position = "absolute";
300134
+ ss.pointerEvents = "none";
300135
+ ss.left = `${l}px`;
300136
+ ss.top = `${t}px`;
300137
+ ss.width = `${w}px`;
300138
+ ss.height = `${h$2}px`;
300139
+ ss.background = color2;
300140
+ container.appendChild(strip);
300141
+ };
300142
+ if (insideVMid && effectiveColumnWidths.length > 1) {
300143
+ const rule = midRuleOf(insideVMid);
300144
+ const color2 = colorOf(tableBorders?.insideV);
300145
+ let cum = 0;
300146
+ for (let i3 = 0;i3 < effectiveColumnWidths.length - 1; i3 += 1) {
300147
+ cum += effectiveColumnWidths[i3];
300148
+ const gx = isRtl ? fragmentWidth - cum : cum;
300149
+ appendStrip("superdoc-compound-border-midv", Math.round(gx - rule / 2), ringTopInset, rule, fragmentHeight - ringTopInset - ringBottomInset, color2);
300150
+ }
300151
+ }
300152
+ if (insideHMid && interiorRowBoundaries.length > 0) {
300153
+ const rule = midRuleOf(insideHMid);
300154
+ const color2 = colorOf(tableBorders?.insideH);
300155
+ for (const { y: gy } of interiorRowBoundaries)
300156
+ appendStrip("superdoc-compound-border-midh", ringLeftInset, Math.round(gy + midOffsetOf(insideHMid)), fragmentWidth - ringLeftInset - ringRightInset, rule, color2);
300157
+ }
300158
+ }
300159
+ if (cellSpacingPx === 0 && !separateBorders && interiorRowBoundaries.length > 0 && block.rows?.length) {
300160
+ const occupancy = buildColumnOccupancy(measure.rows, effectiveColumnWidths.length);
300161
+ const columnX = [0];
300162
+ for (const width of effectiveColumnWidths)
300163
+ columnX.push(columnX[columnX.length - 1] + width);
300164
+ for (const { y: boundaryY, belowRowIndex } of interiorRowBoundaries)
300165
+ for (const segment of computeBoundaryGapSegments(occupancy, belowRowIndex)) {
300166
+ if (segment.aboveCell.rowIndex < fragment.fromRow)
300167
+ continue;
300168
+ const aboveCell = block.rows[segment.aboveCell.rowIndex]?.cells?.[segment.aboveCell.cellIndex];
300169
+ const boundaryRowBorders = block.rows[belowRowIndex - 1]?.attrs?.borders;
300170
+ const effectiveInsideH = boundaryRowBorders ? {
300171
+ ...tableBorders ?? {},
300172
+ ...boundaryRowBorders
300173
+ }.insideH : tableBorders?.insideH;
300174
+ const cellBottom = aboveCell?.attrs?.borders?.bottom;
300175
+ const spec = isExplicitNoneBorder(cellBottom) ? undefined : resolveTableBorderValue(cellBottom, effectiveInsideH);
300176
+ if (!isPresentBorder(spec))
300177
+ continue;
300178
+ const x = columnX[segment.startCol];
300179
+ const width = columnX[segment.endColExclusive] - x;
300180
+ if (width <= 0)
300181
+ continue;
300182
+ const strip = doc$12.createElement("div");
300183
+ strip.className = "superdoc-row-boundary-gap";
300184
+ const ss = strip.style;
300185
+ ss.position = "absolute";
300186
+ ss.pointerEvents = "none";
300187
+ ss.left = `${isRtl ? fragment.width - x - width : x}px`;
300188
+ ss.top = `${boundaryY}px`;
300189
+ ss.width = `${width}px`;
300190
+ ss.height = "0";
300191
+ applyBorder(strip, "Top", spec);
300192
+ container.appendChild(strip);
300193
+ }
300194
+ }
299400
300195
  return container;
299401
300196
  }, getOwnContainerKey = (item) => {
299402
300197
  if (item.kind !== "fragment")
@@ -305834,7 +306629,51 @@ menclose::after {
305834
306629
  getStats() {
305835
306630
  return this.cache.getStats();
305836
306631
  }
305837
- }, sharedHeaderFooterCache, HEADER_FOOTER_VARIANTS$12, canvas = null, ctx = null, isWordChar$1 = (char) => {
306632
+ }, sharedHeaderFooterCache, HEADER_FOOTER_VARIANTS$12, isAtomicLayoutRun = (run2) => typeof run2.src === "string" || run2.kind === "math" || run2.kind === "fieldAnnotation", resolveFieldAnnotationFontSize = (value) => {
306633
+ if (typeof value === "number" && Number.isFinite(value))
306634
+ return value;
306635
+ if (typeof value === "string") {
306636
+ const parsed = parseFloat(value);
306637
+ if (Number.isFinite(parsed) && parsed > 0)
306638
+ return parsed;
306639
+ }
306640
+ return 16;
306641
+ }, getImageRunSize = (run2) => {
306642
+ const distLeft = run2.distLeft ?? 0;
306643
+ const distRight = run2.distRight ?? 0;
306644
+ const distTop = run2.distTop ?? 0;
306645
+ const distBottom = run2.distBottom ?? 0;
306646
+ return {
306647
+ width: (run2.width ?? 0) + distLeft + distRight,
306648
+ height: (run2.height ?? 0) + distTop + distBottom
306649
+ };
306650
+ }, getMathRunSize = (run2) => ({
306651
+ width: run2.width ?? 20,
306652
+ height: run2.height ?? 24
306653
+ }), getFieldAnnotationRunSize = (run2, measureText$1) => {
306654
+ const fontSize = resolveFieldAnnotationFontSize(run2.fontSize);
306655
+ const horizontalPadding = run2.highlighted === false ? 0 : 8;
306656
+ const verticalPadding = run2.highlighted === false ? 0 : 6;
306657
+ const label = run2.displayLabel ?? "";
306658
+ const width = (label ? measureText$1(label, run2, fontSize) : 0) + horizontalPadding;
306659
+ let height = fontSize * FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER + verticalPadding;
306660
+ if (run2.variant === "signature" && run2.imageSrc)
306661
+ height = Math.max(height, 28 + verticalPadding);
306662
+ if (run2.variant === "image" && run2.imageSrc && run2.size?.height)
306663
+ height = Math.max(height, run2.size.height + verticalPadding);
306664
+ if (run2.variant === "html" && run2.size?.height)
306665
+ height = Math.max(height, run2.size.height);
306666
+ return {
306667
+ width,
306668
+ height
306669
+ };
306670
+ }, getAtomicRunLayoutSize = (run2, measureText$1) => {
306671
+ if (typeof run2.src === "string")
306672
+ return getImageRunSize(run2);
306673
+ if (run2.kind === "math")
306674
+ return getMathRunSize(run2);
306675
+ return getFieldAnnotationRunSize(run2, measureText$1);
306676
+ }, canvas = null, ctx = null, isWordChar$1 = (char) => {
305838
306677
  if (!char)
305839
306678
  return false;
305840
306679
  const code6 = char.charCodeAt(0);
@@ -305863,6 +306702,26 @@ menclose::after {
305863
306702
  }, DEFAULT_TAB_INTERVAL_TWIPS$12 = 720, TWIPS_PER_PX$2, TAB_EPSILON$1 = 0.1, WIDTH_FUDGE_PX = 0.5, twipsToPx$1 = (twips) => twips / TWIPS_PER_PX$2, pxToTwips$1 = (px) => Math.round(px * TWIPS_PER_PX$2), sanitizeIndent$1 = (value) => typeof value === "number" && Number.isFinite(value) ? Math.max(0, value) : 0, sanitizeRawIndent = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0, sanitizeDecimalSeparator$1 = (value) => value === "," ? "," : ".", getRunWidth = (run2) => {
305864
306703
  const width = run2.width;
305865
306704
  return typeof width === "number" ? width : 0;
306705
+ }, measureAtomicText = (text5, run2, fontSize) => {
306706
+ const family2 = run2.fontFamily || "Arial";
306707
+ const context = getCtx();
306708
+ if (!context)
306709
+ return Math.max(0, text5.length * (fontSize * 0.6));
306710
+ context.font = `${run2.italic ? "italic " : ""}${run2.bold ? "bold " : ""}${fontSize}px ${family2}`.trim();
306711
+ return context.measureText(text5).width;
306712
+ }, getAtomicRunLayoutWidth = (run2) => getAtomicRunLayoutSize(run2, measureAtomicText).width, getAtomicRunLayoutHeight = (run2) => getAtomicRunLayoutSize(run2, measureAtomicText).height, getLineMaxAtomicHeight = (runs2, fromRun, fromChar, toRun, toChar) => {
306713
+ let max$2 = 0;
306714
+ for (let r$1 = fromRun;r$1 <= toRun; r$1 += 1) {
306715
+ const run2 = runs2[r$1];
306716
+ if (!isAtomicLayoutRun(run2))
306717
+ continue;
306718
+ if (r$1 === toRun && toChar === 0)
306719
+ continue;
306720
+ if (r$1 === fromRun && r$1 === toRun && toChar <= fromChar)
306721
+ continue;
306722
+ max$2 = Math.max(max$2, getAtomicRunLayoutHeight(run2));
306723
+ }
306724
+ return max$2;
305866
306725
  }, isLineBreakRun$1 = (run2) => run2.kind === "lineBreak" || run2.kind === "break" && run2.breakType === "line", markerFontString = (run2) => {
305867
306726
  const size$1 = run2?.fontSize ?? 16;
305868
306727
  const family2 = run2?.fontFamily ?? "Arial";
@@ -305935,7 +306794,7 @@ menclose::after {
305935
306794
  };
305936
306795
  const text5 = runText(run2);
305937
306796
  if (!text5) {
305938
- const runWidth = getRunWidth(run2);
306797
+ const runWidth = isAtomicLayoutRun(run2) ? getAtomicRunLayoutWidth(run2) : getRunWidth(run2);
305939
306798
  if (runWidth > 0) {
305940
306799
  totalWidth += runWidth;
305941
306800
  endRun = r$1;
@@ -305994,7 +306853,7 @@ menclose::after {
305994
306853
  break;
305995
306854
  const text5 = runText(run2);
305996
306855
  if (!text5) {
305997
- totalWidth += getRunWidth(run2);
306856
+ totalWidth += isAtomicLayoutRun(run2) ? getAtomicRunLayoutWidth(run2) : getRunWidth(run2);
305998
306857
  continue;
305999
306858
  }
306000
306859
  const sliceStart = r$1 === startRunIndex ? startChar : 0;
@@ -306172,7 +307031,21 @@ menclose::after {
306172
307031
  }
306173
307032
  const text5 = runText(run2);
306174
307033
  if (!text5) {
306175
- cursorX += getRunWidth(run2);
307034
+ const atomicWidth = isAtomicLayoutRun(run2) ? getAtomicRunLayoutWidth(run2) : getRunWidth(run2);
307035
+ const pendingTabAlign = consumePendingTabAlignStart();
307036
+ if (pendingTabAlign != null) {
307037
+ const segment = {
307038
+ runIndex,
307039
+ fromChar: 0,
307040
+ toChar: 1,
307041
+ width: atomicWidth,
307042
+ x: pendingTabAlign.paintX,
307043
+ ...pendingTabAlign.precedingTabEndX !== undefined ? { precedingTabEndX: pendingTabAlign.precedingTabEndX } : {}
307044
+ };
307045
+ cursorX = pendingTabAlign.layoutX + atomicWidth;
307046
+ segments.push(segment);
307047
+ } else
307048
+ cursorX += atomicWidth;
306176
307049
  lineWidth = Math.max(lineWidth, cursorX);
306177
307050
  continue;
306178
307051
  }
@@ -311590,7 +312463,7 @@ menclose::after {
311590
312463
  }
311591
312464
  }, EMUS_PER_INCH = 914400, maxSize = 5000, cache, makeKey = (text5, font, letterSpacing) => {
311592
312465
  return `${text5}|${font}|${letterSpacing || 0}`;
311593
- }, fontMetricsCache, MAX_CACHE_SIZE = 1000, METRICS_TEST_STRING = "MHgypbdlÁÉÍ", DEFAULT_MIN_COLUMN_WIDTH = 8, TWIPS_PER_PX$1 = 15, PLACEHOLDER_COLUMN_MAX_WIDTH = 1, DEFAULT_CELL_PADDING$1, DEFAULT_FIELD_ANNOTATION_FONT_SIZE$1 = 16, FIELD_ANNOTATION_PILL_PADDING$1 = 8, TABLE_CELL_METRICS_CACHE_SIZE = 2000, TABLE_AUTOFIT_RESULT_CACHE_SIZE = 500, NO_WRAP_MAX_WIDTH, TOKEN_BOUNDARY_PATTERN, LruCache = class {
312466
+ }, fontMetricsCache, MAX_CACHE_SIZE = 1000, METRICS_TEST_STRING = "MHgypbdlÁÉÍ", DEFAULT_MIN_COLUMN_WIDTH = 8, TWIPS_PER_PX$1 = 15, PLACEHOLDER_COLUMN_MAX_WIDTH = 1, DEFAULT_CELL_PADDING$1, DEFAULT_FIELD_ANNOTATION_FONT_SIZE = 16, FIELD_ANNOTATION_PILL_PADDING = 8, TABLE_CELL_METRICS_CACHE_SIZE = 2000, TABLE_AUTOFIT_RESULT_CACHE_SIZE = 500, NO_WRAP_MAX_WIDTH, TOKEN_BOUNDARY_PATTERN, LruCache = class {
311594
312467
  constructor(maxSize$1) {
311595
312468
  this.cache = /* @__PURE__ */ new Map;
311596
312469
  this.maxSize = maxSize$1;
@@ -311624,7 +312497,7 @@ menclose::after {
311624
312497
  this.cache.delete(oldestKey);
311625
312498
  }
311626
312499
  }
311627
- }, tableCellMetricsCache, autoFitTableResultCache, canvasContext$1 = null, computeTabStops2, measurementConfig, canvasContext = null, DEFAULT_TAB_INTERVAL_TWIPS2 = 720, TWIPS_PER_PX2, twipsToPx2 = (twips) => twips / TWIPS_PER_PX2, pxToTwips = (px) => Math.round(px * TWIPS_PER_PX2), DEFAULT_TAB_INTERVAL_PX, TAB_EPSILON = 0.1, DEFAULT_CELL_PADDING, DEFAULT_DECIMAL_SEPARATOR2 = ".", ALLOWED_TAB_VALS, FIELD_ANNOTATION_PILL_PADDING = 8, FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER = 1.2, FIELD_ANNOTATION_VERTICAL_PADDING = 6, DEFAULT_FIELD_ANNOTATION_FONT_SIZE = 16, DEFAULT_PARAGRAPH_FONT_SIZE = 12, DEFAULT_PARAGRAPH_FONT_FAMILY = "Arial", isValidFontSize = (value) => typeof value === "number" && Number.isFinite(value) && value > 0, normalizeFontSize2 = (value, fallback = DEFAULT_PARAGRAPH_FONT_SIZE) => {
312500
+ }, tableCellMetricsCache, autoFitTableResultCache, canvasContext$1 = null, computeTabStops2, measurementConfig, canvasContext = null, DEFAULT_TAB_INTERVAL_TWIPS2 = 720, TWIPS_PER_PX2, twipsToPx2 = (twips) => twips / TWIPS_PER_PX2, pxToTwips = (px) => Math.round(px * TWIPS_PER_PX2), DEFAULT_TAB_INTERVAL_PX, TAB_EPSILON = 0.1, DEFAULT_CELL_PADDING, DEFAULT_DECIMAL_SEPARATOR2 = ".", ALLOWED_TAB_VALS, DEFAULT_PARAGRAPH_FONT_SIZE = 12, DEFAULT_PARAGRAPH_FONT_FAMILY = "Arial", isValidFontSize = (value) => typeof value === "number" && Number.isFinite(value) && value > 0, normalizeFontSize2 = (value, fallback = DEFAULT_PARAGRAPH_FONT_SIZE) => {
311628
312501
  if (isValidFontSize(value))
311629
312502
  return value;
311630
312503
  if (typeof value === "string") {
@@ -314196,13 +315069,13 @@ menclose::after {
314196
315069
  return;
314197
315070
  console.log(...args$1);
314198
315071
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
314199
- var init_src_ly1ZYfUZ_es = __esm(() => {
315072
+ var init_src_bMRzO9Kl_es = __esm(() => {
314200
315073
  init_rolldown_runtime_Bg48TavK_es();
314201
- init_SuperConverter_DRKaQwZS_es();
315074
+ init_SuperConverter_Ed3nFN54_es();
314202
315075
  init_jszip_C49i9kUs_es();
314203
315076
  init_xml_js_CqGKpaft_es();
314204
315077
  init_uuid_B2wVPhPi_es();
314205
- init_create_headless_toolbar_ChACxHAH_es();
315078
+ init_create_headless_toolbar_PSeH6IV5_es();
314206
315079
  init_constants_D9qj59G2_es();
314207
315080
  init_unified_BDuVPlMu_es();
314208
315081
  init_remark_gfm_BUJjZJLy_es();
@@ -324749,7 +325622,10 @@ ${err.toString()}`);
324749
325622
  for (let r$1 = 0;r$1 < rows; r$1++) {
324750
325623
  const cellNodes = [];
324751
325624
  for (let c = 0;c < columns; c++) {
324752
- const cellAttrs = widths ? { colwidth: [widths[c]] } : {};
325625
+ const cellAttrs = widths ? {
325626
+ colwidth: [widths[c]],
325627
+ tableCellProperties: { cellWidth: cellWidthDxa(widths[c]) }
325628
+ } : {};
324753
325629
  const cell2 = tableCellType.createAndFill(cellAttrs);
324754
325630
  if (!cell2)
324755
325631
  return false;
@@ -327412,6 +328288,10 @@ ${err.toString()}`);
327412
328288
  return { style: attrs.style };
327413
328289
  } },
327414
328290
  wrapAttributes: { rendered: false },
328291
+ wrapperParagraph: {
328292
+ default: null,
328293
+ rendered: false
328294
+ },
327415
328295
  anchorData: { rendered: false },
327416
328296
  marginOffset: { rendered: false },
327417
328297
  attributes: { rendered: false },
@@ -348974,13 +349854,28 @@ function print() { __p += __j.call(arguments, '') }
348974
349854
  "single",
348975
349855
  "double",
348976
349856
  "dashed",
349857
+ "dashSmallGap",
348977
349858
  "dotted",
348978
349859
  "thick",
348979
349860
  "triple",
348980
349861
  "dotDash",
348981
349862
  "dotDotDash",
349863
+ "thinThickSmallGap",
349864
+ "thickThinSmallGap",
349865
+ "thinThickThinSmallGap",
349866
+ "thinThickMediumGap",
349867
+ "thickThinMediumGap",
349868
+ "thinThickThinMediumGap",
349869
+ "thinThickLargeGap",
349870
+ "thickThinLargeGap",
349871
+ "thinThickThinLargeGap",
348982
349872
  "wave",
348983
- "doubleWave"
349873
+ "doubleWave",
349874
+ "dashDotStroked",
349875
+ "threeDEmboss",
349876
+ "threeDEngrave",
349877
+ "outset",
349878
+ "inset"
348984
349879
  ]);
348985
349880
  BORDER_STYLE_NUMBER = {
348986
349881
  single: 1,
@@ -348991,8 +349886,23 @@ function print() { __p += __j.call(arguments, '') }
348991
349886
  dotDash: 6,
348992
349887
  dotDotDash: 7,
348993
349888
  triple: 8,
349889
+ thinThickSmallGap: 9,
349890
+ thickThinSmallGap: 10,
349891
+ thinThickThinSmallGap: 11,
349892
+ thinThickMediumGap: 12,
349893
+ thickThinMediumGap: 13,
349894
+ thinThickThinMediumGap: 14,
349895
+ thinThickLargeGap: 15,
349896
+ thickThinLargeGap: 16,
349897
+ thinThickThinLargeGap: 17,
348994
349898
  wave: 18,
348995
- doubleWave: 19
349899
+ doubleWave: 19,
349900
+ dashSmallGap: 20,
349901
+ dashDotStroked: 21,
349902
+ threeDEmboss: 22,
349903
+ threeDEngrave: 23,
349904
+ outset: 24,
349905
+ inset: 25
348996
349906
  };
348997
349907
  BORDER_STYLE_LINES = {
348998
349908
  single: 1,
@@ -349003,8 +349913,21 @@ function print() { __p += __j.call(arguments, '') }
349003
349913
  dotDash: 1,
349004
349914
  dotDotDash: 1,
349005
349915
  triple: 3,
349916
+ thinThickSmallGap: 2,
349917
+ thickThinSmallGap: 2,
349918
+ thinThickThinSmallGap: 3,
349919
+ thinThickMediumGap: 2,
349920
+ thickThinMediumGap: 2,
349921
+ thinThickThinMediumGap: 3,
349922
+ thinThickLargeGap: 2,
349923
+ thickThinLargeGap: 2,
349924
+ thinThickThinLargeGap: 3,
349006
349925
  wave: 1,
349007
- doubleWave: 2
349926
+ doubleWave: 2,
349927
+ dashSmallGap: 1,
349928
+ dashDotStroked: 1,
349929
+ threeDEmboss: 1,
349930
+ threeDEngrave: 1
349008
349931
  };
349009
349932
  PX_PER_PT$12 = 96 / 72;
349010
349933
  BORDER_SIDES2 = [
@@ -357457,11 +358380,11 @@ function print() { __p += __j.call(arguments, '') }
357457
358380
  ]);
357458
358381
  });
357459
358382
 
357460
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-CjKDFHjb.es.js
358383
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DNNbMZCp.es.js
357461
358384
  var DEFAULT_TEXT_ALIGN_OPTIONS, DEFAULT_LINE_HEIGHT_OPTIONS, DEFAULT_ZOOM_OPTIONS, DEFAULT_DOCUMENT_MODE_OPTIONS, DEFAULT_FONT_SIZE_OPTIONS, headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS, FONT_SIZE_OPTIONS;
357462
- var init_create_super_doc_ui_CjKDFHjb_es = __esm(() => {
357463
- init_SuperConverter_DRKaQwZS_es();
357464
- init_create_headless_toolbar_ChACxHAH_es();
358385
+ var init_create_super_doc_ui_DNNbMZCp_es = __esm(() => {
358386
+ init_SuperConverter_Ed3nFN54_es();
358387
+ init_create_headless_toolbar_PSeH6IV5_es();
357465
358388
  DEFAULT_TEXT_ALIGN_OPTIONS = [
357466
358389
  {
357467
358390
  label: "Left",
@@ -357752,15 +358675,15 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
357752
358675
 
357753
358676
  // ../../packages/superdoc/dist/super-editor.es.js
357754
358677
  var init_super_editor_es = __esm(() => {
357755
- init_src_ly1ZYfUZ_es();
357756
- init_SuperConverter_DRKaQwZS_es();
358678
+ init_src_bMRzO9Kl_es();
358679
+ init_SuperConverter_Ed3nFN54_es();
357757
358680
  init_jszip_C49i9kUs_es();
357758
358681
  init_xml_js_CqGKpaft_es();
357759
- init_create_headless_toolbar_ChACxHAH_es();
358682
+ init_create_headless_toolbar_PSeH6IV5_es();
357760
358683
  init_constants_D9qj59G2_es();
357761
358684
  init_unified_BDuVPlMu_es();
357762
358685
  init_DocxZipper_BzS208BW_es();
357763
- init_create_super_doc_ui_CjKDFHjb_es();
358686
+ init_create_super_doc_ui_DNNbMZCp_es();
357764
358687
  init_ui_CGB3qmy3_es();
357765
358688
  init_eventemitter3_UwU_CLPU_es();
357766
358689
  init_errors_C_DoKMoN_es();
@@ -380847,6 +381770,9 @@ function resolveEffectiveHeaderFooterRef2({
380847
381770
  }
380848
381771
  return null;
380849
381772
  }
381773
+ // ../../packages/layout-engine/contracts/src/border-band.ts
381774
+ var init_border_band = () => {};
381775
+
380850
381776
  // ../../packages/layout-engine/contracts/src/ooxml-z-index.ts
380851
381777
  function coerceRelativeHeight2(raw) {
380852
381778
  if (typeof raw === "number" && Number.isFinite(raw))
@@ -381360,6 +382286,7 @@ var init_engines = () => {};
381360
382286
 
381361
382287
  // ../../packages/layout-engine/contracts/src/index.ts
381362
382288
  var init_src = __esm(() => {
382289
+ init_border_band();
381363
382290
  init_justify_utils();
381364
382291
  init_pm_range();
381365
382292
  init_graphic_placement();
@@ -387923,13 +388850,28 @@ var init_borders = __esm(() => {
387923
388850
  "single",
387924
388851
  "double",
387925
388852
  "dashed",
388853
+ "dashSmallGap",
387926
388854
  "dotted",
387927
388855
  "thick",
387928
388856
  "triple",
387929
388857
  "dotDash",
387930
388858
  "dotDotDash",
388859
+ "thinThickSmallGap",
388860
+ "thickThinSmallGap",
388861
+ "thinThickThinSmallGap",
388862
+ "thinThickMediumGap",
388863
+ "thickThinMediumGap",
388864
+ "thinThickThinMediumGap",
388865
+ "thinThickLargeGap",
388866
+ "thickThinLargeGap",
388867
+ "thinThickThinLargeGap",
387931
388868
  "wave",
387932
- "doubleWave"
388869
+ "doubleWave",
388870
+ "dashDotStroked",
388871
+ "threeDEmboss",
388872
+ "threeDEngrave",
388873
+ "outset",
388874
+ "inset"
387933
388875
  ]);
387934
388876
  });
387935
388877
 
@@ -388539,6 +389481,11 @@ function resolveConditionalProps2(propertyType, styleType, styleId2, translatedL
388539
389481
  const props = def?.tableStyleProperties?.[styleType]?.[propertyType];
388540
389482
  if (props)
388541
389483
  chain.push(props);
389484
+ if (styleType === "wholeTable" && propertyType === "tableCellProperties") {
389485
+ const baseProps = def?.tableCellProperties;
389486
+ if (baseProps)
389487
+ chain.push(baseProps);
389488
+ }
388542
389489
  currentId = def?.basedOn;
388543
389490
  }
388544
389491
  if (chain.length === 0)
@@ -388553,7 +389500,7 @@ function resolveCellStyles2(propertyType, tableInfo, translatedLinkedStyles) {
388553
389500
  const cellStyleProps = [];
388554
389501
  const tableStyleId = tableInfo.tableProperties.tableStyleId;
388555
389502
  const { rowBandSize, colBandSize } = resolveEffectiveBandSizes2(tableStyleId, translatedLinkedStyles);
388556
- const cellStyleTypes = determineCellStyleTypes2(tableInfo.tableProperties?.tblLook ?? DEFAULT_TBL_LOOK2, tableInfo.rowIndex, tableInfo.cellIndex, tableInfo.numRows, tableInfo.numCells, rowBandSize, colBandSize, tableInfo.rowCnfStyle, tableInfo.cellCnfStyle);
389503
+ const cellStyleTypes = determineCellStyleTypes2(tableInfo.tableProperties?.tblLook ?? DEFAULT_TBL_LOOK2, tableInfo.rowIndex, tableInfo.cellIndex, tableInfo.numRows, tableInfo.numCells, rowBandSize, colBandSize, tableInfo.rowCnfStyle, tableInfo.cellCnfStyle, tableInfo.gridColumnStart, tableInfo.gridColumnSpan, tableInfo.numGridCols);
388557
389504
  cellStyleTypes.forEach((styleType) => {
388558
389505
  const typeProps = resolveConditionalProps2(propertyType, styleType, tableStyleId, translatedLinkedStyles);
388559
389506
  if (typeProps) {
@@ -388576,12 +389523,15 @@ function resolveTableCellProperties2(inlineProps, tableInfo, translatedLinkedSty
388576
389523
  }
388577
389524
  return combineProperties2(chain, { fullOverrideProps: ["shading"] });
388578
389525
  }
388579
- function determineCellStyleTypes2(tblLook, rowIndex, cellIndex, numRows, numCells, rowBandSize = 1, colBandSize = 1, rowCnfStyle, cellCnfStyle) {
389526
+ function determineCellStyleTypes2(tblLook, rowIndex, cellIndex, numRows, numCells, rowBandSize = 1, colBandSize = 1, rowCnfStyle, cellCnfStyle, gridColumnStart, gridColumnSpan, numGridCols) {
388580
389527
  const applicable = new Set(["wholeTable"]);
388581
389528
  const normalizedRowBandSize = rowBandSize > 0 ? rowBandSize : 1;
388582
389529
  const normalizedColBandSize = colBandSize > 0 ? colBandSize : 1;
389530
+ const columnStart = gridColumnStart ?? cellIndex;
389531
+ const columnEnd = columnStart + (gridColumnSpan ?? 1);
389532
+ const columnCount = numGridCols != null && numCells != null ? Math.max(numGridCols, numCells) : numGridCols ?? numCells;
388583
389533
  const bandRowIndex = Math.max(0, rowIndex - (tblLook?.firstRow ? 1 : 0));
388584
- const bandColIndex = Math.max(0, cellIndex - (tblLook?.firstColumn ? 1 : 0));
389534
+ const bandColIndex = Math.max(0, columnStart - (tblLook?.firstColumn ? 1 : 0));
388585
389535
  const rowGroup = Math.floor(bandRowIndex / normalizedRowBandSize);
388586
389536
  const colGroup = Math.floor(bandColIndex / normalizedColBandSize);
388587
389537
  if (!tblLook?.noHBand) {
@@ -388592,8 +389542,8 @@ function determineCellStyleTypes2(tblLook, rowIndex, cellIndex, numRows, numCell
388592
389542
  }
388593
389543
  const isFirstRow = !!tblLook?.firstRow && rowIndex === 0;
388594
389544
  const isLastRow = !!tblLook?.lastRow && numRows != null && numRows > 0 && rowIndex === numRows - 1;
388595
- const isFirstCol = !!tblLook?.firstColumn && cellIndex === 0;
388596
- const isLastCol = !!tblLook?.lastColumn && numCells != null && numCells > 0 && cellIndex === numCells - 1;
389545
+ const isFirstCol = !!tblLook?.firstColumn && columnStart === 0;
389546
+ const isLastCol = !!tblLook?.lastColumn && columnCount != null && columnCount > 0 && columnEnd >= columnCount;
388597
389547
  if (isFirstRow)
388598
389548
  applicable.add("firstRow");
388599
389549
  if (isFirstCol)
@@ -391366,6 +392316,7 @@ var WRAP_TYPES2, WRAP_TEXT_VALUES2, H_RELATIVE_VALUES2, V_RELATIVE_VALUES2, H_AL
391366
392316
  var init_shapes = __esm(() => {
391367
392317
  init_src();
391368
392318
  init_utilities();
392319
+ init_attributes();
391369
392320
  init_paragraph2();
391370
392321
  WRAP_TYPES2 = new Set(["None", "Square", "Tight", "Through", "TopAndBottom", "Inline"]);
391371
392322
  WRAP_TEXT_VALUES2 = new Set(["bothSides", "left", "right", "largest"]);
@@ -391933,10 +392884,40 @@ function normalizeLegacyBorderStyle2(value) {
391933
392884
  return "dotDash";
391934
392885
  case "dotdotdash":
391935
392886
  return "dotDotDash";
392887
+ case "dashsmallgap":
392888
+ return "dashSmallGap";
392889
+ case "thinthicksmallgap":
392890
+ return "thinThickSmallGap";
392891
+ case "thickthinsmallgap":
392892
+ return "thickThinSmallGap";
392893
+ case "thinthickthinsmallgap":
392894
+ return "thinThickThinSmallGap";
392895
+ case "thinthickmediumgap":
392896
+ return "thinThickMediumGap";
392897
+ case "thickthinmediumgap":
392898
+ return "thickThinMediumGap";
392899
+ case "thinthickthinmediumgap":
392900
+ return "thinThickThinMediumGap";
392901
+ case "thinthicklargegap":
392902
+ return "thinThickLargeGap";
392903
+ case "thickthinlargegap":
392904
+ return "thickThinLargeGap";
392905
+ case "thinthickthinlargegap":
392906
+ return "thinThickThinLargeGap";
391936
392907
  case "wave":
391937
392908
  return "wave";
391938
392909
  case "doublewave":
391939
392910
  return "doubleWave";
392911
+ case "dashdotstroked":
392912
+ return "dashDotStroked";
392913
+ case "threedemboss":
392914
+ return "threeDEmboss";
392915
+ case "threedengrave":
392916
+ return "threeDEngrave";
392917
+ case "outset":
392918
+ return "outset";
392919
+ case "inset":
392920
+ return "inset";
391940
392921
  case "single":
391941
392922
  default:
391942
392923
  return "single";
@@ -392074,14 +393055,21 @@ function tableNodeToBlock2(node3, {
392074
393055
  tableStyleId: effectiveStyleId ?? undefined
392075
393056
  } : undefined;
392076
393057
  const rows = [];
393058
+ const grid = node3.attrs?.grid;
393059
+ const numGridCols = Array.isArray(grid) && grid.length > 0 ? grid.length : undefined;
393060
+ let activeRowSpans = [];
392077
393061
  node3.content.forEach((rowNode, rowIndex) => {
393062
+ const { placements: placements2, nextActiveRowSpans } = placeRowCellsOnGrid2(rowNode, activeRowSpans);
393063
+ activeRowSpans = nextActiveRowSpans;
392078
393064
  const parsedRow = parseTableRow2({
392079
393065
  rowNode,
392080
393066
  rowIndex,
392081
393067
  numRows: node3?.content?.length ?? 1,
392082
393068
  context: parserDeps,
392083
393069
  defaultCellPadding,
392084
- tableProperties: tablePropertiesForCascade
393070
+ tableProperties: tablePropertiesForCascade,
393071
+ cellGridPlacements: placements2,
393072
+ numGridCols
392085
393073
  });
392086
393074
  if (parsedRow) {
392087
393075
  if (!shouldHideTrackedNode2(parsedRow.attrs?.trackedChange, parserDeps.trackedChangesConfig)) {
@@ -392212,7 +393200,36 @@ function tableNodeToBlock2(node3, {
392212
393200
  };
392213
393201
  return tableBlock;
392214
393202
  }
392215
- var isTableRowNode2 = (node3) => node3.type === "tableRow" || node3.type === "table_row", isTableCellNode2 = (node3) => node3.type === "tableCell" || node3.type === "table_cell" || node3.type === "tableHeader" || node3.type === "table_header", isTableSkipPlaceholderCell2 = (node3) => {
393203
+ var placeRowCellsOnGrid2 = (rowNode, activeRowSpans) => {
393204
+ const placements2 = [];
393205
+ const nextActiveRowSpans = activeRowSpans.map((count) => Math.max(0, count - 1));
393206
+ let column = 0;
393207
+ const cellSpan = (cellNode) => {
393208
+ const colspan = cellNode.attrs?.colspan;
393209
+ if (typeof colspan === "number" && colspan > 0)
393210
+ return colspan;
393211
+ const colwidth = cellNode.attrs?.colwidth;
393212
+ return Array.isArray(colwidth) && colwidth.length > 0 ? colwidth.length : 1;
393213
+ };
393214
+ for (const cellNode of Array.isArray(rowNode.content) ? rowNode.content : []) {
393215
+ if (!isTableCellNode2(cellNode)) {
393216
+ placements2.push(null);
393217
+ continue;
393218
+ }
393219
+ while ((activeRowSpans[column] ?? 0) > 0)
393220
+ column += 1;
393221
+ const span = cellSpan(cellNode);
393222
+ placements2.push({ gridColumnStart: column, gridColumnSpan: span });
393223
+ const rowspan = typeof cellNode.attrs?.rowspan === "number" ? cellNode.attrs.rowspan : 1;
393224
+ if (rowspan > 1) {
393225
+ for (let covered = column;covered < column + span; covered += 1) {
393226
+ nextActiveRowSpans[covered] = Math.max(nextActiveRowSpans[covered] ?? 0, rowspan - 1);
393227
+ }
393228
+ }
393229
+ column += span;
393230
+ }
393231
+ return { placements: placements2, nextActiveRowSpans };
393232
+ }, isTableRowNode2 = (node3) => node3.type === "tableRow" || node3.type === "table_row", isTableCellNode2 = (node3) => node3.type === "tableCell" || node3.type === "table_cell" || node3.type === "tableHeader" || node3.type === "table_header", isTableSkipPlaceholderCell2 = (node3) => {
392216
393233
  const placeholder = node3.attrs?.__placeholder;
392217
393234
  return placeholder === "gridBefore" || placeholder === "gridAfter";
392218
393235
  }, convertResolvedCellBorder2 = (value) => {
@@ -392247,7 +393264,20 @@ var isTableRowNode2 = (node3) => node3.type === "tableRow" || node3.type === "ta
392247
393264
  const blocks2 = [];
392248
393265
  const rowCnfStyle = args3.rowCnfStyle ?? null;
392249
393266
  const cellCnfStyle = cellNode.attrs?.tableCellProperties?.cnfStyle ?? null;
392250
- const tableInfo = tableProperties ? { tableProperties, rowIndex, cellIndex, numCells, numRows, rowCnfStyle, cellCnfStyle } : undefined;
393267
+ const tableInfo = tableProperties ? {
393268
+ tableProperties,
393269
+ rowIndex,
393270
+ cellIndex,
393271
+ numCells,
393272
+ numRows,
393273
+ rowCnfStyle,
393274
+ cellCnfStyle,
393275
+ ...args3.gridPlacement != null && args3.numGridCols != null ? {
393276
+ gridColumnStart: args3.gridPlacement.gridColumnStart,
393277
+ gridColumnSpan: args3.gridPlacement.gridColumnSpan,
393278
+ numGridCols: args3.numGridCols
393279
+ } : {}
393280
+ } : undefined;
392251
393281
  const inlineTcProps = cellNode.attrs?.tableCellProperties;
392252
393282
  const resolvedTcProps = resolveTableCellProperties2(inlineTcProps, tableInfo, context.converterContext?.translatedLinkedStyles);
392253
393283
  const cellBackground = cellNode.attrs?.background;
@@ -392547,7 +393577,9 @@ var isTableRowNode2 = (node3) => node3.type === "tableRow" || node3.type === "ta
392547
393577
  tableProperties,
392548
393578
  numCells: rowNode?.content?.length || 1,
392549
393579
  numRows,
392550
- rowCnfStyle
393580
+ rowCnfStyle,
393581
+ gridPlacement: args3.cellGridPlacements?.[cellIndex] ?? null,
393582
+ numGridCols: args3.numGridCols
392551
393583
  });
392552
393584
  if (parsedCell) {
392553
393585
  cells.push(parsedCell);