pptx-viewer-core 1.1.31 → 1.1.33
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/{SvgExporter-BkkVdcN7.d.mts → SvgExporter-DszPzkAO.d.mts} +1 -1
- package/dist/{SvgExporter-MDf-1CNQ.d.ts → SvgExporter-K7gytgbs.d.ts} +1 -1
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +0 -0
- package/dist/cli/index.mjs +0 -0
- package/dist/converter/index.d.mts +3 -3
- package/dist/converter/index.d.ts +3 -3
- package/dist/index.d.mts +127 -8
- package/dist/index.d.ts +127 -8
- package/dist/index.js +677 -116
- package/dist/index.mjs +677 -117
- package/dist/{presentation-BWchOWpy.d.mts → presentation-DnczfOWz.d.mts} +33 -1
- package/dist/{presentation-BWchOWpy.d.ts → presentation-DnczfOWz.d.ts} +33 -1
- package/dist/{text-operations-DTlmk6ap.d.ts → text-operations-BpaAJ5gE.d.ts} +1 -1
- package/dist/{text-operations-Dld03ITU.d.mts → text-operations-Q4Ckgnu_.d.mts} +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1584,8 +1584,8 @@ var DEFAULT_COLORS = {
|
|
|
1584
1584
|
};
|
|
1585
1585
|
var DEFAULT_MAJOR_FONT = "Calibri Light";
|
|
1586
1586
|
var DEFAULT_MINOR_FONT = "Calibri";
|
|
1587
|
-
function hexToRgb(
|
|
1588
|
-
return
|
|
1587
|
+
function hexToRgb(hex8) {
|
|
1588
|
+
return hex8.replace(/^#/, "").toUpperCase();
|
|
1589
1589
|
}
|
|
1590
1590
|
function isoNow() {
|
|
1591
1591
|
return (/* @__PURE__ */ new Date()).toISOString().replace(/\.\d+Z$/, "Z");
|
|
@@ -4258,8 +4258,8 @@ var PptxColorTransformCodec = class {
|
|
|
4258
4258
|
clampUnitInterval(value) {
|
|
4259
4259
|
return Math.min(1, Math.max(0, value));
|
|
4260
4260
|
}
|
|
4261
|
-
hexToRgb(
|
|
4262
|
-
const normalized =
|
|
4261
|
+
hexToRgb(hex8) {
|
|
4262
|
+
const normalized = hex8.replace("#", "");
|
|
4263
4263
|
if (!/^[0-9a-fA-F]{6}$/.test(normalized)) {
|
|
4264
4264
|
return void 0;
|
|
4265
4265
|
}
|
|
@@ -5769,7 +5769,7 @@ var PptxColorStyleCodec = class {
|
|
|
5769
5769
|
parseColor: (colorNode, placeholderColor) => this.parseColor(colorNode, placeholderColor),
|
|
5770
5770
|
extractColorOpacity: (colorNode) => this.extractColorOpacity(colorNode),
|
|
5771
5771
|
clampUnitInterval: (value) => this.clampUnitInterval(value),
|
|
5772
|
-
hexToRgb: (
|
|
5772
|
+
hexToRgb: (hex8) => this.hexToRgb(hex8),
|
|
5773
5773
|
rgbToHex: (r, g, b) => this.rgbToHex(r, g, b)
|
|
5774
5774
|
});
|
|
5775
5775
|
this.shapeEffectXmlCodec = new PptxShapeEffectXmlCodec({
|
|
@@ -5792,8 +5792,8 @@ var PptxColorStyleCodec = class {
|
|
|
5792
5792
|
clampUnitInterval(value) {
|
|
5793
5793
|
return this.colorTransformCodec.clampUnitInterval(value);
|
|
5794
5794
|
}
|
|
5795
|
-
hexToRgb(
|
|
5796
|
-
return this.colorTransformCodec.hexToRgb(
|
|
5795
|
+
hexToRgb(hex8) {
|
|
5796
|
+
return this.colorTransformCodec.hexToRgb(hex8);
|
|
5797
5797
|
}
|
|
5798
5798
|
rgbToHex(r, g, b) {
|
|
5799
5799
|
return this.colorTransformCodec.rgbToHex(r, g, b);
|
|
@@ -5964,9 +5964,9 @@ function normalizeHex(value) {
|
|
|
5964
5964
|
if (raw.length === 0) {
|
|
5965
5965
|
return "";
|
|
5966
5966
|
}
|
|
5967
|
-
const
|
|
5968
|
-
if (/^[0-9a-fA-F]{6}$/.test(
|
|
5969
|
-
return
|
|
5967
|
+
const hex8 = raw.replace(/^#/, "");
|
|
5968
|
+
if (/^[0-9a-fA-F]{6}$/.test(hex8)) {
|
|
5969
|
+
return hex8.toUpperCase();
|
|
5970
5970
|
}
|
|
5971
5971
|
return raw.toLowerCase();
|
|
5972
5972
|
}
|
|
@@ -5976,8 +5976,8 @@ function colorsEqual(left, right) {
|
|
|
5976
5976
|
}
|
|
5977
5977
|
return normalizeHex(left) === normalizeHex(right);
|
|
5978
5978
|
}
|
|
5979
|
-
function buildSrgbColorChoice(
|
|
5980
|
-
const normalized = String(
|
|
5979
|
+
function buildSrgbColorChoice(hex8, opacity) {
|
|
5980
|
+
const normalized = String(hex8 || "").replace(/^#/, "");
|
|
5981
5981
|
const srgb = { "@_val": normalized };
|
|
5982
5982
|
if (typeof opacity === "number" && Number.isFinite(opacity) && opacity >= 0 && opacity < 1) {
|
|
5983
5983
|
const alphaPct = Math.round(Math.max(0, Math.min(1, opacity)) * 1e5);
|
|
@@ -9489,9 +9489,9 @@ function decodeKeyframeValue(valNode) {
|
|
|
9489
9489
|
if (strVal && strVal["@_val"] !== void 0) {
|
|
9490
9490
|
return { value: String(strVal["@_val"]), valueType: "str" };
|
|
9491
9491
|
}
|
|
9492
|
-
const
|
|
9493
|
-
if (
|
|
9494
|
-
const raw =
|
|
9492
|
+
const boolVal3 = valNode["p:boolVal"];
|
|
9493
|
+
if (boolVal3 && boolVal3["@_val"] !== void 0) {
|
|
9494
|
+
const raw = boolVal3["@_val"];
|
|
9495
9495
|
const value = raw === "1" || raw === "true";
|
|
9496
9496
|
return { value, valueType: "bool" };
|
|
9497
9497
|
}
|
|
@@ -12010,7 +12010,11 @@ var PptxSaveConstantsFactory = class {
|
|
|
12010
12010
|
slideAudioRelationshipType: "http://purl.oclc.org/ooxml/officeDocument/relationships/audio",
|
|
12011
12011
|
slideCommentRelationshipType: "http://purl.oclc.org/ooxml/officeDocument/relationships/comments",
|
|
12012
12012
|
slideNotesRelationshipType: "http://purl.oclc.org/ooxml/officeDocument/relationships/notesSlide",
|
|
12013
|
-
|
|
12013
|
+
// The OPC relationships namespace (the xmlns of .rels parts) is
|
|
12014
|
+
// conformance-independent: real Strict packages keep the canonical
|
|
12015
|
+
// schemas.openxmlformats.org form. Only the relationship *type*
|
|
12016
|
+
// URIs above switch to Strict. See strict-namespace-map.ts.
|
|
12017
|
+
relationshipsNamespace: "http://schemas.openxmlformats.org/package/2006/relationships",
|
|
12014
12018
|
// Content types are NOT namespace-dependent; they stay the same
|
|
12015
12019
|
// in both Strict and Transitional conformance.
|
|
12016
12020
|
slideContentType: "application/vnd.openxmlformats-officedocument.presentationml.slide+xml",
|
|
@@ -12733,13 +12737,13 @@ function generateFontGuid() {
|
|
|
12733
12737
|
bytes[i] = Math.floor(Math.random() * 256);
|
|
12734
12738
|
}
|
|
12735
12739
|
}
|
|
12736
|
-
const
|
|
12740
|
+
const hex8 = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0").toUpperCase()).join("");
|
|
12737
12741
|
return [
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12742
|
+
hex8.substring(0, 8),
|
|
12743
|
+
hex8.substring(8, 12),
|
|
12744
|
+
hex8.substring(12, 16),
|
|
12745
|
+
hex8.substring(16, 20),
|
|
12746
|
+
hex8.substring(20, 32)
|
|
12743
12747
|
].join("-");
|
|
12744
12748
|
}
|
|
12745
12749
|
function detectFontFormat(data) {
|
|
@@ -13060,7 +13064,8 @@ function parseSeriesDataPoints(seriesNode, xmlLookup, colorParser) {
|
|
|
13060
13064
|
}).filter((dp) => dp !== void 0);
|
|
13061
13065
|
}
|
|
13062
13066
|
function parseSeriesDataLabels(seriesNode, xmlLookup) {
|
|
13063
|
-
const
|
|
13067
|
+
const dLblsNode = xmlLookup.getChildByLocalName(seriesNode, "dLbls");
|
|
13068
|
+
const dLblNodes = dLblsNode ? xmlLookup.getChildrenArrayByLocalName(dLblsNode, "dLbl") : xmlLookup.getChildrenArrayByLocalName(seriesNode, "dLbl");
|
|
13064
13069
|
if (dLblNodes.length === 0) {
|
|
13065
13070
|
return [];
|
|
13066
13071
|
}
|
|
@@ -13070,6 +13075,10 @@ function parseSeriesDataLabels(seriesNode, xmlLookup) {
|
|
|
13070
13075
|
if (idx === void 0) {
|
|
13071
13076
|
return void 0;
|
|
13072
13077
|
}
|
|
13078
|
+
const deleteNode = xmlLookup.getChildByLocalName(node, "delete");
|
|
13079
|
+
if (deleteNode?.["@_val"] === "1" || deleteNode?.["@_val"] === "true") {
|
|
13080
|
+
return { idx };
|
|
13081
|
+
}
|
|
13073
13082
|
const result = { idx };
|
|
13074
13083
|
const boolFields = [
|
|
13075
13084
|
["showVal", "showVal"],
|
|
@@ -13417,6 +13426,29 @@ function collectAxisTextValues(node, results) {
|
|
|
13417
13426
|
}
|
|
13418
13427
|
}
|
|
13419
13428
|
|
|
13429
|
+
// src/core/utils/chart-container-type-map.ts
|
|
13430
|
+
var CONTAINER_LOCAL_NAME_TO_TYPE = {
|
|
13431
|
+
barChart: "bar",
|
|
13432
|
+
bar3DChart: "bar3D",
|
|
13433
|
+
lineChart: "line",
|
|
13434
|
+
line3DChart: "line3D",
|
|
13435
|
+
pieChart: "pie",
|
|
13436
|
+
pie3DChart: "pie3D",
|
|
13437
|
+
ofPieChart: "ofPie",
|
|
13438
|
+
doughnutChart: "doughnut",
|
|
13439
|
+
areaChart: "area",
|
|
13440
|
+
area3DChart: "area3D",
|
|
13441
|
+
scatterChart: "scatter",
|
|
13442
|
+
bubbleChart: "bubble",
|
|
13443
|
+
radarChart: "radar",
|
|
13444
|
+
stockChart: "stock",
|
|
13445
|
+
surfaceChart: "surface",
|
|
13446
|
+
surface3DChart: "surface"
|
|
13447
|
+
};
|
|
13448
|
+
function chartContainerLocalNameToType(localName) {
|
|
13449
|
+
return CONTAINER_LOCAL_NAME_TO_TYPE[localName];
|
|
13450
|
+
}
|
|
13451
|
+
|
|
13420
13452
|
// src/core/utils/chart-cx-parser.ts
|
|
13421
13453
|
function extractCxSeriesColor(ser, xmlLookup) {
|
|
13422
13454
|
const spPr = xmlLookup.getChildByLocalName(ser, "spPr");
|
|
@@ -15172,10 +15204,10 @@ function applyBackgroundColorToCSld(cSld, backgroundColor) {
|
|
|
15172
15204
|
delete cSld["p:bg"];
|
|
15173
15205
|
return;
|
|
15174
15206
|
}
|
|
15175
|
-
const
|
|
15207
|
+
const hex8 = backgroundColor.replace(/^#/, "").toUpperCase();
|
|
15176
15208
|
cSld["p:bg"] = {
|
|
15177
15209
|
"p:bgPr": {
|
|
15178
|
-
"a:solidFill": { "a:srgbClr": { "@_val":
|
|
15210
|
+
"a:solidFill": { "a:srgbClr": { "@_val": hex8 } },
|
|
15179
15211
|
"a:effectLst": {}
|
|
15180
15212
|
}
|
|
15181
15213
|
};
|
|
@@ -15798,8 +15830,8 @@ function accentColor(index, themeColorMap) {
|
|
|
15798
15830
|
}
|
|
15799
15831
|
return DEFAULT_ACCENT_COLORS[index % DEFAULT_ACCENT_COLORS.length];
|
|
15800
15832
|
}
|
|
15801
|
-
function lighten(
|
|
15802
|
-
const parsed =
|
|
15833
|
+
function lighten(hex8, amount) {
|
|
15834
|
+
const parsed = hex8.replace("#", "");
|
|
15803
15835
|
const r = parseInt(parsed.substring(0, 2), 16);
|
|
15804
15836
|
const g = parseInt(parsed.substring(2, 4), 16);
|
|
15805
15837
|
const b = parseInt(parsed.substring(4, 6), 16);
|
|
@@ -20182,26 +20214,27 @@ var NAMESPACE_PAIRS = [
|
|
|
20182
20214
|
"http://purl.oclc.org/ooxml/officeDocument/docPropsVTypes",
|
|
20183
20215
|
"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
|
|
20184
20216
|
],
|
|
20185
|
-
// --
|
|
20217
|
+
// -- OfficeDocument document relationship --
|
|
20218
|
+
// (Other OPC-defined relationship types - package/relationships,
|
|
20219
|
+
// core-properties, digital-signature - are conformance-independent and
|
|
20220
|
+
// intentionally omitted; see the module header.)
|
|
20186
20221
|
[
|
|
20187
20222
|
"http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument",
|
|
20188
20223
|
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
|
|
20189
20224
|
],
|
|
20225
|
+
// -- Schema Library --
|
|
20190
20226
|
[
|
|
20191
|
-
"http://purl.oclc.org/ooxml/
|
|
20192
|
-
"http://schemas.openxmlformats.org/
|
|
20227
|
+
"http://purl.oclc.org/ooxml/schemaLibrary/main",
|
|
20228
|
+
"http://schemas.openxmlformats.org/schemaLibrary/2006/main"
|
|
20193
20229
|
],
|
|
20230
|
+
// -- Content-type descriptions (note the distinct transitional host) --
|
|
20194
20231
|
[
|
|
20195
|
-
"http://purl.oclc.org/ooxml/
|
|
20196
|
-
"http://
|
|
20232
|
+
"http://purl.oclc.org/ooxml/descriptions/base",
|
|
20233
|
+
"http://descriptions.openxmlformats.org/description/base"
|
|
20197
20234
|
],
|
|
20198
20235
|
[
|
|
20199
|
-
"http://purl.oclc.org/ooxml/
|
|
20200
|
-
"http://
|
|
20201
|
-
],
|
|
20202
|
-
[
|
|
20203
|
-
"http://purl.oclc.org/ooxml/package/relationships/digital-signature/signature",
|
|
20204
|
-
"http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature"
|
|
20236
|
+
"http://purl.oclc.org/ooxml/descriptions/full",
|
|
20237
|
+
"http://descriptions.openxmlformats.org/description/full"
|
|
20205
20238
|
],
|
|
20206
20239
|
// -- SpreadsheetML (for embedded charts / workbooks) --
|
|
20207
20240
|
[
|
|
@@ -20212,11 +20245,6 @@ var NAMESPACE_PAIRS = [
|
|
|
20212
20245
|
[
|
|
20213
20246
|
"http://purl.oclc.org/ooxml/wordprocessingml/main",
|
|
20214
20247
|
"http://schemas.openxmlformats.org/wordprocessingml/2006/main"
|
|
20215
|
-
],
|
|
20216
|
-
// -- Markup Compatibility --
|
|
20217
|
-
[
|
|
20218
|
-
"http://purl.oclc.org/ooxml/markup-compatibility/2006",
|
|
20219
|
-
"http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
20220
20248
|
]
|
|
20221
20249
|
];
|
|
20222
20250
|
var STRICT_TO_TRANSITIONAL_NS = new Map(NAMESPACE_PAIRS);
|
|
@@ -20230,7 +20258,8 @@ var ALGORITHMIC_FAMILIES = /* @__PURE__ */ new Set([
|
|
|
20230
20258
|
"drawingml",
|
|
20231
20259
|
"spreadsheetml",
|
|
20232
20260
|
"wordprocessingml",
|
|
20233
|
-
"officeDocument"
|
|
20261
|
+
"officeDocument",
|
|
20262
|
+
"schemaLibrary"
|
|
20234
20263
|
]);
|
|
20235
20264
|
function deriveTransitionalUri(uri) {
|
|
20236
20265
|
if (!uri.startsWith(STRICT_BASE)) {
|
|
@@ -21417,11 +21446,11 @@ async function repairPptx(buffer) {
|
|
|
21417
21446
|
}
|
|
21418
21447
|
|
|
21419
21448
|
// src/core/utils/theme-switching.ts
|
|
21420
|
-
function normalizeHex2(
|
|
21421
|
-
if (!
|
|
21449
|
+
function normalizeHex2(hex8) {
|
|
21450
|
+
if (!hex8) {
|
|
21422
21451
|
return "";
|
|
21423
21452
|
}
|
|
21424
|
-
return
|
|
21453
|
+
return hex8.replace(/^#/, "").toUpperCase().slice(0, 6);
|
|
21425
21454
|
}
|
|
21426
21455
|
function buildColorRemapTable(oldColorMap, newColorMap) {
|
|
21427
21456
|
const remap = /* @__PURE__ */ new Map();
|
|
@@ -21615,8 +21644,8 @@ function applyThemeToData(data, newColorScheme, newFontScheme, themeName) {
|
|
|
21615
21644
|
}
|
|
21616
21645
|
|
|
21617
21646
|
// src/core/utils/accessibility-checker.ts
|
|
21618
|
-
function parseHexColor(
|
|
21619
|
-
const cleaned =
|
|
21647
|
+
function parseHexColor(hex8) {
|
|
21648
|
+
const cleaned = hex8.replace(/^#/, "");
|
|
21620
21649
|
if (!/^[\da-fA-F]+$/.test(cleaned)) {
|
|
21621
21650
|
return null;
|
|
21622
21651
|
}
|
|
@@ -24916,6 +24945,37 @@ function ensureArray6(v) {
|
|
|
24916
24945
|
}
|
|
24917
24946
|
return Array.isArray(v) ? v : [v];
|
|
24918
24947
|
}
|
|
24948
|
+
function consolidateComboContainersInXml(plotArea, getLocalName) {
|
|
24949
|
+
const containerKeys = Object.keys(plotArea).filter((k) => getLocalName(k).endsWith("Chart"));
|
|
24950
|
+
if (containerKeys.length === 0) {
|
|
24951
|
+
return void 0;
|
|
24952
|
+
}
|
|
24953
|
+
const primaryKey = containerKeys[0];
|
|
24954
|
+
if (containerKeys.length === 1) {
|
|
24955
|
+
return primaryKey;
|
|
24956
|
+
}
|
|
24957
|
+
const primary = plotArea[primaryKey];
|
|
24958
|
+
if (!primary) {
|
|
24959
|
+
return primaryKey;
|
|
24960
|
+
}
|
|
24961
|
+
const serKey = findKey4(primary, "ser", getLocalName) ?? "c:ser";
|
|
24962
|
+
const allSeries = [];
|
|
24963
|
+
for (const key of containerKeys) {
|
|
24964
|
+
const container = plotArea[key];
|
|
24965
|
+
if (!container) {
|
|
24966
|
+
continue;
|
|
24967
|
+
}
|
|
24968
|
+
const containerSerKey = findKey4(container, "ser", getLocalName);
|
|
24969
|
+
if (containerSerKey) {
|
|
24970
|
+
allSeries.push(...ensureArray6(container[containerSerKey]));
|
|
24971
|
+
}
|
|
24972
|
+
if (key !== primaryKey) {
|
|
24973
|
+
delete plotArea[key];
|
|
24974
|
+
}
|
|
24975
|
+
}
|
|
24976
|
+
primary[serKey] = allSeries.length === 1 ? allSeries[0] : allSeries;
|
|
24977
|
+
return primaryKey;
|
|
24978
|
+
}
|
|
24919
24979
|
function effectiveContainers(series, chartLevelType) {
|
|
24920
24980
|
return series.map((s) => {
|
|
24921
24981
|
const t = s.seriesChartType ?? chartLevelType;
|
|
@@ -25367,6 +25427,146 @@ function applySeriesMarkerToXml(seriesNode, marker, getLocalName) {
|
|
|
25367
25427
|
insertOrdered2(seriesNode, "c:marker", built, getLocalName);
|
|
25368
25428
|
}
|
|
25369
25429
|
|
|
25430
|
+
// src/core/utils/chart-series-datalabel-serializer.ts
|
|
25431
|
+
function findKey9(obj, local, getLocalName) {
|
|
25432
|
+
return Object.keys(obj).find((k) => getLocalName(k) === local);
|
|
25433
|
+
}
|
|
25434
|
+
function boolVal2(on) {
|
|
25435
|
+
return { "@_val": on ? "1" : "0" };
|
|
25436
|
+
}
|
|
25437
|
+
var AFTER_DLBLS = /* @__PURE__ */ new Set(["cat", "val", "xVal", "yVal", "bubbleSize", "smooth", "extLst"]);
|
|
25438
|
+
var DLBLS_GROUP_ORDER = [
|
|
25439
|
+
"numFmt",
|
|
25440
|
+
"spPr",
|
|
25441
|
+
"txPr",
|
|
25442
|
+
"dLblPos",
|
|
25443
|
+
"showLegendKey",
|
|
25444
|
+
"showVal",
|
|
25445
|
+
"showCatName",
|
|
25446
|
+
"showSerName",
|
|
25447
|
+
"showPercent",
|
|
25448
|
+
"showBubbleSize",
|
|
25449
|
+
"separator",
|
|
25450
|
+
"showLeaderLines",
|
|
25451
|
+
"leaderLines"
|
|
25452
|
+
];
|
|
25453
|
+
function buildDLbl(existing, label, getLocalName) {
|
|
25454
|
+
const node = {};
|
|
25455
|
+
node["c:idx"] = { "@_val": String(label.idx) };
|
|
25456
|
+
const hasShow = label.showVal !== void 0 || label.showCatName !== void 0 || label.showSerName !== void 0 || label.showPercent !== void 0 || label.showLegendKey !== void 0 || label.showBubbleSize !== void 0;
|
|
25457
|
+
const hasContent = hasShow || label.position !== void 0 || label.text !== void 0;
|
|
25458
|
+
if (!hasContent) {
|
|
25459
|
+
node["c:delete"] = { "@_val": "1" };
|
|
25460
|
+
return node;
|
|
25461
|
+
}
|
|
25462
|
+
if (existing) {
|
|
25463
|
+
const layoutKey = findKey9(existing, "layout", getLocalName);
|
|
25464
|
+
if (layoutKey) {
|
|
25465
|
+
node[layoutKey] = existing[layoutKey];
|
|
25466
|
+
}
|
|
25467
|
+
}
|
|
25468
|
+
if (label.text !== void 0) {
|
|
25469
|
+
node["c:tx"] = {
|
|
25470
|
+
"c:rich": {
|
|
25471
|
+
"a:bodyPr": {},
|
|
25472
|
+
"a:lstStyle": {},
|
|
25473
|
+
"a:p": { "a:r": { "a:t": label.text } }
|
|
25474
|
+
}
|
|
25475
|
+
};
|
|
25476
|
+
} else if (existing) {
|
|
25477
|
+
const txKey = findKey9(existing, "tx", getLocalName);
|
|
25478
|
+
if (txKey) {
|
|
25479
|
+
node[txKey] = existing[txKey];
|
|
25480
|
+
}
|
|
25481
|
+
}
|
|
25482
|
+
if (existing) {
|
|
25483
|
+
for (const local of ["numFmt", "spPr", "txPr"]) {
|
|
25484
|
+
const k = findKey9(existing, local, getLocalName);
|
|
25485
|
+
if (k) {
|
|
25486
|
+
node[k] = existing[k];
|
|
25487
|
+
}
|
|
25488
|
+
}
|
|
25489
|
+
}
|
|
25490
|
+
if (label.position !== void 0) {
|
|
25491
|
+
node["c:dLblPos"] = { "@_val": label.position };
|
|
25492
|
+
}
|
|
25493
|
+
if (label.showLegendKey !== void 0) {
|
|
25494
|
+
node["c:showLegendKey"] = boolVal2(label.showLegendKey);
|
|
25495
|
+
}
|
|
25496
|
+
if (label.showVal !== void 0) {
|
|
25497
|
+
node["c:showVal"] = boolVal2(label.showVal);
|
|
25498
|
+
}
|
|
25499
|
+
if (label.showCatName !== void 0) {
|
|
25500
|
+
node["c:showCatName"] = boolVal2(label.showCatName);
|
|
25501
|
+
}
|
|
25502
|
+
if (label.showSerName !== void 0) {
|
|
25503
|
+
node["c:showSerName"] = boolVal2(label.showSerName);
|
|
25504
|
+
}
|
|
25505
|
+
if (label.showPercent !== void 0) {
|
|
25506
|
+
node["c:showPercent"] = boolVal2(label.showPercent);
|
|
25507
|
+
}
|
|
25508
|
+
if (label.showBubbleSize !== void 0) {
|
|
25509
|
+
node["c:showBubbleSize"] = boolVal2(label.showBubbleSize);
|
|
25510
|
+
}
|
|
25511
|
+
return node;
|
|
25512
|
+
}
|
|
25513
|
+
function applySeriesDataLabelsToXml(seriesNode, dataLabels, getLocalName) {
|
|
25514
|
+
const dLblsKey = findKey9(seriesNode, "dLbls", getLocalName);
|
|
25515
|
+
const labels = dataLabels ?? [];
|
|
25516
|
+
const existingByIdx = /* @__PURE__ */ new Map();
|
|
25517
|
+
let groupChildren = [];
|
|
25518
|
+
if (dLblsKey) {
|
|
25519
|
+
const dLbls = seriesNode[dLblsKey];
|
|
25520
|
+
const dLblKey = findKey9(dLbls, "dLbl", getLocalName);
|
|
25521
|
+
if (dLblKey) {
|
|
25522
|
+
const nodes = Array.isArray(dLbls[dLblKey]) ? dLbls[dLblKey] : [dLbls[dLblKey]];
|
|
25523
|
+
for (const node of nodes) {
|
|
25524
|
+
const idxKey = findKey9(node, "idx", getLocalName);
|
|
25525
|
+
const idxNode = idxKey ? node[idxKey] : void 0;
|
|
25526
|
+
const idx = idxNode ? Number.parseInt(String(idxNode["@_val"]), 10) : NaN;
|
|
25527
|
+
if (Number.isFinite(idx)) {
|
|
25528
|
+
existingByIdx.set(idx, node);
|
|
25529
|
+
}
|
|
25530
|
+
}
|
|
25531
|
+
}
|
|
25532
|
+
groupChildren = Object.keys(dLbls).filter((k) => getLocalName(k) !== "dLbl").map((k) => [k, dLbls[k]]);
|
|
25533
|
+
}
|
|
25534
|
+
if (labels.length === 0 && groupChildren.length === 0) {
|
|
25535
|
+
if (dLblsKey) {
|
|
25536
|
+
delete seriesNode[dLblsKey];
|
|
25537
|
+
}
|
|
25538
|
+
return;
|
|
25539
|
+
}
|
|
25540
|
+
const built = [...labels].sort((a, b) => a.idx - b.idx).map((label) => buildDLbl(existingByIdx.get(label.idx), label, getLocalName));
|
|
25541
|
+
const newDLbls = {};
|
|
25542
|
+
if (built.length > 0) {
|
|
25543
|
+
newDLbls["c:dLbl"] = built.length === 1 ? built[0] : built;
|
|
25544
|
+
}
|
|
25545
|
+
const ordered = [...groupChildren].sort((a, b) => {
|
|
25546
|
+
const ai = DLBLS_GROUP_ORDER.indexOf(getLocalName(a[0]));
|
|
25547
|
+
const bi = DLBLS_GROUP_ORDER.indexOf(getLocalName(b[0]));
|
|
25548
|
+
return (ai === -1 ? DLBLS_GROUP_ORDER.length : ai) - (bi === -1 ? DLBLS_GROUP_ORDER.length : bi);
|
|
25549
|
+
});
|
|
25550
|
+
for (const [k, v] of ordered) {
|
|
25551
|
+
newDLbls[k] = v;
|
|
25552
|
+
}
|
|
25553
|
+
if (dLblsKey) {
|
|
25554
|
+
seriesNode[dLblsKey] = newDLbls;
|
|
25555
|
+
return;
|
|
25556
|
+
}
|
|
25557
|
+
const keys = Object.keys(seriesNode);
|
|
25558
|
+
const beforeIdx = keys.findIndex((k) => AFTER_DLBLS.has(getLocalName(k)));
|
|
25559
|
+
const entries = keys.map((k) => [k, seriesNode[k]]);
|
|
25560
|
+
const at = beforeIdx === -1 ? entries.length : beforeIdx;
|
|
25561
|
+
entries.splice(at, 0, ["c:dLbls", newDLbls]);
|
|
25562
|
+
for (const k of keys) {
|
|
25563
|
+
delete seriesNode[k];
|
|
25564
|
+
}
|
|
25565
|
+
for (const [k, v] of entries) {
|
|
25566
|
+
seriesNode[k] = v;
|
|
25567
|
+
}
|
|
25568
|
+
}
|
|
25569
|
+
|
|
25370
25570
|
// src/core/utils/chart-trendline-serializer.ts
|
|
25371
25571
|
var TYPE_TO_OOXML = {
|
|
25372
25572
|
linear: "linear",
|
|
@@ -25376,7 +25576,7 @@ var TYPE_TO_OOXML = {
|
|
|
25376
25576
|
power: "power",
|
|
25377
25577
|
movingAvg: "movingAvg"
|
|
25378
25578
|
};
|
|
25379
|
-
function
|
|
25579
|
+
function findKey10(obj, local, getLocalName) {
|
|
25380
25580
|
return Object.keys(obj).find((k) => getLocalName(k) === local);
|
|
25381
25581
|
}
|
|
25382
25582
|
function ensureArray9(v) {
|
|
@@ -25393,10 +25593,10 @@ function buildSpPr(existing, color, getLocalName) {
|
|
|
25393
25593
|
return existing;
|
|
25394
25594
|
}
|
|
25395
25595
|
const spPr = existing ? { ...existing } : {};
|
|
25396
|
-
const lnKey =
|
|
25596
|
+
const lnKey = findKey10(spPr, "ln", getLocalName) ?? "a:ln";
|
|
25397
25597
|
const existingLn = spPr[lnKey] ?? {};
|
|
25398
|
-
const fillKey =
|
|
25399
|
-
const noFillKey =
|
|
25598
|
+
const fillKey = findKey10(existingLn, "solidFill", getLocalName) ?? "a:solidFill";
|
|
25599
|
+
const noFillKey = findKey10(existingLn, "noFill", getLocalName);
|
|
25400
25600
|
const ln = { ...existingLn };
|
|
25401
25601
|
if (noFillKey) {
|
|
25402
25602
|
delete ln[noFillKey];
|
|
@@ -25408,13 +25608,13 @@ function buildSpPr(existing, color, getLocalName) {
|
|
|
25408
25608
|
function buildTrendline(existing, t, getLocalName) {
|
|
25409
25609
|
const node = {};
|
|
25410
25610
|
if (existing) {
|
|
25411
|
-
const nameKey =
|
|
25611
|
+
const nameKey = findKey10(existing, "name", getLocalName);
|
|
25412
25612
|
if (nameKey) {
|
|
25413
25613
|
node["c:name"] = existing[nameKey];
|
|
25414
25614
|
}
|
|
25415
25615
|
}
|
|
25416
25616
|
const spPr = buildSpPr(
|
|
25417
|
-
existing ? existing[
|
|
25617
|
+
existing ? existing[findKey10(existing, "spPr", getLocalName) ?? ""] : void 0,
|
|
25418
25618
|
t.color,
|
|
25419
25619
|
getLocalName
|
|
25420
25620
|
);
|
|
@@ -25444,7 +25644,7 @@ function buildTrendline(existing, t, getLocalName) {
|
|
|
25444
25644
|
node["c:dispEq"] = { "@_val": "1" };
|
|
25445
25645
|
}
|
|
25446
25646
|
if (existing) {
|
|
25447
|
-
const lblKey =
|
|
25647
|
+
const lblKey = findKey10(existing, "trendlineLbl", getLocalName);
|
|
25448
25648
|
if (lblKey) {
|
|
25449
25649
|
node["c:trendlineLbl"] = existing[lblKey];
|
|
25450
25650
|
}
|
|
@@ -25452,7 +25652,7 @@ function buildTrendline(existing, t, getLocalName) {
|
|
|
25452
25652
|
return node;
|
|
25453
25653
|
}
|
|
25454
25654
|
function applySeriesTrendlinesToXml(seriesNode, trendlines, getLocalName) {
|
|
25455
|
-
const existingKey =
|
|
25655
|
+
const existingKey = findKey10(seriesNode, "trendline", getLocalName);
|
|
25456
25656
|
const existingNodes = existingKey ? ensureArray9(seriesNode[existingKey]) : [];
|
|
25457
25657
|
const built = trendlines.map((t, i) => buildTrendline(existingNodes[i], t, getLocalName));
|
|
25458
25658
|
if (existingKey) {
|
|
@@ -28662,8 +28862,8 @@ function buildTextRunEffectListXml(style) {
|
|
|
28662
28862
|
}
|
|
28663
28863
|
return effectLst;
|
|
28664
28864
|
}
|
|
28665
|
-
function buildShadowColorNode(
|
|
28666
|
-
const clr =
|
|
28865
|
+
function buildShadowColorNode(hex8, opacity) {
|
|
28866
|
+
const clr = hex8.replace("#", "");
|
|
28667
28867
|
const alpha = typeof opacity === "number" ? Math.round(opacity * 1e5) : void 0;
|
|
28668
28868
|
return {
|
|
28669
28869
|
"@_val": clr,
|
|
@@ -31906,8 +32106,8 @@ function updateCellTextStyleInRawXml(element, rowIndex, colIndex, styleUpdates)
|
|
|
31906
32106
|
}
|
|
31907
32107
|
}
|
|
31908
32108
|
if ("color" in styleUpdates && typeof styleUpdates.color === "string") {
|
|
31909
|
-
const
|
|
31910
|
-
rPr["a:solidFill"] = { "a:srgbClr": { "@_val":
|
|
32109
|
+
const hex8 = styleUpdates.color.replace("#", "");
|
|
32110
|
+
rPr["a:solidFill"] = { "a:srgbClr": { "@_val": hex8 } };
|
|
31911
32111
|
}
|
|
31912
32112
|
if ("align" in styleUpdates) {
|
|
31913
32113
|
const pPr = paragraph["a:pPr"] ?? {};
|
|
@@ -31947,8 +32147,8 @@ function updateCellTextStyleInRawXml(element, rowIndex, colIndex, styleUpdates)
|
|
|
31947
32147
|
}
|
|
31948
32148
|
}
|
|
31949
32149
|
if ("color" in styleUpdates && typeof styleUpdates.color === "string") {
|
|
31950
|
-
const
|
|
31951
|
-
endRPr["a:solidFill"] = { "a:srgbClr": { "@_val":
|
|
32150
|
+
const hex8 = styleUpdates.color.replace("#", "");
|
|
32151
|
+
endRPr["a:solidFill"] = { "a:srgbClr": { "@_val": hex8 } };
|
|
31952
32152
|
}
|
|
31953
32153
|
}
|
|
31954
32154
|
}
|
|
@@ -32227,6 +32427,10 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
32227
32427
|
if (!plotArea) {
|
|
32228
32428
|
continue;
|
|
32229
32429
|
}
|
|
32430
|
+
consolidateComboContainersInXml(
|
|
32431
|
+
plotArea,
|
|
32432
|
+
(key) => this.compatibilityService.getXmlLocalName(key)
|
|
32433
|
+
);
|
|
32230
32434
|
let chartTypeKey = Object.keys(plotArea).find(
|
|
32231
32435
|
(key) => this.compatibilityService.getXmlLocalName(key).endsWith("Chart")
|
|
32232
32436
|
);
|
|
@@ -32289,19 +32493,19 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
32289
32493
|
this.updateChartCacheValues(valNode, true, seriesData.values.map(String));
|
|
32290
32494
|
}
|
|
32291
32495
|
if (seriesData.color) {
|
|
32292
|
-
const
|
|
32496
|
+
const hex8 = seriesData.color.replace("#", "");
|
|
32293
32497
|
const spPr = this.xmlLookupService.getChildByLocalName(seriesNode, "spPr");
|
|
32294
32498
|
if (spPr) {
|
|
32295
32499
|
const solidFillKey = Object.keys(spPr).find(
|
|
32296
32500
|
(k) => this.compatibilityService.getXmlLocalName(k) === "solidFill"
|
|
32297
32501
|
) ?? "a:solidFill";
|
|
32298
|
-
spPr[solidFillKey] = { "a:srgbClr": { "@_val":
|
|
32502
|
+
spPr[solidFillKey] = { "a:srgbClr": { "@_val": hex8 } };
|
|
32299
32503
|
} else {
|
|
32300
32504
|
const spPrKey = Object.keys(seriesNode).find(
|
|
32301
32505
|
(k) => this.compatibilityService.getXmlLocalName(k) === "spPr"
|
|
32302
32506
|
) ?? "c:spPr";
|
|
32303
32507
|
seriesNode[spPrKey] = {
|
|
32304
|
-
"a:solidFill": { "a:srgbClr": { "@_val":
|
|
32508
|
+
"a:solidFill": { "a:srgbClr": { "@_val": hex8 } }
|
|
32305
32509
|
};
|
|
32306
32510
|
}
|
|
32307
32511
|
}
|
|
@@ -32333,6 +32537,13 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
32333
32537
|
(key) => this.compatibilityService.getXmlLocalName(key)
|
|
32334
32538
|
);
|
|
32335
32539
|
}
|
|
32540
|
+
if (seriesData.dataLabels !== void 0) {
|
|
32541
|
+
applySeriesDataLabelsToXml(
|
|
32542
|
+
seriesNode,
|
|
32543
|
+
seriesData.dataLabels,
|
|
32544
|
+
(key) => this.compatibilityService.getXmlLocalName(key)
|
|
32545
|
+
);
|
|
32546
|
+
}
|
|
32336
32547
|
}
|
|
32337
32548
|
if (chartData.series.length > seriesNodes.length) {
|
|
32338
32549
|
const templateSeries = seriesNodes.length > 0 ? seriesNodes[seriesNodes.length - 1] : void 0;
|
|
@@ -32862,36 +33073,131 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
32862
33073
|
}
|
|
32863
33074
|
};
|
|
32864
33075
|
|
|
32865
|
-
// src/core/core/runtime/smartart-
|
|
33076
|
+
// src/core/core/runtime/smartart-colors-builder.ts
|
|
32866
33077
|
function asObject(value) {
|
|
33078
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
33079
|
+
}
|
|
33080
|
+
function toArray(value) {
|
|
33081
|
+
if (Array.isArray(value)) {
|
|
33082
|
+
return value.filter((entry) => Boolean(asObject(entry)));
|
|
33083
|
+
}
|
|
33084
|
+
const obj = asObject(value);
|
|
33085
|
+
return obj ? [obj] : [];
|
|
33086
|
+
}
|
|
33087
|
+
function findKey11(obj, name, getLocalName) {
|
|
33088
|
+
return Object.keys(obj).find((k) => getLocalName(k) === name);
|
|
33089
|
+
}
|
|
33090
|
+
function hex7(value) {
|
|
33091
|
+
return value.replace("#", "");
|
|
33092
|
+
}
|
|
33093
|
+
var COLOR_LOCAL_NAMES = /* @__PURE__ */ new Set([
|
|
33094
|
+
"srgbClr",
|
|
33095
|
+
"schemeClr",
|
|
33096
|
+
"sysClr",
|
|
33097
|
+
"prstClr",
|
|
33098
|
+
"scrgbClr",
|
|
33099
|
+
"hslClr"
|
|
33100
|
+
]);
|
|
33101
|
+
function applyColorToList(list, value, getLocalName) {
|
|
33102
|
+
const colorKey = Object.keys(list).find((k) => COLOR_LOCAL_NAMES.has(getLocalName(k)));
|
|
33103
|
+
const srgb = { "@_val": hex7(value) };
|
|
33104
|
+
if (!colorKey) {
|
|
33105
|
+
list["a:srgbClr"] = srgb;
|
|
33106
|
+
return;
|
|
33107
|
+
}
|
|
33108
|
+
const existing = list[colorKey];
|
|
33109
|
+
const rest = Array.isArray(existing) ? existing.slice(1).filter((entry) => Boolean(asObject(entry))) : [];
|
|
33110
|
+
if (colorKey !== "a:srgbClr") {
|
|
33111
|
+
delete list[colorKey];
|
|
33112
|
+
}
|
|
33113
|
+
list["a:srgbClr"] = rest.length > 0 ? [srgb, ...rest] : srgb;
|
|
33114
|
+
}
|
|
33115
|
+
function applySmartArtColorTransform(colorsDef, transform, getLocalName) {
|
|
33116
|
+
if (!transform) {
|
|
33117
|
+
return false;
|
|
33118
|
+
}
|
|
33119
|
+
let mutated = false;
|
|
33120
|
+
if (transform.name && transform.name.length > 0) {
|
|
33121
|
+
if (colorsDef["@_title"] !== transform.name) {
|
|
33122
|
+
colorsDef["@_title"] = transform.name;
|
|
33123
|
+
mutated = true;
|
|
33124
|
+
}
|
|
33125
|
+
}
|
|
33126
|
+
const styleLblKey = findKey11(colorsDef, "styleLbl", getLocalName);
|
|
33127
|
+
if (!styleLblKey) {
|
|
33128
|
+
return mutated;
|
|
33129
|
+
}
|
|
33130
|
+
const labels = toArray(colorsDef[styleLblKey]);
|
|
33131
|
+
if (labels.length === 0) {
|
|
33132
|
+
return mutated;
|
|
33133
|
+
}
|
|
33134
|
+
let fillIndex = 0;
|
|
33135
|
+
let lineIndex = 0;
|
|
33136
|
+
for (const label of labels) {
|
|
33137
|
+
const fillKey = findKey11(label, "fillClrLst", getLocalName);
|
|
33138
|
+
if (fillKey) {
|
|
33139
|
+
const value = transform.fillColors[fillIndex++];
|
|
33140
|
+
const list = asObject(label[fillKey]);
|
|
33141
|
+
if (list && value) {
|
|
33142
|
+
applyColorToList(list, value, getLocalName);
|
|
33143
|
+
mutated = true;
|
|
33144
|
+
}
|
|
33145
|
+
}
|
|
33146
|
+
const lineKey = findKey11(label, "linClrLst", getLocalName);
|
|
33147
|
+
if (lineKey) {
|
|
33148
|
+
const value = transform.lineColors[lineIndex++];
|
|
33149
|
+
const list = asObject(label[lineKey]);
|
|
33150
|
+
if (list && value) {
|
|
33151
|
+
applyColorToList(list, value, getLocalName);
|
|
33152
|
+
mutated = true;
|
|
33153
|
+
}
|
|
33154
|
+
}
|
|
33155
|
+
}
|
|
33156
|
+
return mutated;
|
|
33157
|
+
}
|
|
33158
|
+
|
|
33159
|
+
// src/core/core/runtime/smartart-quickstyle-builder.ts
|
|
33160
|
+
function applySmartArtQuickStyle(styleDef, quickStyle) {
|
|
33161
|
+
if (!quickStyle || !quickStyle.name || quickStyle.name.length === 0) {
|
|
33162
|
+
return false;
|
|
33163
|
+
}
|
|
33164
|
+
if (styleDef["@_title"] === quickStyle.name) {
|
|
33165
|
+
return false;
|
|
33166
|
+
}
|
|
33167
|
+
styleDef["@_title"] = quickStyle.name;
|
|
33168
|
+
return true;
|
|
33169
|
+
}
|
|
33170
|
+
|
|
33171
|
+
// src/core/core/runtime/smartart-save-chrome.ts
|
|
33172
|
+
function asObject2(value) {
|
|
32867
33173
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
32868
33174
|
}
|
|
32869
33175
|
function applySmartArtChrome(dataModel, chrome, getLocalName) {
|
|
32870
33176
|
if (!chrome || !chrome.backgroundColor && !chrome.outlineColor && (chrome.outlineWidth === null || chrome.outlineWidth === void 0)) {
|
|
32871
33177
|
return;
|
|
32872
33178
|
}
|
|
32873
|
-
const
|
|
33179
|
+
const findKey12 = (obj, name) => Object.keys(obj).find((k) => getLocalName(k) === name);
|
|
32874
33180
|
if (chrome.backgroundColor) {
|
|
32875
|
-
const
|
|
32876
|
-
const bgKey =
|
|
32877
|
-
const bg =
|
|
32878
|
-
const fillKey =
|
|
32879
|
-
bg[fillKey] = { "a:srgbClr": { "@_val":
|
|
33181
|
+
const hex8 = chrome.backgroundColor.replace("#", "");
|
|
33182
|
+
const bgKey = findKey12(dataModel, "bg") ?? "dgm:bg";
|
|
33183
|
+
const bg = asObject2(dataModel[bgKey]);
|
|
33184
|
+
const fillKey = findKey12(bg, "solidFill") ?? "a:solidFill";
|
|
33185
|
+
bg[fillKey] = { "a:srgbClr": { "@_val": hex8 } };
|
|
32880
33186
|
dataModel[bgKey] = bg;
|
|
32881
33187
|
}
|
|
32882
33188
|
const hasOutlineWidth = chrome.outlineWidth !== null && chrome.outlineWidth !== void 0;
|
|
32883
33189
|
if (chrome.outlineColor || hasOutlineWidth) {
|
|
32884
|
-
const wholeKey =
|
|
32885
|
-
const whole =
|
|
32886
|
-
const lnKey =
|
|
32887
|
-
const ln =
|
|
33190
|
+
const wholeKey = findKey12(dataModel, "whole") ?? "dgm:whole";
|
|
33191
|
+
const whole = asObject2(dataModel[wholeKey]);
|
|
33192
|
+
const lnKey = findKey12(whole, "ln") ?? "a:ln";
|
|
33193
|
+
const ln = asObject2(whole[lnKey]);
|
|
32888
33194
|
if (hasOutlineWidth) {
|
|
32889
33195
|
ln["@_w"] = String(Math.round(chrome.outlineWidth * 12700));
|
|
32890
33196
|
}
|
|
32891
33197
|
if (chrome.outlineColor) {
|
|
32892
|
-
const
|
|
32893
|
-
const fillKey =
|
|
32894
|
-
ln[fillKey] = { "a:srgbClr": { "@_val":
|
|
33198
|
+
const hex8 = chrome.outlineColor.replace("#", "");
|
|
33199
|
+
const fillKey = findKey12(ln, "solidFill") ?? "a:solidFill";
|
|
33200
|
+
ln[fillKey] = { "a:srgbClr": { "@_val": hex8 } };
|
|
32895
33201
|
}
|
|
32896
33202
|
whole[lnKey] = ln;
|
|
32897
33203
|
dataModel[wholeKey] = whole;
|
|
@@ -32926,10 +33232,56 @@ function buildPointText(text) {
|
|
|
32926
33232
|
}
|
|
32927
33233
|
};
|
|
32928
33234
|
}
|
|
32929
|
-
function
|
|
33235
|
+
function joinRunText(runs) {
|
|
33236
|
+
return (runs ?? []).map((run) => run.text).join("");
|
|
33237
|
+
}
|
|
33238
|
+
function buildMultiRunParagraph(runs) {
|
|
33239
|
+
const runObjects = runs.map((run) => {
|
|
33240
|
+
const rObj = {};
|
|
33241
|
+
rObj["a:rPr"] = run.rPr ?? { "@_lang": "en-US", "@_dirty": "0" };
|
|
33242
|
+
rObj["a:t"] = run.text;
|
|
33243
|
+
return rObj;
|
|
33244
|
+
});
|
|
33245
|
+
return { "a:r": runObjects.length === 1 ? runObjects[0] : runObjects };
|
|
33246
|
+
}
|
|
33247
|
+
function shouldRebuildFromRuns(node) {
|
|
33248
|
+
const runs = node.runs;
|
|
33249
|
+
if (!runs || runs.length === 0) {
|
|
33250
|
+
return false;
|
|
33251
|
+
}
|
|
33252
|
+
const hasRichRun = runs.length > 1 || Boolean(runs[0]?.rPr);
|
|
33253
|
+
if (!hasRichRun) {
|
|
33254
|
+
return false;
|
|
33255
|
+
}
|
|
33256
|
+
return joinRunText(runs) === node.text;
|
|
33257
|
+
}
|
|
33258
|
+
function buildPointFromRuns(runs) {
|
|
33259
|
+
return {
|
|
33260
|
+
"a:bodyPr": {},
|
|
33261
|
+
"a:lstStyle": {},
|
|
33262
|
+
"a:p": buildMultiRunParagraph(runs)
|
|
33263
|
+
};
|
|
33264
|
+
}
|
|
33265
|
+
function applyRunsToExistingBody(pt2, tKey, runs) {
|
|
33266
|
+
const body = pt2[tKey];
|
|
33267
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
33268
|
+
pt2[tKey] = buildPointFromRuns(runs);
|
|
33269
|
+
return;
|
|
33270
|
+
}
|
|
33271
|
+
const bodyObj = body;
|
|
33272
|
+
const pKey = Object.keys(bodyObj).find((k) => stripPrefix(k) === "p");
|
|
33273
|
+
bodyObj[pKey ?? "a:p"] = buildMultiRunParagraph(runs);
|
|
33274
|
+
}
|
|
33275
|
+
function applyTextToExistingPoint(pt2, node) {
|
|
33276
|
+
const text = node.text;
|
|
33277
|
+
const rebuildFromRuns = shouldRebuildFromRuns(node);
|
|
32930
33278
|
const tKey = Object.keys(pt2).find((k) => stripPrefix(k) === "t");
|
|
32931
33279
|
if (!tKey) {
|
|
32932
|
-
pt2["dgm:t"] = buildPointText(text);
|
|
33280
|
+
pt2["dgm:t"] = rebuildFromRuns ? buildPointFromRuns(node.runs) : buildPointText(text);
|
|
33281
|
+
return;
|
|
33282
|
+
}
|
|
33283
|
+
if (rebuildFromRuns) {
|
|
33284
|
+
applyRunsToExistingBody(pt2, tKey, node.runs);
|
|
32933
33285
|
return;
|
|
32934
33286
|
}
|
|
32935
33287
|
const body = pt2[tKey];
|
|
@@ -32990,7 +33342,7 @@ function mergeSmartArtPointXml(existingPts, nodes) {
|
|
|
32990
33342
|
if (!desired) {
|
|
32991
33343
|
continue;
|
|
32992
33344
|
}
|
|
32993
|
-
applyTextToExistingPoint(pt2, desired
|
|
33345
|
+
applyTextToExistingPoint(pt2, desired);
|
|
32994
33346
|
seenContentIds.add(modelId);
|
|
32995
33347
|
merged.push(pt2);
|
|
32996
33348
|
}
|
|
@@ -33003,7 +33355,7 @@ function mergeSmartArtPointXml(existingPts, nodes) {
|
|
|
33003
33355
|
if (node.nodeType && !NON_CONTENT_POINT_TYPES.has(node.nodeType)) {
|
|
33004
33356
|
ptNode["@_type"] = node.nodeType;
|
|
33005
33357
|
}
|
|
33006
|
-
ptNode["dgm:t"] = buildPointText(node.text);
|
|
33358
|
+
ptNode["dgm:t"] = shouldRebuildFromRuns(node) ? buildPointFromRuns(node.runs) : buildPointText(node.text);
|
|
33007
33359
|
merged.push(ptNode);
|
|
33008
33360
|
}
|
|
33009
33361
|
return merged;
|
|
@@ -33112,9 +33464,83 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
33112
33464
|
} catch (e) {
|
|
33113
33465
|
console.warn(`Failed to save SmartArt data at ${dataPartPath}:`, e);
|
|
33114
33466
|
}
|
|
33467
|
+
await this.regenerateSmartArtColorPart(slidePath, smartArtData);
|
|
33468
|
+
await this.regenerateSmartArtQuickStylePart(slidePath, smartArtData);
|
|
33115
33469
|
}
|
|
33116
33470
|
this.pendingSmartArtUpdates = void 0;
|
|
33117
33471
|
}
|
|
33472
|
+
/**
|
|
33473
|
+
* Merge the in-memory colour transform back into `ppt/diagrams/colors*.xml`.
|
|
33474
|
+
*
|
|
33475
|
+
* Resolves the part via the SmartArt `colorsRelId` relationship alongside
|
|
33476
|
+
* the data part, merges surgically (preserving unknown content), and skips
|
|
33477
|
+
* gracefully when the rel or part is absent. No-op when the in-memory data
|
|
33478
|
+
* carries no colour transform.
|
|
33479
|
+
*/
|
|
33480
|
+
async regenerateSmartArtColorPart(slidePath, smartArtData) {
|
|
33481
|
+
const transform = smartArtData?.colorTransform;
|
|
33482
|
+
if (!smartArtData?.colorsRelId || !transform) {
|
|
33483
|
+
return;
|
|
33484
|
+
}
|
|
33485
|
+
await this.mergeSmartArtDiagramPart(
|
|
33486
|
+
slidePath,
|
|
33487
|
+
smartArtData.colorsRelId,
|
|
33488
|
+
"colorsDef",
|
|
33489
|
+
"colours",
|
|
33490
|
+
(colorsDef) => applySmartArtColorTransform(
|
|
33491
|
+
colorsDef,
|
|
33492
|
+
transform,
|
|
33493
|
+
(k) => this.compatibilityService.getXmlLocalName(k)
|
|
33494
|
+
)
|
|
33495
|
+
);
|
|
33496
|
+
}
|
|
33497
|
+
/**
|
|
33498
|
+
* Merge the in-memory quick style back into `ppt/diagrams/quickStyles*.xml`.
|
|
33499
|
+
*
|
|
33500
|
+
* Resolves the part via the SmartArt `styleRelId` relationship, merges
|
|
33501
|
+
* surgically, and skips gracefully when the rel or part is absent. No-op
|
|
33502
|
+
* when the in-memory data carries no quick style.
|
|
33503
|
+
*/
|
|
33504
|
+
async regenerateSmartArtQuickStylePart(slidePath, smartArtData) {
|
|
33505
|
+
const quickStyle = smartArtData?.quickStyle;
|
|
33506
|
+
if (!smartArtData?.styleRelId || !quickStyle) {
|
|
33507
|
+
return;
|
|
33508
|
+
}
|
|
33509
|
+
await this.mergeSmartArtDiagramPart(
|
|
33510
|
+
slidePath,
|
|
33511
|
+
smartArtData.styleRelId,
|
|
33512
|
+
"styleDef",
|
|
33513
|
+
"quick style",
|
|
33514
|
+
(styleDef) => applySmartArtQuickStyle(styleDef, quickStyle)
|
|
33515
|
+
);
|
|
33516
|
+
}
|
|
33517
|
+
/**
|
|
33518
|
+
* Read a SmartArt diagram part by slide relationship id, locate its root
|
|
33519
|
+
* definition element by local name, apply a surgical merge callback, and
|
|
33520
|
+
* write the part back only when the callback reports a change. Skips
|
|
33521
|
+
* gracefully when the rel, part, or root element is absent.
|
|
33522
|
+
*/
|
|
33523
|
+
async mergeSmartArtDiagramPart(slidePath, relId, defLocalName, label, merge) {
|
|
33524
|
+
const relationships = this.slideRelsMap.get(slidePath);
|
|
33525
|
+
const target = relationships?.get(relId);
|
|
33526
|
+
if (!target) {
|
|
33527
|
+
return;
|
|
33528
|
+
}
|
|
33529
|
+
const partPath = this.resolveImagePath(slidePath, target);
|
|
33530
|
+
const existingXml = await this.zip.file(partPath)?.async("string");
|
|
33531
|
+
if (!existingXml) {
|
|
33532
|
+
return;
|
|
33533
|
+
}
|
|
33534
|
+
try {
|
|
33535
|
+
const parsed = this.parser.parse(existingXml);
|
|
33536
|
+
const def = this.xmlLookupService.getChildByLocalName(parsed, defLocalName);
|
|
33537
|
+
if (def && merge(def)) {
|
|
33538
|
+
this.zip.file(partPath, this.builder.build(parsed));
|
|
33539
|
+
}
|
|
33540
|
+
} catch (e) {
|
|
33541
|
+
console.warn(`Failed to save SmartArt ${label} at ${partPath}:`, e);
|
|
33542
|
+
}
|
|
33543
|
+
}
|
|
33118
33544
|
/**
|
|
33119
33545
|
* Find the slide path for an element by scanning the slideMap.
|
|
33120
33546
|
*/
|
|
@@ -33146,10 +33572,10 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
33146
33572
|
}
|
|
33147
33573
|
const cSld = root["p:cSld"] || {};
|
|
33148
33574
|
if (notesMaster.backgroundColor) {
|
|
33149
|
-
const
|
|
33575
|
+
const hex8 = notesMaster.backgroundColor.replace("#", "");
|
|
33150
33576
|
cSld["p:bg"] = {
|
|
33151
33577
|
"p:bgPr": {
|
|
33152
|
-
"a:solidFill": { "a:srgbClr": { "@_val":
|
|
33578
|
+
"a:solidFill": { "a:srgbClr": { "@_val": hex8 } },
|
|
33153
33579
|
"a:effectLst": {}
|
|
33154
33580
|
}
|
|
33155
33581
|
};
|
|
@@ -33182,10 +33608,10 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
33182
33608
|
}
|
|
33183
33609
|
const cSld = root["p:cSld"] || {};
|
|
33184
33610
|
if (handoutMaster.backgroundColor) {
|
|
33185
|
-
const
|
|
33611
|
+
const hex8 = handoutMaster.backgroundColor.replace("#", "");
|
|
33186
33612
|
cSld["p:bg"] = {
|
|
33187
33613
|
"p:bgPr": {
|
|
33188
|
-
"a:solidFill": { "a:srgbClr": { "@_val":
|
|
33614
|
+
"a:solidFill": { "a:srgbClr": { "@_val": hex8 } },
|
|
33189
33615
|
"a:effectLst": {}
|
|
33190
33616
|
}
|
|
33191
33617
|
};
|
|
@@ -35635,8 +36061,8 @@ var PptxHandlerRuntime34 = class extends PptxHandlerRuntime33 {
|
|
|
35635
36061
|
*/
|
|
35636
36062
|
buildClrSchemeObject(schemeName, colorMap) {
|
|
35637
36063
|
const slot = (key) => {
|
|
35638
|
-
const
|
|
35639
|
-
const srgb =
|
|
36064
|
+
const hex8 = String(colorMap[key] || "").replace(/^#/, "");
|
|
36065
|
+
const srgb = hex8.length === 6 ? hex8.toUpperCase() : "000000";
|
|
35640
36066
|
return { "a:srgbClr": { "@_val": srgb } };
|
|
35641
36067
|
};
|
|
35642
36068
|
return {
|
|
@@ -36300,6 +36726,12 @@ var PptxHandlerRuntime40 = class _PptxHandlerRuntime extends PptxHandlerRuntime3
|
|
|
36300
36726
|
xmlLookupService: this.xmlLookupService
|
|
36301
36727
|
});
|
|
36302
36728
|
this.deduplicateExtensionLists(this.presentationData);
|
|
36729
|
+
if (effectiveConformance === "transitional") {
|
|
36730
|
+
const presentationNode = this.presentationData["p:presentation"];
|
|
36731
|
+
if (presentationNode && "@_conformance" in presentationNode) {
|
|
36732
|
+
delete presentationNode["@_conformance"];
|
|
36733
|
+
}
|
|
36734
|
+
}
|
|
36303
36735
|
const presentationXml2 = this.builder.build(this.presentationData);
|
|
36304
36736
|
this.zip.file("ppt/presentation.xml", presentationXml2);
|
|
36305
36737
|
}
|
|
@@ -42409,8 +42841,8 @@ var PptxHandlerRuntime66 = class extends PptxHandlerRuntime65 {
|
|
|
42409
42841
|
/**
|
|
42410
42842
|
* Build an OOXML colour node (`a:srgbClr`) from a hex string.
|
|
42411
42843
|
*/
|
|
42412
|
-
buildSrgbClrNode(
|
|
42413
|
-
const clean =
|
|
42844
|
+
buildSrgbClrNode(hex8) {
|
|
42845
|
+
const clean = hex8.replace(/^#/, "").toUpperCase();
|
|
42414
42846
|
return { "a:srgbClr": { "@_val": clean } };
|
|
42415
42847
|
}
|
|
42416
42848
|
/**
|
|
@@ -42833,6 +43265,45 @@ var PptxHandlerRuntime68 = class extends PptxHandlerRuntime67 {
|
|
|
42833
43265
|
}
|
|
42834
43266
|
}
|
|
42835
43267
|
}
|
|
43268
|
+
/**
|
|
43269
|
+
* Extract the per-run text + run-properties of a SmartArt content point's
|
|
43270
|
+
* first paragraph (`dgm:t/a:p/a:r`).
|
|
43271
|
+
*
|
|
43272
|
+
* Each `a:r` yields one {@link PptxSmartArtTextRun} carrying its joined
|
|
43273
|
+
* `a:t` text and a verbatim copy of its `a:rPr` properties (when present).
|
|
43274
|
+
* Only the first paragraph is captured: SmartArt content points are
|
|
43275
|
+
* single-paragraph in practice, and the round-trip save path rebuilds a
|
|
43276
|
+
* single paragraph from these runs. Returns undefined when there is fewer
|
|
43277
|
+
* than one run worth preserving (a single run is still returned so per-run
|
|
43278
|
+
* formatting like a bold sole run survives).
|
|
43279
|
+
*/
|
|
43280
|
+
extractSmartArtNodeRuns(point) {
|
|
43281
|
+
const tBody = this.xmlLookupService.getChildByLocalName(point, "t");
|
|
43282
|
+
if (!tBody) {
|
|
43283
|
+
return void 0;
|
|
43284
|
+
}
|
|
43285
|
+
const paragraph = this.xmlLookupService.getChildrenArrayByLocalName(tBody, "p")[0];
|
|
43286
|
+
if (!paragraph) {
|
|
43287
|
+
return void 0;
|
|
43288
|
+
}
|
|
43289
|
+
const runNodes = this.xmlLookupService.getChildrenArrayByLocalName(paragraph, "r");
|
|
43290
|
+
if (runNodes.length === 0) {
|
|
43291
|
+
return void 0;
|
|
43292
|
+
}
|
|
43293
|
+
const runs = [];
|
|
43294
|
+
for (const run of runNodes) {
|
|
43295
|
+
const textValues = [];
|
|
43296
|
+
this.collectLocalTextValues(run, "t", textValues);
|
|
43297
|
+
const text = textValues.join("");
|
|
43298
|
+
const rPrNode = this.xmlLookupService.getChildByLocalName(run, "rPr");
|
|
43299
|
+
const entry = { text };
|
|
43300
|
+
if (rPrNode) {
|
|
43301
|
+
entry.rPr = JSON.parse(JSON.stringify(rPrNode));
|
|
43302
|
+
}
|
|
43303
|
+
runs.push(entry);
|
|
43304
|
+
}
|
|
43305
|
+
return runs.length > 0 ? runs : void 0;
|
|
43306
|
+
}
|
|
42836
43307
|
/**
|
|
42837
43308
|
* Parse background and outline chrome from `dgm:bg` and `dgm:whole`.
|
|
42838
43309
|
*/
|
|
@@ -43136,11 +43607,13 @@ var PptxHandlerRuntime70 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
|
|
|
43136
43607
|
if (!resolvedText) {
|
|
43137
43608
|
return null;
|
|
43138
43609
|
}
|
|
43610
|
+
const runs = this.extractSmartArtNodeRuns(point);
|
|
43139
43611
|
return {
|
|
43140
43612
|
id: pointId,
|
|
43141
43613
|
text: resolvedText.trim(),
|
|
43142
43614
|
parentId: parentByNodeId.get(pointId),
|
|
43143
|
-
nodeType
|
|
43615
|
+
nodeType,
|
|
43616
|
+
runs
|
|
43144
43617
|
};
|
|
43145
43618
|
}).filter((entry) => Boolean(entry)).slice(0, MAX_SMARTART_NODES);
|
|
43146
43619
|
if (nodes.length === 0) {
|
|
@@ -43858,11 +44331,11 @@ var PptxHandlerRuntime74 = class extends PptxHandlerRuntime73 {
|
|
|
43858
44331
|
} else if (localName === "srgbClr") {
|
|
43859
44332
|
const items = Array.isArray(value) ? value : [value];
|
|
43860
44333
|
for (const item of items) {
|
|
43861
|
-
const
|
|
44334
|
+
const hex8 = String(
|
|
43862
44335
|
typeof item === "object" && item !== null ? item["@_val"] : item ?? ""
|
|
43863
44336
|
).trim();
|
|
43864
|
-
if (
|
|
43865
|
-
output.push(
|
|
44337
|
+
if (hex8.length > 0) {
|
|
44338
|
+
output.push(hex8.startsWith("#") ? hex8 : `#${hex8}`);
|
|
43866
44339
|
}
|
|
43867
44340
|
}
|
|
43868
44341
|
}
|
|
@@ -43930,9 +44403,10 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
|
|
|
43930
44403
|
return void 0;
|
|
43931
44404
|
}
|
|
43932
44405
|
const chartType = this.detectChartType(plotArea);
|
|
43933
|
-
const
|
|
44406
|
+
const chartContainerKeys = Object.keys(plotArea).filter(
|
|
43934
44407
|
(key) => this.compatibilityService.getXmlLocalName(key).endsWith("Chart")
|
|
43935
44408
|
);
|
|
44409
|
+
const seriesContainerKey = chartContainerKeys[0];
|
|
43936
44410
|
if (!seriesContainerKey) {
|
|
43937
44411
|
return this.parseCxChart(
|
|
43938
44412
|
plotArea,
|
|
@@ -43944,19 +44418,14 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
|
|
|
43944
44418
|
);
|
|
43945
44419
|
}
|
|
43946
44420
|
const seriesContainer = plotArea[seriesContainerKey];
|
|
43947
|
-
const
|
|
43948
|
-
|
|
44421
|
+
const { categories, series } = this.parseAllChartContainers(
|
|
44422
|
+
plotArea,
|
|
44423
|
+
chartContainerKeys,
|
|
44424
|
+
chartType
|
|
44425
|
+
);
|
|
44426
|
+
if (series.length === 0) {
|
|
43949
44427
|
return void 0;
|
|
43950
44428
|
}
|
|
43951
|
-
const categoriesFromFirstSeries = this.extractChartPointValues(
|
|
43952
|
-
this.xmlLookupService.getChildByLocalName(seriesList[0], "cat"),
|
|
43953
|
-
false
|
|
43954
|
-
);
|
|
43955
|
-
const categories = categoriesFromFirstSeries.length ? categoriesFromFirstSeries : this.extractChartPointValues(
|
|
43956
|
-
this.xmlLookupService.getChildByLocalName(seriesList[0], "xVal"),
|
|
43957
|
-
false
|
|
43958
|
-
);
|
|
43959
|
-
const series = this.buildChartSeries(seriesList, categories);
|
|
43960
44429
|
const titleNode = this.xmlLookupService.getChildByLocalName(chartRoot, "title");
|
|
43961
44430
|
const titleTextValues = [];
|
|
43962
44431
|
this.collectLocalTextValues(titleNode, "t", titleTextValues);
|
|
@@ -44055,6 +44524,49 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
|
|
|
44055
44524
|
...clrMapOvr ? { clrMapOvr } : {}
|
|
44056
44525
|
};
|
|
44057
44526
|
}
|
|
44527
|
+
/**
|
|
44528
|
+
* Parse every chart-type container in the plot area into a single flat
|
|
44529
|
+
* series list plus a shared category list.
|
|
44530
|
+
*
|
|
44531
|
+
* For a single-type chart this parses the one container exactly as before.
|
|
44532
|
+
* For a combo chart (multiple `c:*Chart` siblings) each container's series
|
|
44533
|
+
* are parsed and tagged with the container's chart type via
|
|
44534
|
+
* {@link PptxChartSeries.seriesChartType}, so the combo serializer can
|
|
44535
|
+
* re-emit each series under the correct container on save. Series keep the
|
|
44536
|
+
* document order of their containers.
|
|
44537
|
+
*
|
|
44538
|
+
* @param plotArea - The `c:plotArea` XML object.
|
|
44539
|
+
* @param containerKeys - All chart-type container keys, in document order.
|
|
44540
|
+
* @param chartLevelType - The detected chart-level type. When this is
|
|
44541
|
+
* `combo`, each series is tagged with its own container type; otherwise no
|
|
44542
|
+
* per-series type is set (the chart-level type applies to every series).
|
|
44543
|
+
* @returns The merged categories and series.
|
|
44544
|
+
*/
|
|
44545
|
+
parseAllChartContainers(plotArea, containerKeys, chartLevelType) {
|
|
44546
|
+
const isCombo = chartLevelType === "combo";
|
|
44547
|
+
let categories = [];
|
|
44548
|
+
const series = [];
|
|
44549
|
+
for (const containerKey of containerKeys) {
|
|
44550
|
+
const container = plotArea[containerKey];
|
|
44551
|
+
const seriesList = this.xmlLookupService.getChildrenArrayByLocalName(container, "ser");
|
|
44552
|
+
if (seriesList.length === 0) {
|
|
44553
|
+
continue;
|
|
44554
|
+
}
|
|
44555
|
+
if (categories.length === 0) {
|
|
44556
|
+
const fromCat = this.extractChartPointValues(
|
|
44557
|
+
this.xmlLookupService.getChildByLocalName(seriesList[0], "cat"),
|
|
44558
|
+
false
|
|
44559
|
+
);
|
|
44560
|
+
categories = fromCat.length ? fromCat : this.extractChartPointValues(
|
|
44561
|
+
this.xmlLookupService.getChildByLocalName(seriesList[0], "xVal"),
|
|
44562
|
+
false
|
|
44563
|
+
);
|
|
44564
|
+
}
|
|
44565
|
+
const containerType = isCombo ? chartContainerLocalNameToType(this.compatibilityService.getXmlLocalName(containerKey)) : void 0;
|
|
44566
|
+
series.push(...this.buildChartSeries(seriesList, categories, containerType));
|
|
44567
|
+
}
|
|
44568
|
+
return { categories, series };
|
|
44569
|
+
}
|
|
44058
44570
|
/**
|
|
44059
44571
|
* Build the series array from raw OOXML `c:ser` nodes.
|
|
44060
44572
|
*
|
|
@@ -44064,9 +44576,11 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
|
|
|
44064
44576
|
*
|
|
44065
44577
|
* @param seriesList - Array of `c:ser` XML objects from the chart container.
|
|
44066
44578
|
* @param categories - Pre-parsed category labels (used for fallback values).
|
|
44579
|
+
* @param seriesChartType - When set (combo charts), tags every series in this
|
|
44580
|
+
* container with its source chart type for round-trip.
|
|
44067
44581
|
* @returns The series array matching `PptxChartData["series"]`.
|
|
44068
44582
|
*/
|
|
44069
|
-
buildChartSeries(seriesList, categories) {
|
|
44583
|
+
buildChartSeries(seriesList, categories, seriesChartType) {
|
|
44070
44584
|
return seriesList.map((seriesNode, seriesIndex) => {
|
|
44071
44585
|
const seriesName = this.extractChartSeriesName(seriesNode);
|
|
44072
44586
|
const values = this.extractChartPointValues(
|
|
@@ -44104,7 +44618,8 @@ var PptxHandlerRuntime75 = class extends PptxHandlerRuntime74 {
|
|
|
44104
44618
|
...dataPoints.length > 0 ? { dataPoints } : {},
|
|
44105
44619
|
...seriesMarker ? { marker: seriesMarker } : {},
|
|
44106
44620
|
...dataLabels.length > 0 ? { dataLabels } : {},
|
|
44107
|
-
...explosion !== void 0 ? { explosion } : {}
|
|
44621
|
+
...explosion !== void 0 ? { explosion } : {},
|
|
44622
|
+
...seriesChartType ? { seriesChartType } : {}
|
|
44108
44623
|
};
|
|
44109
44624
|
});
|
|
44110
44625
|
}
|
|
@@ -57091,6 +57606,51 @@ function setChartDataPointExplosion(element, seriesIndex, pointIndex, explosion)
|
|
|
57091
57606
|
const dp = ensureDataPoint(series, pointIndex);
|
|
57092
57607
|
dp.explosion = explosion;
|
|
57093
57608
|
}
|
|
57609
|
+
function applyLabelEdit(label, edit) {
|
|
57610
|
+
if (edit.showValue !== void 0) {
|
|
57611
|
+
label.showVal = edit.showValue;
|
|
57612
|
+
}
|
|
57613
|
+
if (edit.showCategory !== void 0) {
|
|
57614
|
+
label.showCatName = edit.showCategory;
|
|
57615
|
+
}
|
|
57616
|
+
if (edit.showSeriesName !== void 0) {
|
|
57617
|
+
label.showSerName = edit.showSeriesName;
|
|
57618
|
+
}
|
|
57619
|
+
if (edit.showPercent !== void 0) {
|
|
57620
|
+
label.showPercent = edit.showPercent;
|
|
57621
|
+
}
|
|
57622
|
+
if (edit.showLegendKey !== void 0) {
|
|
57623
|
+
label.showLegendKey = edit.showLegendKey;
|
|
57624
|
+
}
|
|
57625
|
+
if (edit.position !== void 0) {
|
|
57626
|
+
label.position = edit.position;
|
|
57627
|
+
}
|
|
57628
|
+
if (edit.text !== void 0) {
|
|
57629
|
+
label.text = edit.text === "" ? void 0 : edit.text;
|
|
57630
|
+
}
|
|
57631
|
+
}
|
|
57632
|
+
function setChartDataPointLabel(element, seriesIndex, pointIndex, edit) {
|
|
57633
|
+
validateSeriesIndex(element, seriesIndex);
|
|
57634
|
+
const series = element.chartData.series[seriesIndex];
|
|
57635
|
+
if (edit === null) {
|
|
57636
|
+
if (!series.dataLabels) {
|
|
57637
|
+
return;
|
|
57638
|
+
}
|
|
57639
|
+
series.dataLabels = series.dataLabels.filter((l) => l.idx !== pointIndex);
|
|
57640
|
+
if (series.dataLabels.length === 0) {
|
|
57641
|
+
series.dataLabels = void 0;
|
|
57642
|
+
}
|
|
57643
|
+
return;
|
|
57644
|
+
}
|
|
57645
|
+
const labels = series.dataLabels ??= [];
|
|
57646
|
+
let label = labels.find((l) => l.idx === pointIndex);
|
|
57647
|
+
if (!label) {
|
|
57648
|
+
label = { idx: pointIndex };
|
|
57649
|
+
labels.push(label);
|
|
57650
|
+
labels.sort((a, b) => a.idx - b.idx);
|
|
57651
|
+
}
|
|
57652
|
+
applyLabelEdit(label, edit);
|
|
57653
|
+
}
|
|
57094
57654
|
function removeEmptyDataPoint(series, pointIndex) {
|
|
57095
57655
|
if (!series.dataPoints) {
|
|
57096
57656
|
return;
|
|
@@ -57140,8 +57700,8 @@ function generateLayoutXml(definition) {
|
|
|
57140
57700
|
const phShapes = placeholders.map((ph, i) => placeholderSpXml(ph, i + 2)).join("\n");
|
|
57141
57701
|
let bgXml = "";
|
|
57142
57702
|
if (definition.backgroundColor) {
|
|
57143
|
-
const
|
|
57144
|
-
bgXml = ` <p:bg><p:bgPr><a:solidFill><a:srgbClr val="${
|
|
57703
|
+
const hex8 = definition.backgroundColor.replace(/^#/, "").toUpperCase();
|
|
57704
|
+
bgXml = ` <p:bg><p:bgPr><a:solidFill><a:srgbClr val="${hex8}"/></a:solidFill><a:effectLst/></p:bgPr></p:bg>
|
|
57145
57705
|
`;
|
|
57146
57706
|
}
|
|
57147
57707
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -57617,8 +58177,8 @@ var TextBuilder = class _TextBuilder {
|
|
|
57617
58177
|
*
|
|
57618
58178
|
* @param hex - Color as a hex string (e.g. "#FF0000").
|
|
57619
58179
|
*/
|
|
57620
|
-
color(
|
|
57621
|
-
this._options.color =
|
|
58180
|
+
color(hex8) {
|
|
58181
|
+
this._options.color = hex8;
|
|
57622
58182
|
return this;
|
|
57623
58183
|
}
|
|
57624
58184
|
/**
|
|
@@ -62394,8 +62954,8 @@ function stepTable10(t) {
|
|
|
62394
62954
|
}
|
|
62395
62955
|
return out.join(" ");
|
|
62396
62956
|
}
|
|
62397
|
-
function parseHexRgb(
|
|
62398
|
-
const m = /^#?([0-9a-f]{6})/i.exec(
|
|
62957
|
+
function parseHexRgb(hex8) {
|
|
62958
|
+
const m = /^#?([0-9a-f]{6})/i.exec(hex8.trim());
|
|
62399
62959
|
if (!m) {
|
|
62400
62960
|
return { r: 0, g: 0, b: 0 };
|
|
62401
62961
|
}
|
|
@@ -63371,6 +63931,7 @@ exports.setChartCategories = setChartCategories;
|
|
|
63371
63931
|
exports.setChartDataLabels = setChartDataLabels;
|
|
63372
63932
|
exports.setChartDataPointExplosion = setChartDataPointExplosion;
|
|
63373
63933
|
exports.setChartDataPointFill = setChartDataPointFill;
|
|
63934
|
+
exports.setChartDataPointLabel = setChartDataPointLabel;
|
|
63374
63935
|
exports.setChartGrouping = setChartGrouping;
|
|
63375
63936
|
exports.setChartLegend = setChartLegend;
|
|
63376
63937
|
exports.setChartSeriesChartType = setChartSeriesChartType;
|