@superdoc-dev/cli 0.8.0-next.101 → 0.8.0-next.104
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 +272 -82
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -66095,7 +66095,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
66095
66095
|
emptyOptions2 = {};
|
|
66096
66096
|
});
|
|
66097
66097
|
|
|
66098
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
66098
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-CbX9ZPI9.es.js
|
|
66099
66099
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
66100
66100
|
const fieldValue = extension$1.config[field];
|
|
66101
66101
|
if (typeof fieldValue === "function")
|
|
@@ -105829,25 +105829,62 @@ var isRegExp = (value) => {
|
|
|
105829
105829
|
node3._vMergeConsumed = true;
|
|
105830
105830
|
}, getTableCellMargins = (inlineMargins, referencedStyles) => {
|
|
105831
105831
|
const { cellMargins = {} } = referencedStyles;
|
|
105832
|
-
|
|
105833
|
-
|
|
105834
|
-
|
|
105835
|
-
|
|
105836
|
-
|
|
105837
|
-
|
|
105838
|
-
|
|
105839
|
-
|
|
105840
|
-
|
|
105841
|
-
|
|
105842
|
-
|
|
105843
|
-
|
|
105844
|
-
|
|
105845
|
-
|
|
105846
|
-
|
|
105832
|
+
const readMargin = (source, key) => {
|
|
105833
|
+
if (!source)
|
|
105834
|
+
return null;
|
|
105835
|
+
const v = source[key];
|
|
105836
|
+
if (v == null)
|
|
105837
|
+
return null;
|
|
105838
|
+
if (typeof v === "number")
|
|
105839
|
+
return v;
|
|
105840
|
+
if (typeof v === "object" && typeof v.value === "number")
|
|
105841
|
+
return v.value;
|
|
105842
|
+
return null;
|
|
105843
|
+
};
|
|
105844
|
+
const sides = [
|
|
105845
|
+
{
|
|
105846
|
+
physical: "top",
|
|
105847
|
+
physicalKey: "marginTop",
|
|
105848
|
+
logicalKey: null
|
|
105849
|
+
},
|
|
105850
|
+
{
|
|
105851
|
+
physical: "bottom",
|
|
105852
|
+
physicalKey: "marginBottom",
|
|
105853
|
+
logicalKey: null
|
|
105854
|
+
},
|
|
105855
|
+
{
|
|
105856
|
+
physical: "left",
|
|
105857
|
+
physicalKey: "marginLeft",
|
|
105858
|
+
logicalKey: "marginStart"
|
|
105859
|
+
},
|
|
105860
|
+
{
|
|
105861
|
+
physical: "right",
|
|
105862
|
+
physicalKey: "marginRight",
|
|
105863
|
+
logicalKey: "marginEnd"
|
|
105864
|
+
}
|
|
105865
|
+
];
|
|
105866
|
+
const result = {};
|
|
105867
|
+
for (const { physical, physicalKey, logicalKey } of sides) {
|
|
105868
|
+
const inlinePhysical = readMargin(inlineMargins, physicalKey);
|
|
105869
|
+
const inlineLogical = logicalKey ? readMargin(inlineMargins, logicalKey) : null;
|
|
105870
|
+
if (inlinePhysical != null) {
|
|
105871
|
+
result[physical] = twipsToPixels(inlinePhysical);
|
|
105872
|
+
continue;
|
|
105873
|
+
}
|
|
105874
|
+
if (inlineLogical != null) {
|
|
105875
|
+
result[physical] = twipsToPixels(inlineLogical);
|
|
105876
|
+
continue;
|
|
105877
|
+
}
|
|
105878
|
+
const stylePhysical = readMargin(cellMargins, physicalKey);
|
|
105879
|
+
const styleLogical = logicalKey ? readMargin(cellMargins, logicalKey) : null;
|
|
105880
|
+
if (stylePhysical != null)
|
|
105881
|
+
result[physical] = twipsToPixels(stylePhysical);
|
|
105882
|
+
else if (styleLogical != null)
|
|
105883
|
+
result[physical] = twipsToPixels(styleLogical);
|
|
105847
105884
|
else
|
|
105848
|
-
|
|
105849
|
-
|
|
105850
|
-
|
|
105885
|
+
result[physical] = undefined;
|
|
105886
|
+
}
|
|
105887
|
+
return result;
|
|
105851
105888
|
}, 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) => {
|
|
105852
105889
|
const safeWidth = Number.isFinite(gridWidth) ? gridWidth : 0;
|
|
105853
105890
|
const noBorder = {
|
|
@@ -119548,7 +119585,7 @@ var isRegExp = (value) => {
|
|
|
119548
119585
|
state.kern = kernNode.attributes["w:val"];
|
|
119549
119586
|
}
|
|
119550
119587
|
}, SuperConverter;
|
|
119551
|
-
var
|
|
119588
|
+
var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
|
|
119552
119589
|
init_rolldown_runtime_Bg48TavK_es();
|
|
119553
119590
|
init_jszip_C49i9kUs_es();
|
|
119554
119591
|
init_xml_js_CqGKpaft_es();
|
|
@@ -157417,7 +157454,7 @@ var init_SuperConverter_5Idv4fhC_es = __esm(() => {
|
|
|
157417
157454
|
};
|
|
157418
157455
|
});
|
|
157419
157456
|
|
|
157420
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
157457
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-CbUkXBcM.es.js
|
|
157421
157458
|
function parseSizeUnit(val = "0") {
|
|
157422
157459
|
const length3 = val.toString() || "0";
|
|
157423
157460
|
const value = Number.parseFloat(length3);
|
|
@@ -160139,8 +160176,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
160139
160176
|
}
|
|
160140
160177
|
};
|
|
160141
160178
|
};
|
|
160142
|
-
var
|
|
160143
|
-
|
|
160179
|
+
var init_create_headless_toolbar_CbUkXBcM_es = __esm(() => {
|
|
160180
|
+
init_SuperConverter_CbX9ZPI9_es();
|
|
160144
160181
|
init_constants_DrU4EASo_es();
|
|
160145
160182
|
init_dist_B8HfvhaK_es();
|
|
160146
160183
|
CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
|
|
@@ -161587,7 +161624,7 @@ var init_decrypt_docx_4kQ488M9_es = __esm(() => {
|
|
|
161587
161624
|
]);
|
|
161588
161625
|
});
|
|
161589
161626
|
|
|
161590
|
-
// ../../packages/superdoc/dist/chunks/DocxZipper-
|
|
161627
|
+
// ../../packages/superdoc/dist/chunks/DocxZipper-TPSo9G36.es.js
|
|
161591
161628
|
function sniffEncoding(u8) {
|
|
161592
161629
|
if (u8.length >= 2) {
|
|
161593
161630
|
const b0 = u8[0], b1 = u8[1];
|
|
@@ -162247,7 +162284,7 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
|
|
|
162247
162284
|
return `image/${MIME_TYPE_FOR_EXT[detectedType] || detectedType}`;
|
|
162248
162285
|
}
|
|
162249
162286
|
}, DocxZipper_default;
|
|
162250
|
-
var
|
|
162287
|
+
var init_DocxZipper_TPSo9G36_es = __esm(() => {
|
|
162251
162288
|
init_rolldown_runtime_Bg48TavK_es();
|
|
162252
162289
|
init_jszip_C49i9kUs_es();
|
|
162253
162290
|
init_xml_js_CqGKpaft_es();
|
|
@@ -162302,7 +162339,8 @@ var init_DocxZipper_Dh4RtvcE_es = __esm(() => {
|
|
|
162302
162339
|
]);
|
|
162303
162340
|
MIME_TYPE_FOR_EXT = {
|
|
162304
162341
|
tif: "tiff",
|
|
162305
|
-
jpg: "jpeg"
|
|
162342
|
+
jpg: "jpeg",
|
|
162343
|
+
svg: "svg+xml"
|
|
162306
162344
|
};
|
|
162307
162345
|
FONT_CONTENT_TYPES = {
|
|
162308
162346
|
odttf: "application/vnd.openxmlformats-officedocument.obfuscatedFont",
|
|
@@ -208837,7 +208875,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
208837
208875
|
init_remark_gfm_BhnWr3yf_es();
|
|
208838
208876
|
});
|
|
208839
208877
|
|
|
208840
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
208878
|
+
// ../../packages/superdoc/dist/chunks/src-BfDVvw9H.es.js
|
|
208841
208879
|
function deleteProps(obj, propOrProps) {
|
|
208842
208880
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
208843
208881
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -211760,6 +211798,15 @@ function shallowEqual$2(a2, b$1) {
|
|
|
211760
211798
|
return false;
|
|
211761
211799
|
return true;
|
|
211762
211800
|
}
|
|
211801
|
+
function isSdtContentFullyLocked(node3) {
|
|
211802
|
+
return node3.attrs.lockMode === "sdtContentLocked";
|
|
211803
|
+
}
|
|
211804
|
+
function findAncestorDepth$1($pos, predicate) {
|
|
211805
|
+
for (let depth = $pos.depth;depth > 0; depth -= 1)
|
|
211806
|
+
if (predicate($pos.node(depth)))
|
|
211807
|
+
return depth;
|
|
211808
|
+
return null;
|
|
211809
|
+
}
|
|
211763
211810
|
function deleteFromEndOfRun(state, dispatch, $pos) {
|
|
211764
211811
|
const rightRun = state.doc.nodeAt($pos.pos + 1);
|
|
211765
211812
|
const $afterRightRunPos = state.doc.resolve($pos.pos + 2 + rightRun.nodeSize);
|
|
@@ -213581,6 +213628,9 @@ function getTableContext($head) {
|
|
|
213581
213628
|
table: table2
|
|
213582
213629
|
};
|
|
213583
213630
|
}
|
|
213631
|
+
function isRtlTable(table2) {
|
|
213632
|
+
return table2?.attrs?.tableProperties?.rightToLeft === true;
|
|
213633
|
+
}
|
|
213584
213634
|
function getCellRect(context) {
|
|
213585
213635
|
const map$12 = TableMap.get(context.table);
|
|
213586
213636
|
return {
|
|
@@ -213588,6 +213638,9 @@ function getCellRect(context) {
|
|
|
213588
213638
|
rect: map$12.findCell(context.cellStart - context.tableStart)
|
|
213589
213639
|
};
|
|
213590
213640
|
}
|
|
213641
|
+
function getEffectiveTableDir(table2, dir) {
|
|
213642
|
+
return isRtlTable(table2) ? -dir : dir;
|
|
213643
|
+
}
|
|
213591
213644
|
function isLastCellInTable(context) {
|
|
213592
213645
|
if (!context)
|
|
213593
213646
|
return false;
|
|
@@ -213679,7 +213732,8 @@ function getTableBoundaryExitSelection(state, dir) {
|
|
|
213679
213732
|
const context = getTableContext(selection.$head);
|
|
213680
213733
|
if (!context)
|
|
213681
213734
|
return null;
|
|
213682
|
-
const
|
|
213735
|
+
const effectiveDir = getEffectiveTableDir(context.table, dir);
|
|
213736
|
+
const helpers = getDirectionHelpers(effectiveDir);
|
|
213683
213737
|
if (!helpers.isEdgeParagraphInCell(selection.$head, context.cellDepth))
|
|
213684
213738
|
return null;
|
|
213685
213739
|
if (!helpers.isAtParagraphBoundary(selection.$head))
|
|
@@ -213690,7 +213744,38 @@ function getTableBoundaryExitSelection(state, dir) {
|
|
|
213690
213744
|
const targetPos = helpers.findTextPosAcrossBoundary(state, boundaryPos);
|
|
213691
213745
|
if (targetPos != null)
|
|
213692
213746
|
return TextSelection.create(state.doc, targetPos);
|
|
213693
|
-
return findSelectionNearBoundary(state, boundaryPos,
|
|
213747
|
+
return findSelectionNearBoundary(state, boundaryPos, effectiveDir);
|
|
213748
|
+
}
|
|
213749
|
+
function getIntraTableArrowSelection(state, dir, expandSelection) {
|
|
213750
|
+
const selection = state.selection;
|
|
213751
|
+
if (!selection.empty)
|
|
213752
|
+
return null;
|
|
213753
|
+
const context = getTableContext(selection.$head);
|
|
213754
|
+
if (!context)
|
|
213755
|
+
return null;
|
|
213756
|
+
if (!isRtlTable(context.table))
|
|
213757
|
+
return null;
|
|
213758
|
+
const effectiveDir = getEffectiveTableDir(context.table, dir);
|
|
213759
|
+
const helpers = getDirectionHelpers(effectiveDir);
|
|
213760
|
+
if (!helpers.isEdgeParagraphInCell(selection.$head, context.cellDepth))
|
|
213761
|
+
return null;
|
|
213762
|
+
if (!helpers.isAtParagraphBoundary(selection.$head))
|
|
213763
|
+
return null;
|
|
213764
|
+
const { map: map$12 } = getCellRect(context);
|
|
213765
|
+
const currentCellRelativePos = context.cellStart - context.tableStart;
|
|
213766
|
+
const nextCellRelativePos = map$12.nextCell(currentCellRelativePos, "horiz", effectiveDir);
|
|
213767
|
+
if (nextCellRelativePos == null)
|
|
213768
|
+
return null;
|
|
213769
|
+
const nextCellAbsolutePos = context.tableStart + nextCellRelativePos;
|
|
213770
|
+
if (expandSelection)
|
|
213771
|
+
return CellSelection.create(state.doc, context.cellStart, nextCellAbsolutePos);
|
|
213772
|
+
const nextCellNode = state.doc.nodeAt(nextCellAbsolutePos);
|
|
213773
|
+
if (!nextCellNode)
|
|
213774
|
+
return null;
|
|
213775
|
+
const targetPos = effectiveDir > 0 ? findFirstTextPosInNode(nextCellNode, nextCellAbsolutePos) : findLastTextPosInNode(nextCellNode, nextCellAbsolutePos);
|
|
213776
|
+
if (targetPos != null)
|
|
213777
|
+
return TextSelection.create(state.doc, targetPos);
|
|
213778
|
+
return findSelectionNearBoundary(state, nextCellAbsolutePos, effectiveDir);
|
|
213694
213779
|
}
|
|
213695
213780
|
function getAdjacentTableEntrySelection(state, dir) {
|
|
213696
213781
|
const selection = state.selection;
|
|
@@ -213707,13 +213792,14 @@ function getAdjacentTableEntrySelection(state, dir) {
|
|
|
213707
213792
|
const adjacentNode = dir > 0 ? $boundary.nodeAfter : $boundary.nodeBefore;
|
|
213708
213793
|
if (!adjacentNode || adjacentNode.type.spec.tableRole !== "table")
|
|
213709
213794
|
return null;
|
|
213710
|
-
|
|
213711
|
-
|
|
213795
|
+
const effectiveDir = isRtlTable(adjacentNode) ? -dir : dir;
|
|
213796
|
+
const tablePos = dir > 0 ? boundaryPos : boundaryPos - adjacentNode.nodeSize;
|
|
213797
|
+
if (effectiveDir > 0) {
|
|
213798
|
+
const targetPos$1 = findFirstTextPosInNode(adjacentNode, tablePos);
|
|
213712
213799
|
if (targetPos$1 != null)
|
|
213713
213800
|
return TextSelection.create(state.doc, targetPos$1);
|
|
213714
|
-
return findSelectionNearBoundary(state,
|
|
213801
|
+
return findSelectionNearBoundary(state, tablePos, 1);
|
|
213715
213802
|
}
|
|
213716
|
-
const tablePos = boundaryPos - adjacentNode.nodeSize;
|
|
213717
213803
|
const targetPos = findLastTextPosInNode(adjacentNode, tablePos);
|
|
213718
213804
|
if (targetPos != null)
|
|
213719
213805
|
return TextSelection.create(state.doc, targetPos);
|
|
@@ -213725,7 +213811,7 @@ function createTableBoundaryNavigationPlugin() {
|
|
|
213725
213811
|
props: { handleKeyDown(view, event) {
|
|
213726
213812
|
if (event.defaultPrevented)
|
|
213727
213813
|
return false;
|
|
213728
|
-
if (event.
|
|
213814
|
+
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
213729
213815
|
return false;
|
|
213730
213816
|
if ((event.key === "Backspace" || event.key === "Delete") && isInProtectedTrailingTableParagraph(view.state)) {
|
|
213731
213817
|
event.preventDefault();
|
|
@@ -213734,7 +213820,14 @@ function createTableBoundaryNavigationPlugin() {
|
|
|
213734
213820
|
const dir = event.key === "ArrowRight" ? 1 : event.key === "ArrowLeft" ? -1 : 0;
|
|
213735
213821
|
if (!dir)
|
|
213736
213822
|
return false;
|
|
213737
|
-
const
|
|
213823
|
+
const context = getTableContext(view.state.selection.$head);
|
|
213824
|
+
const allowShiftInRtlTable = Boolean(event.shiftKey && context && isRtlTable(context.table));
|
|
213825
|
+
if (event.shiftKey && !allowShiftInRtlTable)
|
|
213826
|
+
return false;
|
|
213827
|
+
let nextSelection = getIntraTableArrowSelection(view.state, dir, event.shiftKey);
|
|
213828
|
+
if (!nextSelection && event.shiftKey)
|
|
213829
|
+
return false;
|
|
213830
|
+
nextSelection = nextSelection ?? getTableBoundaryExitSelection(view.state, dir) ?? getAdjacentTableEntrySelection(view.state, dir);
|
|
213738
213831
|
if (!nextSelection)
|
|
213739
213832
|
return false;
|
|
213740
213833
|
view.dispatch(view.state.tr.setSelection(nextSelection).scrollIntoView());
|
|
@@ -255296,18 +255389,28 @@ function resolveRenderedTableWidth(columnWidth, measuredWidth, attrs) {
|
|
|
255296
255389
|
}
|
|
255297
255390
|
function resolveTableFrame(baseX, columnWidth, tableWidth, attrs) {
|
|
255298
255391
|
const width = resolveRenderedTableWidth(columnWidth, tableWidth, attrs);
|
|
255299
|
-
const
|
|
255300
|
-
|
|
255392
|
+
const explicitJustification = typeof attrs?.justification === "string" ? attrs.justification : undefined;
|
|
255393
|
+
const isRtlTable$1 = attrs?.tableProperties?.rightToLeft === true;
|
|
255394
|
+
const effectiveJustification = explicitJustification ?? (isRtlTable$1 ? "end" : undefined);
|
|
255395
|
+
const tableIndent = getTableIndentWidth(attrs);
|
|
255396
|
+
if (effectiveJustification === "center")
|
|
255301
255397
|
return {
|
|
255302
255398
|
x: baseX + (columnWidth - width) / 2,
|
|
255303
255399
|
width
|
|
255304
255400
|
};
|
|
255305
|
-
if (
|
|
255401
|
+
if (effectiveJustification === "right" || effectiveJustification === "end") {
|
|
255402
|
+
const rightAlignedX = baseX + (columnWidth - width);
|
|
255403
|
+
if (explicitJustification == null && isRtlTable$1 && tableIndent !== 0)
|
|
255404
|
+
return {
|
|
255405
|
+
x: rightAlignedX - tableIndent,
|
|
255406
|
+
width
|
|
255407
|
+
};
|
|
255306
255408
|
return {
|
|
255307
|
-
x:
|
|
255409
|
+
x: rightAlignedX,
|
|
255308
255410
|
width
|
|
255309
255411
|
};
|
|
255310
|
-
|
|
255412
|
+
}
|
|
255413
|
+
return applyTableIndent(baseX, width, tableIndent, columnWidth);
|
|
255311
255414
|
}
|
|
255312
255415
|
function calculateColumnMinWidth(measuredWidth) {
|
|
255313
255416
|
if (!Number.isFinite(measuredWidth) || measuredWidth <= 0)
|
|
@@ -263678,30 +263781,61 @@ function isTableBorderValue(value) {
|
|
|
263678
263781
|
function extractTableBorders(bordersInput, options) {
|
|
263679
263782
|
if (!bordersInput || typeof bordersInput !== "object")
|
|
263680
263783
|
return;
|
|
263681
|
-
const
|
|
263784
|
+
const borders = {};
|
|
263785
|
+
const assignConverted = (side, raw) => {
|
|
263786
|
+
if (raw == null)
|
|
263787
|
+
return;
|
|
263788
|
+
if (isTableBorderValue(raw)) {
|
|
263789
|
+
borders[side] = raw;
|
|
263790
|
+
return;
|
|
263791
|
+
}
|
|
263792
|
+
const converted = convertTableBorderValue(raw, options);
|
|
263793
|
+
if (converted !== undefined)
|
|
263794
|
+
borders[side] = converted;
|
|
263795
|
+
};
|
|
263796
|
+
for (const side of [
|
|
263682
263797
|
"top",
|
|
263683
263798
|
"right",
|
|
263684
263799
|
"bottom",
|
|
263685
263800
|
"left",
|
|
263686
263801
|
"insideH",
|
|
263687
263802
|
"insideV"
|
|
263688
|
-
]
|
|
263803
|
+
])
|
|
263804
|
+
assignConverted(side, bordersInput[side]);
|
|
263805
|
+
if (borders.left == null)
|
|
263806
|
+
assignConverted("left", bordersInput.start);
|
|
263807
|
+
if (borders.right == null)
|
|
263808
|
+
assignConverted("right", bordersInput.end);
|
|
263809
|
+
return Object.keys(borders).length > 0 ? borders : undefined;
|
|
263810
|
+
}
|
|
263811
|
+
function extractCellBorders(cellAttrs, _options) {
|
|
263812
|
+
if (!cellAttrs?.borders)
|
|
263813
|
+
return;
|
|
263814
|
+
const bordersData = cellAttrs.borders;
|
|
263689
263815
|
const borders = {};
|
|
263690
|
-
for (const side of
|
|
263691
|
-
|
|
263692
|
-
|
|
263693
|
-
|
|
263694
|
-
|
|
263695
|
-
|
|
263696
|
-
|
|
263697
|
-
|
|
263698
|
-
|
|
263699
|
-
|
|
263700
|
-
|
|
263816
|
+
for (const side of [
|
|
263817
|
+
"top",
|
|
263818
|
+
"right",
|
|
263819
|
+
"bottom",
|
|
263820
|
+
"left"
|
|
263821
|
+
]) {
|
|
263822
|
+
const spec = convertBorderSpec(bordersData[side]);
|
|
263823
|
+
if (spec)
|
|
263824
|
+
borders[side] = spec;
|
|
263825
|
+
}
|
|
263826
|
+
if (borders.left == null) {
|
|
263827
|
+
const spec = convertBorderSpec(bordersData.start);
|
|
263828
|
+
if (spec)
|
|
263829
|
+
borders.left = spec;
|
|
263830
|
+
}
|
|
263831
|
+
if (borders.right == null) {
|
|
263832
|
+
const spec = convertBorderSpec(bordersData.end);
|
|
263833
|
+
if (spec)
|
|
263834
|
+
borders.right = spec;
|
|
263701
263835
|
}
|
|
263702
263836
|
return Object.keys(borders).length > 0 ? borders : undefined;
|
|
263703
263837
|
}
|
|
263704
|
-
function extractCellPadding(cellAttrs) {
|
|
263838
|
+
function extractCellPadding(cellAttrs, _options) {
|
|
263705
263839
|
const cellMargins = cellAttrs?.cellMargins;
|
|
263706
263840
|
if (!cellMargins || typeof cellMargins !== "object")
|
|
263707
263841
|
return;
|
|
@@ -263715,6 +263849,12 @@ function extractCellPadding(cellAttrs) {
|
|
|
263715
263849
|
padding.bottom = margins.bottom;
|
|
263716
263850
|
if (typeof margins.left === "number")
|
|
263717
263851
|
padding.left = margins.left;
|
|
263852
|
+
const marginStart = margins.marginStart;
|
|
263853
|
+
const marginEnd = margins.marginEnd;
|
|
263854
|
+
if (typeof marginStart === "number" && padding.left == null)
|
|
263855
|
+
padding.left = marginStart;
|
|
263856
|
+
if (typeof marginEnd === "number" && padding.right == null)
|
|
263857
|
+
padding.right = marginEnd;
|
|
263718
263858
|
if (Object.keys(padding).length === 0)
|
|
263719
263859
|
return;
|
|
263720
263860
|
return normalizeCellPaddingTopBottom(padding);
|
|
@@ -265539,7 +265679,11 @@ function tableNodeToBlock(node3, { nextBlockId, positions, storyKey, trackedChan
|
|
|
265539
265679
|
};
|
|
265540
265680
|
};
|
|
265541
265681
|
const borderSource = getBorderSource();
|
|
265542
|
-
const
|
|
265682
|
+
const isRtlTable$1 = tablePropertiesForCascade?.rightToLeft === true;
|
|
265683
|
+
const tableBorders = borderSource ? extractTableBorders(borderSource.borders, {
|
|
265684
|
+
unit: borderSource.unit,
|
|
265685
|
+
isRtl: isRtlTable$1
|
|
265686
|
+
}) : undefined;
|
|
265543
265687
|
if (tableBorders)
|
|
265544
265688
|
tableAttrs.borders = tableBorders;
|
|
265545
265689
|
if (node3.attrs?.borderCollapse)
|
|
@@ -276461,6 +276605,35 @@ var Node$13 = class Node$14 {
|
|
|
276461
276605
|
dispatch(tr.scrollIntoView());
|
|
276462
276606
|
}
|
|
276463
276607
|
return true;
|
|
276608
|
+
}, deleteBlockSdtAtTextBlockStart = () => ({ state, dispatch }) => {
|
|
276609
|
+
const { selection } = state;
|
|
276610
|
+
if (!selection.empty)
|
|
276611
|
+
return false;
|
|
276612
|
+
const { $from } = selection;
|
|
276613
|
+
const sdtDepth = findAncestorDepth$1($from, (node3) => node3.type.name === "structuredContentBlock");
|
|
276614
|
+
if (sdtDepth == null)
|
|
276615
|
+
return false;
|
|
276616
|
+
const textblockDepth = findAncestorDepth$1($from, (node3) => node3.isTextblock);
|
|
276617
|
+
if (textblockDepth !== sdtDepth + 1)
|
|
276618
|
+
return false;
|
|
276619
|
+
if ($from.node(textblockDepth).type.name !== "paragraph")
|
|
276620
|
+
return false;
|
|
276621
|
+
if ($from.pos !== $from.start(textblockDepth))
|
|
276622
|
+
return false;
|
|
276623
|
+
if ($from.before(textblockDepth) !== $from.start(sdtDepth))
|
|
276624
|
+
return false;
|
|
276625
|
+
const sdtNode = $from.node(sdtDepth);
|
|
276626
|
+
if (sdtNode.attrs.lockMode === "sdtLocked")
|
|
276627
|
+
return false;
|
|
276628
|
+
if (isSdtContentFullyLocked(sdtNode))
|
|
276629
|
+
return true;
|
|
276630
|
+
if (dispatch) {
|
|
276631
|
+
const from$1 = $from.before(sdtDepth);
|
|
276632
|
+
const tr = state.tr.delete(from$1, from$1 + sdtNode.nodeSize);
|
|
276633
|
+
const selectionPos = Math.min(from$1, tr.doc.content.size);
|
|
276634
|
+
dispatch(tr.setSelection(Selection.near(tr.doc.resolve(selectionPos), -1)).scrollIntoView());
|
|
276635
|
+
}
|
|
276636
|
+
return true;
|
|
276464
276637
|
}, deleteSkipEmptyRun = () => ({ state, dispatch }) => {
|
|
276465
276638
|
const sel = state.selection;
|
|
276466
276639
|
if (!sel.empty)
|
|
@@ -284954,6 +285127,7 @@ var Node$13 = class Node$14 {
|
|
|
284954
285127
|
tr.setMeta("inputType", "deleteContentBackward");
|
|
284955
285128
|
return false;
|
|
284956
285129
|
},
|
|
285130
|
+
() => commands$1.deleteBlockSdtAtTextBlockStart(),
|
|
284957
285131
|
() => commands$1.backspaceEmptyRunParagraph(),
|
|
284958
285132
|
() => commands$1.backspaceSkipEmptyRun(),
|
|
284959
285133
|
() => commands$1.backspaceAtomBefore(),
|
|
@@ -284968,6 +285142,7 @@ var Node$13 = class Node$14 {
|
|
|
284968
285142
|
const { view } = editor;
|
|
284969
285143
|
dispatchHistoryBoundary(view);
|
|
284970
285144
|
return editor.commands.first(({ commands: commands$1 }) => [
|
|
285145
|
+
() => commands$1.deleteBlockSdtAtTextBlockStart(),
|
|
284971
285146
|
() => commands$1.deleteSkipEmptyRun(),
|
|
284972
285147
|
() => commands$1.deleteAtomAfter(),
|
|
284973
285148
|
() => commands$1.deleteNextToRun(),
|
|
@@ -290195,6 +290370,7 @@ menclose::after {
|
|
|
290195
290370
|
min: boundary.minWidth,
|
|
290196
290371
|
r: boundary.resizable ? 1 : 0
|
|
290197
290372
|
})),
|
|
290373
|
+
rtl: isRtl,
|
|
290198
290374
|
segments: boundarySegments.map((segs, colIndex) => segs.map((seg) => ({
|
|
290199
290375
|
c: colIndex,
|
|
290200
290376
|
y: seg.y + contentTop,
|
|
@@ -290213,7 +290389,7 @@ menclose::after {
|
|
|
290213
290389
|
}
|
|
290214
290390
|
if (block.id)
|
|
290215
290391
|
container.setAttribute("data-sd-block-id", block.id);
|
|
290216
|
-
if ((block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse")) === "separate" &&
|
|
290392
|
+
if ((block.attrs?.borderCollapse ?? (block.attrs?.cellSpacing != null ? "separate" : "collapse")) === "separate" && tableBorders) {
|
|
290217
290393
|
applyBorder(container, "Top", borderValueToSpec(tableBorders.top));
|
|
290218
290394
|
applyBorder(container, "Right", borderValueToSpec(isRtl ? tableBorders.left : tableBorders.right));
|
|
290219
290395
|
applyBorder(container, "Bottom", borderValueToSpec(tableBorders.bottom));
|
|
@@ -297022,7 +297198,9 @@ menclose::after {
|
|
|
297022
297198
|
"left",
|
|
297023
297199
|
"right",
|
|
297024
297200
|
"insideH",
|
|
297025
|
-
"insideV"
|
|
297201
|
+
"insideV",
|
|
297202
|
+
"start",
|
|
297203
|
+
"end"
|
|
297026
297204
|
];
|
|
297027
297205
|
const result = {};
|
|
297028
297206
|
for (const side of sides) {
|
|
@@ -297347,6 +297525,7 @@ menclose::after {
|
|
|
297347
297525
|
return null;
|
|
297348
297526
|
const cellAttrs = {};
|
|
297349
297527
|
if (resolvedTcProps?.borders && typeof resolvedTcProps.borders === "object") {
|
|
297528
|
+
const resolvedBordersData = resolvedTcProps.borders;
|
|
297350
297529
|
const resolvedBorders = {};
|
|
297351
297530
|
for (const side of [
|
|
297352
297531
|
"top",
|
|
@@ -297354,36 +297533,46 @@ menclose::after {
|
|
|
297354
297533
|
"bottom",
|
|
297355
297534
|
"left"
|
|
297356
297535
|
]) {
|
|
297357
|
-
const spec = convertResolvedCellBorder(
|
|
297536
|
+
const spec = convertResolvedCellBorder(resolvedBordersData[side]);
|
|
297358
297537
|
if (spec)
|
|
297359
297538
|
resolvedBorders[side] = spec;
|
|
297360
297539
|
}
|
|
297540
|
+
if (resolvedBorders.left == null) {
|
|
297541
|
+
const spec = convertResolvedCellBorder(resolvedBordersData.start);
|
|
297542
|
+
if (spec)
|
|
297543
|
+
resolvedBorders.left = spec;
|
|
297544
|
+
}
|
|
297545
|
+
if (resolvedBorders.right == null) {
|
|
297546
|
+
const spec = convertResolvedCellBorder(resolvedBordersData.end);
|
|
297547
|
+
if (spec)
|
|
297548
|
+
resolvedBorders.right = spec;
|
|
297549
|
+
}
|
|
297361
297550
|
if (Object.keys(resolvedBorders).length > 0)
|
|
297362
297551
|
cellAttrs.borders = resolvedBorders;
|
|
297363
297552
|
}
|
|
297364
297553
|
if (!cellAttrs.borders && cellNode.attrs?.borders && typeof cellNode.attrs.borders === "object") {
|
|
297365
297554
|
const legacy = cellNode.attrs.borders;
|
|
297366
|
-
const
|
|
297555
|
+
const filteredLegacyBorders = {};
|
|
297367
297556
|
for (const side of [
|
|
297368
297557
|
"top",
|
|
297369
297558
|
"right",
|
|
297370
297559
|
"bottom",
|
|
297371
|
-
"left"
|
|
297560
|
+
"left",
|
|
297561
|
+
"start",
|
|
297562
|
+
"end"
|
|
297372
297563
|
]) {
|
|
297373
297564
|
const b$1 = legacy[side];
|
|
297374
|
-
if (b$1 && b$1.val && typeof b$1.size === "number" && b$1.size > 0)
|
|
297375
|
-
|
|
297376
|
-
|
|
297377
|
-
|
|
297378
|
-
width: b$1.size,
|
|
297379
|
-
color: color2
|
|
297565
|
+
if (b$1 && b$1.val && typeof b$1.size === "number" && b$1.size > 0)
|
|
297566
|
+
filteredLegacyBorders[side] = {
|
|
297567
|
+
...b$1,
|
|
297568
|
+
val: normalizeLegacyBorderStyle(b$1.val)
|
|
297380
297569
|
};
|
|
297381
|
-
}
|
|
297382
297570
|
}
|
|
297383
|
-
|
|
297571
|
+
const fallback = extractCellBorders({ borders: filteredLegacyBorders }, { isRtl: tableProperties?.rightToLeft === true });
|
|
297572
|
+
if (fallback)
|
|
297384
297573
|
cellAttrs.borders = fallback;
|
|
297385
297574
|
}
|
|
297386
|
-
const padding = extractCellPadding(cellNode.attrs ?? {}) ?? (defaultCellPadding ? { ...defaultCellPadding } : undefined);
|
|
297575
|
+
const padding = extractCellPadding(cellNode.attrs ?? {}, { isRtl: tableProperties?.rightToLeft === true }) ?? (defaultCellPadding ? { ...defaultCellPadding } : undefined);
|
|
297387
297576
|
if (padding)
|
|
297388
297577
|
cellAttrs.padding = padding;
|
|
297389
297578
|
const verticalAlign = cellNode.attrs?.verticalAlign;
|
|
@@ -302529,18 +302718,18 @@ menclose::after {
|
|
|
302529
302718
|
return;
|
|
302530
302719
|
console.log(...args$1);
|
|
302531
302720
|
}, 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;
|
|
302532
|
-
var
|
|
302721
|
+
var init_src_BfDVvw9H_es = __esm(() => {
|
|
302533
302722
|
init_rolldown_runtime_Bg48TavK_es();
|
|
302534
|
-
|
|
302723
|
+
init_SuperConverter_CbX9ZPI9_es();
|
|
302535
302724
|
init_jszip_C49i9kUs_es();
|
|
302536
302725
|
init_uuid_qzgm05fK_es();
|
|
302537
|
-
|
|
302726
|
+
init_create_headless_toolbar_CbUkXBcM_es();
|
|
302538
302727
|
init_constants_DrU4EASo_es();
|
|
302539
302728
|
init_dist_B8HfvhaK_es();
|
|
302540
302729
|
init_unified_Dsuw2be5_es();
|
|
302541
302730
|
init_remark_gfm_BhnWr3yf_es();
|
|
302542
302731
|
init_remark_stringify_6MMJfY0k_es();
|
|
302543
|
-
|
|
302732
|
+
init_DocxZipper_TPSo9G36_es();
|
|
302544
302733
|
init__plugin_vue_export_helper_HmhZBO0u_es();
|
|
302545
302734
|
init_eventemitter3_UwU_CLPU_es();
|
|
302546
302735
|
init_errors_C_DoKMoN_es();
|
|
@@ -305302,6 +305491,7 @@ ${err.toString()}`);
|
|
|
305302
305491
|
decreaseListIndent: () => decreaseListIndent,
|
|
305303
305492
|
decreaseTextIndent: () => decreaseTextIndent,
|
|
305304
305493
|
deleteAtomAfter: () => deleteAtomAfter,
|
|
305494
|
+
deleteBlockSdtAtTextBlockStart: () => deleteBlockSdtAtTextBlockStart,
|
|
305305
305495
|
deleteNextToRun: () => deleteNextToRun,
|
|
305306
305496
|
deleteSelection: () => deleteSelection$1,
|
|
305307
305497
|
deleteSkipEmptyRun: () => deleteSkipEmptyRun,
|
|
@@ -340575,11 +340765,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
340575
340765
|
];
|
|
340576
340766
|
});
|
|
340577
340767
|
|
|
340578
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
340768
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-CkcWwDom.es.js
|
|
340579
340769
|
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;
|
|
340580
|
-
var
|
|
340581
|
-
|
|
340582
|
-
|
|
340770
|
+
var init_create_super_doc_ui_CkcWwDom_es = __esm(() => {
|
|
340771
|
+
init_SuperConverter_CbX9ZPI9_es();
|
|
340772
|
+
init_create_headless_toolbar_CbUkXBcM_es();
|
|
340583
340773
|
MOD_ALIASES = new Set([
|
|
340584
340774
|
"Mod",
|
|
340585
340775
|
"Meta",
|
|
@@ -340621,16 +340811,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
340621
340811
|
|
|
340622
340812
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
340623
340813
|
var init_super_editor_es = __esm(() => {
|
|
340624
|
-
|
|
340625
|
-
|
|
340814
|
+
init_src_BfDVvw9H_es();
|
|
340815
|
+
init_SuperConverter_CbX9ZPI9_es();
|
|
340626
340816
|
init_jszip_C49i9kUs_es();
|
|
340627
340817
|
init_xml_js_CqGKpaft_es();
|
|
340628
|
-
|
|
340818
|
+
init_create_headless_toolbar_CbUkXBcM_es();
|
|
340629
340819
|
init_constants_DrU4EASo_es();
|
|
340630
340820
|
init_dist_B8HfvhaK_es();
|
|
340631
340821
|
init_unified_Dsuw2be5_es();
|
|
340632
|
-
|
|
340633
|
-
|
|
340822
|
+
init_DocxZipper_TPSo9G36_es();
|
|
340823
|
+
init_create_super_doc_ui_CkcWwDom_es();
|
|
340634
340824
|
init_ui_CGB3qmy3_es();
|
|
340635
340825
|
init_eventemitter3_UwU_CLPU_es();
|
|
340636
340826
|
init_errors_C_DoKMoN_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.8.0-next.
|
|
3
|
+
"version": "0.8.0-next.104",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.8.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.8.0-next.
|
|
39
|
-
"@superdoc-dev/cli-linux-
|
|
40
|
-
"@superdoc-dev/cli-
|
|
41
|
-
"@superdoc-dev/cli-
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.8.0-next.104",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.8.0-next.104",
|
|
39
|
+
"@superdoc-dev/cli-linux-arm64": "0.8.0-next.104",
|
|
40
|
+
"@superdoc-dev/cli-windows-x64": "0.8.0-next.104",
|
|
41
|
+
"@superdoc-dev/cli-linux-x64": "0.8.0-next.104"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|