@harbour-enterprises/superdoc 1.3.0-next.7 → 1.3.0-next.8
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/chunks/{PdfViewer-CnKGOFjP.es.js → PdfViewer-CjwO2nPe.es.js} +2 -2
- package/dist/chunks/{PdfViewer-BolWPjJ9.cjs → PdfViewer-fF1B6H-9.cjs} +2 -2
- package/dist/chunks/{SuperConverter-Bc9dM-qO.es.js → SuperConverter-DwLhA2mM.es.js} +193 -124
- package/dist/chunks/{SuperConverter-BIrkxV37.cjs → SuperConverter-d7nvQrVD.cjs} +193 -124
- package/dist/chunks/{index-CKi-JNoY.cjs → index-B2Aynj2f.cjs} +4 -4
- package/dist/chunks/{index-BuT4cwmK.es.js → index-DoZiv8EQ.es.js} +52 -22
- package/dist/chunks/{index-CmmcvSxn.cjs → index-DzCJy9Bf.cjs} +52 -22
- package/dist/chunks/{index-C0irsRkX.es.js → index-U7zpbaq1.es.js} +4 -4
- package/dist/style.css +1 -1
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +3 -3
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +245 -146
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/superdoc.umd.js
CHANGED
|
@@ -14552,6 +14552,9 @@
|
|
|
14552
14552
|
columnIndex,
|
|
14553
14553
|
columnWidth = null,
|
|
14554
14554
|
allColumnWidths = [],
|
|
14555
|
+
rowIndex = 0,
|
|
14556
|
+
totalRows = 1,
|
|
14557
|
+
totalColumns,
|
|
14555
14558
|
_referencedStyles
|
|
14556
14559
|
}) {
|
|
14557
14560
|
const { nodeListHandler } = params2;
|
|
@@ -14560,19 +14563,46 @@
|
|
|
14560
14563
|
const tcPr = node2.elements.find((el) => el.name === "w:tcPr");
|
|
14561
14564
|
const tableCellProperties = tcPr ? translator$J.encode({ ...params2, nodes: [tcPr] }) ?? {} : {};
|
|
14562
14565
|
attributes["tableCellProperties"] = tableCellProperties;
|
|
14563
|
-
|
|
14564
|
-
|
|
14565
|
-
|
|
14566
|
-
|
|
14567
|
-
|
|
14568
|
-
|
|
14569
|
-
|
|
14570
|
-
}
|
|
14571
|
-
if (rowBorders)
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14566
|
+
const effectiveTotalColumns = totalColumns ?? (allColumnWidths.length || 1);
|
|
14567
|
+
const effectiveTotalRows = totalRows ?? (table2?.elements?.filter((el) => el.name === "w:tr").length || 1);
|
|
14568
|
+
const colspan = parseInt(tableCellProperties.gridSpan || 1, 10);
|
|
14569
|
+
const isFirstRow = rowIndex === 0;
|
|
14570
|
+
const isLastRow = rowIndex === effectiveTotalRows - 1;
|
|
14571
|
+
const isFirstColumn = columnIndex === 0;
|
|
14572
|
+
const isLastColumn = columnIndex + colspan >= effectiveTotalColumns;
|
|
14573
|
+
const cellBorders = {};
|
|
14574
|
+
if (rowBorders) {
|
|
14575
|
+
if (rowBorders.top?.val === "none") {
|
|
14576
|
+
cellBorders.top = rowBorders.top;
|
|
14577
|
+
} else if (isFirstRow && rowBorders.top) {
|
|
14578
|
+
cellBorders.top = rowBorders.top;
|
|
14579
|
+
}
|
|
14580
|
+
if (rowBorders.bottom?.val === "none") {
|
|
14581
|
+
cellBorders.bottom = rowBorders.bottom;
|
|
14582
|
+
} else if (isLastRow && rowBorders.bottom) {
|
|
14583
|
+
cellBorders.bottom = rowBorders.bottom;
|
|
14584
|
+
}
|
|
14585
|
+
if (rowBorders.left?.val === "none") {
|
|
14586
|
+
cellBorders.left = rowBorders.left;
|
|
14587
|
+
} else if (isFirstColumn && rowBorders.left) {
|
|
14588
|
+
cellBorders.left = rowBorders.left;
|
|
14589
|
+
}
|
|
14590
|
+
if (rowBorders.right?.val === "none") {
|
|
14591
|
+
cellBorders.right = rowBorders.right;
|
|
14592
|
+
} else if (isLastColumn && rowBorders.right) {
|
|
14593
|
+
cellBorders.right = rowBorders.right;
|
|
14594
|
+
}
|
|
14595
|
+
if (!isLastRow && rowBorders.insideH) {
|
|
14596
|
+
cellBorders.bottom = rowBorders.insideH;
|
|
14597
|
+
}
|
|
14598
|
+
if (!isLastColumn && rowBorders.insideV) {
|
|
14599
|
+
cellBorders.right = rowBorders.insideV;
|
|
14600
|
+
}
|
|
14601
|
+
}
|
|
14602
|
+
attributes["borders"] = cellBorders;
|
|
14603
|
+
const inlineBorders = processInlineCellBorders(tableCellProperties.borders, cellBorders);
|
|
14604
|
+
if (inlineBorders) attributes["borders"] = Object.assign(attributes["borders"], inlineBorders);
|
|
14605
|
+
if (colspan > 1) attributes["colspan"] = colspan;
|
|
14576
14606
|
let width = tableCellProperties.cellWidth?.value ? twipsToPixels$2(tableCellProperties.cellWidth?.value) : null;
|
|
14577
14607
|
const widthType = tableCellProperties.cellWidth?.type;
|
|
14578
14608
|
if (widthType) attributes["widthType"] = widthType;
|
|
@@ -14582,10 +14612,9 @@
|
|
|
14582
14612
|
attributes["widthUnit"] = "px";
|
|
14583
14613
|
const defaultColWidths = allColumnWidths;
|
|
14584
14614
|
const hasDefaultColWidths = allColumnWidths && allColumnWidths.length > 0;
|
|
14585
|
-
|
|
14586
|
-
if (colspanNum && colspanNum > 1 && hasDefaultColWidths) {
|
|
14615
|
+
if (colspan > 1 && hasDefaultColWidths) {
|
|
14587
14616
|
let colwidth = [];
|
|
14588
|
-
for (let i2 = 0; i2 <
|
|
14617
|
+
for (let i2 = 0; i2 < colspan; i2++) {
|
|
14589
14618
|
let colwidthValue = defaultColWidths[columnIndex + i2];
|
|
14590
14619
|
let defaultColwidth = 100;
|
|
14591
14620
|
if (typeof colwidthValue !== "undefined") {
|
|
@@ -14735,22 +14764,18 @@
|
|
|
14735
14764
|
return ["bottom", "top", "left", "right"].reduce((acc, direction) => {
|
|
14736
14765
|
const borderAttrs = borders[direction];
|
|
14737
14766
|
const rowBorderAttrs = rowBorders[direction];
|
|
14738
|
-
if (borderAttrs && borderAttrs["val"] !== "
|
|
14767
|
+
if (borderAttrs && borderAttrs["val"] !== "none") {
|
|
14739
14768
|
const color2 = borderAttrs["color"];
|
|
14740
14769
|
let size2 = borderAttrs["size"];
|
|
14741
14770
|
if (size2) size2 = eighthPointsToPixels(size2);
|
|
14742
14771
|
acc[direction] = { color: color2, size: size2, val: borderAttrs["val"] };
|
|
14743
14772
|
return acc;
|
|
14744
14773
|
}
|
|
14745
|
-
if (borderAttrs && borderAttrs["val"] === "
|
|
14774
|
+
if (borderAttrs && borderAttrs["val"] === "none") {
|
|
14746
14775
|
const border = Object.assign({}, rowBorderAttrs || {});
|
|
14747
|
-
|
|
14748
|
-
|
|
14749
|
-
|
|
14750
|
-
border["val"] = "none";
|
|
14751
|
-
acc[direction] = border;
|
|
14752
|
-
return acc;
|
|
14753
|
-
}
|
|
14776
|
+
border["val"] = "none";
|
|
14777
|
+
acc[direction] = border;
|
|
14778
|
+
return acc;
|
|
14754
14779
|
}
|
|
14755
14780
|
return acc;
|
|
14756
14781
|
}, {});
|
|
@@ -14886,6 +14911,9 @@
|
|
|
14886
14911
|
columnIndex,
|
|
14887
14912
|
columnWidth,
|
|
14888
14913
|
columnWidths: allColumnWidths,
|
|
14914
|
+
rowIndex,
|
|
14915
|
+
totalRows,
|
|
14916
|
+
totalColumns,
|
|
14889
14917
|
_referencedStyles
|
|
14890
14918
|
} = params2.extraParams;
|
|
14891
14919
|
const schemaNode = handleTableCellNode({
|
|
@@ -14897,6 +14925,9 @@
|
|
|
14897
14925
|
columnIndex,
|
|
14898
14926
|
columnWidth,
|
|
14899
14927
|
allColumnWidths,
|
|
14928
|
+
rowIndex,
|
|
14929
|
+
totalRows,
|
|
14930
|
+
totalColumns,
|
|
14900
14931
|
_referencedStyles
|
|
14901
14932
|
});
|
|
14902
14933
|
if (encodedAttrs && Object.keys(encodedAttrs).length) {
|
|
@@ -14920,13 +14951,26 @@
|
|
|
14920
14951
|
attributes: validXmlAttributes$a
|
|
14921
14952
|
};
|
|
14922
14953
|
const translator$I = NodeTranslator.from(config$i);
|
|
14923
|
-
const
|
|
14954
|
+
const propertyTranslators$3 = [
|
|
14955
|
+
translator$1q,
|
|
14956
|
+
translator$Z,
|
|
14957
|
+
translator$X,
|
|
14958
|
+
translator$W,
|
|
14959
|
+
translator$1o,
|
|
14960
|
+
translator$1m,
|
|
14961
|
+
translator$V,
|
|
14962
|
+
translator$1k
|
|
14963
|
+
];
|
|
14964
|
+
const translator$H = NodeTranslator.from(
|
|
14965
|
+
createNestedPropertiesTranslator("w:tblBorders", "borders", propertyTranslators$3)
|
|
14966
|
+
);
|
|
14967
|
+
const translator$G = NodeTranslator.from({
|
|
14924
14968
|
xmlName: "w:cantSplit",
|
|
14925
14969
|
sdNodeOrKeyName: "cantSplit",
|
|
14926
14970
|
encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
14927
14971
|
decode: ({ node: node2 }) => node2.attrs?.cantSplit ? { attributes: {} } : void 0
|
|
14928
14972
|
});
|
|
14929
|
-
const translator$
|
|
14973
|
+
const translator$F = NodeTranslator.from(
|
|
14930
14974
|
createSingleAttrPropertyHandler(
|
|
14931
14975
|
"w:gridAfter",
|
|
14932
14976
|
null,
|
|
@@ -14935,7 +14979,7 @@
|
|
|
14935
14979
|
(v2) => integerToString(v2)
|
|
14936
14980
|
)
|
|
14937
14981
|
);
|
|
14938
|
-
const translator$
|
|
14982
|
+
const translator$E = NodeTranslator.from(
|
|
14939
14983
|
createSingleAttrPropertyHandler(
|
|
14940
14984
|
"w:gridBefore",
|
|
14941
14985
|
null,
|
|
@@ -14944,20 +14988,20 @@
|
|
|
14944
14988
|
(v2) => integerToString(v2)
|
|
14945
14989
|
)
|
|
14946
14990
|
);
|
|
14947
|
-
const translator$
|
|
14991
|
+
const translator$D = NodeTranslator.from({
|
|
14948
14992
|
xmlName: "w:hidden",
|
|
14949
14993
|
sdNodeOrKeyName: "hidden",
|
|
14950
14994
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
14951
14995
|
decode: ({ node: node2 }) => node2.attrs.hidden ? { attributes: {} } : void 0
|
|
14952
14996
|
});
|
|
14953
|
-
const translator$
|
|
14954
|
-
const translator$
|
|
14997
|
+
const translator$C = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
|
|
14998
|
+
const translator$B = NodeTranslator.from({
|
|
14955
14999
|
xmlName: "w:tblHeader",
|
|
14956
15000
|
sdNodeOrKeyName: "repeatHeader",
|
|
14957
15001
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
14958
15002
|
decode: ({ node: node2 }) => node2.attrs.repeatHeader ? { attributes: {} } : void 0
|
|
14959
15003
|
});
|
|
14960
|
-
const translator$
|
|
15004
|
+
const translator$A = NodeTranslator.from({
|
|
14961
15005
|
xmlName: "w:trHeight",
|
|
14962
15006
|
sdNodeOrKeyName: "rowHeight",
|
|
14963
15007
|
encode: ({ nodes }) => {
|
|
@@ -14984,24 +15028,24 @@
|
|
|
14984
15028
|
return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
|
|
14985
15029
|
}
|
|
14986
15030
|
});
|
|
14987
|
-
const translator$
|
|
14988
|
-
const translator$
|
|
14989
|
-
const propertyTranslators$
|
|
14990
|
-
translator$
|
|
15031
|
+
const translator$z = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
|
|
15032
|
+
const translator$y = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
|
|
15033
|
+
const propertyTranslators$2 = [
|
|
15034
|
+
translator$G,
|
|
14991
15035
|
translator$1I,
|
|
14992
15036
|
translator$1G,
|
|
14993
|
-
translator$G,
|
|
14994
15037
|
translator$F,
|
|
14995
15038
|
translator$E,
|
|
14996
|
-
translator$1D,
|
|
14997
15039
|
translator$D,
|
|
15040
|
+
translator$1D,
|
|
14998
15041
|
translator$C,
|
|
14999
15042
|
translator$B,
|
|
15000
15043
|
translator$A,
|
|
15001
|
-
translator$z
|
|
15044
|
+
translator$z,
|
|
15045
|
+
translator$y
|
|
15002
15046
|
];
|
|
15003
|
-
const translator$
|
|
15004
|
-
createNestedPropertiesTranslator("w:trPr", "tableRowProperties", propertyTranslators$
|
|
15047
|
+
const translator$x = NodeTranslator.from(
|
|
15048
|
+
createNestedPropertiesTranslator("w:trPr", "tableRowProperties", propertyTranslators$2, {
|
|
15005
15049
|
cantSplit: false,
|
|
15006
15050
|
hidden: false,
|
|
15007
15051
|
repeatHeader: false
|
|
@@ -15079,7 +15123,7 @@
|
|
|
15079
15123
|
let tableRowProperties = {};
|
|
15080
15124
|
const tPr = row2.elements.find((el) => el.name === "w:trPr");
|
|
15081
15125
|
if (tPr) {
|
|
15082
|
-
tableRowProperties = translator$
|
|
15126
|
+
tableRowProperties = translator$x.encode({
|
|
15083
15127
|
...params2,
|
|
15084
15128
|
nodes: [tPr]
|
|
15085
15129
|
});
|
|
@@ -15089,6 +15133,12 @@
|
|
|
15089
15133
|
encodedAttrs["tableRowProperties"] = Object.freeze(tableRowProperties);
|
|
15090
15134
|
encodedAttrs["rowHeight"] = twipsToPixels$2(tableRowProperties["rowHeight"]?.value);
|
|
15091
15135
|
encodedAttrs["cantSplit"] = tableRowProperties["cantSplit"];
|
|
15136
|
+
const baseBorders = params2.extraParams?.rowBorders;
|
|
15137
|
+
const rowTableBorders = getRowTableBorders({
|
|
15138
|
+
params: params2,
|
|
15139
|
+
row: row2,
|
|
15140
|
+
baseBorders
|
|
15141
|
+
});
|
|
15092
15142
|
const { columnWidths: gridColumnWidths, activeRowSpans = [] } = params2.extraParams;
|
|
15093
15143
|
const totalColumns = Array.isArray(gridColumnWidths) ? gridColumnWidths.length : 0;
|
|
15094
15144
|
const pendingRowSpans = Array.isArray(activeRowSpans) ? activeRowSpans.slice() : [];
|
|
@@ -15121,6 +15171,10 @@
|
|
|
15121
15171
|
path: [...params2.path || [], node2],
|
|
15122
15172
|
extraParams: {
|
|
15123
15173
|
...params2.extraParams,
|
|
15174
|
+
rowBorders: {
|
|
15175
|
+
...baseBorders,
|
|
15176
|
+
...rowTableBorders
|
|
15177
|
+
},
|
|
15124
15178
|
node: node2,
|
|
15125
15179
|
columnIndex: startColumn,
|
|
15126
15180
|
columnWidth
|
|
@@ -15150,6 +15204,33 @@
|
|
|
15150
15204
|
};
|
|
15151
15205
|
return newNode;
|
|
15152
15206
|
};
|
|
15207
|
+
function getRowTableBorders({ params: params2, row: row2, baseBorders }) {
|
|
15208
|
+
const tblPrEx = row2?.elements?.find?.((el) => el.name === "w:tblPrEx");
|
|
15209
|
+
const tblBorders = tblPrEx?.elements?.find?.((el) => el.name === "w:tblBorders");
|
|
15210
|
+
if (!tblBorders) {
|
|
15211
|
+
return baseBorders;
|
|
15212
|
+
}
|
|
15213
|
+
const rawOverrides = translator$H.encode({ ...params2, nodes: [tblBorders] }) || {};
|
|
15214
|
+
const overrides = processRawTableBorders(rawOverrides);
|
|
15215
|
+
if (!Object.keys(overrides).length) {
|
|
15216
|
+
return baseBorders;
|
|
15217
|
+
}
|
|
15218
|
+
return { ...baseBorders || {}, ...overrides };
|
|
15219
|
+
}
|
|
15220
|
+
function processRawTableBorders(rawBorders) {
|
|
15221
|
+
const borders = {};
|
|
15222
|
+
Object.entries(rawBorders || {}).forEach(([name, attributes]) => {
|
|
15223
|
+
const attrs = {};
|
|
15224
|
+
const color2 = attributes?.color;
|
|
15225
|
+
const size2 = attributes?.size;
|
|
15226
|
+
const val = attributes?.val;
|
|
15227
|
+
if (color2 && color2 !== "auto") attrs.color = color2.startsWith("#") ? color2 : `#${color2}`;
|
|
15228
|
+
if (size2 != null && size2 !== "auto") attrs.size = eighthPointsToPixels(size2);
|
|
15229
|
+
if (val) attrs.val = val;
|
|
15230
|
+
borders[name] = attrs;
|
|
15231
|
+
});
|
|
15232
|
+
return borders;
|
|
15233
|
+
}
|
|
15153
15234
|
const decode$y = (params2, decodedAttrs) => {
|
|
15154
15235
|
const { node: node2 } = params2;
|
|
15155
15236
|
const cells = node2.content || [];
|
|
@@ -15190,7 +15271,7 @@
|
|
|
15190
15271
|
}
|
|
15191
15272
|
}
|
|
15192
15273
|
tableRowProperties["cantSplit"] = node2.attrs["cantSplit"];
|
|
15193
|
-
const trPr = translator$
|
|
15274
|
+
const trPr = translator$x.decode({
|
|
15194
15275
|
...params2,
|
|
15195
15276
|
node: { ...node2, attrs: { ...node2.attrs, tableRowProperties } }
|
|
15196
15277
|
});
|
|
@@ -15210,7 +15291,7 @@
|
|
|
15210
15291
|
decode: decode$y,
|
|
15211
15292
|
attributes: validXmlAttributes$9
|
|
15212
15293
|
};
|
|
15213
|
-
const translator$
|
|
15294
|
+
const translator$w = NodeTranslator.from(config$h);
|
|
15214
15295
|
function parseTagValueJSON(json) {
|
|
15215
15296
|
if (typeof json !== "string") {
|
|
15216
15297
|
return {};
|
|
@@ -30436,7 +30517,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
30436
30517
|
decode: decode$x,
|
|
30437
30518
|
attributes: validXmlAttributes$8
|
|
30438
30519
|
};
|
|
30439
|
-
const translator$
|
|
30520
|
+
const translator$v = NodeTranslator.from(config$g);
|
|
30440
30521
|
function handleInlineNode(params2) {
|
|
30441
30522
|
const { node: node2 } = params2.extraParams;
|
|
30442
30523
|
if (node2.name !== "wp:inline") {
|
|
@@ -30490,7 +30571,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
30490
30571
|
decode: decode$w,
|
|
30491
30572
|
attributes: validXmlAttributes$7
|
|
30492
30573
|
};
|
|
30493
|
-
const translator$
|
|
30574
|
+
const translator$u = NodeTranslator.from(config$f);
|
|
30494
30575
|
const XML_NODE_NAME$f = "w:drawing";
|
|
30495
30576
|
const SD_NODE_NAME$d = [];
|
|
30496
30577
|
const validXmlAttributes$6 = [];
|
|
@@ -30498,8 +30579,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
30498
30579
|
const nodes = params2.nodes;
|
|
30499
30580
|
const node2 = nodes[0];
|
|
30500
30581
|
const translatorByChildName = {
|
|
30501
|
-
"wp:anchor": translator$
|
|
30502
|
-
"wp:inline": translator$
|
|
30582
|
+
"wp:anchor": translator$v,
|
|
30583
|
+
"wp:inline": translator$u
|
|
30503
30584
|
};
|
|
30504
30585
|
const result = (node2.elements || []).reduce((acc, child) => {
|
|
30505
30586
|
if (acc) return acc;
|
|
@@ -30522,7 +30603,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
30522
30603
|
if (!node2 || !node2.type) {
|
|
30523
30604
|
return null;
|
|
30524
30605
|
}
|
|
30525
|
-
const childTranslator = node2.attrs.isAnchor ? translator$
|
|
30606
|
+
const childTranslator = node2.attrs.isAnchor ? translator$v : translator$u;
|
|
30526
30607
|
const resultNode = childTranslator.decode(params2);
|
|
30527
30608
|
return wrapTextInRun(
|
|
30528
30609
|
{
|
|
@@ -30540,7 +30621,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
30540
30621
|
decode: decode$v,
|
|
30541
30622
|
attributes: validXmlAttributes$6
|
|
30542
30623
|
};
|
|
30543
|
-
const translator$
|
|
30624
|
+
const translator$t = NodeTranslator.from(config$e);
|
|
30544
30625
|
function getTextNodeForExport(text2, marks, params2) {
|
|
30545
30626
|
const hasLeadingOrTrailingSpace = /^\s|\s$/.test(text2);
|
|
30546
30627
|
const space = hasLeadingOrTrailingSpace ? "preserve" : null;
|
|
@@ -30948,7 +31029,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
30948
31029
|
return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
|
|
30949
31030
|
}
|
|
30950
31031
|
function prepareImageAnnotation(params2, imageSize) {
|
|
30951
|
-
return translator$
|
|
31032
|
+
return translator$t.decode({
|
|
30952
31033
|
...params2,
|
|
30953
31034
|
imageSize
|
|
30954
31035
|
});
|
|
@@ -31410,7 +31491,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31410
31491
|
decode: decode$u,
|
|
31411
31492
|
attributes: validXmlAttributes$5
|
|
31412
31493
|
};
|
|
31413
|
-
const translator$
|
|
31494
|
+
const translator$s = NodeTranslator.from(config$d);
|
|
31414
31495
|
function preProcessVerticalMergeCells(table2, { editorSchema }) {
|
|
31415
31496
|
if (!table2 || !Array.isArray(table2.content)) {
|
|
31416
31497
|
return table2;
|
|
@@ -31451,17 +31532,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31451
31532
|
}
|
|
31452
31533
|
return table2;
|
|
31453
31534
|
}
|
|
31454
|
-
const translator$
|
|
31535
|
+
const translator$r = NodeTranslator.from({
|
|
31455
31536
|
xmlName: "w:bidiVisual",
|
|
31456
31537
|
sdNodeOrKeyName: "rightToLeft",
|
|
31457
31538
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
31458
31539
|
decode: ({ node: node2 }) => node2.attrs.rightToLeft ? { attributes: {} } : void 0
|
|
31459
31540
|
});
|
|
31460
|
-
const translator$
|
|
31461
|
-
const translator$
|
|
31462
|
-
const translator$
|
|
31463
|
-
const translator$
|
|
31464
|
-
const translator$
|
|
31541
|
+
const translator$q = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
|
|
31542
|
+
const translator$p = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
|
|
31543
|
+
const translator$o = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
|
|
31544
|
+
const translator$n = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
|
|
31545
|
+
const translator$m = NodeTranslator.from({
|
|
31465
31546
|
xmlName: "w:tblLook",
|
|
31466
31547
|
sdNodeOrKeyName: "tblLook",
|
|
31467
31548
|
attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
|
|
@@ -31473,16 +31554,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31473
31554
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
31474
31555
|
}
|
|
31475
31556
|
});
|
|
31476
|
-
const translator$
|
|
31477
|
-
const translator$
|
|
31478
|
-
const translator$
|
|
31557
|
+
const translator$l = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
|
|
31558
|
+
const translator$k = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
|
|
31559
|
+
const translator$j = NodeTranslator.from(
|
|
31479
31560
|
createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
|
|
31480
31561
|
);
|
|
31481
|
-
const translator$
|
|
31562
|
+
const translator$i = NodeTranslator.from(
|
|
31482
31563
|
createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
|
|
31483
31564
|
);
|
|
31484
|
-
const translator$
|
|
31485
|
-
const translator$
|
|
31565
|
+
const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
|
|
31566
|
+
const translator$g = NodeTranslator.from({
|
|
31486
31567
|
xmlName: "w:tblpPr",
|
|
31487
31568
|
sdNodeOrKeyName: "floatingTableProperties",
|
|
31488
31569
|
attributes: ["w:leftFromText", "w:rightFromText", "w:topFromText", "w:bottomFromText", "w:tblpX", "w:tblpY"].map((attr) => createAttributeHandler(attr, null, parseInteger, integerToString)).concat(["w:horzAnchor", "w:vertAnchor", "w:tblpXSpec", "w:tblpYSpec"].map((attr) => createAttributeHandler(attr))),
|
|
@@ -31494,19 +31575,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31494
31575
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
31495
31576
|
}
|
|
31496
31577
|
});
|
|
31497
|
-
const propertyTranslators$2 = [
|
|
31498
|
-
translator$1q,
|
|
31499
|
-
translator$Z,
|
|
31500
|
-
translator$X,
|
|
31501
|
-
translator$W,
|
|
31502
|
-
translator$1o,
|
|
31503
|
-
translator$1m,
|
|
31504
|
-
translator$V,
|
|
31505
|
-
translator$1k
|
|
31506
|
-
];
|
|
31507
|
-
const translator$g = NodeTranslator.from(
|
|
31508
|
-
createNestedPropertiesTranslator("w:tblBorders", "borders", propertyTranslators$2)
|
|
31509
|
-
);
|
|
31510
31578
|
const propertyTranslators$1 = [
|
|
31511
31579
|
translator$1p,
|
|
31512
31580
|
translator$Y,
|
|
@@ -31519,12 +31587,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31519
31587
|
createNestedPropertiesTranslator("w:tblCellMar", "cellMargins", propertyTranslators$1)
|
|
31520
31588
|
);
|
|
31521
31589
|
const propertyTranslators = [
|
|
31522
|
-
translator$
|
|
31590
|
+
translator$r,
|
|
31523
31591
|
translator$1D,
|
|
31524
31592
|
translator$2b,
|
|
31525
|
-
translator$r,
|
|
31526
|
-
translator$D,
|
|
31527
31593
|
translator$q,
|
|
31594
|
+
translator$C,
|
|
31528
31595
|
translator$p,
|
|
31529
31596
|
translator$o,
|
|
31530
31597
|
translator$n,
|
|
@@ -31535,6 +31602,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31535
31602
|
translator$i,
|
|
31536
31603
|
translator$h,
|
|
31537
31604
|
translator$g,
|
|
31605
|
+
translator$H,
|
|
31538
31606
|
translator$f
|
|
31539
31607
|
];
|
|
31540
31608
|
const translator$e = NodeTranslator.from(
|
|
@@ -31794,8 +31862,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31794
31862
|
}
|
|
31795
31863
|
const borderProps = _processTableBorders(encodedAttrs.tableProperties.borders || {});
|
|
31796
31864
|
const referencedStyles = _getReferencedTableStyles(encodedAttrs.tableStyleId, params2) || {};
|
|
31797
|
-
|
|
31798
|
-
encodedAttrs.borders = { ...referencedStyles.borders, ...borderProps.borders };
|
|
31865
|
+
encodedAttrs.borders = { ...referencedStyles.borders, ...borderProps };
|
|
31799
31866
|
encodedAttrs.tableProperties.cellMargins = referencedStyles.cellMargins = {
|
|
31800
31867
|
...referencedStyles.cellMargins,
|
|
31801
31868
|
...encodedAttrs.tableProperties.cellMargins
|
|
@@ -31816,19 +31883,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31816
31883
|
}
|
|
31817
31884
|
const content2 = [];
|
|
31818
31885
|
const totalColumns = columnWidths.length;
|
|
31886
|
+
const totalRows = rows.length;
|
|
31819
31887
|
const activeRowSpans = totalColumns > 0 ? new Array(totalColumns).fill(0) : [];
|
|
31820
31888
|
rows.forEach((row2, rowIndex) => {
|
|
31821
|
-
const result = translator$
|
|
31889
|
+
const result = translator$w.encode({
|
|
31822
31890
|
...params2,
|
|
31823
31891
|
path: [...params2.path || [], node2],
|
|
31824
31892
|
nodes: [row2],
|
|
31825
31893
|
extraParams: {
|
|
31826
31894
|
row: row2,
|
|
31827
31895
|
table: node2,
|
|
31828
|
-
rowBorders,
|
|
31896
|
+
rowBorders: encodedAttrs.borders,
|
|
31829
31897
|
columnWidths,
|
|
31830
31898
|
activeRowSpans: activeRowSpans.slice(),
|
|
31831
31899
|
rowIndex,
|
|
31900
|
+
totalRows,
|
|
31901
|
+
totalColumns,
|
|
31832
31902
|
_referencedStyles: referencedStyles
|
|
31833
31903
|
}
|
|
31834
31904
|
});
|
|
@@ -31903,21 +31973,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31903
31973
|
};
|
|
31904
31974
|
function _processTableBorders(rawBorders) {
|
|
31905
31975
|
const borders = {};
|
|
31906
|
-
const rowBorders = {};
|
|
31907
31976
|
Object.entries(rawBorders).forEach(([name, attributes]) => {
|
|
31908
31977
|
const attrs = {};
|
|
31909
31978
|
const color2 = attributes.color;
|
|
31910
31979
|
const size2 = attributes.size;
|
|
31980
|
+
const val = attributes.val;
|
|
31911
31981
|
if (color2 && color2 !== "auto") attrs["color"] = color2.startsWith("#") ? color2 : `#${color2}`;
|
|
31912
31982
|
if (size2 && size2 !== "auto") attrs["size"] = eighthPointsToPixels(size2);
|
|
31913
|
-
|
|
31914
|
-
if (rowBorderNames.includes(name)) rowBorders[name] = attrs;
|
|
31983
|
+
if (val) attrs["val"] = val;
|
|
31915
31984
|
borders[name] = attrs;
|
|
31916
31985
|
});
|
|
31917
|
-
return
|
|
31918
|
-
borders,
|
|
31919
|
-
rowBorders
|
|
31920
|
-
};
|
|
31986
|
+
return borders;
|
|
31921
31987
|
}
|
|
31922
31988
|
function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
31923
31989
|
if (!tableStyleReference) return null;
|
|
@@ -31957,9 +32023,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
31957
32023
|
}
|
|
31958
32024
|
const tableProperties = translator$e.encode({ ...params2, nodes: [tblPr] });
|
|
31959
32025
|
if (tableProperties) {
|
|
31960
|
-
const
|
|
31961
|
-
if (borders) stylesToReturn.borders = borders;
|
|
31962
|
-
if (rowBorders) stylesToReturn.rowBorders = rowBorders;
|
|
32026
|
+
const borders = _processTableBorders(tableProperties.borders || {});
|
|
32027
|
+
if (borders || Object.keys(borders).length) stylesToReturn.borders = borders;
|
|
31963
32028
|
const cellMargins = {};
|
|
31964
32029
|
Object.entries(tableProperties.cellMargins || {}).forEach(([key2, attrs]) => {
|
|
31965
32030
|
if (attrs?.value != null) {
|
|
@@ -32808,7 +32873,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
32808
32873
|
return { nodes: [], consumed: 0 };
|
|
32809
32874
|
}
|
|
32810
32875
|
const translatorParams = { ...params2, nodes: [node2] };
|
|
32811
|
-
const schemaNode = translator$
|
|
32876
|
+
const schemaNode = translator$t.encode(translatorParams);
|
|
32812
32877
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
32813
32878
|
return { nodes: newNodes, consumed: 1 };
|
|
32814
32879
|
};
|
|
@@ -33051,7 +33116,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33051
33116
|
if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
|
|
33052
33117
|
return { nodes: [], consumed: 0 };
|
|
33053
33118
|
}
|
|
33054
|
-
const result = translator$
|
|
33119
|
+
const result = translator$s.encode(params2);
|
|
33055
33120
|
if (!result) {
|
|
33056
33121
|
return { nodes: [], consumed: 0 };
|
|
33057
33122
|
}
|
|
@@ -33079,12 +33144,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33079
33144
|
translator$1s,
|
|
33080
33145
|
translator$2n,
|
|
33081
33146
|
translator$2m,
|
|
33082
|
-
translator$
|
|
33147
|
+
translator$r,
|
|
33083
33148
|
translator$9,
|
|
33084
33149
|
translator$a,
|
|
33085
33150
|
translator$1q,
|
|
33086
33151
|
translator$2r,
|
|
33087
|
-
translator$
|
|
33152
|
+
translator$G,
|
|
33088
33153
|
translator$2c,
|
|
33089
33154
|
translator$1I,
|
|
33090
33155
|
translator$2h,
|
|
@@ -33092,7 +33157,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33092
33157
|
translator$1R,
|
|
33093
33158
|
translator$2,
|
|
33094
33159
|
translator$1G,
|
|
33095
|
-
translator$
|
|
33160
|
+
translator$t,
|
|
33096
33161
|
translator$2i,
|
|
33097
33162
|
translator$1T,
|
|
33098
33163
|
translator$1Z,
|
|
@@ -33101,13 +33166,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33101
33166
|
translator$Z,
|
|
33102
33167
|
translator$1U,
|
|
33103
33168
|
translator$1F,
|
|
33104
|
-
translator$G,
|
|
33105
33169
|
translator$F,
|
|
33170
|
+
translator$E,
|
|
33106
33171
|
translator$d,
|
|
33107
33172
|
translator$$,
|
|
33108
33173
|
translator$L,
|
|
33109
33174
|
translator$K,
|
|
33110
|
-
translator$
|
|
33175
|
+
translator$D,
|
|
33111
33176
|
translator$M,
|
|
33112
33177
|
translator$2q,
|
|
33113
33178
|
translator$12,
|
|
@@ -33149,7 +33214,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33149
33214
|
translator$2f,
|
|
33150
33215
|
translator$1S,
|
|
33151
33216
|
translator$1m,
|
|
33152
|
-
translator$
|
|
33217
|
+
translator$s,
|
|
33153
33218
|
translator$20,
|
|
33154
33219
|
translator$2b,
|
|
33155
33220
|
translator$27,
|
|
@@ -33167,23 +33232,23 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33167
33232
|
translator$2p,
|
|
33168
33233
|
translator$1b,
|
|
33169
33234
|
translator$b,
|
|
33170
|
-
translator$
|
|
33171
|
-
translator$r,
|
|
33172
|
-
translator$f,
|
|
33173
|
-
translator$D,
|
|
33235
|
+
translator$H,
|
|
33174
33236
|
translator$q,
|
|
33175
|
-
translator$
|
|
33237
|
+
translator$f,
|
|
33176
33238
|
translator$C,
|
|
33177
33239
|
translator$p,
|
|
33240
|
+
translator$c,
|
|
33241
|
+
translator$B,
|
|
33178
33242
|
translator$o,
|
|
33179
33243
|
translator$n,
|
|
33180
33244
|
translator$m,
|
|
33181
|
-
translator$e,
|
|
33182
33245
|
translator$l,
|
|
33246
|
+
translator$e,
|
|
33183
33247
|
translator$k,
|
|
33184
33248
|
translator$j,
|
|
33185
33249
|
translator$i,
|
|
33186
33250
|
translator$h,
|
|
33251
|
+
translator$g,
|
|
33187
33252
|
translator$I,
|
|
33188
33253
|
translator$R,
|
|
33189
33254
|
translator$O,
|
|
@@ -33192,10 +33257,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33192
33257
|
translator$10,
|
|
33193
33258
|
translator$19,
|
|
33194
33259
|
translator$T,
|
|
33195
|
-
translator$
|
|
33260
|
+
translator$w,
|
|
33196
33261
|
translator$S,
|
|
33197
|
-
translator$
|
|
33198
|
-
translator$
|
|
33262
|
+
translator$A,
|
|
33263
|
+
translator$x,
|
|
33199
33264
|
translator$1a,
|
|
33200
33265
|
translator$18,
|
|
33201
33266
|
translator$17,
|
|
@@ -33206,13 +33271,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33206
33271
|
translator$28,
|
|
33207
33272
|
translator$_,
|
|
33208
33273
|
translator$1X,
|
|
33209
|
-
translator$A,
|
|
33210
33274
|
translator$z,
|
|
33275
|
+
translator$y,
|
|
33211
33276
|
translator$1P,
|
|
33212
33277
|
translator$16,
|
|
33213
33278
|
translator$15,
|
|
33214
|
-
translator$w,
|
|
33215
33279
|
translator$v,
|
|
33280
|
+
translator$u,
|
|
33216
33281
|
commentRangeStartTranslator,
|
|
33217
33282
|
commentRangeEndTranslator
|
|
33218
33283
|
])
|
|
@@ -33551,8 +33616,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33551
33616
|
converter,
|
|
33552
33617
|
path: [el]
|
|
33553
33618
|
});
|
|
33554
|
-
const
|
|
33555
|
-
const paraId = attrs["w14:paraId"];
|
|
33619
|
+
const lastElement = parsedElements[parsedElements.length - 1];
|
|
33620
|
+
const paraId = lastElement?.attrs?.["w14:paraId"];
|
|
33556
33621
|
return {
|
|
33557
33622
|
commentId: internalId || v4(),
|
|
33558
33623
|
importedId,
|
|
@@ -33595,7 +33660,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
33595
33660
|
if (!extendedDef) return { ...comment2, isDone: comment2.isDone ?? false };
|
|
33596
33661
|
const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
|
|
33597
33662
|
let parentComment;
|
|
33598
|
-
if (paraIdParent)
|
|
33663
|
+
if (paraIdParent) {
|
|
33664
|
+
parentComment = comments.find(
|
|
33665
|
+
(c2) => c2.paraId === paraIdParent || c2.elements?.some((el) => el.attrs?.["w14:paraId"] === paraIdParent)
|
|
33666
|
+
);
|
|
33667
|
+
}
|
|
33599
33668
|
const newComment = {
|
|
33600
33669
|
...comment2,
|
|
33601
33670
|
isDone: isDone ?? false,
|
|
@@ -35335,13 +35404,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
35335
35404
|
text: translator$1,
|
|
35336
35405
|
lineBreak: translator$2r,
|
|
35337
35406
|
table: translator$b,
|
|
35338
|
-
tableRow: translator$
|
|
35407
|
+
tableRow: translator$w,
|
|
35339
35408
|
tableCell: translator$I,
|
|
35340
35409
|
bookmarkStart: translator$a,
|
|
35341
35410
|
bookmarkEnd: translator$9,
|
|
35342
|
-
fieldAnnotation: translator$
|
|
35411
|
+
fieldAnnotation: translator$s,
|
|
35343
35412
|
tab: translator$2p,
|
|
35344
|
-
image: translator$
|
|
35413
|
+
image: translator$t,
|
|
35345
35414
|
hardBreak: translator$2r,
|
|
35346
35415
|
commentRangeStart: commentRangeStartTranslator,
|
|
35347
35416
|
commentRangeEnd: commentRangeEndTranslator,
|
|
@@ -35353,10 +35422,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
35353
35422
|
contentBlock: translator,
|
|
35354
35423
|
vectorShape: translateVectorShape,
|
|
35355
35424
|
shapeGroup: translateShapeGroup,
|
|
35356
|
-
structuredContent: translator$
|
|
35357
|
-
structuredContentBlock: translator$
|
|
35358
|
-
documentPartObject: translator$
|
|
35359
|
-
documentSection: translator$
|
|
35425
|
+
structuredContent: translator$s,
|
|
35426
|
+
structuredContentBlock: translator$s,
|
|
35427
|
+
documentPartObject: translator$s,
|
|
35428
|
+
documentSection: translator$s,
|
|
35360
35429
|
"page-number": translator$4,
|
|
35361
35430
|
"total-page-number": translator$3,
|
|
35362
35431
|
pageReference: translator$6,
|
|
@@ -36366,7 +36435,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
36366
36435
|
static getStoredSuperdocVersion(docx) {
|
|
36367
36436
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
36368
36437
|
}
|
|
36369
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.3.0-next.
|
|
36438
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.3.0-next.8") {
|
|
36370
36439
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
36371
36440
|
}
|
|
36372
36441
|
/**
|
|
@@ -62076,7 +62145,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
62076
62145
|
return false;
|
|
62077
62146
|
}
|
|
62078
62147
|
};
|
|
62079
|
-
const summaryVersion = "1.3.0-next.
|
|
62148
|
+
const summaryVersion = "1.3.0-next.8";
|
|
62080
62149
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
62081
62150
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
62082
62151
|
function mapAttributes(attrs) {
|
|
@@ -64710,7 +64779,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
64710
64779
|
* Process collaboration migrations
|
|
64711
64780
|
*/
|
|
64712
64781
|
processCollaborationMigrations() {
|
|
64713
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.
|
|
64782
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.8");
|
|
64714
64783
|
if (!this.options.ydoc) return;
|
|
64715
64784
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
64716
64785
|
let docVersion = metaMap.get("version");
|
|
@@ -91544,6 +91613,12 @@ ${l}
|
|
|
91544
91613
|
run2.letterSpacing = defaults2.letterSpacing;
|
|
91545
91614
|
}
|
|
91546
91615
|
};
|
|
91616
|
+
const applyInlineRunProperties = (run2, runProperties) => {
|
|
91617
|
+
if (!runProperties) return;
|
|
91618
|
+
if (runProperties?.letterSpacing != null) {
|
|
91619
|
+
run2.letterSpacing = twipsToPx$1(runProperties.letterSpacing);
|
|
91620
|
+
}
|
|
91621
|
+
};
|
|
91547
91622
|
function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defaultSize, styleContext, listCounterContext, trackedChanges, bookmarks, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG$1, themeColors, converters, converterContext) {
|
|
91548
91623
|
const baseBlockId = nextBlockId("paragraph");
|
|
91549
91624
|
const paragraphProps = typeof para.attrs?.paragraphProperties === "object" && para.attrs.paragraphProperties !== null ? para.attrs.paragraphProperties : {};
|
|
@@ -91696,7 +91771,7 @@ ${l}
|
|
|
91696
91771
|
runStyleId
|
|
91697
91772
|
});
|
|
91698
91773
|
};
|
|
91699
|
-
const visitNode = (node2, inheritedMarks = [], activeSdt, activeRunStyleId = null) => {
|
|
91774
|
+
const visitNode = (node2, inheritedMarks = [], activeSdt, activeRunStyleId = null, activeRunProperties) => {
|
|
91700
91775
|
if (node2.type === "text" && node2.text) {
|
|
91701
91776
|
const run2 = textNodeToRun(
|
|
91702
91777
|
node2,
|
|
@@ -91712,6 +91787,7 @@ ${l}
|
|
|
91712
91787
|
const inlineStyleId = getInlineStyleId(inheritedMarks);
|
|
91713
91788
|
applyRunStyles2(run2, inlineStyleId, activeRunStyleId);
|
|
91714
91789
|
applyBaseRunDefaults(run2, baseRunDefaults, defaultFont, defaultSize);
|
|
91790
|
+
applyInlineRunProperties(run2, activeRunProperties);
|
|
91715
91791
|
applyMarksToRun(
|
|
91716
91792
|
run2,
|
|
91717
91793
|
[...node2.marks ?? [], ...inheritedMarks ?? []],
|
|
@@ -91724,14 +91800,16 @@ ${l}
|
|
|
91724
91800
|
}
|
|
91725
91801
|
if (node2.type === "run" && Array.isArray(node2.content)) {
|
|
91726
91802
|
const mergedMarks = [...node2.marks ?? [], ...inheritedMarks ?? []];
|
|
91727
|
-
const
|
|
91728
|
-
|
|
91803
|
+
const runProperties = typeof node2.attrs?.runProperties === "object" && node2.attrs.runProperties !== null ? node2.attrs.runProperties : null;
|
|
91804
|
+
const nextRunStyleId = extractRunStyleId(runProperties) ?? activeRunStyleId;
|
|
91805
|
+
const nextRunProperties = runProperties ?? activeRunProperties;
|
|
91806
|
+
node2.content.forEach((child) => visitNode(child, mergedMarks, activeSdt, nextRunStyleId, nextRunProperties));
|
|
91729
91807
|
return;
|
|
91730
91808
|
}
|
|
91731
91809
|
if (node2.type === "structuredContent" && Array.isArray(node2.content)) {
|
|
91732
91810
|
const inlineMetadata = resolveNodeSdtMetadata(node2, "structuredContent");
|
|
91733
91811
|
const nextSdt = inlineMetadata ?? activeSdt;
|
|
91734
|
-
node2.content.forEach((child) => visitNode(child, inheritedMarks, nextSdt, activeRunStyleId));
|
|
91812
|
+
node2.content.forEach((child) => visitNode(child, inheritedMarks, nextSdt, activeRunStyleId, activeRunProperties));
|
|
91735
91813
|
return;
|
|
91736
91814
|
}
|
|
91737
91815
|
if (node2.type === "fieldAnnotation") {
|
|
@@ -91785,6 +91863,7 @@ ${l}
|
|
|
91785
91863
|
const inlineStyleId = getInlineStyleId(mergedMarks);
|
|
91786
91864
|
applyRunStyles2(tokenRun, inlineStyleId, activeRunStyleId);
|
|
91787
91865
|
applyBaseRunDefaults(tokenRun, baseRunDefaults, defaultFont, defaultSize);
|
|
91866
|
+
applyInlineRunProperties(tokenRun, activeRunProperties);
|
|
91788
91867
|
if (pageRefPos) {
|
|
91789
91868
|
tokenRun.pmStart = pageRefPos.start;
|
|
91790
91869
|
tokenRun.pmEnd = pageRefPos.end;
|
|
@@ -91799,7 +91878,9 @@ ${l}
|
|
|
91799
91878
|
}
|
|
91800
91879
|
currentRuns.push(tokenRun);
|
|
91801
91880
|
} else if (Array.isArray(node2.content)) {
|
|
91802
|
-
node2.content.forEach(
|
|
91881
|
+
node2.content.forEach(
|
|
91882
|
+
(child) => visitNode(child, mergedMarks, activeSdt, activeRunStyleId, activeRunProperties)
|
|
91883
|
+
);
|
|
91803
91884
|
}
|
|
91804
91885
|
return;
|
|
91805
91886
|
}
|
|
@@ -91813,7 +91894,9 @@ ${l}
|
|
|
91813
91894
|
}
|
|
91814
91895
|
}
|
|
91815
91896
|
if (Array.isArray(node2.content)) {
|
|
91816
|
-
node2.content.forEach(
|
|
91897
|
+
node2.content.forEach(
|
|
91898
|
+
(child) => visitNode(child, inheritedMarks, activeSdt, activeRunStyleId, activeRunProperties)
|
|
91899
|
+
);
|
|
91817
91900
|
}
|
|
91818
91901
|
return;
|
|
91819
91902
|
}
|
|
@@ -91865,6 +91948,7 @@ ${l}
|
|
|
91865
91948
|
runStyleId: activeRunStyleId,
|
|
91866
91949
|
mergedMarksCount: mergedMarks.length
|
|
91867
91950
|
});
|
|
91951
|
+
applyInlineRunProperties(tokenRun, activeRunProperties);
|
|
91868
91952
|
currentRuns.push(tokenRun);
|
|
91869
91953
|
}
|
|
91870
91954
|
return;
|
|
@@ -95041,6 +95125,7 @@ ${l}
|
|
|
95041
95125
|
let lastFontSize = 12;
|
|
95042
95126
|
let tabStopCursor = 0;
|
|
95043
95127
|
let pendingTabAlignment = null;
|
|
95128
|
+
let pendingRunSpacing = 0;
|
|
95044
95129
|
let lastAppliedTabAlign = null;
|
|
95045
95130
|
const warnedTabVals = /* @__PURE__ */ new Set();
|
|
95046
95131
|
let activeTabGroup = null;
|
|
@@ -95051,6 +95136,10 @@ ${l}
|
|
|
95051
95136
|
}
|
|
95052
95137
|
return true;
|
|
95053
95138
|
};
|
|
95139
|
+
const resolveBoundarySpacing = (lineWidth, isRunStart, run2) => {
|
|
95140
|
+
if (lineWidth <= 0) return 0;
|
|
95141
|
+
return isRunStart ? pendingRunSpacing : run2.letterSpacing ?? 0;
|
|
95142
|
+
};
|
|
95054
95143
|
const alignPendingTabForWidth = (segmentWidth, beforeDecimalWidth) => {
|
|
95055
95144
|
if (!pendingTabAlignment || !currentLine) return void 0;
|
|
95056
95145
|
if (segmentWidth < 0) {
|
|
@@ -95178,6 +95267,7 @@ ${l}
|
|
|
95178
95267
|
tabStopCursor = 0;
|
|
95179
95268
|
pendingTabAlignment = null;
|
|
95180
95269
|
lastAppliedTabAlign = null;
|
|
95270
|
+
pendingRunSpacing = 0;
|
|
95181
95271
|
continue;
|
|
95182
95272
|
}
|
|
95183
95273
|
if (isLineBreakRun(run2)) {
|
|
@@ -95220,6 +95310,7 @@ ${l}
|
|
|
95220
95310
|
tabStopCursor = 0;
|
|
95221
95311
|
pendingTabAlignment = null;
|
|
95222
95312
|
lastAppliedTabAlign = null;
|
|
95313
|
+
pendingRunSpacing = 0;
|
|
95223
95314
|
continue;
|
|
95224
95315
|
}
|
|
95225
95316
|
if (isTabRun(run2)) {
|
|
@@ -95285,6 +95376,7 @@ ${l}
|
|
|
95285
95376
|
} else {
|
|
95286
95377
|
pendingTabAlignment = null;
|
|
95287
95378
|
}
|
|
95379
|
+
pendingRunSpacing = 0;
|
|
95288
95380
|
continue;
|
|
95289
95381
|
}
|
|
95290
95382
|
if (isImageRun(run2)) {
|
|
@@ -95323,6 +95415,7 @@ ${l}
|
|
|
95323
95415
|
}
|
|
95324
95416
|
]
|
|
95325
95417
|
};
|
|
95418
|
+
pendingRunSpacing = 0;
|
|
95326
95419
|
if (activeTabGroup && runIndex + 1 >= activeTabGroup.measure.endRunIndex) {
|
|
95327
95420
|
activeTabGroup = null;
|
|
95328
95421
|
}
|
|
@@ -95384,6 +95477,7 @@ ${l}
|
|
|
95384
95477
|
currentLine.width = roundValue(tabAlign.target);
|
|
95385
95478
|
}
|
|
95386
95479
|
lastAppliedTabAlign = null;
|
|
95480
|
+
pendingRunSpacing = 0;
|
|
95387
95481
|
continue;
|
|
95388
95482
|
}
|
|
95389
95483
|
if (isFieldAnnotationRun(run2)) {
|
|
@@ -95423,6 +95517,7 @@ ${l}
|
|
|
95423
95517
|
}
|
|
95424
95518
|
]
|
|
95425
95519
|
};
|
|
95520
|
+
pendingRunSpacing = 0;
|
|
95426
95521
|
continue;
|
|
95427
95522
|
}
|
|
95428
95523
|
if (currentLine.width + annotationWidth > currentLine.maxWidth && currentLine.width > 0) {
|
|
@@ -95475,9 +95570,11 @@ ${l}
|
|
|
95475
95570
|
currentLine.width = roundValue(tabAlign.target);
|
|
95476
95571
|
}
|
|
95477
95572
|
lastAppliedTabAlign = null;
|
|
95573
|
+
pendingRunSpacing = 0;
|
|
95478
95574
|
continue;
|
|
95479
95575
|
}
|
|
95480
95576
|
if (!("text" in run2) || !("fontSize" in run2)) {
|
|
95577
|
+
pendingRunSpacing = 0;
|
|
95481
95578
|
continue;
|
|
95482
95579
|
}
|
|
95483
95580
|
lastFontSize = run2.fontSize;
|
|
@@ -95488,6 +95585,7 @@ ${l}
|
|
|
95488
95585
|
const segment = tabSegments[segmentIndex];
|
|
95489
95586
|
const isLastSegment = segmentIndex === tabSegments.length - 1;
|
|
95490
95587
|
if (/^[ ]+$/.test(segment)) {
|
|
95588
|
+
const isRunStart = charPosInRun === 0 && segmentIndex === 0;
|
|
95491
95589
|
const spacesLength = segment.length;
|
|
95492
95590
|
const spacesStartChar = charPosInRun;
|
|
95493
95591
|
const spacesEndChar = charPosInRun + spacesLength;
|
|
@@ -95506,7 +95604,7 @@ ${l}
|
|
|
95506
95604
|
spaceCount: spacesLength
|
|
95507
95605
|
};
|
|
95508
95606
|
} else {
|
|
95509
|
-
const boundarySpacing = currentLine.width
|
|
95607
|
+
const boundarySpacing = resolveBoundarySpacing(currentLine.width, isRunStart, run2);
|
|
95510
95608
|
if (currentLine.width + boundarySpacing + spacesWidth > currentLine.maxWidth - WIDTH_FUDGE_PX2 && currentLine.width > 0) {
|
|
95511
95609
|
trimTrailingWrapSpaces(currentLine);
|
|
95512
95610
|
const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
|
|
@@ -95570,6 +95668,7 @@ ${l}
|
|
|
95570
95668
|
const spaceStartChar = charPosInRun;
|
|
95571
95669
|
const spaceEndChar = charPosInRun + 1;
|
|
95572
95670
|
const singleSpaceWidth = measureRunWidth(" ", font, ctx2, run2, spaceStartChar);
|
|
95671
|
+
const isRunStart2 = charPosInRun === 0 && segmentIndex === 0 && wordIndex === 0;
|
|
95573
95672
|
if (!currentLine) {
|
|
95574
95673
|
currentLine = {
|
|
95575
95674
|
fromRun: runIndex,
|
|
@@ -95584,7 +95683,7 @@ ${l}
|
|
|
95584
95683
|
spaceCount: 1
|
|
95585
95684
|
};
|
|
95586
95685
|
} else {
|
|
95587
|
-
const boundarySpacing2 = currentLine.width
|
|
95686
|
+
const boundarySpacing2 = resolveBoundarySpacing(currentLine.width, isRunStart2, run2);
|
|
95588
95687
|
if (currentLine.width + boundarySpacing2 + singleSpaceWidth > currentLine.maxWidth - WIDTH_FUDGE_PX2 && currentLine.width > 0) {
|
|
95589
95688
|
trimTrailingWrapSpaces(currentLine);
|
|
95590
95689
|
const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
|
|
@@ -95769,7 +95868,8 @@ ${l}
|
|
|
95769
95868
|
continue;
|
|
95770
95869
|
}
|
|
95771
95870
|
const isTocEntry = block.attrs?.isTocEntry;
|
|
95772
|
-
const
|
|
95871
|
+
const isRunStart = charPosInRun === 0 && segmentIndex === 0 && wordIndex === 0;
|
|
95872
|
+
const boundarySpacing = resolveBoundarySpacing(currentLine.width, isRunStart, run2);
|
|
95773
95873
|
const justifyAlignment = block.attrs?.alignment === "justify";
|
|
95774
95874
|
const totalWidthWithWord = currentLine.width + boundarySpacing + wordCommitWidth + // Safe cast: only TextRuns produce word segments from split(), other run types are handled earlier
|
|
95775
95875
|
(shouldIncludeDelimiterSpace ? run2.letterSpacing ?? 0 : 0);
|
|
@@ -95937,6 +96037,7 @@ ${l}
|
|
|
95937
96037
|
}
|
|
95938
96038
|
}
|
|
95939
96039
|
}
|
|
96040
|
+
pendingRunSpacing = run2.letterSpacing ?? 0;
|
|
95940
96041
|
}
|
|
95941
96042
|
if (!currentLine && lines.length === 0) {
|
|
95942
96043
|
const uiDisplayFallbackFontSize = (block.runs[0]?.kind === "text" ? block.runs[0].fontSize : void 0) ?? 12;
|
|
@@ -96740,6 +96841,7 @@ ${l}
|
|
|
96740
96841
|
#dragLastPointer = null;
|
|
96741
96842
|
#dragLastRawHit = null;
|
|
96742
96843
|
#dragUsedPageNotMountedFallback = false;
|
|
96844
|
+
#suppressFocusInFromDraggable = false;
|
|
96743
96845
|
// Cell selection drag state
|
|
96744
96846
|
// Tracks cell-specific context when drag starts in a table for multi-cell selection
|
|
96745
96847
|
#cellAnchor = null;
|
|
@@ -98720,6 +98822,7 @@ ${l}
|
|
|
98720
98822
|
return;
|
|
98721
98823
|
}
|
|
98722
98824
|
const isDraggableAnnotation = target?.closest?.('[data-draggable="true"]') != null;
|
|
98825
|
+
this.#suppressFocusInFromDraggable = isDraggableAnnotation;
|
|
98723
98826
|
if (!this.#layoutState.layout) {
|
|
98724
98827
|
if (!isDraggableAnnotation) {
|
|
98725
98828
|
event.preventDefault();
|
|
@@ -99450,6 +99553,10 @@ ${l}
|
|
|
99450
99553
|
if (isInRegisteredSurface(event)) {
|
|
99451
99554
|
return;
|
|
99452
99555
|
}
|
|
99556
|
+
if (this.#suppressFocusInFromDraggable) {
|
|
99557
|
+
this.#suppressFocusInFromDraggable = false;
|
|
99558
|
+
return;
|
|
99559
|
+
}
|
|
99453
99560
|
const target = event.target;
|
|
99454
99561
|
const activeTarget = this.#getActiveDomTarget();
|
|
99455
99562
|
if (!activeTarget) {
|
|
@@ -99476,6 +99583,7 @@ ${l}
|
|
|
99476
99583
|
}
|
|
99477
99584
|
};
|
|
99478
99585
|
#handlePointerUp = (event) => {
|
|
99586
|
+
this.#suppressFocusInFromDraggable = false;
|
|
99479
99587
|
if (!this.#isDragging) return;
|
|
99480
99588
|
if (typeof this.#viewportHost.hasPointerCapture === "function" && typeof this.#viewportHost.releasePointerCapture === "function" && this.#viewportHost.hasPointerCapture(event.pointerId)) {
|
|
99481
99589
|
this.#viewportHost.releasePointerCapture(event.pointerId);
|
|
@@ -107205,16 +107313,7 @@ ${l}
|
|
|
107205
107313
|
* @param {import("./tableHelpers/createTableBorders.js").TableBorders} [borders] - Border styling for this table
|
|
107206
107314
|
*/
|
|
107207
107315
|
borders: {
|
|
107208
|
-
default: {}
|
|
107209
|
-
renderDOM({ borders }) {
|
|
107210
|
-
if (!borders) return {};
|
|
107211
|
-
const style2 = Object.entries(borders).reduce((acc, [key2, { size: size2, color: color2 }]) => {
|
|
107212
|
-
return `${acc}border-${key2}: ${Math.ceil(size2)}px solid ${color2 || "black"};`;
|
|
107213
|
-
}, "");
|
|
107214
|
-
return {
|
|
107215
|
-
style: style2
|
|
107216
|
-
};
|
|
107217
|
-
}
|
|
107316
|
+
default: {}
|
|
107218
107317
|
},
|
|
107219
107318
|
/**
|
|
107220
107319
|
* @category Attribute
|
|
@@ -144030,7 +144129,7 @@ ${reason}`);
|
|
|
144030
144129
|
this.config.colors = shuffleArray(this.config.colors);
|
|
144031
144130
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
144032
144131
|
this.colorIndex = 0;
|
|
144033
|
-
this.version = "1.3.0-next.
|
|
144132
|
+
this.version = "1.3.0-next.8";
|
|
144034
144133
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
144035
144134
|
this.superdocId = config2.superdocId || v4();
|
|
144036
144135
|
this.colors = this.config.colors;
|