@harbour-enterprises/superdoc 1.0.0-beta.54 → 1.0.0-beta.56
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-qBKjClah.cjs → PdfViewer-CnvD--7P.cjs} +1 -1
- package/dist/chunks/{PdfViewer-D_U-y4Wi.es.js → PdfViewer-DsYaXp0H.es.js} +1 -1
- package/dist/chunks/{index-BKvAeQdF.cjs → index-BpBdSm3V.cjs} +3 -3
- package/dist/chunks/{index-to6_YLa7.es.js → index-DF1aQt8V.es.js} +3 -3
- package/dist/chunks/{index-t8thQIOL-vW80ABaR.es.js → index-DYnUncjo-Br0s3gQs.es.js} +1 -1
- package/dist/chunks/{index-t8thQIOL-CV8VTGI4.cjs → index-DYnUncjo-Uv8YzgRb.cjs} +1 -1
- package/dist/chunks/{super-editor.es-xpC1DWhM.es.js → super-editor.es-BxMwj135.es.js} +524 -190
- package/dist/chunks/{super-editor.es-BMiadG4G.cjs → super-editor.es-DkFw0sfq.cjs} +524 -190
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-OoT4LYwQ.js → converter-DwC5XPQX.js} +274 -171
- package/dist/super-editor/chunks/{docx-zipper-Cf_hIcjC.js → docx-zipper-BkCzC50U.js} +1 -1
- package/dist/super-editor/chunks/{editor-CqbtudGQ.js → editor-CoKNeouN.js} +255 -24
- package/dist/super-editor/chunks/{index-t8thQIOL.js → index-DYnUncjo.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-BsfRAJ0o.js → toolbar-DUWk-Bwi.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/super-editor.es.js +6 -6
- 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 +526 -192
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/superdoc.umd.js
CHANGED
|
@@ -18081,7 +18081,7 @@
|
|
|
18081
18081
|
decode: decode$R,
|
|
18082
18082
|
attributes: validXmlAttributes$h
|
|
18083
18083
|
};
|
|
18084
|
-
const translator$
|
|
18084
|
+
const translator$2p = NodeTranslator.from(config$p);
|
|
18085
18085
|
const encode$O = (attributes) => attributes?.["w:val"];
|
|
18086
18086
|
const decode$Q = (attrs) => attrs?.highlight;
|
|
18087
18087
|
const attrConfig$q = Object.freeze({
|
|
@@ -18143,7 +18143,7 @@
|
|
|
18143
18143
|
decode: decode$P,
|
|
18144
18144
|
attributes: validXmlAttributes$g
|
|
18145
18145
|
};
|
|
18146
|
-
const translator$
|
|
18146
|
+
const translator$2o = NodeTranslator.from(config$o);
|
|
18147
18147
|
const encode$M = (attributes) => {
|
|
18148
18148
|
return attributes["w:val"];
|
|
18149
18149
|
};
|
|
@@ -18222,7 +18222,7 @@
|
|
|
18222
18222
|
decode: decode$L,
|
|
18223
18223
|
attributes: validXmlAttributes$f
|
|
18224
18224
|
};
|
|
18225
|
-
const translator$
|
|
18225
|
+
const translator$2n = NodeTranslator.from(config$n);
|
|
18226
18226
|
const carbonCopy = (obj) => {
|
|
18227
18227
|
if (!obj) return void 0;
|
|
18228
18228
|
try {
|
|
@@ -18363,7 +18363,7 @@
|
|
|
18363
18363
|
"color",
|
|
18364
18364
|
(v2) => {
|
|
18365
18365
|
if (v2 === "auto") {
|
|
18366
|
-
return
|
|
18366
|
+
return "auto";
|
|
18367
18367
|
} else if (v2) {
|
|
18368
18368
|
return `#${v2}`;
|
|
18369
18369
|
} else {
|
|
@@ -18548,9 +18548,10 @@
|
|
|
18548
18548
|
const intValue = parseInteger(value);
|
|
18549
18549
|
return intValue != void 0 ? String(intValue) : void 0;
|
|
18550
18550
|
};
|
|
18551
|
-
const translator$
|
|
18552
|
-
const translator$
|
|
18553
|
-
const translator$
|
|
18551
|
+
const translator$2m = NodeTranslator.from(createSingleBooleanPropertyHandler("w:b", "bold"));
|
|
18552
|
+
const translator$2l = NodeTranslator.from(createSingleBooleanPropertyHandler("w:bCs", "boldCs"));
|
|
18553
|
+
const translator$2k = NodeTranslator.from(createBorderPropertyHandler("w:bdr", "borders"));
|
|
18554
|
+
const translator$2j = NodeTranslator.from(createSingleBooleanPropertyHandler("w:i", "italic"));
|
|
18554
18555
|
const encode$I = (attributes) => attributes?.["w:val"];
|
|
18555
18556
|
const decode$K = (attrs) => attrs?.underline;
|
|
18556
18557
|
const attrConfig$m = Object.freeze({
|
|
@@ -18645,10 +18646,10 @@
|
|
|
18645
18646
|
decode: decode$F,
|
|
18646
18647
|
attributes: validXmlAttributes$e
|
|
18647
18648
|
};
|
|
18648
|
-
const translator$
|
|
18649
|
-
const translator$
|
|
18650
|
-
const translator$
|
|
18651
|
-
const translator$
|
|
18649
|
+
const translator$2i = NodeTranslator.from(config$m);
|
|
18650
|
+
const translator$2h = NodeTranslator.from(createSingleBooleanPropertyHandler("w:strike"));
|
|
18651
|
+
const translator$2g = NodeTranslator.from(createSingleBooleanPropertyHandler("w:dstrike"));
|
|
18652
|
+
const translator$2f = NodeTranslator.from({
|
|
18652
18653
|
xmlName: "w:color",
|
|
18653
18654
|
sdNodeOrKeyName: "color",
|
|
18654
18655
|
attributes: [
|
|
@@ -18665,7 +18666,7 @@
|
|
|
18665
18666
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18666
18667
|
}
|
|
18667
18668
|
});
|
|
18668
|
-
const translator$
|
|
18669
|
+
const translator$2e = NodeTranslator.from({
|
|
18669
18670
|
xmlName: "w:rFonts",
|
|
18670
18671
|
sdNodeOrKeyName: "fontFamily",
|
|
18671
18672
|
attributes: [
|
|
@@ -18696,16 +18697,16 @@
|
|
|
18696
18697
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18697
18698
|
}
|
|
18698
18699
|
});
|
|
18699
|
-
const translator$
|
|
18700
|
-
const translator$
|
|
18701
|
-
const translator$
|
|
18702
|
-
const translator$
|
|
18700
|
+
const translator$2d = NodeTranslator.from(createSingleAttrPropertyHandler("w:rStyle", "styleId"));
|
|
18701
|
+
const translator$2c = NodeTranslator.from(createSingleIntegerPropertyHandler("w:sz", "fontSize"));
|
|
18702
|
+
const translator$2b = NodeTranslator.from(createSingleIntegerPropertyHandler("w:szCs", "fontSizeCs"));
|
|
18703
|
+
const translator$2a = NodeTranslator.from({
|
|
18703
18704
|
xmlName: "w:caps",
|
|
18704
18705
|
sdNodeOrKeyName: "textTransform",
|
|
18705
18706
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1") ? "uppercase" : "none",
|
|
18706
18707
|
decode: ({ node: node2 }) => node2.attrs["textTransform"] != null ? { name: "w:caps", attributes: { "w:val": booleanToString(node2.attrs["textTransform"] === "uppercase") } } : void 0
|
|
18707
18708
|
});
|
|
18708
|
-
const translator$
|
|
18709
|
+
const translator$29 = NodeTranslator.from({
|
|
18709
18710
|
xmlName: "w:shd",
|
|
18710
18711
|
sdNodeOrKeyName: "shading",
|
|
18711
18712
|
attributes: [
|
|
@@ -18727,7 +18728,7 @@
|
|
|
18727
18728
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18728
18729
|
}
|
|
18729
18730
|
});
|
|
18730
|
-
const translator$
|
|
18731
|
+
const translator$28 = NodeTranslator.from({
|
|
18731
18732
|
xmlName: "w:lang",
|
|
18732
18733
|
sdNodeOrKeyName: "lang",
|
|
18733
18734
|
attributes: [createAttributeHandler("w:val"), createAttributeHandler("w:eastAsia"), createAttributeHandler("w:bidi")],
|
|
@@ -18739,26 +18740,99 @@
|
|
|
18739
18740
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18740
18741
|
}
|
|
18741
18742
|
});
|
|
18742
|
-
const translator$
|
|
18743
|
+
const translator$27 = NodeTranslator.from(createSingleIntegerPropertyHandler("w:spacing", "letterSpacing"));
|
|
18744
|
+
const translator$26 = NodeTranslator.from(createSingleAttrPropertyHandler("w:vertAlign"));
|
|
18745
|
+
const translator$25 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:smallCaps"));
|
|
18746
|
+
const translator$24 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:snapToGrid"));
|
|
18747
|
+
const translator$23 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:emboss"));
|
|
18748
|
+
const translator$22 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:imprint"));
|
|
18749
|
+
const translator$21 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:noProof"));
|
|
18750
|
+
const translator$20 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:oMath"));
|
|
18751
|
+
const translator$1$ = NodeTranslator.from(createSingleBooleanPropertyHandler("w:outline"));
|
|
18752
|
+
const translator$1_ = NodeTranslator.from(createSingleBooleanPropertyHandler("w:shadow"));
|
|
18753
|
+
const translator$1Z = NodeTranslator.from(createSingleBooleanPropertyHandler("w:vanish"));
|
|
18754
|
+
const translator$1Y = NodeTranslator.from(createSingleBooleanPropertyHandler("w:specVanish"));
|
|
18755
|
+
const translator$1X = NodeTranslator.from(createSingleAttrPropertyHandler("w:effect"));
|
|
18756
|
+
const translator$1W = NodeTranslator.from(createSingleAttrPropertyHandler("w:em"));
|
|
18757
|
+
const translator$1V = NodeTranslator.from(createSingleAttrPropertyHandler("w:w"));
|
|
18758
|
+
const translator$1U = NodeTranslator.from(createSingleIntegerPropertyHandler("w:kern"));
|
|
18759
|
+
const translator$1T = NodeTranslator.from(createSingleIntegerPropertyHandler("w:position"));
|
|
18760
|
+
const translator$1S = NodeTranslator.from({
|
|
18761
|
+
xmlName: "w:fitText",
|
|
18762
|
+
sdNodeOrKeyName: "fitText",
|
|
18763
|
+
attributes: [createIntegerAttributeHandler("w:val"), createIntegerAttributeHandler("w:id")],
|
|
18764
|
+
encode: (_2, encodedAttrs) => {
|
|
18765
|
+
return encodedAttrs;
|
|
18766
|
+
},
|
|
18767
|
+
decode: function({ node: node2 }) {
|
|
18768
|
+
const decodedAttrs = this.decodeAttributes({ node: { ...node2, attrs: node2.attrs["fitText"] || {} } });
|
|
18769
|
+
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18770
|
+
}
|
|
18771
|
+
});
|
|
18772
|
+
const translator$1R = NodeTranslator.from({
|
|
18773
|
+
xmlName: "w:eastAsianLayout",
|
|
18774
|
+
sdNodeOrKeyName: "eastAsianLayout",
|
|
18775
|
+
attributes: [
|
|
18776
|
+
createIntegerAttributeHandler("w:id"),
|
|
18777
|
+
createBooleanAttributeHandler("w:combine"),
|
|
18778
|
+
createAttributeHandler("w:combineBrackets"),
|
|
18779
|
+
createBooleanAttributeHandler("w:vert"),
|
|
18780
|
+
createBooleanAttributeHandler("w:vertCompress")
|
|
18781
|
+
],
|
|
18782
|
+
encode: (_2, encodedAttrs) => {
|
|
18783
|
+
return encodedAttrs;
|
|
18784
|
+
},
|
|
18785
|
+
decode: function({ node: node2 }) {
|
|
18786
|
+
const decodedAttrs = this.decodeAttributes({ node: { ...node2, attrs: node2.attrs["eastAsianLayout"] || {} } });
|
|
18787
|
+
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18788
|
+
}
|
|
18789
|
+
});
|
|
18790
|
+
const translator$1Q = NodeTranslator.from(createSingleBooleanPropertyHandler("w:rtl"));
|
|
18791
|
+
const translator$1P = NodeTranslator.from(createSingleBooleanPropertyHandler("w:cs"));
|
|
18792
|
+
const translator$1O = NodeTranslator.from(createSingleBooleanPropertyHandler("w:iCs"));
|
|
18793
|
+
const translator$1N = NodeTranslator.from(createSingleBooleanPropertyHandler("w:webHidden"));
|
|
18743
18794
|
const propertyTranslators$b = [
|
|
18744
|
-
translator$
|
|
18745
|
-
translator$
|
|
18746
|
-
translator$
|
|
18747
|
-
translator$
|
|
18748
|
-
translator$
|
|
18795
|
+
translator$2l,
|
|
18796
|
+
translator$2m,
|
|
18797
|
+
translator$2k,
|
|
18798
|
+
translator$2a,
|
|
18799
|
+
translator$2f,
|
|
18800
|
+
translator$1P,
|
|
18801
|
+
translator$2g,
|
|
18802
|
+
translator$1R,
|
|
18749
18803
|
translator$1X,
|
|
18750
18804
|
translator$1W,
|
|
18805
|
+
translator$23,
|
|
18806
|
+
translator$1S,
|
|
18807
|
+
translator$2e,
|
|
18808
|
+
translator$2b,
|
|
18809
|
+
translator$2c,
|
|
18810
|
+
translator$2o,
|
|
18751
18811
|
translator$22,
|
|
18752
|
-
translator$
|
|
18812
|
+
translator$2j,
|
|
18813
|
+
translator$1O,
|
|
18753
18814
|
translator$1U,
|
|
18815
|
+
translator$28,
|
|
18816
|
+
translator$27,
|
|
18817
|
+
translator$21,
|
|
18818
|
+
translator$20,
|
|
18819
|
+
translator$1$,
|
|
18754
18820
|
translator$1T,
|
|
18755
|
-
translator$1S,
|
|
18756
|
-
translator$1R,
|
|
18757
18821
|
translator$1Q,
|
|
18758
|
-
translator$
|
|
18759
|
-
translator$
|
|
18822
|
+
translator$2d,
|
|
18823
|
+
translator$1_,
|
|
18824
|
+
translator$29,
|
|
18825
|
+
translator$25,
|
|
18826
|
+
translator$24,
|
|
18827
|
+
translator$1Y,
|
|
18828
|
+
translator$2h,
|
|
18829
|
+
translator$2i,
|
|
18830
|
+
translator$1Z,
|
|
18831
|
+
translator$26,
|
|
18832
|
+
translator$1N,
|
|
18833
|
+
translator$1V
|
|
18760
18834
|
];
|
|
18761
|
-
const translator$
|
|
18835
|
+
const translator$1M = NodeTranslator.from(
|
|
18762
18836
|
createNestedPropertiesTranslator("w:rPr", "runProperties", propertyTranslators$b)
|
|
18763
18837
|
);
|
|
18764
18838
|
const SUPPORTED_ALTERNATE_CONTENT_REQUIRES = /* @__PURE__ */ new Set([
|
|
@@ -18840,18 +18914,18 @@
|
|
|
18840
18914
|
elements: carbonCopy(selectedElements)
|
|
18841
18915
|
};
|
|
18842
18916
|
}
|
|
18843
|
-
const translator$
|
|
18917
|
+
const translator$1L = NodeTranslator.from(config$l);
|
|
18844
18918
|
function buildPath(existingPath = [], node2, branch) {
|
|
18845
18919
|
const path2 = [...existingPath];
|
|
18846
18920
|
if (node2) path2.push(node2);
|
|
18847
18921
|
if (branch) path2.push(branch);
|
|
18848
18922
|
return path2;
|
|
18849
18923
|
}
|
|
18850
|
-
const translator$
|
|
18851
|
-
const translator$
|
|
18852
|
-
const translator$
|
|
18853
|
-
const translator$
|
|
18854
|
-
const translator$
|
|
18924
|
+
const translator$1K = NodeTranslator.from(createSingleBooleanPropertyHandler("w:adjustRightInd"));
|
|
18925
|
+
const translator$1J = NodeTranslator.from(createSingleBooleanPropertyHandler("w:autoSpaceDE"));
|
|
18926
|
+
const translator$1I = NodeTranslator.from(createSingleBooleanPropertyHandler("w:autoSpaceDN"));
|
|
18927
|
+
const translator$1H = NodeTranslator.from(createSingleBooleanPropertyHandler("w:bidi", "rightToLeft"));
|
|
18928
|
+
const translator$1G = NodeTranslator.from({
|
|
18855
18929
|
xmlName: "w:cnfStyle",
|
|
18856
18930
|
sdNodeOrKeyName: "cnfStyle",
|
|
18857
18931
|
attributes: [
|
|
@@ -18877,9 +18951,9 @@
|
|
|
18877
18951
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18878
18952
|
}
|
|
18879
18953
|
});
|
|
18880
|
-
const translator$
|
|
18881
|
-
const translator$
|
|
18882
|
-
const translator$
|
|
18954
|
+
const translator$1F = NodeTranslator.from(createSingleBooleanPropertyHandler("w:contextualSpacing"));
|
|
18955
|
+
const translator$1E = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
|
|
18956
|
+
const translator$1D = NodeTranslator.from({
|
|
18883
18957
|
xmlName: "w:framePr",
|
|
18884
18958
|
sdNodeOrKeyName: "framePr",
|
|
18885
18959
|
attributes: [
|
|
@@ -18907,7 +18981,7 @@
|
|
|
18907
18981
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18908
18982
|
}
|
|
18909
18983
|
});
|
|
18910
|
-
const translator$
|
|
18984
|
+
const translator$1C = NodeTranslator.from({
|
|
18911
18985
|
xmlName: "w:ind",
|
|
18912
18986
|
sdNodeOrKeyName: "indent",
|
|
18913
18987
|
attributes: [
|
|
@@ -18932,12 +19006,12 @@
|
|
|
18932
19006
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18933
19007
|
}
|
|
18934
19008
|
});
|
|
18935
|
-
const translator$
|
|
18936
|
-
const translator$
|
|
18937
|
-
const translator$
|
|
18938
|
-
const translator$
|
|
18939
|
-
const translator$
|
|
18940
|
-
const translator$
|
|
19009
|
+
const translator$1B = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
|
|
19010
|
+
const translator$1A = NodeTranslator.from(createSingleBooleanPropertyHandler("w:keepLines"));
|
|
19011
|
+
const translator$1z = NodeTranslator.from(createSingleBooleanPropertyHandler("w:keepNext"));
|
|
19012
|
+
const translator$1y = NodeTranslator.from(createSingleBooleanPropertyHandler("w:kinsoku"));
|
|
19013
|
+
const translator$1x = NodeTranslator.from(createSingleBooleanPropertyHandler("w:mirrorIndents"));
|
|
19014
|
+
const translator$1w = NodeTranslator.from(createSingleIntegerPropertyHandler("w:ilvl"));
|
|
18941
19015
|
const createTrackStyleMark = (marks) => {
|
|
18942
19016
|
const trackStyleMark = marks.find((mark2) => mark2.type === "trackFormat");
|
|
18943
19017
|
if (trackStyleMark) {
|
|
@@ -19019,41 +19093,40 @@
|
|
|
19019
19093
|
decode: decode$D,
|
|
19020
19094
|
attributes: validXmlAttributes$c
|
|
19021
19095
|
};
|
|
19022
|
-
const translator$
|
|
19023
|
-
const translator$
|
|
19024
|
-
const propertyTranslators$a = [translator$
|
|
19025
|
-
const translator$
|
|
19096
|
+
const translator$1v = NodeTranslator.from(config$k);
|
|
19097
|
+
const translator$1u = NodeTranslator.from(createSingleIntegerPropertyHandler("w:numId"));
|
|
19098
|
+
const propertyTranslators$a = [translator$1L, translator$1w, translator$1v, translator$1u];
|
|
19099
|
+
const translator$1t = NodeTranslator.from(
|
|
19026
19100
|
createNestedPropertiesTranslator("w:numPr", "numberingProperties", propertyTranslators$a)
|
|
19027
19101
|
);
|
|
19028
|
-
const translator$
|
|
19102
|
+
const translator$1s = NodeTranslator.from(
|
|
19029
19103
|
createSingleAttrPropertyHandler("w:outlineLvl", "outlineLvl", "w:val", parseInteger, integerToString)
|
|
19030
19104
|
);
|
|
19031
|
-
const translator$
|
|
19032
|
-
const translator$
|
|
19033
|
-
const translator$
|
|
19034
|
-
const translator$
|
|
19035
|
-
const translator$
|
|
19036
|
-
const translator$
|
|
19037
|
-
const translator$
|
|
19038
|
-
const translator$
|
|
19039
|
-
const translator$
|
|
19040
|
-
const translator$
|
|
19041
|
-
const translator$
|
|
19105
|
+
const translator$1r = NodeTranslator.from(createSingleBooleanPropertyHandler("w:overflowPunct"));
|
|
19106
|
+
const translator$1q = NodeTranslator.from(createBorderPropertyHandler("w:bar"));
|
|
19107
|
+
const translator$1p = NodeTranslator.from(createBorderPropertyHandler("w:between"));
|
|
19108
|
+
const translator$1o = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
|
|
19109
|
+
const translator$1n = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
|
|
19110
|
+
const translator$1m = NodeTranslator.from(createBorderPropertyHandler("w:left"));
|
|
19111
|
+
const translator$1l = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
|
|
19112
|
+
const translator$1k = NodeTranslator.from(createBorderPropertyHandler("w:right"));
|
|
19113
|
+
const translator$1j = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
|
|
19114
|
+
const translator$1i = NodeTranslator.from(createBorderPropertyHandler("w:top"));
|
|
19115
|
+
const translator$1h = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
|
|
19042
19116
|
const propertyTranslators$9 = [
|
|
19043
|
-
translator$
|
|
19044
|
-
translator$1r,
|
|
19117
|
+
translator$1L,
|
|
19045
19118
|
translator$1q,
|
|
19046
19119
|
translator$1p,
|
|
19047
|
-
translator$
|
|
19048
|
-
translator$
|
|
19049
|
-
translator$
|
|
19120
|
+
translator$1o,
|
|
19121
|
+
translator$1m,
|
|
19122
|
+
translator$1k,
|
|
19123
|
+
translator$1i
|
|
19050
19124
|
];
|
|
19051
|
-
const translator$
|
|
19125
|
+
const translator$1g = NodeTranslator.from(
|
|
19052
19126
|
createNestedPropertiesTranslator("w:pBdr", "borders", propertyTranslators$9)
|
|
19053
19127
|
);
|
|
19054
|
-
const translator$
|
|
19055
|
-
const translator$
|
|
19056
|
-
const translator$1e = NodeTranslator.from(createSingleBooleanPropertyHandler("w:snapToGrid"));
|
|
19128
|
+
const translator$1f = NodeTranslator.from(createSingleAttrPropertyHandler("w:pStyle", "styleId"));
|
|
19129
|
+
const translator$1e = NodeTranslator.from(createSingleBooleanPropertyHandler("w:pageBreakBefore"));
|
|
19057
19130
|
const translator$1d = NodeTranslator.from({
|
|
19058
19131
|
xmlName: "w:spacing",
|
|
19059
19132
|
sdNodeOrKeyName: "spacing",
|
|
@@ -19078,7 +19151,7 @@
|
|
|
19078
19151
|
const translator$1c = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressAutoHyphens"));
|
|
19079
19152
|
const translator$1b = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressLineNumbers"));
|
|
19080
19153
|
const translator$1a = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressOverlap"));
|
|
19081
|
-
const propertyTranslators$8 = [translator$
|
|
19154
|
+
const propertyTranslators$8 = [translator$1L, translator$2n];
|
|
19082
19155
|
const translator$19 = NodeTranslator.from(
|
|
19083
19156
|
createNestedArrayPropertyHandler("w:tabs", "tabStops", propertyTranslators$8, { skipRun: true })
|
|
19084
19157
|
);
|
|
@@ -19089,7 +19162,6 @@
|
|
|
19089
19162
|
const translator$14 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:widowControl"));
|
|
19090
19163
|
const translator$13 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:wordWrap"));
|
|
19091
19164
|
const propertyTranslators$7 = [
|
|
19092
|
-
translator$1M,
|
|
19093
19165
|
translator$1L,
|
|
19094
19166
|
translator$1K,
|
|
19095
19167
|
translator$1J,
|
|
@@ -19104,14 +19176,15 @@
|
|
|
19104
19176
|
translator$1A,
|
|
19105
19177
|
translator$1z,
|
|
19106
19178
|
translator$1y,
|
|
19107
|
-
translator$
|
|
19179
|
+
translator$1x,
|
|
19108
19180
|
translator$1t,
|
|
19109
19181
|
translator$1s,
|
|
19110
|
-
translator$
|
|
19182
|
+
translator$1r,
|
|
19111
19183
|
translator$1g,
|
|
19112
19184
|
translator$1f,
|
|
19113
|
-
translator$1Q,
|
|
19114
19185
|
translator$1e,
|
|
19186
|
+
translator$29,
|
|
19187
|
+
translator$24,
|
|
19115
19188
|
translator$1d,
|
|
19116
19189
|
translator$1c,
|
|
19117
19190
|
translator$1b,
|
|
@@ -19123,7 +19196,7 @@
|
|
|
19123
19196
|
translator$15,
|
|
19124
19197
|
translator$14,
|
|
19125
19198
|
translator$13,
|
|
19126
|
-
translator$
|
|
19199
|
+
translator$1M
|
|
19127
19200
|
];
|
|
19128
19201
|
const translator$12 = NodeTranslator.from(
|
|
19129
19202
|
createNestedPropertiesTranslator("w:pPr", "paragraphProperties", propertyTranslators$7)
|
|
@@ -19196,12 +19269,12 @@
|
|
|
19196
19269
|
const DEFAULT_FONT_SIZE_HALF_POINTS = 20;
|
|
19197
19270
|
const resolveRunProperties = (params2, inlineRpr, resolvedPpr, isListNumber = false, numberingDefinedInline = false) => {
|
|
19198
19271
|
const paragraphStyleId = resolvedPpr?.styleId;
|
|
19199
|
-
const paragraphStyleProps = resolveStyleChain$1(params2, paragraphStyleId, translator$
|
|
19200
|
-
const defaultProps2 = getDefaultProperties(params2, translator$
|
|
19201
|
-
const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params2, "Normal", translator$
|
|
19272
|
+
const paragraphStyleProps = resolveStyleChain$1(params2, paragraphStyleId, translator$1M);
|
|
19273
|
+
const defaultProps2 = getDefaultProperties(params2, translator$1M);
|
|
19274
|
+
const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params2, "Normal", translator$1M);
|
|
19202
19275
|
let runStyleProps = {};
|
|
19203
19276
|
if (!paragraphStyleId?.startsWith("TOC")) {
|
|
19204
|
-
runStyleProps = inlineRpr.styleId ? resolveStyleChain$1(params2, inlineRpr.styleId, translator$
|
|
19277
|
+
runStyleProps = inlineRpr.styleId ? resolveStyleChain$1(params2, inlineRpr.styleId, translator$1M) : {};
|
|
19205
19278
|
}
|
|
19206
19279
|
let styleChain;
|
|
19207
19280
|
if (isNormalDefault) {
|
|
@@ -19217,7 +19290,7 @@
|
|
|
19217
19290
|
params2,
|
|
19218
19291
|
resolvedPpr.numberingProperties.ilvl ?? 0,
|
|
19219
19292
|
numId,
|
|
19220
|
-
translator$
|
|
19293
|
+
translator$1M
|
|
19221
19294
|
);
|
|
19222
19295
|
}
|
|
19223
19296
|
if (!numberingDefinedInline) {
|
|
@@ -19379,6 +19452,7 @@
|
|
|
19379
19452
|
}
|
|
19380
19453
|
function getNumberingProperties(params2, ilvl, numId, translator2, tries = 0) {
|
|
19381
19454
|
const { numbering: allDefinitions } = params2;
|
|
19455
|
+
if (!allDefinitions) return {};
|
|
19382
19456
|
const { definitions, abstracts } = allDefinitions;
|
|
19383
19457
|
const propertiesChain = [];
|
|
19384
19458
|
const numDefinition = definitions[numId];
|
|
@@ -19806,13 +19880,12 @@
|
|
|
19806
19880
|
return runProperties;
|
|
19807
19881
|
}
|
|
19808
19882
|
marks.forEach((mark2) => {
|
|
19809
|
-
|
|
19883
|
+
const type2 = mark2.type.name ?? mark2.type;
|
|
19884
|
+
switch (type2) {
|
|
19810
19885
|
case "strike":
|
|
19811
19886
|
case "italic":
|
|
19812
19887
|
case "bold":
|
|
19813
|
-
|
|
19814
|
-
runProperties[mark2.type] = mark2.attrs.value;
|
|
19815
|
-
}
|
|
19888
|
+
runProperties[type2] = mark2.attrs.value !== "0" && mark2.attrs.value !== false;
|
|
19816
19889
|
break;
|
|
19817
19890
|
case "underline": {
|
|
19818
19891
|
const { underlineType, underlineColor } = mark2.attrs;
|
|
@@ -20061,7 +20134,7 @@
|
|
|
20061
20134
|
let submarks = [];
|
|
20062
20135
|
const rPr = rPrChange.elements?.find((el) => el.name === "w:rPr");
|
|
20063
20136
|
if (rPr) {
|
|
20064
|
-
const runProperties = translator$
|
|
20137
|
+
const runProperties = translator$1M.encode({ ...params2, nodes: [rPr] });
|
|
20065
20138
|
submarks = encodeMarksFromRPr(runProperties, params2?.docx);
|
|
20066
20139
|
}
|
|
20067
20140
|
return [{ type: TrackFormatMarkName$1, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
|
|
@@ -20623,8 +20696,8 @@
|
|
|
20623
20696
|
{
|
|
20624
20697
|
xmlName: "w:history",
|
|
20625
20698
|
sdName: "history",
|
|
20626
|
-
encode: (attributes) => attributes["w:history"] === "1" || attributes["w:history"] === "true",
|
|
20627
|
-
decode: (attributes) => attributes["history"] ? "1" : "0"
|
|
20699
|
+
encode: (attributes) => attributes["w:history"] == null ? null : attributes["w:history"] === "1" || attributes["w:history"] === "true",
|
|
20700
|
+
decode: (attributes) => attributes["history"] == null ? null : attributes["history"] ? "1" : "0"
|
|
20628
20701
|
},
|
|
20629
20702
|
_createAttributeHandler("w:tooltip", "tooltip"),
|
|
20630
20703
|
_createAttributeHandler("r:id", "rId"),
|
|
@@ -20767,7 +20840,7 @@
|
|
|
20767
20840
|
if (!runNode) return void 0;
|
|
20768
20841
|
const elements = Array.isArray(runNode.elements) ? runNode.elements : [];
|
|
20769
20842
|
const rPrNode = elements.find((child) => child?.name === "w:rPr");
|
|
20770
|
-
const runProperties = rPrNode ? translator$
|
|
20843
|
+
const runProperties = rPrNode ? translator$1M.encode({ ...params2, nodes: [rPrNode] }) : {};
|
|
20771
20844
|
const paragraphProperties = params2?.extraParams?.paragraphProperties || {};
|
|
20772
20845
|
const resolvedRunProperties = resolveRunProperties(params2, runProperties ?? {}, paragraphProperties);
|
|
20773
20846
|
const marks = encodeMarksFromRPr(resolvedRunProperties, params2?.docx) || [];
|
|
@@ -20828,29 +20901,37 @@
|
|
|
20828
20901
|
const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node2);
|
|
20829
20902
|
const runAttrs = runNodeForExport.attrs || {};
|
|
20830
20903
|
const runProperties = runAttrs.runProperties || {};
|
|
20831
|
-
const marksProperties = decodeRPrFromMarks(runNodeForExport.marks || []);
|
|
20832
|
-
const finalRunProperties = combineRunProperties([runProperties, marksProperties]);
|
|
20833
20904
|
const exportParams = {
|
|
20834
20905
|
...params2,
|
|
20835
20906
|
node: runNodeForExport,
|
|
20836
|
-
extraParams: { ...params2?.extraParams, runProperties
|
|
20907
|
+
extraParams: { ...params2?.extraParams, runProperties }
|
|
20837
20908
|
};
|
|
20838
20909
|
if (!exportParams.editor) {
|
|
20839
20910
|
exportParams.editor = { extensionService: { extensions: [] } };
|
|
20840
20911
|
}
|
|
20841
20912
|
const childElements = translateChildNodes(exportParams) || [];
|
|
20842
|
-
let runPropertiesElement = translator$
|
|
20913
|
+
let runPropertiesElement = translator$1M.decode({
|
|
20843
20914
|
...params2,
|
|
20844
|
-
node: { attrs: { runProperties
|
|
20915
|
+
node: { attrs: { runProperties } }
|
|
20845
20916
|
});
|
|
20846
20917
|
const runPropsTemplate = runPropertiesElement ? cloneXmlNode(runPropertiesElement) : null;
|
|
20847
20918
|
const applyBaseRunProps = (runNode) => applyRunPropertiesTemplate(runNode, runPropsTemplate);
|
|
20919
|
+
const replaceRunProps = (runNode) => {
|
|
20920
|
+
if (Array.isArray(runNode.elements)) {
|
|
20921
|
+
runNode.elements = runNode.elements.filter((el) => el?.name !== "w:rPr");
|
|
20922
|
+
} else {
|
|
20923
|
+
runNode.elements = [];
|
|
20924
|
+
}
|
|
20925
|
+
if (runPropsTemplate) {
|
|
20926
|
+
runNode.elements.unshift(cloneXmlNode(runPropsTemplate));
|
|
20927
|
+
}
|
|
20928
|
+
};
|
|
20848
20929
|
const runs2 = [];
|
|
20849
20930
|
childElements.forEach((child) => {
|
|
20850
20931
|
if (!child) return;
|
|
20851
20932
|
if (child.name === "w:r") {
|
|
20852
20933
|
const clonedRun = cloneXmlNode(child);
|
|
20853
|
-
|
|
20934
|
+
replaceRunProps(clonedRun);
|
|
20854
20935
|
runs2.push(clonedRun);
|
|
20855
20936
|
return;
|
|
20856
20937
|
}
|
|
@@ -20866,7 +20947,7 @@
|
|
|
20866
20947
|
const trackedClone = cloneXmlNode(child);
|
|
20867
20948
|
if (Array.isArray(trackedClone.elements)) {
|
|
20868
20949
|
trackedClone.elements.forEach((element2) => {
|
|
20869
|
-
if (element2?.name === "w:r")
|
|
20950
|
+
if (element2?.name === "w:r") replaceRunProps(element2);
|
|
20870
20951
|
});
|
|
20871
20952
|
}
|
|
20872
20953
|
runs2.push(trackedClone);
|
|
@@ -20928,12 +21009,12 @@
|
|
|
20928
21009
|
const translator$R = NodeTranslator.from(createBorderPropertyHandler("w:tl2br"));
|
|
20929
21010
|
const translator$Q = NodeTranslator.from(createBorderPropertyHandler("w:tr2bl"));
|
|
20930
21011
|
const propertyTranslators$6 = [
|
|
20931
|
-
translator$
|
|
21012
|
+
translator$1i,
|
|
20932
21013
|
translator$T,
|
|
20933
|
-
translator$
|
|
20934
|
-
translator$
|
|
21014
|
+
translator$1m,
|
|
21015
|
+
translator$1o,
|
|
20935
21016
|
translator$X,
|
|
20936
|
-
translator$
|
|
21017
|
+
translator$1k,
|
|
20937
21018
|
translator$V,
|
|
20938
21019
|
translator$U,
|
|
20939
21020
|
translator$R,
|
|
@@ -20952,12 +21033,12 @@
|
|
|
20952
21033
|
)
|
|
20953
21034
|
);
|
|
20954
21035
|
const propertyTranslators$5 = [
|
|
20955
|
-
translator$
|
|
21036
|
+
translator$1n,
|
|
20956
21037
|
translator$W,
|
|
20957
|
-
translator$
|
|
20958
|
-
translator$
|
|
21038
|
+
translator$1l,
|
|
21039
|
+
translator$1j,
|
|
20959
21040
|
translator$S,
|
|
20960
|
-
translator$
|
|
21041
|
+
translator$1h
|
|
20961
21042
|
];
|
|
20962
21043
|
const translator$N = NodeTranslator.from(
|
|
20963
21044
|
createNestedPropertiesTranslator("w:tcMar", "cellMargins", propertyTranslators$5)
|
|
@@ -20986,12 +21067,12 @@
|
|
|
20986
21067
|
createNestedArrayPropertyHandler("w:headers", "headers", [translator$J])
|
|
20987
21068
|
);
|
|
20988
21069
|
const propertyTranslators$4 = [
|
|
20989
|
-
translator$
|
|
21070
|
+
translator$1G,
|
|
20990
21071
|
translator$_,
|
|
20991
21072
|
translator$Z,
|
|
20992
21073
|
translator$Y,
|
|
20993
21074
|
translator$P,
|
|
20994
|
-
translator$
|
|
21075
|
+
translator$29,
|
|
20995
21076
|
translator$O,
|
|
20996
21077
|
translator$N,
|
|
20997
21078
|
translator$17,
|
|
@@ -21447,12 +21528,12 @@
|
|
|
21447
21528
|
const translator$x = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
|
|
21448
21529
|
const propertyTranslators$3 = [
|
|
21449
21530
|
translator$F,
|
|
21450
|
-
translator$
|
|
21451
|
-
translator$
|
|
21531
|
+
translator$1G,
|
|
21532
|
+
translator$1E,
|
|
21452
21533
|
translator$E,
|
|
21453
21534
|
translator$D,
|
|
21454
21535
|
translator$C,
|
|
21455
|
-
translator$
|
|
21536
|
+
translator$1B,
|
|
21456
21537
|
translator$B,
|
|
21457
21538
|
translator$A,
|
|
21458
21539
|
translator$z,
|
|
@@ -36862,7 +36943,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
36862
36943
|
const textRunProperties = decodeRPrFromMarks(marks || []);
|
|
36863
36944
|
const parentRunProperties = params2.extraParams?.runProperties || {};
|
|
36864
36945
|
const combinedRunProperties = combineRunProperties([parentRunProperties, textRunProperties]);
|
|
36865
|
-
const rPrNode = translator$
|
|
36946
|
+
const rPrNode = translator$1M.decode({ node: { attrs: { runProperties: combinedRunProperties } } });
|
|
36866
36947
|
textNodes.push({
|
|
36867
36948
|
name: "w:t",
|
|
36868
36949
|
elements: [{ text: text2, type: "text" }],
|
|
@@ -37804,33 +37885,33 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
37804
37885
|
}
|
|
37805
37886
|
});
|
|
37806
37887
|
const propertyTranslators$2 = [
|
|
37807
|
-
translator$
|
|
37888
|
+
translator$1o,
|
|
37808
37889
|
translator$X,
|
|
37809
37890
|
translator$V,
|
|
37810
37891
|
translator$U,
|
|
37811
|
-
translator$
|
|
37812
|
-
translator$
|
|
37892
|
+
translator$1m,
|
|
37893
|
+
translator$1k,
|
|
37813
37894
|
translator$T,
|
|
37814
|
-
translator$
|
|
37895
|
+
translator$1i
|
|
37815
37896
|
];
|
|
37816
37897
|
const translator$e = NodeTranslator.from(
|
|
37817
37898
|
createNestedPropertiesTranslator("w:tblBorders", "borders", propertyTranslators$2)
|
|
37818
37899
|
);
|
|
37819
37900
|
const propertyTranslators$1 = [
|
|
37820
|
-
translator$
|
|
37901
|
+
translator$1n,
|
|
37821
37902
|
translator$W,
|
|
37822
|
-
translator$
|
|
37823
|
-
translator$
|
|
37903
|
+
translator$1l,
|
|
37904
|
+
translator$1j,
|
|
37824
37905
|
translator$S,
|
|
37825
|
-
translator$
|
|
37906
|
+
translator$1h
|
|
37826
37907
|
];
|
|
37827
37908
|
const translator$d = NodeTranslator.from(
|
|
37828
37909
|
createNestedPropertiesTranslator("w:tblCellMar", "cellMargins", propertyTranslators$1)
|
|
37829
37910
|
);
|
|
37830
37911
|
const propertyTranslators = [
|
|
37831
37912
|
translator$q,
|
|
37832
|
-
translator$
|
|
37833
|
-
translator$
|
|
37913
|
+
translator$1B,
|
|
37914
|
+
translator$29,
|
|
37834
37915
|
translator$p,
|
|
37835
37916
|
translator$B,
|
|
37836
37917
|
translator$o,
|
|
@@ -39101,7 +39182,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
39101
39182
|
});
|
|
39102
39183
|
break;
|
|
39103
39184
|
case "w:ins":
|
|
39104
|
-
result = translator$
|
|
39185
|
+
result = translator$1v.encode({
|
|
39105
39186
|
...translatorParams,
|
|
39106
39187
|
extraParams: {
|
|
39107
39188
|
...translatorParams.extraParams,
|
|
@@ -39157,7 +39238,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
39157
39238
|
case "trackDelete":
|
|
39158
39239
|
return translator$2.decode(params2);
|
|
39159
39240
|
case "trackInsert":
|
|
39160
|
-
return translator$
|
|
39241
|
+
return translator$1v.decode(params2);
|
|
39161
39242
|
}
|
|
39162
39243
|
}
|
|
39163
39244
|
const isLinkNode = node2.marks?.some((m2) => m2.type === "link");
|
|
@@ -39233,33 +39314,40 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
39233
39314
|
};
|
|
39234
39315
|
const translatorList = Array.from(
|
|
39235
39316
|
/* @__PURE__ */ new Set([
|
|
39236
|
-
translator$
|
|
39317
|
+
translator$1L,
|
|
39237
39318
|
translator$6,
|
|
39238
39319
|
translator$5,
|
|
39239
39320
|
translator$4,
|
|
39240
39321
|
translator$3,
|
|
39241
|
-
translator$1L,
|
|
39242
39322
|
translator$1K,
|
|
39243
39323
|
translator$1J,
|
|
39244
|
-
translator$
|
|
39245
|
-
translator$
|
|
39246
|
-
translator$
|
|
39324
|
+
translator$1I,
|
|
39325
|
+
translator$2m,
|
|
39326
|
+
translator$1q,
|
|
39327
|
+
translator$2l,
|
|
39328
|
+
translator$2k,
|
|
39247
39329
|
translator$q,
|
|
39248
39330
|
translator$7,
|
|
39249
39331
|
translator$8,
|
|
39250
|
-
translator$
|
|
39251
|
-
translator$
|
|
39332
|
+
translator$1o,
|
|
39333
|
+
translator$2p,
|
|
39252
39334
|
translator$F,
|
|
39253
|
-
translator$
|
|
39254
|
-
translator$1H,
|
|
39255
|
-
translator$1W,
|
|
39335
|
+
translator$2a,
|
|
39256
39336
|
translator$1G,
|
|
39257
|
-
translator$
|
|
39337
|
+
translator$2f,
|
|
39258
39338
|
translator$1F,
|
|
39339
|
+
translator$1P,
|
|
39340
|
+
translator$2,
|
|
39341
|
+
translator$1E,
|
|
39259
39342
|
translator$s,
|
|
39343
|
+
translator$2g,
|
|
39344
|
+
translator$1R,
|
|
39260
39345
|
translator$1X,
|
|
39346
|
+
translator$1W,
|
|
39347
|
+
translator$23,
|
|
39261
39348
|
translator$X,
|
|
39262
|
-
translator$
|
|
39349
|
+
translator$1S,
|
|
39350
|
+
translator$1D,
|
|
39263
39351
|
translator$E,
|
|
39264
39352
|
translator$D,
|
|
39265
39353
|
translator$b,
|
|
@@ -39268,49 +39356,60 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
39268
39356
|
translator$I,
|
|
39269
39357
|
translator$C,
|
|
39270
39358
|
translator$K,
|
|
39271
|
-
translator$
|
|
39359
|
+
translator$2o,
|
|
39272
39360
|
translator$10,
|
|
39273
|
-
translator$
|
|
39274
|
-
translator$
|
|
39275
|
-
translator$1D,
|
|
39361
|
+
translator$2j,
|
|
39362
|
+
translator$1O,
|
|
39276
39363
|
translator$1w,
|
|
39364
|
+
translator$1C,
|
|
39365
|
+
translator$22,
|
|
39366
|
+
translator$1v,
|
|
39277
39367
|
translator$V,
|
|
39278
39368
|
translator$U,
|
|
39279
|
-
translator$1C,
|
|
39280
39369
|
translator$1B,
|
|
39281
39370
|
translator$1A,
|
|
39282
39371
|
translator$1z,
|
|
39283
|
-
translator$
|
|
39284
|
-
translator$1n,
|
|
39372
|
+
translator$1U,
|
|
39285
39373
|
translator$1y,
|
|
39374
|
+
translator$28,
|
|
39375
|
+
translator$1m,
|
|
39376
|
+
translator$1x,
|
|
39377
|
+
translator$21,
|
|
39286
39378
|
translator$O,
|
|
39287
|
-
translator$1v,
|
|
39288
39379
|
translator$1u,
|
|
39289
39380
|
translator$1t,
|
|
39381
|
+
translator$1$,
|
|
39290
39382
|
translator$1s,
|
|
39383
|
+
translator$1r,
|
|
39384
|
+
translator$20,
|
|
39291
39385
|
translator$11,
|
|
39292
|
-
translator$
|
|
39293
|
-
translator$1h,
|
|
39294
|
-
translator$12,
|
|
39386
|
+
translator$1e,
|
|
39295
39387
|
translator$1g,
|
|
39388
|
+
translator$1T,
|
|
39389
|
+
translator$12,
|
|
39390
|
+
translator$1f,
|
|
39296
39391
|
translator$$,
|
|
39297
|
-
translator$
|
|
39298
|
-
translator$
|
|
39299
|
-
translator$
|
|
39300
|
-
translator$1l,
|
|
39301
|
-
translator$r,
|
|
39392
|
+
translator$2e,
|
|
39393
|
+
translator$1M,
|
|
39394
|
+
translator$2d,
|
|
39302
39395
|
translator$1Q,
|
|
39303
|
-
translator$
|
|
39396
|
+
translator$1k,
|
|
39397
|
+
translator$r,
|
|
39398
|
+
translator$1_,
|
|
39399
|
+
translator$29,
|
|
39400
|
+
translator$25,
|
|
39401
|
+
translator$24,
|
|
39304
39402
|
translator$1d,
|
|
39305
39403
|
translator$1c,
|
|
39306
39404
|
translator$1b,
|
|
39307
39405
|
translator$1a,
|
|
39308
|
-
translator$T,
|
|
39309
39406
|
translator$1Y,
|
|
39310
|
-
translator$
|
|
39311
|
-
translator$
|
|
39407
|
+
translator$T,
|
|
39408
|
+
translator$2h,
|
|
39409
|
+
translator$2c,
|
|
39410
|
+
translator$2b,
|
|
39312
39411
|
translator$1,
|
|
39313
|
-
translator$
|
|
39412
|
+
translator$2n,
|
|
39314
39413
|
translator$19,
|
|
39315
39414
|
translator$9,
|
|
39316
39415
|
translator$e,
|
|
@@ -39345,12 +39444,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
39345
39444
|
translator$18,
|
|
39346
39445
|
translator$16,
|
|
39347
39446
|
translator$15,
|
|
39348
|
-
translator$
|
|
39349
|
-
translator$
|
|
39447
|
+
translator$1i,
|
|
39448
|
+
translator$2i,
|
|
39350
39449
|
translator$L,
|
|
39450
|
+
translator$1Z,
|
|
39451
|
+
translator$26,
|
|
39351
39452
|
translator$Y,
|
|
39453
|
+
translator$1V,
|
|
39352
39454
|
translator$y,
|
|
39353
39455
|
translator$x,
|
|
39456
|
+
translator$1N,
|
|
39354
39457
|
translator$14,
|
|
39355
39458
|
translator$13,
|
|
39356
39459
|
translator$u,
|
|
@@ -39458,7 +39561,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
39458
39561
|
if (nodes.length === 0 || nodes[0].name !== "w:br") {
|
|
39459
39562
|
return { nodes: [], consumed: 0 };
|
|
39460
39563
|
}
|
|
39461
|
-
const result = translator$
|
|
39564
|
+
const result = translator$2p.encode(params2);
|
|
39462
39565
|
if (!result) return { nodes: [], consumed: 0 };
|
|
39463
39566
|
return {
|
|
39464
39567
|
nodes: [result],
|
|
@@ -39602,7 +39705,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
39602
39705
|
...currentNode,
|
|
39603
39706
|
type: "element"
|
|
39604
39707
|
};
|
|
39605
|
-
const translated = translator$
|
|
39708
|
+
const translated = translator$1L.encode({
|
|
39606
39709
|
...params2,
|
|
39607
39710
|
nodes: [nodeForTranslator],
|
|
39608
39711
|
extraParams: { ...params2.extraParams || {}, node: nodeForTranslator }
|
|
@@ -40108,7 +40211,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
40108
40211
|
if (!nodes.length || nodes[0].name !== "w:tab") {
|
|
40109
40212
|
return { nodes: [], consumed: 0 };
|
|
40110
40213
|
}
|
|
40111
|
-
const node2 = translator$
|
|
40214
|
+
const node2 = translator$2n.encode(params2);
|
|
40112
40215
|
return { nodes: [node2], consumed: 1 };
|
|
40113
40216
|
};
|
|
40114
40217
|
const tabNodeEntityHandler = {
|
|
@@ -41187,7 +41290,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
41187
41290
|
if (vmlAttributes || horizontalRule) {
|
|
41188
41291
|
return translateVRectContentBlock(params2);
|
|
41189
41292
|
}
|
|
41190
|
-
const alternateContent = translator$
|
|
41293
|
+
const alternateContent = translator$1L.decode(params2);
|
|
41191
41294
|
return wrapTextInRun(alternateContent);
|
|
41192
41295
|
}
|
|
41193
41296
|
function translateVRectContentBlock(params2) {
|
|
@@ -41334,16 +41437,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
41334
41437
|
paragraph: translator$11,
|
|
41335
41438
|
run: translator$$,
|
|
41336
41439
|
text: translator$1,
|
|
41337
|
-
lineBreak: translator$
|
|
41440
|
+
lineBreak: translator$2p,
|
|
41338
41441
|
table: translator$9,
|
|
41339
41442
|
tableRow: translator$v,
|
|
41340
41443
|
tableCell: translator$G,
|
|
41341
41444
|
bookmarkStart: translator$8,
|
|
41342
41445
|
bookmarkEnd: translator$7,
|
|
41343
41446
|
fieldAnnotation: translator$r,
|
|
41344
|
-
tab: translator$
|
|
41447
|
+
tab: translator$2n,
|
|
41345
41448
|
image: translator$s,
|
|
41346
|
-
hardBreak: translator$
|
|
41449
|
+
hardBreak: translator$2p,
|
|
41347
41450
|
commentRangeStart: commentRangeStartTranslator,
|
|
41348
41451
|
commentRangeEnd: commentRangeEndTranslator,
|
|
41349
41452
|
commentReference: () => null,
|
|
@@ -41507,7 +41610,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
41507
41610
|
markElement.type = "element";
|
|
41508
41611
|
break;
|
|
41509
41612
|
case "underline": {
|
|
41510
|
-
const translated = translator$
|
|
41613
|
+
const translated = translator$2i.decode({
|
|
41511
41614
|
node: {
|
|
41512
41615
|
attrs: {
|
|
41513
41616
|
underlineType: attrs.underlineType ?? attrs.underline ?? null,
|
|
@@ -41571,7 +41674,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
41571
41674
|
break;
|
|
41572
41675
|
case "highlight": {
|
|
41573
41676
|
const highlightValue = attrs.color ?? attrs.highlight ?? null;
|
|
41574
|
-
const translated = translator$
|
|
41677
|
+
const translated = translator$2o.decode({ node: { attrs: { highlight: highlightValue } } });
|
|
41575
41678
|
return translated || {};
|
|
41576
41679
|
}
|
|
41577
41680
|
case "strike":
|
|
@@ -42083,7 +42186,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
42083
42186
|
static getStoredSuperdocVersion(docx) {
|
|
42084
42187
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42085
42188
|
}
|
|
42086
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
42189
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.56") {
|
|
42087
42190
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42088
42191
|
}
|
|
42089
42192
|
/**
|
|
@@ -67122,7 +67225,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
67122
67225
|
const shouldSkipNodeView = (editor) => {
|
|
67123
67226
|
return isHeadless(editor);
|
|
67124
67227
|
};
|
|
67125
|
-
const summaryVersion = "1.0.0-beta.
|
|
67228
|
+
const summaryVersion = "1.0.0-beta.56";
|
|
67126
67229
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
67127
67230
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
67128
67231
|
function mapAttributes(attrs) {
|
|
@@ -67911,7 +68014,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
67911
68014
|
{ default: remarkStringify2 },
|
|
67912
68015
|
{ default: remarkGfm2 }
|
|
67913
68016
|
] = await Promise.all([
|
|
67914
|
-
Promise.resolve().then(() =>
|
|
68017
|
+
Promise.resolve().then(() => indexDYnUncjo),
|
|
67915
68018
|
Promise.resolve().then(() => indexDRCvimau),
|
|
67916
68019
|
Promise.resolve().then(() => indexC_x_N6Uh),
|
|
67917
68020
|
Promise.resolve().then(() => indexD_sWOSiG),
|
|
@@ -68116,7 +68219,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
68116
68219
|
* Process collaboration migrations
|
|
68117
68220
|
*/
|
|
68118
68221
|
processCollaborationMigrations() {
|
|
68119
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
68222
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.56");
|
|
68120
68223
|
if (!this.options.ydoc) return;
|
|
68121
68224
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
68122
68225
|
let docVersion = metaMap.get("version");
|
|
@@ -69063,7 +69166,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
69063
69166
|
const DEFAULT_HYPERLINK_CONFIG$1 = {
|
|
69064
69167
|
enableRichHyperlinks: false
|
|
69065
69168
|
};
|
|
69066
|
-
const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
69169
|
+
const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
69170
|
+
"image",
|
|
69171
|
+
"hardBreak",
|
|
69172
|
+
"lineBreak",
|
|
69173
|
+
"page-number",
|
|
69174
|
+
"total-page-number",
|
|
69175
|
+
"passthroughInline",
|
|
69176
|
+
"bookmarkEnd"
|
|
69177
|
+
]);
|
|
69067
69178
|
const TOKEN_INLINE_TYPES = /* @__PURE__ */ new Map([
|
|
69068
69179
|
["page-number", "pageNumber"],
|
|
69069
69180
|
["total-page-number", "totalPageCount"]
|
|
@@ -87687,6 +87798,7 @@ ${l}
|
|
|
87687
87798
|
return effectiveEndA > startB && startA < endB;
|
|
87688
87799
|
};
|
|
87689
87800
|
function hitTestPage(layout, point2) {
|
|
87801
|
+
const pageGap = layout.pageGap ?? 0;
|
|
87690
87802
|
let cursorY = 0;
|
|
87691
87803
|
for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex += 1) {
|
|
87692
87804
|
const page = layout.pages[pageIndex];
|
|
@@ -87695,7 +87807,7 @@ ${l}
|
|
|
87695
87807
|
if (point2.y >= top2 && point2.y < bottom2) {
|
|
87696
87808
|
return { pageIndex, page };
|
|
87697
87809
|
}
|
|
87698
|
-
cursorY = bottom2;
|
|
87810
|
+
cursorY = bottom2 + pageGap;
|
|
87699
87811
|
}
|
|
87700
87812
|
return null;
|
|
87701
87813
|
}
|
|
@@ -87904,9 +88016,10 @@ ${l}
|
|
|
87904
88016
|
if (!pageHit) {
|
|
87905
88017
|
return null;
|
|
87906
88018
|
}
|
|
88019
|
+
const pageGap = layout.pageGap ?? 0;
|
|
87907
88020
|
const pageRelativePoint = {
|
|
87908
88021
|
x: containerPoint.x,
|
|
87909
|
-
y: containerPoint.y - pageHit.pageIndex * layout.pageSize.h
|
|
88022
|
+
y: containerPoint.y - pageHit.pageIndex * (layout.pageSize.h + pageGap)
|
|
87910
88023
|
};
|
|
87911
88024
|
logClickStage("log", "page-hit", {
|
|
87912
88025
|
pageIndex: pageHit.pageIndex
|
|
@@ -88127,7 +88240,7 @@ ${l}
|
|
|
88127
88240
|
const rectY = fragment.y + lineOffset;
|
|
88128
88241
|
rects.push({
|
|
88129
88242
|
x: rectX,
|
|
88130
|
-
y: rectY + pageIndex * layout.pageSize.h,
|
|
88243
|
+
y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
88131
88244
|
width: rectWidth,
|
|
88132
88245
|
height: line.lineHeight,
|
|
88133
88246
|
pageIndex
|
|
@@ -88244,7 +88357,7 @@ ${l}
|
|
|
88244
88357
|
const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
|
|
88245
88358
|
rects.push({
|
|
88246
88359
|
x: rectX,
|
|
88247
|
-
y: rectY + pageIndex * layout.pageSize.h,
|
|
88360
|
+
y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
88248
88361
|
width: rectWidth,
|
|
88249
88362
|
height: line.lineHeight,
|
|
88250
88363
|
pageIndex
|
|
@@ -88273,7 +88386,7 @@ ${l}
|
|
|
88273
88386
|
if (!rangesOverlap(pmRange.pmStart, pmRange.pmEnd, from2, to)) return;
|
|
88274
88387
|
rects.push({
|
|
88275
88388
|
x: fragment.x,
|
|
88276
|
-
y: fragment.y + pageIndex * layout.pageSize.h,
|
|
88389
|
+
y: fragment.y + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
|
|
88277
88390
|
width: fragment.width,
|
|
88278
88391
|
height: fragment.height,
|
|
88279
88392
|
pageIndex
|
|
@@ -91187,6 +91300,8 @@ ${l}
|
|
|
91187
91300
|
const FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation";
|
|
91188
91301
|
const DEFAULT_PAGE_SIZE = { w: 612, h: 792 };
|
|
91189
91302
|
const DEFAULT_MARGINS = { top: 72, right: 72, bottom: 72, left: 72 };
|
|
91303
|
+
const DEFAULT_VIRTUALIZED_PAGE_GAP = 72;
|
|
91304
|
+
const DEFAULT_PAGE_GAP = 24;
|
|
91190
91305
|
const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
|
|
91191
91306
|
const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
|
|
91192
91307
|
const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
|
|
@@ -92261,8 +92376,9 @@ ${l}
|
|
|
92261
92376
|
const rawRects = layoutRectSource();
|
|
92262
92377
|
if (!rawRects.length) return [];
|
|
92263
92378
|
const pageHeight = __privateGet$1(this, _session).mode === "body" ? __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this) : __privateMethod$1(this, _PresentationEditor_instances, getHeaderFooterPageHeight_fn).call(this);
|
|
92379
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
92264
92380
|
return rawRects.map((rect) => {
|
|
92265
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
92381
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
92266
92382
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
92267
92383
|
if (!coords) return null;
|
|
92268
92384
|
const absLeft = coords.x * zoom + overlayRect.left;
|
|
@@ -92514,7 +92630,8 @@ ${l}
|
|
|
92514
92630
|
return null;
|
|
92515
92631
|
}
|
|
92516
92632
|
const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
|
|
92517
|
-
const
|
|
92633
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
92634
|
+
const pageLocalY = rect2.y - rect2.pageIndex * (pageHeight + pageGap);
|
|
92518
92635
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect2.pageIndex, rect2.x, pageLocalY);
|
|
92519
92636
|
if (!coords) {
|
|
92520
92637
|
return null;
|
|
@@ -93258,10 +93375,11 @@ ${l}
|
|
|
93258
93375
|
const color2 = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
|
|
93259
93376
|
const opacity = __privateGet$1(this, _layoutOptions).presence?.highlightOpacity ?? 0.35;
|
|
93260
93377
|
const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
93378
|
+
const pageGap = layout.pageGap ?? 0;
|
|
93261
93379
|
const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
|
|
93262
93380
|
const limitedRects = rects.slice(0, MAX_SELECTION_RECTS_PER_USER);
|
|
93263
93381
|
limitedRects.forEach((rect) => {
|
|
93264
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
93382
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
93265
93383
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
93266
93384
|
if (!coords) return;
|
|
93267
93385
|
const selectionEl = doc2.createElement("div");
|
|
@@ -93724,6 +93842,12 @@ ${l}
|
|
|
93724
93842
|
return;
|
|
93725
93843
|
}
|
|
93726
93844
|
({ layout, measures } = result);
|
|
93845
|
+
if (__privateGet$1(this, _layoutOptions).virtualization?.enabled) {
|
|
93846
|
+
const gap = __privateGet$1(this, _layoutOptions).virtualization.gap ?? DEFAULT_VIRTUALIZED_PAGE_GAP;
|
|
93847
|
+
layout.pageGap = Math.max(0, gap);
|
|
93848
|
+
} else {
|
|
93849
|
+
layout.pageGap = DEFAULT_PAGE_GAP;
|
|
93850
|
+
}
|
|
93727
93851
|
headerLayouts = result.headers;
|
|
93728
93852
|
footerLayouts = result.footers;
|
|
93729
93853
|
} catch (error) {
|
|
@@ -94211,9 +94335,10 @@ ${l}
|
|
|
94211
94335
|
const layout = __privateGet$1(this, _layoutState).layout;
|
|
94212
94336
|
if (!layout) return null;
|
|
94213
94337
|
const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
94338
|
+
const pageGap = layout.pageGap ?? 0;
|
|
94214
94339
|
if (pageHeight <= 0) return null;
|
|
94215
|
-
const pageIndex = Math.max(0, Math.floor(y2 / pageHeight));
|
|
94216
|
-
const pageLocalY = y2 - pageIndex * pageHeight;
|
|
94340
|
+
const pageIndex = Math.max(0, Math.floor(y2 / (pageHeight + pageGap)));
|
|
94341
|
+
const pageLocalY = y2 - pageIndex * (pageHeight + pageGap);
|
|
94217
94342
|
const headerRegion = __privateGet$1(this, _headerRegions).get(pageIndex);
|
|
94218
94343
|
if (headerRegion && __privateMethod$1(this, _PresentationEditor_instances, pointInRegion_fn).call(this, headerRegion, x2, pageLocalY)) {
|
|
94219
94344
|
return headerRegion;
|
|
@@ -94638,8 +94763,9 @@ ${l}
|
|
|
94638
94763
|
return;
|
|
94639
94764
|
}
|
|
94640
94765
|
const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
|
|
94766
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
94641
94767
|
rects.forEach((rect, _index) => {
|
|
94642
|
-
const pageLocalY = rect.y - rect.pageIndex * pageHeight;
|
|
94768
|
+
const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
|
|
94643
94769
|
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
|
|
94644
94770
|
if (!coords) {
|
|
94645
94771
|
return;
|
|
@@ -94897,9 +95023,10 @@ ${l}
|
|
|
94897
95023
|
return null;
|
|
94898
95024
|
}
|
|
94899
95025
|
const pageHeight = __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
95026
|
+
const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
|
|
94900
95027
|
return {
|
|
94901
95028
|
x: pageLocalX,
|
|
94902
|
-
y: pageIndex * pageHeight + pageLocalY
|
|
95029
|
+
y: pageIndex * (pageHeight + pageGap) + pageLocalY
|
|
94903
95030
|
};
|
|
94904
95031
|
};
|
|
94905
95032
|
normalizeClientPoint_fn = function(clientX, clientY) {
|
|
@@ -98194,7 +98321,7 @@ ${l}
|
|
|
98194
98321
|
return tr.docChanged ? tr : null;
|
|
98195
98322
|
}
|
|
98196
98323
|
});
|
|
98197
|
-
const mergeRanges$
|
|
98324
|
+
const mergeRanges$2 = (ranges, docSize) => {
|
|
98198
98325
|
if (!ranges.length) return [];
|
|
98199
98326
|
const sorted = ranges.map(({ from: from2, to }) => ({
|
|
98200
98327
|
from: Math.max(0, from2),
|
|
@@ -98223,7 +98350,7 @@ ${l}
|
|
|
98223
98350
|
});
|
|
98224
98351
|
});
|
|
98225
98352
|
});
|
|
98226
|
-
return mergeRanges$
|
|
98353
|
+
return mergeRanges$2(ranges, docSize);
|
|
98227
98354
|
};
|
|
98228
98355
|
const mapRangesThroughTransactions = (ranges, transactions, docSize) => {
|
|
98229
98356
|
let mapped = ranges;
|
|
@@ -98235,7 +98362,7 @@ ${l}
|
|
|
98235
98362
|
return { from: mappedFrom, to: mappedTo };
|
|
98236
98363
|
}).filter(Boolean);
|
|
98237
98364
|
});
|
|
98238
|
-
return mergeRanges$
|
|
98365
|
+
return mergeRanges$2(mapped, docSize);
|
|
98239
98366
|
};
|
|
98240
98367
|
const buildWrapTransaction = (state2, ranges, runType) => {
|
|
98241
98368
|
if (!ranges.length) return null;
|
|
@@ -98294,7 +98421,7 @@ ${l}
|
|
|
98294
98421
|
if (!runType) return null;
|
|
98295
98422
|
pendingRanges = mapRangesThroughTransactions(pendingRanges, transactions, docSize);
|
|
98296
98423
|
const changedRanges = collectChangedRanges(transactions, docSize);
|
|
98297
|
-
pendingRanges = mergeRanges$
|
|
98424
|
+
pendingRanges = mergeRanges$2([...pendingRanges, ...changedRanges], docSize);
|
|
98298
98425
|
if (view?.composing) {
|
|
98299
98426
|
return null;
|
|
98300
98427
|
}
|
|
@@ -98304,6 +98431,204 @@ ${l}
|
|
|
98304
98431
|
}
|
|
98305
98432
|
});
|
|
98306
98433
|
};
|
|
98434
|
+
const splitRunsAfterMarkPlugin = new Plugin({
|
|
98435
|
+
appendTransaction(transactions, _old, newState) {
|
|
98436
|
+
const markRanges = [];
|
|
98437
|
+
let mappingToFinal = new Mapping();
|
|
98438
|
+
for (let ti = transactions.length - 1; ti >= 0; ti--) {
|
|
98439
|
+
const tr2 = transactions[ti];
|
|
98440
|
+
tr2.steps.forEach((step) => {
|
|
98441
|
+
if (!(step instanceof AddMarkStep || step instanceof RemoveMarkStep)) return;
|
|
98442
|
+
const fromAfterTr = tr2.mapping.map(step.from, 1);
|
|
98443
|
+
const toAfterTr = tr2.mapping.map(step.to, -1);
|
|
98444
|
+
markRanges.push({
|
|
98445
|
+
from: mappingToFinal.map(fromAfterTr, 1),
|
|
98446
|
+
to: mappingToFinal.map(toAfterTr, -1)
|
|
98447
|
+
});
|
|
98448
|
+
});
|
|
98449
|
+
const composed = new Mapping();
|
|
98450
|
+
composed.appendMapping(tr2.mapping);
|
|
98451
|
+
composed.appendMapping(mappingToFinal);
|
|
98452
|
+
mappingToFinal = composed;
|
|
98453
|
+
}
|
|
98454
|
+
if (!markRanges.length) return null;
|
|
98455
|
+
const runType = newState.schema.nodes["run"];
|
|
98456
|
+
if (!runType) return null;
|
|
98457
|
+
const runPositions = /* @__PURE__ */ new Set();
|
|
98458
|
+
markRanges.forEach(({ from: from2, to }) => {
|
|
98459
|
+
newState.doc.nodesBetween(from2, to, (node2, pos) => {
|
|
98460
|
+
if (node2.type === runType) runPositions.add(pos);
|
|
98461
|
+
});
|
|
98462
|
+
});
|
|
98463
|
+
if (!runPositions.size) return null;
|
|
98464
|
+
const tr = newState.tr;
|
|
98465
|
+
const originalSelection = newState.selection;
|
|
98466
|
+
const isTextSelection2 = originalSelection instanceof TextSelection$1;
|
|
98467
|
+
let preservedAnchor = isTextSelection2 ? originalSelection.anchor : null;
|
|
98468
|
+
let preservedHead = isTextSelection2 ? originalSelection.head : null;
|
|
98469
|
+
const anchorAssoc = preservedAnchor != null && preservedHead != null && preservedAnchor <= preservedHead ? -1 : 1;
|
|
98470
|
+
const headAssoc = preservedAnchor != null && preservedHead != null && preservedHead >= preservedAnchor ? 1 : -1;
|
|
98471
|
+
const mapOffsetThroughReplacement = (startPos, replacement, offset2) => {
|
|
98472
|
+
let currentPos = startPos;
|
|
98473
|
+
let remaining = offset2;
|
|
98474
|
+
let mapped = null;
|
|
98475
|
+
replacement.forEach((node2) => {
|
|
98476
|
+
if (mapped != null) return;
|
|
98477
|
+
const contentSize = node2.content.size;
|
|
98478
|
+
if (remaining <= contentSize) {
|
|
98479
|
+
mapped = currentPos + 1 + remaining;
|
|
98480
|
+
return;
|
|
98481
|
+
}
|
|
98482
|
+
remaining -= contentSize;
|
|
98483
|
+
currentPos += node2.nodeSize;
|
|
98484
|
+
});
|
|
98485
|
+
return mapped ?? currentPos;
|
|
98486
|
+
};
|
|
98487
|
+
Array.from(runPositions).sort((a2, b2) => b2 - a2).forEach((pos) => {
|
|
98488
|
+
const mappedPos = tr.mapping.map(pos);
|
|
98489
|
+
const runNode = tr.doc.nodeAt(mappedPos);
|
|
98490
|
+
if (!runNode) return;
|
|
98491
|
+
const groups = [];
|
|
98492
|
+
let current = [];
|
|
98493
|
+
let currentMarks = null;
|
|
98494
|
+
runNode.forEach((child) => {
|
|
98495
|
+
if (child.isText) {
|
|
98496
|
+
if (currentMarks && Mark$1.sameSet(currentMarks, child.marks)) {
|
|
98497
|
+
current.push(child);
|
|
98498
|
+
} else {
|
|
98499
|
+
if (current.length) groups.push(Fragment$1.from(current));
|
|
98500
|
+
current = [child];
|
|
98501
|
+
currentMarks = child.marks;
|
|
98502
|
+
}
|
|
98503
|
+
} else {
|
|
98504
|
+
if (current.length) groups.push(Fragment$1.from(current));
|
|
98505
|
+
groups.push(Fragment$1.from(child));
|
|
98506
|
+
current = [];
|
|
98507
|
+
currentMarks = null;
|
|
98508
|
+
}
|
|
98509
|
+
});
|
|
98510
|
+
if (current.length) groups.push(Fragment$1.from(current));
|
|
98511
|
+
if (groups.length <= 1) return;
|
|
98512
|
+
const replacement = Fragment$1.from(
|
|
98513
|
+
groups.map((content2) => runType.create(runNode.attrs, content2, runNode.marks))
|
|
98514
|
+
);
|
|
98515
|
+
tr.replaceWith(mappedPos, mappedPos + runNode.nodeSize, replacement);
|
|
98516
|
+
const stepMap = tr.mapping.maps[tr.mapping.maps.length - 1];
|
|
98517
|
+
const mapSelectionPos = (pos2, assoc) => {
|
|
98518
|
+
if (pos2 == null) return null;
|
|
98519
|
+
if (pos2 < mappedPos || pos2 > mappedPos + runNode.nodeSize) {
|
|
98520
|
+
return stepMap.map(pos2, assoc);
|
|
98521
|
+
}
|
|
98522
|
+
const offsetInRun = pos2 - (mappedPos + 1);
|
|
98523
|
+
return mapOffsetThroughReplacement(mappedPos, replacement, offsetInRun);
|
|
98524
|
+
};
|
|
98525
|
+
preservedAnchor = mapSelectionPos(preservedAnchor, anchorAssoc);
|
|
98526
|
+
preservedHead = mapSelectionPos(preservedHead, headAssoc);
|
|
98527
|
+
});
|
|
98528
|
+
if (tr.docChanged && originalSelection) {
|
|
98529
|
+
if (originalSelection instanceof TextSelection$1 && preservedAnchor != null && preservedHead != null) {
|
|
98530
|
+
tr.setSelection(TextSelection$1.create(tr.doc, preservedAnchor, preservedHead));
|
|
98531
|
+
} else {
|
|
98532
|
+
tr.setSelection(originalSelection.map(tr.doc, tr.mapping));
|
|
98533
|
+
}
|
|
98534
|
+
}
|
|
98535
|
+
return tr.docChanged ? tr : null;
|
|
98536
|
+
}
|
|
98537
|
+
});
|
|
98538
|
+
const calculateInlineRunPropertiesPlugin = (editor) => new Plugin({
|
|
98539
|
+
appendTransaction(transactions, _oldState, newState) {
|
|
98540
|
+
const tr = newState.tr;
|
|
98541
|
+
if (!transactions.some((t) => t.docChanged)) return null;
|
|
98542
|
+
if (!transactions.some(
|
|
98543
|
+
(tr2) => tr2.steps.some((step) => step instanceof AddMarkStep || step instanceof RemoveMarkStep)
|
|
98544
|
+
)) {
|
|
98545
|
+
return null;
|
|
98546
|
+
}
|
|
98547
|
+
const runType = newState.schema.nodes.run;
|
|
98548
|
+
if (!runType) return null;
|
|
98549
|
+
const changedRanges = [];
|
|
98550
|
+
transactions.forEach((tr2) => {
|
|
98551
|
+
tr2.steps.forEach((step) => {
|
|
98552
|
+
const from2 = tr2.mapping.map(step.from, 1);
|
|
98553
|
+
const to = tr2.mapping.map(step.to, -1);
|
|
98554
|
+
changedRanges.push({ from: from2, to });
|
|
98555
|
+
});
|
|
98556
|
+
});
|
|
98557
|
+
const runPositions = /* @__PURE__ */ new Set();
|
|
98558
|
+
mergeRanges$1(changedRanges, newState.doc.content.size).forEach(({ from: from2, to }) => {
|
|
98559
|
+
newState.doc.nodesBetween(from2, to, (node2, pos) => {
|
|
98560
|
+
if (node2.type === runType) runPositions.add(pos);
|
|
98561
|
+
});
|
|
98562
|
+
});
|
|
98563
|
+
if (!runPositions.size) return null;
|
|
98564
|
+
runPositions.forEach((pos) => {
|
|
98565
|
+
const runNode = tr.doc.nodeAt(pos);
|
|
98566
|
+
if (!runNode) return;
|
|
98567
|
+
const $pos = tr.doc.resolve(pos);
|
|
98568
|
+
let paragraphNode = null;
|
|
98569
|
+
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
98570
|
+
const node2 = $pos.node(depth);
|
|
98571
|
+
if (node2.type.name === "paragraph") {
|
|
98572
|
+
paragraphNode = node2;
|
|
98573
|
+
break;
|
|
98574
|
+
}
|
|
98575
|
+
}
|
|
98576
|
+
if (!paragraphNode) return;
|
|
98577
|
+
const marks = getMarksFromRun(runNode);
|
|
98578
|
+
const runPropertiesFromMarks = decodeRPrFromMarks(marks);
|
|
98579
|
+
const paragraphProperties = getResolvedParagraphProperties(paragraphNode) || calculateResolvedParagraphProperties(editor, paragraphNode, $pos);
|
|
98580
|
+
const runPropertiesFromStyles = resolveRunProperties(
|
|
98581
|
+
{ docx: editor.converter?.convertedXml ?? {}, numbering: editor.converter?.numbering ?? {} },
|
|
98582
|
+
{},
|
|
98583
|
+
paragraphProperties,
|
|
98584
|
+
false,
|
|
98585
|
+
Boolean(paragraphNode.attrs.paragraphProperties?.numberingProperties)
|
|
98586
|
+
);
|
|
98587
|
+
const inlineRunProperties = getInlineRunProperties(runPropertiesFromMarks, runPropertiesFromStyles);
|
|
98588
|
+
const runProperties = Object.keys(inlineRunProperties).length ? inlineRunProperties : null;
|
|
98589
|
+
if (JSON.stringify(runProperties) === JSON.stringify(runNode.attrs.runProperties)) return;
|
|
98590
|
+
tr.setNodeMarkup(pos, runNode.type, { ...runNode.attrs, runProperties }, runNode.marks);
|
|
98591
|
+
});
|
|
98592
|
+
return tr.docChanged ? tr : null;
|
|
98593
|
+
}
|
|
98594
|
+
});
|
|
98595
|
+
function getMarksFromRun(runNode) {
|
|
98596
|
+
let marks = [];
|
|
98597
|
+
runNode.forEach((child) => {
|
|
98598
|
+
if (!marks.length && child.isText) {
|
|
98599
|
+
marks = child.marks;
|
|
98600
|
+
}
|
|
98601
|
+
});
|
|
98602
|
+
return marks;
|
|
98603
|
+
}
|
|
98604
|
+
function getInlineRunProperties(runPropertiesFromMarks, runPropertiesFromStyles) {
|
|
98605
|
+
const inlineRunProperties = {};
|
|
98606
|
+
for (const key2 in runPropertiesFromMarks) {
|
|
98607
|
+
const valueFromMarks = runPropertiesFromMarks[key2];
|
|
98608
|
+
const valueFromStyles = runPropertiesFromStyles[key2];
|
|
98609
|
+
if (JSON.stringify(valueFromMarks) !== JSON.stringify(valueFromStyles)) {
|
|
98610
|
+
inlineRunProperties[key2] = valueFromMarks;
|
|
98611
|
+
}
|
|
98612
|
+
}
|
|
98613
|
+
return inlineRunProperties;
|
|
98614
|
+
}
|
|
98615
|
+
function mergeRanges$1(ranges, docSize) {
|
|
98616
|
+
if (!ranges.length) return [];
|
|
98617
|
+
const sorted = ranges.map(({ from: from2, to }) => ({
|
|
98618
|
+
from: Math.max(0, from2),
|
|
98619
|
+
to: Math.min(docSize, to)
|
|
98620
|
+
})).filter(({ from: from2, to }) => from2 < to).sort((a2, b2) => a2.from - b2.from);
|
|
98621
|
+
const merged = [];
|
|
98622
|
+
for (const range2 of sorted) {
|
|
98623
|
+
const last = merged[merged.length - 1];
|
|
98624
|
+
if (last && range2.from <= last.to) {
|
|
98625
|
+
last.to = Math.max(last.to, range2.to);
|
|
98626
|
+
} else {
|
|
98627
|
+
merged.push({ ...range2 });
|
|
98628
|
+
}
|
|
98629
|
+
}
|
|
98630
|
+
return merged;
|
|
98631
|
+
}
|
|
98307
98632
|
const Run = OxmlNode.create({
|
|
98308
98633
|
name: "run",
|
|
98309
98634
|
oXmlName: "w:r",
|
|
@@ -98358,7 +98683,12 @@ ${l}
|
|
|
98358
98683
|
return ["span", base2, 0];
|
|
98359
98684
|
},
|
|
98360
98685
|
addPmPlugins() {
|
|
98361
|
-
return [
|
|
98686
|
+
return [
|
|
98687
|
+
wrapTextInRunsPlugin(),
|
|
98688
|
+
splitRunsAfterMarkPlugin,
|
|
98689
|
+
calculateInlineRunPropertiesPlugin(this.editor),
|
|
98690
|
+
cleanupEmptyRunsPlugin
|
|
98691
|
+
];
|
|
98362
98692
|
}
|
|
98363
98693
|
});
|
|
98364
98694
|
const restartNumbering = ({ editor, tr, state: state2, dispatch }) => {
|
|
@@ -103185,7 +103515,9 @@ ${l}
|
|
|
103185
103515
|
const style2 = sides.map((side) => {
|
|
103186
103516
|
const border = borders?.[side];
|
|
103187
103517
|
if (border && border.val === "none") return `border-${side}: ${border.val};`;
|
|
103188
|
-
|
|
103518
|
+
let color2 = border?.color || "black";
|
|
103519
|
+
if (color2 === "auto") color2 = "black";
|
|
103520
|
+
if (border) return `border-${side}: ${Math.ceil(border.size)}px solid ${color2};`;
|
|
103189
103521
|
return "";
|
|
103190
103522
|
}).join(" ");
|
|
103191
103523
|
return { style: style2 };
|
|
@@ -108345,6 +108677,8 @@ ${l}
|
|
|
108345
108677
|
name: "passthroughInline",
|
|
108346
108678
|
group: "inline",
|
|
108347
108679
|
inline: true,
|
|
108680
|
+
// IMPORTANT: This node is registered in pm-adapter/src/constants.ts ATOMIC_INLINE_TYPES
|
|
108681
|
+
// If you change atom to false, you MUST remove it from that set to avoid positioning bugs
|
|
108348
108682
|
atom: true,
|
|
108349
108683
|
draggable: false,
|
|
108350
108684
|
selectable: false,
|
|
@@ -148663,7 +148997,7 @@ ${style2}
|
|
|
148663
148997
|
this.config.colors = shuffleArray(this.config.colors);
|
|
148664
148998
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
148665
148999
|
this.colorIndex = 0;
|
|
148666
|
-
this.version = "1.0.0-beta.
|
|
149000
|
+
this.version = "1.0.0-beta.56";
|
|
148667
149001
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
148668
149002
|
this.superdocId = config2.superdocId || v4();
|
|
148669
149003
|
this.colors = this.config.colors;
|
|
@@ -151129,7 +151463,7 @@ ${style2}
|
|
|
151129
151463
|
value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
|
|
151130
151464
|
);
|
|
151131
151465
|
}
|
|
151132
|
-
const
|
|
151466
|
+
const indexDYnUncjo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
151133
151467
|
__proto__: null,
|
|
151134
151468
|
unified
|
|
151135
151469
|
}, Symbol.toStringTag, { value: "Module" }));
|