@superdoc-dev/cli 0.17.0-next.43 → 0.17.0-next.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +906 -101
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -68164,7 +68164,7 @@ var init_remark_gfm_BUJjZJLy_es = __esm(() => {
|
|
|
68164
68164
|
emptyOptions2 = {};
|
|
68165
68165
|
});
|
|
68166
68166
|
|
|
68167
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
68167
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-Ed3nFN54.es.js
|
|
68168
68168
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
68169
68169
|
const fieldValue = extension$1.config[field];
|
|
68170
68170
|
if (typeof fieldValue === "function")
|
|
@@ -77740,6 +77740,50 @@ function getCellSpacingPx(cellSpacing) {
|
|
|
77740
77740
|
const asPx = (cellSpacing.type ?? "").toLowerCase() === "dxa" && v >= 20 ? v / TWIPS_PER_PX : v;
|
|
77741
77741
|
return Math.max(0, asPx);
|
|
77742
77742
|
}
|
|
77743
|
+
function getBorderBandProfile(value) {
|
|
77744
|
+
if (value == null || typeof value !== "object")
|
|
77745
|
+
return null;
|
|
77746
|
+
if ("none" in value && value.none)
|
|
77747
|
+
return null;
|
|
77748
|
+
const raw = value;
|
|
77749
|
+
if (!raw.style)
|
|
77750
|
+
return null;
|
|
77751
|
+
const formula = COMPOUND_PROFILES[raw.style];
|
|
77752
|
+
if (!formula)
|
|
77753
|
+
return null;
|
|
77754
|
+
const w = typeof raw.width === "number" ? raw.width : typeof raw.size === "number" ? raw.size : 1;
|
|
77755
|
+
if (w <= 0)
|
|
77756
|
+
return null;
|
|
77757
|
+
const segments = formula(w).map((s) => Math.max(1, s));
|
|
77758
|
+
return {
|
|
77759
|
+
segments,
|
|
77760
|
+
band: segments.reduce((sum, s) => sum + s, 0)
|
|
77761
|
+
};
|
|
77762
|
+
}
|
|
77763
|
+
function getBorderBandWidthPx(value) {
|
|
77764
|
+
if (value == null)
|
|
77765
|
+
return 0;
|
|
77766
|
+
if (typeof value !== "object")
|
|
77767
|
+
return 0;
|
|
77768
|
+
if ("none" in value && value.none)
|
|
77769
|
+
return 0;
|
|
77770
|
+
const raw = value;
|
|
77771
|
+
if (raw.style === "none")
|
|
77772
|
+
return 0;
|
|
77773
|
+
const w = typeof raw.width === "number" ? raw.width : typeof raw.size === "number" ? raw.size : 1;
|
|
77774
|
+
const width = Math.max(0, w);
|
|
77775
|
+
if (width === 0)
|
|
77776
|
+
return 0;
|
|
77777
|
+
if (raw.style === "thick")
|
|
77778
|
+
return Math.max(width, 1);
|
|
77779
|
+
const profile = getBorderBandProfile(value);
|
|
77780
|
+
if (profile)
|
|
77781
|
+
return profile.band;
|
|
77782
|
+
return width;
|
|
77783
|
+
}
|
|
77784
|
+
function isNativeCssDoubleStyle(style) {
|
|
77785
|
+
return style === "double";
|
|
77786
|
+
}
|
|
77743
77787
|
function coerceRelativeHeight(raw) {
|
|
77744
77788
|
if (typeof raw === "number" && Number.isFinite(raw))
|
|
77745
77789
|
return raw;
|
|
@@ -79347,6 +79391,11 @@ function resolveConditionalProps(propertyType, styleType, styleId, translatedLin
|
|
|
79347
79391
|
const props = def?.tableStyleProperties?.[styleType]?.[propertyType];
|
|
79348
79392
|
if (props)
|
|
79349
79393
|
chain.push(props);
|
|
79394
|
+
if (styleType === "wholeTable" && propertyType === "tableCellProperties") {
|
|
79395
|
+
const baseProps = def?.tableCellProperties;
|
|
79396
|
+
if (baseProps)
|
|
79397
|
+
chain.push(baseProps);
|
|
79398
|
+
}
|
|
79350
79399
|
currentId = def?.basedOn;
|
|
79351
79400
|
}
|
|
79352
79401
|
if (chain.length === 0)
|
|
@@ -79360,7 +79409,7 @@ function resolveCellStyles(propertyType, tableInfo, translatedLinkedStyles) {
|
|
|
79360
79409
|
const cellStyleProps = [];
|
|
79361
79410
|
const tableStyleId = tableInfo.tableProperties.tableStyleId;
|
|
79362
79411
|
const { rowBandSize, colBandSize } = resolveEffectiveBandSizes(tableStyleId, translatedLinkedStyles);
|
|
79363
|
-
determineCellStyleTypes(tableInfo.tableProperties?.tblLook ?? DEFAULT_TBL_LOOK, tableInfo.rowIndex, tableInfo.cellIndex, tableInfo.numRows, tableInfo.numCells, rowBandSize, colBandSize, tableInfo.rowCnfStyle, tableInfo.cellCnfStyle).forEach((styleType) => {
|
|
79412
|
+
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) => {
|
|
79364
79413
|
const typeProps = resolveConditionalProps(propertyType, styleType, tableStyleId, translatedLinkedStyles);
|
|
79365
79414
|
if (typeProps)
|
|
79366
79415
|
cellStyleProps.push(typeProps);
|
|
@@ -79378,12 +79427,15 @@ function resolveTableCellProperties(inlineProps, tableInfo, translatedLinkedStyl
|
|
|
79378
79427
|
chain.push(inlineProps);
|
|
79379
79428
|
return combineProperties(chain, { fullOverrideProps: ["shading"] });
|
|
79380
79429
|
}
|
|
79381
|
-
function determineCellStyleTypes(tblLook, rowIndex, cellIndex, numRows, numCells, rowBandSize = 1, colBandSize = 1, rowCnfStyle, cellCnfStyle) {
|
|
79430
|
+
function determineCellStyleTypes(tblLook, rowIndex, cellIndex, numRows, numCells, rowBandSize = 1, colBandSize = 1, rowCnfStyle, cellCnfStyle, gridColumnStart, gridColumnSpan, numGridCols) {
|
|
79382
79431
|
const applicable = new Set(["wholeTable"]);
|
|
79383
79432
|
const normalizedRowBandSize = rowBandSize > 0 ? rowBandSize : 1;
|
|
79384
79433
|
const normalizedColBandSize = colBandSize > 0 ? colBandSize : 1;
|
|
79434
|
+
const columnStart = gridColumnStart ?? cellIndex;
|
|
79435
|
+
const columnEnd = columnStart + (gridColumnSpan ?? 1);
|
|
79436
|
+
const columnCount = numGridCols != null && numCells != null ? Math.max(numGridCols, numCells) : numGridCols ?? numCells;
|
|
79385
79437
|
const bandRowIndex = Math.max(0, rowIndex - (tblLook?.firstRow ? 1 : 0));
|
|
79386
|
-
const bandColIndex = Math.max(0,
|
|
79438
|
+
const bandColIndex = Math.max(0, columnStart - (tblLook?.firstColumn ? 1 : 0));
|
|
79387
79439
|
const rowGroup = Math.floor(bandRowIndex / normalizedRowBandSize);
|
|
79388
79440
|
const colGroup = Math.floor(bandColIndex / normalizedColBandSize);
|
|
79389
79441
|
if (!tblLook?.noHBand)
|
|
@@ -79392,8 +79444,8 @@ function determineCellStyleTypes(tblLook, rowIndex, cellIndex, numRows, numCells
|
|
|
79392
79444
|
applicable.add(colGroup % 2 === 0 ? "band1Vert" : "band2Vert");
|
|
79393
79445
|
const isFirstRow = !!tblLook?.firstRow && rowIndex === 0;
|
|
79394
79446
|
const isLastRow = !!tblLook?.lastRow && numRows != null && numRows > 0 && rowIndex === numRows - 1;
|
|
79395
|
-
const isFirstCol = !!tblLook?.firstColumn &&
|
|
79396
|
-
const isLastCol = !!tblLook?.lastColumn &&
|
|
79447
|
+
const isFirstCol = !!tblLook?.firstColumn && columnStart === 0;
|
|
79448
|
+
const isLastCol = !!tblLook?.lastColumn && columnCount != null && columnCount > 0 && columnEnd >= columnCount;
|
|
79397
79449
|
if (isFirstRow)
|
|
79398
79450
|
applicable.add("firstRow");
|
|
79399
79451
|
if (isFirstCol)
|
|
@@ -107246,10 +107298,40 @@ function normalizeLegacyBorderStyle(value) {
|
|
|
107246
107298
|
return "dotDash";
|
|
107247
107299
|
case "dotdotdash":
|
|
107248
107300
|
return "dotDotDash";
|
|
107301
|
+
case "dashsmallgap":
|
|
107302
|
+
return "dashSmallGap";
|
|
107303
|
+
case "thinthicksmallgap":
|
|
107304
|
+
return "thinThickSmallGap";
|
|
107305
|
+
case "thickthinsmallgap":
|
|
107306
|
+
return "thickThinSmallGap";
|
|
107307
|
+
case "thinthickthinsmallgap":
|
|
107308
|
+
return "thinThickThinSmallGap";
|
|
107309
|
+
case "thinthickmediumgap":
|
|
107310
|
+
return "thinThickMediumGap";
|
|
107311
|
+
case "thickthinmediumgap":
|
|
107312
|
+
return "thickThinMediumGap";
|
|
107313
|
+
case "thinthickthinmediumgap":
|
|
107314
|
+
return "thinThickThinMediumGap";
|
|
107315
|
+
case "thinthicklargegap":
|
|
107316
|
+
return "thinThickLargeGap";
|
|
107317
|
+
case "thickthinlargegap":
|
|
107318
|
+
return "thickThinLargeGap";
|
|
107319
|
+
case "thinthickthinlargegap":
|
|
107320
|
+
return "thinThickThinLargeGap";
|
|
107249
107321
|
case "wave":
|
|
107250
107322
|
return "wave";
|
|
107251
107323
|
case "doublewave":
|
|
107252
107324
|
return "doubleWave";
|
|
107325
|
+
case "dashdotstroked":
|
|
107326
|
+
return "dashDotStroked";
|
|
107327
|
+
case "threedemboss":
|
|
107328
|
+
return "threeDEmboss";
|
|
107329
|
+
case "threedengrave":
|
|
107330
|
+
return "threeDEngrave";
|
|
107331
|
+
case "outset":
|
|
107332
|
+
return "outset";
|
|
107333
|
+
case "inset":
|
|
107334
|
+
return "inset";
|
|
107253
107335
|
case "single":
|
|
107254
107336
|
default:
|
|
107255
107337
|
return "single";
|
|
@@ -107360,14 +107442,21 @@ function tableNodeToBlock(node3, { nextBlockId, positions, storyKey, trackedChan
|
|
|
107360
107442
|
tableStyleId: effectiveStyleId ?? undefined
|
|
107361
107443
|
} : undefined;
|
|
107362
107444
|
const rows = [];
|
|
107445
|
+
const grid = node3.attrs?.grid;
|
|
107446
|
+
const numGridCols = Array.isArray(grid) && grid.length > 0 ? grid.length : undefined;
|
|
107447
|
+
let activeRowSpans = [];
|
|
107363
107448
|
node3.content.forEach((rowNode, rowIndex) => {
|
|
107449
|
+
const { placements, nextActiveRowSpans } = placeRowCellsOnGrid(rowNode, activeRowSpans);
|
|
107450
|
+
activeRowSpans = nextActiveRowSpans;
|
|
107364
107451
|
const parsedRow = parseTableRow({
|
|
107365
107452
|
rowNode,
|
|
107366
107453
|
rowIndex,
|
|
107367
107454
|
numRows: node3?.content?.length ?? 1,
|
|
107368
107455
|
context: parserDeps,
|
|
107369
107456
|
defaultCellPadding,
|
|
107370
|
-
tableProperties: tablePropertiesForCascade
|
|
107457
|
+
tableProperties: tablePropertiesForCascade,
|
|
107458
|
+
cellGridPlacements: placements,
|
|
107459
|
+
numGridCols
|
|
107371
107460
|
});
|
|
107372
107461
|
if (parsedRow) {
|
|
107373
107462
|
if (!shouldHideTrackedNode(parsedRow.attrs?.trackedChange, parserDeps.trackedChangesConfig))
|
|
@@ -117075,7 +117164,7 @@ var isRegExp = (value) => {
|
|
|
117075
117164
|
return true;
|
|
117076
117165
|
}, areAttrsEqual = (attrsA = {}, attrsB = {}) => {
|
|
117077
117166
|
return objectIncludes(attrsA, attrsB);
|
|
117078
|
-
}, 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) => {
|
|
117167
|
+
}, 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) => {
|
|
117079
117168
|
const radians = shadow.direction * Math.PI / 180;
|
|
117080
117169
|
return {
|
|
117081
117170
|
dx: shadow.distance * Math.cos(radians),
|
|
@@ -135588,6 +135677,39 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
|
|
|
135588
135677
|
value: measurement.value,
|
|
135589
135678
|
type: measurement.type ?? "px"
|
|
135590
135679
|
};
|
|
135680
|
+
}, placeRowCellsOnGrid = (rowNode, activeRowSpans) => {
|
|
135681
|
+
const placements = [];
|
|
135682
|
+
const nextActiveRowSpans = activeRowSpans.map((count2) => Math.max(0, count2 - 1));
|
|
135683
|
+
let column = 0;
|
|
135684
|
+
const cellSpan = (cellNode) => {
|
|
135685
|
+
const colspan = cellNode.attrs?.colspan;
|
|
135686
|
+
if (typeof colspan === "number" && colspan > 0)
|
|
135687
|
+
return colspan;
|
|
135688
|
+
const colwidth = cellNode.attrs?.colwidth;
|
|
135689
|
+
return Array.isArray(colwidth) && colwidth.length > 0 ? colwidth.length : 1;
|
|
135690
|
+
};
|
|
135691
|
+
for (const cellNode of Array.isArray(rowNode.content) ? rowNode.content : []) {
|
|
135692
|
+
if (!isTableCellNode(cellNode)) {
|
|
135693
|
+
placements.push(null);
|
|
135694
|
+
continue;
|
|
135695
|
+
}
|
|
135696
|
+
while ((activeRowSpans[column] ?? 0) > 0)
|
|
135697
|
+
column += 1;
|
|
135698
|
+
const span = cellSpan(cellNode);
|
|
135699
|
+
placements.push({
|
|
135700
|
+
gridColumnStart: column,
|
|
135701
|
+
gridColumnSpan: span
|
|
135702
|
+
});
|
|
135703
|
+
const rowspan = typeof cellNode.attrs?.rowspan === "number" ? cellNode.attrs.rowspan : 1;
|
|
135704
|
+
if (rowspan > 1)
|
|
135705
|
+
for (let covered = column;covered < column + span; covered += 1)
|
|
135706
|
+
nextActiveRowSpans[covered] = Math.max(nextActiveRowSpans[covered] ?? 0, rowspan - 1);
|
|
135707
|
+
column += span;
|
|
135708
|
+
}
|
|
135709
|
+
return {
|
|
135710
|
+
placements,
|
|
135711
|
+
nextActiveRowSpans
|
|
135712
|
+
};
|
|
135591
135713
|
}, isTableRowNode = (node3) => node3.type === "tableRow" || node3.type === "table_row", isTableCellNode = (node3) => node3.type === "tableCell" || node3.type === "table_cell" || node3.type === "tableHeader" || node3.type === "table_header", isTableSkipPlaceholderCell = (node3) => {
|
|
135592
135714
|
const placeholder = node3.attrs?.__placeholder;
|
|
135593
135715
|
return placeholder === "gridBefore" || placeholder === "gridAfter";
|
|
@@ -135630,7 +135752,12 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
|
|
|
135630
135752
|
numCells,
|
|
135631
135753
|
numRows,
|
|
135632
135754
|
rowCnfStyle,
|
|
135633
|
-
cellCnfStyle
|
|
135755
|
+
cellCnfStyle,
|
|
135756
|
+
...args2.gridPlacement != null && args2.numGridCols != null ? {
|
|
135757
|
+
gridColumnStart: args2.gridPlacement.gridColumnStart,
|
|
135758
|
+
gridColumnSpan: args2.gridPlacement.gridColumnSpan,
|
|
135759
|
+
numGridCols: args2.numGridCols
|
|
135760
|
+
} : {}
|
|
135634
135761
|
} : undefined;
|
|
135635
135762
|
const inlineTcProps = cellNode.attrs?.tableCellProperties;
|
|
135636
135763
|
const resolvedTcProps = resolveTableCellProperties(inlineTcProps, tableInfo, context.converterContext?.translatedLinkedStyles);
|
|
@@ -135921,7 +136048,9 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
|
|
|
135921
136048
|
tableProperties,
|
|
135922
136049
|
numCells: rowNode?.content?.length || 1,
|
|
135923
136050
|
numRows,
|
|
135924
|
-
rowCnfStyle
|
|
136051
|
+
rowCnfStyle,
|
|
136052
|
+
gridPlacement: args2.cellGridPlacements?.[cellIndex] ?? null,
|
|
136053
|
+
numGridCols: args2.numGridCols
|
|
135925
136054
|
});
|
|
135926
136055
|
if (parsedCell)
|
|
135927
136056
|
cells.push(parsedCell);
|
|
@@ -136508,7 +136637,7 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
|
|
|
136508
136637
|
state.kern = kernNode.attributes["w:val"];
|
|
136509
136638
|
}
|
|
136510
136639
|
}, SuperConverter;
|
|
136511
|
-
var
|
|
136640
|
+
var init_SuperConverter_Ed3nFN54_es = __esm(() => {
|
|
136512
136641
|
init_rolldown_runtime_Bg48TavK_es();
|
|
136513
136642
|
init_jszip_C49i9kUs_es();
|
|
136514
136643
|
init_xml_js_CqGKpaft_es();
|
|
@@ -140954,6 +141083,71 @@ var init_SuperConverter_DIgF4xk__es = __esm(() => {
|
|
|
140954
141083
|
"highlight",
|
|
140955
141084
|
"link"
|
|
140956
141085
|
];
|
|
141086
|
+
COMPOUND_PROFILES = {
|
|
141087
|
+
double: (w) => [
|
|
141088
|
+
w,
|
|
141089
|
+
w,
|
|
141090
|
+
w
|
|
141091
|
+
],
|
|
141092
|
+
triple: (w) => [
|
|
141093
|
+
w,
|
|
141094
|
+
w,
|
|
141095
|
+
w,
|
|
141096
|
+
w,
|
|
141097
|
+
w
|
|
141098
|
+
],
|
|
141099
|
+
thinThickSmallGap: (w) => [
|
|
141100
|
+
w,
|
|
141101
|
+
PT_075,
|
|
141102
|
+
PT_075
|
|
141103
|
+
],
|
|
141104
|
+
thickThinSmallGap: (w) => [
|
|
141105
|
+
PT_075,
|
|
141106
|
+
PT_075,
|
|
141107
|
+
w
|
|
141108
|
+
],
|
|
141109
|
+
thinThickMediumGap: (w) => [
|
|
141110
|
+
w,
|
|
141111
|
+
w / 2,
|
|
141112
|
+
w / 2
|
|
141113
|
+
],
|
|
141114
|
+
thickThinMediumGap: (w) => [
|
|
141115
|
+
w / 2,
|
|
141116
|
+
w / 2,
|
|
141117
|
+
w
|
|
141118
|
+
],
|
|
141119
|
+
thinThickLargeGap: (w) => [
|
|
141120
|
+
PT_150,
|
|
141121
|
+
w,
|
|
141122
|
+
PT_075
|
|
141123
|
+
],
|
|
141124
|
+
thickThinLargeGap: (w) => [
|
|
141125
|
+
PT_075,
|
|
141126
|
+
w,
|
|
141127
|
+
PT_150
|
|
141128
|
+
],
|
|
141129
|
+
thinThickThinSmallGap: (w) => [
|
|
141130
|
+
PT_075,
|
|
141131
|
+
PT_075,
|
|
141132
|
+
w,
|
|
141133
|
+
PT_075,
|
|
141134
|
+
PT_075
|
|
141135
|
+
],
|
|
141136
|
+
thinThickThinMediumGap: (w) => [
|
|
141137
|
+
w / 2,
|
|
141138
|
+
w / 2,
|
|
141139
|
+
w,
|
|
141140
|
+
w / 2,
|
|
141141
|
+
w / 2
|
|
141142
|
+
],
|
|
141143
|
+
thinThickThinLargeGap: (w) => [
|
|
141144
|
+
PT_075,
|
|
141145
|
+
w,
|
|
141146
|
+
PT_150,
|
|
141147
|
+
w,
|
|
141148
|
+
PT_075
|
|
141149
|
+
]
|
|
141150
|
+
};
|
|
140957
141151
|
SPACE_CHARS = new Set([" ", " "]);
|
|
140958
141152
|
idlessSdtContainerKeys = /* @__PURE__ */ new WeakMap;
|
|
140959
141153
|
DRAWING_DIAGNOSTIC_CODES = {
|
|
@@ -163779,13 +163973,28 @@ var init_SuperConverter_DIgF4xk__es = __esm(() => {
|
|
|
163779
163973
|
"single",
|
|
163780
163974
|
"double",
|
|
163781
163975
|
"dashed",
|
|
163976
|
+
"dashSmallGap",
|
|
163782
163977
|
"dotted",
|
|
163783
163978
|
"thick",
|
|
163784
163979
|
"triple",
|
|
163785
163980
|
"dotDash",
|
|
163786
163981
|
"dotDotDash",
|
|
163982
|
+
"thinThickSmallGap",
|
|
163983
|
+
"thickThinSmallGap",
|
|
163984
|
+
"thinThickThinSmallGap",
|
|
163985
|
+
"thinThickMediumGap",
|
|
163986
|
+
"thickThinMediumGap",
|
|
163987
|
+
"thinThickThinMediumGap",
|
|
163988
|
+
"thinThickLargeGap",
|
|
163989
|
+
"thickThinLargeGap",
|
|
163990
|
+
"thinThickThinLargeGap",
|
|
163787
163991
|
"wave",
|
|
163788
|
-
"doubleWave"
|
|
163992
|
+
"doubleWave",
|
|
163993
|
+
"dashDotStroked",
|
|
163994
|
+
"threeDEmboss",
|
|
163995
|
+
"threeDEngrave",
|
|
163996
|
+
"outset",
|
|
163997
|
+
"inset"
|
|
163789
163998
|
]);
|
|
163790
163999
|
FONT_FAMILY_FALLBACKS$1 = Object.freeze({
|
|
163791
164000
|
swiss: "Arial, sans-serif",
|
|
@@ -165434,7 +165643,7 @@ var init_SuperConverter_DIgF4xk__es = __esm(() => {
|
|
|
165434
165643
|
};
|
|
165435
165644
|
});
|
|
165436
165645
|
|
|
165437
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
165646
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-PSeH6IV5.es.js
|
|
165438
165647
|
function parseSizeUnit(val = "0") {
|
|
165439
165648
|
const length3 = val.toString() || "0";
|
|
165440
165649
|
const value = Number.parseFloat(length3);
|
|
@@ -176237,9 +176446,9 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, MARK_KEYS, STEP_OP_CATALOG_UNFROZEN2, P
|
|
|
176237
176446
|
}
|
|
176238
176447
|
};
|
|
176239
176448
|
};
|
|
176240
|
-
var
|
|
176449
|
+
var init_create_headless_toolbar_PSeH6IV5_es = __esm(() => {
|
|
176241
176450
|
init_rolldown_runtime_Bg48TavK_es();
|
|
176242
|
-
|
|
176451
|
+
init_SuperConverter_Ed3nFN54_es();
|
|
176243
176452
|
init_jszip_C49i9kUs_es();
|
|
176244
176453
|
init_uuid_B2wVPhPi_es();
|
|
176245
176454
|
init_constants_D9qj59G2_es();
|
|
@@ -226332,7 +226541,7 @@ var init_remark_gfm_DCND_V_3_es = __esm(() => {
|
|
|
226332
226541
|
init_remark_gfm_BUJjZJLy_es();
|
|
226333
226542
|
});
|
|
226334
226543
|
|
|
226335
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
226544
|
+
// ../../packages/superdoc/dist/chunks/src-bMRzO9Kl.es.js
|
|
226336
226545
|
function deleteProps(obj, propOrProps) {
|
|
226337
226546
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
226338
226547
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -231177,6 +231386,12 @@ function updateTableWrapper(tableWrapper, table2) {
|
|
|
231177
231386
|
borderWidth = Math.ceil(Math.max(borderLeftMax, borderRightMax));
|
|
231178
231387
|
tableWrapper.style.setProperty("--table-border-width", `${borderWidth || defaultBorderWidth}px`);
|
|
231179
231388
|
}
|
|
231389
|
+
function cellWidthDxa(widthPx) {
|
|
231390
|
+
return {
|
|
231391
|
+
value: widthPx * 15,
|
|
231392
|
+
type: "dxa"
|
|
231393
|
+
};
|
|
231394
|
+
}
|
|
231180
231395
|
function cloneBorders(borders, sides) {
|
|
231181
231396
|
if (!borders || typeof borders !== "object")
|
|
231182
231397
|
return {};
|
|
@@ -270353,6 +270568,19 @@ function countHeaderRows(block) {
|
|
|
270353
270568
|
break;
|
|
270354
270569
|
return count2;
|
|
270355
270570
|
}
|
|
270571
|
+
function countRepeatableHeaderRows(block) {
|
|
270572
|
+
const headerCount = countHeaderRows(block);
|
|
270573
|
+
if (headerCount === 0)
|
|
270574
|
+
return 0;
|
|
270575
|
+
let bandEnd = headerCount;
|
|
270576
|
+
for (let r$1 = 0;r$1 < headerCount && r$1 < block.rows.length; r$1++)
|
|
270577
|
+
for (const cell2 of block.rows[r$1]?.cells ?? []) {
|
|
270578
|
+
const rowSpan = cell2.rowSpan ?? 1;
|
|
270579
|
+
if (rowSpan > 1)
|
|
270580
|
+
bandEnd = Math.max(bandEnd, r$1 + rowSpan);
|
|
270581
|
+
}
|
|
270582
|
+
return Math.min(bandEnd, block.rows.length);
|
|
270583
|
+
}
|
|
270356
270584
|
function sumRowHeights(rows, fromRow, toRow) {
|
|
270357
270585
|
let total = 0;
|
|
270358
270586
|
for (let i3 = fromRow;i3 < toRow && i3 < rows.length; i3++)
|
|
@@ -270737,7 +270965,7 @@ function layoutTableBlock({ block, measure, columnWidth, ensurePage, advanceColu
|
|
|
270737
270965
|
});
|
|
270738
270966
|
return;
|
|
270739
270967
|
}
|
|
270740
|
-
const headerCount =
|
|
270968
|
+
const headerCount = countRepeatableHeaderRows(block);
|
|
270741
270969
|
const headerPrefixHeights = [0];
|
|
270742
270970
|
for (let i3 = 0;i3 < headerCount; i3 += 1)
|
|
270743
270971
|
headerPrefixHeights.push(headerPrefixHeights[i3] + (measure.rows[i3]?.height ?? 0));
|
|
@@ -283542,12 +283770,14 @@ function computeAutoFitColumnWidths(input2) {
|
|
|
283542
283770
|
const currentWidths = fixedLayout.columnWidths.slice(0, gridColumnCount);
|
|
283543
283771
|
const minBounds = new Array(gridColumnCount).fill(0);
|
|
283544
283772
|
const maxBounds = new Array(gridColumnCount).fill(0);
|
|
283773
|
+
const textBounds = new Array(gridColumnCount).fill(0);
|
|
283545
283774
|
const preferredOverrides = new Array(gridColumnCount).fill(undefined);
|
|
283546
283775
|
const multiSpanCells = [];
|
|
283547
283776
|
accumulateBounds({
|
|
283548
283777
|
rows: normalizedRows,
|
|
283549
283778
|
minBounds,
|
|
283550
283779
|
maxBounds,
|
|
283780
|
+
textBounds,
|
|
283551
283781
|
preferredOverrides,
|
|
283552
283782
|
multiSpanCells
|
|
283553
283783
|
});
|
|
@@ -283570,7 +283800,26 @@ function computeAutoFitColumnWidths(input2) {
|
|
|
283570
283800
|
targetTableWidth = Math.min(targetTableWidth, maxResolvedTableWidth);
|
|
283571
283801
|
} else {
|
|
283572
283802
|
targetTableWidth = Math.min(targetTableWidth, maxResolvedTableWidth);
|
|
283573
|
-
if (
|
|
283803
|
+
if (workingInput.contentSizeAutoTable === true) {
|
|
283804
|
+
const columnBandAllowances = workingInput.columnBandAllowances;
|
|
283805
|
+
resolvedWidths = maxBounds.map((max$2, index2) => {
|
|
283806
|
+
const allowance = columnBandAllowances?.[index2] ?? 0;
|
|
283807
|
+
const withAllowance = Math.max(max$2, minBounds[index2]) + allowance;
|
|
283808
|
+
const textFloor = textBounds[index2] + allowance * 2;
|
|
283809
|
+
return Math.max(withAllowance, textFloor);
|
|
283810
|
+
});
|
|
283811
|
+
for (const spanCell of multiSpanCells) {
|
|
283812
|
+
const covered = resolvedWidths.slice(spanCell.startColumn, spanCell.startColumn + spanCell.span);
|
|
283813
|
+
const currentTotal = sumWidths$1(covered);
|
|
283814
|
+
const demand = spanCell.preferredWidth ?? spanCell.maxContentWidth;
|
|
283815
|
+
if (currentTotal < demand && covered.length > 0) {
|
|
283816
|
+
const topUp = (demand - currentTotal) / covered.length;
|
|
283817
|
+
for (let index2 = 0;index2 < covered.length; index2++)
|
|
283818
|
+
resolvedWidths[spanCell.startColumn + index2] += topUp;
|
|
283819
|
+
}
|
|
283820
|
+
}
|
|
283821
|
+
targetTableWidth = Math.min(sumWidths$1(resolvedWidths), maxResolvedTableWidth);
|
|
283822
|
+
} else if (!shouldPreservePreferredGrid) {
|
|
283574
283823
|
resolvedWidths = redistributeTowardMaximumsWithinCurrentTable(resolvedWidths, minBounds, maxBounds);
|
|
283575
283824
|
resolvedWidths = redistributeTowardContentWeightedShape(resolvedWidths, minBounds, maxBounds);
|
|
283576
283825
|
}
|
|
@@ -283632,7 +283881,8 @@ function resolveAutoFitContext(input2) {
|
|
|
283632
283881
|
span: cell2.span,
|
|
283633
283882
|
preferredWidth: cell2.preferredWidth,
|
|
283634
283883
|
minContentWidth: cell2.minContentWidth,
|
|
283635
|
-
maxContentWidth: cell2.maxContentWidth
|
|
283884
|
+
maxContentWidth: cell2.maxContentWidth,
|
|
283885
|
+
horizontalInsets: cell2.horizontalInsets
|
|
283636
283886
|
}))
|
|
283637
283887
|
})),
|
|
283638
283888
|
minColumnWidth
|
|
@@ -283665,7 +283915,8 @@ function normalizeLegacyRows(rows) {
|
|
|
283665
283915
|
span,
|
|
283666
283916
|
preferredWidth: sanitizeOptionalWidth(cell2.preferredWidth),
|
|
283667
283917
|
minContentWidth: Math.max(0, cell2.minContentWidth ?? 0),
|
|
283668
|
-
maxContentWidth: Math.max(0, cell2.maxContentWidth ?? cell2.minContentWidth ?? 0)
|
|
283918
|
+
maxContentWidth: Math.max(0, cell2.maxContentWidth ?? cell2.minContentWidth ?? 0),
|
|
283919
|
+
horizontalInsets: Math.max(0, cell2.horizontalInsets ?? 0)
|
|
283669
283920
|
});
|
|
283670
283921
|
columnIndex += span;
|
|
283671
283922
|
}
|
|
@@ -283702,7 +283953,8 @@ function buildNormalizedRows(workingInput, rowMetrics) {
|
|
|
283702
283953
|
span: Math.max(1, placedCell.span ?? metrics?.span ?? 1),
|
|
283703
283954
|
preferredWidth: sanitizeOptionalWidth(metrics?.preferredWidth ?? placedCell.preferredWidth),
|
|
283704
283955
|
minContentWidth: Math.max(0, metrics?.minContentWidth ?? 0),
|
|
283705
|
-
maxContentWidth: Math.max(0, metrics?.maxContentWidth ?? metrics?.minContentWidth ?? 0)
|
|
283956
|
+
maxContentWidth: Math.max(0, metrics?.maxContentWidth ?? metrics?.minContentWidth ?? 0),
|
|
283957
|
+
horizontalInsets: Math.max(0, metrics?.horizontalInsets ?? 0)
|
|
283706
283958
|
};
|
|
283707
283959
|
}),
|
|
283708
283960
|
skippedColumns: (workingRow.skippedColumns ?? []).map((skipped) => ({
|
|
@@ -283716,7 +283968,7 @@ function buildNormalizedRows(workingInput, rowMetrics) {
|
|
|
283716
283968
|
});
|
|
283717
283969
|
}
|
|
283718
283970
|
function accumulateBounds(args$1) {
|
|
283719
|
-
const { rows, minBounds, maxBounds, preferredOverrides, multiSpanCells } = args$1;
|
|
283971
|
+
const { rows, minBounds, maxBounds, textBounds, preferredOverrides, multiSpanCells } = args$1;
|
|
283720
283972
|
for (const row2 of rows) {
|
|
283721
283973
|
for (const skipped of row2.skippedColumns) {
|
|
283722
283974
|
minBounds[skipped.columnIndex] = Math.max(minBounds[skipped.columnIndex], skipped.minContentWidth);
|
|
@@ -283728,6 +283980,7 @@ function accumulateBounds(args$1) {
|
|
|
283728
283980
|
if (cell2.span === 1) {
|
|
283729
283981
|
minBounds[cell2.startColumn] = Math.max(minBounds[cell2.startColumn], cell2.minContentWidth);
|
|
283730
283982
|
maxBounds[cell2.startColumn] = Math.max(maxBounds[cell2.startColumn], cell2.maxContentWidth);
|
|
283983
|
+
textBounds[cell2.startColumn] = Math.max(textBounds[cell2.startColumn], Math.max(0, cell2.maxContentWidth - cell2.horizontalInsets));
|
|
283731
283984
|
if (preferredOverrides[cell2.startColumn] == null && cell2.preferredWidth != null)
|
|
283732
283985
|
preferredOverrides[cell2.startColumn] = cell2.preferredWidth;
|
|
283733
283986
|
} else
|
|
@@ -284171,16 +284424,29 @@ function buildAutoFitWorkingGridInput(block, constraints) {
|
|
|
284171
284424
|
layoutMode,
|
|
284172
284425
|
preferredColumnWidths,
|
|
284173
284426
|
preferredTableWidth,
|
|
284174
|
-
gridColumnCount
|
|
284427
|
+
gridColumnCount,
|
|
284428
|
+
rows
|
|
284175
284429
|
});
|
|
284176
284430
|
const preserveExplicitAutoGrid = shouldPreserveExplicitAutoGrid({
|
|
284177
284431
|
layoutMode,
|
|
284432
|
+
tableWidth,
|
|
284178
284433
|
preferredColumnWidths,
|
|
284179
284434
|
preferredTableWidth,
|
|
284180
284435
|
gridColumnCount,
|
|
284181
284436
|
rows
|
|
284182
284437
|
});
|
|
284183
|
-
const
|
|
284438
|
+
const contentSizeAutoTable = resolveContentSizeAutoTable({
|
|
284439
|
+
layoutMode,
|
|
284440
|
+
tableWidth,
|
|
284441
|
+
preferredTableWidth,
|
|
284442
|
+
preferredColumnWidths,
|
|
284443
|
+
maxTableWidth,
|
|
284444
|
+
rows,
|
|
284445
|
+
preserveAutoGrid,
|
|
284446
|
+
preserveExplicitAutoGrid
|
|
284447
|
+
});
|
|
284448
|
+
const columnBandAllowances = contentSizeAutoTable ? resolveColumnBandAllowances(block.attrs?.borders, gridColumnCount) : undefined;
|
|
284449
|
+
const autoGridWidthBudget = contentSizeAutoTable ? undefined : resolveAutoGridWidthBudget({
|
|
284184
284450
|
layoutMode,
|
|
284185
284451
|
tableWidth,
|
|
284186
284452
|
preferredColumnWidths,
|
|
@@ -284195,6 +284461,8 @@ function buildAutoFitWorkingGridInput(block, constraints) {
|
|
|
284195
284461
|
...preserveAutoGrid ? { preserveAutoGrid } : {},
|
|
284196
284462
|
...preserveExplicitAutoGrid ? { preserveExplicitAutoGrid } : {},
|
|
284197
284463
|
...autoGridWidthBudget != null ? { autoGridWidthBudget } : {},
|
|
284464
|
+
...contentSizeAutoTable ? { contentSizeAutoTable } : {},
|
|
284465
|
+
...columnBandAllowances ? { columnBandAllowances } : {},
|
|
284198
284466
|
preferredTableWidth,
|
|
284199
284467
|
preferredColumnWidths,
|
|
284200
284468
|
gridColumnCount,
|
|
@@ -284216,19 +284484,21 @@ function shouldPreserveAuthoredGrid(args$1) {
|
|
|
284216
284484
|
return approximatelyEqual(totalPreferredColumnWidth, preferredTableWidth) || isSlightlyUnderPreferredTableWidth(totalPreferredColumnWidth, preferredTableWidth);
|
|
284217
284485
|
}
|
|
284218
284486
|
function shouldPreserveAutoGrid(args$1) {
|
|
284219
|
-
const { layoutMode, preferredColumnWidths, preferredTableWidth, gridColumnCount } = args$1;
|
|
284487
|
+
const { layoutMode, preferredColumnWidths, preferredTableWidth, gridColumnCount, rows } = args$1;
|
|
284220
284488
|
if (layoutMode !== "autofit")
|
|
284221
284489
|
return false;
|
|
284222
284490
|
if (preferredTableWidth != null)
|
|
284223
284491
|
return false;
|
|
284224
284492
|
if (preferredColumnWidths.length === 0 || preferredColumnWidths.length !== gridColumnCount)
|
|
284225
284493
|
return false;
|
|
284494
|
+
if (preferredColumnWidths.length === 1 && !hasConcreteCellWidthRequest(rows))
|
|
284495
|
+
return false;
|
|
284226
284496
|
if (!hasNonUniformGrid(preferredColumnWidths))
|
|
284227
284497
|
return false;
|
|
284228
284498
|
return true;
|
|
284229
284499
|
}
|
|
284230
284500
|
function shouldPreserveExplicitAutoGrid(args$1) {
|
|
284231
|
-
const { layoutMode, preferredColumnWidths, preferredTableWidth, gridColumnCount, rows } = args$1;
|
|
284501
|
+
const { layoutMode, tableWidth, preferredColumnWidths, preferredTableWidth, gridColumnCount, rows } = args$1;
|
|
284232
284502
|
if (layoutMode !== "autofit")
|
|
284233
284503
|
return false;
|
|
284234
284504
|
if (preferredTableWidth == null || preferredTableWidth <= 0)
|
|
@@ -284237,8 +284507,52 @@ function shouldPreserveExplicitAutoGrid(args$1) {
|
|
|
284237
284507
|
return false;
|
|
284238
284508
|
if (!hasNonUniformGrid(preferredColumnWidths) && !hasConcreteCellWidthRequest(rows))
|
|
284239
284509
|
return false;
|
|
284510
|
+
if (isPercentTableWidth(tableWidth))
|
|
284511
|
+
return true;
|
|
284240
284512
|
return approximatelyEqual(sumWidths(preferredColumnWidths), preferredTableWidth);
|
|
284241
284513
|
}
|
|
284514
|
+
function isPercentTableWidth(tableWidth) {
|
|
284515
|
+
return typeof tableWidth === "object" && tableWidth != null && typeof tableWidth.type === "string" && tableWidth.type.toLowerCase() === "pct";
|
|
284516
|
+
}
|
|
284517
|
+
function resolveContentSizeAutoTable(args$1) {
|
|
284518
|
+
const { layoutMode, tableWidth, preferredTableWidth, preferredColumnWidths, maxTableWidth, rows, preserveAutoGrid, preserveExplicitAutoGrid } = args$1;
|
|
284519
|
+
if (layoutMode !== "autofit")
|
|
284520
|
+
return false;
|
|
284521
|
+
if (preferredTableWidth != null)
|
|
284522
|
+
return false;
|
|
284523
|
+
if (preserveAutoGrid || preserveExplicitAutoGrid)
|
|
284524
|
+
return false;
|
|
284525
|
+
if (!isAutoOrNilTableWidth(tableWidth))
|
|
284526
|
+
return false;
|
|
284527
|
+
if (hasConcreteCellWidthRequest(rows))
|
|
284528
|
+
return false;
|
|
284529
|
+
if (sumWidths(preferredColumnWidths) > maxTableWidth + 0.5)
|
|
284530
|
+
return false;
|
|
284531
|
+
return true;
|
|
284532
|
+
}
|
|
284533
|
+
function isAutoOrNilTableWidth(tableWidth) {
|
|
284534
|
+
if (tableWidth == null)
|
|
284535
|
+
return true;
|
|
284536
|
+
if (hasAutoTableWidthSemantics(tableWidth))
|
|
284537
|
+
return true;
|
|
284538
|
+
if (typeof tableWidth === "object" && typeof tableWidth.type === "string")
|
|
284539
|
+
return tableWidth.type.toLowerCase() === "nil";
|
|
284540
|
+
return false;
|
|
284541
|
+
}
|
|
284542
|
+
function resolveColumnBandAllowances(borders, gridColumnCount) {
|
|
284543
|
+
if (gridColumnCount <= 0)
|
|
284544
|
+
return;
|
|
284545
|
+
const left$1 = getBorderBandWidthPx(borders?.left);
|
|
284546
|
+
const insideV = getBorderBandWidthPx(borders?.insideV);
|
|
284547
|
+
const right$1 = getBorderBandWidthPx(borders?.right);
|
|
284548
|
+
const allowances = [];
|
|
284549
|
+
for (let i3 = 0;i3 < gridColumnCount; i3++) {
|
|
284550
|
+
const edgeLeft = i3 === 0 ? left$1 : insideV;
|
|
284551
|
+
const edgeRight = i3 === gridColumnCount - 1 ? right$1 : insideV;
|
|
284552
|
+
allowances.push((edgeLeft + edgeRight) / 2);
|
|
284553
|
+
}
|
|
284554
|
+
return allowances.some((a2) => a2 > 0) ? allowances : undefined;
|
|
284555
|
+
}
|
|
284242
284556
|
function resolveAutoGridWidthBudget(args$1) {
|
|
284243
284557
|
const { layoutMode, tableWidth, preferredColumnWidths, preferredTableWidth, gridColumnCount, maxTableWidth } = args$1;
|
|
284244
284558
|
if (layoutMode !== "autofit")
|
|
@@ -284539,7 +284853,8 @@ async function measureTableCellContentMetrics(cell2, options) {
|
|
|
284539
284853
|
if (contentBlocks.length === 0) {
|
|
284540
284854
|
const emptyMetrics = {
|
|
284541
284855
|
minWidthPx: horizontalInsets,
|
|
284542
|
-
maxWidthPx: horizontalInsets
|
|
284856
|
+
maxWidthPx: horizontalInsets,
|
|
284857
|
+
horizontalInsetsPx: horizontalInsets
|
|
284543
284858
|
};
|
|
284544
284859
|
tableCellMetricsCache.set(cacheKey, emptyMetrics);
|
|
284545
284860
|
return emptyMetrics;
|
|
@@ -284553,7 +284868,8 @@ async function measureTableCellContentMetrics(cell2, options) {
|
|
|
284553
284868
|
}
|
|
284554
284869
|
const result = {
|
|
284555
284870
|
minWidthPx: minContentWidthPx + horizontalInsets,
|
|
284556
|
-
maxWidthPx: maxContentWidthPx + horizontalInsets
|
|
284871
|
+
maxWidthPx: maxContentWidthPx + horizontalInsets,
|
|
284872
|
+
horizontalInsetsPx: horizontalInsets
|
|
284557
284873
|
};
|
|
284558
284874
|
tableCellMetricsCache.set(cacheKey, result);
|
|
284559
284875
|
return result;
|
|
@@ -284583,7 +284899,8 @@ async function measureTableAutoFitContentMetrics(table2, workingInput, fixedLayo
|
|
|
284583
284899
|
span,
|
|
284584
284900
|
preferredWidth: normalizedCell?.preferredWidth,
|
|
284585
284901
|
minContentWidth: metrics.minWidthPx,
|
|
284586
|
-
maxContentWidth: metrics.maxWidthPx
|
|
284902
|
+
maxContentWidth: metrics.maxWidthPx,
|
|
284903
|
+
horizontalInsets: metrics.horizontalInsetsPx
|
|
284587
284904
|
};
|
|
284588
284905
|
}))
|
|
284589
284906
|
};
|
|
@@ -284598,7 +284915,8 @@ async function measureTableAutoFitContentMetrics(table2, workingInput, fixedLayo
|
|
|
284598
284915
|
span: cellMetrics.span,
|
|
284599
284916
|
preferredWidth: cellMetrics.preferredWidth,
|
|
284600
284917
|
minContentWidth: cellMetrics.minContentWidth,
|
|
284601
|
-
maxContentWidth: cellMetrics.maxContentWidth
|
|
284918
|
+
maxContentWidth: cellMetrics.maxContentWidth,
|
|
284919
|
+
horizontalInsets: cellMetrics.horizontalInsets
|
|
284602
284920
|
})),
|
|
284603
284921
|
skippedAfter: normalizedRow.skippedAfter ?? []
|
|
284604
284922
|
};
|
|
@@ -284850,18 +285168,7 @@ function clearTextMeasurementCaches() {
|
|
|
284850
285168
|
canvasContext = null;
|
|
284851
285169
|
}
|
|
284852
285170
|
function getTableBorderWidthPx(value) {
|
|
284853
|
-
|
|
284854
|
-
return 0;
|
|
284855
|
-
if (typeof value === "object" && "none" in value && value.none)
|
|
284856
|
-
return 0;
|
|
284857
|
-
const raw = value;
|
|
284858
|
-
const w = typeof raw.width === "number" ? raw.width : typeof raw.size === "number" ? raw.size : 1;
|
|
284859
|
-
const width = Math.max(0, w);
|
|
284860
|
-
if (raw.style === "none")
|
|
284861
|
-
return 0;
|
|
284862
|
-
if (raw.style === "thick")
|
|
284863
|
-
return Math.max(width * 2, 3);
|
|
284864
|
-
return width;
|
|
285171
|
+
return getBorderBandWidthPx(value);
|
|
284865
285172
|
}
|
|
284866
285173
|
function getTableBorderWidths(borders) {
|
|
284867
285174
|
return {
|
|
@@ -286562,12 +286869,17 @@ async function measureTableBlock(block, constraints, fontContext) {
|
|
|
286562
286869
|
});
|
|
286563
286870
|
if (rowspan === 1)
|
|
286564
286871
|
rowBaseHeights[rowIndex] = Math.max(rowBaseHeights[rowIndex], totalCellHeight);
|
|
286565
|
-
else
|
|
286872
|
+
else {
|
|
286873
|
+
const firstBlockMeasure = blockMeasures[0];
|
|
286874
|
+
const firstLineHeight = firstBlockMeasure?.kind === "paragraph" && firstBlockMeasure.lines.length > 0 ? firstBlockMeasure.lines[0].lineHeight : undefined;
|
|
286875
|
+
const minRowHeight = Math.min(totalCellHeight, firstLineHeight != null ? firstLineHeight + paddingTop + paddingBottom : totalCellHeight / rowspan);
|
|
286566
286876
|
spanConstraints.push({
|
|
286567
286877
|
startRow: rowIndex,
|
|
286568
286878
|
rowSpan: rowspan,
|
|
286569
|
-
requiredHeight: totalCellHeight
|
|
286879
|
+
requiredHeight: totalCellHeight,
|
|
286880
|
+
minRowHeight
|
|
286570
286881
|
});
|
|
286882
|
+
}
|
|
286571
286883
|
gridColIndex += colspan;
|
|
286572
286884
|
}
|
|
286573
286885
|
for (let col = gridColIndex;col < gridColumnCount; col++)
|
|
@@ -286579,6 +286891,12 @@ async function measureTableBlock(block, constraints, fontContext) {
|
|
|
286579
286891
|
});
|
|
286580
286892
|
}
|
|
286581
286893
|
const rowHeights = [...rowBaseHeights];
|
|
286894
|
+
for (const constraint of spanConstraints) {
|
|
286895
|
+
const spanLength = Math.min(constraint.rowSpan, rowHeights.length - constraint.startRow);
|
|
286896
|
+
for (let i3 = 0;i3 < spanLength; i3++)
|
|
286897
|
+
if (rowBaseHeights[constraint.startRow + i3] === 0)
|
|
286898
|
+
rowHeights[constraint.startRow + i3] = Math.max(rowHeights[constraint.startRow + i3], constraint.minRowHeight);
|
|
286899
|
+
}
|
|
286582
286900
|
for (const constraint of spanConstraints) {
|
|
286583
286901
|
const { startRow, rowSpan, requiredHeight } = constraint;
|
|
286584
286902
|
if (rowSpan <= 0)
|
|
@@ -286593,6 +286911,34 @@ async function measureTableBlock(block, constraints, fontContext) {
|
|
|
286593
286911
|
rowHeights[startRow + i3] += increment2;
|
|
286594
286912
|
}
|
|
286595
286913
|
}
|
|
286914
|
+
if ((block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse")) !== "separate" && block.rows.length > 0) {
|
|
286915
|
+
const tableBordersForBands = block.attrs?.borders;
|
|
286916
|
+
const bandReservation = (band) => band > 2 ? band - 1 : 0;
|
|
286917
|
+
const gridlineBand = (gridline) => {
|
|
286918
|
+
let band = 0;
|
|
286919
|
+
const rowAbove = gridline > 0 ? block.rows[gridline - 1] : undefined;
|
|
286920
|
+
const rowBelow = gridline < block.rows.length ? block.rows[gridline] : undefined;
|
|
286921
|
+
for (const row2 of [rowAbove, rowBelow]) {
|
|
286922
|
+
if (!row2)
|
|
286923
|
+
continue;
|
|
286924
|
+
const override = row2.attrs?.borders;
|
|
286925
|
+
const eff = override ? {
|
|
286926
|
+
...tableBordersForBands ?? {},
|
|
286927
|
+
...override
|
|
286928
|
+
} : tableBordersForBands;
|
|
286929
|
+
const value = gridline === 0 ? eff?.top : gridline === block.rows.length ? eff?.bottom : eff?.insideH;
|
|
286930
|
+
band = Math.max(band, getBorderBandWidthPx(value));
|
|
286931
|
+
}
|
|
286932
|
+
for (const cell2 of rowAbove?.cells ?? [])
|
|
286933
|
+
band = Math.max(band, getBorderBandWidthPx(cell2.attrs?.borders?.bottom));
|
|
286934
|
+
for (const cell2 of rowBelow?.cells ?? [])
|
|
286935
|
+
band = Math.max(band, getBorderBandWidthPx(cell2.attrs?.borders?.top));
|
|
286936
|
+
return band;
|
|
286937
|
+
};
|
|
286938
|
+
for (let i3 = 0;i3 < block.rows.length; i3++)
|
|
286939
|
+
rowHeights[i3] += bandReservation(gridlineBand(i3));
|
|
286940
|
+
rowHeights[block.rows.length - 1] += bandReservation(gridlineBand(block.rows.length));
|
|
286941
|
+
}
|
|
286596
286942
|
block.rows.forEach((row2, index2) => {
|
|
286597
286943
|
const spec = row2.attrs?.rowHeight;
|
|
286598
286944
|
if (spec?.value != null && Number.isFinite(spec.value))
|
|
@@ -294240,7 +294586,10 @@ var Node$13 = class Node$14 {
|
|
|
294240
294586
|
const headerCells = [];
|
|
294241
294587
|
const cells = [];
|
|
294242
294588
|
for (let index2 = 0;index2 < colsCount; index2++) {
|
|
294243
|
-
const cellAttrs = columnWidths ? {
|
|
294589
|
+
const cellAttrs = columnWidths ? {
|
|
294590
|
+
colwidth: [columnWidths[index2]],
|
|
294591
|
+
tableCellProperties: { cellWidth: cellWidthDxa(columnWidths[index2]) }
|
|
294592
|
+
} : null;
|
|
294244
294593
|
const cell2 = createCell2(types3.tableCell, cellContent, cellAttrs);
|
|
294245
294594
|
if (cell2)
|
|
294246
294595
|
cells.push(cell2);
|
|
@@ -309549,15 +309898,30 @@ menclose::after {
|
|
|
309549
309898
|
single: "solid",
|
|
309550
309899
|
double: "double",
|
|
309551
309900
|
dashed: "dashed",
|
|
309901
|
+
dashSmallGap: "dashed",
|
|
309552
309902
|
dotted: "dotted",
|
|
309553
309903
|
thick: "solid",
|
|
309554
309904
|
triple: "solid",
|
|
309555
309905
|
dotDash: "dashed",
|
|
309556
309906
|
dotDotDash: "dashed",
|
|
309907
|
+
thinThickSmallGap: "solid",
|
|
309908
|
+
thickThinSmallGap: "solid",
|
|
309909
|
+
thinThickThinSmallGap: "solid",
|
|
309910
|
+
thinThickMediumGap: "solid",
|
|
309911
|
+
thickThinMediumGap: "solid",
|
|
309912
|
+
thinThickThinMediumGap: "solid",
|
|
309913
|
+
thinThickLargeGap: "solid",
|
|
309914
|
+
thickThinLargeGap: "solid",
|
|
309915
|
+
thinThickThinLargeGap: "solid",
|
|
309557
309916
|
wave: "solid",
|
|
309558
|
-
doubleWave: "solid"
|
|
309917
|
+
doubleWave: "solid",
|
|
309918
|
+
dashDotStroked: "dashed",
|
|
309919
|
+
threeDEmboss: "ridge",
|
|
309920
|
+
threeDEngrave: "groove",
|
|
309921
|
+
outset: "solid",
|
|
309922
|
+
inset: "solid"
|
|
309559
309923
|
}[style2];
|
|
309560
|
-
}, isValidHexColor2 = (color2) => /^#[0-9A-Fa-f]{6}$/.test(color2), applyBorder = (element3, side, border) => {
|
|
309924
|
+
}, isValidHexColor2 = (color2) => /^#[0-9A-Fa-f]{6}$/.test(color2), applyBorder = (element3, side, border, widthOverridePx) => {
|
|
309561
309925
|
if (!border)
|
|
309562
309926
|
return;
|
|
309563
309927
|
if (border.style === "none" || border.width === 0) {
|
|
@@ -309565,18 +309929,40 @@ menclose::after {
|
|
|
309565
309929
|
return;
|
|
309566
309930
|
}
|
|
309567
309931
|
const style2 = borderStyleToCSS(border.style);
|
|
309568
|
-
const width = border.width ?? 1;
|
|
309569
309932
|
const color2 = border.color ?? "#000000";
|
|
309570
309933
|
const safeColor = isValidHexColor2(color2) ? color2 : "#000000";
|
|
309571
|
-
const actualWidth =
|
|
309934
|
+
const actualWidth = widthOverridePx ?? getBorderBandWidthPx(border);
|
|
309572
309935
|
element3.style[`border${side}`] = `${actualWidth}px ${style2} ${safeColor}`;
|
|
309573
|
-
}, applyCellBorders = (element3, borders) => {
|
|
309936
|
+
}, applyCellBorders = (element3, borders, widthOverridesPx) => {
|
|
309574
309937
|
if (!borders)
|
|
309575
309938
|
return;
|
|
309576
309939
|
applyBorder(element3, "Top", borders.top);
|
|
309577
|
-
applyBorder(element3, "Right", borders.right);
|
|
309940
|
+
applyBorder(element3, "Right", borders.right, widthOverridesPx?.right);
|
|
309578
309941
|
applyBorder(element3, "Bottom", borders.bottom);
|
|
309579
|
-
applyBorder(element3, "Left", borders.left);
|
|
309942
|
+
applyBorder(element3, "Left", borders.left, widthOverridesPx?.left);
|
|
309943
|
+
}, BEVEL_LIGHT_AUTO = "#F0F0F0", BEVEL_DARK_AUTO = "#A0A0A0", bevelDarkColor = (color2) => {
|
|
309944
|
+
if (!color2 || !/^#[0-9A-Fa-f]{6}$/.test(color2) || color2.toLowerCase() === "#000000")
|
|
309945
|
+
return BEVEL_DARK_AUTO;
|
|
309946
|
+
const half = (i3) => Math.floor(parseInt(color2.slice(i3, i3 + 2), 16) / 2);
|
|
309947
|
+
return `#${[
|
|
309948
|
+
1,
|
|
309949
|
+
3,
|
|
309950
|
+
5
|
|
309951
|
+
].map((i3) => half(i3).toString(16).padStart(2, "0")).join("")}`;
|
|
309952
|
+
}, bevelLightColor = (color2) => {
|
|
309953
|
+
if (!color2 || !/^#[0-9A-Fa-f]{6}$/.test(color2) || color2.toLowerCase() === "#000000")
|
|
309954
|
+
return BEVEL_LIGHT_AUTO;
|
|
309955
|
+
return color2;
|
|
309956
|
+
}, bevelToneSpec = (spec, visualSide, owner) => {
|
|
309957
|
+
if (!spec || spec.style !== "outset" && spec.style !== "inset")
|
|
309958
|
+
return spec;
|
|
309959
|
+
const raisedSide = visualSide === "top" || visualSide === "left";
|
|
309960
|
+
const light = spec.style === "outset" === (owner === "table") === raisedSide;
|
|
309961
|
+
return {
|
|
309962
|
+
...spec,
|
|
309963
|
+
style: "single",
|
|
309964
|
+
color: light ? bevelLightColor(spec.color) : bevelDarkColor(spec.color)
|
|
309965
|
+
};
|
|
309580
309966
|
}, borderValueToSpec = (value) => {
|
|
309581
309967
|
if (!value)
|
|
309582
309968
|
return;
|
|
@@ -310685,7 +311071,7 @@ menclose::after {
|
|
|
310685
311071
|
hasSdtContainerChrome
|
|
310686
311072
|
};
|
|
310687
311073
|
}, renderTableCell = (deps) => {
|
|
310688
|
-
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;
|
|
311074
|
+
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;
|
|
310689
311075
|
const padding = cell2?.attrs?.padding || {
|
|
310690
311076
|
top: 0,
|
|
310691
311077
|
left: 4,
|
|
@@ -310693,9 +311079,16 @@ menclose::after {
|
|
|
310693
311079
|
bottom: 0
|
|
310694
311080
|
};
|
|
310695
311081
|
const buildTableImageHyperlinkAnchor = (imageEl, hyperlink, display) => buildImageHyperlinkAnchor(doc$12, imageEl, hyperlink, display);
|
|
310696
|
-
const
|
|
311082
|
+
const compoundBandEats = (border, bandInCellPx) => {
|
|
311083
|
+
const profile = border ? getBorderBandProfile(border) : null;
|
|
311084
|
+
if (!profile)
|
|
311085
|
+
return 0;
|
|
311086
|
+
const bandInCell = bandInCellPx ?? profile.band;
|
|
311087
|
+
return Math.max(0, bandInCell - profile.band / 2);
|
|
311088
|
+
};
|
|
311089
|
+
const paddingLeft = Math.max(0, (isRtl ? padding.right ?? 4 : padding.left ?? 4) - compoundBandEats(borders?.left, borderBandOverridesPx?.left));
|
|
310697
311090
|
const paddingTop = padding.top ?? 0;
|
|
310698
|
-
const paddingRight = isRtl ? padding.left ?? 4 : padding.right ?? 4;
|
|
311091
|
+
const paddingRight = Math.max(0, (isRtl ? padding.left ?? 4 : padding.right ?? 4) - compoundBandEats(borders?.right, borderBandOverridesPx?.right));
|
|
310699
311092
|
const paddingBottom = padding.bottom ?? 0;
|
|
310700
311093
|
const cellEl = doc$12.createElement("div");
|
|
310701
311094
|
cellEl.style.position = "absolute";
|
|
@@ -310710,7 +311103,7 @@ menclose::after {
|
|
|
310710
311103
|
cellEl.style.paddingRight = `${paddingRight}px`;
|
|
310711
311104
|
cellEl.style.paddingBottom = `${paddingBottom}px`;
|
|
310712
311105
|
if (borders)
|
|
310713
|
-
applyCellBorders(cellEl, borders);
|
|
311106
|
+
applyCellBorders(cellEl, borders, borderBandOverridesPx);
|
|
310714
311107
|
else if (useDefaultBorder)
|
|
310715
311108
|
cellEl.style.border = "1px solid rgba(0,0,0,0.6)";
|
|
310716
311109
|
if (cell2?.attrs?.background)
|
|
@@ -311184,16 +311577,25 @@ menclose::after {
|
|
|
311184
311577
|
elem.dataset.trackChangeAuthorColor = meta2.color;
|
|
311185
311578
|
if (meta2.date)
|
|
311186
311579
|
elem.dataset.trackChangeDate = meta2.date;
|
|
311187
|
-
}, hasAnyResolvedBorder = (borders) => Boolean(borders.top || borders.right || borders.bottom || borders.left), resolveRenderedCellBorders = ({ cellBorders, hasBordersAttribute, tableBorders, cellPosition, cellSpacingPx, continuesFromPrev, continuesOnNext, aboveCellBorders, leftCellBorders, rightCellBorders,
|
|
311580
|
+
}, hasAnyResolvedBorder = (borders) => Boolean(borders.top || borders.right || borders.bottom || borders.left), resolveRenderedCellBorders = ({ cellBorders, hasBordersAttribute, tableBorders, cellPosition, cellSpacingPx, continuesFromPrev, continuesOnNext, aboveCellBorders, leftCellBorders, rightCellBorders, separateBorders, nextRowSuppressesSharedTop }) => {
|
|
311188
311581
|
const hasExplicitBorders = hasExplicitCellBorders(cellBorders);
|
|
311189
311582
|
const cellBounds = getTableCellGridBounds(cellPosition);
|
|
311190
311583
|
const touchesTopBoundary = cellBounds.touchesTopEdge || continuesFromPrev;
|
|
311191
|
-
const touchesBottomBoundary = cellBounds.touchesBottomEdge || continuesOnNext
|
|
311192
|
-
const hasInteriorNeighborBorder = !touchesTopBoundary &&
|
|
311584
|
+
const touchesBottomBoundary = cellBounds.touchesBottomEdge || continuesOnNext;
|
|
311585
|
+
const hasInteriorNeighborBorder = !touchesTopBoundary && isPresentBorder(aboveCellBorders?.bottom) || !cellBounds.touchesLeftEdge && isPresentBorder(leftCellBorders?.right);
|
|
311586
|
+
if (separateBorders && cellSpacingPx === 0) {
|
|
311587
|
+
const cb = cellBorders ?? {};
|
|
311588
|
+
return {
|
|
311589
|
+
top: resolveTableBorderValue(cb.top, touchesTopBoundary ? tableBorders?.top : tableBorders?.insideH),
|
|
311590
|
+
right: resolveTableBorderValue(cb.right, cellBounds.touchesRightEdge ? tableBorders?.right : tableBorders?.insideV),
|
|
311591
|
+
bottom: resolveTableBorderValue(cb.bottom, touchesBottomBoundary ? tableBorders?.bottom : tableBorders?.insideH),
|
|
311592
|
+
left: resolveTableBorderValue(cb.left, cellBounds.touchesLeftEdge ? tableBorders?.left : tableBorders?.insideV)
|
|
311593
|
+
};
|
|
311594
|
+
}
|
|
311193
311595
|
if (cellSpacingPx === 0 && (hasExplicitBorders || hasInteriorNeighborBorder)) {
|
|
311194
311596
|
const cb = cellBorders ?? {};
|
|
311195
311597
|
return {
|
|
311196
|
-
top: touchesTopBoundary ? resolveTableBorderValue(cb.top, tableBorders?.top) :
|
|
311598
|
+
top: touchesTopBoundary ? resolveTableBorderValue(cb.top, tableBorders?.top) : resolveBorderConflict(cb.top, aboveCellBorders?.bottom) ?? (isExplicitNoneBorder(cb.top) && isExplicitNoneBorder(aboveCellBorders?.bottom) ? undefined : borderValueToSpec(tableBorders?.insideH)),
|
|
311197
311599
|
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),
|
|
311198
311600
|
right: cellBounds.touchesRightEdge ? resolveTableBorderValue(cb.right, tableBorders?.right) : isPresentBorder(cb.right) && !isPresentBorder(rightCellBorders?.left) ? cb.right : undefined,
|
|
311199
311601
|
bottom: touchesBottomBoundary ? resolveTableBorderValue(cb.bottom, tableBorders?.bottom) : undefined
|
|
@@ -311233,8 +311635,102 @@ menclose::after {
|
|
|
311233
311635
|
bottom: touchesBottomBoundary ? borderValueToSpec(tableBorders.bottom) : interiorBottom,
|
|
311234
311636
|
left: baseBorders.left
|
|
311235
311637
|
};
|
|
311638
|
+
}, appendCompoundBorderRects = (doc$12, container, cellElement, borders, rect, edges) => {
|
|
311639
|
+
if (!borders)
|
|
311640
|
+
return;
|
|
311641
|
+
const { ownsBottomBand, rightIsBoundary, leftIsBoundary, suppressMid } = edges;
|
|
311642
|
+
const sideInfo = [
|
|
311643
|
+
"top",
|
|
311644
|
+
"right",
|
|
311645
|
+
"bottom",
|
|
311646
|
+
"left"
|
|
311647
|
+
].map((side) => {
|
|
311648
|
+
const spec = borders[side];
|
|
311649
|
+
const profile = spec ? getBorderBandProfile(spec) : null;
|
|
311650
|
+
if (!spec || !profile)
|
|
311651
|
+
return null;
|
|
311652
|
+
if (isNativeCssDoubleStyle(spec.style)) {
|
|
311653
|
+
if (side === "top" || side === "bottom" && ownsBottomBand || side === "left" && leftIsBoundary || side === "right" && rightIsBoundary)
|
|
311654
|
+
return null;
|
|
311655
|
+
}
|
|
311656
|
+
const { segments } = profile;
|
|
311657
|
+
return {
|
|
311658
|
+
side,
|
|
311659
|
+
band: Math.max(1, Math.round(profile.band)),
|
|
311660
|
+
outerRule: Math.max(1, Math.round(segments[0])),
|
|
311661
|
+
innerRule: Math.max(1, Math.round(segments[segments.length - 1])),
|
|
311662
|
+
midRule: segments.length === 5 ? Math.max(1, Math.round(segments[2])) : 0,
|
|
311663
|
+
midOffset: segments.length === 5 ? Math.round(segments[0] + segments[1]) : 0,
|
|
311664
|
+
color: spec.color && /^#[0-9A-Fa-f]{6}$/.test(spec.color) ? spec.color : "#000000"
|
|
311665
|
+
};
|
|
311666
|
+
});
|
|
311667
|
+
if (!sideInfo.some(Boolean))
|
|
311668
|
+
return;
|
|
311669
|
+
const x0$1 = Math.round(rect.x);
|
|
311670
|
+
const y0 = Math.round(rect.y);
|
|
311671
|
+
const x1 = Math.round(rect.x + rect.width);
|
|
311672
|
+
const y1 = Math.round(rect.y + rect.height);
|
|
311673
|
+
for (const info of sideInfo) {
|
|
311674
|
+
if (!info)
|
|
311675
|
+
continue;
|
|
311676
|
+
const cssSide = info.side[0].toUpperCase() + info.side.slice(1);
|
|
311677
|
+
cellElement.style[`border${cssSide}Color`] = "transparent";
|
|
311678
|
+
}
|
|
311679
|
+
const [top$1, right$1, bottom$1, left$1] = sideInfo;
|
|
311680
|
+
const rectEl = doc$12.createElement("div");
|
|
311681
|
+
rectEl.className = "superdoc-compound-border-rect";
|
|
311682
|
+
const st = rectEl.style;
|
|
311683
|
+
st.position = "absolute";
|
|
311684
|
+
st.boxSizing = "border-box";
|
|
311685
|
+
st.pointerEvents = "none";
|
|
311686
|
+
const topInset = top$1 ? top$1.band - top$1.innerRule : 0;
|
|
311687
|
+
const leftInset = left$1 ? leftIsBoundary ? left$1.band - left$1.innerRule : Math.round(left$1.band / 2) - left$1.innerRule : 0;
|
|
311688
|
+
const bottomInset = bottom$1 ? ownsBottomBand ? bottom$1.band - bottom$1.innerRule : Math.round(bottom$1.band / 2) - bottom$1.outerRule : 0;
|
|
311689
|
+
const rightInset = right$1 ? rightIsBoundary ? right$1.band - right$1.innerRule : Math.round(right$1.band / 2) - right$1.outerRule : 0;
|
|
311690
|
+
st.left = `${x0$1 + leftInset}px`;
|
|
311691
|
+
st.top = `${y0 + topInset}px`;
|
|
311692
|
+
st.width = `${x1 - x0$1 - leftInset - rightInset}px`;
|
|
311693
|
+
st.height = `${y1 - y0 - topInset - bottomInset}px`;
|
|
311694
|
+
if (top$1)
|
|
311695
|
+
st.borderTop = `${top$1.innerRule}px solid ${top$1.color}`;
|
|
311696
|
+
if (bottom$1)
|
|
311697
|
+
st.borderBottom = `${ownsBottomBand ? bottom$1.innerRule : bottom$1.outerRule}px solid ${bottom$1.color}`;
|
|
311698
|
+
if (left$1)
|
|
311699
|
+
st.borderLeft = `${left$1.innerRule}px solid ${left$1.color}`;
|
|
311700
|
+
if (right$1)
|
|
311701
|
+
st.borderRight = `${rightIsBoundary ? right$1.innerRule : right$1.outerRule}px solid ${right$1.color}`;
|
|
311702
|
+
container.appendChild(rectEl);
|
|
311703
|
+
const midTop = top$1 && top$1.midRule > 0 && !suppressMid?.top ? top$1 : null;
|
|
311704
|
+
const midLeft = left$1 && left$1.midRule > 0 && !suppressMid?.left ? left$1 : null;
|
|
311705
|
+
const midBottom = bottom$1 && bottom$1.midRule > 0 && ownsBottomBand && !suppressMid?.bottom ? bottom$1 : null;
|
|
311706
|
+
const midRight = right$1 && right$1.midRule > 0 && rightIsBoundary && !suppressMid?.right ? right$1 : null;
|
|
311707
|
+
if (midTop || midLeft || midBottom || midRight) {
|
|
311708
|
+
const mid = doc$12.createElement("div");
|
|
311709
|
+
mid.className = "superdoc-compound-border-mid";
|
|
311710
|
+
const ms = mid.style;
|
|
311711
|
+
ms.position = "absolute";
|
|
311712
|
+
ms.boxSizing = "border-box";
|
|
311713
|
+
ms.pointerEvents = "none";
|
|
311714
|
+
const tIn = midTop ? midTop.midOffset : 0;
|
|
311715
|
+
const lIn = midLeft ? midLeft.midOffset : 0;
|
|
311716
|
+
const bIn = midBottom ? midBottom.midOffset : 0;
|
|
311717
|
+
const rIn = midRight ? midRight.midOffset : 0;
|
|
311718
|
+
ms.left = `${x0$1 + lIn}px`;
|
|
311719
|
+
ms.top = `${y0 + tIn}px`;
|
|
311720
|
+
ms.width = `${x1 - x0$1 - lIn - rIn}px`;
|
|
311721
|
+
ms.height = `${y1 - y0 - tIn - bIn}px`;
|
|
311722
|
+
if (midTop)
|
|
311723
|
+
ms.borderTop = `${midTop.midRule}px solid ${midTop.color}`;
|
|
311724
|
+
if (midBottom)
|
|
311725
|
+
ms.borderBottom = `${midBottom.midRule}px solid ${midBottom.color}`;
|
|
311726
|
+
if (midLeft)
|
|
311727
|
+
ms.borderLeft = `${midLeft.midRule}px solid ${midLeft.color}`;
|
|
311728
|
+
if (midRight)
|
|
311729
|
+
ms.borderRight = `${midRight.midRule}px solid ${midRight.color}`;
|
|
311730
|
+
container.appendChild(mid);
|
|
311731
|
+
}
|
|
311236
311732
|
}, renderTableRow = (deps) => {
|
|
311237
|
-
const { doc: doc$12, container, rowIndex, y: y$1, rowMeasure, row: row2, prevRow, prevRowMeasure, nextRow,
|
|
311733
|
+
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;
|
|
311238
311734
|
const totalCols = columnWidths.length;
|
|
311239
311735
|
const rowTrackedChange = row2?.attrs?.trackedChange;
|
|
311240
311736
|
let rowTrackedChangeConfig;
|
|
@@ -311298,17 +311794,6 @@ menclose::after {
|
|
|
311298
311794
|
return cells[i3]?.attrs?.borders;
|
|
311299
311795
|
}
|
|
311300
311796
|
};
|
|
311301
|
-
const findCellRightEdgeAtColumn = (measureCells, gridCol) => {
|
|
311302
|
-
if (!measureCells)
|
|
311303
|
-
return;
|
|
311304
|
-
for (let i3 = 0;i3 < measureCells.length; i3++) {
|
|
311305
|
-
const start$1 = measureCells[i3].gridColumnStart ?? i3;
|
|
311306
|
-
const span = measureCells[i3].colSpan ?? 1;
|
|
311307
|
-
if (gridCol >= start$1 && gridCol < start$1 + span)
|
|
311308
|
-
return start$1 + span;
|
|
311309
|
-
}
|
|
311310
|
-
};
|
|
311311
|
-
const nextRowMaxCol = nextRowOccupiedRightCol != null && nextRowOccupiedRightCol > 0 ? nextRowOccupiedRightCol : nextRowMeasure?.cells?.length ? Math.max(...nextRowMeasure.cells.map((c) => (c.gridColumnStart ?? 0) + (c.colSpan ?? 1))) : Infinity;
|
|
311312
311797
|
for (let cellIndex = 0;cellIndex < rowMeasure.cells.length; cellIndex += 1) {
|
|
311313
311798
|
const cellMeasure = rowMeasure.cells[cellIndex];
|
|
311314
311799
|
const cell2 = row2?.cells?.[cellIndex];
|
|
@@ -311329,8 +311814,6 @@ menclose::after {
|
|
|
311329
311814
|
const aboveCellBorders = findCellBordersAtColumn(prevRow?.cells, prevRowMeasure?.cells, gridColumnStart);
|
|
311330
311815
|
const leftCellBorders = gridColumnStart > 0 ? findCellBordersAtColumn(row2?.cells, rowMeasure.cells, gridColumnStart - 1) : undefined;
|
|
311331
311816
|
const rightCellBorders = findCellBordersAtColumn(row2?.cells, rowMeasure.cells, gridColumnStart + colSpan);
|
|
311332
|
-
const nextRowLeavesRightGap = gridColumnStart + colSpan > nextRowMaxCol;
|
|
311333
|
-
const aboveCellRightEdge = findCellRightEdgeAtColumn(prevRowMeasure?.cells, gridColumnStart);
|
|
311334
311817
|
const resolvedBorders = resolveRenderedCellBorders({
|
|
311335
311818
|
cellBorders: cellBordersAttr,
|
|
311336
311819
|
hasBordersAttribute,
|
|
@@ -311342,11 +311825,16 @@ menclose::after {
|
|
|
311342
311825
|
aboveCellBorders,
|
|
311343
311826
|
leftCellBorders,
|
|
311344
311827
|
rightCellBorders,
|
|
311345
|
-
|
|
311346
|
-
deferTopToAboveCell: aboveCellRightEdge !== undefined && aboveCellRightEdge > rowRightEdgeCol,
|
|
311828
|
+
separateBorders,
|
|
311347
311829
|
nextRowSuppressesSharedTop
|
|
311348
311830
|
});
|
|
311349
311831
|
const finalBorders = isRtl && resolvedBorders ? swapCellBordersLR(resolvedBorders) : resolvedBorders;
|
|
311832
|
+
const tonedBorders = separateBorders && finalBorders ? {
|
|
311833
|
+
top: bevelToneSpec(finalBorders.top, "top", "cell"),
|
|
311834
|
+
right: bevelToneSpec(finalBorders.right, "right", "cell"),
|
|
311835
|
+
bottom: bevelToneSpec(finalBorders.bottom, "bottom", "cell"),
|
|
311836
|
+
left: bevelToneSpec(finalBorders.left, "left", "cell")
|
|
311837
|
+
} : finalBorders;
|
|
311350
311838
|
let cellHeight;
|
|
311351
311839
|
if (partialRow)
|
|
311352
311840
|
cellHeight = partialRow.partialHeight;
|
|
@@ -311359,6 +311847,34 @@ menclose::after {
|
|
|
311359
311847
|
const computedCellWidth = calculateColspanWidth(gridColumnStart, colSpan);
|
|
311360
311848
|
if (isRtl && computedCellWidth > 0)
|
|
311361
311849
|
x = tableContentWidth - x - computedCellWidth;
|
|
311850
|
+
const cellGridBounds = getTableCellGridBounds(cellPosition);
|
|
311851
|
+
const cellIsIntentionallyBorderless = hasBordersAttribute && !hasExplicitCellBorders(cellBordersAttr);
|
|
311852
|
+
const cb = cellBordersAttr ?? {};
|
|
311853
|
+
const effectiveSideSpecs = cellIsIntentionallyBorderless ? {} : {
|
|
311854
|
+
top: cellGridBounds.touchesTopEdge || continuesFromPrev === true ? resolveTableBorderValue(cb.top, effectiveTableBorders?.top) : resolveBorderConflict(cb.top, aboveCellBorders?.bottom) ?? borderValueToSpec(effectiveTableBorders?.insideH),
|
|
311855
|
+
bottom: cellGridBounds.touchesBottomEdge || continuesOnNext === true ? resolveTableBorderValue(cb.bottom, effectiveTableBorders?.bottom) : resolveBorderConflict(cb.bottom, undefined) ?? borderValueToSpec(effectiveTableBorders?.insideH),
|
|
311856
|
+
left: cellGridBounds.touchesLeftEdge ? resolveTableBorderValue(cb.left, effectiveTableBorders?.left) : resolveBorderConflict(cb.left, leftCellBorders?.right) ?? borderValueToSpec(effectiveTableBorders?.insideV),
|
|
311857
|
+
right: cellGridBounds.touchesRightEdge ? resolveTableBorderValue(cb.right, effectiveTableBorders?.right) : resolveBorderConflict(cb.right, rightCellBorders?.left) ?? borderValueToSpec(effectiveTableBorders?.insideV)
|
|
311858
|
+
};
|
|
311859
|
+
const rectBorders = (isRtl ? swapCellBordersLR(effectiveSideSpecs) : effectiveSideSpecs) ?? effectiveSideSpecs;
|
|
311860
|
+
const visualTouchesLeft = isRtl ? cellGridBounds.touchesRightEdge : cellGridBounds.touchesLeftEdge;
|
|
311861
|
+
const visualTouchesRight = isRtl ? cellGridBounds.touchesLeftEdge : cellGridBounds.touchesRightEdge;
|
|
311862
|
+
const leftStraddleProfile = !visualTouchesLeft && rectBorders.left ? getBorderBandProfile(rectBorders.left) : null;
|
|
311863
|
+
const rightStraddleProfile = !visualTouchesRight && rectBorders.right ? getBorderBandProfile(rectBorders.right) : null;
|
|
311864
|
+
let paintBorders = tonedBorders;
|
|
311865
|
+
let borderBandOverridesPx;
|
|
311866
|
+
if (leftStraddleProfile || rightStraddleProfile) {
|
|
311867
|
+
paintBorders = { ...tonedBorders ?? {} };
|
|
311868
|
+
borderBandOverridesPx = {};
|
|
311869
|
+
if (leftStraddleProfile) {
|
|
311870
|
+
paintBorders.left = rectBorders.left;
|
|
311871
|
+
borderBandOverridesPx.left = leftStraddleProfile.band / 2;
|
|
311872
|
+
}
|
|
311873
|
+
if (rightStraddleProfile) {
|
|
311874
|
+
paintBorders.right = rectBorders.right;
|
|
311875
|
+
borderBandOverridesPx.right = rightStraddleProfile.band / 2;
|
|
311876
|
+
}
|
|
311877
|
+
}
|
|
311362
311878
|
const { cellElement } = renderTableCell({
|
|
311363
311879
|
doc: doc$12,
|
|
311364
311880
|
x,
|
|
@@ -311366,7 +311882,8 @@ menclose::after {
|
|
|
311366
311882
|
rowHeight: cellHeight,
|
|
311367
311883
|
cellMeasure,
|
|
311368
311884
|
cell: cell2,
|
|
311369
|
-
borders:
|
|
311885
|
+
borders: paintBorders,
|
|
311886
|
+
borderBandOverridesPx,
|
|
311370
311887
|
useDefaultBorder: false,
|
|
311371
311888
|
renderLine: renderLine$1,
|
|
311372
311889
|
captureLineSnapshot,
|
|
@@ -311389,7 +311906,68 @@ menclose::after {
|
|
|
311389
311906
|
if (rowTrackedChange && rowTrackedChangeConfig)
|
|
311390
311907
|
applyRowTrackedChangeToCell(cellElement, rowTrackedChange, rowTrackedChangeConfig);
|
|
311391
311908
|
container.appendChild(cellElement);
|
|
311909
|
+
const tableProvidesMid = (value) => {
|
|
311910
|
+
const profile = value != null && typeof value === "object" ? getBorderBandProfile(value) : null;
|
|
311911
|
+
return profile != null && profile.segments.length === 5;
|
|
311912
|
+
};
|
|
311913
|
+
const suppressMid = {
|
|
311914
|
+
top: tableProvidesMid(cellGridBounds.touchesTopEdge || continuesFromPrev === true ? effectiveTableBorders?.top : effectiveTableBorders?.insideH),
|
|
311915
|
+
bottom: tableProvidesMid(cellGridBounds.touchesBottomEdge || continuesOnNext === true ? effectiveTableBorders?.bottom : effectiveTableBorders?.insideH),
|
|
311916
|
+
left: tableProvidesMid(visualTouchesLeft ? isRtl ? effectiveTableBorders?.right : effectiveTableBorders?.left : effectiveTableBorders?.insideV),
|
|
311917
|
+
right: tableProvidesMid(visualTouchesRight ? isRtl ? effectiveTableBorders?.left : effectiveTableBorders?.right : effectiveTableBorders?.insideV)
|
|
311918
|
+
};
|
|
311919
|
+
appendCompoundBorderRects(doc$12, container, cellElement, rectBorders, {
|
|
311920
|
+
x,
|
|
311921
|
+
y: y$1,
|
|
311922
|
+
width: computedCellWidth > 0 ? computedCellWidth : cellMeasure.width ?? 0,
|
|
311923
|
+
height: cellHeight
|
|
311924
|
+
}, {
|
|
311925
|
+
ownsBottomBand: cellGridBounds.touchesBottomEdge || continuesOnNext === true,
|
|
311926
|
+
rightIsBoundary: visualTouchesRight,
|
|
311927
|
+
leftIsBoundary: visualTouchesLeft,
|
|
311928
|
+
suppressMid
|
|
311929
|
+
});
|
|
311930
|
+
}
|
|
311931
|
+
}, buildColumnOccupancy = (rows, numCols) => {
|
|
311932
|
+
const occupancy = rows.map(() => new Array(numCols).fill(null));
|
|
311933
|
+
rows.forEach((row2, rowIndex) => {
|
|
311934
|
+
row2?.cells?.forEach((cell2, cellIndex) => {
|
|
311935
|
+
const startCol = cell2.gridColumnStart ?? 0;
|
|
311936
|
+
const endCol = Math.min(numCols, startCol + (cell2.colSpan ?? 1));
|
|
311937
|
+
const endRow = Math.min(rows.length, rowIndex + (cell2.rowSpan ?? 1));
|
|
311938
|
+
const ref$1 = {
|
|
311939
|
+
rowIndex,
|
|
311940
|
+
cellIndex
|
|
311941
|
+
};
|
|
311942
|
+
for (let r$1 = rowIndex;r$1 < endRow; r$1 += 1)
|
|
311943
|
+
for (let c = startCol;c < endCol; c += 1)
|
|
311944
|
+
occupancy[r$1][c] = ref$1;
|
|
311945
|
+
});
|
|
311946
|
+
});
|
|
311947
|
+
return occupancy;
|
|
311948
|
+
}, computeBoundaryGapSegments = (occupancy, belowRowIndex) => {
|
|
311949
|
+
const above = occupancy[belowRowIndex - 1];
|
|
311950
|
+
const below = occupancy[belowRowIndex];
|
|
311951
|
+
if (!above || !below)
|
|
311952
|
+
return [];
|
|
311953
|
+
const segments = [];
|
|
311954
|
+
let current = null;
|
|
311955
|
+
for (let c = 0;c < above.length; c += 1) {
|
|
311956
|
+
const aboveCell = above[c];
|
|
311957
|
+
const isGap = aboveCell !== null && below[c] === null;
|
|
311958
|
+
if (isGap && current && current.aboveCell === aboveCell)
|
|
311959
|
+
current.endColExclusive = c + 1;
|
|
311960
|
+
else if (isGap) {
|
|
311961
|
+
current = {
|
|
311962
|
+
startCol: c,
|
|
311963
|
+
endColExclusive: c + 1,
|
|
311964
|
+
aboveCell
|
|
311965
|
+
};
|
|
311966
|
+
segments.push(current);
|
|
311967
|
+
} else
|
|
311968
|
+
current = null;
|
|
311392
311969
|
}
|
|
311970
|
+
return segments;
|
|
311393
311971
|
}, renderTableFragment = (deps) => {
|
|
311394
311972
|
const { doc: doc$12, fragment: fragment2, 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;
|
|
311395
311973
|
if (!doc$12) {
|
|
@@ -311541,11 +312119,23 @@ menclose::after {
|
|
|
311541
312119
|
}
|
|
311542
312120
|
if (block.id)
|
|
311543
312121
|
container.setAttribute("data-sd-block-id", block.id);
|
|
311544
|
-
|
|
311545
|
-
|
|
311546
|
-
|
|
311547
|
-
applyBorder(container, "
|
|
311548
|
-
applyBorder(container, "
|
|
312122
|
+
const borderCollapse = block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse");
|
|
312123
|
+
const separateBorders = borderCollapse === "separate";
|
|
312124
|
+
if (borderCollapse === "separate" && tableBorders) {
|
|
312125
|
+
applyBorder(container, "Top", bevelToneSpec(borderValueToSpec(tableBorders.top), "top", "table"));
|
|
312126
|
+
applyBorder(container, "Right", bevelToneSpec(borderValueToSpec(isRtl ? tableBorders.left : tableBorders.right), "right", "table"));
|
|
312127
|
+
applyBorder(container, "Bottom", bevelToneSpec(borderValueToSpec(tableBorders.bottom), "bottom", "table"));
|
|
312128
|
+
applyBorder(container, "Left", bevelToneSpec(borderValueToSpec(isRtl ? tableBorders.right : tableBorders.left), "left", "table"));
|
|
312129
|
+
for (const [cssSide, value] of [
|
|
312130
|
+
["Top", tableBorders.top],
|
|
312131
|
+
["Right", isRtl ? tableBorders.left : tableBorders.right],
|
|
312132
|
+
["Bottom", tableBorders.bottom],
|
|
312133
|
+
["Left", isRtl ? tableBorders.right : tableBorders.left]
|
|
312134
|
+
]) {
|
|
312135
|
+
const spec = borderValueToSpec(value);
|
|
312136
|
+
if (spec && getBorderBandProfile(spec) && !isNativeCssDoubleStyle(spec.style))
|
|
312137
|
+
container.style[`border${cssSide}Color`] = "transparent";
|
|
312138
|
+
}
|
|
311549
312139
|
}
|
|
311550
312140
|
const allRowHeights = measure.rows.map((r$1, idx) => {
|
|
311551
312141
|
if (fragment2.partialRow && fragment2.partialRow.rowIndex === idx)
|
|
@@ -311578,9 +312168,8 @@ menclose::after {
|
|
|
311578
312168
|
prevRow: r$1 > 0 ? block.rows[r$1 - 1] : undefined,
|
|
311579
312169
|
prevRowMeasure: r$1 > 0 ? measure.rows[r$1 - 1] : undefined,
|
|
311580
312170
|
nextRow: r$1 < block.rows.length - 1 ? block.rows[r$1 + 1] : undefined,
|
|
311581
|
-
nextRowMeasure: r$1 < block.rows.length - 1 ? measure.rows[r$1 + 1] : undefined,
|
|
311582
312171
|
rowOccupiedRightCol: rowOccupiedRightCols[r$1],
|
|
311583
|
-
|
|
312172
|
+
separateBorders,
|
|
311584
312173
|
totalRows: block.rows.length,
|
|
311585
312174
|
tableBorders,
|
|
311586
312175
|
columnWidths: effectiveColumnWidths,
|
|
@@ -311684,10 +312273,16 @@ menclose::after {
|
|
|
311684
312273
|
}
|
|
311685
312274
|
}
|
|
311686
312275
|
}
|
|
312276
|
+
const interiorRowBoundaries = [];
|
|
311687
312277
|
for (let r$1 = fragment2.fromRow;r$1 < fragment2.toRow; r$1 += 1) {
|
|
311688
312278
|
const rowMeasure = measure.rows[r$1];
|
|
311689
312279
|
if (!rowMeasure)
|
|
311690
312280
|
break;
|
|
312281
|
+
if (r$1 > fragment2.fromRow)
|
|
312282
|
+
interiorRowBoundaries.push({
|
|
312283
|
+
y: y$1,
|
|
312284
|
+
belowRowIndex: r$1
|
|
312285
|
+
});
|
|
311691
312286
|
const isFirstRenderedBodyRow = r$1 === fragment2.fromRow;
|
|
311692
312287
|
const isLastRenderedBodyRow = r$1 === fragment2.toRow - 1;
|
|
311693
312288
|
const partialRowData = fragment2.partialRow && fragment2.partialRow.rowIndex === r$1 ? fragment2.partialRow : undefined;
|
|
@@ -311702,9 +312297,8 @@ menclose::after {
|
|
|
311702
312297
|
prevRow: r$1 > 0 ? block.rows[r$1 - 1] : undefined,
|
|
311703
312298
|
prevRowMeasure: r$1 > 0 ? measure.rows[r$1 - 1] : undefined,
|
|
311704
312299
|
nextRow: r$1 < block.rows.length - 1 ? block.rows[r$1 + 1] : undefined,
|
|
311705
|
-
nextRowMeasure: r$1 < block.rows.length - 1 ? measure.rows[r$1 + 1] : undefined,
|
|
311706
312300
|
rowOccupiedRightCol: rowOccupiedRightCols[r$1],
|
|
311707
|
-
|
|
312301
|
+
separateBorders,
|
|
311708
312302
|
totalRows: block.rows.length,
|
|
311709
312303
|
tableBorders,
|
|
311710
312304
|
columnWidths: effectiveColumnWidths,
|
|
@@ -311730,6 +312324,171 @@ menclose::after {
|
|
|
311730
312324
|
});
|
|
311731
312325
|
y$1 += actualRowHeight + cellSpacingPx;
|
|
311732
312326
|
}
|
|
312327
|
+
{
|
|
312328
|
+
const sides = [
|
|
312329
|
+
[
|
|
312330
|
+
"top",
|
|
312331
|
+
tableBorders?.top,
|
|
312332
|
+
fragment2.continuesFromPrev !== true
|
|
312333
|
+
],
|
|
312334
|
+
[
|
|
312335
|
+
"right",
|
|
312336
|
+
isRtl ? tableBorders?.left : tableBorders?.right,
|
|
312337
|
+
true
|
|
312338
|
+
],
|
|
312339
|
+
[
|
|
312340
|
+
"bottom",
|
|
312341
|
+
tableBorders?.bottom,
|
|
312342
|
+
fragment2.continuesOnNext !== true
|
|
312343
|
+
],
|
|
312344
|
+
[
|
|
312345
|
+
"left",
|
|
312346
|
+
isRtl ? tableBorders?.right : tableBorders?.left,
|
|
312347
|
+
true
|
|
312348
|
+
]
|
|
312349
|
+
];
|
|
312350
|
+
let outlineEl = null;
|
|
312351
|
+
for (const [side, value, enabled] of sides) {
|
|
312352
|
+
if (!enabled || value == null || typeof value !== "object")
|
|
312353
|
+
continue;
|
|
312354
|
+
const spec = value;
|
|
312355
|
+
const profile = getBorderBandProfile(value);
|
|
312356
|
+
if (!profile)
|
|
312357
|
+
continue;
|
|
312358
|
+
if (isNativeCssDoubleStyle(spec.style))
|
|
312359
|
+
continue;
|
|
312360
|
+
const rule = Math.max(1, Math.round(profile.segments[0]));
|
|
312361
|
+
const color2 = spec.color && /^#[0-9A-Fa-f]{6}$/.test(spec.color) ? spec.color : "#000000";
|
|
312362
|
+
if (!outlineEl) {
|
|
312363
|
+
outlineEl = doc$12.createElement("div");
|
|
312364
|
+
outlineEl.className = "superdoc-compound-border-outline";
|
|
312365
|
+
const st = outlineEl.style;
|
|
312366
|
+
st.position = "absolute";
|
|
312367
|
+
st.inset = "0";
|
|
312368
|
+
st.boxSizing = "border-box";
|
|
312369
|
+
st.pointerEvents = "none";
|
|
312370
|
+
container.appendChild(outlineEl);
|
|
312371
|
+
}
|
|
312372
|
+
const cssSide = side[0].toUpperCase() + side.slice(1);
|
|
312373
|
+
outlineEl.style[`border${cssSide}`] = `${rule}px solid ${color2}`;
|
|
312374
|
+
}
|
|
312375
|
+
}
|
|
312376
|
+
{
|
|
312377
|
+
const midProfileOf = (value) => {
|
|
312378
|
+
if (value == null || typeof value !== "object")
|
|
312379
|
+
return null;
|
|
312380
|
+
const profile = getBorderBandProfile(value);
|
|
312381
|
+
return profile && profile.segments.length === 5 ? profile : null;
|
|
312382
|
+
};
|
|
312383
|
+
const colorOf = (value) => {
|
|
312384
|
+
const c = value?.color;
|
|
312385
|
+
return c && /^#[0-9A-Fa-f]{6}$/.test(c) ? c : "#000000";
|
|
312386
|
+
};
|
|
312387
|
+
const midOffsetOf = (profile) => Math.round(profile.segments[0] + profile.segments[1]);
|
|
312388
|
+
const midRuleOf = (profile) => Math.max(1, Math.round(profile.segments[2]));
|
|
312389
|
+
const topBorder = tableBorders?.top;
|
|
312390
|
+
const bottomBorder = tableBorders?.bottom;
|
|
312391
|
+
const leftBorder = isRtl ? tableBorders?.right : tableBorders?.left;
|
|
312392
|
+
const rightBorder = isRtl ? tableBorders?.left : tableBorders?.right;
|
|
312393
|
+
const topMid = fragment2.continuesFromPrev !== true ? midProfileOf(topBorder) : null;
|
|
312394
|
+
const bottomMid = fragment2.continuesOnNext !== true ? midProfileOf(bottomBorder) : null;
|
|
312395
|
+
const leftMid = midProfileOf(leftBorder);
|
|
312396
|
+
const rightMid = midProfileOf(rightBorder);
|
|
312397
|
+
const insideHMid = midProfileOf(tableBorders?.insideH);
|
|
312398
|
+
const insideVMid = midProfileOf(tableBorders?.insideV);
|
|
312399
|
+
const fragmentWidth = fragment2.width;
|
|
312400
|
+
const fragmentHeight = fragment2.height;
|
|
312401
|
+
const ringTopInset = topMid ? midOffsetOf(topMid) : 0;
|
|
312402
|
+
const ringBottomInset = bottomMid ? midOffsetOf(bottomMid) : 0;
|
|
312403
|
+
const ringLeftInset = leftMid ? midOffsetOf(leftMid) : 0;
|
|
312404
|
+
const ringRightInset = rightMid ? midOffsetOf(rightMid) : 0;
|
|
312405
|
+
if (topMid || bottomMid || leftMid || rightMid) {
|
|
312406
|
+
const ring = doc$12.createElement("div");
|
|
312407
|
+
ring.className = "superdoc-compound-border-midring";
|
|
312408
|
+
const rs = ring.style;
|
|
312409
|
+
rs.position = "absolute";
|
|
312410
|
+
rs.boxSizing = "border-box";
|
|
312411
|
+
rs.pointerEvents = "none";
|
|
312412
|
+
rs.left = `${ringLeftInset}px`;
|
|
312413
|
+
rs.top = `${ringTopInset}px`;
|
|
312414
|
+
rs.width = `${fragmentWidth - ringLeftInset - ringRightInset}px`;
|
|
312415
|
+
rs.height = `${fragmentHeight - ringTopInset - ringBottomInset}px`;
|
|
312416
|
+
if (topMid)
|
|
312417
|
+
rs.borderTop = `${midRuleOf(topMid)}px solid ${colorOf(topBorder)}`;
|
|
312418
|
+
if (bottomMid)
|
|
312419
|
+
rs.borderBottom = `${midRuleOf(bottomMid)}px solid ${colorOf(bottomBorder)}`;
|
|
312420
|
+
if (leftMid)
|
|
312421
|
+
rs.borderLeft = `${midRuleOf(leftMid)}px solid ${colorOf(leftBorder)}`;
|
|
312422
|
+
if (rightMid)
|
|
312423
|
+
rs.borderRight = `${midRuleOf(rightMid)}px solid ${colorOf(rightBorder)}`;
|
|
312424
|
+
container.appendChild(ring);
|
|
312425
|
+
}
|
|
312426
|
+
const appendStrip = (className, l, t, w, h$2, color2) => {
|
|
312427
|
+
const strip = doc$12.createElement("div");
|
|
312428
|
+
strip.className = className;
|
|
312429
|
+
const ss = strip.style;
|
|
312430
|
+
ss.position = "absolute";
|
|
312431
|
+
ss.pointerEvents = "none";
|
|
312432
|
+
ss.left = `${l}px`;
|
|
312433
|
+
ss.top = `${t}px`;
|
|
312434
|
+
ss.width = `${w}px`;
|
|
312435
|
+
ss.height = `${h$2}px`;
|
|
312436
|
+
ss.background = color2;
|
|
312437
|
+
container.appendChild(strip);
|
|
312438
|
+
};
|
|
312439
|
+
if (insideVMid && effectiveColumnWidths.length > 1) {
|
|
312440
|
+
const rule = midRuleOf(insideVMid);
|
|
312441
|
+
const color2 = colorOf(tableBorders?.insideV);
|
|
312442
|
+
let cum = 0;
|
|
312443
|
+
for (let i3 = 0;i3 < effectiveColumnWidths.length - 1; i3 += 1) {
|
|
312444
|
+
cum += effectiveColumnWidths[i3];
|
|
312445
|
+
const gx = isRtl ? fragmentWidth - cum : cum;
|
|
312446
|
+
appendStrip("superdoc-compound-border-midv", Math.round(gx - rule / 2), ringTopInset, rule, fragmentHeight - ringTopInset - ringBottomInset, color2);
|
|
312447
|
+
}
|
|
312448
|
+
}
|
|
312449
|
+
if (insideHMid && interiorRowBoundaries.length > 0) {
|
|
312450
|
+
const rule = midRuleOf(insideHMid);
|
|
312451
|
+
const color2 = colorOf(tableBorders?.insideH);
|
|
312452
|
+
for (const { y: gy } of interiorRowBoundaries)
|
|
312453
|
+
appendStrip("superdoc-compound-border-midh", ringLeftInset, Math.round(gy + midOffsetOf(insideHMid)), fragmentWidth - ringLeftInset - ringRightInset, rule, color2);
|
|
312454
|
+
}
|
|
312455
|
+
}
|
|
312456
|
+
if (cellSpacingPx === 0 && !separateBorders && interiorRowBoundaries.length > 0 && block.rows?.length) {
|
|
312457
|
+
const occupancy = buildColumnOccupancy(measure.rows, effectiveColumnWidths.length);
|
|
312458
|
+
const columnX = [0];
|
|
312459
|
+
for (const width of effectiveColumnWidths)
|
|
312460
|
+
columnX.push(columnX[columnX.length - 1] + width);
|
|
312461
|
+
for (const { y: boundaryY, belowRowIndex } of interiorRowBoundaries)
|
|
312462
|
+
for (const segment of computeBoundaryGapSegments(occupancy, belowRowIndex)) {
|
|
312463
|
+
if (segment.aboveCell.rowIndex < fragment2.fromRow)
|
|
312464
|
+
continue;
|
|
312465
|
+
const aboveCell = block.rows[segment.aboveCell.rowIndex]?.cells?.[segment.aboveCell.cellIndex];
|
|
312466
|
+
const boundaryRowBorders = block.rows[belowRowIndex - 1]?.attrs?.borders;
|
|
312467
|
+
const effectiveInsideH = boundaryRowBorders ? {
|
|
312468
|
+
...tableBorders ?? {},
|
|
312469
|
+
...boundaryRowBorders
|
|
312470
|
+
}.insideH : tableBorders?.insideH;
|
|
312471
|
+
const cellBottom = aboveCell?.attrs?.borders?.bottom;
|
|
312472
|
+
const spec = isExplicitNoneBorder(cellBottom) ? undefined : resolveTableBorderValue(cellBottom, effectiveInsideH);
|
|
312473
|
+
if (!isPresentBorder(spec))
|
|
312474
|
+
continue;
|
|
312475
|
+
const x = columnX[segment.startCol];
|
|
312476
|
+
const width = columnX[segment.endColExclusive] - x;
|
|
312477
|
+
if (width <= 0)
|
|
312478
|
+
continue;
|
|
312479
|
+
const strip = doc$12.createElement("div");
|
|
312480
|
+
strip.className = "superdoc-row-boundary-gap";
|
|
312481
|
+
const ss = strip.style;
|
|
312482
|
+
ss.position = "absolute";
|
|
312483
|
+
ss.pointerEvents = "none";
|
|
312484
|
+
ss.left = `${isRtl ? fragment2.width - x - width : x}px`;
|
|
312485
|
+
ss.top = `${boundaryY}px`;
|
|
312486
|
+
ss.width = `${width}px`;
|
|
312487
|
+
ss.height = "0";
|
|
312488
|
+
applyBorder(strip, "Top", spec);
|
|
312489
|
+
container.appendChild(strip);
|
|
312490
|
+
}
|
|
312491
|
+
}
|
|
311733
312492
|
return container;
|
|
311734
312493
|
}, getOwnContainerKey = (item) => {
|
|
311735
312494
|
if (item.kind !== "fragment")
|
|
@@ -326607,13 +327366,13 @@ menclose::after {
|
|
|
326607
327366
|
return;
|
|
326608
327367
|
console.log(...args$1);
|
|
326609
327368
|
}, 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;
|
|
326610
|
-
var
|
|
327369
|
+
var init_src_bMRzO9Kl_es = __esm(() => {
|
|
326611
327370
|
init_rolldown_runtime_Bg48TavK_es();
|
|
326612
|
-
|
|
327371
|
+
init_SuperConverter_Ed3nFN54_es();
|
|
326613
327372
|
init_jszip_C49i9kUs_es();
|
|
326614
327373
|
init_xml_js_CqGKpaft_es();
|
|
326615
327374
|
init_uuid_B2wVPhPi_es();
|
|
326616
|
-
|
|
327375
|
+
init_create_headless_toolbar_PSeH6IV5_es();
|
|
326617
327376
|
init_constants_D9qj59G2_es();
|
|
326618
327377
|
init_unified_BDuVPlMu_es();
|
|
326619
327378
|
init_remark_gfm_BUJjZJLy_es();
|
|
@@ -337160,7 +337919,10 @@ ${err.toString()}`);
|
|
|
337160
337919
|
for (let r$1 = 0;r$1 < rows; r$1++) {
|
|
337161
337920
|
const cellNodes = [];
|
|
337162
337921
|
for (let c = 0;c < columns; c++) {
|
|
337163
|
-
const cellAttrs = widths ? {
|
|
337922
|
+
const cellAttrs = widths ? {
|
|
337923
|
+
colwidth: [widths[c]],
|
|
337924
|
+
tableCellProperties: { cellWidth: cellWidthDxa(widths[c]) }
|
|
337925
|
+
} : {};
|
|
337164
337926
|
const cell2 = tableCellType.createAndFill(cellAttrs);
|
|
337165
337927
|
if (!cell2)
|
|
337166
337928
|
return false;
|
|
@@ -361389,13 +362151,28 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
361389
362151
|
"single",
|
|
361390
362152
|
"double",
|
|
361391
362153
|
"dashed",
|
|
362154
|
+
"dashSmallGap",
|
|
361392
362155
|
"dotted",
|
|
361393
362156
|
"thick",
|
|
361394
362157
|
"triple",
|
|
361395
362158
|
"dotDash",
|
|
361396
362159
|
"dotDotDash",
|
|
362160
|
+
"thinThickSmallGap",
|
|
362161
|
+
"thickThinSmallGap",
|
|
362162
|
+
"thinThickThinSmallGap",
|
|
362163
|
+
"thinThickMediumGap",
|
|
362164
|
+
"thickThinMediumGap",
|
|
362165
|
+
"thinThickThinMediumGap",
|
|
362166
|
+
"thinThickLargeGap",
|
|
362167
|
+
"thickThinLargeGap",
|
|
362168
|
+
"thinThickThinLargeGap",
|
|
361397
362169
|
"wave",
|
|
361398
|
-
"doubleWave"
|
|
362170
|
+
"doubleWave",
|
|
362171
|
+
"dashDotStroked",
|
|
362172
|
+
"threeDEmboss",
|
|
362173
|
+
"threeDEngrave",
|
|
362174
|
+
"outset",
|
|
362175
|
+
"inset"
|
|
361399
362176
|
]);
|
|
361400
362177
|
BORDER_STYLE_NUMBER = {
|
|
361401
362178
|
single: 1,
|
|
@@ -361406,8 +362183,23 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
361406
362183
|
dotDash: 6,
|
|
361407
362184
|
dotDotDash: 7,
|
|
361408
362185
|
triple: 8,
|
|
362186
|
+
thinThickSmallGap: 9,
|
|
362187
|
+
thickThinSmallGap: 10,
|
|
362188
|
+
thinThickThinSmallGap: 11,
|
|
362189
|
+
thinThickMediumGap: 12,
|
|
362190
|
+
thickThinMediumGap: 13,
|
|
362191
|
+
thinThickThinMediumGap: 14,
|
|
362192
|
+
thinThickLargeGap: 15,
|
|
362193
|
+
thickThinLargeGap: 16,
|
|
362194
|
+
thinThickThinLargeGap: 17,
|
|
361409
362195
|
wave: 18,
|
|
361410
|
-
doubleWave: 19
|
|
362196
|
+
doubleWave: 19,
|
|
362197
|
+
dashSmallGap: 20,
|
|
362198
|
+
dashDotStroked: 21,
|
|
362199
|
+
threeDEmboss: 22,
|
|
362200
|
+
threeDEngrave: 23,
|
|
362201
|
+
outset: 24,
|
|
362202
|
+
inset: 25
|
|
361411
362203
|
};
|
|
361412
362204
|
BORDER_STYLE_LINES = {
|
|
361413
362205
|
single: 1,
|
|
@@ -361418,8 +362210,21 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
361418
362210
|
dotDash: 1,
|
|
361419
362211
|
dotDotDash: 1,
|
|
361420
362212
|
triple: 3,
|
|
362213
|
+
thinThickSmallGap: 2,
|
|
362214
|
+
thickThinSmallGap: 2,
|
|
362215
|
+
thinThickThinSmallGap: 3,
|
|
362216
|
+
thinThickMediumGap: 2,
|
|
362217
|
+
thickThinMediumGap: 2,
|
|
362218
|
+
thinThickThinMediumGap: 3,
|
|
362219
|
+
thinThickLargeGap: 2,
|
|
362220
|
+
thickThinLargeGap: 2,
|
|
362221
|
+
thinThickThinLargeGap: 3,
|
|
361421
362222
|
wave: 1,
|
|
361422
|
-
doubleWave: 2
|
|
362223
|
+
doubleWave: 2,
|
|
362224
|
+
dashSmallGap: 1,
|
|
362225
|
+
dashDotStroked: 1,
|
|
362226
|
+
threeDEmboss: 1,
|
|
362227
|
+
threeDEngrave: 1
|
|
361423
362228
|
};
|
|
361424
362229
|
PX_PER_PT$12 = 96 / 72;
|
|
361425
362230
|
BORDER_SIDES3 = [
|
|
@@ -369872,11 +370677,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
369872
370677
|
]);
|
|
369873
370678
|
});
|
|
369874
370679
|
|
|
369875
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
370680
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-DNNbMZCp.es.js
|
|
369876
370681
|
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;
|
|
369877
|
-
var
|
|
369878
|
-
|
|
369879
|
-
|
|
370682
|
+
var init_create_super_doc_ui_DNNbMZCp_es = __esm(() => {
|
|
370683
|
+
init_SuperConverter_Ed3nFN54_es();
|
|
370684
|
+
init_create_headless_toolbar_PSeH6IV5_es();
|
|
369880
370685
|
DEFAULT_TEXT_ALIGN_OPTIONS = [
|
|
369881
370686
|
{
|
|
369882
370687
|
label: "Left",
|
|
@@ -370167,15 +370972,15 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
370167
370972
|
|
|
370168
370973
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
370169
370974
|
var init_super_editor_es = __esm(() => {
|
|
370170
|
-
|
|
370171
|
-
|
|
370975
|
+
init_src_bMRzO9Kl_es();
|
|
370976
|
+
init_SuperConverter_Ed3nFN54_es();
|
|
370172
370977
|
init_jszip_C49i9kUs_es();
|
|
370173
370978
|
init_xml_js_CqGKpaft_es();
|
|
370174
|
-
|
|
370979
|
+
init_create_headless_toolbar_PSeH6IV5_es();
|
|
370175
370980
|
init_constants_D9qj59G2_es();
|
|
370176
370981
|
init_unified_BDuVPlMu_es();
|
|
370177
370982
|
init_DocxZipper_BzS208BW_es();
|
|
370178
|
-
|
|
370983
|
+
init_create_super_doc_ui_DNNbMZCp_es();
|
|
370179
370984
|
init_ui_CGB3qmy3_es();
|
|
370180
370985
|
init_eventemitter3_UwU_CLPU_es();
|
|
370181
370986
|
init_errors_C_DoKMoN_es();
|