ooxml-core 1.43.0 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +152 -68
- package/dist/index.mjs +153 -69
- package/dist/opc/declared-fonts.d.ts +9 -0
- package/dist/opc/declared-fonts.d.ts.map +1 -0
- package/dist/opc/index.cjs +84 -0
- package/dist/opc/index.d.ts +1 -0
- package/dist/opc/index.d.ts.map +1 -1
- package/dist/opc/index.mjs +85 -2
- package/dist/xlsx/ui/index.cjs +40 -5
- package/dist/xlsx/ui/index.mjs +40 -5
- package/dist/xlsx/ui/locales/de/options.d.ts.map +1 -1
- package/dist/xlsx/ui/locales/en/options.d.ts.map +1 -1
- package/dist/xlsx/ui/locales/es/options.d.ts.map +1 -1
- package/dist/xlsx/ui/locales/fr/options.d.ts.map +1 -1
- package/dist/xlsx/ui/locales/zh-CN/options.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14811,28 +14811,28 @@ function fillChild(doc, fill) {
|
|
|
14811
14811
|
}
|
|
14812
14812
|
function modelledChildren(doc, value) {
|
|
14813
14813
|
const out = [];
|
|
14814
|
-
const
|
|
14814
|
+
const add3 = (name2, node) => out.push({ name: name2, node });
|
|
14815
14815
|
if (value.line || value.lineSourceXml) {
|
|
14816
14816
|
const ln = value.lineSourceXml ? importDrawingXml(doc, value.lineSourceXml) : drawingElement(doc, "ln");
|
|
14817
14817
|
if (value.line) patchDrawingLine(ln, value.line);
|
|
14818
|
-
|
|
14818
|
+
add3("ln", ln);
|
|
14819
14819
|
}
|
|
14820
14820
|
const fill = fillChild(doc, value.fill);
|
|
14821
14821
|
if (fill) out.push(fill);
|
|
14822
14822
|
if (value.highlight) {
|
|
14823
14823
|
const highlight = drawingElement(doc, "highlight");
|
|
14824
14824
|
highlight.appendChild(importDrawingXml(doc, drawingColorXml(value.highlight)));
|
|
14825
|
-
|
|
14825
|
+
add3("highlight", highlight);
|
|
14826
14826
|
}
|
|
14827
|
-
if (value.underlineLineFollowsText)
|
|
14828
|
-
else if (value.underlineLineXml)
|
|
14829
|
-
if (value.underlineFillFollowsText)
|
|
14827
|
+
if (value.underlineLineFollowsText) add3("uLnTx", drawingElement(doc, "uLnTx"));
|
|
14828
|
+
else if (value.underlineLineXml) add3("uLn", importDrawingXml(doc, value.underlineLineXml));
|
|
14829
|
+
if (value.underlineFillFollowsText) add3("uFillTx", drawingElement(doc, "uFillTx"));
|
|
14830
14830
|
else {
|
|
14831
14831
|
const underline = fillChild(doc, value.underlineFill);
|
|
14832
14832
|
if (underline) {
|
|
14833
14833
|
const uFill = drawingElement(doc, "uFill");
|
|
14834
14834
|
uFill.appendChild(underline.node);
|
|
14835
|
-
|
|
14835
|
+
add3("uFill", uFill);
|
|
14836
14836
|
}
|
|
14837
14837
|
}
|
|
14838
14838
|
for (const [local, key] of [
|
|
@@ -14842,16 +14842,16 @@ function modelledChildren(doc, value) {
|
|
|
14842
14842
|
["sym", "symbol"]
|
|
14843
14843
|
]) {
|
|
14844
14844
|
const font = value[key];
|
|
14845
|
-
if (font)
|
|
14845
|
+
if (font) add3(local, writeDrawingFont(doc, local, font));
|
|
14846
14846
|
}
|
|
14847
14847
|
if (value.hyperlinkClick)
|
|
14848
|
-
|
|
14848
|
+
add3("hlinkClick", writeHyperlink(doc, "hlinkClick", value.hyperlinkClick));
|
|
14849
14849
|
if (value.hyperlinkMouseOver)
|
|
14850
|
-
|
|
14850
|
+
add3("hlinkMouseOver", writeHyperlink(doc, "hlinkMouseOver", value.hyperlinkMouseOver));
|
|
14851
14851
|
if (value.rightToLeft !== void 0) {
|
|
14852
14852
|
const rtl = drawingElement(doc, "rtl");
|
|
14853
14853
|
if (!value.rightToLeft) rtl.setAttribute("val", "0");
|
|
14854
|
-
|
|
14854
|
+
add3("rtl", rtl);
|
|
14855
14855
|
}
|
|
14856
14856
|
return out;
|
|
14857
14857
|
}
|
|
@@ -14913,35 +14913,35 @@ function setAttributes2(element4, value) {
|
|
|
14913
14913
|
}
|
|
14914
14914
|
function bulletChildren(doc, value) {
|
|
14915
14915
|
const out = [];
|
|
14916
|
-
const
|
|
14917
|
-
if (value.bulletColor === "text")
|
|
14916
|
+
const add3 = (name2, node) => out.push({ name: name2, node });
|
|
14917
|
+
if (value.bulletColor === "text") add3("buClrTx", drawingElement(doc, "buClrTx"));
|
|
14918
14918
|
else if (value.bulletColor) {
|
|
14919
14919
|
const color2 = drawingElement(doc, "buClr");
|
|
14920
14920
|
color2.appendChild(importDrawingXml(doc, drawingColorXml(value.bulletColor)));
|
|
14921
|
-
|
|
14921
|
+
add3("buClr", color2);
|
|
14922
14922
|
}
|
|
14923
14923
|
const size = value.bulletSize;
|
|
14924
|
-
if (size === "text")
|
|
14924
|
+
if (size === "text") add3("buSzTx", drawingElement(doc, "buSzTx"));
|
|
14925
14925
|
else if (size) {
|
|
14926
14926
|
const local = size.unit === "percent" ? "buSzPct" : "buSzPts";
|
|
14927
14927
|
const element4 = drawingElement(doc, local);
|
|
14928
14928
|
setScaled(element4, "val", size.value, size.unit === "percent" ? 1e5 : 100);
|
|
14929
|
-
|
|
14929
|
+
add3(local, element4);
|
|
14930
14930
|
}
|
|
14931
|
-
if (value.bulletFont === "text")
|
|
14932
|
-
else if (value.bulletFont)
|
|
14931
|
+
if (value.bulletFont === "text") add3("buFontTx", drawingElement(doc, "buFontTx"));
|
|
14932
|
+
else if (value.bulletFont) add3("buFont", writeDrawingFont(doc, "buFont", value.bulletFont));
|
|
14933
14933
|
const bullet = value.bullet;
|
|
14934
|
-
if (bullet?.kind === "none")
|
|
14934
|
+
if (bullet?.kind === "none") add3("buNone", drawingElement(doc, "buNone"));
|
|
14935
14935
|
else if (bullet?.kind === "char") {
|
|
14936
14936
|
const element4 = drawingElement(doc, "buChar");
|
|
14937
14937
|
element4.setAttribute("char", bullet.char);
|
|
14938
|
-
|
|
14938
|
+
add3("buChar", element4);
|
|
14939
14939
|
} else if (bullet?.kind === "autoNumber") {
|
|
14940
14940
|
const element4 = drawingElement(doc, "buAutoNum");
|
|
14941
14941
|
element4.setAttribute("type", bullet.scheme);
|
|
14942
14942
|
setValue(element4, "startAt", bullet.startAt);
|
|
14943
|
-
|
|
14944
|
-
} else if (bullet?.kind === "picture")
|
|
14943
|
+
add3("buAutoNum", element4);
|
|
14944
|
+
} else if (bullet?.kind === "picture") add3("buBlip", importDrawingXml(doc, bullet.xml));
|
|
14945
14945
|
return out;
|
|
14946
14946
|
}
|
|
14947
14947
|
function writeDrawingParagraphProperties(doc, value, local = "pPr") {
|
|
@@ -20339,22 +20339,22 @@ function patchRange(labels2, range2, show) {
|
|
|
20339
20339
|
for (const child6 of elements(ext))
|
|
20340
20340
|
if (child6.namespaceURI === C15 && ["datalabelsRange", "showDataLabelsRange"].includes(child6.localName))
|
|
20341
20341
|
ext.removeChild(child6);
|
|
20342
|
-
const
|
|
20342
|
+
const add3 = (parent, ns, name2, text3) => {
|
|
20343
20343
|
const node = root.ownerDocument.createElementNS(ns, name2);
|
|
20344
20344
|
if (text3 !== void 0) node.textContent = text3;
|
|
20345
20345
|
parent.appendChild(node);
|
|
20346
20346
|
return node;
|
|
20347
20347
|
};
|
|
20348
20348
|
if (range2) {
|
|
20349
|
-
|
|
20350
|
-
const node =
|
|
20351
|
-
|
|
20352
|
-
const cache =
|
|
20353
|
-
|
|
20349
|
+
add3(ext, C15, "c15:showDataLabelsRange").setAttribute("val", show ? "1" : "0");
|
|
20350
|
+
const node = add3(ext, C15, "c15:datalabelsRange");
|
|
20351
|
+
add3(node, C15, "c15:f", range2.formula);
|
|
20352
|
+
const cache = add3(node, C15, "c15:dlblRangeCache");
|
|
20353
|
+
add3(cache, NS.c, "c:ptCount").setAttribute("val", String(range2.cache.length));
|
|
20354
20354
|
range2.cache.forEach((text3, index) => {
|
|
20355
|
-
const pt2 =
|
|
20355
|
+
const pt2 = add3(cache, NS.c, "c:pt");
|
|
20356
20356
|
pt2.setAttribute("idx", String(index));
|
|
20357
|
-
|
|
20357
|
+
add3(pt2, NS.c, "c:v", text3);
|
|
20358
20358
|
});
|
|
20359
20359
|
}
|
|
20360
20360
|
if (!elements(ext).length) root.removeChild(ext);
|
|
@@ -24294,14 +24294,14 @@ function components(outline2) {
|
|
|
24294
24294
|
function subsetTrueType(font, used) {
|
|
24295
24295
|
const glyphs = [0];
|
|
24296
24296
|
const mapped = /* @__PURE__ */ new Map([[0, 0]]);
|
|
24297
|
-
const
|
|
24297
|
+
const add3 = (glyph2) => {
|
|
24298
24298
|
if (mapped.has(glyph2) || glyph2 >= font.glyphCount) return;
|
|
24299
24299
|
mapped.set(glyph2, glyphs.length);
|
|
24300
24300
|
glyphs.push(glyph2);
|
|
24301
24301
|
};
|
|
24302
|
-
for (const glyph2 of used)
|
|
24302
|
+
for (const glyph2 of used) add3(glyph2);
|
|
24303
24303
|
for (let index = 1; index < glyphs.length; index++)
|
|
24304
|
-
for (const part of components(font.outline(glyphs[index])))
|
|
24304
|
+
for (const part of components(font.outline(glyphs[index]))) add3(part.glyph);
|
|
24305
24305
|
const outlines = glyphs.map((glyph2) => {
|
|
24306
24306
|
const source2 = font.outline(glyph2);
|
|
24307
24307
|
if (!source2.length) return source2;
|
|
@@ -43861,7 +43861,7 @@ function siblingGroupOf(node, parentOf, childrenOf, roots2) {
|
|
|
43861
43861
|
function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
|
|
43862
43862
|
const out = [];
|
|
43863
43863
|
const seen = /* @__PURE__ */ new Set();
|
|
43864
|
-
const
|
|
43864
|
+
const add3 = (node) => {
|
|
43865
43865
|
if (!seen.has(node.id)) {
|
|
43866
43866
|
seen.add(node.id);
|
|
43867
43867
|
out.push(node);
|
|
@@ -43869,13 +43869,13 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
|
|
|
43869
43869
|
};
|
|
43870
43870
|
const addAll = (list2) => {
|
|
43871
43871
|
for (const node of list2) {
|
|
43872
|
-
|
|
43872
|
+
add3(node);
|
|
43873
43873
|
}
|
|
43874
43874
|
};
|
|
43875
43875
|
for (const node of current) {
|
|
43876
43876
|
switch (axis) {
|
|
43877
43877
|
case "self":
|
|
43878
|
-
|
|
43878
|
+
add3(node);
|
|
43879
43879
|
break;
|
|
43880
43880
|
case "ch":
|
|
43881
43881
|
addAll(childrenOf.get(node.id) ?? []);
|
|
@@ -43884,13 +43884,13 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
|
|
|
43884
43884
|
addAll(descendantsOf(node, childrenOf));
|
|
43885
43885
|
break;
|
|
43886
43886
|
case "desOrSelf":
|
|
43887
|
-
|
|
43887
|
+
add3(node);
|
|
43888
43888
|
addAll(descendantsOf(node, childrenOf));
|
|
43889
43889
|
break;
|
|
43890
43890
|
case "par": {
|
|
43891
43891
|
const parent = parentOf.get(node.id);
|
|
43892
43892
|
if (parent) {
|
|
43893
|
-
|
|
43893
|
+
add3(parent);
|
|
43894
43894
|
}
|
|
43895
43895
|
break;
|
|
43896
43896
|
}
|
|
@@ -43898,7 +43898,7 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
|
|
|
43898
43898
|
addAll(ancestorsOf(node, parentOf));
|
|
43899
43899
|
break;
|
|
43900
43900
|
case "ancstOrSelf":
|
|
43901
|
-
|
|
43901
|
+
add3(node);
|
|
43902
43902
|
addAll(ancestorsOf(node, parentOf));
|
|
43903
43903
|
break;
|
|
43904
43904
|
case "followSib":
|
|
@@ -43925,7 +43925,7 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots2) {
|
|
|
43925
43925
|
}
|
|
43926
43926
|
case "root": {
|
|
43927
43927
|
const ancestors = ancestorsOf(node, parentOf);
|
|
43928
|
-
|
|
43928
|
+
add3(ancestors.length > 0 ? ancestors[ancestors.length - 1] : node);
|
|
43929
43929
|
break;
|
|
43930
43930
|
}
|
|
43931
43931
|
}
|
|
@@ -53104,8 +53104,8 @@ function applyOperation(data, edit, options2) {
|
|
|
53104
53104
|
if (edit.position === "below") return addDiagramNodeBelow(data, edit.nodeId, text3, options2);
|
|
53105
53105
|
if (edit.position === "above")
|
|
53106
53106
|
return edit.nodeId ? addDiagramNodeAbove(data, edit.nodeId, text3, options2) : data;
|
|
53107
|
-
const
|
|
53108
|
-
return
|
|
53107
|
+
const add3 = edit.position === "after" ? addDiagramNodeAfter : addDiagramNodeBefore;
|
|
53108
|
+
return add3(data, text3, edit.nodeId, options2);
|
|
53109
53109
|
}
|
|
53110
53110
|
case "remove":
|
|
53111
53111
|
return removeDiagramNode(data, edit.nodeId);
|
|
@@ -54297,8 +54297,8 @@ function parseDefinitionHeader(root) {
|
|
|
54297
54297
|
uniqueId: stringAttribute(root, "uniqueId") ?? "",
|
|
54298
54298
|
categories: children(first(root, "catLst", NS.dgm) ?? root, "cat", NS.dgm).flatMap((cat) => {
|
|
54299
54299
|
const type = stringAttribute(cat, "type");
|
|
54300
|
-
const
|
|
54301
|
-
return type ? [{ type, ...Number.isFinite(
|
|
54300
|
+
const priority2 = Number.parseInt(cat.getAttribute("pri") ?? "", 10);
|
|
54301
|
+
return type ? [{ type, ...Number.isFinite(priority2) ? { priority: priority2 } : {} }] : [];
|
|
54302
54302
|
})
|
|
54303
54303
|
};
|
|
54304
54304
|
const title = stringAttribute(first(root, "title", NS.dgm), "val");
|
|
@@ -54549,6 +54549,7 @@ __export(opc_exports, {
|
|
|
54549
54549
|
parseCustomProperties: () => parseCustomProperties,
|
|
54550
54550
|
parseCustomPropertyTexts: () => parseCustomPropertyTexts,
|
|
54551
54551
|
parseRelationships: () => parseRelationships,
|
|
54552
|
+
readDeclaredFonts: () => readDeclaredFonts,
|
|
54552
54553
|
relationshipsPartFor: () => relationshipsPartFor,
|
|
54553
54554
|
relativePartTarget: () => relativePartTarget,
|
|
54554
54555
|
removeContentTypeOverride: () => removeContentTypeOverride,
|
|
@@ -55936,6 +55937,89 @@ async function stripPackageSignatures(zip) {
|
|
|
55936
55937
|
function zlibCompress(data) {
|
|
55937
55938
|
return fflate.zlibSync(data);
|
|
55938
55939
|
}
|
|
55940
|
+
var PARTS = [
|
|
55941
|
+
/^word\/(fontTable|styles)\.xml$/u,
|
|
55942
|
+
/^xl\/styles\.xml$/u,
|
|
55943
|
+
/^ppt\/presentation\.xml$/u,
|
|
55944
|
+
/^ppt\/slideMasters\/slideMaster\d+\.xml$/u,
|
|
55945
|
+
/^ppt\/slides\/slide([1-9]|1[0-9]|20)\.xml$/u,
|
|
55946
|
+
/^visio\/document\.xml$/u,
|
|
55947
|
+
/^(word|xl|ppt|visio)\/theme\/theme\d+\.xml$/u
|
|
55948
|
+
];
|
|
55949
|
+
var MAX_PART_BYTES = 2 * 1024 * 1024;
|
|
55950
|
+
var MAX_TOTAL_BYTES = 8 * 1024 * 1024;
|
|
55951
|
+
var FAMILY_PATTERNS = [
|
|
55952
|
+
/\btypeface="([^"]+)"/gu,
|
|
55953
|
+
/<w:font\s+w:name="([^"]+)"/gu,
|
|
55954
|
+
/\bw:(?:ascii|hAnsi|eastAsia|cs)="([^"]+)"/gu,
|
|
55955
|
+
/<name\s+val="([^"]+)"/gu,
|
|
55956
|
+
/<FaceName\b[^>]*?\bNameU="([^"]+)"/gu
|
|
55957
|
+
];
|
|
55958
|
+
var decodeXml = (value) => value.replace(/"/gu, '"').replace(/'/gu, "'").replace(/</gu, "<").replace(/>/gu, ">").replace(/&/gu, "&");
|
|
55959
|
+
function add(into, raw2) {
|
|
55960
|
+
const family = decodeXml(raw2).trim();
|
|
55961
|
+
if (!family || family.startsWith("+") || family.length > 64) return;
|
|
55962
|
+
const key = family.toLowerCase();
|
|
55963
|
+
if (!into.has(key)) into.set(key, family);
|
|
55964
|
+
}
|
|
55965
|
+
function collectEmbedded(name2, xml2, into) {
|
|
55966
|
+
if (name2 === "ppt/presentation.xml") {
|
|
55967
|
+
for (const match of xml2.matchAll(/<p:embeddedFont>\s*<p:font\b[^>]*?\btypeface="([^"]+)"/gu)) {
|
|
55968
|
+
if (match[1]) add(into, match[1]);
|
|
55969
|
+
}
|
|
55970
|
+
}
|
|
55971
|
+
if (name2 === "word/fontTable.xml") {
|
|
55972
|
+
for (const match of xml2.matchAll(/<w:font\s+w:name="([^"]+)"[^>]*>([\s\S]*?)<\/w:font>/gu)) {
|
|
55973
|
+
if (match[1] && /<w:embed(Regular|Bold|Italic|BoldItalic)\b/u.test(match[2] ?? "")) {
|
|
55974
|
+
add(into, match[1]);
|
|
55975
|
+
}
|
|
55976
|
+
}
|
|
55977
|
+
}
|
|
55978
|
+
}
|
|
55979
|
+
function readDeclaredFonts(bytes) {
|
|
55980
|
+
const data = bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes);
|
|
55981
|
+
let total = 0;
|
|
55982
|
+
let parts;
|
|
55983
|
+
try {
|
|
55984
|
+
parts = fflate.unzipSync(data, {
|
|
55985
|
+
filter: (file) => {
|
|
55986
|
+
if (!PARTS.some((pattern) => pattern.test(file.name))) return false;
|
|
55987
|
+
if (file.originalSize > MAX_PART_BYTES || total + file.originalSize > MAX_TOTAL_BYTES) {
|
|
55988
|
+
return false;
|
|
55989
|
+
}
|
|
55990
|
+
total += file.originalSize;
|
|
55991
|
+
return true;
|
|
55992
|
+
}
|
|
55993
|
+
});
|
|
55994
|
+
} catch {
|
|
55995
|
+
return { families: [], embedded: [] };
|
|
55996
|
+
}
|
|
55997
|
+
const families = /* @__PURE__ */ new Map();
|
|
55998
|
+
const embedded = /* @__PURE__ */ new Map();
|
|
55999
|
+
for (const name2 of Object.keys(parts).sort(byPriority)) {
|
|
56000
|
+
const part = parts[name2];
|
|
56001
|
+
if (!part) continue;
|
|
56002
|
+
const xml2 = fflate.strFromU8(part);
|
|
56003
|
+
for (const pattern of FAMILY_PATTERNS) {
|
|
56004
|
+
for (const match of xml2.matchAll(pattern)) if (match[1]) add(families, match[1]);
|
|
56005
|
+
}
|
|
56006
|
+
collectEmbedded(name2, xml2, embedded);
|
|
56007
|
+
}
|
|
56008
|
+
const embeddedKeys = new Set(embedded.keys());
|
|
56009
|
+
return {
|
|
56010
|
+
families: [...families].filter(([key]) => !embeddedKeys.has(key)).map(([, name2]) => name2),
|
|
56011
|
+
embedded: [...embedded.values()]
|
|
56012
|
+
};
|
|
56013
|
+
}
|
|
56014
|
+
function priority(name2) {
|
|
56015
|
+
if (name2.includes("/theme/")) return 0;
|
|
56016
|
+
if (/styles\.xml$|fontTable\.xml$|presentation\.xml$|document\.xml$/u.test(name2)) return 1;
|
|
56017
|
+
if (name2.includes("slideMaster")) return 2;
|
|
56018
|
+
return 3;
|
|
56019
|
+
}
|
|
56020
|
+
function byPriority(a2, b) {
|
|
56021
|
+
return priority(a2) - priority(b) || a2.localeCompare(b, "en", { numeric: true });
|
|
56022
|
+
}
|
|
55939
56023
|
|
|
55940
56024
|
// diagram/picture-layout.ts
|
|
55941
56025
|
var DIAGRAM_PICTURE_SOURCE_NS = "urn:ooxml-core:diagram-picture-sources:1";
|
|
@@ -55952,7 +56036,7 @@ function remapFill(fill, id) {
|
|
|
55952
56036
|
function captureDiagramPictures(model, dataXml2, dataParts, drawing) {
|
|
55953
56037
|
const pictures = [];
|
|
55954
56038
|
const parts = { ...dataParts };
|
|
55955
|
-
const
|
|
56039
|
+
const add3 = (source2, owner) => {
|
|
55956
56040
|
const part = source2.fill.relId ? owner[source2.fill.relId] : void 0;
|
|
55957
56041
|
if (!part) return;
|
|
55958
56042
|
let id = Object.keys(parts).find((key) => parts[key] === part);
|
|
@@ -55975,7 +56059,7 @@ function captureDiagramPictures(model, dataXml2, dataParts, drawing) {
|
|
|
55975
56059
|
const nodeId = element4.getAttribute("nodeId");
|
|
55976
56060
|
const fill = first(element4, "blipFill", NS.a);
|
|
55977
56061
|
if (nodeId && fill && model.nodes.some((node) => node.modelId === nodeId))
|
|
55978
|
-
|
|
56062
|
+
add3(
|
|
55979
56063
|
{
|
|
55980
56064
|
nodeId,
|
|
55981
56065
|
fill: parseDrawingPictureFill(fill),
|
|
@@ -55989,7 +56073,7 @@ function captureDiagramPictures(model, dataXml2, dataParts, drawing) {
|
|
|
55989
56073
|
if (point.fill?.kind !== "picture") continue;
|
|
55990
56074
|
const nodeId = point.type === "pres" ? point.presAssocId : point.modelId;
|
|
55991
56075
|
if (nodeId && model.nodes.some((node) => node.modelId === nodeId) && !pictures.some((item2) => item2.nodeId === nodeId))
|
|
55992
|
-
|
|
56076
|
+
add3(
|
|
55993
56077
|
{
|
|
55994
56078
|
nodeId,
|
|
55995
56079
|
fill: point.fill,
|
|
@@ -56009,7 +56093,7 @@ function captureDiagramPictures(model, dataXml2, dataParts, drawing) {
|
|
|
56009
56093
|
))
|
|
56010
56094
|
continue;
|
|
56011
56095
|
if (nodeId && model.nodes.some((node) => node.modelId === nodeId))
|
|
56012
|
-
|
|
56096
|
+
add3(
|
|
56013
56097
|
{
|
|
56014
56098
|
nodeId,
|
|
56015
56099
|
fill: shape.fill,
|
|
@@ -56376,7 +56460,7 @@ function resolveDiagramDrawingStyles(drawing, scheme2) {
|
|
|
56376
56460
|
|
|
56377
56461
|
// diagram/write/cache.ts
|
|
56378
56462
|
var DSP2 = "http://schemas.microsoft.com/office/drawing/2008/diagram";
|
|
56379
|
-
function
|
|
56463
|
+
function add2(parent, namespace, name2, attrs2 = {}) {
|
|
56380
56464
|
const child6 = parent.ownerDocument.createElementNS(namespace, name2);
|
|
56381
56465
|
for (const [key, value] of Object.entries(attrs2)) child6.setAttribute(key, value);
|
|
56382
56466
|
parent.appendChild(child6);
|
|
@@ -56387,8 +56471,8 @@ function withDiagramDrawingRelationship(xml2, relationshipId) {
|
|
|
56387
56471
|
const model = doc.documentElement;
|
|
56388
56472
|
let extension = descendants(model, "dataModelExt").find((node) => node.namespaceURI === DSP2);
|
|
56389
56473
|
if (!extension) {
|
|
56390
|
-
const extLst = first(model, "extLst", NS.dgm) ??
|
|
56391
|
-
extension =
|
|
56474
|
+
const extLst = first(model, "extLst", NS.dgm) ?? add2(model, NS.dgm, "dgm:extLst");
|
|
56475
|
+
extension = add2(add2(extLst, NS.a, "a:ext", { uri: DSP2 }), DSP2, "dsp:dataModelExt", {
|
|
56392
56476
|
minVer: NS.dgm
|
|
56393
56477
|
});
|
|
56394
56478
|
}
|
|
@@ -56517,9 +56601,9 @@ function buildGeneratedDiagramCache(dataXml2, input) {
|
|
|
56517
56601
|
parent.parentNode?.removeChild(parent);
|
|
56518
56602
|
else parent?.removeChild(marker2);
|
|
56519
56603
|
}
|
|
56520
|
-
const extLst = first(root, "extLst", NS.dgm) ??
|
|
56521
|
-
const marker =
|
|
56522
|
-
|
|
56604
|
+
const extLst = first(root, "extLst", NS.dgm) ?? add2(root, NS.dgm, "dgm:extLst");
|
|
56605
|
+
const marker = add2(
|
|
56606
|
+
add2(extLst, NS.a, "a:ext", { uri: GENERATED_DIAGRAM_CACHE_NS }),
|
|
56523
56607
|
GENERATED_DIAGRAM_CACHE_NS,
|
|
56524
56608
|
"oc:generatedCache",
|
|
56525
56609
|
{
|
|
@@ -56530,20 +56614,20 @@ function buildGeneratedDiagramCache(dataXml2, input) {
|
|
|
56530
56614
|
);
|
|
56531
56615
|
drawing.shapes.forEach((shape, index) => {
|
|
56532
56616
|
const id = serialized.modelIds.get(shape.modelId);
|
|
56533
|
-
const point =
|
|
56534
|
-
|
|
56617
|
+
const point = add2(points2, NS.dgm, "dgm:pt", { modelId: id, type: "pres" });
|
|
56618
|
+
add2(point, NS.dgm, "dgm:prSet", {
|
|
56535
56619
|
...shape.sourceNodeId ? { presAssocID: shape.sourceNodeId } : {},
|
|
56536
56620
|
presName: shape.sourceLayoutRole ?? "node",
|
|
56537
56621
|
presStyleLbl: shape.sourceStyleLabel ?? "node1",
|
|
56538
56622
|
presStyleIdx: String(index),
|
|
56539
56623
|
presStyleCnt: String(drawing.shapes.length)
|
|
56540
56624
|
});
|
|
56541
|
-
const properties =
|
|
56625
|
+
const properties = add2(point, NS.dgm, "dgm:spPr");
|
|
56542
56626
|
if (shape.fill?.kind === "picture" && shape.fill.sourceXml) {
|
|
56543
56627
|
properties.appendChild(doc.importNode(parseXml(shape.fill.sourceXml).documentElement, true));
|
|
56544
56628
|
}
|
|
56545
56629
|
if (shape.sourceNodeId)
|
|
56546
|
-
|
|
56630
|
+
add2(connections, NS.dgm, "dgm:cxn", {
|
|
56547
56631
|
modelId: createOfficeGuid(),
|
|
56548
56632
|
type: "presOf",
|
|
56549
56633
|
srcId: shape.sourceNodeId,
|
|
@@ -56552,7 +56636,7 @@ function buildGeneratedDiagramCache(dataXml2, input) {
|
|
|
56552
56636
|
destOrd: "0",
|
|
56553
56637
|
presId: input.layoutId ?? ""
|
|
56554
56638
|
});
|
|
56555
|
-
|
|
56639
|
+
add2(marker, GENERATED_DIAGRAM_CACHE_NS, "oc:shape", { id });
|
|
56556
56640
|
});
|
|
56557
56641
|
return {
|
|
56558
56642
|
dataXml: buildXml(doc),
|
|
@@ -58698,19 +58782,19 @@ function compress3(h2, data, offset) {
|
|
|
58698
58782
|
ah = t1h + t2h + Math.floor(nl / 4294967296) >>> 0;
|
|
58699
58783
|
al = nl >>> 0;
|
|
58700
58784
|
}
|
|
58701
|
-
const
|
|
58785
|
+
const add3 = (i2, xh, xl) => {
|
|
58702
58786
|
const lo = (h2[i2 + 1] >>> 0) + (xl >>> 0);
|
|
58703
58787
|
h2[i2] = h2[i2] + xh + Math.floor(lo / 4294967296) >>> 0;
|
|
58704
58788
|
h2[i2 + 1] = lo >>> 0;
|
|
58705
58789
|
};
|
|
58706
|
-
|
|
58707
|
-
|
|
58708
|
-
|
|
58709
|
-
|
|
58710
|
-
|
|
58711
|
-
|
|
58712
|
-
|
|
58713
|
-
|
|
58790
|
+
add3(0, ah, al);
|
|
58791
|
+
add3(2, bh, bl);
|
|
58792
|
+
add3(4, ch, cl);
|
|
58793
|
+
add3(6, dh, dl);
|
|
58794
|
+
add3(8, eh, el);
|
|
58795
|
+
add3(10, fh, fl);
|
|
58796
|
+
add3(12, gh, gl);
|
|
58797
|
+
add3(14, hh, hl);
|
|
58714
58798
|
}
|
|
58715
58799
|
function digest64(data, iv, bytes) {
|
|
58716
58800
|
const h2 = new Uint32Array(iv);
|