@superdoc-dev/cli 0.2.0-next.33 → 0.2.0-next.35
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 +215 -34
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -101805,9 +101805,9 @@ var init_remark_gfm_CQ3Jg4PR_es = __esm(() => {
|
|
|
101805
101805
|
init_remark_gfm_z_sDF4ss_es();
|
|
101806
101806
|
});
|
|
101807
101807
|
|
|
101808
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
101809
|
-
var
|
|
101810
|
-
__export(
|
|
101808
|
+
// ../../packages/superdoc/dist/chunks/src-dG-lytW9.es.js
|
|
101809
|
+
var exports_src_dG_lytW9_es = {};
|
|
101810
|
+
__export(exports_src_dG_lytW9_es, {
|
|
101811
101811
|
zt: () => defineMark,
|
|
101812
101812
|
z: () => cM,
|
|
101813
101813
|
yt: () => removeAwarenessStates,
|
|
@@ -115851,6 +115851,16 @@ function insertRowAtIndex({ tr, tablePos, tableNode, sourceRowIndex, insertIndex
|
|
|
115851
115851
|
function generateParaId() {
|
|
115852
115852
|
return Array.from({ length: 8 }, () => Math.floor(Math.random() * 16).toString(16)).join("").toUpperCase();
|
|
115853
115853
|
}
|
|
115854
|
+
function createSeparatorParagraph(schema) {
|
|
115855
|
+
const paragraphType = schema.nodes.paragraph;
|
|
115856
|
+
if (!paragraphType)
|
|
115857
|
+
return null;
|
|
115858
|
+
const separatorAttrs = {
|
|
115859
|
+
sdBlockId: v4_default(),
|
|
115860
|
+
paraId: generateParaId()
|
|
115861
|
+
};
|
|
115862
|
+
return paragraphType.createAndFill(separatorAttrs) ?? paragraphType.createAndFill();
|
|
115863
|
+
}
|
|
115854
115864
|
function buildTableSuccess(tableAddress, trackedChangeRefs) {
|
|
115855
115865
|
return {
|
|
115856
115866
|
success: true,
|
|
@@ -116840,8 +116850,12 @@ function tablesSplitAdapter(editor, input2, options) {
|
|
|
116840
116850
|
delete newTableAttrs.paraId;
|
|
116841
116851
|
delete newTableAttrs.textId;
|
|
116842
116852
|
const newTable = schema.nodes.table.create(newTableAttrs, secondTableRows);
|
|
116853
|
+
const separatorParagraph = createSeparatorParagraph(schema);
|
|
116854
|
+
if (!separatorParagraph)
|
|
116855
|
+
return toTableFailure("INVALID_TARGET", "Table split could not create a separator paragraph.");
|
|
116843
116856
|
const insertPos = tr.mapping.slice(mapFrom).map(tablePos + tableNode.nodeSize);
|
|
116844
|
-
tr.insert(insertPos,
|
|
116857
|
+
tr.insert(insertPos, separatorParagraph);
|
|
116858
|
+
tr.insert(insertPos + separatorParagraph.nodeSize, newTable);
|
|
116845
116859
|
applyDirectMutationMeta(tr);
|
|
116846
116860
|
editor.dispatch(tr);
|
|
116847
116861
|
clearIndexCache(editor);
|
|
@@ -116993,26 +117007,69 @@ function tablesInsertCellAdapter(editor, input2, options) {
|
|
|
116993
117007
|
function tablesDeleteCellAdapter(editor, input2, options) {
|
|
116994
117008
|
rejectTrackedMode("tables.deleteCell", options);
|
|
116995
117009
|
const { table: table2, cellPos, cellNode, rowIndex, columnIndex } = resolveCellLocator(editor, input2, "tables.deleteCell");
|
|
117010
|
+
const row2 = table2.candidate.node.child(rowIndex);
|
|
117011
|
+
const deletedColspan = Math.max(1, cellNode.attrs.colspan || 1);
|
|
117012
|
+
const deletedColwidth = Array.isArray(cellNode.attrs.colwidth) ? [...cellNode.attrs.colwidth] : null;
|
|
117013
|
+
if (input2.mode === "shiftLeft" && row2.childCount <= 1)
|
|
117014
|
+
return toTableFailure("NO_OP", "Cannot shift-left delete the last remaining cell in a row.");
|
|
116996
117015
|
if (options?.dryRun)
|
|
116997
117016
|
return buildTableSuccess(table2.address);
|
|
116998
117017
|
try {
|
|
116999
117018
|
const tr = editor.state.tr;
|
|
117000
|
-
const
|
|
117019
|
+
const tablePos = table2.candidate.pos;
|
|
117020
|
+
const tableStart = tablePos + 1;
|
|
117001
117021
|
const tableNode = table2.candidate.node;
|
|
117002
117022
|
const map$22 = TableMap.get(tableNode);
|
|
117003
117023
|
const schema = editor.state.schema;
|
|
117004
117024
|
tr.delete(cellPos, cellPos + cellNode.nodeSize);
|
|
117005
117025
|
if (input2.mode === "shiftLeft") {
|
|
117006
|
-
const
|
|
117007
|
-
|
|
117008
|
-
|
|
117009
|
-
|
|
117010
|
-
|
|
117011
|
-
|
|
117012
|
-
|
|
117013
|
-
const
|
|
117014
|
-
const
|
|
117015
|
-
|
|
117026
|
+
const currentTableNode = tr.doc.nodeAt(tablePos);
|
|
117027
|
+
if (!currentTableNode || currentTableNode.type.name !== "table")
|
|
117028
|
+
return toTableFailure("INVALID_TARGET", "Cell deletion could not locate the updated table.");
|
|
117029
|
+
const currentRow = currentTableNode.child(rowIndex);
|
|
117030
|
+
const lastCellIndex = currentRow.childCount - 1;
|
|
117031
|
+
const lastAttrs = currentRow.child(lastCellIndex).attrs;
|
|
117032
|
+
const tableCellProperties = lastAttrs.tableCellProperties ?? {};
|
|
117033
|
+
const lastRowspan = Math.max(1, lastAttrs.rowspan || 1);
|
|
117034
|
+
const hasVerticalMerge = tableCellProperties.vMerge != null;
|
|
117035
|
+
if (lastRowspan > 1 || hasVerticalMerge) {
|
|
117036
|
+
let rowEndPos = tablePos + 1;
|
|
117037
|
+
for (let i$1 = 0;i$1 <= rowIndex; i$1++)
|
|
117038
|
+
rowEndPos += currentTableNode.child(i$1).nodeSize;
|
|
117039
|
+
const mappedRowEnd = rowEndPos - 1;
|
|
117040
|
+
const newCell = schema.nodes.tableCell.createAndFill();
|
|
117041
|
+
tr.insert(mappedRowEnd, newCell);
|
|
117042
|
+
} else {
|
|
117043
|
+
const nextColspan = Math.max(1, lastAttrs.colspan || 1) + deletedColspan;
|
|
117044
|
+
const nextTableCellProps = { ...tableCellProperties };
|
|
117045
|
+
if (nextColspan > 1)
|
|
117046
|
+
nextTableCellProps.gridSpan = nextColspan;
|
|
117047
|
+
else
|
|
117048
|
+
delete nextTableCellProps.gridSpan;
|
|
117049
|
+
const nextColwidth = Array.isArray(lastAttrs.colwidth) ? [...lastAttrs.colwidth] : null;
|
|
117050
|
+
if (nextColwidth) {
|
|
117051
|
+
if (deletedColwidth)
|
|
117052
|
+
for (const width of deletedColwidth) {
|
|
117053
|
+
if (nextColwidth.length >= nextColspan)
|
|
117054
|
+
break;
|
|
117055
|
+
nextColwidth.push(typeof width === "number" ? width : 0);
|
|
117056
|
+
}
|
|
117057
|
+
while (nextColwidth.length < nextColspan)
|
|
117058
|
+
nextColwidth.push(0);
|
|
117059
|
+
}
|
|
117060
|
+
let rowOffset = 0;
|
|
117061
|
+
for (let i$1 = 0;i$1 < rowIndex; i$1++)
|
|
117062
|
+
rowOffset += currentTableNode.child(i$1).nodeSize;
|
|
117063
|
+
let lastCellOffset = rowOffset + 1;
|
|
117064
|
+
for (let i$1 = 0;i$1 < lastCellIndex; i$1++)
|
|
117065
|
+
lastCellOffset += currentRow.child(i$1).nodeSize;
|
|
117066
|
+
tr.setNodeMarkup(tableStart + lastCellOffset, null, {
|
|
117067
|
+
...lastAttrs,
|
|
117068
|
+
colspan: nextColspan,
|
|
117069
|
+
colwidth: nextColwidth,
|
|
117070
|
+
tableCellProperties: nextTableCellProps
|
|
117071
|
+
});
|
|
117072
|
+
}
|
|
117016
117073
|
} else {
|
|
117017
117074
|
const lastRowIndex = map$22.height - 1;
|
|
117018
117075
|
const colOffset = map$22.map[lastRowIndex * map$22.width + columnIndex];
|
|
@@ -117558,6 +117615,38 @@ function tablesSetShadingAdapter(editor, input2, options) {
|
|
|
117558
117615
|
[propsKey]: currentProps,
|
|
117559
117616
|
...syncAttrs
|
|
117560
117617
|
});
|
|
117618
|
+
if (resolved.scope === "table") {
|
|
117619
|
+
const tableNode = resolved.node;
|
|
117620
|
+
const tableStart = resolved.pos + 1;
|
|
117621
|
+
const map$22 = TableMap.get(tableNode);
|
|
117622
|
+
const seen = /* @__PURE__ */ new Set;
|
|
117623
|
+
const mapFrom = tr.mapping.maps.length;
|
|
117624
|
+
for (let i$1 = 0;i$1 < map$22.map.length; i$1++) {
|
|
117625
|
+
const relPos = map$22.map[i$1];
|
|
117626
|
+
if (seen.has(relPos))
|
|
117627
|
+
continue;
|
|
117628
|
+
seen.add(relPos);
|
|
117629
|
+
const cellNode = tableNode.nodeAt(relPos);
|
|
117630
|
+
if (!cellNode)
|
|
117631
|
+
continue;
|
|
117632
|
+
const cellAttrs = cellNode.attrs;
|
|
117633
|
+
const cellProps = { ...cellAttrs.tableCellProperties ?? {} };
|
|
117634
|
+
cellProps.shading = {
|
|
117635
|
+
fill: input2.color,
|
|
117636
|
+
val: "clear",
|
|
117637
|
+
color: "auto"
|
|
117638
|
+
};
|
|
117639
|
+
const nextCellAttrs = {
|
|
117640
|
+
...cellAttrs,
|
|
117641
|
+
tableCellProperties: cellProps
|
|
117642
|
+
};
|
|
117643
|
+
if (input2.color === "auto")
|
|
117644
|
+
delete nextCellAttrs.background;
|
|
117645
|
+
else
|
|
117646
|
+
nextCellAttrs.background = { color: input2.color };
|
|
117647
|
+
tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(tableStart + relPos), null, nextCellAttrs);
|
|
117648
|
+
}
|
|
117649
|
+
}
|
|
117561
117650
|
applyDirectMutationMeta(tr);
|
|
117562
117651
|
editor.dispatch(tr);
|
|
117563
117652
|
clearIndexCache(editor);
|
|
@@ -173043,7 +173132,7 @@ var Node$13 = class Node$14 {
|
|
|
173043
173132
|
trackedChanges: context.trackedChanges ?? []
|
|
173044
173133
|
});
|
|
173045
173134
|
}, _hoisted_1$6, _hoisted_2$1, _hoisted_3, _hoisted_4, ContextMenu_default, _hoisted_1$5, BasicUpload_default, _hoisted_1$4, MIN_WIDTH = 200, PPI = 96, alignment = "flex-end", Ruler_default, GenericPopover_default, _hoisted_1$3, RESIZE_HANDLE_WIDTH_PX = 9, RESIZE_HANDLE_OFFSET_PX = 4, DRAG_OVERLAY_EXTENSION_PX = 1000, MIN_DRAG_OVERLAY_WIDTH_PX = 2000, THROTTLE_INTERVAL_MS = 16, MIN_RESIZE_DELTA_PX = 1, TableResizeOverlay_default, _hoisted_1$2, OVERLAY_EXPANSION_PX = 2000, RESIZE_HANDLE_SIZE_PX = 12, MOUSE_MOVE_THROTTLE_MS = 16, DIMENSION_CHANGE_THRESHOLD_PX = 1, Z_INDEX_OVERLAY = 10, Z_INDEX_HANDLE = 15, Z_INDEX_GUIDELINE = 20, ImageResizeOverlay_default, LINK_CLICK_DEBOUNCE_MS = 300, CURSOR_UPDATE_TIMEOUT_MS = 10, LinkClickHandler_default, _hoisted_1$1, _hoisted_2, DOCX2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", TABLE_RESIZE_HOVER_THRESHOLD = 8, TABLE_RESIZE_THROTTLE_MS = 16, SuperEditor_default, _hoisted_1, SuperInput_default, SlashMenu, Extensions;
|
|
173046
|
-
var
|
|
173135
|
+
var init_src_dG_lytW9_es = __esm(() => {
|
|
173047
173136
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
173048
173137
|
init_SuperConverter_BSZgN87C_es();
|
|
173049
173138
|
init_jszip_ChlR43oI_es();
|
|
@@ -203936,8 +204025,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
203936
204025
|
return isObjectLike_default(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
203937
204026
|
};
|
|
203938
204027
|
stubFalse_default = stubFalse;
|
|
203939
|
-
freeExports$2 = typeof
|
|
203940
|
-
freeModule$2 = freeExports$2 && typeof
|
|
204028
|
+
freeExports$2 = typeof exports_src_dG_lytW9_es == "object" && exports_src_dG_lytW9_es && !exports_src_dG_lytW9_es.nodeType && exports_src_dG_lytW9_es;
|
|
204029
|
+
freeModule$2 = freeExports$2 && typeof module_src_dG_lytW9_es == "object" && module_src_dG_lytW9_es && !module_src_dG_lytW9_es.nodeType && module_src_dG_lytW9_es;
|
|
203941
204030
|
Buffer$1 = freeModule$2 && freeModule$2.exports === freeExports$2 ? _root_default.Buffer : undefined;
|
|
203942
204031
|
isBuffer_default = (Buffer$1 ? Buffer$1.isBuffer : undefined) || stubFalse_default;
|
|
203943
204032
|
typedArrayTags = {};
|
|
@@ -203945,8 +204034,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
203945
204034
|
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
|
|
203946
204035
|
_baseIsTypedArray_default = baseIsTypedArray;
|
|
203947
204036
|
_baseUnary_default = baseUnary;
|
|
203948
|
-
freeExports$1 = typeof
|
|
203949
|
-
freeModule$1 = freeExports$1 && typeof
|
|
204037
|
+
freeExports$1 = typeof exports_src_dG_lytW9_es == "object" && exports_src_dG_lytW9_es && !exports_src_dG_lytW9_es.nodeType && exports_src_dG_lytW9_es;
|
|
204038
|
+
freeModule$1 = freeExports$1 && typeof module_src_dG_lytW9_es == "object" && module_src_dG_lytW9_es && !module_src_dG_lytW9_es.nodeType && module_src_dG_lytW9_es;
|
|
203950
204039
|
freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && _freeGlobal_default.process;
|
|
203951
204040
|
_nodeUtil_default = function() {
|
|
203952
204041
|
try {
|
|
@@ -204051,8 +204140,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
204051
204140
|
Stack.prototype.has = _stackHas_default;
|
|
204052
204141
|
Stack.prototype.set = _stackSet_default;
|
|
204053
204142
|
_Stack_default = Stack;
|
|
204054
|
-
freeExports = typeof
|
|
204055
|
-
freeModule = freeExports && typeof
|
|
204143
|
+
freeExports = typeof exports_src_dG_lytW9_es == "object" && exports_src_dG_lytW9_es && !exports_src_dG_lytW9_es.nodeType && exports_src_dG_lytW9_es;
|
|
204144
|
+
freeModule = freeExports && typeof module_src_dG_lytW9_es == "object" && module_src_dG_lytW9_es && !module_src_dG_lytW9_es.nodeType && module_src_dG_lytW9_es;
|
|
204056
204145
|
Buffer4 = freeModule && freeModule.exports === freeExports ? _root_default.Buffer : undefined;
|
|
204057
204146
|
allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
|
|
204058
204147
|
_cloneBuffer_default = cloneBuffer;
|
|
@@ -211704,7 +211793,7 @@ var init_zipper_Cnk_HjM2_es = __esm(() => {
|
|
|
211704
211793
|
|
|
211705
211794
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
211706
211795
|
var init_super_editor_es = __esm(() => {
|
|
211707
|
-
|
|
211796
|
+
init_src_dG_lytW9_es();
|
|
211708
211797
|
init_SuperConverter_BSZgN87C_es();
|
|
211709
211798
|
init_jszip_ChlR43oI_es();
|
|
211710
211799
|
init_xml_js_DLE8mr0n_es();
|
|
@@ -271350,6 +271439,16 @@ var init_appendRows = __esm(() => {
|
|
|
271350
271439
|
function generateParaId2() {
|
|
271351
271440
|
return Array.from({ length: 8 }, () => Math.floor(Math.random() * 16).toString(16)).join("").toUpperCase();
|
|
271352
271441
|
}
|
|
271442
|
+
function createSeparatorParagraph2(schema) {
|
|
271443
|
+
const paragraphType = schema.nodes.paragraph;
|
|
271444
|
+
if (!paragraphType)
|
|
271445
|
+
return null;
|
|
271446
|
+
const separatorAttrs = {
|
|
271447
|
+
sdBlockId: v42(),
|
|
271448
|
+
paraId: generateParaId2()
|
|
271449
|
+
};
|
|
271450
|
+
return paragraphType.createAndFill(separatorAttrs) ?? paragraphType.createAndFill();
|
|
271451
|
+
}
|
|
271353
271452
|
function buildTableSuccess2(tableAddress, trackedChangeRefs) {
|
|
271354
271453
|
return {
|
|
271355
271454
|
success: true,
|
|
@@ -272324,8 +272423,13 @@ function tablesSplitAdapter2(editor, input2, options) {
|
|
|
272324
272423
|
delete newTableAttrs.paraId;
|
|
272325
272424
|
delete newTableAttrs.textId;
|
|
272326
272425
|
const newTable = schema.nodes.table.create(newTableAttrs, secondTableRows);
|
|
272426
|
+
const separatorParagraph = createSeparatorParagraph2(schema);
|
|
272427
|
+
if (!separatorParagraph) {
|
|
272428
|
+
return toTableFailure2("INVALID_TARGET", "Table split could not create a separator paragraph.");
|
|
272429
|
+
}
|
|
272327
272430
|
const insertPos = tr.mapping.slice(mapFrom).map(tablePos + tableNode.nodeSize);
|
|
272328
|
-
tr.insert(insertPos,
|
|
272431
|
+
tr.insert(insertPos, separatorParagraph);
|
|
272432
|
+
tr.insert(insertPos + separatorParagraph.nodeSize, newTable);
|
|
272329
272433
|
applyDirectMutationMeta2(tr);
|
|
272330
272434
|
editor.dispatch(tr);
|
|
272331
272435
|
clearIndexCache2(editor);
|
|
@@ -272493,6 +272597,12 @@ function tablesDeleteCellAdapter2(editor, input2, options) {
|
|
|
272493
272597
|
rejectTrackedMode2("tables.deleteCell", options);
|
|
272494
272598
|
const resolved = resolveCellLocator2(editor, input2, "tables.deleteCell");
|
|
272495
272599
|
const { table: table2, cellPos, cellNode, rowIndex, columnIndex } = resolved;
|
|
272600
|
+
const row2 = table2.candidate.node.child(rowIndex);
|
|
272601
|
+
const deletedColspan = Math.max(1, cellNode.attrs.colspan || 1);
|
|
272602
|
+
const deletedColwidth = Array.isArray(cellNode.attrs.colwidth) ? [...cellNode.attrs.colwidth] : null;
|
|
272603
|
+
if (input2.mode === "shiftLeft" && row2.childCount <= 1) {
|
|
272604
|
+
return toTableFailure2("NO_OP", "Cannot shift-left delete the last remaining cell in a row.");
|
|
272605
|
+
}
|
|
272496
272606
|
if (options?.dryRun) {
|
|
272497
272607
|
return buildTableSuccess2(table2.address);
|
|
272498
272608
|
}
|
|
@@ -272505,16 +272615,59 @@ function tablesDeleteCellAdapter2(editor, input2, options) {
|
|
|
272505
272615
|
const schema = editor.state.schema;
|
|
272506
272616
|
tr.delete(cellPos, cellPos + cellNode.nodeSize);
|
|
272507
272617
|
if (input2.mode === "shiftLeft") {
|
|
272508
|
-
const
|
|
272509
|
-
|
|
272510
|
-
|
|
272511
|
-
|
|
272512
|
-
|
|
272513
|
-
|
|
272514
|
-
|
|
272515
|
-
const
|
|
272516
|
-
const
|
|
272517
|
-
|
|
272618
|
+
const currentTableNode = tr.doc.nodeAt(tablePos);
|
|
272619
|
+
if (!currentTableNode || currentTableNode.type.name !== "table") {
|
|
272620
|
+
return toTableFailure2("INVALID_TARGET", "Cell deletion could not locate the updated table.");
|
|
272621
|
+
}
|
|
272622
|
+
const currentRow = currentTableNode.child(rowIndex);
|
|
272623
|
+
const lastCellIndex = currentRow.childCount - 1;
|
|
272624
|
+
const lastCell = currentRow.child(lastCellIndex);
|
|
272625
|
+
const lastAttrs = lastCell.attrs;
|
|
272626
|
+
const tableCellProperties = lastAttrs.tableCellProperties ?? {};
|
|
272627
|
+
const lastRowspan = Math.max(1, lastAttrs.rowspan || 1);
|
|
272628
|
+
const hasVerticalMerge = tableCellProperties.vMerge != null;
|
|
272629
|
+
if (lastRowspan > 1 || hasVerticalMerge) {
|
|
272630
|
+
let rowEndPos = tablePos + 1;
|
|
272631
|
+
for (let i5 = 0;i5 <= rowIndex; i5++)
|
|
272632
|
+
rowEndPos += currentTableNode.child(i5).nodeSize;
|
|
272633
|
+
const mappedRowEnd = rowEndPos - 1;
|
|
272634
|
+
const newCell = schema.nodes.tableCell.createAndFill();
|
|
272635
|
+
tr.insert(mappedRowEnd, newCell);
|
|
272636
|
+
} else {
|
|
272637
|
+
const lastColspan = Math.max(1, lastAttrs.colspan || 1);
|
|
272638
|
+
const nextColspan = lastColspan + deletedColspan;
|
|
272639
|
+
const nextTableCellProps = {
|
|
272640
|
+
...tableCellProperties
|
|
272641
|
+
};
|
|
272642
|
+
if (nextColspan > 1)
|
|
272643
|
+
nextTableCellProps.gridSpan = nextColspan;
|
|
272644
|
+
else
|
|
272645
|
+
delete nextTableCellProps.gridSpan;
|
|
272646
|
+
const nextColwidth = Array.isArray(lastAttrs.colwidth) ? [...lastAttrs.colwidth] : null;
|
|
272647
|
+
if (nextColwidth) {
|
|
272648
|
+
if (deletedColwidth) {
|
|
272649
|
+
for (const width of deletedColwidth) {
|
|
272650
|
+
if (nextColwidth.length >= nextColspan)
|
|
272651
|
+
break;
|
|
272652
|
+
nextColwidth.push(typeof width === "number" ? width : 0);
|
|
272653
|
+
}
|
|
272654
|
+
}
|
|
272655
|
+
while (nextColwidth.length < nextColspan)
|
|
272656
|
+
nextColwidth.push(0);
|
|
272657
|
+
}
|
|
272658
|
+
let rowOffset = 0;
|
|
272659
|
+
for (let i5 = 0;i5 < rowIndex; i5++)
|
|
272660
|
+
rowOffset += currentTableNode.child(i5).nodeSize;
|
|
272661
|
+
let lastCellOffset = rowOffset + 1;
|
|
272662
|
+
for (let i5 = 0;i5 < lastCellIndex; i5++)
|
|
272663
|
+
lastCellOffset += currentRow.child(i5).nodeSize;
|
|
272664
|
+
tr.setNodeMarkup(tableStart + lastCellOffset, null, {
|
|
272665
|
+
...lastAttrs,
|
|
272666
|
+
colspan: nextColspan,
|
|
272667
|
+
colwidth: nextColwidth,
|
|
272668
|
+
tableCellProperties: nextTableCellProps
|
|
272669
|
+
});
|
|
272670
|
+
}
|
|
272518
272671
|
} else {
|
|
272519
272672
|
const lastRowIndex = map8.height - 1;
|
|
272520
272673
|
const colOffset = map8.map[lastRowIndex * map8.width + columnIndex];
|
|
@@ -273042,6 +273195,34 @@ function tablesSetShadingAdapter2(editor, input2, options) {
|
|
|
273042
273195
|
currentProps.shading = { fill: input2.color, val: "clear", color: "auto" };
|
|
273043
273196
|
const syncAttrs = resolved.scope === "table" ? syncExtractedTableAttrs2(currentProps) : {};
|
|
273044
273197
|
tr.setNodeMarkup(resolved.pos, null, { ...currentAttrs, [propsKey]: currentProps, ...syncAttrs });
|
|
273198
|
+
if (resolved.scope === "table") {
|
|
273199
|
+
const tableNode = resolved.node;
|
|
273200
|
+
const tableStart = resolved.pos + 1;
|
|
273201
|
+
const map8 = TableMap2.get(tableNode);
|
|
273202
|
+
const seen = new Set;
|
|
273203
|
+
const mapFrom = tr.mapping.maps.length;
|
|
273204
|
+
for (let i5 = 0;i5 < map8.map.length; i5++) {
|
|
273205
|
+
const relPos = map8.map[i5];
|
|
273206
|
+
if (seen.has(relPos))
|
|
273207
|
+
continue;
|
|
273208
|
+
seen.add(relPos);
|
|
273209
|
+
const cellNode = tableNode.nodeAt(relPos);
|
|
273210
|
+
if (!cellNode)
|
|
273211
|
+
continue;
|
|
273212
|
+
const cellAttrs = cellNode.attrs;
|
|
273213
|
+
const cellProps = { ...cellAttrs.tableCellProperties ?? {} };
|
|
273214
|
+
cellProps.shading = { fill: input2.color, val: "clear", color: "auto" };
|
|
273215
|
+
const nextCellAttrs = {
|
|
273216
|
+
...cellAttrs,
|
|
273217
|
+
tableCellProperties: cellProps
|
|
273218
|
+
};
|
|
273219
|
+
if (input2.color === "auto")
|
|
273220
|
+
delete nextCellAttrs.background;
|
|
273221
|
+
else
|
|
273222
|
+
nextCellAttrs.background = { color: input2.color };
|
|
273223
|
+
tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(tableStart + relPos), null, nextCellAttrs);
|
|
273224
|
+
}
|
|
273225
|
+
}
|
|
273045
273226
|
applyDirectMutationMeta2(tr);
|
|
273046
273227
|
editor.dispatch(tr);
|
|
273047
273228
|
clearIndexCache2(editor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"typescript": "^5.9.2",
|
|
22
22
|
"@superdoc/document-api": "0.0.1",
|
|
23
23
|
"@superdoc/pm-adapter": "0.0.0",
|
|
24
|
-
"superdoc": "
|
|
25
|
-
"
|
|
24
|
+
"@superdoc/super-editor": "0.0.1",
|
|
25
|
+
"superdoc": "1.16.0"
|
|
26
26
|
},
|
|
27
27
|
"module": "src/index.ts",
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"@superdoc-dev/cli-darwin-
|
|
33
|
-
"@superdoc-dev/cli-darwin-
|
|
34
|
-
"@superdoc-dev/cli-linux-
|
|
35
|
-
"@superdoc-dev/cli-linux-
|
|
36
|
-
"@superdoc-dev/cli-windows-x64": "0.2.0-next.
|
|
32
|
+
"@superdoc-dev/cli-darwin-arm64": "0.2.0-next.35",
|
|
33
|
+
"@superdoc-dev/cli-darwin-x64": "0.2.0-next.35",
|
|
34
|
+
"@superdoc-dev/cli-linux-arm64": "0.2.0-next.35",
|
|
35
|
+
"@superdoc-dev/cli-linux-x64": "0.2.0-next.35",
|
|
36
|
+
"@superdoc-dev/cli-windows-x64": "0.2.0-next.35"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"dev": "bun run src/index.ts",
|