superdoc 1.14.0 → 1.15.0-next.2
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/{SuperConverter-BWKP_jTL.cjs → SuperConverter-BevYhIoX.cjs} +205 -67
- package/dist/chunks/{SuperConverter-BGuW-x9Y.es.js → SuperConverter-CC6mcWnc.es.js} +205 -67
- package/dist/chunks/{src-B-a8oU-W.cjs → src-BeR3aE72.cjs} +147 -51
- package/dist/chunks/{src-Bff1txuA.es.js → src-BrAeXFXo.es.js} +147 -51
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/src/core/commands/tests/test-schema.d.ts +1 -1
- package/dist/super-editor/src/core/super-converter/v3/handlers/wp/helpers/vector-shape-helpers.d.ts +9 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/wp/helpers/vector-shape-helpers.d.ts.map +1 -1
- package/dist/super-editor/src/extensions/table/table.d.ts +1 -1
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +2 -2
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +352 -118
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -10740,6 +10740,182 @@ var PluginKey = class {
|
|
|
10740
10740
|
return state[this.key];
|
|
10741
10741
|
}
|
|
10742
10742
|
};
|
|
10743
|
+
function getPresetColor(name) {
|
|
10744
|
+
return {
|
|
10745
|
+
aliceBlue: "#f0f8ff",
|
|
10746
|
+
antiqueWhite: "#faebd7",
|
|
10747
|
+
aqua: "#00ffff",
|
|
10748
|
+
aquamarine: "#7fffd4",
|
|
10749
|
+
azure: "#f0ffff",
|
|
10750
|
+
beige: "#f5f5dc",
|
|
10751
|
+
bisque: "#ffe4c4",
|
|
10752
|
+
black: "#000000",
|
|
10753
|
+
blanchedAlmond: "#ffebcd",
|
|
10754
|
+
blue: "#0000ff",
|
|
10755
|
+
blueViolet: "#8a2be2",
|
|
10756
|
+
brown: "#a52a2a",
|
|
10757
|
+
burlyWood: "#deb887",
|
|
10758
|
+
cadetBlue: "#5f9ea0",
|
|
10759
|
+
chartreuse: "#7fff00",
|
|
10760
|
+
chocolate: "#d2691e",
|
|
10761
|
+
coral: "#ff7f50",
|
|
10762
|
+
cornflowerBlue: "#6495ed",
|
|
10763
|
+
cornsilk: "#fff8dc",
|
|
10764
|
+
crimson: "#dc143c",
|
|
10765
|
+
cyan: "#00ffff",
|
|
10766
|
+
dkBlue: "#00008b",
|
|
10767
|
+
dkCyan: "#008b8b",
|
|
10768
|
+
dkGoldenrod: "#b8860b",
|
|
10769
|
+
dkGray: "#a9a9a9",
|
|
10770
|
+
dkGreen: "#006400",
|
|
10771
|
+
dkKhaki: "#bdb76b",
|
|
10772
|
+
dkMagenta: "#8b008b",
|
|
10773
|
+
dkOliveGreen: "#556b2f",
|
|
10774
|
+
dkOrange: "#ff8c00",
|
|
10775
|
+
dkOrchid: "#9932cc",
|
|
10776
|
+
dkRed: "#8b0000",
|
|
10777
|
+
dkSalmon: "#e9967a",
|
|
10778
|
+
dkSeaGreen: "#8fbc8f",
|
|
10779
|
+
dkSlateBlue: "#483d8b",
|
|
10780
|
+
dkSlateGray: "#2f4f4f",
|
|
10781
|
+
dkTurquoise: "#00ced1",
|
|
10782
|
+
dkViolet: "#9400d3",
|
|
10783
|
+
deepPink: "#ff1493",
|
|
10784
|
+
deepSkyBlue: "#00bfff",
|
|
10785
|
+
dimGray: "#696969",
|
|
10786
|
+
dodgerBlue: "#1e90ff",
|
|
10787
|
+
firebrick: "#b22222",
|
|
10788
|
+
floralWhite: "#fffaf0",
|
|
10789
|
+
forestGreen: "#228b22",
|
|
10790
|
+
fuchsia: "#ff00ff",
|
|
10791
|
+
gainsboro: "#dcdcdc",
|
|
10792
|
+
ghostWhite: "#f8f8ff",
|
|
10793
|
+
gold: "#ffd700",
|
|
10794
|
+
goldenrod: "#daa520",
|
|
10795
|
+
gray: "#808080",
|
|
10796
|
+
green: "#008000",
|
|
10797
|
+
greenYellow: "#adff2f",
|
|
10798
|
+
honeydew: "#f0fff0",
|
|
10799
|
+
hotPink: "#ff69b4",
|
|
10800
|
+
indianRed: "#cd5c5c",
|
|
10801
|
+
indigo: "#4b0082",
|
|
10802
|
+
ivory: "#fffff0",
|
|
10803
|
+
khaki: "#f0e68c",
|
|
10804
|
+
lavender: "#e6e6fa",
|
|
10805
|
+
lavenderBlush: "#fff0f5",
|
|
10806
|
+
lawnGreen: "#7cfc00",
|
|
10807
|
+
lemonChiffon: "#fffacd",
|
|
10808
|
+
ltBlue: "#add8e6",
|
|
10809
|
+
ltCoral: "#f08080",
|
|
10810
|
+
ltCyan: "#e0ffff",
|
|
10811
|
+
ltGoldenrodYellow: "#fafad2",
|
|
10812
|
+
ltGray: "#d3d3d3",
|
|
10813
|
+
ltGreen: "#90ee90",
|
|
10814
|
+
ltPink: "#ffb6c1",
|
|
10815
|
+
ltSalmon: "#ffa07a",
|
|
10816
|
+
ltSeaGreen: "#20b2aa",
|
|
10817
|
+
ltSkyBlue: "#87cefa",
|
|
10818
|
+
ltSlateGray: "#778899",
|
|
10819
|
+
ltSteelBlue: "#b0c4de",
|
|
10820
|
+
ltYellow: "#ffffe0",
|
|
10821
|
+
lime: "#00ff00",
|
|
10822
|
+
limeGreen: "#32cd32",
|
|
10823
|
+
linen: "#faf0e6",
|
|
10824
|
+
magenta: "#ff00ff",
|
|
10825
|
+
maroon: "#800000",
|
|
10826
|
+
medAquamarine: "#66cdaa",
|
|
10827
|
+
medBlue: "#0000cd",
|
|
10828
|
+
medOrchid: "#ba55d3",
|
|
10829
|
+
medPurple: "#9370db",
|
|
10830
|
+
medSeaGreen: "#3cb371",
|
|
10831
|
+
medSlateBlue: "#7b68ee",
|
|
10832
|
+
medSpringGreen: "#00fa9a",
|
|
10833
|
+
medTurquoise: "#48d1cc",
|
|
10834
|
+
medVioletRed: "#c71585",
|
|
10835
|
+
midnightBlue: "#191970",
|
|
10836
|
+
mintCream: "#f5fffa",
|
|
10837
|
+
mistyRose: "#ffe4e1",
|
|
10838
|
+
moccasin: "#ffe4b5",
|
|
10839
|
+
navajoWhite: "#ffdead",
|
|
10840
|
+
navy: "#000080",
|
|
10841
|
+
oldLace: "#fdf5e6",
|
|
10842
|
+
olive: "#808000",
|
|
10843
|
+
oliveDrab: "#6b8e23",
|
|
10844
|
+
orange: "#ffa500",
|
|
10845
|
+
orangeRed: "#ff4500",
|
|
10846
|
+
orchid: "#da70d6",
|
|
10847
|
+
paleGoldenrod: "#eee8aa",
|
|
10848
|
+
paleGreen: "#98fb98",
|
|
10849
|
+
paleTurquoise: "#afeeee",
|
|
10850
|
+
paleVioletRed: "#db7093",
|
|
10851
|
+
papayaWhip: "#ffefd5",
|
|
10852
|
+
peachPuff: "#ffdab9",
|
|
10853
|
+
peru: "#cd853f",
|
|
10854
|
+
pink: "#ffc0cb",
|
|
10855
|
+
plum: "#dda0dd",
|
|
10856
|
+
powderBlue: "#b0e0e6",
|
|
10857
|
+
purple: "#800080",
|
|
10858
|
+
red: "#ff0000",
|
|
10859
|
+
rosyBrown: "#bc8f8f",
|
|
10860
|
+
royalBlue: "#4169e1",
|
|
10861
|
+
saddleBrown: "#8b4513",
|
|
10862
|
+
salmon: "#fa8072",
|
|
10863
|
+
sandyBrown: "#f4a460",
|
|
10864
|
+
seaGreen: "#2e8b57",
|
|
10865
|
+
seaShell: "#fff5ee",
|
|
10866
|
+
sienna: "#a0522d",
|
|
10867
|
+
silver: "#c0c0c0",
|
|
10868
|
+
skyBlue: "#87ceeb",
|
|
10869
|
+
slateBlue: "#6a5acd",
|
|
10870
|
+
slateGray: "#708090",
|
|
10871
|
+
snow: "#fffafa",
|
|
10872
|
+
springGreen: "#00ff7f",
|
|
10873
|
+
steelBlue: "#4682b4",
|
|
10874
|
+
tan: "#d2b48c",
|
|
10875
|
+
teal: "#008080",
|
|
10876
|
+
thistle: "#d8bfd8",
|
|
10877
|
+
tomato: "#ff6347",
|
|
10878
|
+
turquoise: "#40e0d0",
|
|
10879
|
+
violet: "#ee82ee",
|
|
10880
|
+
wheat: "#f5deb3",
|
|
10881
|
+
white: "#ffffff",
|
|
10882
|
+
whiteSmoke: "#f5f5f5",
|
|
10883
|
+
yellow: "#ffff00",
|
|
10884
|
+
yellowGreen: "#9acd32"
|
|
10885
|
+
}[name] ?? null;
|
|
10886
|
+
}
|
|
10887
|
+
function applyModifiersAndAlpha(color, elements) {
|
|
10888
|
+
let alpha = null;
|
|
10889
|
+
(elements || []).forEach((mod) => {
|
|
10890
|
+
if (mod.name === "a:shade") color = applyColorModifier(color, "shade", mod.attributes["val"]);
|
|
10891
|
+
else if (mod.name === "a:tint") color = applyColorModifier(color, "tint", mod.attributes["val"]);
|
|
10892
|
+
else if (mod.name === "a:lumMod") color = applyColorModifier(color, "lumMod", mod.attributes["val"]);
|
|
10893
|
+
else if (mod.name === "a:lumOff") color = applyColorModifier(color, "lumOff", mod.attributes["val"]);
|
|
10894
|
+
else if (mod.name === "a:alpha") alpha = parseInt(mod.attributes["val"]) / 1e5;
|
|
10895
|
+
});
|
|
10896
|
+
return {
|
|
10897
|
+
color,
|
|
10898
|
+
alpha
|
|
10899
|
+
};
|
|
10900
|
+
}
|
|
10901
|
+
function extractColorFromElement(element) {
|
|
10902
|
+
if (!element?.elements) return null;
|
|
10903
|
+
const schemeClr = element.elements.find((el) => el.name === "a:schemeClr");
|
|
10904
|
+
if (schemeClr) {
|
|
10905
|
+
const themeName = schemeClr.attributes?.["val"];
|
|
10906
|
+
return applyModifiersAndAlpha(getThemeColor(themeName), schemeClr.elements);
|
|
10907
|
+
}
|
|
10908
|
+
const srgbClr = element.elements.find((el) => el.name === "a:srgbClr");
|
|
10909
|
+
if (srgbClr) return applyModifiersAndAlpha("#" + srgbClr.attributes?.["val"], srgbClr.elements);
|
|
10910
|
+
const prstClr = element.elements.find((el) => el.name === "a:prstClr");
|
|
10911
|
+
if (prstClr) {
|
|
10912
|
+
const presetName = prstClr.attributes?.["val"];
|
|
10913
|
+
const baseColor = getPresetColor(presetName);
|
|
10914
|
+
if (!baseColor) return null;
|
|
10915
|
+
return applyModifiersAndAlpha(baseColor, prstClr.elements);
|
|
10916
|
+
}
|
|
10917
|
+
return null;
|
|
10918
|
+
}
|
|
10743
10919
|
function getThemeColor(name) {
|
|
10744
10920
|
return {
|
|
10745
10921
|
accent1: "#5b9bd5",
|
|
@@ -10788,9 +10964,13 @@ function applyColorModifier(hexColor, modifier, value) {
|
|
|
10788
10964
|
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
10789
10965
|
}
|
|
10790
10966
|
function extractStrokeWidth(spPr) {
|
|
10791
|
-
const
|
|
10792
|
-
if (!
|
|
10793
|
-
|
|
10967
|
+
const ln = spPr?.elements?.find((el) => el.name === "a:ln");
|
|
10968
|
+
if (!ln) return 1;
|
|
10969
|
+
const w$1 = ln.attributes?.["w"];
|
|
10970
|
+
if (w$1 == null) return 1;
|
|
10971
|
+
const emu = typeof w$1 === "string" ? parseFloat(w$1) : w$1;
|
|
10972
|
+
if (emu === 0) return .75;
|
|
10973
|
+
return emu * 72 / 914400;
|
|
10794
10974
|
}
|
|
10795
10975
|
function extractLineEnds(spPr) {
|
|
10796
10976
|
const ln = spPr?.elements?.find((el) => el.name === "a:ln");
|
|
@@ -10820,72 +11000,30 @@ function extractStrokeColor(spPr, style) {
|
|
|
10820
11000
|
if (ln.elements?.find((el) => el.name === "a:noFill")) return null;
|
|
10821
11001
|
const solidFill = ln.elements?.find((el) => el.name === "a:solidFill");
|
|
10822
11002
|
if (solidFill) {
|
|
10823
|
-
const
|
|
10824
|
-
if (
|
|
10825
|
-
const themeName$1 = schemeClr$1.attributes?.["val"];
|
|
10826
|
-
let color$1 = getThemeColor(themeName$1);
|
|
10827
|
-
(schemeClr$1.elements || []).forEach((mod) => {
|
|
10828
|
-
if (mod.name === "a:shade") color$1 = applyColorModifier(color$1, "shade", mod.attributes["val"]);
|
|
10829
|
-
else if (mod.name === "a:tint") color$1 = applyColorModifier(color$1, "tint", mod.attributes["val"]);
|
|
10830
|
-
else if (mod.name === "a:lumMod") color$1 = applyColorModifier(color$1, "lumMod", mod.attributes["val"]);
|
|
10831
|
-
});
|
|
10832
|
-
return color$1;
|
|
10833
|
-
}
|
|
10834
|
-
const srgbClr = solidFill.elements?.find((el) => el.name === "a:srgbClr");
|
|
10835
|
-
if (srgbClr) return "#" + srgbClr.attributes?.["val"];
|
|
11003
|
+
const result = extractColorFromElement(solidFill);
|
|
11004
|
+
if (result) return result.color;
|
|
10836
11005
|
}
|
|
10837
11006
|
}
|
|
10838
11007
|
if (!style) return null;
|
|
10839
11008
|
const lnRef = style.elements?.find((el) => el.name === "a:lnRef");
|
|
10840
11009
|
if (!lnRef) return null;
|
|
10841
11010
|
if (lnRef.attributes?.["idx"] === "0") return null;
|
|
10842
|
-
const
|
|
10843
|
-
if (
|
|
10844
|
-
|
|
10845
|
-
let color = getThemeColor(themeName);
|
|
10846
|
-
(schemeClr.elements || []).forEach((mod) => {
|
|
10847
|
-
if (mod.name === "a:shade") color = applyColorModifier(color, "shade", mod.attributes["val"]);
|
|
10848
|
-
else if (mod.name === "a:tint") color = applyColorModifier(color, "tint", mod.attributes["val"]);
|
|
10849
|
-
else if (mod.name === "a:lumMod") color = applyColorModifier(color, "lumMod", mod.attributes["val"]);
|
|
10850
|
-
else if (mod.name === "a:lumOff") color = applyColorModifier(color, "lumOff", mod.attributes["val"]);
|
|
10851
|
-
});
|
|
10852
|
-
return color;
|
|
11011
|
+
const lnRefResult = extractColorFromElement(lnRef);
|
|
11012
|
+
if (lnRefResult) return lnRefResult.color;
|
|
11013
|
+
return null;
|
|
10853
11014
|
}
|
|
10854
11015
|
function extractFillColor(spPr, style) {
|
|
10855
11016
|
if (spPr?.elements?.find((el) => el.name === "a:noFill")) return null;
|
|
10856
11017
|
const solidFill = spPr?.elements?.find((el) => el.name === "a:solidFill");
|
|
10857
11018
|
if (solidFill) {
|
|
10858
|
-
const
|
|
10859
|
-
if (
|
|
10860
|
-
|
|
10861
|
-
let color$1 = getThemeColor(themeName$1);
|
|
10862
|
-
let alpha = null;
|
|
10863
|
-
(schemeClr$1.elements || []).forEach((mod) => {
|
|
10864
|
-
if (mod.name === "a:shade") color$1 = applyColorModifier(color$1, "shade", mod.attributes["val"]);
|
|
10865
|
-
else if (mod.name === "a:tint") color$1 = applyColorModifier(color$1, "tint", mod.attributes["val"]);
|
|
10866
|
-
else if (mod.name === "a:lumMod") color$1 = applyColorModifier(color$1, "lumMod", mod.attributes["val"]);
|
|
10867
|
-
else if (mod.name === "a:lumOff") color$1 = applyColorModifier(color$1, "lumOff", mod.attributes["val"]);
|
|
10868
|
-
else if (mod.name === "a:alpha") alpha = parseInt(mod.attributes["val"]) / 1e5;
|
|
10869
|
-
});
|
|
10870
|
-
if (alpha !== null && alpha < 1) return {
|
|
10871
|
-
type: "solidWithAlpha",
|
|
10872
|
-
color: color$1,
|
|
10873
|
-
alpha
|
|
10874
|
-
};
|
|
10875
|
-
return color$1;
|
|
10876
|
-
}
|
|
10877
|
-
const srgbClr = solidFill.elements?.find((el) => el.name === "a:srgbClr");
|
|
10878
|
-
if (srgbClr) {
|
|
10879
|
-
let alpha = null;
|
|
10880
|
-
const alphaEl = srgbClr.elements?.find((el) => el.name === "a:alpha");
|
|
10881
|
-
if (alphaEl) alpha = parseInt(alphaEl.attributes?.["val"] || "100000", 10) / 1e5;
|
|
10882
|
-
const color$1 = "#" + srgbClr.attributes?.["val"];
|
|
10883
|
-
if (alpha !== null && alpha < 1) return {
|
|
11019
|
+
const result = extractColorFromElement(solidFill);
|
|
11020
|
+
if (result) {
|
|
11021
|
+
if (result.alpha !== null && result.alpha < 1) return {
|
|
10884
11022
|
type: "solidWithAlpha",
|
|
10885
|
-
color: color
|
|
10886
|
-
alpha
|
|
11023
|
+
color: result.color,
|
|
11024
|
+
alpha: result.alpha
|
|
10887
11025
|
};
|
|
10888
|
-
return color
|
|
11026
|
+
return result.color;
|
|
10889
11027
|
}
|
|
10890
11028
|
}
|
|
10891
11029
|
const gradFill = spPr?.elements?.find((el) => el.name === "a:gradFill");
|
|
@@ -10895,16 +11033,16 @@ function extractFillColor(spPr, style) {
|
|
|
10895
11033
|
const fillRef = style.elements?.find((el) => el.name === "a:fillRef");
|
|
10896
11034
|
if (!fillRef) return null;
|
|
10897
11035
|
if (fillRef.attributes?.["idx"] === "0") return null;
|
|
10898
|
-
const
|
|
10899
|
-
if (
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
}
|
|
10907
|
-
return
|
|
11036
|
+
const fillRefResult = extractColorFromElement(fillRef);
|
|
11037
|
+
if (fillRefResult) {
|
|
11038
|
+
if (fillRefResult.alpha !== null && fillRefResult.alpha < 1) return {
|
|
11039
|
+
type: "solidWithAlpha",
|
|
11040
|
+
color: fillRefResult.color,
|
|
11041
|
+
alpha: fillRefResult.alpha
|
|
11042
|
+
};
|
|
11043
|
+
return fillRefResult.color;
|
|
11044
|
+
}
|
|
11045
|
+
return null;
|
|
10908
11046
|
}
|
|
10909
11047
|
function extractGradientFill(gradFill) {
|
|
10910
11048
|
const gradient = {
|
|
@@ -33599,7 +33737,7 @@ var SuperConverter = class SuperConverter {
|
|
|
33599
33737
|
static getStoredSuperdocVersion(docx) {
|
|
33600
33738
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
33601
33739
|
}
|
|
33602
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.
|
|
33740
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.15.0-next.2") {
|
|
33603
33741
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
33604
33742
|
}
|
|
33605
33743
|
static generateWordTimestamp() {
|
|
@@ -10728,6 +10728,182 @@ var PluginKey = class {
|
|
|
10728
10728
|
return state[this.key];
|
|
10729
10729
|
}
|
|
10730
10730
|
};
|
|
10731
|
+
function getPresetColor(name) {
|
|
10732
|
+
return {
|
|
10733
|
+
aliceBlue: "#f0f8ff",
|
|
10734
|
+
antiqueWhite: "#faebd7",
|
|
10735
|
+
aqua: "#00ffff",
|
|
10736
|
+
aquamarine: "#7fffd4",
|
|
10737
|
+
azure: "#f0ffff",
|
|
10738
|
+
beige: "#f5f5dc",
|
|
10739
|
+
bisque: "#ffe4c4",
|
|
10740
|
+
black: "#000000",
|
|
10741
|
+
blanchedAlmond: "#ffebcd",
|
|
10742
|
+
blue: "#0000ff",
|
|
10743
|
+
blueViolet: "#8a2be2",
|
|
10744
|
+
brown: "#a52a2a",
|
|
10745
|
+
burlyWood: "#deb887",
|
|
10746
|
+
cadetBlue: "#5f9ea0",
|
|
10747
|
+
chartreuse: "#7fff00",
|
|
10748
|
+
chocolate: "#d2691e",
|
|
10749
|
+
coral: "#ff7f50",
|
|
10750
|
+
cornflowerBlue: "#6495ed",
|
|
10751
|
+
cornsilk: "#fff8dc",
|
|
10752
|
+
crimson: "#dc143c",
|
|
10753
|
+
cyan: "#00ffff",
|
|
10754
|
+
dkBlue: "#00008b",
|
|
10755
|
+
dkCyan: "#008b8b",
|
|
10756
|
+
dkGoldenrod: "#b8860b",
|
|
10757
|
+
dkGray: "#a9a9a9",
|
|
10758
|
+
dkGreen: "#006400",
|
|
10759
|
+
dkKhaki: "#bdb76b",
|
|
10760
|
+
dkMagenta: "#8b008b",
|
|
10761
|
+
dkOliveGreen: "#556b2f",
|
|
10762
|
+
dkOrange: "#ff8c00",
|
|
10763
|
+
dkOrchid: "#9932cc",
|
|
10764
|
+
dkRed: "#8b0000",
|
|
10765
|
+
dkSalmon: "#e9967a",
|
|
10766
|
+
dkSeaGreen: "#8fbc8f",
|
|
10767
|
+
dkSlateBlue: "#483d8b",
|
|
10768
|
+
dkSlateGray: "#2f4f4f",
|
|
10769
|
+
dkTurquoise: "#00ced1",
|
|
10770
|
+
dkViolet: "#9400d3",
|
|
10771
|
+
deepPink: "#ff1493",
|
|
10772
|
+
deepSkyBlue: "#00bfff",
|
|
10773
|
+
dimGray: "#696969",
|
|
10774
|
+
dodgerBlue: "#1e90ff",
|
|
10775
|
+
firebrick: "#b22222",
|
|
10776
|
+
floralWhite: "#fffaf0",
|
|
10777
|
+
forestGreen: "#228b22",
|
|
10778
|
+
fuchsia: "#ff00ff",
|
|
10779
|
+
gainsboro: "#dcdcdc",
|
|
10780
|
+
ghostWhite: "#f8f8ff",
|
|
10781
|
+
gold: "#ffd700",
|
|
10782
|
+
goldenrod: "#daa520",
|
|
10783
|
+
gray: "#808080",
|
|
10784
|
+
green: "#008000",
|
|
10785
|
+
greenYellow: "#adff2f",
|
|
10786
|
+
honeydew: "#f0fff0",
|
|
10787
|
+
hotPink: "#ff69b4",
|
|
10788
|
+
indianRed: "#cd5c5c",
|
|
10789
|
+
indigo: "#4b0082",
|
|
10790
|
+
ivory: "#fffff0",
|
|
10791
|
+
khaki: "#f0e68c",
|
|
10792
|
+
lavender: "#e6e6fa",
|
|
10793
|
+
lavenderBlush: "#fff0f5",
|
|
10794
|
+
lawnGreen: "#7cfc00",
|
|
10795
|
+
lemonChiffon: "#fffacd",
|
|
10796
|
+
ltBlue: "#add8e6",
|
|
10797
|
+
ltCoral: "#f08080",
|
|
10798
|
+
ltCyan: "#e0ffff",
|
|
10799
|
+
ltGoldenrodYellow: "#fafad2",
|
|
10800
|
+
ltGray: "#d3d3d3",
|
|
10801
|
+
ltGreen: "#90ee90",
|
|
10802
|
+
ltPink: "#ffb6c1",
|
|
10803
|
+
ltSalmon: "#ffa07a",
|
|
10804
|
+
ltSeaGreen: "#20b2aa",
|
|
10805
|
+
ltSkyBlue: "#87cefa",
|
|
10806
|
+
ltSlateGray: "#778899",
|
|
10807
|
+
ltSteelBlue: "#b0c4de",
|
|
10808
|
+
ltYellow: "#ffffe0",
|
|
10809
|
+
lime: "#00ff00",
|
|
10810
|
+
limeGreen: "#32cd32",
|
|
10811
|
+
linen: "#faf0e6",
|
|
10812
|
+
magenta: "#ff00ff",
|
|
10813
|
+
maroon: "#800000",
|
|
10814
|
+
medAquamarine: "#66cdaa",
|
|
10815
|
+
medBlue: "#0000cd",
|
|
10816
|
+
medOrchid: "#ba55d3",
|
|
10817
|
+
medPurple: "#9370db",
|
|
10818
|
+
medSeaGreen: "#3cb371",
|
|
10819
|
+
medSlateBlue: "#7b68ee",
|
|
10820
|
+
medSpringGreen: "#00fa9a",
|
|
10821
|
+
medTurquoise: "#48d1cc",
|
|
10822
|
+
medVioletRed: "#c71585",
|
|
10823
|
+
midnightBlue: "#191970",
|
|
10824
|
+
mintCream: "#f5fffa",
|
|
10825
|
+
mistyRose: "#ffe4e1",
|
|
10826
|
+
moccasin: "#ffe4b5",
|
|
10827
|
+
navajoWhite: "#ffdead",
|
|
10828
|
+
navy: "#000080",
|
|
10829
|
+
oldLace: "#fdf5e6",
|
|
10830
|
+
olive: "#808000",
|
|
10831
|
+
oliveDrab: "#6b8e23",
|
|
10832
|
+
orange: "#ffa500",
|
|
10833
|
+
orangeRed: "#ff4500",
|
|
10834
|
+
orchid: "#da70d6",
|
|
10835
|
+
paleGoldenrod: "#eee8aa",
|
|
10836
|
+
paleGreen: "#98fb98",
|
|
10837
|
+
paleTurquoise: "#afeeee",
|
|
10838
|
+
paleVioletRed: "#db7093",
|
|
10839
|
+
papayaWhip: "#ffefd5",
|
|
10840
|
+
peachPuff: "#ffdab9",
|
|
10841
|
+
peru: "#cd853f",
|
|
10842
|
+
pink: "#ffc0cb",
|
|
10843
|
+
plum: "#dda0dd",
|
|
10844
|
+
powderBlue: "#b0e0e6",
|
|
10845
|
+
purple: "#800080",
|
|
10846
|
+
red: "#ff0000",
|
|
10847
|
+
rosyBrown: "#bc8f8f",
|
|
10848
|
+
royalBlue: "#4169e1",
|
|
10849
|
+
saddleBrown: "#8b4513",
|
|
10850
|
+
salmon: "#fa8072",
|
|
10851
|
+
sandyBrown: "#f4a460",
|
|
10852
|
+
seaGreen: "#2e8b57",
|
|
10853
|
+
seaShell: "#fff5ee",
|
|
10854
|
+
sienna: "#a0522d",
|
|
10855
|
+
silver: "#c0c0c0",
|
|
10856
|
+
skyBlue: "#87ceeb",
|
|
10857
|
+
slateBlue: "#6a5acd",
|
|
10858
|
+
slateGray: "#708090",
|
|
10859
|
+
snow: "#fffafa",
|
|
10860
|
+
springGreen: "#00ff7f",
|
|
10861
|
+
steelBlue: "#4682b4",
|
|
10862
|
+
tan: "#d2b48c",
|
|
10863
|
+
teal: "#008080",
|
|
10864
|
+
thistle: "#d8bfd8",
|
|
10865
|
+
tomato: "#ff6347",
|
|
10866
|
+
turquoise: "#40e0d0",
|
|
10867
|
+
violet: "#ee82ee",
|
|
10868
|
+
wheat: "#f5deb3",
|
|
10869
|
+
white: "#ffffff",
|
|
10870
|
+
whiteSmoke: "#f5f5f5",
|
|
10871
|
+
yellow: "#ffff00",
|
|
10872
|
+
yellowGreen: "#9acd32"
|
|
10873
|
+
}[name] ?? null;
|
|
10874
|
+
}
|
|
10875
|
+
function applyModifiersAndAlpha(color, elements) {
|
|
10876
|
+
let alpha = null;
|
|
10877
|
+
(elements || []).forEach((mod) => {
|
|
10878
|
+
if (mod.name === "a:shade") color = applyColorModifier(color, "shade", mod.attributes["val"]);
|
|
10879
|
+
else if (mod.name === "a:tint") color = applyColorModifier(color, "tint", mod.attributes["val"]);
|
|
10880
|
+
else if (mod.name === "a:lumMod") color = applyColorModifier(color, "lumMod", mod.attributes["val"]);
|
|
10881
|
+
else if (mod.name === "a:lumOff") color = applyColorModifier(color, "lumOff", mod.attributes["val"]);
|
|
10882
|
+
else if (mod.name === "a:alpha") alpha = parseInt(mod.attributes["val"]) / 1e5;
|
|
10883
|
+
});
|
|
10884
|
+
return {
|
|
10885
|
+
color,
|
|
10886
|
+
alpha
|
|
10887
|
+
};
|
|
10888
|
+
}
|
|
10889
|
+
function extractColorFromElement(element) {
|
|
10890
|
+
if (!element?.elements) return null;
|
|
10891
|
+
const schemeClr = element.elements.find((el) => el.name === "a:schemeClr");
|
|
10892
|
+
if (schemeClr) {
|
|
10893
|
+
const themeName = schemeClr.attributes?.["val"];
|
|
10894
|
+
return applyModifiersAndAlpha(getThemeColor(themeName), schemeClr.elements);
|
|
10895
|
+
}
|
|
10896
|
+
const srgbClr = element.elements.find((el) => el.name === "a:srgbClr");
|
|
10897
|
+
if (srgbClr) return applyModifiersAndAlpha("#" + srgbClr.attributes?.["val"], srgbClr.elements);
|
|
10898
|
+
const prstClr = element.elements.find((el) => el.name === "a:prstClr");
|
|
10899
|
+
if (prstClr) {
|
|
10900
|
+
const presetName = prstClr.attributes?.["val"];
|
|
10901
|
+
const baseColor = getPresetColor(presetName);
|
|
10902
|
+
if (!baseColor) return null;
|
|
10903
|
+
return applyModifiersAndAlpha(baseColor, prstClr.elements);
|
|
10904
|
+
}
|
|
10905
|
+
return null;
|
|
10906
|
+
}
|
|
10731
10907
|
function getThemeColor(name) {
|
|
10732
10908
|
return {
|
|
10733
10909
|
accent1: "#5b9bd5",
|
|
@@ -10776,9 +10952,13 @@ function applyColorModifier(hexColor, modifier, value) {
|
|
|
10776
10952
|
return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
|
|
10777
10953
|
}
|
|
10778
10954
|
function extractStrokeWidth(spPr) {
|
|
10779
|
-
const
|
|
10780
|
-
if (!
|
|
10781
|
-
|
|
10955
|
+
const ln = spPr?.elements?.find((el) => el.name === "a:ln");
|
|
10956
|
+
if (!ln) return 1;
|
|
10957
|
+
const w$1 = ln.attributes?.["w"];
|
|
10958
|
+
if (w$1 == null) return 1;
|
|
10959
|
+
const emu = typeof w$1 === "string" ? parseFloat(w$1) : w$1;
|
|
10960
|
+
if (emu === 0) return .75;
|
|
10961
|
+
return emu * 72 / 914400;
|
|
10782
10962
|
}
|
|
10783
10963
|
function extractLineEnds(spPr) {
|
|
10784
10964
|
const ln = spPr?.elements?.find((el) => el.name === "a:ln");
|
|
@@ -10808,72 +10988,30 @@ function extractStrokeColor(spPr, style) {
|
|
|
10808
10988
|
if (ln.elements?.find((el) => el.name === "a:noFill")) return null;
|
|
10809
10989
|
const solidFill = ln.elements?.find((el) => el.name === "a:solidFill");
|
|
10810
10990
|
if (solidFill) {
|
|
10811
|
-
const
|
|
10812
|
-
if (
|
|
10813
|
-
const themeName$1 = schemeClr$1.attributes?.["val"];
|
|
10814
|
-
let color$1 = getThemeColor(themeName$1);
|
|
10815
|
-
(schemeClr$1.elements || []).forEach((mod) => {
|
|
10816
|
-
if (mod.name === "a:shade") color$1 = applyColorModifier(color$1, "shade", mod.attributes["val"]);
|
|
10817
|
-
else if (mod.name === "a:tint") color$1 = applyColorModifier(color$1, "tint", mod.attributes["val"]);
|
|
10818
|
-
else if (mod.name === "a:lumMod") color$1 = applyColorModifier(color$1, "lumMod", mod.attributes["val"]);
|
|
10819
|
-
});
|
|
10820
|
-
return color$1;
|
|
10821
|
-
}
|
|
10822
|
-
const srgbClr = solidFill.elements?.find((el) => el.name === "a:srgbClr");
|
|
10823
|
-
if (srgbClr) return "#" + srgbClr.attributes?.["val"];
|
|
10991
|
+
const result = extractColorFromElement(solidFill);
|
|
10992
|
+
if (result) return result.color;
|
|
10824
10993
|
}
|
|
10825
10994
|
}
|
|
10826
10995
|
if (!style) return null;
|
|
10827
10996
|
const lnRef = style.elements?.find((el) => el.name === "a:lnRef");
|
|
10828
10997
|
if (!lnRef) return null;
|
|
10829
10998
|
if (lnRef.attributes?.["idx"] === "0") return null;
|
|
10830
|
-
const
|
|
10831
|
-
if (
|
|
10832
|
-
|
|
10833
|
-
let color = getThemeColor(themeName);
|
|
10834
|
-
(schemeClr.elements || []).forEach((mod) => {
|
|
10835
|
-
if (mod.name === "a:shade") color = applyColorModifier(color, "shade", mod.attributes["val"]);
|
|
10836
|
-
else if (mod.name === "a:tint") color = applyColorModifier(color, "tint", mod.attributes["val"]);
|
|
10837
|
-
else if (mod.name === "a:lumMod") color = applyColorModifier(color, "lumMod", mod.attributes["val"]);
|
|
10838
|
-
else if (mod.name === "a:lumOff") color = applyColorModifier(color, "lumOff", mod.attributes["val"]);
|
|
10839
|
-
});
|
|
10840
|
-
return color;
|
|
10999
|
+
const lnRefResult = extractColorFromElement(lnRef);
|
|
11000
|
+
if (lnRefResult) return lnRefResult.color;
|
|
11001
|
+
return null;
|
|
10841
11002
|
}
|
|
10842
11003
|
function extractFillColor(spPr, style) {
|
|
10843
11004
|
if (spPr?.elements?.find((el) => el.name === "a:noFill")) return null;
|
|
10844
11005
|
const solidFill = spPr?.elements?.find((el) => el.name === "a:solidFill");
|
|
10845
11006
|
if (solidFill) {
|
|
10846
|
-
const
|
|
10847
|
-
if (
|
|
10848
|
-
|
|
10849
|
-
let color$1 = getThemeColor(themeName$1);
|
|
10850
|
-
let alpha = null;
|
|
10851
|
-
(schemeClr$1.elements || []).forEach((mod) => {
|
|
10852
|
-
if (mod.name === "a:shade") color$1 = applyColorModifier(color$1, "shade", mod.attributes["val"]);
|
|
10853
|
-
else if (mod.name === "a:tint") color$1 = applyColorModifier(color$1, "tint", mod.attributes["val"]);
|
|
10854
|
-
else if (mod.name === "a:lumMod") color$1 = applyColorModifier(color$1, "lumMod", mod.attributes["val"]);
|
|
10855
|
-
else if (mod.name === "a:lumOff") color$1 = applyColorModifier(color$1, "lumOff", mod.attributes["val"]);
|
|
10856
|
-
else if (mod.name === "a:alpha") alpha = parseInt(mod.attributes["val"]) / 1e5;
|
|
10857
|
-
});
|
|
10858
|
-
if (alpha !== null && alpha < 1) return {
|
|
10859
|
-
type: "solidWithAlpha",
|
|
10860
|
-
color: color$1,
|
|
10861
|
-
alpha
|
|
10862
|
-
};
|
|
10863
|
-
return color$1;
|
|
10864
|
-
}
|
|
10865
|
-
const srgbClr = solidFill.elements?.find((el) => el.name === "a:srgbClr");
|
|
10866
|
-
if (srgbClr) {
|
|
10867
|
-
let alpha = null;
|
|
10868
|
-
const alphaEl = srgbClr.elements?.find((el) => el.name === "a:alpha");
|
|
10869
|
-
if (alphaEl) alpha = parseInt(alphaEl.attributes?.["val"] || "100000", 10) / 1e5;
|
|
10870
|
-
const color$1 = "#" + srgbClr.attributes?.["val"];
|
|
10871
|
-
if (alpha !== null && alpha < 1) return {
|
|
11007
|
+
const result = extractColorFromElement(solidFill);
|
|
11008
|
+
if (result) {
|
|
11009
|
+
if (result.alpha !== null && result.alpha < 1) return {
|
|
10872
11010
|
type: "solidWithAlpha",
|
|
10873
|
-
color: color
|
|
10874
|
-
alpha
|
|
11011
|
+
color: result.color,
|
|
11012
|
+
alpha: result.alpha
|
|
10875
11013
|
};
|
|
10876
|
-
return color
|
|
11014
|
+
return result.color;
|
|
10877
11015
|
}
|
|
10878
11016
|
}
|
|
10879
11017
|
const gradFill = spPr?.elements?.find((el) => el.name === "a:gradFill");
|
|
@@ -10883,16 +11021,16 @@ function extractFillColor(spPr, style) {
|
|
|
10883
11021
|
const fillRef = style.elements?.find((el) => el.name === "a:fillRef");
|
|
10884
11022
|
if (!fillRef) return null;
|
|
10885
11023
|
if (fillRef.attributes?.["idx"] === "0") return null;
|
|
10886
|
-
const
|
|
10887
|
-
if (
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
}
|
|
10895
|
-
return
|
|
11024
|
+
const fillRefResult = extractColorFromElement(fillRef);
|
|
11025
|
+
if (fillRefResult) {
|
|
11026
|
+
if (fillRefResult.alpha !== null && fillRefResult.alpha < 1) return {
|
|
11027
|
+
type: "solidWithAlpha",
|
|
11028
|
+
color: fillRefResult.color,
|
|
11029
|
+
alpha: fillRefResult.alpha
|
|
11030
|
+
};
|
|
11031
|
+
return fillRefResult.color;
|
|
11032
|
+
}
|
|
11033
|
+
return null;
|
|
10896
11034
|
}
|
|
10897
11035
|
function extractGradientFill(gradFill) {
|
|
10898
11036
|
const gradient = {
|
|
@@ -33581,7 +33719,7 @@ var SuperConverter = class SuperConverter {
|
|
|
33581
33719
|
static getStoredSuperdocVersion(docx) {
|
|
33582
33720
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
33583
33721
|
}
|
|
33584
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.
|
|
33722
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.15.0-next.2") {
|
|
33585
33723
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
33586
33724
|
}
|
|
33587
33725
|
static generateWordTimestamp() {
|