pptx-react-viewer 4.9.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/dist/{AiChatPanel-WJ64Q6KO.js → AiChatPanel-RBQFM6JK.js} +27 -27
- package/dist/AiChatPanel-RBQFM6JK.js.br +0 -0
- package/dist/AiChatPanel-RBQFM6JK.js.gz +0 -0
- package/dist/{AiChatPanel-YRWC7C3B.mjs → AiChatPanel-SIEMT43N.mjs} +3 -3
- package/dist/AiChatPanel-SIEMT43N.mjs.br +0 -0
- package/dist/AiChatPanel-SIEMT43N.mjs.gz +0 -0
- package/dist/{Model3DScene-DS6AQWFV.mjs → Model3DScene-HZ7SOUFQ.mjs} +1 -1
- package/dist/{Model3DScene-DS6AQWFV.mjs.br → Model3DScene-HZ7SOUFQ.mjs.br} +0 -0
- package/dist/Model3DScene-HZ7SOUFQ.mjs.gz +0 -0
- package/dist/{Model3DScene-VHDYCHO5.js → Model3DScene-ITAVIIVY.js} +2 -2
- package/dist/Model3DScene-ITAVIIVY.js.br +0 -0
- package/dist/Model3DScene-ITAVIIVY.js.gz +0 -0
- package/dist/{chunk-K5HZD63F.mjs → chunk-3UZYGG6W.mjs} +6 -6
- package/dist/chunk-3UZYGG6W.mjs.br +0 -0
- package/dist/chunk-3UZYGG6W.mjs.gz +0 -0
- package/dist/{chunk-M6KW27TZ.mjs → chunk-A5A6B2PA.mjs} +17 -13
- package/dist/chunk-A5A6B2PA.mjs.br +0 -0
- package/dist/chunk-A5A6B2PA.mjs.gz +0 -0
- package/dist/{chunk-YWAFJZ23.js → chunk-E5565MDK.js} +796 -327
- package/dist/chunk-E5565MDK.js.br +0 -0
- package/dist/chunk-E5565MDK.js.gz +0 -0
- package/dist/{chunk-Y7RTQOD6.mjs → chunk-LMJU46E5.mjs} +1 -1
- package/dist/chunk-LMJU46E5.mjs.br +0 -0
- package/dist/chunk-LMJU46E5.mjs.gz +0 -0
- package/dist/{chunk-7NTNFOPT.js → chunk-NTMJSTXL.js} +187 -187
- package/dist/chunk-NTMJSTXL.js.br +0 -0
- package/dist/chunk-NTMJSTXL.js.gz +0 -0
- package/dist/{chunk-PSJTZIIK.js → chunk-PPDIZ3XP.js} +5 -5
- package/dist/chunk-PPDIZ3XP.js.br +0 -0
- package/dist/chunk-PPDIZ3XP.js.gz +0 -0
- package/dist/{chunk-ZZY24BB7.mjs → chunk-WM33FDLD.mjs} +1 -1
- package/dist/chunk-WM33FDLD.mjs.br +0 -0
- package/dist/chunk-WM33FDLD.mjs.gz +0 -0
- package/dist/{chunk-PJT2DTOS.mjs → chunk-ZBFDEYLQ.mjs} +796 -327
- package/dist/chunk-ZBFDEYLQ.mjs.br +0 -0
- package/dist/chunk-ZBFDEYLQ.mjs.gz +0 -0
- package/dist/{chunk-NMXIX7E4.js → chunk-ZEQVK2FT.js} +1179 -1179
- package/dist/chunk-ZEQVK2FT.js.br +0 -0
- package/dist/chunk-ZEQVK2FT.js.gz +0 -0
- package/dist/{chunk-ZZ6IPWOP.js → chunk-ZI57KREY.js} +820 -816
- package/dist/chunk-ZI57KREY.js.br +0 -0
- package/dist/chunk-ZI57KREY.js.gz +0 -0
- package/dist/index.d.ts +20 -4
- package/dist/index.js +61 -61
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +22 -6
- package/dist/internals.js +104 -104
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +20 -4
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-WJ64Q6KO.js.br +0 -0
- package/dist/AiChatPanel-WJ64Q6KO.js.gz +0 -0
- package/dist/AiChatPanel-YRWC7C3B.mjs.br +0 -0
- package/dist/AiChatPanel-YRWC7C3B.mjs.gz +0 -0
- package/dist/Model3DScene-DS6AQWFV.mjs.gz +0 -0
- package/dist/Model3DScene-VHDYCHO5.js.br +0 -0
- package/dist/Model3DScene-VHDYCHO5.js.gz +0 -0
- package/dist/chunk-7NTNFOPT.js.br +0 -0
- package/dist/chunk-7NTNFOPT.js.gz +0 -0
- package/dist/chunk-K5HZD63F.mjs.br +0 -0
- package/dist/chunk-K5HZD63F.mjs.gz +0 -0
- package/dist/chunk-M6KW27TZ.mjs.br +0 -0
- package/dist/chunk-M6KW27TZ.mjs.gz +0 -0
- package/dist/chunk-NMXIX7E4.js.br +0 -0
- package/dist/chunk-NMXIX7E4.js.gz +0 -0
- package/dist/chunk-PJT2DTOS.mjs.br +0 -0
- package/dist/chunk-PJT2DTOS.mjs.gz +0 -0
- package/dist/chunk-PSJTZIIK.js.br +0 -0
- package/dist/chunk-PSJTZIIK.js.gz +0 -0
- package/dist/chunk-Y7RTQOD6.mjs.br +0 -0
- package/dist/chunk-Y7RTQOD6.mjs.gz +0 -0
- package/dist/chunk-YWAFJZ23.js.br +0 -0
- package/dist/chunk-YWAFJZ23.js.gz +0 -0
- package/dist/chunk-ZZ6IPWOP.js.br +0 -0
- package/dist/chunk-ZZ6IPWOP.js.gz +0 -0
- package/dist/chunk-ZZY24BB7.mjs.br +0 -0
- package/dist/chunk-ZZY24BB7.mjs.gz +0 -0
|
@@ -11100,7 +11100,7 @@ function createChartElement(chartType, input, options) {
|
|
|
11100
11100
|
const chartData = {
|
|
11101
11101
|
chartType,
|
|
11102
11102
|
categories: input.categories,
|
|
11103
|
-
categoryLevels: input.categoryLevels?.map((
|
|
11103
|
+
categoryLevels: input.categoryLevels?.map((level2) => [...level2]),
|
|
11104
11104
|
series,
|
|
11105
11105
|
title: input.title,
|
|
11106
11106
|
grouping: input.grouping,
|
|
@@ -35944,9 +35944,9 @@ function paragraphsAt(text22, sizePt) {
|
|
|
35944
35944
|
const afterParent = (text22.spaceAfterParent ?? DEFAULT_SPACE_AFTER_PARENT) / 100;
|
|
35945
35945
|
const afterChild = (text22.spaceAfterChild ?? DEFAULT_SPACE_AFTER_CHILD) / 100;
|
|
35946
35946
|
const { secondary } = paragraphSizesPt(text22, sizePt);
|
|
35947
|
-
const paragraph = (value,
|
|
35948
|
-
const bullet = bulletLevel > 0 &&
|
|
35949
|
-
const size = bullet ||
|
|
35947
|
+
const paragraph = (value, level2) => {
|
|
35948
|
+
const bullet = bulletLevel > 0 && level2 >= bulletLevel;
|
|
35949
|
+
const size = bullet || level2 >= 2 ? secondary : sizePt;
|
|
35950
35950
|
return {
|
|
35951
35951
|
text: value,
|
|
35952
35952
|
size,
|
|
@@ -36819,6 +36819,136 @@ var init_alg_hier = __esm({
|
|
|
36819
36819
|
HIER_ALGS = /* @__PURE__ */ new Set(["hierRoot", "hierChild"]);
|
|
36820
36820
|
}
|
|
36821
36821
|
});
|
|
36822
|
+
function shapeTransform(node) {
|
|
36823
|
+
const box = node.box;
|
|
36824
|
+
if (!box) {
|
|
36825
|
+
return void 0;
|
|
36826
|
+
}
|
|
36827
|
+
const rotation = (((node.shape?.rot ?? 0) + node.rotation) % 360 + 360) % 360;
|
|
36828
|
+
const quarter = Math.round((node.shape?.rot ?? 0) / 90);
|
|
36829
|
+
if (Math.abs(quarter) % 2 === 1 && Math.abs((node.shape?.rot ?? 0) - quarter * 90) < 1e-6) {
|
|
36830
|
+
const cx = box.x + box.w / 2;
|
|
36831
|
+
const cy = box.y + box.h / 2;
|
|
36832
|
+
return { x: cx - box.h / 2, y: cy - box.w / 2, w: box.h, h: box.w, rotation };
|
|
36833
|
+
}
|
|
36834
|
+
return { ...box, rotation };
|
|
36835
|
+
}
|
|
36836
|
+
var init_shape_transform = __esm({
|
|
36837
|
+
"src/core/utils/smartart-engine/shape-transform.ts"() {
|
|
36838
|
+
}
|
|
36839
|
+
});
|
|
36840
|
+
function depthOf(point) {
|
|
36841
|
+
let depth = 0;
|
|
36842
|
+
for (let current = point.parent; current; current = current.parent) {
|
|
36843
|
+
depth++;
|
|
36844
|
+
}
|
|
36845
|
+
return depth;
|
|
36846
|
+
}
|
|
36847
|
+
function level(depth) {
|
|
36848
|
+
return Math.max(0, Math.min(MAX_LEVEL, depth));
|
|
36849
|
+
}
|
|
36850
|
+
function connectorDim(node) {
|
|
36851
|
+
return node.alg.type === "conn" && node.alg.params.dim === "1D" ? "1D" : "2D";
|
|
36852
|
+
}
|
|
36853
|
+
function derivedStyleLabel(node) {
|
|
36854
|
+
if (!node.hasPresOf) {
|
|
36855
|
+
return void 0;
|
|
36856
|
+
}
|
|
36857
|
+
const point = node.presOf[0] ?? node.point;
|
|
36858
|
+
switch (point.type) {
|
|
36859
|
+
case "node":
|
|
36860
|
+
case "asst":
|
|
36861
|
+
return `node${level(depthOf(point))}`;
|
|
36862
|
+
case "sibTrans":
|
|
36863
|
+
return `sibTrans${connectorDim(node)}1`;
|
|
36864
|
+
case "parTrans":
|
|
36865
|
+
return `parChTrans${connectorDim(node)}${level(depthOf(point))}`;
|
|
36866
|
+
default:
|
|
36867
|
+
return void 0;
|
|
36868
|
+
}
|
|
36869
|
+
}
|
|
36870
|
+
function engineStyleLabel(node) {
|
|
36871
|
+
for (let current = node; current; current = current.parent) {
|
|
36872
|
+
if (current.styleLbl) {
|
|
36873
|
+
return current.styleLbl;
|
|
36874
|
+
}
|
|
36875
|
+
}
|
|
36876
|
+
return derivedStyleLabel(node);
|
|
36877
|
+
}
|
|
36878
|
+
var MAX_LEVEL;
|
|
36879
|
+
var init_style_label = __esm({
|
|
36880
|
+
"src/core/utils/smartart-engine/style-label.ts"() {
|
|
36881
|
+
MAX_LEVEL = 4;
|
|
36882
|
+
}
|
|
36883
|
+
});
|
|
36884
|
+
function connectorPreset(node) {
|
|
36885
|
+
const type = node.shape?.type;
|
|
36886
|
+
if (!type || type === "none" || node.shape?.hideGeom || !node.values.has("connDist")) {
|
|
36887
|
+
return void 0;
|
|
36888
|
+
}
|
|
36889
|
+
if (type !== "conn") {
|
|
36890
|
+
return type;
|
|
36891
|
+
}
|
|
36892
|
+
const params = node.alg.params;
|
|
36893
|
+
if ((params.dim ?? "2D") !== "2D" || (params.connRout ?? "stra") !== "stra") {
|
|
36894
|
+
return void 0;
|
|
36895
|
+
}
|
|
36896
|
+
const begin = (params.begSty ?? "noArr") === "arr";
|
|
36897
|
+
const end = (params.endSty ?? "arr") === "arr";
|
|
36898
|
+
if (begin && end) {
|
|
36899
|
+
return "leftRightArrow";
|
|
36900
|
+
}
|
|
36901
|
+
if (begin) {
|
|
36902
|
+
return "leftArrow";
|
|
36903
|
+
}
|
|
36904
|
+
return end ? "rightArrow" : "rect";
|
|
36905
|
+
}
|
|
36906
|
+
function buildConnectorNode(node, index, connectorIndex, palette, roleColors) {
|
|
36907
|
+
const preset22 = connectorPreset(node);
|
|
36908
|
+
const transform6 = preset22 ? shapeTransform(node) : void 0;
|
|
36909
|
+
if (!preset22 || !transform6 || !(transform6.w > 0) || !(transform6.h > 0)) {
|
|
36910
|
+
return void 0;
|
|
36911
|
+
}
|
|
36912
|
+
const styleLabel = engineStyleLabel(node);
|
|
36913
|
+
const fills = styleLabel ? roleColors?.[styleLabel]?.fill : void 0;
|
|
36914
|
+
const fill = fills && fills.length > 0 ? fills[connectorIndex % fills.length] : colour(index, palette);
|
|
36915
|
+
const x = transform6.x * PX_PER_PT3;
|
|
36916
|
+
const y = transform6.y * PX_PER_PT3;
|
|
36917
|
+
const width = transform6.w * PX_PER_PT3;
|
|
36918
|
+
const height = transform6.h * PX_PER_PT3;
|
|
36919
|
+
return {
|
|
36920
|
+
kind: "rect",
|
|
36921
|
+
key: `${node.name || "engine-conn"}-${index}`,
|
|
36922
|
+
x,
|
|
36923
|
+
y,
|
|
36924
|
+
width,
|
|
36925
|
+
height,
|
|
36926
|
+
rx: 0,
|
|
36927
|
+
fill,
|
|
36928
|
+
stroke: "none",
|
|
36929
|
+
strokeWidth: 0,
|
|
36930
|
+
opacity: 1,
|
|
36931
|
+
text: "",
|
|
36932
|
+
fontSize: 0,
|
|
36933
|
+
textX: x + width / 2,
|
|
36934
|
+
textY: y + height / 2,
|
|
36935
|
+
rotation: transform6.rotation === 0 ? void 0 : transform6.rotation,
|
|
36936
|
+
presetOverride: preset22,
|
|
36937
|
+
...preset22 === "rect" ? {} : { shapeAdjustments: { ...ARROW_ADJUSTMENTS } },
|
|
36938
|
+
...styleLabel ? { styleLabel } : {}
|
|
36939
|
+
};
|
|
36940
|
+
}
|
|
36941
|
+
var ARROW_ADJUSTMENTS;
|
|
36942
|
+
var PX_PER_PT3;
|
|
36943
|
+
var init_connector_shape = __esm({
|
|
36944
|
+
"src/core/utils/smartart-engine/connector-shape.ts"() {
|
|
36945
|
+
init_smartart_layout_style_helpers();
|
|
36946
|
+
init_shape_transform();
|
|
36947
|
+
init_style_label();
|
|
36948
|
+
ARROW_ADJUSTMENTS = { adj1: 6e4, adj2: 5e4 };
|
|
36949
|
+
PX_PER_PT3 = 96 / 72;
|
|
36950
|
+
}
|
|
36951
|
+
});
|
|
36822
36952
|
function collectNodes(nodes, parentId, out) {
|
|
36823
36953
|
for (const node of nodes) {
|
|
36824
36954
|
out.push({ node, parentId: node.parentId ?? parentId });
|
|
@@ -37514,6 +37644,68 @@ var init_pres_tree = __esm({
|
|
|
37514
37644
|
MAX_DEPTH = 96;
|
|
37515
37645
|
}
|
|
37516
37646
|
});
|
|
37647
|
+
function connectorThickness(node, fallback) {
|
|
37648
|
+
const parent = node.parent;
|
|
37649
|
+
let resized = false;
|
|
37650
|
+
for (const constraint of parent?.constraints ?? []) {
|
|
37651
|
+
if (!parent || !SIZE_TYPES2.has(constraint.type) || !SIZE_TYPES2.has(constraint.refType)) {
|
|
37652
|
+
continue;
|
|
37653
|
+
}
|
|
37654
|
+
if (constraint.refFor === "self" && !constraint.refForName) {
|
|
37655
|
+
continue;
|
|
37656
|
+
}
|
|
37657
|
+
const targets = relatedNodes(parent, constraint.for, constraint.forName, constraint.ptType);
|
|
37658
|
+
if (!targets.includes(node)) {
|
|
37659
|
+
continue;
|
|
37660
|
+
}
|
|
37661
|
+
const ref = relatedNodes(
|
|
37662
|
+
parent,
|
|
37663
|
+
constraint.refFor,
|
|
37664
|
+
constraint.refForName,
|
|
37665
|
+
constraint.refPtType
|
|
37666
|
+
)[0];
|
|
37667
|
+
const box = ref?.box;
|
|
37668
|
+
if (!box || ref.alg.type === "conn") {
|
|
37669
|
+
continue;
|
|
37670
|
+
}
|
|
37671
|
+
const base = constraint.refType === "w" ? box.w : box.h;
|
|
37672
|
+
if (base > 0) {
|
|
37673
|
+
node.values.set(constraint.type, base * constraint.fact);
|
|
37674
|
+
resized = true;
|
|
37675
|
+
}
|
|
37676
|
+
}
|
|
37677
|
+
if (resized) {
|
|
37678
|
+
for (let i2 = 0; i2 < node.constraints.length; i2++) {
|
|
37679
|
+
if (isSelfSizeConstraint(node, i2)) {
|
|
37680
|
+
applyConstraint(node, node.constraints[i2]);
|
|
37681
|
+
}
|
|
37682
|
+
}
|
|
37683
|
+
}
|
|
37684
|
+
const h2 = node.values.get("h");
|
|
37685
|
+
return resized && h2 !== void 0 && h2 > 0 ? h2 : fallback;
|
|
37686
|
+
}
|
|
37687
|
+
function edgeDistance(shape, box, dx, dy) {
|
|
37688
|
+
const halfW = box.w / 2;
|
|
37689
|
+
const halfH = box.h / 2;
|
|
37690
|
+
if (shape.shape?.type === "ellipse" && halfW > 0 && halfH > 0) {
|
|
37691
|
+
return halfW * halfH / Math.hypot(halfH * dx, halfW * dy);
|
|
37692
|
+
}
|
|
37693
|
+
const tx = dx === 0 ? Infinity : halfW / Math.abs(dx);
|
|
37694
|
+
const ty = dy === 0 ? Infinity : halfH / Math.abs(dy);
|
|
37695
|
+
return Math.min(tx, ty);
|
|
37696
|
+
}
|
|
37697
|
+
var SIZE_TYPES2;
|
|
37698
|
+
var DEFAULT_BEGIN_PAD;
|
|
37699
|
+
var DEFAULT_END_PAD;
|
|
37700
|
+
var init_connector_size = __esm({
|
|
37701
|
+
"src/core/utils/smartart-engine/connector-size.ts"() {
|
|
37702
|
+
init_constraint_eval();
|
|
37703
|
+
init_preferred_size();
|
|
37704
|
+
SIZE_TYPES2 = /* @__PURE__ */ new Set(["w", "h"]);
|
|
37705
|
+
DEFAULT_BEGIN_PAD = 0.22;
|
|
37706
|
+
DEFAULT_END_PAD = 0.25;
|
|
37707
|
+
}
|
|
37708
|
+
});
|
|
37517
37709
|
function rootOf2(node) {
|
|
37518
37710
|
let current = node;
|
|
37519
37711
|
while (current.parent) {
|
|
@@ -37560,13 +37752,6 @@ function findShape(scope, point, name, skip) {
|
|
|
37560
37752
|
visit(scope);
|
|
37561
37753
|
return named ?? fallback;
|
|
37562
37754
|
}
|
|
37563
|
-
function edgeDistance(box, dx, dy) {
|
|
37564
|
-
const halfW = box.w / 2;
|
|
37565
|
-
const halfH = box.h / 2;
|
|
37566
|
-
const tx = dx === 0 ? Infinity : halfW / Math.abs(dx);
|
|
37567
|
-
const ty = dy === 0 ? Infinity : halfH / Math.abs(dy);
|
|
37568
|
-
return Math.min(tx, ty);
|
|
37569
|
-
}
|
|
37570
37755
|
function arrangeConnector(node) {
|
|
37571
37756
|
const box = node.box;
|
|
37572
37757
|
if (!box) {
|
|
@@ -37585,8 +37770,8 @@ function arrangeConnector(node) {
|
|
|
37585
37770
|
if (length > 0) {
|
|
37586
37771
|
const dx = (ex - sx) / length;
|
|
37587
37772
|
const dy = (ey - sy) / length;
|
|
37588
|
-
const startGap = edgeDistance(src.box, dx, dy);
|
|
37589
|
-
const endGap = edgeDistance(dst.box, dx, dy);
|
|
37773
|
+
const startGap = edgeDistance(src, src.box, dx, dy);
|
|
37774
|
+
const endGap = edgeDistance(dst, dst.box, dx, dy);
|
|
37590
37775
|
const connDist = Math.max(0, length - startGap - endGap);
|
|
37591
37776
|
node.values.set("connDist", connDist);
|
|
37592
37777
|
for (const constraint of node.constraints) {
|
|
@@ -37594,13 +37779,13 @@ function arrangeConnector(node) {
|
|
|
37594
37779
|
node.values.set(constraint.type, connDist * constraint.fact);
|
|
37595
37780
|
}
|
|
37596
37781
|
}
|
|
37597
|
-
const begPad = node.values.get("begPad") ??
|
|
37598
|
-
const endPad = node.values.get("endPad") ??
|
|
37782
|
+
const begPad = node.values.get("begPad") ?? connDist * DEFAULT_BEGIN_PAD;
|
|
37783
|
+
const endPad = node.values.get("endPad") ?? connDist * DEFAULT_END_PAD;
|
|
37599
37784
|
const arrowLength = Math.max(0, connDist - begPad - endPad);
|
|
37600
37785
|
const mid = startGap + begPad + arrowLength / 2;
|
|
37601
37786
|
const cx = sx + dx * mid;
|
|
37602
37787
|
const cy = sy + dy * mid;
|
|
37603
|
-
const thickness = box.h;
|
|
37788
|
+
const thickness = connectorThickness(node, box.h);
|
|
37604
37789
|
node.box = { x: cx - arrowLength / 2, y: cy - thickness / 2, w: arrowLength, h: thickness };
|
|
37605
37790
|
node.rotation = normaliseAngle2(Math.atan2(dy, dx) * 180 / Math.PI);
|
|
37606
37791
|
}
|
|
@@ -37616,6 +37801,7 @@ function normaliseAngle2(degrees) {
|
|
|
37616
37801
|
}
|
|
37617
37802
|
var init_alg_connector = __esm({
|
|
37618
37803
|
"src/core/utils/smartart-engine/alg-connector.ts"() {
|
|
37804
|
+
init_connector_size();
|
|
37619
37805
|
}
|
|
37620
37806
|
});
|
|
37621
37807
|
function groupContentChildren(node) {
|
|
@@ -38655,11 +38841,11 @@ function applyEngineFonts(collected, nodeById, fontName) {
|
|
|
38655
38841
|
const pt2 = sizes.get(node) ?? 18;
|
|
38656
38842
|
const text22 = texts.get(node);
|
|
38657
38843
|
const { first, secondary } = text22 ? paragraphSizesPt(text22, pt2) : { first: pt2, secondary: Math.round(pt2 * DESCENDANT_FONT_SCALE) };
|
|
38658
|
-
rendered.fontSize = first *
|
|
38659
|
-
rendered.descendantFontSize = hasDescendants(node) ? secondary *
|
|
38844
|
+
rendered.fontSize = first * PX_PER_PT4;
|
|
38845
|
+
rendered.descendantFontSize = hasDescendants(node) ? secondary * PX_PER_PT4 : void 0;
|
|
38660
38846
|
}
|
|
38661
38847
|
}
|
|
38662
|
-
var
|
|
38848
|
+
var PX_PER_PT4;
|
|
38663
38849
|
var init_engine_fonts = __esm({
|
|
38664
38850
|
"src/core/utils/smartart-engine/engine-fonts.ts"() {
|
|
38665
38851
|
init_smartart_layout_item_font_size();
|
|
@@ -38667,7 +38853,7 @@ var init_engine_fonts = __esm({
|
|
|
38667
38853
|
init_move_with_merge();
|
|
38668
38854
|
init_node_text();
|
|
38669
38855
|
init_text_measure();
|
|
38670
|
-
|
|
38856
|
+
PX_PER_PT4 = 96 / 72;
|
|
38671
38857
|
}
|
|
38672
38858
|
});
|
|
38673
38859
|
function transitionLabelOf(node) {
|
|
@@ -38697,24 +38883,6 @@ var init_render_filter = __esm({
|
|
|
38697
38883
|
"src/core/utils/smartart-engine/render-filter.ts"() {
|
|
38698
38884
|
}
|
|
38699
38885
|
});
|
|
38700
|
-
function shapeTransform(node) {
|
|
38701
|
-
const box = node.box;
|
|
38702
|
-
if (!box) {
|
|
38703
|
-
return void 0;
|
|
38704
|
-
}
|
|
38705
|
-
const rotation = (((node.shape?.rot ?? 0) + node.rotation) % 360 + 360) % 360;
|
|
38706
|
-
const quarter = Math.round((node.shape?.rot ?? 0) / 90);
|
|
38707
|
-
if (Math.abs(quarter) % 2 === 1 && Math.abs((node.shape?.rot ?? 0) - quarter * 90) < 1e-6) {
|
|
38708
|
-
const cx = box.x + box.w / 2;
|
|
38709
|
-
const cy = box.y + box.h / 2;
|
|
38710
|
-
return { x: cx - box.h / 2, y: cy - box.w / 2, w: box.h, h: box.w, rotation };
|
|
38711
|
-
}
|
|
38712
|
-
return { ...box, rotation };
|
|
38713
|
-
}
|
|
38714
|
-
var init_shape_transform = __esm({
|
|
38715
|
-
"src/core/utils/smartart-engine/shape-transform.ts"() {
|
|
38716
|
-
}
|
|
38717
|
-
});
|
|
38718
38886
|
function isFullySupported(root) {
|
|
38719
38887
|
let ok = true;
|
|
38720
38888
|
const visit = (node) => {
|
|
@@ -38741,10 +38909,10 @@ function buildRenderedNode(node, index, nodeById, palette, style, mergedSourceId
|
|
|
38741
38909
|
const hidden = Boolean(node.shape?.hideGeom);
|
|
38742
38910
|
const text22 = primary?.text ?? literalText ?? "";
|
|
38743
38911
|
const sw = hidden ? 0 : styleStroke(style);
|
|
38744
|
-
const x = transform6.x *
|
|
38745
|
-
const y = transform6.y *
|
|
38746
|
-
const width = transform6.w *
|
|
38747
|
-
const height = transform6.h *
|
|
38912
|
+
const x = transform6.x * PX_PER_PT5;
|
|
38913
|
+
const y = transform6.y * PX_PER_PT5;
|
|
38914
|
+
const width = transform6.w * PX_PER_PT5;
|
|
38915
|
+
const height = transform6.h * PX_PER_PT5;
|
|
38748
38916
|
const foldedNodeIds = [
|
|
38749
38917
|
...sourceIds.slice(1),
|
|
38750
38918
|
...(mergedSourceIds ?? []).filter((id) => !sourceIds.includes(id))
|
|
@@ -38771,15 +38939,23 @@ function buildRenderedNode(node, index, nodeById, palette, style, mergedSourceId
|
|
|
38771
38939
|
rotation: transform6.rotation === 0 ? void 0 : transform6.rotation,
|
|
38772
38940
|
presetOverride: node.shape?.type ?? "roundRect",
|
|
38773
38941
|
foldedNodeIds: foldedNodeIds.length > 0 ? foldedNodeIds : void 0,
|
|
38774
|
-
literalText
|
|
38942
|
+
literalText,
|
|
38943
|
+
styleLabel: engineStyleLabel(node)
|
|
38775
38944
|
};
|
|
38776
38945
|
}
|
|
38777
|
-
function collectRenderedNodes(root, nodeById, palette, style) {
|
|
38946
|
+
function collectRenderedNodes(root, nodeById, palette, style, roleColors) {
|
|
38778
38947
|
const out = [];
|
|
38948
|
+
const connectors2 = [];
|
|
38779
38949
|
const visitSiblings = (siblings) => {
|
|
38780
38950
|
const { extraIdsByTarget, suppressed, carrierByTarget } = computeMoveWithMerge(siblings);
|
|
38781
38951
|
for (const node of siblings) {
|
|
38782
|
-
if (node.alg.type
|
|
38952
|
+
if (node.alg.type === "conn") {
|
|
38953
|
+
const index = out.length + connectors2.length;
|
|
38954
|
+
const arrow = buildConnectorNode(node, index, connectors2.length, palette, roleColors);
|
|
38955
|
+
if (arrow) {
|
|
38956
|
+
connectors2.push(arrow);
|
|
38957
|
+
}
|
|
38958
|
+
} else if (!suppressed.has(node)) {
|
|
38783
38959
|
const mergedIds = extraIdsByTarget.get(node.name);
|
|
38784
38960
|
const rendered = buildRenderedNode(node, out.length, nodeById, palette, style, mergedIds);
|
|
38785
38961
|
if (rendered) {
|
|
@@ -38792,7 +38968,7 @@ function collectRenderedNodes(root, nodeById, palette, style) {
|
|
|
38792
38968
|
}
|
|
38793
38969
|
};
|
|
38794
38970
|
visitSiblings([root]);
|
|
38795
|
-
return out;
|
|
38971
|
+
return { collected: out, connectors: connectors2 };
|
|
38796
38972
|
}
|
|
38797
38973
|
function isFiniteGeometry(node) {
|
|
38798
38974
|
return Number.isFinite(node.x) && Number.isFinite(node.y) && Number.isFinite(node.width) && Number.isFinite(node.height) && node.width > 0 && node.height > 0;
|
|
@@ -38820,9 +38996,15 @@ function runEngineLayout(smartArtData, containerBounds, nodes, palette, style) {
|
|
|
38820
38996
|
if (!run || !isFullySupported(run.root)) {
|
|
38821
38997
|
return void 0;
|
|
38822
38998
|
}
|
|
38823
|
-
const collected = collectRenderedNodes(
|
|
38999
|
+
const { collected, connectors: connectors2 } = collectRenderedNodes(
|
|
39000
|
+
run.root,
|
|
39001
|
+
nodeById,
|
|
39002
|
+
palette,
|
|
39003
|
+
style,
|
|
39004
|
+
smartArtData.colorTransform?.roleColors
|
|
39005
|
+
);
|
|
38824
39006
|
applyEngineFonts(collected, nodeById, smartArtData.themeMinorFont);
|
|
38825
|
-
const rendered = collected.map((entry5) => entry5.rendered);
|
|
39007
|
+
const rendered = [...collected.map((entry5) => entry5.rendered), ...connectors2];
|
|
38826
39008
|
if (rendered.length === 0 || !rendered.every(isFiniteGeometry)) {
|
|
38827
39009
|
return void 0;
|
|
38828
39010
|
}
|
|
@@ -38836,18 +39018,20 @@ function runEngineLayout(smartArtData, containerBounds, nodes, palette, style) {
|
|
|
38836
39018
|
}
|
|
38837
39019
|
var SUPPORTED_ALGS;
|
|
38838
39020
|
var PT_PER_PX;
|
|
38839
|
-
var
|
|
39021
|
+
var PX_PER_PT5;
|
|
38840
39022
|
var init_engine_to_result = __esm({
|
|
38841
39023
|
"src/core/utils/smartart-engine/engine-to-result.ts"() {
|
|
38842
39024
|
init_smartart_layout_item_font_size();
|
|
38843
39025
|
init_smartart_layout_style_helpers();
|
|
38844
39026
|
init_alg_hier();
|
|
39027
|
+
init_connector_shape();
|
|
38845
39028
|
init_engine();
|
|
38846
39029
|
init_engine_fonts();
|
|
38847
39030
|
init_move_with_merge();
|
|
38848
39031
|
init_node_text();
|
|
38849
39032
|
init_render_filter();
|
|
38850
39033
|
init_shape_transform();
|
|
39034
|
+
init_style_label();
|
|
38851
39035
|
init_text_measure();
|
|
38852
39036
|
SUPPORTED_ALGS = /* @__PURE__ */ new Set([
|
|
38853
39037
|
"composite",
|
|
@@ -38862,7 +39046,22 @@ var init_engine_to_result = __esm({
|
|
|
38862
39046
|
"tx"
|
|
38863
39047
|
]);
|
|
38864
39048
|
PT_PER_PX = 72 / 96;
|
|
38865
|
-
|
|
39049
|
+
PX_PER_PT5 = 1 / PT_PER_PX;
|
|
39050
|
+
}
|
|
39051
|
+
});
|
|
39052
|
+
function tagSmartArtElementStyleLabel(element, label) {
|
|
39053
|
+
if (label) {
|
|
39054
|
+
styleLabels.set(element, label);
|
|
39055
|
+
}
|
|
39056
|
+
return element;
|
|
39057
|
+
}
|
|
39058
|
+
function smartArtElementStyleLabel(element) {
|
|
39059
|
+
return styleLabels.get(element);
|
|
39060
|
+
}
|
|
39061
|
+
var styleLabels;
|
|
39062
|
+
var init_smartart_element_style_label = __esm({
|
|
39063
|
+
"src/core/utils/smartart-element-style-label.ts"() {
|
|
39064
|
+
styleLabels = /* @__PURE__ */ new WeakMap();
|
|
38866
39065
|
}
|
|
38867
39066
|
});
|
|
38868
39067
|
function accentColor(index, themeColorMap) {
|
|
@@ -39785,8 +39984,8 @@ function parseParagraphLevel(pPr) {
|
|
|
39785
39984
|
if (!pPr) {
|
|
39786
39985
|
return 0;
|
|
39787
39986
|
}
|
|
39788
|
-
const
|
|
39789
|
-
return Number.isFinite(
|
|
39987
|
+
const level2 = Number.parseInt(String(pPr["@_lvl"] || "0"), 10);
|
|
39988
|
+
return Number.isFinite(level2) ? Math.min(Math.max(level2, 0), 8) : 0;
|
|
39790
39989
|
}
|
|
39791
39990
|
function parseParagraphExtraAttributes(pPr) {
|
|
39792
39991
|
const result = {};
|
|
@@ -40160,12 +40359,12 @@ function paragraphStyle(paragraph, fallback) {
|
|
|
40160
40359
|
}
|
|
40161
40360
|
function paragraphMetadata(paragraph, paragraphIndex, bulletEnabled) {
|
|
40162
40361
|
const pPr = paragraph.pPr;
|
|
40163
|
-
const
|
|
40362
|
+
const level2 = parseParagraphLevel(pPr);
|
|
40164
40363
|
const explicitBullet = parseBulletInfo(pPr, paragraphIndex) ?? void 0;
|
|
40165
|
-
const bulletInfo = explicitBullet ?? (bulletEnabled && (
|
|
40364
|
+
const bulletInfo = explicitBullet ?? (bulletEnabled && (level2 ?? 0) >= 1 ? { char: AUTO_BULLET_CHAR } : void 0);
|
|
40166
40365
|
return {
|
|
40167
40366
|
...bulletInfo ? { bulletInfo } : {},
|
|
40168
|
-
paragraphLevel:
|
|
40367
|
+
paragraphLevel: level2,
|
|
40169
40368
|
...paragraph.endParaRPr ? { endParaRunProperties: paragraph.endParaRPr } : {}
|
|
40170
40369
|
};
|
|
40171
40370
|
}
|
|
@@ -40402,10 +40601,12 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
|
|
|
40402
40601
|
fontSize,
|
|
40403
40602
|
fontColor: rendered.fontColor ?? "#FFFFFF",
|
|
40404
40603
|
textSegments,
|
|
40405
|
-
rotation: rendered.rotation
|
|
40604
|
+
rotation: rendered.rotation,
|
|
40605
|
+
...rendered.shapeAdjustments ? { shapeAdjustments: rendered.shapeAdjustments } : {}
|
|
40406
40606
|
};
|
|
40607
|
+
const push2 = (element) => elements2.push(tagSmartArtElementStyleLabel(element, rendered.styleLabel));
|
|
40407
40608
|
if (rendered.kind === "rect") {
|
|
40408
|
-
|
|
40609
|
+
push2(
|
|
40409
40610
|
makeShapeElement(
|
|
40410
40611
|
id,
|
|
40411
40612
|
containerBounds.x + rendered.x,
|
|
@@ -40426,7 +40627,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
|
|
|
40426
40627
|
} else if (rendered.kind === "circle") {
|
|
40427
40628
|
const halfWidth = rendered.rx ?? rendered.r;
|
|
40428
40629
|
const halfHeight = rendered.ry ?? rendered.r;
|
|
40429
|
-
|
|
40630
|
+
push2(
|
|
40430
40631
|
makeShapeElement(
|
|
40431
40632
|
id,
|
|
40432
40633
|
containerBounds.x + rendered.cx - halfWidth,
|
|
@@ -40446,7 +40647,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
|
|
|
40446
40647
|
);
|
|
40447
40648
|
} else {
|
|
40448
40649
|
const bbox = polygonBoundingBox(rendered.points);
|
|
40449
|
-
|
|
40650
|
+
push2(
|
|
40450
40651
|
makeShapeElement(
|
|
40451
40652
|
id,
|
|
40452
40653
|
containerBounds.x + bbox.x,
|
|
@@ -40465,6 +40666,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
|
|
|
40465
40666
|
}
|
|
40466
40667
|
var init_smartart_interpreter_drawing_bridge = __esm({
|
|
40467
40668
|
"src/core/utils/smartart-interpreter-drawing-bridge.ts"() {
|
|
40669
|
+
init_smartart_element_style_label();
|
|
40468
40670
|
init_smartart_helpers();
|
|
40469
40671
|
init_smartart_interpreter_fold_text();
|
|
40470
40672
|
init_smartart_node_tree_axis();
|
|
@@ -41336,8 +41538,8 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
|
|
|
41336
41538
|
const proportional = proportionalMarginFraction(index, role);
|
|
41337
41539
|
const lineSpacingFactor = SMARTART_LINE_SPACING_FACTOR;
|
|
41338
41540
|
const fitsAtPoint = (rootPt2) => {
|
|
41339
|
-
const rootPx = rootPt2 *
|
|
41340
|
-
const descendantPx = Math.round(rootPt2 * SMARTART_DESCENDANT_FONT_SCALE) *
|
|
41541
|
+
const rootPx = rootPt2 * PX_PER_PT6;
|
|
41542
|
+
const descendantPx = Math.round(rootPt2 * SMARTART_DESCENDANT_FONT_SCALE) * PX_PER_PT6;
|
|
41341
41543
|
const margins = proportional ? { horizontal: proportional.horizontal * rootPx, vertical: proportional.vertical * rootPx } : fixedMargins;
|
|
41342
41544
|
for (const item3 of items) {
|
|
41343
41545
|
const naturalHeight = typeof naturalAspect === "number" ? Math.min(item3.height, item3.width * naturalAspect) : item3.height;
|
|
@@ -41359,8 +41561,8 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
|
|
|
41359
41561
|
}
|
|
41360
41562
|
return true;
|
|
41361
41563
|
};
|
|
41362
|
-
const ceilingPt = Math.max(1, Math.floor(ceilingPx /
|
|
41363
|
-
const floorPt = Math.min(ceilingPt, Math.max(1, Math.ceil(floorPx /
|
|
41564
|
+
const ceilingPt = Math.max(1, Math.floor(ceilingPx / PX_PER_PT6 + 1e-9));
|
|
41565
|
+
const floorPt = Math.min(ceilingPt, Math.max(1, Math.ceil(floorPx / PX_PER_PT6 - 1e-9)));
|
|
41364
41566
|
let rootPt = floorPt;
|
|
41365
41567
|
for (let candidate = ceilingPt; candidate > floorPt; candidate--) {
|
|
41366
41568
|
if (fitsAtPoint(candidate)) {
|
|
@@ -41368,12 +41570,12 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
|
|
|
41368
41570
|
break;
|
|
41369
41571
|
}
|
|
41370
41572
|
}
|
|
41371
|
-
const rootSizePx = rootPt *
|
|
41573
|
+
const rootSizePx = rootPt * PX_PER_PT6;
|
|
41372
41574
|
const descendantSizePx = snapToWholePoint(rootSizePx * SMARTART_DESCENDANT_FONT_SCALE);
|
|
41373
41575
|
return { rootSizePx, descendantSizePx };
|
|
41374
41576
|
}
|
|
41375
41577
|
var SMARTART_DESCENDANT_FONT_SCALE;
|
|
41376
|
-
var
|
|
41578
|
+
var PX_PER_PT6;
|
|
41377
41579
|
var init_smartart_layout_item_font_tier = __esm({
|
|
41378
41580
|
"src/core/utils/smartart-layout-item-font-tier.ts"() {
|
|
41379
41581
|
init_smartart_layout_item_font_role();
|
|
@@ -41381,7 +41583,7 @@ var init_smartart_layout_item_font_tier = __esm({
|
|
|
41381
41583
|
init_smartart_layout_item_font_tier_fit();
|
|
41382
41584
|
init_smartart_text_wrap_fit();
|
|
41383
41585
|
SMARTART_DESCENDANT_FONT_SCALE = 0.78;
|
|
41384
|
-
|
|
41586
|
+
PX_PER_PT6 = 96 / 72;
|
|
41385
41587
|
}
|
|
41386
41588
|
});
|
|
41387
41589
|
function resolveCycleFontFit(plan, index, ringNodes, hubNode, ringNodeWidth, ringNodeHeight, hubWidth, hubHeight, cornerInsetPx, childrenOf, fontName) {
|
|
@@ -42668,7 +42870,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
|
|
|
42668
42870
|
}
|
|
42669
42871
|
}
|
|
42670
42872
|
const roots = nodes.filter((n) => !childIds.has(n.id));
|
|
42671
|
-
const
|
|
42873
|
+
const depthOf2 = /* @__PURE__ */ new Map();
|
|
42672
42874
|
let maxDepth2 = 0;
|
|
42673
42875
|
const depthStack = roots.map((r) => ({
|
|
42674
42876
|
node: r,
|
|
@@ -42676,7 +42878,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
|
|
|
42676
42878
|
}));
|
|
42677
42879
|
while (depthStack.length > 0) {
|
|
42678
42880
|
const { node, depth } = depthStack.pop();
|
|
42679
|
-
|
|
42881
|
+
depthOf2.set(node.id, depth);
|
|
42680
42882
|
maxDepth2 = Math.max(maxDepth2, depth);
|
|
42681
42883
|
for (const c of childrenIn(node)) {
|
|
42682
42884
|
depthStack.push({ node: c, depth: depth + 1 });
|
|
@@ -42733,7 +42935,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
|
|
|
42733
42935
|
({ node, x, width }, i2) => presetBoxNode({
|
|
42734
42936
|
key: `${elementId}-lintbl-${node.id}-${i2}`,
|
|
42735
42937
|
x,
|
|
42736
|
-
y: rowY(
|
|
42938
|
+
y: rowY(depthOf2.get(node.id) ?? 0),
|
|
42737
42939
|
width,
|
|
42738
42940
|
height: rowHeight,
|
|
42739
42941
|
node,
|
|
@@ -44985,18 +45187,18 @@ function fanContinues(t, perRow, orgChart, siblingCount2, normalCount) {
|
|
|
44985
45187
|
const spanW = effectiveWidth(t, orgChart);
|
|
44986
45188
|
return chPrefFanEligible || isSoloChainLink && normalCount > 1 && spanW === normalCount;
|
|
44987
45189
|
}
|
|
44988
|
-
function walk2(t,
|
|
45190
|
+
function walk2(t, level2, perRow, orgChart, siblingCount2) {
|
|
44989
45191
|
const { normal } = partitionChildren(t, orgChart);
|
|
44990
45192
|
if (normal.length === 0) {
|
|
44991
|
-
return { deepestFanLevel:
|
|
45193
|
+
return { deepestFanLevel: level2, maxHangDepth: 0, maxHangRows: 0, hangingColumns: 0 };
|
|
44992
45194
|
}
|
|
44993
|
-
if (
|
|
44994
|
-
let deepestFan =
|
|
45195
|
+
if (level2 === 0) {
|
|
45196
|
+
let deepestFan = level2;
|
|
44995
45197
|
let maxHang = 0;
|
|
44996
45198
|
let maxRows = 0;
|
|
44997
45199
|
let hangingColumns = 0;
|
|
44998
45200
|
for (const child262 of normal) {
|
|
44999
|
-
const r = walk2(child262,
|
|
45201
|
+
const r = walk2(child262, level2 + 1, perRow, orgChart, normal.length);
|
|
45000
45202
|
deepestFan = Math.max(deepestFan, r.deepestFanLevel);
|
|
45001
45203
|
maxHang = Math.max(maxHang, r.maxHangDepth);
|
|
45002
45204
|
maxRows = Math.max(maxRows, r.maxHangRows);
|
|
@@ -45010,12 +45212,12 @@ function walk2(t, level, perRow, orgChart, siblingCount2) {
|
|
|
45010
45212
|
};
|
|
45011
45213
|
}
|
|
45012
45214
|
if (fanContinues(t, perRow, orgChart, siblingCount2, normal.length)) {
|
|
45013
|
-
let deepestFan =
|
|
45215
|
+
let deepestFan = level2 + 1;
|
|
45014
45216
|
let maxHang = 0;
|
|
45015
45217
|
let maxRows = 0;
|
|
45016
45218
|
let hangingColumns = 0;
|
|
45017
45219
|
for (const child262 of normal) {
|
|
45018
|
-
const r = walk2(child262,
|
|
45220
|
+
const r = walk2(child262, level2 + 1, perRow, orgChart, void 0);
|
|
45019
45221
|
deepestFan = Math.max(deepestFan, r.deepestFanLevel);
|
|
45020
45222
|
maxHang = Math.max(maxHang, r.maxHangDepth);
|
|
45021
45223
|
maxRows = Math.max(maxRows, r.maxHangRows);
|
|
@@ -45029,7 +45231,7 @@ function walk2(t, level, perRow, orgChart, siblingCount2) {
|
|
|
45029
45231
|
};
|
|
45030
45232
|
}
|
|
45031
45233
|
return {
|
|
45032
|
-
deepestFanLevel:
|
|
45234
|
+
deepestFanLevel: level2,
|
|
45033
45235
|
maxHangDepth: treeDepth(t) - 1,
|
|
45034
45236
|
maxHangRows: countDescendants(t, orgChart),
|
|
45035
45237
|
hangingColumns: 1
|
|
@@ -45072,20 +45274,20 @@ var init_smartart_hierarchy_hang_depth = __esm({
|
|
|
45072
45274
|
init_smartart_hierarchy_orgchart_tree();
|
|
45073
45275
|
}
|
|
45074
45276
|
});
|
|
45075
|
-
function widthWalk(t,
|
|
45277
|
+
function widthWalk(t, level2, perRow, orgChart, siblingCount2, map) {
|
|
45076
45278
|
const { normal } = partitionChildren(t, orgChart);
|
|
45077
45279
|
let width;
|
|
45078
45280
|
if (normal.length === 0) {
|
|
45079
45281
|
width = 1;
|
|
45080
|
-
} else if (
|
|
45282
|
+
} else if (level2 === 0) {
|
|
45081
45283
|
width = 0;
|
|
45082
45284
|
for (const child262 of normal) {
|
|
45083
|
-
width += widthWalk(child262,
|
|
45285
|
+
width += widthWalk(child262, level2 + 1, perRow, orgChart, normal.length, map);
|
|
45084
45286
|
}
|
|
45085
45287
|
} else if (fanContinues(t, perRow, orgChart, siblingCount2, normal.length)) {
|
|
45086
45288
|
width = 0;
|
|
45087
45289
|
for (const child262 of normal) {
|
|
45088
|
-
width += widthWalk(child262,
|
|
45290
|
+
width += widthWalk(child262, level2 + 1, perRow, orgChart, void 0, map);
|
|
45089
45291
|
}
|
|
45090
45292
|
} else {
|
|
45091
45293
|
width = 1;
|
|
@@ -45327,7 +45529,7 @@ function placeAssistants(hc, x, parentBottom, assistants, options, cursor) {
|
|
|
45327
45529
|
stubConnector(hc, assistant.node.id, x + hc.boxH / 2, parentBottom, x + width / 2, y);
|
|
45328
45530
|
}
|
|
45329
45531
|
}
|
|
45330
|
-
function placeHangingTree(hc, t, x, options, cursor, size,
|
|
45532
|
+
function placeHangingTree(hc, t, x, options, cursor, size, level2 = 0) {
|
|
45331
45533
|
const y = cursor.y;
|
|
45332
45534
|
const boxW = size?.w ?? hc.boxW;
|
|
45333
45535
|
const boxH = size?.h ?? hc.boxH;
|
|
@@ -45340,7 +45542,7 @@ function placeHangingTree(hc, t, x, options, cursor, size, level = 0) {
|
|
|
45340
45542
|
if (normal.length === 0) {
|
|
45341
45543
|
return;
|
|
45342
45544
|
}
|
|
45343
|
-
if (options.foldDeeperGenerations &&
|
|
45545
|
+
if (options.foldDeeperGenerations && level2 >= 1) {
|
|
45344
45546
|
return;
|
|
45345
45547
|
}
|
|
45346
45548
|
const childX = align ? placeX : options.direction === "left" ? x - options.indent : x + options.indent;
|
|
@@ -45355,7 +45557,7 @@ function placeHangingTree(hc, t, x, options, cursor, size, level = 0) {
|
|
|
45355
45557
|
childY,
|
|
45356
45558
|
child262.node.id
|
|
45357
45559
|
);
|
|
45358
|
-
placeHangingTree(hc, child262, childX, options, cursor, void 0,
|
|
45560
|
+
placeHangingTree(hc, child262, childX, options, cursor, void 0, level2 + 1);
|
|
45359
45561
|
}
|
|
45360
45562
|
}
|
|
45361
45563
|
function placeHangingForest(hc, roots, startX, startY, options, rootSize) {
|
|
@@ -45440,17 +45642,17 @@ var init_smartart_hierarchy_hanging_box = __esm({
|
|
|
45440
45642
|
DEFAULT_HANGING_VGAP_RATIO = 0.55;
|
|
45441
45643
|
}
|
|
45442
45644
|
});
|
|
45443
|
-
function countRows(t,
|
|
45645
|
+
function countRows(t, level2, orgChart, fold) {
|
|
45444
45646
|
const { assistants, normal } = partitionChildren(t, orgChart);
|
|
45445
45647
|
let count = 1 + assistants.length;
|
|
45446
45648
|
if (normal.length === 0) {
|
|
45447
45649
|
return count;
|
|
45448
45650
|
}
|
|
45449
|
-
if (fold &&
|
|
45651
|
+
if (fold && level2 >= 1) {
|
|
45450
45652
|
return count;
|
|
45451
45653
|
}
|
|
45452
45654
|
for (const child262 of normal) {
|
|
45453
|
-
count += countRows(child262,
|
|
45655
|
+
count += countRows(child262, level2 + 1, orgChart, fold);
|
|
45454
45656
|
}
|
|
45455
45657
|
return count;
|
|
45456
45658
|
}
|
|
@@ -46086,8 +46288,8 @@ function planFan(childCount, perRow, siblingCxs) {
|
|
|
46086
46288
|
}
|
|
46087
46289
|
return { columns: siblingCxs, overflow: childCount - siblingCxs.length };
|
|
46088
46290
|
}
|
|
46089
|
-
function placeFannedRow(hc, t, normal, plan, cx, cy,
|
|
46090
|
-
const fanCy = (
|
|
46291
|
+
function placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, options, placeAtFn) {
|
|
46292
|
+
const fanCy = (level2 + 1) * cellH + cellH / 2;
|
|
46091
46293
|
const fanned = normal.slice(0, plan.columns.length);
|
|
46092
46294
|
for (let i2 = 0; i2 < fanned.length; i2++) {
|
|
46093
46295
|
const child262 = fanned[i2];
|
|
@@ -46101,7 +46303,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, option
|
|
|
46101
46303
|
fanCy - hc.boxH / 2,
|
|
46102
46304
|
child262.node.id
|
|
46103
46305
|
);
|
|
46104
|
-
placeAtFn(hc, child262, childCx, fanCy, 0, 1,
|
|
46306
|
+
placeAtFn(hc, child262, childCx, fanCy, 0, 1, level2 + 1, cellW, cellH, options);
|
|
46105
46307
|
}
|
|
46106
46308
|
if (plan.overflow <= 0 || !options.hangingPlacer) {
|
|
46107
46309
|
return;
|
|
@@ -46109,7 +46311,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, option
|
|
|
46109
46311
|
const remainder = normal.slice(plan.columns.length);
|
|
46110
46312
|
const columnOffset = hc.boxW * HIER_TAIL_OFFSET_RATIO;
|
|
46111
46313
|
const anchorX = plan.columns[0] - hc.boxW / 2 + columnOffset;
|
|
46112
|
-
const anchorY = (
|
|
46314
|
+
const anchorY = (level2 + 2) * cellH;
|
|
46113
46315
|
for (const child262 of remainder) {
|
|
46114
46316
|
elbowConnector(
|
|
46115
46317
|
hc,
|
|
@@ -46151,7 +46353,7 @@ function placeAssistantRow(hc, parentId, cx, cy, assistants) {
|
|
|
46151
46353
|
x += assistW + ASSISTANT_GAP;
|
|
46152
46354
|
}
|
|
46153
46355
|
}
|
|
46154
|
-
function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset,
|
|
46356
|
+
function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level2, cellW, cellH, options, placeChild) {
|
|
46155
46357
|
const siblingCxs = [];
|
|
46156
46358
|
{
|
|
46157
46359
|
let offset = xOffset;
|
|
@@ -46161,12 +46363,12 @@ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level, cellW,
|
|
|
46161
46363
|
offset += childW;
|
|
46162
46364
|
}
|
|
46163
46365
|
}
|
|
46164
|
-
const cascadeShift = options.cascadeOffsetX &&
|
|
46366
|
+
const cascadeShift = options.cascadeOffsetX && level2 + 1 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
|
|
46165
46367
|
let childOffset = xOffset;
|
|
46166
46368
|
for (const child262 of normal) {
|
|
46167
46369
|
const childW = spanOf(child262, options);
|
|
46168
46370
|
const childCx = (childOffset + childW / 2) * cellW + cascadeShift;
|
|
46169
|
-
const childCy = (
|
|
46371
|
+
const childCy = (level2 + 1) * cellH + cellH / 2;
|
|
46170
46372
|
elbowConnector(
|
|
46171
46373
|
hc,
|
|
46172
46374
|
parentId,
|
|
@@ -46183,7 +46385,7 @@ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level, cellW,
|
|
|
46183
46385
|
childCy,
|
|
46184
46386
|
childOffset,
|
|
46185
46387
|
childW,
|
|
46186
|
-
|
|
46388
|
+
level2 + 1,
|
|
46187
46389
|
cellW,
|
|
46188
46390
|
cellH,
|
|
46189
46391
|
options,
|
|
@@ -46215,13 +46417,13 @@ function wrappedGroupSlotCount(group2, orgChart) {
|
|
|
46215
46417
|
}
|
|
46216
46418
|
return group2.members.reduce((sum, m) => sum + effectiveWidth(m, orgChart), 0);
|
|
46217
46419
|
}
|
|
46218
|
-
function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW,
|
|
46420
|
+
function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, level2, cellW, cellH, options, placeAtFn) {
|
|
46219
46421
|
const groups = planWrappedGroups(normal, options.perRow, options.orgChart);
|
|
46220
46422
|
const totalSlots = groups.reduce((sum, g2) => sum + wrappedGroupSlotCount(g2, options.orgChart), 0);
|
|
46221
46423
|
const totalW = spanW * cellW;
|
|
46222
46424
|
const leftX = xOffset * cellW;
|
|
46223
46425
|
const unitW = totalW / Math.max(1, totalSlots);
|
|
46224
|
-
const rowCy = (
|
|
46426
|
+
const rowCy = (level2 + 1) * cellH + cellH / 2;
|
|
46225
46427
|
let slot = 0;
|
|
46226
46428
|
for (const group2 of groups) {
|
|
46227
46429
|
slot = group2.fansAsRow ? placeRowFanGroup(
|
|
@@ -46234,7 +46436,7 @@ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, leve
|
|
|
46234
46436
|
unitW,
|
|
46235
46437
|
slot,
|
|
46236
46438
|
rowCy,
|
|
46237
|
-
|
|
46439
|
+
level2,
|
|
46238
46440
|
cellW,
|
|
46239
46441
|
cellH,
|
|
46240
46442
|
options,
|
|
@@ -46251,25 +46453,25 @@ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, leve
|
|
|
46251
46453
|
rowCy,
|
|
46252
46454
|
cellW,
|
|
46253
46455
|
cellH,
|
|
46254
|
-
|
|
46456
|
+
level2,
|
|
46255
46457
|
options,
|
|
46256
46458
|
placeAtFn
|
|
46257
46459
|
);
|
|
46258
46460
|
}
|
|
46259
46461
|
}
|
|
46260
|
-
function placeRowFanGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy,
|
|
46462
|
+
function placeRowFanGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, level2, cellW, cellH, options, placeAtFn) {
|
|
46261
46463
|
let cursor = slot;
|
|
46262
46464
|
for (const child262 of group2.members) {
|
|
46263
46465
|
const childW = effectiveWidth(child262, options.orgChart);
|
|
46264
46466
|
const childCx = leftX + unitW * (cursor + childW / 2);
|
|
46265
46467
|
elbowConnector(hc, parentId, cx, cy + hc.boxH / 2, childCx, rowCy - hc.boxH / 2, child262.node.id);
|
|
46266
46468
|
const virtualOffset = childCx / cellW - childW / 2;
|
|
46267
|
-
placeAtFn(hc, child262, childCx, rowCy, virtualOffset, childW,
|
|
46469
|
+
placeAtFn(hc, child262, childCx, rowCy, virtualOffset, childW, level2 + 1, cellW, cellH, options);
|
|
46268
46470
|
cursor += childW;
|
|
46269
46471
|
}
|
|
46270
46472
|
return cursor;
|
|
46271
46473
|
}
|
|
46272
|
-
function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, cellW, cellH,
|
|
46474
|
+
function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, cellW, cellH, level2, options, placeAtFn) {
|
|
46273
46475
|
const groupCx = leftX + unitW * (slot + 0.5);
|
|
46274
46476
|
const subRowH = cellH / group2.members.length;
|
|
46275
46477
|
let fromId = parentId;
|
|
@@ -46281,7 +46483,7 @@ function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowC
|
|
|
46281
46483
|
elbowConnector(hc, fromId, fromX, fromY, groupCx, childCy - hc.boxH / 2, child262.node.id);
|
|
46282
46484
|
const childW = effectiveWidth(child262, options.orgChart);
|
|
46283
46485
|
const virtualOffset = groupCx / cellW - childW / 2;
|
|
46284
|
-
placeAtFn(hc, child262, groupCx, childCy, virtualOffset, childW,
|
|
46486
|
+
placeAtFn(hc, child262, groupCx, childCy, virtualOffset, childW, level2 + 1, cellW, cellH, options);
|
|
46285
46487
|
fromId = child262.node.id;
|
|
46286
46488
|
fromX = groupCx;
|
|
46287
46489
|
fromY = childCy + hc.boxH / 2;
|
|
@@ -46294,7 +46496,7 @@ var init_smartart_hierarchy_wrapped_groups = __esm({
|
|
|
46294
46496
|
init_smartart_hierarchy_shared();
|
|
46295
46497
|
}
|
|
46296
46498
|
});
|
|
46297
|
-
function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset,
|
|
46499
|
+
function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset, level2, cellW, cellH, options) {
|
|
46298
46500
|
placeFlatChildren(
|
|
46299
46501
|
hc,
|
|
46300
46502
|
parentId,
|
|
@@ -46302,14 +46504,14 @@ function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset, level, cellW,
|
|
|
46302
46504
|
cx,
|
|
46303
46505
|
cy,
|
|
46304
46506
|
xOffset,
|
|
46305
|
-
|
|
46507
|
+
level2,
|
|
46306
46508
|
cellW,
|
|
46307
46509
|
cellH,
|
|
46308
46510
|
options,
|
|
46309
46511
|
placeAt
|
|
46310
46512
|
);
|
|
46311
46513
|
}
|
|
46312
|
-
function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW,
|
|
46514
|
+
function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW, level2, cellW, cellH, options) {
|
|
46313
46515
|
placeWrappedChildren(
|
|
46314
46516
|
hc,
|
|
46315
46517
|
parentId,
|
|
@@ -46318,32 +46520,32 @@ function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW, lev
|
|
|
46318
46520
|
cy,
|
|
46319
46521
|
xOffset,
|
|
46320
46522
|
spanW,
|
|
46321
|
-
|
|
46523
|
+
level2,
|
|
46322
46524
|
cellW,
|
|
46323
46525
|
cellH,
|
|
46324
46526
|
options,
|
|
46325
46527
|
placeAt
|
|
46326
46528
|
);
|
|
46327
46529
|
}
|
|
46328
|
-
function placeAt(hc, t, cx, cy, xOffset, spanW,
|
|
46530
|
+
function placeAt(hc, t, cx, cy, xOffset, spanW, level2, cellW, cellH, options, siblingCxs) {
|
|
46329
46531
|
pushNode(hc, t.node, cx - hc.boxW / 2, cy - hc.boxH / 2);
|
|
46330
46532
|
const { assistants, normal } = partitionChildren(t, options.orgChart);
|
|
46331
46533
|
placeAssistantRow(hc, t.node.id, cx, cy, assistants);
|
|
46332
46534
|
if (normal.length === 0) {
|
|
46333
46535
|
return;
|
|
46334
46536
|
}
|
|
46335
|
-
if (options.foldDeeperGenerations &&
|
|
46537
|
+
if (options.foldDeeperGenerations && level2 >= 1) {
|
|
46336
46538
|
return;
|
|
46337
46539
|
}
|
|
46338
|
-
if (options.hangingPlacer &&
|
|
46540
|
+
if (options.hangingPlacer && level2 >= 1) {
|
|
46339
46541
|
const plan = planFan(normal.length, options.perRow, siblingCxs);
|
|
46340
46542
|
if (plan) {
|
|
46341
|
-
placeFannedRow(hc, t, normal, plan, cx, cy,
|
|
46543
|
+
placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, options, placeAt);
|
|
46342
46544
|
return;
|
|
46343
46545
|
}
|
|
46344
46546
|
const isSoloChainLink = !siblingCxs || siblingCxs.length === 1;
|
|
46345
46547
|
if (isSoloChainLink && normal.length > 1 && spanW === normal.length) {
|
|
46346
|
-
placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset,
|
|
46548
|
+
placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level2, cellW, cellH, options);
|
|
46347
46549
|
return;
|
|
46348
46550
|
}
|
|
46349
46551
|
const anchorY = cy + hc.boxH / 2 + (options.hangHeightRatio ?? HANG_HEIGHT_RATIO) * hc.boxH;
|
|
@@ -46371,21 +46573,21 @@ function placeAt(hc, t, cx, cy, xOffset, spanW, level, cellW, cellH, options, si
|
|
|
46371
46573
|
cy,
|
|
46372
46574
|
xOffset,
|
|
46373
46575
|
spanW,
|
|
46374
|
-
|
|
46576
|
+
level2,
|
|
46375
46577
|
cellW,
|
|
46376
46578
|
cellH,
|
|
46377
46579
|
options
|
|
46378
46580
|
);
|
|
46379
46581
|
} else {
|
|
46380
|
-
placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset,
|
|
46582
|
+
placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level2, cellW, cellH, options);
|
|
46381
46583
|
}
|
|
46382
46584
|
}
|
|
46383
|
-
function placeStandardTree(hc, t, xOffset,
|
|
46585
|
+
function placeStandardTree(hc, t, xOffset, level2, cellW, cellH, options) {
|
|
46384
46586
|
const spanW = spanOf(t, options);
|
|
46385
|
-
const cascadeShift = options.cascadeOffsetX &&
|
|
46587
|
+
const cascadeShift = options.cascadeOffsetX && level2 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
|
|
46386
46588
|
const cx = (xOffset + spanW / 2) * cellW + cascadeShift;
|
|
46387
|
-
const cy =
|
|
46388
|
-
placeAt(hc, t, cx, cy, xOffset, spanW,
|
|
46589
|
+
const cy = level2 * cellH + cellH / 2;
|
|
46590
|
+
placeAt(hc, t, cx, cy, xOffset, spanW, level2, cellW, cellH, options);
|
|
46389
46591
|
}
|
|
46390
46592
|
var init_smartart_hierarchy_standard = __esm({
|
|
46391
46593
|
"src/core/utils/smartart-hierarchy-standard.ts"() {
|
|
@@ -48047,10 +48249,10 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
|
|
|
48047
48249
|
const boxH = Math.min(cellH * 0.35, 28);
|
|
48048
48250
|
const elements2 = [];
|
|
48049
48251
|
let colourIdx = 0;
|
|
48050
|
-
function walk3(t, xOffset,
|
|
48252
|
+
function walk3(t, xOffset, level2) {
|
|
48051
48253
|
const w = treeWidth(t);
|
|
48052
48254
|
const cx = bounds.x + padding + (xOffset + w / 2) * cellW;
|
|
48053
|
-
const cy = bounds.y + padding +
|
|
48255
|
+
const cy = bounds.y + padding + level2 * cellH + cellH / 2;
|
|
48054
48256
|
const ci = colourIdx++;
|
|
48055
48257
|
const fill = accentColor(ci, themeColorMap);
|
|
48056
48258
|
elements2.push(
|
|
@@ -48073,7 +48275,7 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
|
|
|
48073
48275
|
for (const child262 of t.children) {
|
|
48074
48276
|
const childW = treeWidth(child262);
|
|
48075
48277
|
const childCx = bounds.x + padding + (childOffset + childW / 2) * cellW;
|
|
48076
|
-
const childCy = bounds.y + padding + (
|
|
48278
|
+
const childCy = bounds.y + padding + (level2 + 1) * cellH + cellH / 2;
|
|
48077
48279
|
elements2.push(
|
|
48078
48280
|
makeConnectorElement(
|
|
48079
48281
|
nextId("sa-hier-conn"),
|
|
@@ -48084,7 +48286,7 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
|
|
|
48084
48286
|
lighten(fill, 0.5)
|
|
48085
48287
|
)
|
|
48086
48288
|
);
|
|
48087
|
-
walk3(child262, childOffset,
|
|
48289
|
+
walk3(child262, childOffset, level2 + 1);
|
|
48088
48290
|
childOffset += childW;
|
|
48089
48291
|
}
|
|
48090
48292
|
return w;
|
|
@@ -49069,10 +49271,15 @@ function buildSmartArtColorRoleMap(styleLbls, deps) {
|
|
|
49069
49271
|
const map = {};
|
|
49070
49272
|
for (const lbl of styleLbls) {
|
|
49071
49273
|
const parsed = parseLabel(lbl, deps);
|
|
49072
|
-
|
|
49274
|
+
const hasText = parsed.textFill.length > 0;
|
|
49275
|
+
if (!parsed.name || parsed.fill.length === 0 && parsed.line.length === 0 && !hasText) {
|
|
49073
49276
|
continue;
|
|
49074
49277
|
}
|
|
49075
|
-
map[parsed.name] = {
|
|
49278
|
+
map[parsed.name] = {
|
|
49279
|
+
fill: parsed.fill,
|
|
49280
|
+
line: parsed.line,
|
|
49281
|
+
...hasText ? { textFill: parsed.textFill } : {}
|
|
49282
|
+
};
|
|
49076
49283
|
}
|
|
49077
49284
|
return map;
|
|
49078
49285
|
}
|
|
@@ -55167,10 +55374,10 @@ function parseCxRegionMapOptions(series, dataNode, xmlLookup, colorParser) {
|
|
|
55167
55374
|
}
|
|
55168
55375
|
function readIndexedDimension(dataNode, kind, type, xmlLookup) {
|
|
55169
55376
|
const dimension = xmlLookup.getChildrenArrayByLocalName(dataNode, kind).find((candidate) => String(candidate["@_type"] ?? "") === type);
|
|
55170
|
-
const
|
|
55377
|
+
const level2 = xmlLookup.getChildByLocalName(dimension, "lvl");
|
|
55171
55378
|
const values = [];
|
|
55172
55379
|
const indices = [];
|
|
55173
|
-
for (const [position2, point] of xmlLookup.getChildrenArrayByLocalName(
|
|
55380
|
+
for (const [position2, point] of xmlLookup.getChildrenArrayByLocalName(level2, "pt").entries()) {
|
|
55174
55381
|
const raw = xmlLookup.getScalarChildByLocalName(point, "v") ?? point["#text"];
|
|
55175
55382
|
values.push(String(raw ?? "").trim());
|
|
55176
55383
|
const parsed = Number.parseInt(String(point["@_idx"] ?? position2), 10);
|
|
@@ -55307,7 +55514,7 @@ function parseCxChartSeries(plotArea, xmlLookup, chartSpace, chartRoot, colorPar
|
|
|
55307
55514
|
if (serIndex === 0) {
|
|
55308
55515
|
const catDimLevels = strDims.get("cat") ?? strDims.values().next().value;
|
|
55309
55516
|
if (catDimLevels) {
|
|
55310
|
-
categoryLevels = catDimLevels.map((
|
|
55517
|
+
categoryLevels = catDimLevels.map((level2) => [...level2]);
|
|
55311
55518
|
for (const val2 of catDimLevels[0] ?? []) {
|
|
55312
55519
|
if (val2) {
|
|
55313
55520
|
categories.push(val2);
|
|
@@ -63935,6 +64142,10 @@ function buildFabricatedDrawingXml(shapes, nodes, presentationGuidByNodeId) {
|
|
|
63935
64142
|
return `${XML_PROLOG}\r
|
|
63936
64143
|
<dsp:drawing ${DSP_XMLNS}><dsp:spTree><dsp:nvGrpSpPr><dsp:cNvPr id="0" name=""/><dsp:cNvGrpSpPr/></dsp:nvGrpSpPr><dsp:grpSpPr/>${body}</dsp:spTree></dsp:drawing>`;
|
|
63937
64144
|
}
|
|
64145
|
+
function withStyleLabel(element) {
|
|
64146
|
+
const styleLabel = smartArtElementStyleLabel(element);
|
|
64147
|
+
return styleLabel ? { styleLabel } : {};
|
|
64148
|
+
}
|
|
63938
64149
|
function smartArtElementsToDrawingShapes(elements2) {
|
|
63939
64150
|
if (!elements2 || elements2.length === 0) {
|
|
63940
64151
|
return [];
|
|
@@ -63977,7 +64188,8 @@ function smartArtElementsToDrawingShapes(elements2) {
|
|
|
63977
64188
|
fontColor: shape.textStyle?.color,
|
|
63978
64189
|
...shape.shapeStyle?.scene3d ? { scene3d: shape.shapeStyle.scene3d } : {},
|
|
63979
64190
|
...shape.shapeStyle?.shape3d ? { shape3d: shape.shapeStyle.shape3d } : {},
|
|
63980
|
-
...shape.textStyle?.text3d ? { text3d: shape.textStyle.text3d } : {}
|
|
64191
|
+
...shape.textStyle?.text3d ? { text3d: shape.textStyle.text3d } : {},
|
|
64192
|
+
...withStyleLabel(el)
|
|
63981
64193
|
});
|
|
63982
64194
|
}
|
|
63983
64195
|
return shapes;
|
|
@@ -63992,6 +64204,7 @@ var init_smartart_fabrication_drawing = __esm({
|
|
|
63992
64204
|
init_constants();
|
|
63993
64205
|
init_custom_geometry();
|
|
63994
64206
|
init_custom_geometry_command_order();
|
|
64207
|
+
init_smartart_element_style_label();
|
|
63995
64208
|
init_smartart_fabrication_3d();
|
|
63996
64209
|
init_smartart_fabrication_data();
|
|
63997
64210
|
init_smartart_fabrication_text();
|
|
@@ -64063,6 +64276,10 @@ function applySmartArtQuickStyle3d(shapes, data) {
|
|
|
64063
64276
|
const nodeLabels = resolveNodeLabels(data.nodes);
|
|
64064
64277
|
const fallback = labelsByName.get(PRIMARY_STYLE_LABEL) ?? labelsByName.get(nodeLabels.values().next().value ?? "");
|
|
64065
64278
|
return shapes.map((shape) => {
|
|
64279
|
+
const own = shape.styleLabel ? labelsByName.get(shape.styleLabel) : void 0;
|
|
64280
|
+
if (own || shape.styleLabel) {
|
|
64281
|
+
return own ? withLabel3d(shape, own) : shape;
|
|
64282
|
+
}
|
|
64066
64283
|
const nodeId = nodeIdForShape(shape.id, data.nodes);
|
|
64067
64284
|
const labelName = nodeId ? nodeLabels.get(nodeId) : void 0;
|
|
64068
64285
|
const label = (labelName ? labelsByName.get(labelName) : void 0) ?? fallback;
|
|
@@ -68715,17 +68932,17 @@ var init_placeholder_level_style_serializer = __esm({
|
|
|
68715
68932
|
FILL_VARIANTS = ["a:noFill", "a:gradFill", "a:blipFill", "a:pattFill", "a:grpFill"];
|
|
68716
68933
|
}
|
|
68717
68934
|
});
|
|
68718
|
-
function levelXmlKey(
|
|
68719
|
-
return
|
|
68935
|
+
function levelXmlKey(level2) {
|
|
68936
|
+
return level2 === -1 ? "a:defPPr" : `a:lvl${level2 + 1}pPr`;
|
|
68720
68937
|
}
|
|
68721
68938
|
function serializeTextStyleLevels(levels, existing) {
|
|
68722
68939
|
const childEdits = /* @__PURE__ */ new Map();
|
|
68723
68940
|
for (const [key2, style] of Object.entries(levels)) {
|
|
68724
|
-
const
|
|
68725
|
-
if (!Number.isFinite(
|
|
68941
|
+
const level2 = Number(key2);
|
|
68942
|
+
if (!Number.isFinite(level2)) {
|
|
68726
68943
|
continue;
|
|
68727
68944
|
}
|
|
68728
|
-
const xmlKey = levelXmlKey(
|
|
68945
|
+
const xmlKey = levelXmlKey(level2);
|
|
68729
68946
|
childEdits.set(
|
|
68730
68947
|
xmlKey,
|
|
68731
68948
|
serializePlaceholderLevelStyle(style, existing?.[xmlKey])
|
|
@@ -78106,10 +78323,10 @@ function parseOleChartElement(shape) {
|
|
|
78106
78323
|
if (!oleChartEl || oleChartEl["@_type"] === void 0) {
|
|
78107
78324
|
return void 0;
|
|
78108
78325
|
}
|
|
78109
|
-
const
|
|
78326
|
+
const level2 = oleChartEl["@_lvl"] !== void 0 ? Number(oleChartEl["@_lvl"]) : void 0;
|
|
78110
78327
|
return {
|
|
78111
78328
|
subelementType: String(oleChartEl["@_type"]),
|
|
78112
|
-
...
|
|
78329
|
+
...level2 !== void 0 && !Number.isNaN(level2) ? { level: level2 } : {}
|
|
78113
78330
|
};
|
|
78114
78331
|
}
|
|
78115
78332
|
var init_animation_target_graphic_el = __esm({
|
|
@@ -78680,9 +78897,9 @@ function extractBldPTemplates(bldP) {
|
|
|
78680
78897
|
continue;
|
|
78681
78898
|
}
|
|
78682
78899
|
const levelRaw = tmpl["@_lvl"];
|
|
78683
|
-
const
|
|
78900
|
+
const level2 = levelRaw !== void 0 ? Number.parseInt(String(levelRaw), 10) : 0;
|
|
78684
78901
|
result.push({
|
|
78685
|
-
level: Number.isFinite(
|
|
78902
|
+
level: Number.isFinite(level2) ? level2 : 0,
|
|
78686
78903
|
timeNodeList: tnLst,
|
|
78687
78904
|
rawXml: tmpl
|
|
78688
78905
|
});
|
|
@@ -104459,6 +104676,113 @@ var init_chart_multi_level_category_parser = __esm({
|
|
|
104459
104676
|
"src/core/utils/chart-multi-level-category-parser.ts"() {
|
|
104460
104677
|
}
|
|
104461
104678
|
});
|
|
104679
|
+
function prSetOf(pt2, localName292) {
|
|
104680
|
+
const key2 = Object.keys(pt2).find((candidate) => localName292(candidate) === "prSet");
|
|
104681
|
+
const value = key2 ? pt2[key2] : void 0;
|
|
104682
|
+
return Array.isArray(value) ? value[0] : value;
|
|
104683
|
+
}
|
|
104684
|
+
function readPresPoints(points4, localName292) {
|
|
104685
|
+
const byId = /* @__PURE__ */ new Map();
|
|
104686
|
+
for (const pt2 of points4) {
|
|
104687
|
+
if (!pt2 || typeof pt2 !== "object" || String(pt2["@_type"] ?? "").trim() !== "pres") {
|
|
104688
|
+
continue;
|
|
104689
|
+
}
|
|
104690
|
+
const id = String(pt2["@_modelId"] ?? "").trim();
|
|
104691
|
+
const prSet = prSetOf(pt2, localName292);
|
|
104692
|
+
if (!id || !prSet) {
|
|
104693
|
+
continue;
|
|
104694
|
+
}
|
|
104695
|
+
const styleIndex2 = Number(prSet["@_presStyleIdx"] ?? 0);
|
|
104696
|
+
byId.set(id, {
|
|
104697
|
+
id,
|
|
104698
|
+
name: String(prSet["@_presName"] ?? "").trim(),
|
|
104699
|
+
styleLabel: String(prSet["@_presStyleLbl"] ?? "").trim(),
|
|
104700
|
+
styleIndex: Number.isFinite(styleIndex2) && styleIndex2 > 0 ? Math.floor(styleIndex2) : 0,
|
|
104701
|
+
assocId: String(prSet["@_presAssocID"] ?? "").trim()
|
|
104702
|
+
});
|
|
104703
|
+
}
|
|
104704
|
+
return byId;
|
|
104705
|
+
}
|
|
104706
|
+
function algorithmByLayoutNodeName(root) {
|
|
104707
|
+
const byName = /* @__PURE__ */ new Map();
|
|
104708
|
+
const stack = root ? [root] : [];
|
|
104709
|
+
while (stack.length > 0) {
|
|
104710
|
+
const node = stack.pop();
|
|
104711
|
+
if (node.name && node.algorithm?.type && !byName.has(node.name)) {
|
|
104712
|
+
byName.set(node.name, node.algorithm.type);
|
|
104713
|
+
}
|
|
104714
|
+
stack.push(...node.children ?? []);
|
|
104715
|
+
}
|
|
104716
|
+
return byName;
|
|
104717
|
+
}
|
|
104718
|
+
function resolveSmartArtMergedTextLabels(points4, connections, layout, localName292) {
|
|
104719
|
+
const result = /* @__PURE__ */ new Map();
|
|
104720
|
+
const algorithms = algorithmByLayoutNodeName(layout?.rootNode);
|
|
104721
|
+
const presPoints = readPresPoints(points4, localName292);
|
|
104722
|
+
if (algorithms.size === 0 || presPoints.size === 0) {
|
|
104723
|
+
return result;
|
|
104724
|
+
}
|
|
104725
|
+
const presented = /* @__PURE__ */ new Set();
|
|
104726
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
104727
|
+
for (const connection of connections) {
|
|
104728
|
+
if (connection.type === "presOf") {
|
|
104729
|
+
presented.add(connection.destId);
|
|
104730
|
+
} else if (connection.type === "presParOf") {
|
|
104731
|
+
const siblings = childrenByParent.get(connection.sourceId) ?? [];
|
|
104732
|
+
siblings.push(connection.destId);
|
|
104733
|
+
childrenByParent.set(connection.sourceId, siblings);
|
|
104734
|
+
}
|
|
104735
|
+
}
|
|
104736
|
+
for (const siblingIds of childrenByParent.values()) {
|
|
104737
|
+
const siblings = siblingIds.map((id) => presPoints.get(id)).filter((pt2) => Boolean(pt2?.styleLabel && presented.has(pt2.id)));
|
|
104738
|
+
const texts = siblings.filter((pt2) => algorithms.get(pt2.name) === "tx");
|
|
104739
|
+
for (const shape of siblings) {
|
|
104740
|
+
if (algorithms.get(shape.name) === "tx" || result.has(shape.id)) {
|
|
104741
|
+
continue;
|
|
104742
|
+
}
|
|
104743
|
+
const text22 = texts.find(
|
|
104744
|
+
(pt2) => pt2.assocId === shape.assocId && pt2.styleLabel !== shape.styleLabel
|
|
104745
|
+
);
|
|
104746
|
+
if (text22) {
|
|
104747
|
+
result.set(shape.id, {
|
|
104748
|
+
styleLabel: text22.styleLabel,
|
|
104749
|
+
styleIndex: text22.styleIndex,
|
|
104750
|
+
textPointId: text22.id
|
|
104751
|
+
});
|
|
104752
|
+
}
|
|
104753
|
+
}
|
|
104754
|
+
}
|
|
104755
|
+
return result;
|
|
104756
|
+
}
|
|
104757
|
+
function smartArtMergedTextColor(label, textFillByLabel) {
|
|
104758
|
+
const list2 = textFillByLabel?.[label.styleLabel]?.textFill;
|
|
104759
|
+
if (!list2 || list2.length === 0) {
|
|
104760
|
+
return void 0;
|
|
104761
|
+
}
|
|
104762
|
+
return list2[label.styleIndex % list2.length];
|
|
104763
|
+
}
|
|
104764
|
+
function resolveSmartArtMergedTextColors(points4, connections, layout, textFillByLabel, localName292) {
|
|
104765
|
+
const colors = /* @__PURE__ */ new Map();
|
|
104766
|
+
if (!textFillByLabel) {
|
|
104767
|
+
return colors;
|
|
104768
|
+
}
|
|
104769
|
+
for (const [shapeId, label] of resolveSmartArtMergedTextLabels(
|
|
104770
|
+
points4,
|
|
104771
|
+
connections,
|
|
104772
|
+
layout,
|
|
104773
|
+
localName292
|
|
104774
|
+
)) {
|
|
104775
|
+
const color2 = smartArtMergedTextColor(label, textFillByLabel);
|
|
104776
|
+
if (color2) {
|
|
104777
|
+
colors.set(shapeId, color2);
|
|
104778
|
+
}
|
|
104779
|
+
}
|
|
104780
|
+
return colors;
|
|
104781
|
+
}
|
|
104782
|
+
var init_smartart_merged_text_label = __esm({
|
|
104783
|
+
"src/core/utils/smartart-merged-text-label.ts"() {
|
|
104784
|
+
}
|
|
104785
|
+
});
|
|
104462
104786
|
function children12(node, name, localName292) {
|
|
104463
104787
|
if (!node) {
|
|
104464
104788
|
return [];
|
|
@@ -105958,21 +106282,21 @@ var init_text_body_has_content = __esm({
|
|
|
105958
106282
|
function createAutoNumberSequence() {
|
|
105959
106283
|
return { levels: /* @__PURE__ */ new Map() };
|
|
105960
106284
|
}
|
|
105961
|
-
function forgetFromLevel(sequence,
|
|
106285
|
+
function forgetFromLevel(sequence, level2) {
|
|
105962
106286
|
for (const recorded of sequence.levels.keys()) {
|
|
105963
|
-
if (recorded >=
|
|
106287
|
+
if (recorded >= level2) {
|
|
105964
106288
|
sequence.levels.delete(recorded);
|
|
105965
106289
|
}
|
|
105966
106290
|
}
|
|
105967
106291
|
}
|
|
105968
|
-
function breakAutoNumberRun(sequence,
|
|
105969
|
-
forgetFromLevel(sequence,
|
|
106292
|
+
function breakAutoNumberRun(sequence, level2) {
|
|
106293
|
+
forgetFromLevel(sequence, level2);
|
|
105970
106294
|
}
|
|
105971
|
-
function nextAutoNumber(sequence,
|
|
105972
|
-
const running = sequence.levels.get(
|
|
106295
|
+
function nextAutoNumber(sequence, level2, scheme, startAt) {
|
|
106296
|
+
const running = sequence.levels.get(level2);
|
|
105973
106297
|
const ordinal = running && running.scheme === scheme ? running.ordinal + 1 : startAt;
|
|
105974
|
-
forgetFromLevel(sequence,
|
|
105975
|
-
sequence.levels.set(
|
|
106298
|
+
forgetFromLevel(sequence, level2 + 1);
|
|
106299
|
+
sequence.levels.set(level2, { scheme, ordinal });
|
|
105976
106300
|
return ordinal;
|
|
105977
106301
|
}
|
|
105978
106302
|
var init_auto_number_sequence = __esm({
|
|
@@ -108683,7 +109007,7 @@ function masterStyleFonts(styles) {
|
|
|
108683
109007
|
if (!styles) {
|
|
108684
109008
|
return [];
|
|
108685
109009
|
}
|
|
108686
|
-
return [styles.title, styles.body, styles.other].flatMap((levels) => levels ?? []).map((
|
|
109010
|
+
return [styles.title, styles.body, styles.other].flatMap((levels) => levels ?? []).map((level2) => level2.run.fontName).filter((name) => Boolean(name));
|
|
108687
109011
|
}
|
|
108688
109012
|
var PPT_MASTER_LEVELS;
|
|
108689
109013
|
var TITLE_LEVELS;
|
|
@@ -110369,8 +110693,8 @@ function textSpecInfo(count) {
|
|
|
110369
110693
|
function promptText(textType, paragraphs2) {
|
|
110370
110694
|
const text22 = paragraphs2.join("\r");
|
|
110371
110695
|
const levels = new ByteWriter();
|
|
110372
|
-
paragraphs2.forEach((para,
|
|
110373
|
-
levels.u32(para.length + 1).u16(
|
|
110696
|
+
paragraphs2.forEach((para, level2) => {
|
|
110697
|
+
levels.u32(para.length + 1).u16(level2);
|
|
110374
110698
|
});
|
|
110375
110699
|
return new ByteWriter().bytes(textHeader(textType)).bytes(atom(RT.TextBytesAtom, new ByteWriter().ansi(text22).toBytes())).bytes(atom(RT.MasterTextPropAtom, levels.toBytes())).bytes(textSpecInfo(text22.length + 1)).toBytes();
|
|
110376
110700
|
}
|
|
@@ -110536,9 +110860,9 @@ var init_master_placeholders_writer = __esm({
|
|
|
110536
110860
|
});
|
|
110537
110861
|
function buildMasterStyleAtom(recInstance, levels, fontIndex) {
|
|
110538
110862
|
const w = new ByteWriter().u16(levels.length);
|
|
110539
|
-
for (const
|
|
110540
|
-
writePfException(w,
|
|
110541
|
-
writeCfException(w,
|
|
110863
|
+
for (const level2 of levels) {
|
|
110864
|
+
writePfException(w, level2.paragraph);
|
|
110865
|
+
writeCfException(w, level2.run, fontIndex);
|
|
110542
110866
|
}
|
|
110543
110867
|
return record(RT.TextMasterStyleAtom, w.toBytes(), recInstance, false, 0);
|
|
110544
110868
|
}
|
|
@@ -111594,11 +111918,11 @@ function levelsFor(styles, textType) {
|
|
|
111594
111918
|
return void 0;
|
|
111595
111919
|
}
|
|
111596
111920
|
}
|
|
111597
|
-
function relativiseParagraph(para,
|
|
111921
|
+
function relativiseParagraph(para, level2) {
|
|
111598
111922
|
const runs = para.runs.map((run) => {
|
|
111599
111923
|
const out = { ...run };
|
|
111600
111924
|
for (const key2 of STYLE_KEYS) {
|
|
111601
|
-
const inherited =
|
|
111925
|
+
const inherited = level2?.run[key2] ?? false;
|
|
111602
111926
|
if (out[key2] !== void 0 && out[key2] === inherited) {
|
|
111603
111927
|
delete out[key2];
|
|
111604
111928
|
}
|
|
@@ -112231,9 +112555,9 @@ function buildChartExData(chartData, series, id) {
|
|
|
112231
112555
|
const stringDimensions = [
|
|
112232
112556
|
{
|
|
112233
112557
|
"@_type": "cat",
|
|
112234
|
-
"cx:lvl": categoryLevels.map((
|
|
112235
|
-
"@_ptCount": String(
|
|
112236
|
-
"cx:pt": chartData.chartType === "regionMap" &&
|
|
112558
|
+
"cx:lvl": categoryLevels.map((level2) => ({
|
|
112559
|
+
"@_ptCount": String(level2.length),
|
|
112560
|
+
"cx:pt": chartData.chartType === "regionMap" && level2 === categoryLevels[0] ? indexedPoints(level2, regionOptions?.categorySourceIndices) : points(level2)
|
|
112237
112561
|
}))
|
|
112238
112562
|
}
|
|
112239
112563
|
];
|
|
@@ -115826,10 +116150,10 @@ function replaceLevels(target, source, getLocalName2) {
|
|
|
115826
116150
|
const targetKey = findKey26(target, "lvl", getLocalName2) ?? "cx:lvl";
|
|
115827
116151
|
const sourceKey = findKey26(source, "lvl", getLocalName2);
|
|
115828
116152
|
const oldLevels = asArray4(target[targetKey]);
|
|
115829
|
-
const newLevels = asArray4(sourceKey ? source[sourceKey] : void 0).map((
|
|
116153
|
+
const newLevels = asArray4(sourceKey ? source[sourceKey] : void 0).map((level2, index) => {
|
|
115830
116154
|
const old = oldLevels[index];
|
|
115831
116155
|
if (!old) {
|
|
115832
|
-
return
|
|
116156
|
+
return level2;
|
|
115833
116157
|
}
|
|
115834
116158
|
const merged = {};
|
|
115835
116159
|
for (const key2 of Object.keys(old)) {
|
|
@@ -115837,7 +116161,7 @@ function replaceLevels(target, source, getLocalName2) {
|
|
|
115837
116161
|
merged[key2] = old[key2];
|
|
115838
116162
|
}
|
|
115839
116163
|
}
|
|
115840
|
-
return { ...
|
|
116164
|
+
return { ...level2, ...merged };
|
|
115841
116165
|
});
|
|
115842
116166
|
target[targetKey] = newLevels.length === 1 ? newLevels[0] : newLevels;
|
|
115843
116167
|
}
|
|
@@ -118018,18 +118342,18 @@ var init_uniform_segment_overrides = __esm({
|
|
|
118018
118342
|
"src/core/core/runtime/uniform-segment-overrides.ts"() {
|
|
118019
118343
|
}
|
|
118020
118344
|
});
|
|
118021
|
-
function authoredPropertyGate(authoredProperties,
|
|
118345
|
+
function authoredPropertyGate(authoredProperties, level2) {
|
|
118022
118346
|
if (authoredProperties) {
|
|
118023
118347
|
return (key2) => authoredProperties[key2] !== void 0;
|
|
118024
118348
|
}
|
|
118025
|
-
const isNested = typeof
|
|
118349
|
+
const isNested = typeof level2 === "number" && Number.isFinite(level2) && level2 > 0;
|
|
118026
118350
|
return () => !isNested;
|
|
118027
118351
|
}
|
|
118028
|
-
function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spacing,
|
|
118352
|
+
function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spacing, level2, authoredProperties) {
|
|
118029
118353
|
const paragraphProps = {};
|
|
118030
|
-
const owns = authoredPropertyGate(authoredProperties,
|
|
118031
|
-
if (typeof
|
|
118032
|
-
paragraphProps["@_lvl"] = String(Math.min(Math.max(Math.round(
|
|
118354
|
+
const owns = authoredPropertyGate(authoredProperties, level2);
|
|
118355
|
+
if (typeof level2 === "number" && Number.isFinite(level2) && level2 >= 0) {
|
|
118356
|
+
paragraphProps["@_lvl"] = String(Math.min(Math.max(Math.round(level2), 0), 8));
|
|
118033
118357
|
}
|
|
118034
118358
|
if (paragraphAlign && owns("align")) {
|
|
118035
118359
|
paragraphProps["@_algn"] = paragraphAlign;
|
|
@@ -123339,7 +123663,7 @@ var init_PptxHandlerRuntimeSaveParagraphs = __esm({
|
|
|
123339
123663
|
PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
|
|
123340
123664
|
createParagraphsFromTextContent(text22, textStyle, textSegments, resolveHyperlinkRelationshipId) {
|
|
123341
123665
|
const runScopedTextStyle = toRunScopedTextStyle(textStyle);
|
|
123342
|
-
const createParagraph = (runs, bulletInfo,
|
|
123666
|
+
const createParagraph = (runs, bulletInfo, level2, endParaRunProperties, paragraphProperties2, markup) => {
|
|
123343
123667
|
const effectiveStyle = paragraphProperties2 ? { ...textStyle, ...paragraphProperties2 } : textStyle;
|
|
123344
123668
|
const paragraphAlign = this.textAlignToDrawingValue(effectiveStyle?.align);
|
|
123345
123669
|
const spacing = {
|
|
@@ -123353,7 +123677,7 @@ var init_PptxHandlerRuntimeSaveParagraphs = __esm({
|
|
|
123353
123677
|
paragraphAlign,
|
|
123354
123678
|
bulletInfo,
|
|
123355
123679
|
spacing,
|
|
123356
|
-
|
|
123680
|
+
level2,
|
|
123357
123681
|
paragraphProperties2
|
|
123358
123682
|
);
|
|
123359
123683
|
return assembleParagraphXml(runs, paragraphProps, endParaRunProperties, markup);
|
|
@@ -129204,20 +129528,20 @@ var init_smartart_colors_builder = __esm({
|
|
|
129204
129528
|
]);
|
|
129205
129529
|
}
|
|
129206
129530
|
});
|
|
129207
|
-
function
|
|
129531
|
+
function prSetOf2(pt2) {
|
|
129208
129532
|
const prSet = pt2["dgm:prSet"];
|
|
129209
129533
|
return prSet && typeof prSet === "object" && !Array.isArray(prSet) ? prSet : {};
|
|
129210
129534
|
}
|
|
129211
129535
|
function findPresPointForAssoc(pts, assocId) {
|
|
129212
129536
|
return pts.find(
|
|
129213
|
-
(pt2) => pt2["@_type"] === "pres" && String(
|
|
129537
|
+
(pt2) => pt2["@_type"] === "pres" && String(prSetOf2(pt2)["@_presAssocID"] || "") === assocId
|
|
129214
129538
|
);
|
|
129215
129539
|
}
|
|
129216
129540
|
function maxPresParOfOrd(cxns, srcId) {
|
|
129217
129541
|
return cxns.filter((c) => c["@_type"] === "presParOf" && c["@_srcId"] === srcId).reduce((max, c) => Math.max(max, parseInt(String(c["@_srcOrd"] ?? ""), 10) || 0), -1);
|
|
129218
129542
|
}
|
|
129219
129543
|
function countNodePresPoints(pts) {
|
|
129220
|
-
return pts.filter((pt2) => pt2["@_type"] === "pres" &&
|
|
129544
|
+
return pts.filter((pt2) => pt2["@_type"] === "pres" && prSetOf2(pt2)["@_presName"] === "node").length;
|
|
129221
129545
|
}
|
|
129222
129546
|
function emptyTextBody() {
|
|
129223
129547
|
return { "a:bodyPr": {}, "a:lstStyle": {}, "a:p": { "a:endParaRPr": { "@_lang": "en-US" } } };
|
|
@@ -129327,8 +129651,8 @@ function synthesizeNewSmartArtStructuralPoints(existingPts, existingCxns, nodes,
|
|
|
129327
129651
|
pts.push(buildPresSibTransPoint(presSibTransId, sibTransId));
|
|
129328
129652
|
const total = idx + 1;
|
|
129329
129653
|
for (const pt2 of pts) {
|
|
129330
|
-
if (pt2["@_type"] === "pres" &&
|
|
129331
|
-
|
|
129654
|
+
if (pt2["@_type"] === "pres" && prSetOf2(pt2)["@_presName"] === "node") {
|
|
129655
|
+
prSetOf2(pt2)["@_presStyleCnt"] = String(total);
|
|
129332
129656
|
}
|
|
129333
129657
|
}
|
|
129334
129658
|
const srcOrd = connectionByChildId.get(node.id)?.srcOrd ?? 0;
|
|
@@ -138248,8 +138572,8 @@ var init_PptxHandlerRuntimePlaceholderLookup = __esm({
|
|
|
138248
138572
|
mergePlaceholderLevelStyles(base, override) {
|
|
138249
138573
|
const merged = {};
|
|
138250
138574
|
for (const key2 of /* @__PURE__ */ new Set([...Object.keys(base ?? {}), ...Object.keys(override ?? {})])) {
|
|
138251
|
-
const
|
|
138252
|
-
merged[
|
|
138575
|
+
const level2 = Number.parseInt(key2, 10);
|
|
138576
|
+
merged[level2] = { ...base?.[level2], ...override?.[level2] };
|
|
138253
138577
|
}
|
|
138254
138578
|
return merged;
|
|
138255
138579
|
}
|
|
@@ -139161,8 +139485,8 @@ var init_PptxHandlerRuntimeBulletParsing = __esm({
|
|
|
139161
139485
|
...paragraphProps?.["a:buSzTx"] !== void 0 ? { sizeInherit: true } : {}
|
|
139162
139486
|
};
|
|
139163
139487
|
}
|
|
139164
|
-
const
|
|
139165
|
-
const normalizedLevel = Number.isFinite(
|
|
139488
|
+
const level2 = Number.parseInt(String(paragraphProps?.["@_lvl"] || "0"), 10);
|
|
139489
|
+
const normalizedLevel = Number.isFinite(level2) ? Math.min(Math.max(level2 + 1, 1), 9) : 1;
|
|
139166
139490
|
const levelKey = `a:lvl${normalizedLevel}pPr`;
|
|
139167
139491
|
const inheritedLevelProps = xmlChild(xmlChild(inheritedTxBody, "a:lstStyle"), levelKey);
|
|
139168
139492
|
const bodyLevelProps = xmlChild(xmlChild(txBody, "a:lstStyle"), levelKey);
|
|
@@ -139723,8 +140047,8 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
|
|
|
139723
140047
|
p["a:pPr"]
|
|
139724
140048
|
);
|
|
139725
140049
|
const parsedLevel = Number.parseInt(String(directPPr?.["@_lvl"] ?? "0"), 10);
|
|
139726
|
-
const
|
|
139727
|
-
const levelKey = `a:lvl${
|
|
140050
|
+
const level2 = Number.isFinite(parsedLevel) ? Math.min(Math.max(parsedLevel, 0), 8) : 0;
|
|
140051
|
+
const levelKey = `a:lvl${level2 + 1}pPr`;
|
|
139728
140052
|
const ownLstStyle = ctx.txBody?.["a:lstStyle"];
|
|
139729
140053
|
const inheritedLstStyle = ctx.inheritedTxBody?.["a:lstStyle"];
|
|
139730
140054
|
const lstStyleParagraphDefaults = this.mergeXmlObjects(
|
|
@@ -139742,7 +140066,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
|
|
|
139742
140066
|
if (paragraphRtl !== void 0 && textStyle.rtl === void 0) {
|
|
139743
140067
|
textStyle.rtl = paragraphRtl;
|
|
139744
140068
|
}
|
|
139745
|
-
const ownPlaceholderAlignment = ctx.effectiveLevelStyles?.[
|
|
140069
|
+
const ownPlaceholderAlignment = ctx.effectiveLevelStyles?.[level2]?.alignment ?? ctx.effectiveLevelStyles?.[-1]?.alignment;
|
|
139746
140070
|
const paraAlign = resolveParagraphAlignment(
|
|
139747
140071
|
pPr?.["@_algn"],
|
|
139748
140072
|
ownPlaceholderAlignment,
|
|
@@ -139870,7 +140194,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
|
|
|
139870
140194
|
mergedDefaultRunStyle.fontFamily = ctx.styleFontRefTypeface;
|
|
139871
140195
|
}
|
|
139872
140196
|
if (ctx.effectiveLevelStyles) {
|
|
139873
|
-
const phLevel = ctx.effectiveLevelStyles[
|
|
140197
|
+
const phLevel = ctx.effectiveLevelStyles[level2];
|
|
139874
140198
|
const phBase = ctx.effectiveLevelStyles[-1];
|
|
139875
140199
|
const runOwnRtl = mergedDefaultRunStyle.rtl;
|
|
139876
140200
|
if (phLevel) {
|
|
@@ -139890,7 +140214,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
|
|
|
139890
140214
|
let effectiveMarginLeft = parMarginLeft;
|
|
139891
140215
|
let effectiveIndent = parIndent;
|
|
139892
140216
|
if (ctx.effectiveLevelStyles) {
|
|
139893
|
-
const phLevel = ctx.effectiveLevelStyles[
|
|
140217
|
+
const phLevel = ctx.effectiveLevelStyles[level2];
|
|
139894
140218
|
const phBase = ctx.effectiveLevelStyles[-1];
|
|
139895
140219
|
if (effectiveMarginLeft === void 0) {
|
|
139896
140220
|
effectiveMarginLeft = phLevel?.marginLeft ?? phBase?.marginLeft;
|
|
@@ -143264,12 +143588,12 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
|
|
|
143264
143588
|
return;
|
|
143265
143589
|
}
|
|
143266
143590
|
const levelStyles = {};
|
|
143267
|
-
for (let
|
|
143591
|
+
for (let level2 = 1; level2 <= 9; level2++) {
|
|
143268
143592
|
const parsed = this.parsePlaceholderLevelStyle(
|
|
143269
|
-
defaultTextStyle[`a:lvl${
|
|
143593
|
+
defaultTextStyle[`a:lvl${level2}pPr`]
|
|
143270
143594
|
);
|
|
143271
143595
|
if (parsed) {
|
|
143272
|
-
levelStyles[
|
|
143596
|
+
levelStyles[level2 - 1] = parsed;
|
|
143273
143597
|
}
|
|
143274
143598
|
}
|
|
143275
143599
|
const defaultLevel = this.parsePlaceholderLevelStyle(
|
|
@@ -146312,7 +146636,7 @@ var init_PptxHandlerRuntimeSmartArtParsing = __esm({
|
|
|
146312
146636
|
return [];
|
|
146313
146637
|
}
|
|
146314
146638
|
}
|
|
146315
|
-
parseDrawingShape(sp, index, emuPerPx) {
|
|
146639
|
+
parseDrawingShape(sp, index, emuPerPx, mergedTextColor) {
|
|
146316
146640
|
const spPr = this.xmlLookupService.getChildByLocalName(sp, "spPr");
|
|
146317
146641
|
if (!spPr) {
|
|
146318
146642
|
return null;
|
|
@@ -146373,7 +146697,7 @@ var init_PptxHandlerRuntimeSmartArtParsing = __esm({
|
|
|
146373
146697
|
}
|
|
146374
146698
|
const text22 = textValues2.join("").trim() || void 0;
|
|
146375
146699
|
const textStyle = extractDrawingShapeTextStyle(txBody, this.drawingShapeStyleDeps(), emuPerPx);
|
|
146376
|
-
textStyle.fontColor ??= extractDrawingShapeFontRefColor(sp, this.drawingShapeStyleDeps());
|
|
146700
|
+
textStyle.fontColor ??= mergedTextColor ?? extractDrawingShapeFontRefColor(sp, this.drawingShapeStyleDeps());
|
|
146377
146701
|
const { fontSize, fontColor } = textStyle;
|
|
146378
146702
|
const txXfrm = this.xmlLookupService.getChildByLocalName(sp, "txXfrm");
|
|
146379
146703
|
const txOff = this.xmlLookupService.getChildByLocalName(txXfrm, "off");
|
|
@@ -146601,6 +146925,7 @@ var PptxHandlerRuntime89;
|
|
|
146601
146925
|
var init_PptxHandlerRuntimeSmartArt = __esm({
|
|
146602
146926
|
"src/core/core/runtime/PptxHandlerRuntimeSmartArt.ts"() {
|
|
146603
146927
|
init_utils();
|
|
146928
|
+
init_smartart_merged_text_label();
|
|
146604
146929
|
init_smartart_point_metadata();
|
|
146605
146930
|
init_smartart_pres_layout_vars();
|
|
146606
146931
|
init_smart_art_text_helpers();
|
|
@@ -146699,7 +147024,16 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
|
|
|
146699
147024
|
diagramDataRelationshipId,
|
|
146700
147025
|
drawingExtensionRelId
|
|
146701
147026
|
);
|
|
146702
|
-
const drawingShapes = drawingResolution ? await this.parseSmartArtDrawingShapesFromPath(
|
|
147027
|
+
const drawingShapes = drawingResolution ? await this.parseSmartArtDrawingShapesFromPath(
|
|
147028
|
+
drawingResolution.path,
|
|
147029
|
+
resolveSmartArtMergedTextColors(
|
|
147030
|
+
points4,
|
|
147031
|
+
parsedConnections,
|
|
147032
|
+
layoutDefinition,
|
|
147033
|
+
colorTransform?.roleColors,
|
|
147034
|
+
localName292
|
|
147035
|
+
)
|
|
147036
|
+
) : [];
|
|
146703
147037
|
const drawingRelationshipId = drawingResolution?.relId;
|
|
146704
147038
|
const styleRelationshipId = parsedRelationshipIds?.styleRelId ?? "";
|
|
146705
147039
|
const quickStyle = await this.parseSmartArtQuickStyle(slidePath, styleRelationshipId);
|
|
@@ -146806,17 +147140,22 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
|
|
|
146806
147140
|
* resolves picture (blip) fills to data URLs via the drawing part's own
|
|
146807
147141
|
* relationships. Delegates to a pure helper with an injected dep bundle.
|
|
146808
147142
|
*/
|
|
146809
|
-
async parseSmartArtDrawingShapesFromPath(drawingPath) {
|
|
146810
|
-
return parseDrawingShapesFromPart(drawingPath, this.drawingBlipDeps());
|
|
147143
|
+
async parseSmartArtDrawingShapesFromPath(drawingPath, mergedTextColors) {
|
|
147144
|
+
return parseDrawingShapesFromPart(drawingPath, this.drawingBlipDeps(mergedTextColors));
|
|
146811
147145
|
}
|
|
146812
147146
|
/** Bind runtime zip / parser / lookup / image helpers for the drawing parser. */
|
|
146813
|
-
drawingBlipDeps() {
|
|
147147
|
+
drawingBlipDeps(mergedTextColors) {
|
|
146814
147148
|
return {
|
|
146815
147149
|
readText: (path) => this.zip.file(path)?.async("string") ?? Promise.resolve(void 0),
|
|
146816
147150
|
parse: (xml) => this.parser.parse(xml),
|
|
146817
147151
|
getChild: (node, local) => this.xmlLookupService.getChildByLocalName(node, local),
|
|
146818
147152
|
getChildren: (node, local) => this.xmlLookupService.getChildrenArrayByLocalName(node, local),
|
|
146819
|
-
parseDrawingShape: (sp, index, emuPerPx) => this.parseDrawingShape(
|
|
147153
|
+
parseDrawingShape: (sp, index, emuPerPx) => this.parseDrawingShape(
|
|
147154
|
+
sp,
|
|
147155
|
+
index,
|
|
147156
|
+
emuPerPx,
|
|
147157
|
+
mergedTextColors?.get(String(sp["@_modelId"] ?? ""))
|
|
147158
|
+
),
|
|
146820
147159
|
emuPerPx: _PptxHandlerRuntime.EMU_PER_PX,
|
|
146821
147160
|
ensureArray: (value) => this.ensureArray(value),
|
|
146822
147161
|
resolveImagePath: (base, target) => this.resolveImagePath(base, target),
|
|
@@ -149589,7 +149928,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
|
|
|
149589
149928
|
},
|
|
149590
149929
|
placeholderType: (element) => this.getElementPlaceholderInfo(element)?.type,
|
|
149591
149930
|
applyBodyDefaults: (textStyle, defaults) => this.applyPlaceholderBodyDefaults(textStyle, defaults),
|
|
149592
|
-
applyLevelDefaults: (textStyle,
|
|
149931
|
+
applyLevelDefaults: (textStyle, level2) => this.applyPlaceholderLevelDefaults(textStyle, level2)
|
|
149593
149932
|
}
|
|
149594
149933
|
);
|
|
149595
149934
|
const sldLayout = layoutXml["p:sldLayout"];
|
|
@@ -151659,38 +151998,38 @@ function parseMasterStyleAtom(view, rec, scheme, fonts) {
|
|
|
151659
151998
|
break;
|
|
151660
151999
|
}
|
|
151661
152000
|
pos2 = cf.next;
|
|
151662
|
-
const
|
|
152001
|
+
const level2 = {};
|
|
151663
152002
|
if (cf.props.sizePt !== void 0) {
|
|
151664
|
-
|
|
152003
|
+
level2.sizePt = cf.props.sizePt;
|
|
151665
152004
|
}
|
|
151666
152005
|
if (cf.props.bold !== void 0) {
|
|
151667
|
-
|
|
152006
|
+
level2.bold = cf.props.bold;
|
|
151668
152007
|
}
|
|
151669
152008
|
if (cf.props.colorRgb !== void 0) {
|
|
151670
|
-
|
|
152009
|
+
level2.colorRgb = cf.props.colorRgb;
|
|
151671
152010
|
}
|
|
151672
152011
|
if (cf.props.fontRef !== void 0 && fonts[cf.props.fontRef]) {
|
|
151673
|
-
|
|
152012
|
+
level2.fontName = fonts[cf.props.fontRef];
|
|
151674
152013
|
}
|
|
151675
152014
|
if (pf.props.align !== void 0) {
|
|
151676
|
-
|
|
152015
|
+
level2.align = pf.props.align;
|
|
151677
152016
|
}
|
|
151678
152017
|
if (pf.props.hasBullet !== void 0) {
|
|
151679
|
-
|
|
152018
|
+
level2.hasBullet = pf.props.hasBullet;
|
|
151680
152019
|
}
|
|
151681
152020
|
if (pf.props.bulletChar !== void 0) {
|
|
151682
|
-
|
|
152021
|
+
level2.bulletChar = pf.props.bulletChar;
|
|
151683
152022
|
}
|
|
151684
152023
|
if (pf.props.bulletFontRef !== void 0 && fonts[pf.props.bulletFontRef]) {
|
|
151685
|
-
|
|
152024
|
+
level2.bulletFontName = fonts[pf.props.bulletFontRef];
|
|
151686
152025
|
}
|
|
151687
152026
|
if (pf.props.leftMarginMu !== void 0) {
|
|
151688
|
-
|
|
152027
|
+
level2.marginLeftEmu = masterToEmu(pf.props.leftMarginMu);
|
|
151689
152028
|
}
|
|
151690
152029
|
if (pf.props.indentMu !== void 0) {
|
|
151691
|
-
|
|
152030
|
+
level2.indentEmu = masterToEmu(pf.props.indentMu);
|
|
151692
152031
|
}
|
|
151693
|
-
levels.push(
|
|
152032
|
+
levels.push(level2);
|
|
151694
152033
|
}
|
|
151695
152034
|
return levels;
|
|
151696
152035
|
}
|
|
@@ -152270,28 +152609,28 @@ var init_shape_writer2 = __esm({
|
|
|
152270
152609
|
init_xml_utils();
|
|
152271
152610
|
}
|
|
152272
152611
|
});
|
|
152273
|
-
function levelXml(tag,
|
|
152612
|
+
function levelXml(tag, level2, fallbackSizePt) {
|
|
152274
152613
|
const attrs3 = [];
|
|
152275
|
-
if (
|
|
152276
|
-
attrs3.push(`marL="${emu(
|
|
152614
|
+
if (level2.marginLeftEmu !== void 0) {
|
|
152615
|
+
attrs3.push(`marL="${emu(level2.marginLeftEmu)}"`);
|
|
152277
152616
|
}
|
|
152278
|
-
if (
|
|
152279
|
-
attrs3.push(`indent="${-Math.abs(emu(
|
|
152617
|
+
if (level2.indentEmu !== void 0) {
|
|
152618
|
+
attrs3.push(`indent="${-Math.abs(emu(level2.indentEmu))}"`);
|
|
152280
152619
|
}
|
|
152281
|
-
attrs3.push(`algn="${
|
|
152620
|
+
attrs3.push(`algn="${level2.align ?? "l"}"`);
|
|
152282
152621
|
let bullet = "";
|
|
152283
|
-
if (
|
|
152622
|
+
if (level2.hasBullet === false) {
|
|
152284
152623
|
bullet = "<a:buNone/>";
|
|
152285
|
-
} else if (
|
|
152286
|
-
if (
|
|
152287
|
-
bullet += `<a:buFont typeface="${esc(
|
|
152624
|
+
} else if (level2.hasBullet === true || level2.bulletChar !== void 0) {
|
|
152625
|
+
if (level2.bulletFontName !== void 0) {
|
|
152626
|
+
bullet += `<a:buFont typeface="${esc(level2.bulletFontName)}"/>`;
|
|
152288
152627
|
}
|
|
152289
|
-
bullet += `<a:buChar char="${esc(
|
|
152628
|
+
bullet += `<a:buChar char="${esc(level2.bulletChar ?? "\u2022")}"/>`;
|
|
152290
152629
|
}
|
|
152291
|
-
const size = Math.round((
|
|
152292
|
-
const bold =
|
|
152293
|
-
const color2 =
|
|
152294
|
-
const font =
|
|
152630
|
+
const size = Math.round((level2.sizePt ?? fallbackSizePt) * 100);
|
|
152631
|
+
const bold = level2.bold ? ' b="1"' : "";
|
|
152632
|
+
const color2 = level2.colorRgb !== void 0 ? solidFill(level2.colorRgb) : '<a:solidFill><a:schemeClr val="tx1"/></a:solidFill>';
|
|
152633
|
+
const font = level2.fontName !== void 0 ? `<a:latin typeface="${esc(level2.fontName)}"/>` : '<a:latin typeface="+mn-lt"/>';
|
|
152295
152634
|
const defRPr = `<a:defRPr sz="${size}" kern="1200"${bold}>${color2}${font}</a:defRPr>`;
|
|
152296
152635
|
return `<a:${tag} ${attrs3.join(" ")}>${bullet}${defRPr}</a:${tag}>`;
|
|
152297
152636
|
}
|
|
@@ -164976,16 +165315,16 @@ var SmartArtElementProcessor = class {
|
|
|
164976
165315
|
}
|
|
164977
165316
|
return roots.length > 0 ? roots : [...nodeMap.values()];
|
|
164978
165317
|
}
|
|
164979
|
-
renderNestedList(nodes,
|
|
165318
|
+
renderNestedList(nodes, level2) {
|
|
164980
165319
|
const lines = [];
|
|
164981
|
-
const indent = " ".repeat(
|
|
165320
|
+
const indent = " ".repeat(level2);
|
|
164982
165321
|
for (const node of nodes) {
|
|
164983
165322
|
const text22 = node.text.trim();
|
|
164984
165323
|
if (text22) {
|
|
164985
165324
|
lines.push(`${indent}- ${text22}`);
|
|
164986
165325
|
}
|
|
164987
165326
|
if (node.children && node.children.length > 0) {
|
|
164988
|
-
lines.push(this.renderNestedList(node.children,
|
|
165327
|
+
lines.push(this.renderNestedList(node.children, level2 + 1));
|
|
164989
165328
|
}
|
|
164990
165329
|
}
|
|
164991
165330
|
return lines.join("\n");
|
|
@@ -166922,19 +167261,19 @@ var TextSegmentRenderer = class {
|
|
|
166922
167261
|
if (!options.disableLists && !options.inlineMode) {
|
|
166923
167262
|
const bullet = group2.segments.find((segment) => Boolean(segment.bulletInfo))?.bulletInfo;
|
|
166924
167263
|
if (bullet && !bullet.none) {
|
|
166925
|
-
const
|
|
167264
|
+
const level2 = resolveListLevel(bullet, group2.index, options.paragraphIndents);
|
|
166926
167265
|
const marker = resolveListMarker(bullet, group2.index);
|
|
166927
167266
|
const alreadyNumbered = bullet.autoNumType && /^\d+[.)]\s/.test(rawText);
|
|
166928
167267
|
const prefix = alreadyNumbered ? "" : `${marker} `;
|
|
166929
167268
|
if (options.htmlFormatting) {
|
|
166930
|
-
const pad23 =
|
|
167269
|
+
const pad23 = level2 * 1.5;
|
|
166931
167270
|
return {
|
|
166932
167271
|
text: `<div style="padding-left:${pad23}em">${prefix}${rawText}</div>`,
|
|
166933
167272
|
isListItem: true
|
|
166934
167273
|
};
|
|
166935
167274
|
}
|
|
166936
167275
|
return {
|
|
166937
|
-
text: `${" ".repeat(
|
|
167276
|
+
text: `${" ".repeat(level2)}${prefix}${rawText}`,
|
|
166938
167277
|
isListItem: true
|
|
166939
167278
|
};
|
|
166940
167279
|
}
|
|
@@ -169209,7 +169548,7 @@ function dataLabelBox(label) {
|
|
|
169209
169548
|
const y = centred2 ? label.y - h2 / 2 : label.y - label.fontSize * ASCENT - DATA_LABEL_PAD_Y;
|
|
169210
169549
|
return { x, y, w, h: h2 };
|
|
169211
169550
|
}
|
|
169212
|
-
var
|
|
169551
|
+
var PX_PER_PT7;
|
|
169213
169552
|
var DATA_LABEL_PAD_X;
|
|
169214
169553
|
var DATA_LABEL_PAD_Y;
|
|
169215
169554
|
var DATA_LABEL_LINE_HEIGHT;
|
|
@@ -169217,9 +169556,9 @@ var ASCENT;
|
|
|
169217
169556
|
var canvasContext;
|
|
169218
169557
|
var init_chart_label_measure = __esm2({
|
|
169219
169558
|
"src/render/chart-label-measure.ts"() {
|
|
169220
|
-
|
|
169221
|
-
DATA_LABEL_PAD_X = 3 *
|
|
169222
|
-
DATA_LABEL_PAD_Y = 1.5 *
|
|
169559
|
+
PX_PER_PT7 = 4 / 3;
|
|
169560
|
+
DATA_LABEL_PAD_X = 3 * PX_PER_PT7;
|
|
169561
|
+
DATA_LABEL_PAD_Y = 1.5 * PX_PER_PT7;
|
|
169223
169562
|
DATA_LABEL_LINE_HEIGHT = 1.2207;
|
|
169224
169563
|
ASCENT = 0.952;
|
|
169225
169564
|
}
|
|
@@ -171214,8 +171553,8 @@ function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceInd
|
|
|
171214
171553
|
const fontPx = axis?.fontSize !== void 0 ? chartFontPx(axis.fontSize) : DEFAULT_CHART_TEXT_PX;
|
|
171215
171554
|
const bandHeight = Math.max(fontPx, 8) + 4;
|
|
171216
171555
|
const baselineShift = labelsAbove ? -0.2 * fontPx : 0.8 * fontPx;
|
|
171217
|
-
return levels.flatMap((
|
|
171218
|
-
const values = sourceIndices2.map((sourceIndex) =>
|
|
171556
|
+
return levels.flatMap((level2, levelIndex) => {
|
|
171557
|
+
const values = sourceIndices2.map((sourceIndex) => level2[sourceIndex] ?? "");
|
|
171219
171558
|
return groupedLabels(values).flatMap((group2) => {
|
|
171220
171559
|
if (!group2.text || group2.start % skip !== 0) {
|
|
171221
171560
|
return [];
|
|
@@ -171344,7 +171683,7 @@ function chartDataInCategoryOrder(chartData, sourceIndices2) {
|
|
|
171344
171683
|
...chartData,
|
|
171345
171684
|
categories: sourceIndices2.map((sourceIndex) => chartData.categories[sourceIndex] ?? ""),
|
|
171346
171685
|
categoryLevels: chartData.categoryLevels?.map(
|
|
171347
|
-
(
|
|
171686
|
+
(level2) => sourceIndices2.map((sourceIndex) => level2[sourceIndex] ?? "")
|
|
171348
171687
|
),
|
|
171349
171688
|
series: chartData.series.map((series) => ({
|
|
171350
171689
|
...series,
|
|
@@ -175508,12 +175847,12 @@ function computeSunburstArcs(series, cx, cy, maxR, colorPalette) {
|
|
|
175508
175847
|
}
|
|
175509
175848
|
return out;
|
|
175510
175849
|
}
|
|
175511
|
-
function hierarchyKey(levels,
|
|
175512
|
-
return levels.slice(
|
|
175850
|
+
function hierarchyKey(levels, level2, index) {
|
|
175851
|
+
return levels.slice(level2).map((labels) => labels[index] ?? "").join("\0");
|
|
175513
175852
|
}
|
|
175514
175853
|
function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, colorPalette) {
|
|
175515
|
-
const levels = categoryLevels.filter((
|
|
175516
|
-
const leafCount = Math.max(values.length, ...levels.map((
|
|
175854
|
+
const levels = categoryLevels.filter((level2) => level2.length > 0);
|
|
175855
|
+
const leafCount = Math.max(values.length, ...levels.map((level2) => level2.length), 0);
|
|
175517
175856
|
if (levels.length === 0 || leafCount === 0) {
|
|
175518
175857
|
return [];
|
|
175519
175858
|
}
|
|
@@ -175528,15 +175867,15 @@ function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, c
|
|
|
175528
175867
|
const rootLabels = levels[levels.length - 1] ?? [];
|
|
175529
175868
|
const rootColors = /* @__PURE__ */ new Map();
|
|
175530
175869
|
const out = [];
|
|
175531
|
-
for (let
|
|
175532
|
-
const ringIndex = levels.length - 1 -
|
|
175870
|
+
for (let level2 = levels.length - 1; level2 >= 0; level2--) {
|
|
175871
|
+
const ringIndex = levels.length - 1 - level2;
|
|
175533
175872
|
const innerRadius = ringWidth * (ringIndex + 0.5);
|
|
175534
175873
|
const outerRadius = ringWidth * (ringIndex + 1.5);
|
|
175535
175874
|
let start = 0;
|
|
175536
175875
|
while (start < leafCount) {
|
|
175537
|
-
const key2 = hierarchyKey(levels,
|
|
175876
|
+
const key2 = hierarchyKey(levels, level2, start);
|
|
175538
175877
|
let end = start + 1;
|
|
175539
|
-
while (end < leafCount && hierarchyKey(levels,
|
|
175878
|
+
while (end < leafCount && hierarchyKey(levels, level2, end) === key2) {
|
|
175540
175879
|
end++;
|
|
175541
175880
|
}
|
|
175542
175881
|
const startAngle = -Math.PI / 2 + prefix[start] / total * Math.PI * 2;
|
|
@@ -175550,8 +175889,8 @@ function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, c
|
|
|
175550
175889
|
fill: paletteColor2(rootColors.get(rootLabel) ?? start, colorPalette),
|
|
175551
175890
|
opacity: Math.max(0.1, 0.9 - ringIndex * 0.1),
|
|
175552
175891
|
level: ringIndex,
|
|
175553
|
-
label: levels[
|
|
175554
|
-
...
|
|
175892
|
+
label: levels[level2][start] ?? "",
|
|
175893
|
+
...level2 === 0 && end === start + 1 ? { pointIndex: start } : {},
|
|
175555
175894
|
...arcLabelPlacement(cx, cy, (innerRadius + outerRadius) / 2, startAngle, endAngle)
|
|
175556
175895
|
});
|
|
175557
175896
|
start = end;
|
|
@@ -176700,10 +177039,10 @@ var init_chart_treemap_squarify = __esm2({
|
|
|
176700
177039
|
}
|
|
176701
177040
|
});
|
|
176702
177041
|
function normalizedLevels(levels, pointCount2) {
|
|
176703
|
-
return levels.map((
|
|
177042
|
+
return levels.map((level2) => {
|
|
176704
177043
|
let previous = "";
|
|
176705
177044
|
return Array.from({ length: pointCount2 }, (_, index) => {
|
|
176706
|
-
const label =
|
|
177045
|
+
const label = level2[index]?.trim() ?? "";
|
|
176707
177046
|
if (label) {
|
|
176708
177047
|
previous = label;
|
|
176709
177048
|
}
|
|
@@ -185439,6 +185778,75 @@ var init_chart_3d_view_scene = __esm2({
|
|
|
185439
185778
|
init_surface_chart_3d_scene();
|
|
185440
185779
|
}
|
|
185441
185780
|
});
|
|
185781
|
+
function isSmartArt3DGlassMaterial(material) {
|
|
185782
|
+
return material === "clear";
|
|
185783
|
+
}
|
|
185784
|
+
function smartArt3DSurfaceAlpha(material, opacity2, facing) {
|
|
185785
|
+
if (!isSmartArt3DGlassMaterial(material)) {
|
|
185786
|
+
return opacity2;
|
|
185787
|
+
}
|
|
185788
|
+
const tilt = 1 - Math.max(0, Math.min(1, facing));
|
|
185789
|
+
const share = CLEAR_FACE_ALPHA + CLEAR_EDGE_GAIN * tilt ** CLEAR_EDGE_EXPONENT;
|
|
185790
|
+
return Math.max(0, Math.min(1, opacity2 * share));
|
|
185791
|
+
}
|
|
185792
|
+
function smartArt3DVertexAlphas(positions2, normals, material, opacity2, eye) {
|
|
185793
|
+
const out = new Float32Array(positions2.length / 3);
|
|
185794
|
+
for (let i2 = 0, v = 0; i2 < positions2.length; i2 += 3, v++) {
|
|
185795
|
+
let view = { x: 0, y: 0, z: 1 };
|
|
185796
|
+
if (eye) {
|
|
185797
|
+
const dx = eye.x - positions2[i2];
|
|
185798
|
+
const dy = eye.y - positions2[i2 + 1];
|
|
185799
|
+
const dz = eye.z - positions2[i2 + 2];
|
|
185800
|
+
const len = Math.hypot(dx, dy, dz) || 1;
|
|
185801
|
+
view = { x: dx / len, y: dy / len, z: dz / len };
|
|
185802
|
+
}
|
|
185803
|
+
const facing = normals[i2] * view.x + normals[i2 + 1] * view.y + normals[i2 + 2] * view.z;
|
|
185804
|
+
out[v] = smartArt3DSurfaceAlpha(material, opacity2, facing);
|
|
185805
|
+
}
|
|
185806
|
+
return out;
|
|
185807
|
+
}
|
|
185808
|
+
function orientSmartArt3DTriangles(triangles) {
|
|
185809
|
+
const { positions: p, normals: n } = triangles;
|
|
185810
|
+
for (let t = 0; t + 9 <= p.length; t += 9) {
|
|
185811
|
+
const ux = p[t + 3] - p[t];
|
|
185812
|
+
const uy = p[t + 4] - p[t + 1];
|
|
185813
|
+
const uz = p[t + 5] - p[t + 2];
|
|
185814
|
+
const vx = p[t + 6] - p[t];
|
|
185815
|
+
const vy = p[t + 7] - p[t + 1];
|
|
185816
|
+
const vz = p[t + 8] - p[t + 2];
|
|
185817
|
+
const cx = uy * vz - uz * vy;
|
|
185818
|
+
const cy = uz * vx - ux * vz;
|
|
185819
|
+
const cz = ux * vy - uy * vx;
|
|
185820
|
+
const nx = n[t] + n[t + 3] + n[t + 6];
|
|
185821
|
+
const ny = n[t + 1] + n[t + 4] + n[t + 7];
|
|
185822
|
+
const nz = n[t + 2] + n[t + 5] + n[t + 8];
|
|
185823
|
+
if (cx * nx + cy * ny + cz * nz < 0) {
|
|
185824
|
+
for (const arr of [p, n]) {
|
|
185825
|
+
for (let c = 0; c < 3; c++) {
|
|
185826
|
+
const b = arr[t + 3 + c];
|
|
185827
|
+
arr[t + 3 + c] = arr[t + 6 + c];
|
|
185828
|
+
arr[t + 6 + c] = b;
|
|
185829
|
+
}
|
|
185830
|
+
}
|
|
185831
|
+
}
|
|
185832
|
+
}
|
|
185833
|
+
}
|
|
185834
|
+
function isSmartArt3DTranslucentMesh(mesh) {
|
|
185835
|
+
return !mesh.fillNone && (mesh.opacity < 1 || isSmartArt3DGlassMaterial(mesh.solid?.material));
|
|
185836
|
+
}
|
|
185837
|
+
function smartArt3DGlassLightModel(model) {
|
|
185838
|
+
return { ...model, ambient: 1, diffuse: 0 };
|
|
185839
|
+
}
|
|
185840
|
+
var CLEAR_FACE_ALPHA;
|
|
185841
|
+
var CLEAR_EDGE_GAIN;
|
|
185842
|
+
var CLEAR_EDGE_EXPONENT;
|
|
185843
|
+
var init_smartart_3d_translucency = __esm2({
|
|
185844
|
+
"src/render/smartart-3d-translucency.ts"() {
|
|
185845
|
+
CLEAR_FACE_ALPHA = 0.2;
|
|
185846
|
+
CLEAR_EDGE_GAIN = 2;
|
|
185847
|
+
CLEAR_EDGE_EXPONENT = 1;
|
|
185848
|
+
}
|
|
185849
|
+
});
|
|
185442
185850
|
function buildTextBlockTexture(three, block) {
|
|
185443
185851
|
if (typeof document === "undefined" || block.lines.every((l) => l.text.length === 0)) {
|
|
185444
185852
|
return null;
|
|
@@ -185950,19 +186358,45 @@ function buildGradientTexture(three, gradient) {
|
|
|
185950
186358
|
texture.needsUpdate = true;
|
|
185951
186359
|
return texture;
|
|
185952
186360
|
}
|
|
186361
|
+
function withAlpha(rgb2, alpha) {
|
|
186362
|
+
const out = new Float32Array(alpha.length * 4);
|
|
186363
|
+
for (let v = 0; v < alpha.length; v++) {
|
|
186364
|
+
out.set(rgb2.subarray(v * 3, v * 3 + 3), v * 4);
|
|
186365
|
+
out[v * 4 + 3] = alpha[v];
|
|
186366
|
+
}
|
|
186367
|
+
return out;
|
|
186368
|
+
}
|
|
185953
186369
|
function buildPart(three, part, light, eye, disposables) {
|
|
185954
|
-
|
|
185955
|
-
if (positions2.length === 0) {
|
|
186370
|
+
if (part.triangles.positions.length === 0) {
|
|
185956
186371
|
return null;
|
|
185957
186372
|
}
|
|
186373
|
+
const glass = isSmartArt3DGlassMaterial(part.material);
|
|
186374
|
+
const translucent = part.opacity < 1 || glass;
|
|
186375
|
+
if (translucent) {
|
|
186376
|
+
orientSmartArt3DTriangles(part.triangles);
|
|
186377
|
+
}
|
|
186378
|
+
const { positions: positions2, normals } = part.triangles;
|
|
185958
186379
|
const gradient = part.gradient;
|
|
185959
186380
|
const flatColor = hexToRgb7(part.color);
|
|
185960
186381
|
const baseAt = (p) => gradient ? smartArt3DGradientColor(gradient, p) : flatColor;
|
|
185961
186382
|
const geometry = new three.BufferGeometry();
|
|
185962
186383
|
geometry.setAttribute("position", new three.Float32BufferAttribute(positions2, 3));
|
|
186384
|
+
const shading = shadeSmartArt3DVertices(
|
|
186385
|
+
positions2,
|
|
186386
|
+
normals,
|
|
186387
|
+
baseAt,
|
|
186388
|
+
glass ? smartArt3DGlassLightModel(light) : light,
|
|
186389
|
+
eye
|
|
186390
|
+
);
|
|
185963
186391
|
geometry.setAttribute(
|
|
185964
186392
|
"color",
|
|
185965
|
-
new three.BufferAttribute(
|
|
186393
|
+
glass ? new three.BufferAttribute(
|
|
186394
|
+
withAlpha(
|
|
186395
|
+
shading,
|
|
186396
|
+
smartArt3DVertexAlphas(positions2, normals, part.material, part.opacity, eye)
|
|
186397
|
+
),
|
|
186398
|
+
4
|
|
186399
|
+
) : new three.BufferAttribute(shading, 3)
|
|
185966
186400
|
);
|
|
185967
186401
|
const texture = gradient ? buildGradientTexture(three, gradient) : null;
|
|
185968
186402
|
if (gradient && texture) {
|
|
@@ -185980,9 +186414,13 @@ function buildPart(three, part, light, eye, disposables) {
|
|
|
185980
186414
|
color: texture ? "#ffffff" : part.color,
|
|
185981
186415
|
map: texture,
|
|
185982
186416
|
vertexColors: true,
|
|
185983
|
-
side: three.DoubleSide,
|
|
185984
|
-
transparent:
|
|
185985
|
-
|
|
186417
|
+
side: translucent ? three.FrontSide : three.DoubleSide,
|
|
186418
|
+
transparent: translucent,
|
|
186419
|
+
// A glass carries its alpha per vertex; the material then stays at 1.
|
|
186420
|
+
opacity: glass ? 1 : part.opacity,
|
|
186421
|
+
// Translucent solids are layered in paint order, like PowerPoint's
|
|
186422
|
+
// per-shape compositing, rather than hiding one another.
|
|
186423
|
+
depthWrite: !translucent
|
|
185986
186424
|
});
|
|
185987
186425
|
disposables.push(geometry, material);
|
|
185988
186426
|
return new three.Mesh(geometry, material);
|
|
@@ -186009,12 +186447,20 @@ function buildLitMeshObject(three, mesh, light, eye) {
|
|
|
186009
186447
|
for (const cap of geometry?.contourCaps ?? []) {
|
|
186010
186448
|
appendCap(three, contour, cap);
|
|
186011
186449
|
}
|
|
186450
|
+
const material = mesh.solid?.material;
|
|
186012
186451
|
const parts = [
|
|
186013
|
-
{
|
|
186452
|
+
{
|
|
186453
|
+
triangles: body,
|
|
186454
|
+
color: mesh.fill,
|
|
186455
|
+
gradient: mesh.gradient,
|
|
186456
|
+
opacity: mesh.opacity,
|
|
186457
|
+
material
|
|
186458
|
+
},
|
|
186014
186459
|
{
|
|
186015
186460
|
triangles: sides,
|
|
186016
186461
|
color: mesh.solid?.extrusionColor ?? mesh.fill,
|
|
186017
|
-
opacity: mesh.opacity
|
|
186462
|
+
opacity: mesh.opacity,
|
|
186463
|
+
material
|
|
186018
186464
|
},
|
|
186019
186465
|
{
|
|
186020
186466
|
triangles: contour,
|
|
@@ -186022,33 +186468,36 @@ function buildLitMeshObject(three, mesh, light, eye) {
|
|
|
186022
186468
|
opacity: mesh.opacity
|
|
186023
186469
|
}
|
|
186024
186470
|
];
|
|
186025
|
-
|
|
186471
|
+
parts.forEach((part, order) => {
|
|
186026
186472
|
const built = buildPart(three, part, light, localEye, disposables);
|
|
186027
186473
|
if (built) {
|
|
186028
|
-
|
|
186029
|
-
const material = built.material;
|
|
186030
|
-
material.transparent = true;
|
|
186031
|
-
material.opacity = mesh.opacity;
|
|
186032
|
-
}
|
|
186474
|
+
built.renderOrder = order;
|
|
186033
186475
|
group2.add(built);
|
|
186034
186476
|
}
|
|
186035
|
-
}
|
|
186477
|
+
});
|
|
186036
186478
|
}
|
|
186037
186479
|
for (const line4 of buildStrokeLines(three, mesh, disposables)) {
|
|
186038
186480
|
group2.add(line4);
|
|
186039
186481
|
}
|
|
186482
|
+
const labelsFrom = group2.children.length;
|
|
186040
186483
|
buildLitTextObject(three, mesh, group2, light, disposables);
|
|
186484
|
+
for (const label of group2.children.slice(labelsFrom)) {
|
|
186485
|
+
label.renderOrder = LABEL_RENDER_ORDER;
|
|
186486
|
+
}
|
|
186041
186487
|
return { group: group2, disposables };
|
|
186042
186488
|
}
|
|
186489
|
+
var LABEL_RENDER_ORDER;
|
|
186043
186490
|
var GRADIENT_TEXELS;
|
|
186044
186491
|
var init_lit_mesh_object = __esm2({
|
|
186045
186492
|
"src/smartart-3d/lit-mesh-object.ts"() {
|
|
186046
186493
|
init_smartart_3d_drawing_solid();
|
|
186047
186494
|
init_smartart_3d_ring();
|
|
186048
186495
|
init_smartart_3d_solid_geometry();
|
|
186496
|
+
init_smartart_3d_translucency();
|
|
186049
186497
|
init_smartart_3d_vertex_shading();
|
|
186050
186498
|
init_flat_mesh_object();
|
|
186051
186499
|
init_lit_text_object();
|
|
186500
|
+
LABEL_RENDER_ORDER = 3;
|
|
186052
186501
|
GRADIENT_TEXELS = 256;
|
|
186053
186502
|
}
|
|
186054
186503
|
});
|
|
@@ -186266,16 +186715,19 @@ async function mountSmartArt3DView(model, ctx) {
|
|
|
186266
186715
|
);
|
|
186267
186716
|
}
|
|
186268
186717
|
scene.add(root);
|
|
186269
|
-
|
|
186718
|
+
model.meshes.forEach((mesh, index) => {
|
|
186270
186719
|
const built = lit ? buildLitMeshObject(
|
|
186271
186720
|
three,
|
|
186272
186721
|
mesh,
|
|
186273
186722
|
resolveSmartArt3DLightModel(model.lighting, mesh.solid?.material, eye !== void 0),
|
|
186274
186723
|
eye
|
|
186275
186724
|
) : buildFlatMeshObject(three, mesh);
|
|
186725
|
+
if (lit && isSmartArt3DTranslucentMesh(mesh)) {
|
|
186726
|
+
built.group.renderOrder = index + 1;
|
|
186727
|
+
}
|
|
186276
186728
|
root.add(built.group);
|
|
186277
186729
|
disposables.push(...built.disposables);
|
|
186278
|
-
}
|
|
186730
|
+
});
|
|
186279
186731
|
const camera = buildSmartArtViewCamera(three, model.bounds, model.camera, ctx.size);
|
|
186280
186732
|
let overflow = frameSmartArtOverflow(three, root, camera, ctx.size, Boolean(model.camera));
|
|
186281
186733
|
return {
|
|
@@ -186300,6 +186752,7 @@ var init_view_scene = __esm2({
|
|
|
186300
186752
|
"src/smartart-3d/view-scene.ts"() {
|
|
186301
186753
|
init_smartart_3d_lighting();
|
|
186302
186754
|
init_smartart_3d_scene_camera();
|
|
186755
|
+
init_smartart_3d_translucency();
|
|
186303
186756
|
init_flat_mesh_object();
|
|
186304
186757
|
init_lit_mesh_object();
|
|
186305
186758
|
init_view_camera();
|
|
@@ -191492,7 +191945,7 @@ function pointInRing(p, ring) {
|
|
|
191492
191945
|
}
|
|
191493
191946
|
return inside;
|
|
191494
191947
|
}
|
|
191495
|
-
function contourRaster(values, w, h2,
|
|
191948
|
+
function contourRaster(values, w, h2, level2) {
|
|
191496
191949
|
const at = (x, y) => x < 0 || y < 0 || x >= w || y >= h2 ? 0 : values[y * w + x];
|
|
191497
191950
|
const stride = w + 2;
|
|
191498
191951
|
const hKey = (x, y) => ((y + 1) * stride + (x + 1)) * 2;
|
|
@@ -191502,7 +191955,7 @@ function contourRaster(values, w, h2, level) {
|
|
|
191502
191955
|
if (!points4.has(key2)) {
|
|
191503
191956
|
const a = at(x, y);
|
|
191504
191957
|
const b = horizontal ? at(x + 1, y) : at(x, y + 1);
|
|
191505
|
-
const t = b !== a ? (
|
|
191958
|
+
const t = b !== a ? (level2 - a) / (b - a) : 0.5;
|
|
191506
191959
|
points4.set(key2, horizontal ? { x: x + t, y } : { x, y: y + t });
|
|
191507
191960
|
}
|
|
191508
191961
|
return key2;
|
|
@@ -191526,15 +191979,15 @@ function contourRaster(values, w, h2, level) {
|
|
|
191526
191979
|
};
|
|
191527
191980
|
for (let y = -1; y < h2; y++) {
|
|
191528
191981
|
for (let x = -1; x < w; x++) {
|
|
191529
|
-
const tl = at(x, y) >=
|
|
191530
|
-
const tr = at(x + 1, y) >=
|
|
191531
|
-
const br = at(x + 1, y + 1) >=
|
|
191532
|
-
const bl = at(x, y + 1) >=
|
|
191982
|
+
const tl = at(x, y) >= level2 ? 1 : 0;
|
|
191983
|
+
const tr = at(x + 1, y) >= level2 ? 1 : 0;
|
|
191984
|
+
const br = at(x + 1, y + 1) >= level2 ? 1 : 0;
|
|
191985
|
+
const bl = at(x, y + 1) >= level2 ? 1 : 0;
|
|
191533
191986
|
const code = tl * 8 + tr * 4 + br * 2 + bl;
|
|
191534
191987
|
if (code === 0 || code === 15) {
|
|
191535
191988
|
continue;
|
|
191536
191989
|
}
|
|
191537
|
-
const centre = (at(x, y) + at(x + 1, y) + at(x + 1, y + 1) + at(x, y + 1)) / 4 >=
|
|
191990
|
+
const centre = (at(x, y) + at(x + 1, y) + at(x + 1, y + 1) + at(x, y + 1)) / 4 >= level2;
|
|
191538
191991
|
switch (code) {
|
|
191539
191992
|
case 1:
|
|
191540
191993
|
case 14:
|
|
@@ -199354,14 +199807,14 @@ function round2(value, precision) {
|
|
|
199354
199807
|
function svgDataUri(svg, filterId) {
|
|
199355
199808
|
return `url("data:image/svg+xml,${encodeURIComponent(svg)}#${filterId}")`;
|
|
199356
199809
|
}
|
|
199357
|
-
function pixelateFilterMarkup(
|
|
199358
|
-
const tile4 = round2(
|
|
199359
|
-
const dot2 = round2(
|
|
199810
|
+
function pixelateFilterMarkup(level2, filterId) {
|
|
199811
|
+
const tile4 = round2(level2, 4);
|
|
199812
|
+
const dot2 = round2(level2 * DOT_RATIO, 4);
|
|
199360
199813
|
return `<svg xmlns="http://www.w3.org/2000/svg"><filter id="${filterId}" primitiveUnits="objectBoundingBox" x="-0.5" y="-0.5" width="2" height="2" color-interpolation-filters="sRGB"><feFlood x="0" y="0" width="${dot2}" height="${dot2}" result="dot"/><feComposite in="dot" width="${tile4}" height="${tile4}" result="tile"/><feTile in="tile" result="grid"/><feComposite in="SourceGraphic" in2="grid" operator="in"/></filter></svg>`;
|
|
199361
199814
|
}
|
|
199362
|
-
var PIXELATE_FILTER_VALUES = PIXELATE_LEVELS.map((
|
|
199815
|
+
var PIXELATE_FILTER_VALUES = PIXELATE_LEVELS.map((level2, index) => {
|
|
199363
199816
|
const filterId = `pptx-pixelate-${index}`;
|
|
199364
|
-
return svgDataUri(pixelateFilterMarkup(
|
|
199817
|
+
return svgDataUri(pixelateFilterMarkup(level2, filterId), filterId);
|
|
199365
199818
|
});
|
|
199366
199819
|
function buildSteppedKeyframes(name, order, opacityFrom, opacityTo) {
|
|
199367
199820
|
const lastIndex = order.length - 1;
|
|
@@ -200670,7 +201123,7 @@ function revealedByLevel(nodes, progress) {
|
|
|
200670
201123
|
return nodes.length;
|
|
200671
201124
|
}
|
|
200672
201125
|
const allowed = new Set(uniqueLevels.slice(0, shownLevels));
|
|
200673
|
-
return levels.filter((
|
|
201126
|
+
return levels.filter((level2) => allowed.has(level2)).length;
|
|
200674
201127
|
}
|
|
200675
201128
|
function revealedByBranch(nodes, progress) {
|
|
200676
201129
|
const roots = nodeBranchRoots(nodes);
|
|
@@ -202446,8 +202899,8 @@ var DEFAULT_BUILD_LEVEL = 1;
|
|
|
202446
202899
|
function groupParagraphsByBuildLevel(levels, buildLevel = DEFAULT_BUILD_LEVEL) {
|
|
202447
202900
|
const groups = [];
|
|
202448
202901
|
for (let i2 = 0; i2 < levels.length; i2++) {
|
|
202449
|
-
const
|
|
202450
|
-
const opensGroup = groups.length === 0 ||
|
|
202902
|
+
const level2 = levels[i2] ?? 0;
|
|
202903
|
+
const opensGroup = groups.length === 0 || level2 < buildLevel;
|
|
202451
202904
|
if (opensGroup) {
|
|
202452
202905
|
groups.push([i2]);
|
|
202453
202906
|
} else {
|
|
@@ -215494,8 +215947,8 @@ function resolveParagraphBullet(firstSegment, baseFontSize = firstSegment?.style
|
|
|
215494
215947
|
return void 0;
|
|
215495
215948
|
}
|
|
215496
215949
|
var INDENT_PX_PER_LEVEL = 18;
|
|
215497
|
-
function bulletIndentPx(
|
|
215498
|
-
const lvl = typeof
|
|
215950
|
+
function bulletIndentPx(level2) {
|
|
215951
|
+
const lvl = typeof level2 === "number" && level2 > 0 ? level2 : 0;
|
|
215499
215952
|
return lvl * INDENT_PX_PER_LEVEL;
|
|
215500
215953
|
}
|
|
215501
215954
|
function resolveParagraphIndent(paraIndent, paragraphLevel) {
|
|
@@ -215693,15 +216146,15 @@ function setElementBullets(element, kind, range) {
|
|
|
215693
216146
|
}
|
|
215694
216147
|
const first = segments[0] ?? paragraph.terminator;
|
|
215695
216148
|
const info = first?.bulletInfo;
|
|
215696
|
-
const
|
|
216149
|
+
const level2 = first?.paragraphLevel ?? 0;
|
|
215697
216150
|
if (info?.autoNumType && paragraphBulletKind(segments) === "numbered") {
|
|
215698
216151
|
const startAt = info.autoNumStartAt ?? 1;
|
|
215699
|
-
const ordinal = nextAutoNumber(sequence,
|
|
216152
|
+
const ordinal = nextAutoNumber(sequence, level2, info.autoNumType, startAt) - startAt;
|
|
215700
216153
|
if (info.paragraphIndex !== ordinal) {
|
|
215701
216154
|
segments = toggleParagraphBullet(segments, "numbered", ordinal);
|
|
215702
216155
|
}
|
|
215703
216156
|
} else {
|
|
215704
|
-
breakAutoNumberRun(sequence,
|
|
216157
|
+
breakAutoNumberRun(sequence, level2);
|
|
215705
216158
|
}
|
|
215706
216159
|
next.push(...segments);
|
|
215707
216160
|
if (paragraph.terminator) {
|
|
@@ -219590,11 +220043,11 @@ function definedEntries(descriptor) {
|
|
|
219590
220043
|
([, value]) => value !== void 0
|
|
219591
220044
|
);
|
|
219592
220045
|
}
|
|
219593
|
-
function resolveNotesLevelStyle(notesStyle,
|
|
220046
|
+
function resolveNotesLevelStyle(notesStyle, level2 = 0) {
|
|
219594
220047
|
if (!notesStyle) {
|
|
219595
220048
|
return {};
|
|
219596
220049
|
}
|
|
219597
|
-
const own = notesStyle[
|
|
220050
|
+
const own = notesStyle[level2];
|
|
219598
220051
|
const fallback = notesStyle[-1];
|
|
219599
220052
|
const descriptor = {
|
|
219600
220053
|
fontFamily: own?.fontFamily ?? fallback?.fontFamily,
|
|
@@ -223419,12 +223872,12 @@ function renumberRemappedParagraphs(segments) {
|
|
|
223419
223872
|
return segment;
|
|
223420
223873
|
}
|
|
223421
223874
|
const info = segment.bulletInfo;
|
|
223422
|
-
const
|
|
223875
|
+
const level2 = segment.paragraphLevel ?? 0;
|
|
223423
223876
|
if (!info?.autoNumType || !resolveParagraphBullet(segment)?.isNumbered) {
|
|
223424
|
-
breakAutoNumberRun(sequence,
|
|
223877
|
+
breakAutoNumberRun(sequence, level2);
|
|
223425
223878
|
return segment;
|
|
223426
223879
|
}
|
|
223427
|
-
const ordinal = nextAutoNumber(sequence,
|
|
223880
|
+
const ordinal = nextAutoNumber(sequence, level2, info.autoNumType, info.autoNumStartAt ?? 1) - (info.autoNumStartAt ?? 1);
|
|
223428
223881
|
if (info.paragraphIndex === void 0 || info.paragraphIndex === ordinal) {
|
|
223429
223882
|
return segment;
|
|
223430
223883
|
}
|
|
@@ -230354,17 +230807,17 @@ function computeHierarchyLayout(nodes, box, palette, style, elementId) {
|
|
|
230354
230807
|
const renderedNodes = [];
|
|
230355
230808
|
const connectors2 = [];
|
|
230356
230809
|
let colourIdx = 0;
|
|
230357
|
-
function renderTreeNode(t, xOffset,
|
|
230810
|
+
function renderTreeNode(t, xOffset, level2) {
|
|
230358
230811
|
const w = treeWidth(t);
|
|
230359
230812
|
const nodeCx = (xOffset + w / 2) * cellW;
|
|
230360
|
-
const nodeCy =
|
|
230813
|
+
const nodeCy = level2 * cellH + cellH / 2;
|
|
230361
230814
|
const ci = colourIdx++;
|
|
230362
230815
|
const fontSize = fitFontSize(t.node.text, boxW * 0.9, boxH, 11);
|
|
230363
230816
|
let childOffset = xOffset;
|
|
230364
230817
|
for (const child27 of t.children) {
|
|
230365
230818
|
const childW = treeWidth(child27);
|
|
230366
230819
|
const childCx = (childOffset + childW / 2) * cellW;
|
|
230367
|
-
const childCy = (
|
|
230820
|
+
const childCy = (level2 + 1) * cellH + cellH / 2;
|
|
230368
230821
|
const midY = nodeCy + boxH / 2 + (childCy - boxH / 2 - (nodeCy + boxH / 2)) / 2;
|
|
230369
230822
|
connectors2.push({
|
|
230370
230823
|
key: `${elementId}-hier-conn-${t.node.id}-${child27.node.id}`,
|
|
@@ -230393,7 +230846,7 @@ function computeHierarchyLayout(nodes, box, palette, style, elementId) {
|
|
|
230393
230846
|
renderedNodes.push(nodeEntry);
|
|
230394
230847
|
let co = xOffset;
|
|
230395
230848
|
for (const child27 of t.children) {
|
|
230396
|
-
renderTreeNode(child27, co,
|
|
230849
|
+
renderTreeNode(child27, co, level2 + 1);
|
|
230397
230850
|
co += treeWidth(child27);
|
|
230398
230851
|
}
|
|
230399
230852
|
}
|
|
@@ -235742,8 +236195,8 @@ function paragraphGroupText(group2) {
|
|
|
235742
236195
|
}
|
|
235743
236196
|
function paragraphGroupLevel(group2) {
|
|
235744
236197
|
const first = group2.marker ?? group2.content[0];
|
|
235745
|
-
const
|
|
235746
|
-
return typeof
|
|
236198
|
+
const level2 = first?.paragraphLevel;
|
|
236199
|
+
return typeof level2 === "number" && level2 > 0 ? Math.min(level2, MAX_PARAGRAPH_LEVEL) : 0;
|
|
235747
236200
|
}
|
|
235748
236201
|
function readElementParagraphs(element) {
|
|
235749
236202
|
const groups = groupElementParagraphs(element);
|
|
@@ -235873,14 +236326,14 @@ function mapOutlineKey(input, rowKey) {
|
|
|
235873
236326
|
}
|
|
235874
236327
|
return none;
|
|
235875
236328
|
}
|
|
235876
|
-
function withLevel(segments,
|
|
236329
|
+
function withLevel(segments, level2) {
|
|
235877
236330
|
return segments.map((segment, index) => {
|
|
235878
236331
|
if (index > 0) {
|
|
235879
236332
|
return segment;
|
|
235880
236333
|
}
|
|
235881
236334
|
const next = { ...segment };
|
|
235882
|
-
if (
|
|
235883
|
-
next.paragraphLevel = Math.min(
|
|
236335
|
+
if (level2 > 0) {
|
|
236336
|
+
next.paragraphLevel = Math.min(level2, MAX_PARAGRAPH_LEVEL);
|
|
235884
236337
|
} else {
|
|
235885
236338
|
delete next.paragraphLevel;
|
|
235886
236339
|
}
|
|
@@ -236019,12 +236472,12 @@ function applyIndent(slides, row, delta) {
|
|
|
236019
236472
|
}
|
|
236020
236473
|
const result = editParagraphs(slides, row, (paragraphs2) => {
|
|
236021
236474
|
const current = paragraphs2[row.paragraphIndex];
|
|
236022
|
-
const
|
|
236023
|
-
if (
|
|
236475
|
+
const level2 = Math.min(Math.max(current.level + (delta > 0 ? 1 : -1), 0), MAX_PARAGRAPH_LEVEL);
|
|
236476
|
+
if (level2 === current.level) {
|
|
236024
236477
|
return null;
|
|
236025
236478
|
}
|
|
236026
236479
|
const next = [...paragraphs2];
|
|
236027
|
-
next[row.paragraphIndex] = { ...current, level };
|
|
236480
|
+
next[row.paragraphIndex] = { ...current, level: level2 };
|
|
236028
236481
|
return next;
|
|
236029
236482
|
});
|
|
236030
236483
|
return result ?? unchanged2([...slides], row);
|
|
@@ -236081,6 +236534,44 @@ function applyOutlineEdit(slides, edit, options = {}) {
|
|
|
236081
236534
|
return unchanged2([...slides], row);
|
|
236082
236535
|
}
|
|
236083
236536
|
}
|
|
236537
|
+
var NUDGE_SMALL = 1;
|
|
236538
|
+
var NUDGE_LARGE = 10;
|
|
236539
|
+
function editorNudgeDelta(key2, large) {
|
|
236540
|
+
const step = large ? NUDGE_LARGE : NUDGE_SMALL;
|
|
236541
|
+
switch (key2) {
|
|
236542
|
+
case "ArrowLeft":
|
|
236543
|
+
return { dx: -step, dy: 0 };
|
|
236544
|
+
case "ArrowRight":
|
|
236545
|
+
return { dx: step, dy: 0 };
|
|
236546
|
+
case "ArrowUp":
|
|
236547
|
+
return { dx: 0, dy: -step };
|
|
236548
|
+
case "ArrowDown":
|
|
236549
|
+
return { dx: 0, dy: step };
|
|
236550
|
+
default:
|
|
236551
|
+
return null;
|
|
236552
|
+
}
|
|
236553
|
+
}
|
|
236554
|
+
function editorSlideStep(key2, hasSelection, withModifier) {
|
|
236555
|
+
if (withModifier) {
|
|
236556
|
+
return null;
|
|
236557
|
+
}
|
|
236558
|
+
if (key2 === "PageUp") {
|
|
236559
|
+
return "prevSlide";
|
|
236560
|
+
}
|
|
236561
|
+
if (key2 === "PageDown") {
|
|
236562
|
+
return "nextSlide";
|
|
236563
|
+
}
|
|
236564
|
+
if (hasSelection) {
|
|
236565
|
+
return null;
|
|
236566
|
+
}
|
|
236567
|
+
if (key2 === "ArrowLeft" || key2 === "ArrowUp") {
|
|
236568
|
+
return "prevSlide";
|
|
236569
|
+
}
|
|
236570
|
+
if (key2 === "ArrowRight" || key2 === "ArrowDown") {
|
|
236571
|
+
return "nextSlide";
|
|
236572
|
+
}
|
|
236573
|
+
return null;
|
|
236574
|
+
}
|
|
236084
236575
|
function resolveChord(key2, shiftKey, hasSelection) {
|
|
236085
236576
|
switch (key2.toLowerCase()) {
|
|
236086
236577
|
case "z":
|
|
@@ -236222,8 +236713,6 @@ function isEditorControlTarget(target) {
|
|
|
236222
236713
|
}
|
|
236223
236714
|
return Boolean(element.closest(CONTROL_SELECTOR));
|
|
236224
236715
|
}
|
|
236225
|
-
var NUDGE_SMALL = 1;
|
|
236226
|
-
var NUDGE_LARGE = 10;
|
|
236227
236716
|
var GUARD_DEFAULTS = {
|
|
236228
236717
|
canEdit: true,
|
|
236229
236718
|
isPresenting: false,
|
|
@@ -236234,21 +236723,6 @@ var GUARD_DEFAULTS = {
|
|
|
236234
236723
|
isTextInputTarget: false,
|
|
236235
236724
|
isControlTarget: false
|
|
236236
236725
|
};
|
|
236237
|
-
function editorNudgeDelta(key2, large) {
|
|
236238
|
-
const step = large ? NUDGE_LARGE : NUDGE_SMALL;
|
|
236239
|
-
switch (key2) {
|
|
236240
|
-
case "ArrowLeft":
|
|
236241
|
-
return { dx: -step, dy: 0 };
|
|
236242
|
-
case "ArrowRight":
|
|
236243
|
-
return { dx: step, dy: 0 };
|
|
236244
|
-
case "ArrowUp":
|
|
236245
|
-
return { dx: 0, dy: -step };
|
|
236246
|
-
case "ArrowDown":
|
|
236247
|
-
return { dx: 0, dy: step };
|
|
236248
|
-
default:
|
|
236249
|
-
return null;
|
|
236250
|
-
}
|
|
236251
|
-
}
|
|
236252
236726
|
var NO_ACTION = { action: null };
|
|
236253
236727
|
function mapEditorKey(input, guard = {}) {
|
|
236254
236728
|
const state = { ...GUARD_DEFAULTS, ...guard };
|
|
@@ -236301,18 +236775,13 @@ function mapEditorKey(input, guard = {}) {
|
|
|
236301
236775
|
return chord2;
|
|
236302
236776
|
}
|
|
236303
236777
|
}
|
|
236778
|
+
const paging = editorSlideStep(key2, state.hasSelection, mod || alt);
|
|
236779
|
+
if (paging) {
|
|
236780
|
+
return { action: paging };
|
|
236781
|
+
}
|
|
236304
236782
|
if (state.hasSelection) {
|
|
236305
236783
|
const delta = editorNudgeDelta(key2, Boolean(input.shiftKey));
|
|
236306
|
-
|
|
236307
|
-
return { action: "nudge", dx: delta.dx, dy: delta.dy };
|
|
236308
|
-
}
|
|
236309
|
-
return NO_ACTION;
|
|
236310
|
-
}
|
|
236311
|
-
if (key2 === "ArrowLeft") {
|
|
236312
|
-
return { action: "prevSlide" };
|
|
236313
|
-
}
|
|
236314
|
-
if (key2 === "ArrowRight") {
|
|
236315
|
-
return { action: "nextSlide" };
|
|
236784
|
+
return delta ? { action: "nudge", dx: delta.dx, dy: delta.dy } : NO_ACTION;
|
|
236316
236785
|
}
|
|
236317
236786
|
return NO_ACTION;
|
|
236318
236787
|
}
|
|
@@ -242665,8 +243134,8 @@ var VIEWER_SHORTCUT_REFERENCE = [
|
|
|
242665
243134
|
{ actionKey: "pptx.ribbon.ungroup", shortcut: "Ctrl/Cmd+Shift+G" },
|
|
242666
243135
|
{ actionKey: "pptx.shortcuts.action.nudgeElement", shortcut: "Arrow keys" },
|
|
242667
243136
|
{ actionKey: "pptx.shortcuts.action.nudgeElementLarge", shortcut: "Shift+Arrow keys" },
|
|
242668
|
-
{ actionKey: "pptx.shortcuts.action.prevSlide", shortcut: "Left arrow" },
|
|
242669
|
-
{ actionKey: "pptx.shortcuts.action.nextSlide", shortcut: "Right arrow" },
|
|
243137
|
+
{ actionKey: "pptx.shortcuts.action.prevSlide", shortcut: "Left or Up arrow, Page Up" },
|
|
243138
|
+
{ actionKey: "pptx.shortcuts.action.nextSlide", shortcut: "Right or Down arrow, Page Down" },
|
|
242670
243139
|
{ actionKey: "pptx.shortcuts.action.zoomCanvas", shortcut: "Ctrl/Cmd+Mouse wheel" },
|
|
242671
243140
|
{ actionKey: "pptx.shortcuts.action.commitTextEdit", shortcut: "Ctrl/Cmd+Enter" },
|
|
242672
243141
|
{ actionKey: "pptx.shortcuts.action.cancelTextEdit", shortcut: "Escape" },
|