@superdoc-dev/mcp 0.3.0-next.86 → 0.3.0-next.88
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 +264 -90
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -51891,7 +51891,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
51891
51891
|
emptyOptions2 = {};
|
|
51892
51892
|
});
|
|
51893
51893
|
|
|
51894
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
51894
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-CbX9ZPI9.es.js
|
|
51895
51895
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
51896
51896
|
const fieldValue = extension$1.config[field];
|
|
51897
51897
|
if (typeof fieldValue === "function")
|
|
@@ -91625,25 +91625,62 @@ var isRegExp = (value) => {
|
|
|
91625
91625
|
node2._vMergeConsumed = true;
|
|
91626
91626
|
}, getTableCellMargins = (inlineMargins, referencedStyles) => {
|
|
91627
91627
|
const { cellMargins = {} } = referencedStyles;
|
|
91628
|
-
|
|
91629
|
-
|
|
91630
|
-
|
|
91631
|
-
|
|
91632
|
-
|
|
91633
|
-
|
|
91634
|
-
|
|
91635
|
-
|
|
91636
|
-
|
|
91637
|
-
|
|
91638
|
-
|
|
91639
|
-
|
|
91640
|
-
|
|
91641
|
-
|
|
91642
|
-
|
|
91628
|
+
const readMargin = (source, key) => {
|
|
91629
|
+
if (!source)
|
|
91630
|
+
return null;
|
|
91631
|
+
const v = source[key];
|
|
91632
|
+
if (v == null)
|
|
91633
|
+
return null;
|
|
91634
|
+
if (typeof v === "number")
|
|
91635
|
+
return v;
|
|
91636
|
+
if (typeof v === "object" && typeof v.value === "number")
|
|
91637
|
+
return v.value;
|
|
91638
|
+
return null;
|
|
91639
|
+
};
|
|
91640
|
+
const sides = [
|
|
91641
|
+
{
|
|
91642
|
+
physical: "top",
|
|
91643
|
+
physicalKey: "marginTop",
|
|
91644
|
+
logicalKey: null
|
|
91645
|
+
},
|
|
91646
|
+
{
|
|
91647
|
+
physical: "bottom",
|
|
91648
|
+
physicalKey: "marginBottom",
|
|
91649
|
+
logicalKey: null
|
|
91650
|
+
},
|
|
91651
|
+
{
|
|
91652
|
+
physical: "left",
|
|
91653
|
+
physicalKey: "marginLeft",
|
|
91654
|
+
logicalKey: "marginStart"
|
|
91655
|
+
},
|
|
91656
|
+
{
|
|
91657
|
+
physical: "right",
|
|
91658
|
+
physicalKey: "marginRight",
|
|
91659
|
+
logicalKey: "marginEnd"
|
|
91660
|
+
}
|
|
91661
|
+
];
|
|
91662
|
+
const result = {};
|
|
91663
|
+
for (const { physical, physicalKey, logicalKey } of sides) {
|
|
91664
|
+
const inlinePhysical = readMargin(inlineMargins, physicalKey);
|
|
91665
|
+
const inlineLogical = logicalKey ? readMargin(inlineMargins, logicalKey) : null;
|
|
91666
|
+
if (inlinePhysical != null) {
|
|
91667
|
+
result[physical] = twipsToPixels(inlinePhysical);
|
|
91668
|
+
continue;
|
|
91669
|
+
}
|
|
91670
|
+
if (inlineLogical != null) {
|
|
91671
|
+
result[physical] = twipsToPixels(inlineLogical);
|
|
91672
|
+
continue;
|
|
91673
|
+
}
|
|
91674
|
+
const stylePhysical = readMargin(cellMargins, physicalKey);
|
|
91675
|
+
const styleLogical = logicalKey ? readMargin(cellMargins, logicalKey) : null;
|
|
91676
|
+
if (stylePhysical != null)
|
|
91677
|
+
result[physical] = twipsToPixels(stylePhysical);
|
|
91678
|
+
else if (styleLogical != null)
|
|
91679
|
+
result[physical] = twipsToPixels(styleLogical);
|
|
91643
91680
|
else
|
|
91644
|
-
|
|
91645
|
-
|
|
91646
|
-
|
|
91681
|
+
result[physical] = undefined;
|
|
91682
|
+
}
|
|
91683
|
+
return result;
|
|
91647
91684
|
}, PX_PER_PT$1, pxToEighthPoints = (px) => Math.round(px / PX_PER_PT$1 * 8), SIDES, XML_NODE_NAME$30 = "w:tc", SD_NODE_NAME$29 = "tableCell", validXmlAttributes$8, config$29, translator$6, propertyTranslators$9, translator$154, translator$51, translator$68, translator$69, translator$74, translator$157, translator$160, translator$172, translator$177, translator$178, propertyTranslators$8, translator$173, createPlaceholderCell = (gridWidth, reason) => {
|
|
91648
91685
|
const safeWidth = Number.isFinite(gridWidth) ? gridWidth : 0;
|
|
91649
91686
|
const noBorder = {
|
|
@@ -105344,7 +105381,7 @@ var isRegExp = (value) => {
|
|
|
105344
105381
|
state.kern = kernNode.attributes["w:val"];
|
|
105345
105382
|
}
|
|
105346
105383
|
}, SuperConverter;
|
|
105347
|
-
var
|
|
105384
|
+
var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
|
|
105348
105385
|
init_rolldown_runtime_Bg48TavK_es();
|
|
105349
105386
|
init_jszip_C49i9kUs_es();
|
|
105350
105387
|
init_xml_js_CqGKpaft_es();
|
|
@@ -143213,7 +143250,7 @@ var init_SuperConverter_5Idv4fhC_es = __esm(() => {
|
|
|
143213
143250
|
};
|
|
143214
143251
|
});
|
|
143215
143252
|
|
|
143216
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
143253
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-CbUkXBcM.es.js
|
|
143217
143254
|
function parseSizeUnit(val = "0") {
|
|
143218
143255
|
const length = val.toString() || "0";
|
|
143219
143256
|
const value = Number.parseFloat(length);
|
|
@@ -145935,8 +145972,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
145935
145972
|
}
|
|
145936
145973
|
};
|
|
145937
145974
|
};
|
|
145938
|
-
var
|
|
145939
|
-
|
|
145975
|
+
var init_create_headless_toolbar_CbUkXBcM_es = __esm(() => {
|
|
145976
|
+
init_SuperConverter_CbX9ZPI9_es();
|
|
145940
145977
|
init_constants_DrU4EASo_es();
|
|
145941
145978
|
init_dist_B8HfvhaK_es();
|
|
145942
145979
|
CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
|
|
@@ -200154,7 +200191,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
200154
200191
|
init_remark_gfm_BhnWr3yf_es();
|
|
200155
200192
|
});
|
|
200156
200193
|
|
|
200157
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
200194
|
+
// ../../packages/superdoc/dist/chunks/src-BVPPjYkZ.es.js
|
|
200158
200195
|
function deleteProps(obj, propOrProps) {
|
|
200159
200196
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
200160
200197
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -204898,6 +204935,9 @@ function getTableContext($head) {
|
|
|
204898
204935
|
table: table2
|
|
204899
204936
|
};
|
|
204900
204937
|
}
|
|
204938
|
+
function isRtlTable(table2) {
|
|
204939
|
+
return table2?.attrs?.tableProperties?.rightToLeft === true;
|
|
204940
|
+
}
|
|
204901
204941
|
function getCellRect(context) {
|
|
204902
204942
|
const map$12 = TableMap.get(context.table);
|
|
204903
204943
|
return {
|
|
@@ -204905,6 +204945,9 @@ function getCellRect(context) {
|
|
|
204905
204945
|
rect: map$12.findCell(context.cellStart - context.tableStart)
|
|
204906
204946
|
};
|
|
204907
204947
|
}
|
|
204948
|
+
function getEffectiveTableDir(table2, dir) {
|
|
204949
|
+
return isRtlTable(table2) ? -dir : dir;
|
|
204950
|
+
}
|
|
204908
204951
|
function isLastCellInTable(context) {
|
|
204909
204952
|
if (!context)
|
|
204910
204953
|
return false;
|
|
@@ -204996,7 +205039,8 @@ function getTableBoundaryExitSelection(state, dir) {
|
|
|
204996
205039
|
const context = getTableContext(selection.$head);
|
|
204997
205040
|
if (!context)
|
|
204998
205041
|
return null;
|
|
204999
|
-
const
|
|
205042
|
+
const effectiveDir = getEffectiveTableDir(context.table, dir);
|
|
205043
|
+
const helpers = getDirectionHelpers(effectiveDir);
|
|
205000
205044
|
if (!helpers.isEdgeParagraphInCell(selection.$head, context.cellDepth))
|
|
205001
205045
|
return null;
|
|
205002
205046
|
if (!helpers.isAtParagraphBoundary(selection.$head))
|
|
@@ -205007,7 +205051,38 @@ function getTableBoundaryExitSelection(state, dir) {
|
|
|
205007
205051
|
const targetPos = helpers.findTextPosAcrossBoundary(state, boundaryPos);
|
|
205008
205052
|
if (targetPos != null)
|
|
205009
205053
|
return TextSelection.create(state.doc, targetPos);
|
|
205010
|
-
return findSelectionNearBoundary(state, boundaryPos,
|
|
205054
|
+
return findSelectionNearBoundary(state, boundaryPos, effectiveDir);
|
|
205055
|
+
}
|
|
205056
|
+
function getIntraTableArrowSelection(state, dir, expandSelection) {
|
|
205057
|
+
const selection = state.selection;
|
|
205058
|
+
if (!selection.empty)
|
|
205059
|
+
return null;
|
|
205060
|
+
const context = getTableContext(selection.$head);
|
|
205061
|
+
if (!context)
|
|
205062
|
+
return null;
|
|
205063
|
+
if (!isRtlTable(context.table))
|
|
205064
|
+
return null;
|
|
205065
|
+
const effectiveDir = getEffectiveTableDir(context.table, dir);
|
|
205066
|
+
const helpers = getDirectionHelpers(effectiveDir);
|
|
205067
|
+
if (!helpers.isEdgeParagraphInCell(selection.$head, context.cellDepth))
|
|
205068
|
+
return null;
|
|
205069
|
+
if (!helpers.isAtParagraphBoundary(selection.$head))
|
|
205070
|
+
return null;
|
|
205071
|
+
const { map: map$12 } = getCellRect(context);
|
|
205072
|
+
const currentCellRelativePos = context.cellStart - context.tableStart;
|
|
205073
|
+
const nextCellRelativePos = map$12.nextCell(currentCellRelativePos, "horiz", effectiveDir);
|
|
205074
|
+
if (nextCellRelativePos == null)
|
|
205075
|
+
return null;
|
|
205076
|
+
const nextCellAbsolutePos = context.tableStart + nextCellRelativePos;
|
|
205077
|
+
if (expandSelection)
|
|
205078
|
+
return CellSelection.create(state.doc, context.cellStart, nextCellAbsolutePos);
|
|
205079
|
+
const nextCellNode = state.doc.nodeAt(nextCellAbsolutePos);
|
|
205080
|
+
if (!nextCellNode)
|
|
205081
|
+
return null;
|
|
205082
|
+
const targetPos = effectiveDir > 0 ? findFirstTextPosInNode(nextCellNode, nextCellAbsolutePos) : findLastTextPosInNode(nextCellNode, nextCellAbsolutePos);
|
|
205083
|
+
if (targetPos != null)
|
|
205084
|
+
return TextSelection.create(state.doc, targetPos);
|
|
205085
|
+
return findSelectionNearBoundary(state, nextCellAbsolutePos, effectiveDir);
|
|
205011
205086
|
}
|
|
205012
205087
|
function getAdjacentTableEntrySelection(state, dir) {
|
|
205013
205088
|
const selection = state.selection;
|
|
@@ -205024,13 +205099,14 @@ function getAdjacentTableEntrySelection(state, dir) {
|
|
|
205024
205099
|
const adjacentNode = dir > 0 ? $boundary.nodeAfter : $boundary.nodeBefore;
|
|
205025
205100
|
if (!adjacentNode || adjacentNode.type.spec.tableRole !== "table")
|
|
205026
205101
|
return null;
|
|
205027
|
-
|
|
205028
|
-
|
|
205102
|
+
const effectiveDir = isRtlTable(adjacentNode) ? -dir : dir;
|
|
205103
|
+
const tablePos = dir > 0 ? boundaryPos : boundaryPos - adjacentNode.nodeSize;
|
|
205104
|
+
if (effectiveDir > 0) {
|
|
205105
|
+
const targetPos$1 = findFirstTextPosInNode(adjacentNode, tablePos);
|
|
205029
205106
|
if (targetPos$1 != null)
|
|
205030
205107
|
return TextSelection.create(state.doc, targetPos$1);
|
|
205031
|
-
return findSelectionNearBoundary(state,
|
|
205108
|
+
return findSelectionNearBoundary(state, tablePos, 1);
|
|
205032
205109
|
}
|
|
205033
|
-
const tablePos = boundaryPos - adjacentNode.nodeSize;
|
|
205034
205110
|
const targetPos = findLastTextPosInNode(adjacentNode, tablePos);
|
|
205035
205111
|
if (targetPos != null)
|
|
205036
205112
|
return TextSelection.create(state.doc, targetPos);
|
|
@@ -205042,7 +205118,7 @@ function createTableBoundaryNavigationPlugin() {
|
|
|
205042
205118
|
props: { handleKeyDown(view, event) {
|
|
205043
205119
|
if (event.defaultPrevented)
|
|
205044
205120
|
return false;
|
|
205045
|
-
if (event.
|
|
205121
|
+
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
205046
205122
|
return false;
|
|
205047
205123
|
if ((event.key === "Backspace" || event.key === "Delete") && isInProtectedTrailingTableParagraph(view.state)) {
|
|
205048
205124
|
event.preventDefault();
|
|
@@ -205051,7 +205127,14 @@ function createTableBoundaryNavigationPlugin() {
|
|
|
205051
205127
|
const dir = event.key === "ArrowRight" ? 1 : event.key === "ArrowLeft" ? -1 : 0;
|
|
205052
205128
|
if (!dir)
|
|
205053
205129
|
return false;
|
|
205054
|
-
const
|
|
205130
|
+
const context = getTableContext(view.state.selection.$head);
|
|
205131
|
+
const allowShiftInRtlTable = Boolean(event.shiftKey && context && isRtlTable(context.table));
|
|
205132
|
+
if (event.shiftKey && !allowShiftInRtlTable)
|
|
205133
|
+
return false;
|
|
205134
|
+
let nextSelection = getIntraTableArrowSelection(view.state, dir, event.shiftKey);
|
|
205135
|
+
if (!nextSelection && event.shiftKey)
|
|
205136
|
+
return false;
|
|
205137
|
+
nextSelection = nextSelection ?? getTableBoundaryExitSelection(view.state, dir) ?? getAdjacentTableEntrySelection(view.state, dir);
|
|
205055
205138
|
if (!nextSelection)
|
|
205056
205139
|
return false;
|
|
205057
205140
|
view.dispatch(view.state.tr.setSelection(nextSelection).scrollIntoView());
|
|
@@ -246613,18 +246696,28 @@ function resolveRenderedTableWidth(columnWidth, measuredWidth, attrs) {
|
|
|
246613
246696
|
}
|
|
246614
246697
|
function resolveTableFrame(baseX, columnWidth, tableWidth, attrs) {
|
|
246615
246698
|
const width = resolveRenderedTableWidth(columnWidth, tableWidth, attrs);
|
|
246616
|
-
const
|
|
246617
|
-
|
|
246699
|
+
const explicitJustification = typeof attrs?.justification === "string" ? attrs.justification : undefined;
|
|
246700
|
+
const isRtlTable$1 = attrs?.tableProperties?.rightToLeft === true;
|
|
246701
|
+
const effectiveJustification = explicitJustification ?? (isRtlTable$1 ? "end" : undefined);
|
|
246702
|
+
const tableIndent = getTableIndentWidth(attrs);
|
|
246703
|
+
if (effectiveJustification === "center")
|
|
246618
246704
|
return {
|
|
246619
246705
|
x: baseX + (columnWidth - width) / 2,
|
|
246620
246706
|
width
|
|
246621
246707
|
};
|
|
246622
|
-
if (
|
|
246708
|
+
if (effectiveJustification === "right" || effectiveJustification === "end") {
|
|
246709
|
+
const rightAlignedX = baseX + (columnWidth - width);
|
|
246710
|
+
if (explicitJustification == null && isRtlTable$1 && tableIndent !== 0)
|
|
246711
|
+
return {
|
|
246712
|
+
x: rightAlignedX - tableIndent,
|
|
246713
|
+
width
|
|
246714
|
+
};
|
|
246623
246715
|
return {
|
|
246624
|
-
x:
|
|
246716
|
+
x: rightAlignedX,
|
|
246625
246717
|
width
|
|
246626
246718
|
};
|
|
246627
|
-
|
|
246719
|
+
}
|
|
246720
|
+
return applyTableIndent(baseX, width, tableIndent, columnWidth);
|
|
246628
246721
|
}
|
|
246629
246722
|
function calculateColumnMinWidth(measuredWidth) {
|
|
246630
246723
|
if (!Number.isFinite(measuredWidth) || measuredWidth <= 0)
|
|
@@ -254995,30 +255088,61 @@ function isTableBorderValue(value) {
|
|
|
254995
255088
|
function extractTableBorders(bordersInput, options) {
|
|
254996
255089
|
if (!bordersInput || typeof bordersInput !== "object")
|
|
254997
255090
|
return;
|
|
254998
|
-
const
|
|
255091
|
+
const borders = {};
|
|
255092
|
+
const assignConverted = (side, raw) => {
|
|
255093
|
+
if (raw == null)
|
|
255094
|
+
return;
|
|
255095
|
+
if (isTableBorderValue(raw)) {
|
|
255096
|
+
borders[side] = raw;
|
|
255097
|
+
return;
|
|
255098
|
+
}
|
|
255099
|
+
const converted = convertTableBorderValue(raw, options);
|
|
255100
|
+
if (converted !== undefined)
|
|
255101
|
+
borders[side] = converted;
|
|
255102
|
+
};
|
|
255103
|
+
for (const side of [
|
|
254999
255104
|
"top",
|
|
255000
255105
|
"right",
|
|
255001
255106
|
"bottom",
|
|
255002
255107
|
"left",
|
|
255003
255108
|
"insideH",
|
|
255004
255109
|
"insideV"
|
|
255005
|
-
]
|
|
255110
|
+
])
|
|
255111
|
+
assignConverted(side, bordersInput[side]);
|
|
255112
|
+
if (borders.left == null)
|
|
255113
|
+
assignConverted("left", bordersInput.start);
|
|
255114
|
+
if (borders.right == null)
|
|
255115
|
+
assignConverted("right", bordersInput.end);
|
|
255116
|
+
return Object.keys(borders).length > 0 ? borders : undefined;
|
|
255117
|
+
}
|
|
255118
|
+
function extractCellBorders(cellAttrs, _options) {
|
|
255119
|
+
if (!cellAttrs?.borders)
|
|
255120
|
+
return;
|
|
255121
|
+
const bordersData = cellAttrs.borders;
|
|
255006
255122
|
const borders = {};
|
|
255007
|
-
for (const side of
|
|
255008
|
-
|
|
255009
|
-
|
|
255010
|
-
|
|
255011
|
-
|
|
255012
|
-
|
|
255013
|
-
|
|
255014
|
-
|
|
255015
|
-
|
|
255016
|
-
|
|
255017
|
-
|
|
255123
|
+
for (const side of [
|
|
255124
|
+
"top",
|
|
255125
|
+
"right",
|
|
255126
|
+
"bottom",
|
|
255127
|
+
"left"
|
|
255128
|
+
]) {
|
|
255129
|
+
const spec = convertBorderSpec(bordersData[side]);
|
|
255130
|
+
if (spec)
|
|
255131
|
+
borders[side] = spec;
|
|
255132
|
+
}
|
|
255133
|
+
if (borders.left == null) {
|
|
255134
|
+
const spec = convertBorderSpec(bordersData.start);
|
|
255135
|
+
if (spec)
|
|
255136
|
+
borders.left = spec;
|
|
255137
|
+
}
|
|
255138
|
+
if (borders.right == null) {
|
|
255139
|
+
const spec = convertBorderSpec(bordersData.end);
|
|
255140
|
+
if (spec)
|
|
255141
|
+
borders.right = spec;
|
|
255018
255142
|
}
|
|
255019
255143
|
return Object.keys(borders).length > 0 ? borders : undefined;
|
|
255020
255144
|
}
|
|
255021
|
-
function extractCellPadding(cellAttrs) {
|
|
255145
|
+
function extractCellPadding(cellAttrs, _options) {
|
|
255022
255146
|
const cellMargins = cellAttrs?.cellMargins;
|
|
255023
255147
|
if (!cellMargins || typeof cellMargins !== "object")
|
|
255024
255148
|
return;
|
|
@@ -255032,6 +255156,12 @@ function extractCellPadding(cellAttrs) {
|
|
|
255032
255156
|
padding.bottom = margins.bottom;
|
|
255033
255157
|
if (typeof margins.left === "number")
|
|
255034
255158
|
padding.left = margins.left;
|
|
255159
|
+
const marginStart = margins.marginStart;
|
|
255160
|
+
const marginEnd = margins.marginEnd;
|
|
255161
|
+
if (typeof marginStart === "number" && padding.left == null)
|
|
255162
|
+
padding.left = marginStart;
|
|
255163
|
+
if (typeof marginEnd === "number" && padding.right == null)
|
|
255164
|
+
padding.right = marginEnd;
|
|
255035
255165
|
if (Object.keys(padding).length === 0)
|
|
255036
255166
|
return;
|
|
255037
255167
|
return normalizeCellPaddingTopBottom(padding);
|
|
@@ -256856,7 +256986,11 @@ function tableNodeToBlock(node2, { nextBlockId, positions, storyKey, trackedChan
|
|
|
256856
256986
|
};
|
|
256857
256987
|
};
|
|
256858
256988
|
const borderSource = getBorderSource();
|
|
256859
|
-
const
|
|
256989
|
+
const isRtlTable$1 = tablePropertiesForCascade?.rightToLeft === true;
|
|
256990
|
+
const tableBorders = borderSource ? extractTableBorders(borderSource.borders, {
|
|
256991
|
+
unit: borderSource.unit,
|
|
256992
|
+
isRtl: isRtlTable$1
|
|
256993
|
+
}) : undefined;
|
|
256860
256994
|
if (tableBorders)
|
|
256861
256995
|
tableAttrs.borders = tableBorders;
|
|
256862
256996
|
if (node2.attrs?.borderCollapse)
|
|
@@ -281512,6 +281646,7 @@ menclose::after {
|
|
|
281512
281646
|
min: boundary.minWidth,
|
|
281513
281647
|
r: boundary.resizable ? 1 : 0
|
|
281514
281648
|
})),
|
|
281649
|
+
rtl: isRtl,
|
|
281515
281650
|
segments: boundarySegments.map((segs, colIndex) => segs.map((seg) => ({
|
|
281516
281651
|
c: colIndex,
|
|
281517
281652
|
y: seg.y + contentTop,
|
|
@@ -281530,7 +281665,7 @@ menclose::after {
|
|
|
281530
281665
|
}
|
|
281531
281666
|
if (block.id)
|
|
281532
281667
|
container.setAttribute("data-sd-block-id", block.id);
|
|
281533
|
-
if ((block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse")) === "separate" &&
|
|
281668
|
+
if ((block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse")) === "separate" && tableBorders) {
|
|
281534
281669
|
applyBorder(container, "Top", borderValueToSpec(tableBorders.top));
|
|
281535
281670
|
applyBorder(container, "Right", borderValueToSpec(isRtl ? tableBorders.left : tableBorders.right));
|
|
281536
281671
|
applyBorder(container, "Bottom", borderValueToSpec(tableBorders.bottom));
|
|
@@ -288339,7 +288474,9 @@ menclose::after {
|
|
|
288339
288474
|
"left",
|
|
288340
288475
|
"right",
|
|
288341
288476
|
"insideH",
|
|
288342
|
-
"insideV"
|
|
288477
|
+
"insideV",
|
|
288478
|
+
"start",
|
|
288479
|
+
"end"
|
|
288343
288480
|
];
|
|
288344
288481
|
const result = {};
|
|
288345
288482
|
for (const side of sides) {
|
|
@@ -288664,6 +288801,7 @@ menclose::after {
|
|
|
288664
288801
|
return null;
|
|
288665
288802
|
const cellAttrs = {};
|
|
288666
288803
|
if (resolvedTcProps?.borders && typeof resolvedTcProps.borders === "object") {
|
|
288804
|
+
const resolvedBordersData = resolvedTcProps.borders;
|
|
288667
288805
|
const resolvedBorders = {};
|
|
288668
288806
|
for (const side of [
|
|
288669
288807
|
"top",
|
|
@@ -288671,36 +288809,46 @@ menclose::after {
|
|
|
288671
288809
|
"bottom",
|
|
288672
288810
|
"left"
|
|
288673
288811
|
]) {
|
|
288674
|
-
const spec = convertResolvedCellBorder(
|
|
288812
|
+
const spec = convertResolvedCellBorder(resolvedBordersData[side]);
|
|
288675
288813
|
if (spec)
|
|
288676
288814
|
resolvedBorders[side] = spec;
|
|
288677
288815
|
}
|
|
288816
|
+
if (resolvedBorders.left == null) {
|
|
288817
|
+
const spec = convertResolvedCellBorder(resolvedBordersData.start);
|
|
288818
|
+
if (spec)
|
|
288819
|
+
resolvedBorders.left = spec;
|
|
288820
|
+
}
|
|
288821
|
+
if (resolvedBorders.right == null) {
|
|
288822
|
+
const spec = convertResolvedCellBorder(resolvedBordersData.end);
|
|
288823
|
+
if (spec)
|
|
288824
|
+
resolvedBorders.right = spec;
|
|
288825
|
+
}
|
|
288678
288826
|
if (Object.keys(resolvedBorders).length > 0)
|
|
288679
288827
|
cellAttrs.borders = resolvedBorders;
|
|
288680
288828
|
}
|
|
288681
288829
|
if (!cellAttrs.borders && cellNode.attrs?.borders && typeof cellNode.attrs.borders === "object") {
|
|
288682
288830
|
const legacy = cellNode.attrs.borders;
|
|
288683
|
-
const
|
|
288831
|
+
const filteredLegacyBorders = {};
|
|
288684
288832
|
for (const side of [
|
|
288685
288833
|
"top",
|
|
288686
288834
|
"right",
|
|
288687
288835
|
"bottom",
|
|
288688
|
-
"left"
|
|
288836
|
+
"left",
|
|
288837
|
+
"start",
|
|
288838
|
+
"end"
|
|
288689
288839
|
]) {
|
|
288690
288840
|
const b$1 = legacy[side];
|
|
288691
|
-
if (b$1 && b$1.val && typeof b$1.size === "number" && b$1.size > 0)
|
|
288692
|
-
|
|
288693
|
-
|
|
288694
|
-
|
|
288695
|
-
width: b$1.size,
|
|
288696
|
-
color: color2
|
|
288841
|
+
if (b$1 && b$1.val && typeof b$1.size === "number" && b$1.size > 0)
|
|
288842
|
+
filteredLegacyBorders[side] = {
|
|
288843
|
+
...b$1,
|
|
288844
|
+
val: normalizeLegacyBorderStyle(b$1.val)
|
|
288697
288845
|
};
|
|
288698
|
-
}
|
|
288699
288846
|
}
|
|
288700
|
-
|
|
288847
|
+
const fallback = extractCellBorders({ borders: filteredLegacyBorders }, { isRtl: tableProperties?.rightToLeft === true });
|
|
288848
|
+
if (fallback)
|
|
288701
288849
|
cellAttrs.borders = fallback;
|
|
288702
288850
|
}
|
|
288703
|
-
const padding = extractCellPadding(cellNode.attrs ?? {}) ?? (defaultCellPadding ? { ...defaultCellPadding } : undefined);
|
|
288851
|
+
const padding = extractCellPadding(cellNode.attrs ?? {}, { isRtl: tableProperties?.rightToLeft === true }) ?? (defaultCellPadding ? { ...defaultCellPadding } : undefined);
|
|
288704
288852
|
if (padding)
|
|
288705
288853
|
cellAttrs.padding = padding;
|
|
288706
288854
|
const verticalAlign = cellNode.attrs?.verticalAlign;
|
|
@@ -293846,12 +293994,12 @@ menclose::after {
|
|
|
293846
293994
|
return;
|
|
293847
293995
|
console.log(...args$1);
|
|
293848
293996
|
}, 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;
|
|
293849
|
-
var
|
|
293997
|
+
var init_src_BVPPjYkZ_es = __esm(() => {
|
|
293850
293998
|
init_rolldown_runtime_Bg48TavK_es();
|
|
293851
|
-
|
|
293999
|
+
init_SuperConverter_CbX9ZPI9_es();
|
|
293852
294000
|
init_jszip_C49i9kUs_es();
|
|
293853
294001
|
init_uuid_qzgm05fK_es();
|
|
293854
|
-
|
|
294002
|
+
init_create_headless_toolbar_CbUkXBcM_es();
|
|
293855
294003
|
init_constants_DrU4EASo_es();
|
|
293856
294004
|
init_dist_B8HfvhaK_es();
|
|
293857
294005
|
init_unified_Dsuw2be5_es();
|
|
@@ -331892,11 +332040,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
331892
332040
|
];
|
|
331893
332041
|
});
|
|
331894
332042
|
|
|
331895
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
332043
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-CkcWwDom.es.js
|
|
331896
332044
|
var 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;
|
|
331897
|
-
var
|
|
331898
|
-
|
|
331899
|
-
|
|
332045
|
+
var init_create_super_doc_ui_CkcWwDom_es = __esm(() => {
|
|
332046
|
+
init_SuperConverter_CbX9ZPI9_es();
|
|
332047
|
+
init_create_headless_toolbar_CbUkXBcM_es();
|
|
331900
332048
|
MOD_ALIASES = new Set([
|
|
331901
332049
|
"Mod",
|
|
331902
332050
|
"Meta",
|
|
@@ -331938,16 +332086,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
331938
332086
|
|
|
331939
332087
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
331940
332088
|
var init_super_editor_es = __esm(() => {
|
|
331941
|
-
|
|
331942
|
-
|
|
332089
|
+
init_src_BVPPjYkZ_es();
|
|
332090
|
+
init_SuperConverter_CbX9ZPI9_es();
|
|
331943
332091
|
init_jszip_C49i9kUs_es();
|
|
331944
332092
|
init_xml_js_CqGKpaft_es();
|
|
331945
|
-
|
|
332093
|
+
init_create_headless_toolbar_CbUkXBcM_es();
|
|
331946
332094
|
init_constants_DrU4EASo_es();
|
|
331947
332095
|
init_dist_B8HfvhaK_es();
|
|
331948
332096
|
init_unified_Dsuw2be5_es();
|
|
331949
332097
|
init_DocxZipper_Dh4RtvcE_es();
|
|
331950
|
-
|
|
332098
|
+
init_create_super_doc_ui_CkcWwDom_es();
|
|
331951
332099
|
init_ui_CGB3qmy3_es();
|
|
331952
332100
|
init_eventemitter3_UwU_CLPU_es();
|
|
331953
332101
|
init_errors_C_DoKMoN_es();
|
|
@@ -395364,21 +395512,47 @@ var getTableCellVMerge2 = (node4) => {
|
|
|
395364
395512
|
}
|
|
395365
395513
|
}, getTableCellMargins2 = (inlineMargins, referencedStyles) => {
|
|
395366
395514
|
const { cellMargins = {} } = referencedStyles;
|
|
395367
|
-
|
|
395368
|
-
|
|
395369
|
-
|
|
395370
|
-
const
|
|
395371
|
-
if (
|
|
395372
|
-
|
|
395373
|
-
|
|
395374
|
-
|
|
395375
|
-
|
|
395376
|
-
|
|
395515
|
+
const readMargin = (source, key2) => {
|
|
395516
|
+
if (!source)
|
|
395517
|
+
return null;
|
|
395518
|
+
const v = source[key2];
|
|
395519
|
+
if (v == null)
|
|
395520
|
+
return null;
|
|
395521
|
+
if (typeof v === "number")
|
|
395522
|
+
return v;
|
|
395523
|
+
if (typeof v === "object" && typeof v.value === "number")
|
|
395524
|
+
return v.value;
|
|
395525
|
+
return null;
|
|
395526
|
+
};
|
|
395527
|
+
const sides = [
|
|
395528
|
+
{ physical: "top", physicalKey: "marginTop", logicalKey: null },
|
|
395529
|
+
{ physical: "bottom", physicalKey: "marginBottom", logicalKey: null },
|
|
395530
|
+
{ physical: "left", physicalKey: "marginLeft", logicalKey: "marginStart" },
|
|
395531
|
+
{ physical: "right", physicalKey: "marginRight", logicalKey: "marginEnd" }
|
|
395532
|
+
];
|
|
395533
|
+
const result = {};
|
|
395534
|
+
for (const { physical, physicalKey, logicalKey } of sides) {
|
|
395535
|
+
const inlinePhysical = readMargin(inlineMargins, physicalKey);
|
|
395536
|
+
const inlineLogical = logicalKey ? readMargin(inlineMargins, logicalKey) : null;
|
|
395537
|
+
if (inlinePhysical != null) {
|
|
395538
|
+
result[physical] = twipsToPixels4(inlinePhysical);
|
|
395539
|
+
continue;
|
|
395540
|
+
}
|
|
395541
|
+
if (inlineLogical != null) {
|
|
395542
|
+
result[physical] = twipsToPixels4(inlineLogical);
|
|
395543
|
+
continue;
|
|
395544
|
+
}
|
|
395545
|
+
const stylePhysical = readMargin(cellMargins, physicalKey);
|
|
395546
|
+
const styleLogical = logicalKey ? readMargin(cellMargins, logicalKey) : null;
|
|
395547
|
+
if (stylePhysical != null) {
|
|
395548
|
+
result[physical] = twipsToPixels4(stylePhysical);
|
|
395549
|
+
} else if (styleLogical != null) {
|
|
395550
|
+
result[physical] = twipsToPixels4(styleLogical);
|
|
395377
395551
|
} else {
|
|
395378
|
-
|
|
395552
|
+
result[physical] = undefined;
|
|
395379
395553
|
}
|
|
395380
|
-
|
|
395381
|
-
|
|
395554
|
+
}
|
|
395555
|
+
return result;
|
|
395382
395556
|
};
|
|
395383
395557
|
var init_legacy_handle_table_cell_node = __esm(() => {
|
|
395384
395558
|
init_helpers();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/mcp",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.88",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"@types/bun": "^1.3.8",
|
|
20
20
|
"@types/node": "22.19.2",
|
|
21
21
|
"typescript": "^5.9.2",
|
|
22
|
-
"@superdoc/super-editor": "0.0.1",
|
|
23
22
|
"@superdoc/document-api": "0.0.1",
|
|
23
|
+
"@superdoc/super-editor": "0.0.1",
|
|
24
24
|
"superdoc": "1.32.0"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|