pptx-viewer-core 1.1.34 → 1.1.35
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-CGO8Tx9z.d.mts → SvgExporter-CYyO9c5A.d.mts} +1 -1
- package/dist/{SvgExporter-DpupBlmk.d.ts → SvgExporter-DdjrIx33.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 +51 -6
- package/dist/index.d.ts +51 -6
- package/dist/index.js +393 -127
- package/dist/index.mjs +393 -128
- package/dist/{presentation-CyttD6sq.d.mts → presentation-BRAUjTRt.d.mts} +98 -45
- package/dist/{presentation-CyttD6sq.d.ts → presentation-BRAUjTRt.d.ts} +98 -45
- package/dist/{text-operations-DXebUVQp.d.ts → text-operations-BJUOhA1w.d.ts} +1 -1
- package/dist/{text-operations-D5GfkYT5.d.mts → text-operations-CkW4BO91.d.mts} +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6209,16 +6209,16 @@ var PptxShapeStyleExtractor = class {
|
|
|
6209
6209
|
extractShapeStyle(spPr, styleNode) {
|
|
6210
6210
|
const style = {};
|
|
6211
6211
|
const shapeProps = spPr || {};
|
|
6212
|
-
const
|
|
6212
|
+
const solidFill2 = shapeProps["a:solidFill"];
|
|
6213
6213
|
const gradFill = shapeProps["a:gradFill"];
|
|
6214
6214
|
const pattFill = shapeProps["a:pattFill"];
|
|
6215
6215
|
const noFill = shapeProps["a:noFill"];
|
|
6216
6216
|
const blipFill = shapeProps["a:blipFill"];
|
|
6217
|
-
if (
|
|
6217
|
+
if (solidFill2) {
|
|
6218
6218
|
style.fillMode = "solid";
|
|
6219
|
-
style.fillColor = this.context.parseColor(
|
|
6220
|
-
style.fillOpacity = this.context.extractColorOpacity(
|
|
6221
|
-
const solidFillColorXml = extractColorChoiceXml(
|
|
6219
|
+
style.fillColor = this.context.parseColor(solidFill2);
|
|
6220
|
+
style.fillOpacity = this.context.extractColorOpacity(solidFill2);
|
|
6221
|
+
const solidFillColorXml = extractColorChoiceXml(solidFill2);
|
|
6222
6222
|
if (solidFillColorXml) {
|
|
6223
6223
|
style.fillColorXml = solidFillColorXml;
|
|
6224
6224
|
}
|
|
@@ -8949,15 +8949,15 @@ var PptxSlideLoaderService = class {
|
|
|
8949
8949
|
|
|
8950
8950
|
// src/core/services/PptxXmlLookupService.ts
|
|
8951
8951
|
var PptxXmlLookupService = class {
|
|
8952
|
-
getChildByLocalName(parent,
|
|
8952
|
+
getChildByLocalName(parent, localName2) {
|
|
8953
8953
|
if (!parent) {
|
|
8954
8954
|
return void 0;
|
|
8955
8955
|
}
|
|
8956
|
-
const direct = parent[
|
|
8956
|
+
const direct = parent[localName2];
|
|
8957
8957
|
if (direct && typeof direct === "object" && !Array.isArray(direct)) {
|
|
8958
8958
|
return direct;
|
|
8959
8959
|
}
|
|
8960
|
-
const suffix = `:${
|
|
8960
|
+
const suffix = `:${localName2}`;
|
|
8961
8961
|
const matchingKey = Object.keys(parent).find((key) => key.endsWith(suffix));
|
|
8962
8962
|
if (!matchingKey) {
|
|
8963
8963
|
return void 0;
|
|
@@ -8968,32 +8968,32 @@ var PptxXmlLookupService = class {
|
|
|
8968
8968
|
}
|
|
8969
8969
|
return value;
|
|
8970
8970
|
}
|
|
8971
|
-
getChildrenArrayByLocalName(parent,
|
|
8971
|
+
getChildrenArrayByLocalName(parent, localName2) {
|
|
8972
8972
|
if (!parent) {
|
|
8973
8973
|
return [];
|
|
8974
8974
|
}
|
|
8975
|
-
const direct = parent[
|
|
8975
|
+
const direct = parent[localName2];
|
|
8976
8976
|
if (direct !== void 0) {
|
|
8977
8977
|
return this.toXmlArray(direct);
|
|
8978
8978
|
}
|
|
8979
|
-
const suffix = `:${
|
|
8979
|
+
const suffix = `:${localName2}`;
|
|
8980
8980
|
const matchingKey = Object.keys(parent).find((key) => key.endsWith(suffix));
|
|
8981
8981
|
if (!matchingKey) {
|
|
8982
8982
|
return [];
|
|
8983
8983
|
}
|
|
8984
8984
|
return this.toXmlArray(parent[matchingKey]);
|
|
8985
8985
|
}
|
|
8986
|
-
getScalarChildByLocalName(parent,
|
|
8986
|
+
getScalarChildByLocalName(parent, localName2) {
|
|
8987
8987
|
if (!parent) {
|
|
8988
8988
|
return void 0;
|
|
8989
8989
|
}
|
|
8990
|
-
const direct = parent[
|
|
8990
|
+
const direct = parent[localName2];
|
|
8991
8991
|
if (typeof direct === "string" || typeof direct === "number") {
|
|
8992
8992
|
return String(direct);
|
|
8993
8993
|
}
|
|
8994
|
-
const suffix = `:${
|
|
8994
|
+
const suffix = `:${localName2}`;
|
|
8995
8995
|
for (const [key, value] of Object.entries(parent)) {
|
|
8996
|
-
if (key !==
|
|
8996
|
+
if (key !== localName2 && !key.endsWith(suffix)) {
|
|
8997
8997
|
continue;
|
|
8998
8998
|
}
|
|
8999
8999
|
if (typeof value === "string" || typeof value === "number") {
|
|
@@ -10438,11 +10438,11 @@ function parseP14FromExtLst(extLstNode, xmlLookupService, getXmlLocalName) {
|
|
|
10438
10438
|
if (key.startsWith("@_")) {
|
|
10439
10439
|
continue;
|
|
10440
10440
|
}
|
|
10441
|
-
const
|
|
10442
|
-
if (!P14_TRANSITION_TYPES.has(
|
|
10441
|
+
const localName2 = getXmlLocalName(key);
|
|
10442
|
+
if (!P14_TRANSITION_TYPES.has(localName2)) {
|
|
10443
10443
|
continue;
|
|
10444
10444
|
}
|
|
10445
|
-
const type =
|
|
10445
|
+
const type = localName2;
|
|
10446
10446
|
let direction;
|
|
10447
10447
|
let orient;
|
|
10448
10448
|
let pattern;
|
|
@@ -10492,8 +10492,8 @@ function buildP14ExtLst(transitionType, direction, orient, pattern, rawExtLst, x
|
|
|
10492
10492
|
if (key.startsWith("@_")) {
|
|
10493
10493
|
continue;
|
|
10494
10494
|
}
|
|
10495
|
-
const
|
|
10496
|
-
if (P14_TRANSITION_TYPES.has(
|
|
10495
|
+
const localName2 = getXmlLocalName(key);
|
|
10496
|
+
if (P14_TRANSITION_TYPES.has(localName2)) {
|
|
10497
10497
|
return false;
|
|
10498
10498
|
}
|
|
10499
10499
|
}
|
|
@@ -10556,17 +10556,17 @@ var PptxSlideTransitionService = class {
|
|
|
10556
10556
|
if (key.startsWith("@_")) {
|
|
10557
10557
|
continue;
|
|
10558
10558
|
}
|
|
10559
|
-
const
|
|
10560
|
-
if (
|
|
10559
|
+
const localName2 = this.getXmlLocalName(key);
|
|
10560
|
+
if (localName2 === "sndAc") {
|
|
10561
10561
|
rawSoundAction = value;
|
|
10562
10562
|
continue;
|
|
10563
10563
|
}
|
|
10564
|
-
if (
|
|
10564
|
+
if (localName2 === "extLst") {
|
|
10565
10565
|
rawExtLst = value;
|
|
10566
10566
|
continue;
|
|
10567
10567
|
}
|
|
10568
|
-
if (TRANSITION_TYPES.has(
|
|
10569
|
-
transitionType =
|
|
10568
|
+
if (TRANSITION_TYPES.has(localName2)) {
|
|
10569
|
+
transitionType = localName2;
|
|
10570
10570
|
}
|
|
10571
10571
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
10572
10572
|
const detail = value;
|
|
@@ -12743,27 +12743,27 @@ function detectDigitalSignatures(zipEntryPaths) {
|
|
|
12743
12743
|
function getSignaturePathsToStrip(zipEntryPaths) {
|
|
12744
12744
|
return zipEntryPaths.filter((p) => p.startsWith(SIGNATURE_PREFIX));
|
|
12745
12745
|
}
|
|
12746
|
-
function findByLocalName(parent,
|
|
12746
|
+
function findByLocalName(parent, localName2) {
|
|
12747
12747
|
if (!parent) {
|
|
12748
12748
|
return void 0;
|
|
12749
12749
|
}
|
|
12750
|
-
if (parent[
|
|
12751
|
-
return parent[
|
|
12750
|
+
if (parent[localName2] !== void 0 && typeof parent[localName2] === "object") {
|
|
12751
|
+
return parent[localName2];
|
|
12752
12752
|
}
|
|
12753
12753
|
for (const key of Object.keys(parent)) {
|
|
12754
12754
|
const parts = key.split(":");
|
|
12755
|
-
if (parts[parts.length - 1] ===
|
|
12755
|
+
if (parts[parts.length - 1] === localName2 && typeof parent[key] === "object") {
|
|
12756
12756
|
return parent[key];
|
|
12757
12757
|
}
|
|
12758
12758
|
}
|
|
12759
12759
|
return void 0;
|
|
12760
12760
|
}
|
|
12761
|
-
function findScalarByLocalName(parent,
|
|
12761
|
+
function findScalarByLocalName(parent, localName2) {
|
|
12762
12762
|
if (!parent) {
|
|
12763
12763
|
return void 0;
|
|
12764
12764
|
}
|
|
12765
|
-
if (parent[
|
|
12766
|
-
const v = parent[
|
|
12765
|
+
if (parent[localName2] !== void 0) {
|
|
12766
|
+
const v = parent[localName2];
|
|
12767
12767
|
if (typeof v === "string") {
|
|
12768
12768
|
return v;
|
|
12769
12769
|
}
|
|
@@ -12776,7 +12776,7 @@ function findScalarByLocalName(parent, localName) {
|
|
|
12776
12776
|
}
|
|
12777
12777
|
for (const key of Object.keys(parent)) {
|
|
12778
12778
|
const parts = key.split(":");
|
|
12779
|
-
if (parts[parts.length - 1] ===
|
|
12779
|
+
if (parts[parts.length - 1] === localName2) {
|
|
12780
12780
|
const v = parent[key];
|
|
12781
12781
|
if (typeof v === "string") {
|
|
12782
12782
|
return v;
|
|
@@ -12791,13 +12791,13 @@ function findScalarByLocalName(parent, localName) {
|
|
|
12791
12791
|
}
|
|
12792
12792
|
return void 0;
|
|
12793
12793
|
}
|
|
12794
|
-
function findAllByLocalName(parent,
|
|
12794
|
+
function findAllByLocalName(parent, localName2) {
|
|
12795
12795
|
if (!parent) {
|
|
12796
12796
|
return [];
|
|
12797
12797
|
}
|
|
12798
12798
|
for (const key of Object.keys(parent)) {
|
|
12799
12799
|
const parts = key.split(":");
|
|
12800
|
-
if (parts[parts.length - 1] ===
|
|
12800
|
+
if (parts[parts.length - 1] === localName2) {
|
|
12801
12801
|
const v = parent[key];
|
|
12802
12802
|
if (Array.isArray(v)) {
|
|
12803
12803
|
return v;
|
|
@@ -13274,8 +13274,8 @@ function parseLineStyle(container, elementName, xmlLookup, colorParser) {
|
|
|
13274
13274
|
if (spPr) {
|
|
13275
13275
|
const lnNode = xmlLookup.getChildByLocalName(spPr, "ln");
|
|
13276
13276
|
if (lnNode) {
|
|
13277
|
-
const
|
|
13278
|
-
const lineColor = colorParser.parseColor(
|
|
13277
|
+
const solidFill2 = xmlLookup.getChildByLocalName(lnNode, "solidFill");
|
|
13278
|
+
const lineColor = colorParser.parseColor(solidFill2);
|
|
13279
13279
|
if (lineColor) {
|
|
13280
13280
|
result.color = lineColor;
|
|
13281
13281
|
}
|
|
@@ -13317,8 +13317,8 @@ function parseShapeProps(spPrNode, xmlLookup, colorParser) {
|
|
|
13317
13317
|
}
|
|
13318
13318
|
const result = {};
|
|
13319
13319
|
let hasProps = false;
|
|
13320
|
-
const
|
|
13321
|
-
const fillColor = colorParser.parseColor(
|
|
13320
|
+
const solidFill2 = xmlLookup.getChildByLocalName(spPrNode, "solidFill");
|
|
13321
|
+
const fillColor = colorParser.parseColor(solidFill2);
|
|
13322
13322
|
if (fillColor) {
|
|
13323
13323
|
result.fillColor = fillColor;
|
|
13324
13324
|
hasProps = true;
|
|
@@ -13498,8 +13498,8 @@ var AXIS_TYPE_MAP = {
|
|
|
13498
13498
|
dateAx: "dateAx",
|
|
13499
13499
|
serAx: "serAx"
|
|
13500
13500
|
};
|
|
13501
|
-
function upsertChartAxisChild(parent,
|
|
13502
|
-
const existingKey = Object.keys(parent).find((k) => getLocalName(k) ===
|
|
13501
|
+
function upsertChartAxisChild(parent, localName2, value, getLocalName) {
|
|
13502
|
+
const existingKey = Object.keys(parent).find((k) => getLocalName(k) === localName2);
|
|
13503
13503
|
if (value === void 0) {
|
|
13504
13504
|
if (existingKey) {
|
|
13505
13505
|
delete parent[existingKey];
|
|
@@ -13509,18 +13509,18 @@ function upsertChartAxisChild(parent, localName, value, getLocalName) {
|
|
|
13509
13509
|
if (existingKey) {
|
|
13510
13510
|
parent[existingKey]["@_val"] = value;
|
|
13511
13511
|
} else {
|
|
13512
|
-
parent[`c:${
|
|
13512
|
+
parent[`c:${localName2}`] = { "@_val": value };
|
|
13513
13513
|
}
|
|
13514
13514
|
}
|
|
13515
13515
|
function parseChartAxes(plotArea, xmlLookup, colorParser, getLocalName) {
|
|
13516
13516
|
const result = [];
|
|
13517
13517
|
for (const key of Object.keys(plotArea)) {
|
|
13518
|
-
const
|
|
13519
|
-
const axisType = AXIS_TYPE_MAP[
|
|
13518
|
+
const localName2 = getLocalName(key);
|
|
13519
|
+
const axisType = AXIS_TYPE_MAP[localName2];
|
|
13520
13520
|
if (!axisType) {
|
|
13521
13521
|
continue;
|
|
13522
13522
|
}
|
|
13523
|
-
const axisNodes = xmlLookup.getChildrenArrayByLocalName(plotArea,
|
|
13523
|
+
const axisNodes = xmlLookup.getChildrenArrayByLocalName(plotArea, localName2);
|
|
13524
13524
|
for (const axisNode of axisNodes) {
|
|
13525
13525
|
const axis = parseSingleAxis(axisNode, axisType, xmlLookup, colorParser);
|
|
13526
13526
|
if (axis) {
|
|
@@ -13717,8 +13717,8 @@ function parseTxPr(txPrNode, xmlLookup, colorParser, target) {
|
|
|
13717
13717
|
if (latin?.["@_typeface"]) {
|
|
13718
13718
|
target.fontFamily = String(latin["@_typeface"]);
|
|
13719
13719
|
}
|
|
13720
|
-
const
|
|
13721
|
-
const fontColor = colorParser.parseColor(
|
|
13720
|
+
const solidFill2 = xmlLookup.getChildByLocalName(defRPr, "solidFill");
|
|
13721
|
+
const fontColor = colorParser.parseColor(solidFill2);
|
|
13722
13722
|
if (fontColor) {
|
|
13723
13723
|
target.fontColor = fontColor;
|
|
13724
13724
|
}
|
|
@@ -13793,8 +13793,8 @@ var CONTAINER_LOCAL_NAME_TO_TYPE = {
|
|
|
13793
13793
|
surfaceChart: "surface",
|
|
13794
13794
|
surface3DChart: "surface"
|
|
13795
13795
|
};
|
|
13796
|
-
function chartContainerLocalNameToType(
|
|
13797
|
-
return CONTAINER_LOCAL_NAME_TO_TYPE[
|
|
13796
|
+
function chartContainerLocalNameToType(localName2) {
|
|
13797
|
+
return CONTAINER_LOCAL_NAME_TO_TYPE[localName2];
|
|
13798
13798
|
}
|
|
13799
13799
|
|
|
13800
13800
|
// src/core/utils/chart-cx-parser.ts
|
|
@@ -13803,11 +13803,11 @@ function extractCxSeriesColor(ser, xmlLookup) {
|
|
|
13803
13803
|
if (!spPr) {
|
|
13804
13804
|
return void 0;
|
|
13805
13805
|
}
|
|
13806
|
-
const
|
|
13807
|
-
if (!
|
|
13806
|
+
const solidFill2 = xmlLookup.getChildByLocalName(spPr, "solidFill");
|
|
13807
|
+
if (!solidFill2) {
|
|
13808
13808
|
return void 0;
|
|
13809
13809
|
}
|
|
13810
|
-
const srgb = xmlLookup.getChildByLocalName(
|
|
13810
|
+
const srgb = xmlLookup.getChildByLocalName(solidFill2, "srgbClr");
|
|
13811
13811
|
if (srgb) {
|
|
13812
13812
|
const val = String(srgb["@_val"] || "").trim();
|
|
13813
13813
|
if (val.length === 6) {
|
|
@@ -14015,18 +14015,18 @@ function parseWorksheetCells(xml) {
|
|
|
14015
14015
|
}
|
|
14016
14016
|
return cells;
|
|
14017
14017
|
}
|
|
14018
|
-
function findByLocalName2(obj,
|
|
14018
|
+
function findByLocalName2(obj, localName2) {
|
|
14019
14019
|
for (const key of Object.keys(obj)) {
|
|
14020
14020
|
const parts = key.split(":");
|
|
14021
14021
|
const local = parts[parts.length - 1];
|
|
14022
|
-
if (local ===
|
|
14022
|
+
if (local === localName2) {
|
|
14023
14023
|
return obj[key];
|
|
14024
14024
|
}
|
|
14025
14025
|
}
|
|
14026
14026
|
return void 0;
|
|
14027
14027
|
}
|
|
14028
|
-
function getChildArray(parent,
|
|
14029
|
-
const child = findByLocalName2(parent,
|
|
14028
|
+
function getChildArray(parent, localName2) {
|
|
14029
|
+
const child = findByLocalName2(parent, localName2);
|
|
14030
14030
|
if (!child) {
|
|
14031
14031
|
return [];
|
|
14032
14032
|
}
|
|
@@ -14038,8 +14038,8 @@ function getChildArray(parent, localName) {
|
|
|
14038
14038
|
}
|
|
14039
14039
|
return [];
|
|
14040
14040
|
}
|
|
14041
|
-
function getTextValue(parent,
|
|
14042
|
-
const child = findByLocalName2(parent,
|
|
14041
|
+
function getTextValue(parent, localName2) {
|
|
14042
|
+
const child = findByLocalName2(parent, localName2);
|
|
14043
14043
|
if (child === void 0 || child === null) {
|
|
14044
14044
|
return void 0;
|
|
14045
14045
|
}
|
|
@@ -16505,8 +16505,8 @@ function createSimpleLookup() {
|
|
|
16505
16505
|
return void 0;
|
|
16506
16506
|
}
|
|
16507
16507
|
for (const [key, value] of Object.entries(obj)) {
|
|
16508
|
-
const
|
|
16509
|
-
if (
|
|
16508
|
+
const localName2 = key.includes(":") ? key.split(":").pop() : key;
|
|
16509
|
+
if (localName2 === name && value && typeof value === "object" && !Array.isArray(value)) {
|
|
16510
16510
|
return value;
|
|
16511
16511
|
}
|
|
16512
16512
|
}
|
|
@@ -16517,8 +16517,8 @@ function createSimpleLookup() {
|
|
|
16517
16517
|
return [];
|
|
16518
16518
|
}
|
|
16519
16519
|
for (const [key, value] of Object.entries(obj)) {
|
|
16520
|
-
const
|
|
16521
|
-
if (
|
|
16520
|
+
const localName2 = key.includes(":") ? key.split(":").pop() : key;
|
|
16521
|
+
if (localName2 === name) {
|
|
16522
16522
|
if (Array.isArray(value)) {
|
|
16523
16523
|
return value.filter(
|
|
16524
16524
|
(v) => v !== null && typeof v === "object"
|
|
@@ -17645,6 +17645,62 @@ function layoutRelationship(nodes, bounds, themeColorMap) {
|
|
|
17645
17645
|
return elements;
|
|
17646
17646
|
}
|
|
17647
17647
|
|
|
17648
|
+
// src/core/utils/smartart-node-style-apply.ts
|
|
17649
|
+
function styledContentNodes(nodes) {
|
|
17650
|
+
return getContentNodes(nodes);
|
|
17651
|
+
}
|
|
17652
|
+
function applyNodeStylesToElements(elements, nodes) {
|
|
17653
|
+
const contentNodes = styledContentNodes(nodes);
|
|
17654
|
+
if (contentNodes.length === 0) {
|
|
17655
|
+
return elements;
|
|
17656
|
+
}
|
|
17657
|
+
let shapeIndex = 0;
|
|
17658
|
+
return elements.map((element) => {
|
|
17659
|
+
if (element.type !== "shape") {
|
|
17660
|
+
return element;
|
|
17661
|
+
}
|
|
17662
|
+
const node = contentNodes[shapeIndex++];
|
|
17663
|
+
const style = node?.style;
|
|
17664
|
+
if (!style || Object.keys(style).length === 0) {
|
|
17665
|
+
return element;
|
|
17666
|
+
}
|
|
17667
|
+
const shapeStyle = { ...element.shapeStyle };
|
|
17668
|
+
if (style.fillColor !== void 0) {
|
|
17669
|
+
shapeStyle.fillColor = style.fillColor;
|
|
17670
|
+
shapeStyle.fillMode = "solid";
|
|
17671
|
+
}
|
|
17672
|
+
if (style.lineColor !== void 0) {
|
|
17673
|
+
shapeStyle.strokeColor = style.lineColor;
|
|
17674
|
+
}
|
|
17675
|
+
const baseTextStyle = element.textStyle ?? {};
|
|
17676
|
+
const textStyle = { ...baseTextStyle };
|
|
17677
|
+
if (style.fontColor !== void 0) {
|
|
17678
|
+
textStyle.color = style.fontColor;
|
|
17679
|
+
}
|
|
17680
|
+
if (style.bold !== void 0) {
|
|
17681
|
+
textStyle.bold = style.bold;
|
|
17682
|
+
}
|
|
17683
|
+
if (style.italic !== void 0) {
|
|
17684
|
+
textStyle.italic = style.italic;
|
|
17685
|
+
}
|
|
17686
|
+
const segments = element.textSegments?.map((seg) => ({
|
|
17687
|
+
...seg,
|
|
17688
|
+
style: {
|
|
17689
|
+
...seg.style,
|
|
17690
|
+
...style.fontColor !== void 0 ? { color: style.fontColor } : {},
|
|
17691
|
+
...style.bold !== void 0 ? { bold: style.bold } : {},
|
|
17692
|
+
...style.italic !== void 0 ? { italic: style.italic } : {}
|
|
17693
|
+
}
|
|
17694
|
+
}));
|
|
17695
|
+
return {
|
|
17696
|
+
...element,
|
|
17697
|
+
shapeStyle,
|
|
17698
|
+
textStyle,
|
|
17699
|
+
...segments ? { textSegments: segments } : {}
|
|
17700
|
+
};
|
|
17701
|
+
});
|
|
17702
|
+
}
|
|
17703
|
+
|
|
17648
17704
|
// src/core/utils/smartart-decompose.ts
|
|
17649
17705
|
function quickStyleStrokeScale(quickStyle) {
|
|
17650
17706
|
if (!quickStyle?.effectIntensity) {
|
|
@@ -17741,9 +17797,13 @@ function decomposeSmartArt(smartArtData, containerBounds, themeColorMap, layoutD
|
|
|
17741
17797
|
if (namedLayout) {
|
|
17742
17798
|
const namedResult = dispatchNamedLayout(namedLayout, nodes, containerBounds, effectiveThemeMap);
|
|
17743
17799
|
if (namedResult) {
|
|
17744
|
-
return namedResult;
|
|
17800
|
+
return applyNodeStylesToElements(namedResult, nodes);
|
|
17745
17801
|
}
|
|
17746
17802
|
}
|
|
17803
|
+
const algorithmic = dispatchLayoutByType(layoutType, nodes, containerBounds, effectiveThemeMap);
|
|
17804
|
+
return algorithmic ? applyNodeStylesToElements(algorithmic, nodes) : algorithmic;
|
|
17805
|
+
}
|
|
17806
|
+
function dispatchLayoutByType(layoutType, nodes, containerBounds, effectiveThemeMap) {
|
|
17747
17807
|
switch (layoutType) {
|
|
17748
17808
|
case "list":
|
|
17749
17809
|
return layoutList(nodes, containerBounds, effectiveThemeMap);
|
|
@@ -18090,6 +18150,46 @@ function reorderSmartArtNodeToIndex(data, nodeId, newIndex) {
|
|
|
18090
18150
|
};
|
|
18091
18151
|
}
|
|
18092
18152
|
|
|
18153
|
+
// src/core/utils/smartart-editing-node-style.ts
|
|
18154
|
+
function mergeNodeStyle(current, patch) {
|
|
18155
|
+
const merged = { ...current };
|
|
18156
|
+
for (const key of Object.keys(patch)) {
|
|
18157
|
+
const value = patch[key];
|
|
18158
|
+
if (value === void 0) {
|
|
18159
|
+
delete merged[key];
|
|
18160
|
+
} else {
|
|
18161
|
+
merged[key] = value;
|
|
18162
|
+
}
|
|
18163
|
+
}
|
|
18164
|
+
return merged;
|
|
18165
|
+
}
|
|
18166
|
+
function setSmartArtNodeStyle(data, nodeId, style) {
|
|
18167
|
+
let matched = false;
|
|
18168
|
+
const nodes = data.nodes.map((node) => {
|
|
18169
|
+
if (node.id !== nodeId) {
|
|
18170
|
+
return node;
|
|
18171
|
+
}
|
|
18172
|
+
matched = true;
|
|
18173
|
+
const nextStyle = mergeNodeStyle(node.style, style);
|
|
18174
|
+
const hasStyle = Object.keys(nextStyle).length > 0;
|
|
18175
|
+
const updated = { ...node };
|
|
18176
|
+
if (hasStyle) {
|
|
18177
|
+
updated.style = nextStyle;
|
|
18178
|
+
} else {
|
|
18179
|
+
delete updated.style;
|
|
18180
|
+
}
|
|
18181
|
+
return updated;
|
|
18182
|
+
});
|
|
18183
|
+
if (!matched) {
|
|
18184
|
+
return data;
|
|
18185
|
+
}
|
|
18186
|
+
return {
|
|
18187
|
+
...data,
|
|
18188
|
+
nodes,
|
|
18189
|
+
drawingShapes: void 0
|
|
18190
|
+
};
|
|
18191
|
+
}
|
|
18192
|
+
|
|
18093
18193
|
// src/core/utils/smartart-editing-reflow-layouts-geometric.ts
|
|
18094
18194
|
function reflowCycle(nodes, bounds) {
|
|
18095
18195
|
const size = Math.min(bounds.width, bounds.height);
|
|
@@ -19902,18 +20002,18 @@ function extractTagAttribute(xml, tagName, attributeName) {
|
|
|
19902
20002
|
const match = xml.match(pattern);
|
|
19903
20003
|
return match?.groups?.["attributeValue"]?.trim();
|
|
19904
20004
|
}
|
|
19905
|
-
function extractFirstTagText(xml,
|
|
20005
|
+
function extractFirstTagText(xml, localName2) {
|
|
19906
20006
|
const pattern = new RegExp(
|
|
19907
|
-
`<([\\w.-]+:)?${
|
|
20007
|
+
`<([\\w.-]+:)?${localName2}\\b[^>]*>([\\s\\S]*?)<\\/([\\w.-]+:)?${localName2}>`,
|
|
19908
20008
|
"i"
|
|
19909
20009
|
);
|
|
19910
20010
|
const match = xml.match(pattern);
|
|
19911
20011
|
return match?.[2]?.replace(/\s+/g, "").trim() || void 0;
|
|
19912
20012
|
}
|
|
19913
|
-
function extractAllTagText(xml,
|
|
20013
|
+
function extractAllTagText(xml, localName2) {
|
|
19914
20014
|
const result = [];
|
|
19915
20015
|
const regex = new RegExp(
|
|
19916
|
-
`<([\\w.-]+:)?${
|
|
20016
|
+
`<([\\w.-]+:)?${localName2}\\b[^>]*>([\\s\\S]*?)<\\/([\\w.-]+:)?${localName2}>`,
|
|
19917
20017
|
"gi"
|
|
19918
20018
|
);
|
|
19919
20019
|
let match = regex.exec(xml);
|
|
@@ -26546,8 +26646,8 @@ var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
|
|
|
26546
26646
|
return void 0;
|
|
26547
26647
|
}
|
|
26548
26648
|
const fillNode = tblBg["a:fill"];
|
|
26549
|
-
const
|
|
26550
|
-
const schemeClr =
|
|
26649
|
+
const solidFill2 = fillNode?.["a:solidFill"] ?? tblBg["a:solidFill"];
|
|
26650
|
+
const schemeClr = solidFill2?.["a:schemeClr"];
|
|
26551
26651
|
const schemeColor = schemeClr ? String(schemeClr["@_val"] || "").trim() || void 0 : void 0;
|
|
26552
26652
|
const fill = schemeColor ? { schemeColor } : void 0;
|
|
26553
26653
|
const hasEffectLst = Boolean(tblBg["a:effectLst"]);
|
|
@@ -26575,11 +26675,11 @@ var PptxHandlerRuntime2 = class extends PptxHandlerRuntime {
|
|
|
26575
26675
|
if (!fill) {
|
|
26576
26676
|
return void 0;
|
|
26577
26677
|
}
|
|
26578
|
-
const
|
|
26579
|
-
if (!
|
|
26678
|
+
const solidFill2 = fill["a:solidFill"];
|
|
26679
|
+
if (!solidFill2) {
|
|
26580
26680
|
return void 0;
|
|
26581
26681
|
}
|
|
26582
|
-
const schemeClr =
|
|
26682
|
+
const schemeClr = solidFill2["a:schemeClr"];
|
|
26583
26683
|
if (!schemeClr) {
|
|
26584
26684
|
return void 0;
|
|
26585
26685
|
}
|
|
@@ -30858,10 +30958,10 @@ var PptxHandlerRuntime19 = class _PptxHandlerRuntime extends PptxHandlerRuntime1
|
|
|
30858
30958
|
if (csTypeface) {
|
|
30859
30959
|
style.complexScriptFont = csTypeface;
|
|
30860
30960
|
}
|
|
30861
|
-
const
|
|
30862
|
-
if (
|
|
30863
|
-
style.color = this.parseColor(
|
|
30864
|
-
const colorXml = extractColorChoiceXml(
|
|
30961
|
+
const solidFill2 = xmlChild(runProperties, "a:solidFill");
|
|
30962
|
+
if (solidFill2) {
|
|
30963
|
+
style.color = this.parseColor(solidFill2);
|
|
30964
|
+
const colorXml = extractColorChoiceXml(solidFill2);
|
|
30865
30965
|
if (colorXml) {
|
|
30866
30966
|
style.colorXml = colorXml;
|
|
30867
30967
|
}
|
|
@@ -31826,13 +31926,13 @@ function serializeTablePropertyFlags(tbl, tableData) {
|
|
|
31826
31926
|
}
|
|
31827
31927
|
tbl["a:tblPr"] = tblPr;
|
|
31828
31928
|
}
|
|
31829
|
-
function replaceFirstTextValueInTree(node,
|
|
31929
|
+
function replaceFirstTextValueInTree(node, localName2, newValue, getXmlLocalName) {
|
|
31830
31930
|
if (node === null || node === void 0) {
|
|
31831
31931
|
return false;
|
|
31832
31932
|
}
|
|
31833
31933
|
if (Array.isArray(node)) {
|
|
31834
31934
|
for (const entry of node) {
|
|
31835
|
-
if (replaceFirstTextValueInTree(entry,
|
|
31935
|
+
if (replaceFirstTextValueInTree(entry, localName2, newValue, getXmlLocalName)) {
|
|
31836
31936
|
return true;
|
|
31837
31937
|
}
|
|
31838
31938
|
}
|
|
@@ -31843,13 +31943,13 @@ function replaceFirstTextValueInTree(node, localName, newValue, getXmlLocalName)
|
|
|
31843
31943
|
}
|
|
31844
31944
|
const objectNode = node;
|
|
31845
31945
|
for (const [key, value] of Object.entries(objectNode)) {
|
|
31846
|
-
if (getXmlLocalName(key) ===
|
|
31946
|
+
if (getXmlLocalName(key) === localName2) {
|
|
31847
31947
|
if (typeof value === "string" || typeof value === "number") {
|
|
31848
31948
|
objectNode[key] = newValue;
|
|
31849
31949
|
return true;
|
|
31850
31950
|
}
|
|
31851
31951
|
}
|
|
31852
|
-
if (replaceFirstTextValueInTree(value,
|
|
31952
|
+
if (replaceFirstTextValueInTree(value, localName2, newValue, getXmlLocalName)) {
|
|
31853
31953
|
return true;
|
|
31854
31954
|
}
|
|
31855
31955
|
}
|
|
@@ -32937,10 +33037,10 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
32937
33037
|
* Upsert a `c:<localName>` child with `@_val` on an axis or scaling node.
|
|
32938
33038
|
* When `value` is undefined, removes any existing child of that local name.
|
|
32939
33039
|
*/
|
|
32940
|
-
upsertChartAxisChild(parent,
|
|
33040
|
+
upsertChartAxisChild(parent, localName2, value) {
|
|
32941
33041
|
upsertChartAxisChild(
|
|
32942
33042
|
parent,
|
|
32943
|
-
|
|
33043
|
+
localName2,
|
|
32944
33044
|
value,
|
|
32945
33045
|
(key) => this.compatibilityService.getXmlLocalName(key)
|
|
32946
33046
|
);
|
|
@@ -32974,10 +33074,10 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
32974
33074
|
cacheNode[ptKey] = buildChartPoints(values);
|
|
32975
33075
|
}
|
|
32976
33076
|
/** Replace the first text value found deep in the node tree. */
|
|
32977
|
-
replaceFirstTextValue(node,
|
|
33077
|
+
replaceFirstTextValue(node, localName2, newValue) {
|
|
32978
33078
|
return replaceFirstTextValueInTree(
|
|
32979
33079
|
node,
|
|
32980
|
-
|
|
33080
|
+
localName2,
|
|
32981
33081
|
newValue,
|
|
32982
33082
|
(key) => this.compatibilityService.getXmlLocalName(key)
|
|
32983
33083
|
);
|
|
@@ -32989,10 +33089,10 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
32989
33089
|
* Upsert a `c:<localName>` child carrying only an `@_val` attribute on
|
|
32990
33090
|
* `parent`. When `value` is `undefined` the existing child is removed.
|
|
32991
33091
|
*/
|
|
32992
|
-
upsertValChild(parent,
|
|
32993
|
-
const existing = this.xmlLookupService.getChildByLocalName(parent,
|
|
33092
|
+
upsertValChild(parent, localName2, value) {
|
|
33093
|
+
const existing = this.xmlLookupService.getChildByLocalName(parent, localName2);
|
|
32994
33094
|
const existingKey = Object.keys(parent).find(
|
|
32995
|
-
(k) => this.compatibilityService.getXmlLocalName(k) ===
|
|
33095
|
+
(k) => this.compatibilityService.getXmlLocalName(k) === localName2
|
|
32996
33096
|
);
|
|
32997
33097
|
if (value === void 0) {
|
|
32998
33098
|
if (existingKey) {
|
|
@@ -33003,7 +33103,7 @@ var PptxHandlerRuntime23 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
33003
33103
|
if (existing && existingKey) {
|
|
33004
33104
|
parent[existingKey] = { ...existing, "@_val": value };
|
|
33005
33105
|
} else {
|
|
33006
|
-
parent[`c:${
|
|
33106
|
+
parent[`c:${localName2}`] = { "@_val": value };
|
|
33007
33107
|
}
|
|
33008
33108
|
}
|
|
33009
33109
|
/**
|
|
@@ -33323,27 +33423,27 @@ function applySmartArtChrome(dataModel, chrome, getLocalName) {
|
|
|
33323
33423
|
if (!chrome || !chrome.backgroundColor && !chrome.outlineColor && (chrome.outlineWidth === null || chrome.outlineWidth === void 0)) {
|
|
33324
33424
|
return;
|
|
33325
33425
|
}
|
|
33326
|
-
const
|
|
33426
|
+
const findKey13 = (obj, name) => Object.keys(obj).find((k) => getLocalName(k) === name);
|
|
33327
33427
|
if (chrome.backgroundColor) {
|
|
33328
33428
|
const hex8 = chrome.backgroundColor.replace("#", "");
|
|
33329
|
-
const bgKey =
|
|
33429
|
+
const bgKey = findKey13(dataModel, "bg") ?? "dgm:bg";
|
|
33330
33430
|
const bg = asObject2(dataModel[bgKey]);
|
|
33331
|
-
const fillKey =
|
|
33431
|
+
const fillKey = findKey13(bg, "solidFill") ?? "a:solidFill";
|
|
33332
33432
|
bg[fillKey] = { "a:srgbClr": { "@_val": hex8 } };
|
|
33333
33433
|
dataModel[bgKey] = bg;
|
|
33334
33434
|
}
|
|
33335
33435
|
const hasOutlineWidth = chrome.outlineWidth !== null && chrome.outlineWidth !== void 0;
|
|
33336
33436
|
if (chrome.outlineColor || hasOutlineWidth) {
|
|
33337
|
-
const wholeKey =
|
|
33437
|
+
const wholeKey = findKey13(dataModel, "whole") ?? "dgm:whole";
|
|
33338
33438
|
const whole = asObject2(dataModel[wholeKey]);
|
|
33339
|
-
const lnKey =
|
|
33439
|
+
const lnKey = findKey13(whole, "ln") ?? "a:ln";
|
|
33340
33440
|
const ln = asObject2(whole[lnKey]);
|
|
33341
33441
|
if (hasOutlineWidth) {
|
|
33342
33442
|
ln["@_w"] = String(Math.round(chrome.outlineWidth * 12700));
|
|
33343
33443
|
}
|
|
33344
33444
|
if (chrome.outlineColor) {
|
|
33345
33445
|
const hex8 = chrome.outlineColor.replace("#", "");
|
|
33346
|
-
const fillKey =
|
|
33446
|
+
const fillKey = findKey13(ln, "solidFill") ?? "a:solidFill";
|
|
33347
33447
|
ln[fillKey] = { "a:srgbClr": { "@_val": hex8 } };
|
|
33348
33448
|
}
|
|
33349
33449
|
whole[lnKey] = ln;
|
|
@@ -33351,6 +33451,102 @@ function applySmartArtChrome(dataModel, chrome, getLocalName) {
|
|
|
33351
33451
|
}
|
|
33352
33452
|
}
|
|
33353
33453
|
|
|
33454
|
+
// src/core/core/runtime/smartart-style-xml.ts
|
|
33455
|
+
function localName(key) {
|
|
33456
|
+
const idx = key.indexOf(":");
|
|
33457
|
+
return idx >= 0 ? key.slice(idx + 1) : key;
|
|
33458
|
+
}
|
|
33459
|
+
function findKey12(obj, local) {
|
|
33460
|
+
return Object.keys(obj).find((k) => localName(k) === local);
|
|
33461
|
+
}
|
|
33462
|
+
function ensureChild(obj, local, prefixedFallback) {
|
|
33463
|
+
const key = findKey12(obj, local) ?? prefixedFallback;
|
|
33464
|
+
const existing = obj[key];
|
|
33465
|
+
if (existing && typeof existing === "object" && !Array.isArray(existing)) {
|
|
33466
|
+
return existing;
|
|
33467
|
+
}
|
|
33468
|
+
const created = {};
|
|
33469
|
+
obj[key] = created;
|
|
33470
|
+
return created;
|
|
33471
|
+
}
|
|
33472
|
+
function hexValue(color) {
|
|
33473
|
+
return color.replace(/^#/u, "").toUpperCase();
|
|
33474
|
+
}
|
|
33475
|
+
function solidFill(color) {
|
|
33476
|
+
return { "a:srgbClr": { "@_val": hexValue(color) } };
|
|
33477
|
+
}
|
|
33478
|
+
function setSolidFill(parent, color) {
|
|
33479
|
+
const key = findKey12(parent, "solidFill") ?? "a:solidFill";
|
|
33480
|
+
parent[key] = solidFill(color);
|
|
33481
|
+
}
|
|
33482
|
+
function applyShapeStyle(pt2, style) {
|
|
33483
|
+
if (style.fillColor === void 0 && style.lineColor === void 0) {
|
|
33484
|
+
return;
|
|
33485
|
+
}
|
|
33486
|
+
const spPr = ensureChild(pt2, "spPr", "dgm:spPr");
|
|
33487
|
+
if (style.fillColor !== void 0) {
|
|
33488
|
+
setSolidFill(spPr, style.fillColor);
|
|
33489
|
+
}
|
|
33490
|
+
if (style.lineColor !== void 0) {
|
|
33491
|
+
const ln = ensureChild(spPr, "ln", "a:ln");
|
|
33492
|
+
setSolidFill(ln, style.lineColor);
|
|
33493
|
+
}
|
|
33494
|
+
}
|
|
33495
|
+
function ensureFirstRunRPr(pt2) {
|
|
33496
|
+
const tKey = findKey12(pt2, "t");
|
|
33497
|
+
if (!tKey) {
|
|
33498
|
+
return void 0;
|
|
33499
|
+
}
|
|
33500
|
+
const body = pt2[tKey];
|
|
33501
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
33502
|
+
return void 0;
|
|
33503
|
+
}
|
|
33504
|
+
const pKey = findKey12(body, "p");
|
|
33505
|
+
if (!pKey) {
|
|
33506
|
+
return void 0;
|
|
33507
|
+
}
|
|
33508
|
+
const paragraph = body[pKey];
|
|
33509
|
+
const firstP = Array.isArray(paragraph) ? paragraph[0] : paragraph;
|
|
33510
|
+
if (!firstP || typeof firstP !== "object") {
|
|
33511
|
+
return void 0;
|
|
33512
|
+
}
|
|
33513
|
+
const rKey = findKey12(firstP, "r");
|
|
33514
|
+
if (!rKey) {
|
|
33515
|
+
return void 0;
|
|
33516
|
+
}
|
|
33517
|
+
const run = firstP[rKey];
|
|
33518
|
+
const firstR = Array.isArray(run) ? run[0] : run;
|
|
33519
|
+
if (!firstR || typeof firstR !== "object") {
|
|
33520
|
+
return void 0;
|
|
33521
|
+
}
|
|
33522
|
+
return ensureChild(firstR, "rPr", "a:rPr");
|
|
33523
|
+
}
|
|
33524
|
+
function applyRunStyle(pt2, style) {
|
|
33525
|
+
if (style.bold === void 0 && style.italic === void 0 && style.fontColor === void 0) {
|
|
33526
|
+
return;
|
|
33527
|
+
}
|
|
33528
|
+
const rPr = ensureFirstRunRPr(pt2);
|
|
33529
|
+
if (!rPr) {
|
|
33530
|
+
return;
|
|
33531
|
+
}
|
|
33532
|
+
if (style.bold !== void 0) {
|
|
33533
|
+
rPr["@_b"] = style.bold ? "1" : "0";
|
|
33534
|
+
}
|
|
33535
|
+
if (style.italic !== void 0) {
|
|
33536
|
+
rPr["@_i"] = style.italic ? "1" : "0";
|
|
33537
|
+
}
|
|
33538
|
+
if (style.fontColor !== void 0) {
|
|
33539
|
+
setSolidFill(rPr, style.fontColor);
|
|
33540
|
+
}
|
|
33541
|
+
}
|
|
33542
|
+
function applySmartArtNodeStyleToPoint(pt2, style) {
|
|
33543
|
+
if (!style || Object.keys(style).length === 0) {
|
|
33544
|
+
return;
|
|
33545
|
+
}
|
|
33546
|
+
applyShapeStyle(pt2, style);
|
|
33547
|
+
applyRunStyle(pt2, style);
|
|
33548
|
+
}
|
|
33549
|
+
|
|
33354
33550
|
// src/core/core/runtime/smartart-xml-builders.ts
|
|
33355
33551
|
var NON_CONTENT_POINT_TYPES = /* @__PURE__ */ new Set([
|
|
33356
33552
|
"doc",
|
|
@@ -33490,6 +33686,7 @@ function mergeSmartArtPointXml(existingPts, nodes) {
|
|
|
33490
33686
|
continue;
|
|
33491
33687
|
}
|
|
33492
33688
|
applyTextToExistingPoint(pt2, desired);
|
|
33689
|
+
applySmartArtNodeStyleToPoint(pt2, desired.style);
|
|
33493
33690
|
seenContentIds.add(modelId);
|
|
33494
33691
|
merged.push(pt2);
|
|
33495
33692
|
}
|
|
@@ -33503,6 +33700,7 @@ function mergeSmartArtPointXml(existingPts, nodes) {
|
|
|
33503
33700
|
ptNode["@_type"] = node.nodeType;
|
|
33504
33701
|
}
|
|
33505
33702
|
ptNode["dgm:t"] = shouldRebuildFromRuns(node) ? buildPointFromRuns(node.runs) : buildPointText(node.text);
|
|
33703
|
+
applySmartArtNodeStyleToPoint(ptNode, node.style);
|
|
33506
33704
|
merged.push(ptNode);
|
|
33507
33705
|
}
|
|
33508
33706
|
return merged;
|
|
@@ -34476,8 +34674,8 @@ var PptxHandlerRuntime27 = class extends PptxHandlerRuntime26 {
|
|
|
34476
34674
|
}
|
|
34477
34675
|
const obj = node;
|
|
34478
34676
|
for (const [key, value] of Object.entries(obj)) {
|
|
34479
|
-
const
|
|
34480
|
-
if (
|
|
34677
|
+
const localName2 = this.compatibilityService.getXmlLocalName(key);
|
|
34678
|
+
if (localName2 === "extLst" && value && typeof value === "object") {
|
|
34481
34679
|
const extLst = value;
|
|
34482
34680
|
for (const extKey of Object.keys(extLst)) {
|
|
34483
34681
|
const extLocalName = this.compatibilityService.getXmlLocalName(extKey);
|
|
@@ -36693,9 +36891,9 @@ function applyTableStyleEntryToNode(styleNode, entry) {
|
|
|
36693
36891
|
}
|
|
36694
36892
|
function applyFillToSection(styleNode, sectionKey, fill) {
|
|
36695
36893
|
const section = ensureSection(styleNode, sectionKey);
|
|
36696
|
-
const tcStyle =
|
|
36697
|
-
const fillNode =
|
|
36698
|
-
const
|
|
36894
|
+
const tcStyle = ensureChild2(section, "a:tcStyle");
|
|
36895
|
+
const fillNode = ensureChild2(tcStyle, "a:fill");
|
|
36896
|
+
const solidFill2 = ensureChild2(fillNode, "a:solidFill");
|
|
36699
36897
|
const schemeClr = { "@_val": fill.schemeColor };
|
|
36700
36898
|
if (fill.tint !== void 0) {
|
|
36701
36899
|
schemeClr["a:tint"] = { "@_val": String(fill.tint) };
|
|
@@ -36703,14 +36901,14 @@ function applyFillToSection(styleNode, sectionKey, fill) {
|
|
|
36703
36901
|
if (fill.shade !== void 0) {
|
|
36704
36902
|
schemeClr["a:shade"] = { "@_val": String(fill.shade) };
|
|
36705
36903
|
}
|
|
36706
|
-
for (const key of Object.keys(
|
|
36707
|
-
delete
|
|
36904
|
+
for (const key of Object.keys(solidFill2)) {
|
|
36905
|
+
delete solidFill2[key];
|
|
36708
36906
|
}
|
|
36709
|
-
|
|
36907
|
+
solidFill2["a:schemeClr"] = schemeClr;
|
|
36710
36908
|
}
|
|
36711
36909
|
function applyTextToSection(styleNode, sectionKey, text) {
|
|
36712
36910
|
const section = ensureSection(styleNode, sectionKey);
|
|
36713
|
-
const tcTxStyle =
|
|
36911
|
+
const tcTxStyle = ensureChild2(section, "a:tcTxStyle");
|
|
36714
36912
|
if (text.bold !== void 0) {
|
|
36715
36913
|
if (text.bold) {
|
|
36716
36914
|
tcTxStyle["@_b"] = "on";
|
|
@@ -36750,7 +36948,7 @@ function ensureSection(styleNode, sectionKey) {
|
|
|
36750
36948
|
styleNode[sectionKey] = created;
|
|
36751
36949
|
return created;
|
|
36752
36950
|
}
|
|
36753
|
-
function
|
|
36951
|
+
function ensureChild2(parent, key) {
|
|
36754
36952
|
const existing = parent[key];
|
|
36755
36953
|
if (Array.isArray(existing) && existing.length > 0) {
|
|
36756
36954
|
return existing[0];
|
|
@@ -40508,9 +40706,9 @@ var PptxHandlerRuntime56 = class extends PptxHandlerRuntime55 {
|
|
|
40508
40706
|
}
|
|
40509
40707
|
const bgPr = xmlChild(bg, "p:bgPr");
|
|
40510
40708
|
if (bgPr) {
|
|
40511
|
-
const
|
|
40512
|
-
if (
|
|
40513
|
-
return this.parseColor(
|
|
40709
|
+
const solidFill2 = xmlChild(bgPr, "a:solidFill");
|
|
40710
|
+
if (solidFill2) {
|
|
40711
|
+
return this.parseColor(solidFill2);
|
|
40514
40712
|
}
|
|
40515
40713
|
const pattFill = xmlChild(bgPr, "a:pattFill");
|
|
40516
40714
|
if (pattFill) {
|
|
@@ -40553,9 +40751,9 @@ var PptxHandlerRuntime56 = class extends PptxHandlerRuntime55 {
|
|
|
40553
40751
|
if (idx === 0) {
|
|
40554
40752
|
return void 0;
|
|
40555
40753
|
}
|
|
40556
|
-
const
|
|
40557
|
-
if (
|
|
40558
|
-
return this.parseColor(
|
|
40754
|
+
const solidFill2 = xmlChild(bgRef, "a:solidFill");
|
|
40755
|
+
if (solidFill2) {
|
|
40756
|
+
return this.parseColor(solidFill2);
|
|
40559
40757
|
}
|
|
40560
40758
|
const overrideColor = this.parseColor(bgRef);
|
|
40561
40759
|
if (this.themeFormatScheme) {
|
|
@@ -43374,7 +43572,7 @@ var PptxHandlerRuntime68 = class extends PptxHandlerRuntime67 {
|
|
|
43374
43572
|
partPath
|
|
43375
43573
|
};
|
|
43376
43574
|
}
|
|
43377
|
-
collectLocalTextValues(node,
|
|
43575
|
+
collectLocalTextValues(node, localName2, output) {
|
|
43378
43576
|
const MAX_NODES = 1e6;
|
|
43379
43577
|
const stack = [node];
|
|
43380
43578
|
let visited = 0;
|
|
@@ -43397,7 +43595,7 @@ var PptxHandlerRuntime68 = class extends PptxHandlerRuntime67 {
|
|
|
43397
43595
|
}
|
|
43398
43596
|
const objectNode = current;
|
|
43399
43597
|
for (const [key, value] of Object.entries(objectNode)) {
|
|
43400
|
-
if (this.compatibilityService.getXmlLocalName(key) ===
|
|
43598
|
+
if (this.compatibilityService.getXmlLocalName(key) === localName2) {
|
|
43401
43599
|
if (typeof value === "string" || typeof value === "number") {
|
|
43402
43600
|
const textValue = String(value).trim();
|
|
43403
43601
|
if (textValue.length > 0) {
|
|
@@ -43451,6 +43649,71 @@ var PptxHandlerRuntime68 = class extends PptxHandlerRuntime67 {
|
|
|
43451
43649
|
}
|
|
43452
43650
|
return runs.length > 0 ? runs : void 0;
|
|
43453
43651
|
}
|
|
43652
|
+
/**
|
|
43653
|
+
* Extract a content point's per-node visual override.
|
|
43654
|
+
*
|
|
43655
|
+
* Reads the point's presentation `spPr` solid fill and line colour, and the
|
|
43656
|
+
* first run's `rPr` bold / italic / solid fill, into a
|
|
43657
|
+
* {@link PptxSmartArtNodeStyle}. Every field is optional and only set when
|
|
43658
|
+
* present, so an unstyled point yields `undefined` (never throws on missing
|
|
43659
|
+
* structure). This lets the editing UI display the node's current colours.
|
|
43660
|
+
*/
|
|
43661
|
+
extractSmartArtNodeStyle(point) {
|
|
43662
|
+
const style = {};
|
|
43663
|
+
const spPr = this.xmlLookupService.getChildByLocalName(point, "spPr");
|
|
43664
|
+
if (spPr) {
|
|
43665
|
+
const fill = this.parseColor(this.xmlLookupService.getChildByLocalName(spPr, "solidFill"));
|
|
43666
|
+
if (fill) {
|
|
43667
|
+
style.fillColor = fill;
|
|
43668
|
+
}
|
|
43669
|
+
const ln = this.xmlLookupService.getChildByLocalName(spPr, "ln");
|
|
43670
|
+
if (ln) {
|
|
43671
|
+
const lineColor = this.parseColor(
|
|
43672
|
+
this.xmlLookupService.getChildByLocalName(ln, "solidFill")
|
|
43673
|
+
);
|
|
43674
|
+
if (lineColor) {
|
|
43675
|
+
style.lineColor = lineColor;
|
|
43676
|
+
}
|
|
43677
|
+
}
|
|
43678
|
+
}
|
|
43679
|
+
const rPr = this.firstRunProperties(point);
|
|
43680
|
+
if (rPr) {
|
|
43681
|
+
if (this.xmlBoolean(rPr["@_b"])) {
|
|
43682
|
+
style.bold = true;
|
|
43683
|
+
}
|
|
43684
|
+
if (this.xmlBoolean(rPr["@_i"])) {
|
|
43685
|
+
style.italic = true;
|
|
43686
|
+
}
|
|
43687
|
+
const fontColor = this.parseColor(
|
|
43688
|
+
this.xmlLookupService.getChildByLocalName(rPr, "solidFill")
|
|
43689
|
+
);
|
|
43690
|
+
if (fontColor) {
|
|
43691
|
+
style.fontColor = fontColor;
|
|
43692
|
+
}
|
|
43693
|
+
}
|
|
43694
|
+
return Object.keys(style).length > 0 ? style : void 0;
|
|
43695
|
+
}
|
|
43696
|
+
/** Read the first run's `rPr` of a content point's first paragraph. */
|
|
43697
|
+
firstRunProperties(point) {
|
|
43698
|
+
const tBody = this.xmlLookupService.getChildByLocalName(point, "t");
|
|
43699
|
+
if (!tBody) {
|
|
43700
|
+
return void 0;
|
|
43701
|
+
}
|
|
43702
|
+
const paragraph = this.xmlLookupService.getChildrenArrayByLocalName(tBody, "p")[0];
|
|
43703
|
+
if (!paragraph) {
|
|
43704
|
+
return void 0;
|
|
43705
|
+
}
|
|
43706
|
+
const run = this.xmlLookupService.getChildrenArrayByLocalName(paragraph, "r")[0];
|
|
43707
|
+
if (!run) {
|
|
43708
|
+
return void 0;
|
|
43709
|
+
}
|
|
43710
|
+
return this.xmlLookupService.getChildByLocalName(run, "rPr");
|
|
43711
|
+
}
|
|
43712
|
+
/** Interpret an OOXML boolean attribute ("1"/"true"/"on" => true). */
|
|
43713
|
+
xmlBoolean(value) {
|
|
43714
|
+
const v = String(value ?? "").trim().toLowerCase();
|
|
43715
|
+
return v === "1" || v === "true" || v === "on";
|
|
43716
|
+
}
|
|
43454
43717
|
/**
|
|
43455
43718
|
* Parse background and outline chrome from `dgm:bg` and `dgm:whole`.
|
|
43456
43719
|
*/
|
|
@@ -43465,8 +43728,8 @@ var PptxHandlerRuntime68 = class extends PptxHandlerRuntime67 {
|
|
|
43465
43728
|
}
|
|
43466
43729
|
const chrome = {};
|
|
43467
43730
|
if (bg) {
|
|
43468
|
-
const
|
|
43469
|
-
const bgColor = this.parseColor(
|
|
43731
|
+
const solidFill2 = this.xmlLookupService.getChildByLocalName(bg, "solidFill");
|
|
43732
|
+
const bgColor = this.parseColor(solidFill2);
|
|
43470
43733
|
if (bgColor) {
|
|
43471
43734
|
chrome.backgroundColor = bgColor;
|
|
43472
43735
|
}
|
|
@@ -43474,8 +43737,8 @@ var PptxHandlerRuntime68 = class extends PptxHandlerRuntime67 {
|
|
|
43474
43737
|
if (whole) {
|
|
43475
43738
|
const lnNode = this.xmlLookupService.getChildByLocalName(whole, "ln");
|
|
43476
43739
|
if (lnNode) {
|
|
43477
|
-
const
|
|
43478
|
-
const outlineColor = this.parseColor(
|
|
43740
|
+
const solidFill2 = this.xmlLookupService.getChildByLocalName(lnNode, "solidFill");
|
|
43741
|
+
const outlineColor = this.parseColor(solidFill2);
|
|
43479
43742
|
if (outlineColor) {
|
|
43480
43743
|
chrome.outlineColor = outlineColor;
|
|
43481
43744
|
}
|
|
@@ -43650,8 +43913,8 @@ var PptxHandlerRuntime69 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
|
|
|
43650
43913
|
const skewY = xfrm?.["@_skewY"] ? parseInt(String(xfrm["@_skewY"]), 10) / 6e4 : void 0;
|
|
43651
43914
|
const prstGeom = this.xmlLookupService.getChildByLocalName(spPr, "prstGeom");
|
|
43652
43915
|
const shapeType = prstGeom ? String(prstGeom["@_prst"] || "rect") : "rect";
|
|
43653
|
-
const
|
|
43654
|
-
const fillColor = this.parseColor(
|
|
43916
|
+
const solidFill2 = this.xmlLookupService.getChildByLocalName(spPr, "solidFill");
|
|
43917
|
+
const fillColor = this.parseColor(solidFill2);
|
|
43655
43918
|
const lnNode = this.xmlLookupService.getChildByLocalName(spPr, "ln");
|
|
43656
43919
|
const lnFill = lnNode ? this.xmlLookupService.getChildByLocalName(lnNode, "solidFill") : void 0;
|
|
43657
43920
|
const strokeColor = this.parseColor(lnFill);
|
|
@@ -43755,12 +44018,14 @@ var PptxHandlerRuntime70 = class _PptxHandlerRuntime extends PptxHandlerRuntime6
|
|
|
43755
44018
|
return null;
|
|
43756
44019
|
}
|
|
43757
44020
|
const runs = this.extractSmartArtNodeRuns(point);
|
|
44021
|
+
const style = this.extractSmartArtNodeStyle(point);
|
|
43758
44022
|
return {
|
|
43759
44023
|
id: pointId,
|
|
43760
44024
|
text: resolvedText.trim(),
|
|
43761
44025
|
parentId: parentByNodeId.get(pointId),
|
|
43762
44026
|
nodeType,
|
|
43763
|
-
runs
|
|
44027
|
+
runs,
|
|
44028
|
+
style
|
|
43764
44029
|
};
|
|
43765
44030
|
}).filter((entry) => Boolean(entry)).slice(0, MAX_SMARTART_NODES);
|
|
43766
44031
|
if (nodes.length === 0) {
|
|
@@ -43925,10 +44190,10 @@ var PptxHandlerRuntime71 = class extends PptxHandlerRuntime70 {
|
|
|
43925
44190
|
};
|
|
43926
44191
|
const matchedKeys = [];
|
|
43927
44192
|
for (const key of Object.keys(plotArea)) {
|
|
43928
|
-
const
|
|
43929
|
-
const mapped = chartElementMap[
|
|
44193
|
+
const localName2 = this.compatibilityService.getXmlLocalName(key);
|
|
44194
|
+
const mapped = chartElementMap[localName2];
|
|
43930
44195
|
if (mapped) {
|
|
43931
|
-
matchedKeys.push(
|
|
44196
|
+
matchedKeys.push(localName2);
|
|
43932
44197
|
}
|
|
43933
44198
|
}
|
|
43934
44199
|
if (matchedKeys.length >= 2) {
|
|
@@ -43938,8 +44203,8 @@ var PptxHandlerRuntime71 = class extends PptxHandlerRuntime70 {
|
|
|
43938
44203
|
return chartElementMap[matchedKeys[0]];
|
|
43939
44204
|
}
|
|
43940
44205
|
for (const key of Object.keys(plotArea)) {
|
|
43941
|
-
const
|
|
43942
|
-
if (
|
|
44206
|
+
const localName2 = this.compatibilityService.getXmlLocalName(key);
|
|
44207
|
+
if (localName2 === "plotAreaRegion" || localName2 === "plotSurface") {
|
|
43943
44208
|
const seriesArr = this.xmlLookupService.getChildrenArrayByLocalName(
|
|
43944
44209
|
plotArea[key],
|
|
43945
44210
|
"series"
|
|
@@ -44466,8 +44731,8 @@ var PptxHandlerRuntime74 = class extends PptxHandlerRuntime73 {
|
|
|
44466
44731
|
if (key.startsWith("@_")) {
|
|
44467
44732
|
continue;
|
|
44468
44733
|
}
|
|
44469
|
-
const
|
|
44470
|
-
if (
|
|
44734
|
+
const localName2 = this.compatibilityService.getXmlLocalName(key);
|
|
44735
|
+
if (localName2 === "schemeClr") {
|
|
44471
44736
|
const items = Array.isArray(value) ? value : [value];
|
|
44472
44737
|
for (const item of items) {
|
|
44473
44738
|
const resolved = this.resolveChartSchemeColor(item);
|
|
@@ -44475,7 +44740,7 @@ var PptxHandlerRuntime74 = class extends PptxHandlerRuntime73 {
|
|
|
44475
44740
|
output.push(resolved);
|
|
44476
44741
|
}
|
|
44477
44742
|
}
|
|
44478
|
-
} else if (
|
|
44743
|
+
} else if (localName2 === "srgbClr") {
|
|
44479
44744
|
const items = Array.isArray(value) ? value : [value];
|
|
44480
44745
|
for (const item of items) {
|
|
44481
44746
|
const hex8 = String(
|
|
@@ -64147,6 +64412,7 @@ exports.setChartSeriesMarker = setChartSeriesMarker;
|
|
|
64147
64412
|
exports.setChartSeriesTrendline = setChartSeriesTrendline;
|
|
64148
64413
|
exports.setChartTitle = setChartTitle;
|
|
64149
64414
|
exports.setChartType = setChartType;
|
|
64415
|
+
exports.setSmartArtNodeStyle = setSmartArtNodeStyle;
|
|
64150
64416
|
exports.shouldRenderFallbackLabel = shouldRenderFallbackLabel;
|
|
64151
64417
|
exports.shouldReturnToZoomSlide = shouldReturnToZoomSlide;
|
|
64152
64418
|
exports.subtractPolygons = subtractPolygons;
|