ooxml-core 1.41.0 → 1.42.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/README.md +4 -0
- package/dist/PptxHandler-73QIJ6SD.cjs +14 -0
- package/dist/{PptxHandler-3AGIITR7.mjs → PptxHandler-A2J4PCOB.mjs} +2 -2
- package/dist/PptxHandler-OGLVLX2T.mjs +5 -0
- package/dist/{PresentationBuilder-MZBKYOYD.cjs → PresentationBuilder-6S5PJXXF.cjs} +6 -6
- package/dist/{PresentationBuilder-JNID4B4Z.mjs → PresentationBuilder-APJKCMVS.mjs} +2 -2
- package/dist/{PresentationBuilder-5DPKFUXP.mjs → PresentationBuilder-F3BWDERK.mjs} +3 -3
- package/dist/automation/index.cjs +75 -89
- package/dist/automation/index.mjs +75 -89
- package/dist/chart/index.cjs +5 -5
- package/dist/chart/index.mjs +5 -5
- package/dist/{chunk-LRBWCRQ3.cjs → chunk-3J6VIKLP.cjs} +3 -3
- package/dist/chunk-CODMW5KF.cjs +110 -0
- package/dist/{chunk-KKVD3R6O.mjs → chunk-CPSTCCRD.mjs} +4 -4
- package/dist/{chunk-P3WAKBVS.mjs → chunk-IPV3J3I5.mjs} +82 -90
- package/dist/{chunk-6LGRRQ3K.mjs → chunk-MXA67O7R.mjs} +1 -1
- package/dist/{chunk-JXR6YWBW.mjs → chunk-N6X5CJZP.mjs} +125 -126
- package/dist/chunk-O3YGBYGZ.mjs +104 -0
- package/dist/{chunk-75KBNUKS.cjs → chunk-QZPOPUI5.cjs} +82 -89
- package/dist/{chunk-UE23HF2N.mjs → chunk-VKFKEVHK.mjs} +1 -1
- package/dist/{chunk-DD7COXWR.mjs → chunk-VV724DWE.mjs} +19 -7
- package/dist/{chunk-HTELXT2N.mjs → chunk-XVB3CBNM.mjs} +19 -6
- package/dist/{chunk-3BIFRTU4.cjs → chunk-YNQRXFTC.cjs} +1283 -1270
- package/dist/{chunk-ZYCBJKAE.mjs → chunk-ZUEN4RQG.mjs} +1 -1
- package/dist/diagram/index.cjs +499 -370
- package/dist/diagram/index.d.ts +1 -0
- package/dist/diagram/index.d.ts.map +1 -1
- package/dist/diagram/index.mjs +495 -371
- package/dist/docx/embedded.cjs +67 -89
- package/dist/docx/embedded.mjs +67 -89
- package/dist/docx/index.cjs +118 -106
- package/dist/docx/index.mjs +118 -106
- package/dist/docx/layout/index.cjs +118 -106
- package/dist/docx/layout/index.mjs +118 -106
- package/dist/docx/load/index.cjs +67 -89
- package/dist/docx/load/index.mjs +67 -89
- package/dist/docx/shape-svg.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +72 -94
- package/dist/docx/ui/index.mjs +72 -94
- package/dist/drawingml/dash-pattern.d.ts +61 -0
- package/dist/drawingml/dash-pattern.d.ts.map +1 -0
- package/dist/drawingml/index.cjs +249 -43
- package/dist/drawingml/index.d.ts +3 -0
- package/dist/drawingml/index.d.ts.map +1 -1
- package/dist/drawingml/index.mjs +241 -44
- package/dist/drawingml/rect-path-gradient.d.ts +5 -0
- package/dist/drawingml/rect-path-gradient.d.ts.map +1 -1
- package/dist/drawingml/shape-path-gradient.d.ts +57 -0
- package/dist/drawingml/shape-path-gradient.d.ts.map +1 -0
- package/dist/geometry/index.cjs +68 -90
- package/dist/geometry/index.mjs +68 -90
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +2 -2
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -1
- package/dist/index.cjs +686 -489
- package/dist/index.mjs +686 -489
- package/dist/pptx/automation/index.cjs +355 -191
- package/dist/pptx/automation/index.d.ts +11 -17
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +156 -71
- package/dist/pptx/chunks/{elements-6BMEOo7i.d.ts → elements-PBugbKtv.d.ts} +3 -873
- package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-BbXLv6As.d.ts → index-BJuR8GLL.d.ts} +4 -4
- package/dist/pptx/chunks/{index-BbXLv6As.d.ts.map → index-BJuR8GLL.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-DvN0TkJJ.d.ts → index-Rbvl2WaM.d.ts} +14 -10
- package/dist/pptx/chunks/index-Rbvl2WaM.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Dija_Wth.d.ts → index-xoJGYTgQ.d.ts} +5 -3
- package/dist/pptx/chunks/index-xoJGYTgQ.d.ts.map +1 -0
- package/dist/pptx/chunks/table-C7ITXL3Y.d.ts +875 -0
- package/dist/pptx/chunks/table-C7ITXL3Y.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-DorONr3h.d.ts → text-operations-BNJr7aGa.d.ts} +3 -2
- package/dist/pptx/chunks/text-operations-BNJr7aGa.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +169 -96
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +69 -91
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/editor/render/table-data-grid-ops.cjs +5 -5
- package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
- package/dist/pptx/editor/render/table-layout.cjs +6 -6
- package/dist/pptx/editor/render/table-layout.d.ts +8 -37
- package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-layout.mjs +1 -1
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +214 -129
- package/dist/pptx/index.d.ts +6 -5
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/teams/index.cjs +136 -91
- package/dist/teams/index.mjs +136 -91
- package/dist/text/font-metrics/design-advances.generated.d.ts +3 -1
- package/dist/text/font-metrics/design-advances.generated.d.ts.map +1 -1
- package/dist/text/index.cjs +8 -0
- package/dist/text/index.mjs +8 -0
- package/dist/visio/index.cjs +8 -0
- package/dist/visio/index.mjs +8 -0
- package/dist/visio/ui/index.cjs +8 -0
- package/dist/visio/ui/index.mjs +8 -0
- package/dist/xlsx/collab/index.cjs +67 -89
- package/dist/xlsx/collab/index.mjs +67 -89
- package/dist/xlsx/index.cjs +116 -108
- package/dist/xlsx/index.mjs +116 -108
- package/dist/xlsx/layout/shape-paint.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +67 -89
- package/dist/xlsx/load/index.mjs +67 -89
- package/dist/xlsx/ui/index.cjs +72 -94
- package/dist/xlsx/ui/index.mjs +72 -94
- package/package.json +1 -1
- package/dist/PptxHandler-EL4E4SPH.mjs +0 -5
- package/dist/PptxHandler-OIZ3R3DJ.cjs +0 -14
- package/dist/chunk-3IT6ZD7K.mjs +0 -213
- package/dist/chunk-FRUB573B.cjs +0 -219
- package/dist/pptx/chunks/elements-6BMEOo7i.d.ts.map +0 -1
- package/dist/pptx/chunks/index-Dija_Wth.d.ts.map +0 -1
- package/dist/pptx/chunks/index-DvN0TkJJ.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-DorONr3h.d.ts.map +0 -1
package/dist/diagram/index.mjs
CHANGED
|
@@ -143,24 +143,24 @@ function isSpace(ch) {
|
|
|
143
143
|
function parseAttributes(source2) {
|
|
144
144
|
const attrs2 = {};
|
|
145
145
|
let i = 0;
|
|
146
|
-
const
|
|
147
|
-
while (i <
|
|
148
|
-
while (i <
|
|
146
|
+
const n2 = source2.length;
|
|
147
|
+
while (i < n2) {
|
|
148
|
+
while (i < n2 && !isNameChar(source2[i])) {
|
|
149
149
|
i++;
|
|
150
150
|
}
|
|
151
151
|
const nameStart = i;
|
|
152
|
-
while (i <
|
|
152
|
+
while (i < n2 && isNameChar(source2[i])) {
|
|
153
153
|
i++;
|
|
154
154
|
}
|
|
155
155
|
const name = source2.slice(nameStart, i);
|
|
156
|
-
while (i <
|
|
156
|
+
while (i < n2 && isSpace(source2[i])) {
|
|
157
157
|
i++;
|
|
158
158
|
}
|
|
159
159
|
if (!name || source2[i] !== "=") {
|
|
160
160
|
continue;
|
|
161
161
|
}
|
|
162
162
|
i++;
|
|
163
|
-
while (i <
|
|
163
|
+
while (i < n2 && isSpace(source2[i])) {
|
|
164
164
|
i++;
|
|
165
165
|
}
|
|
166
166
|
const quote = source2[i];
|
|
@@ -1204,12 +1204,12 @@ function cmds(src) {
|
|
|
1204
1204
|
let i = 0;
|
|
1205
1205
|
while (i < tokens.length) {
|
|
1206
1206
|
const op = tokens[i++];
|
|
1207
|
-
const
|
|
1208
|
-
if (
|
|
1207
|
+
const n2 = ARITY[op];
|
|
1208
|
+
if (n2 === void 0) {
|
|
1209
1209
|
throw new Error(`Unknown path op ${op}`);
|
|
1210
1210
|
}
|
|
1211
|
-
const a = tokens.slice(i, i +
|
|
1212
|
-
i +=
|
|
1211
|
+
const a = tokens.slice(i, i + n2);
|
|
1212
|
+
i += n2;
|
|
1213
1213
|
switch (op) {
|
|
1214
1214
|
case "M":
|
|
1215
1215
|
out.push({ kind: "moveTo", x: a[0], y: a[1] });
|
|
@@ -1322,84 +1322,22 @@ var triangle = (g2, dir) => g2.poly([
|
|
|
1322
1322
|
[D * dir, 0],
|
|
1323
1323
|
[-D * dir, D]
|
|
1324
1324
|
]);
|
|
1325
|
-
var
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
[
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
[-8.5, -13.5],
|
|
1342
|
-
[-9.3, -17.2],
|
|
1343
|
-
[-7.8, -19.5],
|
|
1344
|
-
[-4, -22.5],
|
|
1345
|
-
[-3.3, -21.7],
|
|
1346
|
-
[-1.8, -21.7],
|
|
1347
|
-
[-1, -23.2],
|
|
1348
|
-
[0.5, -23.2],
|
|
1349
|
-
[1.2, -21.7],
|
|
1350
|
-
[2.7, -21.7],
|
|
1351
|
-
[3.5, -22.5],
|
|
1352
|
-
[8, -18.7],
|
|
1353
|
-
[8.7, -17.2],
|
|
1354
|
-
[8, -16.5],
|
|
1355
|
-
[8, -15],
|
|
1356
|
-
[9.5, -14.2],
|
|
1357
|
-
[9.5, -13.5],
|
|
1358
|
-
[8, -12.7],
|
|
1359
|
-
[8.7, -9.7],
|
|
1360
|
-
[5, -6],
|
|
1361
|
-
[2, -6],
|
|
1362
|
-
[-2.5, -2.2],
|
|
1363
|
-
[-3.3, 0.8],
|
|
1364
|
-
[-5.5, 2.3],
|
|
1365
|
-
[-4.8, 6.8],
|
|
1366
|
-
[-6.3, 7.5],
|
|
1367
|
-
[-6.3, 18],
|
|
1368
|
-
[-4.8, 18],
|
|
1369
|
-
[-4, 17.3],
|
|
1370
|
-
[4.2, 17.3],
|
|
1371
|
-
[4.2, 6.8],
|
|
1372
|
-
[6.5, 5.3],
|
|
1373
|
-
[6.5, 3.8],
|
|
1374
|
-
[8, 3],
|
|
1375
|
-
[8, 1.5],
|
|
1376
|
-
[8.7, 0.8],
|
|
1377
|
-
[13.2, 0],
|
|
1378
|
-
[17, -4.5],
|
|
1379
|
-
[18.5, -4.5],
|
|
1380
|
-
[18.5, -6],
|
|
1381
|
-
[17.7, -6.7],
|
|
1382
|
-
[18.5, -8.2],
|
|
1383
|
-
[18.5, -15],
|
|
1384
|
-
[20, -15.7],
|
|
1385
|
-
[20, -18],
|
|
1386
|
-
[17.7, -19.5],
|
|
1387
|
-
[17.7, -21],
|
|
1388
|
-
[15.5, -24.7],
|
|
1389
|
-
[15.5, -27],
|
|
1390
|
-
[14, -27],
|
|
1391
|
-
[13.2, -27.7],
|
|
1392
|
-
[13.2, -29.2],
|
|
1393
|
-
[9.5, -30],
|
|
1394
|
-
[8.7, -30.7],
|
|
1395
|
-
[8.7, -32.2],
|
|
1396
|
-
[5.7, -31.5],
|
|
1397
|
-
[4.2, -33.7],
|
|
1398
|
-
[2.7, -33.7],
|
|
1399
|
-
[2, -32.2],
|
|
1400
|
-
[-2.5, -32.2],
|
|
1401
|
-
[-3.3, -33.7]
|
|
1402
|
-
];
|
|
1325
|
+
var U = 90;
|
|
1326
|
+
var question = (g2) => {
|
|
1327
|
+
const x = (v) => g2.x(v * U);
|
|
1328
|
+
const y = (v) => g2.y(v * U);
|
|
1329
|
+
const r = (v) => g2.len(v * U);
|
|
1330
|
+
return [
|
|
1331
|
+
`M ${x(-0.214)} ${y(-0.162)} A ${r(0.214)} ${r(0.2125)} 10800000 10800000`,
|
|
1332
|
+
`A ${r(0.108)} ${r(0.162)} 0 5400000`,
|
|
1333
|
+
`A ${r(0.053)} ${r(0.085)} 16200000 -5400000`,
|
|
1334
|
+
`L ${x(0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.08)}`,
|
|
1335
|
+
`A ${r(0.108)} ${r(0.16)} 10800000 5400000`,
|
|
1336
|
+
`A ${r(0.052)} ${r(0.082)} 5400000 -5400000`,
|
|
1337
|
+
`A ${r(0.107)} ${r(0.1065)} 0 -10800000`,
|
|
1338
|
+
`L ${x(-0.214)} ${y(-0.162)} Z`
|
|
1339
|
+
].join(" ");
|
|
1340
|
+
};
|
|
1403
1341
|
var MOVIE = [
|
|
1404
1342
|
[-33.75, -16.5],
|
|
1405
1343
|
[-33.75, -3],
|
|
@@ -1506,8 +1444,8 @@ var buttons = {
|
|
|
1506
1444
|
)
|
|
1507
1445
|
]),
|
|
1508
1446
|
actionButtonHelp: build("actionButtonHelp", (g2) => [
|
|
1509
|
-
darken(g2
|
|
1510
|
-
darken(g2.circle(
|
|
1447
|
+
darken(question(g2)),
|
|
1448
|
+
darken(g2.circle(0, 0.295 * U, 0.08 * U))
|
|
1511
1449
|
]),
|
|
1512
1450
|
actionButtonInformation: build("actionButtonInformation", (g2) => [
|
|
1513
1451
|
darken(g2.circle(0, 0.4, 34)),
|
|
@@ -4830,12 +4768,46 @@ var leftRightUpArrow2 = exactDef(
|
|
|
4830
4768
|
)
|
|
4831
4769
|
]
|
|
4832
4770
|
);
|
|
4771
|
+
var swooshArrow3 = exactDef(
|
|
4772
|
+
"swooshArrow",
|
|
4773
|
+
{ adj1: 25e3, adj2: 16667 },
|
|
4774
|
+
[
|
|
4775
|
+
"a1 pin 1 adj1 75000",
|
|
4776
|
+
"maxAdj2 */ 70000 w ss",
|
|
4777
|
+
"a2 pin 0 adj2 maxAdj2",
|
|
4778
|
+
"ad1 */ h a1 100000",
|
|
4779
|
+
"ad2 */ ss a2 100000",
|
|
4780
|
+
"xB +- r 0 ad2",
|
|
4781
|
+
"yB +- t ssd8 0",
|
|
4782
|
+
"alfa */ cd4 1 14",
|
|
4783
|
+
"dx0 tan ssd8 alfa",
|
|
4784
|
+
"xC +- xB 0 dx0",
|
|
4785
|
+
"dx1 tan ad1 alfa",
|
|
4786
|
+
"yF +- yB ad1 0",
|
|
4787
|
+
"xF +- xB dx1 0",
|
|
4788
|
+
"xE +- xF dx0 0",
|
|
4789
|
+
"yE +- yF ssd8 0",
|
|
4790
|
+
"dy2 +- yE 0 t",
|
|
4791
|
+
"dy22 */ dy2 1 2",
|
|
4792
|
+
"dy3 */ h 1 20",
|
|
4793
|
+
"yD +- dy22 0 dy3",
|
|
4794
|
+
"dy4 */ hd6 1 1",
|
|
4795
|
+
"yP1 +- hd6 dy4 0",
|
|
4796
|
+
"xP1 val wd6",
|
|
4797
|
+
"dy5 */ hd6 1 2",
|
|
4798
|
+
"yP2 +- yF dy5 0",
|
|
4799
|
+
"xP2 val wd4"
|
|
4800
|
+
],
|
|
4801
|
+
"l t r b",
|
|
4802
|
+
[p("M l b Q xP1 yP1 xB yB L xC t L r yD L xE yE L xF yF Q xP2 yP2 l b Z")]
|
|
4803
|
+
);
|
|
4833
4804
|
var EXACT_ARROW_PRESET_DEFINITIONS = {
|
|
4834
4805
|
leftRightArrow: leftRightArrow2,
|
|
4835
4806
|
upDownArrow: upDownArrow2,
|
|
4836
4807
|
quadArrow: quadArrow2,
|
|
4837
4808
|
leftUpArrow: leftUpArrow2,
|
|
4838
|
-
leftRightUpArrow: leftRightUpArrow2
|
|
4809
|
+
leftRightUpArrow: leftRightUpArrow2,
|
|
4810
|
+
swooshArrow: swooshArrow3
|
|
4839
4811
|
};
|
|
4840
4812
|
|
|
4841
4813
|
// geometry/preset-shape-definitions-exact-circular.ts
|
|
@@ -4857,32 +4829,32 @@ function onEllipse(name, rw, rh, ang) {
|
|
|
4857
4829
|
`${name}y +- vc ${name}dy 0`
|
|
4858
4830
|
];
|
|
4859
4831
|
}
|
|
4860
|
-
function head(
|
|
4832
|
+
function head(n2, baseAng, tipAng) {
|
|
4861
4833
|
const out = [
|
|
4862
|
-
...onEllipse(`${
|
|
4863
|
-
...onEllipse(`${
|
|
4864
|
-
`${
|
|
4865
|
-
`${
|
|
4866
|
-
`${
|
|
4867
|
-
`${
|
|
4868
|
-
`${
|
|
4869
|
-
`${
|
|
4870
|
-
`${
|
|
4871
|
-
`${
|
|
4872
|
-
`${
|
|
4873
|
-
`${
|
|
4834
|
+
...onEllipse(`${n2}H`, "rw3", "rh3", baseAng),
|
|
4835
|
+
...onEllipse(`${n2}A`, "rw3", "rh3", tipAng),
|
|
4836
|
+
`${n2}Gdx cos thh ${tipAng}`,
|
|
4837
|
+
`${n2}Gdy sin thh ${tipAng}`,
|
|
4838
|
+
`${n2}Gx +- ${n2}Hx ${n2}Gdx 0`,
|
|
4839
|
+
`${n2}Gy +- ${n2}Hy ${n2}Gdy 0`,
|
|
4840
|
+
`${n2}Bx +- ${n2}Hx 0 ${n2}Gdx`,
|
|
4841
|
+
`${n2}By +- ${n2}Hy 0 ${n2}Gdy`,
|
|
4842
|
+
`${n2}sx1 +- ${n2}Bx 0 hc`,
|
|
4843
|
+
`${n2}sy1 +- ${n2}By 0 vc`,
|
|
4844
|
+
`${n2}sx2 +- ${n2}Gx 0 hc`,
|
|
4845
|
+
`${n2}sy2 +- ${n2}Gy 0 vc`
|
|
4874
4846
|
];
|
|
4875
4847
|
for (const [k, rw, rh] of [
|
|
4876
4848
|
["F", "rw1", "rh1"],
|
|
4877
4849
|
["D", "rw2", "rh2"]
|
|
4878
4850
|
]) {
|
|
4879
|
-
const m = `${
|
|
4851
|
+
const m = `${n2}${k}`;
|
|
4880
4852
|
out.push(
|
|
4881
4853
|
`${m}r min ${rw} ${rh}`,
|
|
4882
|
-
`${m}x1 */ ${
|
|
4883
|
-
`${m}y1 */ ${
|
|
4884
|
-
`${m}x2 */ ${
|
|
4885
|
-
`${m}y2 */ ${
|
|
4854
|
+
`${m}x1 */ ${n2}sx1 ${m}r ${rw}`,
|
|
4855
|
+
`${m}y1 */ ${n2}sy1 ${m}r ${rh}`,
|
|
4856
|
+
`${m}x2 */ ${n2}sx2 ${m}r ${rw}`,
|
|
4857
|
+
`${m}y2 */ ${n2}sy2 ${m}r ${rh}`,
|
|
4886
4858
|
`${m}ex +- ${m}x2 0 ${m}x1`,
|
|
4887
4859
|
`${m}ey +- ${m}y2 0 ${m}y1`,
|
|
4888
4860
|
`${m}len mod ${m}ex ${m}ey 0`,
|
|
@@ -4936,7 +4908,7 @@ var BASE = [
|
|
|
4936
4908
|
"tAng at2 rI tq",
|
|
4937
4909
|
"hAng at2 Hdx Hdy"
|
|
4938
4910
|
];
|
|
4939
|
-
var headPath = (
|
|
4911
|
+
var headPath = (n2) => `L ${n2}Gx ${n2}Gy L ${n2}Ax ${n2}Ay L ${n2}Bx ${n2}By L ${n2}DX ${n2}DY`;
|
|
4940
4912
|
var circularArrow3 = exactDef(
|
|
4941
4913
|
"circularArrow",
|
|
4942
4914
|
{ adj1: 12500, adj2: 1142319, adj3: 20457681, adj4: 108e5, adj5: 12500 },
|
|
@@ -5555,19 +5527,19 @@ var EXACT_MISC_PRESET_DEFINITIONS = {
|
|
|
5555
5527
|
};
|
|
5556
5528
|
|
|
5557
5529
|
// geometry/preset-shape-definitions-exact-funnel.ts
|
|
5558
|
-
function newton(m,
|
|
5530
|
+
function newton(m, n2) {
|
|
5559
5531
|
return [
|
|
5560
|
-
`${
|
|
5561
|
-
`${
|
|
5562
|
-
`${
|
|
5563
|
-
`${
|
|
5564
|
-
`${
|
|
5565
|
-
`${
|
|
5566
|
-
`${
|
|
5567
|
-
`${
|
|
5568
|
-
`${
|
|
5569
|
-
`${
|
|
5570
|
-
`${
|
|
5532
|
+
`${n2}b1 */ ${m} b1 1`,
|
|
5533
|
+
`${n2}b2 */ ${m} b2 1`,
|
|
5534
|
+
`${n2}s1 mod a1 ${n2}b1 0`,
|
|
5535
|
+
`${n2}s2 mod a2 ${n2}b2 0`,
|
|
5536
|
+
`${n2}m1 */ ${m} dY 1`,
|
|
5537
|
+
`${n2}f0 +- ${n2}m1 ${n2}s2 ${n2}s1`,
|
|
5538
|
+
`${n2}t1 */ ${n2}b1 b1 ${n2}s1`,
|
|
5539
|
+
`${n2}t2 */ ${n2}b2 b2 ${n2}s2`,
|
|
5540
|
+
`${n2}d0 +- dY ${n2}t2 ${n2}t1`,
|
|
5541
|
+
`${n2}d1 */ ${n2}f0 1 ${n2}d0`,
|
|
5542
|
+
`${n2} +- ${m} 0 ${n2}d1`
|
|
5571
5543
|
];
|
|
5572
5544
|
}
|
|
5573
5545
|
var STEPS = ["mA", "mB", "mC", "mD", "mE", "mF"];
|
|
@@ -5584,7 +5556,7 @@ var funnel = exactDef(
|
|
|
5584
5556
|
"a1m +- a1 0 a2",
|
|
5585
5557
|
"m0 */ a1m 1 dY",
|
|
5586
5558
|
...newton("m0", "mA"),
|
|
5587
|
-
...STEPS.slice(1).flatMap((
|
|
5559
|
+
...STEPS.slice(1).flatMap((n2, i) => newton(STEPS[i], n2)),
|
|
5588
5560
|
"mb1 */ mF b1 1",
|
|
5589
5561
|
"mb2 */ mF b2 1",
|
|
5590
5562
|
"phi1 at2 a1 mb1",
|
|
@@ -5641,10 +5613,13 @@ var verticalScroll = exactDef(
|
|
|
5641
5613
|
p(
|
|
5642
5614
|
"M ch ch2 A ch2 ch2 10800000 5400000 L x6 t A ch2 ch2 16200000 10800000 L x4 ch L x4 y4 A ch2 ch2 0 5400000 L ch2 b A ch2 ch2 5400000 10800000 L ch y3 Z"
|
|
5643
5615
|
),
|
|
5644
|
-
p(
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5616
|
+
p(
|
|
5617
|
+
"M ch y4 A ch2 ch2 0 5400000 A ch2 ch2 5400000 10800000 A ch4 ch4 16200000 10800000 Z M x3b ch2 A ch2 ch2 0 5400000 A ch4 ch4 5400000 10800000 Z",
|
|
5618
|
+
{
|
|
5619
|
+
fill: "darkenLess",
|
|
5620
|
+
stroke: false
|
|
5621
|
+
}
|
|
5622
|
+
),
|
|
5648
5623
|
p(
|
|
5649
5624
|
"M x3 t A ch2 ch2 16200000 10800000 L x4 ch M ch2 y4 L ch y4 M x3b ch2 L x3 ch2 A ch4 ch4 16200000 -10800000",
|
|
5650
5625
|
{ fill: "none" }
|
|
@@ -5660,10 +5635,13 @@ var horizontalScroll = exactDef(
|
|
|
5660
5635
|
p(
|
|
5661
5636
|
"M ch2 ch A ch2 ch2 16200000 -5400000 L l x6 A ch2 ch2 10800000 -10800000 L ch x4 L y4 x4 A ch2 ch2 5400000 -5400000 L r ch2 A ch2 ch2 0 -10800000 L y3 ch Z"
|
|
5662
5637
|
),
|
|
5663
|
-
p(
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5638
|
+
p(
|
|
5639
|
+
"M y4 ch A ch2 ch2 5400000 -5400000 A ch2 ch2 0 -10800000 A ch4 ch4 10800000 -10800000 Z M ch2 x3b A ch2 ch2 5400000 -5400000 A ch4 ch4 0 -10800000 Z",
|
|
5640
|
+
{
|
|
5641
|
+
fill: "darkenLess",
|
|
5642
|
+
stroke: false
|
|
5643
|
+
}
|
|
5644
|
+
),
|
|
5667
5645
|
p(
|
|
5668
5646
|
"M l x3 A ch2 ch2 10800000 -10800000 L ch x4 M y4 ch2 L y4 ch M ch2 x3b L ch2 x3 A ch4 ch4 10800000 10800000",
|
|
5669
5647
|
{ fill: "none" }
|
|
@@ -5719,11 +5697,11 @@ var EXACT_LEFT_RIGHT_RIBBON_PRESET_DEFINITIONS = { leftRightRibbon };
|
|
|
5719
5697
|
|
|
5720
5698
|
// geometry/preset-shape-definitions-exact-ellipse-ribbons.ts
|
|
5721
5699
|
var AV = { adj1: 25e3, adj2: 5e4, adj3: 12500 };
|
|
5722
|
-
function para(
|
|
5723
|
-
return [`${
|
|
5700
|
+
function para(n2, x) {
|
|
5701
|
+
return [`${n2}q */ ${x} ${x} w`, `${n2}r +- ${x} 0 ${n2}q`, `${n2} */ f1 ${n2}r 1`];
|
|
5724
5702
|
}
|
|
5725
5703
|
function build2(name, flip) {
|
|
5726
|
-
const y = (
|
|
5704
|
+
const y = (n2, off) => flip ? `${n2} +- b 0 ${off}` : `${n2} +- t ${off} 0`;
|
|
5727
5705
|
const gd17 = [
|
|
5728
5706
|
"a1 pin 0 adj1 100000",
|
|
5729
5707
|
"a2 pin 25000 adj2 75000",
|
|
@@ -6856,8 +6834,8 @@ function ray(baseX1, baseY1, baseX2, baseY2, apexX, apexY) {
|
|
|
6856
6834
|
]
|
|
6857
6835
|
};
|
|
6858
6836
|
}
|
|
6859
|
-
function starTrigTable(
|
|
6860
|
-
const total =
|
|
6837
|
+
function starTrigTable(n2) {
|
|
6838
|
+
const total = n2 * 2;
|
|
6861
6839
|
const step = Math.PI * 2 / total;
|
|
6862
6840
|
const start = -Math.PI / 2;
|
|
6863
6841
|
const result = [];
|
|
@@ -6870,8 +6848,8 @@ function starTrigTable(n) {
|
|
|
6870
6848
|
}
|
|
6871
6849
|
return result;
|
|
6872
6850
|
}
|
|
6873
|
-
function buildStarN(
|
|
6874
|
-
const trig = starTrigTable(
|
|
6851
|
+
function buildStarN(n2, defaultAdj, hf, vf) {
|
|
6852
|
+
const trig = starTrigTable(n2);
|
|
6875
6853
|
const gdLst = [
|
|
6876
6854
|
gd9("a", `pin 0 adj 50000`),
|
|
6877
6855
|
gd9("swd2", hf === void 0 ? "*/ wd2 1 1" : "*/ wd2 hf 100000"),
|
|
@@ -6896,7 +6874,7 @@ function buildStarN(n, defaultAdj, hf, vf) {
|
|
|
6896
6874
|
}
|
|
6897
6875
|
commands.push({ kind: "close" });
|
|
6898
6876
|
return {
|
|
6899
|
-
name: `star${
|
|
6877
|
+
name: `star${n2}`,
|
|
6900
6878
|
avLst: {
|
|
6901
6879
|
adj: defaultAdj,
|
|
6902
6880
|
...hf === void 0 ? {} : { hf },
|
|
@@ -13557,7 +13535,7 @@ function fontRule(node) {
|
|
|
13557
13535
|
}
|
|
13558
13536
|
function hasFontLength(node) {
|
|
13559
13537
|
return flattenEngineTree(node).some(
|
|
13560
|
-
(
|
|
13538
|
+
(n2) => n2.constraints.some((c) => LENGTHS.has(c.type) && FONT_TYPES.has(c.refType))
|
|
13561
13539
|
);
|
|
13562
13540
|
}
|
|
13563
13541
|
function fontSearchPlan(node) {
|
|
@@ -13589,17 +13567,17 @@ function fits(node, context) {
|
|
|
13589
13567
|
if (!box) {
|
|
13590
13568
|
return true;
|
|
13591
13569
|
}
|
|
13592
|
-
for (const
|
|
13593
|
-
const b =
|
|
13594
|
-
if (!b ||
|
|
13570
|
+
for (const n2 of flattenEngineTree(node)) {
|
|
13571
|
+
const b = n2.box;
|
|
13572
|
+
if (!b || n2.alg.type === "conn" || !(b.w > 0) || !(b.h > 0)) {
|
|
13595
13573
|
continue;
|
|
13596
13574
|
}
|
|
13597
13575
|
if (b.x < box.x - SPILL_TOLERANCE_PT || b.y < box.y - SPILL_TOLERANCE_PT || b.x + b.w > box.x + box.w + SPILL_TOLERANCE_PT || b.y + b.h > box.y + box.h + SPILL_TOLERANCE_PT) {
|
|
13598
13576
|
return false;
|
|
13599
13577
|
}
|
|
13600
|
-
const font = layoutFontOf(
|
|
13601
|
-
const text2 = font === void 0 ? void 0 : context.textOf(
|
|
13602
|
-
if (font !== void 0 && text2 && !textFitsAt(
|
|
13578
|
+
const font = layoutFontOf(n2);
|
|
13579
|
+
const text2 = font === void 0 ? void 0 : context.textOf(n2);
|
|
13580
|
+
if (font !== void 0 && text2 && !textFitsAt(n2, text2, font, context.metrics, layoutFontOf)) {
|
|
13603
13581
|
return false;
|
|
13604
13582
|
}
|
|
13605
13583
|
}
|
|
@@ -13607,14 +13585,14 @@ function fits(node, context) {
|
|
|
13607
13585
|
}
|
|
13608
13586
|
function recordGrowth(node) {
|
|
13609
13587
|
const nodes = flattenEngineTree(node);
|
|
13610
|
-
for (const
|
|
13611
|
-
const grown =
|
|
13612
|
-
if (grown !== void 0 && canGrow(
|
|
13613
|
-
|
|
13588
|
+
for (const n2 of nodes) {
|
|
13589
|
+
const grown = n2.box?.h;
|
|
13590
|
+
if (grown !== void 0 && canGrow(n2, "h") && grown > (n2.growFloor?.h ?? -Infinity)) {
|
|
13591
|
+
n2.growFloor = { ...n2.growFloor, h: grown };
|
|
13614
13592
|
}
|
|
13615
13593
|
}
|
|
13616
|
-
for (const
|
|
13617
|
-
for (const group of
|
|
13594
|
+
for (const n2 of nodes) {
|
|
13595
|
+
for (const group of n2.groups) {
|
|
13618
13596
|
if (group.type !== "h" && group.type !== "w") {
|
|
13619
13597
|
continue;
|
|
13620
13598
|
}
|
|
@@ -13631,11 +13609,11 @@ function recordGrowth(node) {
|
|
|
13631
13609
|
}
|
|
13632
13610
|
}
|
|
13633
13611
|
function resetCandidate(node) {
|
|
13634
|
-
for (const
|
|
13635
|
-
|
|
13636
|
-
if (
|
|
13637
|
-
|
|
13638
|
-
|
|
13612
|
+
for (const n2 of flattenEngineTree(node)) {
|
|
13613
|
+
n2.growFloor = void 0;
|
|
13614
|
+
if (n2 !== node) {
|
|
13615
|
+
n2.minValues.clear();
|
|
13616
|
+
n2.maxValues.clear();
|
|
13639
13617
|
}
|
|
13640
13618
|
}
|
|
13641
13619
|
}
|
|
@@ -14403,10 +14381,10 @@ function arrangeCycle(node) {
|
|
|
14403
14381
|
}
|
|
14404
14382
|
const params = node.alg.params;
|
|
14405
14383
|
const hub = params.ctrShpMap === "fNode" ? groups.shift() : void 0;
|
|
14406
|
-
const
|
|
14384
|
+
const n2 = groups.length;
|
|
14407
14385
|
const cx0 = box.x + box.w / 2;
|
|
14408
14386
|
const cy0 = box.y + box.h / 2;
|
|
14409
|
-
if (
|
|
14387
|
+
if (n2 === 0) {
|
|
14410
14388
|
if (hub) {
|
|
14411
14389
|
placeGroup(hub, box.x, box.y, box.w, box.h);
|
|
14412
14390
|
}
|
|
@@ -14419,7 +14397,7 @@ function arrangeCycle(node) {
|
|
|
14419
14397
|
const parsedSpan = Number(params.spanAng);
|
|
14420
14398
|
const spanAng = Number.isFinite(parsedSpan) ? parsedSpan : 360;
|
|
14421
14399
|
const rotPath = params.rotPath === "alongPath";
|
|
14422
|
-
if (
|
|
14400
|
+
if (n2 === 1) {
|
|
14423
14401
|
const w0 = box.w;
|
|
14424
14402
|
const h0 = Math.min(box.h, box.w * heightOverWidth);
|
|
14425
14403
|
placeGroupCentered(groups[0], cx0, cy0, w0, h0);
|
|
@@ -14433,7 +14411,7 @@ function arrangeCycle(node) {
|
|
|
14433
14411
|
return;
|
|
14434
14412
|
}
|
|
14435
14413
|
const full = Math.abs(spanAng) >= 360;
|
|
14436
|
-
const step = full ? spanAng /
|
|
14414
|
+
const step = full ? spanAng / n2 : spanAng / (n2 - 1);
|
|
14437
14415
|
const halfStepRad = Math.abs(step) * DEG_TO_RAD / 2;
|
|
14438
14416
|
const sinHalf = Math.sin(halfStepRad);
|
|
14439
14417
|
const r0 = sinHalf > 1e-6 ? (1 + gap) / (2 * sinHalf) : 0;
|
|
@@ -14972,8 +14950,8 @@ function sanitizeLvlNode(lvlNode) {
|
|
|
14972
14950
|
function arrangePyra(node) {
|
|
14973
14951
|
const box = node.box;
|
|
14974
14952
|
const children2 = contentChildren(node);
|
|
14975
|
-
const
|
|
14976
|
-
if (!box ||
|
|
14953
|
+
const n2 = children2.length;
|
|
14954
|
+
if (!box || n2 === 0) {
|
|
14977
14955
|
return;
|
|
14978
14956
|
}
|
|
14979
14957
|
const lvlNodeName = node.alg.params.pyraLvlNode ?? "level";
|
|
@@ -14985,12 +14963,12 @@ function arrangePyra(node) {
|
|
|
14985
14963
|
}
|
|
14986
14964
|
const inverted = node.alg.params.linDir === "fromT";
|
|
14987
14965
|
const gap = Math.max(0, node.values.get("sibSp") ?? node.values.get("sp") ?? 0);
|
|
14988
|
-
const bandH = Math.max(0, (box.h - gap * (
|
|
14966
|
+
const bandH = Math.max(0, (box.h - gap * (n2 - 1)) / n2);
|
|
14989
14967
|
const bandCx = box.x + box.w / 2;
|
|
14990
14968
|
children2.forEach((child3, i) => {
|
|
14991
14969
|
const top = box.y + i * (bandH + gap);
|
|
14992
|
-
const effectiveI = inverted ?
|
|
14993
|
-
const halfWide = box.w * (effectiveI + 1) /
|
|
14970
|
+
const effectiveI = inverted ? n2 - 1 - i : i;
|
|
14971
|
+
const halfWide = box.w * (effectiveI + 1) / n2 / 2;
|
|
14994
14972
|
child3.box = { x: bandCx - halfWide, y: top, w: halfWide * 2, h: bandH };
|
|
14995
14973
|
});
|
|
14996
14974
|
}
|
|
@@ -15008,7 +14986,7 @@ function applyPyraAccentSplit(node) {
|
|
|
15008
14986
|
const txName = node.alg.params.pyraAcctTxNode ?? "acctTx";
|
|
15009
14987
|
const inverted = node.alg.params.linDir === "fromT";
|
|
15010
14988
|
const items = contentChildren(node);
|
|
15011
|
-
const
|
|
14989
|
+
const n2 = items.length;
|
|
15012
14990
|
const bandCx = box.x + box.w / 2;
|
|
15013
14991
|
items.forEach((item2, i) => {
|
|
15014
14992
|
const itemBox = item2.box;
|
|
@@ -15036,8 +15014,8 @@ function applyPyraAccentSplit(node) {
|
|
|
15036
15014
|
h: descendant.box.h
|
|
15037
15015
|
};
|
|
15038
15016
|
}
|
|
15039
|
-
const effectiveI = inverted ?
|
|
15040
|
-
const halfNarrow = box.w * effectiveI /
|
|
15017
|
+
const effectiveI = inverted ? n2 - 1 - i : i;
|
|
15018
|
+
const halfNarrow = box.w * effectiveI / n2 / 2;
|
|
15041
15019
|
const accentLeft = scaleFromAnchor(bandCx + halfNarrow, box.x, scale);
|
|
15042
15020
|
const accentRight = box.x + box.w;
|
|
15043
15021
|
for (const root of accentRoots) {
|
|
@@ -15107,8 +15085,8 @@ function measure2(node, box, cells, spacer, row) {
|
|
|
15107
15085
|
);
|
|
15108
15086
|
return { cellW, cellH, along, across, cols };
|
|
15109
15087
|
}
|
|
15110
|
-
function fits2(fit,
|
|
15111
|
-
const lines = Math.ceil(
|
|
15088
|
+
function fits2(fit, n2, box, row) {
|
|
15089
|
+
const lines = Math.ceil(n2 / fit.cols);
|
|
15112
15090
|
const lineLen = fit.cols * (row ? fit.cellW : fit.cellH) + (fit.cols - 1) * fit.along;
|
|
15113
15091
|
const across = lines * (row ? fit.cellH : fit.cellW) + (lines - 1) * fit.across;
|
|
15114
15092
|
return row ? lineLen <= box.w + 1e-6 && across <= box.h + 1e-6 : lineLen <= box.h + 1e-6 && across <= box.w + 1e-6;
|
|
@@ -15188,19 +15166,19 @@ function gridSize(dims, m, row) {
|
|
|
15188
15166
|
const acrossLen = lines * (row ? m.cellH : m.cellW) + (lines - 1) * m.across;
|
|
15189
15167
|
return row ? { w: alongLen, h: acrossLen } : { w: acrossLen, h: alongLen };
|
|
15190
15168
|
}
|
|
15191
|
-
function dimsFor(lineLen,
|
|
15192
|
-
const lines = Math.max(1, Math.ceil(
|
|
15169
|
+
function dimsFor(lineLen, n2, row) {
|
|
15170
|
+
const lines = Math.max(1, Math.ceil(n2 / lineLen));
|
|
15193
15171
|
return row ? { cols: lineLen, rows: lines } : { cols: lines, rows: lineLen };
|
|
15194
15172
|
}
|
|
15195
|
-
function chooseDims(node,
|
|
15173
|
+
function chooseDims(node, n2, m, box, row) {
|
|
15196
15174
|
const fixed = node.values.get("bkPtFixedVal") ?? Number(node.alg.params.bkPtFixedVal);
|
|
15197
15175
|
if (node.alg.params.bkpt === "fixed" && Number.isFinite(fixed) && fixed > 0) {
|
|
15198
|
-
return dimsFor(Math.min(
|
|
15176
|
+
return dimsFor(Math.min(n2, Math.round(fixed)), n2, row);
|
|
15199
15177
|
}
|
|
15200
|
-
let best = dimsFor(
|
|
15178
|
+
let best = dimsFor(n2, n2, row);
|
|
15201
15179
|
let bestScale = -Infinity;
|
|
15202
|
-
for (let lineLen =
|
|
15203
|
-
const dims = dimsFor(lineLen,
|
|
15180
|
+
for (let lineLen = n2; lineLen >= 1; lineLen--) {
|
|
15181
|
+
const dims = dimsFor(lineLen, n2, row);
|
|
15204
15182
|
const size = gridSize(dims, m, row);
|
|
15205
15183
|
const scale = Math.min(box.w / Math.max(1e-9, size.w), box.h / Math.max(1e-9, size.h));
|
|
15206
15184
|
if (scale > bestScale + 1e-9) {
|
|
@@ -15210,7 +15188,7 @@ function chooseDims(node, n, m, box, row) {
|
|
|
15210
15188
|
}
|
|
15211
15189
|
if (node.alg.params.bkpt === "bal") {
|
|
15212
15190
|
const lines = row ? best.rows : best.cols;
|
|
15213
|
-
return dimsFor(Math.ceil(
|
|
15191
|
+
return dimsFor(Math.ceil(n2 / lines), n2, row);
|
|
15214
15192
|
}
|
|
15215
15193
|
return best;
|
|
15216
15194
|
}
|
|
@@ -15237,8 +15215,8 @@ function arrangeSnake(node) {
|
|
|
15237
15215
|
if (!(m.cellW > 0) || !(m.cellH > 0)) {
|
|
15238
15216
|
return;
|
|
15239
15217
|
}
|
|
15240
|
-
const
|
|
15241
|
-
const dims = ruled ? dimsFor(ruled.cols,
|
|
15218
|
+
const n2 = cells.length;
|
|
15219
|
+
const dims = ruled ? dimsFor(ruled.cols, n2, row) : chooseDims(node, n2, m, box, row);
|
|
15242
15220
|
const size = gridSize(dims, m, row);
|
|
15243
15221
|
const scale = Math.min(1, box.w / size.w, box.h / size.h);
|
|
15244
15222
|
const cw = m.cellW * scale;
|
|
@@ -15254,7 +15232,7 @@ function arrangeSnake(node) {
|
|
|
15254
15232
|
const reverseAlternate = params.contDir === "revDir";
|
|
15255
15233
|
cells.forEach((cell, i) => {
|
|
15256
15234
|
const line2 = Math.floor(i / lineLen);
|
|
15257
|
-
const inLine = Math.min(lineLen,
|
|
15235
|
+
const inLine = Math.min(lineLen, n2 - line2 * lineLen);
|
|
15258
15236
|
const reversedLine = reverseAlternate && line2 % 2 === 1;
|
|
15259
15237
|
const pos = reversedLine ? lineLen - 1 - i % lineLen : i % lineLen;
|
|
15260
15238
|
const centre = params.off === "ctr" ? (lineLen - inLine) / 2 : 0;
|
|
@@ -15554,9 +15532,9 @@ function allNodes(entries) {
|
|
|
15554
15532
|
roots.add(top);
|
|
15555
15533
|
}
|
|
15556
15534
|
const out = [];
|
|
15557
|
-
const visit = (
|
|
15558
|
-
out.push(
|
|
15559
|
-
|
|
15535
|
+
const visit = (n2) => {
|
|
15536
|
+
out.push(n2);
|
|
15537
|
+
n2.children.forEach(visit);
|
|
15560
15538
|
};
|
|
15561
15539
|
roots.forEach(visit);
|
|
15562
15540
|
return out;
|
|
@@ -15825,7 +15803,7 @@ function isRenderable(node, presented, literalText) {
|
|
|
15825
15803
|
if (literalText && literalText.trim().length > 0) {
|
|
15826
15804
|
return true;
|
|
15827
15805
|
}
|
|
15828
|
-
return presented.some((
|
|
15806
|
+
return presented.some((n2) => (n2?.text ?? "").trim().length > 0);
|
|
15829
15807
|
}
|
|
15830
15808
|
|
|
15831
15809
|
// diagram/engine/engine-to-result.ts
|
|
@@ -15946,7 +15924,7 @@ function runEngineLayout(smartArtData, containerBounds, nodes, palette, style) {
|
|
|
15946
15924
|
if (!rawXmlText || !(widthPt > 0) || !(heightPt > 0)) {
|
|
15947
15925
|
return void 0;
|
|
15948
15926
|
}
|
|
15949
|
-
const nodeById = new Map(nodes.map((
|
|
15927
|
+
const nodeById = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
15950
15928
|
const metrics = textMetricsFor(resolveFontTable(smartArtData.themeMinorFont));
|
|
15951
15929
|
const context = {
|
|
15952
15930
|
textOf: (node) => nodeTextFor(node, sourceIdsOf(node), transitionLabelOf(node), nodeById),
|
|
@@ -16489,11 +16467,11 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots) {
|
|
|
16489
16467
|
}
|
|
16490
16468
|
const excluded = new Set(
|
|
16491
16469
|
(axis === "follow" ? descendantsOf(node, childrenOf) : ancestorsOf(node, parentOf)).map(
|
|
16492
|
-
(
|
|
16470
|
+
(n2) => n2.id
|
|
16493
16471
|
)
|
|
16494
16472
|
);
|
|
16495
16473
|
const range = axis === "follow" ? nodes.slice(docIndex + 1) : nodes.slice(0, docIndex);
|
|
16496
|
-
addAll(range.filter((
|
|
16474
|
+
addAll(range.filter((n2) => !excluded.has(n2.id)));
|
|
16497
16475
|
break;
|
|
16498
16476
|
}
|
|
16499
16477
|
case "root": {
|
|
@@ -16525,7 +16503,7 @@ function selectRange(nodes, start, count) {
|
|
|
16525
16503
|
return nodes.slice(zeroBasedStart, zeroBasedStart + take);
|
|
16526
16504
|
}
|
|
16527
16505
|
function applyPointTypeAndRange(nodes, pointType2, start, count) {
|
|
16528
|
-
const filtered = pointType2 ? nodes.filter((
|
|
16506
|
+
const filtered = pointType2 ? nodes.filter((n2) => pointTypeMatches(n2, pointType2)) : nodes;
|
|
16529
16507
|
return selectRange(filtered, start, count);
|
|
16530
16508
|
}
|
|
16531
16509
|
function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
|
|
@@ -16539,7 +16517,7 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
|
|
|
16539
16517
|
if (axis[0] === "root" && axis.length > 1 && axis[1] !== "ch") {
|
|
16540
16518
|
return void 0;
|
|
16541
16519
|
}
|
|
16542
|
-
const byId = new Map(nodes.map((
|
|
16520
|
+
const byId = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
16543
16521
|
const childrenOf = /* @__PURE__ */ new Map();
|
|
16544
16522
|
const parentOf = /* @__PURE__ */ new Map();
|
|
16545
16523
|
for (const node of nodes) {
|
|
@@ -16554,7 +16532,7 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
|
|
|
16554
16532
|
}
|
|
16555
16533
|
}
|
|
16556
16534
|
}
|
|
16557
|
-
const roots = nodes.filter((
|
|
16535
|
+
const roots = nodes.filter((n2) => !n2.parentId || !byId.has(n2.parentId));
|
|
16558
16536
|
let current;
|
|
16559
16537
|
let nextHop;
|
|
16560
16538
|
if (axis[0] === "root" && axis.length > 1) {
|
|
@@ -16611,7 +16589,7 @@ function resolveAxisMaxDepth(nodes, axis, pointTypes, start, count, anchor) {
|
|
|
16611
16589
|
if (anchor.length === 0) {
|
|
16612
16590
|
return void 0;
|
|
16613
16591
|
}
|
|
16614
|
-
const byId = new Map(nodes.map((
|
|
16592
|
+
const byId = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
16615
16593
|
let max = 0;
|
|
16616
16594
|
for (const anchorPoint of anchor) {
|
|
16617
16595
|
const resolved = resolveAxisNodes(nodes, axis, pointTypes, start, count, [anchorPoint]);
|
|
@@ -17792,14 +17770,14 @@ function selectArrangedNodes(node, flat, roots) {
|
|
|
17792
17770
|
// diagram/layout/smartart-tree.ts
|
|
17793
17771
|
function buildForest(nodes) {
|
|
17794
17772
|
const map = /* @__PURE__ */ new Map();
|
|
17795
|
-
for (const
|
|
17796
|
-
map.set(
|
|
17773
|
+
for (const n2 of nodes) {
|
|
17774
|
+
map.set(n2.id, { node: n2, children: [] });
|
|
17797
17775
|
}
|
|
17798
17776
|
const roots = [];
|
|
17799
|
-
for (const
|
|
17800
|
-
const tn = map.get(
|
|
17801
|
-
if (
|
|
17802
|
-
map.get(
|
|
17777
|
+
for (const n2 of nodes) {
|
|
17778
|
+
const tn = map.get(n2.id);
|
|
17779
|
+
if (n2.parentId && map.has(n2.parentId)) {
|
|
17780
|
+
map.get(n2.parentId).children.push(tn);
|
|
17803
17781
|
} else {
|
|
17804
17782
|
roots.push(tn);
|
|
17805
17783
|
}
|
|
@@ -17807,16 +17785,16 @@ function buildForest(nodes) {
|
|
|
17807
17785
|
return roots;
|
|
17808
17786
|
}
|
|
17809
17787
|
function buildTree(nodes) {
|
|
17810
|
-
const hasNestedChildren = nodes.some((
|
|
17788
|
+
const hasNestedChildren = nodes.some((n2) => n2.children !== void 0 && n2.children.length > 0);
|
|
17811
17789
|
if (!hasNestedChildren) {
|
|
17812
17790
|
return buildForest(nodes);
|
|
17813
17791
|
}
|
|
17814
|
-
const toTreeNode = (
|
|
17815
|
-
node:
|
|
17816
|
-
children: (
|
|
17792
|
+
const toTreeNode = (n2) => ({
|
|
17793
|
+
node: n2,
|
|
17794
|
+
children: (n2.children ?? []).map(toTreeNode)
|
|
17817
17795
|
});
|
|
17818
|
-
const allIds = new Set(nodes.map((
|
|
17819
|
-
const roots = nodes.filter((
|
|
17796
|
+
const allIds = new Set(nodes.map((n2) => n2.id));
|
|
17797
|
+
const roots = nodes.filter((n2) => !n2.parentId || !allIds.has(n2.parentId));
|
|
17820
17798
|
return roots.map(toTreeNode);
|
|
17821
17799
|
}
|
|
17822
17800
|
var MAX_TREE_DEPTH = 256;
|
|
@@ -18477,10 +18455,10 @@ function buildCycleHubBox(hubNode, ring, totalNodeCount, inputs, hubFontFit) {
|
|
|
18477
18455
|
}
|
|
18478
18456
|
|
|
18479
18457
|
// diagram/layout/smartart-layout-interpreter-cycle-connectors.ts
|
|
18480
|
-
function buildCycleRingConnectors(ring,
|
|
18458
|
+
function buildCycleRingConnectors(ring, n2, connectorCount, ringCentre, elementId) {
|
|
18481
18459
|
return Array.from({ length: connectorCount }, (_, i) => {
|
|
18482
18460
|
const from = ring.centers[i];
|
|
18483
|
-
const to = ring.centers[(i + 1) %
|
|
18461
|
+
const to = ring.centers[(i + 1) % n2];
|
|
18484
18462
|
const midX = (from.x + to.x) / 2;
|
|
18485
18463
|
const midY = (from.y + to.y) / 2;
|
|
18486
18464
|
const pullRadius = Math.max(ring.nodeWidth, ring.nodeHeight) / 2;
|
|
@@ -19035,9 +19013,9 @@ function resolveRingAxisOffset(dimension, boundSize, scale, values) {
|
|
|
19035
19013
|
|
|
19036
19014
|
// diagram/layout/smartart-layout-interpreter-cycle-ring.ts
|
|
19037
19015
|
var DEG_TO_RAD4 = Math.PI / 180;
|
|
19038
|
-
function degenerateRingLayout(
|
|
19016
|
+
function degenerateRingLayout(n2, heightOverWidth, box) {
|
|
19039
19017
|
const boxCentre = { x: box.width / 2, y: box.height / 2 };
|
|
19040
|
-
if (
|
|
19018
|
+
if (n2 <= 0) {
|
|
19041
19019
|
return {
|
|
19042
19020
|
centers: [],
|
|
19043
19021
|
nodeWidth: 0,
|
|
@@ -19047,7 +19025,7 @@ function degenerateRingLayout(n, heightOverWidth, box) {
|
|
|
19047
19025
|
hubHalfHeight: 0
|
|
19048
19026
|
};
|
|
19049
19027
|
}
|
|
19050
|
-
if (
|
|
19028
|
+
if (n2 === 1) {
|
|
19051
19029
|
const w0 = box.width;
|
|
19052
19030
|
const h0 = Math.min(box.height, box.width * Math.max(0.01, heightOverWidth));
|
|
19053
19031
|
return {
|
|
@@ -19061,8 +19039,8 @@ function degenerateRingLayout(n, heightOverWidth, box) {
|
|
|
19061
19039
|
}
|
|
19062
19040
|
return void 0;
|
|
19063
19041
|
}
|
|
19064
|
-
function ringLayoutForGapFactor(
|
|
19065
|
-
if (
|
|
19042
|
+
function ringLayoutForGapFactor(n2, stAngDeg, spanDeg, gapFactor, heightOverWidth, box, hubGeometry, sibTransBulgeRatio, knownNodeWidthPx) {
|
|
19043
|
+
if (n2 === 1 && hubGeometry && knownNodeWidthPx !== void 0 && knownNodeWidthPx > 0) {
|
|
19066
19044
|
return nestedHubSatelliteRingLayout(
|
|
19067
19045
|
stAngDeg,
|
|
19068
19046
|
heightOverWidth,
|
|
@@ -19071,12 +19049,12 @@ function ringLayoutForGapFactor(n, stAngDeg, spanDeg, gapFactor, heightOverWidth
|
|
|
19071
19049
|
knownNodeWidthPx
|
|
19072
19050
|
);
|
|
19073
19051
|
}
|
|
19074
|
-
const degenerate = degenerateRingLayout(
|
|
19052
|
+
const degenerate = degenerateRingLayout(n2, heightOverWidth, box);
|
|
19075
19053
|
if (degenerate) {
|
|
19076
19054
|
return degenerate;
|
|
19077
19055
|
}
|
|
19078
19056
|
const full = Math.abs(spanDeg) >= 360;
|
|
19079
|
-
const step = full ? spanDeg /
|
|
19057
|
+
const step = full ? spanDeg / n2 : spanDeg / (n2 - 1);
|
|
19080
19058
|
const halfStepRad = Math.abs(step) * DEG_TO_RAD4 / 2;
|
|
19081
19059
|
const clampedGap = Math.max(0, gapFactor);
|
|
19082
19060
|
const sinHalf = Math.sin(halfStepRad);
|
|
@@ -19086,7 +19064,7 @@ function ringLayoutForGapFactor(n, stAngDeg, spanDeg, gapFactor, heightOverWidth
|
|
|
19086
19064
|
const r0Hub = hubHalfWidth + hubGeometry.gapRatio + 0.5;
|
|
19087
19065
|
r0 = Math.max(r0, r0Hub);
|
|
19088
19066
|
}
|
|
19089
|
-
const natural = Array.from({ length:
|
|
19067
|
+
const natural = Array.from({ length: n2 }, (_, i) => {
|
|
19090
19068
|
const angleRad = (stAngDeg + i * step - 90) * DEG_TO_RAD4;
|
|
19091
19069
|
return { x: r0 * Math.cos(angleRad), y: r0 * Math.sin(angleRad) };
|
|
19092
19070
|
});
|
|
@@ -19115,10 +19093,10 @@ function ringLayoutForGapFactor(n, stAngDeg, spanDeg, gapFactor, heightOverWidth
|
|
|
19115
19093
|
hubHalfHeight: naturalHubRadius * scaleY
|
|
19116
19094
|
};
|
|
19117
19095
|
}
|
|
19118
|
-
function computeCycleRingLayout(
|
|
19119
|
-
const nestedHubSatellite =
|
|
19096
|
+
function computeCycleRingLayout(n2, stAngDeg, spanDeg, minGapRatio, heightOverWidth, box, absoluteGapPx, hubGeometry, absoluteHubGapPx, sibTransBulgeRatio, knownNodeWidthPx) {
|
|
19097
|
+
const nestedHubSatellite = n2 === 1 && hubGeometry && knownNodeWidthPx !== void 0 && knownNodeWidthPx > 0;
|
|
19120
19098
|
if (!nestedHubSatellite) {
|
|
19121
|
-
const degenerate = degenerateRingLayout(
|
|
19099
|
+
const degenerate = degenerateRingLayout(n2, heightOverWidth, box);
|
|
19122
19100
|
if (degenerate) {
|
|
19123
19101
|
return degenerate;
|
|
19124
19102
|
}
|
|
@@ -19127,7 +19105,7 @@ function computeCycleRingLayout(n, stAngDeg, spanDeg, minGapRatio, heightOverWid
|
|
|
19127
19105
|
const needsHubGapIteration = absoluteHubGapPx !== void 0 && absoluteHubGapPx > 0 && hubGeometry !== void 0;
|
|
19128
19106
|
if (!needsGapIteration && !needsHubGapIteration) {
|
|
19129
19107
|
return ringLayoutForGapFactor(
|
|
19130
|
-
|
|
19108
|
+
n2,
|
|
19131
19109
|
stAngDeg,
|
|
19132
19110
|
spanDeg,
|
|
19133
19111
|
minGapRatio,
|
|
@@ -19142,7 +19120,7 @@ function computeCycleRingLayout(n, stAngDeg, spanDeg, minGapRatio, heightOverWid
|
|
|
19142
19120
|
let hub = hubGeometry;
|
|
19143
19121
|
for (let iteration = 0; iteration < 20; iteration += 1) {
|
|
19144
19122
|
const candidate = ringLayoutForGapFactor(
|
|
19145
|
-
|
|
19123
|
+
n2,
|
|
19146
19124
|
stAngDeg,
|
|
19147
19125
|
spanDeg,
|
|
19148
19126
|
gapFactor,
|
|
@@ -19164,7 +19142,7 @@ function computeCycleRingLayout(n, stAngDeg, spanDeg, minGapRatio, heightOverWid
|
|
|
19164
19142
|
}
|
|
19165
19143
|
}
|
|
19166
19144
|
return ringLayoutForGapFactor(
|
|
19167
|
-
|
|
19145
|
+
n2,
|
|
19168
19146
|
stAngDeg,
|
|
19169
19147
|
spanDeg,
|
|
19170
19148
|
gapFactor,
|
|
@@ -19204,11 +19182,11 @@ function arrangeCycle2(plan, nodes, box, palette, style, elementId, index = EMPT
|
|
|
19204
19182
|
box,
|
|
19205
19183
|
sizeBox
|
|
19206
19184
|
);
|
|
19207
|
-
const
|
|
19185
|
+
const n2 = ringNodes.length;
|
|
19208
19186
|
const startDeg = numericParam(plan.node, "stAng", 0);
|
|
19209
19187
|
const spanDeg = numericParam(plan.node, "spanAng", 360);
|
|
19210
19188
|
const ring = computeCycleRingLayout(
|
|
19211
|
-
|
|
19189
|
+
n2,
|
|
19212
19190
|
startDeg,
|
|
19213
19191
|
spanDeg,
|
|
19214
19192
|
minGapRatio,
|
|
@@ -19221,12 +19199,12 @@ function arrangeCycle2(plan, nodes, box, palette, style, elementId, index = EMPT
|
|
|
19221
19199
|
knownNodeWidthPx
|
|
19222
19200
|
);
|
|
19223
19201
|
const full = Math.abs(spanDeg) >= 360;
|
|
19224
|
-
const connectorCount =
|
|
19225
|
-
const ringStepDeg =
|
|
19202
|
+
const connectorCount = n2 > 0 ? full ? n2 : Math.max(0, n2 - 1) : 0;
|
|
19203
|
+
const ringStepDeg = n2 > 0 ? full ? spanDeg / n2 : spanDeg / Math.max(1, n2 - 1) : 0;
|
|
19226
19204
|
const ringCentre = ring.hubCenter;
|
|
19227
19205
|
const connectors2 = buildCycleRingConnectors(
|
|
19228
19206
|
ring,
|
|
19229
|
-
|
|
19207
|
+
n2,
|
|
19230
19208
|
connectorCount,
|
|
19231
19209
|
ringCentre,
|
|
19232
19210
|
elementId
|
|
@@ -19404,12 +19382,12 @@ function buildHubRenderedNode(arranger, hubNode, box, palette, style, elementId,
|
|
|
19404
19382
|
|
|
19405
19383
|
// diagram/layout/smartart-node-tree-axis.ts
|
|
19406
19384
|
function topLevelSmartArtNodes(nodes) {
|
|
19407
|
-
const hasNestedChildren = nodes.some((
|
|
19385
|
+
const hasNestedChildren = nodes.some((n2) => n2.children !== void 0 && n2.children.length > 0);
|
|
19408
19386
|
if (hasNestedChildren) {
|
|
19409
19387
|
return nodes;
|
|
19410
19388
|
}
|
|
19411
|
-
const ids = new Set(nodes.map((
|
|
19412
|
-
return nodes.filter((
|
|
19389
|
+
const ids = new Set(nodes.map((n2) => n2.id));
|
|
19390
|
+
return nodes.filter((n2) => !n2.parentId || !ids.has(n2.parentId));
|
|
19413
19391
|
}
|
|
19414
19392
|
function smartArtDescendantsWithText(node, childrenOf) {
|
|
19415
19393
|
const out = [];
|
|
@@ -19432,15 +19410,15 @@ function smartArtDescendantsWithText(node, childrenOf) {
|
|
|
19432
19410
|
}
|
|
19433
19411
|
function smartArtChildrenOf(nodes, connections) {
|
|
19434
19412
|
const map = /* @__PURE__ */ new Map();
|
|
19435
|
-
for (const
|
|
19436
|
-
if (
|
|
19437
|
-
map.set(
|
|
19438
|
-
} else if (
|
|
19439
|
-
const list2 = map.get(
|
|
19413
|
+
for (const n2 of nodes) {
|
|
19414
|
+
if (n2.children && n2.children.length > 0) {
|
|
19415
|
+
map.set(n2.id, n2.children);
|
|
19416
|
+
} else if (n2.parentId) {
|
|
19417
|
+
const list2 = map.get(n2.parentId);
|
|
19440
19418
|
if (list2) {
|
|
19441
|
-
list2.push(
|
|
19419
|
+
list2.push(n2);
|
|
19442
19420
|
} else {
|
|
19443
|
-
map.set(
|
|
19421
|
+
map.set(n2.parentId, [n2]);
|
|
19444
19422
|
}
|
|
19445
19423
|
}
|
|
19446
19424
|
}
|
|
@@ -19564,7 +19542,7 @@ function applyCustomLayoutToNode(node, custom, box) {
|
|
|
19564
19542
|
}
|
|
19565
19543
|
}
|
|
19566
19544
|
function applyCustomLayoutOverrides(result, nodes, box) {
|
|
19567
|
-
const nodeById = new Map(nodes.map((
|
|
19545
|
+
const nodeById = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
19568
19546
|
let changed = false;
|
|
19569
19547
|
const nodesOut = result.nodes.map((rendered) => {
|
|
19570
19548
|
const node = rendered.nodeId ? nodeById.get(rendered.nodeId) : void 0;
|
|
@@ -19748,8 +19726,8 @@ function resolveContentSizedExtents(texts, crossExtentPx, fontSizePx, table, lin
|
|
|
19748
19726
|
lines * fontSizePx * smartArtLineEm(table) * lineSpacingFactor + marginVerticalPx + 2 * cornerInsetPx
|
|
19749
19727
|
);
|
|
19750
19728
|
});
|
|
19751
|
-
const
|
|
19752
|
-
const gapTotal = Math.max(0,
|
|
19729
|
+
const n2 = natural.length;
|
|
19730
|
+
const gapTotal = Math.max(0, n2 - 1) * gap;
|
|
19753
19731
|
const total = natural.reduce((sum, extent) => sum + extent, 0) + gapTotal;
|
|
19754
19732
|
if (total <= usableMain || total - gapTotal <= 0) {
|
|
19755
19733
|
return natural;
|
|
@@ -20027,24 +20005,24 @@ function resolveMainAxisGap(index, role, mainAxisType, ceilingPx) {
|
|
|
20027
20005
|
}
|
|
20028
20006
|
return void 0;
|
|
20029
20007
|
}
|
|
20030
|
-
function resolveMainAxisLayout(constraints, index, role, mainAxisType, ceilingPx, usableMain, begPad, endPad,
|
|
20008
|
+
function resolveMainAxisLayout(constraints, index, role, mainAxisType, ceilingPx, usableMain, begPad, endPad, n2, clampRatio) {
|
|
20031
20009
|
const explicitSib = resolveRatioConstraint(constraints, index, role, ["sibSp", "sp"], Number.NaN);
|
|
20032
20010
|
if (!Number.isNaN(explicitSib)) {
|
|
20033
20011
|
const sib2 = clampRatio(explicitSib);
|
|
20034
|
-
const denom2 = begPad + endPad +
|
|
20035
|
-
const mainExtent2 =
|
|
20012
|
+
const denom2 = begPad + endPad + n2 + Math.max(0, n2 - 1) * sib2;
|
|
20013
|
+
const mainExtent2 = n2 > 0 ? usableMain / denom2 : usableMain;
|
|
20036
20014
|
return { mainExtent: mainExtent2, gap: sib2 * mainExtent2 };
|
|
20037
20015
|
}
|
|
20038
20016
|
const inferredGap = resolveMainAxisGap(index, role, mainAxisType, ceilingPx);
|
|
20039
20017
|
if (inferredGap && "absolutePx" in inferredGap) {
|
|
20040
20018
|
const gapAbs = Math.max(0, inferredGap.absolutePx);
|
|
20041
|
-
const denom2 = begPad + endPad +
|
|
20042
|
-
const mainExtent2 =
|
|
20019
|
+
const denom2 = begPad + endPad + n2;
|
|
20020
|
+
const mainExtent2 = n2 > 0 ? Math.max(0, usableMain - Math.max(0, n2 - 1) * gapAbs) / denom2 : usableMain;
|
|
20043
20021
|
return { mainExtent: mainExtent2, gap: gapAbs };
|
|
20044
20022
|
}
|
|
20045
20023
|
const sib = clampRatio(inferredGap && "relative" in inferredGap ? inferredGap.relative : 0.25);
|
|
20046
|
-
const denom = begPad + endPad +
|
|
20047
|
-
const mainExtent =
|
|
20024
|
+
const denom = begPad + endPad + n2 + Math.max(0, n2 - 1) * sib;
|
|
20025
|
+
const mainExtent = n2 > 0 ? usableMain / denom : usableMain;
|
|
20048
20026
|
return { mainExtent, gap: sib * mainExtent };
|
|
20049
20027
|
}
|
|
20050
20028
|
|
|
@@ -20091,15 +20069,15 @@ function arrangeRecursiveTable(view, plan, nodes, box, palette, style, elementId
|
|
|
20091
20069
|
const reversed = resolvedLinDir(view, plan.node, nodes.length, presLayoutVars, "fromT") === "fromB";
|
|
20092
20070
|
const rowChild = findRowChild(view, plan.node, presLayoutVars);
|
|
20093
20071
|
const colReversed = rowChild ? resolvedLinDir(view, rowChild, nodes.length, presLayoutVars, "fromL") === "fromR" : false;
|
|
20094
|
-
const byId = new Map(nodes.map((
|
|
20095
|
-
const childrenIn = (
|
|
20072
|
+
const byId = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
20073
|
+
const childrenIn = (n2) => (childrenOf.get(n2.id) ?? []).filter((c) => byId.has(c.id));
|
|
20096
20074
|
const childIds = /* @__PURE__ */ new Set();
|
|
20097
|
-
for (const
|
|
20098
|
-
for (const c of childrenIn(
|
|
20075
|
+
for (const n2 of nodes) {
|
|
20076
|
+
for (const c of childrenIn(n2)) {
|
|
20099
20077
|
childIds.add(c.id);
|
|
20100
20078
|
}
|
|
20101
20079
|
}
|
|
20102
|
-
const roots = nodes.filter((
|
|
20080
|
+
const roots = nodes.filter((n2) => !childIds.has(n2.id));
|
|
20103
20081
|
const depthOf2 = /* @__PURE__ */ new Map();
|
|
20104
20082
|
let maxDepth2 = 0;
|
|
20105
20083
|
const depthStack = roots.map((r) => ({
|
|
@@ -20120,11 +20098,11 @@ function arrangeRecursiveTable(view, plan, nodes, box, palette, style, elementId
|
|
|
20120
20098
|
const rowGap = DEFAULT_GAP_RATIO2 * rowHeight;
|
|
20121
20099
|
const rowY = (depth) => (reversed ? generations - 1 - depth : depth) * (rowHeight + rowGap);
|
|
20122
20100
|
const splitAcross = (items, x, width) => {
|
|
20123
|
-
const
|
|
20124
|
-
if (
|
|
20101
|
+
const n2 = items.length;
|
|
20102
|
+
if (n2 === 0) {
|
|
20125
20103
|
return [];
|
|
20126
20104
|
}
|
|
20127
|
-
const denom =
|
|
20105
|
+
const denom = n2 + Math.max(0, n2 - 1) * DEFAULT_GAP_RATIO2;
|
|
20128
20106
|
const colWidth = width / denom;
|
|
20129
20107
|
const colGap = DEFAULT_GAP_RATIO2 * colWidth;
|
|
20130
20108
|
const ordered2 = colReversed ? [...items].reverse() : items;
|
|
@@ -20190,24 +20168,24 @@ function arrangeRecursiveTable(view, plan, nodes, box, palette, style, elementId
|
|
|
20190
20168
|
}
|
|
20191
20169
|
|
|
20192
20170
|
// diagram/layout/smartart-layout-snake-grid.ts
|
|
20193
|
-
function snakeGridDims(plan,
|
|
20171
|
+
function snakeGridDims(plan, n2, w, h, flowDir) {
|
|
20194
20172
|
const bkpt = algorithmParam(plan.node, "bkpt");
|
|
20195
20173
|
const fixedVal = findConstraint(plan.node.constraints, "bkPtFixedVal")?.value;
|
|
20196
20174
|
if (bkpt === "fixed" && typeof fixedVal === "number" && fixedVal > 0) {
|
|
20197
|
-
const lineLength = Math.max(1, Math.min(
|
|
20175
|
+
const lineLength = Math.max(1, Math.min(n2, Math.round(fixedVal)));
|
|
20198
20176
|
if (flowDir === "col") {
|
|
20199
20177
|
const rows = lineLength;
|
|
20200
|
-
return { cols: Math.max(1, Math.ceil(
|
|
20178
|
+
return { cols: Math.max(1, Math.ceil(n2 / rows)), rows };
|
|
20201
20179
|
}
|
|
20202
20180
|
const cols2 = lineLength;
|
|
20203
|
-
return { cols: cols2, rows: Math.max(1, Math.ceil(
|
|
20181
|
+
return { cols: cols2, rows: Math.max(1, Math.ceil(n2 / cols2)) };
|
|
20204
20182
|
}
|
|
20205
20183
|
if (flowDir === "col") {
|
|
20206
|
-
const rows = Math.max(1, Math.round(Math.sqrt(
|
|
20207
|
-
return { cols: Math.max(1, Math.ceil(
|
|
20184
|
+
const rows = Math.max(1, Math.round(Math.sqrt(n2 * Math.max(0.2, h / Math.max(1, w)))));
|
|
20185
|
+
return { cols: Math.max(1, Math.ceil(n2 / rows)), rows };
|
|
20208
20186
|
}
|
|
20209
|
-
const cols = Math.max(1, Math.round(Math.sqrt(
|
|
20210
|
-
return { cols, rows: Math.max(1, Math.ceil(
|
|
20187
|
+
const cols = Math.max(1, Math.round(Math.sqrt(n2 * Math.max(0.2, w / Math.max(1, h)))));
|
|
20188
|
+
return { cols, rows: Math.max(1, Math.ceil(n2 / cols)) };
|
|
20211
20189
|
}
|
|
20212
20190
|
function snakeCell(i, dims, flowDir, sameDir, grDir) {
|
|
20213
20191
|
const primaryCount = flowDir === "col" ? dims.rows : dims.cols;
|
|
@@ -20231,7 +20209,7 @@ function snakeCell(i, dims, flowDir, sameDir, grDir) {
|
|
|
20231
20209
|
function arrangeSnake2(plan, nodes, box, palette, style, elementId, index = EMPTY_CONSTRAINT_INDEX, childrenOf, fontName) {
|
|
20232
20210
|
const { width: w, height: h } = box;
|
|
20233
20211
|
const ctx = styleContext(style);
|
|
20234
|
-
const
|
|
20212
|
+
const n2 = nodes.length;
|
|
20235
20213
|
const sib = resolveRatioConstraint(
|
|
20236
20214
|
plan.node.constraints,
|
|
20237
20215
|
index,
|
|
@@ -20243,7 +20221,7 @@ function arrangeSnake2(plan, nodes, box, palette, style, elementId, index = EMPT
|
|
|
20243
20221
|
const grDirRaw = algorithmParam(plan.node, "grDir");
|
|
20244
20222
|
const grDir = grDirRaw === "tR" || grDirRaw === "bL" || grDirRaw === "bR" ? grDirRaw : "tL";
|
|
20245
20223
|
const sameDir = algorithmParam(plan.node, "contDir") === "sameDir";
|
|
20246
|
-
const { cols, rows } = snakeGridDims(plan,
|
|
20224
|
+
const { cols, rows } = snakeGridDims(plan, n2, w, h, flowDir);
|
|
20247
20225
|
const usableW = w - INSET * 2;
|
|
20248
20226
|
const usableH = h - INSET * 2;
|
|
20249
20227
|
const mainCount = flowDir === "col" ? rows : cols;
|
|
@@ -20308,7 +20286,7 @@ function arrangeSnake2(plan, nodes, box, palette, style, elementId, index = EMPT
|
|
|
20308
20286
|
height: cellH,
|
|
20309
20287
|
node,
|
|
20310
20288
|
index: i,
|
|
20311
|
-
total:
|
|
20289
|
+
total: n2,
|
|
20312
20290
|
palette,
|
|
20313
20291
|
style,
|
|
20314
20292
|
ctx,
|
|
@@ -20353,7 +20331,7 @@ function arrangeLinear2(view, plan, flow, nodes, box, palette, style, elementId,
|
|
|
20353
20331
|
const endPad = clampRatio(resolveRatioConstraint(constraints, index, role, ["endPad"], 0));
|
|
20354
20332
|
const aspect = itemAspect(view, plan, index, nodes.length, presLayoutVars);
|
|
20355
20333
|
const flow2 = ordered(nodes, flow);
|
|
20356
|
-
const
|
|
20334
|
+
const n2 = flow2.length;
|
|
20357
20335
|
const horizontal = flow.orientation === "horizontal";
|
|
20358
20336
|
const usableMain = (horizontal ? w : h) - INSET * 2;
|
|
20359
20337
|
const usableCross = (horizontal ? h : w) - INSET * 2;
|
|
@@ -20367,7 +20345,7 @@ function arrangeLinear2(view, plan, flow, nodes, box, palette, style, elementId,
|
|
|
20367
20345
|
usableMain,
|
|
20368
20346
|
begPad,
|
|
20369
20347
|
endPad,
|
|
20370
|
-
|
|
20348
|
+
n2,
|
|
20371
20349
|
clampRatio
|
|
20372
20350
|
);
|
|
20373
20351
|
const itemTemplate = itemNode(plan.node);
|
|
@@ -20427,7 +20405,7 @@ function arrangeLinear2(view, plan, flow, nodes, box, palette, style, elementId,
|
|
|
20427
20405
|
height: horizontal ? itemH : itemMainExtent,
|
|
20428
20406
|
node,
|
|
20429
20407
|
index: i,
|
|
20430
|
-
total:
|
|
20408
|
+
total: n2,
|
|
20431
20409
|
palette,
|
|
20432
20410
|
style,
|
|
20433
20411
|
ctx,
|
|
@@ -20935,7 +20913,7 @@ function resolveIterationRect(dims, box, iteration, iterationCount) {
|
|
|
20935
20913
|
|
|
20936
20914
|
// diagram/layout/smartart-layout-interpreter-composite-group-slots.ts
|
|
20937
20915
|
function contentSignature(content) {
|
|
20938
|
-
return content.map((
|
|
20916
|
+
return content.map((n2) => n2.id).sort().join(" ");
|
|
20939
20917
|
}
|
|
20940
20918
|
function resolveGroupedSlots(candidates, box, index) {
|
|
20941
20919
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -21089,18 +21067,18 @@ function renderForEachBoundSlots(slots, flat, box, absX, absY, childrenOf, ctx,
|
|
|
21089
21067
|
// diagram/hierarchy/smartart-hierarchy-pitch.ts
|
|
21090
21068
|
var GENERATION_MARGIN_RATIO = 0.1675;
|
|
21091
21069
|
function computeAxisPitch(dimension, margin, itemSize, count, fixedGapRatio) {
|
|
21092
|
-
const
|
|
21093
|
-
const gap =
|
|
21070
|
+
const n2 = Math.max(1, count);
|
|
21071
|
+
const gap = n2 <= 1 ? 0 : fixedGapRatio !== void 0 ? itemSize * Math.max(0, fixedGapRatio) : Math.max(0, (dimension - margin - n2 * itemSize) / (n2 - 1));
|
|
21094
21072
|
const pitch = itemSize + gap;
|
|
21095
|
-
const centeredShift = (dimension -
|
|
21096
|
-
const maxShift = dimension -
|
|
21073
|
+
const centeredShift = (dimension - n2 * pitch + margin) / 2;
|
|
21074
|
+
const maxShift = dimension - n2 * itemSize - gap * (n2 - 0.5);
|
|
21097
21075
|
return { pitch, shift: Math.min(centeredShift, maxShift) };
|
|
21098
21076
|
}
|
|
21099
21077
|
function centeredAxisPitch(dimension, itemSize, gapRatio, count) {
|
|
21100
|
-
const
|
|
21101
|
-
const gap =
|
|
21078
|
+
const n2 = Math.max(1, count);
|
|
21079
|
+
const gap = n2 > 1 ? itemSize * Math.max(0, gapRatio) : 0;
|
|
21102
21080
|
const pitch = itemSize + gap;
|
|
21103
|
-
const span =
|
|
21081
|
+
const span = n2 * itemSize + Math.max(0, n2 - 1) * gap;
|
|
21104
21082
|
const shift = (dimension - span) / 2;
|
|
21105
21083
|
return { pitch, shift };
|
|
21106
21084
|
}
|
|
@@ -21635,7 +21613,7 @@ function findNamedNode(node, name) {
|
|
|
21635
21613
|
function arrangePyramid(plan, nodes, box, palette, style, elementId, index = EMPTY_CONSTRAINT_INDEX, childrenOf, fontName) {
|
|
21636
21614
|
const { width: w, height: h } = box;
|
|
21637
21615
|
const ctx = styleContext(style);
|
|
21638
|
-
const
|
|
21616
|
+
const n2 = nodes.length;
|
|
21639
21617
|
const bandW = w - DEFAULT_INSET * 2;
|
|
21640
21618
|
const bandCx = DEFAULT_INSET + bandW / 2;
|
|
21641
21619
|
const gapRatio = resolveRatioConstraint(
|
|
@@ -21646,7 +21624,7 @@ function arrangePyramid(plan, nodes, box, palette, style, elementId, index = EMP
|
|
|
21646
21624
|
DEFAULT_GAP_RATIO3
|
|
21647
21625
|
);
|
|
21648
21626
|
const usableH = h - DEFAULT_INSET * 2;
|
|
21649
|
-
const bandH =
|
|
21627
|
+
const bandH = n2 > 0 ? usableH / (n2 + Math.max(0, n2 - 1) * gapRatio) : usableH;
|
|
21650
21628
|
const gap = gapRatio * bandH;
|
|
21651
21629
|
const lvlNodeName = algorithmParam(plan.node, "pyraLvlNode");
|
|
21652
21630
|
const lvlNode = lvlNodeName ? findNamedNode(plan.node, lvlNodeName) : void 0;
|
|
@@ -21660,9 +21638,9 @@ function arrangePyramid(plan, nodes, box, palette, style, elementId, index = EMP
|
|
|
21660
21638
|
const halfBandH = (slotBot - slotTop) * lvlHeightRatio / 2;
|
|
21661
21639
|
const yTop = slotMidY - halfBandH;
|
|
21662
21640
|
const yBot = slotMidY + halfBandH;
|
|
21663
|
-
const effectiveI = inverted ?
|
|
21664
|
-
const fTop = effectiveI /
|
|
21665
|
-
const fBot = (effectiveI + 1) /
|
|
21641
|
+
const effectiveI = inverted ? n2 - 1 - i : i;
|
|
21642
|
+
const fTop = effectiveI / n2;
|
|
21643
|
+
const fBot = (effectiveI + 1) / n2;
|
|
21666
21644
|
const halfTop = bandW * fTop / 2 * lvlWidthRatio;
|
|
21667
21645
|
const halfBot = bandW * fBot / 2 * lvlWidthRatio;
|
|
21668
21646
|
return { node, yTop, yBot, halfTop, halfBot };
|
|
@@ -21699,7 +21677,7 @@ function arrangePyramid(plan, nodes, box, palette, style, elementId, index = EMP
|
|
|
21699
21677
|
fontHeight: bandH,
|
|
21700
21678
|
node,
|
|
21701
21679
|
index: i,
|
|
21702
|
-
total:
|
|
21680
|
+
total: n2,
|
|
21703
21681
|
palette,
|
|
21704
21682
|
style,
|
|
21705
21683
|
ctx,
|
|
@@ -21849,7 +21827,7 @@ function resolveHierarchyItemNode(algorithmNode) {
|
|
|
21849
21827
|
return first2;
|
|
21850
21828
|
}
|
|
21851
21829
|
const allNames = new Set(
|
|
21852
|
-
candidates.map((c) => c.name).filter((
|
|
21830
|
+
candidates.map((c) => c.name).filter((n2) => n2 !== void 0)
|
|
21853
21831
|
);
|
|
21854
21832
|
const constraints = algorithmNode.allConstraints ?? algorithmNode.constraints ?? [];
|
|
21855
21833
|
for (const candidate of candidates) {
|
|
@@ -23003,11 +22981,11 @@ function transposeResult(result, realWidth, realHeight) {
|
|
|
23003
22981
|
// diagram/hierarchy/smartart-hierarchy-fit-item-box.ts
|
|
23004
22982
|
var ALL_CHILDREN_HANG_EXTRA_RATIO = 0.6587;
|
|
23005
22983
|
function fitItemBox(box, columns, levels, sibSpRatio, aspectRatio, generationGapRatio, marginXRatio, marginYRatio, maxHangDepth = 0, clampToNaturalAspect = true, maxHangRows = maxHangDepth, allChildrenHang = false, hangHeightRatio = HANG_HEIGHT_RATIO, compositeChainHeightRatio, hangingColumns = columns) {
|
|
23006
|
-
const
|
|
22984
|
+
const n2 = Math.max(1, columns);
|
|
23007
22985
|
const usableW = box.width - 2 * box.width * marginXRatio;
|
|
23008
22986
|
const allHangExtra = allChildrenHang ? ALL_CHILDREN_HANG_EXTRA_RATIO : 0;
|
|
23009
|
-
const hangColumnFraction =
|
|
23010
|
-
const widthFit = usableW / (
|
|
22987
|
+
const hangColumnFraction = n2 > 0 ? Math.min(1, Math.max(0, hangingColumns) / n2) : 0;
|
|
22988
|
+
const widthFit = usableW / (n2 + Math.max(0, n2 - 1) * sibSpRatio + maxHangDepth * HIER_TAIL_OFFSET_RATIO * hangColumnFraction + allHangExtra);
|
|
23011
22989
|
const generations = Math.max(1, levels);
|
|
23012
22990
|
const usableH = box.height - 2 * box.height * marginYRatio;
|
|
23013
22991
|
const heightFit = usableH / (generations + maxHangRows + Math.max(0, generations - 1) * generationGapRatio + maxHangRows * hangHeightRatio);
|
|
@@ -24103,17 +24081,17 @@ function resolvePyraAcctRatio(planNode, index) {
|
|
|
24103
24081
|
const constraints = planNode.allConstraints ?? planNode.constraints;
|
|
24104
24082
|
return resolveRatioConstraint(constraints, index, roleOf(planNode), ["pyraAcctRatio"], 0);
|
|
24105
24083
|
}
|
|
24106
|
-
function pyramidRowGeometry(i,
|
|
24084
|
+
function pyramidRowGeometry(i, n2, box, gapRatio, inverted) {
|
|
24107
24085
|
const bandW = box.width - DEFAULT_INSET * 2;
|
|
24108
24086
|
const bandCx = DEFAULT_INSET + bandW / 2;
|
|
24109
24087
|
const usableH = box.height - DEFAULT_INSET * 2;
|
|
24110
|
-
const bandH =
|
|
24088
|
+
const bandH = n2 > 0 ? usableH / (n2 + Math.max(0, n2 - 1) * gapRatio) : usableH;
|
|
24111
24089
|
const gap = gapRatio * bandH;
|
|
24112
24090
|
const slotTop = DEFAULT_INSET + i * (bandH + gap);
|
|
24113
24091
|
const slotBot = slotTop + bandH;
|
|
24114
|
-
const effectiveI = inverted ?
|
|
24115
|
-
const fTop = effectiveI /
|
|
24116
|
-
const fBot = (effectiveI + 1) /
|
|
24092
|
+
const effectiveI = inverted ? n2 - 1 - i : i;
|
|
24093
|
+
const fTop = effectiveI / n2;
|
|
24094
|
+
const fBot = (effectiveI + 1) / n2;
|
|
24117
24095
|
const halfTop = bandW * fTop / 2;
|
|
24118
24096
|
const halfBot = bandW * fBot / 2;
|
|
24119
24097
|
return {
|
|
@@ -24131,7 +24109,7 @@ function repositionPyramidBands(result, box, planNode, topLevelIds, flatNodes, h
|
|
|
24131
24109
|
return result;
|
|
24132
24110
|
}
|
|
24133
24111
|
const scale = 1 - pyraAcctRatio;
|
|
24134
|
-
const
|
|
24112
|
+
const n2 = topLevelIds.length;
|
|
24135
24113
|
const rowIndexById = new Map(topLevelIds.map((id, i) => [id, i]));
|
|
24136
24114
|
const parentIdById = new Map(flatNodes.map((node) => [node.id, node.parentId]));
|
|
24137
24115
|
const gapRatio = resolveRatioConstraint(
|
|
@@ -24155,7 +24133,7 @@ function repositionPyramidBands(result, box, planNode, topLevelIds, flatNodes, h
|
|
|
24155
24133
|
if (rowIndex === void 0) {
|
|
24156
24134
|
return rendered;
|
|
24157
24135
|
}
|
|
24158
|
-
const row = pyramidRowGeometry(rowIndex,
|
|
24136
|
+
const row = pyramidRowGeometry(rowIndex, n2, box, gapRatio, inverted);
|
|
24159
24137
|
const scaledLeftTop = scale * row.leftTop;
|
|
24160
24138
|
const scaledRightTop = scale * row.rightTop;
|
|
24161
24139
|
const scaledLeftBot = scale * row.leftBot;
|
|
@@ -24273,12 +24251,12 @@ function runArrangement(view, input) {
|
|
|
24273
24251
|
input.connections,
|
|
24274
24252
|
presLayoutVars
|
|
24275
24253
|
) : withNamedRule;
|
|
24276
|
-
const hasAccentSomewhere = arranged.some((node) => flat.some((
|
|
24254
|
+
const hasAccentSomewhere = arranged.some((node) => flat.some((n2) => n2.parentId === node.id));
|
|
24277
24255
|
const withPyramidBands = plan.kind === "pyramid" ? repositionPyramidBands(
|
|
24278
24256
|
withItemRoles,
|
|
24279
24257
|
box,
|
|
24280
24258
|
plan.node,
|
|
24281
|
-
arranged.map((
|
|
24259
|
+
arranged.map((n2) => n2.id),
|
|
24282
24260
|
flat,
|
|
24283
24261
|
hasAccentSomewhere,
|
|
24284
24262
|
constraintIndex
|
|
@@ -24921,7 +24899,7 @@ function descendants2(root, local) {
|
|
|
24921
24899
|
function orderedColorTransforms(channels, transforms) {
|
|
24922
24900
|
let { r, g: g2, b } = channels;
|
|
24923
24901
|
let alpha = 1;
|
|
24924
|
-
const
|
|
24902
|
+
const wrap2 = (value) => (value % 360 + 360) % 360;
|
|
24925
24903
|
for (const transform of transforms) {
|
|
24926
24904
|
const { name, value } = transform;
|
|
24927
24905
|
const fraction = parseDrawingFraction(value);
|
|
@@ -24939,14 +24917,14 @@ function orderedColorTransforms(channels, transforms) {
|
|
|
24939
24917
|
[r, g2, b] = [mix(r), mix(g2), mix(b)];
|
|
24940
24918
|
} else {
|
|
24941
24919
|
const hsl = rgbToHsl(r, g2, b);
|
|
24942
|
-
if (name === "comp") hsl.h =
|
|
24920
|
+
if (name === "comp") hsl.h = wrap2(hsl.h + 180);
|
|
24943
24921
|
else if (name === "hue") {
|
|
24944
24922
|
const hue = parseDrawingHueDegrees(value);
|
|
24945
|
-
if (hue !== void 0) hsl.h =
|
|
24923
|
+
if (hue !== void 0) hsl.h = wrap2(hue);
|
|
24946
24924
|
} else if (name === "hueOff") {
|
|
24947
24925
|
const hue = parseDrawingHueDegrees(value);
|
|
24948
|
-
if (hue !== void 0) hsl.h =
|
|
24949
|
-
} else if (name === "hueMod" && fraction !== void 0) hsl.h =
|
|
24926
|
+
if (hue !== void 0) hsl.h = wrap2(hsl.h + hue);
|
|
24927
|
+
} else if (name === "hueMod" && fraction !== void 0) hsl.h = wrap2(hsl.h * fraction);
|
|
24950
24928
|
else if (name === "sat" && fraction !== void 0) hsl.s = clampUnitInterval(fraction);
|
|
24951
24929
|
else if (name === "satMod" && fraction !== void 0) hsl.s *= fraction;
|
|
24952
24930
|
else if (name === "satOff" && fraction !== void 0)
|
|
@@ -25104,13 +25082,13 @@ function resolveDrawingColor(color, theme, options) {
|
|
|
25104
25082
|
}
|
|
25105
25083
|
if (["hue", "hueMod", "hueOff", "sat", "satMod", "satOff", "lum", "lumMod", "lumOff"].some(has)) {
|
|
25106
25084
|
const hsl = rgbToHsl(r, g2, b);
|
|
25107
|
-
const
|
|
25085
|
+
const wrap2 = (degrees) => (degrees % 360 + 360) % 360;
|
|
25108
25086
|
const hueAbs = parseDrawingHueDegrees(find("hue"));
|
|
25109
|
-
if (hueAbs !== void 0) hsl.h =
|
|
25087
|
+
if (hueAbs !== void 0) hsl.h = wrap2(hueAbs);
|
|
25110
25088
|
const hueMod = parseDrawingFraction(find("hueMod"));
|
|
25111
|
-
if (hueMod !== void 0) hsl.h =
|
|
25089
|
+
if (hueMod !== void 0) hsl.h = wrap2(hsl.h * hueMod);
|
|
25112
25090
|
const hueOff = parseDrawingHueDegrees(find("hueOff"));
|
|
25113
|
-
if (hueOff !== void 0) hsl.h =
|
|
25091
|
+
if (hueOff !== void 0) hsl.h = wrap2(hsl.h + hueOff);
|
|
25114
25092
|
const satAbs = parseDrawingFraction(find("sat"));
|
|
25115
25093
|
if (satAbs !== void 0) hsl.s = clampUnitInterval(satAbs);
|
|
25116
25094
|
const satMod = parseDrawingFraction(find("satMod"));
|
|
@@ -25280,12 +25258,12 @@ function parseArtisticPictureExtension(node) {
|
|
|
25280
25258
|
const key = ARTISTIC_PRIMARY_ATTRIBUTE[effect.localName];
|
|
25281
25259
|
if (!key) return void 0;
|
|
25282
25260
|
const raw = key ? effect.getAttribute(key) : null;
|
|
25283
|
-
const
|
|
25284
|
-
if (!Number.isFinite(
|
|
25261
|
+
const n2 = raw === null ? 0 : Number(raw);
|
|
25262
|
+
if (!Number.isFinite(n2)) return void 0;
|
|
25285
25263
|
return {
|
|
25286
25264
|
kind: "artistic",
|
|
25287
25265
|
name: effect.localName,
|
|
25288
|
-
radius: effect.localName === "artisticBlur" ?
|
|
25266
|
+
radius: effect.localName === "artisticBlur" ? n2 : n2 / 1e3,
|
|
25289
25267
|
baked: true,
|
|
25290
25268
|
...unhandled.length ? { unhandled } : {}
|
|
25291
25269
|
};
|
|
@@ -25397,10 +25375,10 @@ function parseStandardPictureEffect(node) {
|
|
|
25397
25375
|
const raw = node.getAttribute(attribute);
|
|
25398
25376
|
if (raw === null) continue;
|
|
25399
25377
|
const percent = raw.endsWith("%");
|
|
25400
|
-
const
|
|
25401
|
-
if (!Number.isFinite(
|
|
25378
|
+
const n2 = Number(percent ? raw.slice(0, -1) : raw) / (key === "hue" ? 6e4 : key === "radiusEmu" ? 1 : percent ? 100 : 1e5);
|
|
25379
|
+
if (!Number.isFinite(n2) || key === "hue" && (n2 < 0 || n2 >= 360) || key === "threshold" && (n2 < 0 || n2 > 1) || key === "radiusEmu" && (!Number.isSafeInteger(n2) || n2 < 0) || ["saturation", "luminance", "amount"].includes(key) && name !== "alphaMod" && (n2 < (name === "alphaRepl" ? 0 : -1) || n2 > 1))
|
|
25402
25380
|
return void 0;
|
|
25403
|
-
values[key] =
|
|
25381
|
+
values[key] = n2;
|
|
25404
25382
|
}
|
|
25405
25383
|
if (["biLevel", "alphaBiLevel"].includes(name) && values.threshold === void 0)
|
|
25406
25384
|
return void 0;
|
|
@@ -25410,9 +25388,9 @@ function parseStandardPictureEffect(node) {
|
|
|
25410
25388
|
const nested = cont ? elements(cont) : [];
|
|
25411
25389
|
if (nested.length !== 1 || nested[0]?.localName !== "alphaModFix") return void 0;
|
|
25412
25390
|
const raw = nested[0].getAttribute("amt") ?? "100000";
|
|
25413
|
-
const
|
|
25414
|
-
if (!Number.isFinite(
|
|
25415
|
-
values.amount =
|
|
25391
|
+
const n2 = Number(raw.endsWith("%") ? raw.slice(0, -1) : raw) / (raw.endsWith("%") ? 100 : 1e5);
|
|
25392
|
+
if (!Number.isFinite(n2) || n2 < 0) return void 0;
|
|
25393
|
+
values.amount = n2;
|
|
25416
25394
|
}
|
|
25417
25395
|
let colors = [];
|
|
25418
25396
|
if (name === "duotone") {
|
|
@@ -25508,8 +25486,8 @@ function picturePercentage(value) {
|
|
|
25508
25486
|
const text2 = String(value ?? "").trim();
|
|
25509
25487
|
if (!text2) return void 0;
|
|
25510
25488
|
const percent = text2.endsWith("%");
|
|
25511
|
-
const
|
|
25512
|
-
return Number.isFinite(
|
|
25489
|
+
const n2 = Number(percent ? text2.slice(0, -1) : text2) / (percent ? 100 : 1e5);
|
|
25490
|
+
return Number.isFinite(n2) ? n2 : void 0;
|
|
25513
25491
|
}
|
|
25514
25492
|
function readPictureEffect(name, attribute) {
|
|
25515
25493
|
if (name === "grayscl") return { kind: "grayscale" };
|
|
@@ -25589,8 +25567,8 @@ function applyPictureEffects(blip, effects) {
|
|
|
25589
25567
|
// drawingml/read-3d-values.ts
|
|
25590
25568
|
var integer = (value) => {
|
|
25591
25569
|
if (value === void 0 || value === null || String(value).trim() === "") return void 0;
|
|
25592
|
-
const
|
|
25593
|
-
return Number.isSafeInteger(
|
|
25570
|
+
const n2 = Number(value);
|
|
25571
|
+
return Number.isSafeInteger(n2) ? n2 : void 0;
|
|
25594
25572
|
};
|
|
25595
25573
|
function readScene3DValues(node, read) {
|
|
25596
25574
|
const out = {};
|
|
@@ -25711,16 +25689,16 @@ function parsePictureLayout(fill) {
|
|
|
25711
25689
|
["scaleX", "sx"],
|
|
25712
25690
|
["scaleY", "sy"]
|
|
25713
25691
|
]) {
|
|
25714
|
-
const
|
|
25715
|
-
if (
|
|
25692
|
+
const n2 = picturePercentage(tile.getAttribute(attr));
|
|
25693
|
+
if (n2 !== void 0) value[key] = n2;
|
|
25716
25694
|
}
|
|
25717
25695
|
for (const [key, attr] of [
|
|
25718
25696
|
["offsetXEmu", "tx"],
|
|
25719
25697
|
["offsetYEmu", "ty"]
|
|
25720
25698
|
]) {
|
|
25721
25699
|
const raw = tile.getAttribute(attr);
|
|
25722
|
-
const
|
|
25723
|
-
if (Number.isSafeInteger(
|
|
25700
|
+
const n2 = raw === null ? NaN : Number(raw);
|
|
25701
|
+
if (Number.isSafeInteger(n2)) value[key] = n2;
|
|
25724
25702
|
}
|
|
25725
25703
|
const alignment = tile.getAttribute("algn");
|
|
25726
25704
|
if (alignment) value.alignment = alignment;
|
|
@@ -25775,14 +25753,14 @@ function applyPictureLayout(fill, layout) {
|
|
|
25775
25753
|
["offsetXEmu", "tx"],
|
|
25776
25754
|
["offsetYEmu", "ty"]
|
|
25777
25755
|
]) {
|
|
25778
|
-
const
|
|
25779
|
-
if (
|
|
25756
|
+
const n2 = layout.tile[key];
|
|
25757
|
+
if (n2 !== void 0 && (!Number.isFinite(n2) || (name === "sx" || name === "sy" ? n2 <= 0 : !Number.isSafeInteger(n2))))
|
|
25780
25758
|
throw new RangeError("Invalid picture tile");
|
|
25781
|
-
if (
|
|
25759
|
+
if (n2 !== before.tile?.[key])
|
|
25782
25760
|
attr(
|
|
25783
25761
|
tile,
|
|
25784
25762
|
name,
|
|
25785
|
-
|
|
25763
|
+
n2 === void 0 ? void 0 : Math.round(n2 * (name === "sx" || name === "sy" ? 1e5 : 1)),
|
|
25786
25764
|
void 0
|
|
25787
25765
|
);
|
|
25788
25766
|
}
|
|
@@ -25799,11 +25777,11 @@ function applyPictureLayout(fill, layout) {
|
|
|
25799
25777
|
if (tile) fill.removeChild(tile);
|
|
25800
25778
|
const rect2 = make(make(fill, "stretch"), "fillRect");
|
|
25801
25779
|
for (const key of ["l", "t", "r", "b"]) {
|
|
25802
|
-
const
|
|
25803
|
-
if (
|
|
25780
|
+
const n2 = layout.fillRect?.[key];
|
|
25781
|
+
if (n2 !== void 0 && !Number.isFinite(n2))
|
|
25804
25782
|
throw new RangeError("Invalid picture fill rectangle");
|
|
25805
|
-
if (
|
|
25806
|
-
attr(rect2, key,
|
|
25783
|
+
if (n2 !== before.fillRect?.[key])
|
|
25784
|
+
attr(rect2, key, n2 === void 0 ? void 0 : Math.round(n2 * 1e5), void 0);
|
|
25807
25785
|
}
|
|
25808
25786
|
}
|
|
25809
25787
|
}
|
|
@@ -26529,12 +26507,12 @@ function findDiagramShapeIndex(shapes, nodes, nodeId) {
|
|
|
26529
26507
|
}
|
|
26530
26508
|
}
|
|
26531
26509
|
if (shapes.length === nodes.length) {
|
|
26532
|
-
const nodeIdx = nodes.findIndex((
|
|
26510
|
+
const nodeIdx = nodes.findIndex((n2) => n2.id === nodeId);
|
|
26533
26511
|
if (nodeIdx >= 0) {
|
|
26534
26512
|
return nodeIdx;
|
|
26535
26513
|
}
|
|
26536
26514
|
}
|
|
26537
|
-
const node = nodes.find((
|
|
26515
|
+
const node = nodes.find((n2) => n2.id === nodeId);
|
|
26538
26516
|
if (node?.text) {
|
|
26539
26517
|
const text2 = node.text.trim();
|
|
26540
26518
|
const matches = [];
|
|
@@ -26582,7 +26560,7 @@ function createOfficeGuid() {
|
|
|
26582
26560
|
// diagram/edit/node-ops.ts
|
|
26583
26561
|
var diagramModelId = (options) => (options?.createModelId ?? createOfficeGuid)();
|
|
26584
26562
|
function findDiagramRootParentId(nodes) {
|
|
26585
|
-
const nodeIds = new Set(nodes.map((
|
|
26563
|
+
const nodeIds = new Set(nodes.map((n2) => n2.id));
|
|
26586
26564
|
for (const node of nodes) {
|
|
26587
26565
|
if (node.parentId && !nodeIds.has(node.parentId)) {
|
|
26588
26566
|
return node.parentId;
|
|
@@ -26619,13 +26597,13 @@ function insertSibling(data, text2, siblingId, offset, options) {
|
|
|
26619
26597
|
const newId = diagramModelId(options);
|
|
26620
26598
|
let parentId;
|
|
26621
26599
|
if (siblingId) {
|
|
26622
|
-
const sibling = data.nodes.find((
|
|
26600
|
+
const sibling = data.nodes.find((n2) => n2.id === siblingId);
|
|
26623
26601
|
parentId = sibling?.parentId;
|
|
26624
26602
|
}
|
|
26625
26603
|
parentId ??= findDiagramRootParentId(data.nodes);
|
|
26626
26604
|
const newNode = { id: newId, text: text2, parentId };
|
|
26627
26605
|
const nodes = [...data.nodes];
|
|
26628
|
-
const siblingIndex = siblingId ? nodes.findIndex((
|
|
26606
|
+
const siblingIndex = siblingId ? nodes.findIndex((n2) => n2.id === siblingId) : -1;
|
|
26629
26607
|
if (siblingIndex >= 0) {
|
|
26630
26608
|
nodes.splice(siblingIndex + offset, 0, newNode);
|
|
26631
26609
|
} else {
|
|
@@ -26650,7 +26628,7 @@ function addDiagramNodeBelow(data, parentId, text2, options) {
|
|
|
26650
26628
|
return withEditedStructure(data, nodes, connections);
|
|
26651
26629
|
}
|
|
26652
26630
|
function addDiagramNodeAbove(data, nodeId, text2, options) {
|
|
26653
|
-
const target = data.nodes.find((
|
|
26631
|
+
const target = data.nodes.find((n2) => n2.id === nodeId);
|
|
26654
26632
|
if (!target) {
|
|
26655
26633
|
return data;
|
|
26656
26634
|
}
|
|
@@ -26677,13 +26655,13 @@ function addDiagramNodeAbove(data, nodeId, text2, options) {
|
|
|
26677
26655
|
return withEditedStructure(data, nodes, connections);
|
|
26678
26656
|
}
|
|
26679
26657
|
function removeDiagramNode(data, nodeId) {
|
|
26680
|
-
const removedNode = data.nodes.find((
|
|
26681
|
-
const childIds = data.nodes.filter((
|
|
26682
|
-
const nodes = data.nodes.filter((
|
|
26683
|
-
if (
|
|
26684
|
-
return { ...
|
|
26658
|
+
const removedNode = data.nodes.find((n2) => n2.id === nodeId);
|
|
26659
|
+
const childIds = data.nodes.filter((n2) => n2.parentId === nodeId).map((n2) => n2.id);
|
|
26660
|
+
const nodes = data.nodes.filter((n2) => n2.id !== nodeId).map((n2) => {
|
|
26661
|
+
if (n2.parentId === nodeId) {
|
|
26662
|
+
return { ...n2, parentId: removedNode?.parentId };
|
|
26685
26663
|
}
|
|
26686
|
-
return { ...
|
|
26664
|
+
return { ...n2 };
|
|
26687
26665
|
});
|
|
26688
26666
|
const connections = (data.connections ?? []).filter((c) => c.sourceId !== nodeId && c.destId !== nodeId).map((c) => ({ ...c }));
|
|
26689
26667
|
const grandParentId = removedNode?.parentId;
|
|
@@ -26695,7 +26673,7 @@ function removeDiagramNode(data, nodeId) {
|
|
|
26695
26673
|
return withEditedStructure(data, nodes, connections);
|
|
26696
26674
|
}
|
|
26697
26675
|
function setDiagramNodeText(data, nodeId, newText) {
|
|
26698
|
-
const nodes = data.nodes.map((
|
|
26676
|
+
const nodes = data.nodes.map((n2) => n2.id === nodeId ? { ...n2, text: newText } : n2);
|
|
26699
26677
|
return {
|
|
26700
26678
|
...data,
|
|
26701
26679
|
nodes,
|
|
@@ -26709,12 +26687,12 @@ function setDiagramNodeText(data, nodeId, newText) {
|
|
|
26709
26687
|
|
|
26710
26688
|
// diagram/edit/node-order.ts
|
|
26711
26689
|
function moveDiagramNode(data, nodeId, direction) {
|
|
26712
|
-
const node = data.nodes.find((
|
|
26690
|
+
const node = data.nodes.find((n2) => n2.id === nodeId);
|
|
26713
26691
|
if (!node) {
|
|
26714
26692
|
return data;
|
|
26715
26693
|
}
|
|
26716
|
-
const siblings = data.nodes.filter((
|
|
26717
|
-
const currentIndex = siblings.findIndex((
|
|
26694
|
+
const siblings = data.nodes.filter((n2) => n2.parentId === node.parentId);
|
|
26695
|
+
const currentIndex = siblings.findIndex((n2) => n2.id === nodeId);
|
|
26718
26696
|
const targetIndex = currentIndex + direction;
|
|
26719
26697
|
const current = siblings[currentIndex];
|
|
26720
26698
|
const target = siblings[targetIndex];
|
|
@@ -26722,8 +26700,8 @@ function moveDiagramNode(data, nodeId, direction) {
|
|
|
26722
26700
|
return data;
|
|
26723
26701
|
}
|
|
26724
26702
|
const nodes = [...data.nodes];
|
|
26725
|
-
const currentGlobalIndex = nodes.findIndex((
|
|
26726
|
-
const targetGlobalIndex = nodes.findIndex((
|
|
26703
|
+
const currentGlobalIndex = nodes.findIndex((n2) => n2.id === current.id);
|
|
26704
|
+
const targetGlobalIndex = nodes.findIndex((n2) => n2.id === target.id);
|
|
26727
26705
|
if (currentGlobalIndex >= 0 && targetGlobalIndex >= 0) {
|
|
26728
26706
|
nodes[currentGlobalIndex] = target;
|
|
26729
26707
|
nodes[targetGlobalIndex] = current;
|
|
@@ -26731,12 +26709,12 @@ function moveDiagramNode(data, nodeId, direction) {
|
|
|
26731
26709
|
return withEditedStructure(data, nodes);
|
|
26732
26710
|
}
|
|
26733
26711
|
function moveDiagramNodeToIndex(data, nodeId, newIndex) {
|
|
26734
|
-
const node = data.nodes.find((
|
|
26712
|
+
const node = data.nodes.find((n2) => n2.id === nodeId);
|
|
26735
26713
|
if (!node) {
|
|
26736
26714
|
return data;
|
|
26737
26715
|
}
|
|
26738
|
-
const siblings = data.nodes.filter((
|
|
26739
|
-
const currentIndex = siblings.findIndex((
|
|
26716
|
+
const siblings = data.nodes.filter((n2) => n2.parentId === node.parentId);
|
|
26717
|
+
const currentIndex = siblings.findIndex((n2) => n2.id === nodeId);
|
|
26740
26718
|
if (currentIndex < 0) {
|
|
26741
26719
|
return data;
|
|
26742
26720
|
}
|
|
@@ -26750,21 +26728,21 @@ function moveDiagramNodeToIndex(data, nodeId, newIndex) {
|
|
|
26750
26728
|
const siblingIds = new Set(siblings.map((s) => s.id));
|
|
26751
26729
|
const nodes = [];
|
|
26752
26730
|
let sibIdx = 0;
|
|
26753
|
-
for (const
|
|
26754
|
-
nodes.push(siblingIds.has(
|
|
26731
|
+
for (const n2 of data.nodes) {
|
|
26732
|
+
nodes.push(siblingIds.has(n2.id) ? reorderedSiblings[sibIdx++] ?? n2 : n2);
|
|
26755
26733
|
}
|
|
26756
26734
|
return withEditedStructure(data, nodes);
|
|
26757
26735
|
}
|
|
26758
26736
|
function promoteDiagramNode(data, nodeId) {
|
|
26759
|
-
const node = data.nodes.find((
|
|
26737
|
+
const node = data.nodes.find((n2) => n2.id === nodeId);
|
|
26760
26738
|
if (!node || !node.parentId) {
|
|
26761
26739
|
return data;
|
|
26762
26740
|
}
|
|
26763
|
-
const parent = data.nodes.find((
|
|
26741
|
+
const parent = data.nodes.find((n2) => n2.id === node.parentId);
|
|
26764
26742
|
if (!parent) {
|
|
26765
26743
|
return data;
|
|
26766
26744
|
}
|
|
26767
|
-
const nodes = data.nodes.map((
|
|
26745
|
+
const nodes = data.nodes.map((n2) => n2.id === nodeId ? { ...n2, parentId: parent.parentId } : n2);
|
|
26768
26746
|
const connections = (data.connections ?? []).filter((c) => !(c.sourceId === node.parentId && c.destId === nodeId)).map((c) => ({ ...c }));
|
|
26769
26747
|
if (parent.parentId) {
|
|
26770
26748
|
connections.push({
|
|
@@ -26778,18 +26756,18 @@ function promoteDiagramNode(data, nodeId) {
|
|
|
26778
26756
|
return withEditedStructure(data, nodes, connections);
|
|
26779
26757
|
}
|
|
26780
26758
|
function demoteDiagramNode(data, nodeId) {
|
|
26781
|
-
const node = data.nodes.find((
|
|
26759
|
+
const node = data.nodes.find((n2) => n2.id === nodeId);
|
|
26782
26760
|
if (!node) {
|
|
26783
26761
|
return data;
|
|
26784
26762
|
}
|
|
26785
|
-
const siblings = data.nodes.filter((
|
|
26786
|
-
const currentIndex = siblings.findIndex((
|
|
26763
|
+
const siblings = data.nodes.filter((n2) => n2.parentId === node.parentId);
|
|
26764
|
+
const currentIndex = siblings.findIndex((n2) => n2.id === nodeId);
|
|
26787
26765
|
const previous = currentIndex > 0 ? siblings[currentIndex - 1] : void 0;
|
|
26788
26766
|
if (!previous) {
|
|
26789
26767
|
return data;
|
|
26790
26768
|
}
|
|
26791
26769
|
const newParentId = previous.id;
|
|
26792
|
-
const nodes = data.nodes.map((
|
|
26770
|
+
const nodes = data.nodes.map((n2) => n2.id === nodeId ? { ...n2, parentId: newParentId } : n2);
|
|
26793
26771
|
const connections = (data.connections ?? []).filter((c) => !(c.sourceId === node.parentId && c.destId === nodeId)).map((c) => ({ ...c }));
|
|
26794
26772
|
connections.push({
|
|
26795
26773
|
sourceId: newParentId,
|
|
@@ -27313,7 +27291,7 @@ function resolveDiagramReflowCategory(layoutType) {
|
|
|
27313
27291
|
|
|
27314
27292
|
// diagram/edit/reflow.ts
|
|
27315
27293
|
function diagramContentNodes(nodes) {
|
|
27316
|
-
return nodes.filter((
|
|
27294
|
+
return nodes.filter((n2) => n2.text.length > 0);
|
|
27317
27295
|
}
|
|
27318
27296
|
function reflowDiagramLayout(data, bounds) {
|
|
27319
27297
|
const nodes = diagramContentNodes(data.nodes);
|
|
@@ -29506,7 +29484,7 @@ var IV = [
|
|
|
29506
29484
|
1541459225
|
|
29507
29485
|
];
|
|
29508
29486
|
var W = new Uint32Array(64);
|
|
29509
|
-
var rotr = (x,
|
|
29487
|
+
var rotr = (x, n2) => x >>> n2 | x << 32 - n2;
|
|
29510
29488
|
function compress(h, view, offset) {
|
|
29511
29489
|
for (let i = 0; i < 16; i++) W[i] = view.getUint32(offset + i * 4);
|
|
29512
29490
|
for (let i = 16; i < 64; i++) {
|
|
@@ -31393,7 +31371,7 @@ function parseCustomGeometry(custom, width, height) {
|
|
|
31393
31371
|
}
|
|
31394
31372
|
const pathWidth = path.hasAttribute("w") ? Number(path.getAttribute("w")) : contextWidth;
|
|
31395
31373
|
const pathHeight = path.hasAttribute("h") ? Number(path.getAttribute("h")) : contextHeight;
|
|
31396
|
-
if (![pathWidth, pathHeight].every((
|
|
31374
|
+
if (![pathWidth, pathHeight].every((n2) => Number.isFinite(n2) && n2 > 0)) return void 0;
|
|
31397
31375
|
paths.push({
|
|
31398
31376
|
commands,
|
|
31399
31377
|
width: pathWidth,
|
|
@@ -32245,7 +32223,7 @@ function lerpStops(a, b, t) {
|
|
|
32245
32223
|
opacity: oa + (ob - oa) * t
|
|
32246
32224
|
};
|
|
32247
32225
|
}
|
|
32248
|
-
function
|
|
32226
|
+
function gradientColorAt(stops, position) {
|
|
32249
32227
|
const first2 = stops[0];
|
|
32250
32228
|
const last = stops[stops.length - 1];
|
|
32251
32229
|
if (position <= first2.position) {
|
|
@@ -32307,7 +32285,7 @@ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options) {
|
|
|
32307
32285
|
if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
|
|
32308
32286
|
for (let i = bands; i >= 0; i -= 1) {
|
|
32309
32287
|
const t = i / bands;
|
|
32310
|
-
const { color, opacity } =
|
|
32288
|
+
const { color, opacity } = gradientColorAt(sorted, t * 100);
|
|
32311
32289
|
const left = lerpEdge(inner.left, 0, t);
|
|
32312
32290
|
const top = lerpEdge(inner.top, 0, t);
|
|
32313
32291
|
const right = lerpEdge(inner.right, 100, t);
|
|
@@ -32332,10 +32310,10 @@ function buildRectPathGradientExactSvg(stops, focalPoint, fillToRect) {
|
|
|
32332
32310
|
}
|
|
32333
32311
|
const sorted = [...stops].sort((a, b) => a.position - b.position);
|
|
32334
32312
|
const { left, top, right, bottom } = resolveInnerRect(fillToRect, focalPoint);
|
|
32335
|
-
const
|
|
32336
|
-
const alpha = (opacity, attr) => (opacity ?? 1) < 1 ? ` ${attr}="${
|
|
32313
|
+
const n2 = (value) => String(Math.round(value * 1e3) / 1e3);
|
|
32314
|
+
const alpha = (opacity, attr) => (opacity ?? 1) < 1 ? ` ${attr}="${n2(Math.max(0, opacity ?? 1))}"` : "";
|
|
32337
32315
|
const stopMarkup = sorted.map(
|
|
32338
|
-
(stop) => `<stop offset="${
|
|
32316
|
+
(stop) => `<stop offset="${n2(Math.min(Math.max(stop.position, 0), 100) / 100)}" stop-color="${stop.color}"${alpha(stop.opacity, "stop-opacity")}/>`
|
|
32339
32317
|
).join("");
|
|
32340
32318
|
const sides = [
|
|
32341
32319
|
{ id: "t", pts: [0, 0, 100, 0, right, top, left, top], v: [0, top, 0, 0], size: top },
|
|
@@ -32354,15 +32332,15 @@ function buildRectPathGradientExactSvg(stops, focalPoint, fillToRect) {
|
|
|
32354
32332
|
}
|
|
32355
32333
|
].filter((side) => side.size > 1e-3);
|
|
32356
32334
|
const defs = sides.map(
|
|
32357
|
-
(side) => `<linearGradient id="${side.id}" gradientUnits="userSpaceOnUse" x1="${
|
|
32335
|
+
(side) => `<linearGradient id="${side.id}" gradientUnits="userSpaceOnUse" x1="${n2(side.v[0])}" y1="${n2(side.v[1])}" x2="${n2(side.v[2])}" y2="${n2(side.v[3])}">${stopMarkup}</linearGradient>`
|
|
32358
32336
|
).join("");
|
|
32359
32337
|
const polygons = sides.map((side) => {
|
|
32360
|
-
const points = side.pts.map(
|
|
32338
|
+
const points = side.pts.map(n2);
|
|
32361
32339
|
const pairs = [0, 2, 4, 6].map((i) => `${points[i]},${points[i + 1]}`).join(" ");
|
|
32362
32340
|
return `<polygon points="${pairs}" fill="url(#${side.id})"/>`;
|
|
32363
32341
|
}).join("");
|
|
32364
32342
|
const first2 = sorted[0];
|
|
32365
|
-
const plateau = right - left > 1e-3 && bottom - top > 1e-3 ? `<rect x="${
|
|
32343
|
+
const plateau = right - left > 1e-3 && bottom - top > 1e-3 ? `<rect x="${n2(left)}" y="${n2(top)}" width="${n2(right - left)}" height="${n2(bottom - top)}" fill="${first2.color}"${alpha(first2.opacity, "fill-opacity")}/>` : "";
|
|
32366
32344
|
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none" shape-rendering="crispEdges"><defs>${defs}</defs>${polygons}${plateau}</svg>`;
|
|
32367
32345
|
}
|
|
32368
32346
|
function buildRectPathGradientImage(stops, focalPoint, fillToRect) {
|
|
@@ -32370,4 +32348,150 @@ function buildRectPathGradientImage(stops, focalPoint, fillToRect) {
|
|
|
32370
32348
|
return `url("data:image/svg+xml,${encodeURIComponent(markup).replace(/[()]/gu, (c) => c === "(" ? "%28" : "%29")}")`;
|
|
32371
32349
|
}
|
|
32372
32350
|
|
|
32373
|
-
|
|
32351
|
+
// drawingml/shape-path-gradient.ts
|
|
32352
|
+
var CIRCLE_FIELD_PRESETS = new Set(
|
|
32353
|
+
[
|
|
32354
|
+
"chevron",
|
|
32355
|
+
"rightArrow",
|
|
32356
|
+
"leftArrow",
|
|
32357
|
+
"upArrow",
|
|
32358
|
+
"downArrow",
|
|
32359
|
+
"stripedRightArrow",
|
|
32360
|
+
"notchedRightArrow",
|
|
32361
|
+
"bentUpArrow",
|
|
32362
|
+
"bentArrow",
|
|
32363
|
+
"uturnArrow",
|
|
32364
|
+
"leftRightArrow",
|
|
32365
|
+
"upDownArrow",
|
|
32366
|
+
"leftUpArrow",
|
|
32367
|
+
"leftRightUpArrow",
|
|
32368
|
+
"quadArrow",
|
|
32369
|
+
"curvedRightArrow",
|
|
32370
|
+
"curvedLeftArrow",
|
|
32371
|
+
"curvedUpArrow",
|
|
32372
|
+
"curvedDownArrow",
|
|
32373
|
+
"swooshArrow",
|
|
32374
|
+
"lightningBolt",
|
|
32375
|
+
"sun",
|
|
32376
|
+
"moon",
|
|
32377
|
+
"smileyFace",
|
|
32378
|
+
"ribbon",
|
|
32379
|
+
"ribbon2",
|
|
32380
|
+
"ellipseRibbon",
|
|
32381
|
+
"ellipseRibbon2",
|
|
32382
|
+
"leftRightRibbon",
|
|
32383
|
+
"verticalScroll",
|
|
32384
|
+
"horizontalScroll",
|
|
32385
|
+
"wave",
|
|
32386
|
+
"doubleWave",
|
|
32387
|
+
"flowChartDocument",
|
|
32388
|
+
"flowChartMultidocument",
|
|
32389
|
+
"flowChartPunchedTape",
|
|
32390
|
+
"flowChartMagneticDisk",
|
|
32391
|
+
"flowChartDisplay"
|
|
32392
|
+
].map((name) => name.toLowerCase())
|
|
32393
|
+
);
|
|
32394
|
+
var LEGACY_FIELD_PRESETS = new Set(
|
|
32395
|
+
[
|
|
32396
|
+
"donut",
|
|
32397
|
+
"noSmoking",
|
|
32398
|
+
"blockArc",
|
|
32399
|
+
"frame",
|
|
32400
|
+
"chord",
|
|
32401
|
+
"funnel",
|
|
32402
|
+
"mathDivide",
|
|
32403
|
+
"mathNotEqual",
|
|
32404
|
+
"cornerTabs",
|
|
32405
|
+
"squareTabs",
|
|
32406
|
+
"plaqueTabs",
|
|
32407
|
+
"circularArrow",
|
|
32408
|
+
"leftCircularArrow",
|
|
32409
|
+
"leftRightCircularArrow",
|
|
32410
|
+
"flowChartMagneticTape",
|
|
32411
|
+
"flowChartMagneticDrum"
|
|
32412
|
+
].map((name) => name.toLowerCase())
|
|
32413
|
+
);
|
|
32414
|
+
function shapePathGradientField(preset) {
|
|
32415
|
+
if (!preset || preset === "custom") return "circle";
|
|
32416
|
+
const key = preset.toLowerCase();
|
|
32417
|
+
if (CIRCLE_FIELD_PRESETS.has(key)) return "circle";
|
|
32418
|
+
if (LEGACY_FIELD_PRESETS.has(key)) return "legacy";
|
|
32419
|
+
return "outline";
|
|
32420
|
+
}
|
|
32421
|
+
var BAND_COUNT2 = 100;
|
|
32422
|
+
function n(value) {
|
|
32423
|
+
return String(Math.round(value * 1e3) / 1e3);
|
|
32424
|
+
}
|
|
32425
|
+
var ARG_COUNT = { M: 2, L: 2, Q: 4, C: 6, A: 7, Z: 0 };
|
|
32426
|
+
function scalePathAbout(d, s, fx, fy) {
|
|
32427
|
+
const tokens = d.match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gu);
|
|
32428
|
+
if (!tokens) return void 0;
|
|
32429
|
+
const out = [];
|
|
32430
|
+
let i = 0;
|
|
32431
|
+
while (i < tokens.length) {
|
|
32432
|
+
const command = tokens[i++];
|
|
32433
|
+
const count = ARG_COUNT[command];
|
|
32434
|
+
if (count === void 0) return void 0;
|
|
32435
|
+
out.push(command);
|
|
32436
|
+
if (command === "Z") continue;
|
|
32437
|
+
const args = tokens.slice(i, i + count).map(Number);
|
|
32438
|
+
i += count;
|
|
32439
|
+
if (args.length !== count || args.some((value) => !Number.isFinite(value))) return void 0;
|
|
32440
|
+
if (command === "A") {
|
|
32441
|
+
out.push(
|
|
32442
|
+
n(args[0] * s),
|
|
32443
|
+
n(args[1] * s),
|
|
32444
|
+
n(args[2]),
|
|
32445
|
+
n(args[3]),
|
|
32446
|
+
n(args[4]),
|
|
32447
|
+
n(fx + (args[5] - fx) * s),
|
|
32448
|
+
n(fy + (args[6] - fy) * s)
|
|
32449
|
+
);
|
|
32450
|
+
continue;
|
|
32451
|
+
}
|
|
32452
|
+
for (let k = 0; k < count; k += 2) {
|
|
32453
|
+
out.push(n(fx + (args[k] - fx) * s), n(fy + (args[k + 1] - fy) * s));
|
|
32454
|
+
}
|
|
32455
|
+
}
|
|
32456
|
+
return out.join(" ");
|
|
32457
|
+
}
|
|
32458
|
+
function closedSubpaths(d) {
|
|
32459
|
+
const parts = d.split(/(?=M)/u).map((part) => part.trim()).filter((part) => part.endsWith("Z"));
|
|
32460
|
+
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
32461
|
+
}
|
|
32462
|
+
function buildOutlinePathGradientSvg(stops, d, width, height, focusX, focusY) {
|
|
32463
|
+
if (stops.length === 0 || !(width > 0) || !(height > 0)) return void 0;
|
|
32464
|
+
if (scalePathAbout(d, 1, 0, 0) === void 0) return void 0;
|
|
32465
|
+
const sorted = [...stops].sort((a, b) => a.position - b.position);
|
|
32466
|
+
const fx = focusX * width;
|
|
32467
|
+
const fy = focusY * height;
|
|
32468
|
+
const translucent = sorted.some((stop) => (stop.opacity ?? 1) < 1);
|
|
32469
|
+
const body = [];
|
|
32470
|
+
if (translucent) {
|
|
32471
|
+
for (let i = BAND_COUNT2; i >= 1; i -= 1) {
|
|
32472
|
+
const outer = scalePathAbout(d, i / BAND_COUNT2, fx, fy);
|
|
32473
|
+
if (outer === void 0) return void 0;
|
|
32474
|
+
const inner = i > 1 ? scalePathAbout(d, (i - 1) / BAND_COUNT2, fx, fy) : void 0;
|
|
32475
|
+
const { color, opacity } = gradientColorAt(sorted, (i - 0.5) / BAND_COUNT2 * 100);
|
|
32476
|
+
const alpha = opacity < 1 ? ` fill-opacity="${n(Math.max(0, opacity))}"` : "";
|
|
32477
|
+
body.push(
|
|
32478
|
+
`<path d="${outer}${inner ? ` ${inner}` : ""}" fill="${color}"${alpha} fill-rule="evenodd"/>`
|
|
32479
|
+
);
|
|
32480
|
+
}
|
|
32481
|
+
return wrap(width, height, body.join(""));
|
|
32482
|
+
}
|
|
32483
|
+
body.push(`<defs><path id="p" d="${d}"/></defs>`);
|
|
32484
|
+
for (let i = BAND_COUNT2; i >= 1; i -= 1) {
|
|
32485
|
+
const s = i / BAND_COUNT2;
|
|
32486
|
+
const { color } = gradientColorAt(sorted, (i - 0.5) / BAND_COUNT2 * 100);
|
|
32487
|
+
body.push(
|
|
32488
|
+
`<use href="#p" transform="matrix(${n(s)} 0 0 ${n(s)} ${n(fx * (1 - s))} ${n(fy * (1 - s))})" fill="${color}"/>`
|
|
32489
|
+
);
|
|
32490
|
+
}
|
|
32491
|
+
return wrap(width, height, body.join(""));
|
|
32492
|
+
}
|
|
32493
|
+
function wrap(width, height, body) {
|
|
32494
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n(width)} ${n(height)}" preserveAspectRatio="none">${body}</svg>`;
|
|
32495
|
+
}
|
|
32496
|
+
|
|
32497
|
+
export { DEFAULT_GENERATED_DIAGRAM_SCHEME, DIAGRAM_ADD_SHAPE_COMMANDS, DIAGRAM_ADD_SHAPE_LABEL, DIAGRAM_COLOR_ENTRIES, DIAGRAM_COLOR_SECTIONS, DIAGRAM_CONTENT_TYPES, DIAGRAM_DATA_XMLNS, DIAGRAM_DESIGN_COMMANDS, DIAGRAM_DESIGN_GROUPS, DIAGRAM_INSERT_CATEGORIES, DIAGRAM_INSERT_PRESETS, DIAGRAM_NAMED_LAYOUT_CATEGORIES, DIAGRAM_PICTURE_SOURCE_NS, DIAGRAM_RELATIONSHIP_TYPES, DIAGRAM_STYLE_ENTRIES, DIAGRAM_UI_STRINGS, DIAGRAM_XML_PROLOG, EMPTY_CONSTRAINT_INDEX, ENGINE_FIRST_LAYOUT_IDS, FABRICATED_QUICKSTYLE_UNIQUE_ID, GENERATED_DIAGRAM_CACHE_NOTICE, GENERATED_DIAGRAM_CACHE_NS, OFFICE_GRADIENT_PRESETS, RECT_GRADIENT_DIRECTIONS, SMARTART_DESCENDANT_FONT_SCALE, SMARTART_LINE_SPACING_FACTOR, activeBranch, addDiagramNodeAbove, addDiagramNodeAfter, addDiagramNodeBefore, addDiagramNodeBelow, algorithmParameters, appendParentConnection, applyCustomLayoutOverrides, applyDiagramNodeEdit, applyDiagramPictureSources, applySmartArtRoleColors, approximateDiagramDrawingFromNodes, arrangeComposite2 as arrangeComposite, arrangeConn, arrangeCycle2 as arrangeCycle, arrangeHierarchy, arrangeLinear2 as arrangeLinear, arrangePyramid, arrangeSnake2 as arrangeSnake, arrangeSpacer, arrangeText, attributeReader, buildConstraintIndex, buildDiagramNodeGuidMap, buildDiagramPresentationGuidMap, buildFabricatedColorsXml, buildFabricatedQuickStyleXml, buildForest, buildGeneratedDiagramCache, buildOutlinePathGradientSvg, buildRectPathGradientExactSvg, buildRectPathGradientImage, buildRectPathGradientSvg, buildTree, captureDiagramPictures, chooseAlgType, chooseAlgorithm, chooseAlgorithmOfType, circleNode, clampByRules, closedSubpaths, collectFoldedDescendants, collectTransitionText, computeDiagramDrawingBounds, connectionLabel, constraintAttributes, createDiagramNodes, demoteDiagramNode, diagramAvLstXml, diagramColorLabelParams, diagramContentNodes, diagramDesignEdit, diagramDrawingFromViews, diagramLayoutData, diagramModelId, diagramNodeLevels, diagramNodeOutline, diagramNodesInTreeOrder, diagramParagraphsText, diagramPictureRelationships, diagramRelationshipsPart, diagramShapePropertiesXml, discoverArrangement, dispatchArrangement, drawingColorBrightness, drawingColorCss, drawingColorXml, drawingDashLength, drawingFillXml, drawingHas3d, escapeDiagramXml, evaluateWhen, fabricatedColorsCategory, fabricatedColorsUniqueId, fillElementOf, findConstraint, findDiagramRootParentId, findDiagramShapeIndex, firstDiagramParagraphRuns, fitWrappedFontSize, foldedDescendantTexts, foldedItemText, formatDiagramSource, formatXsdDouble, generatedDrawingDigest, gradientColorAt, groupedChildren, interpretSmartArtLayout, isDrawableDiagramShapeView, loadDiagram, markDiagramShapesStale, measureTextWidth, moveDiagramNode, moveDiagramNodeToIndex, nestedChooseBranch, neutralDiagramTextStyler, officeGradientPresetFill, officeGradientPresetId, orderedAttributes, orderedXmlView, parseConnectionAttributes, parseConstraintAttributes, parseCustomLayoutAttributes, parseDefinitionHeader, parseDiagramColors, parseDiagramDataModel, parseDiagramDrawing, parseDiagramLayoutSummary, parseDiagramQuickStyle, parseDrawingColor, parseDrawingColorIn, parseDrawingColorList, parseDrawingFill, parseDrawingGeometry, parseDrawingLine, parseDrawingTextBody, parseFrame, parseIteratorAttributes, parseLayoutDefinitionXml, parseOrderedWhen, parseRelationshipIdAttributes, parseRuleAttributes, parseStyleReferences, parseTransform, parseWhenAttributes, parseXsdDouble, patchDiagramShape, plainDiagramNodes, polygonNode, presetBoxNode, presetPolygonPoints, previewDiagramLayout, projectDiagramNodeText, projectDiagramNodeTextNeutral, promoteDiagramNode, ratioConstraint, readDiagramDrawingShapes, readDiagramNodeParagraphs, reconcileDiagramTextParagraphs, rectGradientDirection, rectGradientFocus, rectNode, reflowBending, reflowChevron, reflowCycle, reflowDiagramLayout, reflowFunnel, reflowGear, reflowMatrix, reflowPyramid, reflowRelationship, reflowTarget, reflowTimeline, reflowVenn, removeDiagramNode, resolveAxisCount, resolveAxisNodes, resolveConstraint, resolveDiagramDrawingPart, resolveDiagramDrawingShape, resolveDiagramDrawingStyles, resolveDiagramLayoutCategory, resolveDiagramReflowCategory, resolveDrawingColor, resolveDrawingOuterShadow, resolveDrawingShadow, resolveDrawingShadowXml, resolveFlowDirection, resolveFontTable, resolveHierarchyDispatchChAlign, resolveHierarchyDispatchLinDir, resolveHierarchyGenerationTemplates, resolveHierarchyItemFontSizePx, resolveHierarchyRootAlign, resolvePresentationOf, resolveRatioConstraint, resolveRoleFontSize, resolveSharedItemFontSize, resolveTieredItemFontSize, ruleAttributes, runEngineLayout, runSmartArtEngine, scalePathAbout, selectArrangedNodes, selectConstraints, setDiagramNodeStyle, setDiagramNodeText, setDrawingFillXml, shapePathGradientField, smartArtChildrenOf, structuralChooseAlgDepth, styleContext, svgDropShadowElement, tailedHierarchyDeclaresChAlign, textBodyParagraphs, themeColorResolver, topLevelSmartArtNodes, treeDepth, treeOrderDiagramNodes, treeWidth, tunnelsPastOwnCompositeSlot, validateSmartArtConstraintRules, validateSmartArtControlFlow, withDiagramDrawingRelationship, withDiagramPictureSources, withDiagramXmlProlog, withDrawingColorBrightness, withDrawingGradientGeometry, withEditedStructure, wrappedLineCount, wrappedWidestLineWidth, writeDiagramFormatDefinition, writeEditedDiagramData, writeFabricatedDiagramData, writeGeneratedDiagramDrawing, writeInsertedDiagramData };
|