superdoc 1.0.0-beta.14 → 1.0.0-beta.15
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-DrsLL5TV.es.js → PdfViewer-CjlHzt9e.es.js} +1 -1
- package/dist/chunks/{PdfViewer-Cdc_EOZ9.cjs → PdfViewer-DltPlBWC.cjs} +1 -1
- package/dist/chunks/{index-9ZvcPlCg.cjs → index-BZnlco_f.cjs} +3 -3
- package/dist/chunks/{index-I4Ew0HDV-EPhjcu7T.cjs → index-Bds7gW4r-JPDW6c39.cjs} +1 -1
- package/dist/chunks/{index-I4Ew0HDV-Bht7-IGi.es.js → index-Bds7gW4r-Pk_xAuWe.es.js} +1 -1
- package/dist/chunks/{index-DB1DyDmZ.es.js → index-qg0AxQJC.es.js} +3 -3
- package/dist/chunks/{super-editor.es-DxAG4BVh.es.js → super-editor.es-CQTkj_nb.es.js} +2031 -472
- package/dist/chunks/{super-editor.es-DuS77THX.cjs → super-editor.es-CuAhqbzW.cjs} +2031 -472
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/style.css +6 -6
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CfmIU--8.js → converter-qMoZOGGn.js} +412 -252
- package/dist/super-editor/chunks/{docx-zipper-B-CXiNSb.js → docx-zipper-QKiyORxV.js} +1 -1
- package/dist/super-editor/chunks/{editor-wC_gs8Bl.js → editor-D8ZdjC2V.js} +1633 -215
- package/dist/super-editor/chunks/{index-I4Ew0HDV.js → index-Bds7gW4r.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-BR1GYvwW.js → toolbar-Spi7vpev.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +6 -6
- package/dist/super-editor/super-editor.es.js +8 -100
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +2033 -474
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -18972,7 +18972,6 @@ const encode$B = (params, encodedAttrs = {}) => {
|
|
|
18972
18972
|
}
|
|
18973
18973
|
}
|
|
18974
18974
|
});
|
|
18975
|
-
console.log("subs:", subs);
|
|
18976
18975
|
return subs;
|
|
18977
18976
|
};
|
|
18978
18977
|
function decode$D(params) {
|
|
@@ -20131,6 +20130,51 @@ function getStrikeValue(attributes) {
|
|
|
20131
20130
|
if (value === "0" || value === "false" || value === "off") return "0";
|
|
20132
20131
|
return "1";
|
|
20133
20132
|
}
|
|
20133
|
+
function parseProperties(node) {
|
|
20134
|
+
const marks = [];
|
|
20135
|
+
const unknownMarks = [];
|
|
20136
|
+
const { attributes = {}, elements = [] } = node;
|
|
20137
|
+
const { nodes, paragraphProperties = {}, runProperties = {} } = splitElementsAndProperties(elements);
|
|
20138
|
+
const hasRun = elements.find((element) => element.name === "w:r");
|
|
20139
|
+
if (hasRun) paragraphProperties.elements = paragraphProperties?.elements?.filter((el) => el.name !== "w:rPr");
|
|
20140
|
+
if (runProperties && runProperties?.elements?.length) {
|
|
20141
|
+
marks.push(...parseMarks(runProperties, unknownMarks));
|
|
20142
|
+
}
|
|
20143
|
+
if (paragraphProperties && paragraphProperties.elements?.length) {
|
|
20144
|
+
const disallowedParagraphProperties = ["w:u"];
|
|
20145
|
+
const filteredParagraphProperties = {
|
|
20146
|
+
...paragraphProperties,
|
|
20147
|
+
elements: paragraphProperties.elements?.filter((el) => !disallowedParagraphProperties.includes(el.name))
|
|
20148
|
+
};
|
|
20149
|
+
marks.push(...parseMarks(filteredParagraphProperties, unknownMarks));
|
|
20150
|
+
}
|
|
20151
|
+
marks.push(...handleStyleChangeMarks(runProperties, marks));
|
|
20152
|
+
if (paragraphProperties && paragraphProperties.elements?.length) {
|
|
20153
|
+
attributes["paragraphProperties"] = paragraphProperties;
|
|
20154
|
+
}
|
|
20155
|
+
if (marks && node.name === "w:p") {
|
|
20156
|
+
marks.forEach((mark) => {
|
|
20157
|
+
const attrValue = Object.keys(mark.attrs ?? {})[0];
|
|
20158
|
+
if (attrValue) {
|
|
20159
|
+
const value = mark.attrs[attrValue];
|
|
20160
|
+
attributes[attrValue] = value;
|
|
20161
|
+
}
|
|
20162
|
+
});
|
|
20163
|
+
}
|
|
20164
|
+
return { elements: nodes, attributes, marks, unknownMarks };
|
|
20165
|
+
}
|
|
20166
|
+
function splitElementsAndProperties(elements) {
|
|
20167
|
+
const pPr = elements.find((el) => el.name === "w:pPr");
|
|
20168
|
+
const rPr = elements.find((el) => el.name === "w:rPr");
|
|
20169
|
+
const sectPr = elements.find((el) => el.name === "w:sectPr");
|
|
20170
|
+
const els = elements.filter((el) => el.name !== "w:pPr" && el.name !== "w:rPr" && el.name !== "w:sectPr");
|
|
20171
|
+
return {
|
|
20172
|
+
nodes: els,
|
|
20173
|
+
paragraphProperties: pPr,
|
|
20174
|
+
runProperties: rPr,
|
|
20175
|
+
sectionProperties: sectPr
|
|
20176
|
+
};
|
|
20177
|
+
}
|
|
20134
20178
|
function getTableStyleId(path) {
|
|
20135
20179
|
const tbl = path.find((ancestor) => ancestor.name === "w:tbl");
|
|
20136
20180
|
if (!tbl) {
|
|
@@ -20155,13 +20199,6 @@ const handleParagraphNode$1 = (params) => {
|
|
|
20155
20199
|
if (pPr) {
|
|
20156
20200
|
inlineParagraphProperties = translator$12.encode({ ...params, nodes: [pPr] }) || {};
|
|
20157
20201
|
}
|
|
20158
|
-
const handleStandardNode2 = nodeListHandler.handlerEntities.find(
|
|
20159
|
-
(e) => e.handlerName === "standardNodeHandler"
|
|
20160
|
-
)?.handler;
|
|
20161
|
-
if (!handleStandardNode2) {
|
|
20162
|
-
console.error("Standard node handler not found");
|
|
20163
|
-
return null;
|
|
20164
|
-
}
|
|
20165
20202
|
const insideTable = (params.path || []).some((ancestor) => ancestor.name === "w:tc");
|
|
20166
20203
|
const tableStyleId = getTableStyleId(params.path || []);
|
|
20167
20204
|
const resolvedParagraphProperties = resolveParagraphProperties(
|
|
@@ -20170,15 +20207,29 @@ const handleParagraphNode$1 = (params) => {
|
|
|
20170
20207
|
insideTable,
|
|
20171
20208
|
tableStyleId
|
|
20172
20209
|
);
|
|
20173
|
-
const
|
|
20174
|
-
|
|
20175
|
-
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20210
|
+
const { elements = [], attributes = {}, marks = [] } = parseProperties(node, params.docx);
|
|
20211
|
+
const childContent = [];
|
|
20212
|
+
if (elements.length) {
|
|
20213
|
+
const updatedElements = elements.map((el) => {
|
|
20214
|
+
if (!el.marks) el.marks = [];
|
|
20215
|
+
el.marks.push(...marks);
|
|
20216
|
+
return el;
|
|
20217
|
+
});
|
|
20218
|
+
const childParams = {
|
|
20219
|
+
...params,
|
|
20220
|
+
nodes: updatedElements,
|
|
20221
|
+
extraParams: { ...params.extraParams, paragraphProperties: resolvedParagraphProperties },
|
|
20222
|
+
path: [...params.path || [], node]
|
|
20223
|
+
};
|
|
20224
|
+
const translatedChildren = nodeListHandler.handler(childParams);
|
|
20225
|
+
childContent.push(...translatedChildren);
|
|
20181
20226
|
}
|
|
20227
|
+
schemaNode = {
|
|
20228
|
+
type: "paragraph",
|
|
20229
|
+
content: childContent,
|
|
20230
|
+
attrs: { ...attributes },
|
|
20231
|
+
marks: []
|
|
20232
|
+
};
|
|
20182
20233
|
schemaNode.type = "paragraph";
|
|
20183
20234
|
schemaNode.attrs.paragraphProperties = inlineParagraphProperties;
|
|
20184
20235
|
schemaNode.attrs.rsidRDefault = node.attributes?.["w:rsidRDefault"];
|
|
@@ -21826,13 +21877,14 @@ const tableOfContentsHandler = (params) => {
|
|
|
21826
21877
|
nodes: node.elements,
|
|
21827
21878
|
path: [...params.path || [], node]
|
|
21828
21879
|
});
|
|
21880
|
+
const normalizedContent = normalizeDocPartContent(translatedContent);
|
|
21829
21881
|
const sdtPr = params.extraParams.sdtPr;
|
|
21830
21882
|
const id = sdtPr.elements?.find((el) => el.name === "w:id")?.attributes["w:val"] || "";
|
|
21831
21883
|
const docPartObj = sdtPr?.elements.find((el) => el.name === "w:docPartObj");
|
|
21832
21884
|
const docPartUnique = docPartObj?.elements.some((el) => el.name === "w:docPartUnique") ?? false;
|
|
21833
21885
|
const result = {
|
|
21834
21886
|
type: "documentPartObject",
|
|
21835
|
-
content:
|
|
21887
|
+
content: normalizedContent,
|
|
21836
21888
|
attrs: {
|
|
21837
21889
|
id,
|
|
21838
21890
|
docPartGallery: "Table of Contents",
|
|
@@ -21872,6 +21924,22 @@ const genericDocPartHandler = (params) => {
|
|
|
21872
21924
|
const validGalleryTypeMap = {
|
|
21873
21925
|
"Table of Contents": tableOfContentsHandler
|
|
21874
21926
|
};
|
|
21927
|
+
const inlineNodeTypes = /* @__PURE__ */ new Set(["bookmarkStart", "bookmarkEnd"]);
|
|
21928
|
+
const wrapInlineNode = (node) => ({
|
|
21929
|
+
type: "paragraph",
|
|
21930
|
+
content: [node]
|
|
21931
|
+
});
|
|
21932
|
+
const normalizeDocPartContent = (nodes = []) => {
|
|
21933
|
+
const normalized = [];
|
|
21934
|
+
nodes.forEach((node) => {
|
|
21935
|
+
if (inlineNodeTypes.has(node?.type)) {
|
|
21936
|
+
normalized.push(wrapInlineNode(node));
|
|
21937
|
+
} else {
|
|
21938
|
+
normalized.push(node);
|
|
21939
|
+
}
|
|
21940
|
+
});
|
|
21941
|
+
return normalized;
|
|
21942
|
+
};
|
|
21875
21943
|
function handleDocumentSectionNode(params) {
|
|
21876
21944
|
const { nodes, nodeListHandler } = params;
|
|
21877
21945
|
if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
|
|
@@ -24950,7 +25018,8 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
24950
25018
|
horizontal: positionHValue,
|
|
24951
25019
|
top: positionVValue
|
|
24952
25020
|
};
|
|
24953
|
-
const
|
|
25021
|
+
const useSimplePos = attributes["simplePos"] === "1" || attributes["simplePos"] === 1;
|
|
25022
|
+
const simplePos = useSimplePos ? node.elements.find((el) => el.name === "wp:simplePos") : null;
|
|
24954
25023
|
const wrapNode = isAnchor ? node.elements.find(
|
|
24955
25024
|
(el) => ["wp:wrapNone", "wp:wrapSquare", "wp:wrapThrough", "wp:wrapTight", "wp:wrapTopAndBottom"].includes(el.name)
|
|
24956
25025
|
) : null;
|
|
@@ -32718,15 +32787,26 @@ const getCommentSchema = (type2, commentIndex) => {
|
|
|
32718
32787
|
}
|
|
32719
32788
|
};
|
|
32720
32789
|
};
|
|
32721
|
-
const getConfig = (type2) =>
|
|
32722
|
-
|
|
32723
|
-
|
|
32724
|
-
|
|
32725
|
-
|
|
32726
|
-
|
|
32727
|
-
|
|
32728
|
-
|
|
32729
|
-
|
|
32790
|
+
const getConfig = (type2) => {
|
|
32791
|
+
const sdName = `${SD_NODE_NAME$6}${type2}`;
|
|
32792
|
+
const isStart = type2 === "Start";
|
|
32793
|
+
return {
|
|
32794
|
+
xmlName: `${XML_NODE_NAME$7}${type2}`,
|
|
32795
|
+
sdNodeOrKeyName: sdName,
|
|
32796
|
+
type: NodeTranslator.translatorTypes.NODE,
|
|
32797
|
+
encode: ({ nodes }) => {
|
|
32798
|
+
const node = nodes?.[0];
|
|
32799
|
+
if (!node) return void 0;
|
|
32800
|
+
const attrs = node.attributes ? { ...node.attributes } : {};
|
|
32801
|
+
return {
|
|
32802
|
+
type: isStart ? "commentRangeStart" : "commentRangeEnd",
|
|
32803
|
+
attrs
|
|
32804
|
+
};
|
|
32805
|
+
},
|
|
32806
|
+
decode: decode$7,
|
|
32807
|
+
attributes: [attrConfig]
|
|
32808
|
+
};
|
|
32809
|
+
};
|
|
32730
32810
|
const commentRangeStartTranslator = NodeTranslator.from(getConfig("Start"));
|
|
32731
32811
|
const commentRangeEndTranslator = NodeTranslator.from(getConfig("End"));
|
|
32732
32812
|
const XML_NODE_NAME$6 = "sd:pageReference";
|
|
@@ -33450,127 +33530,224 @@ const sdtNodeHandlerEntity = {
|
|
|
33450
33530
|
handlerName: "sdtNodeHandler",
|
|
33451
33531
|
handler: handleSdtNode
|
|
33452
33532
|
};
|
|
33453
|
-
|
|
33454
|
-
|
|
33455
|
-
|
|
33456
|
-
|
|
33457
|
-
|
|
33458
|
-
|
|
33459
|
-
|
|
33460
|
-
|
|
33461
|
-
|
|
33462
|
-
|
|
33463
|
-
|
|
33464
|
-
|
|
33465
|
-
|
|
33466
|
-
|
|
33467
|
-
|
|
33468
|
-
|
|
33469
|
-
|
|
33470
|
-
|
|
33471
|
-
|
|
33472
|
-
|
|
33473
|
-
|
|
33533
|
+
const translatorList = Array.from(
|
|
33534
|
+
/* @__PURE__ */ new Set([
|
|
33535
|
+
translator$1M,
|
|
33536
|
+
translator$6,
|
|
33537
|
+
translator$5,
|
|
33538
|
+
translator$4,
|
|
33539
|
+
translator$3,
|
|
33540
|
+
translator$1L,
|
|
33541
|
+
translator$1K,
|
|
33542
|
+
translator$1J,
|
|
33543
|
+
translator$20,
|
|
33544
|
+
translator$1r,
|
|
33545
|
+
translator$1$,
|
|
33546
|
+
translator$q,
|
|
33547
|
+
translator$7,
|
|
33548
|
+
translator$8,
|
|
33549
|
+
translator$1p,
|
|
33550
|
+
translator$23,
|
|
33551
|
+
translator$F,
|
|
33552
|
+
translator$1R,
|
|
33553
|
+
translator$1H,
|
|
33554
|
+
translator$1W,
|
|
33555
|
+
translator$1G,
|
|
33556
|
+
translator$2,
|
|
33557
|
+
translator$1F,
|
|
33558
|
+
translator$s,
|
|
33559
|
+
translator$1X,
|
|
33560
|
+
translator$X,
|
|
33561
|
+
translator$1E,
|
|
33562
|
+
translator$E,
|
|
33563
|
+
translator$D,
|
|
33564
|
+
translator$b,
|
|
33565
|
+
translator$Z,
|
|
33566
|
+
translator$J,
|
|
33567
|
+
translator$I,
|
|
33568
|
+
translator$C,
|
|
33569
|
+
translator$K,
|
|
33570
|
+
translator$22,
|
|
33571
|
+
translator$10,
|
|
33572
|
+
translator$1_,
|
|
33573
|
+
translator$1x,
|
|
33574
|
+
translator$1D,
|
|
33575
|
+
translator$1w,
|
|
33576
|
+
translator$V,
|
|
33577
|
+
translator$U,
|
|
33578
|
+
translator$1C,
|
|
33579
|
+
translator$1B,
|
|
33580
|
+
translator$1A,
|
|
33581
|
+
translator$1z,
|
|
33582
|
+
translator$1P,
|
|
33583
|
+
translator$1n,
|
|
33584
|
+
translator$1y,
|
|
33585
|
+
translator$O,
|
|
33586
|
+
translator$1v,
|
|
33587
|
+
translator$1u,
|
|
33588
|
+
translator$1t,
|
|
33589
|
+
translator$1s,
|
|
33590
|
+
translator$11,
|
|
33591
|
+
translator$1f,
|
|
33592
|
+
translator$1h,
|
|
33593
|
+
translator$12,
|
|
33594
|
+
translator$1g,
|
|
33595
|
+
translator$$,
|
|
33596
|
+
translator$1V,
|
|
33597
|
+
translator$1N,
|
|
33598
|
+
translator$1U,
|
|
33599
|
+
translator$1l,
|
|
33600
|
+
translator$r,
|
|
33601
|
+
translator$1Q,
|
|
33602
|
+
translator$1e,
|
|
33603
|
+
translator$1d,
|
|
33604
|
+
translator$1c,
|
|
33605
|
+
translator$1b,
|
|
33606
|
+
translator$1a,
|
|
33607
|
+
translator$T,
|
|
33608
|
+
translator$1Y,
|
|
33609
|
+
translator$1T,
|
|
33610
|
+
translator$1S,
|
|
33611
|
+
translator$1,
|
|
33612
|
+
translator$21,
|
|
33613
|
+
translator$19,
|
|
33614
|
+
translator$9,
|
|
33615
|
+
translator$e,
|
|
33616
|
+
translator$p,
|
|
33617
|
+
translator$d,
|
|
33618
|
+
translator$B,
|
|
33619
|
+
translator$o,
|
|
33620
|
+
translator$a,
|
|
33621
|
+
translator$A,
|
|
33622
|
+
translator$n,
|
|
33623
|
+
translator$m,
|
|
33624
|
+
translator$l,
|
|
33625
|
+
translator$k,
|
|
33626
|
+
translator$c,
|
|
33627
|
+
translator$j,
|
|
33628
|
+
translator$i,
|
|
33629
|
+
translator$h,
|
|
33630
|
+
translator$g,
|
|
33631
|
+
translator$f,
|
|
33632
|
+
translator$G,
|
|
33633
|
+
translator$P,
|
|
33634
|
+
translator$M,
|
|
33635
|
+
translator$N,
|
|
33636
|
+
translator$H,
|
|
33637
|
+
translator$_,
|
|
33638
|
+
translator$17,
|
|
33639
|
+
translator$R,
|
|
33640
|
+
translator$v,
|
|
33641
|
+
translator$Q,
|
|
33642
|
+
translator$z,
|
|
33643
|
+
translator$w,
|
|
33644
|
+
translator$18,
|
|
33645
|
+
translator$16,
|
|
33646
|
+
translator$15,
|
|
33647
|
+
translator$1j,
|
|
33648
|
+
translator$1Z,
|
|
33649
|
+
translator$L,
|
|
33650
|
+
translator$Y,
|
|
33651
|
+
translator$y,
|
|
33652
|
+
translator$x,
|
|
33653
|
+
translator$14,
|
|
33654
|
+
translator$13,
|
|
33655
|
+
translator$u,
|
|
33656
|
+
translator$t,
|
|
33657
|
+
commentRangeStartTranslator,
|
|
33658
|
+
commentRangeEndTranslator
|
|
33659
|
+
])
|
|
33660
|
+
);
|
|
33661
|
+
const additionalHandlers = Object.freeze(
|
|
33662
|
+
translatorList.reduce((acc, translator2) => {
|
|
33663
|
+
const key = translator2?.xmlName;
|
|
33664
|
+
if (!key) return acc;
|
|
33665
|
+
acc[key] = translator2;
|
|
33666
|
+
return acc;
|
|
33667
|
+
}, {})
|
|
33668
|
+
);
|
|
33669
|
+
const baseHandlers = {
|
|
33670
|
+
...additionalHandlers
|
|
33671
|
+
};
|
|
33672
|
+
const registeredHandlers = Object.freeze(baseHandlers);
|
|
33673
|
+
const INLINE_PARENT_NAMES = /* @__PURE__ */ new Set([
|
|
33674
|
+
"w:r",
|
|
33675
|
+
"w:hyperlink",
|
|
33676
|
+
"w:smartTag",
|
|
33677
|
+
"w:fldSimple",
|
|
33678
|
+
"w:proofErr",
|
|
33679
|
+
"w:del",
|
|
33680
|
+
"w:ins"
|
|
33681
|
+
]);
|
|
33682
|
+
const INLINE_NODE_NAMES = /* @__PURE__ */ new Set([
|
|
33683
|
+
"m:oMathPara",
|
|
33684
|
+
"m:oMath",
|
|
33685
|
+
"m:t",
|
|
33686
|
+
"m:r",
|
|
33687
|
+
"m:ctrlPr",
|
|
33688
|
+
"m:sSupPr",
|
|
33689
|
+
"m:e",
|
|
33690
|
+
"m:sup",
|
|
33691
|
+
"m:sSup"
|
|
33692
|
+
]);
|
|
33693
|
+
const BLOCK_BOUNDARY_NAMES = /* @__PURE__ */ new Set(["w:p", "w:body", "w:tbl", "w:tc", "w:tr"]);
|
|
33694
|
+
const isInlineContext = (path = [], currentNodeName) => {
|
|
33695
|
+
if (currentNodeName && INLINE_NODE_NAMES.has(currentNodeName)) {
|
|
33696
|
+
return true;
|
|
33474
33697
|
}
|
|
33475
|
-
if (
|
|
33476
|
-
|
|
33477
|
-
|
|
33478
|
-
|
|
33479
|
-
|
|
33480
|
-
|
|
33481
|
-
|
|
33482
|
-
|
|
33698
|
+
if (!Array.isArray(path) || path.length === 0) return false;
|
|
33699
|
+
for (let i = path.length - 1; i >= 0; i--) {
|
|
33700
|
+
const ancestorName = path[i]?.name;
|
|
33701
|
+
if (!ancestorName) continue;
|
|
33702
|
+
if (INLINE_NODE_NAMES.has(ancestorName) || INLINE_PARENT_NAMES.has(ancestorName)) {
|
|
33703
|
+
return true;
|
|
33704
|
+
}
|
|
33705
|
+
if (BLOCK_BOUNDARY_NAMES.has(ancestorName)) {
|
|
33706
|
+
return false;
|
|
33707
|
+
}
|
|
33483
33708
|
}
|
|
33484
|
-
return
|
|
33485
|
-
}
|
|
33486
|
-
function splitElementsAndProperties(elements) {
|
|
33487
|
-
const pPr = elements.find((el) => el.name === "w:pPr");
|
|
33488
|
-
const rPr = elements.find((el) => el.name === "w:rPr");
|
|
33489
|
-
const sectPr = elements.find((el) => el.name === "w:sectPr");
|
|
33490
|
-
const els = elements.filter((el) => el.name !== "w:pPr" && el.name !== "w:rPr" && el.name !== "w:sectPr");
|
|
33491
|
-
return {
|
|
33492
|
-
nodes: els,
|
|
33493
|
-
paragraphProperties: pPr,
|
|
33494
|
-
runProperties: rPr,
|
|
33495
|
-
sectionProperties: sectPr
|
|
33496
|
-
};
|
|
33497
|
-
}
|
|
33498
|
-
function getElementName(element) {
|
|
33499
|
-
return SuperConverter.allowedElements[element.name || element.type];
|
|
33500
|
-
}
|
|
33501
|
-
const isPropertiesElement = (element) => {
|
|
33502
|
-
return !!SuperConverter.propertyTypes[element.name || element.type];
|
|
33709
|
+
return false;
|
|
33503
33710
|
};
|
|
33504
|
-
const
|
|
33505
|
-
const { nodes
|
|
33506
|
-
if (!nodes || nodes.length === 0) {
|
|
33507
|
-
return { nodes: [], consumed: 0 };
|
|
33508
|
-
}
|
|
33711
|
+
const handlePassthroughNode = (params) => {
|
|
33712
|
+
const { nodes = [] } = params;
|
|
33509
33713
|
const node = nodes[0];
|
|
33510
|
-
|
|
33511
|
-
|
|
33512
|
-
if (name === "w:sdt") {
|
|
33714
|
+
if (!node) return { nodes: [], consumed: 0 };
|
|
33715
|
+
if (registeredHandlers[node.name]) {
|
|
33513
33716
|
return { nodes: [], consumed: 0 };
|
|
33514
33717
|
}
|
|
33515
|
-
|
|
33516
|
-
|
|
33517
|
-
|
|
33518
|
-
|
|
33519
|
-
|
|
33520
|
-
|
|
33521
|
-
marks: []
|
|
33522
|
-
}
|
|
33523
|
-
],
|
|
33524
|
-
consumed: 0
|
|
33525
|
-
};
|
|
33526
|
-
}
|
|
33527
|
-
if (!getElementName(node)) {
|
|
33528
|
-
return {
|
|
33529
|
-
nodes: [
|
|
33530
|
-
{
|
|
33531
|
-
type: name,
|
|
33532
|
-
content: elements,
|
|
33533
|
-
attrs: { ...attributes },
|
|
33534
|
-
marks
|
|
33535
|
-
}
|
|
33536
|
-
],
|
|
33537
|
-
consumed: 0,
|
|
33538
|
-
unhandled: true
|
|
33539
|
-
};
|
|
33540
|
-
}
|
|
33541
|
-
const content = [];
|
|
33542
|
-
const parentStyleId = getParentStyleId(node);
|
|
33543
|
-
if (elements && elements.length) {
|
|
33544
|
-
const updatedElements = elements.map((el) => {
|
|
33545
|
-
if (!el.marks) el.marks = [];
|
|
33546
|
-
el.marks.push(...marks);
|
|
33547
|
-
return el;
|
|
33548
|
-
});
|
|
33718
|
+
const originalXml = carbonCopy(node) || {};
|
|
33719
|
+
const originalElementsSource = originalXml.elements;
|
|
33720
|
+
const originalElements = originalElementsSource ? carbonCopy(originalElementsSource) : [];
|
|
33721
|
+
const childElements = Array.isArray(node.elements) ? node.elements : [];
|
|
33722
|
+
let childContent = [];
|
|
33723
|
+
if (childElements.length && params.nodeListHandler?.handler) {
|
|
33549
33724
|
const childParams = {
|
|
33550
33725
|
...params,
|
|
33551
|
-
nodes:
|
|
33552
|
-
parentStyleId,
|
|
33726
|
+
nodes: childElements,
|
|
33553
33727
|
path: [...params.path || [], node]
|
|
33554
33728
|
};
|
|
33555
|
-
|
|
33556
|
-
content.push(...childContent);
|
|
33729
|
+
childContent = params.nodeListHandler.handler(childParams) || [];
|
|
33557
33730
|
}
|
|
33558
|
-
|
|
33559
|
-
|
|
33560
|
-
|
|
33561
|
-
|
|
33562
|
-
|
|
33731
|
+
if (originalElements?.length) {
|
|
33732
|
+
originalXml.elements = originalElements;
|
|
33733
|
+
}
|
|
33734
|
+
const passthroughNode = {
|
|
33735
|
+
type: isInlineContext(params.path, node.name) ? "passthroughInline" : "passthroughBlock",
|
|
33736
|
+
attrs: {
|
|
33737
|
+
originalName: node.name,
|
|
33738
|
+
originalXml
|
|
33739
|
+
},
|
|
33740
|
+
marks: [],
|
|
33741
|
+
content: childContent
|
|
33742
|
+
};
|
|
33743
|
+
return {
|
|
33744
|
+
nodes: [passthroughNode],
|
|
33745
|
+
consumed: 1
|
|
33563
33746
|
};
|
|
33564
|
-
return { nodes: [resultNode], consumed: 1 };
|
|
33565
|
-
};
|
|
33566
|
-
const getParentStyleId = (node) => {
|
|
33567
|
-
const pPr = node.elements?.find((el) => el.name === "w:pPr");
|
|
33568
|
-
const styleTag = pPr?.elements?.find((el) => el.name === "w:pStyle");
|
|
33569
|
-
return styleTag ? styleTag.attributes["w:val"] : null;
|
|
33570
33747
|
};
|
|
33571
|
-
const
|
|
33572
|
-
handlerName: "
|
|
33573
|
-
handler:
|
|
33748
|
+
const passthroughNodeHandlerEntity = {
|
|
33749
|
+
handlerName: "passthroughNodeHandler",
|
|
33750
|
+
handler: handlePassthroughNode
|
|
33574
33751
|
};
|
|
33575
33752
|
const handler = (params) => {
|
|
33576
33753
|
const { nodes } = params;
|
|
@@ -33594,13 +33771,6 @@ const handleBookmarkNode = (params) => {
|
|
|
33594
33771
|
return { nodes: [], consumed: 0 };
|
|
33595
33772
|
}
|
|
33596
33773
|
const node = nodes[0];
|
|
33597
|
-
const handleStandardNode2 = nodeListHandler.handlerEntities.find(
|
|
33598
|
-
(e) => e.handlerName === "standardNodeHandler"
|
|
33599
|
-
)?.handler;
|
|
33600
|
-
if (!handleStandardNode2) {
|
|
33601
|
-
console.error("Standard node handler not found");
|
|
33602
|
-
return { nodes: [], consumed: 0 };
|
|
33603
|
-
}
|
|
33604
33774
|
const customMarks = editor?.extensionService?.extensions?.filter((e) => e.isExternal === true) || [];
|
|
33605
33775
|
const bookmarkName = node.attributes["w:name"]?.split(";")[0];
|
|
33606
33776
|
const customMark = customMarks.find((mark) => mark.name === bookmarkName);
|
|
@@ -33609,7 +33779,6 @@ const handleBookmarkNode = (params) => {
|
|
|
33609
33779
|
(n) => n.name === "w:bookmarkEnd" && n.attributes["w:id"] === node.attributes["w:id"]
|
|
33610
33780
|
);
|
|
33611
33781
|
const textNodes = nodes.slice(1, bookmarkEndIndex);
|
|
33612
|
-
const nodeListHandler2 = params.nodeListHandler;
|
|
33613
33782
|
const attrs = {};
|
|
33614
33783
|
node.attributes["w:name"].split(";").forEach((name) => {
|
|
33615
33784
|
const [key, value] = name.split("=");
|
|
@@ -33617,7 +33786,7 @@ const handleBookmarkNode = (params) => {
|
|
|
33617
33786
|
attrs[key] = value;
|
|
33618
33787
|
}
|
|
33619
33788
|
});
|
|
33620
|
-
const translatedText =
|
|
33789
|
+
const translatedText = nodeListHandler.handler({
|
|
33621
33790
|
...params,
|
|
33622
33791
|
nodes: textNodes,
|
|
33623
33792
|
path: [...params.path || [], node]
|
|
@@ -33633,13 +33802,11 @@ const handleBookmarkNode = (params) => {
|
|
|
33633
33802
|
consumed: translatedText.length + 2
|
|
33634
33803
|
};
|
|
33635
33804
|
}
|
|
33636
|
-
const
|
|
33637
|
-
|
|
33638
|
-
|
|
33639
|
-
result.nodes[0].attrs.name = node.attributes["w:name"];
|
|
33640
|
-
result.nodes[0].attrs.id = node.attributes["w:id"];
|
|
33805
|
+
const encoded = translator$8.encode({ ...params, nodes: [node] });
|
|
33806
|
+
if (!encoded) {
|
|
33807
|
+
return { nodes: [], consumed: 0 };
|
|
33641
33808
|
}
|
|
33642
|
-
return
|
|
33809
|
+
return { nodes: [encoded], consumed: 1 };
|
|
33643
33810
|
};
|
|
33644
33811
|
const handleBookmarkStartNode = (params) => {
|
|
33645
33812
|
const { nodes } = params;
|
|
@@ -34561,18 +34728,22 @@ const getInstructionPreProcessor = (instruction) => {
|
|
|
34561
34728
|
const preProcessNodesForFldChar = (nodes = [], docx) => {
|
|
34562
34729
|
const processedNodes = [];
|
|
34563
34730
|
let collectedNodesStack = [];
|
|
34731
|
+
let rawCollectedNodesStack = [];
|
|
34564
34732
|
let currentFieldStack = [];
|
|
34565
34733
|
let unpairedEnd = null;
|
|
34566
34734
|
let collecting = false;
|
|
34567
34735
|
const finalizeField = () => {
|
|
34568
34736
|
if (collecting) {
|
|
34569
34737
|
const collectedNodes = collectedNodesStack.pop().filter((n) => n !== null);
|
|
34738
|
+
const rawCollectedNodes = rawCollectedNodesStack.pop().filter((n) => n !== null);
|
|
34570
34739
|
const currentField = currentFieldStack.pop();
|
|
34571
|
-
const
|
|
34740
|
+
const combinedResult = _processCombinedNodesForFldChar(collectedNodes, currentField.instrText.trim(), docx);
|
|
34741
|
+
const outputNodes = combinedResult.handled ? combinedResult.nodes : rawCollectedNodes;
|
|
34572
34742
|
if (collectedNodesStack.length === 0) {
|
|
34573
|
-
processedNodes.push(...
|
|
34743
|
+
processedNodes.push(...outputNodes);
|
|
34574
34744
|
} else {
|
|
34575
|
-
collectedNodesStack[collectedNodesStack.length - 1].push(...
|
|
34745
|
+
collectedNodesStack[collectedNodesStack.length - 1].push(...outputNodes);
|
|
34746
|
+
rawCollectedNodesStack[rawCollectedNodesStack.length - 1].push(...outputNodes);
|
|
34576
34747
|
}
|
|
34577
34748
|
} else {
|
|
34578
34749
|
unpairedEnd = true;
|
|
@@ -34584,18 +34755,26 @@ const preProcessNodesForFldChar = (nodes = [], docx) => {
|
|
|
34584
34755
|
const instrTextEl = node.elements?.find((el) => el.name === "w:instrText");
|
|
34585
34756
|
collecting = collectedNodesStack.length > 0;
|
|
34586
34757
|
if (fldType === "begin") {
|
|
34587
|
-
collectedNodesStack.push([
|
|
34758
|
+
collectedNodesStack.push([]);
|
|
34759
|
+
rawCollectedNodesStack.push([node]);
|
|
34588
34760
|
currentFieldStack.push({ instrText: "" });
|
|
34589
34761
|
continue;
|
|
34590
34762
|
}
|
|
34591
34763
|
if (instrTextEl && collecting && currentFieldStack.length > 0) {
|
|
34764
|
+
rawCollectedNodesStack[rawCollectedNodesStack.length - 1].push(node);
|
|
34592
34765
|
currentFieldStack[currentFieldStack.length - 1].instrText += (instrTextEl.elements?.[0]?.text || "") + " ";
|
|
34593
34766
|
continue;
|
|
34594
34767
|
}
|
|
34595
34768
|
if (fldType === "end") {
|
|
34769
|
+
if (collecting) {
|
|
34770
|
+
rawCollectedNodesStack[rawCollectedNodesStack.length - 1].push(node);
|
|
34771
|
+
}
|
|
34596
34772
|
finalizeField();
|
|
34597
34773
|
continue;
|
|
34598
34774
|
} else if (fldType === "separate") {
|
|
34775
|
+
if (collecting) {
|
|
34776
|
+
rawCollectedNodesStack[rawCollectedNodesStack.length - 1].push(node);
|
|
34777
|
+
}
|
|
34599
34778
|
continue;
|
|
34600
34779
|
}
|
|
34601
34780
|
if (Array.isArray(node.elements)) {
|
|
@@ -34605,17 +34784,21 @@ const preProcessNodesForFldChar = (nodes = [], docx) => {
|
|
|
34605
34784
|
childResult.unpairedBegin.forEach((pendingField) => {
|
|
34606
34785
|
currentFieldStack.push(pendingField.fieldInfo);
|
|
34607
34786
|
collectedNodesStack.push([node]);
|
|
34787
|
+
rawCollectedNodesStack.push([node]);
|
|
34608
34788
|
});
|
|
34609
34789
|
} else if (childResult.unpairedEnd) {
|
|
34610
34790
|
collectedNodesStack[collectedNodesStack.length - 1].push(node);
|
|
34791
|
+
rawCollectedNodesStack[rawCollectedNodesStack.length - 1].push(node);
|
|
34611
34792
|
finalizeField();
|
|
34612
34793
|
} else if (collecting) {
|
|
34613
34794
|
collectedNodesStack[collectedNodesStack.length - 1].push(node);
|
|
34795
|
+
rawCollectedNodesStack[rawCollectedNodesStack.length - 1].push(node);
|
|
34614
34796
|
} else {
|
|
34615
34797
|
processedNodes.push(node);
|
|
34616
34798
|
}
|
|
34617
34799
|
} else if (collecting) {
|
|
34618
34800
|
collectedNodesStack[collectedNodesStack.length - 1].push(node);
|
|
34801
|
+
rawCollectedNodesStack[rawCollectedNodesStack.length - 1].push(node);
|
|
34619
34802
|
} else {
|
|
34620
34803
|
processedNodes.push(node);
|
|
34621
34804
|
}
|
|
@@ -34637,10 +34820,9 @@ const _processCombinedNodesForFldChar = (nodesToCombine = [], instrText, docx) =
|
|
|
34637
34820
|
const instructionType = instrText.trim().split(" ")[0];
|
|
34638
34821
|
const instructionPreProcessor = getInstructionPreProcessor(instructionType);
|
|
34639
34822
|
if (instructionPreProcessor) {
|
|
34640
|
-
return instructionPreProcessor(nodesToCombine, instrText, docx);
|
|
34641
|
-
} else {
|
|
34642
|
-
return nodesToCombine;
|
|
34823
|
+
return { nodes: instructionPreProcessor(nodesToCombine, instrText, docx), handled: true };
|
|
34643
34824
|
}
|
|
34825
|
+
return { nodes: nodesToCombine, handled: false };
|
|
34644
34826
|
};
|
|
34645
34827
|
const preProcessPageFieldsOnly = (nodes = []) => {
|
|
34646
34828
|
const processedNodes = [];
|
|
@@ -34715,6 +34897,14 @@ function scanFieldSequence(nodes, beginIndex) {
|
|
|
34715
34897
|
endIndex
|
|
34716
34898
|
};
|
|
34717
34899
|
}
|
|
34900
|
+
const commentRangeStartHandlerEntity = generateV2HandlerEntity(
|
|
34901
|
+
"commentRangeStartHandler",
|
|
34902
|
+
commentRangeStartTranslator
|
|
34903
|
+
);
|
|
34904
|
+
const commentRangeEndHandlerEntity = generateV2HandlerEntity(
|
|
34905
|
+
"commentRangeEndHandler",
|
|
34906
|
+
commentRangeEndTranslator
|
|
34907
|
+
);
|
|
34718
34908
|
const createDocumentJson = (docx, converter, editor) => {
|
|
34719
34909
|
const json = carbonCopy(getInitialJSON(docx));
|
|
34720
34910
|
if (!json) return null;
|
|
@@ -34776,6 +34966,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
34776
34966
|
path: []
|
|
34777
34967
|
});
|
|
34778
34968
|
parsedContent = filterOutRootInlineNodes(parsedContent);
|
|
34969
|
+
collapseWhitespaceNextToInlinePassthrough(parsedContent);
|
|
34779
34970
|
const result = {
|
|
34780
34971
|
type: "doc",
|
|
34781
34972
|
content: parsedContent,
|
|
@@ -34816,6 +35007,8 @@ const defaultNodeListHandler = () => {
|
|
|
34816
35007
|
bookmarkStartNodeHandlerEntity,
|
|
34817
35008
|
bookmarkEndNodeHandlerEntity,
|
|
34818
35009
|
hyperlinkNodeHandlerEntity,
|
|
35010
|
+
commentRangeStartHandlerEntity,
|
|
35011
|
+
commentRangeEndHandlerEntity,
|
|
34819
35012
|
drawingNodeHandlerEntity,
|
|
34820
35013
|
trackChangeNodeHandlerEntity,
|
|
34821
35014
|
tableNodeHandlerEntity,
|
|
@@ -34824,7 +35017,7 @@ const defaultNodeListHandler = () => {
|
|
|
34824
35017
|
autoPageHandlerEntity,
|
|
34825
35018
|
autoTotalPageCountEntity,
|
|
34826
35019
|
pageReferenceEntity,
|
|
34827
|
-
|
|
35020
|
+
passthroughNodeHandlerEntity
|
|
34828
35021
|
];
|
|
34829
35022
|
const handler2 = createNodeListHandler(entities);
|
|
34830
35023
|
return {
|
|
@@ -35111,8 +35304,8 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
35111
35304
|
editor.options.annotations = true;
|
|
35112
35305
|
headers.forEach((header) => {
|
|
35113
35306
|
const { rId, referenceFile, currentFileName } = getHeaderFooterSectionData(header, docx);
|
|
35114
|
-
const
|
|
35115
|
-
|
|
35307
|
+
const headerNodes = carbonCopy(referenceFile.elements[0].elements ?? []);
|
|
35308
|
+
const { processedNodes: headerProcessedNodes } = preProcessPageFieldsOnly(headerNodes);
|
|
35116
35309
|
const sectPrHeader = allSectPrElements.find(
|
|
35117
35310
|
(el) => el.name === "w:headerReference" && el.attributes["r:id"] === rId
|
|
35118
35311
|
);
|
|
@@ -35120,7 +35313,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
35120
35313
|
if (converter.headerIds[sectionType]) sectionType = null;
|
|
35121
35314
|
const nodeListHandler = defaultNodeListHandler();
|
|
35122
35315
|
let schema = nodeListHandler.handler({
|
|
35123
|
-
nodes:
|
|
35316
|
+
nodes: headerProcessedNodes,
|
|
35124
35317
|
nodeListHandler,
|
|
35125
35318
|
docx,
|
|
35126
35319
|
converter,
|
|
@@ -35141,15 +35334,15 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
35141
35334
|
if (titlePg) converter.headerIds.titlePg = true;
|
|
35142
35335
|
footers.forEach((footer) => {
|
|
35143
35336
|
const { rId, referenceFile, currentFileName } = getHeaderFooterSectionData(footer, docx);
|
|
35144
|
-
const
|
|
35145
|
-
|
|
35337
|
+
const footerNodes = carbonCopy(referenceFile.elements[0].elements ?? []);
|
|
35338
|
+
const { processedNodes: footerProcessedNodes } = preProcessPageFieldsOnly(footerNodes);
|
|
35146
35339
|
const sectPrFooter = allSectPrElements.find(
|
|
35147
35340
|
(el) => el.name === "w:footerReference" && el.attributes["r:id"] === rId
|
|
35148
35341
|
);
|
|
35149
35342
|
const sectionType = sectPrFooter?.attributes["w:type"];
|
|
35150
35343
|
const nodeListHandler = defaultNodeListHandler();
|
|
35151
35344
|
let schema = nodeListHandler.handler({
|
|
35152
|
-
nodes:
|
|
35345
|
+
nodes: footerProcessedNodes,
|
|
35153
35346
|
nodeListHandler,
|
|
35154
35347
|
docx,
|
|
35155
35348
|
converter,
|
|
@@ -35212,6 +35405,51 @@ function filterOutRootInlineNodes(content = []) {
|
|
|
35212
35405
|
]);
|
|
35213
35406
|
return content.filter((node) => node && typeof node.type === "string" && !INLINE_TYPES.has(node.type));
|
|
35214
35407
|
}
|
|
35408
|
+
function collapseWhitespaceNextToInlinePassthrough(content = []) {
|
|
35409
|
+
if (!Array.isArray(content) || content.length === 0) return;
|
|
35410
|
+
const sequence = collectInlineSequence(content);
|
|
35411
|
+
sequence.forEach((entry, index2) => {
|
|
35412
|
+
if (entry.kind !== "passthrough") return;
|
|
35413
|
+
const prev = findNeighborText(sequence, index2, -1);
|
|
35414
|
+
const next = findNeighborText(sequence, index2, 1);
|
|
35415
|
+
if (!prev || !next) return;
|
|
35416
|
+
if (!prev.node.text.endsWith(" ") || !next.node.text.startsWith(" ")) return;
|
|
35417
|
+
prev.node.text = prev.node.text.replace(/ +$/, " ");
|
|
35418
|
+
next.node.text = next.node.text.replace(/^ +/, "");
|
|
35419
|
+
if (next.node.text.length === 0) {
|
|
35420
|
+
next.parent.splice(next.index, 1);
|
|
35421
|
+
}
|
|
35422
|
+
});
|
|
35423
|
+
}
|
|
35424
|
+
function collectInlineSequence(nodes, result = [], insidePassthrough = false) {
|
|
35425
|
+
if (!Array.isArray(nodes) || nodes.length === 0) return result;
|
|
35426
|
+
nodes.forEach((node, index2) => {
|
|
35427
|
+
if (!node) return;
|
|
35428
|
+
const isPassthrough = node.type === "passthroughInline";
|
|
35429
|
+
if (isPassthrough && !insidePassthrough) {
|
|
35430
|
+
result.push({ kind: "passthrough", parent: nodes, index: index2 });
|
|
35431
|
+
}
|
|
35432
|
+
if (node.type === "text" && typeof node.text === "string" && !insidePassthrough) {
|
|
35433
|
+
result.push({ kind: "text", node, parent: nodes, index: index2 });
|
|
35434
|
+
}
|
|
35435
|
+
if (Array.isArray(node.content) && node.content.length) {
|
|
35436
|
+
const nextInside = insidePassthrough || isPassthrough;
|
|
35437
|
+
collectInlineSequence(node.content, result, nextInside);
|
|
35438
|
+
}
|
|
35439
|
+
});
|
|
35440
|
+
return result;
|
|
35441
|
+
}
|
|
35442
|
+
function findNeighborText(sequence, startIndex, direction) {
|
|
35443
|
+
let cursor = startIndex + direction;
|
|
35444
|
+
while (cursor >= 0 && cursor < sequence.length) {
|
|
35445
|
+
const entry = sequence[cursor];
|
|
35446
|
+
if (entry.kind === "text") {
|
|
35447
|
+
return entry;
|
|
35448
|
+
}
|
|
35449
|
+
cursor += direction;
|
|
35450
|
+
}
|
|
35451
|
+
return null;
|
|
35452
|
+
}
|
|
35215
35453
|
function getThemeColorPalette(docx) {
|
|
35216
35454
|
const themePart = docx?.["word/theme/theme1.xml"];
|
|
35217
35455
|
if (!themePart || !Array.isArray(themePart.elements)) return void 0;
|
|
@@ -35574,7 +35812,9 @@ function exportSchemaToJson(params) {
|
|
|
35574
35812
|
"page-number": translator$4,
|
|
35575
35813
|
"total-page-number": translator$3,
|
|
35576
35814
|
pageReference: translator$6,
|
|
35577
|
-
tableOfContents: translator$5
|
|
35815
|
+
tableOfContents: translator$5,
|
|
35816
|
+
passthroughBlock: translatePassthroughNode,
|
|
35817
|
+
passthroughInline: translatePassthroughNode
|
|
35578
35818
|
};
|
|
35579
35819
|
let handler2 = router[type2];
|
|
35580
35820
|
if (handler2 && "decode" in handler2 && typeof handler2.decode === "function") {
|
|
@@ -35586,6 +35826,11 @@ function exportSchemaToJson(params) {
|
|
|
35586
35826
|
}
|
|
35587
35827
|
return handler2(params);
|
|
35588
35828
|
}
|
|
35829
|
+
function translatePassthroughNode(params) {
|
|
35830
|
+
const original = params?.node?.attrs?.originalXml;
|
|
35831
|
+
if (!original) return null;
|
|
35832
|
+
return carbonCopy(original);
|
|
35833
|
+
}
|
|
35589
35834
|
function translateBodyNode(params) {
|
|
35590
35835
|
let sectPr = params.bodyNode?.elements?.find((n) => n.name === "w:sectPr");
|
|
35591
35836
|
if (!sectPr) {
|
|
@@ -36285,7 +36530,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
36285
36530
|
static getStoredSuperdocVersion(docx) {
|
|
36286
36531
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
36287
36532
|
}
|
|
36288
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.
|
|
36533
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.15") {
|
|
36289
36534
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
36290
36535
|
}
|
|
36291
36536
|
/**
|
|
@@ -36899,7 +37144,6 @@ export {
|
|
|
36899
37144
|
inputRulesPlugin as Z,
|
|
36900
37145
|
TrackDeleteMarkName as _,
|
|
36901
37146
|
Plugin as a,
|
|
36902
|
-
translator$L as a$,
|
|
36903
37147
|
v4 as a0,
|
|
36904
37148
|
TrackFormatMarkName as a1,
|
|
36905
37149
|
comments_module_events as a2,
|
|
@@ -36925,18 +37169,7 @@ export {
|
|
|
36925
37169
|
vClickOutside as aM,
|
|
36926
37170
|
getActiveFormatting as aN,
|
|
36927
37171
|
getFileObject as aO,
|
|
36928
|
-
|
|
36929
|
-
translator$N as aQ,
|
|
36930
|
-
translator$P as aR,
|
|
36931
|
-
translator$I as aS,
|
|
36932
|
-
translator$J as aT,
|
|
36933
|
-
translator$Q as aU,
|
|
36934
|
-
translator$R as aV,
|
|
36935
|
-
translator$17 as aW,
|
|
36936
|
-
translator$K as aX,
|
|
36937
|
-
translator$_ as aY,
|
|
36938
|
-
translator$M as aZ,
|
|
36939
|
-
translator$O as a_,
|
|
37172
|
+
registeredHandlers as aP,
|
|
36940
37173
|
posToDOMRect as aa,
|
|
36941
37174
|
CommandService as ab,
|
|
36942
37175
|
SuperConverter as ac,
|
|
@@ -36964,80 +37197,7 @@ export {
|
|
|
36964
37197
|
convertSizeToCSS as ay,
|
|
36965
37198
|
SelectionRange as az,
|
|
36966
37199
|
Slice as b,
|
|
36967
|
-
translator$23 as b$,
|
|
36968
|
-
translator$Z as b0,
|
|
36969
|
-
translator$Y as b1,
|
|
36970
|
-
commentRangeEndTranslator as b2,
|
|
36971
|
-
commentRangeStartTranslator as b3,
|
|
36972
|
-
translator$t as b4,
|
|
36973
|
-
translator$u as b5,
|
|
36974
|
-
translator$x as b6,
|
|
36975
|
-
translator$y as b7,
|
|
36976
|
-
translator$1Z as b8,
|
|
36977
|
-
translator$w as b9,
|
|
36978
|
-
translator$T as bA,
|
|
36979
|
-
translator$1Q as bB,
|
|
36980
|
-
translator$r as bC,
|
|
36981
|
-
translator$1l as bD,
|
|
36982
|
-
translator$1U as bE,
|
|
36983
|
-
translator$1N as bF,
|
|
36984
|
-
translator$1V as bG,
|
|
36985
|
-
translator$$ as bH,
|
|
36986
|
-
translator$11 as bI,
|
|
36987
|
-
translator$1n as bJ,
|
|
36988
|
-
translator$1C as bK,
|
|
36989
|
-
translator$U as bL,
|
|
36990
|
-
translator$V as bM,
|
|
36991
|
-
translator$1_ as bN,
|
|
36992
|
-
translator$10 as bO,
|
|
36993
|
-
translator$22 as bP,
|
|
36994
|
-
translator$C as bQ,
|
|
36995
|
-
translator$b as bR,
|
|
36996
|
-
translator$D as bS,
|
|
36997
|
-
translator$E as bT,
|
|
36998
|
-
translator$X as bU,
|
|
36999
|
-
translator$s as bV,
|
|
37000
|
-
translator$1F as bW,
|
|
37001
|
-
translator$1W as bX,
|
|
37002
|
-
translator$1H as bY,
|
|
37003
|
-
translator$1R as bZ,
|
|
37004
|
-
translator$F as b_,
|
|
37005
|
-
translator$z as ba,
|
|
37006
|
-
translator$v as bb,
|
|
37007
|
-
translator$1j as bc,
|
|
37008
|
-
translator$G as bd,
|
|
37009
|
-
translator$f as be,
|
|
37010
|
-
translator$g as bf,
|
|
37011
|
-
translator$h as bg,
|
|
37012
|
-
translator$i as bh,
|
|
37013
|
-
translator$j as bi,
|
|
37014
|
-
translator$c as bj,
|
|
37015
|
-
translator$k as bk,
|
|
37016
|
-
translator$l as bl,
|
|
37017
|
-
translator$m as bm,
|
|
37018
|
-
translator$n as bn,
|
|
37019
|
-
translator$A as bo,
|
|
37020
|
-
translator$a as bp,
|
|
37021
|
-
translator$o as bq,
|
|
37022
|
-
translator$B as br,
|
|
37023
|
-
translator$d as bs,
|
|
37024
|
-
translator$p as bt,
|
|
37025
|
-
translator$e as bu,
|
|
37026
|
-
translator$9 as bv,
|
|
37027
|
-
translator$21 as bw,
|
|
37028
|
-
translator$1S as bx,
|
|
37029
|
-
translator$1T as by,
|
|
37030
|
-
translator$1Y as bz,
|
|
37031
37200
|
DOMParser$1 as c,
|
|
37032
|
-
translator$1p as c0,
|
|
37033
|
-
translator$8 as c1,
|
|
37034
|
-
translator$7 as c2,
|
|
37035
|
-
translator$q as c3,
|
|
37036
|
-
translator$1$ as c4,
|
|
37037
|
-
translator$20 as c5,
|
|
37038
|
-
translator$5 as c6,
|
|
37039
|
-
translator$6 as c7,
|
|
37040
|
-
translator$1M as c8,
|
|
37041
37201
|
Mark as d,
|
|
37042
37202
|
dropPoint as e,
|
|
37043
37203
|
callOrGet as f,
|